In our school’s AP Chemistry program, we are allowed an extra credit project at the end of the first semester. I chose to make a video tutorial about calculating lattice energy because I had trouble with in the past. Since it’s one of the more challenging and creative assignments I’ve done for school, it deserves a quick writeup.
The project took about six hours in total. I started by finding and solving a few lattice-energy problems from the Internet. I decided how to introduce lattice energy and wrote a script. It’s deliberately repetitive because we “must cross the line between ignorance and insight many times before we truly understand” (source). That was the easy part.
The harder problem to solve was the technical one: how to record my tutorial. I’m not a fan of tablets with styluses, because a real pen and paper feel have better control even though they can’t undo. I decided to explain the problems on paper and record it with my iPhone. My Glif+ adapter allowed me to mount my phone on a tripod, but no tripod could shoot straight down. To avoid skewing the image, I opted to hold my phone with a stack of books:
The thin Dr. Seuss book protrudes from the rest so that the camera can’t see the stack of books. I had to counterbalance it with Mathematica and Algorithms in C++. I padded one side of the phone with an envelope for some minor skew correction. The phone was connected to my computer to keep it charged and to download footage periodically.
For lighting, the iPhone’s built-in flash turned out to be the best choice. Because the flash and the camera are so close together, my hand’s shadow wasn’t visible from the camera’s point of view. This also allowed me to darken the room during shooting to prevent stray shadows from other lights:
I measured the camera’s field of view and printed papers with boxes on them. Combined with the alignment guides that I taped to my desk, the boxes gave me an estimate of where to stop writing.
Believe it or not, that photo isn’t filtered. The vignette is from a camera flash, and the colors are from the difference in color temperature between my light and the flash.
It’s normal for Time Machine to freeze while copying a large backup
I’m writing this blog post because I couldn’t find any information online about Time Machine hanging while copying files for a backup.
A bit of background: Last week, I accidentally wiped the first ~1 GB of my boot drive with dd because I assumed /dev/disk1 was the removable drive. Thanks to Time Machine, I didn’t lose more than a few minutes of work.
After everything got restored, however, the first Time Machine backup afterwards took a very long time. It seemed to hang after copying about 15 MB, no matter how many times I restarted it. The solution: Watch your computer until it finishes “Preparing Backup,” then let Time Machine run overnight.
If you cancelled the first backup and Time Machine wants to copy your entire hard drive, you need to tell it to inherit the backups from your previous OS X install.
Here’s the log file in case anyone’s interested. I have no idea why it separates the copying into many operations.
12/3/12 11:20:02.699 PM com.apple.backupd: Starting manual backup
12/3/12 11:20:03.561 PM com.apple.backupd: Backing up to: /Volumes/Kevin’s WD Time Machine/Backups.backupdb
12/3/12 11:20:04.637 PM com.apple.backupd: Inheritance scan required for /, associated with previous UUID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXE33CB4
12/3/12 11:20:04.851 PM com.apple.backupd: Event store UUIDs don't match for volume: Macintosh HD
12/3/12 11:20:06.982 PM com.apple.backupd: Deep event scan at path:/ reason:must scan subdirs|new event db|
12/3/12 11:20:06.983 PM com.apple.backupd: First backup after disk inheritance for / - complete scan required
12/4/12 12:03:26.066 AM com.apple.backupd: Finished scan
12/4/12 12:07:11.597 AM com.apple.backupd: Found 62118 files (7.34 GB) needing backup
12/4/12 12:07:12.944 AM com.apple.backupd: 14.73 GB required (including padding), 572.52 GB available
12/4/12 12:20:05.637 AM com.apple.backupd: Copied 15.1 MB of 7.34 GB, 91406 of 91406 items
12/4/12 1:20:06.371 AM com.apple.backupd: Copied 15.2 MB of 7.34 GB, 636464 of 636464 items
12/4/12 2:20:06.602 AM com.apple.backupd: Copied 61 MB of 7.34 GB, 968341 of 968341 items
12/4/12 3:20:07.020 AM com.apple.backupd: Copied 61 MB of 7.34 GB, 1128509 of 1128509 items
12/4/12 4:20:07.373 AM com.apple.backupd: Copied 7.01 GB of 7.34 GB, 1749413 of 1749413 items
12/4/12 4:42:53.173 AM com.apple.backupd: Copied 2041957 files (7.34 GB) from volume Macintosh HD.
12/4/12 4:42:57.259 AM com.apple.backupd: Using file event preflight for Macintosh HD
12/4/12 4:43:00.507 AM com.apple.backupd: Will copy (1.5 MB) from Macintosh HD
12/4/12 4:43:00.527 AM com.apple.backupd: Found 187 files (1.5 MB) needing backup
12/4/12 4:43:00.574 AM com.apple.backupd: 6.43 GB required (including padding), 563.23 GB available
12/4/12 4:43:55.494 AM com.apple.backupd: Copied 4614 files (1.6 MB) from volume Macintosh HD.
12/4/12 4:43:58.155 AM com.apple.backupd: Created new backup: 2012-12-04-044355
Set up a L2TP/IPsec VPN server on Ubuntu 11.04 to connect with Apple iOS and OS X clients
Just for fun, I decided to set up a VPN on an Ubuntu server I have in my house. A VPN will secure otherwise unencrypted Internet traffic when you’re on public Wi-Fi, and it can allow you to bypass internet filters.
I followed Riobard Zhan’s instructions, but there were some changes I made to be compatible with the latest Apple devices and Ubuntu. The changes below were tested with an Ubuntu 12.04 server and iOS 5.1.1 and OS X 10.7.4 clients.
In the file /etc/ipsec.conf, under conn L2TP-PSK-noNAT, you need to enable dead-peer detection (DPD) so that you can connect to the VPN more than once without restarting IPsec and friends:
dpddelay = 15
dpdtimeout = 30
dpdaction = clear
Also, whenever there is something like
echo 1 > /proc/sys/net/ipv4/ip_forward
use this instead:
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
because you don’t have permission to write to that file if you’re not logged in as root. Which you should not be doing.
If you are getting this error:
ipsec_setup: ERROR: Module xfrm4_mode_transport is in use
ipsec_setup: ERROR: Module esp4 is in use
I went to watch the eclipse at the Lawrence Hall of Science in Berkeley, CA. As part of an extra credit assignment for Mrs. @BarnettDreyfuss’s physics class, I did a writeup about the eclipse experience.
I brought my Linux Craptop with me so that I wouldn’t get bored. I ended up writing my notes there because I thought I was really clever. So the times listed should be fairly accurate. (I took them from camera EXIF data, my Twitter updates, my computer’s clock, and my computer’s uptime.)
I also made some drawings, which are quite horrific because I am the world’s least talented artist. As they tell us, Mrs. Barnett minored in art. She is probably laughing her head off right now.
I’m going to upload the drawings for extra credit, but your time is better spent looking at the photos I took.
Here is the play-by-play commentary of the eclipse.
4:44 PM Whoo, got glasses! The first thing I did was try to take a picture of the sun through them.
It didn’t turn out well. Probably the auto-exposure.
4:49 PM Boot a non-Apple laptop. Estimated 5 hours of battery life. AWW YEAH. (Well, the extra capacity battery I just got sticks out the back of the thing, but still: five hours of battery life. Not minutes, but hours.)
6:50 PM I wonder what my life will be like the next time a solar eclipse hits the Bay Area in 20 years. Then again, I might not be living in the Bay Area. Well, San Francisco looks pretty nice from here.
7:00 PM Whoa, they have eclipse viewing devices with actual magnifying lenses! Why didn’t I know about this earlier?!
They magnify the image of the sun to several inches wide. You can even (sort of) see sunspots!
7:03 PM Better get that panorama shot in before I run out of electricity. Snap snap snap. Oh but my phone turns off. Wonderful.
I probably stitched this wrong but it’s late and Photoshop’s automatic stitching job looks fine to me right now.
7:04 PM Cute couple alert. Solar eclipses are romantic? Maybe she’s into science. Who knows.
7:13 PM Left for awhile. Cute couple borrowed my glasses. They don’t know this, but—I saw that!
7:35 PM the sun is merely dented in the top left.
7:38 PM sun still dented.
7:39 PM sun dent no longer visible with unaided eye.
7:42 PM leaving LHS. bye.
8:02 PM We get lost on the way home because the GPS sucks and my phone is out of power energy.
9:00 PM DINNER YUM
12:00 AM Finish organizing photos and drafting this post. Good night, everyone.
Earlier today, Jeff Atwood of Coding Horror posted “Please Don’t Learn to Code” as a response to the recent initiatives to get people programming. Here’s a quick summary: he advocates against popularizing coding on the basis that most people have jobs that won’t require it directly. He cites the mayor of New York as an example.
I respect Atwood a lot. So I reread his article several time throughout the day, trying to understand where he comes from.
I still can’t believe how much he doesn’t get it.
The motivation behind the “everyone should code” movement is not to make everyone into a professional programmer—obviously, that would create a seriously dysfunctional society.
Instead, its primary goals are (1) to teach critical-thinking skills, and (2) to help people understand the computers that run their lives.
(Please note that I am simply advocating for introductory programming courses. Beyond that, every hour spent learning to code becomes less useful to learning those skills than the previous hour was.)
Programming teaches you how to think.
The act of writing software involves the dissection of a problem, a deep understanding each of the problem’s components, and the creation of precise instructions for a machine that will solve the problem. Debugging a piece of software requires the programmer to come up with a list of all the things that could be going wrong, and find logical ways to prove that they functioning correctly.
How are these logical skills not useful for a mayor? Or any other job, for that matter—unless you are microwaving burgers for McDonald’s, these skills are quickly generalized and useful in many other situations.
(Note that I use the word “programmer” loosely: it refers to anybody who knows how to program, not just those who do it as their day jobs.)
Put another way:
We encourage kids to play a musical instrument or two in order to stimulate their cognitive development: does that mean we want everyone to play for the Chicago Symphony Orchestra?
We push for increased science education in schools so that future adults can understand scientific and medical discoveries relevant to their lives: does this mean we want every student to become a molecular biologist?
We encourage people to go to the gym so that they can stay fit: does this mean we want everyone to be in the NBA?
No, no, and no. That is the superficial way of seeing things. We do these things not because they are directly useful, but because they offer indirect benefits. That the reasons aren’t immediately apparent does not imply the activities are useless or frivolous.
Microprocessors run your life.
When you press the power button on a TV, are you closing a circuit to power the TV? No, you are giving input to a piece of software on a microprocessor that causes it to run the wake up function.
When you press the gas pedal on your car, are you mechanically changing some part of the engine to make it run faster? No, you are giving a input to a program running on a microprocessor. You do not drive the car through the gas pedal; the microprocessor screens your input and allows your input to guide it in driving the car when it makes sense.
Currently, the United States has about 100 CPUs per person, a number is only going to increase as more things become digitized. More CPUs implies that we’ll need more people to write software for them.
But that job will fall to a small minority of the population. For everybody else, this means that a general understanding of the computer’s mechanisms (computer literacy) will become critical to becoming a contributing member of society. How else will a judge make an educated ruling in a trial between software companies? How else will Congress understand that blocking a data-transfer protocol won’t end piracy? These are only a few examples of the importance of a “good enough” understanding through basic programming. It’s only going to get worse.
You can yell at me about this article through Twitter. I’m @kevinchen.
From the moment I found an old, beige, 166 MHz Windows 95 PC in kindergarten, I’ve always been curious. Who invented it? How does it do math so fast? Open it up, and what do you have? A mess of chips, circuit boards, wires, connectors, …
Put it all back together, and you have magic.
Steve has been the single largest driving force behind the community that’s changed my life. It’s in this community that I’ve made my closest friends, found new career paths, and reaped the greatest rewards. I’m reading the news and writing this reflection on a Macintosh. And I’ve never even met him.
To me, Steve was a man who did his best every day. He didn’t settle for anything less, and he didn’t allow the people around him to do so either. He was never afraid to challenge existing ideas. He taught people to live each day to the fullest.
And he held out for one final product launch. His last mark on the technology industry was the iPhone 4S: the iPhone For Steve.
His vision lives on in hundreds and hundreds of young people. They, too, have made it their life’s work to reduce the barriers between people and the technology they use. The universe has been dented.
Have we entered a golden age, or is the world descending into a fiery abyss? The future is unknowable, but the study of history suggests that neither extreme is likely. Golden ages and dark ages are rare, and our understanding of our own time is easily swayed by hopes, fears, and other emotions. If the exuberant optimism of the 1990s now seems excessive, the pessimism of the early 2000s may in time seem equally far off the mark.
— Closing words of The Earth and Its Peoples: A Global History by Richard W. Bulliet, et al.
I love Things. It’s the best GTD / to-do list manager in the world, and I use it every day both on my Mac and on my iPod touch.
But recently, my iPod touch stopped booting after I tried to disassemble it and fix the home button. Because I still want to use Things when I’m out and about, and because I have way too much free time, I created Things Paper, a paper version of Things:
It has everything I like about Things — tags, due dates, areas of focus. It also comes in a disposable form factor, and tasks can easily be entered the next time I get back to my Mac.
This is slightly longer than Twitter’s character limit will allow. Rather than break it up into an annoying series of updates, I’ll stick it here.
Today, I am the luckiest man in the world.
Let me explain briefly to you. Today, I went to a friend’s house. When we got home, I realized that my beloved first generation iPod touch was missing. I frantically searched the car, my pockets, my refrigerator — everywhere. But it wasn’t there.
I thought that I might’ve left it on their living room floor. I almost wanted to wait until tomorrow to call them about it.
In the rain, we drove back to the friend’s house. We searched everywhere — under the sofa, in the kitchen, even in the toilet. No luck. Where could it be?
As I was walking home, I noticed a familiar piece of metal lying in the road. Picking it up, I realized it was my iPod. It was already soaking wet and had a bit of dirt on it and a few more scratches, but it hadn’t been run over by a car yet. I turned it on, and I was greeted by the familiar lock screen.
A lot of things had to go right for this to happen. Had I decided to wait until tomorrow, it almost certainly would’ve gotten run over. Had I decided to walk a few feet towards the left or right, I wouldn’t have seen it. By driving to and from his house, we could’ve run over it ourselves.
Fortunately, it was not water damaged. Or anything, for that matter. I simply wiped it off and plugged it into my computer to sync. It’s like nothing ever happened. Kudos to Apple for making such a rugged device.
As I’m about to reboot my computer to install OS X 10.6.6 and the Mac App Store, I couldn’t help but noticing my uptime.
This is impressive to me. Consider this: I came from Windows. My Windows XP box had to be rebooted every week or so otherwise the screen wouldn’t render properly. The short-lived Windows 7 partition on my Mac had to be rebooted every two days, otherwise weird UI bugs would happen (like the taskbar’s icon glow not going away).
But OS X? 41 days before rebooting for non-stability issues. Pure awesome.