Showing entries 1 to 7
Displaying posts with tag: Inciting Hatred (reset)
c++ stl bitset only useful for known-at-compile-time number of bits

Found in the libstdc++ docs:

Extremely weird solutions. If you have access to the compiler and linker at runtime, you can do something insane, like figuring out just how many bits you need, then writing a temporary source code file. That file contains an instantiation of bitset for the required number of bits, inside some wrapper functions with unchanging signatures. Have your program then call the compiler on that file using Position Independent Code, then open the newly-created object file and load those wrapper functions. You’ll have an instantiation of bitset for the exact N that you need at the time. Don’t forget to delete the temporary files. (Yes, this can be, and has been, done.)

Oh yeah – feel the love.

Brought to you by the stl-is-often-worse-for-you-than-meth dept.

Epic portion of FAIL

Excel as Your Database

Mike told me there’s a book. It’s a real book. Epic FAIL.

Sometimes you must wonder what crack people smoke

2>.\my_lwrite.c(31) : warning C4996: ‘write’: The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _write. See online help for details.

WTF.

If Visual Studio 2008 crashes one more time today….

Getting a file size (on Windows)

The first point I’d like to make is that you’re using a Microsoft Windows API, so you have already lost. You are just not quite aware of how much you have lost.

A quick look around and you say “Ahh… GetFileSize, that’s what I want to do!” Except, of course, you’re wrong. You don’t want to use GetFileSize at all. It has the following signature:

DWORD WINAPI GetFileSize(  __in       HANDLE hFile,

__out_opt  LPDWORD lpFileSizeHigh

);

Yes, it supports larger than 4GB files! How? A pointer to the high-order doubleword is passed in! So how do you know if this errored? Return -1? WRONG! Because the high word could have been set and your file length could legitimately be 0×1ffffffff. So to find out if you actually had an error, you must call GetLastError! Instead of one call, you now have two.

The Microsoft documentation even acknowledges that this is stupid: “Because …

[Read more]
How not to get a sensible response on a mailing list/web forum

For a start, you shouldn’t be using a web forum. Are you too stupid to use email or what?

Ask yourself, does your question boil down to “pls do my job 4 me. kthxbye” (because it’s in stupid speak because it’s an obviously stupid question to be asking). If it does, don’t post it. Instead, RTFFM (where F is for Fine…. at least one of them is anyway), look at the archives. You will then find approximately eleventy-billion messages pointing you to exactly the right tool and docs to let you answer your question - easily.

OpenOffice.org2 frustrates me like paper cuts

Possibly Ubuntu’s fault too for shipping the not-latest un-bugfixed release. But either way, it’s really annoying seeing the “Document Recovery” screen more than the edit text widget.

Copy and Paste slides in Impress is not flakey - it’s damn right crushed to pieces. Occationally it does something useful - like paste and not crash.

update: yes, i am just using it to put together presentations for our upcoming devconf - as well as the user conference. Why these things are so hard to do is beyond me. A simple app that didn’t crash *cough* magicpoint *cough* is looking rather superior at the moment.

update part 2: yes, the title changed. arguably i like this one better. although adding “right under the fingernail” is tempting

Phorum?s RSS sucks

Noticed this about our web based forums today:

the “Re: What is this? “Can’t find record in ‘'’ on query.”" post on the cluster forum from 10/02/06 07:53:20 isn’t the last message in that thread. there are currently 6 messages of which I only see 2.

Not only that, but from looking at the RSS, I can’t even see this post.

argh! So I shot off an email to our internal guys. The reply was that they don’t have hacking Phorum on their radar (fair enough). Of course, this just means that Phorum sucks[1] (or at least did in the version we do) and adds to the list of reasons why web based forums are much like doing $adjective to $noun.

What is it with new internet lamers and the inability to use an email program? Or even an nntp client (okay, usenet is officially crap now unless you just want spam and …

[Read more]
Showing entries 1 to 7