some code for a change

I’ve written this function a zillion times, so I decided to post it on my blog. Yes, it could do more error checking (what if that new returns a NULL? what if an exception is thrown?). But it does more than zero error checking, so there you go. This is super useful if you are getting ANSI code paths from legacy APIs or if you are using boost::filesystem::path to store paths in a platform independent way (until the new boost comes out).

This particular version isn’t battle tested (yet), but it does work.

// convert a path from ANSI to UNICODE on windows using std::strings
// useful for converting a boost::filesystem::path into a wpath,
// until those APIs get merged
std::wstring convertStringToWString( std::string in )
{
    if (in.length() == 0 )
    {
        return std::wstring();
    }

    UINT wStringLength = MultiByteToWideChar( CP_ACP, 0, in.c_str(), -1, NULL, 0);
    if (wStringLength==0)
    {
        return std::wstring();
    }

    LPWSTR widestr = new WCHAR[wStringLength];
    wStringLength = MultiByteToWideChar( CP_ACP, 0, in.c_str(), -1, widestr, wStringLength );
    if ( wStringLength ==0 )
    {
        delete[] widestr;
        return std::wstring();
    }

    std::wstring returnVal = std::wstring( widestr );
    delete[] widestr;

    return returnVal;
}

Chez Shea

Chez Shea dining room.
Chez Shea dining room.

For years we’ve stood waiting at Matt’s In The Market and pondering what was behind the door at Chez Shea. We knew that it was supposed to be nice, but we never got around to eating there until recently. We were pleasantly surprised at the size (it is quite small and cozy), the environment (similar to Matt’s old vibe when it was smaller, but more romantic) and the staff (friendly, but not to the point of being annoying). I was very happy that I didn’t feel out of place wearing a suit, the other diners (for the most part) were dressed for special occasion meals as opposed to the shorts and t-shirts you sadly see too often in high-end restaurants around here.

The food was good with some touches of excellence, but not enough to be a draw on its own at this price range. If you are into “Big Flavors”, you can skip Chez Shea. The food was fairly subtle but solid; tasty, but not overpowering. Two elements of what I ate remained with me (admittedly these were the biggest flavors in my meal): I had a Hamachi Crudo which came with some sliced Jalapeno that added an interesting kick to an otherwise bland dish; and a Muscovy duck that was prepared two ways, one of which was a Confit Crepinette that was simply amazing.

The menu is fairly standard high-end northwest cuisine: seasonal, fresh ingredients, featuring seafood and northwest game. The menu itself was a little small, but it was ample enough that we were able to find good choices for four courses each. As with many higher end restaurants, the portions are smaller, but we didn’t leave feeling hungry. If we’d skipped a course, we might have left seeking some extra food though. The wine list was good as well, but not extensive.

Overall, we liked Chez Shea, but probably more for the atmosphere than the food. The food was good enough that we’d definitely consider it again for a special romantic dinner, but not so good that we’re already planning our next visit. I would definitely like to come back and try the Bistro some other night. It is even smaller than the restaurant and may be a great “date night” destination.

Chez Shea / Shea's Lounge on Urbanspoon

iTunes hack warning!

My iTunes account was hacked on Friday, I didn’t find out until Sunday night though because that was when I tried to log in to my account after it had happened.

Watch out for these signs (Apple support didn’t even consider that I had been hacked when I contacted them):
The hackers changed my account ID and my e-mail address to something similar to what they had been before but different. This allowed them to charge two $50 iTunes gift certificates to my card without me being notified (because they had changed the e-mail address on the account).

When I tried to log into my account on iTunes, I got weird errors about my account id or password being incorrect. When I tried to recover my password on Apple.com, I got an error saying that my account ID was not in the system. When I tried to get my account ID, they couldn’t find it (since the hackers changed my e-mail address). Of course, I could not log into the support site to try to report the issue since it requires my Apple ID. Luckily I found the iTunes store form that let me contact support via the web without logging in and they were able to tell me that I had changed my account ID and e-mail address. I was able to log into the new ID that the hackers made with my old password, which was really lucky since Apple support was clueless about what had happened.

