Theme Change
Enjoy the new visuals.
Thoughts of a typist, er, software designer.
Before I hit you with the punchline, let's set everything up.
Read up on Factory Pattern and Dependency Injection, so you will get the punchline. If you are already cool with these techniques, please still read the story, and have a good laugh (I did)!
Okay, here's the situation: parents went away on a week's vacation... Oh wait, not quite.
The real situation was: I had to leave work by a specific time to be home by a specific time, etc. Meanwhile, a coworker calls and asks me if I'm ready to demonstrate that User Interface Prototype hitting the Web Service for that 4 o'clock meeting! I was way ready, but I'm like, "Was this on my Calendar?" and of course it was not on there; Nobody hipped me to that meeting, dude.
Are we there yet?
So, no problem. I will take my rig home and get on VPN access and we are golden.
Except for one thing....
It was so fucking slow on the VPN link to the virtual hosting my remote service that everything was timing out all over the fucking place!
On the upside, I'm glad I was able to test for latency; put timeouts at the top of the list for The Very Next Day.
On the (very) downside, there was only 15 minutes before the start of a 21-person conference call! Out go the "I'm Panicking!" emails to my teammates, as I look into searching for some help with the settings, then determine I'm too panicked to try to deal with it, since the actual timeout would still need to be discovered, and the default 60 seconds was already timing-out.
Are we there now?
We are here now. That's when I remembered the main parts were interface-based, and the class name of the implementation was specified in the configuration file. I simply switched to my debug implementation, with 5 minutes to spare, then sailed through the Demo! You all have one of those, right? Right? Right?
Obviously, the punchline is: It will save your ass in a demo!
Simply kill all of them!
Dear CIA: What the fuck are you waiting for? You know who they are, and you have a Black Ops division. Don't make me connect the fucking dots for you!
Ok, don't want to do that one, how about this:
Dear CIA: Get your asses down there, and "explain" to these people that they are now paying tax to US, or they will start mysteriously disappearing. Again, Black Ops to the rescue!
You can be sure we are doing similar things with Other Bad People, how about focusing the laser on on people who can cross our borders by walking over!
at 12:18 0 comments
Labels: death, failure, horror, rant, uncertainty
I'm sorry but this was spontaneously funny, and I'm behind on posts....
Our company has some software that we demonstrate at trade shows, and the demo's theme is Golf-based; it makes use of golf equipment to lead prospects through our software's features.
Show Time is approaching, and our Sales Lead was in the office across-the-hall, and exclaimed
We Need More Balls!
Of course he meant Golf Balls, but the innuendo was so good, my office-mate and I burst out-loud laughing. Our Sales Team does need More Balls (sales is down)!
at 10:30 0 comments
By way of a current project, I have had to revisit territories that I hoped were long since Gone and Forgotten.
A land of explicit lifetime management, raw pointers to everything, pointer arithmetic, and variable-length structure layouts that make your head spin off its axis!
Of course, I am talking specifically about C++ and unmanaged code interop ala Visual Studio .NET.
It's been a looonnnng several weeks of dual heaps, pinning pointers and accessing other arcane compiler directives and keywords that can only exist in This Universe.
Want to convert a managed Unicode string to an unmanaged buffer of ANSI characters? Good fucking luck! Obviously possible, but for some reason, there's no one-liner to call for this exteremely common interop task. Just for reference, here is what I ended up with:
void convertStringTo(System::String^ str, char buf[], size_t buflen) {
if(str != nullptr) {
pin_ptr wch = PtrToStringChars(str);
size_t convertedChars = 0;
wcstombs_s(&convertedChars, buf, buflen, wch, _TRUNCATE);
}
}
Many "published" solutions used a scheme that allocated a buffer for the ANSI part using Marshal.StringToWhatever(), but this is just one more piece of IntPtr lifecycle bullshit to manage, and you are shit out-of-luck if you want to just put them into a char[] buffer, aside from a stomach-turning extra buffer copy.
The good news is the other primative types box and unbox like butter, once you know the secret:
Object^ value = ....; Double^ sx = (Double^)value; double dx = *sx;
Much less painful. Here is how you can use a managed buffer with unmanaged code:
array^ bufx = gcnew array (BUFSIZE); ... pin_ptr buf_p = &bufx[0];
That's some awfully strange-looking C++, if'n you ask me; but then again, look at the universe we are working in!
So this is only a pseudo-rant, then?
So don't forget to keep your power dry, and all of your punctuation in order! If you can do that, this stuff will get you back on the Long Road Home in no time....
at 13:01 0 comments
Labels: .net, horror, rant, unmanaged code
I almost forgot I registered over at Blogged. I say almost, because now I am getting emails from them indicating I have people following this blog from there.
The more the merrier! Tell your friends. Then they'll tell two friends, and so on, and so on, and so on, and so on.
at 15:12 0 comments
Look, this is humor, so put away the flame-thrower! Just have a laugh and go on your merry way....