log.nikhil.io

Posts tagged “computers” 25

The AppleTV Remote Sucks

Dec 9 It’s so bad a Swiss company made a much saner substitute that sells for ~$20.


Nov 16 Looks like you can use the old remote with the new AppleTV.


I’m annoyed every time I have to use the infernal thing.

  • It tries (poorly) to be something other than a damn TV remote1.
  • There’s no way to tell which end is up.
  • There’s no accidental tap detection when you pick it up.
  • It’s way too small.
  • It’s way too slippery.
  • I use Siri to skip forward and backward because the edge clicks are unmemorable and dysfunctional.

I use the iPhone app when I can and, while I can’t stand the terribly implemented inertial scroll, still find it better than the hardware.

Inertial scrolling does in fact exist on the Siri remote, but the effect is muted. The on-screen movement doesn’t accurately reflect your swiping — scrolling is staggered and it often stops abruptly, when you don’t intend to stop. This makes aspects of navigation, like manual search or entering your email address or password, extremely cumbersome.

– Dave Smith, “My biggest problem with the new Apple TV remote

See also: Steve Brykman of ArsTechnica’s thoughts on “the nightmare horrorshow” that’s the remote.

  1. “You’re basically getting a giant iPad game that you have to play with a tiny remote” 

AppleTV, AppleTV, AppleTV

I absolutely love Dustin Curtis’ splendid explanation of “AppleTV” branding that’s making making the rounds on HN. For posterity, I stole this handy color-coded transcription off Michael Tsai’s blog.

See also: The intractably stupid AppleTV Remote.

Data, Data, Data

Linus Torvalds on git

I’d also like to point out that unlike every single horror I’ve ever witnessed when looking closer at SCM products, git actually has a simple design, with stable and reasonably well-documented data structures. In fact, I’m a huge proponent of designing your code around the data, rather than the other way around, and I think it’s one of the reasons git has been fairly successful

[. . .]

I will, in fact, claim that the difference between a bad programmer and a good one is whether he considers his code or his data structures more important. Bad programmers worry about the code. Good programmers worry about data structures and their relationships.

Computers Are Fast

A nice little quiz meant to illustrate how much your typical Python and Bash code can accomplish in one second.

If the answer is 38,000, both 10,000 and 100,000 are considered correct answers. The goal is to not be wrong by more than 10x :)

and

A newer computer won’t make your code run 1000x faster :)

Digital Octopode

Never knew this was a thing. Behold a pliable, $200 digital model of an octopus for 3D Studio Max (with “72366 Faces and 71879 Vertices.”)

Two Levels of Not Giving a Fuck

No Code is the best way to write secure and reliable applications. Write nothing; deploy nowhere.

Start by not writing any code.

Brilliant. I love both the presence and contents of the Dockerfile in that repo. As is always the case with such projects, the issues and pull requests are 💯

And if one is tempted to go against the tenets of No Code, there’s always my beloved fuckitpy, a (strangely well-thought-out) “Python error steamroller”1:

@fuckit
def buggy_function():
    problem_solved

@fuckit
class BuggyClass(object):
    def __init__(self):
        everything_works_now

And:

This module is like violence: if it doesn’t work, you just need more of it.

  1. Inspired by FuckitJS

Dancing & Walking

From 2016. I wonder how long this would take to render on the latest and greatest graphics card (an nVidia RTX 2080 Ti that sells for $1,200.)

I could watch this one for hours and might just loop it on the old iPad

Text Objects versus Motions

Excellent talk by Chris Toomey on Mastering the Vim Language. Features a lot of must-read Vim resources and nice-to-have plugins. Key takeaway for me: Prefer text objects to motions when possible (corollary: “Is this repeatable?”)

The Korn Shell

Good talk by Siteshwar Vashisht at FOSDEM 2019 on maintaining the Korn shell and old codebases in general. I came by his work while reading up on the fish shell. Featured this nugget

He talks about how they removed dead/inapplicable code and micro-optimizations, refactored a lot of legacy code, improved tests, switched to a new build and CI system, and so on.

Began with this baffling one-liner that won the International Obfuscated C Contest in 1987

main() { printf(&unix["\021%six\012\0"],(unix)["have"]+"fun"-0x60);}

And reminded me of this Aaron Sorkin-esque story about David Korn which I heard via BLN

Greg Sullivan, a MicroSoft product manager (henceforth MPM), was holding forth on a forthcoming product that will provide Unix style scripting and shell services on NT for compatibility and to leverage UNIX expertise that moves to the NT platform. The product suite includes the MKS (Mortise Kern Systems) windowing Korn shell, a windowing Perl, and lots of goodies like awk, sed and grep. It actually fills a nice niche for which other products (like the MKS suite) have either been too highly priced or not well enough integrated. An older man, probably mid-50s, stands up in the back of the room and asserts that Microsoft could have done better with their choice of Korn shell. He asks if they had considered others that are more compatible with existing UNIX versions of KSH.

