K&R . . . check!

Study of King DavidSource Code:  Kernighan and Ritchie The C Programming Language Code Examples

I’m happy to say that I finally completed my effort to work all the exercises in the classic “The C Programming Language” book by Brian Kernigham and Dennis Ritchie (co-creator of UNIX). What started as a side effort to reinforce pointers and memory management as part of my efforts to write a Scheme interpreter supporting my efforts to work through another classic “The Structure and Interpretation of Computer Programs” turned into an eight month effort (mainly due to my lack of time for side projects).

The effort did reinforce that the C programming language is certainly the king of procedural computer languages. There is nothing a von Neumann architecture computer can do that cannot be programmed by ‘C’ and converted into machine code by a good compiler. However, this king is an old king. Yes, garbage collection, object-orientation, concurrency, and JSON encoding can all be done using ‘C’ from either scratch or via open source libraries. Yet, I’m concluding that the effort outweighs the gain when languages such as ‘Go’ and ‘Rust’ coming into their own.

I have mixed emotions. I’m overjoyed to have re-mastered this language using one of the most classic programing language books to do it. But, overall I would put this effort down as a “failed experiment” from which I have learned that I probably need to look to a more modern language (I’m going down the ‘Go’ route) to fill my needs for a “get the job done with no BS” general-purpose language.

All that said, I can confirm “The C Programming Language” is a truly great book. This single book takes the reader through all aspects of classic ‘C’ (it has not been updated to the latest language standards). In the process it also works through basic implementations of classic algorithms and data structures: arrays, queues, linked lists, hash tables, binary trees, binary search, shuffle sort, quick sort, and a simple recursive decent parser. The book also covers implementations of basic standard library functions using low-level operating system calls. By the end of the book, you will have completed a tour de force of the basics of this classic language. I still highly recommend this book to any developer serious about their craft.

Here is a link to my exercise solutions: Kernighan and Ritchie The C Programming Language Code Examples

Article Summary 2015-06-26

“What Is Code? If You Don’t Know, You Need to Read This”

This is probably the best quick summary explaining what software (and computers for that matter) really is. Thank you to Laura Haverkamp for bringing this one to my attention. There is also a good “Behind the Scenes” article. And, I have taken the pages, cleaned them up, and produced an Evernote Summary.

“Electron Microscope Slow-Motion Video of a Vinyl LP”

A great video of a needle reading the grooves of a vinyl record from the guys at Applied Science. Ben Krasnow goes through the process he pursued to be able to make this video. Ben maintains an awesome YouTube channel.

“Killjoys Really is a Most Excellent Space Adventure”

io9 goes on to say that it may (finally) be our next Firefly. I’ll believe it when I see it, but you can bet this one makes my list of shows to binge watch once the first season has concluded. (P.S. If you are a Firefly fan, please vote it up on IMDB.)

Math Puzzle: “The Nine Schoolgirls Challenge”

“Fifteen young ladies in a school walk out three abreast [as a group] for seven days in succession: it is required to arrange them daily, so that no two shall walk twice abreast.”

This problem launched a whole branch of mathematics called combinatorial design theory. A young mathematician, Peter Keevash, has made some breakthroughs with respect to the general case problem within which the above puzzle lives.

“‘EPIC’ fail–how OPM hackers tapped the mother load of espionage data”

An excellent and detailed summary of what is probably the most truly damaging hack of government systems in terms of individual safety.

“Building Prototypes by Dan Gelbart”

Hackaday has pulled together an excellent series of 18 videos of Dan Gelbart demonstrating a whole series of mechanical prototype development techniques. Dan was the co-founder of Creo–a company that developed laser-based products for the printing industry and sold to Kodak (remember them) for $1 billion. Dan has gone on to become an award-winning entrepreneur and inventor. He teaches Mechanical engineering at the University of British Columbia.

“Leading People When They Know More Than You Do”

Truth is that in a knowledge worker career (such as software development) folks who move into management will be managing folks who know more about the task than they do and, in addition, who may be more highly compensated. This is not the “Peter Principle” which is more applicable to the Industrial Revolution as opposed to the Information Age. Instead, it is a natural outgrowth of the realities of knowledge workers. This article is one of the best I’ve read so far providing practical advice for managers and executives who find themselves in this situation.

