And now, something completely different

by Jesse 28. March 2008 03:35

I was recently involved in a rear-end accident (I was hit Yell), much to my annoyance.  My newer car, which is a 13 year old, 2 ton _car_, not these roller skates you people call "economy cars" is part of the family.  I treat my car like a child, its my baby, so having a very large, glaring imperfection such has 2-3 feet of bumper scuff on my car was unacceptable -- consider it like your child bringing home a D and 2 Fs, same feeling.

I'm not saying the car is perfect, not in the least bit (the interior however, we can argue that) -- I had been nudged a few times here and there, someone tried to steal it once, but nothing major (these things disappear at 10 feet) ...except my hood.  I had a "bald spot" on the hood pretty much since I got it and it, like a bald spot, grew as the years went on.  It was that one thing that everyone would say "hey nice ca ...ooo, whats this?" Cry Well, I went and got the estimate for the rear bumper, passed it on to the insurance company, got the OK for it and when I took it back, asked how much for the hood to get painted to.  Hoods are easy -- easy to take off, hang, paint, bake, put back on so it wasn't a whole lot and we agreed on a fair price and I got my car back last night.  Before we more forward, let's talk about the rental...

For a rental car, they first offered me a Sentra.  Uh, no, for those of you in the wild, I'm 6'8, that will not work.  The biggest thing they had was an Ultima - a 2008.  Ok, fine.  The guy brings it around.  The car doesn't have keys, at all (ok, there's one hidden), its all operated by this key fob, which is cool, I'm kinda geeked about that.  You walk up to the door, push a button and "beep" it lets you in, sit down and press the break, push a button, the car starts and your on your way. The guy tells me "you can just leave the fob inside the car" to which I replied "You have no idea where I live do you?" -- not leaving the fob in the car.  I drive this thing and it ain't all bad - overall I liked it (but would never buy one).  But I digress, I need to go right into the complaint deparment because there's a couple things that drove me insane about this car.

1. CVT transmission.  Glad I expereienced it in a "I didn't buy this" way because I HATED it with a passion.  Yes, when you accelerate, you always are at this magical 3200rpm range and continue to accelerate, that's great fine and dandy _BUT_ ...and thats a full, wholesome but... I want to know that the car is IN GEAR when I hit the gas.  I want to feel a slight step, a kick.  Let's be honest, it IS an Ultima and doesn't have the same engine mine has but good god, make me feel like it's trying when I want to get on the highway or pass someone.  One thing they DO have was a mpg gauge (nothing new, my 96 has one - and I think mine's cooler and yes I'm biased) and you'd notice if you were to accelerate with traffic, 5mph over 15-20 seconds, you'd see the mpg thing go ALL OVER the freakin place.  It gave me the feeling of a failing transmission that's hunting for a gear or a bad position senor that didn't have a clue where it was.  Yes, the transmisson was suffering from dementia.

2. Power steering.  I understand this is a mainstream car, but I expect the wheel to be able to hold the weight of my thumb.  The thing was psycho sensitive leading me to believe it does NOT have speed sensitive steering.  If you ever drove an older truck at highway speeds, it feels EXACTLY like that at ALL speeds.  I can't blame that on break-in or "new car" because yes, the brakes were touchy too but I expect that, but not this overly sensitive, soupy feel of the steering wheel.  I want the damn thing to be SURE I'm moving it and not a fly fart.  I'm sure there was quite a few people that were saw me "jerk" the wheel and thought a mental patient was behind the wheel ...well maybe there was but regardless, its way too disconnected-feeling.  Gave me 0 confidence in the car.

In all fairness, I'm super critical of cars.  Most people won't even notice that kinda stuff, but I do, I'm old school in how a car should be (v6 or bigger, rear/all wheel drive).  So back to my car.  I go and turn in the rental, hit the service counter and talk to the nice lady to get my car back, pay the big chunk of cash and she says they can pull the car around -- Nope, I'd rather go find her.  So off I go and my car's sitting out at the end of row 7 (theres 8-9) and I can see it from the other side of the lot.  Like a kid at christmas.