The MPM said that the MKS shell was pretty compatible and should be able to run all UNIX scripts.

The questioner again asserted that the MKS shell was not very compatible and didn’t do a lot of things right that are defined in the KSH language spec. The MPM asserted again that the shell was pretty compatible and should work quite well.

This assertion and counter assertion went back and forth for a bit, when another fellow member of the audience announced to the MPM that the questioner was, in fact David Korn of AT&T (now Lucent) Bell Labs. (DavidKorn is the author of the KornShell).

Uproarious laughter burst forth from the audience, and it was one of the only times that I have seen a (by then pink cheeked) MPM lost for words or momentarily lacking the usual unflappable confidence. So, what’s a body to do when Microsoft reality collides with everyone else’s?

Data, Data, Data

Vicki Boykis’ excellent article on every aspect of ‘Data Science’ I can think of: a little history, employment prospects, skills, education, and continuous learning.

It would appear that more than half the job, at least, is wrangling (replicating, cleaning, imputing, transferring, understanding, augmenting) data. It’s boring and super-important so, of course, is the least favorite thing 🙃

Source

A Lisp Interpreter in Python

Peter Norvig: (How to Write a (Lisp) Interpreter (in Python)).

See also: HyLang. Looks super cool and always makes me wonder if anyone’s ever used it in production.

JavaScript Delenda Est

Back in the second century BC, Cato the Elder ended his speeches with the phrase ‘Carthago delenda est,’ which is to say, ‘Carthage must be destroyed.’ It didn’t matter what the ostensible topic of the speech was: above all, Carthage must be destroyed.

My opinion towards JavaScript is much like Cato’s towards Carthage: it must be rooted out, eliminated and destroyed entirely. I don’t know if I’d go quite so far as to say that the fundamental challenge of mass computing is the final destruction of JavaScript — but I want to say it, even though it’s false.

JavaScript is a pox, a disaster, a shame. It is the most embarrassingly bad thing to become popular in computing since Windows 3.1. Its one virtue (that it’s on every client device) is outshone by its plethora of flaws in much the same way that a matchstick is outshone by the sun, the stars and the primordial energy of the Big Bang added together.

JavaScript is the XML, the Yugo, the Therac-25 of programming languages. The sheer amount of human effort which has been expended working around its fundamental flaws instead of advancing the development of mankind is astounding. The fact that people would take this paragon of wasted opportunity and use it on the server side, where there are so many better alternatives (to a first approximation, every other programming language ever used), is utterly appalling.

JavaScript delenda est.

I don’t know what my newfound affection for it says about me. Via HackerNews.

Gandhi the Annihilator

At least in Civilization:

[. . .] Gandhi tends to be the first to use nuclear weapons, and spares no expense on wiping your civilization off the map. You probably always thought you were crazy — how could a series that prides itself on historical accuracy portray Gandhi so wrong? Well, you’ll be happy to know that both your sanity and Civilization’s historical integrity aren’t at fault. Instead, a bug’s to blame.

In the earlier Civs, leaders are given a set of attributes that dictate their behavior. One such attribute is a number scale associated with aggressiveness. Gandhi was given the lowest number possible, a rating of 1. However, when a civilization adopted democracy, it granted a civilization -2 to opponent aggression levels. This sent Gandhi’s rating of 1 into the negative, which swung it back around to 255 — the highest possible rating available, and thus, the infamous warmonger Gandhi was born.

– Geek.com, What caused Gandhi’s insatiable bloodlust in Civilization

And they just left it in there as an homage:

This cyclical aggression scale was fixed in later versions of the game, but Gandhi wasn’t totally cured of his bloodlust. The team fixed Gandhi’s aggression rating, but as an Easter egg paying homage to the earlier aggressive versions of Gandhi, ramped his nuke rating through the roof. So, while it may be difficult to push Gandhi over the edge, he goes from zero to nuclear option once you do.

Via MS.

Assistant Executive for the Task Force on Employee Services

Via GLP, a University Title Generator that generates “prestigious” titles and associated salaries. A few random gems

  • Associate Coordinator of the Subcommittee for Community Services
  • Deputy Vice President of the Office of Alumni Planning
  • Provost for the Subcommittee for Investor Diversity
  • Vice Chair of the Subcommittee for Donor Technology

Alan Kay on OOP

OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I’m not aware of them.

Dr. Alan Kay on the Meaning of “Object-Oriented Programming”

So… Erlang? (RIP Joe Armstrong 🙏) And that was before this

(I’m not against types, but I don’t know of any type systems that aren’t a complete pain, so I still like dynamic typing.)

Indeed, Dr. Kay.

