dis'z mY own kiNda bloG!!!!!

on this blog,you'll find everything and every piece of thing in a different view,any comments are accepted@ my e-mail!

Saturday, September 25, 2010

Some tips and shortcuts regarding common system usage.

Getting system properties faster : [shortcut key]-                                                                                   Hold 'Windows' key and press 'Pause/Break',simultaneously.                                                                                                                                                         This would open system properties directly without right clicking My Computer and opening it.


For Task-Manager:Press "Ctrl+shift+Esc",simultaneously or we all know the common way of pressing"Ctrl+Alt+Delete".


Locking Folders without any third party software :

Consider you want to lock a folder named in your E:\, whose path is E:\.
Now open the Notepad and type the following

ren .{21EC2020-3AEA-1069-A2DD-08002B30309D}

Where is your folder name. Save the text file as loc.bat in the same drive.
Open another new notepad text file and type the following

ren .{21EC2020-3AEA-1069-A2DD-08002B30309D}

Save the text file as key.bat in the same drive.
Steps to lock the folder:

To lock the folder, simply click the loc.bat and it will transform into control panel icon which is inaccessible.
To unlock the folder click the key.bat file. Thus the folder will be unlocked and the contents are accessible

PS: This has not worked fine in my system. But My Friend still arguing with me that this trick is working fine for him. So I thought Posting it here will be useful for others. 

Shutting down the computer: 
       
Press "Alt+F4" and "U",or you can use,
Press "Win+U",2 times.


To fasten your system:
 Press "Windows key+click on my computer"


To Rename the Recycle bin - This is only for fun

Type regedit in Run Command...
Then go to :HKEY_CLASSES_ROOT/CLSID/{645FF040-5081-101B-9F08-00AA002F954E} and Change the Name.

Change the Default Location for Installing Programs
XP uses the C:/Program Files directory as the default base directory into which new programs are installed. However, you can change the default installation drive and/or directory by using a Registry hack. Run the
Registry Editor and go to
HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion
Look for the value named ProgramFilesDir. By default, the value will be C:/Program Files. Edit the value to any valid drive or folder; XP will use that new location as the default installation directory for new programs. 

Short cut for opening "Add or Remove Programs" window is

1. Open Run
2. Type appwiz.cpl 

Alt+tab
This is for easy way of select next minimize window 

Ctrl+t
This is to open a new tab in tabbed browsers.
Alt+F4
This is used to close the current viewing window or a running application.
Ctrl+W
This will close the current viewing window.


                                                                       -kj.,

 

Client-Server interactions in MMORPGs.

Client-server Interaction in multi player gaming

Here's a basic look at what happens when a group of characters attacks a monster in a typical MMORPG(MASSIVE MULTI-PLAYER ONLINE ROLE PLAYING GAMES):

  1. The group approaches the mob. The groups' clients inform the server of where they are, and the server tells the clients which monster is nearby. The client accesses files relating to the monster's appearance and movement, which are stored on the computer's hard drive.
  2. A tank, or a character designed to be able to absorb a lot of damage, attacks the mob. The tank's client sends a message to the server, informing it of the attack. The server relays that information to the rest of the group's clients.
  3. The party's damage dealers, known as damage per second (DPS) or nukes, attack the mob. Their clients inform the server of what actions they take. The server calculates damage dealt and received and informs each client.
  4. The party's healer casts healing spells on the members of the party. The healer's client informs the server of what spells are being cast and on whom. The server calculates how much healing is done and relays the information to the rest of the party.
  5. The mob's artificial intelligence (AI) protocols determine how the mob behaves during the fight, and the server relays that information to the clients. If the party successfully kills the monster, the server informs each client to display the monster's death animation, which is stored on the computer's hard drive.
  6. A member of the party loots the monster to see what treasure it carried. The server selects items from a loot table at random and tells the clients which items dropped. If some of the players in the group have a quest that requires a certain item from the mob, the server instructs the client to display the icon for that item.
  7. The players, using text or voice chat, decide who will get an item according to the rules of their group or guild. They may use a built-in random number generator to determine who gets what item. If so, the server which distributes the results to all the other clients.
  8. The player who wins the loot clicks on it to pick it up. The client informs the server that the player has done so. The server informs the client to add the item to the player's visible inventory. It also stores the change in the player's inventory in that player's database entry.
  These same steps can apply to just about any encounter in the world, whether it's with a player and an NPC, or a player and another player in a player-versus-player (PVP) environment. All of the information travels back and forth between the client and the server as packets of data. While many players rely on broadband Internet connections to handle the data, the transactions don't necessarily require a lot of bandwidth. Usually, the packets are small, but they come in bursts.

   More important than the speed of the player's Internet connection is how long it takes for information from your computer to travel all the way to the game server, and vice-versa. If there are bottlenecks along the way, the player might experience latency. Latency is another name for a traffic delay. Sometimes, it's noticeable -- a player might attack a monster and have to wait a few seconds before the monster responds. In some cases, latency can significantly disrupt game play.Latency is the signal gap between the server and the client.The signal to the server is called as "ping" and the response signal from the server is called as "pong".A ping and pong constitutes the completion of the interaction.The much is the difference between the ping and pong,the more will be the latency. Developing an MMORPG requires more than just figuring out how to send these packets of data from one place to another.


                                                                                                                 -kj.,

