PyWeek progress: the 4 hour mark
Suddenly I was having a calm day at work, and Rosario is taking care of the baby, so I spent a few hours on the PyWeek project.
I have integrated Chipmunk with QGraphicsScene.
What does it mean? That I can now...
Create a scene
Create a view onto that scene
Create balls, walls and polygons as scene items
Watch said balls/walls/polygons bounce around happily under Chipmunk direction.
For example, here's enough code to create a few balls a box and a staircase:
self.scene=ChipScene()
self.ui.view.setScene(self.scene)
for x in range (0, 10):
self.scene.addBall(x*50.0+10, 50.0, 10.)
self.scene.addBall(x*50.0+20, 20.0, 10.)
self.scene.addWall(0., 0., 0., 500.)
self.scene.addWall(0., 500., 500., 500.)
self.scene.addWall(500., 500., 500., 0.)
self.scene.addWall(500., 0., 0., 0.)
for i in range (0, 20):
self.scene.addWall(i*20, 200+i*20, i*20+20, 200+i*20)
self.scene.addWall(i*20+20, 200+i*20, i*20+20, 200+i*20+20)
self.scene.addPoly([[0, 50], [0, 100], [100, 100], [100, 50], [0, 50]])
I declare that nifty.
PyWeek5
Well, it seems I am in trouble for PyWeek.
Why? Because it's wednesday and I have done nothing. Nothing! It's because I have been working a lot, really, and I have a 4 month baby, too.
So, I am upping the ante.
I will do a PyDay.
I am taking tomorrow off (yeah, right!) and I'm doing the game in one day. Maybe I will scrounge a few hours on sunday, too.
It will probably not be fit for the contest because:
I will use PyQt
I won't test it in any platform other than my Linux box
But here's the game concept (BTW: Twisted sucks as a theme. It sucks really, really, really hard!):
According to the dictionary, Twisted also means perverted. So, this game, Twisted Little Boy is about a bad boy. A really bad boy. But a clever one. He creates machines using random equipment he finds to do evil, really mean things.
I will probably do a live-blog thing like those tutorials I wrote years ago about PyQt.
There's a Google code project (obviously empty): http://code.google.com/p/twistedlittleboy/
See you all tomorrow.
Django, the view from a parachute
In the last few days I have been learning Django in perhaps the hardest way possible: by being hired to work on a site someone else wrote.
I already had the view from 10000 feet. And since I had to get to this thing rather quickly, I jumped on my parachute from those 10000 feet, and learned it on the way down.
Here's what I knew:
Python Web framework
Regexp-based URL dispatching
Its own template language
Its own ORM and form stuff
I have hacked stuff based on TurboGears, Colubrid, pure CherryPy, Mako/Kid/Cheetah/CherryTemplate templates, Routes, Paste and about half a dozen other frameworks or pieces that are used for frameworks, so how new could it be? Well, not very new. I am starting to notice a sort of sameness in these things. They are all alike.
First, the conclusion: I liked it, I could work with it.
Now for some little detail:
The URL dispatching is nice ,if not really interesting. there seem to be two ways to do this, all frameworks use one or the other, and almost everyone likes regexps better.
The ORM+newforms is quite nice! Of course everything was done with oldforms, which is... not quite so nice. But you can switch pieces as you go, and the code actually simplifies as you hack, so it's good.
The template language I could live without. It doesn't seem to be specially featureful, and it didn't seem as expressive to me as my current favourite, Mako. Luckily you can replace it easily. It's not that it's bad, it's just average.
So, I see no reason to learn it instead of Turbogears, or viceversa. On the other hand, if you know one, you can learn the other in perhaps a weekend, so there's no point on not having at least a basic knowledge of both.
Thinking about this blog.
I suppose it happens to everyone once in a while, and it has happened to me often in the past, but I am thinking if I should keep on writing this blog, or if some large change is needed.
Here are some random things from my head:
Almost noone reads it. Really. It has less than 40 subscribers. That's pathetic for a blog that has content for over 7 years :-)
Maybe I should post in spanish, or at least bilingually.
Maybe I should write more features. When I write a longish piece and announce it, there is a respectable traffic surge.
On the other hand, I enjoy writing it. And it's really very little effort (specially now, with BartleBlog ;-)
Maybe it should be more focused in one area, make it a python programming blog, or a tutorials blog, or something like that.
-
But I am not a focused person. I am a generalist. This week I have worked in the following things:
VoIP
Django
PyQt
Linux sysadmining
Firewall/Proxy integration with windows clients
Consulting in the most generic sense, sitting with a company's IT staff and thinking about their situation.
Learning PyGame
And this was in 5 days of work. If I listed what I have done this year, it would take me 500 items. I am broad, how could my blog be narrow?
Maybe it's just not interesting? Or badly done?
Is it too nerdy? Is it not nerdy enough?
I have had a blog with a small readership for 7 years, why is it bothering me now?
If I stop, it doesn't matter, I can always pick it up again later when I feel like writing.
So, there. You, the 40 guys, comment on it if you want ;-)