Uncategorized

The Evolution of Programming Languages

Binary

Ah, sweet purity! I can write my 100 lines of code with complete control. Only deep machine architecture knowledge is required. Please don’t drop the stack of punch cards.

Assembly code

So close to the machine. I can write my 1000 lines of code with complete control. Only deep machine architecture knowledge is required. Dang, maybe I can write some macros for this repeated code.

Perl

I eat strings for breakfast.  Write once, read none. The compiler is you. Named parameters lets me write a function that takes 497 arguments. Idioms, idioms, idioms!

Basic

Because line numbers makes it easier to understand.

C

It’s like a super macro assembler. I know exactly what it’s doing and makes my 100k lines of code so clear. malloc() or alloc() and should I cast that pointer? Memory leak, schmemory leak! How many years until we get ANSI C and the C99?

C++

It’s the best and worst of C and OO! Strong typing until our friend C needs a reinterpret_cast<>. Every routine you need including those you don’t are already in the STL. So easy, just don’t forget that virtual destructor. Templates are the Perl of C++ (write once, read none). I can make my 1M lines of code so neat and clear.

Visual Basic

Drag-n-drop GUIs and 16-bit delight. It does everything you need but has nothing you want–like useable object orientation.

Python

Braces are for weaklings! It has types….sorta. Life is great in a single thread. I can self-comment the code whenver I don’t want to. Python virtual environments: they work virtually in someone’s dream. I can write 10k lines of code that does the work of 1M and still has the same bugs.

Lua

Never heard of it.  Every other single language uses “!” to indicate a NOT operator, so we’ll use “~” because we want you to write more syntax errors.  Does anyone really know how the garbage collector works?

Ruby

I came, I went. The Queen is dead, long live the Queen.

Java

Types, darnit! Everything inherits from Object including God. Write once, debug everywhere. Java applets will save the web! [crickets chirping] But, my 1M lines of code is so neat.

C#

We don’t want to share our toys in Java’s playground. We’re leaving!

JavaScript

Oh crap, people actually want to do things on the web? Hey, Brendan Eich, can you code us up a language over the weekend? Sure, we’ll call it “JavaScript” because it has nothing to do with Java. We don’t need no stinkin’ types since it’s just for small dynamic web pages. Oh crap, you do want full apps? We’ll fix it with Dojo, qooxdoo, jQuery, Handlebars, Underscore, Typescript, Angular, React, Vue, server-side rendering and a unified browser framework that does the same thing that JVM and applets did 10 years ago but now with more Retsin? I still want hard types so let’s use a TypeScript pre-compiler which combined with ESLint restores those cryptic C++ template-like compiler errors you were so (not) missing. I can make 1M lines of code unclear and just as buggy.

Go, Rust, D, Elm, Kotlin, Crystal, Elixer, …

OK, maybe this time…

Advertisement
Standard
Uncategorized

Backup, Schmackup!

New Backup Hardware

Recently, after putting off a data backup overhaul and almost suffering catastrophe (read below) I recently invested in a Synology DS216+II with two 4TB drives.  It was a significant investment.  But it provides:

  • Always on access (it will power down into a sleep mode to conserve energy when not active)
  • A rich set of apps (Android, iOS, AppleTV, web-accessible) for me to connect to it wherever I am including video, audio, pictures.  The apps are top notch.
  • Provides dynamic DNS (they provide the service) which is usable by all the apps and let’s me connect to it from anywhere
  • Very easy to setup and configure.

As home NAS comparisons go the top two manufacturers (as of my own recent survey) are QNAP and Synology.  A very easy simile between the two is Synology is to QNAP as iOS is to Android (in terms of interfaces—not legal approaches).  QNAP gives more tweaks, but isn’t quite as intuitive.  I probably would have been fine either way.  Do your own research.

Synology DiskStation will allow you to use a simple file hierarchy for your photos, videos, and music files and still take advantage of their apps for easy perusal.  Of course, you can just use them like a network disk.  I like this file approach as it’s the most universal and non-proprietary dependent layout for your files.

Offsite Backup

I use Backblaze to backup my individual computers offsite.  I want security if my house burns down.  In addition, I have a Microsoft Family Office 365 subscription (wife needs the latest MS Office for her contract work) and it comes with 1 TB of OneDrive folders for each user.  I use one of the accounts as a “backup” account and have Synology’s easy built-in cloud sync app push my videos and photos folders to that OneDrive account (I’ve set it to push-only so there are no accidental deletes if Microsoft borks my data).  I also replicate the videos/photos folders to my Mac via the built-in Synology sync folder software so it’s doubly-backed-up to Backblaze.  Now I have a “I don’t have to think about it anymore” solution.

Paranoid!?  I’m not Paranoid!

Here’s why I go to all that trouble for offsite backup.  I almost lost major data because of not fully understanding the fine print.

A Long Short Story

