Showing posts from June, 2011

UISegmentedController Customized

Custom UITabBar

Technique 1:

Technique 2:




Segmented View Controller for Switching Views

core data wrapper

Core Data Epic Introduction

Fetch data using one line:

[[self managedObjectContext] fetchObjectsForEntityName:@"Employee" withPredicate:
    @"(lastName LIKE[c] 'Worsley') AND (salary > %@)", minimumSalary];

one to many relationship

OAuth with tweepy


OAuth AuthenticationOAuth is a bit trickier than basic auth, but there are some advantages to using it: You can set a 'from myappname' which will appear in tweets postedMore secure since you don't need the user's passwordYour app does not break if the user changes their password in the futureTweepy tries to make OAuth as painless as possible for you. To begin the process we need to register our client application with Twitter. Create a new application and once you are done you should have your consumer token and secret. Keep these two handy, you'll need them. The next step is creating an OAuthHandler instance. Into this we pass our consumer token and secret which was given to us in the previous paragraph: auth = tweepy.OAuthHandler(consumer_token, consumer_secret) If you have a web application and are using a callback URL that needs to be supplied dynamically you w…

Tutorial: consuming Twitter's real-time stream API in Python


import pycurl, json


USER = "segphault"

def on_receive(data):
  print data

conn = pycurl.Curl()
conn.setopt(pycurl.USERPWD, "%s:%s" % (USER, PASS))
conn.setopt(pycurl.URL, STREAM_URL)
conn.setopt(pycurl.WRITEFUNCTION, on_receive)