Thursday, September 18, 2008

Update to new version Chrome 0.2.149.30 - Release notes?

I just updated my version of Chrome to 0.2.149.30. Surprisingly it doesn't come with a "new release detector", so you will have to go to tools button and them choose "about google chrome" and then it will detect it's outdated and you can press in the link to upgrade.
I had posted before with my first impressions of my first week using google chrome:
http://echofloripa.blogspot.com/2008/09/google-chrome-7-days-after-updated.html

I could notice that the problem with the link was solved. Also the mouse wheel problem now seems to be solved as well. But still the lack of add-ons is really annoying.
What I see as a problem is the lack of a release notes with the changes made to this new version. Is it or not an open-source software? It should come with a proper release notes of the major changes made.
[edit] Just found out that there is a blog with the release notes. Why google doesn't make our lives easier putting a link in the download page or in the official google blog, I don't know :)
[edit] Aparently they've made some improvement for the "on-demand installation".
[edit] Just found another problem, if you are inside a text box and try to select with the left button and use the mouse wheel (to go down or up and continuing to select) it doesn't work.


regards
Emerson

Sunday, September 07, 2008

Adding XML to your Posts in the Blogger

Have you ever tried to post some XML to your posts and got only some values of the tags, loosing all of the XML?

So that an XML like:


<dependency>
<groupId>javanettasks</groupId>
<artifactId>httpunit</artifactId>
<version>1.7</version>
<scope>compile</scope>
</dependency>


becomes:


javanettasks
httpunit
1.7
compile


Why is that????

The problem is that the XML is been interpreted as part of the HTML.
To avoid this you can use the following site:

http://www.elliotswan.com/postable/

It will replace the '<' and '>' symbols (among others) to XML entities, that will be shown correctly in the html but won't make your browser think that they are part of the HTML. You paste the xml there, and as a result you will get something like:

& lt;dependency& gt;
& lt;groupId& gt;javanettasks& lt;/groupId& gt;
& lt;artifactId& gt;httpunit& lt;/artifactId& gt;
& lt;version& gt;1.7& lt;/version& gt;
& lt;scope& gt;compile& lt;/scope& gt;
& lt;/dependency& gt;

That then you can paste safely in your post. To get the best formatting, add a </pre></pre> tags before and after the text.

Google Chrome - 7 days after - Updated review

So, after 6 days I've been using Chrome, I believe I got some updates on my views.

First of all, I'm using Chrome's last release, that I updated via a very intelligently auto upgradeable. The current version is 0.2.149.29.

  • Pros
Speed: I can't deny that Chrome, even lacking the maturity of other browsers, is pretty fast. The start up time to get an empty browser is impressive.
Omnibox: I don't care that much if google is storing all my searches, the omnibox is very good, especially after a bit of use. I was used to using this style of browsing with firefox already, just typing the first letters of the website, but Chrome takes it one level above searching the possible websites even if you never accessed that before.
Task Manager: The task manager shows exactly which page or plugin are putting your system down. I believe it's really useful.

Memory Consumption: The way it control the memory access with a process per tab and other optmizations make Chrome the best browser in terms of memory consumption. In firefox I have to restart once in a while my whole browser when it's getting above 500-700 megabytes.
  • Cons
I still have some critics, which I believe will soon be dealt with.

Task manager:

The task manager could allow for sorting using its fields, the same way the task manager does.
It could also show the totals directly in the main task manager (you can see that in the "Stats for nerds").
And Chrome has something very interesting, if you click "Stats for nerds" link in the task manager it shows the total memory used by all I tried to put it to test then. I put the same tabs in fresh just new chrome, firefox and internet explorer. Here are the results:



It seems like Chrome is the one that occupies more memory for the same exact tabs opened.

Find Box: The find box seems interesting, counting which occurrence it is at the moment (eg: 1 of 20). It doesn't seem to work properly when what you are looking for is inside a text box.


Integration with google's services: It could have a better integration with google's services. I would like to have all the tools in the Google's Toolbar that I use in firefox, for example the super useful auto-fill feature.

Error in loading some pages: This page gets loaded without its html tabs when some of the sections are chosen (try "International" tab for example).

How it should be (in firefox):



How it is shown in Chrome:



So the only way to get the main sections is returning to the main page.

Links not working: I just tested again and now it seems to work. But this site had the main news links not working (in red and blue).

Plugins: Some plugins are not detected correctly and some just don't work. The following image is while trying to use the Photos Uploader of facebook.




Whell-button scroll:

The scroll goes down but don't go up!!

Conclusion is that it is fast, good, but still in its beginning and lacks a lot of things to make me replace firefox.




Loading a page with javascript programatically - Httpclient x HtttUnit

Hi Guys

You might know that I appreciate very much surfing. As a sport for practicing myself, although after moving to England I haven't done as much as I could/should, and for viweing. I quite like following WCT, the main and closed championship with the best 45 surfers int he world, and its qualifier, the WQS. In my spare time, I was getting together a simple app to load the current rankings, then based on the current situation of incomplete competitions that might be running, generate an updatet ranking.

