If you want to get your manager to try out Erlang, but they are hesitant (probably an understatement) you might be able to get some leverage if you use a relational database rather than mnesia. So, here's a quick sample of how to connect to and query a MySQL database.
First, you'll need to install the MySQL ODBC driver if you haven't already. You can find it at http://dev.mysql.com/downloads/connector/odbc/5.1.html. Then you'll need a database to connect to and a table to query. Here's the SQL script I used to create my test database:
And here's the code to connect and query in erlang:
This is what my interactive session looks like:
It's that simple. Post a comment if you want more samples or description.
Erlang docs: http://www.erlang.org/doc/apps/odbc/index.html
I hit the App Store last night to find a new game in the number one spot that I hadn't seen before. It's called Space Deadbeef (as in the hex number). It's a side-scroller with amazing graphics and a great interface-- and it's free! This game is very fun and it's impossible to duplicate this interface on any other platform because it makes extensive use of the multi-touch screen. Personally, I use three fingers to target all of the enemies rapidly and it is very satisfying. It makes me feel like a robot, but in a good way.
In other news, Microsoft released an app called SeaDragon on the App Store. Yes, it is a bit strange seeing as they are supposedly planning to create their own app store (http://tech.slashdot.org/tech/08/11/08/2225250.shtml). This app allows you to view images at different resolutions using pinch-and-zoom a la Google Maps. Seems like Microsoft is as original as ever. http://gizmodo.com/5109658/seadragon-mobile-microsofts-first-ever-iphone...
I've attached three pics of the game, but they are crappy res because I took them with my cell phone so they don't do much justice.
I came across the most impressive Erlang tutorial I have seen yet. Check it out. Now.
I'm working on a tile editor in Flash CS4 and opted to use the TileList class for the palette. Once a swatch is selected, I need to create a copy of that swatch and attach it to the stage. I wasn't quite sure how polymorphism in AS3 worked but I ended up with this little snippet:
Let me know if it helps!
I recently got an iPod Touch and it is the best gadget I've ever had. One of the features of the powerful little machine is the location service. This service uses the wifi radio to listen for wifi beacons, the signal an access point sends out every second or two to let clients know the AP is there. When you refresh your list of wireless networks, it gathers these signals to make the list. Anyway, the utility of this feature is actually quite extensive. You can use it to find nearby restaurants, movie showtimes, and make getting directions a breeze. Unfortunately in my home area, there is no coverage.
I began searching and found an article on MacRumors that mentioned Apple uses a company called Skyhook to provide their database of AP MAC addresses and their coordinates http://www.macrumors.com/2008/01/23/skyhooks-wi-fi-location-technology-f.... Skyhook, according to their website, keeps a database of MAC addresses and associates them with their GPS location. Using this database is claimed to be accurate within 10-20 Meters.
After visiting Skyhook's website, I found the form where you can add your Wifi Access Point to their database. The page is at http://www.skyhookwireless.com/howitworks/submit_ap.php. Unfortunately it can take up to a few weeks to have the data updated with all of their partners. I will repost here if it ends up working for me.
P. S. If you can't find your MAC address, this article might help http://getsatisfaction.com/skyhookwireless/topics/how_do_i_find_the_mac_....
UPDATE 12/22/2008
It worked! Now when I push the current location icon in Google Maps it centers right on my street. Now any other urban residents like myself can find where they are!
This was another feature that should have been simple, but just wasn't. This Google Maps extension allows you to use circle overlays. It is really a GPolygon with 45 points, but it looks like a circle. Here is a sample. You can download the source here.
js/gmaps.CircleOverlay.js:
circle.html:
At work, I've been tasked with a neat little project where a user can select a list of users represented by markers on a Google map by editing a polygon to surround the markers with. However, to my dismay, I could not find any methods in the API to see if a polygon contains a coordinate. I also had a hard time finding an algorithm so that I could implement it.
First I tried the winding number algorithm (http://en.wikipedia.org/wiki/Point_in_polygon) but failed. I didn't put too much time into it since it is so CPU-intesive anyway. Then I came across an article on MSDN (http://msdn.microsoft.com/en-us/library/cc451895.aspx) which I adopted into Javascript. I extended the GPolygon class with a new method called containsLatLng, just like the GLatLngBounds class. The difference is that the method in the GLatLngBounds class will only get the 4 coordinates of the bounding box, which are the farthest points in the polygon, and see if the coordinate lies within that box. My method, however, does true collision detection to see if the point lies within any shape polygon with as many sides as you want. It worked out perfectly.
Without any further ado, here is the code [js/gmaps.polygon.containsLatLng.js]:
And here is the sample usage [index.htm]:
Sample: http://dawsdesign.com/Samples/GIS/
Download: http://dawsdesign.com/Samples/GIS/GIS.zip
Here is a great article that describes an interesting perspective of functional programming. The author over at Tech Republic describes how functional programming is often more secure than imperative languages without even trying.
Here's the link http://blogs.techrepublic.com.com/security/?p=567
This is a short video I put together. It shows how to use emacs to generate an Erlang gen_server to greet a client. It also demonstrates Erlang's hot code-loading capabilities.
Erlang/OTP gen_server demo from Matt Williamson on Vimeo.
Really high quality at http://dawsdesign.com/video/video-gen_server_demo
It never gets old.