Thoughts on the Mute Switch

January 23rd, 2012

So there’s been some blog chatter this week about the mute switch on the iPhone. Of course it’s not really called a mute switch, and it doesn’t really “mute” the phone. It’s really just a signal to the OS that the user would like less sounds.

I fall firmly on the “the mute switch should really mute the phone” side of the fence, at least optionally.

If I’m in a location where I’m expecting my phone to be silent out of respect for something (like, in a movie, at a live performance, or at a funeral) then even if I have an alarm configured for that time, I don’t want it to go off. It’s going to embarrass me if it goes off. And yes, I even include the “Find My iPhone” sound in the list of sounds I don’t want my phone playing in these situations. There are some times when I want to know that my muted phone really isn’t going to make a sound.

But the difference is I don’t expect the phone to stay that way.

John Gruber mentioned that when he mutes his phone while in a movie, he almost never remembers to unmute it. That’s a common problem, but it’s not a hard one to solve.

There was a feature on an old phone I had, that would let you mute the phone for a period of time. “Mute for 2 hours”, for example. When you think about it, mute is almost always situational. You want your phone muted for a while, and usually you know how long. This would do away with the problem of “I muted my phone for a movie but then I missed my alarm clock the next morning because my phone was still muted”.

Better yet, make the phone muting part of a meeting setting. When I put the appointment in my calendar to go to a movie for 2 hours on Thursday, I’d like to set the phone to mute right there. That way there’s no chance I’ll forget to mute it, and no chance I’ll forget to unmute it.

This seems like an obvious feature but I’ve never seen any phone support it.

Can’t Connect to Lion SMB Share?

January 15th, 2012

I’d been having this problem for a while and decided to dig into it today. I have shares from a Lion box, but when I’d attempt to connect from Windows 7, it would just refuse my credentials.

Here’s the solution that worked for me.

Edit this file in a text editor:

/Library/Preferences/SystemConfiguration/com.apple.smb.server.plist

You’ll need permissions to edit it. Run your editor using sudo, for example.

Add the following keys:

1
2
3
4
5
6
<key>AllowKerberosAuth</key>
<true/>
<key>AllowNTLM2Auth</key>
<true/>
<key>KerberosRealm</key>
<string>***COPY-THE-LocalKerberosRealm-VALUE***</string>

Don’t forget to edit this to copy the LocalKerberosRealm value into the KerberosRealm value.

Once you’ve done this, save the file, turn SMB sharing off and back on, and you should be able to log in. I’m not convinced this is “the fix” for everybody, but it worked for me.

What do people eat?

January 13th, 2012

Here’s an interesting way of looking at what people eat: Looking at what people do calorie queries for on Google.

201201130836

The winners are:

apple
banana
almonds
avocado
beer
banana
broccoli
blueberries
chicken breast
chicken
coffee
carrots
dates
domino's pizza
dried apricot
dried cranberries
egg
egg whites
edamame
eggplant
fruit
fish
flour
grapes
grapefruit
gin
green beans
honey
hummus
hard boiled egg
ham
ice cream
indian food
iceberg lettuce
italian sausage
jello
jelly beans
jack daniels
jujubes
kiwi
kale
kfc
kraft dinner
lettuce
lasagna
lean ground beef
lentils
milk
mcdonalds
mushrooms
mashed potatoes
nuts
naan
nanaimo bar
nachos
orange
oatmeal
one egg
onion
pizza
popcorn
pumpkin seeds
pomegranate
quinoa
quiznos
quiche
red wine
rice
raspberries
rum
sushi
sweet potato
salmon
sugar
tim hortons
turkey
tomato
tea
udon
unsweetened applesauce
vodka
vegetables
wine
white wine
watermelon
walnuts
xylitol
xanthan gum
xenergy
yogurt
yam
yellow pepper
zucchini

There you have it; a list of foods that’s not really much use for anything. But still interesting.

Apple Analysts

