[transl.] You went overseas—are you happy? (“出国的你 快乐吗”)

Found the below article through so-called “social media”. Don’t have any affiliation with the author nor the WeChat group, but thought it was worth being translated.

Original post at: http://mp.weixin.qq.com/s?__biz=MzA4ODQwMTkyOQ%3D%3D&mid=200035572&idx=1&sn=6fc8fba95e4c22b96616f5cd79b99437

[n.b. photos from original post omitted]

Everyone looking at the photos from students studying abroad keeps saying, “Wow, what a wonderful life. I’m jealous.”
Don’t be jealous, because the road they take might seem bright and glamorous, but every step taken is another scar suffered.

Continue reading [transl.] You went overseas—are you happy? (“出国的你 快乐吗”)

What concurrency in Node.js could have been

People wrote a lot of good comments on my last post about Node.js. (They also wrote some bad comments, but the worst have been modded out.)

One of the key points I was trying to make was that the way concurrency is written in Node.js sucks, so it blew my mind that people kept referring to new libraries that supposedly fixed things: bluebird, fibers, etc. You see, the callback-hell problem is something that is impossible to fix in “user space”. You either have to modify Node.js internals or design a new language that compiles to JavaScript.

Let me explain.

In a language that allows you to write concurrent code, you might write something like:

Continue reading What concurrency in Node.js could have been

Raise your hand and ask

College lecturers (and teachers in general, I suppose) assume they need to ask if the class has any questions. The benchmark is that if the class doesn’t have any questions, then they understood the material, and if there were questions, then the lecturer should slow down a bit and maybe review it in a bit more detail.

It doesn’t work. Each class may have one or two students that play along with this and actually ask when they can’t follow along. Everyone else, when faced with inscrutable material, tends to shut up and sit through it.

Asking questions in public can be a lot of pressure. You worry that you’ll annoy other people by holding up the class. You worry that everyone else in the room already knows. You worry that you’re missing something really obvious. You worry that you’ll look like an idiot. And despite whatever cheerleading there is to encourage questions, all of these are possibilities.

What would you do if someone asked:

Can’t you just run `make -j` to parallelize your code?

Snickers? Laughs? (Look clueless because you’re not a computer programmer?)

It’s easier for someone with experience and accomplishments to ask questions—the experience means that you probably know as much or more than other people, so it won’t be a dumb question, and the accomplishments create a solid ego that won’t bruise so easily. The people without experience—the beginners—should be asking more questions, not fewer, but if they don’t have much in the way of experience or achievements (or have trouble internalizing them), then it can be a very scary deal.

We can do more to help people ask questions. The Internet is great for dumb questions—just check Yahoo! Answers. Every time I can Google my dumb question in private (“light stove without electricity”), then I feel better knowing that someone else took the fall.

And they probably asked under a pseudonym too. What if we created this tolerant environment for students? Several of my courses had simple CGI message boards where any student could post questions or reply to others, and for every asked question, there were probably several who wanted to ask it.

We could take this one step further and make it an anonymous board, where administrators could, if needed, unmask users (for cheating, harassment, etc.), but people with questions wouldn’t be so afraid of asking a dumb question. A college could create such a feature for their entire school—maybe even go to the extent of not even letting the teacher know the poster’s identity without going through some bureaucracy.

There is value into keeping course-related questions within the school. Teachers can monitor what people are asking about. Students can feel some camaraderie in their problems (misery loves company). Homework-specific questions often require a lot of context, like the homework questions that constantly pop up on Stack Overflow. And really, missing out on all of the help that could be provided in a school setting is a shame.

Nobody should be intimidated into not asking.

Using bcrypt in CakePHP 2.3

CakePHP 2.3 adds native support for the bcrypt hashing algorithm, which is often recommended because of the amount of analysis that’s gone into it and its configurable cost function.

Using it isn’t obvious, however. The 2.3 migration notes merely say, You can now use Blowfish in your $authenticate array to allow bcrypt passwords to be used.

Due to limitations in how Auth works, a new authentication type was added in addition to a new hash type. So to use bcrypt, your $authenticate variable should look like this:

$this->Auth->authenticate = array(
            AuthComponent::ALL => array(
                'scope' => array('User.active' => 0)

That only affects checking the password. To hash passwords using bcrypt, you also need to modify your model because Auth::password won’t work.

    public function beforeSave($options = array()) {
        if (isset($this->data[$this->alias]['password'])) {
            $this->data[$this->alias]['password'] =
                Security::hash($this->data[$this->alias]['password'], "blowfish");
        return true;

Note that you can configure the cost by using Security::setCost (the default is 10).

We don’t remember your startup

Yeah, your startup. You know, the one that had the nifty HTML5 responsive launch page? The one that promised big things and nifty features? The one where we typed in our email address so we could be notified when it launched? You spent the last five months working your butt off to productionize and bugfix your startup, and when the time came, you crafted together a short but sweet email asking us to try out the beta.

Thing is, you forgot to remind us what your startup does. So I get this email from some website with a sufficiently hip name asking me to check them out right this instant. I don’t recall ever seeing them before, so it must be spam, and the few seconds I have before my train arrives, I trash it and move on to the next piece of mail.

What is a divshot and why should I care about it?

After working on your startup for the last year and spending every waking moment thinking and talking about it, it’s easy to assume people know about what you’re doing.

But for the rest of us, it wouldn’t be too much work to include your one-line pitch, would it?

Steve Jobs: 1955–2011

It’s hard to put Steve Jobs into words, but I will forever remember him as a leader who didn’t let critics stop him from accomplishing so many things. We as a society tend to complain about Apple products being overhyped and to mock Apple’s “magical” and “revolutionary” labels, but the critics are uncomfortable because there’s truth under that glossy marketing.

Simply compare tablets before and after iPad, smartphones before and after iPhone, mp3 players before and after iPod, and even personal operating systems before and after OS X. Apple has been constantly setting the goalposts of the technology industry year after year, leaving its competitors struggling to keep up, and they have been and still are profiting enormously.

In the capitalist ideals of our society, isn’t that commendable? Millions of people were willing to pay the sometimes-high price for Apple products not because Steve Jobs really had a reality distortion field or that they were actually just gullible. Fool me once, shame on you, fool me twice, there’s something in the water? Millions of people returned to Apple time after time because Apple had a responsibility and consistently fulfilled it: make products that are ground-breaking yet polished in a way that leaves one wondering how life existed before.

Apple wasn’t interested in esoteric technologies to publish in research journals. When they found something good, they did what seemingly nobody else could: bring it to everybody. It was the ultimate intersection of technology and people. And Steve’s legacy isn’t limited to Apple: NeXT brought revolutionary computing ideals to fruition and without Steve, Pixar would have never went on to produce films like Toy Story and Finding Nemo.

Some companies settle into complacency and some pioneers settle into a dull CEO life. Bill Gates, Marc Andreesen, Larry Ellison… they are still around and active, but when was the last time they stunned us with innovation? Nobody else has come close to Steve Jobs in transforming technology over and over. Steve Jobs saved the best for last, and because we knew he would have continued wowing us year after year, it’s a shame that his time has come. Rest in peace.

"EISA Configuration" partition won’t go away

The symptom is typical: you check out the partitions on your hard drive in Windows Disk Manager only to find out that there’s a weird, inaccessible partition that’s of the type “EISA Configuration.” What is it? Can I get rid of it?

What is it?

It has become standard practice for manufacturers to include recovery data or utilities on the hard drive to save them the costs of creating separate recovery disks for your computer. The benefit is that you can always restore your computer without worrying about losing your restory disks, but the downside is that it’s taking space on your hard drive, and if your hard drive died, you don’t have any restore disks at all.

Continue reading "EISA Configuration" partition won’t go away

Quickly search Java documentation in Firefox

Firefox Quick Searches have become an ingrained habit for me after a lot of repeat searching. Recently I’ve been working on a Java project and I’ve found myself needing to look up classes in the Java online documentation quite often. To that end, I’ve set up a quick-search bookmark that will take me to the relevant documentation page by typing java [keyword] in the address bar. It uses Google’s I’m Feeling Lucky search:
The Javadoc quick search bookmark
Just add a bookmark with the string “http://www.google.com/search?btnI=I%27m+Feeling+Lucky&ie=UTF-8&oe=UTF-8&q=Java%206%20%s“.

LaTeX MLA Style With Title Page

So I was typesetting one day…

… and my English teacher wanted us to use a title page on our essay. I was using the mla-paper package in LaTeX, but that package only allowed for a standard MLA paper with the heading on the first page. I needed a title page, and so I hacked mla.sty into mlawithtitle.sty which has a title page instead. It’s not a very pretty hack, but it allows for a separate title page and that’s what matters to me.
Get it at http://files.aztekera.com/schoolwork/mlawithtitle.sty.

Usage notes are in the file itself.

It's the interface, stupid!

This seems to be a huge issue the big companies “get” and the little companies neglect.  When designing software, make a good interface.  So many times, a piece of software can’t rise up into the big leagues because the interface is horrendous.  The workflow in a program should be efficient, intuitive, and simple.

Case 1:

I downloaded Alibre Design Xpress, which claims to be a full-featured 3D parametric CAD application that’s absolutely free.  I tried it out, and in a few seconds I could see what was wrong with it.  But first, let me give you a little background.

I started out in CAD by learning Autodesk Inventor, a very capable (and pricey) 3D parametric CAD modeling program.  Everything about the program was intuitive and simple, but advanced users could accelerate every step of the process by learning keyboard shortcuts and other little tricks.

Enter Alibre Design. I began by drawing a simple part, and immediately the program was already hampering my work.  I wanted to dimension the box, and I was used to just hitting “D” on my keyboard to select the dimensioning tool.  Nope.  Alibre Design forced me to click the button in the toolbar, which takes a little getting used to.  Same for extrusion: I couldn’t hit a key to extrude, like in Inventor.  It was another tiny little picture on a bar, and I had to hover my mouse and read the tooltips.  Then, Alibre got even more annoying when I went to extrude another sketch on the side of the box.  Apparently, any excess lines besides the closed figure causes Alibre to grind to a halt.  For extruding sketches, it’s either all or nothing.

That said, Alibre Design is a powerful program, and experienced users could easily work around these little annoyances.  But, it does need some deeper thought put into the workflow.

Case 2:

I needed to composite some video, and I tried out T@B’s Zwei-Stein 4.  Wow.  What a nightmare.  To begin with, the interface is the sluggiest interface out of any program I have.  It looks like they tried to invent their own GUI toolkit, with abominable results.

The interface is one confusing mess.  They try to justify this on their website, saying that they favor creativity over simplicity, and that’s why their interface is so bad.  There’s no way I can be creative with such a bad interface.

For starters, to import a clip, you’re forced to use their ugly file tree.  It goes like this:

  1. Click on a video clip.
  2. Wait.
  3. See the thumbnail of it appear in a completely different tab (apparently importing video is a multi-step process).
  4. Drag the little green arrow on the toolbar beneath the preview into the “MediaMixer.”  Oh wait.  You can’t, because the little green arrow takes forever to show up.  This is on a dual-core Turion.

And that was just a small taste of what was to come.  Arranging video in the timeline was much, much worse.  You can’t just select a video clip by clicking it on the timeline.  You have to click its name on the sluggish list in one of Zwei-Stein’s multitudinous panes (bad pun here).  To move a video clip, I’m supposed to Shift+Drag, but it doesn’t work like it should half the time.  The only way to precisely position video is to use their horrible GUI and manually type in a start time and clicking the “=” button.

Lesson learned: Don’t make your own GUI toolkit.  If they really wanted cross-platform compatibility, they should’ve used GTK or Qt.  It might’ve made their program at least slightly bearable.

In the end, think of the user.  Too often, people write programs only thinking about themselves.  They don’t actually give the program to a user and see what happens.  By actually testing it on end users, they can see what parts of the interface need a little repolishing (or a complete rewrite, in Zwei-Stein’s case) so the end user isn’t completely confused.