Tuesday, December 09, 2008

XMLGregorianCalendar, DateTime etc

If you are interested in creating a new instance of XMLGregorianCalendar, then the following code should work for the current time and timezone.

==============================================
DatatypeFactory dtf = DatatypeFactory.newInstance();
XMLGregorianCalendar xgc = dtf.newXMLGregorianCalendar();

Calendar cal = Calendar.getInstance();
xgc.setYear(cal.get(Calendar.YEAR));
xgc.setDay(cal.get(Calendar.DAY_OF_MONTH));
xgc.setMonth(cal.get(Calendar.MONTH)+ 1);
xgc.setHour(cal.get(Calendar.HOUR_OF_DAY));
xgc.setMinute(cal.get(Calendar.MINUTE));
xgc.setSecond(cal.get(Calendar.SECOND));
xgc.setMillisecond(cal.get(Calendar.MILLISECOND));

// Calendar ZONE_OFFSET and DST_OFFSET fields are in milliseconds.
int offsetInMinutes = (cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET)) / (60 * 1000);
xgc.setTimezone(offsetInMinutes);
=================================================

Simpler option:

=================================================
GregorianCalendar gc = new GregorianCalendar();
DatatypeFactory dtf = DatatypeFactory.newInstance();
XMLGregorianCalendar xgc = dtf.newXMLGregorianCalendar(gc);
==================================================

Tuesday, November 04, 2008

Blackberry: Calls go directly to VoiceMail

Profiles. Check the one that is active. Go to Phone. Ensure that "Do not disturb" is set to off.

Monday, November 03, 2008

findbugs Cheatsheet

1) Open the following link (Using Java Webstart):
http://findbugs.cs.umd.edu/demo/jnlp/findbugs.jnlp

This will download the latest findbugs distribution.

2) In the GUI, create a new project and then browse to the directory where your compiled jars exist.

3) Do an analysis.

4) Fix bugs, compile and then ask the gui to do reanalysis. File->Do reanalysis

That is it.

Reference: http://findbugs.sourceforge.net/

Thursday, October 23, 2008

Microsoft Critical Security Update (XP/Vista)

Microsoft has released a critical security update to XP and Vista on October 23, 2008.

http://www.microsoft.com/technet/security/Bulletin/MS08-067.mspx


Vulnerability in Server Service Could Allow Remote Code Execution

Monday, September 15, 2008

Surefire Plugin fails to do java endorsed

Suppose you are trying to endorse xerces and xalan in your surefire plugin and you see errors such as:
Caused by: java.lang.RuntimeException: internal error
at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.applyFacets1(Unknown Source)
at org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl.createBuiltInTypes(Unknown Source)
at org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl.(UnknownSource)
... 45 more

This may mean that your setting of endorsed directory is not being propagated properly to the forked jvm by surefire. This was an issue in the 2.4.2 version of surefire.

This has been fixed in Surefire 2.4.3 (http://jira.codehaus.org/browse/SUREFIRE-491)

Saturday, September 13, 2008

Nikon D90/D80, Canon 40D EXIF Viewer

If you are interested in viewing the EXIF data and play with it, then you can take a look at the following free software.


http://www.opanda.com/en/iexif/


Other Options:

http://www.exifer.friedemann.info/


If you need support for RAW,
http://www.videozona.ru/software/ShowExif/showexif.asp

Thursday, September 11, 2008

Recursively ignore "target" directory in svn

Suppose you are working with maven and svn tries to add target, what you can do to recursively ignore the target directory is:

svn propset -R svn:ignore target .

or you can do the following:

===================

$> svn ps svn:ignore 'target
target-eclipse
.settings
eclipse-target' .

===================

Remember that each ignorable entity should be on one line.

======================
anil@localhost:~/identity/identity-doc/trunk$ svn -R propset svn:ignore '.classpath
> .project
> .metadata
> target
> target-eclipse' .
property 'svn:ignore' set (recursively) on '.'

Monday, September 01, 2008

Lightning Plugin for 64 Bit Fedora

If you need the latest lightning plugin for Mozilla Thunderbird on 64 Bit Linux, then you can take a look at the mozilla site:
http://releases.mozilla.org/pub/mozilla.org/calendar/lightning/releases/0.8/contrib/linux-x86_64/


Good Luck.

Thursday, July 31, 2008

Where is Iced Tea javaws on Fedora?

If you are looking to run jnlp files via web start on Fedora, then look for javaws under either:

/usr/lib/jvm/java-openjdk/bin/

or

/usr/bin

Thunderbird: Export Message Filters and Import across accounts

If there is a need to export and then import message filters in your thunderbird accounts:

Thunderbird Add-On:

https://addons.mozilla.org/en-US/thunderbird/addon/2474


Export Filters:
Tools->Message Filters. Then export the filters into any file.

Import Filters:
Tools -> Import Filters. Then choose the account you want the filters into. Choose the file where the exported filters exist and then apply the filters.

Sunday, June 22, 2008

Opera 9.5 or Firefox 3 - Which is better?

Well, the debate is similar to whether Eclipse is better than IntelliJ in Java IDEs.... There is no clear winner. Both have their positives and negatives. They are both security conscious. :)

