Saturday, June 15, 2013

Funny google

Most of the time when we use Google we enter the items we want to search and expect a good result.

While using SecKeyDecrypt function in iOS to decrypt some data I got error -9809. That is with a "-" in front.

So I went to google and searched for "SecKeyDecrypt error -9809". None of the pages said anything about "-9809".

I tried "SecKeyDecrypt error 9809" and I got some good answers.

The reason is that "-" means show the pages that do not contain the value. Exactly the opposite of what I wanted.

The solution is to include the value with "-" among quotation marks like this:

SecKeyDecrypt error "-9809"

---

Here is the description of the error in case you reached here using google:

While replicating the code here, the code returned an error "-9809" for

status = SecKeyDecrypt(    privateKey,
                         kSecPaddingPKCS1,
                         cipherBuffer,
                         cipherBufferSize,
                         plainBuffer,
                         &plainBufferSize
                         );       

The reason is that there is a typo on the page a little bit above at the line:

  NSData *encryptedData = [NSData dataWithBytes:cipherBuffer length:dataLength];

It should be:

  NSData *encryptedData = [NSData dataWithBytes:cipherBuffer length:cipherBufferSize];

Monday, May 27, 2013

UML Modelling tool for Mac

As Visio is not available for Mac, I had a look a different tools.

In the end I downloaded and tried two:

- one free but a bit limited: UMLet

- one not free ($99 one time or $5/month) but with huge amount of options: Visual Paradigm for UML

feedly not working in Safari

After the announcement of taking Google Reader offline, many switched to Feedly. For Safari it works as an extension that behaves awesome except when it doesn't :-)

On one Mac Book it installed fine but it did not work. After almost giving up, I tried to manually load the URL where the browser should redirect you automatically but it doesn't: http://www.feedly.com/home

Now it works like a breeze

Friday, May 24, 2013

speed of light

As Einstein's Special Theory of Relativity says, the faster you move the less you age.

When you do something you like, you feel like moving at the speed of light.

The work on an awesome project does not feel like work at all and you'll finish it in no time.

That might be why people doing what they love never age. It is the E=mc2 doing the magic!

Thursday, May 23, 2013

Editing words on iOS devices

Here is how you can edit a mistake somewhere in the middle of the word on an iOS device:

http://screencast.com/t/eDxjIDaxYO

Wednesday, May 22, 2013

Should I create an app for iPhone or only for iPad?

According to the Apple press release from January 2013:

The Company sold a record 47.8 million iPhones in the quarter, compared to 37 million in the year-ago quarter. Apple also sold a record 22.9 million iPads during the quarter, compared to 15.4 million in the year-ago quarter.

So, on average, Apple sales twice as many iPhones compared to iPads.

Also, the first iPhone was launched in 2007 while the first iPad came on the market in 2010. So we can assume that there are at least 4 times more iPhones than iPads.

People tend to carry their iPhones everywhere (even in some places they shouldn't) so the chances that somebody would find and use your app on this device is way bigger.

And, last but not least, most of the apps on iPhone work on iPod touch as well.

First, of course, you have to decide is the app can bring value to the customers having an iPhone.

If it can, then the answer is definitely "Yes, you should create an iPhone version as well!".