Posts

Showing posts from June, 2011

UISegmentedController Customized

http://idevrecipes.com/2010/12/13/wooduinavigation/

Custom UITabBar

Technique 1:
http://blog.theanalogguy.be/2010/10/06/custom-colored-uitabbar-icons/

Technique 2:

@implementationUITabBar(CustomImage)-(void)

UIScrollView

NSNotificationCenter

Segmented View Controller for Switching Views

core data wrapper

Core Data Epic Introduction

http://cocoadevcentral.com/articles/000086.php



Fetch data using one line:

[[self managedObjectContext] fetchObjectsForEntityName:@"Employee" withPredicate:
    @"(lastName LIKE[c] 'Worsley') AND (salary > %@)", minimumSalary];
Via: http://cocoawithlove.com/2008/03/core-data-one-line-fetch.html

one to many relationship
http://lethain.com/one-to-many-relationships-in-coredata/

OAuth with tweepy

VIA: https://github.com/tweepy/tweepy/blob/4799c740a20882e854a636e2721164cd5841a6c8/doc/auth_tutorial.rst



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

VIA: http://arstechnica.com/open-source/guides/2010/04/tutorial-use-twitters-new-real-time-stream-api-in-python.ars/


import pycurl, json

STREAM_URL = "http://chirpstream.twitter.com/2b/user.json"

USER = "segphault"
PASS = "XXXXXXXXX"

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)
conn.perform()