Interesting read here:http://www.linux.com/feature/139212

Monday, June 16, 2008

Mozilla Firefox 3 release on June 17th

http://www.mozillazine.org/talkback.html?article=23871 and primarily DeveloperNews have strongly hinted at a Mozilla Firefox 3.0 release on June 17th (Tuesday), 2008.

Keeping fingers crossed.

Wednesday, June 11, 2008

Marc Fluery

Reading the "5 Reasons Why JBoss Founder Marc Fleury is My Hero", I am reflecting on some of the things I liked about Marc.

1) As the other post mentioned, I have seen and heard from folks about how Marc took chances with people. He sometime made quick decisions to hire folks during the first meeting itself. It is better to hire someone and (rarely) get burned than not hiring at all. Talent is precious and rare. It is no secret that the JBoss group built the popular Application Server and is continuing to execute, using a small set of precious talent.
2) Elocution, diction, charisma, glamour et.al characterized his speaking engagements and talks. People would arrive in large groups and be enthralled by his talks, because he would always display his passion - Professional Open Source and ASPECTIZED MIDDLEWARE.
3) He could write blog entries rapidly with great control over content. I think he still does on his blog.

I can say more about the man who is "million"(s) of times richer than me, but it will suffice to say that marcf radiated passion, intuition and charisma (Please do not listen to those who were subjected to marcf's SMD pointers). ;)

Thursday, June 05, 2008

Ralio joins JBoss.org

A recent announcement is indicating that Ralio is going open source and on jboss.org.

References:
http://www.jboss.org/railo/

Monday, June 02, 2008

Open Office does not show slide numbers

You have to do View-> Master-> Master Elements -> Slide Number for the slide number to become visible on your slide, if it does not.

Friday, May 23, 2008

Linux Wireless Setup Common Problems

1) Error for wireless request "Set Mode" (8B06) :
SET failed on device wlan0 ; Device or resource busy.

Determining IP information for wlan0... [Failed]

Solution: Change the settings in Network Manager for Fedora (or your distro) to not start the card at startup.

Additionally, add Network Manager and NetworkManagerDispatcher in the services.


References:
1. Link1
2. Link 2

Thursday, May 22, 2008

Windows XP SP2 install on Thinkpad T61

If the windows install says "No Hard Disk Found", then
1) Go to BIOS setup (F1 at BIOS screen)
2) Select Config
3) Select Serial ATA (SATA)
4) Select "Compatibility"

Once you've installed Windows XP, be sure to download the "Intel Matrix Storage Management Driver," as specified below. Once the software is installed, you may go back into the BIOS setup, and do the same as above--but set it to "AHCI" instead.

Intel Matrix Storage Manager Driver/SATA Hard Drive
Windows XP does not include support for the SATA hard drive out of the box. To install, you have two options. ONE, have the hard drive in "Compatibility" mode, which will allow you to install XP without worrying about drivers. SECOND, you can download and extract the drivers to an external storage device, and install them when the XP installation asks if you'd like to manually install any drivers. Note that, in my experience, the first option is easiest--afterall, you can easily install the drivers after XP is installed, and then switch back to AHCI mode.

If you're interested, the drivers are available here (they also contain detailed instructions on both methods of installation):
http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&lndocid=MIGR-62909

Problem: During installing the Audio Drivers, if you see "HDA Audio Bus Driver required for Installation", then download Microsoft hot fix KB88111 from URL
and then once you install this, XP should say "Found New hardware". Now, install your audio drivers.

Additional Information
http://seamlesstrust.org/trustwiki/index.php/Windows_XP2_install_on_Thinkpad_61

Monday, May 19, 2008

Steve Ballmer feasts on eggs at Hungarian University

It is really an unfortunate incident where Steve Ballmer is subjected to a flurry of eggs by a protestor at an Hungarian University.





Well Steve. You are not the only one. Gov.Arnold Schwarggeneger was subjected to one during the Gubernatorial race.

Sunday, May 18, 2008

Free FTP Client for Windows

Do not be swayed by the myriad commercial tools (even free ones). What you need is Filezilla.

http://sourceforge.net/projects/filezilla/


Free FTP Client For Windows (or any other platform) is Filezilla. Do a google search on it.

Installing Mediawiki on Windows (Simple Guide)

Let us say that you want to install a wiki on your home computer/server for personal reasons and it is running windows... The following cheat sheet will help you get a mediawiki installed.

1) Get XAMPP Lite from http://www.apachefriends.org/en/xampp-windows.html
2) Unzip it into C: directory
3) Unzip media wiki into C:
4) Now under C:/xampplite/htdocs, copy the mediawiki directory and rename it to something that you want the wiki to be called - htdocs/mywiki or htdocs/personalwiki etc.
5) Start apache,mysql using the bat scripts under c:/xampp-lite.
6) http://localhost/mywiki or http://localhost/personalwiki (or any other wiki name you have given).
7) Configure your mediawiki.
8) Move the LocalSettings.php file one level up in the folder structure.

DONE!

Troubleshooting
"Could not find a suitable database driver! * For MySQL, compile PHP using --with-mysql, or install the mysql.so module"

- You are trying to do the regular mediawiki install. Try the xampp way.

"Parse error: syntax error, unexpected T_NAMESPACE, expecting T_STRING"

- PHP 5.3 issue. Use PHP 5.2 until there is a mediawiki fix for this.

Failed opening required includes/WebStart.php

- Check the case of the file names transferred. Some free commercial ftp agent had converted mixed case file names during transfer all to lower case. FileZilla maintains the case of the files during transfer.


Reference
:
Customizing MediaWiki
Adsense With MediaWiki

Tuesday, May 13, 2008

HP acquiring EDS for $14B. What does it mean?

Wow, the acquisitions are happening at a staggering pace. Think of the workforces, heterogeneous systems and cultures that need to be synergized. The acquisition of EDS by HP for $13.2+ billion means opportunities for HP in the services world.

Monday, May 12, 2008

NoroVirus at Java One 2008

Please tell me that this story is not true. I am hearing reports of attendees falling sick at the Java One Conference in Moscone Center. Apparently, Norovirus is the culprit.

http://ginasmith.typepad.com/gina_on_gina/2008/05/just-got-back-f.html


Some references are mentioned here.

Another reference is http://www.theserverside.com/news/thread.tss?thread_id=49341

This morning, I found out what was wrong. I got one of those delightful ALL CAPS emails from JavaOne informing me that we had all been the subject of a viral attack by the dreaded Norovirus. So that was it!


Seriously, Java One is quite boring if you just attend the conference. What you should look forward to is meeting your colleagues (from different parts of the world), meet your competitors, share tips from the landscape and make social/professional contacts. For that matter, any conference is boring if you do not take into effect the "Human" factor.

I hope the Virus outbreak will not dampen the spirits of frequent Java One attendees.


http://technoracle.blogspot.com/2008/05/moscone-norovirus-javaone-truth-please.html

refers to potentially serious happenings at the Moscone....

Mark Little talks about the virus outbreak in his blog post.

Friday, May 09, 2008

Where is JRockit downloads?

There is a thread on bea forums looking for JRockit downloads.
http://forums.bea.com/thread.jspa?threadID=570000807

It is not clear where the downloads for jrockit are..

You can get the patched versions of jrockit for security vulnerabilities from BEA security advisory.
http://dev2dev.bea.com/pub/advisory/277

Thursday, May 01, 2008

PCI Compliance for ECommerce Software

I am placing the following link as a reference.

Websphere eCommerce Software and PCI-DSS.

Link.

Monday, April 28, 2008

SVN recover deleted files

Two steps

1) svn log --verbose
2) svn up -r 123457 file.txt

where 123457 is any revision that you want to get the file from.

References:

http://seamlesstrust.org/trustwiki/index.php/SVN_Recover_Deleted_Files

Wednesday, April 23, 2008

Configure the JDK Logging

If you have code in your application, for example from third party libraries that uses the standard JDK logging, then you should be able to create a logging.properties file and pass it as a system property as in:


java -Djava.util.logging.config.file=logging.properties


Let us take a look at a sample logging.properties.


handlers= java.util.logging.ConsoleHandler.level= INFO
java.util.logging.ConsoleHandler.level = FINER
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
org.something.something = FINER
org.apache.tomcat.catalina = FINER

Sunday, April 13, 2008

firewire to USB adapter

Many times your mac software works mainly with firewire enabled externals. Example, you want to boot from an external firewire enabled disk. Unfortunately, your external drive supports USB. There is no firewire support.

You look for a Firewire to USB adapter. Unfortunately due to the incompatibilities of the specifications, such an adapter does not exist. What a shame. :(

Thursday, April 03, 2008

Tomcat shutdown.sh shuts down all tomcat instances

If you are running tomcat instances on multi-homed machines, then by default, the shut down scripts will kill all tomcat instances on the box. What you need to do is change the shutdown port in conf/server.xml


<Server port="8011" shutdown="SHUTDOWN">


The default port that is present here is 8005.

Wednesday, April 02, 2008

How To: Debug Web Applications on Tomcat with JPDA

Suppose you want to debug a servlet in eclipse.

WINDOWS:-

Step 1: Change your catalina.bat with the following changes


if not "%JPDA_TRANSPORT%" == "" goto gotJpdaTransport
set JPDA_TRANSPORT=dt_socket
:gotJpdaTransport
if not "%JPDA_ADDRESS%" == "" goto gotJpdaAddress
set JPDA_ADDRESS=8787


Step 2: Start Tomcat with

catalina start jpda


Step 3: Open your debug dialog in Eclipse. Add a remote java application with port "8787".

UNIX/LINUX:
No change really needed.

$>./catalina.sh jpda start
$>./catalina.sh jpda stop

Eclipse needs to have a remote java application with port "8000"

Where is Tomcat endorsed directory?

If you are haunted by this question, then for Tomcat 5.x, the folder is tomcat/common/endorsed. For Tomcat 6.x, create a endorsed directory under tomcat. tomcat is basically where the CATALINA_HOME is pointing to.

Under endorsed dir, you should have the following jars (and any other jars needed):

asaldhana~/apache-tomcat-6.0.16/endorsed>ls
resolver.jar serializer.jar xalan.jar xercesImpl.jar xml-apis.jar

Wednesday, March 26, 2008

Demise of MOT

Wow, what an interesting read on the potential demise of a great American technological gorilla called as Motorola or MOT.

Read it here: Motorola insider tells all about the fall of a technology icon

Some interesting bits:


After the success of the RAZR, while Geoffrey was tied up every which way in ROKR development, meetings, criscrossing travel, and so on, through his associates I implored the company to beef up their software expertise, and focus on creating socially networked devices (this was in the years before MySpace and Facebook became the juggernauts they are today). Your predecessor, Ed Zander, had little interest in this, and instead insisted on parlaying his relationship with Steve Jobs into the ill-fated ROKR effort in order to prop up Motorola's stock price.

Tuesday, January 22, 2008

JBoss Classloaders

Here is a nice description of the JBoss Classloaders in action, pictorially.

Deployers and Classloaders

Friday, January 11, 2008

Whatis: Upstream Projects and Downstream Projects

Upstream projects of an IT project are those that depend on the IT project.
Downstream projects of an IT project are those that the IT project depends on.