Old iOS Theme

Found screenshots of a beautiful vintage theme I’d installed on my iPhone 5 via Cydia when I was stupid enough to jailbreak my phone. Wish I could still use it though 😍

Witch

Witch is +tab on steroids.

Hugo Migration

Gave Hugo a try and was quite impressed by the ease and speed. The official documentation kinda sucks at introducing key ideas (like taxonomies) in a gradual way that’s helpful to newcomers, but is great for variable and function references. Found these two posts very helpful. Here’s another that explains template variable scope well. And another that goes over theme development step-by-step.

Sticking to Jekyll for now since

  • I don’t post that often and can wait a minute for recompilation if/when I have that many posts
  • Hugo does not compile SASS like Jekyll; don’t want to make an asset pipeline or turn to readymade solutions like this
  • It doesn’t do archives like Jekyll. Approaches like these might be creative but… 🤷‍♂️

Hugo is as insanely fast as advertized. I love the section and taxonomy abstractions, myriad content types, and I18n support. I’d use it to build any static website that’s not a blog. For now, Viva Jekyll.

Letters to a Computer

The Des Moines Register on how to send them email in (I’m guessing) the late 80s/early 90s.

DSM Register on how to send mail to a computer

An article on how Baud Rate isn’t the same as Bit Rate

Baud rate refers to the number of signal or symbol changes that occur per second. A symbol is one of several voltage, frequency, or phase changes. NRZ binary has two symbols, one for each bit 0 or 1, that represent voltage levels. In this case, the baud or symbol rate is the same as the bit rate.

– Lou Frenzel, Electronic Design, “What’s The Difference Between Bit Rate And Baud Rate?

Via /r/bitcoin

UI Pedantry

Can’t Unsee is “Spot the difference” for UI nerds. 6530. On the “hard” sections, wondered how much the minutiae matter if a user is unable to discern the difference between two comps after a few seconds.

Via Deepu

A Love Letter to the Internet of Old

In an age where we interact primarily with branded and marketed web content, Cameron’s World is a tribute to the lost days of unrefined self-expression on the Internet. This project recalls the visual aesthetics from an era when it was expected that personal spaces would always be under construction.

Numbering from Zero

Dijkstra on why numbering should start from zero.

Numbering is done with natural numbers. Let’s take zero to be the smallest natural number1. For the sequence (2, 3, 4, … ,12), using the convention (2 ≤ n < 13) is appropriate because

  • For a sequence starting with zero, like (0, 1, 2, 3), the left hand condition leaks into unnatural numbers if you use “less than”: (-1 < n).
  • For an empty sequence, the right hand also leaks into the unnatural if you use “less than or equal to”: (n ≤ 0)

And minorly, because these are the true of another convention (1 < n ≤ 12)

  • Difference between bounds (13 - 2 = 11) is the length of the sequence
  • I know that these two sequences are adjacent: (2 ≤ n < 13) and (13 ≤ n < 24)

All that’s prep for:

When dealing with a sequence of length N, the elements of which we wish to distinguish by subscript, the next vexing question is what subscript value to assign to its starting element. Adhering to convention a) yields, when starting with subscript 1, the subscript range 1 ≤ i < N+1; starting with 0, however, gives the nicer range 0 ≤ i < N. So let us let our ordinals start at zero: an element’s ordinal (subscript) equals the number of elements preceding it in the sequence. And the moral of the story is that we had better regard – after all those centuries!2 – zero as a most natural number.

There’s also this little nugget

I think Antony Jay is right when he states: “In corporate religions as in others, the heretic must be cast out not because of the probability that he is wrong but because of the possibility that he is right.”

  1. TIL that this can be so. 

  2. Don’t know what he means here… 

Node Modules

For a single project I made the mistake of working on in my Dropbox folder:

Wonder what the downsides are to hardlinking by default. And, fundamentally, why creating an amazing, Python-like standard library is such an intractable problem in the first place.

[. . .] core-js is also utils library, quite a big one honestly! It has so many functions inside I bet a lot of other packages will be using it!

Not really. Only babel-runtime has it in its deps. Oopsie. And returning to the starting point, cli uses only 3 (trivial) methods from common-tags — stripIndents, stripIndent, oneLine. Oopsie daisy.

In order to use these 3 methods node_modules needs 1826 files. And that’s just 4 of mentioned 976 installed packages.

– Mateusz Morszczyzna, What’s really wrong with node_modules and why this is your fault

🤦‍♂️ The portion of the article that listed functionally similar packages and is-* packages was particularly dismaying. As he points out, there’s a good reason why jQuery and lodash are as immensely popular as they are1.

  1. Was wondering if we’ll ever get back to the magic of hand-crafted web pages and found this article which led me to this modern Geocities clone 💖 

Clay and Lego

Winter Coding Challenges