Search Results

Search found 174 results on 7 pages for 'axel klein'.

Page 5/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • PHP Extended CHM Manual Gone?

    - by Alix Axel
    I'm sorry for maybe posting a question that may not be directly related to programming but where can I find an up to date version of the Extended PHP Manual (the one with the user comments) for download? The usual URL (http://www.php.net/docs-echm.php) seems to redirect to the (http://www.php.net/download-docs.php), was it discontinued?

    Read the article

  • Escaping escape Characters

    - by Alix Axel
    I'm trying to mimic the json_encode bitmask flags implemented in PHP 5.3.0, here is the string I have: $s = addslashes('O\'Rei"lly'); // O\'Rei\"lly Doing json_encode($str, JSON_HEX_APOS | JSON_HEX_QUOT) outputs the following: "O\\\u0027Rei\\\u0022lly" And I'm currently doing this in PHP versions older than 5.3.0: str_replace(array('\\"', "\\'"), array('\\u0022', '\\\u0027'), json_encode($s)) or str_replace(array('\\"', '\\\''), array('\\u0022', '\\\u0027'), json_encode($s)) Which correctly outputs the same result: "O\\\u0027Rei\\\u0022lly" I'm having trouble understanding why do I need to replace single quotes ('\\\'' or even "\\'" [surrounding quotes excluded]) with '\\\u0027' and not just '\\u0027'.

    Read the article

  • Mod rewrite with 3 parameters ?

    - by Axel
    Hello, I did tons of methods to figure out how to make this mod rewrite but i was completly unsuccessful. I want a .htaccess code that rewrite in the following method: http://www.mydomain.com/apple/upcoming/2 --- http://www.mydomain.com/handler.php?topic=apple&orderby=upcoming&page=2 This is easy to do, but the problem is that all parameters are not required so the link has different levels of parameters each time like this: http://www.mydomain.com/apple/popular/2 -- topic=apple&orderby=popular&page=2 http://www.mydomain.com/apple/2 -- topic=apple&orderby=&page=2 http://www.mydomain.com/all/popular/2 -- topic=all&orderby=popular&page=2 http://www.mydomain.com/apple/upcoming/ -- topic=apple&orderby=upcoming&page= So briefly, the url has 3 optional parameters in one static order: (topic) (orderby) (page) Note: the ORDERBY parameter can be "popular" or "upcoming" or nothing. Thanks

    Read the article

  • Get mime type of external file using cURL and php

    - by Axel
    I've used mime_content_type() and File info but i never successed. i want to use now cURL and get the headers of the file which is hosted on another domain then determine if the type is MP3 or not. ( i think the mime type of MP3 is audio/mpeg) Briefly, i know that but i don't know how to apply it :) Thanks

    Read the article

  • APC not working as expected?

    - by Alix Axel
    I've the following function: function Cache($key, $value = null, $ttl = 60) { if (isset($value) === true) { apc_store($key, $value, intval($ttl)); } return apc_fetch($key); } And I'm testing it using the following code: Cache('ktime', time(), 3); // Store sleep(1); var_dump(Cache('ktime') . '-' . time()); echo '<hr />'; // Should Fetch sleep(5); var_dump(Cache('ktime') . '-' . time()); echo '<hr />'; // Should NOT Fetch sleep(1); var_dump(Cache('ktime') . '-' . time()); echo '<hr />'; // Should NOT Fetch sleep(1); var_dump(Cache('ktime') . '-' . time()); echo '<hr />'; // Should NOT Fetch And this is the output: string(21) "1273966771-1273966772" string(21) "1273966771-1273966777" string(21) "1273966771-1273966778" string(21) "1273966771-1273966779" Shouldn't it look like this: string(21) "1273966771-1273966772" string(21) "-1273966777" string(21) "-1273966778" string(21) "-1273966779" I don't understand, can anyone help me figure out this strange behavior?

    Read the article

  • Drop shadow coordinate different from iPhone OS 3.2?

    - by Axel
    I'm trying to draw a custom view with a drop shadow. I'm having different results from iPhone OS 3.2. Has the coordinate system changed for CGContextSetShadowWithColor from 3.2? Here is the code I'm using: CGContextRef graphicContext = UIGraphicsGetCurrentContext(); CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB(); CGFloat values1[4] = { 0, 0, 0, 1}; CGColorRef blackColor = CGColorCreate (colorspace, values1); CGContextSetShadowWithColor(graphicContext, CGSizeMake(0, -1), 3, blackColor); CGColorRelease(blackColor); CGFloat values2[4] = { .5, .5, 1, 1}; CGColorRef fillColor = CGColorCreate (colorspace, values2); CGContextSetFillColorWithColor(graphicContext, fillColor); CGColorRelease(fillColor); CGContextFillRect(graphicContext,CGRectMake(40, 40, 100, 100)); Here is how it looks on 3.1 and from 3.2. All my views using drop shadow look different depending on the version of iPhone OS. Am I missing something?

    Read the article

  • Building Reducisaurus URLs

    - by Alix Axel
    I'm trying to use Reducisaurus Web Service to minify CSS and Javascript but I've run into a problem... Suppose I've two unminified CSS at: http:/domain.com/dynamic/styles/theme.php?color=red http:/domain.com/dynamic/styles/typography.php?font=Arial According to the docs I should call the web service like this: http:/reducisaurus.appspot.com/css?url=http:/domain.com/dynamic/styles/theme.php?color=red And if I want to minify both CSS files at once: http:/reducisaurus.appspot.com/css?url1=http:/domain.com/dynamic/styles/theme.php?color=red&url2=http:/domain.com/dynamic/styles/theme.php?color=red If I wanted to specify a different number of seconds for the cache (3600 for instance) I would use: http:/reducisaurus.appspot.com/css?url=http:/domain.com/dynamic/styles/theme.php?color=red&expire_urls=3600 And again for both CSS files at once: http:/reducisaurus.appspot.com/css?url1=http:/domain.com/dynamic/styles/theme.php?color=red&url2=http:/domain.com/dynamic/styles/theme.php?color=red&expire_urls=3600 Now my question is, how does Reducisaurus knows how to separate the URLs I want? How does it know that &expire_urls=3600 is not part of my URL? And how does it know that &url2=... is not a GET argument of url1? I'm I doing this right? Do I need to urlencode my URLs? I took a peek into the source code and although my Java is very poor it seems that the methods acquireFromRemoteUrl() and getSortedParameterNames() from the BaseServlet.java file hold the answers to my question - if a GET argument name contains - or _ they should be ignored?! What about multiple &url(n)s?

    Read the article

  • Transforming a string to a valid PDO_MYSQL DSN

    - by Alix Axel
    What is the most concise way to transform a string in the following format: mysql:[/[/]][user[:pass]@]host[:port]/db[/] Into a usuable PDO connection/instance (using the PDO_MYSQL DSN), some possible examples: $conn = new PDO('mysql:host=host;dbname=db'); $conn = new PDO('mysql:host=host;port=3307;dbname=db'); $conn = new PDO('mysql:host=host;port=3307;dbname=db', 'user'); $conn = new PDO('mysql:host=host;port=3307;dbname=db', 'user', 'pass'); I've been trying some regular expressions (preg_[match|split|replace]) but they either don't work or are too complex, my gut tells me this is not the way to go but nothing else comes to my mind. Any suggestions?

    Read the article

  • Regex to validate SMTP Responses?

    - by Alix Axel
    I'm writing a regular expression that can interactively validate SMTP responses codes, once the SMTP dialog is completed it should pass the following regex (some parentheses added for better readability): ^(220)(250){3,}(354)(250)(221)$ Or with(out) authentication: ^(220)(250)((334){2}(235))?(250){2,}(354)(250)(221)$ I'm trying to do rewrite the above regexes so that I can interactively check if the dialog is going as expected, otherwise politely send a QUIT command and close the connection saving bandwidth and time, but I'm having a hard time writing an optimal regex. So far I've managed to come up with: ^(220(250(334(235(250(354(250(221)?)?)?){0,})?){0,2})?)?$ Which, besides only matching authenticated connections, has some bugs... For instance, it matches: 220250334235250354250221 220250334334235250354250221 I've also tried the following modification: ^(220(250)?)?((334(235)?){2})?(250(354(250(221)?)?)?){0,}$ This one accepts non-authenticated responses but it fails to match 220250334 and wrongly matches 220250334334235250354250221 (at least 2 250 are needed before the 354 response code). Can someone help me out with this? Thanks in advance.

    Read the article

  • How to not write the full url in javascript ?

    - by Axel
    Hi, I did a Mod rewrite for my website so the URLs looks like this : http://www.mydomain.com/health/54856 http://www.mydomain.com/economy/strategy/911025/ http://www.mydomain.com/tags/obama/new So, the problem is that i make AJAX calls to a file here : http://www.mydomain.com/login.php And i don't want to write the FULL url or even use ../ trick because there isn't a fixed number of folders. So, what i want now, is something worked for my code to access the login.php from the root whatever the domain name is : $.ajax({ type: "POST", url: "http://www.mydomain.com/login.php" });

    Read the article

  • Problem with double quotes and Input

    - by Axel
    Hi, i have the following code : <input type="text" value="<?php echo $_GET['msg']; ?>"> This input is automatically filled with the name that is writen in the previous page. So, if the user wrote : i like "apples" and banana The input will be broken because it will close the tag after the double quotes. I know i can avoid that by html entiting the value, but i don't want this, is there another solution or is there an <<< EOD in html ? Thanks

    Read the article

  • PHP While() Stop Looping

    - by Axel
    Hi, i have a php loop which displays only one record even if there is hundreds. here is the code: <?php $result1 = mysql_query("SELECT * FROM posts") or die(mysql_error()); $numexem = mysql_num_rows($result1); $s="0"; while($s<$numexem){ $postid=mysql_result($result1,$s,"id"); echo "Post id:".$postid; $result2 = mysql_query("SELECT * FROM pics WHERE postid='$postid'") or die(mysql_error()); $rows = mysql_fetch_array($result2) or die(mysql_error()); $pnum = mysql_num_rows($result2); echo " There is ".$pnum." Attached Pictures"; $s++; } ?> I'm wondering if the loop stop because there is other SQL query inside it or what? and i don't think so. Thanks

    Read the article

  • Strip All Urls From A Mixed String ( php )

    - by Axel
    Hi, i reposted this question because i didn't find a good answer. i have a string which can contains text with urls. i want a function to strip all urls from this string and just let the text. by example the string can contains like this : 1) hey take a look here : http://xxx.xxx/545df5 this is nice! 2) hey take a look here : http://www.xxx.xxx/545df5 this is nice! 3) hey take a look here : xxx.xxx/545df5 this is nice! 4) hey take a look here : www.xxx.xxx/545df5 this is nice! Thanks

    Read the article

  • Sending BCC emails using a SMTP server?

    - by Alix Axel
    I've had this noted down on some of my code for a while: /** * Add a BCC. * * Note that according to the conventions of the SMTP protocol all * addresses, including BCC addresses, are included in every email as it * is sent over the Internet. The BCC addresses are stripped off blind * copy email only at the destination email server. * * @param string $email * @param string $name * @return object Email */ I don't remember where I got it from but that shouldn't be relevant to this question. Basically, whenever I try to send an email with BCCs via SMTP the BCC addresses are not hidden - I've read the whole RFC for the SMTP protocol (a couple years ago) and I don't think I'm missing anything. The strange thing is, if I send an email with BCCs using the built-in mail() function everything works just right and I've no idea why - I would like to roll my own email sender but I fail to understand this. Can someone please shed some light into this dark subject?

    Read the article

  • array_splice() - Numerical Offsets of Associative Arrays

    - by Alix Axel
    I'm trying to do something but I can't find any solution, I'm also having some trouble putting it into works so here is a sample code, maybe it'll be enough to demonstrate what I'm aiming for: $input = array ( 'who' => 'me', 'what' => 'car', 'more' => 'car', 'when' => 'today', ); Now, I want to use array_splice() to remove (and return) one element from the array: $spliced = key(array_splice($input, 2, 1)); // I'm only interested in the key... The above will remove and return 1 element (third argument) from $input (first argument), at offset 2 (second argument), so $spliced will hold the value more. I'll be iterating over $input with a foreach loop, I know the key to be spliced but the problem is I don't know its numerical offset and since array_splice only accepts integers I don't know what to do. A very dull example: $result = array(); foreach ($input as $key => $value) { if ($key == 'more') { // Remove the index "more" from $input and add it to $result. $result[] = key(array_splice($input, 2 /* How do I know its 2? */, 1)); } } I first though of using array_search() but it's pointless since it'll return the associative index.... How do I determine the numerical offset of a associative index?

    Read the article

  • Table Disobeys W3C Box Model, Ie8 Ignores Fixed Table Width !

    - by Axel Myers
    Hi, I'm having hard time with tables and column widths. Update: I'm using XHTML Strict 1.0. The page is: http://www.pro-turk.net/try The first problem I have is, I have a column with a fixed width of 100px and 4px padding, but it disobeys my padding depending on the value. The column width (as the distance between two borders according to W3C Box Model) is 156 px even if padding is 0 or 4. Only the position of the text changes. According to W3C Box Model ( available at www.pro-turk.net/box_model.png ), borders and paddings aren't included in WIDTH attribute, so why does it render wrongly ? The second problem is, when you look the page I gave with IE8, the first cell in the second row has 150px fixed width, but ie shows it about 50% of the total table width regardless of what i say.

    Read the article

  • List hits per hour from a MySQL table

    - by Axel
    I am trying to work out the hits per hour from a database. Data basically is stored as follows (with other columns) : Table Name: Hits ============================ VisitorIP TIMESTAMP ---------------------------- 15.215.65.65 123456789 I want to display total hits per hour (within the last 6 hours ) including the hours that has no hits. Example of the output: // Assuming now : 21:00 21:00 - 0 hits 20:00 - 1 hits 19:00 - 4 hits 18:00 - 0 hits 17:00 - 2 hits 16:00 - 3 hits i would love to get the data as array, Please note that the stored date is in UNIX time stamp format. and there may be some hours without any hits! Thanks

    Read the article

  • What's the best, Escape then store Or store then escape the output?

    - by Axel
    Hi, After doing a long search on stackoverflow i didn't find any one talked about this even if it's a big choice, the Question is what's the best in order to prevent both of XSS and SQL injection, Escaping the data then store it in the DB or Store it as it is and escape when output it? Note: it is better if you give some examples of practics if possible. Thanks

    Read the article

  • Get Instance ID of an Object in PHP

    - by Alix Axel
    I've learn a while ago on StackOverflow that we can get the "instance ID" of any resource, for instance: var_dump(intval(curl_init())); // int(2) var_dump(intval(finfo_open())); // int(3) var_dump(intval(curl_init())); // int(4) var_dump(intval(finfo_open())); // int(5) var_dump(intval(curl_init())); // int(6) I need something similar but applied to classes: var_dump(intval(new stdClass())); // int(1) var_dump(intval(new stdClass())); // int(1) var_dump(intval(new stdClass())); // int(1) var_dump(intval(new stdClass())); // int(1) var_dump(intval(new stdClass())); // int(1) I'm using stdClass just has an example here, but as you can see, it's not the output I was hoping for. I just did some more testing and I found that var_dump() can see the instance ID of an object: var_dump($a = new stdClass()); // object(stdClass)#1 (0) { } var_dump($b = new stdClass()); // object(stdClass)#2 (0) { } var_dump($c = new stdClass()); // object(stdClass)#3 (0) { } The same happens with resources of course: var_dump(curl_init()); // resource(2) of type (curl) var_dump(curl_init()); // resource(3) of type (curl) var_dump(curl_init()); // resource(4) of type (curl) Is there any way to achieve the same effect in PHP?

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >