Jan 25th, 2011 by antijingoist
Repeating Hard Coding No-No’s
I just recently got an invite for Agr.io, and thought I’d use Spaz to keep up with it and post while on my Pre Plus. Spaz allows for custom servers in addition to Identi.ca and Twitter. The problem is, no matter what server you are connected to, you are always limited to 140 characters. Agr.io supports 750 characters, much more than the Twitter standard of 140. So, I dive into the Spaz source code and with a quick search, find the number 140, and realize it’s not attached to a variable. It is inserted everywhere Spaz needs to know the character limit is for the service. Great. Hard coded numbers.
Ideally, the client should grab the character limit from the server, but I was tight on time. I added two constants: a twitter character limit and a ‘custom’ server character limit, setting them to 140 and 750. Then I added a conditional to set a variable to one of these constants:
if (Spaz.Prefs.getAccountType() == SPAZCORE_ACCOUNT_CUSTOM) {
spazcore_charcount = SPAZCORE_CHARCOUNT_CUSTOM;
}else{
spazcore_charcount = SPAZCORE_CHARCOUNT_TWITTER;
}
And, of course, find & replace all: ’140′ with spazcore_charcount. Technically, I still cheated and repeated a mistake I shouldn’t have. I still need to modify the source code to change the character limit for posts. However, I still got it to work with Agr.io, which I wanted immediately, and I can add code to check the server configuration for the character limit when I have time later. On a serious note though, please don’t hard code numbers like that. Especially numbers that are variable.
Read the full post and comments »
Jan 24th, 2011 by antijingoist
Customizing the Command Menu Fader in Ares
I just spent the better part of the morning searching Google, trying to figure out how to get a black fader in the Command Menu using Ares. I searched everywhere in Palm’s documentation and their forums. The best solution I could find was the instruction on this forum post:
Add menuClass: ‘no-fade’ to your command menu attributes and that will remove the fade.
And that was to the same question I had. Talk about a non-solution! That was all I had: How do you change the command menu fade? You don’t! After a few hours of searching, that was all I had, and it bothered me. Then I remembered that with Ares, webOS apps are running in a browser… *almost* any browser you choose. I fired up Safari, and after a few element inspections, I had the code necessary to change the command menu fader.
.palm-menu.command-menu.palm-dark > .palm-menu-fade {
background: url(../path/to/file.png) bottom left repeat-x;
}
And then, instead of changing menuClass to ‘no-fade’, I changed it to ‘palm-dark’ (menuClass: “palm-dark”). Of course, the class name does not have to be palm-dark, I just named it that because it fit.
All the mucking about the internet was not in vain. I also found an O’Reilly Quick Reference guide that listed the two official menuClass properties that work with Mojo out of the box: palm-default and palm-white. palm-default is the normal cream-colored fade, and palm-white is a white version (that, honestly, the Palm Facebook app should use instead of the cream one). I have example images of each below.
-
-
The palm-default fader. The normal cream colored fade that looks horrible on a dark or white background.
-
-
The palm-default mojo command menu fader. It really looks good on white background apps, but not on dark ones.
-
-
My palm-dark style. The images for this are provided in the SDK, but the style needs to be manually created.
Read the full post and comments »
Jan 6th, 2011 by antijingoist
Junk Silver Calculator
I’ve been needing to account for the amount of silver I have, and learn webOS programming. I did both by writing a junk silver calculator. The hacky version is currently available via Palm’s beta feed, but I spent all day today making it refined and good. Right now it only calculates the silver value in the most common US silver coins, but I intend to add more.
The full version will hopefully be in the app store catalog soon. The beta is available here: Junk Silver Beta
Read the full post and comments »
Oct 30th, 2010 by antijingoist
Porc411 Location mapping

webOS screenshot
After once forgetting to leave my location on a Porc411, I have since been brainstorming ideas for attaching location information to the calls.
Since I don’t own the server, I am instead sending the location information to myself, and then using Yahoo! Pipes to display where the call came from, if the call was made from a Porc411 phone app (and I am assuming at this point that the call was made). And since I use webOS, it was written for webOS. Later I might post the webOS app up. In any case, here is the pipe for you to view the data I put into it.
Read the full post and comments »
Jun 3rd, 2010 by antijingoist
Porc411 Dashboard Widget for MacOS
There can never be too many ways to check the Porc411. If you do not want another notification in your inbox to let you know of a situation, you can now have a dashboard widget to tell you when there is a new message that needs listening. You can even listen from the widget. Nothing to follow, just messages when you want to see them. Widget requires MacOS 10.4 at least.
Download Porcupine411
Official Porcupine 411 Website
Read the full post and comments »