stackoverflow response that I absolutely loved

Posted in Uncategorized with tags , on November 12, 2009 by dlamotte

I absolutely love this quote:

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand” (Martin Fowler, “Refactoring: Improving the Design of Existing Code”)

Check out this question/answer on stackoverflow.com.

finally attempting to use stackoverflow

Posted in Uncategorized with tags , , on November 10, 2009 by dlamotte

For a while now, I’ve seen stackoverflow in my google searches, but whenever I went there, I never felt like I wanted to participate.  But after watching this google tech talk about stackoverflow, it kind of inspired me to start using it.

Upon navigating to stackoverflow.com, I also stumbled upon sister sites of stackoverflow and promptly signed up with them too.  But one in particular caught my eye, careers.stackoverflow.com.  It is basically a supped up resume platform.  It looks pretty awesome and I’ve signed up for that also.  Just need to get working on filling it out.  I’ll probably do that tonight and post it on here when I’m done with it.

Pretty cool none-the-less.

firefox + vim = vimperator

Posted in Uncategorized with tags , , , on October 14, 2009 by dlamotte

If you are an avid vim user and you were always wondering how to combine the power of vim with your browser, vimperator is your new best friend.

I just found out about vimperator randomly yesterday and added it to firefox immediately.  It’s kind of scary at first, but you soon feel right at home in your browser again.  It’s really scary how vim-like it is.  I still have a lot to learn for the basics in it, but you gotta start somewhere.

If you’re a vim addict (like myself), give it a try now!

If you’re a current vimperator user, any tips? Useful links?

excited for zsh!

Posted in Uncategorized with tags , , , on October 7, 2009 by dlamotte

Last night I got home from work and emerged zsh almost immediately.  Little did I know that if you don’t have a .zshrc in your home directory, there is an interactive setup for it!

I’m quite excited to get back home and finish the setup, however, I think I may have customized too early (as I usually end up doing) and may really end up stepping on my own toes.  The configuration/setup is quite esoteric I must say.  I can barely understand what exactly they are trying to get across and how it works.  I feel that if an experienced user would go through it, they’d have no problem, but as a first time never before used user, its quite complex.  Maybe examples would be useful there?

Anyways, I’m excited to start using it as there are some interesting speed-ups it mentions like:

/f/b as a shortcut to /foo/bar

And I think I’m getting used to menu completion.

Pretty soon I think I’ll be saying, “zsh, where have you been my whole life?!”.  And to be honest, I have only myself to blame.  That whole not wanting to change thing really gets in the way.  Learning new things is such a pain.

learning a new shell: zsh

Posted in Uncategorized with tags , , , on October 6, 2009 by dlamotte

So I’ve decided to start learning a new shell.  I see so much talk about zsh and finally, I’m going to attempt to learn to use it.  I installed it and started using it and a few things are immediately different.

Command completion is different, but slightly annoying.  I like how completion doesn’t scroll the terminal, it is paged AND appears below the command being completed.  (I didn’t like that at first, but now I think its actually quite ingenius) That being said, I which movement around the completion was more vi-like.  I want to use my home row movement keys “h j k l” and not move my hand all the way down to the arrow keys. Talk about inefficient.  Any zsh’ers out there know how to change that?  I’m sure there is a way, but I really haven’t had the time to go through a lot of documentation on it.

I’ve started to realize my only attachment to bash is familiarity and not features. I’ve used bash for more than 5 years now and while I use it extensively, I really believe that zsh most likely has done it better than bash.  A few things hint me this way just by using it for a few moments.

Btw, what’s with zsh assuming when I type something like:

bin

It cd’s me into my bin directory.  That’s all well and good, but when it comes to ‘help’, it just cd’s me into my help/ directory… Is there no bash help equivilent in zsh?  I guess I’d just find that rather odd as I am assuming there are plenty of shell built-in commands and help just seems natural.  Or maybe bash has tainted my “natural” sense.

Anyways, I’m on this new kick of trying to blog reguarly, so I really just needed an excuse to blog.  Let me know where to start with zsh!

google tech talk: couchdb

Posted in Uncategorized with tags , , , on September 30, 2009 by dlamotte

If you haven’t heard of it and are interested about scaling databases of any sort or making fast web applications, I highly suggest you check out this video.  On a high level, it sounds like everything you’ve ever wanted out of a database.  I am absolutely thrilled about it and am excited to start using it.  It also gives me a good reason to actually get down to learning a functional language, erlang.

http://www.youtube.com/watch?v=ESDBM9-U804

Let me know what you think!

learning flash, actionscript 3

Posted in Uncategorized with tags , , on September 28, 2009 by dlamotte

I currently working on a project to store/display performance data. The end product ends up being a graph on the website. Currently I’m using Open Flash Chart 2 which does a pretty decent job, but it doesn’t do everything I want it to do.

Some “basic” features I feel its missing:

  • Autoscaling y-axis
  • ability to handle infinite amount of x-values by allowing user to click/drag graph

Among other things.  Other than those few things and overall better documentation, it’s actually a sweet little flash program.  I’ve been pretty happy with it.  I’m not thrilled with all the fancy/flashy graphics you get by default and therefore disabled it immediately, but at least I can disable them :) .

I thought long and hard about generating a static image and just sticking that on the page, but I feel that using flash better serves the user.  With eventually being able to manipulate, add graphs, zoom,… Any thoughts on this?

