Quantcast
Channel: Cocoanetics
Viewing all 428 articles
Browse latest View live

Public Transit in iOS 6

$
0
0

By now it is public knowledge that there will be no in-house replacement for routing via public means of transport in iOS 6. Indeed if you hold an iOS 6 phone (that somebody maybe has left in a bar) and you try to plan a route from point A to point B you find that you can drive there quite nicely with turn-by-turn in 3D. You can walk there. Or you can get forwarded to a – currently empty – section that supposedly will show a list of transit apps to take on the routing.

I have some personal experience with that to share which might also underline why this move by Apple is actually the only reasonable one.

 

Many moons ago there in the internationally renowned city called Vienna (Austria) Google maps introduced public transit planning. It was great, people could navigate through the city with ease. In Austria the public transit system has been more or less privatized, though it is still has very close ties to the government and politics. Public transit inside the bounds of Vienna is owned and operated by “Wiener Linien”, everything outside this territory and the whole rail system is owned and operated by “OEBB”. Those sound like various independent companies but in reality there are lots of political ties between these players.

For a while everybody was happy and Google was provided the data in the necessary format which had been specified as the de facto standard called Google Transit Feed Specification. Wherever in the world the date is made available in this format, you will get public transit routing in Google Maps.

We can only speculate as to the exact course of events, but let me we lay out some facts for you first. A startup based in Vienna launched an extremely crappy app called Qando which often responds with completely useless routes. Not only does it fail to sound cool by omitting a U (“Quando” is italian and means “When?”), it nevertheless triggered a change of mind at “Wiener Linien”. Or was it because OEBB licensed an app from German HaCon which became the official OEBB routing app named SCOTTY mobil, just like the website.

We cannot be certain who was to blame, but either way the data feed towards Google got terminated. The official reason given was that Google does not properly calculate the routes. When users started to complain to Google, this is the answer they got:

Google apologises that Austrian transit data from OeBB is no longer available on Google Maps. We are sorry for any inconvenience this may cause to commuters, and are working hard to provide this service again in the future. For information on public transportation in Austria, visit http://www.oebb.at/pv/de/Servicebox/Fahrplanabfrage/index.jsp

A birdie tweeted into my ear that this was a result of a back-room deal aimed at neutering Google’s power by making Google Maps worthless for navigation in Vienna. And thus two apps became the only sources of routing information in Vienna. So even though Google was “working hard” they did never stand a chance against the secret deal between several monopolistic companies.

Since then (spring 2010) no progress was made. There was an Open Government initiative, but since Wiener Linien and OEBB don’t belong to the government (at least on paper) they can drag their feet as much as they like and still never provide their transit data to any outsider.

So much for the background story.

The truth of the matter is that if private companies are in charge of public transit and they have vested interests in pushing their own (or partner’s) apps then they have little to no incentive in providing GTFS data to Google. One might think that easy availability of routing info via Google maps might increase these transit companies’ income, but at least the two big Austrian transit authorities do not seem to agree.

Now imagine what Apple would do. It is obvious that they want to cut out Google as a middle man and instead would like to make deals with the likes of Tom Tom. Unfortunately there is no global company that Apple could go to for this kind of data. And why should anybody let Apple have more data than Google is getting?

Even worse, nobody knows the extent of the secret deals that were made to keep Google out of certain markets. Those same deals would probably also make it impossible for Apple to get at this data. In a way Apple has to be thankful to Google for testing the waters and uncovering how difficult it is to get worldwide coverage on a voluntary (and free) basis.

Because of this Apple does the only smart thing: let the companies do it themselves. For Austria I am pretty sure that you will end up seeing Qando and SCOTTY on this list of public transit routing providers.

There will most likely be a way for the new Maps to pass on the start and end coordinates to the app you end up choosing and then you will get the routing info from there instead of being integrated in Maps. Or maybe there will be a way to expose the discovered route somehow inside the maps app. But for this to happen Apple needs to provide some sort of communication process between apps, above and beyond URL schemes. So the app context switch is the more likely variant.

By rolling over the responsibility to the local transit companies Apple makes the smart move of forcing the users to talk to their local companies if they want to trigger an acceptable routing experience from within Apple maps. Apple creates a “negative space”, an obvious void that is just begging to be filled by multiple apps competing to be the public transport info provider of choice for the user. At the same time they are creating an incredible business opportunity to either create the official transit apps for certain areas or to create a premium transit app that competes with some crappy incumbent app.

Transit is something very personal, because people tend to use public transport every day to get to and from work. While Google’s answer was to have system from consuming data feeds, Apple’s is much simpler: There’s an App for that!

flattr this!


Radar: View frame inconsistency using presentViewController + wantsFullScreenLayout Y/N

$
0
0

One of the takeaways from WWDC should always be a renewed promise to yourself and Apple engineers: “File better Radars”. With some time at my hands jettting back over the Atlantic Ocean, I prepared a demo project and the text for my latest filing.

 

When filing a bug, you should try to provide the following items:

  • Steps to Reproduce should be absolute idiot-proof in reproducing the steps. If an Apple engineer cannot immediately follow your instructions to see the issue the Radar will most likely go to the bottom of the pile and has thus lost its chance of being fixed soon.
  • Sometimes new features make certain assumptions that are in contract to previously known behavior. This Radar is one such case. This is what the Expected Results versus Actual Results is for. Explain why you were led to expect a behavior of the software that turned out to be different in actuality. Here I was expecting for presentViewController to obey the presented VC’s wantsFullScreenLayout, but it doesn’t.
  • It also helps a great deal if you can provide a good usage scenario. What are you trying to do? In this case I am trying to present a full screen view controller from a non-full-screen-view-controller with a custom animation. I need to do that for my iCatalog app where the catalog library will always show the status bar, but when viewing one catalog the user might want to hide the status bar.
  • If the problem only started to appear in a certain iOS version, then you should mention this in the Regression section. The new presentViewController supposedly replaced the previously existing presentModalViewController in iOS 5, so this is when  my problem here first appeared.
  • Finally, if your bug report is original enough, then you will be asked for a sample project to demonstrate the issue. As you get better at evaluating whether a problem stems from your own code or Apple’s you will find more and more bug reports going to Attention status and asking you for such a small sample project as opposed to simply being closed as Duplicate. Screenshots are nice too, but not as valuable because with the sample project the engineer can actually test if the problem has been fixed as well.

So, what Radars did you file right after getting back from WWDC? Good ones, I hope!

View frame inconsistency using presentViewController + wantsFullScreenLayout Y/N

Summary:

If presentViewController is used from a VC that has wantsFullScreenLayout == NO to present a modal view with wantsFullScreenLayout == YES then the frame set is incorrect.

Steps to Reproduce:

Run the supplied Demo Project.

  • tap the top button (uses presentModalViewController)
  • note that the blue view covers the entire display, even when hiding the status bar (via the toggle button)
  • return to the root VC via the dismiss button
  • tap the second button (uses presentViewController)
  • note that the blue view background now begins below the status bar. Hiding it makes the black UIWindow background show through

Expected Result

A presentViewController with custom animations should obey the wantsFullScreenLayout property of the presented ViewController.

Actual Results:

The presented ViewController’s view is always offset to match the presenting viewController’s wantsFullScreenLayout property. The frame set on the manually added subview gets overridden and shifted to the same origin as the presenting viewController’s view’s origin.

Regression:

As demonstrated by the demo project the (now deprecated) presentModalViewController does the right thing. The behavior should be consistent between the deprecated and the method replacing it.

Notes:

The demo project has two view controllers, the RootViewController with wantsFullScreenLayout == NO, the ModalViewController with wantsFullScreenLayout == YES. When presented with presentModalViewController then ModalViewController goes properly under the status bar. When presented with the new iOS 5 method presentViewController in combination with a custom animation then the ModalViewController’s view is always forcefully put below the status bar.

There is a button to hide the status bar in ModalViewController. If it was presented with the deprecated method the blue background color shows because the view is properly layouted below it. With the new method the UIWindow’s black color shows because the frame is set incorrectly ignoring the wantsFullScreenLayout property.

The use case for this behavior is to have a root view that is showing the status bar (e.g. a scroll view showing digital catalogs). A modal view (is to be presented from this that requires hiding of the status bar, e.g. for full screen viewing of a digital catalog.

The only workaround is to have also the presenting ViewController with wantsFullScreenLayout == YES and offset all subviews on the RootVC so that they don’t get positioned below the status bar.

This is filed as Radar 11688188, and also on Open Radar to allow developer colleagues to find and dupe it. Download the Sample Project.

flattr this!

Radar: Block-based action handlers for UIActionSheet and UIAlertView

$
0
0

The second type of Radar I vowed to be filing more of following WWDC 2012 are so called “Enhancement Requests”. I have yet to see any of my previously filed requests be implemented in iOS, but it never hurts. One Apple representative once told me that “we’ll implement it if enough people want it”.

I recently demonstrated in a tutorial how to add block-support to UIActionSheet. Now here’s the formal feature request suggesting to Apple to implement this in the official SDK.

The following is filed as Radar #11695432 and also added to OpenRadar.

 

Block-based action handlers for UIActionSheet and UIAlertView

Summary

Implement the possibility of specifying a block for handling actions that are to be executed when selecting an action from a UIActionSheet or a button from an UIAlertView.

Reasoning

The traditional delegate model has several shortcomings that are causing code to be bloated and hard to maintain:

  • the developer has to keep some sort of reference to the interacted element so that in the delegate callback the appropriate action can be carried out. This is quite cumbersome.
  • if multiple action sheets are used from the same view controller the developer has to be able to tell apart the callbacks by e.g. setting a tag value for each. This invariably leads to large switch trees.

Many developers agree with this need, which is why there are so many implementations in existence that somehow graft blocks onto UIActionSheet or UIAlertView.

I’ve made a list or several such implementations here: http://www.cocoanetics.com/2012/06/block-based-action-sheet/

Benefit

By implementing a way for developers to specify block-based action handlers the amount of code needed for complex interactions can be dramatically reduced because the action item state would be kept in the block as opposed to an IVAR or tag number.

flattr this!

Radar: WWDC videos should be organized as iTunes U courses

$
0
0

The third kind of Radars I plan to file more are for new features. While the Apple bug reporter is mostly made for reporting and tracking bugs this is also the only way to formally file a feature request. This one relates to WWDC videos and iTunes U.

I am suggesting here to organize the WWDC videos similar to the Stanford CS193P course where you have all the videos and materials aggregated together and can keep track of your progress (“gotta watch ‘em all”) independently of whether you have downloaded a video or not.

This was filed as Radar #11716509 and also posted on OpenRadar.

 

WWDC videos should be organized as iTunes U courses

There are currently 2 ways to consume WWDC videos:

  1. on the developer website
  2. after login on the developer site in a special hidden iTunes section.

Last year Apple introduced a separate iTunes U app on iPad which has the ability to group together videos and materials in “courses”. The main advantage of this is that this tracks which videos you have watched/studied and it provides this without having to download the videos.

You can watch a video streamed but this would still keep track of the viewing progress there. Or you can download a video for offline viewing.

This suggestion is to create one iTunes U course per section in the developer videos and allow registered developers to subscribe to these courses in the iTunes U app on iPad.

This would be of tremendous benefit to developers because at present the only way you can track which videos you have watched is to download all of them into iTunes and use the viewed-tracking there.

Additionally the PDFs of the slides would be also included as course materials. This would be a great way to show off the capabilities of the iTunes U app while making it much easier for developers to consume.

flattr this!

Radar: App- and Folder-specific Passcode Locks

$
0
0

I’m on fire!

Never before have I filed so many Radars in a single day. This one aims to remove the need for components like my DTPinLockController which I used in iWoman.

This is a Feature Request for getting passcode locks on a per app and per folder basis. So that you can hand your unlocked device to your kids for playing Games but still apps being secure that they have no business in starting. This would passcode-enable all apps that don’t have custom solutions and also make all those custom-passcode-viewcontrollers unnecessary.

If there where an API for inquiring about passcode status then we could keep the user logged in just like the Find my Friends app is doing it. This requires entering the password only if you don’t have a passcode lock set.

I filed this as Radar #11716971 and also posted it to OpenRadars. Please dupe it if you think that this is a useful feature for our favorite platform.

 

App- and Folder-specific Passcode Locks

Current versions of iOS only allow to secure the entire OS with a passcode lock. Once unlocked all apps can be accessed.

Because of this several app makers (including me with my iWoman app) needed to add their own passcode lock screens in their apps which have a different level of sensitivity as compared to games.

This poses several problems for the UX:

  • the app-specific custom passcode screens can never be as secure as the lock provided by the system
  • if such an app stores the passcode in a way that can be figured out then it is likely that the system passcode will be the same
  • or if the user has a different PIN for the system and those apps then he has to remember all these
  • the UI will not be consistent between the custom PIN entry screens and the system one
  • in short those custom solutions are a bad workaround for a problem that should be addressed by the OS

Suggested Solution

Add the capability of adding a passcode locks to individual apps and possibly also folders. A locked folder or app might show that code entry is required by a padlock badge. Upon tapping the icon – if it is not yet unlocked – the new system-app passcode screen will pop up and tell the user that he is now unlocking access to this app or set of apps.

This way the user could keep all his sensitive apps in one folder, e.g. banking or stock trading apps. Also the user could then hand his device to some children who like to play games on the user’s iPhone.

An additional benefit could be that you can prevent deletion of apps or folders that are secured by a passcode lock. So the person I let play Games on it cannot remove the apps that are important to me and would be painful to having to set up again.

App- and Folder-locks could also be configured to time out after a while or not be required for a certain period after unlock.

Also this lock screen does not have to have an emergency dial option and should provide a mechanism to cancel entering of the passcode.

It would probably be most convenient if the passcode for apps/folders has to be the same as the system one.

Having a passcode on apps and folders could also tie into automatic data protection. As opposed to having to opt into this by the developer you could have a locked app/folder be automatically opted into file protection. The files in the app sandbox would then be unlocked only if the passcode is entered.

Provide an API for inquiring about passcode status

An API should be provided for apps to inquire wether there is a system- or an app-level passcode set. Ideally also with an indication as to its strength. This would be similar to how the Find my Friends app is doing it right now: if you have a passcode lock set then it does not require login on every launch.

Apps could generally adopt this practice of storing login credentials if the device or the app is secured with a passcode. This would entice people to add a passcode lock because of the convenience of not having to enter logins in all their apps.

flattr this!

Radar: ARC releases UIColor prematurely

$
0
0

There’s a gotcha/bug if you’re using -[UIColor CGColor] to get a CGColorRef for use with CoreGraphics. I think several people have already documented this on their blogs, but I was having the same issue in my DTCalendarView when running it on device. The same code worked before enabling ARC, but with ARC enabled it there is a difference whether its running on device or simulator.

On Simulator all is fine. On device however you get a EXC_BAD_ACCESS because the ARC release the UIColor way before the end of the current scope. There are several possible workarounds but it is still unintuitive that previously working code ceases working with ARC.

We were told to also file bug reports for unexpected behaviors or something that is counter intuitive, so here you go… Radar #11717864 and OpenRadar. Here’s the sample project.

Update: Yes, I know that you could call this “works as designed”. But the point here is that it is non-obvious and causes previously working code to break. Even the gurus at the Big Nerd Ranch stumbled over this one and filed is filed. In the least I would expect an LLVM compiler warning for this to be added.

 

ARC releases UIColor prematurely

Summary

When assigning a UIColor’s CGColor to a CGColorRef for later use then ARC discards the UIColor too early when running on device.

Steps to Reproduce

Run the attached sample project.

Expected Results

App should run equally well on Simulator and Device. ARC should not release the UIColor before the end of the scope.

Actual Results

App runs ok on Simulator, but crashes on Device with EXC_BAD_ACCESS.

Regression

This was working fine before using it in a project without ARC since the code in question does not use NSObjects for anything except to create the two CGColorRefs.

Notes

A workaround is to save the UIColor in an IVAR to establish a strong reference. When doing this the exception no longer occurs. Another workaround apparently is to immediately CGColorRetain the CGColor.

flattr this!

Forbidden Fruits

$
0
0

A short while after the WWDC 2012 keynote, when Apple made the iOS 6 BETA publicly available, somebody tweeted in German that there are probably already more devices running iOS 6 than Android 4. I translated the tweet to English and tweeted it for everybody’s amusement.

According to sources the iOS 6 BETA is already more widely distributed than Android 4.0

I also added the “According to sources” to make fun of pundits who always add something like this to underline the authoritativeness of the rumors they pick out of thin air. Reactions ranged from calling BS over joy to suspension of disbelief with most tweeps getting that this is one of these things where you cannot really know but it would be funny if it were true, or maybe it really is?

I read it on the Internet and so it must be so …

 

However there are several things we know for sure. These are the facts and they are undisputed. A whole new business segment formed around methods to get iOS 6 into the hands of non-developers. Wired ran an article on these Scofflaw Developers who have sophisticated websites selling access to a limited resource. A scofflaw is ”a lawless drinker of illegally made or illegally obtained liquor”, where liquor is the Apple Koolaid.

Be warned …

Software as such can be copied without limit, but Apple puts an artificial limitation on the number of devices that a developer can install BETA software on, 100 for individual or company accounts. The enterprise program limit is 500 devices. They also warn every developer:

[iOS 6] is intended only for installation on development devices registered with Apple’s Developer Program. Attempting to install this version of iOS in an unauthorized manner could put your device in an unusable state, which could necessitate an out of warranty repair.

[some compiler] and iOS 6 beta are pre-release software and are considered Apple Confidential Information and are subject to the terms of your iOS Developer Program License Agreement. Unauthorized distribution or disclosure of Apple Confidential Information is prohibited.

Your iOS Developer Program membership can be terminated if you provide pre-release Apple Software to anyone other than employees, contractors, and members of your organization who are registered as Apple Developers and have a demonstrable need to know or use Apple Software in order to develop and test applications on your behalf. Unauthorized distribution of Apple Confidential Information (including pre-release Apple Software) is prohibited and may subject you to both civil and criminal liability.

These messages make iOS 6 contraband of the finest quality.

Why do we have an NDA in the first place?

We tend to forget too easily. Do you remember that the Apple developer NDA in the past was covering all Apple iOS software? You couldn’t even discuss any programming techniques with your developer friends in public. Thankfully Apple has reconsidered and abolished the NDA for released software on October 1st, 2008. This move made it possible for sites like mine to openly discuss iPhone development topics.

“Released” being the operative word. As in publicly available because Apple has made it such. NOT as in “widely circulated by Scofflaws”.

In Apple’s own words the NDA is meant to protect inventions and innovations “so that others don’t steal our work” in addition to “hundreds of patents” that they have filed on iPhone technology. The tone of this announcement reminds us of they kind of language that Steve Jobs was known for. Remember “Thermonuclear War”?

The core reason for the NDA is to broaden the window during which Apple can seek legal protection for new stuff in iOS. A reader of Daring Fireball offered this explanation:

At my company, our lawyers advised us to keep what we considered more-or-less public software under NDA for a very long time because demoing software to someone under NDA, no matter how many people it is, avoids “publishing” the software and any inventions contained therein.

We know Apple’s been building up a patent strategy around multi-touch; maybe their lawyers believe there are patentable inventions described in the iPhone SDK and they are telling Apple to keep everything under NDA until they know provisional patents can be filed within a reasonable amount of time (you get a year after publishing in the US, but in the EU, I think you forfeit any patent claims once your invention is “published”).

It’s like, it doesn’t matter at all how broad/leaky the NDA process is, in the eyes of the USPTO, every invention in the iPhone SDK is a non-published invention and will continue to be so until the NDA is lifted.

This mentions the One Year Rule, which states that “any public use” or any description of the invention in a public document (like a blog post) starts the one year timer and once this has ticked down to zero patentability is out of the door.

Apple has an additional level of security to preserve patentability. Not only prohibit they any publication of iOS 6 internals between WWDC and the fall release, they intentionally limit this secret period to well under a year, like 3 to 4 months. This is only possible because of the enormous secrecy inside Apple.

You can be certain that while I’m writing this work on iOS 7 has already begun. If anything would become “published” about this work right now then Apple would lose patentability of it by that time next year. An unfortunate mishap like this would cause much stress on those poor Apple patent lawyers. Also it would make filing the patent more difficult because holders of competing patents would have an extra year of opportunity to find some prior art to immediately void the not-even-filed-yet patent.

Ideally Apple would like to keep new versions of their Operating Systems secret right until the day of release. But even Apple must concede that software is never truly error-free and a period of broad BETA testing is necessary to insure sufficient stability and quality at launch. So those 3 months of intense testing are the minimum compromise between Apple’s lawyers and Apple’s engineers.

Forbidden Fruit Syndrome

This term comes from the bible for the Apple software that Eve was tempting Adam’s hardware with. And there was a snake too.

A good definition for the FFS is this:

In basic terms, it doing something that you’ve been told not to do, but you do it anyway. Depending on the context it may be very mundane or a societal taboo.

I think people like the forbidden fruit because the satisfaction gained from it is usually quite good, but it may leave a sour taste.

iOS 6 is coveted, Apple told us not to do it (at great length) still many users are seeking the satisfaction of being first amongst iOS 6 users. “Look! My Mail has Pull to Refresh” aka “I’m way cooler than you”.

Installing iOS 6 on your main phone provides multiple thrills that few developers can escape from. Smart beings are purchasing “Sacrifical iPod Touches” to install it on, but the foolhardy do it without protection. At least those who do can claim “hey I need to test my apps on that in realistic conditions!”

… or really just Marketing?

Restricting people’s access to the latest and greatest (however unpolished it is under the hood) might also be some sort of backhanded marketing ploy to hype iOS even more. But, honestly, I can tell you from my own experience that engineering is way more important to Apple than that. iOS 6 is far from finished and far from ready for adoption by the broad populace.

What personally bugs me (the “sour taste”, see above) about the practise of selling devices registrations is the kinds of users that will make use of this. The Apple Bug Reporter site is open for everybody with an Apple ID, but most of these “illegal” users will probably never be filing any Radars. The only thing these people ever do is complain about all that is wrong with iOS 6 but never actually help in ironing out the kinks.

What our favorite operating system needs right now is to actually be tested in realistic conditions and then have as many high quality bug reports (aka Radars) filed for the problems you encounter. The more we take that to heart, the better the first Gold Master of it will be.

You can save yourself the time to ask me “is iOS 6 ready to be installed on my main phone?” For me it is, but I’m a developer (I’m testing and filing Radars like crazy) and I have an extensive museum of every iPhone ever made to switch too should my phone become unusable.

flattr this!

Girls in Tech (iOS Edition)

$
0
0

We need more ladies in tech, it is as simple as that. Or as complicated. The statistics are not looking good and I’ve been wondering for a long time why they are not changing to the better. Or not faster.

Why are there so few Women in Science & Technology?

People are quick to respond with ”It’s society’s fault!” and they are half right, half wrong. Right, because there is no simple answer to this riddle, no single point of failure that this skewed relationship can be burdened upon. If there is no single reason for a grand scale effect then it is either religion, politics or the society that is blamed.

 

The problem here is that all three of these are quite nebulous. While it might be true that the result is a sum of all the parts of society, setting our focus there only makes our vision blurry because there are simply too many variables to parse. That is to say that if we try to see the entire problem we can never hope to do anything about it.

Last time I checked 51% of newborn children were female. If tech was “fair” then every second engineer would also be female. Look around! How many women do you see right now at your workplace?

The game of life is complicated. In this game there is no walkthrough we can look up on the Internet. And even if there were a finale to be reached in this game, the main target audience of games are still young male adults with funds to blow on first person shooters. The top 10 games currently sold on consoles are filled with games like Max Payne 3 or Modern Warfare 3. The high sequence numbers tell a story by themselves: it has been like this for many years.

I’m not saying that there are no women that like to play FPS or WoW, but those who like those kinds of games (despite them being targetted at boys) are probably in tech already. Games are often a “gateway drug” into technical professions. Seeing the new Anno 2070 game amongst the top 10 gives me a bit of hope, as this kind of trading strategy game has equal appeal amongst the sexes.

But we are not gamers, we are engineers, some might even consider us scientists. Even with the latest development tools in Xcode we are still researching a lot and bugs are often as elusive as a rare species waiting to be discovered. We keep at it because we love a good riddle and tend to research all the more if the solution eludes us.

“Complicated” intrigues us. Though we prefer to call it “complex” instead. That gives us the power to investigate solutions and reasons. “Complicated” is admitting defeat. Let’s not call it “Chaos”, it’s just the second law of thermodynamics!

It’s a Girl Thing!

The European Commission recently published a video titled Science: It’s a Girl Thing! They probably meant well but the message that it actually transmits is that science is a girl thing only as much as it serves to create makeup, lip sticks and fashionable clothes. Don’t get me started on all that is cliché and wrong here…

http://www.youtube.com/watch?v=WFvh9zbjYeE

“Has it come to this?”, we exclaim but remain as clueless as ever before.

Though there is one thing that we probably agree on: you need to get them while they’re young. Teenage girls need to be shown that Sci/Tech is just as good an option for them as studying to do something “social” like becoming a teacher, a nurse or hairdresser. The problem with most modern societies is that parents are just as unprepared to help their kids find their true calling. So they do what their parents did, they communicate: “You need to go to college so that you will have it better than us one day”. What kind of college? Any that they can barely afford and that has good prospects.

I’m arguing that first and foremost parents should teach their kids to learn to decide for themselves as early as possible. To evaluate options, to form an opinion, to learn to find out what they like and what not. All too often they never stop making all decisions for their offspring right until college at which time it is only because of geographical distance that they are forced to stop.

Opinions and likes need nutrition. What follows is my plea to all parents of girls.

A Better Way

It is my belief that adults need to expose under-aged humans to the broadest possible range of experiences so that they can begin to have an idea what might fulfill them by themselves. That means if you are in iOS development (or any other technical profession) then you should open your door and offer all interested girls to sit with you for a day or week. Show them what it means to “make apps” instead of “makeups”.

Software development can be fun, inviting, full of exciting activities and lots of places where a young woman can bring her unique skills to.

Young girls are generally not being taught that they should stand up for what they love. That’s boys’ land. Girls should give in, be weak, be pretty. Like most of the Disney princesses of the last 30 or so years. Disney meant well too, but inadvertently communicated that there is an endless supply of handsome princes to be relied upon.

Parents don’t have a clue but often they follow traditional roles themselves – the man being in charge of earning the family’s upkeep and the mother being the housewife and housekeeper. Today a family can count themselves as the more modern kind if mom has a part time job. It is like this everywhere I look, even in the house I grew up. Although my mother never found her way back into society or productive work. She died an alcoholic twenty years ago.

I probably took after my father who was the technical half being a structural engineer. My mother learned to be an advertisement graphic artist and was an avid singer. My younger brother recently finished his studies as an opera singer. Coincidence?

Role Models!

Kids and teenagers need role models. Those serve as a fountain of ideas of life choices that are possible and plausible. But there we have our next problem, most current role models offered by the media are crap. TV is being being swamped with rigged shows centering around musical talent or super-modeling. TV is eroding our future, what we need are shows that depict science and technology as something cool to aspire too, not short-lived fame.

I went to search myself for role models in iOS development and with the help of my Twitter followers I was able to compile this list, in no particular order. I’m encouraging girls to unfollow Justin Bieber and instead follow these brilliant individuals who are making it in tech. Way more rewarding, let me tell you.


Natalia Ossipova @nossipova

“Software architect at itemis. Mobile evangelist and developer (mostly iOS). Language-oriented programming expert.”

The best way to get into something is to spend time with people who already does it. Make friends among iOS devs.


Andrea Jessup @andreajessup

“computer programmer-in-training (iOS and Ruby on Rails…this week); geographer; student; OTR listener; guppy fan”

andreajessup.com

A lot of people have taken different paths to get into iOS. I go to school for it, but am also doing work on my own.


Natalia Juckyanova @nattylux

“iPhone dev, musician, baker, co-founder of imangi. Our games: Harbor Master, Temple Run, Max Adventure, geoSpark, Hippo High Dive, Little Red Sled, Imangi.”

imangi.com


Evadne Wu @evadne

“Software Engineer”

radi.ws


Jane Lee @janeylicious

“crazy woman. iOS and rails code monkey. knitter. pianist. bread baker and ice cream maker.”

janeylicious.com


Janine Ohmer @janineanne

“iOS developer. Part time sysadmin. Fearless leader of the Portland Cocoaheads group. Wife. Mom to 3 dogs, 4 cats. Apparently, too busy to tweet much.”

furfly.net


Erica Sadun @ericasadun

“geek girl and brood”

tuaw.com


Christine Corbett @corbett_inc

“Astrophysics PhD student, maker. I tweet about astrophysics, gadgets, entrepreneurship, productivity, iOS, feminism, programming, space travel, supercomputing”

christinecorbettmoran.com


Leah Culver @leahculver

“Founder of Grove (grove.io). Former co-founder of Pownce.”

leahculver.com


Emily Toop @fluffyemily

“Mobile app developer and entrepreneur. Currently in Chile as part of startupchile with my new startup tinyearstech.”

emilytoop.com


Sophia Teutschler @_soaps

“Software Sorceress. Makes Articles, Magical Weather, Xtrail and far too many other apps.”

sophiestication.com


Anne K. Halsall @annekate

“Product Designer at Quora. NSCoder. Cat lover. Coffee elemental.”

randomnonsequitur.com


jaimeejaimee @jaimeejaimee

“UX strategy and design for iOS with blackpixel. Former Senior Manager of UX and Product: v.1 -v.2 at Zappos_Mobile. See also wwdcgirls


Judy Chen @judykitteh

“Chief Community Officer of Appsterdam. Former San Franciscan, lover of nature, food, music, kittehs, Burning Man. Lust for life.”

appsterdam.rs


Melissa @0xabad1dea

“Retroprogrammer of the NES, computer security researcher in the field of static analysis. Even my name has been known to crash stuff.”

0xabad1dea.github.com


manu @codePrincess

“she-nerd, coding, macfangirl, vespa, minimal electro, red, cooking, eating, reading, gaming, gadgets, mmorpg, d&d”

tngs.tumblr.com


Eliza Block @elizablock

“pretty good at pacman”


Gina Trapani @ginatrapani

“I make ThinkUpapptodotxtapps & Smarterware. I host This Week in Google. Founding/former editor of Lifehacker.”

ginatrapani.org


Justine Pratt @justinepratt

“Mobile Developer-Trip Boss, Serving Sizer cooking apps, Date Wheel. Marketing/UI designer/graphic artist, plus webmaster, accountant, strategist, mom.”

creativealgorithms.com/blog


gattoclaudia @gattoclaudia

“Mind Contortionist and Bit Enchantress (iPhone and Web Developer)”

plus.google.com


All these ladies have proven that women can stand their ground in the male dominated (if not “infested”) domain of iOS development. Matt Gemmell is another iOS developer/designer who frequently writes about this topic. He compiled an impressive list of Woman Conference Speakers and has some additional suggestions at the end. His article on Misogyny is world famous, too.

Stop the Self-Deprecation!

I found that often women have an unfortunate tendency to use self-deprecation or displaying an artificially low self-confidence as a means to establish an emotional connection with others. “If I seem smaller the person I approach he will be friendly because he is not intimidated by me.”

It seems that often they have learned this as a strategy to get on even ground with a new acquaintance. Only that this strategy mostly fails to work with men who are themselves trained to be tough, know it all and go it alone. “Everything is either predator or prey, I need to be strong.”

Imagine such a super-whiz-fighter-guy next to a self-deprecating-contact-seeking girl. Who is more likely to make it in tech?

I have not done an in-depth study of the ladies mentioned above. But I am rather certain that they can stand their ground if necessary and have evolved a sufficient BS-filter to deal with male morons who stubbornly refuse to see them as equals. And they are more likely to work better in development teams due to the better interpersonal skills that come with the gender. Trust me, I know. When men work together egos clash.

The Mission, Should You Choose to Accept It …

I see it as our mission to keep our doors open for any girls that like to get a whiff of software development. Give them a gentle nudge to also consider a career in tech/sci besides of what they hear at home from their parents. Also whenever I can I encourage ladies to show themselves in public, do talks on conferences and be proud of their skills and views (which is probably more holistic than those of us guys).

“Trying to reproduce a crash, and I have this crazy urge to put on a pink dress and run around with my iPhone going “CRASH ALL THE THINGS!!!” — Janey Lee

I readily admit that amongst the above women there are a few that I’m almost beginning to develop a crush for … because they have my utmost respect and admiration and … I am fighting the strong urge that almost caused me to make this article a love poem for ladies in iOS development. MUST … REMAIN … OBJECTIVE…

Suffice it to say: the road to more girls in tech starts with YOU. What do YOU do to help?

flattr this!


DTCoreText Case Study: NMSTC

$
0
0

Despite some advances in rich text support coming in iOS 6 my DTCoreText open source project continues to prove its usefulness. First and foremost it provides the ability to convert simple HTML text into attributed strings to give you the ability to retain full control over the display of the text.

I love to receive mail telling me about where in real life DTCoreText finds good use. Especially so if it is used for good, like by the Nottingham Multiple Sclerosis Therapy Centre info app. A case study.

 

Andy Warwick, Director of Creed New Media developed this app. It’s a ‘support’ app for a local charity that he’s involved with, the Nottingham Multiple Sclerosis Therapy Centre (NMSTC). This member-led charity specializes in Hyperbaric Oxygen Therapy (HBO), Physiotherapy, Reflexology, Hopi Ear Candles, Massage, Aromatherapy and advice on various topics.

The NMSTC app uses DTCoreText extensively to display background and informational text in multiple sections. You can probably tell where it’s used: if not, it’s in the ‘Booking a HBO Session’ view, and the ‘About’ view.

 

Andy had tried using local web pages, but he found this solution to be far more polished and elegant.

It was useful for embedding images in the flow of text, styling text, and adding external links; all the stuff that you can do using local HTML pages. The key bonus for Andy, though, was the ability to display the content without having the jarring pre-load flash you get when using a UIWebView, even for local files.

“Thanks for all the obvious hard work you’ve put into your code; it makes things so much easier. Great job!” — Andy Warwick

There are hacky ways around that, of course, but DTCoreText — once Andy understood it’s usage — gave a much better ‘finish’ to the app, while still retaining the ability to quickly and easily edit the content when client made text changes.

You can download the free app on the app store to see DTCoreText in action. We say “Good Job, Andy!”

flattr this!

Radar: Filevault2 uses incorrect keyboard layout for initial unlock

$
0
0

Fresh from our series “Another Day Another Radar” here’s one that stumped my associate Rene.

Since I’m getting a knack in filing these I did the “quick file” for him, as rdar://11738458 and on OpenRadar. As always I am doing this publicly because other people out there might have experienced the same issue which can be quite nerve-wrecking. Also this problem was observed on an OS X version that is public and widely used.

 

Filevault2 uses incorrect keyboard layout for initial unlock

Summary:

When starting a 15″ MacBook Pro (Mid 2009) that is using Filevault2 full disk encryption the wrong keyboard layout is active for entering the initial boot password when starting the system.

Steps to Reproduce:

  • on a Mac with German keyboard set system language to English, keyboard layout to German (matching the HW keyboard)
  • enable Filevault2, choose a password that uses keys that are differently positioned on German and English layout. (e.g. Z and Y)
  • turn off Mac
  • when promoted for the hard disk password try to enter the password as it was entered with OS X running

Expected Results:

Password should be accepted in the keyboard layout used when setting it.

Actual Results:

Password is only accepted when entered with English keyboard layout.

Regression:

With Filevault 1 the password was queried later when the German layout was already active.

Notes:

This might lead to customer confusion because it misleads them to thinking that they have set their password incorrectly. Add to this the extremely stressful situation of thinking that you have lost access to all your data.

Most people would not recognize this problem because typically people would have the system language and keyboard layout be the same. But some users (especially developers and in IT) prefer to have their system in English even with a German keyboard. This also means that they will have to know where this certain characters can be found on an English keyboard to be able to successfully authenticate.

Filefault 2 apparently is using the system language layout instead of the actual HW layout or the one that is configured while running OS X.

flattr this!

Linguan 1.1.1

$
0
0

The 1.1.1 version of anything is always something special. Linguan 1.1.0 brought the first new feature in the form of support for localizing XIB files. Linguan 1.1.1 now contains some hot fixes to address several inconvenient bugs.

Changes

  • FIXED: Problem with invalid UTF8 characters coming out of ibtool
  • FIXED: Broken Compatibility with OS X 10.6
  • FIXED: Changes to the Toolbar did not get saved
  • FIXED: Checkbox missing to enable/disable XIB support

The update has been submitted to Apple and will be auto-released once it passes inspection.

When reporting issues with Linguan please always create a small sample Xcode project with the bare bones contents to be able to reproduce the problem. This enables us to fix it all the more quickly.

Update July 6th: Update is now available on the app store.

flattr this!

iWoman 2.0.8

$
0
0

iWoman is approaching the end of support for iOS 3. This update fixes a minor bug and adds import/export functionality to allow you to move to a new iPhone that is able to run iOS 4 or higher.

Changes

- FIXED a bug that could lead to new cycles not being added to the cycle list upon pushing the Add button.
- ADDED functionality for importing and exporting your database to a text file which is accessible via iTunes.

The update has been submitted to Apple and will be released as soon as it is approved.

flattr this!

Radar: Allow Overriding of User-Agent on UIWebView

$
0
0

Here’s another thing that I had discussed with an Apple engineer at WWDC. UIWebView at present does let you easily modify the user-agent header field that it sends to the server. We found this functionality sorely lacking when we needed to change the user-agent in iCatalog. There are some scenarios where the server-side browser-detection fails and you want to override the user agent for example with one to pretend the web view is desktop Safari.

This feature request was filed as rdar://11767306  and on OpenRadar.

 

There is of course something of a workaround that we found to be working, but it relies on several techniques that might cease to work in a future iOS version.

The first step is to modify the user agent on the very first NSURLRequest that you tell the UIWebView to load.

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:_product.productURL
        cachePolicy:NSURLRequestUseProtocolCachePolicy
        timeoutInterval:60.0];
 
