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(challenge). | |
-export([ swap/3 ]). | |
% no effect on an empty list | |
swap([ ], _, _) -> [ ]; | |
% no effect on a list with a single item | |
swap([ H | [] ], _, _) -> [ H ]; | |
% no effect when both indexes are the same |
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
#!/bin/bash | |
srv=$1 | |
to=$2 | |
machine=$3 | |
loglinesinbody=50 | |
logfile="/var/log/upstart/$srv.log" | |
from="Upstart" |
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
console.log('experiment') | |
var intervalTime = 1000; | |
setInterval(runSomething, intervalTime); | |
var lastTime = Date.now();; | |
function runSomething() { | |
var now = Date.now(); | |
var elapsed = now - lastTime; | |
lastTime = now; |
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 @priv = {}; | |
function Animal() { | |
priv[this] = {}; | |
priv[this].walked = false; | |
} | |
Animal.prototype.walk = function walk() { | |
console.log('walking...') | |
priv[this].walked = 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
int partial_match(char *word_a, char *word_b, int len) { | |
int res, idx; | |
res = 0; | |
for(idx = 0; idx < len; ++idx) | |
if (word_a[idx] == word_b[idx]) | |
++res; | |
return res; | |
} |
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
public async Task<string> UsersLoginAsync(string login, string password) | |
{ | |
var url = "login.xml"; | |
var template = @" | |
<?xml version=""1.0"" encoding=""UTF-8""?> | |
<credentials> | |
<login>{0}</login> | |
<password>{1}</password> | |
</credentials> |
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 util = require('util'); | |
var _ = require('lodash'); | |
var liveconf = require('liveconf'); | |
var conf = liveconf('smootSpeak.json'); | |
module.exports = exports = function(client) { | |
var queues = [ | |
{ regex: /\bsanchez\b/i, text: 'btw I hear that mr Sanchez is an awesome fella' }, |
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
function randomizeLetters(string) { | |
var letters = string.split(''); | |
var result = ''; | |
while(letters.length) | |
result += letters.splice(Math.floor(Math.random() * letters.length), 1)[0]; | |
return result; | |
} | |
function jumbleWord(word) { |
This file has been truncated, but you can view the full file.
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
python tools/gyp_node -f make | |
make -C out BUILDTYPE=Release V=1 | |
cc '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_GNU_SOURCE' '-DHAVE_CONFIG_H' '-DCARES_STATICLIB' -I../deps/cares/include -I../deps/cares/src -I../deps/cares/config/darwin -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF /Users/Soarez/src/joyent/node/out/Release/.deps//Users/Soarez/src/joyent/node/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o.d.raw -c -o /Users/Soarez/src/joyent/node/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o ../deps/cares/src/ares_cancel.c | |
cc '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_GNU_SOURCE' '-DHAVE_CONFIG_H' '-DCARES_STATICLIB' -I../deps/cares/include -I../deps/cares/src -I../deps/cares/config/darwin -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF /Users/So |
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
make -C out BUILDTYPE=Release V=1 | |
LD_LIBRARY_PATH=/Users/Soarez/src/joyent/node/out/Release/lib.host:/Users/Soarez/src/joyent/node/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../.; mkdir -p /Users/Soarez/src/joyent/node/out/Release/obj/gen; python tools/js2c.py "/Users/Soarez/src/joyent/node/out/Release/obj/gen/node_natives.h" src/node.js lib/_debugger.js lib/_linklist.js lib/assert.js lib/buffer.js lib/buffer_ieee754.js lib/child_process.js lib/console.js lib/constants.js lib/crypto.js lib/cluster.js lib/dgram.js lib/dns.js lib/domain.js lib/events.js lib/freelist.js lib/fs.js lib/http.js lib/https.js lib/module.js lib/net.js lib/os.js lib/path.js lib/punycode.js lib/querystring.js lib/readline.js lib/repl.js lib/stream.js lib/string_decoder.js lib/sys.js lib/timers.js lib/tls.js lib/tty.js lib/url.js lib/util.js lib/vm.js lib/zlib.js ./config.gypi src/macros.py | |
c++ '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_DARWIN_USE_64_BIT_INODE=1' '-DNODE_WANT_INTERNALS=1' '-DARCH="x64 |