<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-8709754195953818893</atom:id><lastBuildDate>Mon, 28 May 2012 23:47:10 +0000</lastBuildDate><category>mobile</category><category>flash</category><category>mail</category><category>proxy</category><category>repcached</category><category>urlshortener</category><category>javascript</category><category>sms</category><category>memoization</category><category>command prompt</category><category>videolan</category><category>dynamic programming</category><category>word</category><category>api</category><category>lua</category><category>windows 7</category><category>memcache</category><category>css</category><category>license</category><category>windows</category><category>iptv</category><category>freebsd</category><category>eclipse</category><category>actionscript</category><category>count</category><category>apache</category><category>linux</category><category>facebook</category><category>sharing</category><category>xml</category><category>math</category><category>extensions</category><category>office</category><category>ssd</category><category>mysql</category><category>java</category><category>google maps</category><category>php</category><category>sockets</category><category>netbios</category><category>security</category><category>programming</category><category>bsd</category><category>mysql replication</category><category>goo.gl</category><category>networking</category><category>vlc</category><category>novice</category><category>c</category><category>jquery</category><category>android</category><category>wireless</category><category>software</category><category>unix</category><category>optimization</category><category>arcgis</category><category>samba</category><category>memcached</category><category>gcc</category><category>statistics</category><category>subtitles</category><category>ubuntu</category><category>esri</category><category>ftp</category><category>vista</category><category>recursion</category><category>google</category><title>dev.kafol.net</title><description>For troubleshooting I use Colt Python .357</description><link>http://dev.kafol.net/</link><managingEditor>noreply@blogger.com (jean caffou)</managingEditor><generator>Blogger</generator><openSearch:totalResults>72</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-7319486950982991178</guid><pubDate>Wed, 18 Apr 2012 16:38:00 +0000</pubDate><atom:updated>2012-04-18T18:38:58.282+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>windows 7</category><category domain='http://www.blogger.com/atom/ns#'>ssd</category><category domain='http://www.blogger.com/atom/ns#'>windows</category><category domain='http://www.blogger.com/atom/ns#'>optimization</category><title>Windows 7 SSD Tips</title><description>The list may be updated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;You probably already know this: &lt;br /&gt;Install large programs on the HDD instead of the SSD drive.&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Disabling hibernation saves you X GBs on the SSD drive, where X is the size of your RAM.&lt;br /&gt;Run cmd as administrator.&lt;br /&gt;Type in:&amp;nbsp;
&lt;b style="background-color: #f6fafb; color: #323232; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px; text-align: justify;"&gt;powercfg -h off&lt;br /&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Move Documents, Movies, Pictures, Music folder on the HDD drive.&lt;br /&gt;Moving these directories is easy. Just right-click on them, click Properties, click Location and click Move.&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Move AppData folder - this is the folder where your installed programs store temporary and/or your local data which is used by those programs. It can grow really large in size.&lt;br /&gt;There is no simple procedure to do this, so this option is not really preferred.&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Move the whole Users folder.&lt;br /&gt;&lt;a href="http://lifehacker.com/5467758/move-the-users-directory-in-windows-7"&gt;LifeHacker&lt;/a&gt; has an article about it. Again, not a really simple solution.&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-7319486950982991178?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2012/04/windows-7-ssd-tips.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-7301354595051223650</guid><pubDate>Mon, 16 Apr 2012 22:08:00 +0000</pubDate><atom:updated>2012-04-17T00:08:46.172+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>windows 7</category><category domain='http://www.blogger.com/atom/ns#'>windows</category><title>Windows 7 File permission problem after reinstallation</title><description>&lt;br /&gt;
Run command line as administrator&lt;br /&gt;
&lt;br /&gt;
&lt;span style="background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;"&gt;For Folders or Directories (will perform action recursively):&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="background-color: #fafafa; color: royalblue; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;"&gt;&lt;i&gt;takeown /f directory_name /r /d y&lt;br /&gt;icacls directory_name /grant administrators:F /t&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;"&gt;Replace file_name or directory_name with actual file name or folder name, with path when applicable. The first command will take ownership of the file or folder specified, and the second command will grant full control permissions to administrators user group. Note that when using command for folders, to command will run recursively. To prevent the task been perform recursively, remove the “/r” and “/t” switch.&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;"&gt;Source:&amp;nbsp;&lt;/span&gt;&lt;a href="http://forum.thewindowsclub.com/windows-tips-tutorials-articles/18379-how-take-ownership-full-control-permissions-files-folders-windows.html"&gt;http://forum.thewindowsclub.com/windows-tips-tutorials-articles/18379-how-take-ownership-full-control-permissions-files-folders-windows.html&lt;/a&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-7301354595051223650?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2012/04/windows-7-file-permission-problem-after.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-3628021386832919713</guid><pubDate>Sat, 14 Apr 2012 14:59:00 +0000</pubDate><atom:updated>2012-04-14T17:02:31.048+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>eclipse</category><category domain='http://www.blogger.com/atom/ns#'>android</category><category domain='http://www.blogger.com/atom/ns#'>google maps</category><title>Google Maps API Key for Android (Eclipse, Windows)</title><description>There are two main types of keystores in Eclipse - one is for debugging (a keystore with no password) and the other one is when you create a new one yourself, with a password.&lt;br /&gt;
&lt;br /&gt;
To make Google Maps work on your Android app, you need to enter a MD5 fingerprint of your keystore in Google Maps API signup:&amp;nbsp;&lt;a href="http://code.google.com/android/maps-api-signup.html"&gt;http://code.google.com/android/maps-api-signup.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
And here's how you get your keystore's MD5 fingerprint in Windows.&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;You probably already have JDK installed. Find out your Java bin directory. Mine is:&lt;br /&gt;&lt;b&gt;C:\Program Files\Java\jdk1.6.0_24\bin&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Enter this directory path in your PATH Environment variable (see picture).&lt;/li&gt;
&lt;li&gt;Start "cmd" and navigate to your &lt;br /&gt;&lt;b&gt;C:\Users\&amp;lt;yourusername&amp;gt;\.android&lt;/b&gt; &lt;br /&gt;directory&lt;/li&gt;
&lt;li&gt;Type this command:&lt;br /&gt;&lt;b&gt;keytool -list -keystore debug.keystore&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;The password is empty, just hit enter&lt;/li&gt;
&lt;li&gt;You're done. Copy the MD5 fingerprint in that url, you get an API key, which you use in your Android MapView Layout file.&lt;br /&gt;&lt;b&gt;android:apiKey="your api key here"&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://farm3.static.flickr.com/2018/2319758559_8f6f8596b9_o.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://farm3.static.flickr.com/2018/2319758559_8f6f8596b9_o.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-3628021386832919713?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2012/04/google-maps-api-key-for-android-eclipse.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-5434153052476345122</guid><pubDate>Thu, 01 Mar 2012 23:45:00 +0000</pubDate><atom:updated>2012-03-02T00:49:42.073+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>gcc</category><category domain='http://www.blogger.com/atom/ns#'>memcached</category><category domain='http://www.blogger.com/atom/ns#'>repcached</category><category domain='http://www.blogger.com/atom/ns#'>c</category><title>Repcached does not compile</title><description>&lt;b&gt;&lt;span style="color: red;"&gt;If you want the tutorial on installing repcached, click &lt;a href="http://dev.kafol.net/2011/03/configuring-repcached-service-on.html"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
For the record, I am using:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: x-small;"&gt;Ubuntu 11.10&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: x-small;"&gt;Linux 3.0.0-12-server #20-Ubuntu SMP Fri Oct 7 16:36:30 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style="font-size: x-small;"&gt;gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style="font-size: x-small;"&gt;GNU Make 3.81&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
If you're getting this error when doing &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;make&lt;/span&gt;&amp;nbsp;for &lt;b&gt;repcached&lt;/b&gt;,&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c: In function âadd_iovâ:&lt;/span&gt;&lt;br /&gt;
&lt;u&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;b&gt;memcached.c:696:30: error: âIOV_MAXâ undeclared (first use in this function)&lt;/b&gt;&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c:696:30: note: each undeclared identifier is reported only once for each function it appears in&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c: In function âprocess_statâ:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c:1127:9: warning: format â%dâ expects argument of type âintâ, but argument 3 has type âlong unsigned intâ [-Wformat]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c:1134:9: warning: format â%lluâ expects argument of type âlong long unsigned intâ, but argument 3 has type âuint64_tâ [-Wformat]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c:1138:9: warning: format â%lluâ expects argument of type âlong long unsigned intâ, but argument 3 has type âuint64_tâ [-Wformat]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c:1139:9: warning: format â%lluâ expects argument of type âlong long unsigned intâ, but argument 3 has type âuint64_tâ [-Wformat]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c:1140:9: warning: format â%lluâ expects argument of type âlong long unsigned intâ, but argument 3 has type âuint64_tâ [-Wformat]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c:1141:9: warning: format â%lluâ expects argument of type âlong long unsigned intâ, but argument 3 has type âuint64_tâ [-Wformat]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c:1142:9: warning: format â%lluâ expects argument of type âlong long unsigned intâ, but argument 3 has type âuint64_tâ [-Wformat]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c:1143:9: warning: format â%lluâ expects argument of type âlong long unsigned intâ, but argument 3 has type âuint64_tâ [-Wformat]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c:1144:9: warning: format â%lluâ expects argument of type âlong long unsigned intâ, but argument 3 has type âuint64_tâ [-Wformat]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c:1145:9: warning: format â%lluâ expects argument of type âlong long unsigned intâ, but argument 3 has type âuint64_tâ [-Wformat]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c:1146:9: warning: format â%lluâ expects argument of type âlong long unsigned intâ, but argument 3 has type âsize_tâ [-Wformat]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c:1149:9: warning: format â%lluâ expects argument of type âlong long unsigned intâ, but argument 3 has type âuint64_tâ [-Wformat]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c: In function âprocess_get_commandâ:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c:1331:19: warning: format â%lluâ expects argument of type âlong long unsigned intâ, but argument 3 has type âuint64_tâ [-Wformat]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c: In function âdo_add_deltaâ:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;memcached.c:1573:5: warning: format â%lluâ expects argument of type âlong long unsigned intâ, but argument 3 has type âuint64_tâ [-Wformat]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;make[2]: *** [memcached-memcached.o] Error 1&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;make[2]: Leaving directory `/root/memcached-1.2.8-repcached-2.2'&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;make[1]: *** [all-recursive] Error 1&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;make[1]: Leaving directory `/root/memcached-1.2.8-repcached-2.2'&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;make: *** [all] Error 2&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
Related discussion &lt;a href="http://stackoverflow.com/questions/9026393/error-iov-max-undeclared-first-use-in-this-function"&gt;here&lt;/a&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Compiler says that IOV_MAX is not defined. I'm not really sure what this is, but it compiled fine on Ubuntu 10.04. I guess that const is not used anymore.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
In memcached.c code, we can see that IOV_MAX is defined if the OS is FreeBSD or iOS, so I decided to just define it anyway.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Here is my diff of the code that made it compile, in case you need it.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;57,59c57&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt; #if defined(__FreeBSD__) || defined(__APPLE__)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt; # define IOV_MAX 1024&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt; #endif&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;---&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;gt; #define IOV_MAX 1024&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-5434153052476345122?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2012/03/repcached-does-not-compile.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-2074827404724192694</guid><pubDate>Tue, 28 Feb 2012 17:26:00 +0000</pubDate><atom:updated>2012-02-28T18:27:40.321+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>mysql</category><category domain='http://www.blogger.com/atom/ns#'>count</category><category domain='http://www.blogger.com/atom/ns#'>programming</category><category domain='http://www.blogger.com/atom/ns#'>php</category><title>PHP :: Advice on using count()</title><description>I may be a little late realising this, but a few dozen thousand lines of PHP code in, it's better late than never.&lt;br /&gt;
&lt;br /&gt;
Let's look at example #1 on count() manual&lt;br /&gt;
&lt;a href="http://php.net/manual/en/function.count.php"&gt;http://php.net/manual/en/function.count.php&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="background-color: #e1e1e1; color: #0000bb; font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left;"&gt;$result&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #e1e1e1; color: #007700; font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #e1e1e1; color: #0000bb; font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left;"&gt;count&lt;/span&gt;&lt;span style="background-color: #e1e1e1; color: #007700; font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left;"&gt;(&lt;/span&gt;&lt;span style="background-color: #e1e1e1; color: #0000bb; font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left;"&gt;null&lt;/span&gt;&lt;span style="background-color: #e1e1e1; color: #007700; font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left;"&gt;);&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #e1e1e1; color: #ff8000; font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left;"&gt;//&amp;nbsp;$result&amp;nbsp;==&amp;nbsp;0&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #e1e1e1; color: #0000bb; font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left;"&gt;$result&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #e1e1e1; color: #007700; font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left;"&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #e1e1e1; color: #0000bb; font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left;"&gt;count&lt;/span&gt;&lt;span style="background-color: #e1e1e1; color: #007700; font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left;"&gt;(&lt;/span&gt;&lt;span style="background-color: #e1e1e1; color: #0000bb; font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left;"&gt;false&lt;/span&gt;&lt;span style="background-color: #e1e1e1; color: #007700; font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left;"&gt;);&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: #e1e1e1; color: #ff8000; font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left;"&gt;//&amp;nbsp;$result&amp;nbsp;==&amp;nbsp;1&lt;/span&gt;
&lt;br /&gt;
&lt;span style="background-color: #e1e1e1; color: #ff8000; font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
Does this strike you as a bit odd? Why the hell should count(0) or count(false) be equal to 1?&lt;br /&gt;
&lt;br /&gt;
Well strangely enough, that's how it is. So for example, if you wrote a mysql_query() wrapper where you return false if the query fails and if you expect an array where you check the number of items, you find out that if the query fails, the count will return 1, and you might get some unexpected results.&lt;br /&gt;
&lt;br /&gt;
Keeping computer security in mind, it's best to avoid count() when just checking if some data is returned.&lt;br /&gt;
&lt;br /&gt;
Alternatives are empty() if checks if a variable contains something other than 0, '0', null, false, array() or ''.&lt;br /&gt;
&lt;br /&gt;
OR, in your wrapper functions, if the query fails, just return NULL!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-2074827404724192694?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2012/02/php-advice-on-using-count.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-6304213083464834420</guid><pubDate>Tue, 28 Feb 2012 01:05:00 +0000</pubDate><atom:updated>2012-02-28T02:05:21.687+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>linux</category><category domain='http://www.blogger.com/atom/ns#'>unix</category><category domain='http://www.blogger.com/atom/ns#'>apache</category><category domain='http://www.blogger.com/atom/ns#'>ubuntu</category><title>Apache :: Could not determine fully qualified domain name</title><description>&lt;br /&gt;
Error message:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
Is preety much self-explanatory&lt;br /&gt;
&lt;br /&gt;
Add this&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;ServerName localhost&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In your server configuration file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-6304213083464834420?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2012/02/apache-could-not-determine-fully.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-2857788842072192454</guid><pubDate>Tue, 28 Feb 2012 00:57:00 +0000</pubDate><atom:updated>2012-02-28T02:01:12.401+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>linux</category><category domain='http://www.blogger.com/atom/ns#'>unix</category><category domain='http://www.blogger.com/atom/ns#'>apache</category><category domain='http://www.blogger.com/atom/ns#'>ubuntu</category><title>Apache :: VirtualHost overlap on port</title><description>Errors like&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[warn] _default_ VirtualHost overlap on port 443, the first has precedence&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
are caused because the virtualhosts are not named.&lt;/div&gt;
&lt;div&gt;
(The same applies for any other port, for example 80)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Add this in your apache configuration file&lt;br /&gt;
&lt;span style="background-color: white; color: #373737; font-family: inherit; font-size: 13px; line-height: 1.5;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: white;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;NameVirtualHost *:443&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;
In Ubuntu server, Linux, that configuration is actually located in the &lt;b&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;ports.conf&lt;/span&gt;&lt;/b&gt; file in &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;/etc/apache2&lt;/b&gt;&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;NameVirtualHost *:80&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;NameVirtualHost *:443&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Listen 80&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-2857788842072192454?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2012/02/apache-virtualhost-overlap-on-port.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-2532115748624809943</guid><pubDate>Sun, 26 Feb 2012 01:06:00 +0000</pubDate><atom:updated>2012-02-26T02:06:00.074+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>mysql</category><category domain='http://www.blogger.com/atom/ns#'>linux</category><category domain='http://www.blogger.com/atom/ns#'>ubuntu</category><title>MySQL not starting when restoring files in /var/lib/mysql</title><description>If you get errors like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;120226 &amp;nbsp;1:54:14 [Note] Plugin 'FEDERATED' is disabled.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;120226 &amp;nbsp;1:54:14 &amp;nbsp;InnoDB: Initializing buffer pool, size = 8.0M&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;120226 &amp;nbsp;1:54:14 &amp;nbsp;InnoDB: Completed initialization of buffer pool&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;120226 &amp;nbsp;1:54:15 &amp;nbsp;InnoDB: Started; log sequence number 0 44233&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;120226 &amp;nbsp;1:54:15 [ERROR] Event Scheduler: Failed to open table mysql.event&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;120226 &amp;nbsp;1:54:15 [ERROR] Event Scheduler: Error while loading from disk.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;120226 &amp;nbsp;1:54:15 [Note] Event Scheduler: Purging the queue. 0 events&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;120226 &amp;nbsp;1:54:15 [ERROR] Aborting&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;120226 &amp;nbsp;1:54:15 &amp;nbsp;InnoDB: Starting shutdown...&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;120226 &amp;nbsp;1:54:20 &amp;nbsp;InnoDB: Shutdown completed; log sequence number 0 44233&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;120226 &amp;nbsp;1:54:20 [Note] mysqld: Shutdown complete&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
or&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;120226 &amp;nbsp;1:59:18 [Note] Plugin 'FEDERATED' is disabled.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;120226 &amp;nbsp;1:59:18 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;120226 &amp;nbsp;1:59:18 &amp;nbsp;InnoDB: Initializing buffer pool, size = 8.0M&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;120226 &amp;nbsp;1:59:18 &amp;nbsp;InnoDB: Completed initialization of buffer pool&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;120226 &amp;nbsp;1:59:18 &amp;nbsp;InnoDB: Started; log sequence number 0 44233&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;120226 &amp;nbsp;1:59:18 [ERROR] mysqld: Can't find file: './mysql/host.frm' (errno: 13)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;120226 &amp;nbsp;1:59:18 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
You need to check the file permissions.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The user and group is mysql:mysql&lt;/div&gt;
&lt;div&gt;
File permissions are rw for user and group (660)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Solution&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;chown mysql:mysql -R /var/lib/mysql&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;chmod 660&amp;nbsp;-R /var/lib/mysql&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-2532115748624809943?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2012/02/mysql-not-starting-when-restoring-files.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-3754705828460151123</guid><pubDate>Wed, 22 Feb 2012 18:19:00 +0000</pubDate><atom:updated>2012-02-22T19:20:15.997+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>netbios</category><category domain='http://www.blogger.com/atom/ns#'>sharing</category><category domain='http://www.blogger.com/atom/ns#'>samba</category><category domain='http://www.blogger.com/atom/ns#'>networking</category><title>NETBIOS / Samba share does not accept username and password</title><description>If your username and password gets rejected when logging in MS file share, try using the INT domain for login.&lt;br /&gt;
&lt;br /&gt;
example:&lt;br /&gt;
&lt;br /&gt;
username: INT\your_username&lt;br /&gt;
password: your_password&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-3754705828460151123?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2012/02/netbios-samba-share-does-not-accept.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-2778747956821358299</guid><pubDate>Tue, 21 Feb 2012 17:04:00 +0000</pubDate><atom:updated>2012-02-21T18:05:10.191+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>ftp</category><category domain='http://www.blogger.com/atom/ns#'>linux</category><category domain='http://www.blogger.com/atom/ns#'>ubuntu</category><title>Linux/Ubuntu :: pure-ftpd does not allow login to user with /usr/sbin/nologin shell</title><description>&lt;b&gt;Expectations:&lt;/b&gt;&lt;br /&gt;
You have created a user with&amp;nbsp;/usr/sbin/nologin shell (ftp-only user) in Linux/Ubuntu.&lt;br /&gt;
If you SSH to the box with this username and password it should not work.&lt;br /&gt;
If you FTP to the box with this username and password it should.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Symptoms:&lt;/b&gt;&lt;br /&gt;
Pure-ftpd does not permit login if the shell is set to /bin/false or&amp;nbsp;/usr/sbin/nologin.&lt;br /&gt;
If you change the shell to /bin/bash it works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;Connected to localhost.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;220-You are user number 2 of 50 allowed.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;220-Local time is now 17:53. Server port: 21.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;220-This is a private system - No anonymous login&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;220-IPv6 connections are also welcome on this server.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;220 You will be disconnected after 15 minutes of inactivity.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;Name (localhost:root): ftponly&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;331 User ftponly OK. Password required&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;Password:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;530 Login authentication failed&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;Login failed.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;Remote system type is UNIX.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;Using binary mode to transfer files.&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Solution:&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
You need to add the nologin or false shell to the file&amp;nbsp;/etc/shells.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;root@box:/# cat /etc/shells&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;# /etc/shells: valid login shells&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/bin/csh&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/bin/sh&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/usr/bin/es&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/usr/bin/ksh&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/bin/ksh&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/usr/bin/rc&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/usr/bin/tcsh&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/bin/tcsh&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/usr/bin/esh&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/bin/dash&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/bin/bash&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/bin/rbash&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/usr/bin/screen&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/bin/false&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/usr/sbin/nologin&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-2778747956821358299?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2012/02/linuxubuntu-pure-ftpd-does-not-allow.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-2987518278100101476</guid><pubDate>Sat, 18 Feb 2012 22:46:00 +0000</pubDate><atom:updated>2012-02-18T23:52:07.300+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>php</category><category domain='http://www.blogger.com/atom/ns#'>sms</category><title>PHP :: sending SMS via najdi.si FREE SMS</title><description>You need to make an account on https://id.najdi.si before you can use the code.
&lt;br/&gt;&lt;br/&gt;
All info and description is in the code comments.&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
Example usage:
&lt;pre&gt;
$sms = new sms();
$sms-&amp;gt;send('090666666','one does not simply send an SMS');
&lt;/pre&gt;
&lt;br/&gt;
Enjoy!&lt;br/&gt;
&lt;pre name="code" class="php"&gt;
&amp;lt;?php
/**
* Purpose: 
* Sending SMS via Najdi.si Free SMS
*
* Description: 
* Script logs in using your username and password for https://id.najdi.si and then it sends an SMS to a mobile phone number. 
* There is a 160 character limit per message and daily limit of 40 sent messages.
* The script tries to limit the number of requests to a page and tries to hold on to the session as long as possible. 
* The session cookie is stored in a /tmp/folder for later use, if the script restarts. 
* Once instantiated, object can be reused for sending a number of SMS messages. 
* If a new object is instantiated, it will prefer to use a stored session.
*
* @version Date: 1. february 2012
* @author Žan Kafol
* @access public
*/