// override user agent set?
if (_userAgent)
{
        [request setValue:_userAgent forHTTPHeaderField:@"User-Agent"];
}
 
[_webView loadRequest:request];

What would be fine and good but this change only holds until the first redirect or sub-request for an image or other resource. Some (but not all) of the sub-requests the web view’s delegate is asked whether they should be allowed. I found that if the original NSURLRequest is mutable then the subsequent ones are also mutable and you can imprint the custom agent there as well.

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSMutableURLRequest *)theRequest 
    navigationType:(UIWebViewNavigationType)navigationType
{
    if ([theRequest isKindOfClass:[NSMutableURLRequest class]])
    {
        // override user agent set?
        if (_userAgent)
        {
            [theRequest setValue:_userAgent forHTTPHeaderField:@"User-Agent"];
        }
    }
 
    return YES;
}

But this only works for some sub-requests. I found in my testing that many subsequent requests don’t show here, especially if they are made from JavaScript (i.e. AJAX). That means if you are dealing with a very stubborn web platform that constantly reevaluates your user-agent then you are out of luck faking it there.

Part 2 of this workaround only works of course if the request stay mutable. The iOS docs claim that they are immutable and I believe they only become mutable if you send the original request as mutable. So this is using undocumented behavior and as such inherently unreliable.