Why didn’t Apple notify my previous e-mail address when the change was made? That is a basic security process that many other sites use. There is a pretty clear pattern of fraud here as well, account information is changed and then large purchases are immediately made. Shouldn’t Apple be looking for this kind of thing?

I have contacted support to find out if they have a process for dealing with fraud, but I can’t help but feel that Apple’s security is somewhat to blame here. I’ll let you know what Apple suggests I do.

I also posted the above on the Apple support site here. Please spread the word so that others aren’t ripped off.

On a side note, I can’t help but wonder how my account got hacked. I’m pretty wary of phishing scams, and that kind of thing. I’m always extremely careful with this kind of stuff. The only thing that occurs to me is that the same day my iTunes account got hacked, I created an account on artaculous.com. I used the same e-mail address (of course) and in this case I was lazy and used the same password as my iTunes account. I generally try to avoid using the same password twice, but it does get hard to remember them all without reusing them sometimes. I have since gone and changed every password on every site that I have accounts on, just in case. I’m not saying that artaculous.com is some phishing scam, but the coincidence is rather odd…

I’ll update this post as I get more info from Apple. Please add a comment if you have heard about this scam or have more information or suggestions.

[Update: 6/29/09, 11:26pm]
Of course, I changed all my passwords on every site I could find an account on today. My e-mail is full of account update notices from a zillion large and tiny companies… Except Apple. I changed my Apple ID (Twice!), my password (Twice!), my security question, my mailing address. Exactly zero messages from Apple letting me know in case it wasn’t me. This really is pretty weak security on Apple’s part.

[Update: 6/30/09 9:09am]
One of the iTunes gifts certificates had been sent to a gmail address. I tried to find a way on the gmail site to let them know that an account was being used or involved in a crime, but couldn’t find a way to do it. Seems weird because I don’t think you need the certificates mailed to you to use them, just the code. The second certificate had not been mailed or had the e-mail addy cleared. Can’t Apple track the IP address of whomever uses the gift certificates to track back to the people who hacked my account? Will they bother? Still waiting to hear back from Apple on letting them know that my account was hacked. Would call their number or try to see a genius, but I’m in jury duty right now.

[Update: 6/30/09 2:04pm]
Apple has responded (excerpt):
I understand you are concerned about purchases that were made with your iTunes Store account without your permission or knowledge.

I know it can be discouraging when fraudulent charges are made on any type account whether it’s your bank or iTunes.

I urge you to contact your financial institution as soon as possible to inquire about canceling the card or account and removing the unauthorized transactions. You should also ask them to launch an investigation into the security of your account. Your bank or credit card company’s fraud department should then contact the iTunes
Store to resolve this issue. The iTunes Store cannot reverse the charges.

Basically, they are pushing this back onto me to deal with my credit card company on. Not overjoyed with this, but fair enough, most people thought that was what they would do. I am a bit concerned that they believe that my credit card could also have been compromised because of this. I thought that my credit card info wasn’t exposed. If credit card info is exposed through iTunes and their security is so lax, I’m going to be wary of giving them any info in the future. I’m also concerned that they aren’t saying that they will do anything to pursue the person who did this. I would like to feel that Apple actually cares about this instead of just blowing it off.

[Update 6/30/09 10:36pm]
Found these links with more info about iTunes account hacks:

[Update 7/2/2009 9:43am]
Apple (correctly) disabled my iTunes account when I reported that it was hacked. They didn’t actually tell me this though, so I didn’t find out until I tried to use it to update my iPhone apps. What did they need to re-enable it? My billing address. Where was my billing address info stored? In my iTunes account. Since that was pretty unlikely to change after a hack, it seems a pretty weak way to verify my identity. I pointed that out in my return mail, but so far iTunes support has ignored all my questions and comments in my messages to them. I guess that is policy, but also a bit lame. I also may have figured out why the hackers didn’t change my iTunes password. I did find a message from Apple in my spam folder notifying me that my password had changed (from when I changed it after getting my account back).

