Random header image... Refresh for more!

Had fun working for our State.

Glenn Beck and me hiking down to Walla Walla to stop Medicare cuts – I told them. They renew me.

Former Secretary Salazar suspends adoption of Arizona. Had fun working for our State.

Well, time’s up.  Have to put this on hold.  It didn’t work out quite as well as I’d hoped, but it was still fairly entertaining.  I might have to come back to it later and see what else can be done.

And so, I leave you with the immortal words of Ronald Reagan: ((They’re his words…  Just not necessarily the order he ever used them in.)

America must stand by and see it in a pile of rubble.  It was fought by children planting victory gardens and collecting cans. Well, now we’re in another war for our economic recovery and, finally, on a suicide mission.

September 6, 2010   No Comments

Facing Reality

These are proposing this generation of destiny.

Time is the enemy here.  I did not devote enough time to this project and now I have run out.  There are time-sensitive things I need to be doing, and this project is, unfortunately, not one of them.

Leaving time aside, there are other issues which stand in my way:

  • Using the Twitter API to post causes your tweets to be tagged with your application name.  Given that my application name is not “Web” or “iPhone App”, having them tagged with an application name is going to be a tad suspicious.
  • The gibberish generator is producing gibberish.  While I expected it to be nonsense, for the most part it is not even coherent by the standards set forth by right-wing lunatics.  I did anticipate this scenario and I have some ideas on how to mitigate this problem1, but I don’t have time to implement any of them.
  • 140 characters is way too limiting.  Way way way too limiting.

I’m giving myself two more hours to make some adjustments and tweaks, then I’ll have to leave the project where it is.  However, if you want to get technical, I’m suppose to have five full days dedicated to a Crazy Weekend Project, and if you sum up the elapsed I’ve spent on this one, it’s probably only a day’s worth of that time taken.  So, I should theoretically still have about four days of time remaining, which would allow me to put this on hold and come back to it at a later date, if I choose to do so.

  1. I have a book sitting right here that gives the Dijkstra algorithm and another one that talks about neural nets… []

September 6, 2010   No Comments

Fatal Error: ‘happy place’ Not Found

Fatal Error: ‘happy place’ Not Found
User Stability Corruption Detected.
Details Follow:

Secondly, what are the two last ways. An apprentice is scarce capable of being told by Ulloa, was, not many years of the rest of the goods of equal quantities of labour than the prices of things in ancient times. The ordinary average price of his lands which are not very well be supposed five hundred pounds stock is necessarily hurtful to the assistance of a bloody century plagued by a more extensive ones than they are gone, the number and value of silver, Tower weight, and something was wrong came when the chief magistrate of any particular country promoted by the piece.

Well, it’s true, Lebanon is a clog which, for the beginning were probably in those countries, such as would in this case, would still be some very loose, and, therefore, more disposed to represent it as equally upon people of good credit at three. The wages of common currency. A thousand guilders of Amsterdam brought from the hands of a revenue; from maintaining so great a public teacher; but the meaning of the causes of the colonies, to which it can maintain. A large share of the whole value of that part which, though sometimes violent and very independently, but must overflow. One million we have cut the use requires. Were they ever oppress it. But in this respect, as well as a very important passageway for our men are fond of calling parliaments, and of surmounting a hundred and four pence in the payment of certain goods, would diminish very much upon the stocks, which they expect their fortune, if one may say so, the employment of such debts only as an assignment, from the confidence of their own expense, or at most a hundred people (for some of the United States. They shall in any Department or Officer thereof.

Secondly, The monopoly of their industry. Were there no public institutions and those who are generally as cheap, and gold still seldomer. But though it could not afford this large interest. The banker, who gives him a certain number of independent newspapers, prefer government to raise their price may very safely be trusted entirely to decay. Of the Advantages which Europe has been accustomed to consider themselves as the poor and beggarly, pretty much in arrear to their jurisdiction.

Lorem ipsum dolor sit amet.

Lorem ipsum dolor sit amet.

Lorem ipsum dolor dit amet.

September 5, 2010   No Comments

BEAT DOWN TIME

They’re redeclaring the same variables throughout the sample, but there’s no indication of a method break.

Grrrrrrrr.

They put literal strings in a function call where you’re supposed to provide a variable.

Grrrrrrrrrrrrrrrrr.

THEY HAD TO GO OUT OF THEIR WAY TO MAKE THIS EXAMPLE THIS FUBARED.

GRRRRRRRRRRRRRRRRRRRRRRRR

Excuse me just a minute here.  I have to recenter my emotional state and channel my frustrations and negative energies into restoring balance in my soul and finding my happy place.

September 5, 2010   No Comments

var-y annoying

I want to smack people who use “var” all over the place in their code.  Particularly in their example code.

I AM NOT A COMPILER.  I DON’T DO TYPE INFERENCE.

September 5, 2010   No Comments

And now, the catch.

There’s a bit of a problem with this project that I didn’t quite realize when I started.  It takes a while for the magic of the text to real-

I think I’m going to have a problem with this project when it comes time to post the text to Twitter.  You see, the generated text tends to-

Ah crap.  Looks like I have to say it in some other way…

Twtr: 140 chrs sux.  !¢s = 2big.  fml

September 4, 2010   No Comments

Um. No.

for (int i = 0; i < PrefixLength; PrefixLength++)
{
     prefixQueue.Enqueue(EchoToken.TerminatorWord);
}

Oops.

September 3, 2010   No Comments

‘COMPATIBILITY’ is undefined

At work, I’m currently spending most of my time developing an internal webapp.  It’s the first significant work I’ve done in ASP.Net MVC and JavaScript, so it has been a great learning experiment.

Yesterday, I added a feature that involved JSON serialization to carry data on a round trip from the server to the client and back.  The feature is fairly straightforward:  The server writes one of its data objects to the page as a JSON string, which lets the JavaScript on the page interact with the object.  In response to a user action, the page will package up the object in JavaScript, turning it back into a JSON string, and pass it back to the server.  It feels like a bit of a hack, but hey, it works.

It works in some browsers, that is.  To get the object back into JSON format for the trip back to the server, I was using the method JSON.stringify(object).  The JSON object is apparently natively supported by IE8 and FF3.5 (And maybe Chrome, although I didn’t check), and since the target audience of this internal tool is already using one of those browsers, I don’t have to worry about compatibility.

Before checking into our CI system, which will deploy the code to a testing server, I run it locally.  Works fine in IE8.  Works fine in FF 3.6.  Everything’s happy.  SVN Commit and continue working.  If it’s working HERE, it’ll work THERE.

Or not…

About an hour after I check in this change, I go take a look at the testing server to verify a couple of unrelated changes.  I click on a link and I get a JavaScript error.

'JSON' is undefined

Um…  Excuse me?  I’m using IE8, which I know has a native JSON object.  It’s one of the things they brag about adding in IE8.  It’s there.  I know it’s there.  This worked just fine when I’m running it on my box, and it’s not like there’s some file I forgot to deploy that could cause a native JS object to disappear.  It has to be there…

So I try it in Firefox.  If something went wrong with the deployment or the testing machine, it would be broken in Firefox, too.  Of course, it works fine there.

I scour teh Intarwebz for help related to this error and find nothing useful.  Most of the advice is “Well, did you include ‘JSON2.js’?”, which is a file I’m not using and don’t need because JSON is a native object now.  It has to be there…

After wasting about an hour trying to find a solution, I performed my favourite problem solving manuever:  Throw away everything you know about the problem and start from scratch.  The branch of thought I was on before didn’t get anywhere, so it was time to explore a new direction.  In the initial search, I was looking for a solution to the “JSON is undefined” problem.  But maybe that’s not the problem.  Maybe that’s just the symptom of a different issue.  So now, I have to find what the problem really is.

  • Did the code not get checked in right?  The code is fine.  Nothing’s left in pending changes.
  • Did the JavaScript not get deployed correctly?  The deployment is fine.  All script files I have locally are on the testing server.
  • Have I ever come across anything like this before?  Yes.  IE’s security settings will treat intranet sites differently than Internet sites.

IE security settings…?  Well, that’s easy enough to check.

I go back to the page and change the server in its URL to be the fully qualified internal domain name for the server, not just the name of the server itself.  Hit the link…  Hey, it works!

So…  IE security settings, perhaps?  I consider simply ignoring the problem and telling everyone who uses this app to access the server with the full domain name, but quickly realize what a stupid solution that would be.

Why would this be a security setting, though?  Whenever I’ve run afoul of IE’s security model, it’s because I’ve been doing something that IE thinks could potentially be a risk to security.  It rarely is an actual risk (Unless trying to expand and collapse nodes in an XML file is risky in ways I cannot fathom), but there’s usually some semi-rational reason for blocking an action.  Killing the JSON object isn’t rational.  You can’t do anything with it that you couldn’t already do in JavaScript.  So why disable it?

And that’s when I noticed something.  On my localhost page, there was that little “broken page” button next to the address bar, but that button wasn’t there on the testing server.  WTF?  I didn’t force compatibility settings on the testing server, so why is that button missing?

I open up the Compatibility View Settings dialog and I find this inside:

“Display intranet sites in Compatibility View” is checked BY DEFAULT.

So, Compatibility View is what makes your browser act like IE 7 because so many websites out there were hacked together to work in IE6 and 7 because that’s whate everyone used.  As you may know, IE 6 and 7 were a bit wild when it came to rendering things, prefering the cowboy way of going it alone and doing what feels right, rather than, you know, attempting to follow standards.  When IE8 came along and fixed a lot of those issues, it meant that some poorly designed older pages looked like cat vomit.  So, Microsoft put in the Compatibility View button to make the pages render like they did in IE 7.

That’s all well and nice, except that A: They turned it on by default for intranet sites, and B: It’s not just rendering.  This is important, because I had no idea about this until yesterday.  Compatibility View also rolls back the JavaScript engine in IE to the previous version.  So…  No more JSON object!  Poof!  Gone!

DAMN YOU, IE6.  I’M NOT USING YOU AND I’M NOT EVEN DEVELOPING TO SUPPORT YOU AND YOU’RE STILL MAKING MY LIFE HELL.

So, what did I do?

<script src="Microsoft.Ajax.js" type="text/javascript"/>

That has its own JSON object in it and made my problem go away.  It’s a cop-out, true, but I don’t really care.  I’m trying to write an application that has absolutely nothing to do with stupid default compatibility settings and JavaScript engines and all that other nonsense.

August 18, 2010   4 Comments

Well, that was fun.

The more complex a system becomes, the more interesting it is likely to be when a catastrophe strikes.

Take, for example, a cup of water on an empty table.  When the cup gets knocked over, the water spills out on the table and isn’t terribly exciting.  Let’s replace the water with some Hawaiian Punch.  Now you knock it over and you get a red pool on the table and a red stain left behind once you clean it up.  See?  More interesting.

So let’s add a bit more to it.  Like, say, a computer.  You know, keyboard, mouse, tower.  Stuff like that.  And speakers.  And a rat’s nest of cabling to connect it all together.  Change the table to a computer desk.  Put a nice light colored carpet underneath all of it.  We can’t forget the power strips on the ground behind the set up, either.  And, oh yeah, a slight incline making the desk higher in the front.

Now tip over the cup.

The mouse pad, keyboard, speaker cable, and tower effectively contain all of the liquid in a small space on the desk.  Nothing spills out the front, nothing spills out the side.  However, let’s not forget the incline.  The incline causes what would be a containment fence on a level surface to become a funnel, which swiftly and efficiently drains the pool of sugary liquid through a narrow space between a section of the desk and the computer tower, and out the backside of the desk, where it produces a red cascade directly onto the rat’s nest of wiring, the power strips, and the white carpeting below.

Yeah.  That was -AWESOME-  You just can’t anticipate that kind of failure.

April 17, 2010   No Comments

Achievement Unlocked: Big Truck Of Fail

That’s it.  I’m calling it.  This Crazy Project Weekend is over.

And it’s a big truck of fail.

The biggest problems are the motors.  They just don’t do what I tell them to do.  If they did, this would be a different story.  But I’ve spent over three days tweaking the motors and the robotics and I just can’t get it working.  Maybe I can get a Stelladaptor and try tweaking it with direct feedback.  Maybe I’d be able to do continuous smooth motion if I could have tracked all the bombs properly.  Maybe I just don’t know what I’m doing.

At least I was able to identify the playfield elements and get the computer to tell what the next move should be, even if I couldn’t actually get it to make that move.  The basic recognition and logic was a lot easier than it was for Pong, mainly because trajectories didn’t really matter.  However, I wasn’t quite able to get the bomb tracking/prediction logic working, which would have reduced the tendency for the robot to get distracted temporarily and miss a bomb.  The full tracking also would have made it possible to detect patterns and move smarter.  I also get the feeling that there’s something already in OpenCV that would have taken care of the object detection and motion tracking for me.  That library is so big and I’m not a computer vision expert, so I don’t really know what’s there or how to use it all.  The book and the documentation aren’t always enough.

And then that virus.  Stupid virus.  Make me waste half a day because the bloody computer stops working.  THAT WAS AWESOME.

The segmented auto-calibration thing did work.  I was able to adjust the robot power and swap out gears and the calibration generally figured out the new pixel/degree ratio.  If the motors were more consistent, then it probably would have worked better.  At any rate, that’s a decent technique that I’ll have to remember for the future.  And I’ll have to clean up the code for it, right now it’s kinda messy.

In the end, I did not accomplish what I set out to do.  The best score the robot ever got was 63, and that was a fluke.  And I didn’t even get close to trying to get it to play on a real TV.

March 1, 2010   No Comments