Another – rather obscure – workaround has been documented by James Border. You can set a global user default with the “UserAgent” key.

NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys:
   @"Your desired user agent", @"UserAgent", nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dictionary];

I was quite astonished when my attention was pointed to this. This is not documented anywhere.

So I figured it would make UIWebView much more useful if there was a native method to achieve this. Which brings me to my Radar …

Allow overriding of user-agent on UIWebView

Problem

For some use cases it is necessary to modify the user agent that UIWebView sends towards the server to get a different version of the content. Such scenarios where we needed that included opening a special version of an online shopping bag or opening the full-version of Facebook instead of the mobile one.

Suggested Solution

Expose a userAgent property on UIWebView that uses the default user-agent when nil or otherwise sends the set string. The reason why this should be a feature in the SDK is that most of the time when dealing with online hosted platform providers you have next to no chance of getting them to fix some detection mechanism that causes their platform to send the incorrect content.

To make it easier for the developer there could be some methods that would give me certain predefined user agents, like Safari for Mac, to be used with the suggested property.

flattr this!

CoreLocation Background Update Messaging

$
0
0

Two years ago I put together revolutionary chart that detailed the flow of delegate messages when sending an app into background. This was even featured by Erica Sadun of TUAW because it for the first time visualized the whole process in a easy to understand way.

