Archive for the ‘development’ Category

h1

Display Version / Revision Number in Flex / Actionscript

March 31, 2009

I wanted a method to show what the version or subversion revision number a user was currently running.  The main reason is to determine what code base was being run by users reporting problems I thought we fixed, or not seeing functionality I thought was complete.

Most people are familiar with this functionality exposed via the “Help->About” menu on a desktop application.  Web developers need to do this differently, as there typically is no outer application menu. 

Being a flex application, I have the ability to modify the context menu users see when they right click.  This was part one of the puzzle, and that answer is well documented in this post by Kenny Lin.  The way I have my SDK wired, much of the code documented there did not trigger the autocomplete on my system, but it compiles and runs perfectly.

Getting the revision number is the hard part.  We currently use subversion as our source code repository, and it has a global revision number – what most developers would refer to as the build number. (Due to the fact that we now do a build every time we do a subversion update, see below.)

Subversion has a technique called keyword substitution which allows you to put a string in a file like $Revision$ and every time that file is updated on the repository subversion will update that string with the correct number.  I thought I was done right here – but the problem is that subversion only does this substitution when it updates a file, i.e. when a developer edits it.  I added this to our main application file, and it worked the first time I updated it, but it turns out we don’t update that file very often anymore.

The biggest piece of the puzzle was an autobuild process which is triggered by subversion updates.  My very simple build script generates a subversion info file using this shell script command:

svn info > assets/svnInfo.txt

I embed this file in the application via this technique which is only a couple lines of actionscript code:

//Embed a text file that is autogenerated by the build process
//it contains the revsion number of the project from subversion
[Embed("assets/svnInfo.txt", mimeType="application/octet-stream")]
private static const svnInfoText: Class;

And the following function parses the revision and puts it in the context menu:

/**
* add the version number from the subversion generated file
* to the context menu so testers can verify what
* build they are running
*
**/
private function setUpContextMenu():void
{
    var myMenu:ContextMenu = new ContextMenu();
    myMenu.hideBuiltInItems();
    var svnTextInstance: Object = new svnInfoText();
    var svnString:String = svnTextInstance.toString();
    var findString:String = “Last Changed Rev:”;
    var revisionString:String = svnString.substr(svnString.indexOf(findString) + findString.length +1, 5);
    var menuItem1:ContextMenuItem = new ContextMenuItem(“MyApp v0.1.”+ revisionString);
    myMenu.customItems.push(menuItem1);
    this.contextMenu = myMenu;
}

Getting the autobuild process up and running was the hardest part – learning the various libraries I needed and setting up the license information from adobe.  I have a lot of ideas and opportunities around that, including ANT or other build tools – but for now the simple fact that I can control the build to the level of adding this step of creating the subversion information file get’s me the functionality required. 

h1

Removing formatting for cut/paste

November 19, 2008

When cutting/pasting to some web apps or editors I find myself annoyed that the formatting from the source came along – font size in particular.  The really annoying part is that everything I type after what I pasted is in the new font.

To get around this I paste to notepad and cut it from there.  This way I only get the text and not the formatting.

To do this quick I use launchy to open notepad, but without launchy you can do it pretty quick with Windows Key + R, type notepad + return, then paste, select all, copy.

h1

Got website?

October 27, 2008

Lately I’ve been asking various service provider’s and friends if they have a web site.  Most don’t – and the reason is there isn’t a really easy and wicked cheap solution.  So I say to these people that I do web sites… sometimes it leads to something, sometimes it doesn’t.

Lately my favorite way of building these things is using GoDaddy as a registrar and Google Sites as the source for the webpage.  A few times I’ve just purchased a domain and pointed it at an exsisting site, and for a couple I’ve helped them get a blog up and running. 

Some recent additions to the portfolio:

Leigh’s Barber Shop : A most excellent Barber Shop in Shelburne, VT  – This is a whole google site, with google analytics and multi-user content management.  Still need to add some content to this really simple site.

ReJardin.Com : I secured a domain and redirected it to an existing site.  The real goal here was that the user had a unique domain name that wasn’t claimed yet – so I grabbed it and redirected it.

ToddAubertin.Com : I found a wooden flute maker/ furniture maker up the road and saw his web site needed a lot of work.  I set him up on wordpress in barter for a custom flute.  Did some picture editing/ content creation as well.  We’ve got some plans for more stuff on the site, and I have some plans for some custom furniture for our home.

Manny500Photo.com : I try to make it to Baltimore to see the Red Sox play at Camden Yard once a year.  This year while I was there with the girl: Manny Rameriz hit his 500th home run – and it was a baseball moment we will remember sharing forever.  A fraternity brother of mine was there as well, and took a photo he wanted help selling online.  So we put this site together.  Then the stupid looser Manny had to go and get himself traded to the Dodgers.  A kewl part of this project was tapping the photo editing talents of our friend Jean Wozniak.

