Quilt 7

Quilt 7 (2010-2011): 162 x 244 cm (64″ x 96″). Cotton fabric hand-dyed with Procion MX fibre-reactive dyes, cotton thread, polyester thread, polyester batting, backed with cotton-poly navy sheeting. Machine-pieced and -quilted on a Singer 201-3 (made in Clydebank, Scotland in 1952) and a Singer 500J (Rocketeer) circa 1961.

Quilt 7

Quilt 7: Random

Share

Artifact Pr-1: Cluedo Assistant

Description

A program that helps you play the crime fiction board game Clue (Cluedo in Europe).

The user is prompted with initialization questions (how many players are playing, how many cards each player has, which cards the user has in their hand ).

After the initialization, gameplay begins. For each turn, the program allows the user to record what took place that turn– if anyone made a suggestion (e.g. “I think it was ____ in the ____ with the ____”), an accusation (i.e. positing what is in the envelope),  or if they simply just rolled the dice and moved to a new square.

The program tracks how many card possibilities are left for the envelope and other players. If there is only one of each type of card left in the envelope, an alert is printed advising the player to make an accusation.

At any time, the user is able to make an “inspired deduction” when they are certain another player has a card.  The user also has the option to view various parts of the database at any time during game play. For example, the program sequentially assigns a unique number to every suggestion so they can be viewed as a list of transactions. Other options available for viewing include which cards we know a player has and all of the possible card options.

Technical Knowledge

I applied my knowledge of:

  • logical programming in SWI-Prolog
  • list recursion
  • database programming with assert and retract

Skills Applied

  • building models and using these models to produce logical hints for the user
  • function (predicate) decomposition
  • controlling backtracking with consistent use of green and red cuts

Notes

I wrote this with Sara Bainbridge for CPSC 312, Functional and Logical Programming, at UBC in Fall 2010.  We enjoyed working together and with Prolog.

Demonstration

I can’t release the entire source code because this is an active course and I don’t know if any professors will assign this sort of project to a future class.  Email me if you’d like to see a demo and in the meantime here’s a snippet:

/* Prints an ALERT if the envelope only has one of each card left */
checkForHint :-
     numEnvelopeWeapons(W),
     numEnvelopeSuspects(S),
     numEnvelopeRooms(R),
     !,
     W =:= 1, S =:= 1, R =:= 1,
     retractall(playerOneHint(_)),
     assert(playerOneHint('Only 3 cards left! Assertion:'))
     ; true.

Share

Installing LeJOS NXJ on Mac OS X 10.6 (Snow Leopard)

The intensity of the term has lulled, marginally, so last night I completed my migration from PC to Mac.  I installed LeJOS NXJ, a Java programming environment for the LEGO Mindstorms NXT. It lets us program LEGO robots in Java.

LeJOS is an open source project hosted in the sourceforge repository. It was forked from the TinyVM project which implemented a Java VM for the LEGO Mindstorms RCX system.

By installing I mean adding these to my Macbook Pro and successfully installing the first item on the list on my LEGO Mindstorms NXT brick:

  1. Replacement firmware for the NXT that includes a Java Virtual Machine
  2. A library of Java classes that implement the leJOS NXJ API
  3. A linker for linking user Java classes with classes.jar to form a binary file that can be uploaded and run on the NXT
  4. PC tools for flashing the firmware, uploading programs, debugging, etc
  5. A PC API for writing PC programs that communicate with leJOS NXJ programs using Java streams over Bluetooth, USB, or the LEGO Communications Protocol (LCP)

I’ve blogged about my introduction to LeJOS and Mindstorms and have successfully used LeJOS on Windows Vista and Windows 7 as well as Ubuntu.   Configuring the environment on my Mac was, as usual, easiest of the three.

Recall that I am using a mid-2010 MacBook Pro running Mac OS X 10.6. LeJOS NXJ requires some of the drivers from the original LEGO brand software that ships with the robot.  I tried using the CD that came with my Mindstorms (purchased in May 2008) to install the original LEGO system, but it didn’t install.  There were no error messages but the app never appeared in my apps folder.  This is how I solved the problem:

1. A little probing on the LEGO website and I found a Snow Leopard fix which I used to complete the installation.  I also found and installed the latest LEGO firmware update (version 1.29).

2. Because of the difficulty I’ve had with drivers on both Windows and Ubuntu, I also installed the Fantom Driver on top of the MindStorms app.

All of these are at: http://mindstorms.lego.com/en-us/support/files/Driver.aspx#Driver

3. Download and unzip LeJOS NXJ: http://sourceforge.net/projects/lejos/files/lejos-NXJ/

4. Set the permissions in the downloaded folder:
chmod -R 755 /pathto/lejos_nxj/

5. Edit etc/launchd.conf to include (I already had this from a former install):
setenv JAVA_HOME /Library/Java/Home

6. Edit ~/.bash_profile to include
LEJOS_HOME=/pathto/lejos_nxj
NXJ_HOME="$LEJOS_HOME"
DYLD_LIBRARY_PATH=/pathto/lejos_nxj/bin
export LEJOS_HOME NXJ_HOME DYLD_LIBRARY_PATH
PATH="$LEJOS_HOME/bin:$PATH"
export PATH

This is where I got stuck.  No matter how I adjusted these environment variables, every time I connected the NXT brick by USB and tried to flash the LeJOS firmware onto it, I received some permutation of

Bad news: An error has occurred lejos.pc.comm.NXTCommException: Cannot load a comm driver!

It’s always something with LeJOS and it’s always something I’ve overlooked.  In this case, my Java defaults to 64 bit and LeJOS needs to use 32 bit.  I recently upgraded my RAM to 8GB and in order for the Win 7 virtual drive in my Virtual Box to use 4 GB of memory I have to boot Snow Leopard in 64 bit kernel mode (by holding the 6 and the 4 down during startup).  It is necessary to:

7. Manually add the -d32 flag to the LEJOS scripts. Setting the Java version in system preferences won’t do the trick.  Open all the non-binary files (the ones that don’t end with .bin) in the /pathto/lejos_nxj/bin/ folder and edit all calls to “java” to include -d32 to make them run in 32-bit mode.

Worked like a charm.

I was motivated by more than the opportune free evening.  I am considering enrolling in September in a directed studies course at UBC in which students make a proposal to a faculty member to investigate a topic that goes beyond that which is covered in existing courses.  I’ve enjoyed working (and playing!) with Mindstorms (what red-blooded Canadian wouldn’t!) and last term I enjoyed learning Haskell and Prolog.  This term’s course in internet computing is beginning to stand out as a favourite.  I’m also itching to learn Erlang.  Somewhere in this there is some interesting work…

Share

Java (Tomcat 6) on Mac

I’ve been using a Mac for less than a year and I don’t find the OS as intuitive to manage as Windows. And for good reason–I have some 15 years of bad habits to unlearn! Environment variables, for example. Where and how do you set environment variables on a Mac?

I took a Java web application development course and we needed to edit our environment variables after installing Tomcat 6, the application server. I added these to my /etc/launchd.conf file:

setenv JAVA_HOME whereveritis
setenv CATALINA_HOME yadayada

Mine, for example, looks like this:

setenv JAVA_HOME /Library/Java/Home
setenv CATALINA_HOME /Library/Tomcat/apache-tomcat-6.0.29

Though I didn’t have trouble with any other settings after rebooting, it helps to remember that we can fuss with Java on Mac here:

Applications -> Utilities -> Java Preferences

While using Tomcat 6 I discovered that if there is more than 1 version of el-api.jar on the path there could be problems (you may experience a slightly hysterical evening of HTTP 5XX errors and JSPs that just won’t work no matter what). Take a look at the jar files in /TomcatInstallation/apache-tomcat-6.0.29/lib, and made sure none of them appeared in /JavaHome/lib/ext.