Before the NAS I had an old iMac which ran the Server app and served as the Time Machine backup for all my home Macs. It also served up the music and video files via iTunes.  They were all locked into Apple’s formats.  I didn’t have a way of sharing photos easily with the immediate family other than I did the occasional post to my SmugMug account.  I was using iPhoto and its proprietary format and had not yet migrated to the new “Photos” yet-another-proprietary photo-storage app.   I don’t want to fork over my moolah for the iCloud hosting as I don’t trust Apple in regards to cloud stuff.  Cloud storage isn’t Apple’s core competency and I have a very technically competent friend who had Apple lose lots of his critical files in iCloud and it wasn’t his fault.  I was already using Backblaze for offsite backup of all the Macs.  Flashback to several months ago when we started a renovation at our house.  I disconnected the iMac and didn’t reconnect it for 3 months hedging my bets that the offsite Backblaze backup will suffice for my and my wife’s laptops.  Upon reconnecting the iMac I see the internal secondary hard drive has died.  No problem, I thought, as I still have an off-site backup of those files.  I check to verify the files were still remotely archived (in the April time frame), and I figure I can restore whenever.  I order a new hard drive and didn’t get around to reconnecting until July.  I feel confident that all my laptops are being remotely backed-up and I can restore the old photos and videos which had resided on the old server later.

Upon adding the new hard drive to the server I log into the Backblaze’s interface to restore the files and, whoops, they have vanished.  Long story short, they hadn’t seen my machine for a long period of time and they have the policy that since they aren’t an “archival” service they start to dump my files after 30 or more days of not seeing them.  In addition their software seemed to wrongly considered my secondary internal drive as a temporary external drive.  Gratefully, I was able to talk with their tech support and they restored my files from some way-back cavern of wherever they stored them (with only minor loss).

I almost lost my most important files (home videos and photos) and would have had to eat a huge cost of trying a forensic hard drive retrieval to get them back.  As much as I like Backblaze their fine-print was not very clear regarding secondary hard drives.  Furthermore, they don’t really specify what files they are deleting when they start the purge.

So, I trust no-one.  I have my own multiple back-ups:

  • All Macs using time machine backup on RAID-1 Synology NAS
  • Photos and videos replicated on NAS and a local (iMac) machine
  • Files on Macs backed-up offsite using Backblaze
  • Photos and videos synced to OneDrive

Two offsite back-ups is a bit of overkill.  One other option I could have considered was dropping Backblaze and buying a duplicate NAS.  Synology can setup a replication service between NASes and I could have a friend with adequate bandwidth host it at their house.  It would have paid for itself in a about 5 years, but felt that was too much effort.

I also considered Amazon Glacier and Backblaze’s own B2 service.  But, I was concerned about the administrative effort of picking and choosing the files to back up on the Macs and felt the additional cost for the brain-dead solution was better.

Standard
Uncategorized

Creating Chrome Apps from Websites

In Windows and Linux, Chrome allows you to save a website as an “app” icon to either your desktop or start menu.  What’s nice about these apps is they run without the surrounding browser noise and are treated as separate instances of Chrome (you can open and close them without opening and closing Chrome proper).  Such an icon is really handy for apps like Cloud9 IDE.

Unfortunately, the same is not provided Mac (who knows why?)   However, with the help from this post some nice fellow geeks have written a bash script as well as an AppleScript way to do the heavy lifting.  See the link below for more information (scroll to the bottom of the article for the link to the AppleScript).

https://www.lessannoyingcrm.com/blog/2010/08/149/Create+application+shortcuts+in+Google+Chrome+on+a+Mac

Standard
Uncategorized

6502 Was The Second Assembly Language I Learned

Saw this link today and it took me back 20 years.

http://hackaday.com/2013/02/05/learn-a-little-assembly-language-for-the-6502-processor

The first assembly language I learned was for the Motorola 68000 as part of a college class (circa 1992).   Motorola 68000 assembly is a beauty of clarity to behold and quite easy to learn.  I came home for the Christmas break and saw my old Commodore 64 sitting on my desk.  Thinking, “Dang, now this thing makes sense!” I ordered a $15 C compiler and assembler for it.  I wrote a few small programs in 6502 assembly and then never used it again, but had tons fun over Christmas break basking in my new computer enlightenment.

I had written Basic programs on the C64 that “PEEKed” and “POKEd” values into memory, but I never quite understood those machine language programs and how they related to assembly language.  Even after reading tons of computer magazines as a high schooler, the relationship between machine language and assembly language never really “clicked” in my head.  What was lacking in my reading was a nice tutorial like the one above in book form.  Of course, there were no computer classes of that level available to me in rural Western North Carolina and I was hacking in a vacuum.

The 6502 has an X and Y general register, an accumulator (A), a stack pointer (SP) and a program counter (PC).  That’s it!  It doesn’t get more simple than that.  8-bits of glory!

Standard