Wednesday, September 24, 2008

Google's Project 10 to the 100th

Project 10 to the 100th is a call for ideas that have an impact on the entire world, affecting as many people as possible. You have until October 20th, 2008 to submit your idea. From the top 100 ideas, you have a chance to choose the 20 semi-finalists. In the end, up to 5 ideas will be selected, and Google is committing $10 million to implement those ideas.

It is important to understand that you will not receive the money, but rather a Request for Proposal process will begin "to identify the organization(s) and proposals that are in the best position to help implement the selected ideas". Hence if you wanted to participate in this project for the money, then you are misunderstanding the scope of it. In terms of Google, you "get good karma and the satisfaction of knowing that your idea might truly help a lot of people".

Friday, September 19, 2008

JNI Example

JNI stands for Java Native Interface, which allows you to use, inside your Java application, code written in other programming languages. I will walk you through an example (developed under Windows) of using JNI.

Here are the main steps we need to follow:
- Create a java application that declares the native method.
- Compile the program.
- Generate the header file using javah.
- Implement the native code inside a C application.
- Compile the C code and generate the native library (dll).
- Run the java program.

Let us go through each of these steps:

1. Create a java application that declares the native method.

/**
* Shows a simple example of using JNI
*/
public class JNIExample {
//Declare native method
private native void displayMessage();

public static void main(String[] args) {
//Load native library
System.loadLibrary("JNIExample");
//Call the native method
new JNIExample().displayMessage();
}
}


2. Compile the program.
javac JNIExample.java

3. Generate the header file using javah.
javah -jni JNIExample

4. Implement the native code inside a C application.

#include
#include
#include "JNIExample.h"

JNIEXPORT void JNICALL Java_JNIExample_displayMessage
(JNIEnv *lEnv, jobject lObj) {
printf("This is a JNI Example!\n");
return;
}

The method signature matches exactly the one from the JNIExample.h header file.

5. Compile the C code and generate the native library (dll).
Open a Visual Studio (or similar) command prompt. In my case, it was located under "start->Programs->Visual C++ 2005 Express Edition->Visual Studio Tools->Visual Studio 2005 Command Prompt".
Run the command from the directory where you have the JNIExample.c file:
"cl -I"c:\Program Files\Java\jdk1.5.0_08\include" -I"c:\Program Files\Java\jdk1.5.0_08\include\win32" -MD -LD JNIExample.c -FeJNIExample.dll". Your path to the include directory might be different, so make sure you adjust that according to your settings. The -LD option makes sure that the compiler generates a DLL file. The -MD option makes sure that the DLL generated is linked with the win32 multithreaded C library.

6. Run the Java program.
java JNIExample

Some problems I ran into it while testing the code:
- I was missing the msvcr80.dll file, so I downloaded from here and copied it to c:\windows\system32 directory.
- Even though a manifest file was created, I hade to embedd it inside the dll. I have used the following link to solve the problem: http://msdn.microsoft.com/en-us/library/ms235591(VS.80).aspx. Here is the command: "mt.exe -manifest JNIExample.dll.manifest -outputresource:JNIExample.dll;2"

Saturday, September 13, 2008

Microsoft joins OMG

On September 10th, Microsoft announced its membership in the standards body of OMG (Object Management Group). This does not imply that Microsoft is moving away from its DSL (Domain Specific Language) strategy, where the DSL Toolkit ships with the Visual Studio SDK. What Microsoft is doing is actually supporting both DSL and UML, providing you with the chance to choose the right approach for the right job.

From the press release:

“We’re building modeling in as a core part of the platform,” said Bob Muglia, senior vice president, Server and Tools Business at Microsoft. “This enables IT pros to specify their business needs and build applications that work directly from those specifications. It also brings together the different stages of the IT life cycle — connecting business analysts, who specify requirements, with system architects, who design the solution, with developers, who build the applications, and with operations experts, who deploy and maintain the applications. Ultimately, this means IT pros can innovate and respond faster to the needs of their business.”

Thursday, September 11, 2008

"Accept cookies from sites" remains unchecked in Forefox

In Firefox, something strange started to happen today. Trying to access iGoogle and Yahoo! Mail, they kept telling me that my browser does not accept cookies. How is that possible? I checked my Privacy settings, and there it was, my "Accept cookies from sites" option was not checked. How did that happen? I don't remember unchecking it. No problem, I checked it and started reading my Technology news from iGoogle and checking my email. Some time afterward, guess what? Same problem! Now, I am concerned. I'm thinking my browser is being exploited somehow. But something does not make sense here. By not accepting cookies, I'm actually restricting access, not giving access, I'm increasing my privacy, not decreasing it. OK, so I'm not being exploited, I'm not revealing any private information through my browser, but at the same time, the cookies option somehow gets unchecked. Without keeping you into suspense for much too long, the problem was with one of my browser extensions, Stealther, namely it was being used. To be honest, I do not remember starting it (checking it under Tools -> Stealther), but that my friends, is another story.

BlackBerry Flip and IBM's Spoken Web

RIM introduced the first BlackBerry Perl Flip 8220 smartphone. The official website for the phone can be found here. Taken from the RIM press release:

"The quad-band EDGE based BlackBerry Pearl Flip smartphone presents a sophisticated look with a sleek design and a chrome-finished frame surrounding its smooth, luminescent face. Packed with an abundance of powerful features, it weighs only 3.6 ounces and measures approximately 3.9” x 1.9” x 0.7”. Featuring two high-resolution, light-sensing color displays, the external LCD makes it easy to preview incoming emails, text messages and phone calls without opening the handset, while the large, 240 x 320 internal LCD displays messages, videos and web pages with impressive detail and contrast.

“The popularity of BlackBerry smartphones has grown tremendously around the world and the introduction of this exciting new flip phone will help extend the reach of the BlackBerry platform even further,” said Mike Lazaridis, President and Co-CEO, Research In Motion. “The BlackBerry Pearl Flip is a full-featured smartphone with a unique and friendly design and it is a natural choice for flip phone users who want to start doing more with their phone than just talk.”"

Voice quality is assured through the use of Speaker Independent Voice Recognition (SIVR) for Voice Activated Dialing (VAD). It includes "support for mp3 ring tones, smart dialing, conference calling, speed dialing, call forwarding, voicemail attachment playback and enhanced background noise cancellation. It also features a speakerphone and Bluetooth® 2.0 for use with hands-free headsets, stereo headsets, car kits and other Bluetooth peripherals such as a GPS receiver. The removable/rechargeable 900 mAhr battery provides four hours of talk time and over 14 days of standby time".

IBM is testing a voice-based web browser, developed under the "Spoken Web" project of IBM's India Research Laboratory. Some of the technologies used are Voice eXtensible Markup Language (VoiceXML) and HyperSpeech Transfer Protocol (HSTP). You can read more about it here.