<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>UserPixel</title>
	<atom:link href="http://www.userpixel.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.userpixel.com</link>
	<description></description>
	<lastBuildDate>Tue, 21 Feb 2012 20:00:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>First Song v2</title>
		<link>http://www.userpixel.com/756</link>
		<comments>http://www.userpixel.com/756#comments</comments>
		<pubDate>Tue, 21 Feb 2012 19:58:36 +0000</pubDate>
		<dc:creator>Alex Hanif</dc:creator>
				<category><![CDATA[Music]]></category>
		<category><![CDATA[music creation]]></category>
		<category><![CDATA[piano]]></category>

		<guid isPermaLink="false">http://www.userpixel.com/?p=756</guid>
		<description><![CDATA[The second version of my first try to make music with my new USB MIDI adapter. Keyboard: Yamaha YPT-220 Software: Sekaiju 2.8 (Free GPL, Windows 7 64b) MIDI to MP3 converter: http://solmire.com Video Software: Microsoft Windows Movie Maker This work is available in MIDI or MP3 format for free if anyone is interested]]></description>
			<content:encoded><![CDATA[<p>The second version of my first try to make music with my new USB MIDI adapter.</p>
<ul>
<li>Keyboard: <a href="http://usa.yamaha.com/products/musical-instruments/keyboards/digitalkeyboards/portable_keyboards/ypt-220/?mode=model">Yamaha YPT-220</a></li>
<li>Software: <a href="http://openmidiproject.sourceforge.jp/Sekaiju_en.html">Sekaiju</a> 2.8 (Free GPL, Windows 7 64b)</li>
<li>MIDI to MP3 converter: <a href="http://solmire.com">http://solmire.com</a></li>
<li>Video Software: Microsoft Windows Movie Maker</li>
<li>This work is available in MIDI or MP3 format for free if anyone is interested</li>
</ul>
<p><iframe src="http://www.youtube.com/embed/PpfjK4ajqyk" frameborder="0" width="420" height="315"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.userpixel.com/756/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update needed</title>
		<link>http://www.userpixel.com/748</link>
		<comments>http://www.userpixel.com/748#comments</comments>
		<pubDate>Fri, 17 Feb 2012 14:42:17 +0000</pubDate>
		<dc:creator>Alex Hanif</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[painting]]></category>
		<category><![CDATA[thinking aloud]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.userpixel.com/?p=748</guid>
		<description><![CDATA[I&#8217;ve been very busy lately. The good news is that I have tons of painting to upload. But at the moment writing is not my first priority. However, I read weblogs of web development celebrities almost on a daily basis.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been very busy lately. The good news is that I have tons of painting to upload. But at the moment writing is not my first priority. However, I read weblogs of web development celebrities almost on a daily basis.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.userpixel.com/748/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lua function to traverse all files in a folder recursively</title>
		<link>http://www.userpixel.com/740</link>
		<comments>http://www.userpixel.com/740#comments</comments>
		<pubDate>Thu, 12 Jan 2012 12:37:17 +0000</pubDate>
		<dc:creator>Alex Hanif</dc:creator>
				<category><![CDATA[Tips&Tricks]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[lua]]></category>

		<guid isPermaLink="false">http://www.userpixel.com/?p=740</guid>
		<description><![CDATA[Here is a little function that uses Lua File System (lfs module) in order to traverse all the files in a folder and its sub folders (and their sub folders) recursively. DIR_SEP="\\" --should be "/" for Unix platforms (Linux and Mac) function browseFolder(root) for entity in lfs.dir(root) do if entity~="." and entity~=".." then local fullPath=root..DIR_SEP..entity [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a little function that uses Lua File System (lfs module) in order to traverse all the files in a folder and its sub folders (and their sub folders) recursively.</p>
<pre>DIR_SEP="\\" --should be "/" for Unix platforms (Linux and Mac)
function browseFolder(root)
	for entity in lfs.dir(root) do
		if entity~="." and entity~=".." then
			local fullPath=root..DIR_SEP..entity
			--print("root: "..root..", entity: "..entity..", mode: "..(lfs.attributes(fullPath,"mode")or "-")..", full path: "..fullPath)
			local mode=lfs.attributes(fullPath,"mode")
			if mode=="file" then
				--this is where the processing happens. I print the name of the file and its path but it can be any code
				print(root.." &gt; "..entity)
			elseif mode=="directory" then
				browseFolder(fullPath);
			end
		end
	end
end

--this is a sample call
browseFolder(".")
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.userpixel.com/740/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking IP address format in Lua</title>
		<link>http://www.userpixel.com/736</link>
		<comments>http://www.userpixel.com/736#comments</comments>
		<pubDate>Mon, 09 Jan 2012 16:01:41 +0000</pubDate>
		<dc:creator>Alex Hanif</dc:creator>
				<category><![CDATA[Tips&Tricks]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[lua]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[tcpip]]></category>

		<guid isPermaLink="false">http://www.userpixel.com/?p=736</guid>
		<description><![CDATA[Here is a little function that I developed to test if a string is a valid IPv4 address (that is 4 numbers between 0 to 255 separated with &#8220;.&#8221;) ---checks if a string represents an ip address -- @return true or false function isIpAddress(ip) if not ip then return false end local a,b,c,d=ip:match("^(%d%d?%d?)%.(%d%d?%d?)%.(%d%d?%d?)%.(%d%d?%d?)$") a=tonumber(a) b=tonumber(b) [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a little function that I developed to test if a string is a valid IPv4 address (that is 4 numbers between 0 to 255 separated with &#8220;.&#8221;)</p>
<pre>---checks if a string represents an ip address
-- @return true or false
function isIpAddress(ip)
 if not ip then return false end
 local a,b,c,d=ip:match("^(%d%d?%d?)%.(%d%d?%d?)%.(%d%d?%d?)%.(%d%d?%d?)$")
 a=tonumber(a)
 b=tonumber(b)
 c=tonumber(c)
 d=tonumber(d)
 if not a or not b or not c or not d then return false end
 if a&lt;0 or 255&lt;a then return false end
 if b&lt;0 or 255&lt;b then return false end
 if c&lt;0 or 255&lt;c then return false end
 if d&lt;0 or 255&lt;d then return false end
 return true
end</pre>
<p>And here are some tests:</p>
<pre>assert(isIpAddress("1.1.1.1")==true)
assert(isIpAddress("255.1.1.1")==true)
assert(isIpAddress("255.255.0.0")==true)
assert(isIpAddress("0.0.0.0")==true)
assert(isIpAddress("255.255.255.255")==true)
assert(isIpAddress("0.0.0.1")==true)
assert(isIpAddress("0.0.1.1")==true)
assert(isIpAddress("0.1.1.1")==true)
assert(isIpAddress("1.2.3.4")==true)
assert(isIpAddress(nil)==false)
assert(isIpAddress("")==false)
assert(isIpAddress("1")==false)
assert(isIpAddress("1.2")==false)
assert(isIpAddress("1.2.3")==false)
assert(isIpAddress("1.2.3.4.")==false)
assert(isIpAddress(".1.2.3.4")==false)
assert(isIpAddress("0")==false)
assert(isIpAddress("-1")==false)
assert(isIpAddress("256")==false)
assert(isIpAddress("-1.2.3.4")==false)
assert(isIpAddress("1.-2.3.4")==false)
assert(isIpAddress("1.2.-3.4")==false)
assert(isIpAddress("1.2.3.-4")==false)
assert(isIpAddress("256.2.3.4")==false)
assert(isIpAddress("1.256.3.4")==false)
assert(isIpAddress("1.2.256.4")==false)
assert(isIpAddress("1.2.3.256")==false)
assert(isIpAddress("256.256.256.256")==false)
assert(isIpAddress("1000.0.0.0")==false)
assert(isIpAddress("a.b.c.d")==false)
assert(isIpAddress("a.2.c.d")==false)
assert(isIpAddress("a.b.3.d")==false)
assert(isIpAddress("a.b.c.4")==false)</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.userpixel.com/736/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What are all the valid subnet masks</title>
		<link>http://www.userpixel.com/734</link>
		<comments>http://www.userpixel.com/734#comments</comments>
		<pubDate>Mon, 09 Jan 2012 14:32:50 +0000</pubDate>
		<dc:creator>Alex Hanif</dc:creator>
				<category><![CDATA[Tips&Tricks]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[lua]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[tcpip]]></category>

		<guid isPermaLink="false">http://www.userpixel.com/?p=734</guid>
		<description><![CDATA[Here are all the valid subnet masks for IPv4: 128.0.0.0 192.0.0.0 224.0.0.0 240.0.0.0 248.0.0.0 252.0.0.0 254.0.0.0 255.0.0.0 255.128.0.0 255.192.0.0 255.224.0.0 255.240.0.0 255.248.0.0 255.252.0.0 255.254.0.0 255.255.0.0 255.255.128.0 255.255.192.0 255.255.224.0 255.255.240.0 255.255.248.0 255.255.252.0 255.255.254.0 255.255.255.0 255.255.255.128 255.255.255.192 255.255.255.224 255.255.255.240 255.255.255.248 255.255.255.252 255.255.255.254 The following Lua script was used to calculate those values: map={ ["00000000"]="0", ["10000000"]="128", ["11000000"]="192", ["11100000"]="224", [...]]]></description>
			<content:encoded><![CDATA[<p>Here are all the valid subnet masks for IPv4:</p>
<ol>
<li>128.0.0.0</li>
<li>192.0.0.0</li>
<li>224.0.0.0</li>
<li>240.0.0.0</li>
<li>248.0.0.0</li>
<li>252.0.0.0</li>
<li>254.0.0.0</li>
<li>255.0.0.0</li>
<li>255.128.0.0</li>
<li>255.192.0.0</li>
<li>255.224.0.0</li>
<li>255.240.0.0</li>
<li>255.248.0.0</li>
<li>255.252.0.0</li>
<li>255.254.0.0</li>
<li>255.255.0.0</li>
<li>255.255.128.0</li>
<li>255.255.192.0</li>
<li>255.255.224.0</li>
<li>255.255.240.0</li>
<li>255.255.248.0</li>
<li>255.255.252.0</li>
<li>255.255.254.0</li>
<li>255.255.255.0</li>
<li>255.255.255.128</li>
<li>255.255.255.192</li>
<li>255.255.255.224</li>
<li>255.255.255.240</li>
<li>255.255.255.248</li>
<li>255.255.255.252</li>
<li>255.255.255.254</li>
</ol>
<p>The following Lua script was used to calculate those values:</p>
<pre>map={
  ["00000000"]="0",
  ["10000000"]="128",
  ["11000000"]="192",
  ["11100000"]="224",
  ["11110000"]="240",
  ["11111000"]="248",
  ["11111100"]="252",
  ["11111110"]="254",
  ["11111111"]="255"
}
for i=1,31 do
  s=string.rep("1",i)..string.rep("0",32-i)
  print(map[s:sub( 1, 8)].."."..map[s:sub( 9,16)].."."..map[s:sub(17,24)].."."..map[s:sub(25,32)])
end</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.userpixel.com/734/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New paper</title>
		<link>http://www.userpixel.com/730</link>
		<comments>http://www.userpixel.com/730#comments</comments>
		<pubDate>Sun, 01 Jan 2012 10:13:05 +0000</pubDate>
		<dc:creator>Alex Hanif</dc:creator>
				<category><![CDATA[Drawing]]></category>
		<category><![CDATA[doodles]]></category>
		<category><![CDATA[random drawing]]></category>

		<guid isPermaLink="false">http://www.userpixel.com/?p=730</guid>
		<description><![CDATA[Apparently back side of the paper I have is much better than its front side!]]></description>
			<content:encoded><![CDATA[<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://www.userpixel.com/wp-content/uploads/2012/01/wpid-IMAG0129.jpg" /></p>
<p>Apparently back side of the paper I have is much better than its front side! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.userpixel.com/730/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up Tele2 Huawei e367 3G modem on Linux (Ubuntu 11.04)</title>
		<link>http://www.userpixel.com/723</link>
		<comments>http://www.userpixel.com/723#comments</comments>
		<pubDate>Sat, 31 Dec 2011 10:21:45 +0000</pubDate>
		<dc:creator>Alex Hanif</dc:creator>
				<category><![CDATA[Tips&Tricks]]></category>
		<category><![CDATA[3g]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[modem]]></category>
		<category><![CDATA[settings]]></category>
		<category><![CDATA[tele2]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.userpixel.com/?p=723</guid>
		<description><![CDATA[I needed to connect my Tele2 usb modem to Ubuntu and here is a good solution. It&#8217;s basically these lines that made it work: $ cd /etc/usb_modeswitch.d $ sudo tar xzf /usr/share/usb_modeswitch/configPack.tar.gz 12d1:1446 $ sudo sed -i -e 's/14ac"/14ac,1506"/' 12d1\:1446 Also it seems that the following command is required for it to work: $ sudo [...]]]></description>
			<content:encoded><![CDATA[<p>I needed to connect my Tele2 usb modem to Ubuntu and <a href="https://bugs.launchpad.net/ubuntu/+source/usb-modeswitch-data/+bug/776959">here is a good solution</a>.</p>
<p>It&#8217;s basically these lines that made it work:</p>
<pre>$ cd /etc/usb_modeswitch.d
$ sudo tar xzf /usr/share/usb_modeswitch/configPack.tar.gz 12d1:1446
$ sudo sed -i -e 's/14ac"/14ac,1506"/' 12d1\:1446</pre>
<p>Also <a href="https://bugs.launchpad.net/ubuntu/+source/usb-modeswitch-data/+bug/776959">it seems</a> that the following command is required for it to work:</p>
<pre>$ sudo modprobe usbserial vendor=0x12d1 product=0x1506</pre>
<p>After that, you need to configure Ubuntu Network Connections (the little network icon on the top right of the screen near the speaker icon). Go to &#8220;Mobile Broadband&#8221; tab, click &#8220;Add&#8221;. Select &#8220;Sweden&#8221; as your country, &#8220;Tele2&#8243; as your operator and &#8220;Mobile Bredband&#8221; as your data plan.<br />
Then use the following configurations:</p>
<ul>
<li>PIN1: ***** (your pin code)</li>
<li>connection type: NDIS</li>
<li>access point: mobileinternet.tele2.se</li>
<li>Phone number: *99#</li>
<li>Username and password: Not used (leave empty)</li>
<li>Password Authentication Protocol: CHAP (to be safe you can select all of them)</li>
<li>IP address: Dynamic</li>
<li>DNS address : Dynamic</li>
<li>WINS address: Dynamic</li>
</ul>
<p>PS. The Linux version of the driver is really stable! I share the Internet using an Asus Eee Box and an access point to 4 other wireless devices at home. In Windows, the device used to get disconnected and sometimes it had to be removed from the USB port and inserted again (even when using the latest driver from Huawei). In Linux this hasn&#8217;t happened during the last week.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.userpixel.com/723/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flying elevator</title>
		<link>http://www.userpixel.com/721</link>
		<comments>http://www.userpixel.com/721#comments</comments>
		<pubDate>Thu, 29 Dec 2011 22:54:00 +0000</pubDate>
		<dc:creator>Alex Hanif</dc:creator>
				<category><![CDATA[Stories]]></category>
		<category><![CDATA[elevator]]></category>
		<category><![CDATA[stockholm]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.userpixel.com/?p=721</guid>
		<description><![CDATA[I don&#8217;t know how fast this was going but I am could feel the pressure in my ears when I used this elevator.]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know how fast this was going but I am could feel the pressure in my ears when I used this elevator. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.userpixel.com/721/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hamed&#8217;s woman</title>
		<link>http://www.userpixel.com/716</link>
		<comments>http://www.userpixel.com/716#comments</comments>
		<pubDate>Sun, 18 Dec 2011 12:31:29 +0000</pubDate>
		<dc:creator>Alex Hanif</dc:creator>
				<category><![CDATA[Drawing]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[girl]]></category>
		<category><![CDATA[hamed]]></category>
		<category><![CDATA[pencil drawing]]></category>

		<guid isPermaLink="false">http://www.userpixel.com/?p=716</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.userpixel.com/wp-content/uploads/2011/12/Hameds-woman-processed.jpg"><img class="aligncenter size-medium wp-image-717" title="Hameds woman" src="http://www.userpixel.com/wp-content/uploads/2011/12/Hameds-woman-processed-276x300.jpg" alt="" width="276" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.userpixel.com/716/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Santa</title>
		<link>http://www.userpixel.com/713</link>
		<comments>http://www.userpixel.com/713#comments</comments>
		<pubDate>Sun, 18 Dec 2011 12:29:45 +0000</pubDate>
		<dc:creator>Alex Hanif</dc:creator>
				<category><![CDATA[Drawing]]></category>
		<category><![CDATA[pencil drawing]]></category>
		<category><![CDATA[santa]]></category>

		<guid isPermaLink="false">http://www.userpixel.com/?p=713</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.userpixel.com/wp-content/uploads/2011/12/Santa-Processed.jpg"><img class="aligncenter size-medium wp-image-714" title="Santa" src="http://www.userpixel.com/wp-content/uploads/2011/12/Santa-Processed-191x300.jpg" alt="" width="191" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.userpixel.com/713/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

