Tuesday, March 22, 2011

How to log as root user in ubuntu

  • Open Console
  • #1.This steps are set the root password! but alrady you know root password skip it and goto #2.
  • type sudo su
  • type User password
  • type Confirm Password
  • #2. This steps are to log as root user mode on console
  • Type su in console and it will ask password for root user.then enter above password and hit Enter!

Monday, March 21, 2011

Windows 7 Cool Keyboards shortcuts

This article talks about 15 really cool keyboards shortcuts that are specific to Windows 7. I can bet that you don’t know all of them. Check them out, some of them will surprise you for sure.

1. Ctrl+Shift+N to Create a New Folder

Create a new folder with a shortcut key
Creating a new folder in Windows explorer is something we all need to do on a frequent basis. And until now, there was no default shortcut key available for this task. But Windows 7 changed that.
You could now use Ctrl+Shift+N to quickly create a new folder in Windows or anywhere on your computer where a folder can be created.

2. Ctrl+Shift+Click to Open a Program As Administrator

run as administrator
There are many instances when just clicking on the icon of the application and opening it doesn’t solve your purpose. You need to right click on it and click on “Run as Administrator” so that you can make the required changes to the app.
In Windows 7, this can be done with a keyboard shortcut. You just need to point your mouse cursor on that program and then click on it while pressing Ctrl+Shift keys to open it as administrator.

3. Shift+Right-Click Enhances Send to Menu

send to menu
The above screenshot shows the default send to menu that I get when I simply right click on a program.
Now, if I press the Shift key, and while having it pressed, I right click on the icon, I get an enhanced send to menu. See the screenshot below to check how it looks.
send to menu enhanced
Nice, isn’t it?
Also check 2 Useful Tools To Add Items & Customize the Windows Right Click Menu.

4. Shift+Right-Click on a Folder to Open Command Prompt

open command windows
If you do Shift+right-click on a folder, you’ll find an option that says “Open command windows here.” If you love working with the command prompt, this option should come in handy.

5. Win+Space to Quickly Show Desktop

Remember our quick tip on hiding open windows in windows 7 ? Well, this is the keyboard shortcut version of that mouse cursor trick. Pressing the Win key and the space bar simultaneously shows you the desktop immediately.

6. Win+Up/Down/Left/Right for Moving the Active Window

Create a new folder with a shortcut key
If you intend to quickly move the active window to make space for other apps, you could do that by using the Win key and one of the arrow keys. Each arrow key would move the window in the direction it is meant to.

7. For Dual Monitors: Win+Shift+Left Arrow Key to Move Active Window to Left Monitor

If you are on a dual monitor setup using Windows 7 then you could press the Win+Shift+Left arrow key combination to move the active application window to the left monitor.

8. For Dual Monitors: Win+Shift+Right Arrow Key to Move Active Window to Right Monitor

Similarly, if you need to move the current window to the right monitor screen, just press Win+Shift+right arrow key.

9. Win+T to Get to Taskbar Items

windows 7 taskbar
You could use the key combination Win+T to toggle through the applications pinned on the taskbar in Windows 7.

10. Shift+Click on a Taskbar App to Open a New Instance of the App

Let’s say you’ve got a bunch of Chrome windows open. And you need to quickly open a new blank window of the browser. Here’s the way – point your cursor to the chrome icon on the taskbar, hit Shift and click on it. There you go!

11. Win+B to Move Focus to the System Tray

system tray
In a previous article, we talked about a technique to add more clocks to the default Windows clock in the system tray. Now, if you need to get there without using your mouse cursor, how’d you do that?
Answer – Win+B. That would move the focus on the system tray, and then you could use the arrow keys to cycle through the items, including the Windows clock.

12. Win+P for Quickly Connecting Your Laptop to a Projector

projection menu windows 7
Windows 7 has a nifty projection menu feature which enables you to quickly connect your laptop to a projector or an extended monitor. Win+P is the keyboard shortcut for that purpose.

13. Win+1, Win+2..so on for Opening Taskbar Programs

Want to quickly open a program that’s pinned to your Windows 7 taskbar? You can press the Win key and the number corresponding to the location of the app on the taskbar.

14. Win+Pause helps you check System Properties

system properties
Need to take a quick look at what’s the processor model you are using, or may be check the device manager, or advanced system settings? You could use Win+pause key combination to open the system properties window.

15. Ctrl+Shift+Esc Can Quickly Windows Task Manager