The blad spot is GONE, the bumper is imperfection-free and ah is it nice.  I noticed immediately my rims are bright and bling-blingy -- they detailed the bejesus out of it, inside and out.  The scuffs around the car are GONE (buffed out, dude's got skillz) and I was reminded why I love this car ...that and its paid off!

If you need some body work done, I would recommend Tom Hicks over at Graham Ford.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Design | Automotive

VBscript (don't puke, you'll like this one)

by Jesse 26. March 2008 07:01

"Back in the day" I use to do net admin work -- had a nice little network running that had taken a few years to get up to date.  One of the things I discovered was the magics of WMI and vbscripts.  During this time, I began writing scripts that did ...pretty much everything.  From mapping drives to doing inventory to diagnostics, I had about 50 scripts that did almost everything I needed to do on a day to day basis.

One super cool feature was using microsoft's speech, which has been available in WMI for a while now (I remember it working on win2k).  This allowed an audio warning of sorts to be conveyed to the user if necessary.  Realizing the possible terroristic evilness just to screw with someone interesting nature of this, I wrote a script for a friend of mine that has a teenage daughter that was having problems keeping her on task ...I was happy to help fixing this problem.  Before we get into that, lets take a quick look at getting to things in WMI.

No surprise,  I used google for most of my scripting adventures.  "<some kind of process> vbscript" yielded most pages that I could piece together what I needed.  Consider that the quick and dirty way.  So what's WMI anyway?  Windows Management Instrumentation -- in english, if you can do it with a mouse/keyboard in the OS, you can do it WMI ...and more.  Using WMI is stupid easy.  No complier, no drama (built in!)  Got notepad?  Good, that's all you need.  Open up notepad, copy/paste this, rename it with a .vbs extention, double click and check out your message box.  You need admin-ish rights for this to work (and you CAN enter "localhost" in the textbox)

Ok, big deal right?  Create another file, name it "voice.vbs" and paste this into it.

set objVoice = CreateObject("SAPI.SpVoice")
objVoice.Volume = 100
objVoice.Speak "This is the coolest blog ever!"

Save it and run it.  Have fun with that and yes it does a nice job pronouncing things.  And if you can figure it out, IF you have admin rights to a box on the network ...figure out how to make this work with the voice.  It can be done, but I'm not telling you how -- because its possible uses are just outright evil ...and a great source of entertainment!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Coding

Code Generation - SQL insert statements

by Jesse 19. March 2008 06:08

Need to generate some insert statements for Sql?  Craig (...no link? oh wait, no BLOG, wth?) suggested this and he's used it quite a few times.  I'm a fan of being lazy (but no blog?)

http://vyaskn.tripod.com/code/generate_inserts_2005.txt

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Sql

Selenium revisited (web testing in general)

by Jesse 11. March 2008 04:41

One of the magic's of the internet and more specifically, blogs, it puts you in touch with people you'd NEVER otherwise talk with.  I recieved a comment on my Selenium and the Kiss Theory from InCisif.net suggesting their Web unit testing.  Initially, I denied the response and asked for a more detailed comment as to why and explain how their product is better in x, y, z for reasons a, b and c -- Here's the response I recieved... 

Generally I avoid saying things like "I believe ours [product] is better in x, y and z for a, b and c reasons", making a good case will take a long paragraph, and it is just my opinion and I am bias. Anyway,  here is my case.

Selenium is the only automation tool under $1000 that support cross browser testing. And If you absolutely need functional cross browser testing, Selenium and Selenium RC (remote control) are good choices. Selenium comes with some weaknesses that are due to its architecture that allow cross browser testing (Speed of execution, installation of the Selenium Core on the server).
 
If you are more interested in implementing a lot functional testing, focusing

  • On the speed of development
  • The speed of execution
  • The quality of the IDE and debugger
  • Having a direct access to the DOM
  • You have to support only Internet Explorer or you will address the others browser manually

You could chose between Watir, WatiN, TestComplete or InCisif.net.

If you want to develop your automation in Ruby, then you will choose Watir.
 
If you want to develop your automation in DelphiScript, VBScript or JavaScript, then you will choose TestComplete.

If you are more .NET guy and want to develop in VB.NET, you probably want to look at our product, because we are committed to support VB.NET and C# to the same level (Selenium IDE does not support VB.NET, WatiN focus primarily on C#).
 
Here are some of the some differences between WatiN and InCisif.net.

By the way why do I known so much about WatiN, because I was been using it since January 2008 extensively on one web development. I think WatiN is a very good product. And I have been chatting with the author Jeroen van Menen via email.

InCisif.net has a more advanced record mode than the WatiN recorder. WatiN recorder is little buggy and still not mature. Here you must try for yourself (see our screen casts at http://www.incisif.net).

Web automation testing is not about dummy capture/replay, but a good code generator (AKA record mode can save time). See our screenshots.  Our record mode support: C#, VB.NET and IronPython.

InCisif.net has a tracing mode that allows reviewing the execution of tests. Making easier to find where exactly a test failed.

( full sized image here InCisif_net_Trace_File.jpg (466.08 kb) )

InCisif.net API to look up control is based on what we call the “HTML Control Naming Algorithm”, documented in our help file. 9 steps to determine what is the best information to identify uniquely an html control. Used at record and run time.

WatiN also as a pretty good API, but the record mode does not know how to use it.

When accessing an html control WatiN uses the type of the html control for example : 

ie.Link(Find.ById("LinkButton1")).Click();
ie.Button(Find.ById("btnSubmit")).Click();

Incisif.net uses the following syntax:

Page.Control(“LinkButton1”).Click();
Page.Control(“btnSubmit”).Click();

If the html control changes from a <button> to a <div> Incisif.net code will still work.

WatiN API is a little bit faster than InCisif.net API. Our 9 steps algorithm and our tracing feature have a cost.

I was not able to get WatiN to work with the NUnit 2.x GUI Application. InCisif.net supports NUnit, but also comes with its own test framework including a UI, similar to NUnit, but we added the concept of parameterized test (see here, here and here) and the concept of Test Dependency, very important for UI testing (see this link)

InCisif.net has some special features at record time and runtime to deal with the ASP.NET I'd like “ctl00_ContentPlaceHolder1_butCreateAccount”. See the blog we also have a screen cast about it.

InCisif.net can use some of the C# 3.5 LINQ features and some of our API can use Lambda expressionThat is not absolutely required to program web testing, but is kind of fancy.
 
InCisif.net supports to start and stop Cassini, the web server that ship with ASP.NET 2.0. 
Very usefull.
 
Other features from InCisif.net

  • Reporting API, XML report, HTML report about the tests and test suite execution.
  • Grab Screen shots when an assert failed or an un-expected error is raised.
  • Email notification of the HTML suite report. Attached in a zip file: the xml report, the text trace file and the screenshot grabbed in case of errors.
  • WatiN may support FireFox in the future, InCisif.net may support testing SilverLigth 2.0 application.

Pricing: WatiN is Free. InCisif.net is not, but we are about to reduce our price to $99 a license. We will also offer to license the source code later this year.
If you want to develop applications using InCisif.net and distribute them, we have what we call InCisif.net Run Time For Application which requires a simple files copy to install.
There are royalties between $25 and $50 per install based on the quantity.
 
Jesse, let me known what you think.

Frederic Torres
www.InCisif.net
Web Testing with C# or VB.NET

I think this week at home I'm going to take a look at this - Frederic was nice enough to send me a personal key and I just so happen to have a few sites I could use this against.  More to come on this, no doubt.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

.Net | C# | VB | Testing

My TreeView ate my TreeNodeCollection

by Jesse 6. March 2008 10:38

I seem to always come into contact with these "We hate you!" type errors, and this one is up there.  Took me a while to figure this out, Humor me.

Open up a new web project, create a short number of nodes as such...(sorry its in VB)

Dim Master As New TreeNode("Master", "1m")
Dim Node1 As New TreeNode("Item1", "1p")
Dim Node2 As New TreeNode("Item2", "2p")
Dim Child As New TreeNode("Child1", "1c")
'add child node to node1
Node1.ChildNodes.Add(Child)
'add node1 and 2 to Master
Master.ChildNodes.Add(Node1)
Master.ChildNodes.Add(Node2)

Ok, got that? Now if you tag this into a treeview, you get this kind of display...

Master
- Item1
  o Child1
- Node2

Which is great, but what if you wanted a tree of JUST the children items to Master? so it would look like this...

Item1
- Child1
Item2

How would you do that?  Use some kind of loop?  How about trying TreeView1.Nodes.Add(Master.ChildNodes) (bernt, one's a collection and the control only expects a single node)? I decided to use the Master.ChildNodes and try a foreach loop -- surprise, and recieved this error. 

Index was out of range. Must be non-negative and less than the size of the collection. 

Hu?  My code isn't complicated, so what'd I do wrong?  I move out my Master.ChildNodes into its own collection, "nodes", slightly refactor and check my logic.

For count As Integer = 0 To nodes.Count - 1
    
Me.treeView.Nodes.Add(nodes(count))
Next

yep, I'm starting at 0, minus one off the collection count -- thats lining up, makes sense so I run the code, check the count, yep its 2, thats good

I'm thinking at this point maybe I'm counting wrong, maybe it IS 1 based, so I step into the next and see this

Wait ...hu? Why would it REMOVE an item from my collection when I add it to the treeview?  What if I wanted that for multiple places?  This doesn't add up.  So, let me ask the question -- WHY is it doing this?!  If you switch the Me.treeView.Nodes.Add(nodes(0)) it'll build just fine.  I just don't get it.  With other things like lists and the like, you can rip though those things and pull only what you need into whatever and it does not remove stuff.

Can someone try this and see if you get the same thing?

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net | Coding | Weird | VB

DAL

by Jesse 3. March 2008 10:14

I've had the pain joy opportunity to work with Subsonic, Linq, NHibernate and good ole ADO.  The only one I haven't got to mess with yet is that new MVC thing.  My girlfriend, god love her, asked an amazing question - "What's the difference?  Don't they do the same thing?" Er ...yea I guess they do.  They all write to a database of some kind, somewhere.  So what is the difference?  Well, based on my humble experience, this is my thoughts on each.  Sadly, I don't think there's a clear, big time winner, but there are some that are somewhat better than others.  This'll be a general overview with not a ton of tech detail.

Subsonic is the latest thing I've had to use.  It's very Linq-ish, but not exactly.  Subsonic generates classes for you based on a command line executable and from there, you get your basic goodies, update, save, delete, -destory- and other things.

 

A nice touch to this is three things, 1, all classes generated are partial classes so extending them is uber easy.  Just keep your namespace the same and you'll have NO problems expanding the class to do other things.  2, overloads of some items, such as "Validate", which by default confines to the table/column definition like "must be varchar, cannot be null". 3, if you have a "IsDeleted" column in your database, or "LastModified" ...when you call <entity>.delete(), IsDeleted goes to true and LastModified gets updated too.  4, the "Query" object is cool, I like it, you write various statements that append to your query for different situations (say, if you get an ID back that's greater than 0, that means you should go try to find it) and just do query.AndWhere("

and this magically paging feature.  My page index is 3 (I'm on page 3) and my page size is 20.  Done and done, no drama (makes repeaters easy to work with in that regard)

Of course, there's a few catches.  Joins are ...a royal pain -- creating views seems to be the best work-around (which are picked up by the code generation) and -any- change to the database -requires- a regeneration of the classes.  So if someone changes a column to a bit field, annddd you run your code without the new bits, kaboom.

Loading data is very easy, <Entity> entity = new <Entity>(Id) along with collections, for example <EntityCollection> collection = new <EntityCollection>.FetchAll() and it does bring back related data (database relationships).  Overall I like it, the learning curve is short and does its job with very few surprises.

Linq I've been using in my chapters in tandom and writing up my own little app using Linq.  Linq is part of the .Net 3 framework meaning "its built in!", no extra downloads but you do have to download the extension for VS2005.  Within Vstudio, "Linq to Sql" and you're well on your way.  Drag/drop the tables you want, save it, you've got your entites.  These are also partial classes, so extending them is easy.

Linq also introduces a new ...thing called "var".  Consider var your container for ANYTHING you'd want from your database.  Syntax goes something ...like this.

Product now becomes like an instant database collection with a bunch of really slick stuff on-tap as shown below

One of the advantages with Linq is its built into .net 3 so additional references are not needed, everything's in the GAC.  Second is that anything returned can be used like a database on tap -- don't like your results?  Need them filtered?  Do it right there on the spot if you want.  I think that's huge and uber flexible.  Another thing is more or less SQL like queries are used to get your data so the structure is familiar (just slightly out of order).  And Jon's a big fan -- that counts for something right?

Disadvantage, like SubSonic, every time you change the database, its time to go regenerate the classes (only this time you get to use a GUI!).  Also misuse of var could get nasty.  I've read a few warnings on this, but we're all smart devs, we'd NEVER do that ...right?  I tried to find the post I was thinking of ...can't find it.  Oh well. 

Part two I'll cover NHibernate and ADO because this got a lot longer than I suspected (2-3 days on and off)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net | Design | Architecture

something very disturbing

by Jesse 1. March 2008 16:04

For those of you who don't know me very well, over the past few years I have come to appreciate the right to bear arms.  I had a friend of mine who grew up with them teach me how to clean them, how to shoot them, how to handle them propertly, how to "check a weapon", shoot safely (I'm not the best shot though...) etc.  I learned how to do things by the book since it -IS- a clearly dangerous device.  Today while at a gun shop, I witnessed something that made me VERY uneasy.  A little background, this place I was at is NOT a dive, not shady, not on any level a place you couldn't take anyone.  It's a general hunting/fishing place.  Also another disclaimer, if you don't care about any of the following topics, ignore this post - guns, laws, government, politics.  Still reading?  Good, I think you'll find this interesting.

In order to obtain a firearm, a background check must be done, and they check for the obvious stuff -- no felony convictions, no mental problems, no domestic violence cases outstanding, no illegal drug use, etc.  This can be done VERY quickly, usually within a few minutes with a call in to the feds.  I use to work closely with the "other end" of law enforcement with my time at the Attorney's Office and I was lucky enough to understand and detect (although this isn't rocket science) those that are under the influence of various controlled substences (crack/cocaine, LSD, X, marijuana, etc) and immediately noticed that one such symptom was being broadcasted by someone across the counter.  No, I'm not kidding, at all.

The person in question had bloodshot eyes, pupils the size of golfballs and slightly ...I wouldn't say frantic but very "switchy" -- he'd been doing crack/cocaine at best 24 hrs ago (probably earlier that morning).  I watched this guy intently, listening to his conversation.  He says his son had taken his other gun, got arrested (hu?) and the police took it and wouldn't give it back until he proved it was purchased legally.  Ok, at this point, if EVERY SINGLE red flag in your head isn't goin off, I can't help you.  He then explains to the clerk, and I can't believe this, that he was serious about buying another gun as well as getting his proof of purchase.  The guy behind the counter showed him a good, well made weapon, at a cost around 600$.  If you've ever looked, 600-800 is right around what you'd expect for a good, quality gun (in this case a brand new Beretta 92 9mm) -- I paid 600 for my first gun (not a Beretta), USED -- he didn't want that.  Then he was shown another, a nice Glock with a price tag around 500-550.  He didn't want that either.  The ...um, clerk pulls out the cheaper gun (I'll refrain from saying what kind, I don't like 'em, I think they're crap) for 350 in a 9mm.  He was more interested. 

Now mind you, during this entire exchange, the clerk is NOT handing the person the gun, at all, he WILL NOT let him touch it which is a clear indication that he (the clerk) has noticed "somethin' aint right" -- every time I, joe citizen, go in and ask to see one, I am presented the piece, regardless of cost, checked (verified no bullets in the gun) and handed over as if it were a priceless piece of jewlery, typically with some discussion of the given clerk's experience or the other clerks in general, safety features, etc.

At this point, I'm very much "not cool" with this particular person.  Even idiot me can pick up this guy is on something and the questionare you MUST fill out asks specifically if you have used something he clearly has (which is a felony!).  I motion one of the other clerks over and express my concern.  Almost unbelieveably, he says "Oh I know, happens all the time, but we can't stop them from buying any gun they want, it's their right just as much as it is yours, and we aren't cops -- we just can't do anything about it, we'd get the pants sued off of us".

-long pause-

<Sigh> He's right.  So on monday I'm thinkin' I need to make a few phone calls, most noteably my friend thats a judge, see what she thinks.  I know there's some circumstances where this guy could've had a good reason for it.  Regardless, I, joe citizen, don't completely believe he'd be honest on that questionare.

** Update ** 4/13/2008

Got a comment on my blog from "The F.B.I." with the address given of info@fbi.gov but there's a problem with it -- 1, the IP comes back to France ...sorry, that doesn't make me feel its more authentic (using the onion aren't ya?), 2nd, it refers to internet crime and not ...um, real crime so for now, I'm going to leave it in the comment bin until I get a bit more info on this.  So if you're reading this, use the contact page (link's up top) and drop me a line, let's talk.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Misc | Law | Government

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Like the description says, at my core, I'm a scientist and engineer.  I came from humble beginnings on a 486DX2 Packard Hell playing doom2 on IPX to in a small time retail shop and got into hardware (ISO layers FTW!) and it was all downhill from there.  I'm infinitely curious about almost everything and always wanting to know.

Some of the stuff I'm currently into/researching...

Sitefinity

Ninject

Subsonic

Java

Currently working on ...
i did the hundred 
and some extra stuff

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's, their brother nor their dog's view in anyway.  At all.  Ever.

© Copyright 2007-2008