January 12th, 2012

It’s amazing the discongruity between the “professional” analysts of Apple’s financials, and the “amateurs” like Horace Dediu of Asymco.

I put “professional” and “amateur” in quotes because it seems like in this case, the results you get from these two groups are opposite from what you’d expect. The financial market, and professional analysts, have been underestimating Apple for years now.

This story at Market Watch, “Time to Sell Apple“, is a perfect example. Here’s a few points from this article.

If a business fails to take care of its customers, its customers will go elsewhere … In the case of Apple, this is happening in front of our eyes, and the risks are therefore very high. Apple has stopped serving their customers well, and unless they start to serve their customers better the company will begin to lose more market share and revenue and earnings projections will come down aggressively.

But this whole statement is based on this assertion:

Most people think Apple’s customers are the end user, but … the real customers are third-party resellers, and Apple is not treating them right.

This is just flat out wrong. Apple has never pandered to the carriers and resellers. They’re the only phone manufacturer that doesn’t, and it’s one of the reason their real customers, the folks using the phones, prefer their products.

iPhone users are people who want an iPhone. Android users are, mostly, people who want a phone, and went with the one the carrier suggested.

The company’s high-growth phase is behind it

This is where the analysts methods fail. They can only analyze the data they have available, and they have no data about future products. But it’s these future products, the ones we don’t know about yet, that is where Apple’s growth comes from.

I don’t think the market has any model that can account for this, so they look at each new, incredibly successful, incredibly profitable thing that Apple does as if it’s the last one. Because how could they do otherwise?

An Apple TV

January 3rd, 2012

I don’t really understand why Apple would get into the TV business.

Apple creates new markets. Moving into an established market like the TV business, with all the content complexity and interconnection requirements, just doesn’t seem like something they’d do. It’s a highly competitive space with low margins; not Apple’s kind of business.

And the idea that the world needs an Apple TV because TVs are too hard to connect seems off the mark. Hooking up a TV isn’t difficult; it’s hooking up all the other devices – the cable box, the PS3, the Xbox 360 with the Kinect, the Wii and its sensor bar, that make it difficult. Unless Apple is planning to take over the jobs that all the other devices people do with things hooked up to their TVs, they’re not going to be making things that much simpler.

An “Apple TV” without some pretty amazing content deals would still require a cable box, and if they could pull off those deals, why tie it to a new TV? Why not just making it available through the Apple TV for everyone?

My iTunes Match Experience

December 16th, 2011

I’m in the middle of setting up with iTunes Match. So far, it’s been anything but smooth.

First off, I signed up during the brief window when iTunes Match was available for sale but not actually working in Canada, so I had a completely broken service for a day or so.

But once it was officially switched on, it started working. There are 3 steps to iTunes Match:

201112161716

Step 1 was painless. It whipped through my ~23k songs in an hour or so, and then went on to step 2. I left it at step 2 overnight, and when I woke up in the morning, it was stuck. It was about 80% done, but not moving.

I stopped iTunes Match and restarted it, and this time paid attention to where it stopped. This time it made it to song #22548, and then hung. Stopped, restarted, and it made it to 22549. Progress, but the 10 minutes or so it took for every attempt to make it to that song number was painful. I was watching with fs_usage to see if it was getting hung up on a certain album or something, but every time it stopped it was on something completely different.

But after 2 more restarts, it made it all the way through my music library. Now it’s on Step 3, uploading, and and with 4103 items to go, this one’s going to take a while.

The message I wanted to convey in this post is: If iTunes Match is hanging during Step 2, just stop it and restart it. Eventually it will complete.

Update three days later: It’s just over half done. About 1950 songs to go. I’m on DSL, so my upstream bandwidth is about 1 megabit.

iTunes Match Canada Rollout

December 15th, 2011

Or not-rollout as the case may be. Last night I read that iTunes Match had been switched on in Canada, so I fired up iTunes and went to my account page, and there was an option to Learn More about iTunes Match. I clicked on that and it let me sign up.

