Friday, August 22, 2014

L00k, I haz JavaScriptz!!! ô-ô

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

#1. Freemason

https://www.npmjs.org/package/freemason
https://github.com/spikesagal/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;
build.concatenate('LAB.src.js','jsrequire.src.js');
build.minify();
build.attribute('src/credits.txt');
build.write('dist/jsrequire.min.js');

#2. Require

https://github.com/spikesagal/require

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

#3. Wedge

https://github.com/spikesagal/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.

Monday, August 12, 2013

Letterpress Strategies

I've been playing Letterpress on iOS for a while now. It's a great puzzle game; sort of a hybrid of scrabble and chess. If you haven't tried it yet, give it a shot!

Long story short, I got pretty good at it, and I'd like to share some strategies with you. They're somewhat ordered from the most basic to the most advanced. Without further ado, here they are:


If blue takes the "M" tile, Red can
 win the game on the next turn
with "FULLY". 

Mind the endgame.

One of the first and most important things I learned about letterpress is that you could be winning by a hefty number of points, and the next turn you lose the game. Always ask yourself, can your opponent close the board with the next turn after you've made yours? And if so, will they outscore you? Sometimes you will have to purposely not use an open tile, making it less likely for the opponent to use all the remaining open tiles to win the game.



The scores may be even, but blue
has the advantage with three
blocked tiles

Blocking tiles is what matters most.

Even if you just used half the tiles on the board, if you didn't block them off, they can easily turn over to your opponent.

Don't be fooled by the running score. The score only matters at the end of the game. Oftentimes, using shorter words that block more tiles is better that using longer words that don't block as many tiles.





Block corners first. 

Blue blocked off "E", which is the
most commonly used letter in
English. He could've blocked "D",
But there are three of those on
the board.
Corner tiles are the easiest to block, since they only require two adjacent tiles. Sides need three adjacent tiles, and the tiles in the middle of the board need four.
If you have the first turn, try blocking corners on your first move. It will provide for a nice head start. If a corner is already blocked by your opponent, try blocking a different corner.

Block commonly used letters with rarest occurrence on the board. 

Think vowels, especially "E". If there is only one "E" on the board, and it's in a corner, try to block it off. It will be very easy for you to defend, and hard for your opponent to take.

Blue left "Q" for the last turn.

Blocking hard letters. 

Letters that are hard to use, like "Q" or "Z" don't necessarily have to be blocked off. They will be harder (or impossible) to use for the opponent anyway. However, you can also use these letters to either securely block other tiles, or to detract the opponent from blocking his.

Save super-hard letters for endgame. 

Sometimes there is only one possible word you can make with a certain letter, and it's a short word. If you use it too soon, you may be giving your opponent a free turn to block more tiles.

Don't let blocked tiles lead you away from using them. 

If blue needs one "F" in his word,
It's better for him to use the one
that's already taken by his
opponent.
They won't turn over to you, but they are still very much in play, and can let you make better and longer words. In the example above, Blue can play "QIS" to win the game, even though "I" is blocked off.

Turning over vs. taking a new tile. 

The same letter can often be found on both an unused tile and a tile that has been taken by your opponent (but not blocked). Unless taking the unused tile will block another tile, it is almost always better to turn over your opponent's tile.

Double-block. 

Blue has "E" double-blocked.
It's highly unlikely that Red will
ever take it back.
Blocking tiles is good, but blocking tiles that block the said tile is even better. Aim for a solid, continuous block of tiles, rather than blocking on the opposite sides of the board. Sometimes your opponent will want to take a specific blocked tile. A single-blocked tile can be turned over to your opponent in just two turns, but a double-blocked tile is generally not worth consideration.

Defend. 

Unblock the opponent's tiles. Your primary goal is to block as many tiles as you can, but if you think a turn ahead, you can chip away at blocked tiles, and take them in two turns. When you spot your opponent setting up to take a lot of tiles, it's time to turn over the tiles that would allow them to do so. If you can block tiles at the same time, all the better.

Mutations. 

Some words have different forms, like plural or past tense. In most cases, the longer form of the word is the one you should use, since the shorter form will then count as having been played, and cannot be used again. For example, if both "RIVER" and "RIVERS" can be played, choose the latter; "RIVER" can no longer be played after you've played "RIVERS". However, there are exceptions.
Both "FRIED" and "FRIES" are
possible. In this case, avoid the
word altogether.

Firstly, if the word's shorter form is not actually part of the longer form,  consider how many tiles can be turned over if the opponent chooses the other form of the word. For example, if you play "STRATEGIES", the opponent can still play "STRATEGY", possibly to his  advantage. In many cases, it is better to choose a different word entirely.

The same goes for anagrams. If you play "USURPERS", the opponent can play "PURSUERS", potentially turning over all of the tiles used in that word. Again, in this case it's probably better to come up with a different word.

Lastly, if a word has more than two forms, like a plural form of the noun and a past tense of the verb, it may be better to play the short form of the word. For instance, if "SURPRISED", "SURPRISES", and "SURPRISED" are all on the board, it may be better to play "SURPRISE", so that if your opponent plays "SURPRISES", you can then play "SURPRISED", thereby turning the tiles over to yourself.

Remember, this mutation strategy is to be used for tiles that you do not block. If you do block them, you needn't be worried about the next turn.

It's not obvious, but Blue can play
"FIZZY" on the next turn to block
four tiles, and also unblock
Red's "S"!

Scatter. 

This is an advanced strategy that requires you to think both about your opponent's next turn and about yours. I use this when there are no good ways to block off many tiles in a single turn. The trick is to make two words to be played: one that would be hard for the opponent to turn over, and a second word that will "fill in" the adjacent tiles and block a number of tiles. This is quite hard for the opponent to defend against, unless they guess what the second word is, or can otherwise block the tiles you're after.

Review the word list. 

You never know when someone missed a word form, or when you can think of a combination of two words already on the list, or just use the list as a reminder of possible prefixes, suffixes, and endings that help you form longer words.

Write down words that you think of.

Say you've thought of a nice long word, but it doesn't make the cut for the current turn, because it doesn't block enough tiles. Save it for a later turn. This is especially useful if you're playing several Letterpress games at once.

Last but not least, be vigilant. 

If your opponent makes a mistake, like not going for the plural, use it as an opportunity to undo their turn. And remember, winning with a score 13-12 is still winning!

Wednesday, July 31, 2013

How to prevent your car from catching on fire.

© Jane Tuv
Apparently a van caught on fire this morning in Flatiron, Manhattan. No one seems to have been hurt, thankfully.

This made me recall a few times in my old driving days, when the cars I drove had something seriously wrong with them. So in response, here are a few tips that will keep your car from catching on fire:

  1. Watch your temperature gauge. It should hover in the middle once your car is warmed up. If it gets significantly past that, pull over, shut the engine off, open your hood, and let your car cool down before trying anything else.
  2. It there's a gas station, an auto parts shop, or any kind of an auto repair shop nearby, consider getting some coolant/antifreeze. Most problems with overheating I have had in the past were from low coolant levels. Your coolant tank will have a max fill line, so top if off if necessary. If there's a coolant leak, you may have to do this several times until you get to a repair shop.
  3. If you smell raw gasoline, and you're not near a gas station or a tanker, pull over, shut the engine off, get out of the car, and move away about a hundred feet. Then call a tow truck.
  4. If you see black smoke coming out of your engine compartment, do the same thing as in the step above, only faster, and call 911 instead of a tow truck. 

Friday, July 05, 2013

Help!

This is how I've always imagined the chorus from this classic by The Beatles: