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
bool HelloWorld::init() | |
{ | |
/*has some code*/ | |
//sprite | |
auto sprite = Sprite::create("CloseNormal.png"); | |
this->addChild(sprite1); | |
//sprite change, setTexture | |
sprite->setTexture(Director::getInstance()->getTextureCache()->addImage("CloseNormal_changed.png")); | |
} |
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 HelloWorld::registerControllerListener() | |
{ | |
//create an evnetListenerController | |
_listener = EventListenerController::create(); | |
//bind onConneected event call function | |
_listener->onConnected = CC_CALLBACK_2(HelloWorld::onConnectController,this); | |
//bind disconnect event call function | |
_listener->onDisconnected = CC_CALLBACK_2(HelloWorld::onDisconnectedController,this); |
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
bool HelloWorld::init() | |
{ | |
/*has some code*/ | |
//CC_CALLBACK_0 function | |
auto sprite1 = Sprite::create("CloseNormal.png"); | |
auto callback = CCCallFunc::create(CC_CALLBACK_0(HelloWorld::myFunction1, this)); | |
sprite1->runAction(callback); | |
this->addChild(sprite1); |
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
var express = require('express'); | |
var router = express.Router(); | |
/* GET home page. */ | |
router.get('/', function(req, res, next) { | |
res.render('index', { title: 'Express' }); | |
}); | |
router.get('/sock',function(req,res,next){ | |
res.render('sockTest',{title:'socket Test'}) |
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
var express = require('express'); | |
var path = require('path'); | |
var favicon = require('serve-favicon'); | |
var logger = require('morgan'); | |
var cookieParser = require('cookie-parser'); | |
var bodyParser = require('body-parser'); | |
var session = require('express-session'); | |
var parseurl = require('parseurl'); | |
var routes = require('./routes/index'); |
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
#define TIMETEST 0 | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#if (TIMETEST) | |
#include <chrono>//for time check | |
#endif |
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
#define TIMETEST 0 | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#include <math.h> | |
#if (TIMETEST) | |
#include <chrono>//for time check |
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
#define TIMETEST 0 | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#if (TIMETEST) | |
#include <chrono>//for time check | |
#endif |
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
/* | |
pineoc, 2015-06-01 | |
week 14 network programming | |
select server | |
server code | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> |
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
/* | |
pineoc, 2015-05-18 | |
week 12 network programming | |
select echo server | |
server code | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> |