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 NSDictionary (objectForKeyWithoutNull) | |
- (id)objectForKeyWithoutNull:(id)aKey | |
{ | |
id value = [self objectForKey:aKey]; | |
if ([value isEqual:[NSNull null]]) { | |
return nil; | |
} | |
else { | |
return value; | |
} |
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
- (NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section | |
{ | |
NSLog(@"TimelineDataSource#tableView:numberOfRowsInSection:(%d)", section); | |
NSInteger count = [[_timeline statuses] count]; | |
return (count > 200) ? 200 : count; | |
} |
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
package "build-dep" do | |
action :install | |
end | |
package "rrdtool" do | |
action :install | |
end | |
execute "cpanm" do | |
command "cpanm -n GrowthForecast" |
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
execute "install rrdtool with dependencies" do | |
command "apt-get -y build-dep rrdtool" | |
action :run | |
end | |
execute "install cpanm" do | |
command "curl -L http://cpanmin.us | perl - App::cpanminus" | |
action :run | |
end |
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
# | |
# Cookbook Name:: rbenv | |
# Recipe:: default | |
# | |
# Copyright 2013, YOUR_COMPANY_NAME | |
# | |
# All rights reserved - Do Not Redistribute | |
# | |
git "/home/vagrant/.rbenv" do |
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 Hikaku{ | |
public static void main(String[] a){ | |
int A = 2; | |
int B = 10; | |
int C = 6; | |
if(A>B && A>C){ | |
if(B>C){ | |
System.out.println("最大が"+A+"、次点が"+B); | |
}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
public class Baisuu{ | |
public static void main(String[] args){ | |
for(i=2;i=<32;i=i*2){ | |
System.out.println(i); | |
} | |
} | |
} |
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
public class Baisuu{ | |
public static void main(String[] args){ | |
for(i=2;i=<32;i=i*2){ | |
System.out.println(i); | |
} | |
} | |
} |
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 maxTest { | |
public static void main(String args[]){ | |
int a, b, max; | |
// Test 1 | |
a = 1; | |
b = 2; | |
max = Math.max(a, b); | |
if (max == 2) { | |
System.out.println("test 1 OK"); |
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 maxTest { | |
public static void main(String args[]){ | |
test("test 1", 1, 2, 2); | |
test("test 2", 2, 1, 2); | |
test("test 3", 1, 1, 1); | |
} | |
public static void test(String name, int a, int b, int excepted) { | |
int max; |