29
Nov 08Weekend Update
This week left me with some extra time, though most of it went to seeing family for Thanksgiving, I did manage to create my first gesture-esk application for my multitouch table. When you place 3 or more fingers on the table, it looks for 3 that are making a triangle within a certain size, if it finds one it places a circle in the middle, symbolizing bringing up a menu system.
I’m not sure if there is a better way to do what I did (it seemed to contain too many for loops), but it starts at a finger, then looks for two other fingers within a certain distance from that one. If it does not find two others close enough, it moves to the next finger. If it finds two or more, it checks to see if any of them are within that distance from each-other, and stops if it does. It works really well, and thanks to a friend on a forum I visit, I was able to use an incenter equation to calculate the center.
I started thinking about the next push for RISDpedia. Im looking at ways to document electronic components next. One of the things I have been thinking about is how to document the availability of said components.
Because you cant just pop into a store to purchase them (sad I know), I needed to have a list of placed they can be ordered. As luck would have it octopart (if you don’t know it you really should) has a search API. Octopart lists all the place where you can order a part (Digikey, Mouser etc), if it is in stock, ho many they have, and more.
The API was a little hard to break into though, and it took me more than a few hours to get everything out of it I needed. It is only available as a JSON object and im not the best with javascript. I used MooTools to handle the JSON call, but because there is no print_r (as in php) to pull, and see everything out of an array, I had to do loop after loop to find the entire structure, so I could then map it out, go back, and just ask for the information I want.
Granted, I’m sure im doing it completely wrong, it works. At some point when I have time Ill make it into a MediaWiki extension for RISDpedia.