Featured Quote

In 1913, Henry Ford wrote the following as the directors had been reaping the rewards of profits - "The wages we pay are too small in comparison with our profits. I think we should raise our minimum pay rate".

Friday, September 27, 2013

Programming with VB needs an AutoIT3 helper!

So, I've got this code that goes out and checks on the timestamps of some files that are important to the BMC Bladelogic Client Administration (formerly Marimba) Tuner (aka Agent) on the endpoints.

Checking from a central location out to a couple thousand computers, the Visual Basic .NET (written using Visual Studio Express 2012) can't be trusted to get the latest time stamp.  I wrote the following function and this issue arises specifically when using the Mod.
    Shared Function GetFileInfo(ByVal ComputerName As String, _
                ByVal FiletoFind As String, info As String)        
        Dim Ret As String = ""
        Dim targetfile = "\\" & ComputerName & "\" & FiletoFind
        Dim fi As FileInfo = New FileInfo(targetfile)
        If fi.Exists Then
            fi.Refresh()
            Select Case info
                Case Is = "Exists"
                    Ret = fi.Exists.ToString
                Case Is = "Delete"
                    fi.Delete()
                    Ret = fi.Exists.ToString
                Case Is = "Created"
                    Ret = fi.CreationTime.ToString("MM/dd/yyyy hh:mm:ss tt")
                Case Is = "Access"
                    Ret = fi.LastAccessTime.ToString("MM/dd/yyyy hh:mm:ss tt")
                Case Is = "Mod"
                    Ret = fi.LastWriteTime.ToString("MM/dd/yyyy hh:mm:ss tt")
            End Select
        Else
            Ret = "File Not Found"
        End If

        Ret = Ret.Replace(vbCrLf, "")
        Ret = Ret.Replace(vbCr, "")

        Return Ret

    End Function
So, it should be no problem, right?  Wrong.  Even with the fi.Refresh() in there, it still brings back an outdated time stamp.  You could go to Windows Explorer and UNC to the remote computer, browse to the file and right-click, bring up the properties and see the correct time stamp.  Oddly enough, after you do THAT, the above function gets the right time stamp!  Sometimes the difference between the two can be days!

So, I went to AutoIT3 and ... okay, I already had the code to check the files I wanted...
Func _FileTimeStamp($path)
    Dim $file,$astamp
    $file = $path
    $astamp = FileGetTime($file, 0, 0)
    If IsArray($astamp) Then
        $stamp = $astamp[1] & "/" & $astamp[2] & "/" & $astamp[0] & " " & _
                $astamp[3] & ":" & $astamp[4]
    ElseIf $astamp = 0 Then
        $stamp = "file not Found"
    Else
        $stamp = 0
    EndIf
    Return $stamp
EndFunc   ;==>_FileTimeStamp
The AutoIT3 code gets the right time stamp and makes the VB accessed 'ghost data' update. 

The reason to get the time stamps is to make sure that the Tuner is functioning as expected.  Too often, it is not.  So, WHEN a Tuner has an outdated channel, I wrote a little function to go through a little process that usually fixes the problem.
Private Sub UpdateChannelFix()
        Dim runchannel As String = TunerPath.Replace("Tuner.exe", "Runchannel.exe")
        Dim Procedure(5) As String
        Procedure(0) = "Tuner,-stop http://MyBMCServer.Mycompany.local:5282/Marimba/Current/PatchService"
        Procedure(1) = "Tuner,-stop http://MyBMCServer.Mycompany.local:5282/Marimba/Current/InventoryService"
        Procedure(2) = "Runchannel,-subscribe http://MyBMCServer.Mycompany.local:5282/Marimba/Current/PatchService -reset"
        Procedure(3) = "Runchannel,-subscribe -update http://MyBMCServer.Mycompany.local:5282/Marimba/Current/InfrastructureService"
        Procedure(4) = "Runchannel,-subscribe -update http://MyBMCServer.Mycompany.local:5282/Marimba/Current/InventoryService"
        Procedure(5) = "Runchannel,-subscribe -update http://MyBMCServer.Mycompany.local:5282/Marimba/Current/SubscriptionService"
        For Each pStep As String In Procedure
            Dim rp As Process = New Process
            Dim rpi As ProcessStartInfo = New ProcessStartInfo
            Dim parts = Split(pStep, ",")
            Dim mExe As String = parts(0)
            Dim mCmd As String = parts(1)
            rpi.WindowStyle = ProcessWindowStyle.Hidden
            If mExe = "Tuner" Then
                rpi.FileName = TunerPath
            Else
                rpi.FileName = runchannel
            End If
            rpi.Arguments = mCmd
            rp.StartInfo = rpi
            Try
                rp.Start()
                rp.WaitForExit()
            Catch ex As Exception
                ' oops, nevermind - will catch it in examination
                AlertText = AlertText & vbCrLf & mExe & " " & mCmd & _
                    " <-- Failed to run"
            End Try
        Next
    End Sub
