Skip to content


Found in The Code – QT

#elif (defined(Q_OS_UNIX) || defined(Q_CC_MINGW))
        abort(); // trap; generates core dump
#else
        exit(1); // goodbye cruel world
#endif

file: qglobal.cpp

Posted in programming.

Tagged with , .


PostgreSQL Wishlist

PostgreSQL is a great database, in my opinion much better than Oracle, or the so widely used MySQL. The version 9.0 is going to be out soon. There is the quite huge list of ideas for the future improvements (hopefully in the next 9.1 version).

Depesz wrote his own list of things that he wants to see in the future versions, so I thought I would write my own.

Continued…

Posted in database.

Tagged with , , .


Found in The Code – sqlite

/*
** 2008 May 26
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
******************************************************************************
**
** This header file is used by programs that want to link against the
** RTREE library.  All it does is declare the sqlite3RtreeInit() interface.
*/
#include “sqlite3.h”
sqlite – rtree.h

Posted in programming.

Tagged with , , , .


MySQL SQL Mode Fun

While looking for some information on the web, I found quite nice piece of SQL, something like:

SET sql_mode=’STRICT_ALL_TABLES’; — Session scope for the purpose of this article

This sql_mode looked quite interesting, I’ve checked that in the MySQL documentation and well… it is a little bit terrifying.

Continued…

Posted in database, wtf.

Tagged with , , , , .


Naming Convention aka PHP vs Python

That was to be called naming convention. That obviously is better to have any than none. As I was writing, I noticed that the title doesn’t reflect what I wrote. All turned out to be not about convention but about comparing PHP to Python, but personally none of the languages is my favorite.

After reading the whole post, I realized that Python is not better than PHP, it is messed the same way, so why bother changing from PHP to Python?

Continued…

Posted in programming.

Tagged with , , , , .


Indentation Checking in Ruby

In Python blocks have to be indented just because the indentation level defines the logic. In C/C++/Java there are { and } while in Ruby there is begin and end. Of course indenting is helpful. Just like syntax coloring in editor.

In Ruby can do whatever you want with the indentation. That’s not a problem. Every good editor can fix the code layout due to some rules. Normally I use VIM for all those scripting languages, for programming in Ruby and Python too. In VIM after opening any file I can do the magic command:

Continued…

Posted in programming.

Tagged with , , .


Twitter Fun Again

Well… once again Twitter turns out to be amazing piece of software (is this because it was implemented in Ruby?). Twitter has (had?) a bug where you could force someone to follow you just by

The flaw appears when a user tweets this format: “accept [Twitter Username]”. So, for example “accept TechCrunch”. Magically that user appears as one of your followers.

source

On the blog there is info that:

Follower/following numbers are currently at 0

On my account there are still correct numbers – I wouldn’t use that dirty hack (lovely feature?) just to have more followers. Why someone want’s to have more followers not interested in following? Is there any

Twitter really amazes me – I really couldn’t reproduce that error (feature?) in the soft that I write. Of course I could do that on purpose – but not by accident, no way.

This is really amazed what you’ve done, thank you for inspiring me how to create such hidden features. Good work.

Posted in wtf.

Tagged with , , .


Oh, Those Terrible Units

There are some numbers and units. Numbers are numbers. Units are units. Numbers informs how many. Units inform about two things:

  • how many
  • of what.

Continued…

Posted in programming, software, web.

Tagged with , , .


Virtualenv Tutorial

What is Virtualenv

Virtualenv is a great piece of software. It allows to create some virtual environments that have many different versions of Python across the whole system and having different sets of libraries.

Warning

This document is the first public draft. Some thing should be reviewed later and some will be added.

Tools Versions

While creating this tutorial I used following tools and versions:

  • virtualenv – 1.4.8
  • Python – 2.6.5
  • Ubuntu 10.04 64 bit
  • All console programs run with UTF-8

Do I Need Virtual Environment?

As usually: that depends. Normally you can create and use Python programs without that but using virtualenv can help a lot.

Such virtual environment provides many possibilities such as:

  • On production servers it allows to run applications created for different Python versions.
  • On testing servers it allows to perform many tests including:
    • Testing the installer script if that really installs all necessary libraries with checking their versions.
    • Testing applications using different set of libraries.
    • Checking if upgrade of a library won’t cause errors.

Continued…

Posted in programming.

Tagged with , , , , , , .


Ubuntu 10.04 Upgrade

I’ve already upgraded by laptop to Ubuntu 10.04. Strange, no problems at all. My friend wasn’t so lucky, his laptop doesn’t boot after the upgrade, now he uses Vista. This kind of problems I had last time. There were problems with drivers for my graphic card so I had to take new kernel and drivers from some unstable Ubuntu branch.

Now it just works, nice.

Posted in software.

Tagged with , , , , .




Better Tag Cloud