March 2006 - Posts
As Visual Basic supports only 6 versioning tags (Comments, Legal Copyright, etc), I've ended up modifying VB6.exe (!) to have another tag available.
Incorrectly reported yesterday as a bug, this case is actually a correct behaviour, although not intuitive at all. The problem is that the compiler will try to find a function declaration whenever possible, so in the following case:
BSTR bstr = NULL;
CString s(_bstr_t(bstr));
s = "a";
Here s is parsed as a function declaration, instead of a variable - this is correct, though (!).
Here's one very cool technique I've learned in the past - used mainly when you have to do lots of automation calls to an out-process server. The point is to move these client calls to a dll and inject it in the exe server - there's a huge improvement in speed because now it's in-process.
This should have went into the COM API, or at least in the Win32 api - an official way of injecting a dll (instead of the current hacks that are done usually).
Very old stuff, but
here is an x86 assembly compiler that outputs .net - so now you can write asp.net sites in assembly language :D. The entire site is very interesting, it's the same guy that made the Gmail
shell extension.
Pretty dissapointing from a technical point of view :D, their
software is just playing a list of sites on a network of VNC-controlled PCs. So basically there is a network of PCs with projectors, and from the server you can choose a playlist of sites / movies / pictures to be shown on each of these - with the artist mixing them in real-time, that is. The WiFi connection was just for looking more high-tech.
Besides this, some artists had really good performances - from ironic views of Google in the future to very artsy visual effects and movie mixes.
Interesting stuff -
they mix raw packet data directly from the Internet as I have understood (translated into audio sampels, of course). Will be there to see what is it about.
Pretty old, but what do you say about
this ? It's a full-featured hardware XML processing device that accelerates the work with XML and XSL.
Don't ever use a normal main loop and a Thread.Sleep call to stop using 100% cpu - better use Application.Run and do you processing on the Idle event.
If you didn't know, negating where name='a' to where not(name='a') is not what you expect: the records with NULL are not returned. Still - you can quickly negate a condition with not( ... ) if you are careful when generating it: simply add and not name is null to the condition. So, again:
name='a' -> not(name='a')
name='a' and not name is null -> not(name='a' and not name is null)
The first one is incorrect.
As
Troniu said
here, let's try to think at a *perfect* voting system, available online. It should only allow one vote per PC, and of course detect when a proxy is changed. I propose browser plugins for Firefox & IE - either to store some hidden data to mark the vote or to submit a checksum of computer-specific info :D.
Some bizarre
writings about design patterns (via Mike) :D.
1. try ... catch stops access violation errors also (could have bet on this)
2. it's easy to move records from one database table to another:
insert into Table_dest select * from Table_src
Few days ago I've started cracking it, but, being busy with other things,
these guys were quicker in releasing a patch. Their site seems to be down so maybe I will get again on it.
It's about getting over the 5-way conferencing limit on AMD processors.
There's no way to disable it in IIS - pretty stupid move. I've ended up patching the web.config of a child site to remove or clear parts of the configuration file.
The Java apps on Nokia >= 6630 are skinned (the UI elements, that is) - unlike on the Symbian 7.0 Nokias. This is very good news and comes as a big surprise.
An assignment operator for a simple class like CPoint3D would get unnoticed, right? The performance impact may be pretty severe, as I investigated a case today. As you may guess, there were *lots* of calls to the function - enough to cause a ~5% decrease in speed. Ok course - the function was useless: rep movs is enough.
Default MFC dispatch maps are implemented with direct lookups and not with a search, so after your BEGIN_DISPATCH_MAP you must have DISP_PROPERTYs and DISP_FUNCTIONs exactly in the ascending order of their dispids. Here's the actual MFC source code:
if ((UINT)LOWORD(memid) <= nEntryCount)
{
pEntry = pDispMap->lpEntries + LOWORD(memid)-1;
// must have automatic DISPID or same ID
// if not then look manually
if (pEntry->lDispID == DISPID_UNKNOWN || pEntry->lDispID == memid)
{
return pEntry;
}
}
Although writing value = map[key] is very tempting because it looks nicely there's a big catch with it: if key is not found an entry is created with the empty value. The correct and recommended way of retrieving is using the Lookup function.