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
| config = { | |
| "A":"a", | |
| "B":"b", | |
| "C":"c" | |
| } | |
| config = '¥n'.join(map('='.join, config.iteritems()) | |
| # config= "A=a¥nB=b¥nC=c" |
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
| # まずモジュールのインポート | |
| import optparse | |
| # parserのメインオブジェクトの作成 | |
| parser = optparse.OptionParser() | |
| # 各オプションの設定追加 | |
| # この場合だと--debug引数を与えると後で取得する | |
| # optionsオブジェクトのdebugプロパティがTrueになる | |
| # helpは--helpを与えたときに各オプションで表示される |
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
| express sample -t ejs |
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 material = new THREE.MeshBasicMaterial( { | |
| color: 0x00ff00, | |
| wireframe: true , | |
| map : THREE.ImageUtils.loadTexture('/images/image.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
| cd /emptyDir | |
| touch .gitkeep |
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 projector = new THREE.Projector(); | |
| var mouseX = e.clientX -getElementPosition(renderer.domElement).left; | |
| var mouseY = e.clientY - getElementPosition(renderer.domElement).top; | |
| var x = (mouseX / renderer.domElement.width) * 2 - 1; | |
| var y = -(mouseY/renderer.domElement.height) * 2 + 1; | |
| var vector = new THREE.Vector3(x, y, 1); | |
| projector.unprojectVector(vector, camera); |
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 net = require('net'); | |
| var socket = new net.Socket(); | |
| socket.on('close',function(){ | |
| console.log('close'); | |
| process.nextTick(function(){ | |
| socket.connect(80, "www.google.com"); | |
| }); | |
| }); |
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
| ioctl(fd, FIOCLEX, NULL) | |
| = fcntl(fildes, F_SETFD, FD_CLOEXEC) | |
| ioctl(fd, FIONCLEX, NULL) | |
| = fcntl(fildes, F_SETFD, 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
| char **params; | |
| params = new char*[paramNum]; | |
| params[0] = const_cast<char*>("param1"); | |
| params[1] = const_cast<char*>("param2"); |
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
| $ ls /dev/tty.usb* | |
| /dev/tty.usbserial-00001014 |