» frame | home browse filter search | refresh | log on
printed zondag 29 januari 2012 19:51:04 from www.yoy.be
Welcome 06/05/2005
Is this your first visit? Click here for more information about this site.
QuickStart...
selected recent changes and comments, log in to see more, browse or filter to see all...
What a strange discovery I made today. I was hunting down a weird exception we noticed in the logs of the live system.
It turns out that a 'global' callback procedure is being called when you use Printer.Canvas (Printer.Canvas.StretchDraw in my case) by the GDI subsystem. The default AbortProc in Printers.pas calls Application.ProcessMessages, which was causing trouble in my case.
There's a quick workaround:
function MyAbortProc(Prn: HDC; Error: Integer): Bool; stdcall; begin Result := not FPrinter.Aborted; end;
And then right after Printer.BeginDoc; call SetAbortProc(Printer.Canvas.Handle,MyAbortProc);
location:
Application Development >
Programming Languages >
Object Pascal >
Delphi
created: 26/01/2012 19:46:39 «
modified: 26/01/2012 19:46:39
weight: -200
tokens:
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.
Ik vermoed, ook hier, 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.
Het grappige aan dit alles is dat ik laatst op het werk een proof-of-concept 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.
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.
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.
Dan, eenmaal je beeld kan vastleggen, moet je op zoek naar de nummerplaat. Er bestaat waarschijnlijk wel open-source OCR 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 (een beetje zoals deze).
Deze gegevens moeten allemaal nog verwerkt worden, maar veel moet dat niet kosten. Tegenwoordig worden rekeneenheden niet alleen veel kleiner maar ook veel goedkoper. (Ken je deze?) En iets anders kiezen dan 'gewone' STP netwerkkabels zoals ze overal al liggen zou ik ook niet doen.
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.
location:
Opinions >
".be"-related
created: 2/01/2012 8:29:04 «
modified: 2/01/2012 8:30:29
weight: 0
tokens:
just! en ook hier:
Nu ook op dvd: http://www.youtube.com/watch?v=u4cR8Qj5iRE
http://en.wikipedia.org/wiki/The_Tripods
release v1.1.5.285
- xxmHSYS: HTTPAPI handler
- bug fixed: parameters were parsed from request body multiple times
- when BufferSize is set, contexts keep buffers to save on allocating and releasing memory
Warning: the new xxmHSys1 handlers, build using HTTPAPI v1, use the xxm.xml file as a project registry, but require one or more project names to be listed in the command line in order to start hosting the project over HTTPAPI. This might change in a future version. This allows to evaluate xxmHSys1 and test its performance.
release v1.1.4.284
- upload progress monitoring interface
- new IXxmContext members: BufferSize, Flush
- optional project interface to handle exceptions: IXxmProjectEvents
Only three items this release, but three strong, useful features that should have been in there all along.
BufferSize has a default value of 0 so developers new to xxm can experience the fact that data sent gets though to the client as fast as possible, but it's highly recomended to set BufferSize on larger projects except when debugging.
v0.3.0.277
I was under the false impression that SetWindowsHookEx would throw virus-warnings when used to catch messages globally, but this is not the case. Since it catches events more reliably and using less resources, I've updated odo to use a mouse and keyboard hook to count events.
(Doesn't work on 64-bit processes, and no longer supports 'fix102', if you use the feature, don't upgrade! I might re-introduce it in subsequent versions)
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.
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?
Maar ik zit waarschijnlijk maar wat uit mijn nek te kletsen, want eigenlijk ken ik daar helemaal niets van.
location:
Opinions >
".be"-related
created: 17/11/2011 23:30:10 «
modified: 17/11/2011 23:30:10
weight: 0
tokens:
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.
Plots dacht ik zo wat het zou doen als ze een ongunstig BTW-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 BTW-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.
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.
En zou het meer opbrengen voor de staat? Als het lukt om mensen meer te doen gebruik maken van het betere BTW-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 BTW-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.
Maar het is allemaal maar een ideetje natuurlijk.
location:
Opinions >
".be"-related
created: 9/11/2011 20:26:40 «
modified: 9/11/2011 20:26:40
weight: 0
tokens:
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...
location:
freeware >
xxm
created: 8/11/2011 22:39:39 «
modified: 8/11/2011 22:39:39
weight: 0
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.
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.
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.
location:
Opinions >
".be"-related
created: 2/11/2011 15:36:13 «
modified: 2/11/2011 15:37:12
weight: 0
tokens:
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)
This breathes new live into the print job sub-system and may sometimes cause the 'hanging' jobs to resume printing.
location:
www.yoy.be >
users >
StijnSanders >
IRL
created: 13/09/2011 0:04:51 «
modified: 13/09/2011 0:04:51
weight: 0
tokens:
Een tijd terug, sinds ik deze zag: http://xkcd.com/556/ en ik bijna dagelijks kan uitkijken op de windmolens tussen Melle en Wetteren, 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 http://en.wikipedia.org/wiki/Rise_of_the_Triad 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?
location:
www.yoy.be >
users >
StijnSanders >
IRL >
Nostalgia
created: 10/09/2011 14:07:40 «
modified: 10/09/2011 14:07:50
weight: 0
On one website, I'm using jQuery to load a form into a cell of 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.
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.
Sleuthing around, it appears that this is by design! 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.
Though other sources tell me this is a bug and could get fixed in future versions...
location:
Application Development >
Platforms >
iOS
created: 30/07/2011 2:01:14 «
modified: 30/07/2011 2:01:14
weight: 0
tokens:
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.
Kunnen we dus zelf iets er mee doen? Batterijen zijn peperduur en verliezen behoorlijk veel. En even omhoog pompen 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 desaliniseren, daar is veel energie voor nodig. Maar dat is niet het geval, regenwater genoeg en dat is nog relatief zuiver.
Dus, zou ik kunnen CO2 uit de lucht plukken? En er O2 van maken. En als het even kan CH4 overhouden. Met een truuk kan je die dan opslaan en door een brandstofcel sturen. Bijvoorbeeld 's avonds, als ik thuis kom en de zon gaat slapen.
Als ik zo snel even zoek dan lijkt het niet onmogelijk. Misschien lukt het pas op 250°C, maar we zitten toch met energie over, dus dat zou wel eens goed kunnen lukken...
O jee! Een goed idee! Ik ga dat nu moeten patenteren zeker? Alleen jammer dat dan weer zoveel kost in Europa...
location:
Opinions >
Science
created: 19/05/2011 21:55:16 «
modified: 19/05/2011 21:55:16
weight: 0
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.
location:
projects >
AutoClick
created: 4/05/2011 8:20:34 «
modified: 4/05/2011 8:20:34
weight: 0
references:
![]()
v1.0.8.275
minor update: the cursor tag hides after an interval without movement of the mouse cursor
also added an 'bitcoin accepted' logo to the settings dialog
v0.2.8.274
Added an about box to the settings dialog, and a bitcoin logo and bitcoin address (hint hint)
Tiens, nu ik deze zie: http://www.boingboing.net/2011/04/04/mapping-the-pull-of.html herinner ik me een oude kaart (misschien wel deze?) 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.
location:
spotted on the net >
science >
space
created: 4/04/2011 15:27:09 «
modified: 4/04/2011 15:27:09
weight: 0
Hmm, I guess this will take a lot more getting used to than I thought... Consider this code:
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;
This works on SQLite3 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 SQLite3?
location:
Application Development >
Data Storage >
SQLite
created: 2/04/2011 0:03:07 «
modified: 2/04/2011 0:04:27
weight: 0
tokens:
Yes, it's that easy!
unit un_WakeUpOnLAN;
interface
type
TMACAddress=array[0..5] of byte;
function MACAddressFromStr(x:string):TMACAddress;
procedure SendWakeUpOnLAN(Address:TMACAddress);
implementation
uses SysUtils, WinSock;
function MACAddressFromStr(x:string):TMACAddress;
var
i,j,b:integer;
begin
j:=0;
for i:=1 to Length(x) do
if x[i] in ['0'..'9','A'..'F','a'..'f'] then
begin
if byte(x[i])>$40 then b:=9 else b:=0;
if j>12 then raise Exception.Create('MAC Address too long');
if (j and 1)=0 then
Result[j div 2]:=(b+(byte(x[i]) and $F)) shl 4
else
Result[j div 2]:=Result[j div 2] or (b+(byte(x[i]) and $F));
inc(j);
end;
if j<12 then raise Exception.Create('MAC Address too short');
end;
procedure SendWakeUpOnLAN(Address:TMACAddress);
var
s:TSocket;
i:integer;
a:TSockAddr;
d:array[0..16] of TMACAddress;
const
x:TMACAddress=($FF,$FF,$FF,$FF,$FF,$FF);
begin
d[0]:=x;
for i:=1 to 16 do d[i]:=Address;
a.sin_family:=AF_INET;
a.sin_port:=htons(0);
a.sin_addr.S_addr:=INADDR_BROADCAST;
s:=socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP);
if s=INVALID_SOCKET then
raise Exception.Create(SysErrorMessage(WSAGetLastError));
try
if (connect(s,a,SizeOf(a))=SOCKET_ERROR)
or (setsockopt(s,SOL_SOCKET,SO_BROADCAST,PChar(@i),4)=SOCKET_ERROR)
or (sendto(s,d[0],102,0,a,SizeOf(a))=SOCKET_ERROR) then
raise Exception.Create(SysErrorMessage(WSAGetLastError));
finally
closesocket(s);
end;
end;
var
WSAData:TWSAData;
initialization
WSAStartup($0101, WSAData);
finalization
WSACleanup;
end.
location:
Application Development >
Programming Languages >
Object Pascal >
Delphi
created: 29/03/2011 8:28:46 «
modified: 29/03/2011 9:42:06
weight: 0
I've been asked if I accept donations for the freeware 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.
Today I read about http://www.bitcoin.org/ 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...)
So, if anyone wants to wire me anything (even 0.01BTC just to check if it works) here's a bitcoin address:
1Q5omBMcpRQkx7WqPpHceM37ZBqpCgyrDB
location:
spotted on the net >
legal issues >
financial
created: 23/03/2011 16:45:07 «
modified: 23/03/2011 16:45:07
weight: 0
tokens:
I once had the idea of building a sieve to find primes, 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.
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.
I'm not sure if anyone can use all 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.
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!)
location:
www.yoy.be >
users >
StijnSanders
created: 14/03/2011 0:36:44 «
modified: 25/08/2011 21:14:25
weight: 0
tokens:
I've been looking high and low, found some things that get close, but not close enough (the closest being this one about Microsoft Antimalware Service, but I don't have that one here), but it turns out to be just this: disable the virus-scanner, either while building or by excluding the mozilla build folder(s)...
Because I can't find it anywhere I put it up here, I hope people find it by searching...
So, now I'm stuck because I have the rather new MSVC++2010 Express and it isn't supported (yet?) So I'll have a look why not, or downgrade to the 2008 one...
location:
Information >
Technology >
Information Technology >
Internet >
WebBrowser >
FireFox
created: 9/02/2011 17:40:02 «
modified: 9/02/2011 17:40:02
weight: 0
O jee! en tellen kunnen die ook niet meer! (2000 miljard is toch 2 biljard?)

