
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
// AppController.mm | |
// | |
// depthFormat: GL_DEPTH24_STENCIL8 | |
// | |
// ----------------------------------------------------------- | |
// CCSprite* sprite = CCSprite::create("HelloWorld.png"); | |
// this->addChild(sprite); | |
// sprite->setPosition(ccp(size.width / 2, size.height / 2)); | |
// sprite->setScale(0.5f); | |
// |
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
<?php | |
$imageurl = 'http://farm3.staticflickr.com/2844/9898243895_8ba3267d5a_o.jpg'; | |
$filename = 'tmp.jpg'; | |
$tmp = file_get_contents($imageurl); | |
if ($tmp) { | |
$fp = fopen($filename, 'w'); | |
fwrite($fp, $tmp); | |
fclose($fp); | |
} |

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
# -*- coding: utf-8 -*- | |
require 'rubygems' | |
require 'json/pure' | |
require 'net/https' | |
require 'uri' | |
require 'nokogiri' | |
require 'open-uri' | |
# Yahoo APIのAPI KEY | |
APIKEY = '' |
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
# -*- coding: utf-8 -*- | |
class Colors | |
def Colors.getArrayFromString(str, num) | |
colors = str.unpack(("a" + num.to_s) * (str.length / 2)) | |
colors = colors.collect{|color| | |
color.hex | |
} | |
return colors | |
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
void GB2ShapeCache::addFixturesToBodyForSprite(b2Body *body, const std::string &shape, CCSprite *sprite) { | |
std::map<std::string, BodyDef *>::iterator pos = shapeObjects.find(shape); | |
BodyDef *so = (*pos).second; | |
FixtureDef *fix = so->fixtures; | |
if ((sprite->getScaleX() == 1.0f) && (sprite->getScaleY() == 1.0f)) { | |
// simple case - so do not waste any energy on this | |
while(fix) { | |
body->CreateFixture(&fix->fixture); | |
fix = fix->next; |
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 OnDrag(Vector2 delta) { | |
Vector2 mousePoint = UICamera.currentCamera.ScreenToWorldPoint(UICamera.lastTouchPosition); | |
double radian = Math.Atan2(-1 * mousePoint.y, -1 * mousePoint.x); | |
moveX = (float)Math.Cos(radian) * 60; | |
moveY = (float)Math.Sin(radian) * 60; | |
} | |
void OnMouseUp() { | |
rigidbody.AddForce (moveX, moveY, 0); | |
} |
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
HTTP.Request request = new HTTP.Request( "get", "echo.php?data=test"); | |
request.synchronous = true; | |
request.Send((data) => { | |
print(data.response.Text); | |
JSONObject json = new JSONObject(data.response.Text); | |
int status = int.Parse(json.GetField("status").ToString()); | |
if (status == 200) { | |
JSONObject responseObj = json.GetField("response"); | |
print (AES.decrypt(responseObj.str)); | |
} else { |