Search found 266 matches

by spamyboy
Wed Jun 15, 2011 12:54 pm
Forum: Job Hunt
Topic: MySQL nested hierarchical data
Replies: 1
Views: 1624

MySQL nested hierarchical data

I need script to manage hierarchical data in MySQL database using nested set model. Simple PHP interface is required. The required functions: * display node tree as <ul> <li> structure (incl. numeric index, e.g. 1., 1.1., 1.2., 1.2.1., etc.) * create node (add child) * delete node (along with the su...
by spamyboy
Tue Mar 15, 2011 11:28 am
Forum: PHP - Code
Topic: Parsing information from TrueType font
Replies: 8
Views: 529

Re: Parsing information from TrueType font

There is this discussion on stackoverflow that might be of a help for someone to help me to solve this issue.

Code: Select all

http://stackoverflow.com/questions/5313474/otf-ttf-font-cmap-table/5313566#5313566
by spamyboy
Tue Mar 15, 2011 10:52 am
Forum: PHP - Code
Topic: Parsing information from TrueType font
Replies: 8
Views: 529

Re: Parsing information from TrueType font

Basically I need to generate Character/Glyph Map of all available characters in the font.
by spamyboy
Tue Mar 15, 2011 9:42 am
Forum: PHP - Code
Topic: Parsing information from TrueType font
Replies: 8
Views: 529

Re: Parsing information from TrueType font

I used the code that you have suggested. Now I am able to access the cmap , which is great. Now, how do I convert these characters to image generated with GD or whatever. object(SimpleXMLElement)#4 (3) { ["tableVersion"]=> object(SimpleXMLElement)#5 (1) { ["@attributes"]=> array(...
by spamyboy
Mon Mar 14, 2011 7:29 pm
Forum: PHP - Code
Topic: Parsing information from TrueType font
Replies: 8
Views: 529

Re: Parsing information from TrueType font

an I use it with PHP?
by spamyboy
Mon Mar 14, 2011 12:53 pm
Forum: PHP - Code
Topic: Parsing information from TrueType font
Replies: 8
Views: 529

Re: Parsing information from TrueType font

Could I possibly call freetype2 on linux system using PHP to get info about the font?
by spamyboy
Mon Mar 14, 2011 9:59 am
Forum: PHP - Code
Topic: Changing code passed on by url
Replies: 2
Views: 756

Re: Changing code passed on by url

There is no point asking questions that no one can understand. Try spending more time thinking how to formulate your question if you want to get an answer. Anyway, do you mean that every time you go from one page to the other, the URI parameters get appended and you and up with something like ?id=12...
by spamyboy
Mon Mar 14, 2011 9:56 am
Forum: PHP - Code
Topic: How to get weekly time e.g from thursday to thursday???
Replies: 1
Views: 667

Re: How to get weekly time e.g from thursday to thursday???

I think you want

Code: Select all

strtotime('+7 days', $now)
.
by spamyboy
Mon Mar 14, 2011 9:40 am
Forum: PHP - Code
Topic: Parsing information from TrueType font
Replies: 8
Views: 529

Parsing information from TrueType font

I have a question on stackoverflow about parsing data from TrueType font. Has anyone done that before? I need to extract as much as possible data, most importantly the cmap. Can anyone explain me how do I proceed from the point as described in the stackoverflow? http://stackoverflow.com/questions/52...
by spamyboy
Mon Jun 21, 2010 7:13 pm
Forum: PHP - Code
Topic: PHP GD: need to find out an alpha quantity
Replies: 1
Views: 132

Re: PHP GD: need to find out an alpha quantity

I made a progress. Here is what I have now. However, the quality is very low. Advices please. $im = imagecreatefrompng('public/images/bg-tmp.png'); $pixels = array(); for($y = 0; $y < 24; $y++) { for($x = 0; $x < 24; $x++) { $rgb = imagecolorat($im, $x, $y); $pixels[] = array($x, $y, calc_alpha_diff...
by spamyboy
Mon Jun 21, 2010 5:31 pm
Forum: PHP - Code
Topic: PHP GD: need to find out an alpha quantity
Replies: 1
Views: 132

PHP GD: need to find out an alpha quantity

Imagine this. I have a pixel of color (255,0,0) [red]. No someone painted on it with white color with * alpha. I know the background color, I know with what color it was painted over, I need to get the alpha of the painted over color. How? So far we have: $im = imagecreatefrompng('public/images/bg-t...
by spamyboy
Wed Jun 10, 2009 8:21 am
Forum: PHP - Code
Topic: filter_var and regex (pass Unicode characters only)
Replies: 5
Views: 394

Re: filter_var and regex (pass Unicode characters only)

Thank you, that helped me a lot.
by spamyboy
Wed Jun 10, 2009 7:54 am
Forum: PHP - Code
Topic: filter_var and regex (pass Unicode characters only)
Replies: 5
Views: 394

Re: filter_var and regex (pass Unicode characters only)

This still passes trough 'ABC??&*' as a valid string, though it contains '&*'.

Code: Select all

filter_var('ABC??&*', FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>"/\p{L}/u"))
by spamyboy
Wed Jun 10, 2009 6:12 am
Forum: PHP - Code
Topic: filter_var and regex (pass Unicode characters only)
Replies: 5
Views: 394

filter_var and regex (pass Unicode characters only)

I am trying to create input validation that would pass only characters and white-spaces. This is where I am. Though I can't use [a-zA-Z] because input also might be kiliric, Baltic alphabet (eg. ?????Š??Ž, etc) or Asian etc. Any ideas? var_dump(filter_var('ABC???', FILTER_VALIDATE_REGEXP, array(&quo...
by spamyboy
Sat May 30, 2009 4:20 am
Forum: PHP - Code
Topic: solved. Error while trying to Extend PDO
Replies: 1
Views: 426

Re: Error while trying to Extend PDO

I have understood my last mistake, but now I have stucked on something else.   /**  * Extends PDO and logs all queries that are executed and how long  * they take, including queries issued via prepared statements  */ class ExtendedPDO extends PDO {         # logged queries with their execution time ...