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
int i; | |
while (i < 1000) { | |
Page *newPage = [[Page alloc] initWithEntity:[Page entity] insertIntoManagedObjectContext:[NSManagedObjectContext contextForCurrentThread]]; | |
newPage.page_number = [currentPageNumber copy]; | |
newPage.story_id = self.story.id; | |
//newPage.text = [pageBuffer substringToIndex:splitIndex]; | |
newPage.text = @"meowCAT"; | |
newPage.first_block_number = [startBlockNumber copy]; | |
newPage.first_block_index = [NSNumber numberWithInt:startBlockIndex]; | |
newPage.last_block_number = [currentBlock.block_number copy]; |
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
[super viewDidLoad]; | |
UIImage* backgroundImage = [UIImage imageNamed:@"Title-Background"]; | |
[self.navigationBar setBackgroundImage:backgroundImage | |
forBarMetrics:UIBarMetricsDefault]; | |
CGFloat heightDiff = backgroundImage.size.height - self.navigationBar.frame.size.height; | |
self.navigationBar.frame = CGRectMake(self.navigationBar.frame.origin.x, | |
self.navigationBar.frame.origin.y, | |
backgroundImage.size.width, | |
backgroundImage.size.height); |
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
[super viewDidLoad]; | |
UIImage* backgroundImage = [UIImage imageNamed:@"Title-Background"]; | |
[self.navigationBar setBackgroundImage:backgroundImage | |
forBarMetrics:UIBarMetricsDefault]; | |
CGFloat heightDiff = backgroundImage.size.height - self.navigationBar.frame.size.height; | |
self.navigationBar.frame = CGRectMake(self.navigationBar.frame.origin.x, | |
self.navigationBar.frame.origin.y, | |
backgroundImage.size.width, | |
backgroundImage.size.height); |
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) awakeFromNib { | |
//self.counterLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.frame.size.height - LABEL_HEIGHT, self.frame.size.width - LABEL_WIDTH, LABEL_WIDTH, LABEL_HEIGHT)]; | |
self.counterLabel = [[UILabel alloc] init]; | |
self.counterLabel.text = @"666"; | |
self.counterLabel.font = [UIFont systemFontOfSize:12.0]; | |
self.counterLabel.textColor = [UIColor blackColor]; | |
[self addSubview:self.counterLabel]; | |
[super awakeFromNib]; |
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
/Library/Ruby/Gems/1.8/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:306:in `depend_on': No such file to load -- apn_on_rails (LoadError) | |
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:214:in `require_dependency' | |
from /Library/Ruby/Gems/1.8/gems/railties-3.1.1/lib/rails/engine.rb:417:in `eager_load!' | |
from /Library/Ruby/Gems/1.8/gems/railties-3.1.1/lib/rails/engine.rb:416:in `each' | |
from /Library/Ruby/Gems/1.8/gems/railties-3.1.1/lib/rails/engine.rb:416:in `eager_load!' | |
from /Library/Ruby/Gems/1.8/gems/railties-3.1.1/lib/rails/engine.rb:414:in `each' | |
from /Library/Ruby/Gems/1.8/gems/railties-3.1.1/lib/rails/engine.rb:414:in `eager_load!' | |
from /Library/Ruby/Gems/1.8/gems/railties-3.1.1/lib/rails/application/finisher.rb:51 | |
from /Library/Ruby/Gems/1.8/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `instance_exec' | |
from /Library/Ruby/Gems/1.8/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `run' |
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
LionWeb::Application.routes.draw do | |
resource :session | |
resource :profile | |
resources :messages | |
resources :questions do | |
resources :answers, :controller => "question_answers" | |
collection do | |
get :randomized | |
match ':/page' => "page#show" |
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
resources :questions do | |
resources :answers, :controller => "question_answers" | |
collection do | |
get :randomized | |
get "/:page" => "questions#page" | |
end | |
end |
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
This is the query: | |
SELECT * FROM questions | |
LEFT JOIN messages on questions.id = messages.question_id | |
LEFT JOIN questions_skip_counts qsc on questions.id = qsc.question_id AND questions.user_id = qsc.user_id | |
WHERE messages.sender_id = NULL and questions.user_id != 'FOO' AND qsc.skip_count = | |
(SELECT min(qsc.skip_count) FROM questions LEFT | |
JOIN messages on questions.id = messages.question_id LEFT JOIN questions_skip_counts qsc on questions.id = qsc.question_id AND questions.user_id = qsc.user_id WHERE messages.sender_id = NULL and questions.user_id != 'FOO') | |