Gnome3 Fallback Mode

After working for a while on Xfce, I found out about Gnome 3 fallback mode. That is almost exactly what I needed – old style Gnome. Obviously not completely like Gnome 2.x, but very very close to it.

Will work in Gnome 3 under this mode for a while to see. At least I have all my menus, applets, proper system tray and whatever else I am so used to in their correct places :)

Saturday

Just a short post on a nice Saturday. Started by going to BBQ for birthday party of my friends mother. Meat, beers, guitar, nice people, like always, pics here. After BBQ went went to Agios Georgios where some unknown event was to take place. We didn’t know much about what’s going on there, just decided to check and found out that there should be some DJ concert with tons of people and 20 euro entrance fee, so we skipped it and went to take few photos on a nearby beach. Managed to take few nice pics as well (somehow sea is always nice on photos).

As per now, it is Sunday morning, coffee and few nice plans for a day… Good thing is that tomorrow is a holiday, so this weekend is pretty long!

Latchi

Since parents of my classmate from hometown came for vacations in Cyprus, I decided to visit them in Latchi (close to Paphos) last afternoon. Had some nice time in a taverna by the marine, lots of talking and memories (haven’t seen them for 10 years or so), as well as few pics. On a way back, while I was driving, Yana was playing with camera and night lights, the experimental art photos here.

 

Few nice things about Latchi that I noticed yesterday: the Sunset is just amazing there and it is very very quiet. Even the music in the restaurants is not playing and due to the small size of a town/village and not that many people around – it is very relaxing, compared to Limassol, Paphos or any other town on the island. I am thinking on visiting that place from time to time during evenings for relaxed atmosphere.

PySol

Though many people claim Linux is not for games or whatever, I really love the huge collection of those small games one can spend days on like logic, puzzle, simple strategies and others.

Recently I came across PySol FC Edition – a collection of more than 1000 solitaire card games. Short description from their website states:

There are games that use the 52 card International Pattern deck, games for the 78 card Tarock deck, eight and ten suit Ganjifa games, Hanafuda games, Matrix games, Mahjongg games, and games for an original hexadecimal-based deck.

Has everything from simple and known card games like FreeCell, Spider and Klondike to all kinds of weird things that take some time figure out on how to play them. For the ones who like Klondike, for instance – try Varaha game from the collection. It is more complex and more fun.

Warning you before you downloaded and launched it – may take a lot of your time away from you and you won’t even notice that!

 

SQL GROUP BY with max in subgroups

It’s been few times I needed to select a set of records from SQL table grouped by one column, but sorted by another within a group. For example selecting a list of log entries with the last entry per user or something like that. It is pretty simple when one needs a maximum value of a particular column per key, but what if I need all cells of a record with the biggest/smallest/whatever value of one column, and all those grouped per another column.

Finally the solution was found here and the point there is to do sorting in subquery for group select. In simple it would look like (taking example above):

SELECT * FROM (SELECT * FROM logs WHERE level=’critical’ ORDER BY created DESC) tmp_table GROUP BY user_id;

This will give me the last entry from the log with level=’critical’ per user. It is also possible to all kinds of joins and whatever in subquery. The things is that first we gather all data needed and sorted properly, and then the outed select groups it accordingly.

One additional note which has nothing to do with a query itself, but I found it out during my works related to this task. While running the above-type query on a pretty large table, I got an error from MySQL

ERROR 126 (HY000): Incorrect key file for table ‘/tmp/#sql_NNNN_x.MYI’; try to repair it

By looking around I realized that the hosting company which provided the server set up the /tmp directory of a system as a separate partition of a pretty small size and while MySQL was trying to do the requested task, it was running a bit out of space, causing a corruption of a temporary table. Specifying tmp=/var/tmp (or any other directory with some more space) in /etc/my.cnf (depending on your setup though), setting up correct permissions and restarting MySQL fixed the problem.