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.



http://geekybits.blogspot.com/2007/07/ubuntu-tip-turning-off-tooltips.html

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

www.KDE-Look.org


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

to

/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++

http://www.functionx.com/cpp/



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

#gdm


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>

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

Different Type of Font Sizes are listed below

xx-small
x-small
small
medium
large
x-large
xx-large

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

http://www.456bereastreet.com/lab/styling-form-controls-revisited/text-input-single/


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.

http://groups.google.com/group/mono-olive/msg/d8350f66ce587c1c

Moonlight use Silverlight Plugin in Ubuntu 7.10


Check the following link to know more.

http://www.nino-net.org/2008/05/moonlight-use-silverlight-plugin-in-ubuntu-710/

Retreiving Images from Database(BLOB)


I've found this to be very helpful:
http://www.phpriot.com/articles/images-in-mysql

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


http://www.tutorialspoint.com/prototype/prototype_overview.htm

http://en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks

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.

https://launchpad.net/awn/

http://code.google.com/p/avant-window-navigator/
http://maketecheasier.com/turn-your-...rd/2008/07/23/

Control the panel hiding speed in GNOME

Run gconf-editor and navigate to
/apps/panel/toplevels/top_panel_screen0/unhide_delay

"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..
/apps/panel/toplevels/top_panel_screen0/hide_delay

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
/apps/panel/toplevels/bottom_panel_screen0/unhide_delay
/apps/panel/toplevels/bottom_panel_screen0/hide_delay

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
immediately?"

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":

"hallo"


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:

@Entity
public class Person implements Serializable {
...
private String address;

@Basic
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:

@Embeddable
public class Address implements Serializable {
...
private String houseNumber;
private String street;

@Transient
public String getHouseNumber() { return houseNumber; }

@Transient
public String getStreet() { return street; }

@Basic
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
}
}

@Entity
public class Person implements Serializable {
...
private Address address;

@Embedded
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.

http://codevalley.blogspot.com


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.

http://pisiform.blogspot.com



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.


http://www.cellrater.com


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:
Vista.part1.rar
Vista.part2.rar

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.