Tuesday, 2 September, 2008

In Private browsing in Firefox 2, Opera 9, IE 7 & Safari 3 browsers

Check out the following lin kto know more about In private browsing in different browsers.


Internet Explorer vs. Safari

Comparision between Microsoft Internet Explorer and Apple Safari


Saturday, 30 August, 2008

Mounting External Hard Drive in Ubuntu Linux

Try the following
Applications -> Accessories -> Terminal
sudo apt-get update
sudo apt-get install ntfs-3g
sudo mkdir /media/sdb1
sudo mount -t ntfs-3g /dev/sdb1 /media/sdb1
ls -la /media/sdb1

3D Desktop effects could not be enabled in Ububtu Linux

To resolve this problem, We should have aiglx. Try the following

sudo gedit /etc/X11/xorg.conf

We have to look down some till a entry like "ServerLayout" section and put in

Option "AIGLX" "true"

Then save your stuff and restart X by pressing ctrl+alt+backspace

How to Turn off Tool Tips of GNOME in Ubuntu Linux

Check out the following link.


How to Change Kubuntu Linux Theme

To change the actual theme kubuntu,we can use KDE Display Manager (KDM) , For that we need to install a package called kdmtheme. Once we have installed it, a new item in System Settings appears called KDM Theme Manager. We can now use it to install KDM themes.

We can download more themes from


How to Change the Mount Point for CD ROM

We have to to edit /etc/fstab, which contains all the settings used to mount your devices including CD drives and floppy drives.
If we want the CD drive mounted on /mnt/cdrom, change the follwoing entry from

/dev/hdc /media/cdrom


/dev/hdc /mnt/cdrom

As an alternative to changing the mount point, you can use a symbolic link in order to get a desired path:

ln -s /media/cdrom /mnt/cdrom

C++ Tutorial with Good Examples

A Good web site to learn C++


Running Ubuntu Linux without GUI

Remove all the entries in
/etc/X11/default-display-manager file.

Now, reboot your machine, it automatically boots without GUI(Without starting X server).
If you want to start the X server, just give


Variable Declaration in C++

To declare a variable as a character, use the C++ keyword char followed by a valid C++ name. Here is an example:

char Gender;
With a byte variable declared like that, you can give the variable a starting value. Giving a value to a variable is referred to as initializing it. Initializing a variable is done with the = operator. The syntax used is:
VariableName = Value;
Since a char variable represents one symbol, to initialize it, enclose the initial value in single quotes. Here is an example:
char Answer = 'y';
You can also initialize a variable by including its value between parentheses as follows;

   char Answer('y');

What Happens When We Google

Saturday, 9 August, 2008

How to change the size of a drop down menu

