Running Flask app with gunicorn using a Flask-Script command (on Heroku)

About two weeks ago I felt a huge need of learning something new – a language, framework… Anything! Just to make my brain work a bit harder. After looking around for a few days (sorry Scala and Erlang, you have to wait a bit longer!) I decided to become more familiar with modern cloud application platforms which are becoming more popular these days (or Paas model in general). Because I think that real projects are much better that rewriting tutorials and reading docs, I decided to write a small Flask web app and deploy it on Heroku. After a few days of learning Flask, coding and running my app on a built-in Flask server I decided to move to a bit more production-ready stage by running it using Gunicorn. And here the story begins…

Continue reading

Combine multiple video frames into one using OpenCV

I’m playing a lot with OpenCV and object recognition recently (I started from Python, but now I’ve moved to C++) and what I wanted to do to make my life easier was putting 4 different video frames (original, thresholded, grayscaled & thresholded and original with marked face). Even if it’s not very difficult task, it took me a while to do it, because – definitely – I’m not an OpenCV expert. This article shows how I did it using the new 2.3 (or – actually – 2.X) OpenCV API.

Continue reading

A few words about Python’s extended slices

One thing that most Python users learn at the very beginning are list slices – defining a part of the list using the samplelist[begin:end] syntax. It’s great thing, but – surprisingly – many people don’t even know, that there’s different syntaxt for this, containing one additional parameter – “step”: samplelist[begin:end:step]. How does it work?

Continue reading

Very good interactive Git workflow cheat sheet

Few minutes ago I was looking for a Git workflow cheat sheet to verify some rarely-used parts of my knowledge before doing something I might regret. Actually I was hoping to find something very simple (preferrably one pdf page or so), but instead I found this one, which is a very good, interactive webpage. So I decided to share this find with you, because it’s definitely worth it:

Git workflow cheat sheet

Git workflow cheat sheet

What’s best in it, it presents everything in a very intuitive, visual way which is easy to understand. If you are looking for a command which will completely revert your commited changes, you can just click on “Local Repository” and see which arrow points to “Workspace” – it’s a git reset --hard one. How about leaving the changes you’ve made, but reverting commit? It’s an arrow with git reset --soft. Brillant!

It’s not only a good thing for people who look for a typical cheat sheet, but also for those who have some problems with understanding git workflow.

I really like it – nice work guys!

My first Cassandra contribution

A bit surprisingly and somehow accidentally, today I became a Cassandra contributor. I had a problem with the project I do for work, which made us unable to make our bulkloading script work together with Cassandra authentication (which I described in one of the previous articles on this blog), so we decided to try solving this issue on our own.

The solution was quite simple, but gave me a bit more of Cassandra knowledge and understanding. If you are interested in contributing to Cassandra I think you can take a look at this problem and the solution or even try to reproduce this problem (on Cassandra 1.1.0-rc1 or earlier) and then try to solve it on your own. As I said it was simple, so you won’t get frustrated with the problems you will face, but I think it’s good start for something more. Here is the link to Cassandra’s bug tracker issue:

Working on interesting things, being nicely paid for this and contributing to remarkable Open Source projects in the same time – could it be any better? ;)

Extending Xubuntu desktop to external display using xrandr

Few weeks ago I’ve bought a new laptop and I’ve installed a new Xubuntu 11.10 on it. Surprisingly (and sadly), when I tried to connect an external display to it, I found out that it’s impossible to do it in “out of the box” version of Xubuntu. I had only a choice to use my external display instead of the internal one or to do a “mirror” configuration, having the same on both displays… Satisfying? No, thanks. I had to find out how to do it in the way I want it to work.

Continue reading