Blocking Flash in Chrome

I have the Flashblock add-on for Firefox that allows me to selectively click to allow Flash to run when I want to, and otherwise nothing happens. This makes for a calmer, quieter, more enjoyable web browsing experience. (You can add permanent always-run exceptions for well behaved, regularly visited sites so that clicking-to-flash doesn’t get annoying.)

Lately I’ve started experimenting with Chrome, and I wanted to see if it had a similar add-on. There is a Google Chrome extension called FlashBlock, but it turns out that you don’t need to explicitly add this (or anything). Thanks to these instructions, I learned that all you have to do is:

  1. Type “about:flags” in a new browser window/tab. Scroll down to where it says “Click to play” and click “Enable.” Scroll to the bottom of the page and click “Relaunch browser.”
  2. In your relaunched browser (took me two launches), go to Preferences (Cmd-,), click “Under the Hood,” click “Content Settings,” then scroll down to “Plug-ins” and select the “Click to play” radio button (which is not visible if you haven’t done step 1).
  3. Go to some Flash-y site like youtube.com and test it out. Nice!

My phone is smarter than I am

I finally did it: walked into a Verizon store and picked out a smart phone. I’d been dragging my feet for a variety of reasons, ranging from a dislike of the slab-like form factor to just plain laziness. But oh my, was I missing out! Things have changed since my last phone purchase in 2006!

I’m not an impulse buyer. I was just going to see what the latest offerings were. And if or when I did get a smart phone, I vaguely assumed it’d be an iPhone, which is the only one I’ve played with before. But the Verizon employee who met me as I walked in immediately steered me to the Android side of the store. “That’s what we all use,” he confided. And here I’d thought Verizon was over the moon to be offering the iPhone, which is selling so fast that you can’t get it in black anymore online (or at this particular store), only white.

I handled a bunch of these phones and gradually narrowed it down to two that were the least chunky and slippery. I was persuaded that I might as well opt for a 4G phone, since although only 3G is available here in Corvallis, I’ll be moving back to L.A. soon where it seems 4G is all the rage, and 10 times faster. I really liked the Verizon guy who was helping me; he was extremely knowledgable, fielded every single one of my questions, and was up front about what was a useful attribute and what was a buzzword. I later learned that he was the store owner.

I converged on the Pantech Breakout, a phone I otherwise knew nothing about, but it felt the best and since they all had the same OS, form factor apparently was the deciding angle. It was just a bit smaller than the other 4G phones, with a slightly grippy back, and felt better in my hand. The thing has a 1-GHz processor, weighs less than 5 ounces, and has about a billion features I won’t need but came along for the ride (like how it can act as a “hotspot” and relay net access to other devices). I was going to go home and think it over, per usual with large purchases, when I realized that at $50, what exactly was I going to deliberate?

Verizon guy: “I guess you probably don’t want the phone insurance option. After all, you managed to hold onto that phone for FIVE YEARS.”

He threw in a car charger and a screen protector with a nice discount, and I was on my way. A whole new way! I’ve got the future in my pocket!

Here are some of the awesome things I’ve discovered this “phone” can do:

  • Voice translation. Like, you speak in English, it turns that into text, translates it into French, and then speaks the French aloud. Your French friend can then do this in reverse and suddenly, you’re communicating across the language barrier. I sat in the Verizon store entranced, having a conversation with myself in two languages, and it WORKED! I imagine you could also use this to learn the foreign language, at least to some initial rudimentary level.
  • Voice dictation. You can dictate text messages, emails, search queries, memos, etc. The accuracy of its dictation (relayed to a server, not local to the phone) is startling. I can say “wikipedia oregon trail” and google does the right thing! I can say “post office” when I’m looking at google maps and it pops up pointers at all the right places! The pain of typing texts is gone! (As a bonus, the “swype” method for entering texts on the keyboard is a nice advance in itself, and good for settings in which you don’t want to speak your texts out loud.)
  • Yelp. Google docs. Geocaching. Disc golf maps and scoring. My ravelry knitting projects. An exoplanet counter. Angband.
  • Amusingly gratuitous: animated desktop wallpaper, such as little flowers that sway and bob when you swipe left or right, or ponds that ripple when you touch them. Amusing for about 30 seconds, then deemed not worth the battery life they require and deactivated.

At the store’s recommendation, I attended their “smart phone training session” which took place the next day. It was me and six octogenarians. Another Verizon employee led the class. He began with a glowing paean to all things google, which concluded with “It’s okay to share all of your data with google, because their motto is ‘do no evil.'” I did get more familiar with the OS and was able to ask some questions. So far, so good.

Any favorite Android apps you’d like to suggest?

For loops in bash

