Adding a little more awesome to Alfred and Alpha

In case you missed it, Dr. Drang wrote a nice response to my post on evaluating LaTeX with Alfred and Wolfram Alpha. Though he doesn't use Alfred, the Professor of Python does write a lot of LaTeX, and it would shock no one that knows of him to learn that he quickly cooked up some .py to query Wolfram Alpha from BBEdit.

For whatever reason, today I felt the urge to make a good thing better, and it occurred to me that someone out there on the internet had probably made a Wolfram workflow with more bells and whistles than the stock Wolfram workflow that ships with Alfred.

Sure enough, a little web search turned up a post from (of course) my good friend Gabe at Macdrifter, who pointed to me such a workflow written by David Ferguson.

David's workflow returns Wolfram results live to the Alfred interface without even having to go to the Wolfram site at all.

In early testing, it works flawlessly with standard LaTeX input. For example, here's the 1.9602 I was trying to get in the last post:

Pressing ⌥↩ even puts the numerical result on my clipboard. So yes, this is a way to evaluate LaTeX expressions right in Alfred without having to even lose sight of your LaTeX code.

You do need a Wolfram app ID for this to work, but you can get one free here.

Evaluating LaTeX code with Alfred and Wolfram Alpha

The LaTeX documents I create have a lot of numerical illustrations. If you write hundreds (maybe thousands) of numerical expressions in LaTeX over the course of a year, you will fat-finger a few digits along the way, and I really hate typos.

For example, my PDF output might have an expression like this:

math-pe.png

Quick. In your head. . . does that really equal 1.9602? Yeah, I don't want to do that either.

My old fashioned editing approach would be to hand check each one with a calculator like Soulver, typing in the expression after it's typeset to PDF and verifying the result. This is because the LaTeX code itself isn't in a format that can be pasted into a typical calculator:

\frac{0.9989 + \frac{0.9975}{1.04}}{0.9989} = 1.9602

A better way

I only recently found out that Wolfram Alpha can evaluate most LaTeX expressions in their raw form. Just paste a LaTeX expression into Wolfram Alpha's text input field, and see what it does.

For an even faster approach—avoiding the need to even leave your favorite LaTeX editor—use the stock "Ask Wolfram" workflow in Alfred:

  1. Invoke Alfred
  2. Start typing wolf... to bring up the Wolfram workflow
  3. Paste LaTeX code and return

The workflow takes you straight to the Wolfram site, which evaluates the expression in a second or two.

That's probably enough digits, Wolfram. But anyway, yeah, there's the 1.9602 I was hoping to see.

This is by far the fastest and most accurate way I've found to audit LaTeX numerical expressions on the fly. In fact, I've started using Wolfram Alpha to evaluate expressions in the first place. This lets me type LaTeX expressions as I "think" them and know that I can evaluate them in-line as I go.

Alfred, after all, is always just a Cmd-Space away.

Update: For ideas on automating this process further with Python, see Dr. Drang's follow-up post.

Update 2: Here's an even faster way to evaulate LaTeX with Alfred and Wolfram.

Using Little Snitch to lower your LTE bill

Your Mac is a tiny but vociferous habitat amid an even more boisterous biome. The internet is a really loud place.

If you could somehow translate network traffic to an audible frequency, I’m sure it would sound like a rainforest of monkeys, tropical birds, frogs, bugs, and God knows what other creatures screaming out incessantly in a programed ritual of information mating.

But how loud should your Mac be? Who should it be allowed to cavort with?

Enter Little Snitch—a Mac application that alerts you any time any application on your Mac attempts to connect to the internet. You’re able to allow or deny connections on a permanent or temporary basis. Little Snitch groups these “rules” into profiles that can be network-specific or global. Best of all, as you join new networks, Little Snitch lets you assign them to profiles.

I use three Little Snitch profiles to muzzle the monkeys:

  1. Home: My home network, including Wi-Fi and ethernet connections
  2. Public Wi-Fi: Any open or public network I join
  3. LTE: Any network created by my iPhone or iPad’s hotspot feature

My Home Profile

On my home network profile, anything goes. I don’t have any data caps or security concerns at home, so I generally cut things loose. If home were the only twig in the internet rainforest I sat on, I probably wouldn’t need Little Snitch at all—though I do like how the menubar icon shows me if something is doing a lot of uploading or downloading.

My Public Wi-Fi Profile

If my home network is a tranquil pond of koi, public Wi-Fi is a muddy swamp full of piranha and pythons—with panthers patrolling the perimeter.

My Public Wi-Fi profile is much more restrictive. I’ve locked down just about everything except essential services, web browsing, and email. If I must connect to a public network, I want as little information flowing in and out of my Mac as possible.

My LTE Profile

When connected to LTE, the concern isn’t privacy predation. It’s data usage. And boy, does Little Snitch really help here.

Before I started using Little Snitch a few months ago, I was routinely running right up against my Verizon Wireless data limit around the 23rd day of each month’s billing cycle. My options were 1) impose a moratorium on LTE usage the last week of the month, 2) go over my limit and incur an overage charge, or 3) increase my data limit.

I stubbornly never chose option (3), meaning that every month I either had to give up the benefits of LTE or give up more money to keep using LTE.

I knew that Backblaze, my preferred online backup service, was part of the problem. Backblaze currently offers no way of restricting backups by network.1 And my Mac currently offers no way to change the behavior of applications on a network-by-network basis. As far as my Mac is concerned, a Wi-Fi network fed by LTE data is the same as any other Wi-Fi network.

To reduce the bleeding, I had to remember to manually pause Backblaze when connecting by LTE, and I frequently did not think to do that until it was too late.2

Now, Little Snitch essentially does the pausing for me. It’s as simple as permanently blocking bztransmit the first time it tries to connect over LTE.

