
Google has a tool for companies that consists in a server that craws all the information in the company and indexes it.
Today i passed all the afternoon playing (user perspective) with that little powerful thing.
The usage is simple. The machine is configure to have several types of indexes. So, when you request the information, the machine only returns the information about the specific thing you are searching for.
The Request is simple. Is a Http Request to the specified url were you pass, via query string, the information about your search (search key and several configuration parameters).
My implementation was very simple. A class, that i called it GSA (stands for Google Search Appliance
), with a method called Search. This method receives 3 parameters: the string to search, the start item and a filter parameter.
The filter is the more strange parameter here. It is used to return or the most relevant information, or all the results. The start item is the index of the first element that GSA must return( ie. Give me the elements starting at index 10). Finally the string to search… obvious…
When the Search method is called, i make an Http Request to the server, obtain the information (in a XML format), parse the information using Xpath, return the array of results to the class that invoked GSA (in my case a ASP.NET page) and render all the information.
Simple right?
Well, that is not necessarily right. The initial idea of the manager of my project was to copy a code of someone that already implemented a similar thing. Let’s just say that the boy that implemented it didn’t know how to program. Mixed all the fundamentals of programming (divide the application in Layers for instance). The boy inserted all the code in the Load event of the page, in a single method… no comments…
Unfortunately, in Portugal at least, the programming companies only want what we usually call a Code Monkey and, for that reason, the clients spend millions of euros trying to fix something that could be made correctly at first time.
Today morning i noticed that my blog skin was totally upside down. No, i didn’t been attacked by an hacker.
In fact, the skin i am using wasn’t prepared for internet explorer. Because i normally use Firefox, i didn’t noticed.
So with a little bit off patience i opened the css file an tried to find the styles that needed to be changed. When i found them, i had to apply an css hack to work in both IE and Firefox.
The hack is simple. If you have the style:
.style{
margin:0;
}
and, in it’s context, works well in Firefox but not in Internet Explorer (or vice versa - this normally isn’t the case) we change the .style into the value that works good in internet explorer and create the a new style so it continues to work in Firefox:
/* Internet explorer applies this*/
.style{
margin:10px;
}
/* Firefox applies this*/
html>body .style {
margin:0;
}
If you have more styles, you can leave them in the original .style because firefox will apply them as well. You only need to override the styles that are changed.
I’m developing a website (still top secret) that needs a star rating system. I googled for simple ajax rating systems but didn’t found anything decent (maybe i didn’t googled well).
Pre send me this link. A very cool Star rating system using CSS. Very light and exactly
what i needed!
Here is the link to the “How To”. Maybe i’ll integrate this in an ASP.NET control and publish the code her.