Remove all un-tracked files under mercurial

I just had an issue where Visual studio junked up a fresh hg clone with some project upgrade information among other things.  This my quick remedy.

rm $(hg status -A | grep ? | cut -c3-)

Installing Balsamiq Mockups on Fedora 17 with alien

This is a set of instructions for installing Balsamiq on Fedora 17 using alien and the .deb package provided on the Balsamiq website . Hopefully there will be an rpm package download in the future.  This method can be applied to other deb packages as well.

Start by downloading the Balsamiq .deb from http://www.balsamiq.com/download#dlin

Next you’ll need git installed, if you don’t have it already. ‘yum install git’ does the trick.

Next download the alien source code from http://joeyh.name/code/alien/ and install it

cd /home/[username]/[location]/
git clone git://git.kitenet.net/alien
cd alien
perl Makefile.PL; make; make install

Finally run alien and pass it the path to the deb file. Run the alien script without the i flag if you just want to generate the rpm and not install.

cd alien
su
alien -ri --scripts /home/[username]/[Downloads]
/MockupsForDesktop[Arch].deb

Finally add a symbolic link to balsamiq and run.

ln -s /opt/Balsamiq\ Mockups/bin/Balsamiq\ Mockups /usr/bin/balsamiq
balsamiq 

Building a multi-touch foosball table.

Over the past year I’ve become a foosball fanatic.  We have a great foosball table where I work and The other day after a game I sat down at my desk and with some free time left decided to check out what was new on the exhibition page at processing.org [http://processing.org/exhibition/].  I came across the “Max Planck Reasearch Networks” video and immediately though to my self ‘that multi-touch screen looks like it would be the perfect size for a foosball table!’  And so began the idea for my latest side project…

 A foosball table with a multi-touch playing surface.  It should have the ability to be customized with graphics and sounds, respond the the ball’s motion, keeps track of goals and other stats, as well as provide shot replays.  Eventually I’d like to mix in facial recognition to recognise players for stats keeping and respond to as a player enters the play area.  The so far cost is an issue as well as the accuracy of tracking a hard foosball on a hard surface. So for now I’m starting with a small scale prototype and building as much as I can from scrap parts to keep costs down.

I’m basing my initial design off of this article from maximumpc.com http://bit.ly/KfEKMr.   It’s relativly cheep, since i have most of the parts already, easy set up, and there is already a lot of information available on the web to back this approach.  I’ll probably stick pretty closely to these plans for this prototype and only diverge on the projector, which I’m going to create my self.

I’ll be updating this post with my findings as I go.

Read More

Quickly get a list of all links on a web page with xslt.

  1. Find ‘view source’ in your browser, copy everything.
  2. Got to xsltcake.com and paste the source into the “XML” section
  3. Paste the following into the “xslt” section.:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
      <xsl:template match="//a">
        <xsl:value-of select="@href" />
      </xsl:template>
    </xsl:stylesheet>
    
  4. Click Run

Prepend a file to another file under Linux or Mac OS X using sed.

This command comes in handy if you want to prepend one file to another.

sed -i -e ‘1r fileToAppearOnTop.txt’ -e ‘1{h; D;}’ -e ‘2{p}’ fileNameToPrependTo.txt

Here&#8217;s my latest project on github. This lets you Beautify excel formulas, as well as converting them to c# or JavaScript. https://github.com/joshatjben/excelFormulaUtilitiesJS.

Here’s my latest project on github. This lets you Beautify excel formulas, as well as converting them to c# or JavaScript. https://github.com/joshatjben/excelFormulaUtilitiesJS.

Trim an HTML string

Trim HTML - this will remove any leading or trailing <br />, &nbsp; or white spaces.
^(?:\s|&nbsp;|<\s*br\s*\/*\s*>)*|(?:\s|&nbsp;|<\s*br\s*\/*\s*>)*$

JavaScript function

function trimHTML(inStr){
    return inStr.replace(/^(?:\s|&nbsp;|<\s*br\s*\/*\s*>)*|(?:\s|&nbsp;|<\s*br\s*\/*\s*>)*$/, "");
}

How to convert a usb drive to NTFS under windows

This is useful when trying to get windows onto a usb drive. (Change d to your USB drive)

convert d: /fs:ntfs

Just because you can grasp the answer does not mean you have the knowledge, wisdom, experience, or work ethic to come to that answer

Regular Expressons - Validate a date formated as [yyyy-mm-dd]

This will make sure that the the year is 2000 or greater, check to see that the month is between 01 and 12, and finally make sure the date is between 01 and 31.

^[2][0-9]{3}-(?:[1](?=[0-2])|0(?=[1-9]))[0-9]-(?:[3](?=[01])|0(?=[1-9])|[12])[0-9]$

About

Hi my name is Josh Bennett (AKA joshatjben). I'm a Philadelphia based interactive solutions architect. I specialize in web and mobile.