Monday, June 16, 2014

Have no fear, I know regular expressions!

I know regular expressions, and at last get the joke to the XKCD comic:

32aa7d697775eb67fda4e189cdbbf43e-2014-06-16-17-44.png

( © Randall Monroe)

It does feel a little bit like I know kung fu. Regular expressions, which (essentially) search for a given pattern in a string, i.e. a set of characters (words, numbers, etc.), and then let you do something with the results. These powerful, albeit cryptic, expressions allow you to radically simplify many operations on strings.

Take, for instance, a problem presented on Coderbyte: given a string of words or letters, shift every letter over by 1 (so 'c' becomes 'd', 'z' becomes 'a'), and then capitalize any vowels excluding 'y'.

Here is a solution found sans regular expressions. Just gloss over the fine print for now and look at the size of it.

39ac6be34f3494e06e82e69372ae64b8-2014-06-16-17-44.png

Here is a solution found using regular expressions (namely, mine).

79fffbab2a1f790349a5671213a7a566-2014-06-16-17-44.png

Slight difference, right? As an added benefit, regular expressions can often let you write my like how you would talk about solving the problem:

1. There's this function called 'LetterChanges,' you pass it a string.

2. Give me the result of taking all the alphabetic characters in the string and doing the following with each one:

3. If it's Z, change it to A

4. If it's z, change it to z

5. Otherwise shift the character over by one

7. Replace all the vowels with …

8. … an uppercase version

Neat, huh?

Wednesday, June 11, 2014

A lovely time in Oxford (yet again).

Last weekend was my workshop in Oxford. One day, two tracks, six hours of class, six hours of partying. A packed experience, to say the least.

I am always thrilled to visit Oxford, it's been my favorite city in Europe since two years ago, when I passed through in August 2012. That experience left a powerful impression. My first introduction was through Nancy, a (now) dear friend whom I met in London originally from the states. She ensured I got all the classic Oxford experiences, which has included (over the course of a few visits) tea & crumpets, a bicycle ride along the river and cycling on the wrong side of the road, museum visits, and strolling college grounds finding areas shot in the Harry Potter films. 

Oxford was also the first place where I really felt like "kind of a big deal." I use that term very loosely, and I don't let it get to my head. Still, it was on my first tour of Europe, and I felt so welcomed and people were excited even though only a few knew of me. (My status as a US instructor probably helped: by this point, Europe was ravenous for more high-quality Blues instruction, and saw US-based teachers as the crème de la crème. Timing and luck counts for a non-trivial portion of my success in Europe.) On that visit, I taught a class at the weekly venue that drew a huge crowd, and in one night lined up seven hours of private lessons for the following day. I had never felt so in demand, and to this day have not surpassed that many privates in a single day.

Since then, I always make a concerted effort to pass through Oxford during each European tour. I have been successful thus far, bringing my total number of trips to this lovely town up to five. Five!

I love every aspect of Oxford. The old buildings with breath-taking architecture, the wealth of museums and libraries, the feel of its downtown, the river on which you can go punting in the summer, and of course the people.

f33091e020c4aacdba7eff735294ea55-2014-06-11-18-47.jpeg

This picture summarizes how I feel about Oxford. What could be better than lazily floating along a river with verdant banks, drinking ginger beer in the sunshine, and laughing about everything in life? I have developed many meaningful connections with others that I cherish. Something about Oxford makes it feel comfortable, like a home away from home in Europe.

Oxford comes with a certain old-world quality, intellectualism, and pageantry to boot. You wander through a graveyard and see dates with only three digits, and it's not because the "1" has worn away. Buildings and chapels are breathtaking. There is a gigantic library that extends underground. Students wear academic gowns to their exams, and formal wear underneath; they were a designated flower to identify where they are in the process of their exams. There are formal dinners for students at the halls. There are even bizarre and hilarious traditions at schools, such as at Merton where, every November, students walk backwards for an hour at the quad drinking and being merry, in order to generate enough counter-clockwise momentum to slow down the Earth's rotation and correct for the disruption caused by Daylight Savings Time in the space-time continuum.

I'm just glad that Oxford loves me back. This was the flyer created for the most recent workshop.

73a17149f4c77013b2dcf25aaf63675b-2014-06-11-18-47.jpeg

"American Legend?" Who might that be? I don't know anyone that qualifies as such.

I realize it's self-aware hyperbole, but I have been recently the subject of such flattery and kind words in advertising that leaves me a little astonished and bashful. I have been described also as "the nicest guy in Blues," and my upcoming workshop in Bristol proclaims that I am known for my "international Blues stardom, as well as being a lovely guy."

I don't know what I do to deserve such praise, but I sure do like it, and I'm glad people think it. It reminds me that I'm doing at least something right, and that people like my classes and like me as a human being and want to keep learning with me. As a dance teacher, you're more than selling a teaching product: you're selling yourself, the unique classroom experience you create, the environment you form in the classes and at the dances, and that has a lot to do with you as a person. 

After the workshop, I had the great pleasure of joining the students for bangers and mash. (For all you 'mericans, that means sausages, mashed potatoes, and vegetables.) I have actually avoided such a dish for many years, since the name "bangers and mash" has a certain repulsive sound to it (possibly because "bangers" means something very different in the US?), but I'm glad I was roped into it this time. The food was delicious and high quality, much more than your average pork sausage: I was dining on pidgeon and peri peri chicken and spicy venison sausages. Not at all the unappetizing, unidentifiable meat product accompanied by bland potatoes and over-steamed peas that I envisioned. Amazing. 

f1762f8c0c0e56b58f9dfc6238af4180-2014-06-11-18-47.jpeg

A belly full of food, I managed to squeeze in a 1.5 hour nap at the pub before joining the group for more dancing and partying. We rolled along until 3am with a cozy house party, a wonderful atmosphere for socializing and dancing. 

There were a few moments when I would be saying something to one person, and I'd realize that everyone else in the room was listening to me. This happens from time to time in scenes, with no particular consistency, where I am the center of attention and people unabashedly give it. For a person whom is at home in front of a classroom of 70 students, I am bizarrely shy in social settings. Deep down inside, I'm an introvert, and I don't usually speak up in group environments, often because my comm lag is so long I never have the chance to get in a word edgewise. So these moments, when I realize everyone is looking at me and paying close attention to my every word, sends a flash of embarrassment and an urge to stop talking immediately and once again fade into the background. I need to get used to it. There should be workshops where people can practice not being shy in a structured way, but without the usual crutch of dance. 

The next day, I was treated to even more dancing -- three hours of fantastic Balboa dancing, as I happened to visit during their monthly dance. The level of their dancing is fantastic, and especially surprising given the small community size. After 1.5 hours of walking to and fro, plus three hours of furious footwork, my dogs were barkin'. Of course, Oxford is a real delight to walk through in the summertime, and I was treated to an amusing sight along the way home.

3d2e26d8f4ee94309b29ee91635facfc-2014-06-11-18-47.jpeg

(In case it's unclear due to the low contrast, look closely at the statues.)

I bumped into a former dance student from Stanford, whom is coincidentally studying at Oxford for the semester. It was fantastic to catch up. I am always interested to talk with people who know me from specific and different phases of life -- such as graduate school -- because they serve as an excellent reference point. I can see the crazy amount I have changed over the course of one or two years. Also, we had amazing Thai food and followed it up with ice cream. I treated myself to a brownie sundae with in-house oreo ice cream. Such decadence! It was fun in the moment, though my body was quite cranky with the sugar rush that followed. 

19b329760520494bc4f3123457482fa4-2014-06-11-18-47.jpeg

Although it's been a full week, the time has gone quickly. Tomorrow I depart for Bristol. It's been a lovely time here in Oxford, yet again. Thanks for everything.