Thursday, January 14th, 2010 | Author: ranok

Many of you know that over this winter break from school, I traveled with my family to Aruba, a small island off the coast of Venezuela. I thought I’d write a brief report on my time there, and give some pointers for others who might head there at some point. Aruba is a nation part of the Dutch commonwealth, and thus the official language is Dutch, however most everyone speaks English (on top of Papimento and Spanish). The Aruban government has made it very enticing for Americans to travel there, everywhere I saw, the US dollar was accepted side-by-side with the Aruban Florens.
My trip was a bit on the short side (only five nights) so I mostly explored the area closest to our apartment at The Boardwalk, which is at the north-west end of the island. We booked our stay there, and as part of a package deal, windsurfing lessons and rental. The beach where the Vela windsurfing school was is just a short walk from the Boardwalk and along that beach are all sorts of other resorts and activities from sunset cruises to jet-ski rentals. Aruba is an excellent location for windsurfing due to its consistent winds of about 20 knots, year-round nice weather (mid 80s) and reefs extending out from the beach allow you to walk back if you’re a beginner. While most of my stay was dedicating to windsurfing, I did spend a half-day on a Landrover tour of the island, which brought us to a few areas off the beaten track which exhibit a far more rugged side of Aruba. The natural pool is very enjoyable, and the view is excellent. Additionally, the coral caves are a very different type of cave from the traditional, and are very neat to explore.

Recommended:

  • The Iguana Cantina – This Mexican cantina was very tasty, so good in fact that we returned a second time. I had the red snapper, which was an entire snapper fried, providing an excellent presentation. Between 5-7PM is happy hour, which means 50% off margaritas, sangrias and beers.
  • Gelato from Cafe Amici – There is a huge selection of flavors, and the gelato is very tasty, an excellent way to end the day.
  • Vela Sports windsurfing – The lessons and equipment I got from them was very helpful, and I was able to progress from the beginner lesson my first day to water starts and harnesses at the end of my stay.

Recommended with Reservations:

  • Moby Dick Seafood Restaurant – While the food here was very good, the service was terrible, and the portions left you looking for a second dinner, even though the prices were high.
  • ABC Island Tours – While the tour was a lot of fun, and I got to see parts of the island that were not very accessible, the tour did not go to all of the advertised locations, leaving much to be desired. I suggest verifying with the tour company prior to booking the stops.

I hope this provides some helpful information for those looking for an escape from the cold. If you have any further questions feel free to comment and I’ll do my best to reply.

Peace and chow,

Ranok

P.S. An obligatory photo of my windsurfing:

My windsurfing

Wednesday, October 14th, 2009 | Author: ranok

Today in my Advanced Concepts in Operating Systems class I led the discussion on the Mnesia paper from PADL’99, while this paper has numerous typos it does do an excellent job highlighting the features and advantages of Mnesia. For those of you who are unaware, Mnesia is a distributed, fault-tolerant object DBMS written in Erlang. One thing about Mnesia that I have found to be lacking is a tutorial written for the lay person from the ground up, this gap I intend to try and fill. This multi-segment tutorial assumes you have knowledge of Erlang, and the basic  concepts of manipulating data with DBMSes, other than that, I hope to provide enough information and code to demystify a fairly complex system. However, I still am on the road to mastery, so if I make any errors, or you have any tips for improvement, I’d be happy to add them in.

To get started, start up the Erlang shell (erl) with a name, I will use -sname foo in the following examples. Below is a transcript of starting up and creating a disk-based

ranok@orion:~/Desktop$ erl -sname foo
Erlang R13B01 (erts-5.7.2) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.7.2  (abort with ^G)
(foo@orion)1> mnesia:create_schema([node()]).
ok
(foo@orion)2> mnesia:start().
ok

The most important call made here, create_schema, takes a list of nodes to replicate the schema table to on disk. You can add additional disk-based nodes or ram-based copies later (we’ll get to the details later). After you’ve created the schema (this will make a folder for all the Mnesia table data), you can start the application with the start function.

Now that we have the database running, we need at least one table to store the data in, we will start with a very simple record to just store simple key/value data. The nice thing about Mnesia, is that the data we store can be pretty much anything, from a simple atom to a function. We will start learning the basics from the mnesia_test module, which I have uploaded here.

The first few lines of the module start off like any Erlang code, a module declaration, what functions to export, including the QLC (Query List Comprehensions) include file (you may need to find it for your system) and a record definition:

-record(data, {key, value}).

Which will define our record for the table also named data. In the function setup_and_start/0, we tie in what we already went over with the create_table function, which in our case looks like

mnesia:create_table(data, [{disc_copies, [node()]}, {attributes, record_info(fields, data)}])

The create_table function has a number of options, the most basic of which we will deal with at the moment: the name of the new table, where and how the table will be stored and what fields the table has (this code used the record_info() function to pull those out of the data record for us). Now that we have our table, we need a way to get the data in and out of it.

Many databases provide the ability for multiple queries to be joined into one transaction to be executed atomically. Mnesia is no different, but for the most part, all queries are executed through the transaction manager (there is a dirty interface which will be discussed later), this makes working in a distributed environment much easier. The way to perform a transaction in Mnesia is to pass a fun to the mnesia:transaction() function that will atomically run.

The actual function to enter data (both insert and update) is write(Record). We wrap this into the mnesia_test:insert(Key, Val) function displayed below:

insert(Key, Val) ->
Record = #data{key = Key, value = Val},
F = fun() ->
mnesia:write(Record)
end,
mnesia:transaction(F).

To now retrieve this data back from the database, the read function is now used, the read function takes two arguments: the table name (in this case, data) and the key to retrieve. The mnesia_test retrieve function wraps this nicely for us, and is shown below:

retrieve(Key) ->
F = fun() ->
mnesia:read({data, Key})
end,
{atomic, Data} = mnesia:transaction(F),
Data.

mnesia:transaction will either return {aborted, Reason} or {atomic, Rows}, where Rows is a list of all the retrieved data. If the key we tried to retrieve could not be found, then it will return an empty list.

Say however, we want to search the table for certain values that are not the index of the table. For that there is the matching functions, the simplest of them is the match_object whose usage can be seen here:

search(Val) ->
F = fun() ->
mnesia:match_object(#data{key = '_', value = Val})
end,
{atomic, Data} = mnesia:transaction(F),
Data.

As you can see, simply fill in all the values that are known and that you want to search for, and use the ‘_’ unmatched value for all the other values. This transaction will return the same forms as the read transaction.

There is another method for filtering through Mnesia tables, which is very similar to the list comprehensions builtin to Erlang which is called QLC. The QLC version of the above function is below:

search_qlc(Val) ->
F = fun() ->
qlc:eval(
qlc:q(
[X || X <- mnesia:table(data), X#data.value == Val]
))
end,
{atomic, Data} = mnesia:transaction(F),
Data.

What the query here is doing is is returning a list of Xs where every possible X comes from our data table, and X#data.value == Val. This should be very intuitive for those of you who are familiar with list comprehensions. What qlc:q() does is form a query handle (much like a function object) which gets evaluated by qlc:eval() inside of our transaction object. Again, this will return the same values from mnesia:transaction.

Well, that about covers the basics of Mnesia, you now should be able to setup Mnesia on your computer, create a table and insert/retrieve data from it. In the next installment, we will look at distributed Mnesia and the dirty interface, which provides faster queries by bypassing the transaction manager. After that we will put all of what we’ve learned into creating a system that will take advantage of Mnesia and give a pseudo real-world problem a fitting solution. Please check back soon for the next installment!

Peace and chow,

Ranok

Category: General, Technical  | Tags: , , ,  | Leave a Comment
Saturday, September 05th, 2009 | Author: ranok

Now that I’ve had a chance to settle into my new apartment above Misty Hollow on Market Street, and I have all the needed utilities, I thoughts I take a break and reflect on my first two weeks of my senior year. My schedule this semester has me in class for 11 hours Monday and Wednesday, and practically without class the other week days (I do have class every few Saturdays). This schedule is requiring some work to get used to, either I’m feeling rushed to make it to my next class and keep everything straight (philosophy to statistics) or I’m wondering what to do with all my spare time. I have however found a few things to keep myself occupied on my off days, I’m working for Clarkson as a campus photographer, shooting lots around the area for brochures, the website or mailings. This is a great way for me to practice and improve my photography skills and work with a professional! I will update my Flickr when I have some great shots, so keep checking it out! Of course I’m also still the co-director of COSI, which has a large amount of interest this year, and I’m hoping for good things to turn up. naturally I’m still working on my baby, OSP (a post on that soon). Lastly, I’ve joined the Potsdam Rescue Squad, and am enrolled in the NY state EMT course, which I am enjoying, and excited to become a more useful member as my knowledge grows.

Well, I think that about covers all in my life for the time being.

Peace and chow,

Ranok

Category: General, Personal  | Tags: , , , , ,  | Leave a Comment
Wednesday, August 19th, 2009 | Author: ranok

For those of you who didn’t know the reason behind my two month long silence, it was because I headed to northern Ontario, Canada for the summer to lead canoe trips. I plan on returning to the USA in the next few days, so before the memories fade too quickly, I thought I’d fill everyone in on my experiences, in a hope it would spur others to share as well.

I’ve been working at Langskib for three years now, the past two as an assistant trip leader, and this most recent one as a full trip leader, which I have learned is a big step up in terms of responsibility and freedom. Not only are you allowed to choose your route, and have the (pretty much) final word for your trip, you are the responsible party for 6-10 young boys on your 10-20 day trip through the Canadian wilderness. Not only can it be very stressful thinking of all those parents blindly putting their faith in your good judgement, it is also a uniquely powerful position to help shape the young boys that go on your trip into compassionate, strong men.

This summer, I led two trips, an Excalibur (10-day) trip consisting of 10-12 year olds and a Viking (20-day) trip of approximately the same age group. The first trip was dedicated to pure fun, and feeling comfortable in the woods, which can be an unsettling place for young boys who are accustomed to the hustle, bustle and creature comforts of the suburbs or a big city. On that trip we took our time, packing in fun events whenever we could on our trip to Maple Mountain, the second highest point in Ontario. The view from the top was worth the journey, and provided a very real view of how far we had gone, as Langskib was only a blot on the horizon. After returning to lake Temagami, we embarked on a treasure hunt in a large 12-person Voyageur canoe, culminating in a feast with all the other Excalibur sections.

My second trip, still fresh in my mind we started on the same route, north to Maple Mountain, however, upon reaching the summit, we instead looked west, in the direction we were to head for the next 15 days. We then climbed the golden staircase, which is a number of portages around beautiful waterfalls on the north branch of the Lady Evelyn River. At the top, we arrived at Katherine Lake, where we were met with a float plane laden with provisions for the duration of our trip, as soon as the floats had left the water, and the engine noise had faded to a low drone, we were again reminded of our remoteness, and that all we had to pull us through was each other, a group of 10 11-13 year olds and Dave and myself. From Katherine, we started heading home on the south branch of the river, a widely known route that is both beautiful and very rugged. There are portages down steep rock walls, campsites just above waterfalls, and some fun whitewater to boot. We took our time and ensured that safety was our number 1 priority, closely followed by having fun. At the bottom of the river, we did a portage known as the Diamond Death March, a 4 kilometer trck ending in about 800 meters of marsh and mud to your hip. I had been fearing disaster on this portage, for it is one of the three famed portages for its challenge. However, I was astounded at how smooth the day went, and how the kids were able to push themselves through limits they had set for themselves, and feel very accomplished at the end. Our last push home was through a route called Satan’s Gate, a trail of about 5-12 portages through deep mud to arrive in Sharp Rock Inlet (where Langskib resides) just 1 km west from home. Having our last circle as a group within sight of Langskib was a truly memorable experience.

As I leave, I say my good-byes to all my good friends on staff, and begin my return to civilization, always an interesting experience. Starting on the 24th, I am starting my senior year at Clarkson University, on the Potsdam Rescue Squad and trying to stay active. I look forward to reconnecting with old friends, and hearing their stories once I am safely back across the border.

Peace and chow,

Ranok

Monday, June 08th, 2009 | Author: ranok

As many of you know, I usually spend my summers in northern Ontario paddling the beautiful lakes and rivers. Since I will be leaving for Canada in a few days, I figured I should post an entry letting my many (ha!) readers know that I will be off until late August. This means that progress on my projects will stall until I return and get situated, and any emails will not be responded to for a while.

I hope that everyone has a wonderful summer, and can find some time to relax and enjoy nature’s beauty when we are all surrounded by man made structures. I plan on taking many pictures during my summer sabbatical and am excited to swap stories in the fall.

Peace and chow,

Ranok

P.S. Seitan tastes much better than it looks!