This file contains hidden or 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
// | |
// Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2004-2008 | |
// | |
// Copyright: See COPYING file that comes with this distribution | |
// | |
#ifndef HIGHLIGHTSTATEBUILDER_H_ | |
#define HIGHLIGHTSTATEBUILDER_H_ | |
#include "highlightstate.h" |
This file contains hidden or 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
A libparserutils/build | |
A libparserutils/build/conv.pl | |
A libparserutils/build/Aliases | |
A libparserutils/build/Doxyfile | |
A libparserutils/build/make-aliases.pl | |
A libparserutils/test | |
A libparserutils/test/cscodec-8859.c | |
A libparserutils/test/regression | |
A libparserutils/test/regression/filter-badenc-segv.c | |
A libparserutils/test/regression/stream-nomem.c |
This file contains hidden or 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
- (NSString *)contentOfXMLFile:(NSString *)filename { | |
NSString *contentPath = [[NSBundle bundleForClass:[self class]] pathForResource:filename | |
ofType:@"xml"]; | |
NSURL *contentURL = [NSURL fileURLWithPath:contentPath]; | |
return [NSString stringWithContentsOfURL:contentURL | |
encoding:NSUTF8StringEncoding | |
error:nil]; | |
} |
This file contains hidden or 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
- (NSString *)contentOfXMLFile:(NSString *)filename { | |
NSString *contentPath = [[NSBundle mainBundle] pathForResource:filename | |
ofType:@"xml"]; | |
NSURL *contentURL = [NSURL fileURLWithPath:contentPath]; | |
return [NSString stringWithContentsOfURL:contentURL | |
encoding:NSUTF8StringEncoding | |
error:nil]; | |
} |
This file contains hidden or 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 BookViewController; | |
typedef void(^BookViewControllerResponse)(BookViewController *controller); | |
@interface BookViewController : UIViewController { | |
BookViewControllerResponse cancelBlock_; | |
BookViewControllerResponse saveBlock_; | |
} | |
@property (nonatomic, copy) BookViewControllerResponse cancelBlock; |
This file contains hidden or 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)insertNewObject { | |
__block NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; | |
NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity]; | |
Book *newBook = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context]; | |
BookViewController *bookViewController = [[BookViewController alloc] init]; | |
bookViewController.book = newBook; | |
__block __typeof__(self) blockSelf = self; |
This file contains hidden or 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)insertNewObject { | |
NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; | |
NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity]; | |
Book *newBook = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context]; | |
BookViewController *bookViewController = [[BookViewController alloc] init]; | |
bookViewController.book = newBook; | |
bookViewController.delegate = self; | |
[self presentModalViewController:bookViewController animated:YES]; | |
[bookViewController release]; |
This file contains hidden or 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 BookViewController; | |
@protocol BookViewControllerDelegate | |
- (void)bookViewControllerDidCancel:(BookViewController *)controller; | |
- (void)bookViewControllerDidSave:(BookViewController *)controller; | |
@end | |
@interface BookViewController : UIViewController { | |
id <BookViewControllerDelegate> delegate_; | |
} |
This file contains hidden or 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 EventTimeTest | |
{ | |
public event EventHandler StandardEvent; | |
public event EventHandler TrickyEvent = delegate { }; | |
public void Test() { | |
Stopwatch timer; | |
EventArgs e = new EventArgs(); | |
for (int testCase = 0; testCase < 9; testCase++) { | |
int limit = (int)Math.Pow(10, testCase); |
This file contains hidden or 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
// Sample code to remember size and location of a WinForm. | |
// Needs a Settings class called FormSettings. | |
protected override void OnLoad(EventArgs e) | |
{ | |
base.OnLoad(e); | |
Point location = FormSettings.Default.Location; | |
if (!StartPositionIsWithinBounds(location)) | |
{ | |
location.X = 10; | |
location.Y = 10; |
NewerOlder