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
int ExampleRunner::ex4_2_3() | |
{ | |
using namespace std; | |
vector<StudentInfo> students; | |
StudentInfo record; | |
string::size_type maxlen = 0; | |
// Read and store all the records, and find the length of the longets name | |
while (read(cin, record)) { | |
maxlen = max(maxlen, record.name.size()); |
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
int ExerciseRunner::ex5_10() | |
{ | |
// Write a program to find all the palindromes in a dictionary. | |
// Next find the longest one. | |
typedef std::vector<std::string> str_vec; | |
str_vec palindromes; | |
str_vec dict = {"civic", // x | |
"hello", | |
"zachary" | |
"deleveled",// x |
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
package main | |
import ( | |
"fmt" | |
) | |
func isPerfect(num uint64) { | |
sum := calcDiv(num) | |
if sum == num { | |
fmt.Println(num) |
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
throw: all goroutines are asleep - deadlock! | |
goroutine 1 [select]: | |
main.main() | |
/home/zachary/Dev/Go/perfect_numbers/main.go:31 +0x26f | |
goroutine 2 [syscall]: | |
created by runtime.main | |
/build/buildd/golang-1/src/pkg/runtime/proc.c:221 | |
exit status 2 |
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
g_list = [1, 2, 3] | |
class Test: | |
def testing(self): | |
print g_list | |
a = Test() | |
a.testing() |
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
node.js:201 | |
throw e; // process.nextTick error, or 'error' event on first tick | |
^ | |
Error: unrecognized option: -f | |
at OptionParser.parse (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/optparse.js:50:19) | |
at /usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:463:29 | |
at Object.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:53:5) | |
at Object.<anonymous> (/usr/local/lib/node_modules/coffee-script/bin/coffee:7:41) | |
at Module._compile (module.js:441:26) | |
at Object..js (module.js:459:10) |
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
Error: Forbidden | |
at Object.error (/home/zachary/node_modules/connect/lib/utils.js:43:13) | |
at Object.directory [as handle] (/home/zachary/node_modules/connect/lib/middleware/directory.js:73:52) | |
at next (/home/zachary/node_modules/connect/lib/proto.js:190:15) | |
at Function.handle (/home/zachary/node_modules/connect/lib/proto.js:198:3) | |
at Server.app (/home/zachary/node_modules/connect/lib/connect.js:66:31) | |
at Server.emit (events.js:70:17) | |
at HTTPParser.onIncoming (http.js:1610:12) | |
at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:91:29) | |
at Socket.ondata (http.js:1506:22) |
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
Browser error: | |
Uncaught TypeError: object is not a function melonJS-0.9.5.js:411 | |
Object.extend melonJS-0.9.5.js:411 | |
obj.newInstanceOf melonJS-0.9.5.js:4960 | |
api.addEntity melonJS-0.9.5.js:1326 | |
api.loadTMXLevel melonJS-0.9.5.js:1273 | |
obj.loadLevel melonJS-0.9.5.js:11212 | |
me.ScreenObject.extend.onResetEvent main.js:64 | |
me.ScreenObject.Object.extend.reset melonJS-0.9.5.js:1801 |
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
melonJS: 'tiles/Cliff_tileset_0.png' file for tileset 'Cliff_tileset_0' not found! melonJS-0.9.5.js:9303 | |
melonJS: 'tiles/graphics-tiles-waterflow.png' file for tileset 'graphics-tiles-waterflow' not found! melonJS-0.9.5.js:9303 | |
melonJS: 'tiles/desert_1_0_6.png' file for tileset 'desert_1_0_6' not found! melonJS-0.9.5.js:9303 | |
melonJS: 'tiles/ground_tiles.png' file for tileset 'ground_tiles' not found! melonJS-0.9.5.js:9303 | |
melonJS: 'tiles/object- layer_1.png' file for tileset 'object- layer_1' not found! melonJS-0.9.5.js:9303 | |
melonJS: '../metatiles32x32.png' file for tileset 'metatiles32x32' not found! melonJS-0.9.5.js:9303 |
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
// Bounds check | |
if(posX < 0) | |
posX = 0; | |
else if(posX > (screenW - boundX)) | |
posX = screenW - boundX; | |
if(posY < 0) | |
posY = 0; | |
else if(posY > (screenH - boundY)) | |
posY = screenH - boundY; |
OlderNewer