media, home comments edit

Busy weekend this weekend, but got a lot done and had some fun, so it was one of the better ones.

Saturday my mom came over early and went with me to my 24th (and, ostensibly, final) laser hair removal treatment. (I’ll blog that in a couple of weeks after I see the results.) We tooled around town most of the rest of the morning, got some lunch, and headed back home.

In the afternoon my dad and grandpa came over and my dad helped me wire up some Cat-6 from my office to my living room. I have a feeling my Netflix issues are strongly tied to wireless network interference and since I’m looking at getting a new receiver with Ethernet built in, I needed to get a wire dropped in anyway. (No, my house wasn’t wired when I bought it. I wasn’t involved in the building of the house or I’d have had it wired to start with. As it stands, now I have to retrofit wires in and it’s not so simple with some of the sound barriers and things they built into my walls.)

Wiring that up meant me belly-crawling my way around in the crawlspace under my house, which sucks, especially when your flashlight burns out and you’re in the furthest corner of the house away from the door out. Feels a little like being in Saw, that. Plus there’s not actually enough room with all the pipes and stuff down there to really crawl so much as do that breakdancing worm move. My back and hips are killing me today.

After the wiring was done, we played Wii for a while and I showed my parents and grandpa how Wii Fit works. I showed them that it’s not just games, but also some different strength and yoga exercises. One of the strength exercises I showed them was the “plank exercise” - basically you hold a pushup position without moving for 30 seconds and it scores you on how stable you are. I’m admittedly out of shape, and when I showed them I got a 47 out of 100 for stability. My dad tried it and he also got a 47, so I didn’t feel too bad. Then my 88-year-old grandfather got up there and got a 96 like it was nothing. We were… suitably impressed.

Sunday I got some chores done, played a little BioShock 2, and then went to see the new Alice in Wonderland movie in IMAX 3D.

Disney's Alice in
Wonderland

I am an Alice in Wonderland freak, so I’ve been looking forward to this movie for a long time. That’s actually one of the reasons I paid the $15-per-seat to get the IMAX 3D.

Unfortunately, I didn’t anticipate this to be quite as huge as Avatar was, so I figured getting to the theater a half hour early would be plenty. I was wrong. Very wrong. So wrong we got stuck literally in the back row in the far right corner.

I was unaware that theaters would sell tickets for seats behind the rear speakers, but those were the seats we were in.

Needless to say, this affected my mood and my viewing experience.

The movie itself was good. It was very visually engaging, as expected with Tim Burton films, and did not disappoint on that front. It was nice to see a bit of a “reimagining” of the story and have a sort of “sequel” as it were. The characters were pretty cool and well acted and I never had that thing where I look at my watch and wonder how long is left in the movie. I wanted it to just keep going.

That’s actually the downfall of the movie, if you can call it that. I wanted more. I wanted to hear more about the White Queen, since you really don’t get much from her. I wanted to hear more about the rivalry between the Red Queen and White Queen. I wanted more background on the Knave of Hearts. I think I could have stood another 20 - 30 minutes to get some of that depth that was missing.

There’s also a bit of dancing at the end - you’ll know what I’m talking about when you see it - that could have been cut. It didn’t add anything to the film and was just silly compared to the rest of it.

Don’t let that fool you, though: I thought it was a great movie and I’ll be picking it up when it comes out on Blu-ray. In fact, I think I’ll like it better when it comes out on Blu-ray because I’ll have the opportunity to actually see and hear it all the way it’s supposed to be seen and heard.

The thing is, I don’t think I really got the full viewing experience sitting where we were. Skewed so far back in the corner, some of the 3D effects were blurry and weird rather than being actual 3D. (This was true even for the trailers, the same trailers I saw when I saw Avatar in IMAX 3D and looked fine.) The worst was the sound. There were times where you could tell that if you were sitting in the middle, you’d get this cool effect of some ethereal sounds floating around you, or some disembodied character speaking that should sound like it was in your head. I didn’t get any of that. Stuff that was supposed to be behind you was right over my head. Stuff that was supposed to be in front of you was way out front. The whole thing was very disorienting and actually detracted from my enjoyment of the experience, something I’d waited months for. Enough that I almost would rather not have seen it and just forfeited the tickets and gone some other time when I could have seen it with a decent seat. Very, very disappointing.

Anyway, definitely go check that out, but if you go for IMAX 3D get there ridiculously early or you’ll have wasted your time and your money like me.

