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.

Few photos of different events

For the past couple of weeks there were few events and meetings here and there.

 

Managed to take some pictures as well, so decided to post a short note here with links to appropriate galleries.

First of all there was a 15 years birthday of LITC (Russian school in Limassol) which I was attending. Have lot’s of friends who studied there, so had a chance to bring back memories of how it was in school. Pictures here

Last Saturday we had a Russian-Cyprus VI festival hosted on the sea side of Limassol. This year the performance was really poor as well as the general organization of event sucked big deal. Nevertheless I managed to take few pictures throughout the event.

 

Finally, managed to get out for a beer with Den and Polina to Woodman pub somewhere in between of the events and since had a camera nearby, took few pics as well.

Visual Basic and Visual Studio

It’s been quite a while since last time I touched Visual Basic along with it’s default IDE – Visual Studio. Yesterday I had a quick chance to see it again, since I needed to help on the project which is under development in this environment.

What I can say – things are still as ugly as they used to be (IMHO). So few notes about things that pissed me off:

Auto indent in visual studio is more harmful rather than helpful. Auto completion is very annoying (it tries to complete everything I type instantly and with things different from what I want). All the time I was fighting with these two. I guess there are options to disable/enable features like that or configure different behavior, but in default configuration it sucks. Syntax highlighting is very poor (only highlights few reserved words with one different color).

Now with regards to Visual Basic: it is very interesting to see a language with uses “_” (underscore) to indicate that the line will continue after newline (VB does not use semicolons to indicate the end of statement, instead all statements are one per line), and uses ” ‘ ” (single parenthesis) to start comments. I know languages which are dependent on new lines, but more classical sign to show a continuation of line would be “\” (backslash), while for comment, either “#” (hash) or // (double slash) or /* */ (combination of slashes with starts for long comments) is used.

I had some other thoughts on function names and other, but I will leave this one out :)
Don’t trying to blame anything here, just my view of things as I touched them by accident after using Vim for coding PHP/Perl/C for a while.

HP Laptop BIOS upgrade from Linux

While in search of a solution for my laptop suspend problem I found out that the BIOS, which was initially supplied is very buggy and there is an update. My version was F11, while the latest one is F16. The only problem is the way HP supplies updates for this thingy: only for windows in form of executables.

Thanks to this article, I managed to create work around and flashed my BIOS for HP 6730b. If you run same laptop with version of BIOS earlier than F16, I strongly suggest updating.

The update didn’t fix my problem with suspend, but it did fix few glitches with video stuff.