My C# and Mono talk at Alphageeks meetup

Posted: February 25th, 2010 | Author: Amitay Dobo | Filed under: Development, Technology | Tags: , | 3 Comments »

Last Wednesday an AlphaGeeks technological meet up was arranged  by the honorable Yuval Goldstein. Yuval asked me to give a talk about C#, which was getting bash (unjustifiably!)  on previous events. I used the opportunity to throw inside some Mono project too, and get to know it a little bit myself.

So after sweating a lot on code example, and getting back to C# from recent work with Java and Python, I came up with my first presentation. So if you want to watch me lose my presentational virginity lost on video, have a look at at the talk video (In hebrew, courtesy of The Tech Vibe crew).

The slides are available too, but quite honestly they are pretty useless by themselves, as most of the stuff was code examples.

The code examples

CsharpTalk.Mono – demonstration of Delegates, Lambda Expressions, Extensions methods and some LINQ. This one uses Nunit for Mono, and Moq, so you might need to re-arrange the references to compile it, since i didn’t include the libraries. This one targeted Mono and the project was created in MonoDevelop, but should work fine in Visual Studio (again, you might need to change some references and arrange the libraries).

CSharp4Talk – demonstration of some of the new language features in C# 4.0: Dynamic objects, Optional and Keyworded  parameters and variance/contravariance (the last one still twists my brain). This one was created on Visual Studio 2010 Beta 2, but you might get it to work on mono 2.6, if you configure it before build with C# 4 profile (–with-profile4=yes). Json.net is referenced but not included.


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.