<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Disqus - Latest Comments for troelskn</title><link>http://disqus.com/by/troelskn/</link><description></description><atom:link href="http://disqus.com/troelskn/comments.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 01 Aug 2011 10:20:36 -0000</lastBuildDate><item><title>Re: In one sentence explain closures</title><link>http://1sentence.com/closures/#comment-272845609</link><description>&lt;p&gt;A closure is to objects what functions are to classes.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Mon, 01 Aug 2011 10:20:36 -0000</pubDate></item><item><title>Re: Use Webkit and Imagemagick to Create Cross-browser Buttons and Other Swag</title><link>http://www.sitepoint.com/use-webkit-and-imagemagick-to-create-cross-browser-buttons/#comment-1146903385</link><description>&lt;p&gt;There was a typo in the final css example, that I have fixed now. Does this help?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Thu, 06 Jan 2011 10:28:41 -0000</pubDate></item><item><title>Re: Use Webkit and Imagemagick to Create Cross-browser Buttons and Other Swag</title><link>http://www.sitepoint.com/use-webkit-and-imagemagick-to-create-cross-browser-buttons/#comment-220068692</link><description>&lt;p&gt;There was a typo in the final css example, that I have fixed now. Does this help?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Thu, 06 Jan 2011 05:28:41 -0000</pubDate></item><item><title>Re: Use Webkit and Imagemagick to Create Cross-browser Buttons and Other Swag</title><link>http://www.sitepoint.com/use-webkit-and-imagemagick-to-create-cross-browser-buttons/#comment-1146903377</link><description>&lt;p&gt;Hadn't seen CSS3 PIE - Thanks for that. I'd say that the approach is a bit different, with different pros and cons. By rendering your buttons as sprites, not only do you ensure that it works in all browsers (not just IE is weird, you know), but in my experience behaviors has an unfortunate tendency to crash IE.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Mon, 03 Jan 2011 21:31:35 -0000</pubDate></item><item><title>Re: Use Webkit and Imagemagick to Create Cross-browser Buttons and Other Swag</title><link>http://www.sitepoint.com/use-webkit-and-imagemagick-to-create-cross-browser-buttons/#comment-220068667</link><description>&lt;p&gt;Hadn't seen CSS3 PIE - Thanks for that. I'd say that the approach is a bit different, with different pros and cons. By rendering your buttons as sprites, not only do you ensure that it works in all browsers (not just IE is weird, you know), but in my experience behaviors has an unfortunate tendency to crash IE.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Mon, 03 Jan 2011 16:31:35 -0000</pubDate></item><item><title>Re: Freepik: The Search Engine for Free Photos and Vectors</title><link>http://www.sitepoint.com/freepik-the-search-engine-for-free-photos-and-vectors/#comment-1146905635</link><description>&lt;p&gt;In case you wonder why OpenDNS blocks your access to this site, "pik" is vulgar slang for the male genitalia in Danish.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Wed, 03 Nov 2010 14:49:44 -0000</pubDate></item><item><title>Re: Freepik: The Search Engine for Free Photos and Vectors</title><link>http://www.sitepoint.com/freepik-the-search-engine-for-free-photos-and-vectors/#comment-220065845</link><description>&lt;p&gt;In case you wonder why OpenDNS blocks your access to this site, "pik" is vulgar slang for the male genitalia in Danish.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Wed, 03 Nov 2010 10:49:44 -0000</pubDate></item><item><title>Re: How to Override PHP Configuration Options</title><link>http://www.sitepoint.com/how-to-override-php-configuration-settings/#comment-1146894248</link><description>&lt;p&gt;You should note &lt;code&gt;php_admin_value&lt;/code&gt; and &lt;code&gt;php_admin_flag&lt;/code&gt;, which acts like &lt;code&gt;php_value&lt;/code&gt; and &lt;code&gt;php_flag&lt;/code&gt;, except that they can't be overridden later on. If an ini setting is set with these in the main Apache config file, it can lead to some head-scratching.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Thu, 04 Mar 2010 10:52:38 -0000</pubDate></item><item><title>Re: How to Override PHP Configuration Options</title><link>http://www.sitepoint.com/how-to-override-php-configuration-settings/#comment-220052471</link><description>&lt;p&gt;You should note &lt;code&gt;php_admin_value&lt;/code&gt; and &lt;code&gt;php_admin_flag&lt;/code&gt;, which acts like &lt;code&gt;php_value&lt;/code&gt; and &lt;code&gt;php_flag&lt;/code&gt;, except that they can't be overridden later on. If an ini setting is set with these in the main Apache config file, it can lead to some head-scratching.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Thu, 04 Mar 2010 05:52:38 -0000</pubDate></item><item><title>Re: Introducing pearhub</title><link>http://www.sitepoint.com/introducing-pearhub/#comment-1146888763</link><description>&lt;p&gt;Thanks for the positive responses.&lt;/p&gt;&lt;p&gt;As for mecurial support, you can go vote for it (Click the feedback tab on the site's left side). If you can tell me how I can list the tags of a remote hg repository, I don't think there's much work in adding it?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Sun, 10 Jan 2010 23:59:11 -0000</pubDate></item><item><title>Re: Introducing pearhub</title><link>http://www.sitepoint.com/introducing-pearhub/#comment-220050508</link><description>&lt;p&gt;Thanks for the positive responses.&lt;/p&gt;&lt;p&gt;As for mecurial support, you can go vote for it (Click the feedback tab on the site's left side). If you can tell me how I can list the tags of a remote hg repository, I don't think there's much work in adding it?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Sun, 10 Jan 2010 18:59:11 -0000</pubDate></item><item><title>Re: Pake: PHP project build system</title><link>http://blog.milkfarmsoft.com/2009/08/pake-php5-project-build-system/#comment-13933154</link><description>&lt;p&gt;Thanks Duane. I was not aware of that effort.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Tue, 04 Aug 2009 17:24:46 -0000</pubDate></item><item><title>Re: Pake: PHP project build system</title><link>http://blog.milkfarmsoft.com/2009/08/pake-php5-project-build-system/#comment-13886582</link><description>&lt;p&gt;Good to see someone picking Pake up. I have been thinking about doing the same thing. One problem with Pake is that it got absorbed into Symfony, which means that it never grew any further. In part, I think that is intentional from Fabien, since it is one of the things that makes Symfony stand out amongst other frameworks. It's a pity though; PHP could do well with a standard tool for this, rather than something that is tied to each individual framework.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Tue, 04 Aug 2009 13:01:03 -0000</pubDate></item><item><title>Re: Installing PHP 5.3 On Ubuntu</title><link>http://www.brandonsavage.net/installing-php-5-3-on-ubuntu/#comment-457602805</link><description>&lt;p&gt;Thanks - I fought with this for half a day, before I found your post. Very helpful.&lt;/p&gt;&lt;p&gt;If you want to use your old (package managed) ini files, you can use the following options:&lt;/p&gt;&lt;p&gt;    --with-config-file-path=/etc/php5/apache2 --with-config-file-scan-dir=/etc/php5/apache2/conf.d&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Sun, 19 Jul 2009 00:28:03 -0000</pubDate></item><item><title>Re: Fun with none</title><link>http://uswaretech.com/blog/2009/07/fun-with-none/#comment-16047646</link><description>&lt;p&gt;@rohit: Use var_dump. Like this: &lt;a href="http://gist.github.com/148380" rel="nofollow noopener" target="_blank" title="http://gist.github.com/148380"&gt;http://gist.github.com/148380&lt;/a&gt;&lt;br&gt;When you echo, the value gets coerced to a string.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Thu, 16 Jul 2009 08:06:58 -0000</pubDate></item><item><title>Re: Fun with none</title><link>http://uswaretech.com/blog/2009/07/fun-with-none/#comment-16047643</link><description>&lt;p&gt;You also have the php table wrong. It should be:&lt;/p&gt;&lt;p&gt;    FALSE, TRUE, TRUE, TRUE ,FALSE&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Thu, 16 Jul 2009 07:14:51 -0000</pubDate></item><item><title>Re: A Note on Google&amp;#8217;s So-called Best Practices</title><link>http://www.sitepoint.com/a-note-on-googles-so-called-best-practises/#comment-1146872196</link><description>&lt;blockquote&gt;The poor author of that article has been slammed so unreasonably by blogs like sitepoints. In fact, I find most of the bloggers look more stupid than the author of the article.&lt;br&gt;It irritates me to see how much this guy’s being bashed unnecessarily.&lt;br&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;When someone writes on behalf of Google, he must be prepared to be scrutinised more thoroughly. I have no personal beef with the author (in fact, I don't even know who he is), and I didn't try to make this any kind of attack on his person. I don't see how it could be interpreted as such either. The problem is that this is an educative programme, and people &lt;em&gt;are&lt;/em&gt; going to take information from Google as being true. Therefore they must meet higher standards than most everybody else.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;It seems that the biggest ‘controversy’ is around the following points, which I’ll clarify on behalf of the author of that article (someone has to) ...&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;My biggest problem with this article is not about the individual tips being true or not (Though they are in fact wrong), but rather that focusing on micro-optimisations sends the wrong signal to would-be programmers. The choice between using a switch or an if-statement should &lt;em&gt;not&lt;/em&gt; be made on the grounds of performance. That is worst-practise, not best.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Fri, 26 Jun 2009 15:53:36 -0000</pubDate></item><item><title>Re: A Note on Google&amp;#8217;s So-called Best Practices</title><link>http://www.sitepoint.com/a-note-on-googles-so-called-best-practises/#comment-220039683</link><description>&lt;blockquote&gt;The poor author of that article has been slammed so unreasonably by blogs like sitepoints. In fact, I find most of the bloggers look more stupid than the author of the article.&lt;br&gt;It irritates me to see how much this guy’s being bashed unnecessarily.&lt;br&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;When someone writes on behalf of Google, he must be prepared to be scrutinised more thoroughly. I have no personal beef with the author (in fact, I don't even know who he is), and I didn't try to make this any kind of attack on his person. I don't see how it could be interpreted as such either. The problem is that this is an educative programme, and people &lt;em&gt;are&lt;/em&gt; going to take information from Google as being true. Therefore they must meet higher standards than most everybody else.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;It seems that the biggest ‘controversy’ is around the following points, which I’ll clarify on behalf of the author of that article (someone has to) ...&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;My biggest problem with this article is not about the individual tips being true or not (Though they are in fact wrong), but rather that focusing on micro-optimisations sends the wrong signal to would-be programmers. The choice between using a switch or an if-statement should &lt;em&gt;not&lt;/em&gt; be made on the grounds of performance. That is worst-practise, not best.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Fri, 26 Jun 2009 11:53:36 -0000</pubDate></item><item><title>Re: A Note on Google&amp;#8217;s So-called Best Practices</title><link>http://www.sitepoint.com/a-note-on-googles-so-called-best-practises/#comment-1146872185</link><description>&lt;blockquote&gt;The refute talks about a double-quoted string versus concatenation of several single-quoted strings. Google’s point talkes about single-quoted strings in both cases. However, this point is moot if using an op-code cache (doesn’t everybody?) as an invariant double quoted string results in the same representation as a single-quoted string.&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;I'd say it's moot in any case. Unless you have a very atypical application, the performance that can be gained by replacing double quotes with single quotes is a drop in the ocean (And have you seen the ocean? It's really big, I tell you). Even if it &lt;em&gt;doesn't&lt;/em&gt; make your code less readable, it's still time you've spent on nothing.&lt;/p&gt;&lt;p&gt;Recently, I've been trying to use the different quoting styles to denote the intention of a string. If it's a string constant (Such as a named index in an array), I'll use single quotes, if it's literal text, I'll use double quotes.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;It might make sense to concatenate the queries into a single string and then execute, but isn’t that what prepared statements are for? If performance is that big of an issue, just make sure your target environment has a DB with mysqli or PDO or something.&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;MySql generally doesn't allow you to execute multiple queries in one call and that's probably a good thing (From a security perspective). However, multiple select queries can often be rewritten to a join.&lt;/p&gt;&lt;p&gt;Prepared statements doesn't save you from making additional calls to the database, but they do save the database server from re-parsing the query, and they also make the actual data transfer slightly smaller. Since a database is usually on a different machine, this means that even with prepared queries, a database call is still a very expensive operation and as such, you should generally try to minimise them.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Fri, 26 Jun 2009 08:54:51 -0000</pubDate></item><item><title>Re: A Note on Google&amp;#8217;s So-called Best Practices</title><link>http://www.sitepoint.com/a-note-on-googles-so-called-best-practises/#comment-220039664</link><description>&lt;blockquote&gt;The refute talks about a double-quoted string versus concatenation of several single-quoted strings. Google’s point talkes about single-quoted strings in both cases. However, this point is moot if using an op-code cache (doesn’t everybody?) as an invariant double quoted string results in the same representation as a single-quoted string.&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;I'd say it's moot in any case. Unless you have a very atypical application, the performance that can be gained by replacing double quotes with single quotes is a drop in the ocean (And have you seen the ocean? It's really big, I tell you). Even if it &lt;em&gt;doesn't&lt;/em&gt; make your code less readable, it's still time you've spent on nothing.&lt;/p&gt;&lt;p&gt;Recently, I've been trying to use the different quoting styles to denote the intention of a string. If it's a string constant (Such as a named index in an array), I'll use single quotes, if it's literal text, I'll use double quotes.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;It might make sense to concatenate the queries into a single string and then execute, but isn’t that what prepared statements are for? If performance is that big of an issue, just make sure your target environment has a DB with mysqli or PDO or something.&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;MySql generally doesn't allow you to execute multiple queries in one call and that's probably a good thing (From a security perspective). However, multiple select queries can often be rewritten to a join.&lt;/p&gt;&lt;p&gt;Prepared statements doesn't save you from making additional calls to the database, but they do save the database server from re-parsing the query, and they also make the actual data transfer slightly smaller. Since a database is usually on a different machine, this means that even with prepared queries, a database call is still a very expensive operation and as such, you should generally try to minimise them.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Fri, 26 Jun 2009 04:54:51 -0000</pubDate></item><item><title>Re: Introducing Bucket: A Minimal Dependency Injection Container for PHP</title><link>http://www.sitepoint.com/bucket-is-a-minimal-dependency-injection-container-for-php/#comment-1146869422</link><description>&lt;p&gt;Honestly, I didn't take any offence from the first comment by Joshua. The web is full of libraries and frameworks and so it's hard to be an expert in all of them before making a choice. I might have been too quick to write off &lt;code&gt;sfServiceContainer&lt;/code&gt;; I'll definitely take a second look.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;If there’s something that’s a "real" product, under active development that people can use, it’d be worth mentioning in the tutorial itself - that way people won’t be stuck with Bucket&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;I think it's feature complete - There's nothing more to add to it. That doesn't mean that you're stuck in any way, since you can add whatever complicated factory you want on the backend. In the slightly larger perspective, DI-containers have the very fortunate attribute to them that they are easy to replace. By &lt;strong&gt;definition&lt;/strong&gt;, the application level code has no knowledge about the container, so the &lt;strong&gt;only&lt;/strong&gt; coupling there is, is in the configuration.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Tue, 12 May 2009 09:05:33 -0000</pubDate></item><item><title>Re: Introducing Bucket: A Minimal Dependency Injection Container for PHP</title><link>http://www.sitepoint.com/bucket-is-a-minimal-dependency-injection-container-for-php/#comment-220029404</link><description>&lt;p&gt;Honestly, I didn't take any offence from the first comment by Joshua. The web is full of libraries and frameworks and so it's hard to be an expert in all of them before making a choice. I might have been too quick to write off &lt;code&gt;sfServiceContainer&lt;/code&gt;; I'll definitely take a second look.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;If there’s something that’s a "real" product, under active development that people can use, it’d be worth mentioning in the tutorial itself - that way people won’t be stuck with Bucket&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;I think it's feature complete - There's nothing more to add to it. That doesn't mean that you're stuck in any way, since you can add whatever complicated factory you want on the backend. In the slightly larger perspective, DI-containers have the very fortunate attribute to them that they are easy to replace. By &lt;strong&gt;definition&lt;/strong&gt;, the application level code has no knowledge about the container, so the &lt;strong&gt;only&lt;/strong&gt; coupling there is, is in the configuration.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Tue, 12 May 2009 05:05:33 -0000</pubDate></item><item><title>Re: Introducing Bucket: A Minimal Dependency Injection Container for PHP</title><link>http://www.sitepoint.com/bucket-is-a-minimal-dependency-injection-container-for-php/#comment-1146869415</link><description>&lt;p&gt;@Joshua&lt;br&gt;I admit I only looked at the documentation for it. Maybe I should give it another go. The YAML/XML configuration scared me away, as well as the &lt;strong&gt;sf&lt;/strong&gt; prefix on the classes.&lt;br&gt;&lt;a href="http://www.pake-project.org/download.html" rel="nofollow noopener" target="_blank" title="http://www.pake-project.org/download.html"&gt;Pake&lt;/a&gt; also used to be decoupled from Symfony, but is now tightly integrated into it. That makes me a bit suspicious, although it might just be me being paranoid.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Mon, 11 May 2009 00:00:03 -0000</pubDate></item><item><title>Re: Introducing Bucket: A Minimal Dependency Injection Container for PHP</title><link>http://www.sitepoint.com/bucket-is-a-minimal-dependency-injection-container-for-php/#comment-220029400</link><description>&lt;p&gt;@Joshua&lt;br&gt;I admit I only looked at the documentation for it. Maybe I should give it another go. The YAML/XML configuration scared me away, as well as the &lt;strong&gt;sf&lt;/strong&gt; prefix on the classes.&lt;br&gt;&lt;a href="http://www.pake-project.org/download.html" rel="nofollow noopener" target="_blank" title="http://www.pake-project.org/download.html"&gt;Pake&lt;/a&gt; also used to be decoupled from Symfony, but is now tightly integrated into it. That makes me a bit suspicious, although it might just be me being paranoid.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Sun, 10 May 2009 20:00:03 -0000</pubDate></item><item><title>Re: Interactive CLI password prompt in PHP</title><link>http://www.sitepoint.com/interactive-cli-password-prompt-in-php/#comment-1146880189</link><description>&lt;p&gt;OK, I couldn't get the &lt;code&gt;ScriptPW&lt;/code&gt; trick to work, but I've now updated the snippet above to use the basic password-prompt, if the OS is Windows. This should make the function fully portable.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">troelskn</dc:creator><pubDate>Fri, 01 May 2009 09:54:20 -0000</pubDate></item></channel></rss>