Ogwaros Iwenâl

Into the depths of the fiery abyss

New headphones

without comments

I listen to a lot of music, and I tend to do so on headphones.  I’ve been using some Sony studio-style headphones for some time – I believe I bought them in 1999 or 2000.  They’ve certainly served me well, but the headband was beginning to snap and I’ve begun to notice distortion for louder volumes.  So I ordered a pair of Sennheiser HD 202s.

Wow.

The headphones themselves block out a good deal of ambient noise.  And the clarity is such an improvement – I’m picking up all sorts of nuances that I never noticed that much before.  One of the reviews on Amazon described the sound reproduction as being “analytical” and I can kind of see what the reviewer meant by that.  Certain genres or instrumentations may be a bit too clear, almost deconstructed.  I’m not sure if that is necessarily a bad thing, or just simply different.

My only real complaint so far is that they’re a bit too bulky for use on the bus.  They’re perfect at home, though, which is where I get the most use out of them anyway.

Written by Brian Upton

April 15th, 2009 at 11:33 pm

Tagged with ,

If you were a tree, what kind would you be?

without comments

“A killing tree.”

Krod Mandoon and the Flaming Sword of Fire is trash.  But it’s my kind of trash so far.  Sort of a Robin Hood: Men in Tights – The Series.  But it might take itself a little bit too seriously in spots.

Written by Brian Upton

April 9th, 2009 at 10:52 pm

Tagged with , ,

You are capable of deciding your own destiny.

without comments

The question is: which path will you choose?

The latest trailer for Star Trek is pretty amazing.  I have to admit that the first couple of trailers were quite off-putting.  Kirk joyriding off a cliff at age 10?  Moments that scream ‘X-TREME!’ gimmick marketing?  Lame CGI creatures?  And, ugh, time travel?  Despite all of these possible flaws, this new trailer seems to capture a great emotional core for the movie.  This is Kirk’s journey, to live up to his father, to live up to an ideal.  “I dare you to do better.”  I’m also particularly interested in what they’re doing with Nero, the apparent villain of the movie.  A Trek movie has not had a good villain since General Chang in the sixth movie.

Karl Urban as Dr. McCoy looks like it will be a good choice.  I’m not sure about Pine as Kirk or Quinto as Spock.

I’m cautiously optimistic at this point.  And hey, anything has to be better than Nemesis, right?

Written by Brian Upton

March 10th, 2009 at 10:22 pm

Tagged with ,

Classic Carson Comedy Cracks Up Karl

with 2 comments

That would probably work better if my name were Karl.

Written by Brian Upton

February 3rd, 2009 at 9:18 pm

Texas Ventures news story

without comments

The local NBC affiliate just did a story on Texas Ventures, a student entrepreneurial organization that I’ve worked with in the past. And they used a picture of me from the company website within the story — twice.

Blargh.  Thankfully, I go unnamed…  Congrats to Texas Ventures.

Written by Brian Upton

December 17th, 2008 at 8:31 pm

Tagged with ,

No there’s no light

without comments

Frances the Mute is a masterpiece.  I may, in fact, like it a bit too much.

Something more substantive when I get some time…

Written by Brian Upton

December 2nd, 2008 at 11:53 pm

Tagged with ,

Chrono Trigger Quartet

with one comment

Great quartet performing a medley from Chrono Trigger. Best of all, they do justice to the passion and intensity of Magus’ theme. That’s an extremely rare thing.

Why did Square never release a quarter or orchestral album for Chrono Trigger? Bastards.

Thanks to Brandon.

Written by Brian Upton

November 20th, 2008 at 11:47 pm

Tagged with , ,

IAmLaZyMo

without comments

This month is NaNoWriMo and I haven’t written more than a couple of words in my existing (and languishing) novel. Which is all of 9 pages long so far. I did manage to write an entire three paragraphs in a single sitting in late October. Hardly impressive but those three paragraphs represent the only real progress on it in about a year.

