Archive for the 'tech' Category

Getting AppleScript to insert a text block

Friday, August 1st, 2008

Since trying out MacSpeak Dictate, I found a useful feature called “text macros” which allows you to link a block of text to a voice command. Say the command, and the text is magically inserted. One problem: MacSpeak applies it’s own rules to the formatting of the text, so words may not be capitalized the way you originally entered them. Solution: use an AppleScript instead, which can also be linked to a voice command.

I’ve been searching high and low for how to get AppleScript to type a block of text on command. There’s the “keystroke” command but this is extremely slow for entering a lot of text. The solution I came up with involves saving the current contents of the clip board, inserting the text you want to insert on the clipboard, and getting AppleScript to paste it. Finally AppleScript restores the original contents of the clipboard. I had to use a delay before restoring the clipboard because sometimes the restore goes through before the text is pasted.

tell application "System Events"
	set currentClipboard to the clipboard
	set the clipboard to "Ishir Bhan, M.D., M.P.H."
	keystroke "v" using {command down}
	delay 1
	set the clipboard to currentClipboard
end tell

To include line breaks in your text, just use \n.

Declaring My Independence

Friday, July 4th, 2008

For years, I have been subject to the unrelenting control of the consumer electronics market. I have been forced, by what Adam Smith called the “invisible hand,” to purchase every new shiny gadget that comes along. I have been a slave to the whim of the Silicon Valley CEOs.

Not this year.

Not this time.

No, my friends, today I declare my independence from these forces of oppression. This timing is no accident. Not only is today Independence Day, but in exactly one week, Apple will release the iPhone 3G. Many assumed someone who waited in line for eight hours for the original model and who uses the tag line “iPhone therefore I am” on his blog would be roped into queuing up for the second coming. They are wrong. 

I don’t need their so-called “high speed” wireless data service. I’ll take my time. I don’t need their GPS. I know exactly where I am. And where I’m going. And it’s not to the Apple store. Or the AT&T store. 

We live in a free country and I intend to exercise my freedom.

Thank you.

And God bless America.

Free High-Speed Wireless Internet!

Saturday, May 31st, 2008

I’m an internet junkie, I admit it. Like a drug addict, I need a constant stream of internet flowing into my brain or I start to undergo withdrawal. It doesn’t even really matter what I’m reading, but that steady stream of new information keeps me going. I knew it was bad several years ago when my home internet connection, a cable model, stopped working one evening. After a couple hours of internal debate, I broke down and went back back to work just to get an hour of surfing in before returning home.

You think that’s bad? It’s gotten worse. Since I got my iPhone, the internet is basically sitting in my pocket, its siren song only an arms length away. I find myself almost unconsciously reaching into my pocket to pull out my phone whenever there is some downtime (an elevator ride, a walk down the hall, or even a lull in the coversation). It’s a bad habit and I know I have to stop, but at least I can admit the problem.

I normally hate traveling to hotels because inevitably there is some horrendous internet setup where the company tries to gouge addicts such as myself. Typical prices seem to be $10 a day, meaning that within the course of a typical stay I’ve spent as much on access as I spend in a typical month (and, of course, my home internet fees don’t magically disappear during this time). The worst I’ve seen was in Barcelona, where truly unlimited access from within the hotel cost 27 euros. Even I had to draw the line there…with the declining dollar, that’s just criminal.

Picture 2.png

I arrived in Chicago for a conference last night and was surprised to see the Holiday Inn advertising “Free Highspeed Wireless” access for all its guests. I was overjoyed, but as is typical with these offers, there’s always a catch. They say you get what you pay for, and that’s pretty much what I’ve been able to eke out of this service. The access point, ironically named “stayonline”, drops my connection every few minutes. When I manage to get a signal, the experience allows me to reminisce about the “good old days” of 2400-bps modems. Yes, it’s slow.

Maybe I’ll be forced to actually go out and explore the city.

With my iPhone close at hand, of course.

Microsoft Office 2008 is absolute crap

Friday, February 8th, 2008

It is with great frustration that I find myself using Microsoft Office 2008 for the Mac. After years of putting up with the sluggish Office 2004, loyal users are rewarded with this piece of garbage. Though there are admittedly some improvements in the apps themselves, there is some inexcusable bugginess in the interface that is driving me nuts.

Microsoft Word is the biggest culprit so far. It generally misbehaves with Spaces. Windows will relocate to a new space for no good reason. Sometimes windows will not come to the foreground when clicked. This is not a general problem with Spaces, but is unique to Word as best I can tell.

