Birthday Български

March 31st, 2007Category: My Life3 Comments

I am now 23 years old. Dari had a surprise for me. After I came back from work, there were balloons and food and people :) There are pictures and videos, which I will publish in the next few days. In a few words, we ate, talked, sang ( karaoke and guitar ), ate cake and went to bed. More when I have the pictures and the videos ready

a little Perl Български

March 17th, 2007Category: My LifeNo Comments

Last night I was doing some karaoke stuff and I now have 3 Perl scripts that were helping me all the time:

  1. #!/usr/bin/perl
  2. # execute: ls *.mp3|perl create_zip_file.pl to create .zip from a pair of .mp3 .cdg
  3.  
  4. foreach (<STDIN>) {
  5. $was = $_;
  6. $was =~ s|MP3||gi;
  7. chomp($was);
  8. $string = "zip \"$was"."zip\" \"$was"."mp3\" \"$was"."cdg\"";
  9. print $string;
  10. system ($string);
  11. }
  12.  
  1. #!/usr/bin/perl
  2. # nicecase - proper case on icky filenames with spaces
  3. foreach (<STDIN>) {
  4. $was = $_;
  5. $_ = join ' ', map {ucfirst(lc($_))} split /\s+/, $_;
  6. print $_."\n";
  7. }
  1. #!/usr/bin/perl -w
  2. #Swap Song - Artist to Artist - Song
  3. foreach (<STDIN>){
  4. #print $_."\n";
  5. chomp();
  6. $was = $_;
  7. @asd = split /\-/,$was;
  8. $asd[0] =~ s/[0-9]{1,2}\s//g;
  9. print $asd[1]." - ".$asd[0]."\n";
  10.  
  11. }

Europe against Apple DRM Български

March 12th, 2007Category: My LifeNo Comments

Bulgaria: Bulgaria’s EU Commissioner Meglena Kuneva, who is in charge of consumer protection, accused Apple Co. for unfair competition in front of the German magazine Focus.

http://www.engadget.com/2007/03/11/apple-drm-pressure-spreads-to-eu-chief/
http://news.yahoo.com/s/nm/20070311/wr_nm/eu_apple_dc
http://www.novinite.com/view_news.php?id=77777

Verious Български

March 6th, 2007Category: My Life1 Comment

The last few days ( weeks ) I’ve been working on some interesting aspects of internationalization under linux. Since the start of the semester I started the Bulgarian translation of Rasmol. Nothing interesting in this part, but when a Chinese and Japanese translations showed up, I had to modify the code for the menus to display the gliphs correctly. The problems were the following:
The graphical part of RasMol is using Xlib. No GTK nor QT. So in Xlib, in general, XDrawString and XDrawText are used to display text on the menus. Everything works OK until we start using east Asian languages. With them, a single glyph can be more than one byte, which causes rather interesting things to show up on the screen. Fortunately the Xlib devs have thought about that and have given us XmbDrawText and XmbDrawString but they work in a very different way. In order to display the gliphs on the screen, a list of fonts which can decode the text is needed, the LOCALE must be set correctly and the length of the decoded string must be calculated. Here comes XCreateFontSet - a method to create XFontSet structure required for XmbDraw*. OK, we have the tools but we need fonts, also the text must be in the correct encoding. We cannot just write all languages in UTF and try to display them ( UTF is not very well supported in Xlib regardless of the XwcDraw* functions ). We must encode every language in its own character set. Also since they are all in a single file, we cannot just use open->save to do the conversion, because it will mess up everything. We need to separate the languages, to encode them in the correct charset and to cat them in to the single file. Hopefully it works and here is the list of my 4 encodings:
iso8859-1 ( още известен като latin-1 ) за западно европейските езици
cp1251 ( aka windows-1251) for Cyrillic
cp936 for Chinese
eucjp ( euc-jisx0213, shift-jisx0213, sjis, ujis etc. ) for Japanese
so at the end we have 1 file from which it is impossible to display all languages at once correctly. Good thing there is iconv and the above procedure is not that hard. The hard part is to use the correct encoding< ->font< ->locale combination.

For myself I made a UTF8 version of that file and all languages can render perfectly in one singe file.

In the end we have Rasmol in English, Bulgarian, Spanish, Italian, French, Chinese, Russian and Japanese and they all show correctly under linux ( as well as windows after a few mods in the configs and a few restarts per language switch )

So I have to do some cosmetic changes and there it is.

I got an email from google a week ago ( exactly 1 month after their first email ) in which they thank me for the time and after carefully reviewing my experience and qualifications they decided that they do not have a strong match for me. It was going to be nice to gain some exp. @ google. I guess there were LOTS of applicants and some sources say that ppl from better schools have better chances, but I’m don’t know…

I’m going to get some food…

Georgi’s Blog is proudly powered by WordPress
Постове (RSS) and Коментари (RSS).
Get Firefox! Creative Commons License
22 queries. 0.678 seconds.