As soon as I began using Little Snitch this way, my LTE data usage issues went away completely. In fact, I barely climb above 2.5 GB of LTE data usage in any given month. Before, I would end up anywhere from 4.0 to 4.5 GB, putting me at or over my 4 GB plan.

Little Snitch lets me use just enough LTE on my Mac to be productive—mostly low-bandwidth web browsing and email.

My Cash Flow Profile

The economics here are what one might call intuitive. Little Snitch costs $35 once, and it saves me $10-15 every month. If you regularly hop across different networks, which each pose unique security and data usage challenges, I highly recommend trying out Little Snitch.


  1. To be clear, this is not a criticism of Blackblaze. I HIGHLY recommend using Backblaze for bulk online backup. We just live at a time when mobile data isn’t yet a fully capable peer (cost-wise) compared to non-mobile networks. ↩

  2. To a lesser extent, Dropbox can also be a data hog, so I usually block Dropbox by default and allow it on an exception basis. Most of my Dropbox work involves text files, so the bandwidth is pretty low. However, I’ve taken data hits in the past when someone else added a large amount of data to a shared folder and Dropbox synced the data while I was connected to LTE. With Little Snitch always watching, there’s no need to worry about these unforeseen data traffic bursts. ↩

Online education: We're learning what doesn't work

As the William Lowe Bryan quote goes, "education is one of the few things a person is willing to pay for and not get." What, then, does that say about free online college classes like those offered by sites like Udacity?

A lot apparently:

...all of these efforts have been hampered by the same basic problem: Very few people seem to finish courses when they’re not sitting in a lecture hall. Udacity employs state-of-the-art technology and sophisticated pedagogical strategies to keep their users engaged, peppering students with quizzes and gamifying their education with progress meters and badges. But a recent study found that only 7% of students in this type of class actually make it to the end.

I believe that the web is a legitimate place to teach, but I don't think educational content should be commoditized like tech news or cat videos. I think the more an online education platform relies on volumes for profits—or the more a business model uses "education" as an eyeball-getter for some other purpose—the poorer the educational product will be. That's because, like other free(ish) internet things, the product and customer are often the opposite of the ostensible.

Just because the web has driven the cost of information to zero, don’t assume it will or should do the same for education. The two are very different.

The web is a candy land of information. Facebook statuses, Google searches, even Wikipedia entries all exist because people have a sweet tooth for information. Instant-information sites are great, I guess, but I don't think the business models that built such sites lend themselves to educational business models.

Education is much more than the distribution of information. An educated person is much more than an informed person.

Education should cost (someone) something. People who consume education should pay for education either as a product or as a service. And people who educate should be compensated based on their ability to educate, not their ability to create web traffic.

I also think calling this first generation of free education sites "online universities" is misguided. I don't think the university experience, in the pre-21st-century context, can be reproduced online. University, the product, is something people purchase for reasons that go way beyond lecture hall learning. The social experiences that happen in the conventional college setting can't be emulated online. And they shouldn't be.

I think web-based education will continue to evolve, and most likely become less core and more niche. The very best online education platforms will charge for their products and offer a very clear value proposition to their customers, who will buy (and complete) the education as a stepping stone toward practical economic goals.

Maybe instead of using the web to "innovate" education by gamifying and enabling the already-short attention spans spawned by the instant-information-gratification era, online educators will innovate the web by figuring out ways of re-introducing critical thinking into learning.

I'm not saying this will be an easy task, but I think it's one worth taking on. Otherwise, by molding "education" to the Facebook-status-quo we surrender to one of the greatest ironies of the web: it's so open, yet most of us tend to curl up in one corner of it and nurse the same bottles of highly liquid, nutritionless information we did the day before.

The MacSparky Email Field Guide

By now, you've likely heard that David Sparks has released yet another Field Guide. In this one, he had the onions to take on email. I have to admit, back when I heard David was working on a book about email, I was a bit worried.

Email seems to be a subject that either invokes vomit or apathy depending on the person. How can someone write an interesting book about email?

Well, the only way I know to answer that question is this: get David's book. He really hit it out of the park. I thought I knew everything there was to know about email, but I quickly found out that David knew more. Buying Email should be a pretty easy decision. Who wouldn't want to get better at something they spend hours a day doing?

David's approach for this book in some ways reminds me of the Nest thermostat. David took a mundane, but infinitely pervasive problem—email, that is—and assembled a set of solutions that are as practical as they are elegantly presented.

I challenge you to find a more aesthetically pleasing piece of technical writing. Mike Rhode's original illustrations are fantastic.

Official website for Email

iBookstore

PDF Version

Don't bring a knife to a punch down fight

"You're not gonna do this with a pocket knife."

So says Gabe Weatherhead, the grittiest-DIY-hero-of-geeks you may ever have the pleasure of hearing online, before taking us on a fascinating journey through the conduit of his home network.

As someone who finds himself sewing more and more of his devices together with twisted pairs of copper, I really enjoyed the first episode of Gabe and Erik's new Technical Difficulties podcast. And this is just the start.

So put down your pocket knives, kids. Put in your earbuds, and get out your credit cards.

A net as big as the sea

With billions in funding, the N.S.A. is able to spy with nearly unthinkable scope:

The N.S.A. hacked into target computers to snare messages before they were encrypted. In some cases, companies say they were coerced by the government into handing over their master encryption keys or building in a back door. And the agency used its influence as the world’s most experienced code maker to covertly introduce weaknesses into the encryption standards followed by hardware and software developers around the world.

The most disturbing message in this article to me, however, is the tacit message that current and future U.S. national security depends on the federal government's ability to know every communication and transaction that takes place online.

Maybe modern warfare hasn't changed all that much. This is the 21st century's take on carpet bombing.