Category Archives: Uncategorized

Win32::API v0.48 adds cdecl function call support

In my (really little) spare time, I enjoy hacking on fun projects.
Lately, I have been struggling to get Win32::API Perl module to work on Vista with various MSVC++ and GCC compilers.

Since many have asked for it, and some brave soul had an old patch available on the net, I decided to give it a shot. I had already tried 2 or 3 times to get this patch (originally for v0.41) integrated in the new Win32::API versions, but always failed at it.

Today I decided to take the full journey, and seems I succeeded. Probably I broke something else… :-)
Please bare with me. Anyway, I have 2 things left in this release that I want to address in the new one:

– There's a Borland C macro def that is completely broken (thanks to BrowserUk for noticing)
– I need to complete the stack cleanup assembler code at the end of Call() function in the XS code. This should be easy, for some definition of "easy", since I already have some examples of MSVC/GCC assembler code in my RT queue.

Stay tuned for further updates…

MySQL is just crazy or what?

Ok, I was working on the staging/test database, checking out some performance problems I was experiencing.
Then I thought of optimizing one table. Optimizing should be like rebuilding the physical data file to compact record structures, remove invalidated data, …

MySQL has this OPTIMIZE TABLE command.
Ok, fire!

2/3 minutes passed. Then other 2/3. Then again.

I started to worry and tried to start new sessions, to see if table was blocked. It was.
Completely locked up.

Ok, I left the session running. Went to lunch. Came back.
Still running. WTF? I decided to interrupt the command. CTRL + C.

MySQL responded with some error code, 22 or something.
Ok, just check if I have to rebuild indexes, just in case.

SELECT * FROM sometable

Boom!

Table corrupted. No kidding. Tried to REPAIR TABLE and REPAIR TABLE QUICK.
No way. Table was completely DESTROYED.

Amazing…

Wikidoc syntax highlighting for vim

Recently I've been editing some wikidoc documentation, and I found boring to see everything as plain text.
I wanted to add some color to my vim screen.

So I decided to put together a wikidoc syntax highlighting file for vim.
And, 30 minutes later, it was working!

Thanks to the author of POD syntax highlighting. I shamelessly copied and modified his work…

BonDigi is the programming game of the moment

As I said in my last post, Bon Digi (really Bon Diggy) game is taking over!
When I posted the original announcement on our nonsense mailing list, I didn't know that I would have caused such an incredible activity from our brain cells!

So far, there have been nearly 10 different programming languages versions of Bon Digi game. Languages are: Perl5 (oneliners, scripts and classes), Python, Ruby, Haskell (3 versions!), Perl6, Emacs Lisp, Vim scripting and even CSS!

I will try to post some of these wonderful pieces of fine arts here in the next days.
Stay tuned.

Have you ever heard “Bon Digi”?

It's a game. A crazy one. A really crazy one.
We were doing it friday evening, drinking like nuts, and something in my mind popped up, and I thought:

We should code the algorithm for this game

In fact, it seemed really stupid and obvious. But thinking about it more and more, I discovered that it's not so simple at all…

And if you want to code it elegantly and concisely, you have to think about it for some time.
So, I took this -Ofun opportunity, and turned it, as I promised to Zoso, into a Games::BonDigi CPAN module.

Enjoy!

Fortune file about Jack Bauer

… and finally I managed to assemble a fortune file about Jack Bauer facts.
I looked at some websites that carry a lot of facts about Jack, like www.twentyfour.tv/jackbauer, or http://www.jackbauerisgod.com

Here it is!
You should generate also the ".dat" file to use with fortune program. The command is:

strfile -r jackbauer

This generates a "jackbauer.dat" file that should be copied into your "/usr/share/fortune" (or whatever) folder.
Enjoy!