Client - Server interaction.

  Characteristics of Clients and Servers

In general, client software has the following characteristics.
  • It is an application program that becomes a client temporarily when remote acces is needed, but performs other computation locally.
  • It is invoked by a user and executes for one session.
  • It runs locally on the user's computer.
  • It actively initiates contact with a server (CONNECT primitive).
  • It can access multiple services as needed.(Here we can consider the multiprogramming as discussed in my earlier post).
In general, server software has the following characteristics.
  • It is a special-purpose program dedicated to providing one service.
  • It is invoked automatically when a system boots, and continues to execute through many sessions.
  • It runs on a shared computer.
  • It waits passively for contact from arbitrary remote clients (LISTEN primitive).
  • It accepts contact from arbitrary clients, but offers a single service.But,these days server are offering multiple services.(Consider multithreading here).
  Note that the word server is (strictly) referring to a piece of software. However, a computer running one or more servers is often (incorrectly) called a server.
  Like most application programs, a client and a server use a transport protocol to communicate.                        Figure 1 illustrates a client and a server using the TCP/IP protocol stack.
A client and a server
Figure 1: A client and a server
   The client and server each interact with a protocol in the transport layer of the stack. A sufficiently powerful computer can run multiple servers and clients at the same time. Such a computer must have the necessary hardware resources (e.g. a fast CPU and sufficient memory) and have an operating system capable of running multiple applications concurrently (e.g. UNIX or Windows). Figure 2 illustrates such a setup.
Two servers
Figure 2: Two servers
   The computer in the middle might be running an FTP server and a WWW server. Modern computers are often capable of running many servers at the same time.

Examples of a Client and a Server

  Figure 3 illustrates the sequence of socket procedure calls required for correct client-server programming.
Socket procedure calls
Figure 3: Socket procedure calls
  Client and server applications can use either connection-oriented or connectionless transport protocols to communicate. High-level languages, such as Perl [Wall 2000] , can hide this low-level code to make network programming less error-prone.

Example Server

Figure 4 illustrates a TCP server application written in Perl. The single function call.(Ignore this if you are not familiar with programming,atleast basic knowledge of UNIX is required to understand this concept). 


IO::Socket::INET->new(...) executes the first four procedure calls shown in Figure 3.
use IO::Socket::INET;
use strict;

my $port = shift
    or die"Missing port number\n";

my $socket = IO::Socket::INET->new('LocalPort' => $port,
       'Proto' => 'tcp',
       'Listen' => SOMAXCONN)
    or die "Can't create socket ($!)\n";
print "Server listening\n";
while (my $client = $socket->accept) {
    my $name = gethostbyaddr($client->peeraddr, AF_INET);
    my $port = $client->peerport;
    while (<$client>) {
 print "[$name $port] $_";
 print $client "$.: $_";
    }
    close $client
 or die "Can't close ($!)\n";
}
die "Can't accept socket ($!)\n";

