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
/* | |
* jBenchMark | |
* | |
* Date: 2008/09/04 | |
* @author hisasann | |
* @version 0.1 | |
* | |
* Tested | |
* On IE6.0, IE7.0, FF 3.0, Opera 9.5 and Safari 3.1 on Windows. | |
* |
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
var arr = [ | |
5, 10, 1, 2, 4, 3 | |
]; | |
console.log(arr); | |
function sort(data) { | |
for (i = 0; i < data.length - 1; i++) { | |
console.log(i); | |
for (j = 0; j < data.length - i - 1; j++) { |
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
<!DOCTYPE HTML> | |
<html lang="ru-RU"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<script src="lib/jquery.js" type="text/javascript" charset="utf-8"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$(function() { | |
$(window).keydown(function(event) { | |
if ((event.ctrlKey || event.metaKey) && event.keyCode === 70) { |
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 fizzBuzz() | |
(1..100).each { |i| | |
s = ""; | |
i % 3 == 0 ? s += "Fizz" : ""; | |
i % 5 == 0 ? s += "Buzz" : ""; | |
p s == "" ? i : s; | |
} | |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> | |
<title></title> | |
<style type="text/css" media="screen"> | |
#scroller { | |
height: 200px; | |
border: 1px solid; |
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
console.log("start"); | |
setTimeout(function() { | |
sleep(2000); | |
console.log(1); | |
}, 1000); | |
console.log("end"); | |
function sleep(msec) { | |
try { | |
// FirefoxかOpera |
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
console.log(makePrime(100)); | |
function makePrime(maxCount) { | |
var max = maxCount + 1, | |
primes = new Array(max), | |
ret = new Array(); | |
// 一旦すべて素数とする | |
for (var i=1; i < max; ++i) { primes[i] = true; }; |
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 "Status.h" | |
@implementation Status | |
@synthesize customUrlAlbumId = _customUrlAlbumId; | |
@synthesize isTopReload = _isTopReload; | |
@synthesize isThumbnailReload = _isThumbnailReload; | |
@synthesize isInvitationReload = _isInvitationReload; | |
static Status *sharedHistory = nil; |
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 "PaddingLabel.h" | |
@implementation PaddingLabel | |
- (id)initWithFrame:(CGRect)frame { | |
self = [super initWithFrame:frame]; | |
if (self) { | |
// Initialization code | |
} | |
return self; |
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 "ImageUtil.h" | |
@implementation ImageUtil | |
// 幅を元に、リサイズ画像の幅・高さを算出する | |
+ (CGSize)resizeFromWidth:(CGFloat)width imageSize:(CGSize)imageSize { | |
CGFloat s_x = imageSize.width / width; | |
CGFloat s_y = imageSize.height / (imageSize.height / s_x); | |
CGFloat scale = MAX(s_x, s_y); |