Marcin Świerczyński's blog

Marcin Świerczyński

My name is Marcin Świerczyński. I'm a software developer especially interested in Java and Python languages, Java-based technologies and mobile applications development.

I'll be writing here about interesting issues I faced during my programming adventures. I hope you'll find the solutions useful.

2010 summary and 2011 resolutions

posted 31 Dec 2010

I’ve never done summary of the past year before. As well as I’ve never make huge resolutions for the upcoming year. But, come on, this year was so great it deserve this! We often forget about our past successes so I think that just thinking about them is a great way to start the New Year with good attitude. On the other hand, the next year resolutions list can be a guide for what to...

¬ read more

How to create UIPickerView with toolbar above it in iOS

posted 06 Dec 2010

A few days ago, I had to implement a UIPickerView based select list with toolbar above it. The toolbar had to have a button to close the picker. The whole solution had to be very similar to the one used in a mobile version of Safari browser. How to do that? The clue of the problem is contained in just two properties of UIResponder class: inputView and inputAccessoryView. The first one contains a view which...

¬ read more

Scaling Django

posted 06 Dec 2010

Just quick info: very interesting presentation by Mike Malone about scalability of Django-based web applications. Scaling Django View more presentations from Mike Malone

¬ read more

Django and Rails and Grails comparison

posted 08 Nov 2010

I’ve recently found a link to an interesting presentation at zenzire.com. Its author, Jaime Buelta, speaks about differences between Django, Rails and Grails frameworks. I know Django and Grails. Personally, I like both of them. I can’t only disagree with one argument about Grails - it’s rather poorly documented. But still, it deserves to give it a shot. Just take a look at it. Django and Rails and Grails, Oh my! (Jaime Buelta) from whykay...

¬ read more

Virtualenv + pip

posted 02 Oct 2010

In the Java world there was always a problem with dependencies. All the jars we had to mange by hand - quite awful. Thankfully there is a Maven project which helps us in requirements management. But what about Python? Is there any way to handle necessary libraries? Of course, there is! It is a tandem of virtualenv and pip. Virtualenv is a tool to create isolated Python environments. I’m sure you can imagine a situation...

¬ read more

Productivity tips for programmers

posted 05 Sep 2010

I’ve recently started reading The Productive Programmer book. In a few first chapters, I’ve found some interesting tips for programmers. Some of them can be useful for non-programmers too. Prefer typing than using mouse It is quite obvious that moving hands from keyboard to mouse consumes a lot of time. How to minimize this effort? Use launchers. That applications can be started by a simple keystroke. They display an input where you can enter a...

¬ read more

Python 3. Kompletne wprowadzenie do programowania - opinia

posted 01 Sep 2010

Pozycja Python 3. Kompletne wprowadzenie do programowania (oryg. Programming in Python 3: A Complete Introduction to the Python Language) ukazała się w Polsce nakładem wydawnictwa Helion. Niniejszy tekst stanowi próbę oceny tej książki. “Python 3. Kompletne wprowadzenie do programowania” można podzielić na dwie główne części. Pierwsza stanowi wprowadzenie do podstawowych elementów języka, bez znajomości których ciężko byłoby stworzyć sensowny program w Pythonie. Druga natomiast to omówienie bardziej zaawansowanych technik wykorzystania biblioteki standardowej w sytuacjach uznanych...

¬ read more

Generic relationships in Django

posted 24 Aug 2010

Last week I’ve completed an interesting task within our project: building internal link-shortening system based on persisted objects, not on constant URLs. The main requirement was to get as loosely-coupled design as possible. In the perfect world the “shortenable” classes should know absolutely nothing about link-shortening mechanism. How to get such a flexibility in Django? I’ve used the ContentTypes framework with generic relations and it works pretty well! First of all, we need to prepare...

¬ read more

Code coverage analysis in Django

posted 31 Jul 2010

Code coverage analysis could be very valuable if you want to do reliable testing. 100% coverage doesn’t give you a guarantee that everything will be fine, but still - it’s extremely useful tool. How can we use it in Django-based application? First of all, we’ll need an awesome module called coverage.py and written by Ned Batchelder. I recommend to install it on a development machine instead of just attaching it to the project, because it...

¬ read more

How to add a text message to messages conversation in Android SDK

posted 25 Jul 2010

Today I’ve published new version of my Andriod application - AutoRespnder. The main feature in this release was quite simple: show auto-sent messages within standard messages conversation, just as if was send by hand. How to do this in Android SDK? Because it is a background operation not visible to user, I’ve decided to build a Service to accomplish this task. //imports public class SentSmsLogger extends Service { private static final String TELEPHON_NUMBER_FIELD_NAME = "address";...

¬ read more