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.*; | |
class Person { | |
private String firstname; | |
private String secondname; | |
Person() { | |
//default constructor | |
} | |
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
/** | |
* Read in N integers and counts the number of triples | |
* that sum to exactly 0 | |
* | |
* @author Ian Duffy | |
* @version 0.0.1 | |
* | |
*/ | |
import java.util.*; |
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
#!/bin/bash | |
# Set up Samba4 as Domain Controller | |
# To be run on a fresh install of Ubuntu Server 12.04 with no optional packages selected save SSH | |
# architecture is x86_64, but only 1 place in this script does it matter. | |
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
foreach($vCard as $vCardPart) { | |
if(isset($vCardPart->n[0]['FirstName']) && isset($vCardPart->tel[0]['Value'])) { | |
$number = $vCardPart->tel[0]['Value']; | |
$number = str_replace("-","",$number); | |
$number = str_replace("00353","0",$number); | |
$number = str_replace("+353","0",$number); | |
if( | |
substr($number,0,3) == "086" || | |
substr($number,0,3) == "087" || | |
substr($number,0,3) == "083" || |
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
twitter:card | |
twitter:url | |
twitter:title | |
twitter:description | |
twitter:image | |
og:title | |
og:description | |
og:image | |
itemprop name | |
itemprop description |
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 HashSet<T> { | |
private LinkedSet<T>[] hashTable; | |
@SuppressWarnings("unchecked") | |
HashSet() { | |
hashTable = (LinkedSet<T>[])(new LinkedSet[1000]); | |
for(int i=0;i<hashTable.length;i++) { | |
hashTable[i] = new LinkedSet<T>(); | |
} | |
} |
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 LinkedSet<T> { | |
private class Node<T> { | |
private T item; | |
private Node<T> next; | |
Node(T item0, Node<T> next0) { | |
item = item0; | |
next = next0; | |
} | |
} |
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.*; | |
class TreeSet<T extends Comparable<T>> { | |
private static class Node<T> { | |
private T item; | |
private Node<T> left, right; | |
Node(T item0, Node<T> left0, Node<T> right0) { | |
item = item0; | |
left = left0; |
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
for(int rows=1; rows<(width+width); rows++) { | |
int numSpaces=Math.abs(width-rows); | |
if(numSpaces!=0) System.out.printf("%"+numSpaces+"s",""); | |
for(int stars=0;stars<width-numSpaces;stars++) System.out.print("* "); | |
System.out.println(); | |
} |
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 <iostream> | |
using namespace std; | |
int main() { | |
string blackSquare = "\033[0;37;40m \033[0m"; | |
string whiteSquare = "\033[0;37;47m \033[0m"; | |
string currentColor = blackSquare; | |
for(int rows=0;rows<8;rows++) { | |
for(int cols=0;cols<8;cols++) { |
OlderNewer