June 25, 2012

About a year ago a stray cat started hanging around the garden. It was clearly quite young —my guess would be about 10 months, give or take 2— and incredibly scrawny. After I fed it some left over feta through the kitchen window it refused to leave those 4 square meters for the next two weeks. I kept feeding him and eventually took it to the vet to have him looked over, neutered, de-wormed, de-loused and generally de-parasited. Pragma —as we lovingly named him— has turned out to be a model pet cat. Does his dirty business outside. Can handle himself just fine for however long he’s left alone. Doesn’t scratch any furniture. Doesn’t spray. Doesn’t beg much. Doesn’t fight while being manhandled, for example when he needs to be washed after climbing up the inside of the fireplace. Again. He manages to keep the garden and house relatively cat-free and definitely rodent-free and is absolutely terrified of thunder.

I find it unbelievable that anyone looking at a sleeping cat could maintain the position that animals don’t dream. Of course it has long since been scientifically determined that animals (all mammals and birds and reptiles too) dream just like humans dream. In case you haven’t seen Bizkit the sleepwalking dog yet, that’s all the proof you’ll ever need. I’d venture that probably everything with a brain dreams, at whatever level that brain supports. It just seems to be the way brains work.

However a question to which I have not been able to find an answer is whether animals are aware that they dream. Particularly bad dreams can leave me feeling queasy for days but I’d imagine it would be a lot worse if I didn’t know that it wasn’t real. When my cat wakes up, does he realise that he’s been dreaming? Does he remember his dreams? Can he draw a meaningful distinction between his dream-life and his waking-life? Are his waking actions influenced by his dream memories? I doubt that animals have lucid dreams, it takes quite a lot of directed effort to train yourself to become lucid*.

If you have answers, let me know.

* I once spend a week achieving lucidity. My approach was to watch Waking Life by Richard Linklater every day before going to bed and train myself during the day to continually ask the question; “Am I dreaming now?”. As long as you can make yourself ask that while you’re asleep, it’s usually a piece of cake to become lucid. However I found that my sleep had become very shallow as a result of it and I would often wake up two or three times a night, so I gave up and lost the ability.

A lot of people who use Grasshopper will at some point be confronted with VB.NET or C#. Sometimes by choice, sometimes because someone else posts a script that does what they need. If you have no prior programming experience, this can be quite a shock, as neither VB.NET nor C# are particularly low-threshold languages. It is also possible that you have some experience with Rhino coding via RhinoScript or the old Rhino SDK. In both cases there’s a lot of Object Oriented Programming concepts that will be new to you. In this series of posts called “.NET fundamentals” I’ll try and explain some of the basic concepts that one must understand in order to write code for RhinoCommon. Three of the most frequent stumbling blocks are:

  • value-types vs. reference-types
  • shared-methods vs. instance-methods
  • interfaces and generic types

These words probably mean little to you if you’re just starting out, so I’ll try and refrain from using unexplained jargon in these posts. Also, since C# and VB almost uniformly use different words for all these concepts, I’m just going to stick to VB-speak. However before we get going I’d like to make it clear that almost everything I’m about to tell you is not true. At least it’s not necessarily true. It is however a useful fiction that will make certain things easier to understand. But before we can start talking about any of the abstract stuff, we must first talk about memory.

Read the rest of this entry »

VB vs. C#

June 12, 2012

The two big languages in .NET desktop development are VB.NET and C#. Both derive from long-lived and popular language families, and both have had their share of mutual dislike. Not dissimilar to the Capulets and the Montagues. C# has a proud history of hard-core development. It wasn’t that long ago that practically all serious desktop applications for Windows were written in C or C++. Visual Basic on the other hand has always been the softer language, aimed at non-professional programmers.

In the .NET framework the two languages have converged to an uncanny degree. The only real difference between them now is the ability to write unsafe code in C#, which you really oughtn’t be doing in the first place. But functionality isn’t everything. VB and C# were (are?) developed by different teams and they’ve come up with different approaches to similar problems. These differences have become fodder in the up-close war between Basic and C proponents, who now find themselves in uncomfortable proximity to the opposition.

Microsoft itself seems to be pushing C# harder than VB, for whatever reasons. But as my old* boss Andy leBihan pointed out, new programmers will always gravitate more towards VB, simply because it’s called Visual Basic, rather than C Sharp.

I’m not going to argue a position here, I’m happy working with both languages and I try to distribute new projects evenly between them. I started out as a VB programmer (VBScript, then VB5, then VB6, ultimately VB.NET 2005 → 2010) but have been working with C++ and C# for about 6 years now. There are plenty of things I think VB does better and plenty of other things that C# does better. Some of these are intrinsic to the language, others are mere implementation details of the VisualStudio code editor. Here follows a non-exhaustive list:

Read the rest of this entry »

I’ve been living in Poprad, Slovakia for about 3 years now. I knew the place well since I used to visit throughout my childhood with my parents, but I’ve only ever been here while in holiday mode which is not the same as living mode. One of my main gripes about the place is that it’s difficult to get good food and good ingredients. The supermarkets sell very standard stuff and I have to frequent all of them because they specialize in different categories (Billa has good ham, Kaufland good veggies, Tesco is better at cheese and alcohol, HyperNova does good wine and ground meat etc.). The local market is rather pathetic in terms of selection. The overwhelming majority of restaurants and diners in this country are dismal as well. You’re usually fine while ordering mashed potatoes and schnitzel, but anything involving spices or good meat will almost certainly be a disappointment.

Imagine my elation when we found a fantastic place at walking distance from our home, quite by accident about a year ago. The serving staff speak decent English, the restaurateur is passionate and the chef is a genius. He has the knack of creating a dish around a key ingredient without exaggerating the taste. I know that sounds easy, but I doubt it is.

Today we attended a special tasting menu based on Slovak traditional ingredients and wines, and I was surprised to learn how many good ones there are produced here. The following list is mostly for my own reference. The wines were all selected from two native wineries; Ostrožovič and Vino Nichta. There were a total of six courses, each accompanied by two selected wines.

Read the rest of this entry »