Tuesday, December 27, 2011

The 3 virtues of a great programmer

1. Laziness - The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful, and document what you wrote so you don't have to answer so many questions about it. Hence, the first great virtue of a programmer. Also hence, this book. See also impatience and hubris.

2. Impatience - The anger you feel when the computer is being lazy. This makes you write programs that don't just react to your needs, but actually anticipate them. Or at least pretend to. Hence, the second great virtue of a programmer. See also laziness and hubris.

3. Hubris - Excessive pride, the sort of thing Zeus zaps you for. Also the quality that makes you write (and maintain) programs that other people won't want to say bad things about. Hence, the third great virtue of a programmer. See also laziness and impatience.

Source : wikipedia

Cheers,

Ujjwal Soni

Monday, December 12, 2011

How to Solve Apple iCloud Verification Email Problem

Apple recently launched its cloud storage service, iCloud. When I tried setting up iCloud on my iPhone4, I was stuck with the verification email problem. The set up wizard kept asking for iCloud email verification but I couldn’t find any option to send or resend iCloud verification email to my email address so that I can verify it. On further research I found that Apple has changed the way it handles Apple ID. Your email address and Apple ID now have to be same; this is unlike how Apple used to handle Apple ID and email address. Till now you could create multiple Apple IDs with one email address or, in other words, a single email address could have been associated with multiple Apple IDs. This got me to the root of the problem why I was not receiving the iCloud verification email. If you are facing the same problem, please follow the steps below to receive iCloud verification email:

1. Go to https://appleid.apple.com/

2. Click on “Find out” link under “Not sure if you have an Apple ID?”



3. Fill out your first name, last name and the email address that you want to use for receiving iCloud verification email.

4. On the next screen, select “Email Authentication” option and click “Next”.

5. Now, go to your Email Inbox and you will find an email from Apple on how to reset the Apple ID password. Click on the “Reset your Apple ID password” link in the email.

6. You will be shown more than one Apple IDs that are associated with your email address.


7. Now, choose the Apple ID that you would NOT like to use for receiving iCloud verification email and click “Next”.

8. Reset the password for this account by providing a new password.

9. Login to Apple ID by visiting https://appleid.apple.com/ and clicking “Manage your account” link. Use the Apple ID that you would NOT like to use for receiving iCloud verification email and the password that you had just set.

10. Click on “Edit” link under “Primary Email Address” section, provide a new email address. Click “Save”.

11. Click Sign Out.

Once you have changed the email address for the Apple ID that you would NOT like to use for receiving iCloud verification email, it’s time to set things right in the Apple ID that you would like to use for iCloud services. Just log in to your account https://appleid.apple.com/with Apple ID that you would like to use for receiving iCloud verification email. You should now see the link to resend verification email under your email address. Click on that link, confirm your email address and you will be all set to use iCloud.

Friday, December 9, 2011

TinyMCE Text Area

Hi All,

Recently i was preparing an application which was based on JSP/Struts, i had a requirement to implement custom font, color selection for each text area on the screen (the screen had multiple text-areas), i found a cool script which allows me to implement visual effects to my text areas, TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems.

http://www.tinymce.com

Its very easy and fast to implement..:)

Thanks,

Ujjwal Soni

Thursday, November 10, 2011

Create Secure Jars

Hi.

Recently, There was a need to create JARS which cannot be decompiled as I want to secure my source code.

I found obfuscated jar. bytecode obfuscator modifies the content of source files in such a way that their behaviour is unaffected while minimizing the amount of info from the source code thats exposed. Retroguard was the well known commercial obfuscator for java. There are opensource s/w as well.

See the official link and choose the one that fits your needs.

http://www.linkedin.com/redirect?url=http%3A%2F%2Fjava-source%2Enet%2Fopen-source%2Fobfuscators&urlhash=vWAH

Cheers,

Ujjwal Soni

CSS Compression Online Tool

CSS Compressor online tool to compress CSS to reduce CSS code size and make your web pages load faster. You can select from four levels of compression, depending on how legible you want the compressed CSS to be versus degree of compression. It is quick, easy and free!

http://www.csscompressor.com/

Cheers,

Ujjwal Soni

Sunday, November 6, 2011

ORA-01006: bind variable does not exist

Hi,

Recently one of my collegue faced an error as "ORA-01006: bind variable does not exist". We could'nt rectify the reason for this error, later on, we discovered that there was a comma missing in callable statement parameter declaration.

it was something like ::

  CallableStatement cstmt =
             dbConnection.prepareCall("{call my_new_proc(?,?,?,?" + "?,?" +")}");


which should be like ::

  CallableStatement cstmt =
             dbConnection.prepareCall("{call my_new_proc(?,?,?,?" + ",?,?" +")}");


There can be many reasons for this error, but the one which we discovered was this one.

Cheers,

Ujjwal Soni

Tuesday, October 18, 2011

How to use multiple onloads with external scripts ?

Hi All,

First of all thanks for visiting my blog. I recently working on oracle portlets and i had to add multiple portlets on my single page, that created conflict since both portlets had onload events and that created multiple onload events.

Scripts probably conflict most often when using the onLoad event. Have you ever used code like this?

window.onload=myInitFunction;

This is fine if you're sure myInitFunction() will be the only function that needs to be called when the page is loaded. But how can you know for sure? What if a page that calls your script has code in its ? What if there's another external script on the page that also assigns a function to the onload event? The code above will overwrite what was there with your code and that's not good.

Use the function below to add your function without replacing what is already in the onLoad.

function addOnloadEvent(fnc){
  if ( typeof window.addEventListener != "undefined" )
    window.addEventListener( "load", fnc, false );
  else if ( typeof window.attachEvent != "undefined" ) {
    window.attachEvent( "onload", fnc );
  }
  else {
    if ( window.onload != null ) {
      var oldOnload = window.onload;
      window.onload = function ( e ) {
        oldOnload( e );
        window[fnc]();
      };
    }
    else
      window.onload = fnc;
  }
}
example ::

addOnloadEvent(myFunctionName);

// Or to pass arguments

addOnloadEvent(function(){ myFunctionName('myArgument') });

Cheers,

Ujjwal Soni