Search Results

Search found 6 results on 1 pages for 'nedark'.

Page 1/1 | 1 

  • Strange behavior: Dynamic expressions with RegExp Object in RegExp.match (Javascript)

    - by NeDark
    I have detect a strange behavior in regexps created with the RegExp object: With this code: var exp1 = /./; var exp2 = new RegExp('.'); ? var test1 = exp1.test('large\n\ntext..etc.'); var test2 = exp2.test('large\n\ntext..etc.'); ? var match1 = 'large\n\ntext..etc.'.match(exp1); var match2 = 'large\n\ntext..etc.'.match(exp2); ...the result is: test1 = true test2 = true ? match1 = 'l' (first match) match2 = null With the regexp maked with the regexp object from a string it finds nothing... Why does this happends? Thanks!!

    Read the article

  • Set a color as transparent in palette-based image

    - by NeDark
    Hello there! I want to convert a alpha transparent png image to palette based png image. In GD I can do it easy: // We have already the image loaded in $source_img $w=200; $h=200; // We supose that img dimensions are 200x200 $img = imagecreatetruecolor($w, $h); // New black image list($r, $g, $b) = array(200, 200, 200); // Some color that doesn't appear in image to avoid conflict $color = imagecolorallocate($img, $r, $g, $b); imagefill($img, 0, 0, $color); // Fill the black image with the chosen color. imagecolortransparent($img, $color); // Set the chosen color as transparent $res = imagecopyresampled($img, $source_img, 0, 0, 0, 0, $w, $h, $w, $h); But in Imagick I don't know how set a color as transparent (imagecolortransparent() in GD). I have spent hours searching on the internet, but the help in the php site isn't very comphrensive and there are many undocumented functions. Thanks.

    Read the article

  • How to use SOCI C++ Database library?

    - by NeDark
    I'm trying to implement soci in my program but I don't know how. I'm using C++ on linux, on a project on netbeans. I have followed the steps in http://soci.sourceforge.net/doc/structure.html to install it, and I tried to copy the files soci.h from /src/core and soci-mysql.h from /src/backends/mysql in my proyect but it gives compilation error (these files include other soci files, but it's illogical to copy all files into the directory...). I have read the guide several time but I don't understand what I'm doing wrong, the examples only include these files. Thanks. Edit: I have given more information in a comment below the answer. I don't know what steps I have to do to implement soci.

    Read the article

1