Tuesday, March 07, 2017

npm3 Shenanigans

I'm beginning to see why people hate npm. Both npm-shrinkwrap and npm3's dependency deduping are terrible ideas. npm-shrinkwrap is meant to solve a problem that has to do with programmers incorrectly using semver to specify dependency versions, thereby encouraging programmers to keep incorrectly using semver and putting an ever-expanding bandaid on it, rather than fixing the actual problem. npm3's dependency resolution fixes a problem that npm never had, with a poorly designed feature that is way outside of npm's scope. Instead of including all sub-dependencies with the package that requires them, like npm2 did, npm3 will attempt to merge the dependency trees. This means that the resulting dependency tree will differ depending on install order. "Does this matter? No!" says the documentation; except it totally does: 1) Some problematic package installs become intermittent, 2) The size of the install is sort of arbitrary, and 3) Don't tell me you've never edited a source in node_modules for debugging purposes; now these will (maybe/sometimes) affect all the subdependencies that also use the same module, making it that much harder to debug. Luckily, npm3 still allows you to specify --legacy-bundling to avoid automatic deduping entirely. Keeping my fingers crossed that they will keep this option indefinitely. As for npm-shrinkwrap, just don't use it! If a dependency doesn't use semver correctly, either don't use that dependency, file a critical bug, or fork it and fix it yourself.

Friday, December 23, 2016

Inside: Game Review, Theories, Major Spoilers

Limbo's distinctly noire style,
film grain and all.
Limbo has been my favorite game for a number of years now. I've been following its maker, Playdead Studios, anticipating the release of its new game, Inside, ever since it's been announced. That is, up until last summer, when I got sidetracked by other things, and apparently missed the fact that the game was released on June 29th of this year. Not only am I several months late to the release party, but I only found out about it at all after listening to Polygon's "Besties" podcast. Needless to say, I purchased the game for my PS4 immediately.

Inside continues to explore the all familiar world of environmental puzzles, suspense, and horror, that Limbo established so well. Inside has a very similar feel of a bleak, hopeless world, where science seems to exist solely for the purpose of conducting experiments on human (and sometimes pig) bodies. However, unlike Limbo, where the general feel was eerie emptiness and abandoned machines, the world of Inside is very much populated with humans, and things that seem to have been human in the past, which makes the game feel even more suspenseful and frightening.

The art style of Inside is a stark contrast with Limbo. Even though it's still a 2D puzzle platformer, it's rendered in a 3D engine, which makes the world more immersive, and gives the player much more depth perception, especially when things happen in the background. This mostly does not seem to impact the puzzles themselves, but it certainly contributes to the storytelling and the building of anticipation and suspense. Inside still keeps to a very modest color palette, so while not entirely black-and-white, it still feels just as drab as Limbo. Nearly the only bright color you'll see in the game is the boy's red shirt, which makes him stand out from the rest of the world.

Inside spent 5 years in development prior to its release, and the amount of polish on this game is remarkable. The way that the camera moves when you enter a new room through a doorway, with just enough delay to show you that there is indeed a wall there, but not enough to make it annoying when the character is obstructed. The way that it zooms in on small rooms and tight crawl spaces, and pans way out to open up the vast scape of underwater depths. The background scenes of marching zombies, that serve as an omen of what's to come. The scenes where you reach a domed glass window, and you lean against it and hope to see what's ahead, but the camera stops just shy of revealing the secret. The sound track and effects are glorious. Nothing ever glitches or looks out of place. It feels like you're inside a real world. A horrible, nightmarish world with procedurally animated sacks of bone and gore.

The reaction of other characters in the game feels extraordinarily genuine. There's a scene where you hang over an large open hatch, in plain view of a couple of scientist, while watching them get increasingly agitated. If you keep waiting for a while, they eventually scramble to pull in a portable security robot to take you down. It just makes you feel like there are real people on the other side of the screen, and just like yourself, they don't always succeed in what they do; your success is their failure.

Rather than stick with pushing boxes and pulling levers, Inside introduces a number of new mechanics, all of which work very well. The most heart-thumping of these is the concept of baiting, where you get to make someone almost catch you, just to keep them far away from something that you can then proceed to quickly run to. The little boy can swim now, and the submersible adds to your ability of exploring the underwater world without the sort of time limits that holding your breath underwater would require. There is a new take on gravity puzzles, where the ocean hangs above you. What should seem like a familiar Limbo mechanic of changing water levels feels fresh and new. Last but definitely not least, the ability to put on a helmet and control other zombies is mind-blowing. But more on that later.

