dotnet, gists, build comments edit

I’m working on building a bunch of projects that all follow a specific convention for naming, NuGet packaging, and so on. As part of that, I want to run the build for each component – from clean to package – all at once rather than clean everything, then build everything, then package everything. (For the sake of the article, let’s ignore whether that’s a good idea or not and just stick with me.)

MSBuild has batching, which sort of works like “for-each,” but in examples you see you can really only “batch” on tasks. Targets (groups of tasks) allow you to specify inputs and outputs, but the “outputs” list is assumed to be files, so if it finds the outputs are up to date, it won’t run that input.

Anyway, I found this article that explains how to sort of abuse the inputs and outputs on targets so you can effectively do for-each over a target.

First, create an item list with your inputs and metadata. It doesn’t have to be files. For your inputs, pass the list of parameters. For the outputs, put a dummy value that always evaluates to empty/null – that way it’s never seen as up to date and will always run.

Here’s a sample script:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Start"
  xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
  ToolsVersion="4.0">
  <ItemGroup>
    <SomeValues Include="First">
      <Meta>true</Meta>
    </SomeValues>
    <SomeValues Include="Second">
      <Meta>false</Meta>
    </SomeValues>
  </ItemGroup>
  <Target Name="Start">
    <CallTarget Targets="Parameterized" />
  </Target>
  <Target Name="Parameterized" Inputs="@(SomeValues)" Outputs="%(Identity).Dummy">
    <Message Text="Item = %(SomeValues.Identity)" />
    <Message Text="Meta = %(SomeValues.Meta)" />
    <Message Text="---" />
  </Target>
</Project>

The output, as you’ll see, is that the “Parameterized” target gets called once for each item in the group.

Build output window

My 15-month-old daughter, Phoenix, is a kick in the pants. This kid has got more energy in her than I can keep up with. Of course, when she gets home from day care, she runs rampant and really wants to play, so we do.

I envision a typical play session with a different little girl going something like, “Oh, look, Cookie Monster is going into Hooper’s Store. See how he’s in there? He’s looking for cookies. Cookie starts with ‘C.’ Here comes Elmo, he’s bringing Cookie Monster some cookies. Yum!”

That’s not quite how it goes at our house. Phoenix is into Sesame Street, so we do have the Sesame Street Neighborhood Playset and figures, but she’s also into Little People, so Daddy ended up getting some figures that he could better relate to… like Batman and Joker.

Little People - Batman and
Joker

We’ve also got some Little People vehicles, like the school bus. That means a play session goes more like this for us:

Travis: Hey, Phoenix, can you find Batman? Where’s Batman?

Phoenix: <holding up the Batman figure> BAPMO!

Travis: Yes, that’s Batman! Great! I’ll play Joker, because Daddy is always the bad guy anyway. Here’s Joker, he’s getting into the bus with this little kid. Do you see how Joker is in the bus? Now Joker has a hostage. Hostage starts with ‘H’ – can you say ‘hostage?’”

Phoenix: <dancing the Batman figure around on the floor> BAPMO! BAPMO!

Travis: Right, Batman has to come stop the Joker. Joker is going to drive the bus away from Batman. Vroom! Vroom!

Phoenix: <grabbing the school bus> pbbbbbbbbbtttttt! <making raspberry/spitting noises and driving the bus around>

Travis: Perfect! Now Batman’s going to try to stop Joker… but the Joker has a secret weapon. The shark! Watch out, the shark is going to get you!

At this point, I grab this giant stuffed shark we bought at Ikea for $15. It’s the best $15 I’ve ever spent. Phoenix wrestles this shark and screams and runs and then comes back to wrestle it some more. I attack her with the shark, and she screams and giggles.

Phoenix attacking the giant
shark

Travis: Hey, Jenn, where’s the Wonder Woman figure?

Jenn: I don’t know, have you looked in the toy box?

Travis: Yeah, but I don’t see her. Phoe, where’s Wonder Woman?

Phoenix: <ignoring me, still wrestling the shark>

Travis: Well, crap. How am I supposed to set up the Hall of Justice in Hooper’s Store if I can’t find Wonder Woman?

…and so on. I’m not sure if that’s typical of everyone or if it’s just me. I’m thinking it’s just me. (Phoenix also accompanies me on occasion to the local Things From Another World comic store. Gotta start her early.)

net comments edit

Typemock has released Isolator v7, and this is pretty much the release you’ve been waiting for.

Let’s ignore the visual test coverage, the test autocompletion, or even the automated test runner that runs your tests in the background so you instantly know when you write something that breaks a test. That stuff all rocks and you’ll love it.

This is the version that lets you run tests against different versions of Isolator without having to uninstall/reinstall different versions. A long-running issue, you’ve previously always had to build your tests and run your tests against the exact same version of Isolator. Not a huge deal if it was a product you could check in alongside your code… but you have to install it and you can only have one version installed at a time. No longer! They’ve finally fixed my #1 complaint and I am stoked.

Oh, and they added mocking for the filesystem (System.IO.File) and environment (System.Environment). Nice.

Go check it out.

media, music comments edit

When I’m at work I like listening to music… but I hate being tethered to my computer (or iPod dock, or whatever) by the headphone cord. If I want to slide my chair over to the whiteboard to write something up or reach over and get something out of my bag, I have one of two choices: make the cord so long that it gets tangled up on my chair and in my desk stuff; or take the headphones off to go do whatever it is and put them back on.

Also, I like my headphones. I have some ear buds, I have some over-the-ear headphones, and while they’re not bajillion-dollar models, I like them. I don’t want Yet Another Pair of Headphones that are wireless. I want to use my headphones. The ones I already own.

