<?xml version="1.0" encoding="iso-8859-1" ?> 
<rss version="2.0">
<channel>
<title>yoy.be - Why-O-Why</title> 
<link>http://yoy.be/</link> 
<description>yoy.be - Why-O-Why - is it a structure wiki? is it a blog? does it have any answers or only questions?</description> 
<item>
		<link>http://yoy.be/item.asp?i3008</link>
		<title>COM/ActiveX objects and Windows Vista and newer</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic91.png" width="16" height="16" border="0" align="top" /> COM/ActiveX objects and Windows Vista and newer<br /><p>Applications that provide one or more <span class="newwiki">ActiveX</span>/<span class="newwiki">COM</span> automation objects, created with older versions of Delphi, running without administrative privileges, throw an&nbsp;<span class="newwiki">EOleSysError</span> when strarting up (typically from within the <code>Application.Initialize;</code>). This is because the application will try to register its type library and class registrations when it starts. Add this unit to the project to silent this error at run-time:</p>
<pre><strong>unit</strong> comFixW6;

<strong>interface</strong>

<strong>implementation</strong>

<strong>uses</strong> Windows, SysUtils, ComObj;

<strong>var</strong>
  SaveInitProc:pointer=<strong>nil</strong>;

<strong>procedure</strong> FixComInitProc;
<strong>begin</strong>
  <strong>try</strong>
    <strong>if</strong> SaveInitProc&lt;&gt;<strong>nil</strong> <strong>then</strong> TProcedure(SaveInitProc);
  <strong>except</strong>
    <strong>on</strong> e:EOleSysError <strong>do</strong> <strong>if</strong> e.ErrorCode&lt;&gt;TYPE_E_REGISTRYACCESS <strong>then</strong> <strong>raise</strong>;
  <strong>end</strong>;
<strong>end</strong>;

<strong>initialization</strong>
  SaveInitProc:=InitProc;
  InitProc:=@FixComInitProc;

<strong>end</strong>.</pre><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i78" style="white-space: nowrap;"><img src="http://yoy.be/img/ic81.png" width="16" height="16" border="0" align="top" /> Application Development</a> &gt; <a href="http://yoy.be/item.asp?i80" style="white-space: nowrap;"><img src="http://yoy.be/img/ic85.png" width="16" height="16" border="0" align="top" /> Programming Languages</a> &gt; <a href="http://yoy.be/item.asp?i1595" style="white-space: nowrap;"><img src="http://yoy.be/img/ic86.png" width="16" height="16" border="0" align="top" /> Object Pascal</a> &gt; <a href="http://yoy.be/item.asp?i81" style="white-space: nowrap;"><img src="http://yoy.be/img/ic85.png" width="16" height="16" border="0" align="top" /> Delphi</a> &gt; <a href="http://yoy.be/item.asp?i91" style="white-space: nowrap;"><img src="http://yoy.be/img/ic84.png" width="16" height="16" border="0" align="top" /> ActiveX / COM objects</a></span><br /> <span class="date">created: 2/02/2012 21:55:51 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 2/02/2012 22:01:41</span>
	 <span class="date">weight: 0</span>
	<br /><span class="label">tokens:</span> <a href="http://yoy.be/log.asp?tt27*"><img src="http://yoy.be/img/cat/cat_delphi.gif" width="50" height="13" border="0" align="top" alt="delphi" /></a>  <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i3008</guid>
		<comments>http://yoy.be/report.asp?i3008</comments>
		<pubDate>Thu, 2 Feb 2012 21:01:40 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i3006</link>
		<title>&gt;=, &lt;= operators</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic49.png" width="16" height="16" border="0" align="top" /> &gt;=, &lt;= operators<br /><p>Very nice, I'm trying it.<br />
