Benchmarking: Testing a string against a single composite Regular Expressions, or an array of Regexps

Posted: December 21st, 2009 | Author: Amitay Dobo | Filed under: Development | Tags: , | 2 Comments »

Here.

Today I needed to recode a small part of  client side script to test against a regular expression instead testing it begins with a specific value (using substring).

The current code used an array of expressions the string can begin with, and tested a string by looping and testing for each substring.

Changing the code had me to face a question that haunts me for a long time: which  is more efficient – testing against a single regular expression, composed from different supplied expressions, or testing against an array of those expressions.  By testing i mean to check if at least one of the expression tests positive for the string (i.e. someRegexp.test(“Tested string”) ).

show the rest of the post…


Setting active monitors using xrandr

Posted: August 15th, 2009 | Author: Amitay Dobo | Filed under: Technology | Tags: , , , | No Comments »

This post is (or might be) relevant for people who are running X Server with xrandr (1.2 and up) enabled (meaning, linux users mostly).

I have 2 displays connected to computer: The primary computer monitor and a television I sometime use to watch movies. Ubuntu doesn’t recognize when I turn on and off a monitor, but provides a way of enabling and disabling a monitor. This can be accessed in Gnome through System/Preferences/Display, and there’s even a shortcut for it in the system tray (is that how it’s called on Gnome?)

However, it can be quite a nuisance to click/drag/click/click just for turning on a monitor, and more so when gnome doesn’t remember my exact display setup (i.e. which monitor is left of which monitor).

Xrandr to the rescue!

show the rest of the post…


Django on Google Appengine using app-engine-patch

Posted: August 5th, 2009 | Author: Amitay Dobo | Filed under: Development | Tags: , | No Comments »

After writing about google-app-engine-django (read it for some introductory material about App engine and Django), I’ve found out now about app-engine-patch. This is another option of easily developing Django applications targeting Google App Engine.  App-engine-patch offers some significant advantages and features: show the rest of the post…


Nomachine NX installed for Remote Desktop

Posted: July 22nd, 2009 | Author: Amitay Dobo | Filed under: Technology | 3 Comments »

Just installed NoMachine NX Free edition on my Ubuntu machine. Free NX is a client and server that allows you to control a remote desktop. It runs on top of SSH and has some magical technology (enhancement of the X11 protocol) that is supposed to accelerate it and make it faster than other solutions like VNC.

show the rest of the post…


Is perl the Feldenkrais method of programming languages?

Posted: July 18th, 2009 | Author: Amitay Dobo | Filed under: Uncategorized | No Comments »

Well, Probably not.

I read in Ha’ir magazine a question asked by a reader: “Who taught David Ben Gurion, Israel’s first Prime minister, to stand on his head?.

The answer was, it was Moshe Feldenkrais, Creator of the Feldenkrais method. They also went on to quote him saying:

“We make the impossible possible, the difficult easy, and the easy elegant.”

That rang a bell for me. I googled a bit, and found out what the bell was rung:

“Perl is designed to make the easy jobs easy and the hard jobs possible.” – Larry Wall (see here)

Ok, much more humble from Wall. Maybe some arrogant new framework/language for cool kids can use Feldenkrais Slogan? I can see it fit very nicely in this list.


Google-App-Engine-Django Tutorial, Part 3 – Creating the application

Posted: July 18th, 2009 | Author: Amitay Dobo | Filed under: Development | Tags: , , , | No Comments »

So we left off having an application skeleton, and a local development server running it. In this post we’d create some (very) basic application and upload it to google app engine. This purpose is only to provide a glimpse and have something working. For actually writing an application I suggest reading the documentation for Python, Django, Google App Engine, and GAE-Django listed before. You may also find the blog post. I can also suggest reading this blog post, which goes into greater depth.

show the rest of the post…


Google-App-Engine-Django Tutorial, Part 2 – Set up

Posted: July 13th, 2009 | Author: Amitay Dobo | Filed under: Development | Tags: , , , , | No Comments »

In this post, we’ll setup the environment needed to create and run a Google App Engine (GAE) application using Django and google-app-engine-django helper.

The procedures here are mostly covered in the excellent getting started article for GAE-D, which will likely be kept more up to date than this one. I will try to provide the exact setup process as I ran it, if anyone might find it useful.
I’m going to use Ubuntu Linux for this tutorial, because, well, that’s what I use. If there any difference refer to documentation of the different software, which i will try to provide.

show the rest of the post…


Google-App-Engine-Django Tutorial, Part 1 – Background

Posted: July 13th, 2009 | Author: Amitay Dobo | Filed under: Development | Tags: , , , | 1 Comment »

So, you decided to join the latest buzz train going to the cloud, and check out Google App Engine (GAE from now on). In this post I’ll try to demonstrate how to develop an GAE application using Python, the Django framework (or a subset of), Google App Engine SDK, And Google App engine Django helper.

I did the development for the write-up on an Ubuntu Linux machine so some of the instructions are specific to that environment. Most of them are easily translatable to other platforms.

show the rest of the post…


99 Design patterns on the wall

Posted: June 1st, 2009 | Author: Amitay Dobo | Filed under: Development, Junk | Tags: , , , | No Comments »

Found this on a web site that contain programs for singing (couting, printlning, Console.Outing…) “99 bottles of beer on the wall” in many (manier than I knew existed) programming languages.
It demonstrates the true power of enterprise-ish programming: Take a simple concept and make it robust by harnessing the power of design patterns, modular degin, defensive programming, etc…
(Only found 1 design pattern I recognize – Observer – but perhaps a savvier programmer would spot a few extra.


Slax – linux on a key

Posted: June 1st, 2009 | Author: Amitay Dobo | Filed under: Technology | Tags: , , , | No Comments »

A few days ago I had to take out my main hard disk to be replaced. I was terrified with the thought of being left out without an operable computer. I wanted to find something that will leave me with some web access and help me prepare to computer set up the operating systems of choice when i get back a replacement hard drive.
After some googling, and through the live cd list I got myself introduced to Slax – a linux you can install as a live cd, or on a USB stick, and to do almost anything with.
I’ll begin this short review with the conclusion – It’s good! I recommend anyone making himself a ready to use copy of Slax to be used in the time of need.

show the rest of the post…