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
part of worldcamera; | |
class Play extends State { | |
bool timerIsOn = false; | |
Sprite player; | |
Group<Sprite> bullets; | |
Timer bulletTimer; | |
load() { | |
game.resourceManager.addBitmapData('ship', 'playerShip1_blue.png'); |
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
part of spaceinvader; | |
class Play extends State { | |
int score; | |
Text scoreText; | |
Sprite player; | |
Group<Sprite> bullets; | |
Group<Ufo> ufos; |
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
part of worldcamera; | |
class Play extends State { | |
bool timerIsOn = false; | |
Sprite player; | |
Group<Sprite> bullets; | |
Timer bulletTimer; | |
load() { | |
game.resourceManager.addBitmapData('ship', 'playerShip1_blue.png'); |
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 game = new Phaser.Game(400, 490, Phaser.AUTO, 'gameDiv'); | |
var mainState = { | |
preload: function() { | |
game.stage.backgroundColor = '#71c5cf'; | |
game.load.image('bird', 'assets/notch.png'); | |
game.load.image('pipe', 'assets/dirt.png'); | |
}, | |
create: function() { | |
game.physics.startSystem(Phaser.Physics.ARCADE); | |
this.score = 0; |
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
module.exports = function(coordinates) { | |
var nodeList = ''; | |
var lats = []; | |
var lons = []; | |
var total = 0; | |
for(var i = 0; i < coordinates.length-1; ++i) { | |
lats.push(coordinates[i].geometry.location.lat); | |
lons.push(coordinates[i].geometry.location.lng); | |
} |
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 fs = require('fs') | |
var r = fs.readFileSync('read'); | |
r = r.toString(); | |
var rArray = []; | |
rArray = r.split(' '); | |
var amount = 0; | |
for(var i = 0; i < rArray.length; i++){ | |
if(rArray[i] == 'node.'){ | |
amount++; | |
console.log('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
This problem is the same as the previous but introduces the concept of modules. You will need to create two files to solve this. | |
Create a program that prints a list of files in a given directory, filtered by the extension of the files. The first argument is the directory name and the second argument is the extension filter. Print the list of files (one file per line) to the console. You must use asynchronous I/O. | |
You must write a module file to do most of the work. The module must export a single function that takes three arguments: the directory name, the filename extension string and a callback function, in that order. The filename extension argument must be the same as what was passed to your program. Don't turn it into a RegExp or prefix with "." or do anything except pass it to your module where you can do what you need to make your filter work. | |
The callback function must be called using the idiomatic node(err, data) convention. This convention stipulates that unless there's an error, the first argume |
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
window.setInterval(function() { | |
var elem = document.getElementById('data'); | |
elem.scrollTop = elem.scrollHeight; | |
}, 5000); |
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
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery.form/3.51/jquery.form.min.js"></script> | |
<title>File upload Node.</title> | |
</head> | |
<body> | |
<form id="uploadForm" | |
enctype="multipart/form-data" | |
action="/api/photo" |
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
17:55:50: OBS 0.8.3 (mac) | |
17:55:50: CPU Name: Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz | |
17:55:50: CPU Speed: 2600MHz | |
17:55:50: Physical Cores: 2, Logical Cores: 4 | |
17:55:50: Physical Memory: 8192MB Total | |
17:55:50: OS Name: Mac OS X (NSMACHOperatingSystem) | |
17:55:50: OS Version: Version 10.10 (Build 14A389) | |
17:55:50: Kernel Version: 14.0.0 | |
17:55:50: audio settings reset: | |
samples per sec: 44100 |
OlderNewer