<br />
Is there a way to use &gt;=. &lt;= operators for quering objects? I know I should use &amp;gt, but, how to use it with <span class="newwiki">TMongoWireQuery</span>?</p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i108" style="white-space: nowrap;"><img src="http://yoy.be/img/ic85.png" width="16" height="16" border="0" align="top" /> freeware</a> &gt; <a href="http://yoy.be/item.asp?i2949" style="white-space: nowrap;"><img src="http://yoy.be/img/ic82.png" width="16" height="16" border="0" align="top" /> TMongoWire</a></span><br /> <span class="date">created: 2/02/2012 14:02:01 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 2/02/2012 21:31:28</span>
	 <span class="date">weight: -100</span>
	<br /><span class="label">tokens:</span> <a href="http://yoy.be/log.asp?tt25*"><img src="http://yoy.be/img/cat/cat_coding.gif" width="50" height="13" border="0" align="top" alt="coding" /></a>  <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i3006</guid>
		<comments>http://yoy.be/report.asp?i3006</comments>
		<pubDate>Thu, 2 Feb 2012 20:31:28 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i3004</link>
		<title>Delphi 6: Sockets.pas doesn't call WinSock.closesocket!!!</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic82.png" width="16" height="16" border="0" align="top" /> Delphi 6: Sockets.pas doesn't call WinSock.closesocket!!!<br /><p>I've made a strange discovery! The code in Delphi's default Sockets.pas doesn't call <span class="newwiki">WinSock</span>'s closesocket! (At least Delphi 6, newer versions may have this fixed)&nbsp;Which causes a handle leak when you use <span class="newwiki">TTCPClient</span> and related classes. (At least in Delphi 6 and 7, I haven't been able to check newer versions.)<br />
<strong>Update:</strong> I've found <a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=1845">this item on edc's qc</a>&nbsp;(from 2002!)</p>
<p>I've done extensive debugging to find out which would make the best work-around and this is what I came up with:</p>
<pre><strong>class</strong>
  TMyTCPClient = <strong>class</strong>(TTCPClient)<br />  <strong>public<br />    procedure</strong> Close; <strong>override</strong>;
  <strong>end</strong>;<br /> <br /><br /><strong>procedure</strong> TMyTCPClient.Close;<br /><strong>var</strong><br />&nbsp; h:TSocket;<br /><strong>begin</strong><br />&nbsp; h:=Handle;<br />&nbsp; <strong>inherited</strong>;<br />&nbsp; <strong>if</strong> h&lt;&gt;INVALID_SOCKET <strong>then</strong> closesocket(h);//handle leak?<br /><strong>end</strong>;</pre>
<p>You need to keep a local copy of the Handle value, since <em>inherited</em> performs shutdown-code, but also sets the socket handle value to <em><span class="newwiki">INVALID</span>_<span class="newwiki">SOCKET</span></em> without calling closesocket.</p>
<p>There appears to be an <span class="newwiki">OnDestroyHandle</span> event, but the socket's handle is no longer available by the time it gets called.</p>
<p>It's a nasty little bug that also only pops up unexpectedly after a long time running. It&nbsp;took me a pretty long while with intensive sleuthing now and them, but I'm glad I found this.</p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i78" style="white-space: nowrap;"><img src="http://yoy.be/img/ic81.png" width="16" height="16" border="0" align="top" /> Application Development</a> &gt; <a href="http://yoy.be/item.asp?i80" style="white-space: nowrap;"><img src="http://yoy.be/img/ic85.png" width="16" height="16" border="0" align="top" /> Programming Languages</a> &gt; <a href="http://yoy.be/item.asp?i1595" style="white-space: nowrap;"><img src="http://yoy.be/img/ic86.png" width="16" height="16" border="0" align="top" /> Object Pascal</a> &gt; <a href="http://yoy.be/item.asp?i81" style="white-space: nowrap;"><img src="http://yoy.be/img/ic85.png" width="16" height="16" border="0" align="top" /> Delphi</a></span><br /> <span class="date">created: 30/01/2012 14:43:11 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 2/02/2012 22:17:10</span>
	 <span class="date">weight: 0</span>
	<br /> <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i3004</guid>
		<comments>http://yoy.be/report.asp?i3004</comments>
		<pubDate>Thu, 2 Feb 2012 21:17:09 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i3003</link>
		<title>Printer.Canvas is not threadsafe!</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic84.png" width="16" height="16" border="0" align="top" /> Printer.Canvas is not threadsafe!<br /><p>What a strange discovery I made today. I was hunting down&nbsp;a weird exception we noticed in the logs of the live system.</p>
<p>It turns out that a 'global' callback procedure is being called when you use Printer.Canvas (Printer.Canvas.<span class="newwiki">StretchDraw</span> in my case) by the <span class="newwiki">GDI</span> subsystem. The default <span class="newwiki">AbortProc</span> in Printers.pas calls Application.<span class="newwiki">ProcessMessages</span>, which was causing trouble in my case.</p>
<p>There's a quick workaround:</p>
<pre><strong>function</strong> MyAbortProc(Prn: HDC; Error: Integer): Bool; <strong>stdcall</strong>;
<strong>begin</strong>
  Result := <strong>not</strong> FPrinter.Aborted;
<strong>end</strong>;</pre>
<p>And then right after <code>Printer.BeginDoc;</code> call <code>SetAbortProc(Printer.Canvas.Handle,MyAbortProc);</code></p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i78" style="white-space: nowrap;"><img src="http://yoy.be/img/ic81.png" width="16" height="16" border="0" align="top" /> Application Development</a> &gt; <a href="http://yoy.be/item.asp?i80" style="white-space: nowrap;"><img src="http://yoy.be/img/ic85.png" width="16" height="16" border="0" align="top" /> Programming Languages</a> &gt; <a href="http://yoy.be/item.asp?i1595" style="white-space: nowrap;"><img src="http://yoy.be/img/ic86.png" width="16" height="16" border="0" align="top" /> Object Pascal</a> &gt; <a href="http://yoy.be/item.asp?i81" style="white-space: nowrap;"><img src="http://yoy.be/img/ic85.png" width="16" height="16" border="0" align="top" /> Delphi</a></span><br /> <span class="date">created: 26/01/2012 19:46:39 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 26/01/2012 19:46:39</span>
	 <span class="date">weight: -200</span>
	<br /><span class="label">tokens:</span> <a href="http://yoy.be/log.asp?tt27*"><img src="http://yoy.be/img/cat/cat_delphi.gif" width="50" height="13" border="0" align="top" alt="delphi" /></a>  <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i3003</guid>
		<comments>http://yoy.be/report.asp?i3003</comments>
		<pubDate>Thu, 26 Jan 2012 18:46:38 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2999</link>
		<title>Trajectmeting E17</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic41.png" width="16" height="16" border="0" align="top" /> Trajectmeting E17<br /><p>Achthonderdduizend euro! Achthonderd duizend euro is al besteed aan een systeem om op twee punten langs een weg een poging te doen om je nummerplaat geautomatiseerd te lezen, en aan de hand van de tijd daartussen vast te stellen of de bestuurder zich hield aan de maximumsnelheid of niet. Eerst las ik dat er abnormaal zware voorwaarden waren gesteld om te blijven opereren in extreme condities zoals diepe vorst, maar daarna las ik dat er ernstige fouten zaten in zelfs de allerlaatste test-metingen. Het eerste is misschien storend, maar heb ik begrip voor, dat laatste is ronduit verschrikkelijk.</p>
<p>Ik vermoed, <a href="http://www.humo.be/humo-dossiers/26632">ook hier</a>, dat er offertes zijn opgehaald bij precies drie bedrijven (omdat het er minimum drie moeten zijn), eentje belachelijk duur, eentje terecht duur, maar te duur in vergelijking met de derde en goedkoopste. Ik schreef bijna belachelijk goedkoop, maar achthonderdduizend blijft een bedrag dat ik wel eens graag bij de lotto zou willen winnen (minimum natuurlijk). Ik hoef u er waarschijnlijk niet bij te vertellen welke twee van de drie het beste voor-onderzoek voor hebben gedaan.</p>
<p>Het grappige aan dit alles is dat ik laatst op het werk een <em>proof-of-concept</em> opstelling heb opgesteld om met een minimum aan middelen 'barcodes in de verkeerde richting' te scannen langs een transportband. Ik gebruikte open-source-software en een webcam die we als relatiegeschenk kregen en in de kast was beland. Als ik even mijn eigen bestede tijd niet reken, dan kom ik zelfs niet met een veelvoud van mijn budget aan het totaal van de offerte die we een professionele firma lieten opstellen, want alle veelvouden van nul zijn ook nul.</p>
<p>Misschien is dit niet helemaal te vergelijken met juridisch geldige trajectmeting op de openbare weg, maar volg even mee. Tijdens het familiale chaufferen van het voorbije oud-en-nieuw-weekend, speelde ik met het volgende in gedachten. De grootste materiaalkost zou moeten de beeldvormende toestellen zijn. Daar kan je niet rond. Ik lees dat er voor de trajectmeting op de E17 voor infra-rood werd gekozen, maar dit ernstige invloeden ondervind van wind en weer. Dit zou beter zijn om de tekst op nummerplaten waar te nemen, maar ik geloof dit niet echt. Een nummerplaat is nog altijd bedoeld om het best met het blote oog waar te nemen. Dus gebruiken we best 'gewone' camera's die zichtbaar licht meten. Dit zal ook de kost drukken want je vind ze nagenoeg overal tegenwoordig.</p>
<p>In een andere dimensie, bijvoorbeeld een waar ik het voor het zeggen zou hebben, zou de inrichtende macht gewoon kunnen opleggen dat elke nummerplaat moet magnetisch of radiografisch reageren op een elektronische lus in het wegdek met een digitale code die de belettering van de nummerplaat reproduceert, maar dit ligt waarschijnlijk zowel politiek als inzake privacy best gevoelig.</p>
<p>Dan, eenmaal je beeld kan vastleggen, moet je op zoek naar de nummerplaat. Er bestaat waarschijnlijk wel open-source <span class="newwiki">OCR</span> software (of er zou er moeten bestaan), maar die zou ik niet zomaar loslaten op het rauwe beeldmateriaal. Meeste nummerplaten zijn van dezelfde grootte, en dus zou je moeten kunnen snel op zoek gaan in het beeld naar een rechthoek van deze verhouding. Nummerplaten hangen meestal horizontaal, da's ook handig. Zelfs als je geen nummerplaat kan waarnemen, ik denk aan bezoekers uit het buitenland of tijdelijke oplossingen achter de voorruit, dan zou ik er durven op wedden dat de specifieke verhouding van breedte en hoogte, en eventueel andere kenmerken van de omtrek, van alle auto's die tegelijk op het stuk trajectmeting aanwezig zijn, een behoorlijk hoge graad van uniciteit vertoont (<a href="http://www.google.be/search?q=finger+length+biometric">een beetje zoals deze</a>).</p>
<p>Deze gegevens moeten allemaal nog verwerkt worden, maar veel moet dat niet kosten. Tegenwoordig worden rekeneenheden niet alleen veel kleiner maar ook veel goedkoper. (<a href="http://www.raspberrypi.org/">Ken je deze?</a>) En iets anders kiezen dan 'gewone' <span class="newwiki">STP</span> netwerkkabels zoals ze overal al liggen zou ik ook niet doen.</p>
<p>Dit alles zou toch veel minder moeten kosten dan wat nu al weer is verdwenen van de staatsrekeningen? Toegegeven, er kruipt nog een hoop werk in. Tegen weer en wind de dingen gaan ophangen. Uitgebreid testen, finetunen, controleren... Maar net dat zijn ze nu waarschijnlijk ook aan het doen. Al maanden lang.</p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i135" style="white-space: nowrap;"><img src="http://yoy.be/img/ic113.png" width="16" height="16" border="0" align="top" /> Opinions</a> &gt; <a href="http://yoy.be/item.asp?i339" style="white-space: nowrap;"><img src="http://yoy.be/img/ic113.png" width="16" height="16" border="0" align="top" /> &quot;.be&quot;-related</a></span><br /> <span class="date">created: 2/01/2012 8:29:04 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 2/01/2012 8:30:29</span>
	 <span class="date">weight: 0</span>
	<br /><span class="label">tokens:</span> <a href="http://yoy.be/log.asp?tt34*"><img src="http://yoy.be/img/cat/cat_politiek.gif" width="50" height="13" border="0" align="top" alt="politiek" /></a> <a href="http://yoy.be/log.asp?tt37*"><img src="http://yoy.be/img/cat/cat_actueel.gif" width="50" height="13" border="0" align="top" alt="actueel" /></a>  <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2999</guid>
		<comments>http://yoy.be/report.asp?i2999</comments>
		<pubDate>Mon, 2 Jan 2012 07:30:29 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2993</link>
		<title>Een 'eenvoudige' controle bij aanbestedingen?</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic41.png" width="16" height="16" border="0" align="top" /> Een 'eenvoudige' controle bij aanbestedingen?<br /><p>Ik had een idee deze morgen. Stel dat een ambtenaar op zoek moet naar een minimum aantal offertes voor een openbare aanbesteding voor iets heel specifiek. Hij/zij vind er eentje, maar moet er meer hebben volgens de regels. Stel dat alle contacten en het zoeken in de buurt en het bedrijfsregister niets opleveren, wat dan? Nu dacht ik, stel dat die terecht kan bij de federatie van de sector. Ik weet niet of de staat federaties van verscheidene bedrijfstakken herkent, maar die zouden toch goed geplaatst moeten zijn om over een overzicht te beschikken van welke leden welk specifiek werk zouden kunnen verrichten voor de staat (aan de beste prijs/kwaliteit). Of als er te weinig zijn onder de leden een initiatief nemen om een nieuwe samenwerken op te zetten.</p>
<p>Meer nog, welke controle op offertes in openbare aanbestedingen is er eigenlijk? Zelfs als er aan een minimum aantal is voldaan, zou ook daar niet een vakfederatie goed geplaatst zijn om het kaf van het koren te scheiden? En misschien zelfs een extra filter op corruptie te zijn. Als ze zelf niet te correupt zijn natuurlijk... Dus hoe zou de controle op beroepsfederaties moeten gebeuren?</p>
<p>Maar ik zit waarschijnlijk maar wat uit mijn nek te kletsen, want eigenlijk ken ik daar helemaal niets van.</p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i135" style="white-space: nowrap;"><img src="http://yoy.be/img/ic113.png" width="16" height="16" border="0" align="top" /> Opinions</a> &gt; <a href="http://yoy.be/item.asp?i339" style="white-space: nowrap;"><img src="http://yoy.be/img/ic113.png" width="16" height="16" border="0" align="top" /> &quot;.be&quot;-related</a></span><br /> <span class="date">created: 17/11/2011 23:30:10 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 17/11/2011 23:30:10</span>
	 <span class="date">weight: 0</span>
	<br /><span class="label">tokens:</span> <a href="http://yoy.be/log.asp?tt34*"><img src="http://yoy.be/img/cat/cat_politiek.gif" width="50" height="13" border="0" align="top" alt="politiek" /></a>  <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2993</guid>
		<comments>http://yoy.be/report.asp?i2993</comments>
		<pubDate>Thu, 17 Nov 2011 22:30:10 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2992</link>
		<title>Vet-taks? Wat dacht je van een anti-cocooning-taks?</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic42.png" width="16" height="16" border="0" align="top" /> Vet-taks? Wat dacht je van een anti-cocooning-taks?<br /><p>De vet-taks. Geen rokers in de horeca. Een strengen voedsel-inspectie. Cocooning en de verzuring van de maatschappij. Politieke desinteresse. Nog 5 miljard extra inkomsten zoeken. Al dat economisch en politiek nieuws doet rare dingen in mijn hoofd.</p>
<p>Plots dacht ik zo wat het zou doen als ze een ongunstig <span class="newwiki">BTW</span>-regime zouden instellen voor voeding voor thuis-gebruik. Niet alleen vette voeding of kant-en-klaar maaltijden, maar gewoon alle voedsel bedoeld om thuis te gebruiken. Samen met een verlaagd <span class="newwiki">BTW</span>-tarief voor de horeca zou het dan misschien wel lukken om de mensen ertoe te brengen meer buitenshuis te eten. Echte fauteuilaardappelen trekken hier misschien hun neus voor op, en denken misschien direct aan riant eten in een restaurant, maar een gewoon eethuis om de hoek is ook al goed.</p>
<p>De verhoogde vraag naar gewone maaltijden zou de plaatselijke economie ten goede komen. De werkgelegenheid. Misschien ook de volksgezondheid. Maar misschien vooral dat de mensen meer onder elkaar komen. Dat zou moeten het sociaal weefsel ten goede komen.</p>
<p>En zou het meer opbrengen voor de staat? Als het lukt om mensen meer te doen gebruik maken van het betere <span class="newwiki">BTW</span>-regime in de horeca, misschien niet, maar lijkt me helemaal niet erg. Als je ziet wat het op allemaal andere gebieden zou kunnen betekenen dan is de originele <span class="newwiki">BTW</span>-aanpassing eigenlijk maar een kleine operatie, maar die moet wel doelgericht en secuur worden uitgevoerd. En ik reken natuurlijk ook op de strenge voedselveiligheid-inspectie.</p>
<p>Maar het is allemaal maar een ideetje natuurlijk.</p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i135" style="white-space: nowrap;"><img src="http://yoy.be/img/ic113.png" width="16" height="16" border="0" align="top" /> Opinions</a> &gt; <a href="http://yoy.be/item.asp?i339" style="white-space: nowrap;"><img src="http://yoy.be/img/ic113.png" width="16" height="16" border="0" align="top" /> &quot;.be&quot;-related</a></span><br /> <span class="date">created: 9/11/2011 20:26:40 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 9/11/2011 20:26:40</span>
	 <span class="date">weight: 0</span>
	<br /><span class="label">tokens:</span> <a href="http://yoy.be/log.asp?tt34*"><img src="http://yoy.be/img/cat/cat_politiek.gif" width="50" height="13" border="0" align="top" alt="politiek" /></a> <a href="http://yoy.be/log.asp?tt37*"><img src="http://yoy.be/img/cat/cat_actueel.gif" width="50" height="13" border="0" align="top" alt="actueel" /></a>  <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2992</guid>
		<comments>http://yoy.be/report.asp?i2992</comments>
		<pubDate>Wed, 9 Nov 2011 19:26:39 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2991</link>
		<title>mini-milestone: first auto-build through a cross-project include</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic82.png" width="16" height="16" border="0" align="top" /> mini-milestone: first auto-build through a cross-project include<br /><p>Woohoo! the first auto-build from a second project by using a cross-project include. It'll be available in the next release, but first I'll have to make sure you can't get a deadlock by re-including from the first project... and complete this demo project... and documentation...<br />
<img width="346" height="324" alt="" src="/docs/20111108xxmcpi.PNG" /></p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i108" style="white-space: nowrap;"><img src="http://yoy.be/img/ic85.png" width="16" height="16" border="0" align="top" /> freeware</a> &gt; <a href="http://yoy.be/item.asp?i1443" style="white-space: nowrap;"><img src="http://yoy.be/img/ic82.png" width="16" height="16" border="0" align="top" /> xxm</a></span><br /> <span class="date">created: 8/11/2011 22:39:39 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 8/11/2011 22:39:39</span>
	 <span class="date">weight: 0</span>
	<br /> <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2991</guid>
		<comments>http://yoy.be/report.asp?i2991</comments>
		<pubDate>Tue, 8 Nov 2011 21:39:39 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2990</link>
		<title>Liquidatiereserve</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic42.png" width="16" height="16" border="0" align="top" /> Liquidatiereserve<br /><p>Ik zit met een idee. Als een bedrijf sluit is dat jammer. Er zijn altijd gevolgen van die de mensen treffen. Soms is het een klein jong bedrijf dat niet slaagde in vooropgestelde doelen. Soms is het een grote onderneming waarvan de buitenlandse directie beslist te verhuizen naar een land met lagere lonen.</p>
<p>Stel nu dat alle bedrijven verplicht zouden zijn om een 'liquidatie-reserve' op te bouwen, met daarin een bedrag die zou moeten de kosten van een sluiting dekken. Bij kleine bedrijven is dit niet zo veel omdat het vereffenen van de bezittingen normaal nog iets kan opbrengen. Bij grote bedrijven is dit de geschatte kost van de ontslagpremies, plus de sociale opvolging achteraf, plus eventuele herbestemmingskosten van grotere bedrijventerreinen. Eventueel nog dingen, ik ben geen ekspert op dit gebied.</p>
<p>Is het vreemd dat de staat bedrijven verplicht om geld op zij te houden? Misschien. Maar als het van pas komt zal het goed zijn dat dat geld klaar staat. En geld is nooit alleen. Als de staat oplegt het binnen het land moet worden bewaard, dan neemt het nog altijd deel aan de lokale economie.</p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i135" style="white-space: nowrap;"><img src="http://yoy.be/img/ic113.png" width="16" height="16" border="0" align="top" /> Opinions</a> &gt; <a href="http://yoy.be/item.asp?i339" style="white-space: nowrap;"><img src="http://yoy.be/img/ic113.png" width="16" height="16" border="0" align="top" /> &quot;.be&quot;-related</a></span><br /> <span class="date">created: 2/11/2011 15:36:13 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 2/11/2011 15:37:12</span>
	 <span class="date">weight: 0</span>
	<br /><span class="label">tokens:</span> <a href="http://yoy.be/log.asp?tt34*"><img src="http://yoy.be/img/cat/cat_politiek.gif" width="50" height="13" border="0" align="top" alt="politiek" /></a>  <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2990</guid>
		<comments>http://yoy.be/report.asp?i2990</comments>
		<pubDate>Wed, 2 Nov 2011 14:37:12 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2981</link>
		<title>Power user trick: restart the Printer Spooler service.</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic81.png" width="16" height="16" border="0" align="top" /> Power user trick: restart the Printer Spooler service.<br /><p>Sometimes, there's still one or more jobs in the printer queue, none are deleting or cancelled or in an error state, the printer is powered on, connected, doesn't report any error also, but doesn't start printing. It's a strange situation, but just happens to happen from time to time. This power user trick comes in handy: (No guarantees: this may still not work if something else actually is causing the disruption)</p>
<ul>
    <li>Open the start menu</li>
    <li>Right-click the Computer icon or item.</li>
    <li>Select 'Manage'</li>
    <li>Open or double click 'Services and Applications'</li>
    <li>Open or double click 'Services'</li>
    <li>Locate 'Print Spooler' in the list.</li>
    <li>Right-click and do 'Stop' and then 'Start', or 'Restart' if that option is present.</li>
</ul>
<p>This breathes new live into the print job sub-system and may <strong>sometimes</strong> cause the 'hanging' jobs to resume printing.</p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i62" style="white-space: nowrap;"><img src="http://yoy.be/img/ic13.png" width="16" height="16" border="0" align="top" /> www.yoy.be</a> &gt; <a href="http://yoy.be/item.asp?i36" style="white-space: nowrap;"><img src="http://yoy.be/img/ic16.png" width="16" height="16" border="0" align="top" /> users</a> &gt; <a href="http://yoy.be/item.asp?i18" style="white-space: nowrap;"><img src="http://yoy.be/img/ic22.png" width="16" height="16" border="0" align="top" /> StijnSanders</a> &gt; <a href="http://yoy.be/item.asp?i330" style="white-space: nowrap;"><img src="http://yoy.be/img/ic84.png" width="16" height="16" border="0" align="top" /> IRL</a></span><br /> <span class="date">created: 13/09/2011 0:04:51 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 13/09/2011 0:04:51</span>
	 <span class="date">weight: 0</span>
	<br /><span class="label">tokens:</span> <a href="http://yoy.be/log.asp?tt26*"><img src="http://yoy.be/img/cat/cat_computers.gif" width="50" height="13" border="0" align="top" alt="computers" /></a>  <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2981</guid>
		<comments>http://yoy.be/report.asp?i2981</comments>
		<pubDate>Mon, 12 Sep 2011 22:04:51 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2980</link>
		<title>Hoe noemde dat nu weer?</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic82.png" width="16" height="16" border="0" align="top" /> Hoe noemde dat nu weer?<br /><p>Een tijd terug, sinds ik deze zag: <a href="http://xkcd.com/556/">http://xkcd.com/556/</a>&nbsp;en ik bijna dagelijks&nbsp;kan uitkijken op de <a href="http://maps.google.be/?ll=50.98152,3.816547&amp;spn=0.009267,0.034332&amp;t=h&amp;z=16&amp;vpsrc=6">windmolens tussen Melle en Wetteren</a>, moet ik zo af en toe terug denken aan iets wat ik me herinner van vroeger. Ik moet nog niet zo oud geweest zijn, en misschien zelfs te jong om te snappen waar het over ging (en daarom blijf ik denken dat het misschien de moeite is om er naar op zoek te gaan), dus het moet in de buurt van de vroege jaren 80 op de televisie zijn geweest. Het moet een soort science fiction serie zijn geweest die handelde over de bezetting van de aarde of toch een deel er van door een andere groep wezens. Mensen of buitenaardse wezens weet ik niet meer, maar ik herinner me wel iets van een driehoekige tatoeage op het hoofd. En ook van die grote machines met lange poten waarmee ze over het landschap bewogen, zeg maar een meter of 20. Het was een behoorlijk donkere serie, en misschien zelfs niet engelstalig. Als ik zo zou moeten gokken kom ik op dit <a href="http://en.wikipedia.org/wiki/Rise_of_the_Triad">http://en.wikipedia.org/wiki/Rise_of_the_Triad</a>&nbsp;maar da's een computerspel van midden de jaren 90, en heeft er dacht ik niets mee te maken, dus dat spoor loopt dood. Iemand enig idee?</p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i62" style="white-space: nowrap;"><img src="http://yoy.be/img/ic13.png" width="16" height="16" border="0" align="top" /> www.yoy.be</a> &gt; <a href="http://yoy.be/item.asp?i36" style="white-space: nowrap;"><img src="http://yoy.be/img/ic16.png" width="16" height="16" border="0" align="top" /> users</a> &gt; <a href="http://yoy.be/item.asp?i18" style="white-space: nowrap;"><img src="http://yoy.be/img/ic22.png" width="16" height="16" border="0" align="top" /> StijnSanders</a> &gt; <a href="http://yoy.be/item.asp?i330" style="white-space: nowrap;"><img src="http://yoy.be/img/ic84.png" width="16" height="16" border="0" align="top" /> IRL</a> &gt; <a href="http://yoy.be/item.asp?i1220" style="white-space: nowrap;"><img src="http://yoy.be/img/ic84.png" width="16" height="16" border="0" align="top" /> Nostalgia</a></span><br /> <span class="date">created: 10/09/2011 14:07:40 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 10/09/2011 14:07:50</span>
	 <span class="date">weight: 0</span>
	<br /> <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2980</guid>
		<comments>http://yoy.be/report.asp?i2980</comments>
		<pubDate>Sat, 10 Sep 2011 12:07:49 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2976</link>
		<title>Safari Mobile: no focus from load or timed events</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic43.png" width="16" height="16" border="0" align="top" /> Safari Mobile: no focus from load or timed events<br /><p>On one website, I'm using <a href="http://jquery.org/">jQuery</a> to load a form into a cell of&nbsp;a table to edit a value on that row, and set focus to the edit field, so the user can edit or overwrite the value rightaway.</p>
<p>On an iPad (not sure which version it was on), the keyboard doesn't show, and the field doesn't get the focus. It takes another click onto the field to give it focus and get the keyboard to show.</p>
<p>Sleuthing around, <a href="http://www.quora.com/Mobile-Safari-iPhone-or-iPad-with-JavaScript-how-can-I-launch-the-on-screen-keyboard">it appears that this is by design</a>! Because showing the keyboard is slow and/or intrusive?! I disagree. I think this is a clever way of degrading the user experience of using an interactive website with Safari Mobile in such a way it would get interesting to create a specific iPhone/iPad app.</p>
<p>Though other sources tell me this is a bug and could get fixed in future versions...</p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i78" style="white-space: nowrap;"><img src="http://yoy.be/img/ic81.png" width="16" height="16" border="0" align="top" /> Application Development</a> &gt; <a href="http://yoy.be/item.asp?i661" style="white-space: nowrap;"><img src="http://yoy.be/img/ic85.png" width="16" height="16" border="0" align="top" /> Platforms</a> &gt; <a href="http://yoy.be/item.asp?i2975" style="white-space: nowrap;"><img src="http://yoy.be/img/ic9.png" width="16" height="16" border="0" align="top" /> iOS</a></span><br /> <span class="date">created: 30/07/2011 2:01:14 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 30/07/2011 2:01:14</span>
	 <span class="date">weight: 0</span>
	<br /><span class="label">tokens:</span> <a href="http://yoy.be/log.asp?tt25*"><img src="http://yoy.be/img/cat/cat_coding.gif" width="50" height="13" border="0" align="top" alt="coding" /></a>  <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2976</guid>
		<comments>http://yoy.be/report.asp?i2976</comments>
		<pubDate>Sat, 30 Jul 2011 00:01:14 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2968</link>
		<title>Ideetje: zonnepanelen doen CO2 omzetten in CH4 (voor de brandstofcel op de zolder)</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic40.png" width="16" height="16" border="0" align="top" /> Ideetje: zonnepanelen doen CO2 omzetten in CH4 (voor de brandstofcel op de zolder)<br /><p>Stel, je dak ligt vol met zonnepanelen. Stel die brengen het meest op als de meeste mensen niet thuis zijn, minder energie gebruiken dus, en het 'slimme net' neemt dus ook niet af van je. Dus geen inkomsten en de zonnepanelen betalen zichzelf niet terug.</p>
<p>Kunnen we dus zelf iets er mee doen? <a href="http://www.solarpanel.co.za/solar-batteries.htm">Batterijen zijn peperduur</a> en verliezen behoorlijk veel.&nbsp;En <a href="http://www.geonames.org/2960232/mont-saint-nicolas.html">even omhoog pompen</a> heb ik niet direct plaats voor op mijn woningperceel. Mocht ik in een gebied geplaagd door droogte wonen, en toegang hebben tot zeewater, zou ik misschien <a href="http://www.google.be/search?q=desert+desalinisation">desaliniseren</a>, daar is veel energie voor nodig. Maar dat is niet het geval, regenwater genoeg en dat is nog <a href="http://www.google.be/search?q=regenwaterkwaliteit+vlaanderen">relatief zuiver</a>.</p>
<p>Dus, zou ik kunnen <span class="newwiki">CO2</span> uit de lucht plukken? En er O2 van maken. En als het even kan <span class="newwiki">CH4</span> overhouden. Met een truuk kan je die dan opslaan en door een <a href="http://www.lbl.gov/Science-Articles/Archive/MSD-fuel-cells.html">brandstofcel</a> sturen. Bijvoorbeeld 's avonds, als ik thuis kom en de zon gaat slapen.</p>
<p>Als ik zo <a href="http://www.google.be/search?q=convert+co2+O2+CH4">snel even zoek</a>&nbsp;dan lijkt het niet onmogelijk. Misschien lukt het pas op 250&deg;C, maar we zitten toch met energie over, dus dat zou wel eens goed kunnen lukken...</p>
<p>O jee! Een goed idee! Ik ga dat nu <a href="http://www.freepatentsonline.com/6930073.html">moeten patenteren zeker?</a>&nbsp;Alleen jammer dat dan weer zoveel kost in Europa...</p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i135" style="white-space: nowrap;"><img src="http://yoy.be/img/ic113.png" width="16" height="16" border="0" align="top" /> Opinions</a> &gt; <a href="http://yoy.be/item.asp?i210" style="white-space: nowrap;"><img src="http://yoy.be/img/ic113.png" width="16" height="16" border="0" align="top" /> Science</a></span><br /> <span class="date">created: 19/05/2011 21:55:16 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 19/05/2011 21:55:16</span>
	 <span class="date">weight: 0</span>
	<br /> <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2968</guid>
		<comments>http://yoy.be/report.asp?i2968</comments>
		<pubDate>Thu, 19 May 2011 19:55:16 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2966</link>
		<title>AutoClick</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic3.png" width="16" height="16" border="0" align="top" /> AutoClick<br /><p>I think it would be really handy if you could set a number of clicks at the same location for the program to perform before stopping.</p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i25" style="white-space: nowrap;"><img src="http://yoy.be/img/ic12.png" width="16" height="16" border="0" align="top" /> projects</a> &gt; <a href="http://yoy.be/item.asp?i962" style="white-space: nowrap;"><img src="http://yoy.be/img/ic10.png" width="16" height="16" border="0" align="top" /> AutoClick</a></span><br /> <span class="date">created: 4/05/2011 8:20:34 <a href="http://yoy.be/item.asp?i1" title="i1">&laquo;</a></span>
	 <span class="date">modified: 4/05/2011 8:20:34</span>
	 <span class="date">weight: 0</span>
	<br /> <span class="label">references:</span> 
			<a href="http://yoy.be/item.asp?i1" title="comment by anonymous user"><img src="http://yoy.be/img/ic26.png" width="16" height="16" border="0" align="top" alt="" /><img src="http://yoy.be/img/ic20.png" width="16" height="16" border="0" align="top" alt="" /></a>&nbsp;
			<br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2966</guid>
		<comments>http://yoy.be/report.asp?i2966</comments>
		<pubDate>Wed, 4 May 2011 06:20:33 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2964</link>
		<title>Model van de verschillen in zwaartekracht op aarde.</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic82.png" width="16" height="16" border="0" align="top" /> Model van de verschillen in zwaartekracht op aarde.<br /><p>Tiens, nu ik deze zie: <a href="http://www.boingboing.net/2011/04/04/mapping-the-pull-of.html">http://www.boingboing.net/2011/04/04/mapping-the-pull-of.html</a>&nbsp;herinner ik me een oude kaart (<a href="http://andropov.tradenote.net/product/380803-Antique-Map-Asia.html">misschien wel deze</a>?) waar Sri Lanka abnormaal groot op staat. Mogelijk omdat ze de kust-lijnen toen nog in kaart brachten door er met een boot rond te varen. (Wat bij ondiepe wateren wel nog eens lastig was). Zouden die twee met elkaar kunnen te maken hebben? Als er minder zwaartekracht is om aan het water te trekken, gaat een boot er dan gemakkelijker door? Of moeilijker? Of misschien hadden ze net een lading drank opgeladen die de cartograaf van toen wel lekker vond, kan ook altijd natuurlijk.</p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i222" style="white-space: nowrap;"><img src="http://yoy.be/img/ic86.png" width="16" height="16" border="0" align="top" /> spotted on the net</a> &gt; <a href="http://yoy.be/item.asp?i225" style="white-space: nowrap;"><img src="http://yoy.be/img/ic84.png" width="16" height="16" border="0" align="top" /> science</a> &gt; <a href="http://yoy.be/item.asp?i1658" style="white-space: nowrap;"><img src="http://yoy.be/img/ic84.png" width="16" height="16" border="0" align="top" /> space</a></span><br /> <span class="date">created: 4/04/2011 15:27:09 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 4/04/2011 15:27:09</span>
	 <span class="date">weight: 0</span>
	<br /> <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2964</guid>
		<comments>http://yoy.be/report.asp?i2964</comments>
		<pubDate>Mon, 4 Apr 2011 13:27:09 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2963</link>
		<title>SQLite, a foreign key and its referential integrity...</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic82.png" width="16" height="16" border="0" align="top" /> SQLite, a foreign key and its referential integrity...<br /><p>Hmm, I guess this will take a lot more getting used to than I thought... Consider this code:</p>
<pre>create table tbl1 (
id integer primary key autoincrement,
name varchar(50) not null
);
create table tbl2 (
id integer primary key autoincrement,
tbl1_id int not null,
name varchar(50) not null,
constraint FK_tbl1_tbl2 foreign key (tbl1_id) references tbl1 (id)
);
insert into tbl1 (id,name) values (1,'test1');
insert into tbl2 (id,tbl1_id,name) values (2,1,'test2');
insert into tbl2 (id,tbl1_id,name) values (3,2,'test3');
update tbl1 set id=id+100;
select * from tbl1;
select * from tbl2;</pre>
<p>This works on <span class="newwiki">SQLite3</span> without errors! Not on the inserts, setting an autoincrement field, not on updating the id field(s) that are in use by a foreign key, which actually breaks referential integrity between the two tables! Or have I stumbled upon a fault/bug/incorrectness in <span class="newwiki">SQLite3</span>?</p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i78" style="white-space: nowrap;"><img src="http://yoy.be/img/ic81.png" width="16" height="16" border="0" align="top" /> Application Development</a> &gt; <a href="http://yoy.be/item.asp?i594" style="white-space: nowrap;"><img src="http://yoy.be/img/ic85.png" width="16" height="16" border="0" align="top" /> Data Storage</a> &gt; <a href="http://yoy.be/item.asp?i2962" style="white-space: nowrap;"><img src="http://yoy.be/img/ic84.png" width="16" height="16" border="0" align="top" /> SQLite</a></span><br /> <span class="date">created: 2/04/2011 0:03:07 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 2/04/2011 0:04:27</span>
	 <span class="date">weight: 0</span>
	<br /><span class="label">tokens:</span> <a href="http://yoy.be/log.asp?tt25*"><img src="http://yoy.be/img/cat/cat_coding.gif" width="50" height="13" border="0" align="top" alt="coding" /></a>  <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2963</guid>
		<comments>http://yoy.be/report.asp?i2963</comments>
		<pubDate>Fri, 1 Apr 2011 22:04:27 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2961</link>
		<title>Delphi code to send a Wake-up on LAN signal</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic91.png" width="16" height="16" border="0" align="top" /> Delphi code to send a Wake-up on LAN signal<br /><p>Yes, it's that easy!</p>
<div style="margin-left: 2em; font-family: Lucida Console, monospace"><nowiki>
<p><strong>unit</strong> un_WakeUpOnLAN;</p>
<p><strong>interface</strong></p>
<p><strong>type</strong><br />
&nbsp; TMACAddress=<strong>array</strong>[0..5] <strong>of byte</strong>;</p>
<p><strong>function</strong> MACAddressFromStr(x:<strong>string</strong>):TMACAddress;<br />
<strong>procedure</strong> SendWakeUpOnLAN(Address:TMACAddress);</p>
<p><strong>implementation</strong></p>
<p><strong>uses</strong> SysUtils, WinSock;</p>
<p><strong>function</strong> MACAddressFromStr(x:<strong>string</strong>):TMACAddress;<br />
<strong>var</strong><br />
&nbsp; i,j,b:integer;<br />
<strong>begin</strong><br />
&nbsp; j:=0;<br />
&nbsp; <strong>for</strong> i:=1 <strong>to</strong> Length(x) <strong>do</strong><br />
&nbsp;&nbsp;&nbsp; <strong>if</strong> x[i] <strong>in</strong> ['0'..'9','A'..'F','a'..'f'] <strong>then</strong><br />
&nbsp;&nbsp;&nbsp;&nbsp; <strong>begin</strong><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>if</strong> byte(x[i])&gt;$40 <strong>then</strong> b:=9 <strong>else</strong> b:=0;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>if</strong> j&gt;12 <strong>then</strong> <strong>raise</strong> Exception.Create('MAC Address too long');<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>if</strong> (j <strong>and</strong> 1)=0 <strong>then</strong><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Result[j <strong>div</strong> 2]:=(b+(byte(x[i]) <strong>and</strong> $F)) <strong>shl</strong> 4<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>else</strong><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Result[j <strong>div</strong> 2]:=Result[j <strong>div</strong> 2] <strong>or</strong> (b+(byte(x[i]) <strong>and</strong> $F));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>inc</strong>(j);<br />
&nbsp;&nbsp;&nbsp; <strong>end</strong>;<br />
&nbsp; <strong>if</strong> j&lt;12 <strong>then raise </strong>Exception.Create('MAC Address too short');<br />
<strong>end</strong>;</p>
<p><strong>procedure</strong> SendWakeUpOnLAN(Address:TMACAddress);<br />
<strong>var</strong><br />
&nbsp; s:TSocket;<br />
&nbsp; i:integer;<br />
&nbsp; a:TSockAddr;<br />
&nbsp; d:<strong>array</strong>[0..16] <strong>of</strong> TMACAddress;<br />
<strong>const</strong><br />
&nbsp; x:TMACAddress=($FF,$FF,$FF,$FF,$FF,$FF);<br />
<strong>begin</strong><br />
&nbsp; d[0]:=x;<br />
&nbsp; <strong>for</strong> i:=1 <strong>to</strong> 16 <strong>do</strong> d[i]:=Address;<br />
&nbsp; a.sin_family:=AF_INET;<br />
&nbsp; a.sin_port:=htons(0);<br />
&nbsp; a.sin_addr.S_addr:=INADDR_BROADCAST;<br />
&nbsp; s:=socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP);<br />
&nbsp; <strong>if</strong> s=INVALID_SOCKET <strong>then</strong><br />
&nbsp;&nbsp;&nbsp; <strong>raise</strong> Exception.Create(SysErrorMessage(WSAGetLastError));<br />
&nbsp; <strong>try</strong><br />
&nbsp;&nbsp;&nbsp; <strong>if</strong> (connect(s,a,SizeOf(a))=SOCKET_ERROR)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>or</strong> (setsockopt(s,SOL_SOCKET,SO_BROADCAST,PChar(@i),4)=SOCKET_ERROR)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>or</strong> (sendto(s,d[0],102,0,a,SizeOf(a))=SOCKET_ERROR) then<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>raise</strong> Exception.Create(SysErrorMessage(WSAGetLastError));<br />
&nbsp; <strong>finally</strong><br />
&nbsp;&nbsp;&nbsp; closesocket(s);<br />
&nbsp; <strong>end</strong>;<br />
<strong>end</strong>;</p>
<p><strong>var</strong><br />
&nbsp; WSAData:TWSAData;</p>
<p><strong>initialization</strong><br />
&nbsp; WSAStartup($0101, WSAData);<br />
<strong>finalization</strong><br />
&nbsp; WSACleanup;</p>
<p><strong>end</strong>.</p>
</nowiki></div><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i78" style="white-space: nowrap;"><img src="http://yoy.be/img/ic81.png" width="16" height="16" border="0" align="top" /> Application Development</a> &gt; <a href="http://yoy.be/item.asp?i80" style="white-space: nowrap;"><img src="http://yoy.be/img/ic85.png" width="16" height="16" border="0" align="top" /> Programming Languages</a> &gt; <a href="http://yoy.be/item.asp?i1595" style="white-space: nowrap;"><img src="http://yoy.be/img/ic86.png" width="16" height="16" border="0" align="top" /> Object Pascal</a> &gt; <a href="http://yoy.be/item.asp?i81" style="white-space: nowrap;"><img src="http://yoy.be/img/ic85.png" width="16" height="16" border="0" align="top" /> Delphi</a></span><br /> <span class="date">created: 29/03/2011 8:28:46 <a href="http://yoy.be/item.asp?i1" title="i1">&laquo;</a></span>
	 <span class="date">modified: 29/03/2011 9:42:06</span>
	 <span class="date">weight: 0</span>
	<br /> <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2961</guid>
		<comments>http://yoy.be/report.asp?i2961</comments>
		<pubDate>Tue, 29 Mar 2011 07:42:06 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2959</link>
		<title>bitcoin: digital currency of the people (be your own bank)</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic82.png" width="16" height="16" border="0" align="top" /> bitcoin: digital currency of the people (be your own bank)<br /><p>I've been asked if I accept donations for the <a href="/freeware">freeware</a> I make available over this website, but I don't. I don't have a legal entity to my name to accept any funds for work done, and frankly I don't even care for checking if and how I could get this in the clear with the tax services.</p>