My main gripe about Inside is its difficulty level. It felt much easier, and hence much shorter than Limbo. After you inevitably get absorbed into a conglomeration of bodies that the Internet has been lovingly referring to as the Blob, the game becomes mostly a story book, where you get to run across the screen, destroying everything in your path. There are a couple of puzzles here and there, but they're easy and scarce. So while it was still interesting from a storytelling perspective, this segment didn't satisfy my craving for awe-inspiring puzzles that I assumed I would have to solve to finish the game.

Then there's the ending. I guess I liked it. It was abrupt. It was definitely a huge slap in the face of the player. "You wanted to escape, right? Well, you escaped. Congratulations. Also you're a horrible limb monster." Were they just trying to make a joke about the alternate meaning of Limbo? There have been a number of theories floating around the internet about what the ending tells about the main character of Inside. I'm going to stick to the one that makes almost too much sense.

The secret ending gives away a lot of it. In it, the little boy encounter an office space with a computer terminal and a mind control helmet, that's hooked up to... unknown. As he rips the cable out of the wall panel, the system powers down, and everything goes dark. But just a second before it does, you see that the little boy slumps over and becomes motionless, exactly the same way as the zombie puppets do when they're disconnected from mind control. It's very clearly established that the little boy is a zombie puppet himself.

It was also well established that zombie puppets can themselves operate mind control helmets to control other zombie puppets, in what was easily my favorite mechanic of the game. The first time I plopped a zombie's head into that glorified lampshade, and that cardboard box popped open to reveal another zombie, my jaw hit the floor. I had never experienced anything even remotely like this. I only wish that the creators had used this mechanic in more puzzles, and maybe layered more of that Inception-like goodness and eventually had you controlling a 10th order zombie to perfectly trigger a chain of events that would solve the puzzle.

But I digress. Just prior to the final segment, where Inside goes full Cronenberg, and the little boy is absorbed by a mushy sack of bodies, you are tasked with unhooking it from four mind control helmets. The blob, of course, is using these helmets to control other zombie puppets. It would make total sense if the blob had been controlling the little boy all along, only to lead him into the water tank and absorb him.

Some of the related theories fall apart for me. One is that the little boy is somehow special and gives the Blob superpowers, which is how it's able to escape. I think it's far more likely that the little boy is just a sack of meat and bones, like all the other zombie puppets. It just so happens that the Blob absorbs enough bodies by the time you encounter it, that it feels strong enough to attempt to escape.

The other theory is that the Blob is actually controlling you, the player, who is in turn controlling the little boy. This doesn't make sense to me, because once the blob is unhooked from the mind control helmets, you're still controlling it, not the other way around. I think the Blob is controlling the little boy.

So who is really controlling the Blob, then? That part is definitely ambiguous. It could be a rogue scientist, or it could be you, the player. One may surmise that you are the real Blob, holed up Inside your living room, playing video games, and absorbing all of their mindless zombie characters into yourself, until eventually you feel overwhelmed and want to escape.

Monday, November 16, 2015

CitiBike Guest

I've been using CitiBike for a couple of years now, and mostly loving it; especially now that they have a bunch of stations in Jersey City!

Here's an idea: make it easier to give rides to guests. Why? I often wind up in a situation where I want to ride my bike with another person, but they don't have a CitiBike membership, so I have to convince them to try it out, and then go to the pay station, insert my credit card, and get the unlock code, all whilst my guest is getting uncomfortable and eventually changes his/her mind.

Instead, I would like it to work like so: *blip* I just got a bike; *blip* I just got a bike for my guest. The advantage? My guest isn't aware of any transactions involved, and doesn't have time to change his or her mind. Here's how it would work:
  1. I use my key to unlock my own bike. The light turns green and I take the bike out.
  2. I use my key to unlock my guest's bike. The light starts flashing green.
  3. If I press "1", my credit card (on file) gets authorized, and the bike gets unlocked. If I press anything else, or don't press anything at all, nothing happens. This way I can never accidentally unlock an extra bike if the previous bike I docked failed to lock. This also has an extra advantage that if I'm just trying to unlock a bike for myself and the light starts flashing green, I will *know* that my previous bike failed to lock and I can inform CitiBike.
The guest's bike would get charged per hour of use, just like it does currently, and I think it would convince many to actually get a membership!

Tuesday, September 01, 2015

Why UltraViolet is a failure.

