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([/* dependencies */], function(dep){ | |
return { | |
"test my module": function (test) { | |
// run 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
head | |
meta(charset="utf-8") | |
meta(http-equiv="X-UA-Compatible", content="IE=edge,chrome=1") | |
title= title | |
link(rel='stylesheet', href='/public/js/libs/nodeunit/nodeunit.css') | |
script(src="/public/js/libs/nodeunit/nodeunit.js") | |
script(data-main="/public/js/app-test", src="/public/js/libs/require/require.js") | |
<!-- nodeunit HTML --> |
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 Animal = { | |
legs: 4, | |
walk: function () { ... } | |
}; | |
var Cat = Object.create(Animal, { | |
nyan: { | |
value: function () { ... }, | |
configurable: true | |
}, |
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 * thread_start(void *arg) { | |
while (1) { | |
/* for each column. Only run columns the thread_num | |
is assigned to */ | |
for (column_count = thread_num; column_count < dim - 1; column_count+=threads) { | |
/* do thread work for data chunk */ | |
} | |
/* barrier */ | |
barrier_result = pthread_barrier_wait(barrier); |
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
// persons modules | |
// uses pd - http://raynos.org/blog/17/Improving-ES5-OO-with-pd | |
var Person = { | |
fullName: function _fullName() { | |
return this.firstName + " " + this.lastName; | |
}, | |
age: function _age() { | |
return (new Date).getYear() - this.birthDate.getYear(); | |
}, | |
saySomething: function _saySomething() { |
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 Post = require("../domain/post.js"), | |
PostModel = require("../data/post.js"), | |
View = require("../view/post.js"); | |
var authorized = [ | |
function _requireLogin(req, res, next) { | |
if (req.user) { | |
next(); | |
} else { | |
res.redirect('/login/'); |
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
double** relax(double** matrix, int dim, int threads, double precision) { | |
double** target; | |
double** source; | |
int bytes = dim * dim * sizeof(double); | |
/* copy matrix into source */ | |
source = (double**) malloc(bytes); | |
memcpy(source, matrix, bytes); | |
/* copy matrix into target */; |
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 * thread_start(void *arg) { | |
/* init vars */ | |
/* unpack arg */ | |
while (data->finished == 0) { | |
int barrier_result; | |
double** temp; | |
/* for each column. Only run columns the thread_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
void * thread_start(void *arg) { | |
RELAX_DATA* data; | |
THREAD_ARG* thread_arg; | |
int column_count; | |
int dim; | |
int thread_num; | |
int threads; | |
int precision; | |
clock_t before; |
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
function foo($) { | |
// code | |
} | |
foo(jQuery); |