There are a couple more not quite ready to mention – but my favorite part of the process is that I haven’t exchanged money for any of them.  A couple cost me about $10 and time – but it was time spent not just building the collateral, but learning the process and being better prepared for the next one.

h1

Putty Default Settings

October 7, 2008

PuttyDefaultSession I can’t see the blue in Putty , and every time I started it had to go find that setting.  I asked a couple people about how to make this the default and the didn’t know.  So – I finally figured it out today.  When you start putty, it comes up with a list of “sessions” – and the key thing to understand is that there’s a “Default Session” on the first window that pops up.  Dunno how I missed this for so long.

So make the changes you want in properties – then come to this tab and save with the “Default Settings” session selected.

h1

Facebook "She Said" App

October 1, 2008

Had an idea for a facebook app – it basically let’s you reply to people’s comments or pretty much anything posted on the facebook news feed with “That’s what She Said” – and you probably get points for it or something.  We’ll make money on volume baby.

One feature would be to not actually post the comment but have it show to everyone who has allowed the app access to their feed.  I have a friend on facebook who would not appreciate me responding to her status updates with this phrase, but I know a lot of people who would find that response very entertaining.

h1

Educational Programming

September 27, 2008

Got tired of writing out random math problems for the Girl to practice, so I made a webApp to do it for me. Had some fun with it – and the big thing I learned was that it’s possible to deploy flex app’s on the Google Pages framework.

Check out Anna’s Math Quiz and lemme know how to make it better.

h1

Constant ToDo List

September 24, 2008

IMG_0865 I bought a SideShow device last week, and in the back of my mind I knew what I wanted it to do for me, and today I accomplished it. 

SideShow is a technology to display information on an auxiliary device, kind of like a small monitor for your computer.  picoLCD recently released a device that got below the $50 range and I pulled the trigger.  The device’s are typically used to show the weather, or your inBox status, or stock prices. 

What sparked my interested is that it can also show RSS feeds (blogs).  My current project is using Trac to maintain a list of work to be done, bugs to be fixed, tasks to accomplish – and Trac makes it easy to customize reports and (ding!) display them in RSS format.  So I customized a report to show my top “to do” items and used it as a feed to the sideshow device – so I constantly have a list of what I “should” be working on.

The hardest part was learning Microsofts RSS Platform – which you have to use to get feeds to the RSS gadget that supplies the device it’s information.

I’m not crazy about the RSS gadget and am considering writing my own – it doesn’t update as often as I want and it doesn’t allow me to format the output so the list is a little more compressed.  You can see the “#:” text in the image, I’d like that gone – just a simple list of the RSS info.  Some scrolling on that list would be nice too.

h1

Long lost friend: Found on FaceBook

September 16, 2008

Fabien Found one of my first best friends on FaceBook today.  I haven’t talked to him in about 25 years, since his family moved back to France.  By itself that’s a kewl story – but the interesting (i.e. bloggable) part is that his job is very similar to mine right now.  He’s working at a start-up, mostly at home, building a Flex based UI on a non-Microsoft platform and his team is using Scrum, and they are deploying some of it to the Amazon cloud – all things I’ve been doing.  25 years go by and we both end up doing a very similar thing – whatever made that happen must have been a factor in us becoming friends – or was us becoming friends the factor?

I very much regret that we weren’t in touch when I visited Paris in 1998, as it would have been awesome to have a local to show us around.

h1

QR Codes

July 29, 2008

I just discovered what those 2 dimensional bar code like tags are.  They are called QR Codes and they are very kewl.  I guess the reason they are so kewl is because

  1. They are VERY easy to create yourself with anything you want in them
  2. It should be pretty easy for anyone with a modern cell phone (iPhone app == 2dSense, and is free) to scan them. 
  3. Most scanning programs do things like navigate directly to a URL if that’s what’s encoded

This means you can do things like put one of these tags on a physical object and cause that object to make your phone navigate to a webpage describing the thing it’s attached to.

The following page lets you generate them: http://qrcode.kaywa.com/

Here are some I generated – you’ll have to get the a scanner working to read these

blogPost blogPost1 blogPost2 blogPost3

I anticipate I’ll be using these – I just haven’t imagined how yet.

Here’s a site that let’s you create a patch out of one – but it’s not quite as kewl as possible, as you have to make a link that goes through his site – but still a kewl idea.

h1

Open Source == Goodness

May 29, 2008

Yet another great story in my journey into open source software – there were a couple questions I had about using PHP to access MySQL procedures, and I had a problem installing a good PHP dev enviornment – so I connected to IRC for the first tie in maybe 15 years. Not only did I get my answer – but I had people debating over the best solution. After getting it all resolved I totally did a “kiss both fists and point to the open source gods” move.