Welcome to weblogs.com.pk Sign in | Join | Help

I don't know how many people use SlickRun utility, but I really like it. It is command interface for accessing any website or any locally install program. I am big fane of using command interface then GUI based interface. GUI interface usually easy to learn but it difficult to use on daily basis. Like how many of you actually go to file menu and select new browser window menu option then just pressing ctrl+n.


You can lock you PC by just clicking an icon on your desktop. Here is the method for creating that shortcut,

  1. Right click on your desktop
  2. Select New->Shortcut from popup menu
  3. Type the location %winnt%/system32/rundll32.exe user32.dll,LockWorkStation
  4. Click Next
  5. Give some meaningfull name to this shortcut and click Finish

Now when you double click on this icon, your PC will lock.

Mostly well designed systems usually carry four layers model. Every layer has some specific responsibilities and in good design has less dependence on other layers. Here are these layers with small description,

  • Presentation - This layer is consist of screens where user see data coming from system and has the ability to interact with it. Capabilities of presentation layer depends on the client device. If system is properly design then system can have multiple presentations without any changes in backend system.
  • Controller - This layer actually implements use cases collected at analysis stage.
  • Domain Model - This layer defines key business objects. It captures business rules as well as data requirement of the system. Data requirements translates into attributes of objects and rules usually implemented in method of objects. Rules also dictates the relationship between objects.
  • Persistence - Every system has to store its state somewhere so that it can be retrievable after system restart. Usually it stores into relational database and it can automated by the ORM (Object Relational Model) tools.

If you are working on small project, you can combine different layers, but for big projects it is better to implement these layers clearly.

  • Application will be accessabile from number of locations and on different plateforms.
  • Easy to maintain and distribute across multiple client devices.
  • Since clients are thin, it usually start quick.
  • Less depend on capabilties of client device.
  • Business logic and presentation is seperated.

Today I got an email from one of my colleague mentioning this beautiful quote,

Human are allergic to change. They love to say, "We've always done it that way." I try to fight that. That's why I have a clock on my wall that runs counterclockwise.

~ Grace Hopper

(That's is Admiral Grace Hopper - she invented compiled computer languages. The first being COBOL. She has been called the first Dame of Computer Science).

After going through logical modeling of databases, we usually get a normalized database. In real environment and specially in Web-based system normalized database usually not give us optimum performance. Next step before creating a physical schema/scripts data modeler demoralize the database. It is a reverse process of normalization and object of this process is to get best performance from the database. Demoralization is one of the key reason for having two separate Logical and Physical Models.

Following are key strategies for demoralization,

  • Duplicated Non-key columns (Copying non-key columns in other tables to avoid joining source table in a query)
  • Horizontal Table Splits (Partition very large table data into multiple tables with same structure for reducing indexes size)
  • Vertical Table Splits (Divide different set of columns into multiple tables with same primary key for quick updates)

If you are having problem with slow Internet and wants to speedup your browsing then updating your host file will help you to do that. It will also secure you system from number of security threats. Here is a nice article about this with properly organized host file.

Few days back I saw an email where writer was complaining that their website is not indexed by Google. They have done everything but site was still not indexed by Google. I can understand this, it is frustrating when you don't have any control. Luckily here is a new tool from Google which might help site administrators in this situation.

It is a nice tool for managing Windows Services. It creates a profile and then when user select that profile, it automatically run all associated services. User can access profile through taskbar icon. You can download this tool from here.
It is an interesting article. We saw number of times Windows users complained about Linux installation difficulties. Here is a Linux user trying to install Windows XP home on his PC and having LOTs of problems.

Here is an interesting post. Ofcourse I couldn't check it but atleast we can enjoy it as a mystery novel. :-)

Here is the source of rumor, a snippet from CNet News,

And there's potential that Sun also could be more accommodating of C#, Microsoft's .Net analog to the Java language. Sun Chief Technology Officer Greg Papadopoulos said Sun is examining modified virtual machine software that can run other languages besides Java. The initial focus is on scripting languages, but other options include Fortran and C, and there's "no barrier" to a virtual machine that could run C#, he said. "The virtual machine is capable of executing more."

Definitely MS can not let Google go without giving him a good taste of competetion.  Bill Gate annouced a new product from MSN in his keynote at  'D' Conference, One of its key developer also has blog entry about this. 

PDFBox is an open source project released under the BSD license. It is a pure Java library that supports following important features,

  • Extracting text from PDF document.
  • Encrypt/decrypt any PDF document.
  • Import/export form data
  • Overlay one PDF document on top of another.
  • Split big PDF document into multiple small documents.
  • Append to existing PDF document.
  • Integrate with Jakarta Lucene.

PDFBox API belong to two different packages,

  1. org.pdfbox.cos - represent PDF document as collection of basic objects types.
  2. org.pdfbox.pdfmodel - It encapsulates COS model  and provides high level API

Here is an example code to start with this library,

import java.io.IOException;
import java.io.StringWriter;
import org.pdfbox.pdmodel.PDDocument;
import org.pdfbox.util.PDFTextStripper;
public class PDFExtractor{
    public String getPdfText(String fileName, int start_page, int end_page) throws IOException {
        StringWriter s = new StringWriter();
        PDDocument doc = null;
        try {
            doc = PDDocument.load(fileName);
            PDFTextStripper stripper = new PDFTextStripper();               
            stripper.setStartPage( start_page );
            stripper.setEndPage( end_page );
            stripper.writeText(doc, s);
        } finally {
             if (doc != null) {
       return s.toString();

There is an option available on right click menu for displaying the source code of current web page in notepad. There is another neat way to display same in the browser window itself. Once web page is downloaded properly, enter following command in address bar and hit enter key,





More Posts Next page »