Tuesday, February 23, 2016

Windows 10 for the First Time

Introduction

 Here's another Tuesday post!

I got a top-of-the-line new laptop (at Walmart...) that I've been delaying for far too long.  My four year old laptop barely runs ONE tab in Chrome.  I've had to revert to the old (original!  From 2006!) gmail settings a few times just to get anything done.

Original author unknown
In the same spirit as OSX for the First Time, here is Windows 10 for the First Time.

Background

As I mentioned before, I've been using MS-DOS / Windows for a long time and was fortunate enough to know enough to avoid Windows ME and Windows Vista.  It's been said that Microsoft gets every third product right (unknown attribution), so after Vista and Windows 8 I have moderate expectations for Windows 10.

First Day

The first day went pretty well.  The initial set-up process was really smooth, it connected to my WiFi and the internet just fine and there were not a whole bunch of updates to download right off of the bat.  I tried using YouTube with the new Edge Browser and it worked OK for the first half-hour, after that there were unforgivable errors (e.g. not being able to click inside of the video box).  I mean, who messes up Clicking these days!  I was not impressed.

Somewhere in there I asked "Cortana" how big my hard drive was... she sent me to Bing... I was, again, not impressed.  Also, it's just a text box.  No pretty face or anything!

Cortana from Halo - Copyright Microsoft
I downloaded Firefox at around the hour mark of "real usage" (e.g. not setup time).  Firefox was able to run video just fine on YouTube with no problems.

Second Day

Second day, I needed to print and scan with my networked printer (hp deskjet 2542 wireless all-in-one printer).  Printing worked great and the default drivers installed flawlessly and "just worked" for printing.  +1 to Microsoft, who is now shooting at 1 win and 2 losses.  Funny thing, the biggest hastle was figuring out how to bring up Notepad... I told Cortana to "Open Notepad" after futzing with the new Windows Button in the lower left and at least that worked.  I'll put that as 1 lose for the Windows Button and one win for Cortana, putting us at 2 wins and 3 losses.

Next up was scanning.  I had to install the custom HP software, which claims to be Windows 10 ready, in order to scan.  It kept being unable to setup the printer... which is already set up.  It said to uninstall the HP printer driver and restart the printer... and was then still unable to setup the printer.  Three hours later I booted up my Windows 8 dinosaur and scanned using that.  Epic fail for device drivers!  It was so frustrating it drove me to drink (a reasonable amount).  Windows 10 is now looking at 2 wins and 4 losses.

Conclusion

Avoid using Edge, peripherals and Cortana and it is working OK.  Microsoft usually has a long time frame in mind when releasing a new OS, so it's usually two years until a new OS is generally usable and Windows 10 looks to be no different.  Keep your old OS so that you can have working 3rd party device driver!  Final judgement 4.4 / 10, compared to the usual Microsoft products 8.0 / 10.

Why do I use Windows?  What's that phrase, devil you know?

Tuesday, February 16, 2016

Are these Images Similar? Simple Machine Vision with a Perceptual Hash

From https://evelyngarone.wordpress.com/2011/11/17/cute-and-funny-cats/

Background

At my job I had an actual requirement to tell if a given image was similar to a previous image (to detect a bad video input).  That was it, no background or suggestions on how to go about it.  This sounded a lot like Machine Vision to me, which is somewhere under the Artificial Intelligence (AI) umbrella.

I promptly started to freak-out (see image at right).

Intro

I quickly came across the concept of a Perceptual Hash during my first Google searches.  This led to finding first a C (++?) open-source library called pHash.  This prompted a further search for a Java open source library, which led to a Stack-Overflow question and a small Java class to take care of the heavy lifting.  The docs of this further linked to another source of inspiration on Hacker Factor for that author.

Hypothesis

This class, ImagePHash by Elliot Shepherd, will work as-is without me having to delve into the gory details too much (the Hacker Factor link provided an excellent overview).

Results

It worked really well!  I just put in some tweaks to Springify it (see Java Papers tutorial on Spring annotations for details) and use the logging framework the project uses instead of System.out calls and I was getting back the "distance" between two perceptual hashes in no time.

I still had to interpret these results because my code base needed a yes-no answer.  So I downloaded about 5 images from the Internet that were similar to my original image, and cropped the original image as well.  I found that a distance of 8 was a good cut-off for sameness, e.g. for a distance of 8 or below I would consider the images the same.  This would count the cropped image as the same, but not similar but looks different to me images.

I would be more specific but it was done on company time so I can't go into details too much (see also: Non-disclosure Agreements).

Conclusion

The whole loop took about a day and wasn't too scary once I go into it.  I'm glad that I didn't try to re-invent the wheel and that the class worked!

Tuesday, February 9, 2016

OSX for the First Time

Introduction

Here is this week's Tuesday post.

I started a brand new job and one thing didn't come up in the interview: they are a Mac shop.  I already accepted the offer, so I decided to learn how to use this MacBook Pro (I think).  It's definitely OSX.
You may be too young to have seen one of these.

Background

I'm a long time user of Windows, and started back in the MS-DOS days of having to make a custom 3.5" boot disk to have enough 640k memory (which Ought to Be Enough for Anyone) available to play games.  Needless to say, I'm (unfortunately) invested in Windows, and have some pretty cool stuff that I can do with my mouse.
I'm not trying to start a flame war, one way or another.

First Day

The first day was mostly struggling with the keys and initial setup.  It isn't Ctrl-C to copy, it's command(⌘)-C.  Basically, everything you want to do with Control on Windows you do with Command on Mac... except for stopping a process on a command prompt, that's still control-C.

The control key goes from best-friend to too-busy-to-keep-up status.

Also, the Function Keys aren't the Function Keys by default.  To press F3 you have to press fn-F3.  I've seen similar setups on Laptops but they usually have a "fn-lock" key.  I'm a programmer, so I use F3 (Eclipse -> Go to Source Declaration) about 20 times a day.  I've used a "non-fn" key about 5 times.

First Week

I discover the oddness and joy of the Magic Mouse.  It looks like a mouse that forgot to finish getting made, and I have to configure it to be able to right click, but I've started liking it.
I'd still like to Copy and Paste using my mouse like I have setup on Windows, but oh-well.

Apple Magic Mouse - See Credits section for attribution.
I have a three monitor set up (laptop screen and two monitors) - more than I've ever had on a Windows box.  This is really nice!  I have my command prompt on my small lap-top screen on the right, IM / Email on my left hand screen and the rest in the middle.

I had to struggle with the Dock (I was using a 3rd party Dock on Windows, so this was easy in general) when it would seemingly randomly move to another monitor.  It turns out, mousing down off of the screen brings the dock to that screen.  This can be done quite easily on accident, but once I know what's going on I can bring it back to my main screen pretty easily.

My left monitor starts randomly going black, and I look at many different solutions to the problem.

The system in general is pretty powerful (I think the company got a top-of-the-line model).

First Month

I upgrade the OS to El Capitan (trying to fix the screen issue as mentioned above), I thoroughly look at all of the System Preferences and I'm able to do regular, day-to-day work on it.

Conclusion

After a month of work-day use, it's starting to fade into the mental background.  It doesn't do unexpected things and it doesn't need excessive updates.  I'm not a 'convert' and probably wouldn't pay the extra money for a Mac.

It's definitely better than a "standard" Windows pre-install with McAfee (no link on purpose) and the other bloatware.

P.S.

For the small handful of people reading these, thanks!  You'll continue to find good content.
I'm assuming these reads aren't just bots...

Credits

Magic Mouse Image: By Yutaka Tsutano from Lincoln, United States - Magic MouseUploaded by Mewtu, CC BY 2.0

Wednesday, February 3, 2016

Tuesday, February 2, 2016

Blog Reboot: For SCIENCE!

It has been a heck of a year since the last time there was a new post here.

As mentioned on the Thirteen Blog Cliches on Coding Horror no one likes explainations of why a Blog hasn't been consistent.

Moving forward the posts are going to get a little more Computer Science-y, not in the hard-to read way but in the basic core of reproducing / verifying another persons claims.

In practice, I go through a lot of material that I get off of the web and a lot of times there are gotchas or caveats that the original author did not mention.  They will be mentioned and refined here.  There will be basic sections on hypothesis, results and conclusion.  Nothing super-heavy weight.

I'll keep this short: like I said, nothing super-heavy weight.