IdeaMonk

thoughts, ideas, code and other things...

Sunday, August 22, 2010

ssh -X FTW


Ubuntu 10.04 image on VMware Fusion with 1 Gb allocated to it gives great almost a native feel in terms of performance. But thats only when you have some ram to give to it, for other times its ssh -X and debian testing on netbook for PyQt work :)

Netbooks are one awesome solution for the need of headless boxes if you're willing to shell out 15-18k. Or even second hand ones for around 12K


Labels: , ,

Mooo!

$ aptitude moo
$ aptitude -v moo
$ aptitude -vv moo
$ aptitude -vvv moo

Labels:

Saturday, August 07, 2010

On a dict returning None

Long time ago a thought came, why does a python dict throw exception, can't it just return a None if there is no key with supplied name.
Well now I understand the point of it, which is very obvious - if a dict has a key "foo" and the programmer has stored None into it, how would one distinguish a non-existant key and the one with None stored into it.


So here is the desired bad extension of dict for the Community Centric Python(CCP) Engineer:
class NoneDict(dict):
def __getitem__(self,key):
try:
return self.get(key)
except:
return None

l = NoneDict()

l[1] = "Foo"
l["a"] = "Bar"

print l[1], l["a"] # gives out the values
print l[42] # gives out None

Labels: , ,

Crossroads...

Another transitory gate has presented itself in front. Again time is what is running out, people and their preconceived notions coming out aloud, saying "this way - the right way".
And I'm stuck with no wish to step into any of those. For the road not taken lies in the hourglass these days.
Doesn't the wind smell the way it did 3 years ago, and the desire to break free feels the same as the one from 5 years ago.

The only difference is that the advisors can be convinced with evidence this time. But that is something that has to be sculpted with precision.

While the pillars that stood tall to be hallmarks of reassurance for these days have shaken into dividends or is it just the state of my own mind? After all there are no two places from where the universe looks the same.

Reanimation ahoy!

Labels: