I hereby claim:
- I am hglattergotz on github.
- I am hglattergotz (https://keybase.io/hglattergotz) on keybase.
- I have a public key whose fingerprint is 920F 89A9 D47D F82A D46D 8C16 F640 DC21 0505 3AF4
To claim this, I am signing this object:
<?xml version="1.0" encoding="UTF-8"?> | |
<ruleset name="Custom Naming Rules" | |
xmlns="http://pmd.sf.net/ruleset/1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" | |
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> | |
<description> | |
Customizations for the naming rule sets. Do not include the naming ruleset in the options. | |
This customization pulls all naming rules in and overrides some properties. | |
</description> |
### GIT-PROMPT.SH CONFIG | |
### | |
### lines commented-out with single '#' are default values | |
### lines commented-out with double '##' are examples | |
### | |
### NOTE: this is bash syntax - no spaces around "=" | |
########################################################### | |
# error_bell=off # sound terminal bell when command return code is not zero. (use setterm to set pitch and duration) |
// Part 2. | |
// Use this new function to refactor the code example. | |
// Some good test numbers: 524287, 9369319, 2147483647 (all primes) | |
// | |
// In other words, if you have this code: | |
// | |
// Function.prototype.cached = function(){ | |
// ? (what goes here?) | |
// } | |
// |
// Part 1. | |
// Implement a function prototype extension that caches function results for | |
// the same input arguments of a function with one parameter. | |
// | |
// For example: | |
// Make sin(1) have the result of Math.sin(1), but use a cached value | |
// for future calls. | |
Function.prototype.cached = function() { | |
var cache = {}, extendedFunction = this; |
function Car(make, color) { | |
return { | |
make: arguments[0], | |
color: arguments[1], | |
log : function() { | |
console.log("I'm a " + this.color + " " + this.make); | |
} | |
}; | |
} |
var car = { | |
make: 'Maserati', | |
color: 'silver' | |
} | |
function logCar() { | |
console.log("I'm a " + arguments[0].color + " " + arguments[0].make); | |
} | |
logCar(car); |
function isCreditCard( CC ) { | |
var sum, mul, l, digit, tproduct, i; | |
if (CC.length > 19) | |
return (false); | |
sum = 0; mul = 1; l = CC.length; | |
for (i = 0; i < l; i++) { | |
digit = CC.substring(l-i-1, l-i); |
var cdClosure = function() { | |
var index; | |
function log() { | |
console.log(index); | |
} | |
function iterate() { | |
log(); |
{ | |
"_links": { | |
"self": { | |
"href": "https://api.foxycart.com/users/1", | |
"title": "This User" | |
}, | |
"https://api.foxycart.com/rels/attributes": { | |
"href": "https://api.foxycart.com/users/1/attributes", | |
"title": "Attributes for This User" | |
}, |
I hereby claim:
To claim this, I am signing this object: