Higher Primates Can Program

July 18, 2003 at 7:08 pm

This came
to me from one of the members of the VB team.

Regular Expression Workbench V2.0

July 7, 2003 at 5:51 pm

I’ve finished a new version of my Regular
Expression Workdbench
, and it’s now available on gotdotnet.
If you use regular expressions on .NET, or you’ve heard about them but haven’t really
tried them, this tool can help you a lot. If I do say so myself.

As an old Perl guy (in both senses of the word “old”), I’ve spent a fair amount of
time writing regular expressions. It’s easy to try out a regex in Perl, but not so
easy in a compiled language like C#. I wrote the first version of this utility a couple
of years ago, and in the first version, all it did was let you type in a regex, a
string to run it against, and execute it.

Over time, it grew. The next version supported some fairly cool features:

  • A menu with all the regex language options, so you don’t have to remember what the
    syntax is for zero-width positive lookaheads.
  • Automatic creation of C# or VB code based on your regex and the options you choose.
  • Interpretation of regexes. Hover over a part of the regex, and the popup will tell
    you what that part of the regex means. This is very useful if you’re trying to learn
    regex, or you don’t remember what “(?<=” means.
  • Support for calling Split()

This version adds a few more features:

  • A nicer UI. Not a very high bar, given the previous design (“Who designed this UI?
    Vandals?”) (5 points to anybody who knows who wrote that line…). A real menubar,
    a somewhat-pleasant grouping of controls, etc.
  • Library functionality. Give the regex you wrote a description, and save it away into
    a library, so you can open it up later, or show it off to your friends. Chicks dig
    a well-crafted regular expression.
  • Unit tests for the interpretation features. Found 3 or 4 good bugs when writing the
    unit tests. These tests will get better over time.
  • Support for calling Regex.Replace(). Specify the replacement string, and you’ll see
    exactly what gets replaced.
  • Support for calling Regex.Replace() with a MatchEvaluator. For the cases where you
    can’t do your replacement with a simple substitution string, the Regex class lets
    you write a delegate. The workbench now allows you to write the function, which it
    saves away, compiles, loads and then uses to call Replace.

Comments & suggestions are always welcome.

 

 

 

 

 

 

Maui thoughts

July 4, 2003 at 1:28 am

Spent the last 10 days in Maui (Pictures),
with no internet connection. This a a computer-free post.  

6/25 Blue Water Rafting

This morning, we went on a charter boat operated by Blue Water Rafting. This was a
trip in a small, 7-person Zodiac-like craft. The boat left from Kihei Boat Ramp (definitely
an advantage if you’re staying in Kihei), and we journeyed south to the most recent
lava flows (circa 1790). We spent a lot of time very close to the lava or inside some
caves at the side.

The trip included 5 stops for snorkling, including 4 sites on the west shore and the
obligatory trip to Molokini. Molokini is the
top of a cinder cone with a reef on the inside, and part of the cinder cone under
water. It is the #1 snorkling destination on Maui. This mostly because it’s fairly
big and can support a lot of boats, but there are better places to journey to. It
does have the advantage of being fairly sheltered, and the reef is pretty.

Advantages:
1) You rent the boat, you choose where it goes.
2) Spend time where you want.
3) Nobody else goes close to the lava flow.
4) Snorkel with Dolphins (if you’re lucky), or off the backside of Molokini.
5) Captains know where the fish and the turtles are.

Disadvantages
1) Ride is very rough (the rafting moniker is deserved)
2) Breakfast and lunch are limited (muffins/fruit, sandwiches)
3) Expen$ive. For the 6 person boat for 5 1/2 hours, you will pay $800. That’s helicopter
tour territory.

6/25 Canon
Waterproof Camera Housing

I got my wife a waterproof housing housing for her Canon A20 camera (about $150).
You put the camera in it, seal it up, and it has controls on the outside. The display
might as well be off, and it’s hard to look through the viewfinder, so I had my best
luck pointing and shooting. It helps immensely if you can surface dive, as the fish
are often 15 or 20 feet down. A nice option, especially since waterproof housings
for my G3 cost around $800.

6/26 Snorkling at the Fishbowl. Or, perhaps the aquarium. We’re not sure.

On the advice of our captain, Kim and I and my sister and brother in law decide to
snorkel at the “fishbowl”. It’s near Ahihi
marine preserve
(also a great place to snorkel), but to get there you have to
a) find the trailhead and b) hike for 30 minutes across the lava field. Not as bad
as it sounds.

Once we get there, we find out that this is now a destination for sea kayak tours.
3 boats when we get in there, which isn’t bad, but another 20 arrive when we’re snorkling,
which means avoiding them and the 40 people who don’t really know how to snorkel.
The four of us go outside the bay, and Kim and I see a turtle, but that’s about it.
We come back in, dry off, and hike back another 30 minutes to the car. Not really
better than Ahahi.

6/26 Canon Waterproof Camera Housing (redux)

Used the waterproof housing again today. My wife and I conspired together, which is
never a good thing. If I had prepared the camera, it would have been fine, and if
she had done it the way she wanted, it would have been fine, but unfortunately, she
did what I had said, and left the carry strap on, but didn’t get it tucked in sufficiently.
The housing worked fine for about 10 minutes, but then I got it down about 3 feet,
and it quickly filled with water.  I did all the the right things (kept it wet,
soaked in in fresh water for a long time to get all the salt out), but the camera
is DOA right now. I may try cleaning it more once I get home, but it’s probably a
goner. Sigh. Off to EBay…

6/26 Kinston Technology 128MB Compact Flash Card

Despite the warning on the back that says, “do not bend this card or expose it to
strong physical or electrical shocks, water, solvents”, the compact flash card from
the camera survived immersion in salt water fine, and I was able to pull 12 pictures
off of it. It’s a bit like looking at the images of the Challenger before it exploded
and knowing that something bad is going to happen, as you can see a bit of fog on
some pictures, and then the last picture has droplets inside the lens.

6/29 Maui Thoughts

Maui is certainly a wonderful place. The weather in Kihei (and presumably, also in
Kanapali) is perfect – not too hot, not too cool.

Unfortunately, it appears that everybody in the Western Hemisphere feels the same
way. Despite the lack of Japanese money for the past few years, prices in Maui make
San Francisco prices look cheap. We’re in a 900 sq. ft. one bedroom condo a block
from the beach, with what is technically known in real estate circles as a water view
(ie the water can be seen if you lean out over the railing). A similar unit in this
building with no view is going for $200K. The place where we stayed last time (Hale
Hui Kai), a condo on the water, one of the units is selling for $750K. Or, you can
buy a large house 3 blocks from the beach for $800K. Oh, and if you have a condo,
you also have a maintenance fee of $300 a month.

Off to Maui

June 23, 2003 at 12:52 am


I’m taking a few weeks off to sit on the beach in Maui. I’m taking my laptop to store
all the pictures I take, but I don’t plan to be online.

Bad Roomba!!!

June 20, 2003 at 1:12 am

I bought a Roomba this week.

It’s a $200 robotic vacuum cleaner made by a company named iRobot (wonder if Asimov’s
estate gets any fee from that). Works pretty well at finding its way around the room,
though the first time we ran it, it bumped into a picture leaned up against the wall.
The second time it bumped against the wall, the picture fell, and landed on Roomba.
Roomba got stuck, and shut off.

After that, Roomba got scared and went and hid under out bed at the other end of the
house.

Review: Well, two sessions does not a good product make, but if you’re willing to
sweep the pizza boxes and cans to the side, it does a pretty good job, and it’s fairly
amusing to watch. You do have to hook it up to a charger (somewhat a bummer), but
since you have to empty the container fairly often anyway, making that purely automatic
wouldn’t help much. A pretty sophisticated device.

If I’m going to keep anthropomorphizing the thing, it really needs a better name.
If you have suggestions, let me know.