class sms {
 
 public $username = 'your_username';
 public $pass = '...';
 
 public $cookie_jar = '/tmp/cookie.najdi.si';
 
 private $error = '';
 
 /*
 * Construct function
 * @param string $username
 * @param string $password
 */
 function __construct($u = null, $p = null) {
  if(!is_null($u)) {
   $this-&amp;gt;username = $u;
  }
  
  if(!is_null($p)) {
   $this-&amp;gt;pass = $p;
  }
 }
 
 /*
 * Sends SMS
 * @param string $number
 * @param string $message
 */
 public function send($number,$message) {
  $message = urlencode(substr(iconv('UTF-8', 'ASCII//TRANSLIT', $message), 0, 160));
  $number = ltrim(preg_replace('/[^\d]/','',$number),'0');
  
  @list($area,$num1,$num2) = explode(' ',preg_replace('/(\d{2})(\d{3})(\d{3})/','\1 \2 \3',$number));
  
  $url = &amp;quot;http://www.najdi.si/sms/smsController.jsp?sms_action=4&amp;amp;sms_so_ac_={$area}&amp;amp;sms_so_l_={$num1}%20{$num2}&amp;amp;myContacts=&amp;amp;sms_message_=$message&amp;quot;;
  
  $response = $this-&amp;gt;response($this-&amp;gt;req($url));
  
  if($response === false) {
   $this-&amp;gt;login();
   $response = $this-&amp;gt;response($this-&amp;gt;req($url));
  }
  
  return $response;
 }
 