net, aspnet, gists, csharp comments edit

Messing around with ASP.NET MVC 2.0 (in VS2010 RC1), specifically the validation done with DataAnnotations, and created a simple no-op custom validator attribute like this:

[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
public sealed class MyCustomAttribute : ValidationAttribute
{
  public MyCustomAttribute()
    : base("Custom Error Message: {0}")
  {
  }

  public override bool IsValid(object value)
  {
    return true;
  }
}

Similar to the way the sample “PropertiesMustMatchAttribute” is set up - enabled on a class so you attach it to the model, not a property on the model, and set so you can have more than one.

I then created a simple model that used it like this:

[MyCustom]
[MyCustom]
[MyCustom]
public class MyModel
{
  public string SomeField { get; set; }
  public string OtherField { get; set; }
}

Notice I’m using my custom attribute three times there.

I then set up a quick view to edit the model, enabled validation, and put a breakpoint in the “IsValid” method on my attribute.

I ran the editor, hit the “save” button (to post the “edited” content back and get validated) and the call to my custom validation ran only one time.

You know what I missed? I didn’t implement TypeId.

This is documented as being a “unique identifier used to identify two attributes of the same type.” What’s not said there is that if DataAnnotations (or, at least, the MVC validation portion) comes across two attributes of the same type, it’ll only look at one of them. By default, TypeId is just the type of the attribute, so when two attributes of the same type are encountered, they’re considered “the same.”

If you set your AttributeUsage to AllowMultiple, you absolutely must implement TypeId.

You can see this implemented in the MVC “PropertiesMustMatchAttribute” as a new object (so they’re never identical). Updating my simple attribute like this…

[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
public sealed class MyCustomAttribute : ValidationAttribute
{
  public MyCustomAttribute()
    : base("Custom Error Message: {0}")
  {
  }

  public override bool IsValid(object value)
  {
    return true;
  }

  private object _typeId = new object();
  public override object TypeId
  {
    get
    {
      return this._typeId;
    }
  }
}

…causes my custom attribute to run all three times as expected.

What’s the use case for multiple attributes of the same type? In the case of the “PropertiesMustMatchAttribute” sample, maybe you have a model for registering a user - email, email confirmation, new password, new password confirmation. You want to make sure the two email fields match and the two password fields match. Two instances of one attribute, but working on different fields. Without implementing TypeId, only one of the validation checks will happen.

Once you get it working, sure, you can optimize some (for example, the “PropertiesMustMatchAttribute” could store the names of the properties being compared so if someone actually does try to run redundant validation it won’t happen), but that’s left as an implementation detail.

I went and took this color test which does a sort of career analysis based on colors you like and dislike.

It tries to get you to enroll in a school or something, so don’t give it your email address or anything, but it’s interesting and appears fairly accurate. Here’s my result (along with a description of the test):

The Dewey Color System® is now the world’s most accurate career testing instrument. This report based on your personality traits indicates your two most enjoyable day-day-day occupation skills. It’s a summary of the full report, the Color Leadership Evaluation 5.0.

Studies indicate workplace enjoyment is the key to success. So as you read, consider only “Was I mostly having fun at work?” Disregard your present and past employer’s environment.

Best Occupational Category You’re a CREATOR Keywords: Nonconforming, Impulsive, Expressive, Romantic, Intuitive, Sensitive, and Emotional

These original types place a high value on aesthetic qualities and have a great need for self-expression. They enjoy working independently, being creative, using their imagination, and constantly learning something new. Fields of interest are art, drama, music, and writing or places where they can express, assemble, or implement creative ideas.

CREATOR OCCUPATIONS Suggested careers are Advertising Executive, Architect, Web Designer, Creative Director, Public Relations, Fine or Commercial Artist, Interior Decorator, Lawyer, Librarian, Musician, Reporter, Art Teacher, Broadcaster, Technical Writer, English Teacher, Architect, Photographer, Medical Illustrator, Corporate Trainer, Author, Editor, Landscape Architect, Exhibit Builder, and Package Designer.

CREATOR WORKPLACES Consider workplaces where you can create and improve beauty and aesthetic qualities. Unstructured, flexible organizations that allow self-expression work best with your free-spirited nature.

Suggested Creator workplaces are advertising, public relations, and interior decorating firms; artistic studios, theaters and concert halls; institutions that teach crafts, universities, music, and dance schools. Other workplaces to consider are art institutes, museums, libraries, and galleries.

2nd Best Occupational Category You’re a DOER Keywords: Emotionally Stable, Reliable, High Energy, Practical, Thrifty, and Persistent

These adventurous types prefer action-oriented, concrete problems rather than dealing with thought-provoking, ambiguous, abstract dilemmas. Fields of interest include mechanical, construction, and outdoor careers. They might also enjoy working with machines, tools, and equipment to repair or build something.

I think people who know me would see it as pretty right on. Given my current occupation as a software engineer, I fall pretty close to where it looks like I should be - a mix between creator and doer. I kinda wish I had a little more in the way of “unstructured, flexible organizations” to deal with, but… well, them’s the breaks.

I wanted to be 3D modeler/animator at one point. That would have been along these lines, too. Hmmm.

vs comments edit

You may have noticed that every time you install the DevExpress DXCore/CodeRush/Refactor! products they go into a different install folder. For example, I have two versions installed right now:

  • C:\Program Files\DevExpress 2009.3
  • C:\Program Files\DevExpress 2010.1

The thing is, you can only have one version running at a given time, so it bothered me that there was a new install location every release. I felt like it was left to me to clean up a mess… but it turns out that’s not the case!

This “new install location for every release” is intentional because you can have multiple versions of DXCore/CodeRush/Refactor! installed and you can switch between them using a tool they provide.

Here’s how you do it:

  1. Close all the running instances of Visual Studio.
  2. Go into the IDETools\System\DXCore\BIN folder in the most recent install location. For me, that means C:\Program Files\DevExpress 2010.1\IDETools\System\DXCore\BIN. (Technically you could go to the folder for any of the installs, but I choose to go to the most recent just in case there’s been a patch or addition to the tool.)
  3. In that folder, run the DXCoreVersion.exe program.
  4. The version selected in the dropdown box will be the latest version installed, not necessarily the active version. That’s important and could be misleading.
  5. Select the DXCore version you’d like to be active and click “Run.” In this example, I have version 9.3 active so I’ll select to switch to version 10.1.
  6. A lot of stuff will happen - the version of DXCore currently set up will be unregistered and the version you selected will be registered. Note that while the log will talk about “uninstall” and “install,” it’s not actually adding or removing the installation from your system, it’s just hooking things up.
  7. Wait for the popup to tell you it’s done. It takes a couple of seconds and the Close button isn’t disabled, so it might look like it’s done, but it’s not. Once it’s done, you can click OK to dismiss the popup and close the version switcher.

You can use this process to switch from any version to any version [that you have installed]. If you make sure to keep your community plugins in the default location (under your Documents folder, not under the install location) then your community plugins will transition along for free.

home, network comments edit

As part of our contract renegotiation with Verizon, we upgraded our network speed to 35/35 (35Mbps download and upload). When we did a speed test, however, we were only seeing about 20/15. I did some research and found out a few things that, well, it “would have been nice to know yesterday.”

You may need a new ONT. Some subscribers have old ONT (optical network terminal) boxes on the side of their house that can’t actually support the faster speeds. This wasn’t the case for me, but affected folks actually need someone to come out from Verizon and replace the hardware to get the full speed.

Not all speed tests report higher speeds correctly. I lost the links where I first saw this reported, but in the Verizon forums I saw several cases of common speed tests not actually reporting correctly. I saw this myself. Use the Verizon speed test to check your speed.

You may need to change some settings. Apparently Windows default network settings don’t allow the client to fully take advantage of the higher speeds. Verizon has a network optimizer that you can run that will update some settings and get things working correctly (you can also use it to reset your settings back to default). This worked for me on Windows 7, but if you’re on Vista you may need to read this KB article first. The settings it modifies (copied from their description page):

  • TCP 1323 Extensions - This parameter enables enhancements to the TCP/IP protocol that provide improved performance over high speed connections.
  • TCP Receive Window - This parameter specifies the number of bytes a sender (the source you are downloading from) may transmit without receiving an acknowledgment. Modifying it determines the maximum size offered by the system.
  • MTU (Maximum Transmission Units) - The MTU defines the largest single unit of data that can be transmitted over your connection. The FiOS network requires an MTU of 1492 bytes.

After running the optimizer I was able to get 35/35 on wired connections. Wireless connections still report weird for me - like 3/50 or something. It’s nice and fast, though, so I’m chalking that up to incorrect reporting rather than misconfiguration.