I think this was in Vista too, I am not sure. But it’s a cool shortcut nevertheless. Just press the Ctrl key, Shift key and the ESC key simultaneously and you have the task manager pop up right in front!
So that was about the amazing Windows 7 keyboard shortcuts. I hope you find them useful. In fact, learn them if you are on Windows 7. That’s what I did and it has helped a great deal. If I’ve missed a cool shortcut, do share that in the comments.
Now, if you are on Windows XP, and would love to get some these shortcuts that are relevant to XP, we’ll have you covered tomorrow. We will tell you how you could get some of the above shortcuts working on XP. Stay tuned!

Friday, March 18, 2011

JavaScript ‘new’ Gotchas

JavaScript ‘new’ Gotchas

In my previous post, we looked at JavaScript’s this statement and how it can change depending on the context of the function call. Today, we’ll examine several situations where this could catch you out…
1. Forgetting ‘new’

Consider the following code:


window.WhoAmI = "I'm the window object";
function Test() {
this.WhoAmI = "I'm the Test object";
}
var t = Test();
alert(window.WhoAmI); // I'm the Test object
alert(t.WhoAmI); // t is undefined

What we really meant is:

var t = new Test();

The omission of the new statement gave us undesirable results. Other languages would throw an error when faced with a direct call to a constructor but JavaScript simply treats it like any other function call. this is taken to be the global window object and no value is returned from Test() so t becomes undefined.

This situation can be fixed if you’re writing a JavaScript library for third-party developers. Refer to Fixing Object Instances in JavaScript.
2. Module madness

This one will give you a headache. Examine the following code which uses a module pattern:


window.WhoAmI = "I'm the window object";
var Module = function() {
this.WhoAmI = "I'm the Module object";
function Test() {
this.WhoAmI = "I'm still the Module object";
}
return {
WhoAmI: WhoAmI,
Test: Test
};
}();
alert(Module.WhoAmI); // I'm the Module object
alert(window.WhoAmI); // I'm the Module object
Module.Test();
alert(Module.WhoAmI); // I'm still the Module object

The code looks logical — so why is window.WhoAmI saying it’s the module object?

We need to remember that we have a self-executing function. It’s results are returned to the Module variable but, when it’s first run, Module doesn’t exist. this is therefore the global window object. In other words, this.WhoAmI = window.WhoAmI = "I'm the Module object".

The function returns a JavaScript object with a WhoAmI property with a value of 'WhoAmI'. But what does that refer to? In this case, the JavaScript interpreter works up its prototype chain until it magically finds window.WhoAmI ("I'm the Module object").

Finally, we run the Test() method. However, Module has now been created so, within the Test function, this refers to the Module object so it can correctly set the WhoAmI property.

In summary, avoid using this within a module to refer to the module itself! You should never need it.
3. Method misconceptions

Here’s another JavaScript pattern which will screw with your synapses:


var myObject = {};
myObject.method = function() {
this.WhoAmI = "I'm myObject.method";
function Test() {
this.WhoAmI = "I'm myObject.method.Test()";
}
Test();
return this.WhoAmI;
};
alert(myObject.method()); // I'm myObject.method

In this example, Test() is a private function executed within myObject.method(). At first glance, you would expect this within Test() to reference myObject. It doesn’t: it refers to the global window object since it’s just another function.

If you want to reference myObject within the private function, you’ll require a closure, for example:


var myObject = {};
myObject.method = function() {
this.WhoAmI = "I'm myObject.method";
var T = this;
function Test() {
T.WhoAmI = "I'm myObject.method.Test()";
}
Test();
return this.WhoAmI;
};
alert(myObject.method()); // I'm myObject.method.Test()

4. Referencing methods

Here’s a little code which, fortunately, will work exactly as you expect:


var myObject = {};
myObject.WhoAmI = "I'm myObject";
myObject.method = function() {
this.WhoAmI = "I'm myObject.method";
};
// examine properties
alert(myObject.WhoAmI); // I'm myObject
myObject.method();
alert(myObject.WhoAmI); // I'm myObject.method

Let’s make a minor change and assign myObject.method to another variable:


// examine properties
alert(myObject.WhoAmI); // I'm myObject
var test = myObject.method;
test();
alert(myObject.WhoAmI); // I'm myObject

Why hasn’t myObject.WhoAmI changed? In this case, the call to test() acts like a regular function call so this refers to the window object rather than myObject.

If you think that’s nasty, wait until we take a look at JavaScript event handlers in my next post!

What is ‘this’ in JavaScript?

What is ‘this’ in JavaScript?


JavaScript is a great programming language. That would have been a controversial statement a few years ago, but developers have rediscovered its beauty and elegance. If you dislike JavaScript, it’s probably because:

* You’ve encountered browser API differences or problems  which isn’t really JavaScript’s fault.