Not that I’m participating in NaNoWriMo — and it would be cheating to start with my existing material anyway — but I would like to start making progress again. I just need to find a way to focus on it. Installing Q10 seemed to help some, but I think this is just going to be one of those force-of-sheer-will things.

Written by Brian Upton

November 8th, 2008 at 11:13 pm

Leap of Faith

without comments

Nothing short of breathtaking.

Written by Brian Upton

November 5th, 2008 at 12:16 am

ASP.NET MVC views and content_for

without comments

I’ve switched over development at work from ASP.NET WebForms to the new ASP.NET MVC framework, and so far I’m loving it. It codifies several practices I was already using within WebForms development, while making it easier to code cleaner in other aspects. The MVC framework certainly presents some difficulties, especially coming from being entrenched in WebForms for so long. Sometimes simple things.

For instance, what is the best way to set the HTML page title for a view that uses a master page? Almost all of the examples provided for ASP.NET MVC pass the page title in from the controller using the ViewData dictionary.

ActionResult Index()
{
    // ... action code here
    ViewData["PageTitle"] = "Hello World!";

    return View();
}

<head>
    <title><%= ViewData["PageTitle"] %></title>
</head>

While this approach certainly works, it relies on both the weakly-typed ViewData dictionary and magic literals to retrieve the title. I want to pass in strongly-typed models for all my views.

None of the options for using strongly-typed models containing the page title (and other HTML page data) seemed very appealing. It would mean either passing the model within a “Page” container, or deriving from a common interface that contains the page content. Wrapping the model is cumbersome when working within the view, and putting page data inside the model objects simply is not an option

// Awkward but usable model wrapper.
public class PageData<ModelType>
{
    public string Title { get; set; }

    public ModelType Model { get; set; }
}

// An even worse idea - why should the model care about this?
public interface IHasPageData
{
    string PageTitle { get; set; }
}

class MyModel : IHasPageData { }

Indeed, unless there is significant calculation involved — and why would there be for a page title — why should the controller determine the title for the HTML view at all? Keeping in the spirit of RESTfullness, a “page title” is meaningless for XML or JSON results. Therefore, the HTML view itself should be responsible for its own title.

This is easy for normal views; you have full control of the HTML and full access to the model. However, things become more complicated when you use a master page view. You somehow need to pass up the title of your current view to the master page view. Moreover, you need to do this at run time if you intend to use your strongly-typed model within your title.

Look to the leader as always. After a bit of searching, I found the construct that Ruby on Rails uses to do this: content_for. You would use content_for :title "Hello World" in your view to set the title, then yield :title to output it within your master layout. Bingo – just set up a similar mechanism

There’s an ever so slight problem – the master page view is run before the page view. This unfortunately means that the contents must be registered within the page view’s code behind. It’s a price to pay, but I think it may be worth it to separate HTML-specific view elements from the controller.

So I derived a couple of classes – ContentViewPage (and its generic equivalent) and ContentViewMasterPage. They add a few methods: ContentFor<ContentKey> which associates a content key with either a string or a rendering action, and YieldContentFor<ContentKey> which outputs the contents associated with the content key. Rather than using constants to define the keys, I chose to use types as the key. While I fully admit it’s an abuse of generics, it provides more unique keys and I like the readability it provides.

Registering content is fairly simple to do:

protected override void RegisterContents(object model)
{
    ContentFor<PageTitle>("Hello World");
}

Then, when you want to render that piece of content, you simply use the YieldContentFor<ContentKey> method.

<head>
    <title><% YieldContentFor<PageTitle>(); %></title>
</head>

This example is pretty trivial. Real world scenarios would involve constructing the title from the model object, passing in renderings for navigation menus for the master view, including specialized stylesheets or scripts for the view, and so on. The (extremely simple) implementation is left as an exercise for the reader.

Written by Brian Upton

November 3rd, 2008 at 11:02 pm

Tagged with , ,