Iteration: it’s such a powerful tool. Automating the repetition of tasks can save so much time and keystrokes and tedium. This capability is one of the reasons I love bash, my command shell of choice. I used to employ tcsh, but switched to bash years ago mainly because most linux system scripts use bash, and I wanted to just focus on one syntax so that my own scripts and the system ones would be equally readable. But bash also opened my eyes to the beauties of command-line for loops. (Tcsh makes them interactive, which initially seems nice, but then is annoying if you’d like to re-do an earlier loop you typed in.)

So now I regularly use for loops at the command line for all sorts of things: resizing a collection of images, creating a collection of symbolic links, renaming a series of files by some standard convention. It’s great for any task in which you want to do the same operation, but the individual commands differ slightly, and in which you can’t just pass in a wildcard list of inputs. But for the longest time, I thought there was only one form of the loop syntax:

for i in choice1 choice2 … choiceN ; do
… [some task with $i, the current choice]
done

Thanks to this great collection of for loop examples, I’ve learned that bash now also supports sequence iteration! So you can do

for i in {1..5}; do
… [some task with $i, a number from 1 to 5] …
done

Previously, I would have written

for i in 1 2 3 4 5 ; do
… [some task with $i, the current choice] …
done

which gets very clunky with larger ranges, involving nested loops, one per digit. Ugh!

Newer bashes (version 4.0+) even support increments, e.g.

for i in {1..5..2}; do
… [some task with $i, an odd number from 1 to 5] …
done

And wow, there’s even a C-style syntax:

for (( i=1; i<=5; i++ )); do
… [some task with $i, a number from 1 to 5] …
done

For loops just got easier.

I used this today to generate a file that contained 16 1’s followed by 16 2’s followed by 16 3’s… all the way up to 16 30’s. Exactly the kind of thing I don’t want to do manually. And yes, I actually needed this file in order to get some research done. So it goes!

Von Neumann’s first computer program

What would you do with a brand-new computer of unprecedented capabilities? Ada Lovelace demonstrated the theoretical capabilities of Babbage’s Analytical Machine with a program to compute Bernoulli numbers (1843). J. Presper Eckert and John Mauchly’s first program for ENIAC was a ballistics calculation (1946). Alan Turing used the Manchester Mark 1 to compute Mersenne primes (1949). When John von Neumann had the chance to explore the abilities of ENIAC’s successor, EDVAC, he focused on something quite different: data sorting.

Donald Knuth wrote a fascinating 1970 paper, “Von Neumann’s First Computer Program,” which analyzes the original 23-page handwritten document where von Neumann recorded his planned program. Von Neumann conceived of a merge sort algorithm and wrote out an implementation of the merge part of it, which Knuth examined and reported on. Knuth noted the insights von Neumann achieved and then respectfully, humbly, pointed out places where von Neumann’s code could be optimized as well as an unfortunate bug in the program. As Knuth noted, not bad for programming without having the actual machine yet to test it! (I do not know how Knuth found the error, whether by hand-examination or by running the program through a simulator.)

There were some very pressing reasons why ballistics and numerical simulations were the top priorities for the electronic computers just coming into existence in the late 1940’s. Von Neumann’s foray into “a nonnumeric application for computers” foreshadowed the generation and growth of information processing and a landslide of other associated activities and applications in use throughout the world today.

Still talking when there’s Science to do

I recently had the pleasure of playing Portal for the first time. It’s precisely the kind of puzzle-game I like: progressively more challenging levels that require innovation, and even after you’ve solved a level, there’s often further cleverness to be employed in finding faster or more efficient ways to solve it. I blazed through the first 13 levels in about an hour and a half, and felt a little disappointed when I learned that there were only 19 total. But then I got to level 14, which was the first time that the goal itself had to be divined, not just the way to achieve the goal. And other players’ comments about the levels getting exponentially harder are now starting to make sense. :)

I’ve been fascinated by the process of adjusting to “physics” in a world where you have a teleportation gun. You can open one portal in a nearby wall, and another at a far-off wall, then walk through them to avoid the gaping chasm that lies between. But you can also open a portal beneath your own feet to avoid having to walk to portal 1, or open a portal under some object to make it drop in front of you (instead of having to walk through the portals to retrieve it). And then some crazy stuff starts happening when you pair portals together and bounce between them — or open one in the roof and one in the floor and fall forever between them — or look through a portal and see your own profile from across the room. Mind-bending fun!

Lack a PS3? You can play the flash version, which retains many of the same mechanics but provides a 2D side view rather than a first-person 3D view. The puzzles are different, too.

Portal was first released nearly 3 years ago… and Portal 2 isn’t due until February, 2011. It will feature a two-player cooperative mode! As with so many types of media, I’m glad that my slow adoption rate means I don’t have to suffer through years of waiting. (It may take me a while to solve the last five levels!) Now if only I could finish season 1 of Battlestar Galactica, or season 3 of The West Wing, and catch up with the present!

« Newer entries · Older entries »