Daniel Mai

Daniel Mai

Emacs Tutorial Videos

Emacs is one of the main tools I use on a daily basis. It’s the best text editor I’ve used and I continue to learn about it’s seemingly infinite amount of features and extensibility as I invest more time into it. I went to Emacs Conf 2015 in SF back in August and it further emphasized how incredible Emacs and the people that use it are.

Over the past several months a colleague and I have been working together on creating a series of videos to get the word out on how awesome Emacs is. We have a handful of videos published so far, and have slowly been getting feedback and people subscribing. It’s pretty exciting that people want to learn more about Emacs with our channel. People started posting links to our videos on reddit (such as here and here). Even a blog that I personally follow posted about one of our videos.

If you ever wondered what makes Emacs awesome or have wanted to learn, you can check out our channel. We’ll be making more videos in the future!

No Better Time

I’ve been thinking a lot about 9/11 lately. Not that unsurprising, since I watched Extremely Loud and Incredibly Close and read No Better Time: The Brief, Remarkable Life of Danny Lewin, the Genius Who Transformed the Internet recently. It brings home the point that our time alive is quite short. What’s also interesting is how we can relive the past (at least, mentally).

It’s quite interesting that time can repeat itself in our minds based on how much we cling onto our memories from a certain time, or even how much of the event has been recorded. 9/11 is arguably one of the most recorded terrorist attacks in history. The timeline of the attacks are documented with details to the second1. To me, time feels frighteningly slow as every next detail is accompanied with a timestamp. It wasn’t hard to read the roughly 200 pages of No Better Time, but the death of Danny Lewin, who is arguably the first person killed in the 9/11 attacks, doesn’t happen until the very last pages of the book. And the final pages of the book are where I probably read the slowest.

Hundreds of pages are spent on the Lewin’s life, with his notable achievements being in the military, starting a family, going into the Ph.D program at MIT, and working to end the World Wide Wait of the internet during the 90s. This all sets the stage for the climax of the book. The climax reveals the irony of Lewin’s life, as one of the motivations of ending the World Wide Wait was to prevent high traffic sites such as the news from crashing when breaking news occurred—-breaking news like 9/11, when the phone and radio lines went down, yet the web continued serving news thanks to Lewin’s work.

If Danny were still alive, I would have loved to have dinner with him, if not just to experience his invigorating character. The closest things I’ll have now are the stories about him and the published papers (here’s one) with his name that were critical to speeding up the Internet for everyone.


  1. Read it all on Wikipedia. The flight events alone are incredibly detailed: American Airlines Flight 11, United Airlines Flight 175, United Airlines Flight 93, and American Airlines Flight 77.

General Game Playing

A colleague got me started reading about and taking a course on general game playing. The idea sounds pretty insane: Programs that are designed to play games in general. The game it plays could be chess, checkers, or even go fish—-and the program could be playing them simultaneously. There are tons of other games the program could play. It isn’t any and all of them, since there are some finite restrictions and rules that GGP and the language that describes games must follow.

General game-playing programs do not know the rules of the game ahead of time. As such, they are based on concepts that games have in general; for instance, each game has players, legal moves to make, and conditions that indicate that the game is over. For example, tic-tac-toe involves two players, where each player takes turns marking Xs or Os on the board, and the game-over condition is when there’s a line of matching Xs and Os or if the board doesn’t have any blank spaces. Chess, go fish, and other games follow the same structure as well, although the specific game rules are different.

There’s always been research about computers being smart enough to beat people at games (famously for chess). They’ve been done for years. What makes general game playing programs different is that they are not specialized for any particular game.

It’s crazy to think that a single program can be used to play different games, given that the games are described in a way that the program can understand. In general, games are just a series of states that change as the game progresses, so the program just inspects the states and makes moves accordingly. Unsurprisingly, games are just represented by a state machine. How fortunate, given that I’m currently learning about them in CS 154 as well.

In related news, I watched Peter Norvig’s talk on How Computers Learn today, which was great. He talks about machine learning and some of the work that Google’s done with it in clear language without much jargon. The entire talk was interesting, though the part where (at time 43:52 of the video) he talks about a computer learning how to play the game Breakout and getting really good at it is sort of relevant to the topic for this post. Though it’s not a general way to play games, just having the program learn from its past experience, and all it knows are the pixels on the screen and the score. The computer gets pretty good at playing the game after being extremely dumb from its first time playing and getting pretty good at the game after hundreds of play sessions.