I bought yet another blu-ray movie with one of those "redeem your digital copy" cards inside. I usually ignore them, but this time I thought, why not? UltraViolet seems to be a thing now; it stood up to the test of time. My optical media isn't going to last forever, so I might as well get my moneys worth!

To start, I searched for an iOS app that plays UltraViolet movies. No such thing. There are apps that supposedly connect with UltraViolet to redeem the purchases, which allow you to then stream or download from a digital retailer, such as Flixter, Vudu, or M-GO.

Fair enough, let's start with Flixter. Netflix? Nope, that was Quickster. Whatever, this one's owned by Time Warner. How are the reviews? Four and a half stars! Great! Oh... no, it doesn't actually play movies. Scroll down. Flixter Video! One and a half stars?! Okay, maybe the reviewers were a little harsh. Nope! Most of the complaints are about not being able to play movies offline, or not being able to play movies at all. Not going to bother with this one.

Moving on: Vudu. Same story.

M-GO. Good reviews. Nice interface. Setting up an account was pretty easy. Okay, now I have to set up an UltraViolet account, too. Now I have to link it to the M-GO account, which is done by entering my UltraViolet credentials on M-GO's site. Not very secure, but whatever – it's not like my UltraViolet account has got anything to steal. Linked!

Finally! Let's add those movies! Enter the redemption code on UltraViolet's site. Choose your digital retailer: Flixter or Vudu. That's it. Try another movie code? Same story. Enter the code directly on M-GO? Doesn't work, of course.

Dear Time Warner and Walmart and all the movie studios that made a deal with these decrepit spawn of digital hell: let me recap my situation. I wasn't entirely happy with how Apple handled things, what with their DRM and being restricted to their ecosystem to watch any of my purchased movies. Honestly, it was mostly a matter of principle, because I was actually able to play those movies on all of my devices. The only real issue was "if I ever switch to Android", which of course doesn't support iTunes purchases. Instead, I now have these mysterious UltraViolet digital... somethings. These somethings have zero chance of being played back on any of my media devices.

Saturday, December 06, 2014

iPhone 6: The Good, The Bad, and The Mediocre

© 2014 Apple Inc.

I finally got my iPhone 6 in the mail, and after playing around with it for a couple of days, I have many a praise, but also a few criticismesses.

The Good.

1. Touch ID.

Yes, I know, it's been there since the iPhone 5S. However, since I'm upgrading from the iPhone 5, it's new to me.

Words cannot express how well this feature works. It is simply amazing! It reads your fingerprints and only your fingerprints, and it reads them every time without fail, in a mere fraction of a second. You can store multiple fingerprints, which is very helpful if you want to unlock the phone with either hand, or maybe if several people are using the same device.

2. Slo-mo video recording at 240 fps.

It's official: my iPhone sees better than I do. Watch a droplet of milk fall into a cup of coffee, a pro skateboarder perform a complicated trick, or your house lights flicker, all at an impressive 720p resolution. Oh yeah, did you know your house lights flicker 60 times per second? I didn't, until I watched it in slo-mo.

3. Flash photography.

I believe the advanced flash was also introduced in 5S, but it is nonetheless remarkable. No more zombie-colored portraits! In fact, I will go ahead and state for the record that at close range, my iPhone 6 produces the best flash photography I've seen so far.

4. Video stabilization.

It's there, it works, and it makes videos look a lot smoother and more professional than they used to be.

5. Speaker.

For some reason, no one mentions this: the iPhone 6 has a massive speaker, compared to the minuscule, tinny-sounding speaker of the iPhone 5. You can actually hear the bass lines this time around, and it won't make that horrible clipping noise when you turn the volume all the way up.

6. Retina.

Not a new feature by any means, but the screen is as gorgeous as ever, perhaps even more so, now that it's quite a bit larger.

7. Background App Refresh and Google Hangouts.

Not really an iPhone 6 feature either; it has more to do with iOS 8 and Google doing a great job on the app.

After jumping through a few hoops, I was able to direct all my Google Voice messages (SMS) to Hangouts, and from there on it was smooth sailing. The push notifications work, and since the app uses background refresh, your messages are already loaded when you swipe on the notification. There's no wait time for the message to load, and you don't even have to be connected to the internet at that point. What does that mean for me? It means I can still read my SMS in a timely fashion, despite the fact that my Gmail emails now arrive with a 15 minute delay. More on that in a bit.

The Bad.

1. I don't like giant phones.

