View isort.fs
let insert (a: array<int>) i item =
let mutable i = i - 1
while i >= 0 && item < a.[i] do
a.[i + 1] <- a.[i]
i <- i - 1
a.[i + 1] <- item
let isort (a: array<int>) =
let a = Array.copy a
for i in 1 .. (a.Length - 1) do
View experiments.hs
ordered :: Int -> Int -> (Int, Int)
ordered x y
| x >= y = (x, y)
| otherwise = (y, x)
sumAndProduct :: Int -> Int -> (Int, Int)
sumAndProduct x y = (x + y, x * y)
shift :: ((Int, Int), Int) -> (Int, (Int, Int))
shift ((x, y), z) = (x, (y, z))
View HistoryContainer.cpp
#include "stdafx.h"
#include "HistoryContainer.h"
using namespace std;
void HistoryContainer::AddItem(string item)
{
history.push_back(item);
}
View bash2cmd.cpp
#include "stdafx.h"
#include <iostream>
#include <string>
#include <regex>
#include <fstream>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
using namespace std;
View bash.cmd.cpp
#include "stdafx.h"
#include <iostream>
#include <string>
#include <regex>
#include <fstream>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
using namespace std;
View rankclass.cpp
// rankclass.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
class Ranker
{
View tmpl.js
function tmpl(template, arr) {
if (template.constructor !== String) {
throw "Template must be a string!";
}
for (var i = 0; i < arr.length; i++) {
template = template.replace("%{" + i + "}%", arr[i]);
}
return $(template)[0];
}
View getscript.js
function getScript(url) {
var xml = new XMLHttpRequest();
xml.onreadystatechange = function () {
if (xml.readyState === 4 && xml.status === 200) {
eval(xml.responseText);
console.log("Evaluated the Javascript.");
}
}
xml.open("GET", url, true);
xml.send();
View Use
>>> User = new Class();
>>> User.addInstanceFunc("isUser", function(){console.log("Yeppers!")})
>>> userOne = new User();
>>> userOne.isUser();
Yeppers!
>>> User.addClassFunc("allUsers", function(){console.log("Just that guy...")})
>>> User.allUsers();
Just that guy...
>>> Parent = new Class();
>>> Parent.addInstanceFunc("noActualUse",function(){console.log("This has no use!")});
View searchinelements.js
/**
* @author Solomon Wise
*/
"use strict";
var domTools = {};
domTools.searchInElements = function (elem, pattern) {
if (pattern.constructor !== RegExp) {
throw "Pattern must be a RegExp";
}
if (elem.constructor !== String) {