Tuesday, December 09, 2008

Hi All

I've made it!!!!  

Against all odds, lack of proper training and my injured knee, I managed to finish the 8 miles (12.8 km) race,  in 1:18 hour, in 648th place, from a total of 2.500 participants. Not bad at all : ) 
It wasn't easy though: a circuit loaded with huge ponds, 1/2 meter deep mud, hills, downhills and steep eroded parts, it was for sure the hardest physical activity I ever did so far in my life. At the end of the race your body just ask you to stop and you try to not listen to it and just carry on until the end. I think it will take one week for me to be able to walk normally again : )

But it was definitely worth it and I will surely do it again next year, with a healthy knee and plenty of training!!! 

The rain have stopped in my state Santa Catarina, leaving a total of 122 deaths and more than 80 people missing, but there are still thousands of people homeless and in need of basic help. 

My initiative even attracted the attention of the Brazilian media. See here a report that was broadcasted last week. it seems I'm sort of famous in Brazil now : )

http://uk.youtube.com/watch?v=QUThtCOEhUI

More pictures and videos of the race:
http://echofloripa.multiply.com/photos/album/115/Grim_Challenge

http://uk.youtube.com/watch?v=tPBtmC_p0I8
http://uk.youtube.com/watch?v=B9KJb-eEheI

Some recent news about the flooding:

http://news.xinhuanet.com/english/2008-12/07/content_10467685.htm
http://www.clicrbs.com.br/especial/sc/sos-sc/galeria/lista

Sunday, December 07, 2008

Grim Challenge 8 2008 Race

Just a short update, I went quite well in the race, I finished it!!! It was muh much garder than I could had ever imagined!!!
I was with my knee injured and I thougth even that wouldn't be able to compete.
Tomorrow I will put more info herewith  the results, timing and position.

They will be published here:

A few videos:

A few pictures of the event:

Getting ready!!!!



Saturday, November 29, 2008

HELP FOR THE VICTIMS OF THE FLOODINGS IN BRAZIL. My 8 miles race challenge!!

Hi All

I am going to be running 8 miles in the mud on Saturday 6th December
to raise money for the victims of the flooding in the south of Brazil
(in my home state Santa Catarina). The flood has claimed more than 109
lives and left more than 80000 people without homes, food or water. The situation is overwhelming, people really need help now!!!



For more details of the challenge I have set myself see:
http://www.grimchallenge.co.uk/
For more information of the Brazilian flooding:
http://news.bbc.co.uk/1/hi/world/americas/7753744.stm
http://english.aljazeera.net/news/americas/2008/11/20081129101739685948.html




Update:

 If you woul like to donate directly, please use the bank accounts in brasil provided in the civil defense page:






I decided to do this only 2 days ago. I was going to do a donation myself, then I thought: "I think I could get more people to help", and then a friend of mine told me she couldn't run in the race as she got injured, my chance then, I set-up this separated account in my bank, sent an email around the work asking for sponsorship, and now I make this request online, to anyone who would like to help. I consider myself a relatively fit person :) But I think 8 miles (13 kms) on the mud won't be an easy job, so I started training harder at the gym since yesterday. I did 4 kms yesterday, not too bad for the first day. Now I will try to increase 2 kms every day, so being very optmistic by tuesday/wednesday I would be reaching the necessary 13 kms!!! :) Then put a huge pond ont he top of it, and you've got a real challenge. I'm totally sure it will be worth it to help my countryman in need!!!

Map with cities and roads affectted:

Thanks
Emerson Cargnin

Thursday, November 06, 2008

TOMCAT LOGS: Rotating catalina.out on a solaris box

I tried several different solutions for getting a rotated log on tomcat. I tried configuring a new tomcat.log and putting log4j and commonslog jars inside common/lib, but that just created a new log. When I thought I would have to live with the endless catalina.out, I tried logadm, which with a few configurations actually worked just as I wanted!!!

So here it goes.

1) In a directory which the user you are running tomcat can write create a file called logadm.conf with the following content (assuming tomcat is in the /opt/tomcat/ folder):

/opt/tomcat/logs/catalina.out -C 15 -c -t '/opt/tomcat/logs/$basename.%Y-%m-%d'

2) Create a cron job for the same user (assuming you saved the configuration in /opt/tomcat/logrotate):

You can add the cron entry to the user that is running tomcat in the following way:

export EDITOR=vi
crontab -e

add the line:

0 0 * * * logadm -f /opt/tomcat/logrotate/logadm.conf

This will make it run every midnight of everyday.
  • Explanation on the parameters of logadm

This command, that exists since the solaris 9, will rotate the catalina.out, will rotate the specified log file. The -C tells how many old copies of the files will be kept. The -c is the secret here. It will truncate the log file instead of renaming. This way tomcat keeps the handle to the file and can keep logging. -t uses a template to create the rotated files. Without that it will just append a .1, .2, etc.

You should run it manually before adding to your crontab.

That should be all!!!!

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