Tuesday, June 28, 2005

YouSendIt

How many times had you wanted to send very large files to someone and could not? Jim Edwards suggests using YouSendIt, an absolutely free service. No registration is required and it's secure. The service works like this - you use this service to upload a file to their server and give an email id of the recepient. The recepient receives an email from them, which gives a link to this file, stored on their server. You click on the link and download the file. Please note: They do not send the file as an attachment to your email. Do try it out.
Technorati Tags:
Blogs linking to this article

MIT Weblog Survey

Massachusetts Institute of Technology is conducting a general social survey of the greater weblog community. Their goal is to help understand the way that weblogs are affecting the way we communicate with each other. Specifically, they are interested in issues of demographics, communication behaviors, experience with weblogs and other technology, and the meaning of various types of social links within the blogosphere. Come on, take this survey.
Technorati Tags: , ,
Blogs linking to this article

Friday, June 24, 2005

Enhanced for loop in J2SE 5.0

The enhanced for makes it easier to iterate over all the elements in an array or other kinds of collections. Look at this simple example:
public class EnFor
{
public static void main(String[] args)
{
String[] cities =
{"Pune", "Mumbai", "Bangalore", "Hyderabad"};

for (String name : cities)
{
System.out.println(name);
}
}
}
If we analyse the for code, then the following happens:
(a) a String variable called name is created and set to null. The variable that you declare must be compatible with the elements in the array.
(b) Next, the first value in the cities array is assigned to name.
(c) The body of the loop is executed.
(d) The next value in the cities array is assigned to name. Remember, with each iteration, a different element in the array will be assigned to name.
(e) This is repeated as long as there are elements in the array.

Note: The : in the for, means "IN". Also, what follows the : must be a reference to an array or other collection.
Technorati Tags: , ,
Blogs linking to this article

Thursday, June 23, 2005

Internationalization in Java - An Introduction

Sun defines 'Internationalization' as the process of designing an application so that it can be adapted to various languages and regions without engineering changes. Sometimes the term internationalization is abbreviated as i18n, because there are 18 letters between the first "i" and the last "n.". Let's write a simple Java program to say Hello to a person and Welcome that person to India, in different languages. Here are the steps to Internationalize a program:
(a) Create the .properties files:The English version of the .properties file is say MessagesBundle.properties and contains
greetings = Hello
welcome = Welcome to India
The same contents would be there in the file MessagesBundle_en_US.properties. To create the .properties files in other languages, I am making use of the free, online Free2Professional Site.
Here's the German version of the .properties file ie. MessagesBundle_de_DE.properties where de is the language code and DE is the country code. The contents of this file is:
greetings = Hallo
welcome = Willkommen in Indien
(b) Define the Locale The Locale object identifies a particular language and country. The program gets the Language and Country code from the command line. Thus,
String lang = new String(args[0]);
String country = new String(args[1]);
Locale cLocale = new Locale(lang, country);
(c) Create a Resource Bundle: The ResourceBundle objects contain locale-specific objects. It is created as:
ResourceBundle msg = 
ResourceBundle.getBundle("MessagesBundle", cLocale);
(d) Fetch the Text from the ResourceBundle: To retrieve the message identified by the welcome key, you invoke getString as follows:
String msg = msg.getString("welcome");
Well, that's all that's required. Here's the full code:
import java.util.*;
public class InternationalizationEx
{
public static void main(String[] args)
{
String lang, country;
Locale cLocale;
ResourceBundle msg;

if (args.length != 2)
{
lang = new String("en");
country = new String("US");
}
else
{
lang = new String(args[0]);
country = new String(args[1]);
}

cLocale = new Locale(lang, country);
msg = ResourceBundle.getBundle("MessagesBundle", cLocale);

System.out.println(msg.getString("greetings"));
System.out.println(msg.getString("welcome"));
}
}
To run the program, open a DOS window and type:
java InternationalizationEx de DE
Note: Ensure that the three .properties files and the .java program are in the same folder.
Technorati Tags: , , ,
Blogs linking to this article

