Showing entries 11 to 18
« 10 Newer Entries
Displaying posts with tag: hacking (reset)
Recycling old MySQL business cards


Recycling old MySQL business cards
Originally uploaded by Geert JM VanderkelenWell, we don't have a policy on what to do with them, so I went creative. Not as creative as Harrison did (where is that picture???), but I like it. It's hanging next to my MySQL certificates. Yes, I'm proud on these things, maybe I'm a bit vain.. But it does look good on the wall of my storage room.

(btw, this flickr to Google blogging is great!)

UDFs at the MySQL User's conference

The MySQL User's conference will be held in less than a month from now!!!

This year there is quite a good number of sessions on adding your own functions and procedures, such as:

[Read more]
MySQL Stored Procedures: CASE syntax

Thank you all for taking the time to respond to the little challenge I posted yesterday! I am pleasantly surprised to note that so many people took the time to post a solution. And most people provided the correct answer too: you are all entitled to a well deserved discount to register for the MySQL User's conference!!!

For those of you interested in the solution: there are two different forms of the CASE statement syntax: the so-called simple case and the searched case.

The simple case selects one WHEN...THEN branch by comparing the value of the expression that appears after the CASE

[Read more]
MySQL stored procedurs: ...the CASE that they gave me...

Let's see if you can solve this little puzzle...

Consider this stored procedure:


-- finds the first slash and exits
create procedure p_find_slash(p_text text)
begin
declare v_index int default 1;
declare v_length int default character_length(p_text);
declare v_char char(1);

_main_loop: while v_index <= v_length do -- loop over all characters

set v_char := substring(p_text, v_index, 1); -- grab the current character
case v_char
when v_char = '/' then -- found a slash!
select concat('A slash at ', v_index) message; -- report it
leave _main_loop; -- and then stop
else
[Read more]
Reporting MySQL Internals with Information Schema plug-ins

Last week, I described how to use the MySQL plug-in API to write a minimal 'Hello world!' information schema plug-in. The main purpose of that plug-in is to illustrate the bare essentials of the MySQL information schema plug-in interface.

In this article, I'd like to take that to the next level and demonstrate how to write an information schema plug-in that can access some of the internals of the MySQL server. For this particular purpose, we will focus on a plug-in that reports all the SAVEPOINTs available in the current session. This …

[Read more]
Postfix, MySQL, DoveCot, Spamassassin, Sieve: YES!

This is more venting my frustration over installing Postfix on a new (xen)box (old 1U VALinux finally crashed, blablah..).

I have been putting days, if not weeks into trying to figure out how to make Postfix with virtual users work together with Amavis and Spamassassin so it filters out to the Spam maildir of users.
Now, some will say: oh, that's peanuts. You take Courier's Maildrop and off you go.. Maybe I'm stupid with this, maybe, but it took me far less headaches and an hour (+ burger + pint in the bar) to get Dovecot 'deliver' figured out with Sieve.. and it actually works!

What I have now working on my Ubuntu Feisty server is:
* Postfix with virtual users using MySQL 5.1 (duh)
* Amavisd going through new email using Spamassassin (still have to figure out how to add the X-Spam header)
* Using Dovecot's deliver tool instead of this .. #!@$#$.. maildrop thing.. (no offense)
* Sieve …

[Read more]
Django Goodies

I'm starting to get into Django more and more, forgetting PHP. And some nice stuff is coming up.

Yesterday there was a post about a Django Cheat Sheet published by folks at Mercurytide. Still work in progress, but all tools are welcome for a 'starting' project.

And then there is the Django Book. It's getting quite heavy already in pages and you can leave comments to make it even better!
Of course, there are the usual PostgreSQL posts.. Well, they are funny. Like the one on Chapter 2 suggesting to indeed sort the database engines alphabetically because they should be equally good, but keep PostgreSQL first in the list.

Other comments suggest the MySQL python module MySQLdb doesn't work with Python …

[Read more]
In the house we have, pread() and pwrite() performance

Let us talk about pread() and pwrite() for a moment.

So what are the differences between the two of these, and read() and write()?

The difference between pread() and read() is that pread() is an atomic action.

Let me explain why.

For the average application that is reading data you would normally be doing a seek and then do your call to read(). If you are reading sequentially in a file you will never do the seek call, all you will do is the read() call. The read call causes an update to the the file descriptors position.

Now lets look at the problem where you are reading different blocks of the file instead of reading all blocks sequentially. Calling read () means that you will be doing your call to seek and then updating file->f_pos for the operation. For a pread() the operation of seek is internalized and file->f_pos will not be updated.

So they are …

[Read more]
Showing entries 11 to 18
« 10 Newer Entries