Another nicely put together hacking challenge by @stripe.
Flex your hacking muscles in 8 increasingly difficult challenges. This time the challenge is more web oriented. What? You think just because you’re not a web programmer you don’t need to know this stuff? Oh I think you do mister! Now get your ass over there and put some effort in it. The contest ends on August 29, 2012.
You can skip the intro and dive right in on this page:
A long-standing bug with Bazaar/Launchpad has finally been resolved! Until recently I was not able to checkout anything from Launchpad through a corporate proxy, getting errors like:
bzr: ERROR: Connection error: Couldn't resolve host 'xmlrpc.launchpad.net' [Errno 11004] getaddrinfo failed
bzr: ERROR: Certificate error: hostname '172.16.16.16' doesn't match either of '*.launchpad.net', 'launchpad.net'
Finally this has been resolved in Bazaar 2.5.1 (you do need 2.5.1, the problem still existed in 2.5). Another important piece is that if you are using the command line, the proxy should be set in https_proxy environment variable, in the format:
Notice the “s” in “https_proxy”, this is different from “http_proxy”, and required for Launchpad urls such as “lp:someproject”.
With this in place now I can checkout with
bzr co lp:theproject as usual.
Obviously everybody has a different approach to this. Mine involves these main elements:
- Find a project you like
- Find a project that needs you
- Jump in
How to find a project you are interested in?
- Is there a particular open-source software that you just love so much?
- Is there an open-source software that is almost what you want but just almost?
- Is there an open-source software where somebody you admire is involved in?
How to find a suitable project that needs you?
Based on your answers above, get on Google and find the website of a suitable project. Some additional factors to look for:
- When was the last commit? (i.e. recent enough?)
- How many active committers are there? (i.e. more than one, less than 10?)
- Which VCS do they use and how can you submit branches? (i.e. a VCS you don’t mind using)
How you evaluate these factors is entire up to you. Personally I prefer small-ish projects where my work will be noticeable, but not too small where the developers might not be too welcoming to new faces.
How to get involved?
Please, please suppress your inexplicable desire of sending an introductory mail saying “hey I’m here I want to work on X”. Do NOT send such rubbish. Also do NOT brag about your past projects either.
The only meaningful introduction is contributing code, period! Just pick something you can improve in the project. Anything! Preferably something small, and indisputably an improvement. Your first commits should not be about showing off your genius. Your first commits should NOT be a big refactoring that makes more sense to you. Your first commits should be small, rock solid and easy to accept. In the beginning keep doing small things, gradually bigger and bigger.
Coding style: in the beginning you just have to adopt the coding style used by the others. Make sure to spend some time on observing the coding style of the core contributors, and adopt the same style in your own contributions. If you disagree with it you can propose an alternative later after you are already a recognized member.
Be patient. Don’t get your hopes high early. It takes time to get to know the members, and it is impossible to know in advance if your personalities will be compatible or not.
If for some reason things don’t work out with the project you picked, don’t let that bring you down. There are plenty of fish in the ocean of open-source projects, don’t expect you’ll find the right one for the first try. Be patient and keep looking. As long as you learn something from the experience, your efforts will never be wasted.
Just now when running
./manage.py syncdb Django (1.4) gave a strange error:
Error: No module named cache
What tha… Googled it, no help. A
pip install -r pip.txt --upgrade made it work. Lucky! (Among other things it replaced my Django 1.4 installation in the virtualenv. I suspect that fixed it.)
Didn’t know you can do this until now, and it’s so awesome!
Add this in
highlight CursorLine guibg=#F1F5FA
To highlight the current line only in the active window, throw these in too:
autocmd WinEnter * setlocal cursorline
autocmd WinLeave * setlocal nocursorline
My 5-step banana ice cream recipe got more reaction in one hour than my usual geeky posts in years. Maybe I should combine the two concepts! Or maybe not. Heck, I already like this title so here’s the geeky recipe: a decidedly imperfect recipe for getting my django project up and running on a fresh new install of windows.
- latest stable python2.x:
- latest stable
- (optional) latest stable Bazaar:
- (optional) latest stable
- (optional) putty:
putty, create ssh key with
puttygen, save private and public keys, add to
authorized_keys on repository server, start
pagent, add the key to it.
- Edit environmental variables:
- Append to
Fire up the bash terminal (git bash or DOS command prompt)
(optional) Install Bazaar,
bzr co bzr+ssh://myserver/~/repos/project
Install Django using pip:
pip install django==1.4 (use the version you need!)
Install dependencies of the Django project, typically listed in a file:
pip install -r requirements.txt
Run in Django’s local server:
python manage.py runserver
Best served in a modern browser like Chrome at http://localhost:7000/ Enjoy!
Variations for the more adventurous
putty, use the
openssh that comes with
pip install virtualenv, create a virtual env and run Django inside it.