Sunday 22 August 2010

Focused browsing: limiting open tabs

Last week I've been intensively searching for some info related to the current project. As a result at the end of week there were two firefox windows with about 50 tabs opened in total. Most of them were there just to remind of some related info, which I intended to read later.
If you ever had so much tabs to read in your face, then you know that it can be "a little" frustrating.
At that time this post on lifehacker about rebuilding attention came out.
It mentioned 'No More Tabs' Chrome extension which prevents too many tabs from being opened at the same time.
Searching for extension with same functionality for firefox (again through lifehacker) gave a link to 'Window and Tab limiter', which does exactly the same. In addition it counts not only tabs but windows too.
When you open a new tab and hit your limit it asks you to close one of opened tabs/windows first.
I set my limit to 7 tabs. Two of them are always the the same AppTabbed goosh.org and gmail.com. Now it takes some time to think what tab to close, but at least there is no more 50 opened tabs in my face.

Sunday 15 August 2010

Installing Delphi components on BCB6

Today I've been installing CoolTrayIcon components on BCB6.
I've done it once, but totally forgot how I managed to do it.
The install.txt sais:
1. Select "New Component..." from the menu
2. In "Ancestor type", select "TTrayIcon  [trayicon]"
3. In "Class Name", type "TCoolTrayIcon"
4. In "Palette Page", type "Tray Icons" (or another tab you want to install to)
5. In "Unit file name", select "RegisterTrayIcons.pas" (which is found in the
   CoolTrayIcon package). Also, include CoolTrayIcon.pas and TextTrayIcon.pas,
   or you might get an error regarding "IMGLIST.OBJ".
6. Click on the "Install" button.
If you do exatly that you'll finish with a bunch of linker errors. Particular one is
Outline::TCustomOutline::~TCustomOutline()' referenced from C:\PROGRAM
FILES\BORLAND\CBUILDER6\LIB\BCBSMP.LIB|.\cdiroutl.cpp
Not very straightforward googling results in the following solution:
 this is quite common when installing Delphi components into BCB. You
need to add bcbsmp.bpi into the 'Requires' part of the package. (It's
in the small 'Package' window under 'Requires')
I figured out a way to eliminate the above error message.
add...
..\CBUilder6\Lib\Debug\vclx.bpi
The Pascal component probably 'uses' a VCL sample component. This is a
tricky area for Pascal component usage in BCB as BCB comes with native
C++ sample VCL components and by-design excludes the native Pascal VCL
sample components.
Once I've done it everything went fine in my work environment.
But today I went into another linker error when trying to repeat installation in my home environment:
[Linker Fatal Error] Fatal: Unable to open file 'c:\PROGRA~2\BORLAN~1\Projects\Lib\cooltrayicon.bpi'
Again googling resulted in
Yes, BCB wanted to create files in the folders Projects\Lib and
Projects\Bpl which didn't exist
At last creating Lib directory under Projects resulted in successfull install.
Damn! So wast amount of time was spent just to install one component!

Thursday 5 August 2010

When implementing some complex logic in SQL try first to think in terms of sets and relations.
Think of procedural way only when you definately cannot manage only with sets and relations. Using analytic functions and simple relational operators leads to more straightforward and error-free way of doing tough things then writing complex stored procedures.
Plus debugging stored procedures is not always convinient when dealing with large amounts of data.

Wednesday 4 August 2010

SQL loader hangs when you have uncommited changes on tables you're trying to load to.

Monday 2 August 2010

Sometimes you would prefer to use database engine to pass information between threads.
Idea from Multithreading - The Delphi Way. Martin Harvey.