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
// rankclass.cpp : Defines the entry point for the console application. | |
// | |
#include "stdafx.h" | |
#include <iostream> | |
using namespace std; | |
class Ranker | |
{ |
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
#!/usr/bin/env ruby | |
require 'open-uri' | |
print "URL: " | |
add = gets | |
puts "Info from #{add}" | |
begin | |
open(add) do |f| | |
puts "Fetching images..." | |
puts "Fetching links..." | |
puts "Fetching div tags..." |
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
Numeric.class_eval do | |
def root(pow) | |
return self ** (1/pow.to_f) | |
end | |
end |
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
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 |
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
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)) |
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
#include "stdafx.h" | |
#include "HistoryContainer.h" | |
using namespace std; | |
void HistoryContainer::AddItem(string item) | |
{ | |
history.push_back(item); | |
} |
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
#include "stdafx.h" | |
#include <iostream> | |
#include <string> | |
#include <regex> | |
#include <fstream> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <conio.h> | |
using namespace std; |
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
#include "stdafx.h" | |
#include <iostream> | |
#include <string> | |
#include <regex> | |
#include <fstream> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <conio.h> | |
using namespace std; |
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 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]; | |
} |
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 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(); |
NewerOlder