Share

A Running Start to 2011

Happy new year! Another term has come and gone and with it went my best intentions for updating this blog with anything that resembled regularity. I hereby resolve to add an entry at least once per week in 2011.

Snow Monkey!

Snow Monkey!

I spent Christmas in Japan, a 2-week holiday that included Osaka, Kyoto, Nara, Shibu Onsen (snow monkeys!) and, of course, Tokyo.

As I write this I am sitting in the back row of UBC’s final offering of CPSC 211, OOD with Java. I took this course last year and I am excited to be helping one of my favourite professors, Dr. Kim Voll, deliver this last installment before UBC completes its conversion from Java to Scheme. The fall term went well, incidentally. I enjoyed learning more about functional programming with Haskell at UBC; amongst other assignments we used Haskell to create a RushHour solver and an Oska next best move generator. I was lucky enough to work with my friend Sara on the Oska project. Sara’s background in art and her fluid navigation of the intersection of art and science made the project an exercise in unmitigated pleasure.

Here’s a nice little Haskell example. These two functions (actually three, since the second function is in fact a pair) each multiply two numbers and return the product. The first version uses good old fashioned augmenting (vanilla) recursion. The second version invokes a helper function which uses tail recursion and an accumulator variable:

1.
multiply :: Int -> Int -> Int
multiply x y
| x == 0 = 0
| otherwise = y + multiply ( x - 1 ) y

2.
multiply_tr :: Int -> Int -> Int
multiply_tr x y = multiply_tr_helper x y 0

multiply_tr_helper :: Int -> Int -> Int -> Int
multiply_tr_helper x y product
| x == 0 = product
| otherwise = multiply_tr_helper ( x - 1 ) y ( product + y )

Pretty cool, don’t you think? Perhaps the best example of Haskell’s concise elegance, however, is its implementation of the quick sort algorithm (which is elegant but slow and a bit of a memory-piggy):

qsort [] = []
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++ qsort (filter (>= x) xs)

The second half of the same course focused on logical programming using Prolog. There were some challenging concepts to wrap my head around.

This term is all about operating systems, internetworking, graphics and algorithms. Our plane landed at 9:35 AM on Tuesday and I was in class (slightly late) by 10:10 AM, and that describes the entire week quite well.

Share

On the via ferrata

Since today is the equinox it seemed appropriate to finally update the interweb with the latest happenings in my corner of the world.

I am back at school, studying computer science at UBC and computer technology at BCIT.  I travel between the campuses several times per week and I’m enjoying the two very different ways of viewing and using computers.  I take my new best friend, the Macbook Pro, everywhere I go.  The glamour hasn’t tarnished or worn thin–I still like my new Macbook Pro.

Quilt 8 Process: Barn

Quilt 8 Process: Barn

This fall at UBC I’ll be focusing on functional programming using Haskell, and logical programming using Prolog.  At BCIT I have begun a course in web app development using Java, and the much anticipated iPhone development course is underway.  I began a UBC course in programming languages using Scheme, really a precursor course for what I consider to be the crown jewel of undergrad computer science at UBC, the 4th year compiler development course, but after two weeks I realized that trying to keep so many different programming paradigms separate and distinct was going to be next to impossible.  I’ll take it next year.

Quilt 8 Process: Machines

Quilt 8 Process: Machines

The quilt of Beaver Creek Farm is still under construction.  I’ve been really bad about taking photographs during the process.  Most of the time they are quick and blurry and not worth reproducing; I just can’t seem to get a handle on Scott’s Canon 20D–it just doesn’t like me and won’t cooperate at all.  So I’ve put the Canon away for good and will try taking some process shots this weekend with the new iPhone.  The wedding was last weekend and instead of the quilt we sent Amy and Brent some wedding bling and an IOU for the rest.  I began experimenting with techniques for constructing the buildings on the farm and the results are fantastic, but the process is slow.  Scott reminded me that late and great was better than sloppy and punctual; he hinted that it might even be fun to deliver it to Beaver Creek Farm in person.

Quilt 8 Process: Farmhouse

Quilt 8 Process: Farmhouse

Incidentally, our dry spell ended and the rain returned with the cooler weather.  Almost as if by cue the magnificent light sculpture on the side of the Shaw Tower has developed yet another burnt out gap, just in time for the inclement weather which apparently prevents the building from effecting repairs until spring.  By my count, that means the light sculpture, by far the brightest part of our skyline and the most difficult-to-ignore part of our skyline, will have required repair for 7 to 8 of the 12 months of 2010.  It really grinds my gears. [EDIT: It was fixed by Halloween.  Wow!]

Oh a happy civic note, I was pleased to find out that Van Dusen Gardens has decided to work with the City of Vancouver to keep the Bloedel Conservatory open.  I really like the Bloedel, it’s a beautiful fantastic geodesic dome on the top of Little Mountain in Queen Elizabeth Park.  Inside is a Thomas Hobbs-approved collection of exotic and unusual plants and dozens of species of birds.

The Vancouver Art Gallery has launched a bold campaign to motivate its $300M move to a new location somewhere between its current site and nowhere.  Though the gallery found its budget was short enough to require laying off some 15 staff, they have hired a PR firm and are spamming Canadian art waves with news of their marvelous new cause.  Scott and I were even accosted by a middle-aged art maven in the lobby who wanted us to add our names to a great long scroll of signatures supporting the move.  No thank you.  Especially when I found out she was being paid by the Gallery.

Quilt 8 Process: Tree

Quilt 8 Process: Tree

There are two things I especially dislike about the Gallery’s choice.  The first is the arrogant fait accompli attitude the Gallery has taken, spamming art magazines with news about the move, overdosing its Facebook channel with heady odes to the move etc etc.  The problem is that the City, which owns the land the VAG covets, hasn’t decided whether to give or heck even sell the land to the Gallery.  The City of Vancouver wants to know what the people of Vancouver want.  And I think that’s great because the Vancouver Art Gallery is trying to tell us what we want, which I don’t like at all.

The second thing I don’t like about the new location is its location.  It’s being touted as a new arts centre for the city but it’s a city block that’s sandwiched between an opera house cum playhouse that’s closed during the day, a stadium that’s also closed during the day, and a big post office warehouse.  The Vancouver Art Gallery’s current location in Robson Square places it firmly in the cultural and commercial heart of the downtown core–plenty of restaurants and shops surround it and everything is open and vibrant all the time.  Leaving the historic courthouse where it resides for a big green glass and concrete box (because that’s the sort of McCheng piece of ho-hummery $300M will buy you in Vancouver’s irrationally slow, expensive and homogenous construction scene) seems to undermine the VAG’s alleged commitment to the community.  I think it is irresponsible to carve out the city’s cultural heart and fail to care what happens in its wake.

Vancouver’s art scene is falling rank and file into two camps–those who support the move, and those who don’t.  Scott’s devoted urbanist agenda means it’s a constant topic of conversation in our home.

Quilt 8 Process: Creek

Quilt 8 Process: Creek

Share

Conceptual Craft and Quilting Beaver Creek Farm

It is raining in Vancouver for the first time in many weeks. Most people don’t realize that the rainy Pacific Northwest goes through a two-month dry spell each summer. Bone dry. Great swaths of British Columbia are burning right now as hundreds of natural and man-made wildfires race through endless miles of standing timber; forests and tree farms that have been infested by the Japanese pine beetle are exploding like fire-crackers.

To celebrate the rain and our temporary reprieve from the burning acrid soot that has been thickening the air over Vancouver these last few weeks, I did what every nerd does: I bought some books.

The Art of Conceptual Craft

