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
<?xml version="1.0" encoding="UTF-8" ?> | |
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> | |
<meta> | |
<author>Felix Boehm</author> | |
<documentationURL>http://feedic.com/</documentationURL> | |
<sampleQuery>select * from t where url="feedic.com"</sampleQuery> | |
</meta> | |
<bindings> | |
<select itemPath="" produces="XML"> | |
<urls> |
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
//just wrote this code for a project. how cool is that? | |
var reqURL = (function loopRegExps (url, regExps) { | |
for(var i in regExps){ | |
if(url.match(regExps[i][0])){ return (regExps[i][1] + "url=" + encodeURIcomponent(url))} | |
} | |
})(url, collectionA); | |
/*just some thoughts: | |
I would always use a named function, so it can call itself if needed. It's just a good practice. |
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
class clone{ | |
private int id; | |
public clone next; | |
public clone previous; | |
private boolean deleted = false; | |
public String value; | |
public int getId(){ | |
return this.id; |
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
/* | |
Simple feedparser | |
Based upon: | |
- https://raw.github.com/drudge/node-easyrss | |
*/ | |
var sax = require('./libs/sax'); | |
module.exports.streamParser = function(){ |
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
/* | |
Dependencies: | |
* Request (npm install request) | |
* readabilitySAX (npm install readabilitySAX) | |
* my htmlparser fork (https://github.com/FB55/node-htmlparser) | |
*/ | |
var request = require("request"), | |
readability = require("./readabilitySAX"); | |
Parser = require("node-htmlparser/lib/Parser.js"), |
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
class RSAencrypt{ | |
static public double m; | |
static public double publicK; | |
static private double privateK; | |
static private double nums = 6; | |
static{ | |
double p = ranPrime.genRanPrime(nums); | |
double q = ranPrime.genRanPrime(nums); | |
RSAencrypt.m = p * q; | |
double phi = (p-1) * (q - 1); |
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 inspect = function(obj, showHidden, depth, colors){ | |
var ctx = { | |
style: /*colors ? stylyze : */function(a){return a;}, //todo | |
seen: [] | |
}; | |
return formatValue(ctx, obj, 2); | |
} | |
var _reName = /(\n\s+)"([A-Za-z_$][\w$]*)"/g; | |
var _reValue = /\"([^\n]*)\"(?=,?\n)/g; |
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 java.util.Random; | |
class sort{ | |
public static void main(String[] a){ | |
Sorter[] list = {new InsertionSort(), new BubbleSort(), new QuickSort()}; | |
for(int i = 0; i < list.length; i++){ | |
sort.perform(list[i]); | |
} | |
} |
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(global){ | |
var MathUtils = { | |
powermod: function powermod(num, exp, mod){ | |
if(exp === 1) return num % mod; | |
if(exp & 1 === 1){ //odd | |
return (num * powermod(num, exp-1, mod)) % mod; | |
} | |
return Math.pow(powermod(num, exp/2, mod), 2) % mod; | |
}, |
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 Java, it is possible to drop the `this` in front of instance variables | |
*/ | |
class Example{ | |
private int foo; | |
public Example(int bar){ | |
foo = bar; | |
} | |
public int getFoo(){ | |
return foo; |
OlderNewer