But after that .. nothing. No new UI to let me sync my songs to the cloud.

Either this is was a mistaken rollout and they’ve switched it off (in which case they’ve got a lot of refunding to do) or they are having problems with all the extra subscribers and the problem will sort itself out shortly.

I’m thinking it was a mistaken rollout. Why? Because check this out:

It would be so out of character for Apple to ship UI with a typo. I’m guessing this was supposed to be some sort of test release that accidentally got pushed live.

Update: It’s really live now, and working for me. Typo and all.

UITableView selection not sticking when reloading cells

December 12th, 2011

I have some UITableView code that was setting a selection, and then later making some other changes to the cell using reloadRowsAtIndexPaths:withRowAnimation: and I was having trouble figuring out why my selection wasn’t sticking. I’d select an object, but it wouldn’t show as selected.

Turns out reloadRowsAtIndexPaths:withRowAnimation: will deselect whatever rows you reload. Check this out:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Create an NSIndexPath that indicates the 3rd row
NSIndexPath *path = [NSIndexPath indexPathForRow:3 inSection:0];

// Select it
[self.tableView selectRowAtIndexPath:path
                            animated:NO
                      scrollPosition:UITableViewScrollPositionNone];

// Is it still selected?    
path = self.tableView.indexPathForSelectedRow;

// Yes, this will print the values you'd expect for that row being selected
NSLog(@"Path: %@", path);

// Reload that row
[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:path] withRowAnimation:UITableViewRowAnimationNone];
   
// Now is it still selected?
path = self.tableView.indexPathForSelectedRow;

// Negatory, path is null.
NSLog(@"Path: %@", path);

It’s not obvious from the documentation that this operation affects the selection, and it took me a while to figure out why my selection was being dropped. The fix is simple enough: Preserve the selection yourself around the reload call.

1
2
3
4
5
6
7
8
9
10
// Save the current selection
NSIndexPath *savedSelection = self.tableView.indexPathForSelectedRow;

// Reload
[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:path] withRowAnimation:UITableViewRowAnimationNone];

// And restore the selection
[self.tableView selectRowAtIndexPath:savedSelection
                            animated:NO
                      scrollPosition:UITableViewScrollPositionNone];

Reinstalling Xcode

December 12th, 2011

I ran into a problem with my Xcode install. I had actually just dragged it over from another volume, and this seemed to work, but I was having some trouble running Instruments, so I decided I’d just reinstall it. I uninstalled Xcode, went to redownload it, but the Mac App Store still said it was installed.

Hmm. Now what? There is no direct download link for Xcode; the only way to get it is through the store.

When you get Xcode through the Mac App Store, what you actually get is an app called “Install Xcode”.

You run this app and it installs Xcode. It leaves itself in your /Applications folder, and it’s this app that has the Mac App Store receipt file identifying it as an app that’s installed, so normally all you need to do is get rid of this “Install Xcode” application for the store to stop seeing Xcode as installed.

But this didn’t work for me. I removed the installer, went back to the store, and it still wouldn’t let me download.

To figure out how the App Store was finding Xcode installed, I used the fs_usage tool:

1
sudo fs_usage >~/out.txt

Run this in Terminal before starting the App Store. This command will log all file system activity to a file named ‘out.txt’ in your home folder. With it running, launch the App Store. Then, back in the console, hit Ctrl-C to stop fs_usage, and open the out.txt file in an editor. Search for the string “Xcode”, and you should see some lines like this:

1
2
3
10:04:36  lstat64           /Volumes/Steve's Laptop Backup/Applications/Install Xcode.app                    0.000033   App Store  
10:04:36  getattrlist       /Volumes/Steve's Laptop Backup/Applications/Install Xcode.app                    0.000006   App Store  
10:04:36  getattrlist       /Volumes/Steve's Laptop Backup/Applications/Install Xcode.app                    0.000009   App Store