I thought in using httpclient to load the current rankings page, but the page uses javascript with document.writeln(' to write the table, and httpclient doesn't run javascript.

  • HttpUnit

Then I remembered that in the past I had done some website client automation with httpunit, then decided to use it.

  • Httpunit Maven dependency POM
First problem is to add it as a maven dependency. The last release, 1.7 from march/2008), is not available in the ibiblio main maven2 repository. I found it at the java.net maven 2 repository. To configure maven2 to use it add a settings.xml to your .m2 folder in your home directory with the following content:

<settings>
<profiles>
<profile>
<id>myprofile</id>
<repositories>
<repository>
<id>java.net-maven2-repository</id>
<url>http://download.java.net/maven/2/</url>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>myprofile</activeProfile>
</activeProfiles>
</settings>


The following xml need to be added to your POM in order to import the right libraries into my project:

<dependency>
<groupId>javanettasks</groupId>
<artifactId>httpunit</artifactId>
<version>1.7</version>
<scope>compile</scope>
</dependency>

  • Missing something?
Ok, I re-run the mvn eclipse:eclipse to re-generate my eclipse project files, then I got a java snippet with a simple request of a webpage and printing it. That should show my ranking, as HttpUnit in this page states that it supports "document.writeln".
First problem: It gives a java.lang.NoClassDefFoundError: org/mozilla/javascript/Scriptable. After a bit more researching, I found the library that implements it, the mozilla Rhino, and added it to my POM.xml:


<dependency>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
<version>1.6R5</version>
<scope>compile</scope>
</dependency>


  • Error during javascript processing:
Regenerating again the pom and regreshing the project in eclipse, just to find out that I would get still a further problem:

RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object [Ljava.lang.Object;@110003 of class [Ljava.lang.Object; where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call.
java.net.ConnectException: Connection refused: connect

I noticed in the 1.7 release notes for HttpUnit that the Rhino library was upgraded to the version 1.6R5. I tried changing to that version, but it doesn't seem to help much more.

Depending on the page I try to load I get a different message, for example the fotolog.net site:

failed: org.mozilla.javascript.EcmaError: TypeError: Cannot find function attachEvent in object [object Window]. (httpunit#10(eval)#1)

Any suggestion to make this work?

My resolved classpath (created by maven) is:
httpunit-1.7.jar
js-1.6R5.jar
jtidy-4aug2000r7-dev.jar
junit-3.8.1.jar
nekohtml-0.9.5.jar
servlet-api-2.4.jar
xercesImpl-2.4.0.jar

I'm using the following piece of code below to test:

import com.meterware.httpunit.GetMethodWebRequest;
import com.meterware.httpunit.WebConversation;
import com.meterware.httpunit.WebRequest;
import com.meterware.httpunit.WebResponse;

public class Main {
public static void main(String[] args) throws Exception {
String URL="http://www.aspworldtour.com/2008/ratings.asp?rView=w&rpage=menwqs&rRat=menwqs1&rNav=Men";
WebConversation wc = new WebConversation();
WebRequest req = new GetMethodWebRequest( URL );
WebResponse resp = wc.getResponse( req );
String text = resp.getText();
System.out.println(text);
}
}

UPDATE:
I tried then to use HtmlUnit (like mrs.gredler suggested) onthe same site, and that's the error I get instead:
Exception in thread "main" ======= EXCEPTION START ======== Exception class=[org.mozilla.javascript.WrappedException] com.gargoylesoftware.htmlunit.ScriptException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: Connection refused: connect (http://ad.outsidehub.com/st?ad_type=ad&ad_size=728x90&section=337979#1) (http://oascentral.surfline.com/RealMedia/ads/adstream_mjx.ads/www.aspworldtour.com/1552025455@Top?#8)

Tuesday, September 02, 2008

Google Chrome - first impressions and the crash

Hi Guys

You've all have heard about the google Chrome.
First impression was that it doens't really have anything that special. Maybe only a slightly impression it's a bit faster, but still lacks the normal google bar, that I use quite a bit on firefox, and maybe easier ways to get googles apps integrated. Google's notebook, for example, I don't think there is any way to install it yet.

  • Addons
I quite use a couple of addons for firefox. Dictionary tip, for example, that I can use inside a browser, would be something Google could add easily to the Chrome. Add-block is another one that hsould be integrated somehow. I don't know if the strategy of google will be to not allow developers to create their own plugins to not risk security and reliability. Most of memory leaks with firefox are due to bad-behaving plugins.

  • Crash
Suddenly, when I was messing with the task manager (which is quite interesting by the way), the whole Chrome crashed.



Google's advertisement: "Every tab you're using is run independently in the browser, so if one app crashes it won't take anything else down."

Not quite....

[edited]

Today I tried to use chrome all night at home. I faced then, the tab crash. Just note the app that made the tab crash. Exactly, gmail. 


  • Summary
Positives points: task manager (try the "stats for nerds view"), the thumbnails view, the element inspector for developers, the history, among others.
Negative points: no integration with google toolbar and add-ons (no yet at least), seems like lacking something... And also, of course the fact that it crashed in the first run.

See ya next time and good browsing
emerson