Tuesday, March 29, 2016

OMG .NET, You Are Crazy!!!

OK, so I am doing something simple...  adding a ControlParameter to a SQLDataSource.  I just want to add it as an optional filter.  The ControlParameter points to a TextBox.  Like this...

<asp:ControlParameter ControlID="txtFiltCC" Name="TCity" PropertyName="Text" Type="String" DefaultValue=""/>

Not only does the result return nothing, according to the Microsoft SQL Server Profiler, the query is never even sent to the server!!!  

What the HELL!?!?!?!?

I change the SelectCommand to not use the @TCity paramater and still...  no query sent.  The GridView bound to the SQLDataSource reports that no records were retrieved.   Hmmm...  makes sense since according to SQL Server Profiler, no query was sent.

Then I find the ConvertEmptyStringToNull property on the ControlParameter.  It's default is 'True'.  Hell, I don't want it to be null, so I change it to False.  Friggin SHAZAM!  The SQL query is sent and I get a result set.  Why the HELL would the ConvertEmptyStringToNull cause a query to not be sent, especially if the parameter isn't even used in the query????  This works fine...

<asp:ControlParameter ControlID="txtFiltCC" Name="TCity" PropertyName="Text" Type="String" ConvertEmptyStringToNull="False" DefaultValue=""/>

Really, Microsoft...  This is a crazy little piece in ASP.NET

So...  For anyone scratching their head about a GridView not being populated from a SQLDataSource that is using a ControlParameter pointing to a TextBox, this just may be the solution.

Thursday, March 24, 2016

Just a Little Old

So, using a five year old PC is 'sad,' eh?  According to Apple's Senior Vice President of Worldwide Marketing, Phil Schiller, about 600 million people are using PCs that are over five years old... "This is really sad."

Sad, eh?  A computer is a tool.  If that tool suits the user's need, why change?  Ya, I am a high-tech, hip, cool, well-informed geek of fifty years old but have been using the least expensive cell phones on the least expensive plans I could find; that is, until two years ago.  That was when we moved out to our little rural house on the lake, with barely any cell signal.  That was also when my personal interests turned to landscape and documentary photography.  My main camera, a Canon EOS Rebel T3i doesn't support geo-tagging, so I specifically bought a phone that had good RF power, supported geo-tagging photos and was on a carrier with proven coverage in our rural little hideaway.

And...  after 35 years of using computer screens, my eyes tend to strain with small screens, so I opted to get a 'new & improved' Android cell phone with larger screen.  And, I am happy I did.

In my garage there exists a hammer; a tool.  It is likely 20 years old.  It fits my key requirements: hammer a nail while allowing my hands to grip it properly and not cause undue strain on my wrists.  Why would I want to purchase a new tool if this one works?

My philosophy of PC upgrades is the same...  If the PC fits the requirement, why upgrade?  Only this year did my little HP Mini-110 stop working.  I didn't upgrade because it suited a certain purpose: small size, fully functional for web browsing, would run a word processor and was incredibly easy to throw in my motorcycle's saddle bag or car's trunk when going somewhere.  It was six years old this year.

We have a six year old desktop running as a media machine - it plays DVDs, streams video and music, and functions as a data-backup computer for the other PCs in the house.  Ya, it's six years old but why change???  It works fine!  A newer computer would offer nothing more given these required functions.

I have an old HP desktop from the early 2000's running Debian Linux.  That old fella is used for things like learning C++, ImageMagick and Python and experimenting with the wild side of Linux's low performance world.  It is perfect.

Why is the action of not upgrading a computer more than five years old "...really sad?"  Simple...  The person who make that statement receives a paycheck at least partially based on people upgrading more frequently than every five years, whether they need it or not.

Wednesday, March 23, 2016

Da' Truth!!!

So, there I am; innocently driving our ferret back from a veterinarian visit when what in my wondering ears should echo???  The ranting, irritating, disingenuous voice of Sean Hannity on our local AM radio station.

Now, I am neither liberal or conservative; neither republican or democrat.  I am a proud independent.  That stated, never have I listened to the Sean Hannity show when something was said that didn't make me giggle because of...  well...  Here's what I heard on the trip home from the vet...

Sean is ranting about how President Obama and Hillary Clinton were both "friends" with the Reverend Al Sharpton;  how Reverend Sharpton is a rabel-rouser, a firebrand, an agitator.  Those things, I just don't know and honestly don't really care.

Here is what made me LOL...  One of the voice tag lines for the show had something to do with the "Truth";  something like "Only the Truth!" or something like that.  OK...  Still don't care...  but then the LOL hit.  According to Mr. Hannity, the President and Ms. Clinton both "Kiss Al Sharpton's Ring."  Really?  I mean, did they kneel?  Were they all sitting?  Did they bow?  Was it one-on-one or a threesome?

Mr Hannity???  Pictures?  "Only the Truth" but you say they kissed his ring?  Do you have a reference for this?  Can you prove they kissed his ring???

Years ago these type of radio shows irritated me.  Now they simply provide my inner child with comic relief.  Keep talking!!!  I need the laughs!

Friday, March 4, 2016

Break-Even Performance/Cost Evaluation of Two Computers

So, my cheapie motherboard is on it's way and still waiting on my Pine64 to be shipped.  Hmmm...  I have been wondering how I can evaluate which platform will get me the best 'bang for the buck.'  Well, the main job of these machines is to use ImageMagick and maybe some other image utilities, to comb through hundreds (or thousands or millions) of photos and identify meteors.

So...  I start at total system cost.  A complete Pine64 should cost about $40 (inclusive of processing board, flash drive and power supply).  A complete, low-end AMD system using an AMD Dual-Core Ontario C-70* processor  (from NewEgg) should cost about $85 (inclusive of motherboard, processor, 4GB RAM, flash drive and power supply).

I want to evaluate which is a better value based on the amount of time required to process the same 100 images through the same processing steps.  It is really a pretty simple calculation; just required me to open some cranial doors to past algebra classes...  Those door hinges were rather creaky this morning. :-)

The calculation is simple and based on the ratio of  costs; in this case, 40/85.  Let's say the Pine64 requires 10 minutes to process 100 images.  For the AMD solution to be a better bang for the dollar, how many minutes should it take on the AMD platform to process the same 100 photographs?  simple...  10 * (40/85)  or 4.705 minutes.  Any longer and the Pine64 is a better deal.  Any less and the AMD solution is better.

And...  by inverting the ratio, we can solve how many minutes are required by the Pine64 to have a higher performance; 85/40.  Let's say the AMD requires 5 minutes to process 100 images, then 5 * (85/40) = 10.625 is the breaking evaluation point.  If the Pine64 takes less than 10.625 minutes, it is a better deal.

So...  Some algebra...
p1 - Price of system 1
t1 - Time to perform a process on system 1
p2 - Price of  system 2
t2 - Time to perform a process on system 2

t2 = t1*(p1/p2)  - use if t1 is known and looking for t2
t1 = t2*(p2/p1)  - use if t2 is known and looking for t1

If the real world results are less than or equal to the above results of t2 or t1, then that system is better in terms of performance/cost.

Now, back to something a bit more simple - website migrations, SQL optimizations and thredifying single thread processes...  oh boy oh boy.

* - Processor and Board Disclaimer - Yes, I know the AMD C-70 is an older, less powerful processor.  That, however, means that available motherboards are quite inexpensive.  Plus, the power consumption of the C-70 is really very low - big plus.

Thursday, March 3, 2016

OMG! News Flash! SalesForce & TITSUP

HAHA  OH MY GOD!!!  Thanks goes out to Simon Sharwood and The Register for this article about a Salesforce Outage.

I simply MUST quote their update:
"One of Salesforce.com's European instances is enduring a lengthy un-planned PITSTOP incident – that's a Partial Inability To Support Totally Optimal Performance, a whit below our other status indicator of a Total Inability To Support Usual Performance or TITSUP."

HAHAHAHAH!!!!!  OH MY!!!!  TITSUP!!!!!  Never have I seen TITSUP and Salesforce on the same page before.  SO apropos, So right.  Thanks for the Thursday morning laugh!!!

**Disclaimer - I am not a fan of Salesforce, its abysmal development environment, its incomplete programming language APEX, its poorly thought out data structures and generally the whole Salesforce concept and system.

Wednesday, March 2, 2016

Oracle VM VirtualBox - Just a Misleading Error Message

Three weeks of fighting a "cold from hell" gave me time to think about my little project to automate a search for meteor photos.  Sure, I have a PINE64 on order.  Sure, it may be delivered later in March.  Sure, there may be a flavor of Linux available for it sometime soon.  Sure, I may be able to build ImageMagick and other tools I need for the Pine64.  Sure, the performance may be acceptable for my goal.  Crap, no planned PXE/net-boot planned.

What if...  Let's see...  a complete Pine64 compute node with 1GB Ram and the OS on an 8GB flash drive will cost roughly $35 accepting a lot of "maybe" assumptions.  Let's remove the assumptions and calculate the cost of a good old AMD or Intel processing node.  Looks like a 64 bit AMD based system with 4GB RAM, with PXE boot will run about $85.

So...  I decide to emulate a 32 bit Debian text-only install on an Orable VM Virtual box using 4GB Ram to sort-of emulate the AMD solution.  Which gives me an idea for a new word...

umulate - An emulation that is not exact; allowing certain differences for the sake of brevity or simplicity.  "I am going to umulate this Debian install; the real machine will not have a hard drive, but will boot from a flash drive."  But...  I digress...

BUT SMACK...  An error pops up from Oracle Virtualbox when I try starting the virtual machine...

Failed to open a session for the virtual machine DebianPNode.

Under "Details" it read...

VT-x is disabled in the BIOS for all CPU modes (VERR_VMX_MSR_ALL_VMX_DISABLED)

Well, after some research and comparing this virtual machine with the operational virtual version of Debian, I arrived at a repair that seemingly has nothing to do with the error.  I changed the Base Memory for this Virtual machine to 3072 GB and SHAZAM.  No more error.  Keep in mind, my machine has 8 GB and runs a pretty lean install of 64 bit Windows 7.  Why this misleading message popped up, I have no idea...  but reducing the Virtual machine's Base RAM fixed the problem.