It's a personal preference. Many people like giant phones: there's a reason why Apple made the iPhone 6 Plus. The iPhone 5 was already too big for my liking. The iPhone 6 is so big that I can no longer hold it with one hand and press the home button. I have to use a new "typing grip" as well: holding the iPhone 6 by the sides with my index fingers, and supporting it on the back with the rest of my fingers, while typing with my thumbs. Typing and holding the phone with the same hand is now completely out of question.

2. Camera sticks out.

Everyone knows about this. It's ugly, and if you don't have your phone in a case, it will never lay flat on a table. That said, I always have mine in a case, so it's not a problem.

3. No support for push for Gmail accounts.

This was probably the biggest upset for me. It's not entirely Apple's fault. Some of it is Google's. You see, Apple never supported push via IMAP. However, there was a way to get around that, by setting up Gmail as an Exchange account instead. However, at the end of January 2013 Google disabled the ability to use Exchange to connect to your Gmail account, on any new devices. This means that my email now arrives with a 15-minute delay, which makes SMS forwarding pretty useless.

I tried out a bunch of email apps to connect to Gmail instead, such as the official Gmail app, Mailbox, and myMail. They all seem to share at least one common problem: there is no support for background app refresh. Which means that when you swipe on that email notification, you have to have an internet connection, or else your email won't load. And even if you have it, there is an annoying delay before you can read the email.

Luckily for me, Google Hangouts implemented support for background app refresh, and it works beautifully. They've also integrated Hangouts into the web Gmail client, which works great as well, both for Hangouts/G-Chat and for SMS. So now I can say "adieu" to SMS-to-email forwarding; it has lost its use, and has been superseded by newer and better technology.

4. iOS 8 app crashes and bugs.

iOS 8 is not the most stable of operating systems. Though I'm not seeing as many rendering artifacts as I did with my iPhone 5, both Mail and Camera apps have crashed on me way too many times. There are some interesting bugs as well. For instance, try putting the Camera app into the video recording mode, hit "play" from the Control Center, and then start recording a video. If you listen closely, you will hear the sound of Apple's programmers getting fired. 

The Mediocre.

Battery life.

Sure, it's better than the battery in my iPhone 5, which after two years of use lasts for about 15 minutes during active use. The iPhone 6's battery went down to about 65% after two hours of dicking around. And I'm not talking about heavy usage and playing video games that will make your phone warm enough to heat your apartment during winter. No, just playing around with settings and shooting a few 30-second slo-mo videos. Not great.


Overall, I'm quite pleased with what the iPhone 6 has to offer. The slo-mo feature alone kept me occupied for hours at a time! Now let's get some support for push in Gmail accounts, and "we in beez"!

Friday, August 22, 2014

L00k, I haz JavaScriptz!!! ô-ô

I recently published several JavaScript libraries. Some not so recently:)

#1. Freemason


A build utility that is super-simple to use and doesn't require any configuration. Here's an example:
var build = require('freemason').tasks;

#2. Require