We can use CSS and the 'select' selector. i.e.:
<style type="text/css">
select {
height: 12px;
width: 100px;
max-height: 12px

<style type="text/css">
select {
font-family: Verdana, Arial, sans-serif;
font-size: 0.8em;

Different Type of Font Sizes are listed below


The Default size is medium

HTML Text box - Various Styles

Check the below site which has various styles that can apply for HTML INPUT Text Boxes


Sunday, 3 August, 2008

Finally, Google!

All the rumors about Google are true. Or at least most of them. I've finally decided to collect some excerpts from news articles and blog posts that announce a new Google service or a new feature and start with "Google has finally". In retrospect, everything seems obvious probably because Google set the bar so high that nothing seems impossible.

#1 "Google has finally launched the long-awaited Lively virtual reality service."

#2 "Google has finally added a link to its privacy policy on its home page."

#3 "Google has finally remembered it has an IM client, releasing a Labs test of a new version of Google Talk."

#4 "Google has finally released its long awaited answer to Amazon's web services."

#5 "Google has finally released a version of its Google Desktop search for Mac OS X users."

#6 "Google has finally enabled offline access to Google Docs using their Google Gears plug-in."

#7 "To google has finally been added to the Merriam-Webster dictionary."

#8 "Google has finally added the long-awaited search box to their popular web-based RSS reader."

#9 "Google has finally come out with Street View."

#10 "Google has finally opened up Orkut subscription for all users."

#11 "Google has finally proved its seriousness about healthcare by opening Google Health release to general public."

#12 "Google has finally launched Google Finance, its Yahoo Finance slayer."

#13 "Google has finally announced its open-source mobile phone software, Android."

#14 "In addition to giving us ever-growing amounts of e-mail space, Google has finally added IMAP access to Gmail."

#15 "Google has finally posted a public message about their new favicon on their official Blog."

#16 "Google has finally released a product/service that is NOT stamped with a 'beta' moniker - Google Checkout."

#17 "Google has finally begun introducing some support for Boolean operators with the addition of an OR operator." (that's from January 2001)

#18 "It may have taken 16 months, but Google has finally done something with its JotSpot acquisition."

#19 "Google has finally announced their long anticipated paypal killer. The name: Google Checkout."

#20 "After gangbuster earnings quarter after quarter, search king Google has finally disappointed Wall Street."

#21 "Google has finally released a beta version of its long-awaited and much anticipated blog search, two years after it acquired the popular Blogger technology."

#22 "Google has finally lifted the invitation-only restriction on opening Gmail accounts."

#23 "Google has finally revealed its hand in the scholarly research market, unveiling a beta search site called Google Scholar."

#24 "Google has finally made another acquisition, and this time, the lucky target was a company known as Jaiku."

#25 "It took nearly a decade, but Internet giant Google is finally honoring Veterans Day with a special holiday design for its famous logo."

How to Install MoonLight

Check the following link to refer the discussion from Mono Olive Group.


Moonlight use Silverlight Plugin in Ubuntu 7.10

Check the following link to know more.


Retreiving Images from Database(BLOB)

I've found this to be very helpful:

It shows how to display the image on page 8. Hope it helps If you still need help, post the structure if your table and how you'd like to show the images to the user (ie, or direct url or what way you'd like to use).

Comparison o Ajax frameworks

Check out the following links



Mac look on Ubuntu

If you need the sounds, you have to take a look at the compiz manager..

Use synaptics (system --> administration --> synaptic)
And search for compiz manager, install it, and find it at (system --> administration --> compiz manager(or something like that))

This will atleast get you in the right direction. There are many plugins and settings you can play around with to make your dekstop look all kinds of awsome. And also check the following links.



Control the panel hiding speed in GNOME

Run gconf-editor and navigate to

"Specifies the number of milliseconds delay after the pointer enters the panel area before the panel is automatically re-shown. This key is only relevant if the auto_hide key is true. "

And of course..

Specifies the number of milliseconds delay after the pointer leaves the panel area before the panel is automatically hidden. This key is only relevant if the auto_hide key is true.

And the same for

Double click a line, change the value and OK it. Change takes effect immediately.

Create your own desktop icons in Ubuntu

Right click on desktop > create launcher > launcher

now on the command bit , type the command as if from terminal.
eg. to make a firefox icon it would be command " firefox "

now the icon

click on the little spring to the left of he window ( where the launcher field is ). Then you need to find the image of the program. You can search for this in the files , however im lazy i just Google the name of the program under images and save the image to the launcher.

Copy the GNOME Default Desktop to another User

Create a new user, configure the desktop as you want it to be and then copy all files (including hidden ones) from that user's home to /etc/skel.

Everything inside /etc/skel should be copied to home directories of all new users. The files in /etc/skel can owned by root, the ownerships and permissions will be handled automatically when the new user is created.

Font Location in Ubuntu

They are in /usr/share/fonts I think, in directories like /usr/share/fonts/truetype/ttf-bitstream-vera.

You can install fonts also in /usr/local/share/fonts, I believe. For a single user they can go in ~/.fonts

Problem with Login in GUI Mode in Ubuntu - Tips

On Debian based distros, changing runlevels from 2 to 5 generally will not help. You need to setup a login manager e.g. gdm to start at boot time. To do this, install the login manager and then run

$ sudo update-rc.d gdm defaults

$ sudo /etc/init.d/gdm start

GDM is controlled in this case by the symlinks in /etc/rc2.d. To disable it, you would run something like this:

$ sudo mv /etc/rc2.d/S21gdm /etc/rc2.d/D21gdm

The "S" tells the system to run the target script, whereas "D" tells it to disable. The number indicates the level of priority given to the script. The only thing you need to change is the letter. Simply change it back to re-enable the display manager.

Which is Faster? KDE 4.1 (or) GNOME - Some Views

KDE is designed to be similar to Windows, and it shows. Gnome is and is designed to be much faster. I don't like KDE much, but I need it for applications that still use it. Unfortunately, KDE 4 was such a different coding than KDE 3 many programs still don't have versions for it, so you end up stuck will all 3. Unless you can't find an alternative, Gnome reigns by far.

Xfce IMO is a superior desktop environment to GNOME. I guess I like the fact that Xfce is modular and I find it more customisable than GNOME. I also prefer it's built in programs - Xfwm is better than Metacity and Thunar is a far better file manager than Nautilus.

KDE4 has a very small memory footprint. Almost as small as XFCE. In time, it should evolve into an extremely good DE, but as of now it lacks some serious functionality as well as not many apps. have been ported over to the new widget set. They need to better optimize the KWIN composition manager as well, because currently Compiz is faster even with minimal effects.

The Programmer's Qiuck Giude to the Languages

The proliferation of modern programming languages (all of which seem to have stolen countless features from one another) sometimes makes it difficult to remember what language you're currently using. This handy reference is offered as a public service to help programmers who find themselves in such a dilemma.

TASK: Shoot yourself in the foot.

C: You shoot yourself in the foot.

C++: You accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical assistance is impossible since you can't tell which are bitwise copies and which are just pointing at others and saying, "That's me, over there."

FORTRAN: You shoot yourself in each toe, iteratively, until you run out of toes, then you read in the next foot and repeat. If you run out of bullets, you continue with the attempts to shoot yourself anyways because you have no exception-handling capability.

Pascal: The compiler won't let you shoot yourself in the foot.

Ada: After correctly packing your foot, you attempt to concurrently load the gun, pull the trigger, scream, and shoot yourself in the foot. When you try, however, you discover you can't because your foot is of the wrong type.

COBOL: Using a COLT 45 HANDGUN, AIM gun at LEG.FOOT, THEN place ARM.HAND.FINGER on HANDGUN.TRIGGER and SQUEEZE. THEN return HANDGUN to HOLSTER. CHECK whether shoelace needs to be re-tied.

LISP: You shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds...

FORTH: Foot in yourself shoot.

Prolog: You tell your program that you want to be shot in the foot. The program figures out how to do it, but the syntax doesn't permit it to explain it to you.

BASIC: Shoot yourself in the foot with a water pistol. On large systems, continue until entire lower body is waterlogged.

Visual Basic: You'll really only _appear_ to have shot yourself in the foot, but you'll have had so much fun doing it that you won't care.

HyperTalk: Put the first bullet of gun into foot left of leg of you. Answer the result.

Motif: You spend days writing a UIL description of your foot, the bullet, its trajectory, and the intricate scrollwork on the ivory handles of the gun. When you finally get around to pulling the trigger, the gun jams.

APL: You shoot yourself in the foot, then spend all day figuring out how to do it in fewer characters.

SNOBOL: If you succeed, shoot yourself in the left foot. If you fail, shoot yourself in the right foot.

UNIX: (The way most UNIX hackers shoot themselves in the foot.)
% ls
foot.c foot.h foot.o toe.c toe.o
% rm * .o
rm:.o no such file or directory
% ls

Concurrent Euclid: You shoot yourself in somebody else's foot.

370 JCL: You send your foot down to MIS and include a 400-page document explaining exactly how you want it to be shot. Three years later, your foot comes back deep-fried.

Paradox: Not only can you shoot yourself in the foot, your users can, too.

Access: You try to point the gun at your foot, but it shoots holes in all your Borland distribution diskettes instead.

Revelation: You're sure you're going to be able to shoot yourself in the foot, just as soon as you figure out what all these nifty little bullet-thingies are for.

Modula2: After realizing that you can't actually accomplish anything in this language, you shoot yourself in the head.

Assembler: You try to shoot yourself in the foot, only to discover you must first invent the gun, the bullet, the trigger, and your foot.

Computer Programming joke

At a computer software course, the participants were divided into programming teams. At the end of the session they were given an awkward question to answer: "If you had just boarded an airliner and discovered that your team of programmers had been responsibled for the flight control software, how many of you would disembark

Among the ensuing forest of raised hands only one person sat motionless. The instructor asked why the lone brave person would be so content to stay on board.

"With my team's software," he reasoned, "the plane would be unlikely to successfully taxi to the runway, let alone take off."

Saturday, 2 August, 2008

Google search in command line

Recently I discovered a web page that provide command line interface for google search, as the author called it as Google Shell. Check out the screenshot, and also try it out at http://goosh.org/.

It does looks like unix-shell, thank to Ajax. You may think that is hilarious, but don’t make judgment before trying it out. For me, that is usable. and I should say that is perfect for CLI hardcore users.

I like google translate command line feature very much. Try this:

guest@goosh.org:/web> translate en de hello
translating "hello" from "english" to "german":


Surprisingly, when you hit tab, it does support auto complete and hitting arrow key up and down support keeping history list.

Linux commands list the processes

top command provides a dynamic real-time view of a running system. It can display system summary information as well as a list of tasks currently being managed by the Linux kernel. But if you want get something more specific, you must play some tricks on it. For example, I want a clean view of top ten busiest processes every seconds without those summary info, how should I do with top?

Batch mode operation
top is a real-time application that keeps display processes info sorted by cpu usage, if you redirects the outputs to a file like command line below, you will having your results mixed with ugly symbols, which is not what you want.

top > top.txt

Well, top support batch mode. By specified top on batch mode, top will display the outputs without arrange the views properly, but if you redirects it to a file, you won’t get those messy symbols mixed up.

top -b > top.txt

I just want to monitor top ten processes every seconds!
You can limits your views of top ten using head and tail, but this will STOP top from continuing to monitor the processes.

top -d 1 | head -n 17 | tail -n 11

Fortunately, we have watch to help, but you needs to put top in batch mode, and also you can ask top to stop after done displaying the result for one time. This will increase the accuracy of the result.

watch -n 1 "top -b -n 1 | head -n 17 | tail -n 11"

Tips on JPA Domain Modelling

1. Put Annotation on Methods, not Attributes
If using annotations on attributes, JPA engine will set directly in the attributes using reflection, hereby by-passing any code in setters and getters. This makes it hard to do extra work in setters and getters, if the need arises.

In addition, if you add a getter for some calculated value which has no corresponding attribute, you can mark it @Transient on the method. Had you been putting it on the attributes, you would have no attribute to put the annotation on.

Whatever you do: Try not to mix, using with annotations both on fields and methods. Some JPA providers cannot handle this!

2. Implement Serializable
The specification says you have to, but some JPA providers does not enforce this. Hibernate as JPA provider does not enforce this, but it can fail somewhere deep in its stomach with ClassCastException, if Serializable has not been implemented.

3. Use The Fine Grained Domain Modelling and Mapping Possibilities in JPA
If coming from EJBs (before EJB3), you are not used to be able to do fine grained modelling. EJB2.x was very entity centric. In JPA, you have @Embeddable and @Embedded. Doing more fine grained domain modelling can help make your domain model more expressive.

An @Embeddable is a value object, and as such, it shall be immutable. You do this by only putting getters and no (public) setters on its class. The identity of a value object is based on its state rather than its object id. This means, that the @Embeddable will have no @Id annotation.

As an example, given the domain class Person:

public class Person implements Serializable {
private String address;

public String getAddress() { return address; }
public void setAddress(String address) { this.address = address; }

We could express Address better, by giving it a class of its own. Not because it should be mapped to some other table, but because it makes sense in this particular model. Like this:

public class Address implements Serializable {
private String houseNumber;
private String street;

public String getHouseNumber() { return houseNumber; }

public String getStreet() { return street; }

public String getAddress() { return street + " " + houseNumber; }

// setter needed by JPA, but protected as value object is immutable to domain
protected void setAddress(String address) {
// do all the parsing and rule enforcement here

public class Person implements Serializable {
private Address address;

public Address getAddress() { return address; }
public void setAddress(Address address) { this.address = address; }

The better expressiveness comes from: a) Putting a named class on a concept in the model and, b) having a place (the value object class) where to put domain logic and enforce domain rules.

4. Implement Equality using Real Domain Attribute Values
Classes marked @Entity will always have an id attribute. Often, this is a long sequence. It can be tempting to use this value when implementing equals and hashCode (which is also a requirement), but I recommend against it. I can find two good reasons: One based on modelling rules and one based on technical terms.

* Modelling rule: A class modelled as an entity should be uniquely distinguishable from other instances, solely based on a combination of some of its domain attributes. A long sequence, used solely to obtain relational identification, does not constitute a domain attribute. If you are unable to find a unique combination, it might very well be a sign of a problem with the model.
* Technical term: If equality is based on a database generated and assigned value, you will not be able to use equals and hashCode before an instance has been persisted. That includes putting the instance into container classes, as they rely on equals and hashCode.

5. Protect the Default Constructor
The JPA specification mandates a default constructor on mapped classes, but a default constructor seldom makes sense in modelling terms. With it, you would be able to construct an entity instance with no state. A constructor should always leave the instance created in a sane state. The requirement for the default constructor is only to make dynamic instantiation of instances of the class possible by the JPA provider.

Luckily, you can, and are allowed to, mark the default constructor as protected. Hibernate will even accept it as private, but that is not by the spec.

6. Protect Setter Method on Id Attribute
Basically the same story as above. In this case, it is just because it makes no sense for the application to assign an id.

NOTE: This is only for when the id attribute is marked as assignable by the provider.

7. Avoid Primitives when Mapping Id Attribute
Simply use Long and not long. This makes it possible to detect a not yet set value by testing for null. If using Java5 or above, auto-boxing should take away the pain.

8. Use the Basic Annotation to Override Defaults
By all means, use @Basic to override the default true value of optional to false, for those fields that are not actually optional (I often find that to be most of my attributes).

9. Go Ahead and Use the Column Annotation
Even if you are not interested in generating a schema or DDL from it, you should not hold back on using the @Column annotation. It tells the reader of the code about important information related to the attribute. This is stuff like nullability, length, scale and precision.

10. Do Not Use java.sql.Date/java.sql.Timestamp in Domain Model
Instead, use java.util.Date or java.util.Calendar. Using the types from the java.sql package is a leakage of concerns into the domain model, that we do not want, nor need.

Just remember to put @Temporal on date and calendar attributes.

Reviews about IT companies and products

This blog is about new technologies, news from Cyberworld, new products and softwares, hardwares, gadgets. Reviews and opinions about IT companies and products. All the "tech-nicks" that you need to know about Cyberworld.


Photoshop Tutorial

Photoshop is a standard name in graphic design for web use, print layout, and more. Recognized world-wide as the industry-standard, Photoshop offers one of the most robust graphics editing experiences available. Learn tips and tricks, cool effects, and how to use the Photoshop tools more effectively.


Cell Rater

The Ultimate Guide to cellphones. Why settle for one of the half dozen phones offered by your mobile carrier? There are hundreds of phones all over the world compatible with your service, and you don't have to lock yourself into a contract. Cell Rater brings some of the worlds most exclusive handsets to you with the latest news and detailed reviews.


Windows Vista Recovery Disk

So, you have just purchased a new PC and you finally have Windows Vista! I'll bet you got a great deal as well from one of the major manufacturers. Unfortunately, as much as every manufacturer attempts to be different and better than the competition, they all have one thing in common. One thing missing actually. None of these PC and laptop manufacturers provide you a real Windows Vista installation or recovery CD with your purchase. Instead, they bundle what is referred to as a "recovery disc" (that is if you're lucky - in many instances, you are only offered a a recovery partition) with your machine and leave it at that. The recovery partition will recover your system to factory settings, if need be.

It doesn't matter that you just paid a thousand dollars for a machine that comes with a valid Windows Vista license - computer manufacturers and Microsoft shift the onus to the consumer. it is your responsibility to backup your data and make the required recovery cd's. Manufacturers simply provide the means to do so through a create recovery disk utility in Windows Vista. OK, in all honesty, maybe they have a point, but really, how much does a recovery dvd cost the manufacturer in the overall price of the PC or laptop? Ever heard of common courtesy, or just a nice thing to do?

The problem is, with Windows Vista, the installation media serves dual purposes. It is not just a means to get Windows Vista installed, but also the only way of recovering a damaged installation. The Windows Vista DVD has a "recovery center" that provides you with the option of recovering your system via automated recovery (Vista searches for problems, and attempts to fix them automatically), rolling-back to a previous system restore point, recovering a full PC backup, or accessing a command-line recovery console for advanced recovery purposes.

Microsoft seems to have realized this problem, and have thankfully made a recovery disc for this purpose. The recovery disk contains the contents of the Windows Vista DVD's "recovery center," It cannot be used to install or reinstall Windows Vista, and just serves as a Windows PE (bare bones) interface to recovering your PC.

Just burn with a program such as Nero, onto a CD or DVD, and then boot into it with your PC!

Download the cd:

Solar Powered Video Game Chargers

Are you looking for an easy way to keep your handheld gaming system powered up when your on the go? Look no further than the Solio line of hybrid solar chargers. These three units allow you to plug into the sun and with the appropriate tip charge your Gameboy Advance, Nintendo DS, or PSP. The chargers range in price from $79-199, and the gaming tips are available for all three models for just $9.95.

In addition to lengthening your on the go gaming session, the Solio chargers also help you lower your carbon footprint. Over the next five years, the US will import and use over 2.5 billion chargers for handheld electronics. These chargers will create a total of 9 billion kilograms of carbon - equivalent to the pollution created by five year's-worth of driving by 1.8 million American cars.

Monday, 28 January, 2008

Greasemonkey Script - Integrate Gmail and Google Calendar

Visit the following link

Internet Cookies

Netscape developed cookies. They did so as a means to store "state-related" (a programming term) and other information in a persistent manner. The information in a cookie survives after you disconnect from the remote server. When you connect again, that server can look up the cookie. Cookies work with CGI (Common Gate Interface) programs that reside on the remote server.

When a browser requests a URL (Uniform Resource Locator) from a remote server, the browser first searches a cookies file to see if any of that file's cookies match the URL it's requesting. The browser then sends, as part of the URL request, the remote server information contained in the matching cookie(s). Cookies allow CGI programs to store information on your computer instead of the remote one.

A cookie is a HyperText Transfer Protocol (HTTP) header that consists of a text-only string. Your browser stores this text string in its memory when called upon. This string contains the domain, path, lifetime, and value of a variable. That variable is something a CGI script is looking for--your e-mail address, what site you came from to get to the remote server, what browser you are using, or what operating system you run. A server can get all of this information without cookies, but doing so slows the server down. This is the only information a cookie can contain, unless you fill out a form that explicitly adds other information or the remote server sends you a cookie with information it added--such as a shopping cart ID number. A cookie cannot and does not scan your hard drive.

How To Protect Yourself Against Computer Crashes

To prevent crashes, you need to look at your whole system. Here are key areas to look at.

Operating system. If you have a wintel (Windows/Intel) machine, you have a choice of two operating systems. Those are DOS (which is the underlying OS of WinCRASH--oops, I mean Windows 95, Windows 98, and Windows Me) and Windows NT (NT, 2k, XP).

There is no reason to run Windows 9x on any computer that is less than 2 years old, unless you are running the older game CDs or a laptop that is low on RAM. The false argument that NT costs more conveniently ignores many things, such as the fact you must buy quite a few third party programs to put the missing pieces into Windows 9x, while with NT these pieces are built-in.

RAM. Anything less than 64 MB of RAM, and you'll be dipping into your "virtual RAM," which runs about one 1,000 as fast as your RAM. This means longer execution cycles, timing problems, logjams on your bus, and more crashes.

Bad RAM. Hey, it's always possible. Pay attention to that RAM test when you boot up.

Hard drives. It's best to have your program files on one physical drive, your temporary files and pagefile on a second, and your data files on a third. However, dual-drive machines are far more common than triple-drive machines, and single-drive (ugh!) machines are even more common, still. If you have a single-drive machine, buy an extra hard drive, and partition it so you can devote 1 GB to temp files and another GB to your page file. This will dramatically speed up your machine, and it will reduce crash frequency, too. Keep your hard drives defragmented. How often should you defragment? Run defragmentation at least once a week. If you recently deleted many files, run it again.

Run Scandisk or some other similar hard drive utility to check for bad sectors on your drive(s). These cause crashes, too. Scandisk will also check for lost clusters. Choose the delete option.

Drive organization. Tons of temp files, too many files in your root directory, and the default "keep my frequently-changing files in the same folder as my operating system files" all cause crashes. Relocate your user Profiles, Favorites, Temp, Temporary Internet, and other such files to their own partition or at least their own folder. Go into regedit and change from C:\WINNT or C:\Windows as the default to something like C:\Mystuff or C:\0me.

Long filenames for folders or directories. Microsoft won't tell you this, but they don't support long filenames, even in NT, as seamlessly as they would have you believe. Go beyond 8 characters, and you increase the likelihood of a crash because the resources required to read even one extra character are more than what it takes to read the first 8!. Change Program Files to Programs, and you are on your way to better computing. This can be a hassle, though, because not all of your shortcuts, macros, etc., will respond to Explorer's name change utility. So, this is a "choose your poison" strategy that you should employ only when you want the ultimate in speed an reliability from your machine.

Cheap parts. Buy parts that carry NT certification. Period.

Screen savers. These don't save your screen, but they do induce crashes by hogging resources. You can choose between cute and functional--it's your computer. However, screen savers and crashes go hand in hand. If you are just dead set on a screen saver, at least avoid the kind that allow you to run text banners. These use highly complex algorithms that place a huge drain on your system.

Power glitches. What? You don't have a UPS? I'm not talking about one of those $12 surge strips. Get a battery backup unit, like the kind made by APC, Best Power, or other major names. I use a 1 kVA APC unit for my PC, but a unit a fourth of that size is sufficient. The cost is not much. Make sure you provide surge protection for data lines (such as phone lines going to your modem).

What to do about frequent crashes. Keep notes on what you did just before a crash. If a single program makes you crash, manually uninstall it (run regedit), and then see if your crashes go away. If they do not, then it may be because this program loaded in DLLs that aren't quite right for your system. To cure that, you may have to do a repair reinstall of your operating system and the latest service pack. Good luck.

If your computer makes a clunking sound and then crashes, you have hard drive control or physical hard drive problems. The cure is to reload your operating system, minus any service packs, and disable all TSRs (terminate and stay resident programs, such as screen savers and various utilities). Then, over a period of several user sessions, add in service packs and utilities. Forget the screen saver.

Taking a look at Vista

Traditionally Microsoft software has ignored the fact other operating systems exist. Installing Windows will usually attempt to destroy any other non-Windows partitions, in a Darwineque way, and Windows certainly doesn’t come with anything like a boot manager that lets you select alternative operating systems (although it does offer a boot manager that lets you switch between versions of Windows installed on the disk).

Out in the real world Microsoft is making moves towards opening up and allowing competition. Is there evidence of that in Vista? While it might be a pipe dream to expect Vista to interoperate with other operating systems, is there evidence of toleration of other operating systems?

Of course not.

The installation partitioning tool identifies Linux partitions on the disk but isn’t quite sure what to do with them. It doesn’t identify them by name or file system but simply assigns them a number. But, for that matter, the partitioning tool doesn’t even identify existing NTFS partitions by name or file system. It’s not a particularly helpful piece of software.

Any changes you make to the partition system at this stage are carried out instantly. If you expect to make changes and then be asked to confirm them later, as with practically all Linux installation routines, then you’re in for a shock. There’s no room to experiment with different partition setups.

I installed Vista on a notebook computer that had Ubuntu Dapper installed as its main OS, alongside Windows XP Home. Did Vista install a boot loader that let me boot into my choice of operating systems? Of course not. The boot menu identified Windows XP on the same machine as an “Earlier version of Windows”, indicating a weird kind of snobbishness toward all other non-Vista OSes. Ubuntu definitely wasn’t on the list. To restore my ability to boot into it I’m going to have to reinstall GRUB from a rescue disc.

How about within Computer (aka “My Computer” in earlier versions of Windows). Once Vista was up and running, did it identify the ext3 partition? Did it, gulp, install file system drivers so I could access the contents of my ext3 file systems?

You know the answer.

It looks like the same-old Disk Management snap-in is available from the Computer Management console. As with Windows XP, this merely identified the ext3 and Linux swap partitions as “Healthy”, and reported then to be 100% free.

I’m not sure what excuse Microsoft offers for this lack of functionality. The main open source file systems are extremely established and popular, especially on servers. It wouldn’t be a huge task for Microsoft to provide rudimentary access, even if it’s simply read-only.

In some ways I’m not surprised. I know the nature of Microsoft. But if I ignore this, and pretend for a moment that I’ve no idea of how Microsoft operates, then it’s actually quite shocking that Vista doesn’t interoperate at all with other operating systems. Why not? Doesn’t Microsoft want its product to appeal to a sizable section of users, on the desktop and server, who use Linux?

Over the next few days and weeks I’ll examine more of how Vista interoperates with Linux (and vice versa), so check back. I’m also going to take a look at some of Vista’s features compared to Linux alternatives.

Windows keyboard shortcut: New folder

Because Windows’ console interface is pathetic, users having Linux experience often find having to use the GUI makes even the most menial tasks a cumbersome process. Case-in-point: creating a directory. Having had enough of guiding the mouse pointer through the maze of context menus, I did some research and figured out a very easy keyboard sequence:

Shift + F10, w, f

“Shift + F10” opens the context menu, “w” takes you to the New directory, and “F” creates the directory!

Tuesday, 22 January, 2008

GNU C __attribute__ format

This __attribute__ allows assigning printf-like or scanf-like characteristics to the declared function, and this enables the compiler to check the format string against the parameters provided throughout the code. This is exceptionally helpful in tracking down hard-to-find bugs.

There are two flavors:

* __attribute__((format(printf,m,n)))
* __attribute__((format(scanf,m,n)))

but in practice we use the first one much more often.

The (m) is the number of the "format string" parameter, and (n) is the number of the first variadic parameter. To see some examples:

/* like printf() but to standard error only */
extern void eprintf(const char *format, ...)
__attribute__((format(printf, 1, 2)));
/* 1=format 2=params */

/* printf only if debugging is at the desired level */
extern void dprintf(int dlevel, const char *format, ...)
__attribute__((format(printf, 2, 3)));
/* 2=format 3=params */

With the functions so declared, the compiler will examine the argument lists

$ cat test.c
1 extern void eprintf(const char *format, ...)
2 __attribute__((format(printf, 1, 2)));
4 void foo()
5 {
6 eprintf("s=%s\n", 5); /* error on this line */
8 eprintf("n=%d,%d,%d\n", 1, 2); /* error on this line */
9 }

$ cc -Wall -c test.c
test.c: In function `foo':
test.c:6: warning: format argument is not a pointer (arg 2)
test.c:8: warning: too few arguments for format

Note that the "standard" library functions - printf and the like - are already understood by the compiler by default.

RPython can be faster than C

Check out the following link


Monday, 21 January, 2008

Connect T-Mobile Wireless Internet Through Your Cell Phone

You can find a hardcopy of this walk through on my blog at this location.

I recently took on the challenge of getting an old PC up and running with Xubuntu 7.10. My father recently purchased the T-Mobile Internet package, which allows him to connect his computer to unlimited mobile Internet for $20 a month. Setting this up proved to be easier than I anticipated.

1. The first thing you need to do is change the USB configuration in your phone. On my phone (a Motorola K1) and many other T-Mobile phones, you have to change your USB configuration: make your default USB connection a data connection. By default, most phones are configured to be in “Memory Card” mode.
2. Next, you need to install a piece of software in Ubuntu called “wvdial”. To do this, click on Applications>Accessories>Terminal. Once your terminal window is open, type in the following:

sudo apt-get install wvdial

3. Edit your wvdial.conf file. Type

sudo gedit /etc/wvdial.conf

in a terminal window to do this.

Once you have your wvdial.conf file open, paste in the following text over all the contents of the file:


[Dialer Defaults]
Init1 = AT+CGDCONT=1,”IP”,”wap.voicestream.com”
Modem Type = USB Modem
Phone = *99#
Password = pass
Username = user
Modem = /dev/ttyACM0
Baud = 460800

Take note of the “ttyACM0″ part. This may not be the same on your PC. To find out what yours is, attach your phone to your PC, and then type the following into the terminal:


dmesg | fgrep acm

You should see something like this returned in the output:

[ 9168.949496] cdc_acm 2-3:1.0: ttyACM0: USB ACM device

This ACM device is your phone, and it is now an accessible piece of hardware. For wvdial to use it, you must make sure the above configuration file points wvdial to the right device name. If the above dmesg output produces a different ttyACM#, change it accordingly to match your PC. (Note, if you don’t get any dmesg results at all, try typing this in first: sudo modprobe cdc_acm).

After your wvdial.conf file is created and your sure your Modem = /dev/tty line is correct, save the file and close gedit. Then simply run wvdial from the terminal:

$ wvdial

Wvdial will then access your phone as it is directed to do so by the wvdial.conf file, and essentially dial T-mobiles Internet Service Provider. No real username or password is required for this, so leave the user/pass in the above config file as it is written. You’ll see some output on the screen that looks like this:

user@user-desktop:~$ wvdial
WvDial<*1>: WvDial: Internet dialer version 1.56
WvModem<*1>: Cannot get information for serial port.
WvDial<*1>: Initializing modem.
WvDial<*1>: Sending: AT+CGDCONT=1,”IP”,”wap.voicestream.com”
WvDial Modem<*1>: AT+CGDCONT=1,”IP”,”wap.voicestream.com”
WvDial Modem<*1>: OK
WvDial<*1>: Modem initialized.
WvDial<*1>: Sending: ATDT*99#
WvDial<*1>: Waiting for carrier.
WvDial Modem<*1>: ATDT*99#
WvDial Modem<*1>: CONNECT
WvDial<*1>: Carrier detected. Waiting for prompt.

At this point, the program will pause as it handshakes and establishes a connection using PPP. After about 10 or 20 seconds, the output will continue on and look similar to this:

WvDial: Don’t know what to do! Starting pppd and hoping for the best.
WvDial: Starting pppd at Thu Jan 17 17:50:28 2008
WvDial: Warning: Could not modify /etc/ppp/pap-secrets: Permission denied
WvDial: –> PAP (Password Authentication Protocol) may be flaky.
WvDial: Warning: Could not modify /etc/ppp/chap-secrets: Permission denied
WvDial: –> CHAP (Challenge Handshake) may be flaky.
WvDial: Pid of pppd: 13530
WvDial<*1>: Using interface ppp0
WvDial<*1>: pppd: ?06][08]?06][08]??[06][08]
WvDial<*1>: pppd: ?06][08]?06][08]??[06][08]
WvDial<*1>: pppd: ?06][08]?06][08]??[06][08]
WvDial<*1>: pppd: ?06][08]?06][08]??[06][08]
WvDial<*1>: pppd: ?06][08]?06][08]??[06][08]
WvDial<*1>: local IP address
WvDial<*1>: pppd: ?06][08]?06][08]??[06][08]
WvDial<*1>: remote IP address
WvDial<*1>: pppd: ?06][08]?06][08]??[06][08]
WvDial<*1>: primary DNS address
WvDial<*1>: pppd: ?06][08]?06][08]??[06][08]
WvDial<*1>: secondary DNS address
WvDial<*1>: pppd: ?06][08]?06][08]??[06][08]

Congrats! You are now connected to the Internet using your cellphone. And all you have to do to establish a connection is open a terminal window and type wvdial.

To end your connection, you can simply close the terminal window containing the above mess, or hit CTRL-C while the terminal window is open. So be careful and don’t close the window by accident, or your connection will be dropped and you’ll have to run wvdial all over again. Oh, the agony of typing that one command over again!!

Anyway, enjoy your T-Mobile Wireless Internet connection! You should see a steady downstream of about 20 to 30 KB per second, which is about 5 times faster than dial up. And it’s unlimited! It’s not DSL or Cable, but that’s still not a bad deal for 20 bucks a month.

Sopcast in Ubuntu

1) Download this, untar it and place sp-sc into /usr/local/bin/ :http://download.sopcast.org/download/sp-sc.tgz

2) Download the gtk-sopcast.deb and use gdebi to install it.

That should work out of the box. MPlayer wouldnt work for me, it may for others, but Kaffeine worked perfectly.


With AllTray you can dock any application with no native tray icon (like Evolution, Thunderbird, Terminals) into the system tray. A high-light feature is that a click on the "close" button will minimize back to system tray. It works well with Gnome, KDE, XFCE 4*, Fluxbox* and WindowMaker*

But, there is no drag 'n drop support .


Are You Ready For Blu-Ray?

A Beta version of CyberLink’s BD/HD DVD Advisor has been made available for free download from their website. The diagnostic software analyses system resources to check if they will be able to support playback of the next-generation discs, and recommends upgrades or troubleshooting support if the PC isn’t up to scratch.
Among the components it checks the capabilities of are the processor, graphics card, Blu-ray/HD DVD drive, system memory, operating system and playback software. To find out more, or to download the software, head over to www.cyberlink.com.

Running Windows, Linux And Mac Operating Systems

Avanquest UK has launched a virtual desktop product (created by Parallels Inc) that’ll allow you to run different operating systems and applications alongside Mac OS. Intel processor-based Apple Macs will therefore be able to run Windows, Linux and most other applications in Mac OS X without needing to reboot. Files will be shareable between Windows XP/2000 and Mac OS X by just copying and pasting them, which is useful.

Desktop for Mac will also come with Parallels’ Compressor, which allows Windows 2000, 2003 and XP virtual machines’ hard drive space to be reduced by 50% of more, so that Desktop for Mac isn’t constrained by memory and space requirements.


Sunday, 20 January, 2008

PowerTOP - Power Saver for GNU/Linux

Computer programs can make your computer use more power. PowerTOP is a Linux tool that helps you find those programs that are misbehaving while your computer is idle. The application that misbehaved the most was the Linux kernel. However, as of version 2.6.21, the Linux kernel went tickless, and no longer has a fixed 1000Hz timer tick. The result (in theory) is huge power savings because the CPU stays in low power mode for longer periods during system idle.

However... there are many things that can ruin the party, both inside the kernel and in userspace. PowerTOP combines various sources of information from the kernel into one convenient screen so that you can see how well your system is doing at saving power, and which components are the biggest problems.

PowerTOP has these four basic goals:

* Show how well your system is using the various hardware power-saving features
* Show you the culprit software components that are preventing optimal usage of your - hardware power savings
* Help Linux developers test their application and achieve optimal behavior
* Provide you with tuning suggestions to achieve low power consumption


Switch between RDP and Desktop in Ubuntu

In most of the time, we use RDP in full screen mode, But,sometimes we have problem with minimizing the remote screen.
But, CTRL-ALT-ENTER key combination will help us to make the RDP terminal full screen to windowed mode. So that we can work with the desktop machine also.