Search Results

Search found 151 results on 7 pages for 'axel costas pena'.

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

  • fsutil hardlink doesn't work?

    - by Alix Axel
    I was looking for a way to create hard links under Windows and I found this page: http://technet.microsoft.com/en-us/library/cc788097.aspx To try it out, I created a file (1.txt) on the root of my C: drive with 100 lines of the following content: C:\1.txt (2.598 bytes): test test test test test Then I open the command prompt and type: fsutil hardlink create C:\2.txt C:\1.txt Success, 2.txt was created but when I go to see it's size it has exactly 2.598 bytes and also noticed some strange behaviours (as far as my understanding of hard links goes): If I delete 2.txt (the hard linked file) 1.txt is not deleted, and vice-versa. If I open 2.txt after I delete 1.txt (the original file) the content is still the same. How does the fsutil hardlink create command differs from the copy command? And how can I create a true hard link under Windows? I'm using Windows XP SP 3, and my file system is NTFS.

    Read the article

  • Mapping Absolute / Relative (Local) Paths to Absolute URLs

    - by Alix Axel
    I need a fast and reliable way to map an absolute or relative local path (say ./images/Mafalda.jpg) to it's corresponding absolute URL, so far I've managed to come up with this: function Path($path) { if (file_exists($path) === true) { return rtrim(str_replace('\\', '/', realpath($path)), '/') . (is_dir($path) ? '/' : ''); } return false; } function URL($path) { $path = Path($path); if ($path !== false) { return str_replace($_SERVER['DOCUMENT_ROOT'], getservbyport($_SERVER['SERVER_PORT'], 'tcp') . '://' . $_SERVER['HTTP_HOST'], $path); } return false; } URL('./images/Mafalda.jpg'); // http://domain.com/images/Mafalda.jpg Seems to be working as expected, but since this is a critical feature to my app I want to ask if anyone can spot any problem that I might have missed and optimizations are also welcome since I'm going to use this function several times per each request.

    Read the article

  • Valid Charset for CSS

    - by Alix Axel
    Quick question: what is the (full) valid / allowed charset for id and class CSS identifiers? Is there a regular expression that I can use to validate against? Is it browser agnostic?

    Read the article

  • Quick question about PayPal IPN Security

    - by Alix Axel
    PayPal IPN sends a POST request with a variable number of fields to the notify URL, in order to confirm that the POST request is legit we need to resubmit the same request along with a additional cmd=_notify-validate field to PayPal, which then replies SUCCESS or FAILURE. My question is, why do we need to resend the request to PayPal? Wouldn't something like this work? if (preg_match('~^(?:.+[.])?paypal[.]com$~i', gethostbyaddr($_SERVER['REQUEST_ADDR'])) > 0) { // request came from PayPal, it's legit. } Iff we can trust the server to correctly resolve IPs, I assume we can trust PayPal POST requests, no?

    Read the article

  • Software to Mind Map Dependencies

    - by Alix Axel
    I'm putting together something I'll soon release as OSS and I wanted to make a map of dependencies to get a clearer idea of the big picture. I ended up making the mind map myself using pen and paper: This is something I wish I could do more often, but mapping bigger projects manually is too troublesome (and virtually impossible due to the size of the sheet) and since I can't find any mind mapping software that fits my needs and allows me to display the map in the visual structure I want I often leave the mind maps in my mind alone, no visual representation whatsoever... Can anyone suggest a good mind mapping software that allows me to do something like the above? I've tried FreeMind and XMind so far but their visual structure is too rigid for what I need.

    Read the article

  • XHTML Column Padding Bug

    - by Axel Myers
    Try setting the padding of <td> to more than 1px, you can't. You can only specify 0 or 1px padding for this td. But why ? It's same in both transitional and strict document types. http://www.pro-turk.net/xhtml_col.html

    Read the article

  • PHP filter_var() - FILTER_VALIDATE_URL

    - by Alix Axel
    The FILTER_VALIDATE_URL filter seems to have some trouble validating non-ASCII URLs: var_dump(filter_var('http://pt.wikipedia.org/wiki/', FILTER_VALIDATE_URL)); // http://pt.wikipedia.org/wiki/ var_dump(filter_var('http://pt.wikipedia.org/wiki/Guimarães', FILTER_VALIDATE_URL)); // false Why isn't the last URL correctly validated? And what are the possible workarounds? Running PHP 5.3.0. I'd also like to know where I can find the source code of the FILTER_VALIDATE_URL validation filter.

    Read the article

  • XHtml Strict, Float: Center ?

    - by Axel Myers
    Hi everyone. I'm having hard time with Xhtml Strict 1.0 and Css. And I'm almost out of solutions. My Site Url: http://www.pro-turk.net/beta/ I made a jquery multilevel dropdown menu for my site. It looks like OK, but I have used inline-block property of css display attribute on navigation menu which is a part of css 2.1 and isn't supported by some browsers (including ie6 and ie7). I want to make #nav li elements block level elements, but to do this and having all of them in same line, the only way is using float in #nav li. But I want to center them in their parent (the menu bar). So I need something like float:center (I know it's pretty stupid and doesn't exist). But is there a way to include block level elements as children elements without linebreaks (I mean without making a block level element). Regards.

    Read the article

  • Merging two Regular Expressions to Truncate Words in Strings

    - by Alix Axel
    I'm trying to come up with the following function that truncates string to whole words (if possible, otherwise it should truncate to chars): function Text_Truncate($string, $limit, $more = '...') { $string = trim(html_entity_decode($string, ENT_QUOTES, 'UTF-8')); if (strlen(utf8_decode($string)) > $limit) { $string = preg_replace('~^(.{1,' . intval($limit) . '})(?:\s.*|$)~su', '$1', $string); if (strlen(utf8_decode($string)) > $limit) { $string = preg_replace('~^(.{' . intval($limit) . '}).*~su', '$1', $string); } $string .= $more; } return trim(htmlentities($string, ENT_QUOTES, 'UTF-8', true)); } Here are some tests: // Iñtërnâtiônàlizætiøn and then the quick brown fox... (49 + 3 chars) echo dyd_Text_Truncate('Iñtërnâtiônàlizætiøn and then the quick brown fox jumped overly the lazy dog and one day the lazy dog humped the poor fox down until she died.', 50, '...'); // Iñtërnâtiônàlizætiøn_and_then_the_quick_brown_fox_... (50 + 3 chars) echo dyd_Text_Truncate('Iñtërnâtiônàlizætiøn_and_then_the_quick_brown_fox_jumped_overly_the_lazy_dog and one day the lazy dog humped the poor fox down until she died.', 50, '...'); They both work as it is, however if I drop the second preg_replace() I get the following: Iñtërnâtiônàlizætiøn_and_then_the_quick_brown_fox_jumped_overly_the_lazy_dog and one day the lazy dog humped the poor fox down until she died.... I can't use substr() because it only works on byte level and I don't have access to mb_substr() ATM, I've made several attempts to join the second regex with the first one but without success. Please help S.M.S., I've been struggling with this for almost an hour. EDIT: I'm sorry, I've been awake for 40 hours and I shamelessly missed this: $string = preg_replace('~^(.{1,' . intval($limit) . '})(?:\s.*|$)?~su', '$1', $string); Still, if someone has a more optimized regex (or one that ignores the trailing space) please share: "Iñtërnâtiônàlizætiøn and then " "Iñtërnâtiônàlizætiøn_and_then_" EDIT 2: I still can't get rid of the trailing whitespace, can someone help me out?

    Read the article

  • How does Google Wave & iGoogle prevent XSS by a widget?

    - by Axel
    Hello, If you've used Google Wave or iGoogle you have probably seen that you can insert widgets that are made by third parties without approval. My question is: How does prevent the widge from performing XSS or steak cookies? Are the widgets loaded in an <iframe>? If yes, then what prevents them from redirecting you to another page? Thanks

    Read the article

  • jQuery code to delete all spans with same content but keep one

    - by Axel
    Hello, Say i have the following html: <span class="fruit">Apple</span> <span class="fruit">banana</span> <span class="fruit">Apple</span> <span class="fruit">Apple</span> <span class="fruit">orange</span> I tried different methods but it didn't work, I want a jQuery code to remove all (.fruit) spans with same content but keep one (the first if possible), so i will end up with the following: <span class="fruit">Apple</span> <span class="fruit">banana</span> <span class="fruit">orange</span> Thank you

    Read the article

  • 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

  • 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

  • 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

  • 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

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