Figure 4: Simple TCP server
  The first two lines specify packages to be used. The next two lines extract a port number from the command line. The next four lines perform a passive open with the server listening for incoming connections. The outer while loop accepts a connection and computes the host name and port number of the client. The inner while loop reads from the client (<$client>), echoes the data on standard output (print "[$name $port] $_"), and then sends the client a copy of its own data, prepended with the current line number (print $client "$.: $_"). When the client sends end-of-file, the server closes the current connection and continues the outer loop, waiting for another incoming connection.But these days servers are capable of receiving multiple incomes and generate multiple outcomes(sending requested data to the clients).

Client Example

Figure 5 illustrated a TCP (connection-oriented) client application written in Perl. The single function call

IO::Socket::INET->new(...)  /* executes the first four procedure calls shown in Figure 3.*/
use IO::Socket::INET;
use strict;

my $name = shift
    or die "Missing server name\n";
my $port = shift
    or die "Missing port number\n";

my $socket = IO::Socket::INET->new('PeerAddr' => $name,
       'PeerPort' => $port,
       'Proto' => 'tcp')
    or die "Can't create socket ($!)\n";
print "Client sending\n";
while (<STDIN>) {
    print $socket $_;
    print scalar <$socket>;
}
close $socket
    or die "Can't close socket ($!)\n";

Figure 5: Simple TCP client
  The first two lines specify packages to be used. The next four lines extract a server name and port number from the command line. The next four lines perform an active open on the socket between our client and the server. The while loop reads standard input (<STDIN>), sends the data to the server (print $socket $_), and then reads the server's reply (print scalar <$socket>). At end-of-file, the connection is closed.But these days,the connection is not terminated until the client or the server intentionally or erroritically  disconnects the connection.

Running the Server

Figure 6 illustrates the TCP server application running on penguin and listening on port 1234.(Penguin is an example of WWW server taken here).

penguin(100)% perl tcp-server.pl 1234
Server listening
[localhost 35577] Here we go...
[localhost 35577] Wow, a response!
[localhost 35577] Goodbye

penguin(101)%

Figure 6: Running server
It echoes the segments from a client running on localhost (i.e. the local machine) using port number 35577. It was then terminated.

Running the Client

Figure 7 illustrates the TCP client application contacting a server running on penguin and listening on port 1234.

penguin(107)% perl tcp-client.pl localhost 1234
Client sending
Here we go...
1: Here we go...
Wow, a response!
2: Wow, a response!
Goodbye
3: Goodbye
penguin(108)%

Figure 7: Running client
The text typed by the user is echoed back by the server. The application is terminated by typing end-of-file on standard input.

 This is the way actually a server responds to a negotiation of a client.

Any questions regarding this are entertained.



                                                                                                                                     -kj.,

Difference between MultiProgramming and MultiThreading.

  Multi programming is the technique to run several programs at a time using "time sharing". The main concept behind the multiple programming is that an operating system stores many programs in the main memory simultaneously and then the processor takes one job from that job pool and it executed them. When that job have to wait for some input output then it takes another job from that pool and executes it.like wise it seems that it handles many programs at the same time.This is called 'Multi programming".

  Whereas multi threading means the different threads in the process to perform similar type of the functions. Let's take one example that in the internet world server accepts the requests from the client side for the videos,audios,images. Now we consider the situation according to the single threaded system,in the busy network where many of the clients request for the same things the server would have provided its facilities to only one of the client.But this is not the case with multithreading .This problem is solved bu the multi threading.All the clients get the requested thing,eventhough it is same.But,we must consider the hardware and capacity of the server.Excessive load on the server for the same thing or different things might make the server crash.

OOpzzz.......the google has corrected the glitch of "l33t"

   I have posted in my last posts about the google loco and the "l33t" glitch,but the google has corrected the glitch.If you are even interested in using google loco,just type google loco in search bar and click on I am feeling lucky.