Based on this chart Carl Brown from PDAgent made an addendum to deal with the special case of background region updates and sent it to me. To my shame I have to admit that it was sitting at the bottom of my inbox for 4 months now and it is only now that in my effort to reach Inbox Zero I am dealing with this and putting it up here for your viewing pleasure.

 

This is the original flow as it was current with iOS 4 and I think it is also mostly true for iOS 5.

And here is Carl’s CoreLocation addendum. I had originally planned to merge this flow chart with the original one, but it was not immediately obvious to me how I could achieve that in a visually pleasing way.

Though maybe it would be smarter to keep them separate because they deal with different subsystems.

Carl reported these findings from his experiments:

The weird thing about the Core Location Delegate events is that you get application:didFinishLaunchingWithOptions: but it isn’t followed by applicationDidBecomeActive: or applicationWillEnterForeground: or applicationDidEnterBackground: – which is something I didn’t expect.

The other odd thing is that if you double-tap the home button and use the task manager to Kill-9 the App, the next Core Location notification will launch the App again, but the App will not  re-appear in the recently used Apps list (as revealed by double-tapping the home button), so the user can’t kill the app again (at least not without launching it by hand first). So it becomes an effectively unkillable App (which makes your memory leaks way worse).

So the most important info here seems to be that an app activated from a background location update neither becomes active nor enters any fore- or background. Which makes sense because we don’t want the app to pop to the front just because we have moved. It should be the user’s decision whether he would want to reopen the app. The OS will then make sure to take either the already running (or restarted) instance from the background or launch the app if it got terminated.

Out of curiosity I still would love to merge both flow charts into one “ultimate” one. If you’re good with OmniGraffle then you can take a shot if you like to try, email me and I’ll send you the graffle files.

flattr this!

Podcast #39 – “WWDC, what next?”

$
0
0

Episode 39, recorded June 30th, 2012

 

News

Apple sent all developers an email detailing some changes.

App and In-App Catalog Reports Now Available
Catalog reports provide you with extended information for all of your apps and In-App Purchases. To view and generate reports, go to the Catalog Reports module on iTunes Connect. New reports can be generated only once every 24 hours.

The report you get gives you one big list of everything you have on iTunes Connect. All apps. All In-App Purchases. Apple seems to be afraid of too much vanity and so they limit the generation of this report to once per day.

iTunes Connect Mobile 2.0
iTunes Connect Mobile 2.0 is now available on the App Store. iTunes Connect Mobile allows you to access all of your app information, customer reviews, and sales data on your iPhone, iPad, or iPod touch. You can now also access the metadata for your apps, designate favorite apps for easy tracking, and provide access for additional user roles.

The update to iTunes Connect Mobile already became available during WWDC and several developers have mentioned to me that they especially like the feature that you can now do a manual release of a held back app from on the phone. You know, when the app is in Pending Developer Release status.