* You’re comparing it to a class-based language such as C++, C# or Java and JavaScript doesn’t behave in the way you expect.

One of the most confusing concepts is the ‘this’ keyword. In most languages, ‘this’ is a reference to the current object instantiated by the class. In JavaScript, ‘this’ normally refers to the object which ‘owns’ the method, but it depends on how a function is called.

Global Scope

If there’s no current object, ‘this’ refers to the global object. In a web browser, that’s ‘window’ the top-level object which represents the document, location, history and a few other useful properties and methods.

view plainprint?


1. window.WhoAmI = "I'm the window object";
2. alert(window.WhoAmI);
3. alert(this.WhoAmI); // I'm the window object
4. alert(window === this); // true


window.WhoAmI = "I'm the window object";
alert(window.WhoAmI);
alert(this.WhoAmI); // I'm the window object
alert(window === this); // true


Calling a Function


‘this’ remains the global object if you’re calling a function:
view plainprint?

1. window.WhoAmI = "I'm the window object";
2. function TestThis() {
3. alert(this.WhoAmI); // I'm the window object
4. alert(window === this); // true
5. }
6. TestThis();


window.WhoAmI = "I'm the window object";

function TestThis() {
alert(this.WhoAmI); // I'm the window object
alert(window === this); // true
}

TestThis();

Calling Object Methods


When calling an object constructor or any of its methods, ‘this’ refers to the instance of the object much like any class-based language:

view plainprint?


1. window.WhoAmI = "I'm the window object";
2. function Test() {
3. this.WhoAmI = "I'm the Test object";
4. this.Check1 = function() {
5. alert(this.WhoAmI); // I'm the Test object
6. };
7. }
8. Test.prototype.Check2 = function() {
9. alert(this.WhoAmI); // I'm the Test object
10. };
11. var t = new Test();
12. t.Check1();
13. t.Check2();


window.WhoAmI = "I'm the window object";
function Test() {
this.WhoAmI = "I'm the Test object";
this.Check1 = function() {
alert(this.WhoAmI); // I'm the Test object
};
}


Test.prototype.Check2 = function() {
alert(this.WhoAmI); // I'm the Test object

};
var t = new Test();
t.Check1();
t.Check2();

Using Call or Apply

In essence, call and apply run JavaScript functions as if they were methods of another object. A simple example demonstrates it further:

view plainprint?


1. function SetType(type) {
2. this.WhoAmI = "I'm the "+type+" object";
3. }
4. var newObject = {};
5. SetType.call(newObject, "newObject");
6. alert(newObject.WhoAmI); // I'm the newObject object
7. var new2 = {};
8. SetType.apply(new2, ["new2"]);
9. alert(new2.WhoAmI); // I'm the new2 object


function SetType(type) {
this.WhoAmI = "I'm the "+type+" object";
}
var newObject = {};
SetType.call(newObject, "newObject");
alert(newObject.WhoAmI); // I'm the newObject object
var new2 = {};
SetType.apply(new2, ["new2"]);
alert(new2.WhoAmI); // I'm the new2 object


The only difference is that ‘call’ expects a discrete number of parameters while ‘apply’ can be passed an array of parameters.


Thursday, March 17, 2011

Winamp Pro 5.61 Portable Free Download

Winamp Pro 5.61 Build 3133 Final Multilanguage Portable


Winamp Pro 5.61 Build 3133 Final Multilanguage Portable | 18.2 Mb

Nullsoft Winamp Pro is a fast, flexible, high-fidelity media player for Windows. Winamp supports playback of many audio (MP3, OGG, AAC, WAV, MOD, XM, S3M, IT, MIDI, etc) and video types (AVI, ASF, MPEG, NSV), custom appearances called skins (supporting both classic Winamp 1.x/2.x skins and Winamp 3 freeform skins), audio visualization and audio effect plug-ins (including two industry dominating visualization plug-ins), an advanced media library, Internet radio and TV support, CD ripping, and CD burning..

uTorrent Remote Control

Remote Controll Your uTorrent Clinet!

