Mar 20
Always confused how to delete all messages from root inbox on Linux:
First check the messages by issuing
mail
If you find them useless ( indeed 😉 ), use the following command:
> /var/spool/mail/root (That’s the location where all messages are appended).
March 20th, 2008 in
Linux,
Systems |
No Comments |
1,877 views
Mar 20
Simple way for using command line mail program on Linux:
Simple Email Message:
echo “Message Body” | mail -s “Subject” receiver@emailaddress.com
Sending File using Linux mail command:
mail -s “Subject” receiver@emailaddress.com < file_to_send.txt
Sending Binary Files with Linux mail command:
Sometimes sending binary files does not work well the command line. We can use uuencode formatting for sending such files:
uuencode myimage.jpeg | mail -s “Subject” receiver@emailaddress.com
Few command line options for Linux mail command:
-s subject Use subject for the e-mail title
-c address Send copy of the mail to the specified address
-b address Send blind carbon copy to specified address
More details can be found here:
Linux Mail Command Line Options
Linux Mail Command Line Options – source 2
March 20th, 2008 in
Linux,
Systems |
No Comments |
6,780 views
Mar 18
Remote Method Invocation (RMI):
RMI API is a Java application programming interface for performing the object equivalent of remote procedure calls. The concept of RMI is that, the client can use the services provided by a server which is on a different JVM, making remote calls to it. The client talks to a proxy server, which is in the same JVM as the client, and in turn talks to the actual server on a different JVM. So for the client it feels as if it is talking to a local server. This abstraction is taken care by the RMI API.
For the client to make remote calls on the server, it has to know what all methods are available for it to use. The representation of the service provided by the server to the client is in the form of an interface which the server implements. Therefore, the key to understanding RMI is to remember that interfaces define behavior and classes define implementation. RMI supports two classes that implement the same interface. The first class is the implementation of the behavior, and it runs on the server. The second class acts as a proxy for the remote service and it runs on the client.
RMI Architecture:
Stub & Skeleton Layer:
Stub is present on the client and Skeleton is present on the server. In this layer, RMI uses the Proxy design pattern. In the Proxy pattern, an object in one context is represented by another (the proxy) in a separate context. The proxy knows how to forward method calls between the participating objects. In RMI’s use of the Proxy pattern, the stub class plays the role of the proxy, and the remote service implementation class plays the role of the RealSubject.
When a stub's method is invoked, it does the following:
March 18th, 2008 in
Java |
No Comments |
5,892 views
Mar 13
Properties of Super() in Java:
- Used to invoke “Parentclass” constructor using “Baseclass”
- Invocation of a superclass constructor must be the first line in the subclass constructor.
- It supports super(), the superclass with no-argument and with super(parameter list) with parameters
- Java compiler automatically invokes the no-argument constructor of the superclass.
Example:
public void ParentClass {
String message;
public ParentClass ( String message ){
message = message;
}
}
public void BaseClass extends ParentClass {
String messageTwo;
public BaseClass ( String message, String messageTwo ){
super();
messageTwo = messageTwo;
}
}
March 13th, 2008 in
Java |
No Comments |
2,097 views
Mar 12
Some properties of Super keyword:
- If you have “childclass” overriding methods in “parentclass”, you can invoke overriden methods using super keyword
- It has advantage so that you don’t to have to perform operations in the “parentclass” again.
- Only the immediate “parentclass’s” data and methods can be accessed.
Example:
public class Parentclass {
public void calculateValue() {
System.out.println("2*2");
}
}
public Baseclass extends Parentclass{
// Overrides the calculateValue() method
public void calculateValue() {
super.calculateValue();
System.out.println("10*10");
}
}
Solution:
It will print 4 & 100.
March 12th, 2008 in
Java |
No Comments |
7,377 views
Mar 11
Yahoo unveiled Yahoo! onePlace
March 11th, 2008 in
Random Picks.. |
No Comments |
1,300 views
Mar 08
Requirements for iPhone SDK:
- # Mac OS X Leopard
- # An Intel-based Mac
- # Xcode
- # A free Apple iPhone developer account and the SDK itself — It’s free, though getting the application approved and out onto devices will set you back the $99.
Coverage of Live Event :
iPhone SDK Release
Apple iPhone Developer Program
[video:youtube:v=4i-YCMj9L-g]
March 8th, 2008 in
iPhone |
No Comments |
1,546 views
Mar 06
The iPhone is one of the coolest mobile gadget ever invented, that
March 6th, 2008 in
iPhone |
No Comments |
1,606 views
Mar 05
Semaphores can be used for mutual exclusion and thread synchronization. Instead of busy waiting and wasting CPU cycles, a thread can block on a semaphore (the operating system removes the thread from the CPU scheduling or “ready” queue) if it must wait to enter its critical section or if the resource it wants is not available.
Mutual exclusion pseudocode:
semaphore S = 1; … P(S); N=N+1; V(S);
Condition synchronization pseudocode (resource availability):
semaphore tapeDrives = 7; … P(tapeDrives); useTapeDrive(); V(tapeDrives);
Java has implicit binary semaphores of the form
Object mutex = new Object();
/*...*/
synchronized (mutex) {
/*...*/
}
that can be used for mutual exclusion. Only one thread at a time can be executing inside the synchronized block.
Java synchronization primitives built in Java (monitors and wait sets) behind synchronized, wait(), and notify(). Fortunately, Java allows you to implement all the familiar synchronization schemes on top of monitors and wait sets.
March 5th, 2008 in
Java |
No Comments |
1,216 views
Mar 04
Last.fm which is largest social music platform with over 20 million active users have a section where you can download free Mp3 music files. This section is called Weekly Free Downloads where you currently can download nearly 200 songs including also popular artists like Rihanna, Snoop Dogg and others.
The list of free songs is sorted by popularity so you can see how actual the song.
Soure:http://www.rotorblog.com/2007/11/28/download-mp3-music-files-from-lastfm-for-free/
March 4th, 2008 in
Free Services,
Random Picks.. |
No Comments |
3,353 views