Bird Bot is a Facebook messenger bot. Bird watchers in India shoot photos of birds. And they want to know the bird name. My good old friend from college is an expert in Machine learning. He is building a bird identification api with the help of TensorFlow and Keras. I am helping him with the front-end. Instead of developing an app with React Native, I wrote a simple bot which works with Facebook messenger.…

Read More

I am learning Objective-C. This post contains some Objective-C trivia which I picked up over the last few weeks.

Concatenating Strings

In Objective-C, NSString class represents strings. Concatenating two strings is not easy. To ease the pain, there is a NSMutableString class. It has an append method. The StackOverflow post summarises the different methods available to concatenate strings. Usually, we have problems with XML strings which run into multiple lines.…

Read More

Playing audio in an iOS app consists of two steps:

  1. Creating an Audio session using AVAudioSession class.
  2. Playing the audio using Audio player using AVAudioPlayer class.

AVAudioSession

We want to play audio in apps even though the background music is running. For that, create a shared audio session. The code for initializing a shared session is shown below.

-(void)initAudio
{
    NSError *error;
    
    [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil];
    BOOL success = [[AVAudioSession sharedInstance] setActive: YES error: &error];
    if(!success)
Read More

HTML5 is an evolving web standard. It has good adoption across browsers – IE (10), Firefox, Chrome, Safari, Opera. To see the level of compliance in your browser, visit http://html5test.com. In this post, we will go over the basic features of HTML5.

Semantic tags

Semantic tags like article, section etc are more meaningful than plain div tags.

<article>
 <hgroup>
  <h1>Title of the page</h1>
  <h2>Subtitle</h2>
 </hgroup>
 <section>
  <h1>Virgin Gorda</h1>
  <p>The Baths at Virgin Gorda are truly one of the most picturesque places in the Caribbean.<p>
Read More

SQLite database has native support in iOS. The post provides a simple helper class that you can use to retrieve data and perform update operations on the data.

The helper class uses the libsqlite3.dylib library. Link the XCode project with the library. Create a helper class in Objective-C: DbHelper.

Header file

Define the DbHelper class with a static method (getInstance) to create a singleton instance.…

Read More