Postgresql and time zone in timestamp

Ok, I want us to go through quick experiment. Create new postgresql database and make one table for testing:

CREATE TABLE test (timetz TIME WITH TIME ZONE, tstamp TIMESTAMP WITH TIME ZONE);

Now insert sample data to this table, give both columns same time zone:

INSERT INTO test (timetz, tstamp) VALUES ('16:00:00+06', '2013-02-21 16:00:00+06');

Now select this data and watch this (assuming your database has default timezone in +01):

16:00:00+06 | 2013-02-21 11:00:00+01

Yes, you’ve been fucked.

I’ve spend whole day today debugging god only knows what parts of our application – just to understand, that time and timestamp are treated differently when it comes to storing and displaying time zone.

Cheat of the day

sudo python -m smtpd -n -c DebuggingServer localhost:25

I had no idea that this exists. It’ll print every email that is sent trough your localhost. Perfect for debugging.

Awesome app for this week #4 – AirDroid

And we’re here again to blow your mind with some awesome Android app :). Today I’ll recomend something that you can show to your iphone loving friends and ask “do YOU have app for that?”. AirDroid is an app that lets you manage your phone without a cable. You can just connect it to wifi and send sms messages from your desktop. All you need is a browser and AirDroid – for full description you should check their Android Play page.

The future of Linux desktop?

This catchy title spreads through the internet for quite some time, first was Miguel de Icaza with his What Killed the Linux Desktop and he refereed to the article How Apple Killed the Linux Desktop and Why That Does not Matter published in Wired. After the explosive reaction to the first of these articles, you can infer that we’re all pretty annoyed with this myth of incoming doom – Linux is not going anywhere, it is needed and used by many. The fact that we do not see it on the tables in Starbucks proves nothing. Please take a look at statistics from Wikipedia – 6.81% of visits to Wikipedia is made from Linux, 7.78% from Mac. I once heard that Linux covers about 1% of the market, it seems that our favourite OS is advancing, but in which direction?

Gnome 3

In Linux on PCs we can see noticeable, and disturbing, trend. Everything seems to be getting more and more adjusted for tablets and mobile devices. Let’s look at Gnome 3 in contrast to his predecessor. Gnome 2 was a classic coat, allowed for an easy fit, had many additions and extensions. The default configuration tools were full of options and allowed user to be real master of his desktop. Gnome 3 defaults to large icons, removed more “advanced” features (without third-party tools it is impossible to change the size of text), changing all the switches on the large graphic “sliders”, everywhere you can find translucent clouds and balloons. Even for someone who do not have to deal with it on day to day basis, it will be easy to guess that we see the attempt to use native interface of the tablet, but stretched to the size required on the PC.
Glancing at the other corner we see Unity desktop environment for Ubuntu, which also is known for its large icons, “touchy” interface and a few seconds response time to user actions. When we add the lack of compatibility between Unity and the rest of the world (not full, but boldly directed this way), we can’t do anything else then to scratch our heads and ask what happened?
Why the last few months (if not years) we can see regression in many aspects important for users? Why are people, that were accustomed to working on Linux, have increasingly difficult task to find an environment where they can continue to work without constant frustration? Is the supposed “death of the desktop” and “post PC era” so inspiring that we abandon the current user base? Most people I know, no longer use Gnome and Unity, they just moved to XFCE, Awesome, LXDE and others. People are in desperation and are trying to further develop Gnome 2 (now called Mate) or modify Gnome 3 to behave like its earlier versions (Cinamon).

Unity

The only question is whether we need it? What do new users think of Linux, when most of them meet with the default Unity or Gnome 3? I don’t want to sound like an old person, but those environments are so “modernized” that they are strange and often useless. Years ago users alienation resulted from poor hardware compatibility, today reason for discouragement is increasingly unclear and confusing interface.

And you? What desktop environment do you use and why?

Does the number of monitors matter?

For years, PC users believed that the more monitors we have, the more efficient we are able to work. Multitasking was a term repeated by people like some kind of spell, magic solution to our problems with the constant procrastination. Now, when many had a chance to try it out for themselves, some argue that more work surface (2, 3 monitors instead of one) mainly increases our dispersion.

The first article that I read, that dared to break the silence and argued that the greater number of monitors isn’t necessarily better, was response to the letter of one of the lifehacker readers, which contains some interesting sources of theory that is praising multitasking.

The truth is that you can’t get a clear answer to the question “whether multiple monitors are helping my productivity” because there are more unknowns in this equation. The basic issue is how you use your computer. Graphic designer will gain by working on multiple monitors because he will be able to hold tools and references on one monitor while work without the need for additional image obscuring on other. There are many professions where 2 monitors really make life easier. Another unknown is the size of your monitor – assuming you have two 19-inch panels in total they will give you reasonable number of pixels to work on, but if you plan to purchase two 27 inch monitors – think about whether you really need such a resolution.

My desc before experiment

Another dimension is the use of computer to work / play at home. In this case, in my opinion, if you have a reasonable size monitor, one will be perfectly adequate. My belief stems from the assumption that while you’re on your home PC, you’re using messengers, facebook and email all the time. How much you will be able to do second monitor is full of notifications? Even if you do not devote a lot of time for them but peek only from time to time, it’s a change of context that costs a lot of our brainpower. In the end, the whole time we hung somewhere between a state of concentration and relaxation, we wont be able to devote entirely to what we do (eg. a new note on the blog), and at the same time we wont be relaxed. The result is usually lost of enthusiasm.

And as I’m increasingly irritated by my manner of talking about theories without any verification, I decided to move for the month from my current setting (2 monitors, 1920×1080 and 1440×800) to one (1440×800) to see if I can feel the positive or negative change. I will try to fully describe my experience, share my findings and the tricks that can help with work in a limited workspace.