There was enough info in my account that I’ve had to cancel my credit card, and I’m going to need to be extra vigilant for identity theft moving forward. Since then, I’ve changed my payment method to none in the iTunes store. I may have to enter credit card info each time, but that now seems like a minor inconvenience. I have also changed all my other info to be completely bogus so that if someone does hack it again, they won’t have any useful info on me. Why does Apple need by birthday (not birth date for age verification, but birthday)? I’m going to do the same with my other accounts and would suggest it to anyone else concerned about this kind of stuff.

[Update 7/6/2010]
A year later, tons of reports of other accounts being hacked, including several on this blog. Thanks for adding your voices. Meanwhile, Apple has changed NOTHING on their iTunes security processes. They continue to push the blame and responsibility on their customers and the credit card companies. Now, there are reports that iTunes store and account hacking is not only more widespread than has been thought, but also very well organized. When will Apple take some responsibility?

Seriously, set your payment method to None now if you want to avoid having to deal with this pain. It sucks to have to enter in the data every time you make an iTunes purchase, but it sucks a lot less that having to get a new credit card because someone hacked your iTunes account. Trust me on this one.

[Update 12/26/2010]
I was buying some apps on iTunes today. I still keep my payment info set to none and my address set to my non-billing address as a rule and change them when I want to actually buy anything. It is still a massive PITA, but probably helps me avoid dumb impulse purchases 🙂

I noticed something different today, when I changed my payment and address info, I immediately got a message from Apple about the change, and then another one when I changed it back. This is new, and this is good. A trivial change from Apple, and certainly long overdue, but a very positive step.

[Update 3/22/2013]
Apple has now enabled two-factor authentication on Apple accounts. If you are worried about your account being hacked, it would be a good idea to take advantage of this. Here are instructions from lifehacker on how to turn it on.

Server-based DRM solutions are hostile to consumers

I have a long history with DRM (Digital Rights Management): I worked on the Windows Media 7 Encoder team; I worked at two different internet video startups; and as the owner of record label, I experimented with some of the very first paid digital download solutions (all long lost to internet history at this point).

When I first learned about the DRM mechanism where the player would “phone home” periodically to make sure that you were still licensed to the content, I immediately realized that this was a really fragile way to license media. I’m not talking about subscription content (like Rhapsody), streaming media (like Hulu/YouTube/Flash Media Server) or rentals (like Amazon/iTunes rental), I’m talking about content that is purchased by the consumer. The issue is that there are 1000 ways that the user can lose access to their content without any ill intent on their part. This isn’t an issue if the licenser of their content is still in business and supporting the licensing mechanism. However, even large companies sunset their DRM technology support, screwing over their customers (see Google Video and Microsoft Plays For Sure for example). Depending on how onerous the original licensing scheme is and how it was implemented, buying a new computer, changing the hardware configuration, upgrading system software, the company dropping support for the DRM, the licensing company’s servers going down or just the user being without the internet can cause a user to lose access to the content that they paid for and legally own.

Maybe the user got some warning and could back up their content to some other format (if allowed by the licensing scheme, it often isn’t); but maybe they didn’t see or understand the warning. Then it is too late. Is it the consumer’s fault? No, it is never the consumer’s fault. They purchased digital content with the expectation of owning it forever, just like when they purchased their media as hard goods.

Onerous DRM has been put in place by media companies desperate to avoid piracy, but as it has been written about in so many other places, DRM makes more pirates than it avoids. It makes it more difficult for the people who want to get their content legally by adding roadblocks between them and their purchases and it doesn’t stop the pirates who avoid the whole thing. I wonder how many Plays For Sure customers went to an illegal site to re-download the content that they had already purchased when they lost access to it. I wonder if any of them felt like they were breaking the law at that point. I doubt it. They had paid for something and had been denied access to it. Maybe they were mad at Microsoft, but they were probably more mad at the record labels, because that was the product they purchased. Microsoft was just the store.

