Monday, September 21, 2009

Loading Message Resources From Database

Instead of loading message resource from properties file, here is the code to how to use database as a message resource bundle in struts applcation.

DBPropertyMessageResources.java

public class DBPropertyMessageResources extends MessageResources {

public DBPropertyMessageResources(MessageResourcesFactory factory, String config,boolean returnNull) {

super(factory, config,returnNull);

this.factory=factory;

this.config=config;

this.returnNull=false;

}

public String getMessage(Locale locale, String key) {

String result = DBPropertyMessageService.getMessage(locale, key,

returnNull);

// we need to flush the cache of the super class MessageResource as

//we want to have real dynamic data here (no caches

//except the one in DBPropertyMessageService)

formats.clear();

return result;

}

}


DBPropertyMessageResourcesFactory.java


public class DBPropertyMessageResourcesFactory extends

MessageResourcesFactory {

public MessageResources createResources(String config) {

return new DBPropertyMessageResources(this, config, this.returnNull);

}

}


DBPropertyMessageService.java


public class DBPropertyMessageService {

public static String getMessage(Locale locale, String key, boolean returnNull) {

key=null;

returnNull=true;

locale=null;

// do the jdbc coding to get the value from the database using the key

return "sparkle software";

}

}


struts-config.xml

<message-resources factory="com.sparkle.resources.DBPropertyMessageResourcesFactory" parameter="param1"/>

Sunday, September 6, 2009

Search Engine for API Search

When I was doing research this morning, I came to know that there is a search engine for API search called gotAPI.com. They have got all kinds of api search like java, database, ajax, frameworks etc. And now, they have launched new beta version of gotAPI.com http://beta.gotapi.com/ this have got lot of new features and included more api's. It will be helpful for developers, so I thought of writing this post.

Friday, September 4, 2009

Java Magic Number

A numerical identifier for the class file. It should always be CAFEBABE, in hex, stored in the first 4 bytes of the class file. The easiest way to corrupt a class file’s magic number is to upload it to your website with FTP failing to turn on the binary option

Sometimes during the transmission of files, the connection may be aborted, or may be scrambled, causing class loading to fail. Sometimes when copying files over to a web server, they may become garbled or a disk error might occur. For this reason, special care is taken by the JVM and the class loader, to verify that classes are intact. One of the precautions is that every class definition contains at the beginning the magic number, a sequence of four bytes that identify a file as a Java class definition file.

Yahoo meme

Yahoo launches a microblogging platform which looks like twitter. Now in English version of Yahoo meme

Monday, August 10, 2009

Google Caffeine - New version of Google Search?

Google has just unveiled a “secret project” of “next-generation architecture for Google’s web search“.

What's New

The categories for the new search engine on are as follows: speed, accuracy, temporal relevancy, and index size. Here’s how we define those:

Speed: How fast can the new search engine load results?

Accuracy: Which set of results is more accurate to the search term?

Temporal Relevancy: Is one version of search better at capturing breaking news?

Index Size: Is it really more comprehensive than the last version of Google?


Please visit the web developer preview of Google's new infrastructure at http://www2.sandbox.google.com/ and try searches there.

Tuesday, August 4, 2009

Servlets vs Portlets

  • Portlets are not accessible by a URL. Portlets are intended to be part of a page, as opposed to being independent pages.
  • Browsers and web clients interact with portlets through the portal server. Portlets can neither set HTTP headers, nor be aware of the client URL.
  • The portal server provides a customized subset of the request object to a portlet.
  • Portlets only contribute a fragment of the HTML page that is eventually presented to the browser, and not the whole page. A portal server aggregates these fragments from various portlets to create a final page.
  • Portlets come with certain modes and window states that make them function independently of the whole page behavior.
  • Portlets have access to some specialized functionality that allows storage of states and preferences across requests and sessions.

Monday, August 3, 2009

Eclipse based LDAP Browser and Directory Client

Apache Directory Studio is a completely directory tooling platform intended to be used with any LDAP server however it is particularly designed for use with Apache Directory Sever.

Features
  • LDAP Browser
The LDAP Browser has been designed to work with almost any LDAP server available. It not only permits to read and display the tree of your LDAP Server but also allows you to modify it by creating, editing or removing entries.
  • LDIF Editor
The LDIF Editor is a tool for editing LDIF files. It provides syntax highlighting and content assistance.
  • Schema Editor
The Schema Editor has been designed to edit the schema files in the OpenLDAP format. It allows you to edit easily attribute types and object classes for Apache Directory Server and OpenLDAP.
  • Embeded ApacheDS
Apache Directory Studio bundles the latest version of the LDAPV3 certified Apache DS. Creating and launching a new LDAP server now takes less than 10 seconds!
  • ApacheDS Configuration
The Apache DS Configuration Editor can be used to edit the server configuration ('server.xml' file) of an Apache Directory Server installation.
  • ACI Editor
The ACI Editor allows you to define, for an entry or a set of entries, graphically or manually (in souce code mode), an ACI (Access Control Information) item specification for Apache Directory Server.
  • Internationalization
Apache Directory Studio is now internationalized in English, French and German. We're also open for volunteers who want to add another language support.
  • Multi-platform & in eclipse
Based on Eclipse, Apache Directory Studio is a multi-plaform application that runs on Mac OS X, Linux and Windows, and also as plugins inside Eclipse itself.

Friday, July 31, 2009

New Features and Enhancements in JDK 7

Thursday, July 30, 2009

Tips for Using Tomcat in Production

  1. If you're running on a 1.5+ JVM, add the following to your JAVA_OPTS in catalina.sh (or catalina.bat for Windows):

    1. -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/j2ee/heapdumps

    Then use a tool such as YourKit to analyze the heapdump file.

  2. Straight from the Tomcat documentation on Jasper 2...

    When using Jasper 2 in a production Tomcat server you should consider making the following changes from the default configuration.
    development - To disable on access checks for JSP pages compilation set this to false.
    genStringAsCharArray - To generate slightly more efficient char arrays, set this to true.
    modificationTestInterval - If development has to be set to true for any reason (such as dynamic generation of JSPs), setting this to a high value will improve performance a lot.
    trimSpaces - To remove useless bytes from the response, set this to true.

  3. Use Tomcat's clustering/session replication capability to minimize application user impact during maintenance periods.
  4. Implement custom error pages to hide raw exception messages. To do this, simply add something like the following to your web.xml:

    1. <error-page>
    2.    <error-code>404</error-code>
    3.    <location>/error/404.html</location>
    4. </error-page>

  5. Eliminate System.out and System.err statements from application code and use a logging toolkit such as Log4J for application logging.
  6. Leverage Tomcat's shared library directory. If you're loading several applications with several of the same library dependencies, consider moving them from the applications' WEB-INF/lib directory to Tomcat's shared library {catalina.home}/shared/lib. This will reduce the memory used by each application and result in smaller WAR files.

  7. Tweak memory parameters. Most of the time you will want to make a change to the default settings. The best advice here is to create a development environment that matches your production environment and load test the application. While you do this you can also use a profiler to identify bottlenecks, etc.
  8. Remove unnecessary applications.
  9. Secure the Manager application. By default there are no users with the manager role. To make use of the manager webapp you need to add a new role and user into the CATALINA_HOME/conf/tomcat-users.xml file.

    1. <role rolename="manager">
    2.    <user username="darren" password="ReallyComplexPassword" roles="manager"></user>
    3. </role>

    Use a valve to filter by IP or hostname to only allow a subset of machines to connect (i.e. LAN machines). This can be configured at the Engine, Host, or Context level in the conf/server.xml by adding something like the following:


    1. <!-- allow only LAN IPs to connect to the manager webapp -->
    2. <!-- contrary to the current Tomcat 5.5 documation the value for 'allow' is not a regular expression -->
    3. <!-- future versions may have to be specified as 192.168.1.* -->
    4. <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="192.168.1.*"></Valve>

  10. Strip down server.xml by removing comments to make it easier to read and remove connectors that you don't need. An easy way to do this is the following: Rename CATALINA_HOME/conf/server.xml to CATALINA_HOME/conf/server-original.xml and rename CATALINA_HOME/conf/server-minimal.xml to CATALINA_HOME/conf/server.xml. The minimal configuration provides the same basic configuration, but without the nested comments is much easier to maintain and understand. Do not delete the original file as the comments make it useful for reference if you ever need to make changes. Unless you are using Tomcat with the Apache server, comment out this line in CATALINA_HOME/conf/server.xml:
    <Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3">

  11. Split your Tomcat installation for added flexibility when it comes time to upgrade Tomcat. See the "Advanced Configuration - Multiple Tomcat Instances" section in the RUNNING.txt file of the Tomcat distribution.
  12. Precompile JSPs (at build time).
  13. Secure directory listings. In CATALINA_HOME/conf/web.xml:

    1. <servlet>
    2.    <servlet-name>default</servlet-name>
    3.    <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>   
    4.    <init-param>
    5.       <param-name>debug</param-name>
    6.       <param-value>0</param-value>
    7.    </init-param>
    8.    <init-param>
    9.       <param-name>listings</param-name>
    10.       <param-value>false</param-value>  <!-- make sure this is false -->
    11.    </init-param>
    12.    <load-on-startup>1</load-on-startup>
    13. </servlet>

  14. If you have multi-core CPUs or more than one CPUs on your server, it might be beneficial to increase the thread pool beyond the default 250. On the other hand, if you have a slow server, decreasing the thread pool will decrease the overhead on the server.
  15. Monitor application applications via Tomcat MBeans. This article provides some great insight on how to do this.
  16. Consider JDK 1.5 or even better JDK 1.6 to take advantage of performance improvements.

  17. Use the -server JVM option. This enables the server JVM, which JIT compiles bytecode much earlier, and with stronger optimizations. Startup and first calls will be slower due to JIT compilation taking more time, but subsequent ones will be faster.
  18. Use GZIP compression. Look for the service connector you wish to configure for compression and add two attributes, compression and compressableMimeType. For example:
     
    1. <Connector>
    2.    port="80"
    3.    maxHttpHeaderSize="8192"
    4.    URIEncoding="UTF-8"
    5.    maxThreads="150"
    6.    minSpareThreads="25"
    7.    maxSpareThreads="75"
    8.    enableLookups="false"
    9.    redirectPort="8443"
    10.    acceptCount="100"
    11.    connectionTimeout="20000"
    12.    disableUploadTimeout="true"
    13.    compression="on"
    14.    compressableMimeType="text/html,text/xml,text/plain,application/xml">
    15. </Connector>

    For more information, read the Tomcat HTTP Connector documentation.

  19. The default Tomcat configuration provides good protection for most requirements, but does not prevent a malicious application from compromising the security of other applications running in the same instance. To prevent this sort of attack, Tomcat can be run with a Security Manager enabled which strictly controls access to server resources. Tomcat documentation has a good section on enabling the Security Manager.