High-Resolution App Icon and Newsstand Cover Art for Retina Display
Starting in July, newly submitted iOS apps require high-resolution icons and cover art. Large icons and Newsstand cover art must have a minimum resolution of 1024 x 1024 pixels. To change your app icons or cover art, go to the Manage Your Applications module on iTunes Connect. For more information, see the Custom Icon and Image Creation Guidelines in the iOS Developer Library.

There we where happily creating 512×512 artwork and now it turns out we have to go back and recreate everything at the higher resolution. Apparently there is some place in iOS 6 – still under NDA – where these high res icons will be used. Any way, you should be creating your icons with a resolution-independent vector art program anyway. This serves as a reminder to that.

On June 22nd Apple added added app stores for 32 new countries, and since we all have time I’m going to read them to you. There will be a test later:

  • Albania
  • Benin
  • Bhutan
  • Burkina Faso
  • Cambodia
  • Cape Verde
  • Chad
  • Congo
  • Fiji
  • Gambia
  • Guinea-Bissau
  • Kyrgyzstan
  • Laos
  • Liberia
  • Malawi
  • Mauritania
  • Micronesia
  • Mongolia
  • Mozambique
  • Namibia
  • Nepal
  • Palau
  • Papua New Guinea
  • Sao Tome e Principe
  • Seychelles
  • Sierra Leone
  • Solomon Islands
  • Swaziland
  • Tajikistan
  • Turkmenistan
  • Ukraine
  • Zimbabwe

I find it quite amusing to see certain countries on this list. Even some that I had thought to be imaginary ones from romance novels before. Yes, Micronesia, I’m looking at you!

Most amusing of all is that with the new countries located in Africa it now for the first time becomes easier to buy apps than to be able to find a clean glass of water.

Oh well, if we make a killing selling many more apps because of these additions then we might just as well donate some for charity: water. Problem solved!

Flipboard versus Twitter

The Best WWDC Party

Watch Videos like crazy, one per day

Tech Talks in Fall

13″ Air instead of Retina MacBook

Girls in Tech, my blog post

If you have a second please do respond to this and give your own opinion.

flattr this!


Leap Second Attack

$
0
0

Comics mentioned that last night we would get more rest, exactly one second. Hardly worth noticing though, if it weren’t for several computer systems which seemed to have issues with suddenly finding them one second out of whack.

The reason being that (in UTC) yesterday was one second longer than usual because of an inserted Leap Second. There’s something positive about leap seconds, as Wikipedia notes: “Between their adoption in 1972 and June 2012, 25 leap seconds have been scheduled, all positive.”

At the time of this writing (the day after) I cannot reach any of the sites on apple.com. Pure coincidence? Or a Leap Second Attack?

 

One should think that UNIX-based systems are immune to timing problems because internally unix timestamps are just the number of seconds since January 1st, 1970 00:00 UTC. As Cédric Luthi pointed out to me Mac OS X or iOS didn’t even exist in the year 2000 and so they didn’t have to face this problem. Those represent dates relative to January 1st, 2001. You can see this if you look closely at NSDate’s methods …sinceReferenceDate.

I sat down this morning with breakfast and the firm intention to watch a WWDC 2012 video. I hadn’t downloaded all the episodes because you can stream them from iTunes or via the website just fine. Usually. But not today.

So – as every engineer would – I started to eliminate variables to see what could be the cause of this. Google, still there. Amazon, ok. Then I remembered one rule that would fix most of the Windows problems I had in the past and very rarely also some OS X problems: when in doubt, reboot.

So reboot I did. Didn’t help.

Next up, maybe my shady ADSL connection could be the culprit. So I logged into my router and cut the connection. But restoring it still didn’t help. Maybe a problem of the DNS system?

lionking:~ oliver$ nslookup developer.apple.com
Server:		192.168.1.254
Address:	192.168.1.254#53

** server can't find developer.apple.com: NXDOMAIN

Ah, we’re getting somewhere. An nslookup should always return a valid IP address when queried like that. I am using the default name servers that my ISP provides, so next I tried forcing some public alternative DNS servers to see if they have better success in resolving the name. OpenDNS and Google DNS. But still no joy.

Some people reported that when they had some problems connecting a switch to Google DNS had fixed it for them. But this might have only been the case because name servers have different durations for how long they cache certain IP addresses. If Google had a longer timeout than your ISP then there would have been a grace period where Google could still resolve it.

Another theory I was pursing was that Apple became the victim of a distributed denial of service attack. This fit with Rene Schätzl‘s observation who reported that he was getting timeouts on 3 out of 6 Apple name servers. DDOS attacks often work by overwhelming certain parts of a victims network infrastructure by bomparding it with millions of requests from all the nodes.

Parts of Apple’s web sites are hosted on Akamai which distributes copies all around the globe to share the load and speed up delivery. This might explain why apple.com was not affected because most likely this is one of these distributed sites. The developer portal however might not be and thus became victim of the denial of service, distributed, accidental or otherwise.

Then I turned to Twitter asking my followers if anybody else was experiencing the same issues. And – to my great relief – others were seeing the same problem. This meant that the problem was not localized on my hardware or my own network, but apparently on a grander scale.

Bron Gondwana had asked on Serverfault.com: “Anyone else experiencing high rates of Linux server crashes during a leap second day?”. When I first saw this question tweeted I thought this to be a joke. I assumed that by now all server software vendors would have made their operating systems immune to problems related to the system time.

But apparently not, the question in question revolves around a bug in the Network Time Protocol (NTP) and the existing workaround is about disabling the NTP daemon (host process) and running several time fixing scripts. So that is no joke but actually reality, however hard it is to wrap your mind around that.

But the problem apparently was not limited to name resolution.

Ben Chatelain still know a previous IP address of developer.apple.com which he pinged, but unsuccessfully.

lionking:~ oliver$ ping 17.254.2.129
PING 17.254.2.129 (17.254.2.129): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
^C
--- 17.254.2.129 ping statistics ---
6 packets transmitted, 0 packets received, 100.0% packet loss

Not all of Apple’s servers are hosted equal however. I could still get into iTunes Connect, though with all the images missing.

Closer inspection of the image URLs showed that Apple is hosting them on a dedicated static asset server at itc.mzstatic.com.

Oh, well. You shouldn’t work on Sunday anyway …

Let me know on Twitter or the comments of this post if you have any new information.

Update: I pinged some of the guys at Apple who I know to be as addicted to Twitter as I am and Michael Jurewitz let us know that the team is on top of it.

Update: 2 hours after this the problem had been resolved. Just in time to permit several overworked iOS developers to avoid an otherwise lazy Sunday.

flattr this!

TWIT haunted by Cocoanetics

$
0
0

One day before the WWDC 2012 keynote a group of Austrians hired a car and drove north to Petaluma where the TWIT podcast studio is located. We have been long time fans of Leo Laporte and his prize-winning podcast pioneering. So we were delighted to be witnessing the taping of This Week in Tech #357.

One year before, when I attended my first WWDC I was less well organized and at this time Leo Laporte was still residing in what they called the “TWIT Cottage” a small house with next to no room for guests. But this year 2012 was different since just a few months earlier TWIT had raised enough money to move to their much larger current studio.

Because of this emailing ahead and reserving seats was but a formality.

 

Occording to Google Maps this trip takes around an hour, but realistically you have to add another half hour that it takes you to get over the Golden Gate bridge and out of the city. That’s not too bad, it is about the same time that it took the three buses from San Francisco to Cupertino for all the developers who wanted to pay their respects to the Apple Apparel collection.

The car we had gotten thanks to great organizing by Brendan Duddridge from Tap Forms (the famous iOS database app) was fully loaded with 4 gentlemen and one lady. Being the most compact of the lot I sat on the middle seat in the back row. Nobody complained about lack of space as we all were ecstatic to be visiting Petaluma for the first time.

Leo Laporte is running his studio like a big family. He’s the don, the star and a small army of helpers makes sure that technology, audience and organizing all goes smoothly. I had written specifically that we are iOS developers who are in town for the big event to follow the next day. I was hoping to get some time on the show, because in stark contrast to two of my traveling companions I am not camera shy.

But apparently Leo has not yet adapted his style to dynamically include audience members in his shows, at least not those who are not celebrities themselves. I guess he’s just got a certain way to do his show like he always did it, his two guests dialed in via Skype and appearing on large monitors to either of his sides. This would be the first feature request that I have for TWIT: include the live audience now that you have room for one!

The second room for improvement I saw with the chairs for the audience. It’s great to have the room to accommodate visitors, but your backs hurt after the show. Leo being Leo noted to me, when I tweeted him that, that with more comfortable chairs the audience would never leave! Really?

After the show Leo kindly offered himself to be taken pictures with all the while with the live video stream still going on. Some funny suitable comments could be seen passing by on one monitor that was showing chat room messages in extra large letters. Leo let everybody have ample time to chat a bit and so I took the bull by the horns and used the airtime to promote Cocoanetics a bit.

