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
/** | |
* A simple parallel program in JavaScript for the Rhino JavaScript engine. | |
*/ | |
// Set up the globals. | |
// | |
// While JavaScript allows all values and references in the global scope to be | |
// dynamic, only objects (JavaScript arrays and object natives) are mutable "in | |
// place". It is up to the programmer to keep the global namespace clear in a | |
// multithreaded environment. Because this is a simple program, I didn't do |
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
/** | |
* A simple parallel program in JavaScript for the Rhino JavaScript engine. | |
*/ | |
// Set up the globals. | |
// | |
// While JavaScript allows all values and references in the global scope to be | |
// dynamic, only objects (JavaScript arrays and object natives) are mutable "in | |
// place". It is up to the programmer to keep the global namespace clear in a | |
// multithreaded environment. Because this is a simple program, I didn't do |
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
/** | |
* URL encode an object. | |
*/ | |
exports.encode = function encode(data) { | |
var postData = [], value, property; | |
for(property in data) { | |
if (Object.prototype.hasOwnProperty.call(data, property)) { | |
value = ((typeof data[property] === "undefined") && "undefined" || |
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
%% | |
%% jkp.erl Was created for The Hudson Valley Programmers' Meetup | |
%% homework assignment #13. The requirement is to build a | |
%% rock -- paper -- scissors game between parallel processes. | |
%% http://hvprogrammers.org/homework-13.html | |
%% | |
%% It's also my first experiment with Erlang. | |
%% | |
%% [email protected] | |
%% |
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
// See comments below. | |
// This code sample and justification brought to you by | |
// Isaac Z. Schlueter, aka isaacs | |
// standard style | |
var a = "ape", | |
b = "bat", | |
c = "cat", | |
d = "dog", |
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
import logging | |
import time | |
import base_handler | |
class InsultServer(base_handler.BaseHandler): | |
def get(self): | |
# Log the user agent just for fun. | |
logging.info(self.user_agent_repr) | |
response = base_handler.Response( |
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
Copyright and License | |
--------------------- | |
copyright: (c) 2010 by Fireworks Technology Projects Inc. | |
Unless otherwise indicated, all source code is licensed under the MIT license. | |
See MIT-LICENSE for details. | |
And, unless otherwise indicated, all content, including written copy and images | |
but not including source code, is licensed under a Creative Commons | |
Attribution-ShareAlike 3.0 Unported license. All derivatives of this content |
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
# In a handler module. | |
class SomeHandler(BaseHandler): | |
def get(self): | |
if not self.user: | |
logging.warn('There is no user logged in. How aweful!') | |
return AuthenticationError | |
user_store = self.user.db |
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
<td height="60" align="right" valign="bottom" class="number"> | |
<a href="http://www.youtube.com/watch?v=3o9z37bMRME" target="_blank" | |
title="See Oridel on YouTube."> | |
<img border="0" height="55" src="/images/youtube_videos.png" width="78" | |
style="margin: 10px 10px 0 0;" /></a> | |
<a href="http://www.facebook.com/pages/Oridel-Anti-Aging-Moisturizers-and-Rejuvenating-Skin-Care-Products/133446643332279" target="_blank" title="Join Oridel on Facebook."> | |
<img border="0" height="55" src="/images/facebook.png" width="78" | |
style="margin: 10px 12px 0 0;" /></a> | |
</td> |
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
// ======================== | |
// CommonJS 2.0 environment | |
// ======================== | |
// | |
// (unratified draft specification) | |
// -------------------------------- | |
var env = (function (GLOBAL, undefined) { | |
'use strict'; |
OlderNewer