Client-side asynchronous script importing, built on top of LABjs. Here is an example:
var YourModule = require('/path/to/your_module.js', function() {

#3. Wedge


A browser compatibility shim. Currently supports IE 8+.

#4. TemperSynth

A musical synthesizer with dynamically controlled scale temperament. This was my music hackathon project @ Spotify.

Thursday, May 22, 2014

Friday, November 15, 2013

Recruiter Professionalism

I've been searching for a new job since last week, and my life has been pretty much consumed by phone calls and interviews. Some good, some bad, some... ugly.

This morning, a certain recruiter, let's name him Ryu, calls me. Immediately after I pick up the phone, he puts me on hold for several minutes, and then the call ends abruptly. A minute later, Ryu calls me back, saying that he wants me to come in for an job interview with a certain company next week. "This will not be a technical interview," he says, "they just want to meet you, and then maybe you can meet their design team on another day, and if everything goes well they'll schedule you for a technical interview."

All this is really starting to sound like a lengthy process to me, so I let Ryu know that I am expecting offers to start coming in next week, and he of course wants to know which companies I'm expecting offers from. "Two of these companies are through personal connections," I say, "so I can't really tell you what they are." Without giving me the opportunity to tell him about the third company that I can indeed mention, he interrupts me.

"Well I'm not going to represent you if you can't tell me who you're interviewing with!" Ryu says with increasing fervor. I proceed explaining to him that those companies have specifically asked me not to reveal their identities to recruiters. "That's fine then, I'm just not going to represent you!" he repeats.

At this point I feel that this conversation isn't going anywhere. "Okay man, it was great talking to you." I say and hang up. A few seconds later Ryu calls me back. I patch him through to voicemail. Here is the transcription, verbatim:
Ah... I wasn't done, but... I wish you all the best Alex, you shouldn't hang up on me, because it's a small world, but... shame on you. That... That's just disrespectful, and I don't disrespect people, and... ah... I wish you all... all the best, but shame on you and ah... I... I... I... I hope you can work on your people skills, 'cause that was just... unprofessional. Bye.
Hm. Hadn't he just pointed out that he wasn't going to represent me? Twice? I felt the need to reply at this point. Maybe because I was so ashamed of myself. Here's what I wrote to Ryu in an email:
Hi Ryu,

"I'm not going to represent you" sounded pretty final to me. Not sure what else you were going to say, but speaking of being unprofessional: "shame on you", threatening me, and to a lesser extent putting me on hold and hanging up on me (yes, you just did that) qualifies as such.

Not representing me is your own personal choice, and clearly I'm not in a position to convince you otherwise. I hope you have a wonderful day, and many new clients.

- Alex S.
Seven minutes later, he replies to my email. Again, verbatim:
I got disconnected because my phone cut out

You were being irrational and the fact you don’t trust me says a lot

Good luck to you and shame on you for these threats
Uh. I'm not sure what confuses me more: the lack of punctuation, the fact that he is accusing me of being irrational and threatening, or the ambivalent last sentence? Either way, I am very, very ashamed of myself.

Sunday, September 22, 2013

What the iPhone 5C actually is.

Photo © Apple.

People, the "C" in "iPhone 5C" stands for "colorful", and not "cheap" or "China" as the Internets are speculating. Apple's website says so, right there in the tagline, so let's end this debate.

A more interesting question is, what is an iPhone 5C under the skin? Simply put, it is an iPhone 5 with a plastic back and a slightly upgraded camera. If you want to get technical, the guts have been reworked, but the components are mostly the same.

But why not just sell the old phone, like they did before? Two reasons. The obvious one is that a redesigned phone will sell better than last year's model. The other potential reason is that Apple is reducing the manufacturing costs by replacing an expensive dye-cut aluminum case with molded plastic. Moreover, the more expensive iPhone 5S uses the same case as the iPhone 5, albeit with three different finishes, so it's quite possible that Apple kept the tooling and the production capacity for the expensive aluminum case exactly the same.

It's nice to see a rounded plastic back making a comeback, though. I've been missing the ergonomic feel of my iPhone 3G for quite some time now. Apple's silicone covers for the iPhone 5C, however, are hideous.

Friday, August 23, 2013

The new Batman movie will star Ben Affleck as Batman, Kevin Smith as Superman, and Chris Nolan as Heath Ledger; directed by Christian Bale and produced by Bruce Wayne.

Tuesday, August 13, 2013

Geotracking Paranoia

An article repost hit Facebook today about the "new hidden threat" of geotagging to your children, along with a short video segment from NBC on the topic. This "news" is spreading like wildfire, so before it gets out of control, please let me intervene.

The video mentions that this concerns "unwitty" users. If you are, in fact, unwitty, here is a couple of suggestions:
  1. Don't have children in the first place. You are endangering their lives every day by being unwitty.
  2. Don't use technology. You clearly don't know how it works or what it does.
If you're unsure whether you're unwitty, or if you're unsure whether you should be legitimately paranoid about geotagging, here are a few questions you could ask yourself:
  1. Did you know that Twitter is a public broadcast service, not a private photo gallery? If you did, you probably already knew that anyone, literally anyone, can read your posts.
  2. Did you know that your photos can be geotagged, and that you can turn that feature on or off at the time of your post?
  3. Can you put two and two together, and figure out that if you publicly post geotagged photos, everyone, and I mean everyone, will know exactly when and where the photo was taken?
  4. Did you know that even if your posts are completely private, the sites you're posting to still have full access to everything you're posting, and that all of that information can be released if subpoenaed by the government?
If you already knew all of that, there is one more question you need to ask yourself:
  1. Does the ability to plot data points on a map scare you?
If yes, you should put at least ten locks on your front door, at least fifteen on the back, board your windows shut, and hire at least two armed bodyguards to stay with you at all times, and also one bodyguard per child to stay with them.

If not, go on about living your life. Your children are safe as long as you're not being a dumbass.