JavaScript rules!

There's a question I often ask myself: What's missing in Linux? In F/OSS world?
I have a list of answers for this question but there's one answer that might surprise you: We miss a general-purpose-easy-to-learn-easy-to-use programming language.
I think this answer might come as surprise to most people while considering the abundance of programming languages around us like Perl, Python, Ruby, PHP and others but I always felt there was something else missing. Looking back at history I would like to take a controversial example for this topic from the commercial world: The VB6 example. Sure it was a horrible horrible language but people actually used it for their every-day use. I used to see it all around - Windows people wrote utilities with it, wrote prototypes and in some cases even entire projects with it (god forbid!). People were happy with it and that's what really matters.

In the distant past I loved PHP so much that I used to have this "silly" idea that PHP should be used everywhere - on server side , on client side (because I used to think JS sucks), for shell scripts and even for GUI applications but my colleagues and friends used to dismiss this idea by saying PHP is good for server side scripting because it was designed for it and that's where it should stay. I guess they were right but the idea that one scripting language can and should be able to do everything was stuck in my mind. I was a good PHP developer but I never really got to know JS as well (and that's too bad) but since than a lot has happened.

JavaScript has got a new life and that's already old news by now! It got to be 1st place on some Language Popularity Ranking Lists and everybody noticed it - MS with their HTML5+JS applications in Windows 8 , Gnome (v3) having their new and shiny Gnome Shell written entirely in JS, QT with their QT Quick, Mozilla used it to extend Firefox in the past and now I have a feeling they will build a new OS around it.

A few months ago I decided that I had my fair share of living under a rock and that I should check out JS seriously. After looking for recommendations I bought "Javascript the good parts" and started using JS for a little web project I'm working on in the background. I decided to use the "full javascript stack". Here are some projects I found very useful and interesting in the past few months:

  • node.js (js in server side, check out npm - the nice package manager)
  • express (js framework to write server side applications)
  • mongodb (schema-less database, JS-like syntax for queries and JSON for results, very cool)
  • backbone.js (popular framework for client side)
  • JQuery (who doesn't know this one?)
  • Twitter Bootstrap (related to CSS but awesome for lazy developers who still like their poorly designed web pages to look good)
I don't know if it's the one language to rule them all (mostly because I was wrong so many times before :-P) but I can tell you one thing: The developers community is big enough, The projects are alive. Lots of ready-to-use components with permissive licenses, lots of support (in stack overflow). bottom line: lots of fun.


Changing text direction and GNOME

 So you are writing RTL text (Hebrew, Arabic, Farsi ..) and sometimes you tend to mix some English words in it. In Windows and QT (after enabling in qtconfig) you have to press both Ctrl and Shift keys (both left or right) if you want to change direction for a single line/paragraph/selected text.

In GNOME you have the fabulous Auto Detection - the direction of your paragraph is set by the first character having strong direction. That's cool and works most of the time but what are you supposed to do when it doesn't work. Have no fear - the amazing RLM and LRM characters come to the rescue. RLM and LRM possess superpowers such as strong direction, invisibility and the ability to claim you're following the standards. All you have to do to use these is simply hit the Home key then Right-click to get the context menu then select "Insert unicode control character" (or simply change your national keyboard layout standard to include RLM/LRM) then you have to pray to Alohim/Allah that you will not change your mind later on and be forced to look for it and try to delete it.

I say we can make editing bidi-text easier in GNOME by creating several text actions bound to keyboard shortcuts to handle it. Here are the few actions I had in mind:

  1. A shortcut to change current line/selected text direction, just like windows Ctrl+shift does but insert RLM/LRM when needed.
  2. A shortcut to delete all control characters in the selected text - To be used when you made a big mess in your text and you want to fix it manually all over again.
  3. A shortcut to encapsulate selected text within RLE/LRE and PDF (Pop Directional formatting).
  4. A shortcut to encapsulate selected text whithin RLO/LRO and PDF.
This will probably have to be implemented by a patch to GNOME (GtkEntry and GtkTextView) adding some signals to preform the actions and binding them to some keyboard shortcuts. I don't think there's a special low-level API that will allow implementation of such actions. But I did look for such.

I found a very limited way in which GNOME's Input Method API can provide basic line direction switcher (No. 1 in the above list) and decided, for the sake of pure experiment to try implementing it. I think it's a ugly hack but it works well and better than nothing for now... I guess. It's not perfect at all: it works only for single lines, It might delete selected text (works great when no text is selected) and it will insert two edit actions into the undo buffer so to undo a switch you will have to hit Ctrl+z twice.

The keyboard shortcut I chose for it is Ctrl+Shift+0 or Ctrl+Shift+9 which resembles the location of RLM/LRM in the new Israeli keyboard standard. Using Ctrl+Shift alone (like in QT and Windows did) is no good because I fear it might be used for layout group selection in some layouts.

The Debian packaging and some of the code is base on the awesome Debian package for gtk-im-libthai so I was able to code and package it in a very short time, relativly... for a project with no real future.

So far I tried it only on Ubuntu 11.10+GNOME3+i368/amd64. Seems to work:

If you would like to try it, it's available in my Ubuntu PPA, package name: gtk3-im-rtl (not 'gtk-im-rtl' which is for GNOME2 and seems to be broken). currently compiled only for Ubuntu Oneiric 11.10 . You may also try to download the source and compile for other distros.
But don't you come crying to me if it broke your desktop.
The Input Method is supposed to become default after installation. If not, you'll have to set it by yourself (right click->select input method).

Happy Hackinukkah!!!
.. and merry christmas!


Quitting Ubuntu Hebrew Translators team

Seems that Ubuntu Hebrew Translation Administrators feel harshly about my membership in Ubuntu translators regarding my expressed opinion in a debate regarding gender in translation. In a private mail they "agreed" to renew my membership in Ubuntu Translators team "although I am a trouble maker" as they put it. Well, I didn't mean to become a trouble maker - I just wanted to talk about a technological solution to a certain problem.

I think this is no way to treat volunteers so I told YaronSh "Lech techapes et hachaverim shelcha" and quit the team. I will continue my activity in solving RTL bugs in Ubuntu.

Hebrew translation work is not fun for me anyway now that it sounds so bad.


It's feels good

It feels good to see a bug you fixed get mentioned in a review (original in Hebrew) on a big news site.

.... OTOH it doesn't feel so good when you see the one bug that slipped away get mentioned as well as the only thing stopping the Hebrew installation from being perfect.

Please vote for this bug by clicking "This bug affects me".
(I think it required a Launchpad account)

Maybe we'll manage to get it right for the 10.04.1 release.


Why desktop Linux still sucks - important to watch

I first encountered this video on Linmagazine(Hebrew):

Sometimes, we Linux enthusiasts lack the ability of self-observation. We live in our utopia thinking everything is OK and that soon everybody will use Linux on their desktops. Well, it's freakin 2010 and we're still waiting...

If we want the change to come we must keep these flaws in mind and try to resolve them one by one.

If you fix it they will come...


The kind of stuff that make a geek ROFLOL

What is it? Oh, it's the simple things in life like ... writing a multi-threaded quick-sort implementation in Google's new GO! programming language ....
Amazingly, it even works. Ahhh .. Oh well , had too much fun , time to sleep now.

good night.


Please! No politics on planet FOSS-IL!!!

If, like myself, you are tired of political posts on the FOSS-IL planet, copy the following banner and post it in your blog:

Graphics by Gimp, Tuxpaint, Culmus-fancy fonts, AP online lectures and .. Bibi :)