Excel is giving me a rather unique problem at the moment. I have an external monitor hooked up to my MacBook. When I put an Excel window on the external monitor, it won’t let me drag it to the top of the screen. It only lets me drag it as far as the top of my internal screen, which is only about 2/3 of the way up the (larger) external display.

Microsoft tried to add new functionality by pop-up ribbons in both applications, but I have yet to find anything useful hidden in these interface monstrosities.

The educational version of Office also fails to connect to Microsoft’s own Exchange servers. Given the prevalence of Exchange use at academic institutions, this is mind-boggling.

The last complaint is admittedly not a bug, but rather a foolish feature restriction. The former issues are completely inexcusable and are likely completely due to Microsoft’s non-standard development practices. Add to this the fact that the apps are slow to launch, and I think there will rapidly be an emerging market for non-MS office apps.

RIP Tesla?

Saturday, January 12th, 2008

Tesla: Is the Tesla Supercar Soon to be a Thing of Electric Car Fiction?. “…it seems the group is making moves to cease operation…”

If true, this is really too bad. Though I am a happy Prius owner, I’ve been yearning for a true electric car that can bypass the pump completely. I know there are Prius out there, but this was to be the first truly high-end electric that could shatter the perception that electrics are somehow inferior to their gas guzzling cousins. We can always hope that hydrogen cars start materializing soon. I like the idea of exhaust that is just water. Hmmm…I wonder if we have more humid cities in our future.

(Via Gizmodo.)

Zune gets one right…WiFi sync is a good idea

Monday, December 31st, 2007

The Microsoft Zune has not has an easy introduction to the iPod-dominated digital music player market. The much-maligned music player is perhaps best known for including brown among its color options. Microsoft included WiFi in their original Zune, but the use was of questionable utility at best. Instead of using WiFi to do something obvious like connect to the internet, a genius at Microsoft decided it should be used only for “squirting” songs to your friends, so they could listen for 3 days or 3 plays (whichever came first). Aside from the restrictions of a system that sounds like a car warranty, the obvious problem with this scheme is that it requires someone with another Zune who has similar music tastes to yourself. If if it just required another Zune, that would be a tall order. I have yet to see one outside of an electronics store.

Don’t get me wrong…I’m a fan of competition. Though I generally like Apple products, I think it’s appropriate for the company to work for its success. The new Zune still doesn’t connect to the internet (unlike Apple’s iPhone and iPod Touch), but does allow for wireless syncing. Initially, this didn’t seem like a particularly brilliant idea either. I’m still not convinced its essential for a music player, but it makes a lot of sense for a device like the iPhone. I like to keep my iPhone in my room when I’m sleeping in case I get a call, but it’s not necessarily convenient to keep a computer in the same place…and it’s easy to forget to sync before leaving. With a laptop, this is particularly important, since it’s not practical to leave a sync cable attached as can be done with a desktop. Hopefully Apple will add this functionality in a future update.

Verizon’s “openness” is nothing new

Wednesday, November 28th, 2007

Recent articles have highlighted Verizon Wireless’ statements that they plan to open their network to any cell phone or software program. This sounds like a bold move, but it’s actually not all that exciting. While “unlocked” phones (phones not restricted to a specific carrier) are relatively uncommon in the US, they are frequently seen worldwide and are available through many importers, including mainstream sites like Amazon. These phones typically use GSM cellular technology, the standard used by T-Mobile and AT&T in the US. Your phone’s “identity” is defined by a SIM card, a small, removable card that can be transferred from one phone to another. To change your phone, you just pop your card into the new phone and you’re all set: no need to get prior approval from your phone company.

Verizon and Sprint use CDMA, which lack this SIM card technology. To use a new phone on these networks, you need to contact the company to have them assign your phone’s identification number to your cell number, so that calls are routed appropriately. Verizon now claims they will soon lift restrictions on this process, allowing a wider range of devices on their network.

Sounds great, but here’s a few problems. First of all, as I previously mentioned, you can already do this with T-Mobile and AT&T, so it’s not exactly a bold new step. Secondly, you’ll need to have an unlocked CDMA phone; these are relatively rare (though admittedly may become more common). When you read the fine print, it turns out they will restrict use to “approved” devices. While this is a step in the right direction, the actual impact at this time will be relatively minimal unless Verizon and Sprint start adopting a technology similar to SIM cards.

The iTunes/Starbucks deal is not so crazy after all

Friday, November 23rd, 2007

When Apple announced that they were partnering with Starbucks, many people scratched their heads. I’ve now changed my tune. In fact, I think the plan should be expanded to more types of stores.