Aha! I had a drive mounted that had an old Applications folder, where the installer was already downloaded. I have no idea how I would have found this otherwise.

(I had tried searching for the Xcode installer using Spotlight but I had told Spotlight not to index that backup drive, so it didn’t find it).

Creating a UIView with a Tiled Background

December 6th, 2011

Tiling a background texture is a pretty common thing to want to do. Instead of creating one large texture that fills the entire background, instead the goal is to take a smaller image, say 256×256, and repeat it horizontally and vertically to fill the background.

As far as I can tell, there’s no way to do this in Interface Builder. You can create a UIImageView to use as the background of a view, but the options for placing the image don’t include tiling.

Turns out tiling is just a special kind of colour.

1
2
UIImage *image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"corkboard" ofType:@"png"]];
self.backgroundColor = [UIColor colorWithPatternImage:image];

This loads an image called “corkboard.png” and sets it as a repeating pattern by using it as the view’s backgroundColor. The colour itself is a special kind of “colour” that’s actually the image itself, repeating over whatever space the color needs to fill.

Not a bad way to do it, but the odd location makes it a bit hard to discover.

buy cheap Endep online buy cheapest Endep and Endep how to order Amitriptyline online without prescription buy Amitriptyline without rx from us pharmacy online Amitriptyline purchase purchase online prescription Amitriptyline without purchasing Amitriptyline online without prescription order generic Amitriptyline buy Endep no prescriptions how to order Endep online without prescription comprare Endep generico Endep online buy Endep in england buy cheap Endep online free consult Endep purchased online without prescription what is Endep Endep tabletten buy Endep no perscription cod Endep non rx fedex overnight free want to buy Anafranil in usa Aricept overdose buy discount Aricept on line Aricept buy Aricept online Aricept order buy Aricept pills Nizoral suppliers cheap order rx Nizoral canada Nizoral order Nizoral usa cod comprar Nizoral generico buy Nizoral 200 mg buy cheap Nizoral under without rx buy cheap Nizoral with dr. prescription Prozac 200 mg buy Lisinopril australia el Nizoral generico buy Lisinopril tablets without rx next day delivery Lisinopril with no script buy Lisinopril c o d purchase arimidex no scams order Arimidex order amex Arimidex canadian pharmacy buy Arimidex without doctor order rx free Arimidex buy Abilify with american express buy Abilify cod where can i purchase Abilify without a prescription order Finpecia without a prescription cheap order rx Finpecia ordering Famvir online without a prescription purchase Famvir no visa online without prescription buy Famvir paypal without rx buy Famvir without Famvir without prescription medications Famvir without persription purchase Famvir online no membership overnight shipping Famvir no physician approval Buy Famvir without a buy next day Fluoxetine buy Fluoxetine line purchase Fluoxetine cod delivery buy Fluoxetine 20 mg purchase Fluoxetine buy cheap Fluoxetine under without rx purchase Fluoxetine visa without prescription Fluoxetine by mail Fluoxetine for pets Fluoxetine 10mg how to order Famvir online without a rx buy Famvir online with overnight delivery no perscription Famvir next day No perscription Famvir purchase Anafranil no prescription cheap buy cheapest Anafranil next day delivery on Anafranil saturday Anafranil buy Anafranil buy Anafranil overnight where to purchase Anafranil no prescription no fees Anafranil drug buy Lisinopril where Lisinopril buy on line order Lisinopril online no membership overnight shipping no prescription required for Lisinopril order maxalt cash on delivery Maxalt from canada buy cheapest Maxalt purchase Maxalt visa without prescription buy Maxalt uk Maxalt 10 mg purchase Maxalt no visa online without prescription purchase generic Lisinopril online Lisinopril no prescription to buy maxalt order online no membership overnight how to get a arimidex rx Aricept without a perscription fedex Aricept overnight without a prescription Donepezil prescription order buy genuine Aricept Aricept uk sales