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
# Looping pixels! | |
Win = Gosu::Window.new(500, 500, false) | |
img = Gosu::Image.new(Win, filename) | |
# Show info of 1 pixel | |
p = img.get_pixel(100,100); | |
puts p.to_s | |
# loop and make grey | |
img.each{ |pixel| |
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
def check_pixel(x, y) | |
set_checked(x, y) | |
@shape_pixels = @shape_pixels + 1 | |
if (@shape_y_pixels[y] == nil) | |
@shape_y_pixels[y] = 0 | |
end | |
if (@shape_x_pixels[x] == nil) | |
@shape_x_pixels[x] = 0 | |
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
def resize(size) | |
ImageScience.with_image(@imagefilename) do |img| | |
img.thumbnail(size) do |resizedimg| | |
@tempimage = resizedimg | |
@width = resizedimg.width | |
@height = resizedimg.height | |
return true | |
end | |
end | |
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
def histogram(location) | |
if !@texplayinit | |
init_texplay | |
end | |
histogram_image = TexPlay.create_blank_image(@@Win, 101, 1022) | |
img = Gosu::Image.new(@@Win, @imagefilename) | |
@histopixels = Array.new | |
101.times{ |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
You have a nil object when you didn't expect it! | |
You might have expected an instance of Array. | |
The error occurred while evaluating nil.each | |
{"utf8"=>"✓", | |
"_method"=>"put", | |
"authenticity_token"=>"7dsqpiKslrOcAL+OB1RRhwYpikMn1s9AtBvRWsh2kpA=", | |
"work"=>{"name"=>"dsfsdfd", | |
"categorization_attributes"=>{"1"=>"1", | |
"3"=>"1"}, |
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
<script>$.getScript("/javascripts/jquery.tweet.js", function(){ | |
$("#activity").tweet({ | |
avatar_size: 32, | |
count: 4, | |
query: "TEDxAms+OR+TEDxAmsterdam", | |
loading_text: "Searching Twitter..." | |
}); | |
$('.scroll-pane').jScrollPane(); | |
}); | |
</script> |
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]; | |
[NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(onTimer) userInfo:nil repeats:YES]; | |
if (![[NSUserDefaults standardUserDefaults] objectForKey:kCurrentPage]) { | |
[[NSUserDefaults standardUserDefaults] setInteger:1 forKey:kCurrentPage]; | |
currentPage = 1; | |
} else { | |
currentPage = [[NSUserDefaults standardUserDefaults] integerForKey:kCurrentPage]; |
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
<?php | |
// FACEBOOK WALL RSS FETCHER | |
// For ID, request: https://graph.facebook.com/xxyourpagexx | |
$wall = stealthget("http://www.facebook.com/feeds/page.php?format=atom10&id=96302003265", "http://facebook.com"); | |
?> | |
<pre> | |
Wall Characters: <?=strlen($wall)?> | |
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 | |
{ | |
[self setupPages]; | |
[super viewDidLoad]; | |
} | |
- (void)setupPages | |
{ | |
UIWebView *wview; | |
wview = [[UIWebView alloc] initWithFrame:CGRectMake(16, 16, 300, 800)]; | |
wview.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth); |
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
for( int i = 0; i < 4; i++ ) { | |
UIWebView *wview; | |
int wx; | |
if (i < 2) { | |
wx = 12; | |
} else { | |
wx = 512; | |
} | |
wview = [[UIWebView alloc] initWithFrame:CGRectMake(wx, 16, 500, 716)]; |
OlderNewer