Here’s the basic idea…you walk into a Starbucks. While you’re waiting for your double peppermint soy latte, you notice that you happen to like the song that’s playing. You take out your iPhone or WiFi-capable iPod Touch and it tells you what song is currently playing, as well as what songs were playing previously (in case you didn’t realize you liked the song until after it stopped playing). You can then buy the song right from your iPhone and sync it back up to your computer when you get home. The program is now active in Seattle, San Francisco, and New York, and will expand to more cities next year.

It’s not something I can see myself using frequently unless I start spending more time in Starbucks, but the idea is sound. This morning, I went to get a bagel from Bruegger’s and heard a song playing that caught my attention. It was a female singer who sounded somewhat like Kate Bush and sounded like it belonged to the late 80s-era alternative scene from England. The sound system wasn’t very good, but I thought I made out the lyrics “We could be dancing” as part of the chorus.

I hate not being able to figure out what song I’ve heard, so I hopped onto Google when I returned home and searched for ‘”We could be dancing” lyrics’ in Google, but came up with songs that sounded nothing like what I heard. Thinking I may have miss heard part of the lyrics, I modified the search to “could be dancing”, “you could be dancing”, “I could be dancing”, even “be dancing”. None of the songs were even close.

I then resorted to a different strategy. I knew Kate Bush had recently released a new album, so I checked out the most popular songs from it using iTunes - didn’t sound anything like what I had heard. I then thought further: who sounds like Kate Bush, may even sound like she has a British accent, but is more recent? Tori Amos. I tried searching for ‘”We could be dancing” “Tori Amos”‘ in Google but again came up short. I tried several purported lyrics search site as well as Melodyhound, a site that lets you enter a tune to search with using a virtual piano keyboard. Nothing.

In one last attempt, I went to iTunes and looked up Tori’s newest album and picked the most popular song, Bouncing Off Clouds. To my surprise, that was the song. It turns out the would “dancing” was actually “bouncing”. Who knew? If Bruegger’s had a system like Starbucks, it would have saved me a great deal of wasted time and frustration.

The Kindle fails to ignite

Tuesday, November 20th, 2007

I’m generally a sucker for the latest gadget, but one I won’t be rushing to buy is Amazon’s first entry into the market, the Kindle. The Kindle is an attempt to create what Amazon calls “the iPod of books.” This slim, compact device is innovative in several ways. Instead of using a traditional LCD screen like most laptops and cell phones, it uses a technology called “ePaper”. This technology, though not yet available in color, looks more like a traditional paper page than a screen - it’s not backlit, and can be read more easily in a wide range of lighting conditions. Users have said it is comfortable to read this screen for long periods of time, though I personally don’t have much trouble reading a traditional LCD screen. As a result of this technology, the Kindle has an decent battery life (Amazon estimates you’ll need to recharge every other day).

The second innovation is the inclusion of EVDO wireless data support for “free”. EVDO is the high-speed data network technology used by Sprint and Verizon (it’s not clear who Amazon has teamed up with), so you’ll have internet connectivity at most locations. Of course, Amazon is giving this to you for free so you can buy eBooks instantly from anywhere

This sounds fabulous, doesn’t it? Free high-speed internet? You can browse the web from anywhere? As always, there’s a catch. While there is no monthly fee, you do pay for usage of this network (outside of buying books and using Wikipedia). Want to browse the web? Sorry, you can’t…only read customized newspaper feeds and blogs optimized for the Kindle. Well, at least those are free, right? Nope, you’ll pay for a newspaper subscription or a blog subscription, even though these are freely available online. And remember, the Kindle is black and white only. Want to use the Kindle to send a few quick emails? That will be 10 cents per message. What happened to “free”?

One feature that jumpstarted the iPod revolution was the ability to take material you already owned (i.e. CD’s) and copy the music onto your iPod. There’s nothing analogous for the Kindle. Amazon will convert some files to Kindle’s format, but you’ll have to go through them each time you want to, say, add a PDF to your Kindle (amazingly, the Kindle does not natively support PDF).

Lastly, there’s the price. $399 for the device alone, then you’ll have to pay more for each book. All this to have yet another device you’ll need to carry, one that isn’t really practical for anything other than reading Amazon’s eBooks. Don’t get me wrong, I think that electronic formats are the future of reading (if not the present), but the Kindle does too many things wrong for it to be worthwhile in its current format.

Amazon Kindle

And, it’s really ugly…

It’s here…

Friday, October 26th, 2007

Holding Leopard