Monday, January 31, 2005

My most useful Python script ever...

This Python script simply loops in a directory and change the extention of every file.
Wanna bulk rename a whole directory of .sgml files to .xml files?

import os
import re
pat = re.compile('\.sgml$')

map(lambda f: os.rename(f + '.sgml', f + '.xml'),
[os.path.splitext(f)[0] for f in os.listdir(os.getcwd()) \
if pat.search(f)])

enjoy!

Teaching Computers to Read

The Pentagon's Defense Advanced Research Project Agency, or DARPA, granted a contract worth at least $400,000 last fall to two Rensselaer Polytechnic Institute professors who are trying to build a machine that can learn by reading.
[...]
But reading is difficult for machines. Sentences must be converted into formal logic equations or other computer-friendly formats. Computers can do this on a modest scale.
[...]
Natural language is very ambiguous. If you go beyond sentences like 'John loves Mary,' to something like a paragraph from The Wall Street Journal ... there are some pretty complex phenomena in language that are pretty hard to represent.

[full article]

Friday, January 28, 2005

Google switch to Answers.com

Google is slowly switching from its long-standing use of Dictionary.com definitions to Answers.com definitions.

I just looked at some definitions and Answer.com is quite better than dictionary.com.. Good information, a clean layout and no stupid ads (!)...

Thursday, January 27, 2005

Want to link to your friend without diluting your page rank?

Page rank may be a preoccupation for web site owners.
Some rules are well known:
  1. the more you have inlinks, the more you are important
  2. when you give outlinks, you give fractions of your page rank to external pages.
Googles publicizes a strategy to link to people without propagating your page rank.

simply add the attribute rel="nofollow" in url tag.

It is mostly a great idea for comment spam. Indeed, people can spam your comment box but won't benefit from that. It can also be use to link to people without diluting your PR (this is egoist :o).

Saturday, January 22, 2005

53 Optical Illusions & Visual Phenomena

These pages demonstrate visual phenomena, called "optical illusions" or "visual illusions", the latter more appropriate, because most effects have their basis in the visual pathway, not in the optics of the eye.

Wednesday, January 19, 2005

Koders

Source Code Search Engine

Haaaaaaaa.. I was waiting for that :D





Software “design” and “usability” problems...

"People build things. We've been doing it for thousands of years, and yet only in the past century have “design” and “usability” been major concerns. [...]

It used to be that people built things for themselves, their families, or maybe their friends. Over time designs were polished as people made small improvements and changes to standard ideas for their own needs. [...] Artisans typically had direct contact with the people to whom they sold [...]

That changed with the advent of mass production. Because engineers and inventors no longer had direct interactions with users, they based their designs partly on inference from their own needs and largely on guesswork."

> Full article

Thursday, January 13, 2005

Java Profiling?

Optimizing code is always an important (and fun) step in producing quality software.
I had to find the memory and cpu bottlenecks in my Java application and I faced the problem to choose the right tool.

There are two philosophies: buy a commercial product and look at open source stuff.

I must say I was tempted by the first option - because my employer can affort it - and and I looked at three products (Enerjy Profiler, ej-Technologies jProfiler and Borland Optimizeit). After some tests and looking at the pricing (!), I decided to look at at least one open source product (Eclipse Profiler).

Well, here are some comments - an the dramatical conclusion - about all those tests:

Enerjy Profiler (memory, performance or thread analysez, 295$ US each):
The beauty of this product is its simplicity and its perfect integration with Eclipse (other IDE as well, I presume). It produces an exact profiling of the programs with enough filtering tools (at the method or package level). However, I prefer hierarchical view of methods (to know the details of cpu consumption of a method, for instance).





I overall does a great job and is really fast.

Overall Rating: 7/10

ej-Technologies jProfiler (499$ US, all modules):
This is an all-in-one solution. I was not totally satisfied with this product. The integration with Eclipse simply consists in a launch button that invoke jProfiler.








However, the profiling job is excellent (better than Enerjy). It do provides a hierarchical view of methods. It allows to see method graphs and offers plenty of options for all kind of profiling needs you can have. (update) - the uninstaller is buggy :(

Overall Rating: 6/10


Borland Optimizeit (2,600$ US, the complete suite):
Ok, let's go right to the conclusions. This may be the best profiling tool for Java but this is too expensive.

Product Overall Rating: 8/10; with pricing modifier: 5/10

Eclipse Profiler (Free, Open Source):
This is an open source software and the installation is therefore a bit more tricky. But it is well documented in the readme.txt file. The Eclipse Profiler (EP) simply outperforms all other products! The Ecplise integration is better than Enerjy. EP integrates as a perspective and can be started like any other java application.



The profiling statistics are clear, complete and accurate. It competes easily with ej-tech. The execution is lightning fast!

Overall Rating: 9/10

Pythonner Choice: Elipse Profiler.

Monday, January 10, 2005

Future and Impact of the Internet

How Internet will evolve and how this evolution will impact our lifes?
  • The Internet will be the best place to be heard.. Civic involvement (through the Internet) will increase in the next 10 years;
  • However, the infrastructure of the Internet will be the target of "at least one devastating attack" in the next 10 years;
  • The rise of the blogger are expected to drive greater change in the news media and publishing industries than in any other sector of society.. In other words, more space for the alternative press!


Friday, January 07, 2005

Microsoft to offer Anti-Spyware and AntiVirus tools

Microsoft has unveiled two newly developed tools designed to combat spyware and viruses, both acquired as a result of takeovers.

antispyware: http://www.microsoft.com/spyware
antivirus: to be announced