April 27, 2012
If you get stuck trying to Empty Trash in OS X
A few times, I've had a problem where the progress bar would stop progressing when I tried to empty the OS X Trash. Even going into the Terminal and trying to delete the files via sudo rm causes that command to just sit there, making no progress. Rebooting the computer doesn't help. (And, just to be even more fun, the computer may not even allow itself to be rebooted without restarting the Finder first.)
Every time this has happened that I can recall, the problem has been with the "ownership" of some files in the Trash.
Luckily, there's a very easy solution. Go to the Terminal, and enter:
sudo chown -R xxxxx ~/.Trash/*
(replacing xxxxx with your usual OS X "short" login name.) You'll have to enter an admin password.
After that, you should be able to Empty Trash from the Finder as usual with no problems.
April 09, 2012
Please allow me to take a brief moment here to give me deepest, most heartfelt thanks to Maine-based periodontist Dr. Laura Reidy and her husband, dentist Dr. Jonathan Tozer, and one of their staff – whose name I am very sorry to say I have forgotten, but which I will find out and post here – who detected the cancer early enough to probably save my life. (This staff member noted the first signs of cancer in a regular cleaning session; she alerted Dr. Tozer, who alerted Dr. Reidy.)
In particular, Dr. Reidy did something -- twice -- that I will be eternally grateful for. At first, it looked like it might be cancer, so she sent me to a cancer surgeon, who took biopsies and came to the conclusion that it wasn't.
Although Dr. Reidy is not a cancer surgeon, she looked at my mouth and would not let the matter rest with the surgeon's judgement. She took another biopsy herself, sent it off to be examined, and it came back positive. Her pro-active approach, skill at collecting usable biopsy, and courage to question the surgeon's conclusion, may well have saved my life, because the cancer was caught before there was lymph node involvement. As noted in my previous post, the difference is a 68% vs. 17% five-year survival rate for the type of cancer I had.
I then went to another cancer surgeon, and had surgery which removed some of my palate and upper teeth.
A year after my first surgery, my surgeon thought a spot on the edge of the surgical area looked a little suspicious, and did a "spot biopsy." It came back negative and he didn't pursue it. But when I saw Dr. Reidy two months later, she saw the same suspicious area and was again unwilling to assume that the surgeon's biopsy was correct. Her instincts told her it was still worrisome. She took another biopsy, and it came back positive. So, she may have saved my life not once, but twice, after she and her husband (and that assistant) identified it as possibly being cancer in the first place.
I went to yet another surgeon, the excellent Dr. Charles Norris in Boston, who did more surgery in the same area. And this time, the cancer does indeed appear to be gone -- at least there's been no sign of it in more than five years, and the prognosis is therefore good.
So, my deepest, most sincere thanks to all those who helped me. There is no way I can express my gratitude enough.
I have resigned from Emergent Discovery, LLC. I'm the main founder of the company (although I wasn't the CEO), so it is a sad thing. But I finally came to feel I'd be happier doing something else, and that my family would be happier too if I didn't come home as frustrated as I'd been.
Actually, I will go so far as to say that Steve Jobs' death had something to do with it. In his Stanford commencement address he said:
After Jobs died, I watched that address, which I hadn't seen before. And I noticed that he'd been moved by something he'd happened to see, and that it had, perhaps, been an influence toward changing his life. And I thought, why shouldn't the same happen with me? The fact is that when I looked in the mirror and asked myself the same question Jobs asked himself, the answer would have been "No." For too many days in a row.
The fact is, life is very short. I probably have a more visceral sense of that fact than some people do because I've had cancer. I never talked about it on this blog, but my voice here, moving forward, will be more personal than it was in my Emergent period. This cancer, oral squamous carcinoma, led me to undergo two major surgeries. The upper part of my mouth is largely replaced by a prosthesis (I do have five upper teeth left, which the prosthesis attaches to).
One article says:
For carcinoma of the palate and tonsillar area, 5-yr survival is 68% if patients are treated before lymph node involvement but only 17% after involvement.
The cancer was caught earlier enough that I had no lymph node involvement. But I was highly conscious of the fact that I might die. A year after the first surgery, which removed a good part of my palate, the cancer came back. That, obviously, was quite scary. I had a second surgery, continuing to work hard for Emergent all that time except for basic surgical recovery periods.
Since then there has been no sign of cancer for more than five years.
But, I don't take life for granted. Anything can happen; cancer can return, and there are certainly many other ways of exiting the stage! Life is simply too short and precious to waste a minute of it.
I was therefore primed to hear the combined message of Steve Jobs' speech and, not many years later, his death. And it became one of the catalysts (there were others) leading to a long period of trying to work out what could change so that I would feel differently about working at Emergent. In the end, for a number of reasons, the best answer seemed to be: I should resign.
I don't think it's the time to go into a detailed post-mortem. I wish Emergent well, and I'm moving on. At this point, I'm much more interested in the future.
I'll probably be posting more to this blog, and I'll certainly use it to talk about my next project. I haven't decided yet what that will be. I'm researching and considering various, very diverse options now.
But I do know that I won't have a cofounder. In fact, I'm going to try to get a web services or mobile app off the ground without even an employee.
The technology is vastly better than it used to be. Cloud services like Heroku eliminate many of the technical and hardware barriers.
Virality can lessen the need for traditional marketing expertise, though that can will occur if and only if you have the right idea at exactly the right time, and build a good-enough, attractive-enough embodiment of it. Of course, you can create and test a series of minimum viable products representing different ideas strategies, which gives you a few shots at coming up with the idea. But it's still a Very Hard Thing To Do. On the other hand, if you can achieve it, you can build a business with precious little marketing expenditure.
That's what I'm going to try to do. Build the technology myself, leveraging "the cloud," and try to spark virality. Of course, I may fail, but I think I'll succeed. This view of the world may be wrong, but no one will accuse me of not acting in accordance with it.
Once the product is off the ground, and has achieved a non-trivial degree of critical mass, I'll consider looking for investment and people who can come aboard and help scale it.
I do have some reason to think this is not impossible. For one thing, I created one of the first viral computer services that ever existed. This was a voice-mail-based dating service called 212-ROMANCE, which I started in the early 1980's. As far as I know, it was the first such service. It was enough of the right-idea-at-the-right time, that after I initially ran one small ad once in the Village Voice, usage grew continually until all phone lines were busy continuously. It was spread entirely by word-of-mouth. Eventually, I could go to a party and people I met there would already know about it.
As an aside, because it took a long time to listen to personals ads, I needed a way for the system to play the ads that were most appropriate for each caller first. I designed and implemented a solution that would now be referred to as "collaborative filtering". I'm not aware of that concept being written about or implemented before that (if you know otherwise, please let me know).
So anyway… this post has covered a lot of ground, though none of it particularly in-depth. I wanted to bring this blog up-to-date and prepare the ground for more blogging in the future, and hopefully I've succeeded in that.
February 02, 2012
Calculating the product of a Python list
June 01, 2011
Selenium's WebDriver & Python: Dealing with script timeouts
Selenium's WebDriver is a great way to interact with web sites in an automated way. It's primarily for testing, though I've also had occasion to use it for other purposes (with the permission of the relevant site owners).
I searched the web for solutions and found various suggestions that didn't work. Perhaps many of them worked with pre-WebDriver versions of Selenium, I don't know.
In any case, the following worked for me to change the timeouts to 10 minutes:
from selenium import webdriver
profile = webdriver.firefox \
set_pref = profile.set_preference
driver = webdriver.Firefox(fx_profile=profile)
Note that the dom.max_chrome_script_run_time preference has nothing to do with Google Chrome, it's related to Firefox's internal Chrome URL's. In fact, for my purposes, I only needed to change dom.max_chrome_script_run_time.
Note: if you're not familiar with WebDriver, do help(webdriver.Firefox) for a description of the methods you have available for interacting with sites. Hint: the oddest thing is that to fill in a text field, you get an object representing the element with the text field, and then call myElement.send_keys("the text").
Update: Docs on the Python bindings may be found here.
February 03, 2011
Profiles In Courage
Anti-Mubarak protesters are descending on downton in the thousands. They are not giving up Tahrir. #JAN25
16 hours ago Favorite Retweet Reply
I hear reports of Army evacuating the Square from Protesters. Is this true? #jan25
5 hours ago Favorite Retweet Reply
Either way, I am heading there with medical supplies. They better not block my entrance. #jan25
5 hours ago Favorite Retweet Reply
Then somebody telling him how to get into Tahrir:
@Sandmonkey it's open. Kasr el Nile or talaat harb.
5 hours ago Favorite Retweet Reply
Reports about my dear friend @Sandmonkey being arrested in#Tahrir. So worried can anyone give me more info? @bencnn#Egypt
1 hour ago Favorite Retweet Reply
and a number of other tweets from different people reporting the same thing, including:
Last update, Feb 11:
The courage of Sandmonkey and all the protestors has paid off. Unbelievable to have been privileged to watch this history unfold in real time. Here's the last tweet from Sandmonkey I'll post here:
Sandmonkey Sandmonkey To everyone who rediculed us, opposed us, wanted us to compromise, i say: YOU ARE WELCOME :) TODAY WE ALL CELEBRATE!!! #JAN25
To everyone who rediculed us, opposed us, wanted us to compromise, i say: YOU ARE WELCOME :) TODAY WE ALL CELEBRATE!!! #JAN25
Now, let's hope that the ruling Supreme Council of the Armed Forces doesn't turn out to just enable a continuation of the same type of authoritarian regime...
October 02, 2010
How to tune a guitar
...if you're a luthier, that is.
I was wondering why a Yamaha classical guitar I purchased a few years ago always seems out of tune, and started a discussion about it in a guitar forum, including measuring the pitch while each string is open and fingered on the 5th and 12th frets (bizarrely inconsistent results). They suggested I check out this fascinating article by Gregory Byers. It describes the lengths (pun not intended but allowed) a guitar-maker has to go to to create a situation where each string is somewhat in tune on each fret. My Yamaha was not made that carefully! Of course very few guitars are. Byers spends a month making a guitar, and they cost $9,500.
Get yer mental health here!
A friend of mine, Tom Sulcer, with whom I like to harmonize on tunes like the Beatle's "If I Fell," posted a fairly massive article called "Mentally Healthy Mind" in a Google knowl. It touches on everything from deliberative democracy to Maslow to Spinoza. Did I mention that it's massive? My own impression is that most of the important understandings in life are largely unconscious and hard to modify through conscious deliberation, whereas Tom appears to try and leverage a conscious understanding of just about everything related to living a life. We'll see who's right by noting which of us plays better guitar at age 95.
July 20, 2010
A Dog's Consciousness
Here's a way to imagine what it would be like to be a dog.
Take a few moments to imagine yourself exactly as you are now, with the exception of not being able to focus your attention on anything that exists only in your head. You don't even have to imagine not having thoughts. You just can't focus on them.
October 17, 2009
Non-blocking raw_input for Python
[Edited Aug. 30, 2010 to fix a typo in the function name and generally improve formatting]
I needed a way to allow a raw_input() call to time out. In case it's useful to anyone, I wrote this solution which works under Unix-like OS's.
import signal class AlarmException(Exception): pass def alarmHandler(signum, frame): raise AlarmException def nonBlockingRawInput(prompt='', timeout=20): signal.signal(signal.SIGALRM, alarmHandler) signal.alarm(timeout) try: text = raw_input(prompt) signal.alarm(0) return text except AlarmException: print '\nPrompt timeout. Continuing...' signal.signal(signal.SIGALRM, signal.SIG_IGN) return ''
October 12, 2009
Snow Leopard Guest User data loss bug
I've seen a number of mentions today of a bug that can cause a Snow Leopard user to lose all their data:
One user reports a way to recover the lost data. Since it's buried in a discussion thread, I'm reproducing it here (also fixing a typo pointed out by a reader of this blog):
The problem appears to manifest itself on machines which had the Guest account option enabled under Leopard and were subsequently upgraded to Snow Leopard. Users booting their machines have reported that upon start-up, they have been logged into the Guest account. Upon switching to their regular account, the affected users have been finding all of their user data missing and unrecoverable except from a backup. [MacRumors.]
The files were still in /Users,
recovery was not too difficult.
1) su in terminal
2) mv username username.old
3) create account username
4) mv username username.new
5) mv username.old username
6) chown -R username username
I don't know whether it's a general fix. If you run into the bug and decide to try this solution, feel free to post your experience in the comments section!
September 11, 2009
We've made a substantial upgrade to the look and feel of our Flyfi.com web site. The site does a lot, and this release has been geared toward making the functionality more readily apparent and easier to use.
August 02, 2009
FlyFi Community Playlist
If you're a Facebook user, you might want to check out my company's FlyFi Community Playlist app which lets a Facebook community collaborate on a playlist... but it's more than a playlist because it also provides tracks related to the manually entered ones.
A fair number of the tracks are legally downladable free MP3's, from superb artists like Randy Newman (one of my personal top 5 artists), Ani DiFranco, Suzanne Vega, Dar Williams, and many others.
July 29, 2009
Correction re singletons
The source code link presented at the main post for my singleton mixin classes was bad until now. It pointed to an earlier version that didn't have thread safety or various other improvements. Sorry.
July 28, 2009
Even more singleton improvements
singletonmixin now deals with cases where you want to be able to include args in calls to S.getInstance() even after the initial instantiation.
July 27, 2009
More singleton improvements
Based on internal work and feedback appearing in comments on this blog, I've updated the Python singleton class I posted way back in 2004. That earlier post remains the place to get the code and place any further comments.
It now handles keyword arguments, and is threadsafe for singleton creation.
June 16, 2009
I was stunned at how poor the Iran coverage was on cable news over the weekend. Then I saw this thought from Matthew Yglesias:
Whenever I find myself talking about new media to skeptics of an older generation who worry that the standards online are too debased, I try to remind people that the real debasing came with the rise of multi-channel cable news. In terms of the Iranian elections, the world’s top newspapers have the people on the ground reporting the main facts, and there’s lots of smart analysis from legitimate experts all over the web, but on television if it can’t be captured by two talking heads debating each other it’s like it never happened. (Hat tip to Jason Linkins, who also provided the emphasis.)I had noticed that CNN seems to show an awful lot of discussion between experts over each event -- often much more of that than direct coverage of the event itself But I'd never thought of it in quite the way Matthew puts it. Anyway, I turned on CNN this morning to see whether, for a change, they were covering Iran.
And they were -- kind of. There was some talking head being asked about whether Obama should be taking more of a stand in favor of the protestors. The guy's opinion was that he should.
The picture is being coming clearer. Generally CNN consists of one or more talking heads in a room, taking turns talking about whether the latest news event is being handled in accordance with their personal opinion. Proportionately speaking, there seems to be not all that much actual reporting of facts.
I still don't get the reason why this is happening. Maybe it's because people find it more enjoyable than actual reporting because it's a little like gossiping about the failures of the newsmakers? Or is it that and there's a tiny bit of "human drama" when the talking heads disagree -- kind of a combination of news and reality TV? Or could it simply be that it costs less than actual reporting? (They probably don't even have to pay the talking heads, who are happy to be there to publicize themselves.)
June 15, 2009
If you've been following developments in Iran, and particularly the Internet's essential role in reporting (and supporting) events, I don't have much to add.
If you haven't, I strongly suggest you go to Andrew Sullivan's blog and starting following him now -- as well taking a bit of time to look through his posts from the last couple of days. He's been doing a wonderful job. Far better than any mainstream news outlet, with the possible exception of the NY Times' Lede. (Although the Lede doesn't present as much detail and analysis as Sullivan does -- with the help of his readers and well-chosen links to other sources.)
One of Sullivan's readers sums up the key role Twitter is coming to play:
Ahmadinejad's and Khamenei's websites were taken down yesterday - I saw the latter go down within a couple of minutes because of a DDOS attack organised via Twitter. @StopAhmadi is a good source for tweets on this. The other important use of Twitter has been distribution of proxy addresses via Twitter. This would be how most video and pictures of today's rally have gotten out.
One amazing thing is that it seems at least conceivable that the protests would not have been as successful as they currently appear to be if Twitter didn't exist.
Sullivan suggests wearing green in support of the protesters. I think that's a great idea.
June 09, 2009
Most people reading this blog will know that I am a founder of the company that makes Flyfi.com (basically a vastly improved reboot of the old Goombah site).
In the last couple of weeks we have added enormously to the site, including improved recommendations. If you haven't checked it out, please do!
Here's a note I wrote to introduce it to some high school friends who I recently reconnected with on Facebook:
Hi Everyone. You may remember me playing my guitar in the hallowed halls of B.H.S. In college I became interested in math & computer technology, and in recent years, I've come full-circle by finally merging my interests. I've co-founded a music-oriented Internet startup. Our product is FlyFi.
Our VP/Industry Relations who, in a former life, earned 10 Grammy nominations as a producer, is now dedicated to using his industry connections for getting us the highest quality free music collection on the Internet. We've got great indie artists like Ani DiFranco, some well-known, others up-and-coming. Unlike some of our competing services you don't just hear the music for free -- you can also download many tracks as free legal MP3's.
My area of focus is our music recommendation technology, which lets you type in artists you like and get music out that you'll probably also like. I love music from many genres, from the Beatles to Beethoven to John Coltrane to Leonard Cohen. But I think there are underlying commonalities in the music I most love, regardless of genre. So we have statistical algorithms that try to find music that has those commonalities for each person's tastes.
Over the last 6 weeks or so, I've been completely wrapped up in putting the finishing touches on the first full release of FlyFi (which is why some of you may have noticed that my Facebook communication flow has dropped pretty much to zero). It's out now, ready for your perusal.
So, if you love music, go check out FlyFi.com!
June 06, 2009
One of my more unusual pastimes is making up Tom Swifties. Examples of my efforts in this area include:
"She said I look like a common farm animal!" Tom said sheepishly.and
"Those damned cannibals! They're seasoning us with lemon juice!" Tom said sourly.
The NY Times is having Tom Swifty contest this weekend. Submissions include:
"My men will never mutiny," said the Captain blithely."
In the esthetic of the Tom Swifty, I believe that significant demerits apply to those where the description of the act of speaking doesn't really match the tone of what is said, such as this Times submission:
"She's got my photo in her locket," said Tom independently.
and this one:
"What's under this green jello," Tom asked sublimely.
Here are two particularly fine submissions, from Chris Doyle:
"I'll just have to kill the king," Reggie sighed.
"May I have this dance?" Fred asked gingerly.”