O jee! zijn die waarlijk zo laag gevallen! En De Standaard dan nog! Ik dacht dat die nog wat van plan waren een beetje serieux uit te stralen...
En het meneerke links komt ook verdacht veel voor als 'relevante afbeelding' op een hoop items in de lijst...
location:
spotted on the net >
".be"-related
created: 20/01/2011 22:44:19 «
modified: 20/01/2011 22:44:19
weight: 0
tokens:
An alternative SQLite3.dll wrapper
location:
freeware
created: 14/12/2010 15:23:58 «
modified: 14/12/2010 15:23:58
weight: 0
tokens:
A Delphi driver to access a mongoDB server.
It maps variables onto Delphi variables of type OleVariant, which resembles the loose typing of JavaScript a lot.
There are two main units and three main object to enable access to a mongo DB server:
bsonDoc.pas
TBSONDocument = class(TInterfacedObject, IBSONDocument, IPersistStream)
mongoWire.pas
TMongoWire=class(TObject)
TMongoWireQuery=class(TBSONDocumentsEnumerator)
location:
freeware
created: 2/12/2010 10:05:35 «
modified: 2/12/2010 10:06:09
weight: 0
tokens:
This little trick appears to work in the Delphi debugger also! Use this code to set the debug display name for the current thread:
interface
function IsDebuggerPresent: BOOL; stdcall;
implementation
uses Windows;
function IsDebuggerPresent; external 'kernel32.dll';
procedure SetThreadName(ThreadDisplayName:AnsiString);
var
ThreadInfo:record
dwType:LongWord;
szName:PAnsiChar;
dwThreadID:LongWord;
dwFlags:LongWord;
end;
begin
if IsDebuggerPresent then
begin
ThreadInfo.dwType:=$1000;
ThreadInfo.szName:=PAnsiChar(ThreadDisplayName);
ThreadInfo.dwThreadID:=LongWord(-1);//calling thread
ThreadInfo.dwFlags:=0;
try
RaiseException($406D1388,0,SizeOf(ThreadInfo) div SizeOf(LongWord),@ThreadInfo);
except
//
end;
end;
end;
location:
Application Development >
Programming Languages >
Object Pascal >
Delphi >
Debugging
created: 5/11/2010 0:25:47 «
modified: 5/11/2010 0:45:47
weight: 0
tokens:
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.
If you don't care about the story, scroll to the bottom to see the quick guide through the steps to take.
The old, aging, deteriorating laptop is ready for retirement, it's got its power connector re-soldered twice already, two out of three (...) USB 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...
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?
Step 1: Pulling the image.
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 20GB is nearly full.
(On a side note, I'm was quite happy this last months to discover cleanmgr http://support.microsoft.com/kb/253597 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.)
I found this great tool that does the trick: http://www.chrysocome.net/dd
dd if=\\?\Device\HardDisk0\Partition0 of=\\192.168.0.3\temp\oldlaptop.img bs=128k --progress
'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.
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.
Start 2: Running the image.
Let's see. I've selected qemu www.qemu.org to run the image, it's light-weight, runs well (and closes well), but I hear good things about VMWare player also. http://www.vmware.com/products/player/
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 "STOP 0000007B", and loops into a reboot which repeats.
Thing is, the old machine had an Intel something in it's center, the new one has it of AMD 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.
Start 3: Fixing them drivers.
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 > no, not now > I wont to choose > don't search > select the plain vanilla one)
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.
Start 4: Does it run now?
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.)
So, in short, this is what you need to do to convert a physical Windows installation into a virtual image:
location:
www.yoy.be >
users >
StijnSanders >
IRL
created: 28/10/2010 23:23:16 «
modified: 28/10/2010 23:23:16
weight: 0
tokens:
Vreemd, ik hoor niemand zeggen wat, denk ik, algemeen wel leeft: N-VA kent nu een zeker success omdat een groot deel van de Vlamingen vindt dat zij de mensen zijn(1) die eindelijk dat BHV vraagstuk kunnen kraken, maar eenmaal dat achter de rug is zal wel nog eens worden bekeken wat ze precies van 'Vlaanderen onder Europa' denken. En ik vrees dat dat wel nog eens flink zou kunnen tegenvallen. Ik ben geen expert, maar ik zit zo te denken dat er nu wel een hoop Belgisch gezinde mensen zijn de N-VA (voorlopig) aanhangen omdat ze een heel consequente indruk maken. Ik vermoed dat vóór de recentste federale verkiezingen N-VA er in slaagde een zekere indruk te maken dat ze over politieke inzet en toewijding beschikken, meer dan anderen. Misschien was dat op Vlaams of gemeentelijk niveau(2), ik weet het niet. Maar het was wel net dat wat nodig was om een kritiek aantal mensen te overtuigen. Met rake praat alleen raak je maar zo ver, dat hebben ze goed gesnopen.
Ik denk dus nog dat er een krisis zit aan te komen binnen N-VA, zo binnen een jaar of drie. Of een scheiding tussen Europasten en Belgicisten(3), of een verkiezingsnederlaag omdat ze het droog brood van een directe rapportage aan Europa aan niemand meer verkocht krijgen. Tenzij, en dit is zo'n gedachtenspinseltje van mezelf, dat ze ook hier meer doen dan rake praat alleen, en eens kijken over de grenzen of er nog bevolkingsgroepen zouden geinteresseerd zijn om te 'opereren' onder een entiteit direct onder Europa, bijvoorbeeld: Basken, (Noord-)Ierse protestanten, Koerden(4), Saami(5), Friesen, en misschien zelfs Roma of mensen vrijwillig zonder vaste verblijfplaats in het algemeen.
Maar eerst is nog een regerinkje vormen natuurlijk... (en een kiesdistrictje te splitsen) ((en burgemeesters te benoemen?)) (((en staatsfinanciering om te herzien)))
(1): of misschien wel dat Bart De Wever de man is, maar het interpreteren van een verkiezingsuitlag laat ik aan de eksperts over.
(2): kwatongen beweren dat het laatste seizoen van De Slimste Mens ook veel heeft betekend, maar het inschatten van de politieke relevantie daarvan laat ik aan de eksperts over.
(3): ik veronderstel even dat er op een termijn van 3 jaar (of minder?) een nieuw België onstaat met een stabiele hertekende balans van de deelstaten, zodat er opnieuw meer, maar andere, Belgicisten zijn.
(4): zou Turkijke op 3 jaar in de EU zitten? misschien maar Irak waarschijnlijk niet...
(5): een volk dat leeft in het hoge noorden van Noorwegen, Zweden en Finland, een schoolvoorbeeld van een volk met 'internationaal' gedeeltelijk zelfbestuur.
location:
Opinions >
".be"-related
created: 27/10/2010 9:18:53 «
modified: 27/10/2010 21:39:29
weight: 0
tokens:
Ik vraag me meer en meer af wat wuauctl.exe nu weer zit te doen:

Houdt die er ergens een log bij want ik ga die eens moeten onderzoeken denk ik.
Dat de CPU niet omhoog gaat is omdat die zoveel werk heeft met het swappen!
GoogleUpdate.exe heeft ten minste de manieren om zo weinig mogelijk resources te gebruiken.
location:
www.yoy.be >
users >
StijnSanders >
IRL
created: 14/10/2010 18:55:49 «
modified: 14/10/2010 18:55:49
weight: 0
tokens:
Ik heb net een raar idee. Zou het kunnen zijn dat ik programmeer met mijn middellangetermijngeheugen? (Wat een lang woord.) Dingen die je in je op neemt verwerk je in je kortetermijngeheugen, en als ze daar even blijven gaan ze over naar het middellangetermijngeheugen. Wat daar een tijdje zit maakt het langetermijn zo'n beetje zijn keuze in wat die gaat bijhouden. (Daarom lijkt het achteraf altijd alsof de tijd voorbij is gevlogen, maar da's een ander verhaal.)
Wat er veel gebeurt bij programma's schrijven is lezen! Lezen, lezen en lezen, en onderwijl onthouden wat er precies allemaal gebeurt in veel, zoniet alle mogelijke gevallen. Dat wordt soms wel eens een hele hoop, maar al die dingen lezen (en herlezen, en herlezen...) bouwt op in het kortetermijngeheugen, tot de hele structuur zo'n beetje kant en klaar in je hoofd in het middellangetermijngeheugen zit, en dan pas kan je verder met te veranderen aan die complexe structuur van logica. En je aanpassingen testen en zo.
Als je dat dan een paar dagen niet meer gebruikt, dan verdwijnt het. Bij mij toch. Als ik er dan een paar weken of maandan later nog eens op moet terug komen, dan komen de grote lijnen wel terug (ik vermoed uit het langetermijngeheugen), maar lang niet alles. Dus wordt het weer lezen en lezen...
t'Is natuurlijk maar een idee.
location:
www.yoy.be >
users >
StijnSanders >
IRL
created: 8/10/2010 16:12:15 «
modified: 8/10/2010 16:12:15
weight: 0
tokens:
v1.2.0.272
Mini-diff in adjacent lines with difference (only from left, right for now)
NULL characters are replaced with space.
XML option: treat CDATA as text
XML option: detect namespaces, nodes with the same namespace URI may use different prefixes
Hoe meer ik dingen lees zoals dit en dit en denk aan grote dynamische websites zoals ze in de mode zijn tegenwoordig, de NoSQL generation, en ondertussen verder werk aan xxm, hoe meer ik iedere keer terugkom op het idee om een website zoals dat als applicatie te programmeren voor maar 1 user session, maar een aantal van die applicaties tegelijk te laten draaien natuurlijk, naargelang het aantal concurrent users van het moment.
Misschien denk je wat is het verschil met een session object, die komt er toch ook bij een eerste paginabezoek, en verdwijnt bij logoff of als de session expiret? Ik denk er aan om veel verder te gaan. Wat je als user allemaal kan in zo'n walled garden is tegenwoordig zodanig uitgebreid dat het eigenlijk op zijn eigen een database kan vullen. En dan moet je inbeelden dat je dus met alle honderden/duizenden/miljoenen gebruikers met je data samen in een database moet zitten. Ik vind het vreemd dat een gebruiker last zou kunnen hebben van het feit dat alle data eigenlijk op een hoop samen zit.
Stel nu dat je voor elke gebruiker een applicatie moet starten en een specifieke database moet laden, dan kan je bijvoorbeeld gerust verschillende versies laden. Blijkbaar gaat er veel werk in veranderingen en upgrades bij die grote websites van tegenwoordig, die zou je dan heel rustig user per user kunnen uitrollen.
Bon da's maar een idee. Ik zou het ook kunnen uitwerken en dan nog eens tonen, maar ik stop maar heel af en toe een heel klein beetje tijd in mijn hobby-projectjes, dus dat zou nog een hele tijd duren, en ik wou dit toch al met jullie delen. Ik hoor graag wat jullie er van denken.
location:
spotted on the net >
IT-related >
internet related
created: 22/09/2010 15:26:07 «
modified: 22/09/2010 15:26:07
weight: 0
Yikes, spam scams are getting really hard to ignore for noobs without proper protection:
The message "Facebook password has been changed" from Facebook Team (directorate@facebook.com) contained a virus or a suspicious attachment. It was therefore not fetched from your account and has been left on the server.
If you wish to write to Facebook, just hit reply and send Facebook a message.
Thanks,The Gmail Team
location:
spotted on the net >
IT-related >
development related >
security
created: 17/09/2010 18:05:11 «
modified: 17/09/2010 18:05:21
weight: 0
Area and distance calculator:
A nice app for calculating land area in google maps, is http://www.google.co.in/ig/directory?type=gadgets&url=mikebrewer.co.uk/files/area_distance.xml. However one cannot save the work you've done so far. Somebody else might have an opportunity here do write a similar app. Even if one has to paste a list of coordinates yourself, i.e not on google maps. Farmers etc. often want to calculate their arable land to determine the rental to charge. Maybe somebody knows about an existing app? Free preferably, and for a PC not a smartphone...
Man controlled fire, community engaged in cooking.
Man created wheel, community engaged in transportion.
Skipping a few steps, man engineers, designs, constructs advanced computing devices, and community is to follow the whims of the Apples, Goggles, EyeBeaMs and Migrowesophts of this world? Now the Oracle keeps the Sun from shining freely over my Mocca! My SQL where are we going.
I hope this day even more than I did before there will be a future day that I can open my Windows of my box for free. Be it undix another name.
location:
Opinions >
Computer related
created: 18/08/2010 23:15:14 «
modified: 18/08/2010 23:16:45
weight: 0
Thanks! I don't know how I missed this one...
The menu option "View > Explorer Bar > Folders" doesn't have a shortcut of it's own, but a simple
Alt+V Alt+E Alt+O
works on my computer here. You don't even have to let go of the Alt key while pressing V, E and O!
location:
Opinions >
Computer related >
ELisabeth constantine
created: 12/08/2010 16:12:26 «
modified: 12/08/2010 16:12:26
weight: -90
Just wondering... For Windows Explorer: Can't some nice person program a keyboard shortcut (alt + something) that has the same effect as clicking on the 'folders' view button? Because I'm perpetually in some explorer window that has a single pane, and I always want the tree on the left as well. Or maybe I should just use a different file explorer app?
location:
Opinions >
Computer related
created: 12/08/2010 10:44:02 «
modified: 26/08/2011 10:23:04
weight: -100
v1.1.13.270
Fixed bug reading UTF16 files (and no-one told me!)
XML issue: attribute differences no longer cause tags to mismatch
XML option: set one or more 'defining attributes' used for display and matching
XML option: ignore element sequence (treeview only)
FindMySoft.com has awarded AutoClick with a 'Safe To Install' certificate!
To answer the anonymous user's question: I don't have access to a Win7-64 machine, but I think it should run fine, perhaps in a 32-bits wrapper process. I don't think the method used to virutalize mouse-clicks would fire security warnings, it didn't in Vista.
I use his program every day myself as well, and cannot agree more! I suffer from some permanent RSI as well.
Stijn, I'm a person affected with SMA. Your AutoClick is the single best piece of software I use. It's wonderfully made, it's perfectly functional, it's glitch-free -- in short: it's absolutely faultless! It's freaking perfect!!! :D It just couldn't be better -- I mean it! It's quite indispensable to me and I'm grateful no end to you for it! I do like it so much!
I have a question: does the latest version work under Windows 7 64-bit?
v0.2.6.265
Nice website = www.omniglot.com