My Name is Jorge…

“… and today is my birfday! My name is Jorge and I am your friend!”

So sings my son’s stuffed giraffe toy when we get greet him every morning or put him to bed in the evenings.

Today IS my birf- *ahem* birTHday. What’s more odd to me is not that I’ve lived for more than a third of a century, but that I’ve now lived more than half of my life in one place. Not one address or even one town – one geographical region.

The first half of my life I was a DoD dependent – an Air Force Brat. Half of THOSE years were spent at Seymour Johnson AFB in Goldsboro, NC. If I’m correct, the sequence of locations was: Goldsboro, NC (2 years), Clark AFB, Philippines (4 years), Goldsboro, NC (8 years), Misawa AFB, Japan (2 years), and Goldsboro, NC (2 years) all prior to coming to the St. Louis area in the summer of 1994.

18 years is a long time to stay in one place. I can’t say I remember much what the place looked like back then – you don’t make a habit of memorizing your commute when you’ve got more than 4,000 round-trips under your belt; it’s all the same 60mph blur.

When the next presidential term is done, I’ll be nearly “over-the-hill”… I hope that’s only a third of my lifetime. I don’t want to be part of the statistical average. I want to go out in my 100s. Maybe I’ll get there.

Please don’t throw me a black balloon party. That would seriously blow the giant llama.

WebResource.axd Interferes with Cascading Style Sheets

I encountered a new and frustrating situation within ASP.Net the other day. I was adding AJAX Control Toolkit v3.5 to an ancient intranet portal site and noticed, by way of Internet Explorer, that some style overrides were not being applied. It took a minute to trace the problem and the cause was interesting and annoying.

After adding a TabContainer and ToolkitScriptManager to the page, I noticed aelement for the embedded stylesheet resource of the ACT. So what should have been the final word on the page regarding styles from sheets added earlier were overridden by a last ditch addition in the form of an embedded resource via WebResource.axd.

Necessity being the ugly mother of invention that it is, I needed this situation rectified. The solution was to iterate through the controls in theelement and reorder them so the site stylesheets were last in the control collection.

This gave the site sheets the priority they should have had. I did try using “!important”, but it did not work, possibly because I didn’t use as fully qualified a name as was specified in the embedded resource. And, retrospectively observing, having to use !important to get the style to stick means using !important again and again later.

Convert.ToInt32 vs CInt

This is a search subject I’ve done quite a few times in the past and never really found a good answer. I’ve found results either asking the same question and debate/bicker threads about the obsolete-ness of CInt, but none that describe the difference between the two. Plenty of “if you try to convert X using Y, Z will happen if you don’t W X first” that don’t give an explanation.