I was thinking about this again today when I went to purchase a song off of iTunes and found that Apple had lost my Apple ID. This was the Apple ID that I had spent years buying content from iTunes with. Sure, Apple has moved to make their music DRM free, but I haven’t completely updated my catalog yet, and there is a lot of video that I have paid money for as well that is still subject to Apple’s DRM. While their mechanism still allows me to play my content on my authorized computers (as far as I can tell so far), it will not permit me to authorize a new computer. If Apple isn’t able to fix this problem, what happens to the content I purchased over time? If I can’t access it anymore through no fault of my own, am I in the wrong legally to download it off a file-sharing site?

DRM models have continued to evolve over the years, but I think that the audio model has shown the way for purchased content. It is high time for media owners to allow the people that pay for a full copy of their content to own that content outright, with nothing that could prevent the consumer from having access to the content that they paid for, including transcoding as media formats change over time. Otherwise, they will alientate their consumers as they find they cannot have what they paid for.

note: I avoided mentioning the new licensing models that have sprung up, where when you “buy” a copy of a song or movie the license agreement says that you don’t really own it, which is becoming more common as a way to avoid legal issues when user’s circumvent DRM to make fair-use copies or so that they cannot sue if they cannot access their content. I avoided mentioning it because:
A) it muddies the discussion.
B) I think it is evil.

The coming Seattle-area traffic disaster?

Is there something that the Washington State Department of Transportation isn’t telling us?

Simultaneously, there are several large-scale transportation projects in planning or preparation stages: replacement of the 99 viaduct with a tunnel, replacement of the 520 bridge, and construction of the East Link of the light rail project. These projects individually would have significant impacts on traffic during their construction, however there will be many years of overlap between them which will cause a serious traffic nightmare. If you read the WSDOT pages, you don’t see any mention of any of these projects in relation to each other.

The legislature just approved tolling for the 520 bridge, this is a necessary and correct step. It will have the effect of diverting some traffic to 522 and I-90. At some point in the near future, construction will begin on the new 520 bridge further diverting traffic to the alternate routes.

The east link of the new light rail will run in the express lanes of I-90 removing two lanes of traffic in the peak directions. Currently, on many days, I-90 is stop and go even with these extra lanes. Diverting the current express lane traffic into the existing lanes (even with the additional proposed HOV lane in each direction) will already significantly slow down traffic on this corridor. Add to this the extra traffic diverted from 520 and I-90 will be a parking lot for several hours a day for many years.

I-90 feeds a significant amount of traffic to 99. When the viaduct is being replaced over several years, some amount of its traffic will be diverted to I-5. I-5 will also be getting additional traffic from cars diverting around 520 on 522. I-5 is already pretty bad, this will definitely make it ridiculous.

There are no definitive dates yet for a lot of these projects, but we’ll start seeing some of the first effects in the next few months. There doesn’t seem to be any real coordination going on around these projects or any acknowledgment on their cumulative effects to traffic in the short term from the state. If the duration of these projects were months or even a year, this would be somewhat reasonable. However, WSDOT estimates are for these projects to happen over the next 5-10 years. That isn’t reasonable for this to proceed without serious mitigation plans (even if they were to add significantly to the cost or the time lines).

Right now, it just seems like everything is up in the air so WSDOT isn’t addressing the potential issue. That makes it seem more like they just hope that no one notices…

An idle thought on date naming in the new millenium

Let us pretend that you have a yearly festival, Awesome Fest. You’ve been doing it forever. Awesome Fest ’87 was insane, this year’s Awesome Fest ’09 will be crazy.

What do you call next year’s Awesome Fest? Awesome Fest ’10 sounds weird to me. Don’t you need to start using he whole year for a while (eg. Awesome Fest 2010)?

Maybe we’ll come up with something new?

Just a random thought…