In the video below you might notice that in the middle of my chat with Leo the audio turns bad. This is because we were filming with my iPhone 4S and my GoPro camera at the same time, but the helping hand holding the iPhone 4S switched the recording off too soon. Everybody was assuming that I was about to raise from Leo’s throne which he graciously had offered but then I had the inspiration to mention my podcast.

This turned into me pitching to Leo the idea of doing a developer podcast dedicated to iOS. With cameras still rolling you can see his brain going into overdrive and this resulted in a full second act for my 10 minutes of fame. I’m still hoping that this was able to plant a seed in Leo’s fabulous podcasting brains and maybe one day there will be a TWIT iOS podcast.

The third act – which I moved before the first two in the Video for effect – was about me showing Leo the Find my Friends experiment I had been running all throughout WWDC. 114 “Freunds” symbolized by purple pins who were all converging on the Moscone Center. And while I was showing off the current state on my iPad we could see the third pilgrimage in one cluster moving north heading back to San Francisco. Leo was genuinely excited by the demonstration.

9 days after our visit I got another few minutes of airtime, or rather my iOS 6 public transit article did. This happened in MacBreak Weekly #304. I thought it only fitting to append this after my chat with Leo, sort of as an echo. Leo even mentioned that I had visited “a couple of weeks ago”. I won’t be holding this inaccuracy against him but rather I am thankful for getting another sliver of fame out of that.

http://www.youtube.com/watch?v=YApgaBcEnVg

The material you see was recorded with two iPhone 4S and one GoPro HD (original, not the 2). My buddy Christian had begun to cut it on his Adobe Premiere but the program somehow messed up the project and made it unusable. So I could only use the first section of the video from the start until the beginning of the show. But thanks to the fabulous multi-cam support in Final Cut Pro X I was able to piece together a nice memento of the experience.

I still have to involuntarily giggle: Adobe messes up, Apple saves the day … or in this case, my video.

We’ll be returning to TWIT as soon as we can, at the latest when we’re coming back to San Fran for  WWDC 2013. Leo, don’t forget the iOS podcast! We got you on tape liking the idea!

flattr this!

XBench: Apple Stock SSD versus Striped RAID

$
0
0

I purchased a current model MacMini (Mid 2011) to serve as a Continuous Integration server. I chose the one model that has 4 GB and 2 HDDs because the larger RAM certainly should benefit the overall performance and 2 HDDs would give me an opportunity to experiment with striping the hard disks to see what performance could be gotten from that.

 

For comparison I am using a Mid 2011 27″ iMac which I had with stock Apple SSD and one HDD.

First up, Xbench of the iMac HDD.

Next in line is the performance of the RAID 0 in the MacMini:

Finally here’s the iMac SSD, you can see from the type that it claims to be from Apple:

 

As expected the striped HDD is generally faster than the non-striped one. The SSD takes a clear lead. However there are a few surprising results contained herein as well.

The single most slowest operation when accessing data on hard disks is the seek time, that is the time that the read/write heads need to move to the area on the platters where the data is located, called seek time or access time. In situations when seeking is less of a percentage of the overall operation (e.g. uncached sequential writing) the striping actually doubles the throughput. Random reading is about equivalent with the striped HDD being marginally faster in 3 out of 4 scenarios. In reading of large chunks (= less seeking) the stripe set also outperforms the regular HDD by a factor of almost 3x.

To summarize this, for the RAID0 has twice the throughput in general, except for reading random or sequential 4K blocks.

Now lets see how it did versus the SSD. Again a few surprises there. The RAID0 even outperforms the stock SSD on some scenarios, again when seek time can be ignored, like for large sequential writing. Look at the random access reading and writing however to see where the SSD truly shines. Having no seek times on the SSD memory chips gives you faster throughput between 3 to 10 times.

Reading and writing large sequential files is clearly won by the RAID0 setup, the SSD wins the random access categories hands down.

Conclusion

Of course the question now is wether building apps would actually benefit from the RAID0, I’ve had a fight with colleagues over this one. Is the build process dealing with small or large blocks? Is it more random access or sequential?

Then there is a certain additional danger when you use two hard disks as one. If one of them fails both are toast. HDDs have a certain MTBF (mean time before failure) and they do break occasionally. Therefore it is even more important than usually to be doing regular backups. Also the RAID0 setup makes it impossible to have recovery partition on one hard disk. For these worst case scenarios you should have a USB stick or internet connectivity to launch the recovery system so that you can restore the system if need be.

One scenario comes to mind for which I also want to have the benefit of the RAID0 setup: video encoding. I recently purchased Final Cut Pro X and Compressor on the Apple Store and of course I want to try to add an instance of compressor running on the MacMini for times when I want to speed up the time it takes to encode a 720p video for YouTube.

flattr this!

Who Wants Cocoapedia?

$
0
0

Two years ago I was more idealistic than today. That was when I created Cocoapedia (Oct 2010) and thought that if the place was there the contributors would come. Boy was I naive.

The idea behind Cocoapedia came from an unfortunate run-in I had had with Wikipedia two years earlier. At that time I – similarly enthusiastic – had created a Wikipedia page for myself only to find that flagged for deletion the day after. That was when I learned that Wikipedia has a set of relevancy criteria that artificially filters the content that can go into it.

I had never gotten a medal, never played a part in “historic, political or newsworthy events”, are no “widely known personality from the entertainment industry” and nobody has ever called my works as excellent. My TV appearances were never in an important function, I did not write two novels (or 4 non-fiction books) and the scandals I have unearthed fell mostly on death ears, too.

So I figured, if Wikipedia won’t have us irrelevant iOS developers, then our own Wiki definitely would. So Cocoapedia was born.

 

At first I kept registrations on approval basis which kept the content nice and clean and small. Then I decided to drop the approval for new registrations and instead rely on the same process as Wikipedia: everybody can join, everybody can post. As my popularity on Twitter grew I created stubs (incomplete beginnings of articles) for several people and invited them to complete those with some biographical info.

But somehow the massive Spam industry got wind of this paradise where everybody could post any keywords and links. Chaos ensued. I started to get more and more spam posts up to a level that I could no longer handle them myself.

Wikipedia’s Pareto Principle

Turns out Wikipedia only works because of the massive amount of volunteers who believe in the mission and who police the content rigoriously. If you plot the amount of articles certain logins have created you find that most of the articles on Wikipedia come from a relatively small group. The Pareto Principle applies: 80% of articles come from 20% of logins. Or maybe 95% articles from only 5% of logins. Though these are illustrative numbers not to be taken literally.

That this means is that for any kind of site or services that thrives on socially created content you need to have an enormous user base so that amongst these you will find the few active people who will carry it. That’s lesson number one.

Wikipedia is working because it is driven by sufficient amounts of people believing in their cause. To curate encyclopedic knowledge and defend it against commercial interests. Whoever tries to immortalize himself on Wikipedia will find his attempts flagged and deleted before the end of the day.

I was by myself for the policing and mostly for the creation of articles as well. An enormously unfair disadvantage compared to Wikipedia.

Let’s try Brute Force

The next thing I tried was enabling a spam filter with a lengthy keyword list ranging from insurances over car to sex toys. With mixed success, I was still getting tons of obvious spam registrations but a large portion of spam articles got blocked. However the problem with that approach was that I needed to go into a Mediawiki config file and keep adding new spam words.

The problem with this approach however is that as the spam word list grows longer you start to encroach into the realm of innocent words. Like for example developer and book author Chris Adamson complained that “wiki” was on this list because I had put it there earlier.

Also this did not solve the issue with having to wade ankle-deep through left over spam accounts that had been registered by a bot but had failed to inject their spammy payload. So that solution was none and only served to delay the inevitable.

What About (Dot) Me?

I thought that developers would flock to Cocoapedia and use it as a free platform to tell the world about themselves. Sort of like what you would want a journalist who is writing about you to know about you and possibly quote.

One of the strongest motivators on the internet seems to be the sense of ownership in one’s own identity. While they were still available people buy their names as .com domain names. With the supply of .com names mostly exhausted people turned to new TLDs like .me or turned to offerings like about.me to at least have a few toes in the door.

Any of the stubs I alluded to earlier I created by browsing people’s personal websites and copying the most important biographical details from their “about” pages and a list of their apps from what I could find linked to on the app store.

People with home pages have split in two categories over the last few years: some continue to fill their blogs with interesting articles, others found that they preferred to micro-blog on Twitter and Facebook. A smart person once said: “Every Tweet is a blog post not written”. I found that this holds true ever more than ever before.

Often I quip at some tweet by responding to it or I +1 it by retweeting or favoring it. Smart people like John Gruber don’t do that, instead they quote the tweet on their site and add their comment there. This way they stay the owners of their own statements. As opposed to forfeiting ownership by handing it over to Twitter.

I can relate to people being too busy to keeping information about themselves current in more than one location. If there are changes to your biography that you want to be known (“won Nobel price!”) then you’d have to update your blog, your (newly awarded) Wikipedia page as well as all social network profiles and then – after everything else – the lowly Cocoapedia.