 /*
 * Returns last error as stdclass
 */
 public function get_error() {
  return $this-&amp;gt;error;
 }
 
 private function login() {
  $this-&amp;gt;req('http://www.najdi.si/auth/login.jsp?lg=0&amp;amp;target_url=http%3A%2F%2Fwww.najdi.si%2Findex.jsp');
  
  return $this-&amp;gt;req(&amp;quot;https://id.najdi.si/j_spring_security_check&amp;quot;, array(
   'j_username'     =&amp;gt; $this-&amp;gt;username,
   'j_password'     =&amp;gt; $this-&amp;gt;pass,
   '_spring_security_remember_me' =&amp;gt; 'on'
  ));
 }
 
 private function response($r) {
  $r = json_decode($r);
  
  if($r-&amp;gt;dialog == 3) {
   $this-&amp;gt;error = false;
   return $r;
  }
  
  $this-&amp;gt;error = $r;
  return false;
 }
 
 private function req($url, $post = false) {
  $ack = curl_init();
  
  curl_setopt($ack, CURLOPT_USERAGENT, &amp;quot;Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1&amp;quot; );
  curl_setopt($ack, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ack, CURLOPT_FOLLOWLOCATION, true);
  curl_setopt($ack, CURLOPT_URL, $url);
  curl_setopt($ack, CURLOPT_COOKIEFILE, $this-&amp;gt;cookie_jar); 
  curl_setopt($ack, CURLOPT_COOKIEJAR, $this-&amp;gt;cookie_jar); 
  
  if($post) {
   curl_setopt($ack, CURLOPT_POST, true);
   curl_setopt($ack, CURLOPT_POSTFIELDS, http_build_query($post));
  }
  
  $dat = curl_exec($ack);
  curl_close($ack);
  
  return $dat;
 }
}
?&amp;gt;
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-2987518278100101476?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2012/02/php-sending-sms-via-najdisi-free-sms.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-5049910438671339755</guid><pubDate>Sat, 19 Nov 2011 20:29:00 +0000</pubDate><atom:updated>2011-11-19T21:30:16.389+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>java</category><category domain='http://www.blogger.com/atom/ns#'>android</category><title>Android :: wrong image / data in ListView rows</title><description>&lt;blockquote&gt;
Android's ListView reuses list items when they aren't need anymore. 
For this reason, you need to make sure all views that should change, will actually get changed.
Your problem is that if you don't find a drawable for the current list item, you don't empty nor hide the ImageView. 
You should do thumb.setImageDrawable(null) in that case, or thumb.setVisibility(View.GONE).&lt;/blockquote&gt;
- From &lt;a href="http://stackoverflow.com/questions/3889549/wrong-image-show-up-in-my-listview-rows"&gt;stackoverflow&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre name="code" class="java"&gt;
 @Override
     public View getView(int pos, View v, ViewGroup parent) {
      TimetableViewHolder timetableHolder;
         if (v == null) {
             LayoutInflater vi = ((Activity)context).getLayoutInflater();
             v = vi.inflate(R.layout.timetable_item, parent, false);
             timetableHolder = new TimetableViewHolder();
             timetableHolder.rel = (TextView) v.findViewById(R.id.rel);
             timetableHolder.time = (TextView) v.findViewById(R.id.time);
             timetableHolder.icon = (ImageView) v.findViewById(R.id.icon);
             v.setTag(timetableHolder);
         } else {
          timetableHolder = (TimetableViewHolder) v.getTag(); 
         }

         TimetableItem item = items.get(pos);

         if(item != null) {
          timetableHolder.rel.setText(item.rel);
          timetableHolder.time.setText(item.time);
          if(item.url.equals("ERROR")) {
           timetableHolder.icon.setImageResource(android.R.drawable.ic_menu_close_clear_cancel);
          } else if(item.url.equals("PRESTOP")) {
           timetableHolder.icon.setImageResource(android.R.drawable.ic_menu_directions);
          } else { // THIS IS IMPORTANT
           timetableHolder.icon.setImageResource(android.R.drawable.ic_dialog_info);
          }
         }

         return v;
     }
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-5049910438671339755?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2011/11/android-wrong-image-data-in-listview.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-1838399559488340392</guid><pubDate>Sat, 19 Nov 2011 14:15:00 +0000</pubDate><atom:updated>2011-11-19T15:30:49.638+01:00</atom:updated><title>Android search dialog doesn't appear</title><description>Have a problem?&lt;br /&gt;
The search dialog doesn't show up?&lt;br /&gt;
&lt;br /&gt;
I just thought you should know, I found this interesting comment on &lt;a href="http://stackoverflow.com/questions/5926895/android-search-dialog-doesnt-appear"&gt;stackoverflow&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
oh my god. this is f*ing stupid. i had to use android:label="@string/xyz" instead of android:label="lol" and no single word about this in the documentation. unbelievable&lt;/blockquote&gt;&lt;br /&gt;
&amp;nbsp;This is my manifest:&lt;br /&gt;
&lt;br /&gt;
&lt;pre name="code" class="xml"&gt;
&amp;lt;activity android:name=".SearchableActivity" &amp;gt;
 &amp;lt;intent-filter &amp;gt;
  &amp;lt;action android:name="android.intent.action.SEARCH" /&amp;gt;
 &amp;lt;/intent-filter&amp;gt;

 &amp;lt;meta-data
  android:name="android.app.searchable"
  android:resource="@xml/searchable" /&amp;gt;