Before I explain this, let the audiophiles be warned: This doesn’t yield super-awesome quality. But then again, I’m not sure I’d call music-over-Bluetooth on any level “super-awesome.” Just be aware.

First, get a Bluetooth audio dongle receiver like the TaoTronics BTI-005. That’s the one I got and it seems to work pretty well. This runs between $20 and $30 at the time of this writing. There are a few of these dongles out there, but on Amazon right now this one is the most popular and is one of the few that doesn’t also require you to plug it in.

The audio receiver allows you to plug your existing headphones in and it will receive any audio played over Bluetooth through those headphones. You just converted your headphones to Bluetooth.

TaoTronics BTI-005 Bluetooth audio dongle
receiver

The thing is, you may or may not be done.

If your audio source (iPod, etc.) supports Bluetooth, you’re probably done. Pair it up and listen to a song. See how the quality is.

If the quality is pretty good on your Bluetooth audio source, you’re done.

If your audio source doesn’t support Bluetooth or if the quality sucks, you’re not done. I found, for example, that there’s some real weirdness with connecting a Bluetooth audio headset to a Windows 7 computer. <techspeak>Windows 7 requires a very specific A2DP audio profile that not every Bluetooth headset supports. This dongle doesn’t support it. If you search for “Bluetooth audio quality in Windows 7” you’ll see a ton of people with the same problem on different headsets/adapters.</techspeak>

In this case, you also need a Bluetooth audio transmitter dongle. I bought the JayBird uSport Bluetooth adapter for 3.5mm devices. What this does is plug into the headset jack on your audio source (computer, iPod, phone, etc.) and sends the audio signal via Bluetooth. Pair that up with your receiver dongle and you have both pieces to the puzzle covered – the transmitter and the receiver.

JayBird uSport Bluetooth adapter for 3.5mm
devices

Again, there are different transmitters out there, but this one seems pretty popular and supports this new protocol called “apt-X” that allows you to potentially get a better audio quality if you also use a receiver with “apt-X.” You can also try the TaoTronics TT-BA01 adapter for 3.5mm devices, which will probably work. I wanted the upgrade-ability, so I went with the JayBird.

I’m listening to Pandora through my computer using the BTI-005/JayBird uSport combo right now and it’s decent. Is it audiophile quality? No, but it’s decent. Given that it’s compressed music streaming over the internet and into a mediocre pair of headphones… I don’t think the Bluetooth portion of things is that noticeable. When there’s a gap between songs or a really quiet section of a song, I do hear a low-level “buzzing” background noise. But for what I’m doing… it’s good enough.

I had a four-day-weekend this past weekend but, while it should have been a fairly mild time, it turned out to be a stress-filled pain.

The reason I was off was to help Jenn with some shoulder surgery she was having on Thursday. I’d need to be around to help while she was laid up with pain meds and I figured that would mean some food runs while she slept it off. Phoenix would stay with my parents until Saturday afternoon so we could get everything settled by weekend time. Get a little done around the house, take care of Jenn, no big deal, right?

Wednesday night my parents called up and cancelled because my mom’s cat, Xena, started having some health problems… and on Saturday she ended up having to be put down. She was 16, so I’ve known her almost half my life, and she was totally a part of the family. She always wanted to bite me for some reason, but I think it was because my dad liked to play with her and rile her up (which she loved) and she wanted to play with me, too. I’ll miss that bad little girl.

Anyway, that left us without a babysitter, so we got Jenn’s sister to cover for us. That worked out well – what a lifesaver! – except for the part where we weren’t planning on having Phoenix return until Saturday afternoon. Jenn’s sister had plans first thing in the morning so Phoenix came back early.

The early return wouldn’t have been a big deal except I promised my friend John I’d help him that morning to fix his Windows Home Server that went down during the week. So I had to cancel on him, which I feel bad about, but Jenn couldn’t handle the toddler all doped up and with only one arm working.

In the meantime, Thursday night I was told my grandpa (my last remaining grandparent) was in the hospital with a stroke, unable to move his legs. We found out later that it was something more like an infection of some nature, not a stroke, but still – hospitalized.

I didn’t blog it earlier, but Phoenix grabbed my glasses a couple of weeks ago while I was in the shower and Jenn took her eyes off her for like two seconds. I’m not sure how Phoe managed to rip the arm clean off the glasses, but she did, so I got to get new glasses. I picked them up on Tuesday… but by Friday they were driving me nuts. Straight lines were straight in the center of my lenses, but looked all curved the further away from center they got, sort of like looking through a mild fisheye lens. I took the glasses in on Friday and the optician said that indicates my eyes aren’t adapting to the lens material well. My old lenses were plastic, the new ones were polycarbonate. I ordered some new lenses made of a different material and handed back my glasses. I’ll be on my old/spare glasses for a week and a half or so. Fantastic.

The DST change didn’t help anything since Sunday we had to run a specific errand by 10:30a and we forgot about the time change so it really had to be done by 9:30a… so there was a lot of “Oh, crap, hurry up and get ready! Go! Go! Go!”

Sunday also marked my last day of prednisone. I’ve been fighting some Eustachian tube dysfunction for about a year now and the last few months my ENT has been trying to fight it with a bunch of different drugs… but it’s not working, and Sunday was my last day of my last ditch treatment effort, so I’m gathering it means I’m going to end up with a tube in my ear like you see on kids that get ear infections. I know it’s not a “big deal,” but it still scares the crap out of me, so there’s a low-level simmering going on in my mind about that. I’ll have to make another appointment, probably later this week or next, and find out.

Honestly, after all that, I really couldn’t wait to get back to work. Not that work isn’t stressful (particularly recently), but at least it’s a type of stress I can just bury myself in. Could it be worse? Sure, things can always be worse… but here’s hoping this week tapers off a bit.