<?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>Misadventures of a Celtic Geek &#187; programming</title>
	<atom:link href="http://blog.guesny.net/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.guesny.net</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Sun, 03 Jun 2012 19:25:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>IE session bug</title>
		<link>http://blog.guesny.net/2010/08/11/ie-session-bug-2/</link>
		<comments>http://blog.guesny.net/2010/08/11/ie-session-bug-2/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 07:43:10 +0000</pubDate>
		<dc:creator>welsh_dwarf</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[sessions]]></category>

		<guid isPermaLink="false">http://blog.guesny.net/?p=139</guid>
		<description><![CDATA[I&#8217;m just reposting this here so that it can help someone else. Internet Explorer doesn&#8217;t honor php sessions if the domaine name isn&#8217;t valid (hint: _ isn&#8217;t a valid caracter in domaine names). This can explain some hard to find &#8230; <a href="http://blog.guesny.net/2010/08/11/ie-session-bug-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m just reposting this here so that it can help someone else.<br />
Internet Explorer doesn&#8217;t honor php sessions if the domaine name isn&#8217;t valid (hint: _ isn&#8217;t a valid caracter in domaine names).<br />
This can explain some hard to find bugs where your session works fine on FF, chrome or Safari, but not in Internet Explorer.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.guesny.net/2010/08/11/ie-session-bug-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DynDNS and uptime</title>
		<link>http://blog.guesny.net/2010/03/27/dyndns-and-uptime/</link>
		<comments>http://blog.guesny.net/2010/03/27/dyndns-and-uptime/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 15:52:07 +0000</pubDate>
		<dc:creator>welsh_dwarf</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[personnel]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[dynamic dns]]></category>
		<category><![CDATA[dyndns]]></category>
		<category><![CDATA[ovh]]></category>

		<guid isPermaLink="false">http://blog.guesny.net/?p=109</guid>
		<description><![CDATA[Anyone who has tried to get into touch with me or read this blog these last few days can atest to the fact that I haven&#8217;t been reachable. My deepest apologies . To understand what happened, here&#8217;s a quick lowdown &#8230; <a href="http://blog.guesny.net/2010/03/27/dyndns-and-uptime/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Anyone who has tried to get into touch with me or read this blog these last few days can atest to the fact that I haven&#8217;t been reachable.</p>
<p>My deepest apologies <img src='http://blog.guesny.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> .</p>
<p>To understand what happened, here&#8217;s a quick lowdown on how my setup works:</p>
<p>I&#8217;m self hosting this blog as well as my mail on a converted EasyGate that I got as a beta tester. The machine is connected onto my internet router (a Trio 3D antique) and then onto the internet. My ISP provides a temporary IP address, and as such, I need to use a dynamic DNS record to be able to keep things updated.</p>
<p>Now, the Trio 3D (as with most of it&#8217;s features) has a half assed (excuse my French)  DynDNS system built in. I say half assed because it doesn&#8217;t accept any provider except the historic DynDNS and because it quite often forgets to update. Last week it completely stopped updating, and as an added bonus, I couldn&#8217;t get back into DynDNS to do things manually.</p>
<p>As a work around, I set up OVH (who are my registrar) to route my DNSes manually until I got a permanent fix. That worked until the IP changed Tuesday or Wednesday.</p>
<p>Now things are sorted out. I&#8217;m using OVH&#8217;s own DynDNS servers (much simpler) and am using a home built client to avoid all the dependancies other clients bought in.</p>
<p>The client is written in bash and depends on bash, sed and wget to work. It&#8217;s best used in a cron job, but can also be run on interface specific events if need be.</p>
<p>It uses a web based IP fetcher to work out your IP adresse, and if it&#8217;s changed since you last run the script, it updates your DynDNS records for you.</p>
<p>Without further ado, here&#8217;s the code:</p>
<pre lang="bash">#/bin/bash

USERNAME='myusername'
PASSWORD='mypassword'
HOSTS=('first_url.test.com' 'second_url.test.com')
SERVER="www.ovh.com"

#
#
#

CURRENT_IP=`wget -O - 'http://checkip.dyndns.org/' 2&gt;/dev/null | sed -e 's/.*Address: \([^&lt;]*\).*/\1/'` if [ -f /tmp/my_ip ]; then 	OLD_IP=`cat /tmp/my_ip`; fi # # Don't update unless ip has changed # if [ "x"$CURRENT_IP == "x"$OLD_IP ]; then 	exit; fi; echo "IP changed from " $OLD_IP " to " $CURRENT_IP echo "Saving new IP" echo $CURRENT_IP &gt; /tmp/my_ip

for HOST in ${HOSTS[@]};
do
	echo "Updating " $HOST " to " $CURRENT_IP
	wget -O - "http://${USERNAME}:${PASSWORD}@${SERVER}/nic/update?system=dyndns&amp;hostname=${HOST}&amp;myip=${CURRENT_IP}&amp;wildcard=NOCHG&amp;mx=NOCHG&amp;backmx=NOCHG" 2&gt;/dev/null
	echo ""
done</pre>
<p>Et voila, I hope this helps someone out there</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.guesny.net/2010/03/27/dyndns-and-uptime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On a soduku solver&#8230;</title>
		<link>http://blog.guesny.net/2009/10/03/on-a-soduku-solver/</link>
		<comments>http://blog.guesny.net/2009/10/03/on-a-soduku-solver/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 10:10:43 +0000</pubDate>
		<dc:creator>welsh_dwarf</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[personnel]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sudoku]]></category>

		<guid isPermaLink="false">http://blog.guesny.net/?p=84</guid>
		<description><![CDATA[Yesterday, when I was on the bus, I got pulled into a sudoku. Then I started wondering how a machine could be programmed to solve these puzzles. Note: For the rest of this post: A square is the un-devidable unit &#8230; <a href="http://blog.guesny.net/2009/10/03/on-a-soduku-solver/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yesterday, when I was on the bus, I got pulled into a sudoku. Then I started wondering how a machine could be programmed to solve these puzzles.</p>
<p>Note: For the rest of this post:</p>
<ul>
<li>A square is the un-devidable unit containing 1 number</li>
<li>A section is a 3&#215;3 grid of squares</li>
<li>A column is a 10 square vertical strip</li>
<li>A row is a 10 square horizontal strip</li>
<li>A board is the 9&#215;9 sudoku board</li>
</ul>
<p>There a few simple rules that go into solving these puzzles. Namely :</p>
<ul>
<li>What are the possible values for this square (based on row, column and section)</li>
<li>What are the possible places for this number (in this section)</li>
</ul>
<p>The two questions aren&#8217;t identical, since a numbers position can be influenced by the positions of numbers in other columns or rows that share the section.</p>
<p>The first question comes down to :</p>
<ol>
<li>Take the ensemble of possible numbers</li>
<li>Remove all that are already in the current row</li>
<li>Remove all that are already in the current column</li>
<li>Remove all that are already in the current section</li>
<li>if there is only one left, put it in the square</li>
<li>lather</li>
<li>rinse</li>
<li>repeat</li>
</ol>
<p>The second question comes down to:</p>
<p>For each number not entered in each section</p>
<ol>
<li>Check for number in the rows that pass through this section, eliminate the squares that belong to them if found</li>
<li>Check for number in the columns that pass through this section, eliminate the squares that belong to them if found</li>
<li>if only one square is left, put the number in it</li>
<li>&#8230;</li>
<li>profit</li>
</ol>
<p>OK, mabey that one&#8217;s a bit vague, I&#8217;ll try to make it clearer with a drawing</p>
<div id="attachment_91" class="wp-caption alignnone" style="width: 348px"><img class="size-full wp-image-91" title="Example" src="http://blog.guesny.net/wp-content/uploads/2009/09/sudoku1.png" alt="Example of a row and column problem" width="338" height="335" /><p class="wp-caption-text">Example of a row and column problem</p></div>
<p>In the above image, concentrate on the bottom middle section. If you look, you&#8217;ll notice that there are 4s in the top 2 rows of this section, we can conclude that our 4 must be on the bottom row. We also notice that there is a 4 in the left most column of this section, which only leaves the bottom middle square as a possibility for this 4.</p>
<p>By combining the 2 rules stated above, we should be able to solve any sudoku puzzle.</p>
<p>Any how, that&#8217;s all for now. Proof by code will be comeing in an update.</p>
<p><img src="file:///tmp/moz-screenshot-4.png" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.guesny.net/2009/10/03/on-a-soduku-solver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

