Optimizing J2mepolish Build Proccess
J2mepolish as a build framework is great! I have been using parts of it since before it was in beta.
J2mepolish provides different licenses depending on how you use the product now while this can be looked on in a bad light but I quite like the fact that it is open-source as well as long as you your self release the code under the same license should you wish to release under a different license there are other payed options available.
The build framework is licensed under GPL no matter how you use it.
I have found that the build proccess can be pretty slow and time consuming I have also found that with out obsfication it by default includes ALL classes in the framework include the GUI/Utils. While you don’t make use of them you aren’t violating the license it does increase the application size. There are a few tweeks that one can make to their own personal setup to improve this.
Firstly tmpfs and mounting your /build and /dist directory into memory (For debugging only I wouldn’t mount a full build) You would have to replace the standard build clean target since the standard user shouldn’t have permissions to delete/create tmpfs
Standard:
<delete dir=\"dist\" />
Changed
<delete includeemptydirs=\"true\">
<fileset dir=\"dist\" includes=\"**/*\" defaultexcludes=\"false\"/>
</delete>
Secondly the since the build proccess includes all the J2mepolish source files by default you should be able to just set polish.client.source to a empty directory but it contains a reference Locale which also contains references to other files(Which are not 100% needed unless you actually use the Utilities provided by J2mepolish)
So a simple fix is create a folder structure with /path/to/directory/de/enough/polish/util/Local.java and place this Local.java in there.
In the build file or one of the config files set
polish.client.source=/path/to/directory
and you should be all set. I noticed huge build time improvements but I don’t currently make sure of the GUI/Utils.
Hope this helps make you more productive. If you have any other tweaks I would love to hear them.
Using Python to Format Json
I have been working quite a bit with Json. Json disregards whitespace by implementation this makes the standard format of Json being a single very long line of not so readable text.
Simple example.
{"query":"some text","results":[{"title":"some result","id":"213"}]}
I had some plan to write some simple python script to format it nicely. I have used the json module before, I wasn’t aware it had a format function as part ofjson.tool.
curl + Json + Python
curl http://domain.com/api.json 2> /dev/null | python -mjson.tool
I found that with our redirection the error output to /dev/null i was getting.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 67 0 67 0 0 76 0 –:–:– –:–:– –:–:– 0
Formated Json
{
"query": "some text",
"results": [
{
"id": "213",
"title": "some result"
}
]
}
So Shiretoko isn’t Firefox So Why Call It That?
I have been using the standard Ubuntu Jaunty repo version of Firefox-3.5 since before it was in the standard security repo when it was in fta’s ppa With this version I expected it to be buggy or have oddities such as being called Shiretoko. With the standard repository version I expect it to be Firefox
I know the reasoning was mentioned here some of the reasoning makes sense but if a user chooses to manually install firefox-3.5 they expect to get Firefox since this wont ever auto auto-update from 3.0 to 3.5 with out the users expressed permission I see this as an annoyance.
Calling it Shiretoko is annoying. Having the user-agent string below tends to break sites.
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1) Gecko/20090701 Ubuntu/9.04 (jaunty) Shiretoko/3.5
Now I am not saying call this thing Firefox if it is really an ubuntu build of Shiretoko but since Shiretoko isn’t a standard or mainstream browser it wont be in any Device Database. such as WURFL or DeviceAtlas I say these because I mostly work with mobile related technology but the reasoning applies for any device db or user-agent checker.
Face Book makes horrid pop-up windows.
Use the Chat list on the right to start a conversation.You’re using an old web browser to browse Facebook. To use the full version of Chat from within a normal Facebook window, please upgrade your browser. Switch to Firefox.
Changing the user-agent of a browser in this day and age severely impacts on a users browsing experience. Since most websites now try to do browser detection (Some better then others) they generate different output for different browsers or even worse sorry this website only works in Netscape Navigator and IE 5 and above.
Re Dumping currently loaded Firefox URLs
bryce posted his Perl version of Dumping currently loaded Firefox URLs.
I decided perl is unreadable
and the file is json any way. So with the python-json package You can get some pretty readable code so I wrote a pretty simple Python version ff-pages.
Usage:
python ff-pages.py /path/to/location/sessionstore.js
I am starting off with python so all comments are welcome.
Update 02/06/2009:
python-json isn’t needed.
Seems to only work with firefox3.5
Gmails Label Improvements Broke BetterGmail2
Today Gmail released their improved label support. This update provided some very nice features like drag and drop emails into labels. and changing the order of your labels.
This change did how ever break BetterGmail2 a Firefox add-on. The most noticeable change was the break in the “Sub Labels“. Some of my labels only fit on the screen because the first bit is removed and then indented. Ie I have Mailing List/Ubuntu-za which now only displays Mailing List/Ubu which is rather annoying. The reason for this naming convention is Gmails Imap support does this.
but if you try to add subfolders in your mail client, they’ll become labels that look like this: Folder/Subfolder.
I hope there will be a release patch for this soon.