Sunday, December 21, 2008

No sound in some AVI videos problem correction

Sometimes I get some AVI videos that my K-Lite Codec Pack couldn't synthesise its sound. I realized that uninstalling the Codec Pack the sound would work (but the video not). After a series of trials I found the solution: With the codec pack installed, during playback, a couple of icons will appear on the system tray. Double-clicking the FFa icon will give you the ffdshow audio setup window, and its right panel will have MP3 as the first line, you shall change its Decoder to mp3lib to solve the no-audio problem.

Tuesday, November 4, 2008

Daily Chess Puzzle

I'm addicted to chess right now. So I made a Google Gadget of www.chessgames.com daily chess puzzle.

The path to add the gadget to your iGoogle homepage is http://www.google.com/ig/adde?synd=open&source=ggyp&moduleurl=jaderd.googlepages.com/dailychesspuzzle.xml

Tuesday, October 21, 2008

Android is now Open Source

Finally, i've been decompiling android the past weeks, and now that Android is Open Source, i finally can debug it on my pc.

http://source.android.com/download

Saturday, October 11, 2008

WinGrep - a simple Windows grep-like console application

Windows search tool wasn't enough to find the methods I was looking for, inside .jad files. So I wrote a few lines of C# code to have this explendid tool. It behaves like Linux grep, except for its regular expressions, lol.

http://jaderd.googlepages.com/WinGrep.exe

Arguments:
1: start folder path (e.g.: c:\)
2: file pattern (e.g.: *.class)
3: search string (e.g.: getFromLocation)

Full example : WinGrep.exe c:\ *.class getFromLocation

Batcher - a simple .NET C# Console Application for multiple java .class files decompiling

To decompile the whole Android.jar zipped content we need to JAD each .class file. To do it automatically you can use a tool I developed with this specific purpose.

http://jaderd.googlepages.com/Batcher.exe

Arguments:
1: jad.exe file path (e.g.: c:\jad.exe)
2: unzipped .jar file path (e.g.: c:\android\android)

Full example: Batcher.exe c:\jad.exe c:\android\android

Note: JAD files inside the target path may be overwritten without asking permission

Thursday, September 11, 2008

Google Android Reverse Geocoder Hack

I'm trying to publicize the Google Android Reverse Geocoder.
The problem is that the response comes in an unknown binary file format.
Only the Android.jar can decrypt it, and I can't decompile the JAR (cause it's not java bytecodes) to see how he does it.
Anyone has any brilliant idea on this matter?


The code follows:
Geocoder g = new Geocoder(this);
List
la = g.getFromLocation(51 , 0, 1); //somewhere in UK

then the Android makes a HTTP post to "http://www.google.com/loc/m/api" and from there comes the fiendish binary response.

Sunday, July 27, 2008

Resizable and movable Controls, C# .NET Forms

Imagine resizable and movable controls at runtime. Now make it possible! Just download the following .NET open source class.
http://jaderd.googlepages.com/ResizableControlDLL.zip

Sunday, July 20, 2008

Open source Wave Graph C# .NET Control

In addition to my Wave Reader C# .NET Class, I am also present my open source Wave Graph Resizable Control, and an example project, all zipped in a single package at the following location:

http://jaderd.googlepages.com/WaveGraph.zip

Open source Wave Reader C# .NET Class

Hello groupies. I'm glad to present to you a didactic code: the Wave Reader C# .NET Class

The code is hosted at the following location:
http://code.google.com/p/dot-net-wave-reader/

You can download the zipped source code at:
http://dot-net-wave-reader.googlecode.com/files/WaveReader.zip

Saturday, May 31, 2008

Selecting by id in Google's Datastore API

While developing a Google App, I have found some difficulty while trying to retrieve data by id. The method is very simple, and below is the Phyton code:
objectname = ModelName.get_by_id(longIntegerId)
This is how to select by id from Google's Datastore API

Thanks to: http://www.thinkvitamin.com/features/webapps/developing-with-google-app-engine-part-i

Wednesday, May 28, 2008

Google Maps Polyline Encoder and Drawing Tool

or: "How to draw encoded polylines?"
or: "2 Steps for polylines encoding for GMaps"

