Archive for the ‘programming’ Category

A discussion about whitespace and programming 4th dimensionally

Tuesday, November 10th, 2009

Dan: http://stackoverflow.com…
Dan: python!
Dan: answer: python is wack
Me: from __future__ import division
Me: Oh shit that package is from the future!
Dan: haha
Dan: in the future all whitespace is meaningful
Dan: maybe the next generation of strict constitutionalists will be python programmers and look at what the founding fathers meant in their use of whitespace
Me:

In order to maintain a well-formed Militia
     people should have guns

Me: Aha!
Me: Only in the context of the well-formed Militia block does that apply!
Me: Python wins again.
Dan: crazy: http://timhatch.com/projects/pybraces/
Me: Someone could probably write a pretty solid one.
Dan: just import it from the future and it will already have been done
Me: Haha. I should use that more often.
Dan: heh, it’s like that part at the end of bill & ted 2 where they say they traveled back in time in the future to plant the key, etc..
Me: Heh, I don’t remember as much of Bill and Ted 2 as you.
Dan: maybe that’s the next big thing after agile, programming 4th dimensionally
Dan: i saw that movie way too many times
Me: Space-oriented, future methodology is where it’a at.
Me: In the future.
Me: Bill and Ted? Or Back to the Future?
Dan: both

Last stop: 0.3 Alpha

Saturday, April 18th, 2009

I started writing a multi-service status updating app a while ago, in large part just to learn Flex. I haven’t worked on it since January, but I’m officially putting attneveryone (and 13 tasks on my to do list) to bed today.

It’s at the point at which it suits my needs, and further development is unlikely to help out anyone else. (They can just use ping.fm, which covers every possible service, although it requires you to give up a lot of credentials, and I have a personal aversion to that.) This last version is also pretty solid. I’ve been using it for three months without any problems. (On Windows, though, there’s an issue with ugly scroll bars showing up the first time you add an account.)

It feels good to free up just a bit of “mental obligation real estate.” Now I can build some other crap on it!

Marking your new messages as read without having to go to Gmail in a browser

Friday, February 20th, 2009

I use Gmail Notifier. It absolves people of the need to constantly go to mail.google.com in a browser to see if they have new mail. If I have new mail, the mail icon in the menu bar will turn red, so I can forget about it.

The thing is, sometimes you get new mail that’s just not worth the effort of opening a browser tab. (Gmail Notifier gives you a summary of your new mail.) Yet if you don’t actually go into Gmail, those messages will still be considered new, and the Gmail Notifier icon in the menu bar will stay red.

It does not have a command that lets you tell it to ignore the recent new messages and change its icon back to gray. The red active notifier is surprisingly hard to ignore. So much so that I usually end up going to Gmail and clicking on each new message just so it won’t be counted as new, and the red icon will go away.
 

Well, not anymore. I put together a simple Python script that uses IMAP to log in and mark the new messages as read. If you want to use it and have Python installed, all you need to do is enable IMAP in your Gmail settings, edit the script to use your username and password, and then execute it whenever you want Gmail Notifier’s red icon to stop glaring at you.
 

markasread.py (Right-click to download.)
 
 

Avoiding “Error creating air file: 303″ when compiling a Flex project with an icon

Tuesday, January 6th, 2009

Adding icons to a Flex WindowedApplication project should really be super simple, but because the error messages you get are when something is off are not specific about what is wrong, it took me about forty minutes of googling to find out what was up with these “303: ERROR” messages. So, just in case, you, readers of Notes of Chaos, ever want to specify icons for your Flex desktop application, I’m going to save you some time and tell you what to look out for.

1. You specify the icon files in the yourappname-app.xml file under the <icon> tag. There’s child nodes under that tag: <image16×16> through <image128×128>. Whether or not you think an icon size is going to show, you need to specify one valid image for each of those image tags, or you’ll get the 303 error.

2. The content of those image tags must be a path to an image file that is somewhere under src in the project hierarchy. Flex can’t find the image files outside of src. So, if your 16×16 icon is in src/icons, you’d specify: <image16×16>icons/myicon16.png</image16×16>

3. I read some posts by a guy with an Adobe logo as his userpic that the images have to be in PNG format and that they have to be the sizes specified by the tag.

4. In Project | Properties | Flex Compiler, the “copy non-embedded files to output folder” option must be checked. This will copy the icons to the output folder, and I guess Flex looks for them there, because without it you get the 303 errors.

5. When you build the debug build, no attempt is made to incorporate the icons, as it’ll be running from the debug launcher anyway. When you build the release build is when it actually bothers with them.

6. In the Export Release Build wizard, you can usually just hit Finish on the second panel, but not if you have icons for your app. There’s another panel, which I didn’t know about before. Hit Next on the second panel, and you’ll get to the mysterious third panel, “AIR File Contents.” It lets you select files you want included in the built package. By default, it’s going to include a bunch of unneeded crap, so you probably want to hit Uncheck All and then check the folder containing your icons.

Hopefully, once you do all that figurative i-dotting and t-crossing, Flex should stop giving you a message box full of cryptic 303 error messages and build you an AIR package that installs an app with fancy, or at least non-generic, application icons.

Bullet point post

Thursday, October 16th, 2008
  • Special thanks tonight go out to: OS X’s arbitrary rectangle screen capturing, Perl, tabs.
  • So, I went from a fairly interesting and thought-intensive task the last couple of days to something fairly robotic. I find it relaxing now.
  • Also, a little bit of automation can make something a lot less grating than no automation at all.

Oh, and also Greasemonkey and Perl.