net, vs comments edit

I’m working on some ideas to enhance Solvent and I’ve realized that one of the things I want to do will require some low-level shell programming.

I hate low level shit.

Looking at MSDN, it seems that the only real way to do it is to use C++ (because of the ridiculous amount of weird pointer stuff that’s happening).

I tried pInvoking my way to freedom and leisure. There’s only one problem with that: When there are marshaling issues, I’m not a COM person… I don’t know how to fix them. I live in a higher-level programming world: garbage collection and high-level data structures and no fussing with memory allocation issues. It’s been like seven years since I’ve dealt with anything C or C++ related.

Try as I might, though, I can’t get myself quite DllImported into the Windows Shell.

As such, this weekend I went out and bought Visual C++ .NET - Step By Step. I’m only on like the second chapter (no time!) but I’ve skimmed through the rest.

Lots has changed since I last worked with this stuff. ATL? Funky reserved words (__gc, __value, etc.)? Maybe that’s standard stuff that has always been around, but then, I learned C++ in Solaris on SPARC workstations, which means I read a little about MFC but never had opportunity to use any of it.

(By now, all of you VC++ people out there are shaking your heads. Gimme a break; I’m [re]learning!)

It’ll be good to come up to speed on it; if anything, an interesting exercise in crash-course style learning. Who knows… I might even read the whole thing instead of just enough to get my project done. Heh.

Just looked at my stats. The number two search phrase that leads people to my site is:

you don t have to be rich to be my girl

What in the…?!

I’m working on this project, you know, at work, and it turns out it’s a little larger than we first anticipated so we’re getting some contractors on it.

I’m interviewing these contractors, and I’m finding that lots of people look great on paper but don’t live up to the hype when you talk to them.

We’re looking for ASP.NET developers, specifically. I’ve talked to five developers with excellent looking resumes so far, and only two are remotely close to anything I’d consider an ASP.NET developer. It’s bad to the point where you wonder if the people who put down “proficiency in ASP.NET” have actually been online before in their lives.

One of the first questions I ask a candidate is what the events are (and in what order) for an ASP.NET web form (System.Web.UI.Page) when it executes. For those who actually aren’t ASP.NET developers, this is like asking a college English professor to give you the alphabet. If you don’t know it, or can’t at least get the main ones, it sort of debunks you as being anything you claim to be.

It turns out that this is a tough question for the people we’ve so far interviewed.

For those going to interviews, let me help you out: When you don’t know the answer to a question, say so. You might take the opportunity to think out loud and talk with the interviewer to see if you’re on the right track, but make sure they understand you’re not trying to put up a smoke screen. Do not change the subject and start talking about jobs you’ve had in the past that are entirely unrelated to the job you’re interviewing for. Do not hem and haw about and then give up with the statement “I know I could do a good job for you.” Just be straight and do your best. Unless you’re interviewing for a sales job, chances are the interviewer(s) will know if you’re lying.

Furthermore, if you’ve used a technology (or application or tool or whatever) only once or twice, don’t list it on your resume. Just because you’ve ridden in a car doesn’t mean you know how to drive one. Save us both some time. Oh, and if you tell me you know how to program and that you rely on copying and pasting example code then tweaking it… just get up and walk out. You’re not going to get the job.

Finally, don’t oversell yourself. I understand that people in interviews get nervous and some people react to nervousness by talking… curb your yammering skullcave and let the interviewers ask you questions. If you have a question, ask it. If you’re asked a question, answer it. Don’t go off on some diatribe about the 47 other jobs you’ve had and every project you’ve ever worked on. Answer the question, provide reasonable detail, and move on.

Save me time. I value my time. You’re wasting it. Just… just don’t.

gists, aspnet, csharp comments edit

In creating various web apps, I use Peter Blum’s Professional Validation and More controls for page validation and error display. If you don’t, you really should. They’re much more flexible and robust than the Microsoft validation controls are.

One problem I ran into was in using the ValidationSummary control. I’m generating a huge form using all sorts of validation, and I want the ValidationSummary to display the list of errors on the form as they happen. The issue is, the ValidationSummary only displays when the user tries to submit the form - even if it’s a client-side validation, you only see it when the user clicks the submit button.

I wanted my ValidationSummary to display real-time, rather than waiting for the user to click the submit button. Here’s a little method you can use on your controls to make the page execute validation on a control event. Just pass in your control and the name of the event (“onclick,” “onchange,” etc.) and this will handle the rest.

/// <summary>
/// Adds a call to the VAM page validation to a specified control's event.
/// </summary>
/// <param name="control">The control that should call validation.</param>
/// <param name="eventName">The event that should fire validation (onClick, onChange, etc.)</param>
protected void AddPageValidationEvent(WebControl control, string eventName)
{
    var scriptKey = (string)control.ClientID + "_" + eventName + "_VAMValidate";
    if (!Page.IsStartupScriptRegistered(scriptKey))
    {
        var scriptBase = "<script type=\"text/javascript\" language=\"javascript\">\n" +
            "<!-- \n" +
            "VAM_AttachEvent(VAM_GetById(\"{0}\"), \"{1}\", \"{2}\");\n" +
            "-->\n" +
            "</script>";
        var eventAction = "VAM_ValidateGroup('', true);";
        var completeScript = string.Format(scriptBase, control.ClientID, eventName, eventAction);
        Page.RegisterStartupScript(scriptKey, completeScript);
    }
}

Every year (at least for the past couple of years now), Jenn and I work with Greg and the crew at Western Display Fireworks to help put on a show for the Fourth of July. (One more show, and both Jenn and I will be licensed pyrotechnicians. Next year!)

