I'm a GNOME user, but on my brother's suggestion I tried Amarok a month or so ago, and never looked back. I've used most of the popular music players for linux as well as iTunes & WMP, and I'd actually call Amarok the best on any platform. It's not even close.
One really nice feature is the database integration. I think every application should have this option, and not just because I work for a database company. Amarok can keep all its information in a MySQL database, and that includes the song lyrics it pulls down from the web.
We often recommend to our clients to convert their current
database from MyISAM tables to InnoDB.
The transfer by itself in most cases is almost plain, however the
application can be broken by new unexpected errors
1205 (ER_LOCK_WAIT_TIMEOUT)
Lock wait timeout expired. Transaction was rolled back.
1213 (ER_LOCK_DEADLOCK)
Transaction deadlock. You should rerun the transaction.
It is not hard to handle these errors, but you should be aware
of.
This is some thing we do in our PHP applications:
PLAIN TEXT CODE:
- class mysqlx extends mysqli {
- ...
- function deadlock_query($query) {
- $MAX_ATTEMPS = 100;
- $current = 0;
- while ($current++ <$MAX_ATTEMPS) …
I've been given the go ahead to release my NDB/Connectors code. These connectors wrap the NdbApi for a variety of languages, including Python, Perl, Java and C# at the moment. I'm managing development using Launchpad, so go to
https://launchpad.net/ndb-connectors
To get the latest version or status of the code. If you would like to contribute, feel free to branch a copy of the source using bzr and send me a revision bundle. There is also an ndb-connectors team on launchpad you can join if you'd like to participate more directly in the development. For either of these options to work, you need to first sign the MySQL Code Contributor License Agreement to assign copyright of your contributions to MySQL, Inc.
I hope to have a mailing list set up soon for discussion.
I came back from a two-week snowboarding trip to Zermatt -- my first to Switzerland, and what an excellent trip that was. Great powder, great freeriding, great weather. Will post some photos once I've sorted through them, but in the meantime, Sanna took some as well and posted them to her moblog.
On another note, I haven't mentioned Jim Starkey's comments to my previous post, but they're good reading to everyone interested in MySQL, with clarifications to some things I misunderstood in the documentation. I'm glad to hear that the "serial writes" don't in fact mean just one thread writing, as well as that he believes the engine will at a later stage allow multiple tablespaces per logical database.
I was poking around at credit cards this morning and came across this one that seemed like it would be a good fit for folks who would like to have Sakila (the MySQL dolphin) in their wallet wherever they go.
The colors aren't quite right, and the dolphin isn't moving upward like most of the MySQL logos, but you get the idea.
(I did not get a card, decided against it)
The problem of how to handle trees in SQL has been talked about alot. The basic 3 ways are:
- store the full path for each entry
- store the parent for each node
- use nested tree
Nested tree is good for read-many-write-less applications where the tree doesn't check over time too much as a write-operation is heavy-weight most of the time.
Referencing the Parent through the full path
Using the variant of the path involves a lot of string handling and is always slow. See below:
# use a full path to each node CREATE TABLE tree_path ( node_path VARCHAR(1024) PRIMARY KEY, name VARCHAR(32) NOT NULL, INDEX (name) ) ENGINE = innodb; INSERT INTO tree_path VALUES ( '/0', 'Earth' ), ( '/0/0', 'Europe' ), ( '/0/0/1', 'Germany' ), ( '/1', 'Moon' ), ( '/0/1', 'Asia' ); # search for parent of 'Asia' SELECT t1.name FROM tree_path AS t1 WHERE t1.node_path = ( …[Read more]
This time it's a quick function to validate email addresses,
based on regexp.
It can be used in a trigger to add data validation, or to check
data already in your database that needs a clean up ... really a
simple wrapper around a simple regexp query, but it can be
helpful.
Here it is:
- DELIMITER $$
- DROP FUNCTION IF EXISTS `test`.`is_valid_email` $$
- CREATE DEFINER=`root`@`localhost` FUNCTION `is_valid_email`(p_email varchar(64)) RETURNS tinyint(1)
- BEGIN
- CASE
- WHEN NOT (SELECT p_email REGEXP '^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$')
- THEN
- -- bad data
- RETURN FALSE;
- ELSE
- -- good email
- RETURN TRUE;
- END CASE;
- END $$
- DELIMITER ;
As per Mushu's comment, this is much cleaner, oops:
I was browsing the web today and stumbled upon this. This oven line is great! but come to think of it, how many people can afford to buy this $7k+ gadget (see this MSN coverage). Even if they could buy it, how many will actually would call their oven or email their oven and tell it to cook? I do have to say its a great concept and honestly if I was a millionaire who could afford to buy cool gadgets, I wouldn’t mind getting one of these. Heck, if I owned a house here in LA, it would be something I would consider putting in my kitchen. It would be interesting to see what happens in next few years when gadgets like these might become normal appliances you get for your high end kitchen. Just like how everybody loves to get stainless steel appliances right now for …
[Read more]After this post I've got a question how one can tell if his outer join was converted to inner. You can find it out by looking at the warning generated by EXPLAIN EXTENDED. If the outer join wasn't converted, you'll see it in the rewritten query in the warning:
mysql> explain extended select * from t1 left join (t2, t3) on t2.a= t1.a; ... 3 rows in set, 1 warning (0.00 sec) mysql> show warnings\G *************************** 1. row *************************** Level: Note Code: 1003 Message: select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on ((`test`.`t2`. `a` = `test`.`t1`.`a`)) where 1
In this query LEFT JOIN is not converted to inner.
Now let's try a query where outer join will be converted:
mysql> explain extended select * from t1 left join (t2, t3) on …[Read more]