Out there are some sites that allows you to draw and/or encode polylines, like these:
  1. Encoder javascript
    http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/
  2. Polyline and polygons drawing tool
    http://gmaps-samples.googlecode.com/svn/trunk/poly/mymapstoolbar.html
  3. Google's encoder
    http://code.google.com/apis/maps/documentation/polylineutility.html
I decided to join them in one single mashup:





















Friday, May 16, 2008

Ideas for StreetSize

Yesterday I sent two e-mails to Matt from http://streetsize.com

-------Email 1----------

Hello Matt,

Thank you for your wonderfull site. I think I'm the first Brazilian user, and I have invited my coworkers to join. I think that you'll achieve great success while you respect your users privacy. I'm also a Google Maps mashups developer.

Sugestions:

+ Let me change my public name. I have my login name, and my real name, but I wanna choose which one users will see when they find me on the map.
+ The GMarker should be smaller and with a darker colour to distinguish itself from the background

I have more sugestions that demands much more time from you than the simple ones above. Ask me if you wanna hear.

-----Email 2 ----

Hello again Matt,

I don't know what you have in mind for your site when it gets real crowded. You don't have to share with me your plans, I just wanna be able someday to meet a neighbor, with the help of your site, without knocking his door. It seems that for now you use the Keep It Simple motto, but following are some ideas that may help, if you want to add some complexity to it:

+ Like a social site, instead of location-based-only relationships, friends should be able to track themselves through a contact list.
- With a contact list, the user should be able to filter the map to only see his contacts on it.
- With a contact list, the user should be able to add contacts automaticaly with a Gmail/Yahoo/Hotmail crawler.
+ Users should be able to input where they will be in the future, this feature should be used to schedule parties and meetings
+ Users should be able to update continuosly their location through GPS equiped mobile phones.
+ Users should be able to maintain a history of previous locations, and they could even store whole tracks.

+ If you don't know, Fire Eagle (at http://fireeagle.yahoo.net/) seems to be a service that will share his users location with a limited number of websites that each user will choose. Your Street Size could explore this opportunity also by providing an API to webdevelopers.

Thank you for your time, I hope it's worth reading and good luck!

Wednesday, May 14, 2008

Opening Google Earth (*.kmz) files with the browser

I already knew that Google Maps shows KML file content at its website. You only need to put the KML's URL at the following site search textbox:
http://maps.google.com
then execute the search. But I was unaware that the same applies to Google Earth's KMZ files. They seem unreadable without Google Earth, but you can use the same method above or use the following one:

Example KMZ file:
http://www.gearthblog.com/kmfiles/lasvegas.kmz
Append at the beginning of the above URL:
http://maps.google.com.br/maps?q=
The result is:
http://maps.google.com.br/maps?q=http://www.gearthblog.com/kmfiles/lasvegas.kmz


Open it in your browser.

Saturday, May 10, 2008

Best Google Maps Mashups

Following are my favorite Google Maps Mashups:

1. Amsterdam Helicopter Game - I'm making my own javascript version, click here to see it.
2. Twitter Spy - See where people are microblogging. It should have geographic boundaries, I could do it myself, but I would have to study Twitter's API.
3. Street View Immersive Videos - Like Google Maps Street View but now as a Video, use the mouse to rotate the view.
4. Free real state mashup - find houses and apartments for sale in Brazil, search by size, location or price, for free.
5. Geolocated voice messages - I think that is a great Idea, but it has to be specific to achieve greater success.
6. Paris user contributed map - better than Wikimapia because markers are simpler than polygons, categorization is good for searching and the side bar is easier to locate.
7. London Profiler - Nice looking data viewing!
8. WikiCrime - A wiki for crime reporting and locating.

Google Maps Javascript Helicopter Game






Click the following textbox to start to play:


Use keyboard arrows < ^ > to navigate and + - for zooming


To Do list:
  1. Integrate with Google Adsense to estabilish goals that the user will have to find, with or without the help of address or pointers.
  2. Alternative: Use a categorized list of known places (ex: night clubs) to put the player under a known places knowledge test.
  3. Use FireEagle to open the map rightly above the user real location.
  4. Change the Helicopter gif for one that changes with the inputed commands.
  5. Change the aerial mode for a terrestrial one that limits the movement to the streets.
  6. The API method "panTo" is smoother, but I couldn't make it load new images as you reach the map's edges. Currently I'm using "setCenter" and this method makes map blink.


