Thursday Apr 23, 2009
Thursday Apr 16, 2009
In case you haven't heard, there is an amazing Student offer for JavaOne this year- Students get in free! Plus, they can sign up for CommunityOne at the same time. Both passes are full conference passes with access to everything! Educators (your professors) can also get in free when they bring 10 students with them to the conference. If they aren't able to do this, they still get a fantastic deal of $895 for a full conference pass.
What is a Full Pass?
All the benefits of a FULL conference attendee, which includes: JavaOne general and technical sessions, panel discussions, HOLs (Hands-on-labs), BOFs (Birds-of-a-feather), the Pavilion and the After Dark Bash / Networking Mixer! Not to mention a "hang space" (which includes video games, movies & more!), plus you will be able to check email any time at one of our many hacker stations.
PLUS
Admission to the CommunityOne Deep-Dives. What does this mean? FREE training by our very own SLS on some really great topics, plus hugely discounted certification (vouchers will be handed out at the event)- certification can even be done on-site! There will also be numerous parties and chances for you to network with the best and brightest in the industry, from community leaders to "Rockstars" and everyone in between.
Here is the registration page set up just for you:
http://java.sun.com/javaone/2009/students_and_educators/index.jsp
Monday Mar 16, 2009
International Mobile Equipment Identity (IMEI) is used to identify valid devices connected to GSM and UMTS network. This number can be accessed from a mobile phone by dialing *#06# on the keypad. IMEI is commonly use by software developers as part of software protection scheme to prevent it from being pirated.
JavaME developers however suffers from a drawback because MIDP/CLDC specification does not include an API to obtain IMEI from mobile devices. However there are few phone manufacturers included this functionality through System.getPropery() calls.
Here's how to get IMEI number from mobile devices of different manufacturers
Nokia
PLAIN TEXT
JAVA:
1.
System.getProperty("phone.imei"blogs.sun.com/images/smileys/wink.gif" class="smiley" alt=";)" title=";)" />;
2.
System.getProperty("com.nokia.IMEI"blogs.sun.com/images/smileys/wink.gif" class="smiley" alt=";)" title=";)" />;
Note ; Requires signed midlet. S60 3rd edition device does not requires signing for this to work.
Sony-Ericsson
PLAIN TEXT
JAVA:
1.
System.getProperty("com.sonyericsson.imei"blogs.sun.com/images/smileys/wink.gif" class="smiley" alt=";)" title=";)" />;
Note ; might not work on all model, YMMV
Motorola
PLAIN TEXT
JAVA:
1.
System.getProperty("IMEI"blogs.sun.com/images/smileys/wink.gif" class="smiley" alt=";)" title=";)" />;
2.
System.getProperty("com.motorola.IMEI"blogs.sun.com/images/smileys/wink.gif" class="smiley" alt=";)" title=";)" />;
Samsung
PLAIN TEXT
JAVA:
1.
System.getProperty("com.samsung.imei"blogs.sun.com/images/smileys/wink.gif" class="smiley" alt=";)" title=";)" />;
Siemens
PLAIN TEXT
JAVA:
1.
System.getProperty("com.siemens.imei"blogs.sun.com/images/smileys/wink.gif" class="smiley" alt=";)" title=";)" />;
Hopefully this information can aid you in your J2ME programming projects.
Quick Tip :
It's quite hard to determine the phone model/manufacturer well ahead beforehand. For a more robust solution, I suggest that you combine the above call with System.getProperty("microedition.platform"blogs.sun.com/images/smileys/wink.gif" class="smiley" alt=";)" title=";)" />.
Thursday Feb 12, 2009
Note: I use Solaris 10 x86.
To customize my solaris environment, I tried to change my default shell to bash. When I modified /etc/passwd, I inputted a wrong path for bash. After I logout, I can not get back to system, because I changed root's passwd. How should I do?
I use the boot cd to boot my system, and then choose single user mode. After "#" pompts up, I am in a mini boot environment which is provided by boot cd. Then I
# cd /
# cd tmp
# mkdir mnt
# mount /dev/dsk/c0d0s0 /tmp/mnt (mount the root device and then modify it)
# cd /tmp/mnt/etc
# vi passwd (change root's shell path back to the correct one)
# init 6
When I login back to the system, "Invalid User Shell. Login Rejected" disppears and I succeed in loginning.
Wednesday Feb 11, 2009
Monday Feb 09, 2009
/bin/bash ------------------- Bash Shell
/bin/csh ------------------- C Shell
/bin/ksh ------------------- Kron Shell
/sbin/sh ------------------- Bourne Shell
Thursday Jan 22, 2009
http://net.pku.edu.cn/~course/cs101/resource/g++.html
g++ for Windows
Warning: This page is being maintained mainly for my students. Use these instructions at your own risk. There is no warranty in any form or shape whatsoever!. There is no guaranty that these instructions are up-to-date. With that understanding, you may continue with the rest of this page if you choose to accept these terms.
This page was last updated on September 13, 2005.
Follow these steps to install g++ (the GNU C++ compiler) for Windows. There is no room for creativity here; you must follow the directions exactly.
1. Pick the drive and a folder in which you want to install g++. I'll assume that it is C:, but you can choose a different one. If you choose a different drive or a different folder, you'll need to adapt the directions below accordingly.
2. Download full.exe, an about 14 megabyte executable, to C:\full.exe by right-clicking on the link. Use Save Link As... or Save Target As... Be sure the browser saves the file as C:\full.exe.
3. Run the downloaded executable. This will install g++ (and a lot of other things that you don't really need) on your hard drive. Go to the C: drive using Windows Explorer and double-click on full.exe. Or, open a DOS window (Start > Programs > Command Prompt), connect to the C: drive using the cd command, and type full.
4. Locate where the bin folder was created for the g++ installation. On my Windows XP machine, it was created in the following path:
C:\cygnus\cygwin-b20\H-i586-cygwin32\bin
You now should add it to the PATH environment variable. You do that by following:
Start -> Control Panel -> System -> Advanced -> Environment Variables
At this point you can see the PATH variable either in the User Variables or in the System Variables. Add the g++ path into the PATH variable. You add it to the end of the existing value separated by a semicolon (';'). Make sure that you do not lose the original value. You are just appending more to the end separated by a semicolon.
5. Restart your computer. A Cygnus Solutions entry will appear in your Programs menu, and an icon may appear on your desktop. Don't use them! You will use it using the g++ command on a DOS prompt as explained below.
You should now be able to run g++ from a DOS (Command Prompt) window. For example, to compile a file called C:\mine\hello.cpp, connect to the C:\mine folder and enter
g++ -g hello.cpp -o hello -lm
You'll then be able to run the compiled program by entering hello in the DOS window.
If you've installed Emacs as described here, you will also be able to run g++ from Emacs. If, when you do this, Emacs tries to compile with the command make -k, you made a mistake during the Emacs installation. If you want to learn how to run g++ on emacs, see here.
If you'd like to learn more about where this free compiler came from, we downloaded it from an older site of http://sourceware.org/cygwin/.
If you wish to clean up a little, you may delete the file: full.exe at this point. Your g++ compiler is installed under C:\cygnus.
Friday Jan 09, 2009
Let's talk about Attack Types in the security field today.
Attack types specify how much information which a crypto analyst has access to when cracking an encrypted message. We can sum up the common attach models as the following:
1) Ciphertext-only attack: The attacker is assumed to have access only to a set of ciphertexts; e.g. In any case where a stream cipher like RC4 is used twice with the same key it is open to ciphertext-only attack.; Brute force attack can succeed if a cipher's key space is too small;
2) Known-plain attack: The attacker has samples of both the plaintext and its ciphertext. Then the attacker makes use of them to reveal further secret information, typically secret key;
3) Chosen-plaintext attack: The attacker has the capability to choose arbitrary plaintexts to be encrypted and obtain the corresponding ciphertexts. The goal of the attack is to gain some further information which reduces the security of the encryption scheme. In the worst case, a chosen-plaintext attack could reveal the scheme's secret key;
4) Chosen-ciphertext attack: The attacker gathers information, at least in part, by choosing a ciphertext and obtaining its decryption under an unknown key.
Thursday Jan 08, 2009
How fsck normally works
Unix, any Unix, will refuse to mount a filesystem that was not unmounted
cleanly. This is because it may be corrupt and mounting a corrupt filesystem
will likely cause the system to crash.
When the system boots all filesystems are checked to see whether they
are Clean. The term simply means whether the filesystem was unmounted
properly after it's last use. If the filesystem is Dirty then fsck
will be called in to check it out in more detail. Some Unix variants such
as Linux will also run fsck after the filesystem has been mounted N times
- N is the maximal mount count.
Wednesday Jan 07, 2009
http://www.electronics.oulu.fi/latex/examples/example_3/index.html, I think it's good enough.
Figures
To insert a figure in a LaTeX document, you write lines like this:
\begin{figure}
\centering
\includegraphics[width=3.0in]{imagefile1}
\caption{Caption for figure}
\label{fig:sample_figure}
\end{figure}
The whole block is enclosed between \begin{figure} and \end{figure}. The command \includegraphics does the actual insertion of the image. Here the file name of the inserted image is imagefile1.
If you are using LaTeX to process your document, .eps extension is
appended automatically to the file name. If you are using pdfLaTeX, it
appends .pdf, .png, or .jpg when searching for the image file.
You need to get familiar with some design patterns. Just get read of them.
Singleton pattern
In software engineering, the singleton pattern is a design pattern that is used to restrict instantiation of a class to one object. (This concept is also sometimes generalized to restrict the instance to a specific number of objects - for example, we can restrict the number of instances to five objects.) This is useful when exactly one object is needed to coordinate actions across the system. Sometimes it is generalized to systems that operate more efficiently when only one or a few objects exist. It is also considered an anti-pattern by some people, who feel that it is overused, introducing unnecessary limitations in situations where a sole instance of a class is not actually required, and introduces global state into an application.
Thursday Dec 18, 2008
Cool application of SunSpots!! If you want to find out more, here is the project website :
http://www.tslab.ssvl.kth.se/csd/projects/0821006/
Tuesday Dec 16, 2008
Elliptic curve cryptography (ECC) is an approach to public-key cryptography. It is based on the algebraic Structure of elliptic curves over finite fields. ECC was first mentioned in [33]. Compared to RSA, ECC appears to provide equal security for a far smaller key size(approximately one-eighth the key size), thus reducing processing overhead [57]. For example, a 160-bit ECC key provides the same level of security as a 1024-bit RSA key and 224-bit ECC is equivalent to 2048-bit RSA [56]. It means ECC offers faster computations, lower power consumption, and memory & bandwidth savings. These properties are useful for mobile devices which are typically limited in the resource of CPU, power and network connectivity. In this way, ECC is more suitable for securing mobile banking than RSA theoretically.
Elliptic curve used in cryptography are defined over two kinds of fields:
• prime curves: GF(p), p is a large prime number;
• binary curves: GF(2m), 2m element are binary polynomials;
[Read More]
Monday Dec 08, 2008
Wanted to give you a heads up that the OpenSolaris 2008.11 launch date is set for 10 December. We are scheduling a series of OpenSolaris webinars for OSUM members. The English language webinar is already posted and scheduled for 10 Dec at 9 am, U.S. Pacific Time.
This blog copyright 2009 by Yunpu Zhu

