This file contains hidden or 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
public class fibonacci | |
{ | |
public static void main(String[] args) | |
{ | |
System.out.println(fibonacciValue(5)); | |
} | |
public static int fibonacciValue(int fibonacciIndex) | |
{ | |
if(fibonacciIndex < 2) {return 1;} |
This file contains hidden or 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 random | |
while True: | |
decivalue = random.randrange(0,99) | |
binavalue = bin(decivalue)[2:] | |
answer = int(input("What is " + binavalue + " in base ten? ")) | |
if answer == decivalue: | |
print("..hooray! :D") |
This file contains hidden or 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 <sstream> | |
#include <iostream> | |
using namespace std; | |
int getGCD(int a, int b) | |
{ | |
if(a % b == 0) | |
{ | |
return b; | |
} |
This file contains hidden or 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 app = require("http").createServer(handler).listen(1337); | |
//var io = require("socket.io").listen(app, {log: false}); | |
var path = require("path"); | |
var url = require("url"); | |
var fs = require("fs"); | |
function handler(request, response) | |
{ | |
var action = "." + url.parse(request.url, true).pathname; |
This file contains hidden or 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
public class MergeSort | |
{ | |
public static void main(String[] args) | |
{ | |
int[] array = {57, 36, 13, 5, 24, 42, 68, 79}; | |
array = sort(array); | |
for(int num = 0; num < array.length; num++) | |
{ |
This file contains hidden or 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
<!DOCTYPE hmtl> | |
<html> | |
<head> | |
<style> | |
body | |
{ | |
margin:0px; | |
} | |
#partition |
This file contains hidden or 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 Square | |
{ | |
private: | |
const int size; | |
int* grid; | |
public: | |
Square() : size(4) {grid = new int[size * size];} | |
Square(int size) : size(size) {grid = new int[size * size];} | |
void setNode(int value, int x, int y) {grid[y * size + x] = value;} |
This file contains hidden or 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 kbdin = | |
{ | |
downbinded: new Object(), | |
upbinded: new Object(), | |
stroked: new Object(), | |
downbindKeystroke: function(keyCode, functionality) | |
{ | |
this.downbinded[keyCode] = functionality; | |
}, |
This file contains hidden or 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
public class Insortion | |
{ | |
public static void main(String[] args) | |
{ | |
char[] array = {'a', 'c', 'b', 'e', 'd'}; | |
insertionSort(array); | |
for(int i = 0; i < array.length; i++) {System.out.print(array[i]);} | |
} |
This file contains hidden or 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 mailer = require("nodemailer"); | |
var scheduler = require("node-schedule"); | |
scheduler.scheduleJob({hour: 0, minute: 0}, function() //runs this function every morning at midnight. | |
{ | |
var transport = mailer.createTransport("SMTP", {service: "gmail", auth: require("./gmail.auth.js")}); | |
var settings = { | |
from: "[email protected]", | |
to: "[email protected]", |
OlderNewer