The program finds the path to Tuner.exe by looking in the registry for the Application entry.  Using that, the function uses Tuner.exe to stop the Patch and Inventory channels, which can sometimes get stuck in a running state and cause issues.  Then, it uses the Runchannel.exe program in the same folder to do a reset on the Patch channel.  The -subscribe makes sure that if the channel is not present, it will install it.  Then it updates or subscribes and runs the Infrastructure, Inventory and Subscription channels.  Running the Inventory channel will usually run the Patch channel as well.

Cool, huh?!? :)

Monday, September 23, 2013

Equipment I Need for the Long Motorcycle Trip

Note: I've updated the map with planned places to tent-camp for the night.  Next step in the map-making department is adding planned Gas stops and Food.

I have a Sissy Bar and luggage rack with a roll bag.  I have a standard tent ( I have to repair the poles on it ) and a sleeping bag.  I have a clothes roll.

Still, there are a few items that I feel that I really need before I make the almost 6,000 mile loop.

The first thing I need is a good seat.  I am looking at getting the Comfort Max Gel Jumbo Seat Pad. $114.95, sheep skin cover.  The AMA rider testing seemed to like it well enough.  I won't be doing any 'high spirited riding.'

The second thing I need is some Highway Pegs - without Highway Bars.  For this, I am looking at Comfort Ride Zone's peg support.  $74.99. I'll need to find some male mount pegs to go with them, but that should not be too hard.

The third thing I need is a way to charge my cell phone while on the go.  It could be a solar charger or a battery-connected usb charger for the motorcycle.  If I get a Tank Bag, then there is a charger for use with a tank bag or saddle bag.

The last thing that I really, really need is a good rain suit.  I think I want the blue Rev'It Pacific H20 Rainsuit. $119.99  Maybe the Frogg Toggs?  I just want to stay dry.  Another possibility is to spray my existing rain suit - which leaks like crazy - with the tent-waterproofing stuff.  Maybe some tape along the seams to help repel water.

In addition to the things that I really must have for the trip, there are some things that I really want to have!

I kind of want to have a different sleeping arrangement.  Sleeping on the ground, even with a sleeping bag, can be rough.  What I would like, is an Explorer Deluxe from Hennessy Hammock.

One of the things that I want to get out of this trip is the memories.  I already have a nice DSLR camera and a couple lenses.  What would be great would be to have video!  The Drift HD would be a great camera to capture the ride with.

Saddlebags ( check out vikingbags.com ) would be very useful on such a long trip.  A sleeping pad for the tent would make it a lot more comfortable, if I don't get a Hammock to sleep in.  A Rider backrest might be nice to have on a long trip.

Gun Entheuists vs Reality

So, I see the following pic on my Facebook news feed :

While I support the 2nd amendment and am not anti-gun, I am not obsessed about guns any more than I am obsessed about hammers, digital cameras or computers.

The above meme image has some very inaccurate information.  For one, the PICTURED top gun IS more dangerous than the PICTURED bottom gun.  It has, IN THE PICTURE, a 20 round Magazine.  The bottom gun only has 5 rounds.  Using basic math, the top gun can kill or damage 4 times more things than the top gun. (Oh, and don't call a 'magazine' a clip, which is what they were called until rather recently when terminology freaks started using the difference to call people stupid.  I remember when gun magazines - the monthly publications for reading - advertised "banana clips", curved, high capacity 'magazines' for various guns.  Okay, so maybe my experience is a bit out of date... like I said, not obsessed with guns.)

They claim that a pistol grip, higher capacity magazine and, it looks like the top gun has a heat dispersal mod and a flash suppressor on the barrel, are just cosmetic.

Lets stop and define the word cosmetic
: not important or meaningful
: not substantive :  superficial <cosmetic changes>
Any HONEST police officer or SWAT officer will tell you that the grip changes a LOT about how the gun handles.  It changes the ergonomics and mechanics of shooting.  The shaped stock improves shoulder contact.  Having a pistol grip will allow more accuracy when firing in rapid succession.

Even the MANUFACTURER (Ruger) calls the top version a "tactical rifle" and the bottom one is the "ranch rifle" model.  They are DESIGNED for completely different applications.

According to the specs, the Tactical has a shorter barrel by a little less than 2 inches, shorter overall by 4 inches, a tiny big heavier and $80 more.

Saying that the differences are only cosmetic - not important nor meaningful - goes against all of my logic and reason.  It seems an affront to physics, mechanics and ergonomics.

But the idiots jumped my case, called me ignorant and said all kinds of nasty things about me because I dared to point out that blatant lies do nothing to help any cause.

The poster below is a bit more accurate. 

It uses "mostly superficial" instead of "only cosmetic."  It also points out they can both accept the same magazines of different capacities.  However, they are not the same gun.  They are different models of the same gun.  Using the Tactical Rifle to go hunting is like taking a Nascar vehicle to do the grocery shopping.  I'm sure it will get the job done, but it is not what it was made for.
Of course, with our roads, I'm not sure the racer could make it to the store without bottoming out and getting stuck in a pothole.

When I found a youtube video of a guy demonstrating the differences a pistol grip makes, they called HIM an idiot too.

I have found a blogger who knows about guns...
"The pistol grip affects a few things in reference to your relationship with the rifle.  The shape and angle of the grip affect how the rifle carries and how it shoots, which encompass most of the things you might do with your rifle."
"The reason is that vertical grips make shooting easier."
and part 2...
(with a pistol grip there is) "No contorting necessary.  I can just grasp it normally and the finger ends up pretty close to where I want it.  I find it odd that a rifle could just fit so easily."

Doesn't seem like it is 'just cosmetic,' but they would probably call him ignorant as well - his knowledge doesn't fit with their meme and talking points.

I was looking at reviews of the Mini-14 Tactical and one of the best quotes I saw in comments was from a Trooper :
"Accuracy? Well sports fans, it was never meant to be a benchrest rifle but it will reliably kill a man at two to three hundred yards all day long, which was the whole point."
A different article has a good quote regarding the pistol-grip design on the AR:
"Many famous firearms such as the Thompson submachine gun and several WWII-era German designs used similar grip-to-receiver angles for the same reason it’s endured more than five decades of AR service: It is conducive to effective combat shooting. The AR grip is most natural in-hand when shooting upright (standing, kneeling, etc.), but is likewise well suited for prone work and patrol-type activities. Traditional stock designs lack in one or more of these areas, but thanks to Eugene Stoner, today’s ARs are pretty darn comfortable guns."  (note: the AR has a pistol grip)
It is fairly clear that the reason for a pistol grip on a rifle is to make it an effective Combat Weapon.  Therefore making the change not just for looks.  The standard stock is better for long-term carrying and carrying in wooded and brush areas - less stuff to get caught on the brush and poke into body parts while being carried.



Not 'just cosmetic' differences
Mostly Superficial differences
I made a picture from Ruger's website.  The top is still the 'tactical' model and bottom is still the 'ranch' model, but the differences AS PICTURED are, in fact, mostly superficial and neither is 'more dangerous.'

All I'm saying is have a little more accuracy when trying to do a meme!!  And when called on the bullshit, don't defend it.

One more thing about the 'arguments' is that they used school-yard bully tactics.  They focused on one, insubstantial part of a statement and over-emphasised it to discredit me and distract from the substance of the argument.  Since they can't argue on the facts, they have to draw attention away from valid points by any means necessary.  I hate that - and that is one reason I don't keep firearms within reach.  :)

I have no experience with firing those two configurations one after the other.  I, however, hunted and shot quite a bit growing up.  I was (successfully) squirrel hunting with a revolver when I was a teenager. 

The only way to fully settle this would be to do a side by side test at a firing range with the two guns AS PICTURED.  Firing once for speed, once for accuracy.  With a non-biased judge collecting the stats of each test, the speed, the accuracy, the accuracy during the speed test and the speed during the accuracy test.  Probably at least two or three testers with various experience levels.

Fire 5 rounds as fast as possible with each, time speed and accuracy of both rifles.
Fire 20 rounds as fast as possible with each, time speed and accuracy of both rifles.
Fire 5 rounds as accurately as possible, time speed and accuracy of both rifles.

1. Would you expect a difference in the two rifles performance?
2. Would you expect a difference in speed and/or accuracy due to the stock/grip?
3. What was the actual experience regarding performance and the stock/grip?

If Ruger would loan me the rifles to test, I am sure that I can get a gun range to host the testing.  My office is full of people who won't stop talking about guns, load their own ammo, etc. Even a guy with his own range.  So I can get some volunteers to help test.  I'd be a tester, of course.  Probably have to bring our own ammo though.

I wonder what the engineers who designed the Tactical Rifle would say to all their additions being 'just cosmetic.'  Or what all the designers for military applications whose designs are basically being called complete failures - as they make no difference other than looks?

I guess there is a possibility that they are just cosmetic and change nothing significant about the gun.  That would make those wishing to ban the weapon because of it's looks seem very silly.  It would also make those who want to own that style weapon, who would suffer great emotional distress if they had to settle for the standard version, very, very silly people.

If it turns out there is no difference, then I'd have to say, "I came into this thinking that they should not be banned.  Now, why not?  There is no functional difference in the two, no reason to want one over the other, so, why not put the scary looking one away to make a lot of people feel better?  Its not like they'd be taking away any combat advantage or anything.  All sides of the argument are stupid and a waste of time."

One small side effect to this encounter is that I am now considering getting the Mini-14 Tactical instead, or perhaps in addition to, the CZ75-b that I have been looking at getting. But I know, realize and admit that I am not getting either one to go hunting for food nor just for target practice.  Its all about the Zombie Apocalypse!