Updates from September, 2007 Toggle Comment Threads | Keyboard Shortcuts

  • Subinkrishna Gopi 3:40 pm on September 28, 2007 Permalink |
    Tags: Live, ,   

    New enhanced Microsoft Live Search 

    Microsoft, the world’s largest software maker, said Windows Live search is now on an even technology footing with offerings from rival search engines after years of playing catch-up since it started developing its own Web search in 2003.

    Its new presentation is in line with an industry trend to step beyond traditional text links, with unified search results that offer Web sites, news, pictures and video on one page. Rivals Google Inc and Ask.com made similar changes this year, and Yahoo Inc is moving in that direction.

    “Microsoft is realistic. It doesn’t think it’s going to wake up tomorrow and overtake Google,” said Allen Weiner, an analyst at research firm Gartner. “Right now, Microsoft wants to establish itself more firmly with its existing users.”

    Source: tech2.com

  • Subinkrishna Gopi 10:42 am on September 21, 2007 Permalink |
    Tags: , o'reilly, , , ,   

    What is Web 2.0? 

    What is Web 2.0? Is that a higher version of World Wide Web? Yes and No. Confused? Web 2.0 is not the updates happened to the technical specifications of World Wide Web. But its the revolution happened b’ coz of the way how developers and the users used web as a platform. In Web 2.0, internet is considered as a platform to deliver applications to the users like never before. Technologies like weblogs (blog in short), social networking, social book marking, web APIs, web services & many-to-many publishing (like RSS feeds & podcasts) revolutionized internet & its usage. And Web 2.0 is this change happened to internet.

    According to Tim O’Reilly, “Web 2.0 is the business revolution in the computer industry caused by the move to the internet as platform, and an attempt to understand the rules for success on that new platform.”

    Technology infrastructure evolving in Web 2.0 includes content syndication, messaging protocols, browsers with plugins & extensions, client application frameworks etc.

    Useful Links

  • Subinkrishna Gopi 1:42 pm on September 20, 2007 Permalink |
    Tags: , lotus, , office, word processor   

    Lotus Symphony – IBM’s free office suite 

    IBM Lotus Symphony
    IBM has released the latest version of their office suite Lotus Symphony. There is Lotus Symphony Documents – a word processor, Lotus Symphony Presentations – a presentation tool & Lotus Symphony Spreadsheets – a spreadsheet package.

    This office suite allows the users to edit & save Microsoft ® Office file and can export documents to Adobe ® Portable Document Format (PDF).

    “IBM® Lotus® Symphony™ has something for everyone, like a community-oriented site with tips, a template gallery and support to help you succeed. Businesses can gain more control over spiraling upgrade costs, while still protecting, accessing and maintaining documents well into the future. And for developers, Lotus Symphony tools support Microsoft® Windows® and Office applications, which means you can get even more from your current investments.”

    Source: Lotus Symphony website.

    Useful Links:
    Home Page: http://symphony.lotus.com/software/lotus/symphony/home.jspa
    Download Page: https://www14.software.ibm.com/iwm/web/swerplotus/LotusSymphonyPick.html

  • Subinkrishna Gopi 2:57 pm on September 14, 2007 Permalink |  

    Java performance tips – Part 2 : Better String handling 

    StringBuffer vs String

    As we all know both String & StringBuffer are used to hold string (character sequence) values. The basic & the most important difference between the objects being created using String & StringBuffer : objects of String are immutable (means, no one can change it); but the objects created using StringBuffer are mutable. Consider the following code block,

    // Example 1 
    String aString = "Hello"; 
    aString = aString + "World !";
    // Example 2 
    StringBuffer aStringBuffer = new StringBuffer("Hello"); 
    aStringBuffer.append("World !");

    Here both example 1 & 2 are doing the same thing. If someone ask us which one we think is a better way to append a string to other, hmmm… sometimes, no most of the times people may choose the first method. B’ coz the “+” operator seems super cool, right?

    The String concatenation using the “+” works in a crazy way. It will internally create a temporary StringBuffer object using the current value and will use the append() to get the things done. Why? Any guess? Yeah, you are right. B’ coz the object created using String is immutable.

    I found the byte-code equivalent of both the string concatenation from javaworld.com. Let’s have a look at it.

    Byte-code equivalent of example 1:

    0 new #7 <Class java.lang.String> 
    3 dup 
    4 ldc #2 <String "Hello"> 
    6 invokespecial #12 <Method java.lang.String(java.lang.String)> 
    9 astore_1 
    10 new #8 <Class java.lang.StringBuffer> 
    13 dup 
    14 aload_1 
    15 invokestatic #23 <Method java.lang.String valueOf(java.lang.Object)> 
    18 invokespecial #13 <Method java.lang.StringBuffer(java.lang.String)> 
    21 ldc #1 <String "World !"> 
    23 invokevirtual #15 <Method java.lang.StringBuffer append(java.lang.String)> 
    26 invokevirtual #22 <Method java.lang.String toString()> 
    29 astore_1

    Byte-code equivalent of example 2:

    0 new #8 <Class java.lang.StringBuffer> 
    3 dup 
    4 ldc #2 <String "Hello"> 
    6 invokespecial #13 <Method java.lang.StringBuffer(java.lang.String)> 
    9 astore_1 
    10 aload_1 
    11 ldc #1 <String "World !"> 
    13 invokevirtual #15 <Method java.lang.StringBuffer append(java.lang.String)> 
    16 pop

    I donno how to interpret it. But we can easily understand what is happening there, right?

    StringBuffer vs StringBuilder

    StringBuilder is same as StringBuffer but not thread-safe. All the public methods of StringBuffer are synchronized. StringBuilder offers better performance than StringBuffer in most of the conditions. StringBuffer is advised to use only if some kind of synchronization is needs.

  • Subinkrishna Gopi 6:30 pm on September 13, 2007 Permalink |  

    Different ways to create objects in Java 

    This is a trivia. Yeah, it’s a bit tricky question and people often get confused. I had searched a lot to get all my doubts cleared.

    There are four different ways (I really don’t know is there a fifth way to do this) to create objects in java:

    1. Using new keyword
    This is the most common way to create an object in java. I read somewhere that almost 99% of objects are created in this way.

    MyObject object = new MyObject();

    2. Using Class.forName()
    If we know the name of the class & if it has a public default constructor we can create an object in this way.

    MyObject object = (MyObject) Class.forName("subin.rnd.MyObject").newInstance();

     3. Using clone()
    The clone() can be used to create a copy of an existing object.

    MyObject anotherObject = new MyObject(); 
    MyObject object = anotherObject.clone();

    4. Using object deserialization
    Object deserialization is nothing but creating an object from its serialized form.

    ObjectInputStream inStream = new ObjectInputStream(anInputStream ); 
    MyObject object = (MyObject) inStream.readObject();

    Now you know how to create an object. But its advised to create objects only when it is necessary to do so.

    • amareswar 4:48 pm on October 18, 2007 Permalink

      one more is through creation of object using classloader

      like this.getClass().getClassLoader().loadClass(“com.amar.myobject”).newInstance();

    • Subin 11:40 am on October 19, 2007 Permalink

      Hi Amar,

      Thank you for this one. I wish to hear more from you 🙂


    • subavinodhini 12:41 pm on September 3, 2009 Permalink

      It is also possible to create an object through
      factory methods

      Ex:- NumberFormat obj=NumberFormat.getInstance();

    • Subinkrishna G 12:54 pm on September 3, 2009 Permalink

      Thank you for your comment. But NumberFormat.getInstance() is just a wrapper. Internally the getInstance() is using ‘new’ keyword to create an object.

      — Subin

    • subavinodhini 5:36 pm on September 14, 2009 Permalink

      Hi Subin,

      Thanks for your immediate reply.I have checked the Java API,Then the newInstane() is also using the new operator internally right.


    • Subinkrishna G 9:59 pm on September 15, 2009 Permalink

      Class.forName().newInstance() is using the reflection API to create an object.


    • pacesettergraam 3:39 pm on December 25, 2012 Permalink

      Reblogged this on pacesettergraam.

    • maadamvenkataramana 5:03 pm on June 10, 2013 Permalink

      Another way is
      Class c=MyClassName.class;
      MyClassName mcn=(MyClassName)c.newInstance();

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc