Archive

Archive for the ‘HowTo’ Category

Update or insert rows in SQL

Some operations are not as easy in SQL as in procedural or imperative languages. For example while it is very intuitive to make an update or insert (also known as “upsert”) operation on a std::vector in C++, it is tricky in SQL. The upsert operation is: update data if already in the set and insert it otherwise.

As for recursion in SQL, the way to perform an upsert depends on the DBMS and its version.

Read more…

Fix Gallery3 to extract IPTC headlines and captions

Gallery3, a web based photo album organizer, can extract the IPTC.Caption field of photos you import. This caption is then used to set the description of photos. However, this default behavior might not be what you would expect. Read more…

Categories: HowTo Tags: , ,

Recursion in SQL

We are used to easily writing recursive calls and loops in procedural languages, but this doesn’t hold true in SQL. Indeed, it depends on the DBMS used.

This article will focus on the ability to write recursive queries using Common Table Expressions (CTE). CTE are an addition from the SQL 1999 standard and are not yet available in all DBMS. As of today, CTE are at least compatible with:

  • Microsoft SQL Server 2000 / 2005 / 2008
  • IBM DB2
  • Oracle 9.2
  • PostgreSQL

Read more…

Categories: HowTo Tags: , , , , , ,

Improve your Internet upload bandwidth management by configuring your Linux router

If you are running a Torrent, FTP or whatever kind of server behind your DSL link, you have probably noticed that interactive sessions get really slow (Web browsing, SSH…). As a first solution, you can of course configure your Torrent or FTP server to limit its upload but it’s not fully optimized as this wouldn’t use 100 % of your upload bandwidth.

Read more…

Categories: HowTo Tags: , , , ,
Follow

Get every new post delivered to your Inbox.