Applying that same technique to GGP is probably not feasible. Since the program doesn’t know what kind of game it’s going to play, it can’t really build on past experience and say that certain techniques are better than others. It could be playing tic-tac-toe in one round and chess in the next round, and each game has their own winning strategies.

A good way to make moves without basing it on prior knowledge is to “inspect the future” by checking future possible moves and seeing which move is best, statistically speaking. This is what, from what I’ve read so far, the papers on GGP have written about.

Though I haven’t heard about general game playing at all until this past weekend, it’s pretty interesting. If you want to follow along and learn more about GGP, check out the General Game Playing course on Coursera or ggp.org.

Dwindling Photography

Lately I haven’t been taking as many photos as I’ve used to. I’m always interested in seeing photos that were taken many years ago for the nostalgia, but lately I haven’t been taking any pictures, which means a lack of photos for me to look back on in the future. I haven’t been finding them as valuable, even though I get a kick out of seeing a photo from years ago and reminiscing about the past.

I was partly enlightened while listening to episode 28 of Cmd+Space some time last year. It’s a great episode with John Roderick. About 20 minutes into the podcast, John talks about the current culture to “compulsively record things,” and that some people don’t believe something happened if there isn’t a picture of the event as well. Or rather, they’re disappointed that there aren’t any pictures. So I’ve been taking much fewer photos lately, and I don’t feel like I’ve been missing out on much.

By not taking pictures of anything and everything, I feel that I’m more focused of my surroundings and the people around me and less on capturing the moment with a few photos. It’s very much a Look Up argument (though I still constantly use a computer).

It’s easier to forget without photos, which leads me to choose what memories to cherish mentally.

Here’s to more valued memories.

Some Educational Learning Thoughts

One of the goals that I set for myself before starting college was that I had to get straight-A grades for my classes in school. How hard can it be (it’s SJSU, after all)? I felt that I was behind and below the rest of my friends who went to more prestigious colleges. Getting As would at least mean I’m accomplishing the best that I could, and that I would have a better chance at a future, whatever that “future” was going to be for me.

However, after every semester I realize more things about school, and my priorities have shifted.

One of the first things that I have accepted is that where you go to school doesn’t matter. People have been telling me this repeatedly, but it took me a while to internalize and accept it. People aren’t defined by the school they attended. In many ways, the institution’s culture affects and shapes our perceptions of the world, given that we spend around four years within their atmosphere. But you don’t introduce yourself to people by first saying which school you came from, because that’s not interesting at all.

Another thing I’ve accepted is that grades are not important, at least not as important as I thought they were. Every professor has their own way of grading course work, and yet all grades are considered equally on a college transcript. Some professors grade on the infamous bell curve, while other professors hack their grading scales based on whatever criteria they come up with during the course, extra credit et al. I waste a lot of time caring about what other people tell me what’s right and wrong, which is time I could instead use to focus on more important matters, like actual learning.

Reading Salman Khan’s book, The One World Schoolhouse, reinforced the fact that there is plenty wrong about the modern school system, and not just financially speaking (as much as we complain about the rising costs of tuition). The issue with our schools is ingrained in the pedagogy. Sal’s book provides a lot of context for why the U.S. education system is the way it is, how Khan Academy is changing that space, the purpose of homework, and all sorts of other great points on education and what the future holds for it.

While reading Sal’s book, I had a couple of weeks where I was reading and watching a whole bunch of Bret Victor and John Taylor Gatto, and watched the college documentary Ivory Tower. A couple of my favorite pieces are Bret’s thoughts on teaching and Gatto’s The Six-Lesson Schoolteacher.

There was an interesting discussion last month on the College Opportunity Day of Action about innovation and higher education. The whole panel discussion is recorded on YouTube, and starts an hour into the video and lasts about an hour. One of the main points was rethinking the perceptions that we have about our education, but one point that stood out to me (it happens at about the 1:44:00 timestamp of the video) was one that Freeman Hrabowski made in the talk about the need to learn how to ask the right questions. introducing the topic by prefacing it with Isidor Isaac Rabi growing up in New York and coming home from school with his grandmother asking him “Did you ask a good question today?” while his friends’ mothers would ask their children “What did you learn in school today?” His grandmother’s question encouraged his curiosity.

What did you learn today?

Algorithms at the Khan

Today, Pamela Fox over at Khan Academy announced the new algorithms course that the Academy is making available to the world.