<p>Today I read about <a href="http://www.bitcoin.org/">http://www.bitcoin.org/</a> and this looks like exactly what I need. It's not that hard to set up, and the fact that no institute like a bank is envolved is really interesting. Even the 'funds' itself actually measures in 'mathematical solids in the digital world', so if I were to amass e certain amount of it, it would get financially interesting to check out these aforementioned tax issues (perhaps by an accountant...)</p>
<p>So, if anyone wants to wire me anything (even 0.<span class="newwiki">01BTC</span> just to check if it works) here's a bitcoin address:</p>
<p><span class="newwiki">1Q5omBMcpRQkx7WqPpHceM37ZBqpCgyrDB</span></p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i222" style="white-space: nowrap;"><img src="http://yoy.be/img/ic86.png" width="16" height="16" border="0" align="top" /> spotted on the net</a> &gt; <a href="http://yoy.be/item.asp?i1830" style="white-space: nowrap;"><img src="http://yoy.be/img/ic84.png" width="16" height="16" border="0" align="top" /> legal issues</a> &gt; <a href="http://yoy.be/item.asp?i2958" style="white-space: nowrap;"><img src="http://yoy.be/img/ic84.png" width="16" height="16" border="0" align="top" /> financial</a></span><br /> <span class="date">created: 23/03/2011 16:45:07 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 23/03/2011 16:45:07</span>
	 <span class="date">weight: 0</span>
	<br /><span class="label">tokens:</span> <a href="http://yoy.be/log.asp?tt30*"><img src="http://yoy.be/img/cat/cat_internet.gif" width="50" height="13" border="0" align="top" alt="internet" /></a> <a href="http://yoy.be/log.asp?tt37*"><img src="http://yoy.be/img/cat/cat_actueel.gif" width="50" height="13" border="0" align="top" alt="actueel" /></a> <a href="http://yoy.be/log.asp?tt24*"><img src="http://yoy.be/img/cat/cat_beurs.gif" width="50" height="13" border="0" align="top" alt="beurs" /></a> <a href="http://yoy.be/log.asp?tt25*"><img src="http://yoy.be/img/cat/cat_coding.gif" width="50" height="13" border="0" align="top" alt="coding" /></a> <a href="http://yoy.be/log.asp?tt34*"><img src="http://yoy.be/img/cat/cat_politiek.gif" width="50" height="13" border="0" align="top" alt="politiek" /></a> <a href="http://yoy.be/log.asp?tt36*"><img src="http://yoy.be/img/cat/cat_weblog.gif" width="50" height="13" border="0" align="top" alt="weblog" /></a>  <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2959</guid>
		<comments>http://yoy.be/report.asp?i2959</comments>
		<pubDate>Wed, 23 Mar 2011 15:45:07 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2957</link>
		<title>prime numbers</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic0.png" width="16" height="16" border="0" align="top" /> prime numbers<br /><p>I once had the idea of building a <a href="http://primes.utm.edu/glossary/page.php?sort=SieveOfEratosthenes">sieve to find primes</a>, with two arrays of integers: one array with the primes found so far, and one array with a multiple of the corresponding prime which is just above the number currently being investigated. If a multiple would match, it's not a prime, if I wouldn't find a multiple in all previously found primes, I've got a new prime. This way I would not have to multiply or trial-divide anything. All you have to do is start with a first element set to 2, and 'investigate' 3. This is the next prime of course, and 4 hits the next multiple of 2 that's larger than 3 already.</p>
<p>The first go was long (long!) ago back in 16-bits. It found primes up to 65521. But we're having multiple 64-bit monsters purring on our laps nowadays, so I had another go. Turns out the technique spits out primes in sequence faster than I/O can handle, so I had to optimize a bit. Finding all 32-bits primes took a few hours, so I started a 64-bits version somewhere in februari and left it running on a machine I have in the attic that also records television stuff now and then.</p>
<p>I'm not sure if anyone can use <em>all</em> of the prime numbers in sequence for something, but there it is. If you want a copy, let me know. I could also make a version of the program that runs on several cores. I could also make a client that gets ranges of numbers to check for primes and post them back. But I'm not planning to do that. I suspect I won't find anything ground-breaking in the primes-world this way.</p>
<p>It does make a nice tool to list sets of primes, and the primes list is great to split any (large) number in its prime factors. Have a look: (but please don't overload my spare machine in the attic!)</p>
<p><a href="http://yoy.slyip.net:8080/primes/">primes...</a></p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i62" style="white-space: nowrap;"><img src="http://yoy.be/img/ic13.png" width="16" height="16" border="0" align="top" /> www.yoy.be</a> &gt; <a href="http://yoy.be/item.asp?i36" style="white-space: nowrap;"><img src="http://yoy.be/img/ic16.png" width="16" height="16" border="0" align="top" /> users</a> &gt; <a href="http://yoy.be/item.asp?i18" style="white-space: nowrap;"><img src="http://yoy.be/img/ic22.png" width="16" height="16" border="0" align="top" /> StijnSanders</a></span><br /> <span class="date">created: 14/03/2011 0:36:44 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 25/08/2011 21:14:25</span>
	 <span class="date">weight: 0</span>
	<br /><span class="label">tokens:</span> <img src="http://yoy.be/img/ic8.png" width="16" height="16" border="0" align="top" alt="(friendly-url)" />  <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2957</guid>
		<comments>http://yoy.be/report.asp?i2957</comments>
		<pubDate>Thu, 25 Aug 2011 19:14:25 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2954</link>
		<title>mozilla-build fails: &quot;rm: cannot lstat `conftest.exe ': Permission denied&quot;</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic91.png" width="16" height="16" border="0" align="top" /> mozilla-build fails: &quot;rm: cannot lstat `conftest.exe ': Permission denied&quot;<br /><p>I've been looking high and low, found some things that get close, but not close enough (the closest being <a href="https://developer.mozilla.org/en/Windows_Build_Prerequisites#Common_Problems.2c_Hints_and_Restrictions">this one</a>&nbsp;about Microsoft Antimalware Service, but I don't have that one here), but it turns out to be just this: <strong>disable the virus-scanner</strong>, either while building or by excluding the mozilla build folder(s)...</p>
<p>Because I can't find it anywhere I put it up here, I hope people find it by searching...</p>
<p>So, now I'm stuck because I have the rather new <span class="newwiki">MSVC</span>++2010 Express and it isn't supported (yet?) So I'll have a look why not, or downgrade to the 2008 one...</p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i68" style="white-space: nowrap;"><img src="http://yoy.be/img/ic81.png" width="16" height="16" border="0" align="top" /> Information</a> &gt; <a href="http://yoy.be/item.asp?i69" style="white-space: nowrap;"><img src="http://yoy.be/img/ic84.png" width="16" height="16" border="0" align="top" /> Technology</a> &gt; <a href="http://yoy.be/item.asp?i70" style="white-space: nowrap;"><img src="http://yoy.be/img/ic84.png" width="16" height="16" border="0" align="top" /> Information Technology</a> &gt; <a href="http://yoy.be/item.asp?i73" style="white-space: nowrap;"><img src="http://yoy.be/img/ic84.png" width="16" height="16" border="0" align="top" /> Internet</a> &gt; <a href="http://yoy.be/item.asp?i153" style="white-space: nowrap;"><img src="http://yoy.be/img/ic92.png" width="16" height="16" border="0" align="top" /> WebBrowser</a> &gt; <a href="http://yoy.be/item.asp?i199" style="white-space: nowrap;"><img src="http://yoy.be/img/ic82.png" width="16" height="16" border="0" align="top" /> FireFox</a></span><br /> <span class="date">created: 9/02/2011 17:40:02 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 9/02/2011 17:40:02</span>
	 <span class="date">weight: 0</span>
	<br /> <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2954</guid>
		<comments>http://yoy.be/report.asp?i2954</comments>
		<pubDate>Wed, 9 Feb 2011 16:40:02 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2953</link>
		<title>Zijn die nu waarlijk zo laag gevallen?</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic82.png" width="16" height="16" border="0" align="top" /> Zijn die nu waarlijk zo laag gevallen?<br /><p><a href="http://news.google.be/"><img style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" alt="" src="/docs/20110120dssms.png" /></a></p>
<p>O jee! zijn die waarlijk zo laag gevallen! En <a href="http://www.standaard.be">De Standaard</a> dan nog! Ik dacht dat die nog wat van plan waren een beetje serieux uit te stralen...</p>
<p>En het meneerke links komt ook verdacht veel voor als 'relevante afbeelding' op een hoop items in de lijst...</p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i222" style="white-space: nowrap;"><img src="http://yoy.be/img/ic86.png" width="16" height="16" border="0" align="top" /> spotted on the net</a> &gt; <a href="http://yoy.be/item.asp?i233" style="white-space: nowrap;"><img src="http://yoy.be/img/ic84.png" width="16" height="16" border="0" align="top" /> &quot;.be&quot;-related</a></span><br /> <span class="date">created: 20/01/2011 22:44:19 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 20/01/2011 22:44:19</span>
	 <span class="date">weight: 0</span>
	<br /><span class="label">tokens:</span> <a href="http://yoy.be/log.asp?tt37*"><img src="http://yoy.be/img/cat/cat_actueel.gif" width="50" height="13" border="0" align="top" alt="actueel" /></a>  <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2953</guid>
		<comments>http://yoy.be/report.asp?i2953</comments>
		<pubDate>Thu, 20 Jan 2011 21:44:19 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2951</link>
		<title>TSQLite</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic82.png" width="16" height="16" border="0" align="top" /> TSQLite<br /><p>An alternative <span class="newwiki">SQLite3</span>.dll wrapper</p><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i108" style="white-space: nowrap;"><img src="http://yoy.be/img/ic85.png" width="16" height="16" border="0" align="top" /> freeware</a></span><br /> <span class="date">created: 14/12/2010 15:23:58 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 14/12/2010 15:23:58</span>
	 <span class="date">weight: 0</span>
	<br /><span class="label">tokens:</span> <a href="http://yoy.be/log.asp?tt27*"><img src="http://yoy.be/img/cat/cat_delphi.gif" width="50" height="13" border="0" align="top" alt="delphi" /></a> <img src="http://yoy.be/img/ic8.png" width="16" height="16" border="0" align="top" alt="(friendly-url)" />  <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2951</guid>
		<comments>http://yoy.be/report.asp?i2951</comments>
		<pubDate>Tue, 14 Dec 2010 14:23:57 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2949</link>
		<title>TMongoWire</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic82.png" width="16" height="16" border="0" align="top" /> TMongoWire<br /><p><a href="https://github.com/stijnsanders/TMongoWire"><strong>Delphi MongoDB Driver</strong></a></p>
<p>A Delphi driver to access a <span class="newwiki">mongoDB</span> server.<br />
It maps variables onto Delphi variables of type <span class="newwiki">OleVariant</span>, which resembles the loose typing of <span class="newwiki">JavaScript</span> a lot.<br />
There are two main units and three main object to enable access to a mongo DB server:</p>
<p>bsonDoc.pas<br />
&nbsp; <code>TBSONDocument = class(TInterfacedObject, IBSONDocument, IPersistStream)</code></p>
<ul>
    <li>Holds the data of a 'document', the basic unit <span class="newwiki">mongoDB</span> works with.</li>
    <li>Implements an <span class="newwiki">IBSONDocument</span> interface which allows it to be referenced by an <span class="newwiki">OeVariant</span> variable, and this embedded documents.</li>
    <li>Implements the <span class="newwiki">IPersistStream</span> to enable loading from and saving to <span class="newwiki">BSON</span>, the internal binary storage specification used by <span class="newwiki">mongoDB</span>.</li>
</ul>
<p>&nbsp; <code>function BSON:IBSONDocument; overload;</code><br />
&nbsp; <code>function BSON(x:array of OleVariant):IBSONDocument; overload;</code></p>
<ul>
    <li>Creates a <span class="newwiki">BSON</span> document object ready for use.</li>
    <li>Optionally pass a sequence of key-value pairs, e.g.: <code>BSON(['x',5,'y',7]);</code></li>
    <li>Use '[' and ']' to created embedded documents, e.g.: <code>BSON(['x','[','$gt',7,']']);</code></li>
</ul>
<p>mongoWire.pas<br />
&nbsp; <code>TMongoWire=class(TObject)</code></p>
<ul dir="ltr">
    <li>
    <div style="margin-right: 0px">A connection to a <span class="newwiki">mongoDB</span> server. Supports getting single items, performing inserts, updates and deletes.</div>
    </li>
</ul>
<p>&nbsp;&nbsp;<code>TMongoWireQuery=class(TBSONDocumentsEnumerator)</code></p>
<ul dir="ltr">
    <li>
    <div style="margin-right: 0px">A query to a <span class="newwiki">mongoDB</span> server, handles the cursor and subsequent requests to the server to get more data when needed.</div>
    </li>
</ul><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i108" style="white-space: nowrap;"><img src="http://yoy.be/img/ic85.png" width="16" height="16" border="0" align="top" /> freeware</a></span><br /> <span class="date">created: 2/12/2010 10:05:35 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 2/02/2012 21:36:33</span>
	 <span class="date">weight: 0</span>
	<br /><span class="label">tokens:</span> <a href="http://yoy.be/log.asp?tt27*"><img src="http://yoy.be/img/cat/cat_delphi.gif" width="50" height="13" border="0" align="top" alt="delphi" /></a> <img src="http://yoy.be/img/ic8.png" width="16" height="16" border="0" align="top" alt="(friendly-url)" />  <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2949</guid>
		<comments>http://yoy.be/report.asp?i2949</comments>
		<pubDate>Thu, 2 Feb 2012 20:36:33 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2945</link>
		<title>How to set the thread display name for the thread list debug window</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic91.png" width="16" height="16" border="0" align="top" /> How to set the thread display name for the thread list debug window<br /><p><a href="http://msdn.microsoft.com/en-us/library/xcb2z8hs(VS.71).aspx">This little trick</a> appears to work in the Delphi debugger also! Use this code to set the debug display name for the current thread:</p>
<pre><strong>interface<br /> </strong><br /><br /><strong>function </strong>IsDebuggerPresent: BOOL; <strong>stdcall</strong>;<br /> <br /><strong>implementation<br /> <br /><br />uses</strong> Windows;<br /><br /><strong> <br />function</strong> IsDebuggerPresent; <strong>external</strong> 'kernel32.dll';<br /><strong>  <br />procedure</strong> SetThreadName(ThreadDisplayName:AnsiString);<br /><strong>var</strong><br />&nbsp; ThreadInfo:<strong>record</strong><br />&nbsp;&nbsp;&nbsp; dwType:LongWord;<br />&nbsp;&nbsp;&nbsp; szName:PAnsiChar;<br />&nbsp;&nbsp;&nbsp; dwThreadID:LongWord;<br />&nbsp;&nbsp;&nbsp; dwFlags:LongWord;<br />&nbsp; <strong>end</strong>;<br /><strong>begin<br /></strong><strong>  if</strong> IsDebuggerPresent <strong>then</strong><br />    <strong>begin<br /></strong>&nbsp;     ThreadInfo.dwType:=$1000;<br />&nbsp;     ThreadInfo.szName:=PAnsiChar(ThreadDisplayName);<br />&nbsp;     ThreadInfo.dwThreadID:=LongWord(-1);//calling thread<br />&nbsp;     ThreadInfo.dwFlags:=0;<br />&nbsp;     <strong>try</strong><br />&nbsp;&nbsp;&nbsp;     RaiseException($406D1388,0,SizeOf(ThreadInfo) <strong>div</strong> SizeOf(LongWord),@ThreadInfo);<br />&nbsp;     <strong>except</strong><br />&nbsp;&nbsp;&nbsp;     //<br />&nbsp;     <strong>end</strong>;<br />    <strong>end</strong>;<br /><strong>end</strong>;</pre><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i78" style="white-space: nowrap;"><img src="http://yoy.be/img/ic81.png" width="16" height="16" border="0" align="top" /> Application Development</a> &gt; <a href="http://yoy.be/item.asp?i80" style="white-space: nowrap;"><img src="http://yoy.be/img/ic85.png" width="16" height="16" border="0" align="top" /> Programming Languages</a> &gt; <a href="http://yoy.be/item.asp?i1595" style="white-space: nowrap;"><img src="http://yoy.be/img/ic86.png" width="16" height="16" border="0" align="top" /> Object Pascal</a> &gt; <a href="http://yoy.be/item.asp?i81" style="white-space: nowrap;"><img src="http://yoy.be/img/ic85.png" width="16" height="16" border="0" align="top" /> Delphi</a> &gt; <a href="http://yoy.be/item.asp?i668" style="white-space: nowrap;"><img src="http://yoy.be/img/ic84.png" width="16" height="16" border="0" align="top" /> Debugging</a></span><br /> <span class="date">created: 5/11/2010 0:25:47 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 5/11/2010 0:45:47</span>
	 <span class="date">weight: 0</span>
	<br /><span class="label">tokens:</span> <a href="http://yoy.be/log.asp?tt27*"><img src="http://yoy.be/img/cat/cat_delphi.gif" width="50" height="13" border="0" align="top" alt="delphi" /></a>  <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2945</guid>
		<comments>http://yoy.be/report.asp?i2945</comments>
		<pubDate>Thu, 4 Nov 2010 23:45:47 +0100</pubDate>
		</item>
		<item>
		<link>http://yoy.be/item.asp?i2944</link>
		<title>Creating a virtual image of that old laptop</title>
		<description><![CDATA[
		<img src="http://yoy.be/img/ic82.png" width="16" height="16" border="0" align="top" /> Creating a virtual image of that old laptop<br /><p>The last few days I've been looking up a lot of information on a specific topic, but haven't found all that I need in a single place, so here it goes. This is the story of (yet another) someone that had the great idea of 'cloning' a virtual image out of the old physical machine, to run as a virtual machine on the brand new machine, with a multiple of the capacity of the old machine.</p>
<p>If you don't care about the story, scroll to the bottom to see the quick guide through the steps to take.</p>
<p>The old, aging, deteriorating laptop is ready for retirement, it's got its power connector re-soldered twice already, two out of three (...) <span class="newwiki">USB</span> ports no longer respond, etc. But, all your data is on it. It's full of tools and software you use and you'd like to use. You're not looking forward to the awkward time ahead using two laptops, re-installing software and tools, moving data around, and optionally finding out you've lost all of those precious personal perferences, settings, profile data...</p>
<p>Virtualization is a buzzword nowadays among the happy few that pull the reins on the server farms, but it's pretty available for home users as well. So why not try to pull a virtual image off of the physical machine and see if it would run on the new machine?</p>
<p>Step 1: Pulling the image.</p>
<p>A straight-forward method for modular desktop machines was to put the old harddisk into another machine as secondary drive and pull an image from it. I'm moving between laptops and I don't feel like dismantling this one (any more)... So I need to pull an image of the currently running system, from the main harddisk partition, and write it over network, since this <span class="newwiki">20GB</span> is nearly full.</p>
<p>(On a side note, I'm was quite happy this last months to discover cleanmgr <a href="http://support.microsoft.com/kb/253597">http://support.microsoft.com/kb/253597</a> and especially the 'remove system restore points' option on the second tab! Hundreds or thousands of dead unused kilobytes just sitting there you can get rid of with a mouseclick.)</p>
<p>I found this great tool that does the trick: <a href="http://www.chrysocome.net/dd">http://www.chrysocome.net/dd</a></p>
<p>dd if=\\?\Device\<span class="newwiki">HardDisk0</span>\Partition0 of=\\192.168.0.3\temp\oldlaptop.img bs=128k --progress</p>
<p>'Partition0' apparently is the address of the entire disk, underneath any partitioning or locks the system has on the filesystem. Oddly enough it's available to read from, so take care with running other programs while you're pulling the image. Any files written to while the diskdump is writing may end up corrupt.</p>
<p>I've tried a number of block sizes, ranging from 4k to 2M, but 128k is about a good size to keep both the harddisk and the network interface (100Mbps) busy enough so they won't have to wait on eachother too much. Less would make more read operations, and less data packets going out, more would read more at once, but the disk may forget what to do while the data is flushing down the twisted pair.</p>
<p>Start 2: Running the image.</p>
<p>Let's see. I've selected qemu <a href="http://www.qemu.org">www.qemu.org</a> to run the image, it's light-weight, runs well (and closes well), but I hear good things about <span class="newwiki">VMWare</span> player also. <a href="http://www.vmware.com/products/player/">http://www.vmware.com/products/player/</a></p>
<p>And it boots! It shows a Windows logo for a second... and throws a 'blue screen of death' with an error that states, among other things &quot;<span class="newwiki">STOP</span> 0000007B&quot;, and loops into a reboot which repeats.</p>
<p>Thing is, the old machine had an Intel something in it's center, the new one has it of <span class="newwiki">AMD</span> build, could this be causing problems? From what I read on the web it does. But I've also read all kinds of trickery and tool-slinging to alter registry and core files, but they all boil down to disabling the erring drivers, while still keeping the system running enough to get to boot in a new virtual enclosure.</p>
<p>Start 3: Fixing them drivers.</p>
<p>So back to the old machine. I've tried several things, but what I finally did to get it running is checking every little thing in the device manager (with display of hidden devices swicthed on), which showed the brand's name in the description, and 'update' the drivers to the generic make of drivers, which seem to do the trick also. It may take a reboot or two, and some things may re-appear getting plugged to play again, but you just play them down again putting the generic label on it. (Update driver &gt; no, not now &gt; I wont to choose &gt; don't search &gt; select the plain vanilla one)</p>
<p>Then I took a new diskdump, and just to let this old bird fly again, I restarted in safe mode, and selected to restore a restore point from before I started this endeavor.</p>
<p>Start 4: Does it run now?</p>
<p>Does it run now? Looks like it does, the image is holding a system that wasn't shutdown properly (deuh), so it starts a scandisk before it boots, but that's only normal. Any file that was open at the time of the diskdump may get 'corrected', but I warned you. Then the system boots, telling you you need to activate. Just like you would when you replace your motherboard. (Which I kind of did.)</p>
<p>So, in short, this is what you need to do to convert a physical Windows installation into a virtual image:</p>
<ul>
    <li>download <a href="http://www.chrysocome.net/dd">http://www.chrysocome.net/dd</a></li>
    <li>open device manager</li>
    <li>replace the drivers of any system-components that use a vendor-driver, and replace it with the generic driver, if there isn't one available, disable the device (assuming these are non essential devices)</li>
    <li>reboot, wait a while so any (re-)detected devices get drivers loaded, and repeat the last step just to be sure</li>
    <li>use dd to generate an image of your system in this state</li>
    <li>on the new machine use this image to run a virtual machine</li>
</ul><span class="label">location:</span> <span class="locator"><a href="http://yoy.be/item.asp?i62" style="white-space: nowrap;"><img src="http://yoy.be/img/ic13.png" width="16" height="16" border="0" align="top" /> www.yoy.be</a> &gt; <a href="http://yoy.be/item.asp?i36" style="white-space: nowrap;"><img src="http://yoy.be/img/ic16.png" width="16" height="16" border="0" align="top" /> users</a> &gt; <a href="http://yoy.be/item.asp?i18" style="white-space: nowrap;"><img src="http://yoy.be/img/ic22.png" width="16" height="16" border="0" align="top" /> StijnSanders</a> &gt; <a href="http://yoy.be/item.asp?i330" style="white-space: nowrap;"><img src="http://yoy.be/img/ic84.png" width="16" height="16" border="0" align="top" /> IRL</a></span><br /> <span class="date">created: 28/10/2010 23:23:16 <a href="http://yoy.be/item.asp?i18" title="i18">&laquo;</a></span>
	 <span class="date">modified: 28/10/2010 23:23:16</span>
	 <span class="date">weight: 0</span>
	<br /><span class="label">tokens:</span> <a href="http://yoy.be/log.asp?tt36*"><img src="http://yoy.be/img/cat/cat_weblog.gif" width="50" height="13" border="0" align="top" alt="weblog" /></a> <a href="http://yoy.be/log.asp?tt26*"><img src="http://yoy.be/img/cat/cat_computers.gif" width="50" height="13" border="0" align="top" alt="computers" /></a>  <br />]]></description>
		<guid isPermaLink="true">http://yoy.be/item.asp?i2944</guid>
		<comments>http://yoy.be/report.asp?i2944</comments>
		<pubDate>Thu, 28 Oct 2010 21:23:16 +0100</pubDate>
		</item>
		
</channel>
</rss>