This year, the show was in Clatskanie, OR, about two hours out from our house, way out in the sticks.

We’re talking small town here.

We got to Clatskanie a little before noon on the Fourth to help set up. The show wasn’t scheduled until 10:00p or so, but it takes a while to get things set up, so better to get there early and get it done than scramble at the last minute.

Unfortunately, we got there right when the Independence Day parade was starting. That means they had the main street through town pretty much blocked off so we couldn’t get down it to where we needed to set up. We decided to hang and watch the parade (nothing else to do anyway, right?).

The parade consisted of three log trucks, a dump truck with the local girls’ softball team in the back, four or five tractors, some kids on four wheelers, a couple of hot rod cars, and five tow trucks from the neighboring town.

Like I said, we’re talking small town here.

The parade lasted about 15 minutes and then we went down to where the fireworks were going to be shot from. This ended up being a field around 75 yards give or take from the local waste water treatment plant.

I think you see the bad moon a-rising, just like I did on this.

The result of being right near an open vat of shit is that any time the wind kicks up, it stinks. Like shit. Bad. Really bad.

We got our lawn chairs out, set up “camp” in the pseudo-shade of a tree, and got to work.

The fireworks we shot were 250 or so four-inch shells and 50 or so five-inch shells. That meant we had about 300 mortar tubes we needed to bury. We were fortunate that the city had brought in a backhoe so we didn’t have to dig the trench ourselves. We did, however, have to set the tubes in the trench and backfill around them. Here’s a picture of the tubes alongside the trench.

Mortars ready to be
buried

As we got working on that, Jenn grabbed my attention and pulled me aside.

Jenn: Trav… look in the dirt. Trav: What? [fully expecting to see lumps of crap] J: Are you looking in the dirt? T: I don’t see anything. Rocks. J: Look at the rocks. Close. T: Is that…? J: Yes. There are plastic tampon applicator tubes all over in there.

Now, hold on a sec. I had leather gloves, not a fucking hazmat suit. I gotta dig around in that? Yeaaaah.

We ended up getting the mortars all set up and aimed, though. There were like 10 of us there, so it went quicker than you’d think, but it was still a three-plus hour job. Here are the mortars - buried, loaded, and ready to go.

Cocked, locked, and ready to
rock

Once we got that set up, we headed into town to get some food. The idea was to eat vendor food at the fair going on in the park.

We got to the fair and it was about one short city block long. Vendors lined the “aisle” selling a bunch of stuff I didn’t need. There were seven food vendors. Four of them sold only elephant ears. The rest sold cotton candy, Thai food, and curly fries, respectively.

We turned around and went to one of the restaurants in town, Hump’s. I’d say it was because of a camel theme (because there were camel-related things in there) except for the giant plastic bull near the front counter. Not sure what to make of that.

We finished eating and went back to the fireworks area to find that everyone had moved their chairs away from the place we were sitting. Jenn and I were alone.

I asked why everyone moved. I got the response that it was “misting.”

The day was clear. Few, if any, clouds in the sky. “Misting?”

Hmmm… that could only mean… NO…

“You mean the vat of shit up there was causing mist to fall over here? And you didn’t move my stuff?

“Heh. Yup.”

Assholes.

10:00 rolled around before we knew it. We got dressed up in our fire gear (no flammable clothes, baby) and got ready to roll. Jenn was set to light five four-inch shells (all tied together) right at the beginning, then I was set to light five five-inch shells (all tied together), then Greg and another guy would do the rest of the lighting while we watched for fires.

Jenn got the fusee (which is basically a road flare) and lit her fuse, then handed the fusee to me.

Let me explain “quick match” to you. Basically, quick match is a gunpowder coated string encased in a paper tube. Exposed (outside the tube) it burns kinda slow. Slow enough to watch it burn, at least. Once the flame reaches the paper tube, though, it burns at 60 feet per second. That’s damn fast - until you see it, it’s hard to explain how fast. Just imagine it’s instantaneous, because for all intents and purposes at the sub-foot length, it is.

She was supposed to get back once she lit it, but sort of watched the exposed end of the quick match burn until it burned back to the paper, at which point all five four-inch shells lit off and the concussion hit her.

This is a scary, scary thing, folks. It’s like a stick of dynamite going off in a hole in the ground right in front of you. It’s loud and firey and generally something that, if you’re not prepared for it, is freaky like nothing else.

Jenn scrambled backward to get away from the fireworks while I lit off mine. I handed the fusee to Greg, but, just like Jenn, I wasn’t quite prepared for the blast. Five five-inch shells is noticeably larger than five four-inch shells. It’s not something I can even really quantify, just suffice to say it’s like everything you imagine a war zone being.

I backed off, tripped over Jenn (who banged up her knee), and we both kept backing up until we were at a safe distance while Greg and Brad finished the show. Jenn and I did our job watching for fires (and watching the show) for the rest of the time.

After the show, we went around and made sure there were no live rounds left hanging out for little kids to come up and grab, picked up the garbage, and pulled the mortars out of the ground. We left after that and, after the long drive home, finally crawled in bed around 2:00a.

An exhausting day, to be sure, but there’s something about it that, once you’ve done it, you can’t not do it again. It’s all of the scariness and loud bang and fire of war with the safety of proper setup and equipment (and the knowledge that no one is actually shooting back at you). You smell the gunpowder smoke, you feel the impact, and you’re hooked.

We’ll definitely be back next year. Hopefully it won’t be at the sewage treatment plant.