This is huge. Not only is this another great resource to learn algorithms, this is made alongside Dartmouth professors. This includes one of the authors of the famous CLRS Introduction to Algorithms book, Tom Cormen. If you had a reason to be skeptical about the quality assurance of the Khan Academy content (which is already great), having the Khan-powered algorithms course being backed by Cormen and his colleague Devin Balkcom should alleviate any doubts.

If I had this and VisuAlgo when I took the Data Structures and Algorithms course at SJSU a year ago, I would’ve been so happy. The resources I had back then to learn the course material was plenty, but I think would’ve spent so much time outside the course with these materials to help me learn.

Look on the Bright Side

A positive man on the bus

I took the bus to school yesterday morning. While I was at the bus stop, there was a man there that started to talk with me. As it usually is with strangers, I’m hesitant to start a conversation, but I tend not to ignore someone who talks about how nice the weather is for the day.

Of course innocent conversation starters usually don’t end there. This man proceeded to tell me about the morning he had. He was making casserole in the oven, but when he took it out of the oven, the casserole wasn’t put in all the way so it fell onto the kitchen floor. “I got lucky that it didn’t touch my legs! It was really close,” he said, while he motioned his hands in the air to imply he was grabbing napkins and cleaning the mess from the oven. What a rough morning.

Our conversation doesn’t stop there. He began to talk about the police report he had to write. He pointed out the apartment complex that he lives at not too far away from the bus stop, and he told me that someone broke into his apartment and took everything. And to clarify what he meant by “broke into,” the robber didn’t break his door down—his door was completely fine. Whoever broke into his place used a master key and took photos of all his bank account information, passport, and whatever else was in his apartment. He said people who used to work at the complex were bad enough to take the master key with them after they quit their job.

The reason why he has to write this police report himself is because the police won’t write it themselves, and he has to pester them to give his case a police number (making it official in the police records). Apparently whoever owns the apartment complex he’s living in has some connection with the police, so the police won’t file any reports from that place because that would scare away buyers. If this sounds crazy to you, you’re not alone. I was thinking the same thing as this man told me this.

The conversation then proceeds to the topic of crime. He tells me that someone in America gets robbed every 8 seconds, and that a million Americans have to deal with identity theft. He needs to work on the police report without the help of the cops so that he doesn’t have to go through any issues about people doing things under his name. “If I can make this official, then it’ll my proof if somebody ever tries to do something funny, y’know?”

Before we got on the bus, he ended our chat by smiling, saying that it was still a beautiful day that morning. The weather was pretty nice.

At the end of the day, this guy can still smile and look on the bright side. How someone could be happy after all that is astonishing. The man’s probably gone through tougher times in his life.

The Internet’s Own Boy

Over the weekend I watched The Internet’s Own Boy: The Story of Aaron Swartz. After much anticipation more than a month ago, I wasn’t able to watch it in theaters at Bluelight Cinemas with the movie’s limited theater release on July 4th.

It wasn’t really clear if Bluelight was actually showing the movie. First, Bluelight’s website showed it would be showing the movie, and then it showed that it wouldn’t. And their automated machine over the phone also didn’t mention the movie at all. But the movie’s official website said yes, and @internetsownboy tweeted would be coming to Bluelight as originally scheduled.

It wasn’t worth the drive to see if Bluelight was going to show the movie the day it came out. So my friend and I decided to watch it at home whenever we were free again. And so we watched it.

Anyway, the movie’s good. It does a good job telling the story of Aaron Swartz in a nutshell (an almost two-hour long nutshell). A lot of the parts of his life you can read about online on his blog or elsewhere, such as Wikipedia. The web of links you find online will lead you to many articles, but it’s nice to see it visually documented during the film. I really enjoyed seeing it.

“Enjoyed” probably not the right word. I suppose I should say that I found it interesting. It’s an interesting movie.1

I highly recommend a watch. It’s available on YouTube. Just as Marco says, you’re free to watch it due to the film’s Creative Commons license. Yay.


  1. I told a colleague during lunch that “I had fun over the weekend. I watched the Aaron Swartz documentary.” His response was “That movie doesn’t seem like something I would call fun.”

Working at Udacity - Day 1

Today was my first day of training as a Course Manager at Udacity. It was really great. I’ve only met a handful of people and they’ve all been amazingly kind. The office is a pretty relaxing place. I haven’t gotten into the nitty gritty yet, but I’m excited to learn how to use the teaching and organizational tools of Udacity and actually interact with Udacity students.

