Friday, October 15, 2010

Triggers

I've started a project: digitize all the cassette tapes I can find.
After I do that successfully, I'll digitize all of my dad's LPs.

Needless to say - I've found a lot of old memories listening to some of these tapes. Some of these memories I didn't even realize I'd forgotten.

One of the songs I found on a mix-tape was "Substitute" by The Who. The recording on the mix tape wasn't very good, but it was enough.

I haven't added any of the newly-digitized music to my library yet, so when "Substitute" was stuck in my head I had to go to the internet to hear it. I found a version on YouTube and listened all the way through. Then a funny thing happened: I thought I smelled markers and paint.

Usually smells trigger memories in me - but in this case, music triggered a remembered smell. A lot of "The Who" listening went on while I was in high school where I was taking a lot of "Commercial Art" from good old Tom Wood. The commercial art room (was it 702?) always had chemical smells coming from it. Whether it was markers, paint, various solvents to clean the same.

Monday, January 18, 2010

Inference from Apple Event Invitation

ArsTechnica
posts confirmation of an Apple event on Wednesday, 27 January, 2010.

Most speculate that this event will be the long-awaited announcement of the longer-awaited Apple tablet device. If that's the case, I draw the following inferences from the invitation's spray-paint motif – along with rumors about a radical new user-interface:

  1. The device will have a color display. Reading that back to myself, it seems obvious – however, many expect the device to compete with e-readers such as Amazon's Kindle.
  2. If the spray-paint motif is more than just a cool design element, the device's new UI will be able to emulate a spray can. Specifically, I imagine moving a spray can in and out to change the line-width. That would mean that the input mechanism will incorporate some 3-D elements. I envision a fancy stylus… but who knows.

P.S. I bought a few shares of Apple stock.

Wednesday, January 06, 2010

Where do We Put the Screen?

I don't know how old I was – but I was no more than six – probably closer to four. My parents came home and told me that they had rented a movie. They had a big, blue, padded case with them. I imagine that I said something like, "Coool!"

"Let's set it up and watch it!" was my dad's reply.

"Okay! Where should we put the screen?" I inquired.

"It doesn't go on the screen."

I returned a quizzical look.

"It hooks up to the TV."

Sunday, November 15, 2009

Other Radio Services

There has been some discussion in my local Amateur Radio community about what qualifies as "public service." A lot of the debate concerns a phrase in the FCC rules governing Amateur Radio. It states that amateur radio should not be used for
(5) Communications, on a regular basis, which could reasonably be
furnished alternatively through other radio services.
I just wanted to tell a story about when communications could not be furnished by any other means.

We were supporting the annual ("on a regular basis"?) Multiple-Sclerosis Society's MS 150. The rest-stop where lunch was served was up a canyon (Blacksmith Fork Canyon). One of the riders was run over by a small trailer being towed up the canyon by a pickup truck.

There were EMTs at the rest stop who were able to see to him, but he required a trip to the hospital. Cell phones weren't working in the canyon. A sheriff's depute wasn't able to reach his dispatcher. Only my ham radio could make it out of the canyon.

Scary - yet inspiring.

Monday, July 27, 2009

Sometimes I amaze even myself!

I built a generic method in C#. One of the parameters to the method was the generic type <T>

Looking at my method, I created some instances of T using the new keyword/operator.

I thought to myself, "some classes don't have a constructor... I'll need to restrict that in the declaration. Something like
private static long CreateInstances<T>(List<T> instanceCollection) where T "has a default constructor" {...}


I looked up the where contextual keyword and learned that the syntax for what I wanted to do was:
private static long CreateInstances<T>(List<T> instanceCollection) where T: new() {...}


Just before I hit that last parenthesis I noticed the red-squiggle. It was under some code down in the method body that used the type 'T'

T variable = new T();


I hovered over the squiggled text to see what was the matter:
Error: Cannot create an instance of the variable type 'T' because it does not have the new() constraint.


Ha!! I defeated the red-squiggle before I had even seen it!

Thursday, July 23, 2009

Experiments!

I wasn't sure if the C# is operator would throw a null-reference exception if I gave it a null object. (Katie, a null object is simply an empty placeholder - think of someone's name in your address book, but without an address. When you try to mail them something, you wouldn't just send a blank envelope to them, you're smart enough to recognize the "address not found exception". Null-reference exception is the same thing.)

So, I built an experiment:

static void Main(string[] args)
{
object foo = new System.Xml.XmlDocument();
object bar = null;
System.Uri zap = new Uri("http://fake.uri.nategrigg.com");

try {
Console.WriteLine("foo.GetType(): {0}", foo.GetType().ToString());
Console.WriteLine("foo: {0}", foo.ToString());
Console.WriteLine("bar: null");
Console.WriteLine("zap.GetType(): {0}", zap.GetType().ToString());
Console.WriteLine("zap: {0}", zap.ToString());
Console.WriteLine("foo is object: {0}", foo is object);
Console.WriteLine("bar is object: {0}", bar is object);
Console.WriteLine("zap is object: {0}", zap is object);
Console.WriteLine("foo is XmlDocument: {0}", foo is System.Xml.XmlDocument);
Console.WriteLine("zap is Uri: {0}", zap is Uri);
Console.WriteLine("bar = zap");
bar = zap;
Console.WriteLine("bar is Uri: {0}", bar is Uri);
} catch ( NullReferenceException nullex ) {
Console.WriteLine("Null reference exception: {0}", nullex.Message);
}

Console.ReadKey();
}


Conclusion: When given a null variable, the is operator simply returns false. Which is just what I needed!

Also, the program had the following output (in case you're curious):

foo.GetType(): System.Xml.XmlDocument
foo: System.Xml.XmlDocument
bar: null
zap.GetType(): System.Uri
zap: http://fake.uri.nategrigg.com/
foo is object: True
bar is object: False
zap is object: True
foo is XmlDocument: True
zap is Uri: True
bar = zap
bar is Uri: True

Tuesday, June 30, 2009

localRepo

Man... what a hassle!

Why do I bother checking "specific version" if Visual Studio just copies a different version over the top? Maybe it's MSBuild that's doing the copying.

The secret is that the wrong version of the assembly gets cached here (on my vista box, it may be different in XP):
~/AppData/Roaming/localRepo/Cache/wrongDllVersion.dll

I found the path by checking "read only" on the DLL that kept getting overwritten with the wrong version. When I built the project there was a warning about how Visual Studio was unable to copy the dll.

HA! Take that, Visual Studio!

Sorry if you don't care about DLLs or Visual Studio; I had to put this up so I can find it next time I google: ".net dll wrong version cache"...