“Grady Booch on the Future of Software Engineering”

Grady Booch (blog) speaking at the 37th International Conference of Software Engineering (ICSE 2015). This is an excellent discussion about both the history and the future of Software Engineering.

Grady is the guy that developed the Unified Modelling Language (UML). He was also the Chief Scientist for Rational Software Corp and IBM Research. He is both an ACM and IEEE Fellow and he won the Lovelace Medal in 2013. He has also worked for Facebook.


Article Summary 2015-05-29

44 years of UNIX, Time-lapse Photo Mining, Self Healing Buildings, Free NASA Code, Realtime User Monitoring, Email for Apple Watch, Two-thirds of Europeans Have Same Fathers, New Language for FPGAs, Smartphone with Projector, and Light Bulb with Speaker.

“A Repository with 44 Years of Unix Evolution”

This is one of the coolest things I’ve seen for a nerds and geeks alike in a long time–a GitHub repository that traces 44 years of evolution in the UNIX operating system code base from 1972 to 2015–659,000 commits from 850 identified individual contributors.

“Time-lapse Mining from Internet Photos”

These guys mined 86 million public photos then collapsed ones of places into a common viewpoint. From that, they were able to develop time-lapse videos. Their detailed paper is an amazing read.

“The First Building That Can Heal Its Own Cracks With Biological Cement”

Self-healing buildings.

“It Is Rocket Science! NASA Releases Abundance of Free Code”

Open source code from NASA

“How to provide real user monitoring for single-page applications”

Discusses three challenges single-page apps (SPA) face with respect to real user monitoring (RUM) along with a solution path for Angular-based SPAs using Boomerang.

“How To Send a Hidden Version of Your Email That Only Apple Watch Will See”

Discusses how to craft email messages to specifically utilize the capabilities of the Apple Watch.

“A handful of Bronze-Age men could have fathered two thirds of Europeans”

“Genetic study reveals that two-thirds of European men can be traced back to just three individuals who lived between 3,500 and 7,300 years ago.”

Presents even more detail on the research into the Y-chromosomal most recent common ancestor (“Y-MRCA” or “Y-chromosomal Adam”) and the matrilineal most recent common ancestor (“MRCA” or “Mitochondrial Eve”). If you want to have your genetic ancestry documented, there are some services that can give you a genealogical DNA test.

“Enginursday: A New Approach to FPGAs!”

To increase the usability and approachability of Embedded Micro’s Field Programmable Gate Array (FPGA) “Mojo” development board, they have released a new language named Lucid. Lucid should make customizable hardware as approachable as the Arduino made embedded microcontrollers. Hopefully once things calm down with my bookshelf project, I can start playing with one of these fellows.

“Lenovo’s Projector Phone Beams a Touchscreen Onto Any Surface”

For at least a couple years now, after seeing the projected keyboards and miniature video projectors, I have been saying that what someone needs to do is create a phone that integrates the two. I was specifically thinking of something that could project your view onto a wall at the same time it could project a keyboard. Since this only has one projector it cannot do both yet, but it is certainly getting closer. Not available in the States.

“Sony’s LED Bulb Doubles as a Bluetooth Speaker”

Now if they could only get a variation of this out that supports changing the color like the Philips Hue, one would have the ultimate in mood lighting. But, none the less, this is pretty cool. Also not yet available in the States. (Do you sometimes feel like we’re lagging a bit these days?)

Article Summary 2015-05-21

Usually I send out the articles one-by-one to one or more people who I think might be interested in them. Other times, I post it to my Facebook or LinkedIn feeds. For some, clip them into my Evernote ‘Articles’ notebook so I can reference them later (which also filters out the ads). Finally, others I bookmark on my Pinboard shared browser bookmarks log.

In thinking about all this, what I have been doing is not that effective for the following reasons:

  • I am probably making incorrect assumptions in the filter bubble I inevitably create by only sending some articles to some folks.
  • I create much disjointed work for myself by being inconsistent about distribution.
  • I actually make it harder to find articles when I later need them.
  • I also make it harder to refer someone new to an article I somehow sent to someone else if they might be interested in it.

