Archive for the 'Tips' Category

Extended Desktop on iBook G4

Wednesday, November 23rd, 2005

Yesterday Kate asked me whether it’s possible to connect her professional Sony display to her iBook G4 to get a better picture and color representation or no. I answered, yes, without any hesitation and… it’s where the tricky part started.

While it was farily easy to connect the other monitor by simply plugging it in, it quickly become clear that it’s useless. Firstly, the second screen showed exactly what was on the main. Secondly, the resolutions of both were the same. That’s what is called Mirror Mode there in Macs. I couldn’t believe my eyes. While I could clearly see that the display settings dialog box has everything for laying out several screens to form a bigger virtual space and controls to change resolutions of the screens separately, there obviously were no ways to enable Extended Desktop functionality itself.

I made a quick Googling and found a very interesting page about Macs firmware patching, enabling this multi-screen feature. Well, I hesitated… There were so many warnings that I started to doubt this pilgrimage. I made a little more Googling and finally found what I was looking for — a prove that it’s relatively safe. It was an article on MacWorld site telling the complete recipe. And again the first site has been mentioned there.

I took a deep breath and installed the DMG… Woohoo, now we have a bigger CRT monitor connected to the iBook. The native screen and the display show their own part of a virtual desktop, having different resolutions, different refresh rates and even different background images. :)

Life is good again!

Google: Magic Tips

Wednesday, November 16th, 2005

Something that I always missed in Google Search was the fexibility of expressions building. Sometimes those tricks mentioned in the advanced search facility is barely enough to fulfill my immediate needs and I have to make series of searches and combine them later. That’s what always bugged me. Yesterday I was doing some collocations searches for my English classes after my working day full of coding was over and unexpectedly typed in an expression looking more like something from a programming language. To my astonishment it worked finer than fine and returned lots of useful results.

In this short writing I would love to share my finding with you. It may come that you have already seen a similar description somewhere or maybe it’s even documented (?). Who knows… Personally, I saw this functionality for the first time. So, let’s start some magic?

(more…)

Singleton Strategies

Tuesday, November 15th, 2005

Often, when you are developing some application you wish it to run one instance at a time. If you are writing a native application, there’s no problem because the platform you are aiming on most probably already has everything for this kind of magic. When it comes to cross-platform approach it’s vitally important to choose something neutral. This post is about my experience in this area.

(more…)

Weird Photoshop Math

Friday, November 4th, 2005

Today I was put into a deep shock with how Photoshop calculates final color of the dot which has several semi-transparent objects on its way. Assume for a second that you have a black background and two 50% white squares on top of each other and the background. What do you think, will the resulting picture show grey square or will it be entirely white?

(more…)

Calling Optional Methods

Friday, October 21st, 2005

Today I had another interesting task — to make splash screen window be always on top of everything else on the screen. Yes, and it’s all in Java. I know that Java 1.5.0+ already has a nice method to accomplish this –

setAlwaysOnTop(boolean)

– but what about our 1.4.2 compatibility? I wasn’t able to find any methods for doing this in 1.4.x and decided to add support at least for our users at 1.5.x . The next question was *how* to call this method without breaking compatibility with 1.4.x?

(more…)

Usage of Static Inner Classes

Saturday, October 15th, 2005

Why is it good to have static inner classes? When an inner class is not static it holds a reference to its main class. If your inner class does nothing with the main class the reference is completely useless and only takes some memory. Nothing really harmful, though.

(more…)

Java Timestamps go Database

Friday, September 30th, 2005

Couple of years ago I wrote a small application to manage a post cards distribution for a small advertising company. The application worked with a Cloudscape database but it’s not the point. The point is that my friend, who was working for that company, asked me to help with some strange problem. After the hardware upgrade all of the records in the database became invisible. I need to say that there is a screen where you can examine the amounts of cards sent to a different organizations at the given dates, and there is another screen where you can build a comprehensive reports with the same information but for a given dates range. Well, the records were not visible on the single-date statistics page, but they were in the reports. I was shocked…

(more…)

Two approaches to testing of code with database access

Saturday, September 3rd, 2005

Often we deal with database. Data is flying back and forth between application and data store. Following the modern influences, we wish to have tested everything that might break some day. When you get enough experience and develop the sense of well code design, this task will become easy and straightforward, but unfortunately I can see very often bad samples of code separation and awful design. So what it is all about?

(more…)

Writing Effective Software Descriptions

Thursday, August 25th, 2005

Today I was looking for a good manual on how to build correct and well-formed Debian distribution packages. As you might know, every package has some sort of description telling what application it holds, why user needs this application, what platform this application is supposed to work on etc. While it is a regular descriptor, it still plays big role in advertising your product.

Advertising: Principles and Practice (6th Edition)
by William D. Wells, John Burnett
Creative Advertising: Ideas and Techniques from the World’s Best Campaigns
by Mario Pricken

(more…)

WordPress: Feeds with Read More

Monday, August 15th, 2005

Today I have discovered one very unpleasant thing about my syndication feed. I have a habit to make a post consist of two parts: the introduction and the actual content. Between these two parts I put “

<!--more-->

” mark and what you see on my title page is the list of introductions to the writings. This approach is quite popular among bloggers as it allows us to let users judge for themselves whether they are interested in the content or no before jumping into actual reading. What I have discovered today was that feeds I have contain full content and not the introduction part only. That was a surprise to me because I was working with B2Evolution and MovableType before, and they did what was expected – included introduction only. Reading further you can find out how I fixed that.

(more…)