So the real reason for my post, in order to enhance or start from scratch, I’ll need to learn flash.  There seem to be so many different ways to go with flash.  From xml to actionscript, I just don’t know where to begin.  For one thing, I absolutely hate XML and all the “fun” ways people like to abuse it.  It’s not a solution for everything!  Config files, databases, … there are just better ways to do it.  I’m in love with the JSON format as its so much more natural compared to XML IMO.

This is why I decided, I probably need to learn actionscript.  But I’m still really confused about some things.  I’ve browsed around github.com for example projects using actionscript and noticed that a lot of projects have a toplevel XML file.  Is that really needed?  How about compiling it?  I’ve heard about flex… but I’m unsure where that really fits in?  I’ve heard about Open Source Adobe compilers.  I’ve tried swftools for compiling, but I’m not sure I should go that way either?

My main problem I guess is that, I’m at a loss for all the lingo and jargon and how all the pieces fit together.  Namely where flex fits in.  Is it xml only?  Whats with the mxml.xml file (I may have screwed up the name there, but hopefully you get the jist)?

I’m not willing to buy the new hippest and coolest IDE from Adobe.  I’d like to do this the free and open source way even though I don’t think there is much out there for that way.

What are you experiences with learning flash? Do you think the best way to do it is to go to amazon.com and buy the latest O’Reilly book about actionscript and start hacking? Or are there some good online tutorials (which I attempted to search for, but couldn’t seem to find a really awesome one)?

python setuptools: workaround for ignore specific files

Posted in Uncategorized on September 24, 2009 by dlamotte

It seems like this is a pretty common issue.  People want to ignore a certain file/module in their distribution.  Typically a file resembling: “settings_local.py”.

Well, today I searched around attempting to find an elegant solution and I just couldn’t seem to find one.  So, out comes the monkey patching…

If anyone has this same problem, please comment on how you did it.  Here is how I did:

from distutils.command.build_py import build_py

#
# modify build process to exclude specific files from the build
#
find_package_modules_old = build_py.find_package_modules

def find_package_modules(self, package, package_dir):
    excludes = [
        ('pkg','module','pkg/module.py'),
    ] 

    modules = find_package_modules_old(self, package, package_dir)
    for pkg, module, fname in excludes:
        if (pkg, module, fname) in modules:
            modules.remove((pkg,module,fname))
            print "excluding pkg = %s, module = %s, fname = %s" % \
                (pkg,module,fname)
    return modules

build_py.find_package_modules = find_package_modules

why do people program perl these days?

Posted in Uncategorized with tags , , on September 4, 2009 by dlamotte

With so many other awesome alternatives, I don’t understand why people use perl.

Just the other day, I was programming in perl (at the day job… as I have written a considerable amount in perl already and haven’t gotten the infrastructure in python yet to switch over).  I noticed how poorly the support is for Windows.  Alright everyone, guess what perl returns from this on Windows:

C:\Documents and Settings\username\> perl
use Cwd;
print “cwd: “.getcwd().”\n”;

Well, if you guessed “C:\Documents and Settings\username\“, you are wrong.  In perl, of course, its actually “C:/Documents and Settings/username/“.  I realize it “happens” to work (as in, some windows versions support it… not perl), but I’m not ok with it “happening” to work.  I need it to work.  I don’t want my code breaking on something so simple as a path separator.  And it really isn’t that hard to support both / and \.  Sure enough though, I can’t trust perl to “do the right thing”.  I end up hacking around everything perl has in its standard library.

Another doozy is when you start using File::Find and find out, it doesn’t work on Windows with no_chdir.  Why? Not sure… And I don’t much care.

I guess, what I’m curious about is, how many people still see a good reason to use perl.  One that doesn’t include “we already have an entire infrastructure coded in perl”.  I understand no one really likes “rewriting” code and that it has a batch of its own problems such as reintroducing regressions and is “needlessly expensive”.  However, I would think those projects go away over time.  New projects should use newer technologies and get the old and new technologies to work together.  And eventually, maybe, phase out the old stuff.  Maybe its not something that someone converts overnight, but at least move in the right direction.

My biggest problem with perl is that its standard library is hard to trust to “do the right thing”.  A language in which this stands true is very hard to program efficiently and effectively in.

Django makes web development… fun?

Posted in Uncategorized with tags , , , on August 27, 2009 by dlamotte

Fun may be going _too_ far, but it is a heck of a lot cleaner than anything I ever hacked up before.  To be honest, I really stayed away from web development before I really gave Django a try.  Now, I’m almost ready to start writing my own website/blog/everything (I know, cliche) in Django.

I’ve really gotta hand it to Chipx86 and Djblets though.  My first Django project immediately ran into issues with deployment.  Issues that Djblets immediately solved with the SITE_ROOT stuff.  I have to say, my inexperience with Django most certainly would have led me to hack in something not nearly as clean as what Djblets has in place.

One thing does bother me about the SITE_ROOT stuff.  It’s actually more of a Django problem.  It seems that after adding ‘djblets.util.context_processors.siteRoot’ to TEMPLATE_CONTEXT_PROCESSERS in settings.py, it doesn’t do anything.  In fact it doesn’t, until you use RequestContext() from django.template.context like:

render_to_response(template, RequestContext(request,{…}))

The TEMPLATE_CONTEXT_PROCESSERS are not used until you use RequestContext() which seems so very wrong.  Can someone explain this to me?

Anyways, I really enjoy programming django for the web (still not a huge fan of any web programming, but I’m warming to it…).  If you have working knowledge of python and web programming, I highly suggest Django.

Follow

Get every new post delivered to your Inbox.