Wednesday, July 29, 2009

Choosing a Java Web Framework

Choosing a Java Web framework for your project is not getting any easier. Here are some things I think about when choosing a Java Web framework.

  • Is it action based? Action based frameworks generally map actions (defined in an HTML form or URL) to code in the controller tier of the application. Action based frameworks are the most popular type of framework. Most developers have had at least some exposure to these kinds of frameworks. The most popular Java Web framework, Struts, is an action based framework. Examples: Struts, Struts2 (based on WebWork), Spring MVC, Stripes, Ruby on Rails , Grails
  • Is it component based? Component based frameworks create a component abstraction in the view tier. Event listeners capture user actions and map back to code in the controller tier. I am of the opinion that component based framework have a steeper learning curve than action based frameworks. Some will counter that component based frameworks offer greater productivity, once the framework is learned. Programming in a component based framework can sometimes feel like programming Java Swing components. Examples: JavaServer Faces (JSF) implementations (MyFaces, Tapestry, RIFE, Wicket, Google Web Toolkit (GWT), ThinWire, Echo2, IceFaces (JSF implementation), Click
  • Is it page based? Page based frameworks allow you to develop application made of many Web pages. To implement these Web pages, the developer creates HTML (using JSPs or templates), JavaScript and CSS files. All action based frameworks (that I know of) and some component based frameworks are page based. Most of these frameworks now have good support for AJAX. Because you write the Web tier yourself, you also have a lot of control and the ability to adhere to Web standards. Struts is a page based framework. Examples: Struts, Struts2/WebWork, Spring MVC, Stripes, Ruby on Rails (requires JRuby to run in Java), Grails, RIFE, JavaServer Faces (JSF) implementations (MyFaces), Tapestry, RIFE, Wicket
  • Is the Web tier generated? New AJAX frameworks such as Google Web Toolkit, require you to only code in Java. They then generate the entire Web tier for you, so you don’t have to code the HTML, JavaScript or CSS. You will still need to understand CSS concepts in order to style you components. This may be attractive you if you or your team doesn’t have much experience with JavaScript and CSS or you want to keep all of you application logic within Java code. These frameworks are component based and the style of programming is very similar to Swing. AJAX is used heavily by these framework to create a rich user interface. In traditional frameworks, there are many Web pages that work together to form an application. These frameworks may only have one page (a frame) where components and screens are swapped out using AJAX. Examples: Google Web Toolkit (GWT), ThinWire, Echo2, IceFaces (JSF implementation)
  • Is it JSP based? Many frameworks, including Struts, use JSP pages to generate HTML. JSP (JavaServer Pages) are the classic way to generate Web pages in Java. Tag libraries are used within JSP pages to generate HTML. Custom tags can be created fairly easily to add your own functionality. JSP pages get compiled into Java Servlets. Examples: Struts, Struts2/WebWork, Spring MVC, JavaServer Faces (JSF) implementations (MyFaces), Click
  • Is it template based? Some frameworks offer an alternative to JSP pages known as a template. Sometimes a framework only works with templates, while there are also lightweight template libraries, such as Velocity or FreeMarker, that can be used in combination with JSP frameworks. A template is often an HTML file with references to Java components made within the HTML code. Because these files are not JSP pages, they bypass the JSP API which many developers do not like to use. This also give some templates the ability to be viewed by a browser, which makes them nice for Web designers. I list some examples of frameworks that use template out of the box. However, as I mentioned earlier, JSP based frameworks can be made to work with templating technologies. Examples: Facelets (a view handler that can be used with any JSF implementation), Tapestry, RIFE, Wicket, Velocity, Clay (part of Shale), FreeMarker
  • Is it Rails like? The hugely popular Ruby on Rails (RoR) framework has defined its own class of Web framework. Without going into the framework itself, two fundamentals of this framework are “convention over configuration” and “don’t repeat yourself”. Rails like frameworks generate a lot of the application structure up front to make it easy to get up and running. Examples: Ruby on Rails (requires JRuby to run in Java), Grails, Trails
  • Does it support a dynamic scripting language? Many frameworks now have support for dynamic scripting frameworks. If you would rather do most of your Web programming in a scripting language rather than Java (there are many who would), then one of these frameworks might be for you. They tend to be action and page based and have good support for AJAX. Examples: Ruby on Rails (requires JRuby to run in Java), Grails (using Groovy scripting language)
  • Does it support IoC? You will often hear this referred to as “Spring integration”. The Spring Framework is a full stack J2EE application framework. There are many different sub-frameworks within the Spring Framework, and its Spring IoC (inversion of control or dependency injection) framework is its most widely used. IoC frameworks can make it easy to configure Java beans within your application, as well as provide a number of other benefits. Most of the popular frameworks have support in one way or another for Spring IoC. If this is important to you, then you should make sure the framework you are selecting makes it easy to work with Spring IoC. There are other IoC frameworks out there, such as HiveMind and Plexus, but Spring is currently the standard.
  • Does it support Web conversations? Supporting Web conversations is about tracking state across several pages, so if you are using a framework that is page based, then this may be important to you. If it is, then JBoss Seam and Spring Web Flow are frameworks to consider. They are not Web frameworks, but server side frameworks that integrate into the middle tier of your application. Seam uses JSF for its Web tier. Spring Web Flow can integrate with various Web frameworks. Shale, a framework for JSF, also includes support for conversations, as well as RIFE.
  • Is it testable? Many of the popular frameworks are building in formal support for mock objects and other testing concerns. Testing is critical and Web applications tend to be difficult to test.
  • How well does it support security? Is it well supported and maintained? Is it stable? Will it help me adhere to standards? These are things I think about on all projects when selecting a framework and they apply here as well. Especially here, since there are so many Java Web frameworks to choose from and new ones are showing up each month.

Monday, July 27, 2009

Technologies used to censor the Web

IP Blocking

IP Blocking is one of the most basic methods for censorship, as it simply prevents all packets going to or from targeted IP addresses.

But while these sorts of operations are relatively simple to execute, they don't tackle the problem of individual communications between users, especially if the users have set up multi-hop circuits that use multiple servers to create a proxy ring.

Traffic Classification (QoS)

This is a much more sophisticated method of blocking traffic than IP blocking, as one can halt any file sent through a certain type of protocol, such as FTP. Because we know that FTP transfers are most often sent through TCP port 21, they can simply limit the bandwidth available on that port and throttle transfers. "it is not too resource intensive and is fairly easy to set up."

Shallow Packet Inspection

Shallow packet inspection is basically a blunter, broader version of the deep packet inspection (DPI) technique that is used to block packets based on their content. But unlike DPI, which intercepts packets and inspects their fingerprints, headers and payloads, shallow packet inspection makes broad generalities about traffic based solely on checking out the packet header.

"Shallow packet inspection is more judging a book by its cover. If a packet says that it's SSL (Secure Sockets Layer) in the header, then a shallow packet inspector takes it at face value."

Packet Fingerprinting

This is a slightly more refined method of throttling packets than shallow packet inspection, as it looks not only at the packet header but at its length, frequency of transmission and other characteristics to make a rough determination of its content.

"A lot of things don't explicitly say what they are. For example, a lot of VPN traffic is indistinguishable from SSH traffic, which means that it would be throttled if SSH was,". "But what if businesses relied on VPN connections? You'd move the system to fingerprinting, where the two are easily distinguishable."

Deep Packet Inspection / Packet Content Filtering

DPI is the most refined method for blocking Internet traffic. As mentioned above, deep packet inspectors examine not only a packet's header but also its payload. This gives the ability to filter packets at a more surgical level than any of the other techniques discussed so far.

"Viewing a packet's contents doesn't tell you much on its own, especially if it's encrypted," . "But combining it with the knowledge gained from fingerprinting and shallow packet inspection, it is usually more than enough to figure out what sort of traffic you're looking at."

Thursday, June 18, 2009

CentOS x64 bit: Installing Flash plugin for FF

Download flash plugin from http://labs.adobe.com/downloads/flashplayer10.html

then in terminal:


$ tar -xf libflashplayer-10.0.22.87.linux-x86_64.so.tar.gz
$ sudo cp libflashplayer.so /usr/lib64/mozilla/plugins/

Restart firefox-64 bit.

fxd2tbina4

Wednesday, June 17, 2009

IE vs Firefox in Progressive Rendering

Progressive rendering is the act of displaying each object as it is downloaded. Both IE and FF supports progressive rendering; but, they differ on how they render tables.

Internet Explorer 7

When Internet Explorer renders a , it downloads all the objects within the table before displaying it. This is required so that Internet Explorer can render the table with the correct width for each column.

Mozilla Firefox

On the other hand, Firefox renders all objects progressively regardless if it's in a table. That is to say - each object is displayed as soon as it is downloaded.

What You Can Do To Improve Performance

Performance Tips
  1. Ensure HTML code is valid.
  2. Minimize number of nested tables.
  3. Never wrap entire body contents within a table.
  4. Move towards a CSS-based layout.
  5. Move JavaScript to the very bottom of document (right before the tag). If not possible, move JavaScript to the of document.
  6. Pay close attention to the size of objects and their locations?
The Key Is To Understand

By knowing each browser's strengths and weaknesses, you can build a better design. A good design will never make the reader wait.


Eclipse look and feel for swing applications

This is what you were looking for. There is an open source API called SWT(Standard Widget Toolkit) by eclipse. A GUI framework for Swing user interfaces. You can see the list of swt widgets here http://www.eclipse.org/swt/widgets/. Using this framework we can build application like eclipse look and feel.

Saturday, June 13, 2009

Classpath Helper

How to find unused Jar libs in a huge application?

I think this tool(classpath helper) answers, http://classpathhelper.sourceforge.net/

Friday, June 12, 2009

What is Google Wave?

Google Wave is a new communication service previewed today at Google I/O. "A wave is equal parts conversation and document, where people can communicate and work together with richly formatted text, photos, videos, maps, and more."

The service seems to combine Gmail and Google Docs into an interesting free-form workspace that could be used to write documents collaboratively, plan events, play games or discuss a recent news.

Thursday, June 11, 2009

Running tomcat on port 80 as non-root

  • Use IPtables. This requires a kernel version of 2.4.x or higher. If you’re running an older version of the kernel take a look at IPChains and consider a command something like: ipchains -I input --proto TCP --dport 80 -j REDIRECT 8080

    The IPtables solution allows Tomcat to run as an independent server as a non-privileged user and listen on port 80. IPtables will redirect all requests coming in on port 80 to port 8080 or whatever port you have Tomcat running under.The first step for this solution is to make sure your firewall allows TCP requests on port 8080 (or whatever port your Tomcat configuration has specfied). Essentially you need to duplicate all the firewall rules you have configured for port 80 since you will be redirecting those requests to 8080. The second step is to use the iptables command (usually installed by default on linux distributions) to redirect all packets on port 80, to port 8080. Here is a an example of the command you would use to do this:

    iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 -j REDIRECT --to-port 8080

    To redirect local requests use the following command:iptables -t nat -A OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-port 8080
    This is handy if you’re running Tomcat on your workstation and debugging an application that’s required to run on port 80.
  • Use rinetd. rinetd is a dedicated port redirector program that receives a packet and redirects it to a different port or address. Since rinetd redirects packets after they’ve gone through IPtables, this solution can be used for local and non-local requests.There are two things you should consider when using rinetd. First, rinetd cannot be used to redirect FTP requests because FTP requires more than one socket. Secondly, rinetd makes all packets appear as though they originated from the local machine. This obviously will impact things like web server logs and setting permissions based on IP address.Although rinetd has these side effects, using a combination of iptables and rinetd may be another option but seems like a more complicated solution from a debugging and maintenance perspective.

Saturday, June 6, 2009

Installing self-signed ssl certificate

1. Generate an RSA key for signing the certificate:
openssl genrsa -out mykey.pem 2048

2. Generate a certificate using the new key:
openssl req -new -x509 -key mykey.pem -out mycert.pem -days 365

Enter your name, organization name and address as prompted.
In this example, we've created a key file, mykey.pem, and a self-signed certificate. Normally, you want a certificate from a "certificate authority" or CA. 
3. Since the certificate is in PEM format, convert it to PKCS12 for Tomcat:
openssl pkcs12 -export -in mycert.pem -inkey mykey.pem -out mycert.p12 -name tomcat

You MUST specify an export password! Tomcat expects one.

4. Keep the “mycert.p12” file you will need it to configure in tomcat server.xml.

5. Edit $CATALINA_HOME/conf/server.xml and uncomment the SSL connector tag.
Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="false" proxyPort="443"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keystoreType="PKCS12"
keystoreFile="/opt/openssl-0.9.8g/mycert.p12"
keystorePass="*****" />"

Google's Page Speed

Google has released a Firefox add-on called Page Speed. It integrates with another add-on, Firebug, and is aimed at web developers trying to make their pages faster. “Page Speed is a tool we’ve been using internally to improve the performance of our web pages,” 

Also see YSlow, another Firebug add-on (this time by Yahoo) that “analyzes web pages and suggests ways to improve their performance”.

Monday, June 1, 2009

Best Ajax Framework

There are lot of ajax frameworks out there, my pick is

  • Dojo  Provides more features and widgets but customization is harder
  • YUI -  has well documented code and detailed tutorial.
  • GWT - Google's framework :-)
  • SweekDev Ria - Has more features and performance overheads

Sunday, May 17, 2009

First Web Server

The World's First Web Server by sbisson.

In a glass case at CERN is an unpreposessing little NeXT cube. It's hard to believe that this little workstation changed the world, but it did. It's Tim Berners Lee's original web server, the world's first.

Wednesday, May 13, 2009

Google Launches Search Options, Declares Real-Time Search Biggest Challenge

Google has just launched a new “search options” feature on its main search page. When you click on “Search options” you can filter your search by different types of results (videos, forums, and reviews), by time (recent, past 24 hours, past week, past year), as well as seeing related searches, a “wonder wheel” view, or a timeline view.

At Google’s Searchology event, which is going on right now, Marissa Mayer listed the following as the hardest unsolved problems in search:

- Finding the most recent information
- Expressing that you want just one type of result
- Assessing which results are best
- Knowing what you’re looking for
- Expressing your searches in keywords

Notice that real-time search is the No. 1 problem. (Twitter and a bunch of startups from OneRiot to Tweetmeme are also working on it, with the latter two launching their own real-time search efforts today). And it certainly is a problem for Google, even with the new recent results option. Try searching for any of teh top trending results on Twitter right now like Miss California (vs. Twitter search results) or Star Trek (vs. Twitter results), and you don’t even get any Twitter results on Google.

While real-time search is still a big problem, it is not the only problem. Some of the new options address the difficulty of searching back through time. The recent results get as real-time as Google can get, but you can also expand the timeframe. And you can look at an actual timeline of results, which looks for dates within results and then places them chronologically (this is sort of hit or miss—just because a date is mentioned in a text does not mean the entire result is about or from that period of time). Google now also lets you see related searches as an option. And the Wonder Wheel is more of a visual aid to see how different related topics are clustered together. When you click on any spoke of the wheel, it then causes that search term to be at the center. We’ve seen many of these techniques in the past, but Google is giving them a higher profile by putting them in its main search page..

Tuesday, May 12, 2009

Accessing Remote Database from MySQL Trigger

Recently, we were in need of accessing the remote machine database from the MySQL's trigger. We found the only way to get this done by using the FEDERATED storage engine.

The FEDERATED storage engine is available beginning with MySQL 5.0.3. It is a storage engine that accesses data in tables of remote databases rather than in local tables.

The FEDERATED storage engine is available beginning with MySQL 5.0.3. This storage engine enables data to be accessed from a remote MySQL database on a local server without using replication or cluster technology. When using a FEDERATED table, queries on the local server are automatically executed on the remote (federated) tables. No data is stored on the local tables.

Friday, April 24, 2009

Internet Connection Speed: Top 10 Contries

At the end of 2008, approximately 19 per cent Internet connections around the world were at speeds greater than 5 Mbps — a 21 per cent increase over the average global connection speed at the end of 2007.

This is according to the State of the Internet report, a quarterly study by Akamai Technologies, the US-based Internet content distribution giant. The State of the Internet report tracks average connection speeds for countries around the world.

Check out the top 10 nations in terms of average Internet connection speed.

1. South Korea

South Korea rules supreme when it comes to Internet connection speed and broadband connectivity. It is the world’s No.1 with average connection speed of 15 Mbps, ten times the global average!

During 2008, South Korea’s rate of quarterly change appeared to be locked into a cyclical pattern, with quarterly decreases being recorded in the first and third quarters, and increases seen in the second and fourth quarters.

For the whole year, South Korea saw a modest 7 per cent rise in their levels of high broadband adoption. South Korea is also ranked first in terms of high broadband connectivity with 69 per cent connections above 5 Mpbs.

2. Japan

Japan ranks 2nd in terms of Internet connection and high broadband connectivity. Japan ranks 2nd in terms of high broadband connectivity. About 54 per cent of the connections in Japan are above 7 Mbps.

3. Hong Kong

Hong Kong ranks third with an Internet connection speed of 6.9 Mbps. The country ranks fifth in terms of high broadband connectivity with 38 per cent of the connection above 5 Mbps.

4. Romania

Romania is at the fourth position with a Internet connection speed of 5.7 Mbps. The country ranks third in terms of high broadband connectivity with 45% of the connection above 5 Mbps.

5. Sweden

Sweden is at the fifth position with a Internet connection speed of 5.6 Mbps. Sweden ranks fourth in terms of high broadband connectivity with 39 per cent of the connection above 5Mbps.

6. Switzerland

Switzerland has bagged the sixth position with an Internet connection speed of over 5 Mbps. The country however does not figure in the top ten list of countries with high broadband connectivity.

7. Netherlands

Netherlands ranks 7th with an Internet connection speed of 4.9 Mbps. The country ranks 7th in terms of high broadband connectivity with 28 per cent of the connections above 5 Mbps.

8. Belgium

Belgium is at the 8th position with an Internet connection speed of 4.7 Mbps. The country ranks sixth in terms of high broadband connectivity with 31 per cent of the connection above 5 Mbps.

9. Slovakia

Slovakia bags the ninth position with an Internet connection speed of 4.5 Mbps. The country does not figure among the top ten in terms of high broadband connectivity.

10. Norway

Norway ranks tenth with an Internet connection speed of 4.5 Mbps. The country ranks fifth in terms of high broadband connectivity with 38 per cent of the connection above 5 Mbps.

United States is at the 17th position with an Internet connection speed of 3.9 Mbps, up approximately 8 per cent from the average connection speed for the first quarter of 2008.

In terms of Internet connection speed, China is way behind leading economies with an average Internet connection speed of 833 kbps.

India has been ranked at a dismal 115th among 223 countries in terms of average Internet connection speeds. India has an average Internet connection speed of just 772 Kbps compared with the global average of 1.5 Mbps.

I think now we are in the first place, as Airtel BroadBand introduces 16 Mbps Speed :-)