Today I am trying something new. Periodically I will then publish up to ten of the best in a simple post like this one on my blog which cross posts to Facebook, Twitter, LinkedIn, and Tumbler. Eventually, I will also send a link to the post out to all individuals who might be interested in at least one of the articles and to a general mailing list folks can sign up for if they always want to receive the post.

Without further ado, here are is the first installment:

“Boeing Patents Sci-Fi Force Field That Deflects Explosive Shock Waves”

Boeing has a way to create a “Laser-Induced Plasma Channel” (LIPC) that can absorb the shock wave produced by an explosion. While it will not divert the projectile itself, it does divert the destructive shockwave. Thank you to Josh Garrett for sharing this article.

“Jeremy England, the Man Who May One-Up Darwin”

It may be alive, but does it have a soul? Thank you to Jerry Horne (blog) for sharing this article.

“Haskell Programmers Are Liars: Or, The Real Way to Generate a List of Primes in Haskell”

Setting the reaction provoking, click-bait, title aside this is a really interesting article on Melissa E. O’Neill‘s correct approach to the Sieve of Eratosthenes implementation in Haskell.

“Ember.js: An Antidote To Your Hype Fatigue”

While certainly written with a bias towards Ember.js, this article does have a wealth of good background information on the wide-range of front-end JavaScript frameworks. It then goes on to provide an overview of Ember.js.

“Wolfram Language Artificial Intelligence: The Image Identification Project”

Being a fan of Stephen Wolfram, I have highlighted many of his articles before. Here is one reviewing their new image recognition efforts. More than just a product announcement, it goes into his background assumptions and development efforts openly discussing the challenges he faced.

“The revolutionary Lily Flying Camera Drone is brought to life thanks to 3D printing”

An amazing drone that follows you around.

“DARPA Aims to Accelerate Memory Function for Skill Learning”

DARPA is looking into “memory replay” (Restoring Active Memory (RAM) Replay) as a way to help folks remember events and learn new skills. Johnny Mnemonic will be just around the corner.

“DIY Lock Cracker”

A very clever “robot” for cracking the Master Lock combination locks. Very cool.

“New Sentry Electronic Fire Safe Opened in Seconds with No Sign of Entry” (video)

And, while we are on the topic of breaking into things, the money starts at 3:55 into the video. It is amazing what rare earth elements can do and how inexpensive they can be. Here is where you can get one of those magnets–195.8# of pull for just $88.99.

“Mad Max: Fury Road”

I have not yet seen it, but there are some interesting positive reviews coming in on what had looked to me to be not much more than a nonsensical action movie. Also, it is getting some interesting press about subverting movie sexism.



Does Your Lenovo Laptop Own You?

Anyone who has purchased an inexpensive Microsoft-based laptop recently knows how the laptop vendors “supplement” Microsoft Windows with various “pre-installed” software and utilities such as the ever-nagging “have you paid for your subscription yet” anti-virus software. Not only is this “Crapware” practice annoying, and performance degrading (original ad-laden article), but it is also can endanger your security and privacy.

Over the last week or so it came to light that Lenovo (a Chinese-owned company) installs software from a Superfish called “WindowShopper” on laptops from September 2014 to January 2015. The good news is that they have stopped doing it. The bad news is that what they did is very, very, bad. Just how bad is hard to explain to someone who has a limited to little technical understanding.

They installed this software so that they could inject ads into your browsing experience. What this means is that they sell your information to ad providers who then buy ad space. This ad space is “injected” into your browser search results. It is as if you are reading a newspaper like the New York Times and another company comes along and inserts ads into it without either the New York Times or your consent. This is called a “man-in-the-middle” attack.

Let me be really clear on this. The Superfish software is HACKING your Google search feed with a man-in-the-middle attack and Lenova knowingly facilitated this attack vector to make money by selling access their customers to help boost the profits of their cheap laptops

What makes this so bad (the “Paul Harvey Page Two” for you old timers) is that they do it on SECURED web sites because Google encrypts the results they send you (hence the “https” in the URL and the little lock icon in your browser). And, it turns out (surprise, surprise) that the software they installed to do this is flawed. The flaw lets those that know how break secured access to other sites such as . . . your bank, your healthcare provider, etc. Hopefully, you get the idea.

Here is more information:

And, some of my personal advice:

  • If you own a Lenova laptop, follow the instructions above to check and see if WindowShopper is installed. If it is, remove it. If you are uncomfortable removing it yourself, pay to have someone at your local computer support company do it.
  • If you need to buy a laptop and also need to minimize your spending in doing so by buying a cheap pre-loaded laptop, factor into the cost buying your own clean copy of Windows, wiping what comes installed on the computer, and installing your own copy of Windows from scratch. This is the ONLY sure way of having a clean Windows laptop that is not already loaded down with the “bonus” software the vendor sees fit to include. If you are uncomfortable doing this yourself, factor into the cost the expense to pay your computer store to do it.
  • Or, if you can afford it, consider buying it directly from the Windows Store. I have heard, but not confirmed, that these PCs are sold “clean” of all the adware and “bonus” software.
  • Unless you’re highly technical, my best recommendation is that you buy an Apple Macintosh. I am an Apple Fan Boy and admit it. There is a reason.
  • If you are technical, and you really want to take control of your computing environment, they buy cheap hardware and then install one of the various Linux or BSD distributions. This skips the whole Windows versus Apple debate (but does put you in a Linux vs BSD debate) and gives you the most control of the situation. Although, it isn’t as easy. “My Other OS Is Linux”

UPDATE 2015-02-25

Here are some updates:

  • Lenovo is being sued over their Superfish implementation. There was an excellent interview with Bloomberg News this morning on NPR.
  • Basically, you can no longer trust that a “secured” https connection really is secure. Turns out, that Superfish is not the only software vendor doing this for the sake of ads:
  • From this article (original) and this article (original), the following additional software providers may be doing the same thing. These providers all have an Israeli technology called “SSL Digestor” and “Watchdog”, by a company called Komodia. Basically, these are commercial tools to hack and break your box.
  • If you are a Mac user, while generally you are safer from “Crapware” you are still susceptible to ad ware. To help protect yourself, here is a good article walking you through some steps you can take (original). Also, I highly recommend disabling automatically running Flash in your browser. I don’t know if I would go so far as to shut down JavaScript; otherwise, you’ll be finding yourself managing a large exceptions list for all the sites you like that extensively use JavaScript.
  • Crisis in the House of Node.js?

    An interesting thing happened this Independence Day —TJ Holowaychuk (the brilliant fellow that wrote Empress, Mocha, Jade, Stylus, etc., in other words, a NodeJS guru) announced he is greatly reducing his work in Node.  See his ‘Farewell Node.js‘ post (best quote, “callbacks suck”).

    As can be guessed, this is causing a stir in the vibrant Node and JavaScript communities. Interestingly enough he mentions the venerable C language that I love in passing, but his next language-of-the-day love appears to be the very young Go language. Personally, I would place bets that he will eventually step away from Go too.

    Some of the reaction:

    An excellent functional-language developer I know recently described the language-of-the-day trend, especially regarding the explosion of wrappers and libraries for JavaScript, simply as efforts to make up for deficiencies in the base language that other mature languages simply don’t have or that were solved years ago (c.f. this article, by Douglas Crockford, the author of JSON).

    The ubiquity of JavaScript interest, in my opinion, is because it is a “lowest common denominator” language (as put by my functional developer acquaintance) that is initially easy for new developers to learn. It is the new, more functional, BASIC. Eventually, the most serious of these new programmers run into its problems and thus start seeking (or use their talent to re-invent) various libraries, extensions, and wrappers to try and fill these gaps.

    Perhaps some of this trend comes from our lack of the pursuit of a pre-college software development curriculum leaving smart people who may be interested in software development on their own to pursue their interest. Logically, they first turn to front-end development where they are exposed to HTML and CSS then, in turn, JavaScript and JQuery. The march then to libraries and Node.js logically follows.

    I cannot help but wonder that if we had a decent curriculum for young developers (like the one by Project Lead The Way that focuses on Python as a starter language) then these smart developers would gravitate towards C/C++, Java, or C# for imperative and Lisp/Clojure, Erlang, or Haskell for declarative development needs.

    On the personal side,  I continue to re-birth my own skills and have been refreshing my straight C skills these days, doing some bash scripting, and Java. I’ve also been wondering if Haskell can be brought to bear on some of the more complex algorithm challenges I have at LigoSphere.