This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewDidLoad{ | |
[super viewDidLoad]; | |
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); | |
dispatch_async(queue, ^{ | |
//go fetch some data from the Iternet or DB here... | |
//data received! | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
//update UI | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
AsyncTask<Object, Void, Object> worker = new AsyncTask<Object, Void, Object>(){ | |
@Override | |
protected Object doInBackground(Object... args) { | |
//do something | |
return something; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
04-15 17:57:57.677: E/AndroidRuntime(29310): FATAL EXCEPTION: main | |
04-15 17:57:57.677: E/AndroidRuntime(29310): java.lang.RuntimeException: Unable to start activity ComponentInfo{in.wptrafficanalyzer.locationgooglemapv2demo/in.wptrafficanalyzer.locationgooglemapv2demo.MainActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment | |
04-15 17:57:57.677: E/AndroidRuntime(29310): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180) | |
04-15 17:57:57.677: E/AndroidRuntime(29310): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) | |
04-15 17:57:57.677: E/AndroidRuntime(29310): at android.app.ActivityThread.access$600(ActivityThread.java:141) | |
04-15 17:57:57.677: E/AndroidRuntime(29310): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) | |
04-15 17:57:57.677: E/AndroidRuntime(29310): at android.os.Handler.dispatchMessage(Handler.java:99) | |
04-15 17:57:57.677: E/AndroidRuntime(29310): at android.os.Looper.loop(Lo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation NSArray (Access) | |
- (id) firstObject{ | |
if([self count] > 0){ | |
return [self objectAtIndex:0]; | |
} | |
return nil; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Generated by class-dump 3.4 (64 bit). | |
* | |
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard. | |
*/ | |
#pragma mark Named Structures | |
struct CGPoint { | |
double x; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user www-data; | |
worker_processes 4; | |
pid /run/nginx.pid; | |
worker_rlimit_nofile 8192; | |
events { | |
worker_connections 4096; | |
} | |
http { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table deps_saved_ddl | |
( | |
deps_id serial primary key, | |
deps_view_schema varchar(255), | |
deps_view_name varchar(255), | |
deps_ddl_to_run text | |
); | |
create or replace function deps_save_and_drop_dependencies(p_view_schema varchar, p_view_name varchar) returns void as | |
$$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(next){ | |
sqliteDb.run("create table campgrounds (id integer, name text, latitude real, longitude real, rating real, address text, city text, state text, zip_code text)", next); | |
}, | |
function(next){ | |
sqliteDb.run("create table campground_photos (id integer, photo_url text, campground_id integer)", next); | |
}, | |
function(next){ | |
sqliteDb.run("create table campground_reviews (id integer, headline text, body text, rating text, campground_id integer)", next); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(next){ | |
var sql = "insert into campgrounds (id, name, latitude, longitude, rating, address, city, state, zip_code) values (?, ?, ?, ?, ?, ?, ?, ?, ?)"; | |
models.Campground.find(function(err, campgrounds){ | |
async.eachSeries(campgrounds, function(c, next){ | |
sqliteDb.run(sql, [c.id, c.name, c.latitude, c.longitude, c.rating, c.address, c.city, c.state, c.zip_code], next) | |
}, next); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
models.Campground.find({updated_at: onionrm.gte(timestamp)}, function(err, campgrounds){ | |
}); |