&amp;lt;/activity&amp;gt;
&amp;lt;activity
 android:label="Preferred stations"
 android:name="PreferredStation"
 android:theme="@android:style/Theme.NoTitleBar" &amp;gt;
 &amp;lt;meta-data
  android:name="android.app.default_searchable"
  android:value=".SearchableActivity" /&amp;gt;
&amp;lt;/activity&amp;gt;
&lt;/pre&gt;

And searchable

&lt;pre name="code" class="xml"&gt;
&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;searchable xmlns:android="http://schemas.android.com/apk/res/android"
    android:label="@string/search_label"
    android:hint="@string/search_hint" &amp;gt;
&amp;lt;/searchable&amp;gt;
&lt;/pre&gt;

&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-1838399559488340392?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2011/11/android-search-dialog-doesnt-appear.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-4798673095544980058</guid><pubDate>Sat, 19 Nov 2011 02:02:00 +0000</pubDate><atom:updated>2011-11-19T04:30:43.740+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>java</category><category domain='http://www.blogger.com/atom/ns#'>android</category><category domain='http://www.blogger.com/atom/ns#'>google maps</category><title>Android :: google maps (MapView) hacks, tricks, workarounds</title><description>MapView isn't very developer friendly now is it?&lt;br /&gt;
&lt;br /&gt;
Here are some hacks I've had to work with:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;1) When tapping on the overlay, the app crashes if you're trying to display the dialog.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Unable to add window -- token null is not for an application&lt;/b&gt;&lt;br /&gt;
Yes, this is due to context. Especially if you're trying to do this in a seperate thread or AsyncTask.&lt;br /&gt;
Turns out the context you need to pass to your dialog is mapView.getContext();&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;AlertDialog.Builder dialog = new AlertDialog.Builder(mapView.getContext());&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;2) Displaying only the overlays which are within map bounds&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Oh yeah, several problems here. You've probably come across at least one of these:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Wrong map bounds in onCreate (0, 360000000),&lt;/b&gt;&lt;br /&gt;Yeah, in onCreate those haven't been calculated yet. onStart doesn't help either. Try this:&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;Runnable waitForMapTimeTask = new Runnable() {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; public void run() {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; if(mapView.getLatitudeSpan()==0||mapView.getLongitudeSpan()== 360000000) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;mapView.postDelayed(this, 100);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; } else {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; redrawMarkers(); // draw here&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;mapView.postDelayed(waitForMapTimeTask, 100);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
You create a new thread and wait until you get the right bounds. Recursively call it again.&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Map bounds ???&lt;/b&gt;&lt;br /&gt;Don't worry, it's simple.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;public Rect getMapBounds() {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;return new Rect(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;mapView.getMapCenter().getLongitudeE6() - mapView.getLongitudeSpan()/2,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;mapView.getMapCenter().getLatitudeE6() - mapView.getLatitudeSpan()/2,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;mapView.getMapCenter().getLongitudeE6() + mapView.getLongitudeSpan()/2,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;mapView.getMapCenter().getLatitudeE6() + mapView.getLatitudeSpan()/2&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;...&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;if(!s.drawn &amp;amp;&amp;amp; rect.contains(point.getLongitudeE6(), point.getLatitudeE6())) {&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Yeah, okay, but what about panning / zooming?&lt;/b&gt;&lt;br /&gt;Well, there are no methods, like onPan or onZoom, but some people found their way around this problem. There is no perfect solution, you'll see.&lt;br /&gt;Check these links out:&lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://stackoverflow.com/questions/2328650/how-can-i-detect-if-an-android-mapview-has-been-panned-or-zoomed"&gt;http://stackoverflow.com/questions/2328650/how-can-i-detect-if-an-android-mapview-has-been-panned-or-zoomed&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://stackoverflow.com/questions/2328650/how-can-i-detect-if-an-android-mapview-has-been-panned-or-zoomed"&gt;http://bricolsoftconsulting.com/2011/10/31/extending-mapview-to-add-a-change-event/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://stackoverflow.com/questions/3567420/how-to-catch-that-map-panning-and-zoom-are-really-finished"&gt;http://stackoverflow.com/questions/3567420/how-to-catch-that-map-panning-and-zoom-are-really-finished&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Zoom in on double tap?&lt;/b&gt;&lt;br /&gt;Click here:&amp;nbsp;&lt;a href="http://dev.kafol.net/2011/11/how-hard-is-it-to-make-simple-zoom-in.html"&gt;http://dev.kafol.net/2011/11/how-hard-is-it-to-make-simple-zoom-in.html&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Overlays don't get drawn immediately!&lt;/b&gt;&lt;br /&gt;Try this:&lt;br /&gt;mapView.postInvalidate();&lt;br /&gt;or this:&lt;br /&gt;mapView.invalidate();&lt;br /&gt;&lt;br /&gt;But keep in mind, that&lt;b&gt; invalidate() needs to be called from an UI!&lt;/b&gt; If you're trying to get it working &lt;b&gt;from a thread, use postInvalidate()!&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b style="text-decoration: line-through;"&gt;MapView java.util.ConcurrentModificationException when adding new overlays&lt;/b&gt;&lt;br /&gt;&lt;strike&gt;Not sure if I solved this one, but it seems to work now. I read somewhere that this could happen if you add overlays in a non UI thread. I moved the&amp;nbsp;&lt;/strike&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;&lt;b&gt;Nope, sorry, this one was my bad. I was doing some crazy async sorting and all hell broke loose.&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;itemizedOverlay.populateNow();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;mapOverlays.add(itemizedOverlay);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;mapView.postInvalidate();&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
From&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;doInBackground &lt;/span&gt;to &amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;onPostExecute &lt;/span&gt;in &amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;AsyncTask&lt;/span&gt;.&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
You could also run something in a UI thread like this:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;runOnUiThread(new Runnable() {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; @Override&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void run() {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;//do stuff here&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;});&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-4798673095544980058?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2011/11/android-google-maps-mapview-hacks.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-3190910414974973796</guid><pubDate>Fri, 18 Nov 2011 02:44:00 +0000</pubDate><atom:updated>2011-11-19T21:08:53.653+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>java</category><category domain='http://www.blogger.com/atom/ns#'>xml</category><category domain='http://www.blogger.com/atom/ns#'>android</category><category domain='http://www.blogger.com/atom/ns#'>google maps</category><title>Android :: google maps on double tap zoom in</title><description>How hard is it to make a simple zoom in call on double tap in MapView in Android?&lt;br /&gt;
&lt;br /&gt;
Not very.&lt;br /&gt;
&lt;br /&gt;
How hard is it to get the information on how to do it?&lt;br /&gt;
&lt;br /&gt;
Very.&lt;br /&gt;
&lt;br /&gt;
Here's what you probably didn't know:&lt;br /&gt;
You need to extend the MapView and use this extended class in the Android XML layout file.&lt;br /&gt;
In the extended class you instantiate the gesture detector and set on double tap listener.&lt;br /&gt;
In the Map Activity you implement&amp;nbsp;OnGestureListener and OnDoubleTapListener.&lt;br /&gt;
&lt;br /&gt;
Example:

&lt;pre name="code" class="xml"&gt;
&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="center_horizontal" &amp;gt;
    
 &amp;lt;net.kafol.vlaki.ExtMapView
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/mapview"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:clickable="true"
     android:enabled="true"
     android:apiKey=""
 /&amp;gt;

&amp;lt;/RelativeLayout&amp;gt;
&lt;/pre&gt;


&lt;pre name="code" class="java"&gt;
package net.kafol.vlaki;

import android.content.Context;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.GestureDetector.OnDoubleTapListener;
import android.view.MotionEvent;
import android.view.GestureDetector.OnGestureListener;
import com.google.android.maps.MapView;

public class ExtMapView extends MapView {
 private Context context;
 private GestureDetector gestureDetector;

 public ExtMapView(Context c, AttributeSet attrs) {
  super(c, attrs);
  context = c;

  gestureDetector = new GestureDetector((OnGestureListener) context);
  gestureDetector.setOnDoubleTapListener((OnDoubleTapListener) context);
 }

 public boolean onTouchEvent(MotionEvent ev) {
  if (this.gestureDetector.onTouchEvent(ev))
   return true;
  else
   return super.onTouchEvent(ev);
 }
}
&lt;/pre&gt;

&lt;pre name="code" class="java"&gt;
public class Map extends MapActivity implements OnGestureListener, OnDoubleTapListener {
...
 @Override
 public boolean onDoubleTap(MotionEvent e) {
     int x = (int)e.getX(), y = (int)e.getY();;
     Projection p = mapView.getProjection();
     mapView.getController().animateTo(p.fromPixels(x, y)); // zoom in to a point you tapped 
     mapView.getController().zoomIn();
  return true;
 }
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-3190910414974973796?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2011/11/how-hard-is-it-to-make-simple-zoom-in.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>3</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-6110542522611690973</guid><pubDate>Fri, 18 Nov 2011 01:29:00 +0000</pubDate><atom:updated>2011-11-18T02:41:09.798+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>java</category><category domain='http://www.blogger.com/atom/ns#'>mobile</category><category domain='http://www.blogger.com/atom/ns#'>android</category><title>Android : Checkbox ListView - (un) check all</title><description>This recycling of views in android is preety insane. Pain to work with.&lt;br /&gt;
&lt;br /&gt;
So the problem is how to check all check boxes in a list view, if a list view only contains the visible items.&lt;br /&gt;
&lt;br /&gt;
Iterating through the adapter or array of holders was pretty unreliable, some checkboxes weren't affected.&lt;br /&gt;
&lt;br /&gt;
What I did was actually add an attribute to the data object and iterate through this object array (the same way it get's added in the adapter)-&lt;br /&gt;
&lt;br /&gt;
Here are some functions:&lt;br /&gt;
&lt;pre class="java" name="code"&gt; public void toggleCheck(Boolean val) {
  
  for(Station s : stations.list) {
   s.checked = val;
   editor.putBoolean("PF_"+s.getID(), val);
  }
  
  for(int i=0 ; i &amp;lt; lv.getChildCount() ; i++) {
   CheckBox cb = (CheckBox) lv.getChildAt(i).findViewById(R.id.cb);
   cb.setChecked(val);
  }

  editor.apply();
 }
 
    private class StationCBViewHolder {
        public CheckBox cb;
        public Station s;
    }
 
 private class StationListAdapter extends ArrayAdapter&lt;station&gt; {
     private ArrayList&lt;station&gt; items;
     private Context context;
     
     public StationListAdapter(Context context, int tvResId, ArrayList&lt;station&gt; items) {
         super(context, tvResId, items);
         this.items = items;
         this.context = context;
     }

     @Override
     public View getView(int pos, View v, ViewGroup parent) {
      final StationCBViewHolder holder;
      final Station item = items.get(pos);
      
         if (v == null) {
             LayoutInflater vi = ((Activity)context).getLayoutInflater();
             v = vi.inflate(R.layout.stationcheckboxitem, parent, false);
             
             holder = new StationCBViewHolder();
             holder.cb = (CheckBox) v.findViewById(R.id.cb);
             holder.s = item;
             
             item.checked = prefs.getBoolean("PF_"+item.getID(),true);
             
             //holder.cb.setTag(holder);
             holder.cb.setTag(item);
             holder.cb.setChecked(item.checked);
             holder.cb.setOnCheckedChangeListener(new OnCheckedChangeListener() {
     @Override
     public void onCheckedChanged(CompoundButton v, boolean isChecked) {
      Station s = (Station) v.getTag();
      editor.putBoolean("PF_"+s.getID(), isChecked);
      editor.apply();
     }
    });
                        
             v.setTag(holder);
         } else {
          holder = (StationCBViewHolder) v.getTag(); 
         }

         holder.cb.setText(item.toString());
         holder.cb.setChecked(item.checked);

         return v;
     }

 }
&lt;/station&gt;&lt;/station&gt;&lt;/station&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Full code here:&amp;nbsp;&lt;a href="http://pastebin.com/8NMbHqRV"&gt;http://pastebin.com/8NMbHqRV&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code still has some bugs related to SharedPreferences and&amp;nbsp;SharedPreferences.Editor, but at least it checks and unchecks all checkboxes.&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-6110542522611690973?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2011/11/android-checkbox-listview-un-check-all.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-4463067519302390980</guid><pubDate>Wed, 14 Sep 2011 21:26:00 +0000</pubDate><atom:updated>2011-09-15T00:25:09.575+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>urlshortener</category><category domain='http://www.blogger.com/atom/ns#'>php</category><title>URL shortening - make your own URL shortener</title><description>If you ever thought about URL shortening, you've probably already figured out, how it works.&lt;br /&gt;
&lt;br /&gt;
Those random letters and numbers which serve as a key (in hashtable data structures) are basically encoded integers, which are AUTO_INCREMENT values in the database.&lt;br /&gt;
&lt;br /&gt;
Here are the encoding and decoding functions:
&lt;br /&gt;
&lt;pre class="php" name="code"&gt;const ALLOWED_CHARS = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';

function id2short($integer, $base = self::ALLOWED_CHARS) {
	$out = '';
	$length = strlen($base);
	while($integer &amp;gt; $length-1) {
		$out = $base[fmod($integer, $length)].$out;
		$integer = floor( $integer / $length);
	}
	return $base[$integer].$out;
}

function short2id($string, $base = self::ALLOWED_CHARS) {
	$length = strlen($base);
	$size = strlen($string)-1;
	$string = str_split($string);
	$out = strpos($base, array_pop($string));
	foreach($string as $i=&amp;gt;$char) {
		$out += strpos($base, $char) * pow($length, $size - $i);
	}
	return $out;
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;a href="http://go.kafol.net/2K"&gt;Full code here.&lt;/a&gt;
&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-4463067519302390980?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2011/09/url-shortening-make-your-own-url.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-3320050343440464236</guid><pubDate>Sat, 03 Sep 2011 00:01:00 +0000</pubDate><atom:updated>2011-09-03T02:06:22.983+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>mysql</category><category domain='http://www.blogger.com/atom/ns#'>mysql replication</category><title>MySQL error 1236: Client requested master to start replication from impossible position</title><description>&lt;span style="font-size: large;"&gt;&lt;b&gt;Symptoms:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
[1236] Got fatal error 1236 from master when reading data from binary 
log: 'Client requested master to start replication from impossible 
position'&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;110902 16:47:08 [ERROR] Error reading packet from server: Client requested master to start replication from impossible position ( server_errno=1236)&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;110902 16:47:08 [ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position', Error_code: 1236&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;110902 16:47:08 [Note] Slave I/O thread exiting, read up to log '&lt;/span&gt;&lt;u style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;b&gt;mysql-bin.000033&lt;/b&gt;&lt;/u&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;', position &lt;/span&gt;&lt;u style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;b&gt;4621679&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;on the master&lt;/b&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;root@dimko:/var/lib/mysql# ls -la mysql-bin.000033&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;-rw-rw---- 1 mysql mysql &lt;/span&gt;&lt;u style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;b&gt;4620018&lt;/b&gt;&lt;/u&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; 2011-09-01 13:45 mysql-bin.000033&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;4620018 is less than &lt;/b&gt;&lt;b&gt;4621679, &lt;/b&gt;therefore it's an invalid position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;Causes:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Master server has crashed and the binlog cache has not been flushed to disk. Slave has recieved a new position, did not recieve data, and data gets lost in a crash (however it might have been written to table, but not in binlog).&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;Solution:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Use this CHANGE MASTER statement on the slave.&lt;br /&gt;
CHANGE MASTER TO MASTER_LOG_FILE=&lt;b&gt;&lt;u&gt;&lt;i&gt;[NEXT FILE]&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;, MASTER_LOG_POS=4;&lt;br /&gt;
SLAVE START;&lt;br /&gt;
&lt;br /&gt;
in my case that would be&lt;br /&gt;
&lt;br /&gt;
CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000034', MASTER_LOG_POS=4;&lt;br /&gt;
SLAVE START;&lt;br /&gt;
&lt;br /&gt;
I don't know why the master log position needs to be 4 for the new file.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;What happens:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
When the master server restarts it logs binary changes to a new binlog file, so that we minimize data loss by skipping to the next file (everything from the previous file was written already).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;Prevention&lt;/span&gt;&lt;/b&gt;:&lt;br /&gt;
Add this line to &lt;b style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;my.cnf&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;sync_binlog = 1&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;With this setting the master server flushes cache in the binlog after every write, so that in case of a crash you can lose one statement at most.&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-3320050343440464236?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2011/09/mysql-error-1236-client-requested.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-6832564444334035814</guid><pubDate>Wed, 27 Jul 2011 22:39:00 +0000</pubDate><atom:updated>2011-07-28T01:05:06.581+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>api</category><category domain='http://www.blogger.com/atom/ns#'>facebook</category><category domain='http://www.blogger.com/atom/ns#'>php</category><title>Facebook php-sdk 3.0 changes getLoginURL()</title><description>Somehow these frequent changes are still poorly documented. Documentation is scattered across forums, changelogs, code comments and docs pages. Never on the single place. This is horrible. I'm sorry Facebook people, but this makes you look incompetent.
&lt;br&gt;&lt;br&gt;
The most obvious change is the abandonment of the getSession method. I have also found out that getLoginURL has been changed.
&lt;br&gt;
'req_perms' has been changed to 'scope'
&lt;br&gt;
'next' has been changed to 'redirect_uri'
&lt;br&gt;
'cancel_url' option has been removed. You'll have to find another way. If the user denies access it will be redirected to 'redirect_uri'. The user will also be redirected to 'redirect_uri' if he clicks allow.
&lt;br&gt;
You can know if the user denied access by looking at these GET parameters:
&lt;pre&gt;
[error_reason] =&gt; user_denied 
[error] =&gt; access_denied 
[error_description] =&gt; The user denied your request.
&lt;/pre&gt;

Also worth knowing is that redirect_uri will not work every time on a single page load (without refreshing the page).
&lt;br&gt;
Explanation:
&lt;br&gt;
The first time the users sees the oauth dialog there will be two options: Allow and Deny. Both buttons will redirect to 'redirect_uri'.
&lt;br&gt;
The second time the user sees the oauth dialog, Deny option will be renamed to 'Leave app'. 'redirect_uri' will still work.
&lt;br&gt;
The third time and so on, the button 'Leave app' will redirect to facebook.com/home.php
&lt;br&gt;
&lt;br&gt;
While this may not be entirely precise, it is true that eventually the Deny/Leave app button will not follow the redirect_uri parameter.
&lt;br&gt;
&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-6832564444334035814?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2011/07/facebook-php-sdk-30-changes-getloginurl.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-5397518531821383446</guid><pubDate>Sun, 24 Jul 2011 21:57:00 +0000</pubDate><atom:updated>2011-07-28T01:01:34.110+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>windows 7</category><category domain='http://www.blogger.com/atom/ns#'>iptv</category><category domain='http://www.blogger.com/atom/ns#'>windows</category><category domain='http://www.blogger.com/atom/ns#'>vlc</category><category domain='http://www.blogger.com/atom/ns#'>networking</category><title>SiOL TV, dve mrežni kartici, VLC player, Windows 7 x64-bit</title><description>V primeru da vam IPTv ne deluje, če imate dve mrežni kartici (eno za internet in drugo za TV), poskusite pri mrežnem adapterju za TV nastaviti metriko na 2.
&lt;br&gt;&lt;br&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://i.imgur.com/AucpC.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px;" src="http://i.imgur.com/AucpC.png" border="0" alt="" /&gt;&lt;/a&gt;
&lt;br&gt;&lt;br&gt;
Ne pozabite na ostale nastavitve za vzpostavitev TV na VLC playerju:&lt;br&gt;
-odprite VLC in pritisnite CTRL+P (Preferences)
&lt;br&gt;-spodaj levo obkljukate Show settings "All"-s tem se omogočijo napredne nastavitve
&lt;br&gt;-v meniju gremo na Input/Codecs - na desni pri UDP portu vnesemo pravi port, ki je za t2 "5000", pri MTU pa imam "1492", potem pa še obkljukamo "Force IPv4"
&lt;br&gt;-gremo v meni "Video" in nato kliknemo "output modules" - pri "Video output modules" izberemo možnost iz seznama "OpenGL video output"
&lt;br&gt;-nato v levem meniju izberemo meni "Stream output" in nato "Access output"
&lt;br&gt;-V Access output sem v okence kjer piše "Multicast output interface" vpisal IP mrežne kartice, ki jo uporabljam za internet, v okence "IPv4 multicast output interface adress" pa sem vpisal IP mrežne kartice, ki jo uporabljam zgolj za IPTV
&lt;br&gt;-zadevo shranite in ponovno zaženite program.
&lt;br&gt;&lt;br&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://i.imgur.com/DhS56.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px;" src="http://i.imgur.com/DhS56.png" border="0" alt="" /&gt;&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-5397518531821383446?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2011/07/siol-tv-dve-mrezni-kartici-vlc-player.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-7319337079219191620</guid><pubDate>Sun, 24 Jul 2011 10:56:00 +0000</pubDate><atom:updated>2011-07-24T13:03:19.436+02:00</atom:updated><title>M3U file editor</title><description>M3U are playlist files. I have developed this &lt;a href="http://kafol.net/code/m3u-edit/"&gt;simple editor&lt;/a&gt; for a friend, that needed to edit IPTv playlist files.
&lt;br&gt;&lt;br&gt;
The editor includes mass (bulk) edits as well as item editor. You can upload and export the same filetype.
&lt;br&gt;&lt;br&gt;
You can check out the editor here:
&lt;br&gt;
&lt;span style="font-weight:bold;"&gt;&lt;a href="http://kafol.net/code/m3u-edit/"&gt;http://kafol.net/code/m3u-edit/&lt;/a&gt;&lt;/span&gt;
&lt;br&gt;&lt;br&gt;
M3U files are easy to parse:
&lt;br&gt;
&lt;pre name="code" class="php"&gt;
&amp;lt;?
class m3u {
 public $data = array();
 public $name = '';
 
 public function __construct($data = null) {
  if(!is_null($data)) {
   $this-&amp;gt;load($data);
  }
 }
 
 public function load($data) {
  if(!is_array($data)) explode("\n",$data);
  
  foreach($data as $i=&amp;gt;$line) {
   if(preg_match('/^#EXTNAME:(.+)/is',$line,$m)) {
    $this-&amp;gt;name = clean($m[1]);
   }
   if(preg_match('/^#EXTINF:(\d+),(.+)/is',$line,$m)) {
    $item = new m3uitem();
    $item-&amp;gt;length = intval($m[1]);
    $item-&amp;gt;setName($m[2]);
    if(preg_match('/^#EXTTV:(.+)/is',$data[$i+1],$m)) {
     $item-&amp;gt;setCategories($m[1]);
    }
    $item-&amp;gt;file = trim($data[$i+2]);
    $this-&amp;gt;data[] = $item;
   }
  }
 }
 
 public function sort() {
  usort($this-&amp;gt;data, array(__CLASS__,'cmp'));
 }
 
 public static function cmp($a,$b) {
  if($a-&amp;gt;sort == $b-&amp;gt;sort) {
   return 0;
  }
  return ($a-&amp;gt;sort &amp;gt; $b-&amp;gt;sort) ? +1 : -1;
 }
 
 public function export() {
  $r = "#EXTM3U\n#EXTNAME:{$this-&amp;gt;name}\n\n";
  foreach($this-&amp;gt;data as $d) {
   $r .= "#EXTINF:{$d-&amp;gt;length},{$d-&amp;gt;getName()}\n";
   if($d-&amp;gt;getCategories() != '') {
    $r .= "#EXTTV:{$d-&amp;gt;getCategories()}\n";
   }
   $r .= "{$d-&amp;gt;file}\n\n";
  }
  return $r;
 }
 
}

class m3uitem {
 public $sort = 0;
 public $length = 0;
 public $file = '';
 private $name = '';
 private $categories = array();
 
 public function __construct() {}
 
 public function getName() { 
  return $this-&amp;gt;name; 
 }
 
 public function setName($name) {
  $this-&amp;gt;name = clean($name);
 }
 
 public function getCategories() {
  return implode(';',$this-&amp;gt;categories);
 }
 
 public function setCategories($data) {
  $this-&amp;gt;categories = is_array($data) ? $data : explode(';',clean($data));
  
  foreach($this-&amp;gt;categories as $i=&amp;gt;$cat) {
   if(empty($cat)) {
    unset($this-&amp;gt;categories[$i]);
   } else {
    $this-&amp;gt;categories[$i] = clean($this-&amp;gt;categories[$i]);
   }
  }
 }
}
?&amp;gt;
&lt;/pre&gt;
&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-7319337079219191620?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2011/07/m3u-file-editor.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-6144146686607791335</guid><pubDate>Tue, 19 Jul 2011 12:14:00 +0000</pubDate><atom:updated>2011-09-16T15:17:21.014+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>extensions</category><category domain='http://www.blogger.com/atom/ns#'>subtitles</category><category domain='http://www.blogger.com/atom/ns#'>vlc</category><category domain='http://www.blogger.com/atom/ns#'>videolan</category><category domain='http://www.blogger.com/atom/ns#'>lua</category><title>Automatically download subtitles in VLC player</title><description>You can write VideoLAN VLC player's extensions in LUA programming language.
Extensions are in Videolan\VLC directory lua\extensions.
&lt;br /&gt;
&lt;br /&gt;
This is a &lt;a href="http://addons.videolan.org/CONTENT/content-files/141787-subtitles-mod.lua"&gt;modified&lt;/a&gt; extension to automatically download subtitles.
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: 22px; font-weight: bold;"&gt;&lt;a href="http://kafol.net/code/vlc/AutoSubtitles.lua"&gt;Download extension&lt;/a&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
Will add more languages upon request.&lt;br /&gt;
Currently this extension is intended for personal use.&lt;br /&gt;
&lt;br /&gt;
Screenshots:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-m8F9CXzQmxE/TnMmaCHS1CI/AAAAAAAADXc/wl0Dzk7ByQI/s1600/lua.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://1.bp.blogspot.com/-m8F9CXzQmxE/TnMmaCHS1CI/AAAAAAAADXc/wl0Dzk7ByQI/s320/lua.PNG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-0IIVGWZbTwU/TnMmadVORWI/AAAAAAAADXg/XsztGxfQZuc/s1600/vlc.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="125" src="http://2.bp.blogspot.com/-0IIVGWZbTwU/TnMmadVORWI/AAAAAAAADXg/XsztGxfQZuc/s320/vlc.PNG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-6144146686607791335?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2011/07/automatically-download-subtitles-in-vlc.html</link><author>noreply@blogger.com (jean caffou)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-m8F9CXzQmxE/TnMmaCHS1CI/AAAAAAAADXc/wl0Dzk7ByQI/s72-c/lua.PNG' height='72' width='72'/><thr:total>6</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-4527988491585070308</guid><pubDate>Tue, 19 Jul 2011 12:11:00 +0000</pubDate><atom:updated>2011-07-19T14:12:54.687+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>api</category><category domain='http://www.blogger.com/atom/ns#'>goo.gl</category><category domain='http://www.blogger.com/atom/ns#'>urlshortener</category><category domain='http://www.blogger.com/atom/ns#'>php</category><category domain='http://www.blogger.com/atom/ns#'>google</category><title>PHP goo.gl url shortener</title><description>Here's an implementation of Google's url shortener: goo.gl.

&lt;pre name="code" class="php"&gt;
&amp;lt;?
class googl {
 const api = 'https://www.googleapis.com/urlshortener/v1/url';
 private $key = null;
 
 public function __construct($key = null) {
  if(defined('GOOGLE_API_KEY')) {
   $this-&amp;gt;setKey(GOOGLE_API_KEY);
  }
  
  if(!is_null($key)) {
   $this-&amp;gt;setKey($key);
  }
 }
 
 public function setKey($key) {
  $this-&amp;gt;key = $key;
 }
 
 public function s($url) {
  $data = $this-&amp;gt;shorten($url);
  return isset($data-&amp;gt;id) ? $data-&amp;gt;id : $url;
 }
 
 public function shorten($url) {
  $key = '';
  $data = array();
  $data['longUrl'] = $url;
  
  if(!is_null($this-&amp;gt;key)) {
   $key = '?key='.$this-&amp;gt;key;
  }
  
  return $this-&amp;gt;fetch(self::api.$key,$data);
 }
 
 public function expand($url) {
  $key = is_null($this-&amp;gt;key) ? '' : "&amp;key={$this-&amp;gt;key}";
  return $this-&amp;gt;fetch(self::api.'?shortUrl='.urlencode($url)."$key&amp;projection=FULL");
 }
 
 private function fetch($url, $data = array()) {
  $ch = curl_init();
  
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
  
  if(!empty($data)) {
   curl_setopt($ch, CURLOPT_POST, 1);
   curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
  }
  
  $r = curl_exec($ch);
  curl_close($ch);
  
  return json_decode($r);
 }
}
?&amp;gt;
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-4527988491585070308?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2011/07/php-googl-url-shortener.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-4774235784054013668</guid><pubDate>Wed, 25 May 2011 16:20:00 +0000</pubDate><atom:updated>2011-05-25T18:24:02.366+02:00</atom:updated><title>Disable Ubuntu Unity Launcher</title><description>I guess I'm the only one that hates launchers in desktop environment systems. They're too dumbed down and I can't tell which apps are running and which are just shortcuts.
&lt;br&gt;&lt;br&gt;
&lt;span style="font-weight:bold;"&gt;The easiest way to disable the Unity Netbook Launcher in Ubuntu is to log out from the session, click on the user name and before you enter the password, click on the bottom on the screen and switch to Ubuntu classic&lt;/span&gt;
&lt;br&gt;&lt;br&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.madtomatoe.com/wp-content/uploads/2011/04/Ubuntu-Unity-580x419.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 580px; height: 419px;" src="http://www.madtomatoe.com/wp-content/uploads/2011/04/Ubuntu-Unity-580x419.png" border="0" alt="" /&gt;&lt;/a&gt;
&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-4774235784054013668?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2011/05/disable-ubuntu-unity-launcher.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>4</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8709754195953818893.post-3557111790444108508</guid><pubDate>Wed, 27 Apr 2011 10:54:00 +0000</pubDate><atom:updated>2011-05-22T21:54:50.424+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>word</category><category domain='http://www.blogger.com/atom/ns#'>office</category><category domain='http://www.blogger.com/atom/ns#'>windows</category><title>Custom page numbering in MS Word</title><description>I'm sure most of you came across this problem before - how to add custom page numbering. 

&lt;br&gt;&lt;br&gt;
I don't really like making seperate documents for the pages I don't want numbered and options in MS Word are preety limited. You can set up the numbering to start with a different number. You can't, however, set it up to start with a negative number.

&lt;br&gt;
&lt;br&gt;
Example: You have the first three pages you don't want numbered (front page, page index, thanks). Everything after those pages is numbered and starts with 1.
&lt;br&gt;
&lt;br&gt;
- Go to the header/footer - wherever you want to set up page numbering.
&lt;br&gt;
- Add page numbering, set it up to start with zero and check the option to have a different header/footer on the first page. This way the front page will have the page number zero, but you can delete numbering for that page.
&lt;br&gt;
- Now you need to "extend" the first page, so that the second (or third) page will also be unnumbered. You can do this with page breaks, go to Insert -&gt; page break. There are a couple of different page breaks, choose the one that fits your needs.
&lt;br&gt;&lt;br&gt;
There's an other way to do a completely custom page numbering, but it involves a tiny amount of "programming" and it won't work the same if you add page index, but here goes:
&lt;br&gt;&lt;br&gt;
- Go to the header/footer
&lt;br&gt;
- Retype this code for the example above:
&lt;pre&gt;{ IF { PAGE } &lt; 4 "" "{ = { PAGE } - 3 }" }&lt;/pre&gt;
&lt;br&gt;&lt;br&gt;
The important thing here is that you need to press CTRL+F9 to get the curly braces. If you retype them, it won't work.
&lt;br&gt;
- After you've written the conditions for page numbering, right-click on it and choose "Update field".
&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;{ IF { PAGE } &lt; 4 "" "{ = { PAGE } - 3 }" }&lt;/pre&gt;
This is a simple conditional statement, if the current page number is less than four, the first argument (The empty "" string) will be used, otherwise it will calculate the current page number minus three.
&lt;br&gt;
&lt;br&gt;
Here are some other examples:
&lt;pre&gt;{ IF { PAGE } &lt; 3 "" "{ = { PAGE } - 2 }" }&lt;/pre&gt;
Skip the first two pages
&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;{ IF { PAGE } &lt; 3 "{ PAGE }" "{ = { PAGE } + 5 }" }&lt;/pre&gt;
Number the first two pages normally, then add 5 to the current page number.
&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;{ IF { PAGE } &lt; 3 "{ PAGE }" "" }&lt;/pre&gt;
Add a page number only to the first two pages.
&lt;br&gt;&lt;br&gt;
&lt;a href="http://word.mvps.org/faqs/numbering/pagenumbering.htm"&gt;Source&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8709754195953818893-3557111790444108508?l=dev.kafol.net' alt='' /&gt;&lt;/div&gt;</description><link>http://dev.kafol.net/2011/04/custom-page-numbering-in-ms-word.html</link><author>noreply@blogger.com (jean caffou)</author><thr:total>1</thr:total></item></channel></rss>