Monday, May 5, 2008

Website Performance

Or "How to make my website faster?"
Steve Souders says that he is the YSlow creator, which is a Firefox's and Firebug's extension that calcs the conformity degree of a site with th rules for high performance websites. Now he says he got "14" new rules but lists only 10. Now I will list the current 34 YDN rules plus the 10 "new" ones:
  1. Make Fewer HTTP Requests
  2. Use a Content Delivery Network
  3. Add an Expires or a Cache-Control Header
  4. Gzip Components
  5. Put Stylesheets at the Top
  6. Put Scripts at the Bottom
  7. Avoid CSS Expressions
  8. Make JavaScript and CSS External
  9. Reduce DNS Lookups
  10. Minify JavaScript and CSS
  11. Avoid Redirects
  12. Remove Duplicate Scripts
  13. Configure ETags
  14. Make Ajax Cacheable
  15. Flush the Buffer Early
  16. Use GET for AJAX Requests
  17. Post-load Components
  18. Preload Components
  19. Reduce the Number of DOM Elements
  20. Split Components Across Domains
  21. Minimize the Number of iframes
  22. No 404s
  23. Reduce Cookie Size
  24. Use Cookie-free Domains for Components
  25. Minimize DOM Access
  26. Develop Smart Event Handlers
  27. Choose <link> over @import
  28. Avoid Filters
  29. Optimize Images
  30. Optimize CSS Sprites
  31. Don't Scale Images in HTML
  32. Make favicon.ico Small and Cacheable
  33. Keep Components under 25K
  34. Pack Components into a Multipart Document
  1. Split the initial payload
  2. Load scripts without blocking
  3. Don’t scatter scripts
  4. Split dominant content domains
  5. Make static content cookie-free, repeated
  6. Reduce cookie weight, repeated
  7. Minify CSS, repeated
  8. Optimize images, repeated
  9. Use iframes sparingly, repeated
  10. To www or not to www
I would like to add 2 rules that I readed elsewhere:
  1. Optimize inner loops
  2. Make XHTML web pages
The first one is explainable from the programmer's point of view: the inner loops are the greatest time consumers, and by optimizing them you gain computational time. For articles dealing with how to do that with JS read this and this too.

The second rule applies to mobile web development, where hardware resources are fewer, and complete browsers slowers than browsers that read only XHTML. Visit http://validator.w3.org/ to validate your website.

Yet another post about Firefox plugins

I can't understand people that like Internet Explorer (IE) better than Mozilla Firefox (FF). Benchmarks like this and the plurality of add-ons are my arguments against those people. Following there are some of the essential FF extensions that I know:
  1. IE Tab - some web pages (like .mht) just open in IE, you can open them inside FF with this trick.
  2. Customize Google - removes Google Ads from all websites, also improves security and privacy at any Google website, customize the number of Google's results and makes image results point directly to images.
  3. Ad Block Plus - Remove all Ads from any Website.
  4. Downloads in Tab - The annoying little download window will be a tab.
  5. No Script - this is what makes FF safer than any other browser.
  6. PDF Download - now you can choose what will happen when you click on a PDF link.
  7. Table2Clipboard - copy HTML tables content to you spreadsheet editor.
  8. Gmail Manager - checks for new mail at your(s) Gmail account(s)!
  9. GSpace - turns your Gmail account into a remote drive
  10. PermaTabs - turns a selected tab into a permanent (unclosable) one, useful to people who uses iGoogle or Google Reader.
  11. Tabs Open Relative - new tabs will be open next to current one, not at the end anymore.
  12. Firebug + DOM Inspector - essential for every Web developer: javascript debugger, complete HTML, DOM, style, traffic analysis

Saturday, May 3, 2008

Globalization Tips for Web Programmers (ASP.NET)

The most important thing when you develop an ASP.NET website which interface language is portuguese, is to use the following Web.Config entry:
<globalization uiculture="pt-BR" culture="pt-BR" fileencoding="iso-8859-1" responseencoding="utf-8" requestencoding="utf-8">
The newbiest programmers usualy forget the that his application users could insert special characters into a form. When sending parameter via QueryString the browsers always convert those special characters in an encoded form via one of these functions below:
  1. escape(), example: @ is escaped to %7E
  2. encodeURI(), example: % is encoded to %25
  3. encodeURIComponent(), example: @ is encoded to %40