A recent epiphany finally lifted the veil on the question’s answer: Convert.ToInt32 (and the rest of the .ToX methods in the Convert class) is a method – CInt (and its relatives) are type-casting directives (similar to the C# syntax (int)x; or (string)y;).

The prime difference is the Convert class’ .ToX methods perform additional logic (as methods are wont to do) before employing a type-casting directive and returning the result. Disassembling Convert.ToByte in the .NET Framework library “mscorlib.dll” with Red Gate .NET Reflector supplies the evidence:

Public Shared Function ToByte(ByVal value As Integer) As Byte

  If ((value < 0) OrElse (value > &HFF)) Then
    Throw New OverflowException(Environment.GetResourceString("Overflow_Byte"))
  End If

  Return CByte(value)

End Function

This is the VB.NET representation of mscorlib’s IL for the method; if you disassemble this method into C#, the last line of the method reads: (byte)value;

The Convert class’ conversion methods employ a type-casting mechanism as they return their result. They also throw exceptions when the conversion could presumably be invalid. The difference here is that if you use direct type-casting (CInt, etc.) you may or may not get an exception when an employing them on an invalid argument.

I say “may or may not”, because the default setting for throwing Overflow/Underflow exceptions is different for VB.NET projects versus C# projects. In VB.NET libraries the default is to throw an exception when an overflow would occur and C# libraries default to the converse – in C# if you try to cast the integer value “10000” to a byte the result will be 0 and code execution will continue.

The following truth counters the argument/rumor that “VB.NET’s CInt and its siblings are obsolete”: CInt is shorthand for “CType(, Integer)”. CType is a necessary core construct of VB.NET and without it there would be no type-casting to be had for value types (DirectCast has a different intent so using it to cast value-types should be considered an abomination). There is no reason to believe the VB.NET language group would remove the shorthand because it is a carry-over from VB6 or outmoded or whatever other argument that might be made.

Why write “CType(someVariable, Integer)” when you can write “CInt(someVariable)” and save 10 keystrokes (35%). What a deal!.

Dear Winter of 2011-2012

Monday we got the first real snow of the season. It’s been in the upper 40s to lower 60s all season and it’s been real irritating for someone that actually wants snow. I’m ready to move further north where winter means something. Here in St. Louis winter is mostly just cold and wet. Some times there’s snow, but rarely of any significant quantity.

This season was predicted to be one-half mild and the other half severe. I’m not sure we’ll get the “severe” part. Monday was nice start, but today there was rain and warmer temperatures and it was all gone by the time I got home from work.

I love white winters. The landscape becomes so peaceful, quiet, and still when it’s covered with snow. This time, though… brown. Brown, brown, brown.

Someone call up Bing Crosby and ask him to write a parody of his own song. Ask him to title it: “All I’m Getting is a brown Christmas”

I Got Better

Better at finding things to write about, I mean, not the other thing (recovering from being turned into a newt). Well, not really… These next few posts come from thoughts that “just popped in there” to quote Ray Stantz of the Ghostbusters.

That’s another thing I find irritating about myself: I quote and reference and in-joke drop way too much (see above). Nothing worthwhile here; just a bunch or random stuff from the rest of The Intarwebs. Not going to be a rich and famous anybody without something original. Probably won’t be rich and famous for blogging anyway.

A coworker introduced me to an iOS app named "Flipboard". This thing is pretty nice. I stopped really spending time on Facebook, because I’ve turned into a producer of Facebook information rather than a consumer. Flipboard, however, may increase the consumption even over what the iOS Facebook app has.

The iPad version presents several feeds to you in a magazine-ish format (Facebook, Twitter, various other Internet feeds {customizable, of course}) and you can flip through at your leisure and each page is pseudo-randomly arranged with bits of content from the configured sources. I’m beginning to like it. If you’re an iOS device user you should check it out.

Is this the first time a post has gone out on time? I think so!

I’m Still Impatient

I still have a “microwave mentality” regarding growing a blog audience. I still expect one to appear overnight. Perhaps I over estimate friends’ interests in what I have to say. Facebook and Twitter seem to hide a few interested individuals, but I think I have more acquaintances that full on friends; people I know from that one time way back when. Hell, I’ve even become one myself – I hardly talk to my best friend anymore.

I think my desire for people to have an interest in what I have to say is still a part of my life I’ve been trying to leave behind: the part where I become rich and famous in a world where a man, on average, has only 70 years and the really lucky ones have 115. Contemplating that I’ve already expended half my lifespan is sobering. Having children of my own only reinforces the sobering truth that I am not going to live forever.

I “recently” played Neverwinter Nights 2 and a line from an early NPC has stuck with me: “Oh, I’m sure there’s a hundred Cormicks in a city like Neverwinter…” Meaning: Cormick (another NPC) is not unique in the world. Whenever I think I’m the first to have a brilliant idea I remember this line.

However, there is a second part to this line in the story: “… but for this town, he was as big as folks get.” I’d forgotten that part. Just because you’re not the first to ever have an idea doesn’t mean you can’t do it better than the other 99 out there.

Oh look! I’m caught up on retroposting again. Next update should be Friday. Here’s to fame and fortune!

Less Worry

I was thinking the other day about how much I worry about protecting my personal information (Social Security number and such) and how many times I’ve perhaps been a Paranoid Parrot.

For example, in the past I would have turned off location services in things like Google Maps or iPhone photo tagging thinking: “What if the government is tracking me?” or “What if my phone gets lost? Someone’ll find out where I live!” I even used to leave most of the contact information blank in my phone contacts.

I worry about little. Why worry? What good will come of it? You’re only making a hard time for yourself. I am reminded of Jesus’ teaching to His disciples in Luke Chapter 12 – He was speaking in the folly of worry and storing up things for yourself in this world (specifically verse 25): “Who of you by worrying can add a single hour to his life?”

Do not worry so much about the future that you become a Paranoid Parrot and do not enjoy the good things life has to offer. Do not dwell on material things, but enjoy your time with others. The relationships you establish here are worth far more than gold in Heaven.