Computerized WorldComputerized WorldDiscussion on latest News and Events in my computerized world Articles
Add css styles for gwt widgets
2007-08-29 14:35:00 Adding Cascading styles (CSS) to Google Web Toolkit (GWT) widgets is much simpler and involves only two steps.Style nameset style name for a widget using the $widgetInstance$.setStyleName() method orstick with the default style name of the widget (use for setting global values)default style name examples:for buttons: .gwt-Buttonfor Check Boxs: .gwt-CheckBox CSS style ruleAdd CSS style rules to a .css file and import that into the html page or write those inside the html page itself. (not recommended)Let us provide you with an example which would create buttons shown below.Coding in your java class:Button cancelButton = new Button("Cancel");Button loginButton = new Button("Login");loginButton.setStyleName( "buttons");CSS rules:.gwt-button { background: #EEEEFF; color: #0000CC; font-size: 12px;}.buttons { background: #CCCCCC; color: #333333; font-size: 12px;} More About: Widgets , Tech , Styles
Add css styles for gwt widgets
2007-08-29 14:35:00 Adding Cascading styles (CSS) to Google Web Toolkit (GWT) widgets is much simpler and involves only two steps.Style nameset style name for a widget using the $widgetInstance$.setStyleName() method orstick with the default style name of the widget (use for setting global values)default style name examples:for buttons: .gwt-Buttonfor Check Boxs: .gwt-CheckBox CSS style ruleAdd CSS style rules to a .css file and import that into the html page or write those inside the html page itself. (not recommended)Let us provide you with an example which would create buttons shown below.Coding in your java class:Button cancelButton = new Button("Cancel");Button loginButton = new Button("Login");loginButton.setStyleName( "buttons");CSS rules:.gwt-button { background: #EEEEFF; color: #0000CC; font-size: 12px;}.buttons { background: #CCCCCC; color: #333333; font-size: 12px;}Home More About: Widgets , Tech , Styles
Add css styles for gwt widgets
2007-08-29 14:35:00 Adding Cascading styles (CSS) to Google Web Toolkit (GWT) widgets is much simpler and involves only two steps.Style nameset style name for a widget using the $widgetInstance$.setStyleName() method orstick with the default style name of the widget (use for setting global values)default style name examples:for buttons: .gwt-Buttonfor Check Boxs: .gwt-CheckBox CSS style ruleAdd CSS style rules to a .css file and import that into the html page or write those inside the html page itself. (not recommended)Let us provide you with an example which would create buttons shown below.Coding in your java class:Button cancelButton = new Button("Cancel");Button loginButton = new Button("Login");loginButton.setStyleName( "buttons");CSS rules:.gwt-button { background: #EEEEFF; color: #0000CC; font-size: 12px;}.buttons { background: #CCCCCC; color: #333333; font-size: 12px;} More About: Widgets , Tech , Styles
GWT releases 1.4 and is no longer beta
2007-08-29 14:13:00 Google Web Toolkit (GWT) has released a new version, 1.4. With over 1 million downloads GWT is moving forward well; and it's no longer beta. The user group is really active and well established; so if you haven't tried GWT yet, it's time to have a look. Read more about GWT and news release at GWT blog.For any issues visit the GWT user group here. More About: News , Google , Tech , Beta
GWT releases 1.4 and is no longer beta
2007-08-29 14:13:00 Google Web Toolkit (GWT) has released a new version, 1.4. With over 1 million downloads GWT is moving forward well; and it's no longer beta. The user group is really active and well established; so if you haven't tried GWT yet, it's time to have a look. Read more about GWT and news release at GWT blog.For any issues visit the GWT user group here. More About: News , Google , Tech , Beta
Would Google Adsense let a website earn $100,000 per month?
2007-08-27 14:28:00 With Google Adsense earning $100,000 per month!!! Feels like day dreaming? Are there web sites earning around 100k dollars per month; shockingly and interestingly the answer is yes. There are some few sites that earn this much; even more than that. Believe meA social site named "PlentryOfFish" owned by "Markus" has earned more than $900k in two months while "ShoeMoney" blog earned more than $100k in one month. See the proofs here and here. So the good news is we should try now and reach there since it is possible.Analysis of sites earning with AdsenseMonthly visitorsNumber of visitors is a huge factor considering the Adsense revenue as visitors help revenue increase; so having a healthy visitors base is a must. Adsense ads placementMany sites have been using text/image advertisements rather than going for text only ads or image only ads to change what user sees at first. Adsense text only ads are placed before/inside/after articles; but 250x250 / 300x2... More About: Website , Google Adsense , Earn
Would Google Adsense let a website earn $100,000 per month?
2007-08-27 14:28:00 With Google Adsense earning $100,000 per month!!! Feels like day dreaming? Are there web sites earning around 100k dollars per month; shockingly and interestingly the answer is yes. There are some few sites that earn this much; even more than that. Believe meA social site named "PlentryOfFish" owned by "Markus" has earned more than $900k in two months while "ShoeMoney" blog earned more than $100k in one month. See the proofs here and here. So the good news is we should try now and reach there since it is possible.Analysis of sites earning with AdsenseMonthly visitorsNumber of visitors is a huge factor considering the Adsense revenue as visitors help revenue increase; so having a healthy visitors base is a must. Adsense ads placementMany sites have been using text/image advertisements rather than going for text only ads or image only ads to change what user sees at first. Adsense text only ads are placed before/inside/after articles; but 250x250 / 300x2... More About: Website , Google Adsense , Earn
Adsense Ads between blogger posts
2007-08-22 05:06:00 If you have switched your blog from older blogger to new blogger platform (which uses layouts) and looking for adding adsense advertisements in between posts; Blogger has created a new widget for this purpose. And they have made it such that any non-tech blogger even can use this. This widget lets you specify number of posts between an adsense advertisement. You can see the full guide here at Get inline.If you haven't switched to new blogger yet, don't worry. You still can put adsense ads between your posts. You have to put the adsense code inside the tags that shows up the blog post. My home page has done like that. If you need any assistance on that, just drop me a mail or write below as a comment. I would be happy to help you. More About: News , Google , Adsense , Posts
Adsense Ads between blogger posts
2007-08-22 05:06:00 If you have switched your blog from older blogger to new blogger platform (which uses layouts) and looking for adding adsense advertisements in between posts; Blogger has created a new widget for this purpose. And they have made it such that any non-tech blogger even can use this. This widget lets you specify number of posts between an adsense advertisement. You can see the full guide here at Get inline.If you haven't switched to new blogger yet, don't worry. You still can put adsense ads between your posts. You have to put the adsense code inside the tags that shows up the blog post. My home page has done like that. If you need any assistance on that, just drop me a mail or write below as a comment. I would be happy to help you. More About: News , Google , Adsense , Posts
GWT not working on Internet explorer 7 (IE7) giving "Element not found" jav
2007-08-16 14:48:00 GWT web application started to give "Element not found" javascript error message on Internet Explorer 7 (IE7)? This application worked fine on Internet Explorer 6 and Firefox 2. Now your best guess would be; GWT not working on IE 7 properly. Wasn't it? But the scenario became confusing and unbelievable because your application worked fine on IE7 in some machines while not on some others. Have you faced this issue? Then the below solution is for you.This issue can be fixed by a making a change on windows registry. Steps to follow are;1. Open up the Registry editor - type regedit on command prompt.2. Look for the key shown belowHKEY_CLASSES_ROOTTypeLib{EAB22AC0-30 C1-11CF-A7EB-0000C05BAE0B}1.1 win323. Click on the "Default" row and see the value there. If it's value is "C:WINDOWSsystem32shdocvw.dll", then that is what causes the above mentioned issue. If you have installed Windows in a different drive; C: must be replaced with the that letter.4. Replace that value with "C:W... More About: Google , Java , Tech
GWT not working on Internet explorer 7 (IE7) giving "Element not found" jav
2007-08-16 14:48:00 GWT web application started to give "Element not found" javascript error message on Internet Explorer 7 (IE7)? This application worked fine on Internet Explorer 6 and Firefox 2. Now your best guess would be; GWT not working on IE 7 properly. Wasn't it? But the scenario became confusing and unbelievable because your application worked fine on IE7 in some machines while not on some others. Have you faced this issue? Then the below solution is for you.This issue can be fixed by a making a change on windows registry. Steps to follow are;1. Open up the Registry editor - type regedit on command prompt.2. Look for the key shown belowHKEY_CLASSES_ROOTTypeLib{EAB22AC0-30 C1-11CF-A7EB-0000C05BAE0B}1.1 win323. Click on the "Default" row and see the value there. If it's value is "C:WINDOWSsystem32shdocvw.dll", then that is what causes the above mentioned issue. If you have installed Windows in a different drive; C: must be replaced with the that letter.4. Replace that value with "C:W... More About: Google , Java , Tech
Set Cookies with GWT applications to expire after expected time period
2007-08-13 14:52:00 Google Web Toolkit (GWT) supports HTTP cookies similar to other web technologies. GWT provides methods for setting cookies for specified time duration, for specific domains and paths. Below is a listing on how to set a basic cookie for a duration of one day.Date now = new Date();long nowLong = now.getTime ();nowLong = nowLong + (1000 * 60 * 60 * 24 * 7);//seven daysnow.setTime(nowLong);Cookies.setCooki e("sampleCookieName", "sampleCookiValue", now);When retrieving the cookies, you have to specify only the name of the cookie, nothing related to duration. If the cookie is found in the browser for this domain (not expired); value you set will be returned.Cookies.getCookie("sampleCookieN ame");//only nameIn setting cookies, you must consider on what you actually plans to get done using a cookie. There are two features you can achieve; remember duration (i)from the day it's created, (ii) from the last day this particular user viewed your site. If your site always set cookies when ever a us... More About: Google , Applications , Java , Tech
New Firefox release 2.0.0.6 - Security update
2007-07-31 05:44:00 A new version of Firefox , 2.0.0.6 has been released today. This is another security update. And they released the 2.0.0.5 version just 13 days ago. That's why I really love Firefox. When ever an issue is reported, they work on it and provide us with a new version so that we are on the safe side always. And this is not the case with some other browsers where people have to wait months and years for some fixes. So thanks guys for all your dedication on making a better product.Read the release note for more info.Try this: Portable Firefox on USB drive. Complete security and portability. Free Trial. More About: News , Security , Update , Release
Scrollable table with GWT
2007-07-20 05:05:00 We came across a requirement to build a scrollable data table using Google Web Toolkit (GWT) because we had a limited space, but a growing table depending on the search criteria. As anyone can guess, having a scrollable table would be the best option. For that we used two components rather than one; com.google.gwt.user.client.ui.ScrollPanel and com.google.gwt.user.client.ui.FlexTable . The data table was added inside the Scrollable Panel.For clarification, we have added the code below.ScrollPanel scrollPanel = new ScrollPanel();FlexTable dataTable = new FlexTable();dataTable.setWidth("100%");sc rollPanel.add(dataTable);scrollPanel.setS ize("300", "200");//add data to table....For setting width and height; it's advised to use css rules, but for ease of understanding we have shown some hard coded values here. More About: Java , Tech
Jar not loaded warning/error in Google Web Toolkit (GWT) deployment to tomc
2007-07-12 14:45:00 When a Google Web Toolkit (GWT) web application is deployed to Tomcat web server, you may encounter a warning message as follows.org.apache.catalina.loader.Webapp ClassLoader validateJarFileINFO: validateJarFile(WEB-INFlibgwt-user.jar) - jar not loaded.See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.classNo need to worry too much about this warning message. This raises just because WebappClassLoader has loaded the servlet.jar already. The gwt-user.jar already contain the content of the servlet.jar file. Even though this message can be ignored, this warning message can be avoided just by replacing the gwt-user.jar file with gwt-servlet.jar (which comes with Google Web Toolkit (GWT) download).Following image shows the content of the gwt-user.jar, and the content of the servlet.jar is highlighted. gwt-servlet.jar has been created by removing the content of the servlet.jar from the gwt-user.jar, so this change will not have any impact on your project. More About: Java , Tech , Warning , Error
Call a javascript function inside body of a web page
2007-07-05 14:18:00 JavaScript is mainly used for actions on user events like onClick(), onMouseOver() etc. But what if you need to call a JavaScript function without any user events? Answer would be to use the onLoad() of the body tag. <body onLoad="javascript:myfunction()" ; >But what if you don't have access to change the onLoad()? Is there an answer for that as well?Yes, and it's easy. Just call the function inside your page as same as you would write JavaScript inside the body of a page.<script type="text/javascript" language="JavaScript"> doSomething('params');</script>In this example, doSomething() function is added to the web page inside the header of the page. And for ease of understanding the complete code is shown below.<html> <head> <script type="text/javascript" language="JavaScript"> function doSomething(params); //do something nice with params } </script&... More About: Body , Tech , Page , Javascript , Inside
[Cricket] Sangakkara joins the "five double hundreds" club
2007-07-04 14:02:00 Today Kumara Sangakkara become the seventh cricketer to reach five double hundreds in Test. This is a real achievement and it shows Sangakkara's patiences as well as the talents. Sri Lanka is the only country to have more than one player in that list of seven players.Here are the seven players with five or more double hundreds.1. Donald Bradman (AUS)- 12 2. Brian Lara (WI) - 93. Wally Hammond (ENG) - 74. Marvan Atapattu (SL) - 65. Javed Miandad (PAK) - 66. Kumara Sangakkara (SL) - 57. Rahul Dravid (IND) - 5Well done Sanga. More About: Cricket , News , Double , Club , Five
Why Software Projects Fail?
2007-06-29 13:36:00 Today I read a nice set of ideas on "Why Projects Fail" by Andrew Stellman and Jennifer Greene (ppt or pdf). They have analyzed and categorized the reasons for failures of projects. That led me to write this post.Ways a project can fail1. Things the boss does - Top level may not be communicating well with the rest of the members to pass the knowledge that they got on the requirements or they may not have gained required knowledge. Also some of them may be over confidence on what the team can actually achieve, so they make a guess and resulted in huge issues on development phase. 2. Things the software does - One major problem is receiving unclear incomplete requirements at the start, but has to continue on what is available. This is a huge problem as it would be too late when it's figured out that the the software does not match the expectations of the end user.3. Things the team should have done - Development team also should think wisely and accept the project dead lines. Usually... More About: Software , Tech
Adsense rounded borders for ads formats
2007-06-28 15:15:00 Google Adsense has come up with a new feature for ad borders, that is "Corner style". This features improves the look and feel making an advantage for site developers. Now publishers can choose between 'slightly rounded' or 'highly rounded' corner (two sample are shown here). If your site has a rounded template this will help a lot.To apply this change for existing Adsense ads, you only have to add another line to set another value inside the script. Set the value of "google_ui_features" as follows.google_ui_features = "rc:6";google_ui_features = "rc:10";"rc:6" is for 'slightly rounded' while "rc:10" for 'highly rounded'. More About: News , Google , Form , Mats
Jar utility can compress files?
2007-06-14 02:41:00 Java archive creator is the Jar tool. Is it just a packaging tool or does it compress and package (like zip utilities)? It can compress and package, also by default compression is on. So all the jar files that others have created so far may be compressed (since they did not turn off that). You can turn off the compression feature by using the 0 (zero) option of the jar command. The command would look like follows.jar cvf0 TicTacToe.jar *.classSo what's the big deal? It's always better to compress it!!! Many may think so?No, that's not the truth. There are reasons why you should turn off the compression. For a situation where a jar file is loaded to a browser, uncompressed jar will be suitable over a compressed jar. Uncompressed JAR files can generally be loaded more faster than compressed files because the need to decompression overhead is eliminated. However there's a trade-off, for an uncompressed jar download time over a network may be longer. So decision must be taken by c... More About: Java , Tech , Utility , Files , Compress
Google Adsense gets nice look and feel with Google Account
2007-04-27 15:20:00 Seems Google has started integrating Google Adsense with Google Account. We believe this as a good step since it makes life easier, login to only one account but have many services working. Previously Google did this with Blogger as well. New login page is very nice and colorful. New login page looks as below.Currently the two old and new login pages can be accessed using two different URLs, but this will be changed very soon.Old login page: www.google.com/adsense/login3New login page: www.google.com/adsense/login/ More About: News , Google Adsense , Gets
Sri Lanka through to World cup finals playing against 11 or 13?
2007-04-25 18:42:00 Today is a special day for Sri Lanka ns as SL made their way to finals in World Cup 2007 after the semi final victory over New Zealand yesterday. That was a fantastic match even though it was hard to judge whether SL were playing against 13, not just 11 players. SL was playing against 11 friendly and claim NZ players (and 2 slightly unfair professional umpires).Interesting point was both the 2 umpires, RE Koertzen (South Africa) and SJA Taufel (Australia) made poor LBW decisions against SL. One LBW was given for a thick edge and the other for a ball going far away from the leg stump. When NZs were batting, umpire RE Koertzen warned Dilhara twice putting him under huge pressure. Another a tough LBW decision was given against Rose Tailer for a ball slightly missing the stumps. We can not guess why such experienced umpires give that much bad decisions in crucial matches like semi finals. Even with that type of a situation, SL team came up brilliantly in batting, balling as well as field... More About: Cricket , News
World Cup Semi final on 24th: Sri Lanka vs New Zealands
2007-04-23 03:11:00 Tomorrow (2007-04-24) is going to be a big big day for both Sri Lanka and New Zealand. Two teams meet each other in a crucial match, semi finals. In recent past, SL have done well against New Zealand. They once met in the super eight matches and Sri Lanka won comprehensively by 6 wickets.According to news, the pitch at Sabina Park in Jamaica will have some bounce. This is said to be favoring NZs because SLs have much experiences on subcontinent wickets. But having the best balling department, SLs will be able to get the benefit of the bounce as well. A quick comparison over the two teams1. Captaincy:Stephen Fleming, the New Zealand captain has more experience and is a good leading captain. But Mahela Jayawardane is one of the best positive captains in the world who has shown much colors in a lesser number of matches. So I weight SL has a good captaincy.2. Balling attack:NZ comes with one of the best ballers in the world, Shane Bond. But SL goes with 4 high class ballers: Vaas, Mural... More About: Cricket , News , World Cup , World
Open and read any file in a .war file of a web application with Java
2007-04-17 09:05:00 Question: How can I open and read a file inside a war file of a web application?Answer: InputStream can be used for this with a ClassLoader. A code snippet for opening a file from Java for reading a file inside a web application is listed below. Commented line (InputStream inputStream = new File InputStream(filePath);) shows the common approach used in non-web applications. Common approach is not usable with web applications (.war file) since it fails to find the files. Even though the correct relative path is provided, programs will face issues depending on the web server versions. For web applications, the InputStream will be created using a ClassLoader. Following code snippet can be used for this requirement. But this approach has one limitation. This can read only the files inside WEB-INF/classes folder.import java.io.InputStream;public class WebAppFileRead er { public static void main(String[] args) throws Exception { // full path: "C://projects//myWeb//WebRoot//WEB-INF//c lasses... More About: Tech , Open
Cricket: Sri Lanka won by two runs over England in World Cup 2007
2007-04-06 14:21:00 Sri Lanka vs England super 8 match was on 2007-04-04. They played an amazing match, it was the best game so far in this World Cup . Even that was one of the greatest matches I ever had watched.Sri Lankans were all out for just 235 runs causing many discussions to calculate how many runs should have been added to make it a winnable score. Then England started batting, but they were 12/2 after 6 overs.Over 20: Englands were in a comfortable situation, 100/2 with a RRR(required run rate) of 5.4. But this was easily reachable as Pietersen was batting impressively putting Sri Lankans under pressure.Over 34: Pressure on Englands. They were 134/6, with a RRR of 6.4. And Sri Lankans needed only one wicket two celebrate the tail enders' fun. And England fans were dead silent.Over 46: But that required wicket didn't fell and England batsman were rotating the strike well and they were 217/6 with a RRR of 9.5. But this was easily reachable as both the batsman were well established. It was jus... More About: Cricket , Sri Lanka
Yahoo! Mail provides unlimited storage
2007-03-29 03:25:00 Yahoo has made a big announcement. They are going to provide unlimited storage for Yahoo Mail !!! This huge feature will go live from May 2007. Can you believe it? Are they really going to achieve this or is this going to be an April Fool's Day Joke? Can't be. Today is 28th of March.In April 2004, Google launched GMail, with a 1GB which made all of us shocked, while Yahoo Mail providing 100MB storage. This caused the huge popularity of GMail. So many people switched to GMail from Yahoo and MSN (including me). In fact Google came up with a nice concept of expanding the user's storage limit every second and showing it in GMail home page. Currently it shows 2833.807851 on my machine.Yahoo Mail expanded in following fashion.1997: 4MB2004: 100MB2005: 1GB2007: Unlimited storageBut I really don't think that people love GMail just because it provides 2GM+ storage, but because of the features that it provides. So while providing huge capacities, Yahoo Mail will have to provide great and ... More About: Yahoo , Storage , Rage
[JSTL] According to TLD or attribute directive in tag file, attribute items
2007-03-28 13:32:00 Error Message: According to TLD or attribute directive in tag file, attribute items does not accept any expressions. When working on a J2EE (Java Enterprise Edition) web application with JSTL (JSP Standard Tag Library), this is a pretty common error.Reason for this error is version incompatibility between JSP, Servlet and JSTL. Matching versions are listed below.JSP 1.2 , Servlet 2.3 , JSTL 1.0JSP 2.0 , Servlet 2.4 , JSTL 1.1Check the web.xml to see whether it uses the Servlet 2.3 DTD or Servlet 2.4 Schema. If it uses Servlet 2.3 DTD, it will have the following text.<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" ><web-app>.....</web-app>F or Servlet 2.4 Schema, it will look like below.<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSche ma-instance" xsi:schemaLocation="http://java.sun.com/x ml/ns/j2ee http://java.sun.com/xml/ns/j2ee/we... More About: File , Item , Items , Bute
A child born, two years after his father's death
2007-03-21 10:25:00 According to your maths, above subject would not be correct. But that has happened in Texas. As CNN reports, the little boy's name is Benton Smith and his brave and courageous mom is Kathleen Smith while father was Brian.Brian, who was a solder in US army has gone for Iraq in 2004, and died there in July - 2004. But his wife has given birth to a boy in July, 2006. This has happened because Brian had donated his sperm so Kathleen could keep trying to have a baby while he was in Iraq.Congratulations Kathleen. You are a great mom and a great wife.Read more at CNN.com More About: Death , Child , Years , Father , After
[Cricket] World record - Six sixes in one over
2007-03-19 13:12:00 Herschelle Gibbs, 34 yrs South African right hand batsman made a big record on 2007-03-16. He did this against a leg-spinner, Daan van Bunge of Netherlands in the 30th over. This is where those bullets went.29.1 : long on29.2 : long off29.3 : long on29.4 : deep midwicket29.5 : wide long off29.6 : deep midwicketGibbs got 72 off 40 balls with 7 sixes before Van Bunge caught him in the next over at long on.West Indies great Sir Garfield Sobers and India's Ravi Shastri had done this six sixes in one over during first-class matches. But this is the first time in an international match.Congratulations Gibbs. Related: World record test cricket partnership More About: Cricket , World Record , Over , Record
Decipher the code to check your eyes
More articles from this author:2007-03-16 11:34:00 Try to read the following code. Even though this image looks like an ordinary one, it has a hidden message. But you won't be able to read it if you have good eyes.Couldn't you read that? You can see the answer below but try it again if you could not. Don't directly go and see the answer. Don't show that you have bad eyes. Try again.To see the answer click here.Code is: BAD EYESNow try again to see it yourself. [I don't know who is the owner of this creation, but a nice work.] More About: Eyes , Check , Cipher 1, 2, 3, 4, 5, 6 |