I strongly recommend to use explicitly EncodeURIComponent() when passing parameters via URL. If you do as I say, the ASP.NET will implictly decode it when you call:
Request.Params["parameter's name"];
But if you forget the explict encode, none of the functions below will be able to retrieve correctly those special chars:
  1. Microsoft.JScript.GlobalObject.unescape(), complemented by escape()
  2. Microsoft.JScript.GlobalObject.decodeURI(), complemented by encodeURI()
  3. Microsoft.JScript.GlobalObject.decodeURIComponent(), complemented by encodeURIComponent()
  4. Server.UrlDecode(), complemented by Server.UrlEncode()
Nota: In order to use Microsoft.JScript at MS Visual Studio, you must manually Add Reference.

Javascript (and also JScript) also has
escape(), encodeURI() and encodeURIComponent() and their complementary functions, that have a slightly different results from ASP.NET ones.

Saturday, April 26, 2008

iGoogle, Google Gadgets & Orkut Mobile

My homepage is iGoogle, the customizable Google homepage. There you can have more than the simple Google start page, you can also add gadgets, they are web pages in small containers that resembles windows. My favorite gadgets are:
  1. Todo List (source code)
  2. GMail - read and write e-mails without leaving the homepage (source code)
  3. Google Talk - simple and fast, replaces MSN Messenger (source code)
  4. Google Reader - better than opening each web page/RSS to read the latest news/updates, you just need to add all of them to Google Reader and you can read them in one place, with a "hide readed" function. (source code)
  5. Orkut Mobile - this one I made myself, just shows Orkut Mobile site inside the gadget (source code)
Every gadget is open source and easy to create, just use Google Gadget Editor, that can be used also to upload files (images, scripts, etc), save your code at Google's servers and publish for everyone find and use it.

PS: The background image I've chosen for my iGoogle is the sky, updated every hour!

Thursday, April 24, 2008

Google Maps for dummies

Many people thinks first in Google Maps when choosing an API for displaying maps on a website. There are many alternatives, some of them are even better, as Maplink, the best geocodification in Brazilian territory, Yahoo! Maps with its lightweight API, and MS Live Maps, with 3D buildings, they have their advantages and drawbacks, but none of them widespread as Google's API. Below there are the first steps for who wants to deploy his web map:
  1. If you need instant action, use a Wizard:
  2. You'll need to get a license
  3. You'll rely on Google Maps API reference
  4. To keep in touch with latest news and to explore the possibilities sign the Official Google Maps blog's RSS
Tips for advanced developers coming soon!

Tuesday, April 22, 2008

Cacheable ASP.NET pages

Or "Caching ASPX pages"
Or "How to make ASP.NET pages be stored in the browser's cache?"

I used to save every static page in my Web Projects as .HTML files. But Sandro, from MS-Developers taught me how to make cacheable ASPX pages:

Just insert the following C# .NET code into the Page_Load
Response.Cache.SetExpires(DateTime.Now.AddYears(3));
Response.Cache.SetCacheability(System.Web.HttpCacheability.Public);
You can use the if(!IsPostBack) condition enclosing the code above, for AJAX Pages.

Researching a little more I found an alternative method, just include in the beggining of the ASPX file:
<%@ OutputCache Duration="31536000" Location="Any" VaryByParam="none" %>
As written at ASP Alliance ASP.NET reference

But if you want to disable cacheability use the following code:
Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);

Wednesday, April 16, 2008

Simple Windows Drumkit

Would you like to play drums while do you hear your songs? Even if it's only to play while you wait or download something? This app could be nearly invisible so you could play without disturbing you normal pc use, and to avoid your bosses' eyes.

With a couple of work hour I made this Simple Drum Kit, that fullfills all those requirements, and beyond, because it uses WAV files that can be replaced at your taste. Here's some suggestions:

- Special effects
- Backing vocals
- Percussion
- Melodies
- Bases
- Other music

To download follow the link:
http://www.codeplex.com/skd