Wednesday, June 22, 2005

Static imports in J2SE 5.0

Do you hate to type Java code? Static imports helps you save some typing. If you are using a static class or a static variable, you can import them and save some typing. The simple example below, should clarify this concept:
import static java.lang.Math.*;
import static java.lang.System.out;

public class MyMath5
{
public static void main(String[] args)
{
// returns a double between 0.0 thro' (but not
// including) 1.0
double r1 = random();
int r2 = (int) (random() * 5);
out.println("r1 = " + r1);
out.println("r2 = " + r2);

// Returns the absolute value of the argument
int x = abs(-240);
double d = abs(240.45);
out.println("x = " + x);
out.println("d = " + d);

// Returns an int or long (depending on whether
// the argument is foat or double)
// rounded to the nearest integer value
int p = round(-24.8f);
long q = round(24.45);
out.println("p = " + p);
out.println("q = " + q);

// Returns a value that is minimum of two values
int c = min(243, 240);
double dd = min(90876.5, 90876.49);
out.println("c = " + c);
out.println("dd = " + dd);

// Returns a value that is maximum of two values
int e = max(243, 240);
double f = max(90876.5, 90876.49);
out.println("e = " + e);
out.println("f = " + f);
}
}

Technorati Tags: , ,
Blogs linking to this article

Friday, June 17, 2005

Box with J2SE 5.0

Laila Ali
Wondering what Boxing's got to do with Java? And I didn't mean Laila Ali, the first woman to win a World Boxing Council title, either! You wouldn't like to mess with her, would you?

So, what is Boxing in Java? Boxing refers to the automatic conversion from a primitive to its corresponding wrapper type: Boolean, Byte, Short, Character, Integer, Long, Float or Double. Since this happens automatically, it's also referred to as autoboxing. The reverse is also true, ie. J2SE 5.0 automatically converts wrapper types to primitives and is known as unboxing.

Before you can try out this simple example, you must install and set the environment variables 'path' and 'classpath' for J2SE 5.0.

The example is quite trivial and you could try compiling it with an earlier version of J2SE, to see the compilation errors flagged out.
public class BoxingUnBoxing
{
public static void main(String[] args)
{
// Boxing
int var = 10;
Integer wInt = var;
int result = var * wInt;
System.out.println("Value of result = " + result);

// Unboxing
int conv = wInt;
if (conv < 100)
System.out.println("True");
}
}
Boxing/Unboxing saves us the bother of converting from a primitive to it's wrapper and vice-versa. This feature is definitely a time-saver.

Update: Java 2 Platform, Standard Edition (J2SE 6.0), code name Mustang, is due in the first half of 2006. Also Dolphin, the Java SE 7 release is scheduled to follow Mustang in late 2007,
Technorati Tags: ,
Blogs linking to this article

Thursday, June 16, 2005

Adsense code modifications

I want to ensure that the html of my blog is conforming to W3C//DTD XHTML 1.0 Strict//EN standards. When I validate my markup using the Free W3C Markup Validation Service, I get errors for html code related to Adsense. I had written to Adsense Support about this and here is their reply.

We do allow modification of our code to comply with W3C HTML and XHTML standards. In order to make your code compliant, you'll need to make the following changes to the AdSense for search code:

1. Remove the closing </input> and </image> tags
2. Add an additional closing '/' to the end of the opening html tags for <input> and <image>. This should occur for all 'image' and 'input' tags.

Please note that the AdSense for search code may only be modified as specified above. Our program policies do not permit any additional modifications. We appreciate your understanding.


Technorati Tags: ,
Blogs linking to this article

Wednesday, June 15, 2005

Technorati: tag pages problems