Our local Book Warehouse is closing its doors to make way for another condo extravaganza so I wandered in for a final look. How lucky was I to find a copy of the Boston Museum of Fine Art’s ‘Shy Boy, She Devil, and Isis, The Art of Conceptual Craft, Selections from the Wornick Collection,’ for less than 30% of the bloated Canadian price on the jacket. It’s the catalog for a 2007 Museum of Fine Art (Boston) exhibition which includes, much to my delight, work by Canadian artists like Vancouver’s Peter Pierobon, Toronto’s Gord Peteran and Saskatoon’s Michael Hosaluk.

I have found the work in this book to be especially inspiring because I am starting another art project and the blurry (and often arbitrary) boundaries between art and craft, concept and function have been on my mind. A close friend is remarrying and I am making a quilt for the new couple. Amy, a paramedic by day and motorcycle-driving animal rescue superhero by night, has invested her savings in Beaver Creek Farm, 20 bucolic acres on the outskirts of Southern Ontario’s rural Stevensville. The plan is to create a haven for abused, neglected and damaged animals and the menagerie already includes Vietnamese pot-belly pigs, fainting goats, a pack of ravenous toy dogs and bunnies galore, oh my!

I am impressed by the determination and vision that Amy shares with her new partner Brent, a local boy, so I have begun sketching the design for the quilt. It’s going to be a complete departure from my work to date. I began by reviewing the paintings of prairie-homestead life by one of my favourite Canadian artists, William Kurelek. Here’s a little short by (who else!) the National Film Board.

My interest in maps inevitably led me to Linda Gass’ quilted landscapes. Check them out. They’re formidable, aren’t they.

I’m going to try to quilt a map of Amy and Brent’s Beaver Creek Farm. When we were growing up it was the ‘Bremner place,’ and I have a general idea of the landscape of the farm from our many in situ escapades, so I’ve interviewed Amy and Brent to find out what they envision both as a process and as a goal. Here’s the first iteration sketch. The property is bound to the west and north by Beaver Creek, an ecologically sensitive body of water that flows into a great regional swamp and from there into the mighty Niagara River.

Quilt 8 Plan

The quilt will not be sturdy enough for everyday bed use or casual laundering, so it will be an unambiguous departure from the functionality that is one of the hallmarks of craft.  I’m going to experiment with method: I am going to depart from the structured grid assembly method I’ve used to date and will try using appliqué (some of it raw-edge) on larger, more casually assembled background pieces.  I only have 1 month to complete this piece so I think I will eschew painstaking literal representation and detail in favour of silhouettes and flourishes.  I’ll post progress images regularly on Orangewool.com during the next few weeks.

Share

From Lost Lagoon to Lake Louise

It’s mid-July and so Scott and I are preparing for our next road trip.  Several times a year we load the BBQ, coolers, picnic basket and backpacks into the car and drive into the mountains.  I really enjoy living beside the ocean but every few months I get the itch to visit our great Canadian Rockies.

CLICK A MARKER ON THE MAP TO SEE MORE View Lost Lagoon to Lake Louise in a larger map

From our home beside Lost Lagoon in Vancouver we head east through the Lower Mainland and the Coastal Mountains, parallel to the southern border of BC through the Okanagan and Thompson Valleys to the Kootenay Rockies.  We usually make it as far as Nelson on our first day.  Nelson’s a fine little artist town on the northwest shore of Lake Kootenay.

Day two finds us waiting for the sun and the ferry to take us across the lake.  A slow easy drive takes us through the Kootenays to Radium Hot Springs, a great little village which I consider to be the gateway to the Rockies.  At the Springs we have a soak, then it’s just a short trip through Kootenay National Park to bright glacial Lake Louise.

Berry season is in full swing in the Lower Mainland and our freezer is already full of delicious organic BC strawberries, blueberries and tayberries.  I am interested in learning more about the locavore movement and eating locally grown food so during our trip I’ll be paying especially close attention to the farms and ranches that we pass.  Here is an interesting video that Hellman’s (yes, the mayonnaise people!) have posted.  Ignore that it’s from a food corporation–it’s attention getting.

Share