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
int main(int argc, char** argv) { | |
printf("hello world\n"); | |
} |
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
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
static NSString *CellIdentifier = @"Cell"; | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | |
if (cell == nil) { | |
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; | |
} | |
NSDictionary* pictObj = [self.pictures objectAtIndex:indexPath.row]; | |
NSString* title = [pictObj objectForKey:@"title"]; |
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)viewWillAppear:(BOOL)animated | |
{ | |
[super viewWillAppear:animated]; | |
CLLocationCoordinate2D points[2]; | |
points[0].latitude = 0; | |
points[0].longitude = 0; | |
points[1].latitude = -6; | |
points[1].longitude = 5; | |
MKPolyline* polyline = [MKPolyline polylineWithCoordinates:points count:2]; |
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
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
...code to dequeue and setup a UITableViewCell removed... | |
//retrieve our Core Data representation of the photo | |
Photo* photo = [Photo photoWithFlickrData:pictObj inManagedObjectContext:context]; | |
if (photo.thumbnail) { | |
cell.imageView.image = [UIImage imageWithData:photo.thumbnail]; | |
} | |
else { |
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
#include <iostream> | |
using namespace std; | |
class A | |
{ | |
public: | |
int a1; | |
int a2; | |
virtual void A1() { cout << "A->A1" << endl; } |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>DVTConsoleDebuggerInputTextColor</key> | |
<string>1 1 1 1</string> | |
<key>DVTConsoleDebuggerInputTextFont</key> | |
<string>Menlo-Bold - 11.0</string> | |
<key>DVTConsoleDebuggerOutputTextColor</key> | |
<string>1 1 1 1</string> |
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
import urllib | |
import re | |
class WebApiOpener(urllib.FancyURLopener): | |
''' | |
Provides a way for HTTP Basic authentication to take place without | |
prompting the user for a username and password like FancyURLopener | |
would. | |
''' | |
def __init__(self, username, password): |
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
#include <stdio.h> | |
#include <socketshit.h> | |
int main(int argc, char** argv) | |
{ | |
while(true) { | |
int fd = listen(internet); | |
superbuffer_t buff = read(fd); | |
write(dbfile, buff); | |
//fsync(dbfile); //took this out. was slowing me down |
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
class MyClass1 { | |
private int _fastCounter = 0; | |
private int _slowCounter = 0; | |
public synchronized void methodSlow() { | |
System.out.println("slowCounter.start " + _slowCounter); | |
try { | |
Thread.sleep(5*1000); | |
} | |
catch(Exception e) { |
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)controllerWillChangeContent:(NSFetchedResultsController *)controller { | |
} | |
- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath { | |
} | |
- (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id<NSFetchedResultsSectionInfo>)sectionInfo atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type { | |
} |
OlderNewer