* To install the WebUI, after configuring it with the instructions in the section below, simply visit the WebUI URL in your browser (http://yourip:yourport/gui/ ) and µTorrent will download it automatically.
* To install manually or upgrade to a newer version, visit the forum thread linked above for the download link to the latest version. After downloading, rename the file to "webui.zip" and place it in %AppData%\uTorrent (Paste this path into the Explorer address bar).
* If running µTorrent in portable mode, place it in the same folder as the .dat files
* How to use the WebUI

* Enable and configure the WebUI in µTorrent (Preferences -> Advanced -> WebUI)
* If using the alternate port function, you must allow it in your firewall and forward the port in your router. If using UPnP, µTorrent will automatically forward the WebUI port.
* Open up a supported browser and use the following URL format: http://YourIP:UTport/gui/
* If the browser supports Username:Password (and you have the WebUI working with the first URL) then use the following URL format: http://Username:Password@YourIP:UTport/gui/

N.B: When using the WebUI locally use localhost or 127.0.0.1 as using your external (WAN) IP may cause problems when behind a router.

Freeze on loading or garbage data displayed?

There are several things to try.

* First try pressing CTRL+F5 in your browser. This will either revive the WebUI, or you will see a blank (white) screen. If you only see a blank (white) screen then close and reopen the browser then load WebUI again.
* If that doesn't work then use the following URL http://YourIP:UTport/gui/?action=setsetting&s=webui.cookie&v={} and then reload the WebUI using the normal URL.
* If garbage data is displayed, make sure that your WebUI.zip is the correct size. You may want to try redownloading it and ensure the download was completed successfully.
* If nothing works, then please come to http://forum.utorrent.com/ or irc://irc.utorrent.com/utorrent-webui to ask for help.
* Notes

* Any bugs should be reported at the WebUI Trac. Feature requests can also be made there, or in the µTorrent forums.
* [Opera] Some keyboard shortcuts will have conflicts
* [Opera] To disable Opera's context menu please have a look herehttp://forum.utorrent.com/viewtopic.php?pid=207866#p207866
* Keyboard Shortcuts

* Ctrl + A: Select all rows (select a row in the list first)
* Ctrl + O: Show the form for adding a torrent
* Ctrl + P: Show the settings window
* Ctrl + Z: Deselect All
* Del: Remove torrent
* F2: Show the about window
* F4: Hide/show the toolbar
* F6: Hide/show the details pane
* F7: Hide/show the category list

Running the WebUI over HTTPS (SSL)

1. Open µTorrent and go to the WebUI settings (Preferences -> Advanced -> Web UI)
2. Enable the "Alternative listening port" and change it to any port that you want (this port should not be forwarded in your firewall and/or router)
3. In the "Restrict access to the following IPs" enter "127.0.0.1" (without quotes). This is basically to prevent anybody from accessing the WebUI over HTTP
4. Now you'll have to install Stunnel. You can get the latest version from their website (http://www.stunnel.org/download/binaries.html)
5. After installing Stunnel, open up the stunnel.conf file
6. Under the "; Service-level configuration" comment you can remove all settings except from the "[https]" setting
7. Uncomment the "[https]" setting by removing the semi-colons in front of each line. You may change "https" to "webui" if you'd like
8. The "accept" setting is the port which a browser will try to connect to. So, this is the port that you will have to forward in your firewall and/or router (443 is the default SSL port, but it can changed)
9. The "connect" setting should be changed to the port that you entered as the alternative listening port in µTorrent
10. Start Stunnel, open up your browser, and navigate to https://ip:[Stunnel accept port]/gui/

Wednesday, March 16, 2011

Windows Development Tier Three

Windows Development Tier Three


In the third tier, it’s time to take your programming skills to the next level. In C++, learn key terminology and concepts, create and display a Window, and gain an understanding of COM. In VB.NET and C#, work with data in a database, connect that data to your user interface, work with XML, manage potential errors using exceptions, and step through sample applications to really see what makes things work. By the end of this tier, you will be ready to start creating great Windows applications on your own!

Visual Basic: Absolute Beginner Series


Visual C#: Absolute Beginner Series


C++: Windows Development


Windows Forms


Additional Windows Forms Training

Laptop Chager

21 Reasons why English Sucks

21 Reasons why English Sucks

1. The bandage was wound around the wound.
2. The farm was used to produce produce.
3. The dump was so full it had to refuse more refuse.
4. We must polish the Polish furniture.
5. He could lead if he would get the lead out.
6. The soldier decided to desert his dessert in the desert.
7. Since there was no time like the present, he thought it was time to present the present.
8. A bass was painted on the head of the bass drum.
9. When shot at, the dove dove into the bushes.
10. I did not object to the object.
11. The insurance was invalid for the invalid.
12. There was a row among the oarsmen on how to row.
13. They were too close to the door to close it.
14. The buck does funny things when does are present.
15. A seamstress and a sewer fell down into a sewer line.
16. To help with planting, the farmer taught his sow to sow.
17. The wind was too strong to wind the sail.
18. After a number of injections my jaw got number.
19. Upon seeing the tear in the painting I shed a tear.
20. I had to subject the subject to a series of tests.
21. How can I intimate this to my most intimate friend?