A Solution in Search of a Problem

When evaluating the utility of Cocoapedia I have to immediately admit that its main purpose was for me to have a good feeling about being the owner of tons of information about other people. Not very altruistic, I admit.

And my ego aside, the second main reason was to give other people a platform for publicly stroking their respective egos. As mentioned earlier I could definitely see several people taking much care to include all their public appearances in Cocoapedia. Can you guess which country those come from?

Another idea was that Cocoapedia could possibly become the second site that Google would list if somebody was searching for your name. I just did the search for myself and found my German blog at number one, then Cocoanetics, two articles on Cocoanetics, Xing (where I had a premium account), and then my Cocoapedia page.

However this strategy only works if Google attributes sufficient interestingness in your specific combination of first and last name. That means because of all my online efforts Google is attributing a certain value to this individual named “Oliver Drobnik”. If you spend the same amount of time writing then you will have a similar rank.

Note that this is not page rank, but apparently Google seems to understand the concept of people independently of individual pages or their rank. Sort of a bit like Artificial Intelligence where a big brother-eske intelligence tracks people individually.

If you take most other developers who added themselves to Cocoapedia you will find that if you search for their name the Cocoapedia entry is nowhere to be found in the first few pages of search results. The reason being that Google has not “learned” of their importance.

In short Cocoapedia was trying to achieve something that is not possible. At least not any more. Google will not increase your personal rank just because you have a Cocoapedia page. It will only do that if you make sure that there are many instances on the web and social networks that point to you. A many-to-one relationship if you will.

All idealistic ruminations aside, I fail to see any lasting value in Cocoapedia. I don’t make money with it. It only frustrates because nobody wants to play with me. And it gets drowned by spam. All of this gets rid of your idealism in no time.

I give up!

The philosophy that made Apple great is to know what projects to can. It is not sufficient for something to be good or idealistic. It has to be great to be allowed to survive. Especially so if the upkeep of a “hobby” requires substantial resources without any hope of any kind of compensation.

I checked the server stats in the morning and found around 1000 unique visits per day. I’ve grown Cocoanetics to about 2500 uniques per day and BuySellAds nets me around $100 for banner ads. Do the math! If I plastered Cocoapedia with ads I might net up to $50. So economically Cocoapedia isn’t, it is far from being economic.

There isn’t any universe in which $50 would pay for somebody to manually keep the spam at bay.

And this brings us full circle to why Wikipedia works and Cocoapedia doesn’t. Public wikis can only flourish if they are fueled by identification with their philosophical principals. It takes an army of unpaid volunteers to curate the content. And people only work “pro bono” they believe in the bono.

Where you lack volunteers you might make up the difference in technology. But I have to admit that I have many shortcomings in this area (MySQL, PHP, Mediawiki plugins). I am an iOS developer at heart and would have loved to hire somebody to be the full time administrator of something great. But alas I am neither rich nor wealthy so that this has any chance of turning into reality.

You cannot believe how much pain this causes me. I’ve invested both time and money in Cocoapedia and as such I find it hard to let go. But in trying to become more like Apple I am seeing this as a symbol of a road to becoming more ruthless when it comes to canceling failed projects.

Wanna Take it Off My Hands?

It might be the case that somebody has better plans with the Cocoapedia name. I can imagine that it would be a nice name for a component store or a tutorial collection or anything else that collects wisdom on iOS/Mac development. Or maybe somebody would love to try his luck with the content already in the database.

Because of this I am not shutting down the site right away, but I’m offering the full package to the highest bidder:

  • Cocoapedia Mediawiki Database, import it into your own Wiki or keep it alive
  • Domain Names Cocoapedia.org and Cocoapedia.com – so something non-profit (org) or for commercial reasons (com). About 1500 unique visitors.
  • Twitter user Cocoapedia to go with it. About 200 followers.

I am collecting all serious offers until Monday July 16th and then I will decide who gets it. If nobody can be found then I will just take down the site and replace it with a screen full of advertisements as any smart domain squatter does.

You can e-mail me or tweet me if you have questions or want to submit an offer. Please, pleeeease!

flattr this!

You Don’t Need The Xcode “Command Line Tools”

$
0
0

When Apple made Xcode into its own app bundle it greatly simplified our lives as developers. This enabled incremental updates for the stable version can get from the app store. Also you get updates the same way as updates for other apps.

To cut down on file size Apple made several items optional downloads, like the documentation, older versions of Simulator or Command Line Tools. The latter you need if you are building stuff outside of Xcode, like Open Source projects. You know, bare knuckles, command line geekery.

However those tools are not needed if you want to say use svn or git. This article explains why.

 

When you download and install the “Command Line Tools” they integrate with your Unix file system structure the same way a compiler and header files would. The installer copies these files all over the place. All these tools (and many additional ones) are already included in Xcode.app as they are remote-controlled from Xcode when you build apps. Now if you update Xcode.app via the app store then the copies of these tools remain their current versions.

Have you ever read the description on the download window?

Even even tells you here, “Before installing, note …” that you don’t need this. It mentions two commands that will help us to live without it.

But! I want my GIT!

… and you shall have it. As I mentioned above the git tool (and svn too) are contained inside the Xcode.app bundle from where they are used by Xcode whenever you interact with repositories. There are two commands that you need to know to get to that.

You can have multiple Xcodes installed at the same time, the xcode-select command lets you inquire and set which Xcode is the one you want to use.

xcode-select --print-path
/Applications/Xcode45-DP2.app/Contents/Developer

In this instance my system already has the Xcode 4.5 DP2 set as the current on. To select a specific Xcode you use the –switch switch.

sudo xcode-select --switch /Applications/Xcode45-DP2.app

Note that you are required to use sudo (and enter your admin password) with this. You specify the path to the .app bundle. The tool appends the Contents/Developer. You can also specify the full path yourself, but why type more than necessary?

Having selected the correct Xcode for our purposes (which most of the time will the the normal stable Xcode.app in Applications) we can now run all the contained tools by means of xcrun. Let’s try git.

xcrun git --version
git version 1.7.10.2 (Apple Git-33)
 
git --version
git version 1.7.3.4

Oh how nice, the git version contained in Xcode is much newer than the one I had manually installed in /usr/local/bin. This nicely illustrates the big advantage of using the bundled tools over those “installed eons ago”.

Waqar Malik has this Pro Tip for us:

This awesome little statement sets up an alias for your shell. Whenever you begin a command line with git the shell knows to substitute xcrun git for it. To make this definition persist you have to add it to your .profile (or create a new one if you don’t have one yet) or .bashrc file in your home folder. Either one is fine as long as this gets executed when you launch a new shell.

In case you are curious which actual path xcrun would use for a specific tool, there is the –find switch to “inquire within”

xcrun --find svn
/Applications/Xcode45-DP2.app/Contents/Developer/usr/bin/svn

Armed with the above knowledge you can save the 115 MB that the Command Line Tools need. This package serves a very distinct purpose and it is great for the home-brew-crowd that Apple is making it available as well as is supporting it.

Removing Already Installed Tools

There is no simple way to get rid of the installed files as they are copied all over the place. But there is a manifest file which lists all folders and files that are installed by the package. This allows us to go all “brute force” on the tools and remove them.

remove_CLI_tools.sh

RECEIPT_FILE=/var/db/receipts/com.apple.pkg.DeveloperToolsCLI.bom
RECEIPT_PLIST=/var/db/receipts/com.apple.pkg.DeveloperToolsCLI.plist
 
if [ ! -f "$RECEIPT_FILE" ]
then
  echo "Command Line Tools not installed."
  exit 1
fi
 
echo "Command Line Tools installed, removing ..."
 
# Need to be at root
cd /
 
# Remove files and dirs mentioned in the "Bill of Materials" (BOM)
lsbom -fls $RECEIPT_FILE | sudo xargs rm -r 
 
# remove the receipt
sudo rm $RECEIPT_FILE
 
# remove the plist
sudo rm $RECEIPT_PLIST
 
echo "Done! Please restart XCode to have Command Line Tools appear as uninstalled."

Use at your own risk, it might remove more than you bargained for. So make sure you made a time machine backup before running this.

There is a second copy of the CLI Tools still present on your system even if you remove them with the above script. Xcode downloads end up in ~/Library/Caches/com.apple.dt.Xcode/Downloads and there are another 112168 KBytes to be reclaimed by removing the DMG file that you find in there, at the time of this writing named Xcode.CLTools.10.8-1.7.dmg.

Conclusion

For the rest of us who live and breathe inside Xcode, who only go to the command line to work efficiently with git and svn, we don’t need to install it. By creating aliases for the tools we need in our daily business we reap the benefits of current bundled versions and auto-updating of those through the app store.

By removing the installed CLI tools as well as deleting the downloaded DMG file you can reclaim over 200 MB of valuable disk space without any drawback.

flattr this!

Viewing all 428 articles
Browse latest View live