I had to set up a new work computer for myself, and I didn’t expect it to be so tedious. I really relied on 1Password, Alfred, and Emacs on my own computer, and not having them is a total punch in the gut. Not only did I rely on those programs, but I got really used to the customizations I made, like keyboard shortcuts and Alfred workflows. I should really prepare my own personal set of dotfiles for my preferences (such as this popular one by Mathias Bynens or the amazing magnars’s .emacs.d directory. Now I gotta learn how to organize my settings for readability and easy setup in the future. Right now it’s a whole kludge of preferences that only I really understand. The lesson to learn from this: personal computers are truly personal, and organization and documentation are really important if I don’t want to repeat tedium in the future.

To start, I’m gonna see if I can get any tips from Zach Holman’s words about dotfiles.

How’s School?

So, how’s school?

The dreaded question, to which I just answer “It’s okay.”

I mean, I really don’t want to talk about it. I used to believe that school was really awesome. Nowadays, I’m not too sure.

I remember in elementary school where I would be really excited about it. Go to school to learn and play with friends, what’s there not to like? I was praised for a lot of what I did, like doing well in math1, or doing something that seemed “out of my capability.” In fifth grade I had to give a presentation to second graders on how to make a paper airplane. I typed up a whole page of instructions on Microsoft Word: materials, procedure, observations—-like a lab report. My teacher was really impressed by the document. There was a parent-teacher meeting not too long after and my teacher showed my page of directions to my parents, telling them how impressed she was. She asked them if they helped me make it or if I did it all by myself. “He did it all by himself. I only showed him how to put in the arrows (→).”

That was one of my proud moments in elementary school. Other moments like that include playing the violin at school concerts and making the winning shot in basketball one day during PE.

Then came middle school. I remember graduating from there I thought to myself that I would cherish a lot of memories that I had during middle school. Now, I don’t remember much. I was pretty much a typical child, coping with whatever social drama that middle schoolers tend to create. Middle school was pretty strange in hindsight. Classrooms were filled with students with smug attitudes, and some teachers really seemed like they didn’t express any motivation to teach us.

One thing I’m grateful for about middle school is the handful of friends I’ve kept from that time.

In high school, there was less “trying to fit in” compared to middle school. The group I hung out with were people I liked being around. Socially, it was pretty much the same throughout the four years. That was nice. When I talk to the same people now we have this attitude of “be yourself because I don’t care how you judge me.” We’ve spent enough time with each other during high school that we don’t need to be shy about ourselves. We don’t know everything about each other, but we’ve come to accept each other’s personality.

I don’t know where this post is going. It started with the question “how’s school”, which I assume means academically. But here I am talking about the social aspects of it.

Perhaps school is mainly a social institute first and foremost. We’re expected to do group work, interact with others, and survive for about seven hours a day being in a place with other people.

Anyway, let’s go back to first line of this post: How’s school? To be more specific: How’s SJSU?

It’s alright. It’s not great knowing that even though I’m doing well according to my transcript, all that doesn’t matter because it’s SJSU.

I was talking to my professor about grad school. Although I’m still unsure whether I should go for it, he told me that I should “definitely go.”

You’re fit for grad school. You have the grades and mentality for it. But don’t go here. Go somewhere with a good CS program, like Berkeley, MIT, Carnegie Mellon, Stanford, or UCLA.

But it’d probably be a stretch to apply for the grad programs at those schools because you’re coming from SJSU. Just because you’re doing well here doesn’t mean you’d do well getting a bachelor’s at one of those schools. I mean, I dunno, maybe you would. But the fact is a degree from SJSU isn’t as significant as a degree from one of those top schools.

(That’s not exactly what he said, but it’s an accurate paraphrase.)

So as it stands right now, school is sort of holding me back. If I want to pursue research and go to grad school, I wonder if I have a chance to go one of those schools. I guess if I do go to grad school I shouldn’t aim so high and I’ll end up at a “backup school.”2

Nowadays, school is just this thing I “must do.” It’s a societal obligation that I go to college and get a degree. Sort of drab.

Who knows, maybe my thoughts on school may change later. But these are my thoughts right now about school and whatever else I blabbed about.


  1. I did “well” enough. I wasn’t doing calculus or anything. Just basic algebra. That’s pretty good for an American elementary student, right?

  2. Continuing on with how I started applying to university, I suppose.