If you've had trouble getting your tagged posts appearing on Technorati's tag pages, and you feel you've done everything you should to tag them in the right way, then the problem is probably down to Technorati, not you. A post in A Consuming Experience details out the various problems and likely solutions to this. In my earlier post, I had mentioned that Technorati support is slow or non-existing and it's heartening to note that Niall Kennedy from Technorati is personally looking into this and answering user queries
Technorati Tags:
Blogs linking to this article

Tuesday, June 14, 2005

Free Publishing Tool - QumanaLE

QumanaLE, released today, is a free blog publishing application that offers bloggers choice and control when writing for the Web - creating posts and inserting Technorati tags into individual items.

QumanaLE helps writers quickly capture, organize and edit chunks of content. Users drag-and-drop pieces of text, links, pictures or images. Then, with one click you can add Technorati tags.

Edit and publish the blog post - to as many blogs as you wish ... or save it as a draft to work on later. Turn your content into a draft Word document by saving it as HTML or RTF and opening the file in Word or QumanaLE later.

Download the program and try it yourself for FREE!

Update 15th June 2005 - I have started using this software and here are some problems I am facing:
(a) The editor has no status bar. When I type in an article and click on 'Post', then I don't know what's happening until I get a message after some time, saying that it has posted the article.

(b) The editor does not create a heading/title to my post. Am I missing something here?

(c) I can save my article as a html file. However, I want the generated code to follow W3C standards, which it is not. Can they conform to W3C?

17th June 2005 -
(a) How do I use hidden Technorati tags in my post?

(b) When I drag a photo into the drop pad and I open the editor it comes up to the left; how do I float the image to the right, for instance?

(c) How do I blockquote with a quote image, in my post?
Technorati Tags: ,
Blogs linking to this article

Sunday, June 12, 2005

Tracking my site traffic

It is important to analyse your blog traffic and a post on Quick Online Tips - Tracking My Site Traffic: How to Analyze for Blog Optimization was very informative. To quote:

"This blog is not so big that I should attempt to consider analyzing web trends based on my site statistics. I came across several important indicators of my traffic so it is my humble effort to share them with you. We all have some site traffic tracker to check for how many visitors we get everyday and what is the trend. Other tracking indicators help you to fix your site for better optimization."

I too use the simple, practical tracking tool, Extreme Tracking. I have been blogging for about 20 days only but I can see some trends emerging.
(a) Countries from where my traffic is coming: India - 38.72%, USA - 36.53% If I follow Pareto's Law of 80:20 then obviously I need to keep my content focussed here. Does it mean more local flavor to my posts?

(b) Traffic by Continent: Asia - 43.71%, North America - 40.12%, Europe - 11.48% It's interesting to note that Europe traffic is slowly increasing.

(c) Days of the Week: Unique visitors were the highest on Friday - 22.16%, Saturday - 18.36% and the lowest on Sunday - 9.88% I haven't blogged enough to draw any conclusions yet. Probably it's best to post more articles towards the end of the week?

(d) Hours of the Day: Unique visitors were the highest between 10 am and 12 noon - 16.86% I need to post my articles in the morning.

These were some of the various statistics available. Have you been analysing your blog traffic? What's been your experience? I would love your feedback/suggestions.
Technorati Tags:
Blogs linking to this article

Saturday, June 11, 2005

How to start a Blog

First what's a blog? A blog is short for weblog, a kind of web page that makes it simple to post your thoughts and opinions online.
Here are some of my thoughts:I would love to hear your comments and feedback.
Technorati Tags: , ,
Blogs linking to this article

Blogging Tips

I would like to post here some of the blogging tips that I came across.
(1) I recently discovered Web CEO, an excellent tool for search engine optimization. What I love about this program, it gives me everything I need to run and promote my site. I recommend you to download the Free Edition from their Web site. Updated: 10th June 2005

(2) If you want to optimize your blog for search engines, popularly known as SEO, then you must check out these Free SEO Tools.

(3) Two sites that help you get ideas for new keywords to help you improve your ad relevance are:
Overture Tool
Google Adwords: Keyword Tool.
Updated: 12th June 2005 - Digital Point's Free Keyword Suggestion Tool shows you the results of your query from both Wordtracker and Overture for determining which phrases are searched most often.

(4) This one is related to Yahoo search - how to find pages linking to your own site. Pandia has a full article on this.
Very briefly:
(a) This one searches for inbound links - it finds all pages that link to exactly the page you tell it to. So
link:http://personalwebsiteblog.blogspot.com will find all pages that link to my blog's home page.
(b) With linkdomain you can search for all pages that link to any page within a domain. For example:
linkdomain:personalwebsiteblog.blogspot.com
Hat tip to Sebastian.

(5) If you are using Technorati to create your own tags; do not create a tag with a digit in it - Technorati fails to tag it!
Technorati Tags:
Blogs linking to this article

Friday, June 10, 2005

Technorati public beta released

This is great news! Technorati announced the launch of its public beta - a major redesign of the Technorati service. I am still digesting the various new features introduced by them. It's a thumbs-up from me. Well done.
Technorati Tags:
Blogs linking to this article

My article 'Quick Hibernate' on java.net

An article I wrote for IndicThreads last year, is on the front page of java.net today (9th June 2005). java.net is the Source for Java Technology Collaboration.
Feels good.
Technorati Tags: , , ,
Blogs linking to this article

Thursday, June 09, 2005

I love India

Gaurav's created a nice banner and is requesting all Indians who have blogs, to put up this banner on their site - Join "I Love India" campaign. I have put up the same on my blog. Have you?
Technorati Tags:
Blogs linking to this article

Wednesday, June 08, 2005

Quick Struts

This is Part 1 of the article.

A. Assumptions -
1. This article is meant for Java programmers wanting to try out the Struts Framework. There are many good books available on Struts like Programming Jakarta Struts, Second Edition by Chuck Cavaness and you must be aware of the theory behind Struts. This article is a no-nonsense, hands-on guide to get you started with Struts. The application is quite trivial, as I would like to concentrate on the Struts aspect. Undoubtedly, some aspects of what I write here could be improved upon, but that's not important right now.

2. You would be using this application on a Windows 2000/XP operating system. I have tested the application on Windows XP.

3. You have installed, configured and set the various environment variables for the following software on your PC.

a. J2SE 5.0
b. JBoss Application Server Ver 4.0.2
c. Struts Ver 1.2.7 Framework
d. mySQL Ver 4.0.24 open source database
e. mySQL Connector/J Ver 3.1.8 open source JDBC driver for the above database
f. Apache ANT Ver 1.6.5 open source automated build tool
g. Jakarta Standard Taglib (JSTL) Ver 1.1

B. The Application
Upon starting the application, the user is presented with a simple screen with two fields -

Login ID
Password

and a Submit button.

C. Tables
We just have one table called login created in mySQL. It has three fields: loginID (primary), name, password - all varchar fields. You can enter some records in this table.

Part 2 of this article will follow soon.
For those who have a problem with the installation and settings or have any other question/suggestions, please post a comment on this blog with full details.
Technorati Tags: , ,
Blogs linking to this article

Tuesday, June 07, 2005

Blogging for Money

Some blog for fun, some for money and some like me for both! And why not? So, I decided to post some articles /links here, that could earn you some money, hopefully to cover some of your costs - hosting, domain name etc.

I came across GreenZap that pays you some money for free! GreenZap is a global online payment solution provider. They provide a fast, easy-to-use and secure way for you to safely send, receive and do just about anything with money online. GreenZap can be used to purchase goods and services on EBay(r), Yahoo Auctions(r), Craig's list(tm), or any number of other consumer-driven sales sites.

Opening a GreenZap account, is F-R-E-E and once you do, you'll be a part of my community and rewarded with $25 to spend online...just for signing up! You will also be rewarded for anyone and everyone who joins your community and becomes a GreenZap member. Simply click on this GreenZap link.
Hat Tip: Bradsblog

Technorati Tags: ,
Blogs linking to this article

Monday, June 06, 2005

Do I have a Writer's Block?

I want to write an article, but I can't. I have a few articles in mind that I desperately want to get out, but, every time I sit down to it, I can't. Why can't I write?

Is it lack of Time? Not true. I spend hours going thro' the different blog feeds (170 to date) I have subscribed thro' Bloglines; surely I can devote some time from this to write.

Do I need a vacation? Again, not true. Very recently, I had taken a break from the daily grind.

Health problem? NO. Touch wood, I am in the pink of health!

I needed to do something about this and started searching on Google about 'Writer's Block'. The search gave me a long list of articles on this topic and one particular article by Lisa R. Cohen caught my eye. She mentions 'Write about Writer's Block' and hence this post! I found her site very informative.

Here are some more links to get you going too.

Merlin Mann's blog post Hack your way out of writer's block
From Purdue University
LEO: Literacy Education Online
Capital Community College Foundation
Technorati Tags: ,
Blogs linking to this article

Thursday, June 02, 2005

What are Podcasts / Podcasting?

Podcasts are audio blogs that people create as an alternate form of online expression. Some are professionally produced, like talk shows and music broadcasts, while others are less formal daily diaries and running commentary between friends. If you've got an iPod or other portable media player, and are interested in getting free, unique content to listen to, podcasting is for you. The name iPod refers to a class of portable digital audio players designed and marketed by Apple Computer. iPod offers a simple user interface designed around a central scroll wheel. Most iPod models store media on a built-in hard drive, while a lower-end model, iPod shuffle, relies on flash memory. Like most digital audio players, iPod can serve as an external hard drive while connected to a computer.
Podcasting has become the latest hyped Internet technology. It's a way of using your computer to automatically download audio shows to your iPod (or other player), so that you've always got something new to listen to. Getting started with podcasting is easy. All you need is a computer with an Internet link and a portable media player. In fact, you can listen to podcasts right on your computer.
Here are some links to get you started:
Get Started with Podcasts in 3 Steps
Make Your First Podcast
Using Bloglines to track Podcasts
Talks about PodProducer a software that will help you produce and record your podcast.
Ink Scrawl has suggested this excellent blog post - What is Podcasting and why should you care?.
iPod and iTunes: The Missing Manual - Read online Chapter 2: The iPod Sync Connection

Update: What's the relevance of iPods in India? Is it just a passing phase? I feel that they will not catch on in India. The pricing has to be just right and currently these are too costly. You would definitely hear about them and probably a few hundred would have them too, but then what's a few hundred amongst a billion+ population?

Technorati Tags: , , ,
Blogs linking to this article

Findory

Last night during my Google searches, I stumbled upon Findory, a personalized news / blog aggregator. What I liked about it was that there were no profiles to fill in and no groups to join. Every time you click on an artile to read, the site takes it as an indication of your interest. When you return to the home page, it would have adjusted the number of articles it thinks you care about. If you click on a link to an article and you feel it's not interesting, you can delete it from the list of articles you've read. Findory personalizes the homepage for each reader, recommending content based on what you have read and what new content is being published. Give it a shot.

Update: Lee Odden also thinks that Findory is better than most news services with regards to personalization.
Technorati Tags:
Blogs linking to this article

Wednesday, June 01, 2005

Blog sports a new look

Vaspers the Grate posted some constructive criticism on my blog about it's look and feel, tagline, focus and what should appear in the right column. I have incorporated a lot of Steven's suggestion and changed the focus of the blog too, as should be obvious from the new tagline. Sebastian has suggested opening a new browser window, when someone clicks on my links. What do you think about the 'new look' blog?

Update: I have added a 'Freebies' section on my side bar. Check it out.
Technorati Tags:
Blogs linking to this article