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
String.prototype.pad = function(i){ | |
var s = this; | |
while(s.length<i) s="0"+s; | |
return s; | |
} | |
Date.prototype.format = function(s){ | |
s = s.replace(/Y/g,this.getFullYear()); | |
s = s.replace(/M/g,(this.getMonth()+1).toString().pad(2)); | |
s = s.replace(/d/g,this.getDate().toString().pad(2)); |
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 node | |
var fs = require('fs'); | |
var help = "Usage : trash [-lhx] files...\n\t-l : list trashcan\n\t-x : cancel (files: timestamp)\n\t-h : help"; | |
var trash = process.env['HOME'] + "/.trash/"; | |
(function(argv, log, error) { | |
argv = require('optimist').parse(argv); | |
if (typeof argv.l === 'string') { |
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
case (int)instructions.Div://divides regB with regC and puts the result in regA | |
if (register[regB] == 0) | |
return -1; | |
register[regA] = register[regB] / register[regC]; | |
executionTime += 39; | |
break; |
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; | |
import java.util.Scanner; | |
public class SeedGenerator { | |
public static void main(String[] args) throws Exception{ | |
Scanner scanner = new Scanner(System.in); | |
System.out.print("Write a 6-byte string: "); | |
String string = scanner.next(); | |
byte[] b = string.getBytes("UTF-8"); |
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 X { | |
public static void main(String[] s) { | |
byte[] a = new byte[6], b = new byte[6]; | |
new Random(0x437950CAAB99L).nextBytes(a); | |
new Random(0xD6FD03B08D76L).nextBytes(b); | |
System.out.println(new String(a) + " " + new String(b)); | |
} | |
} |
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; | |
public class X{ | |
static{ | |
byte[] b = new byte[6]; | |
new Random(0xFE7147F36BBFL).nextBytes(b); | |
System.out.println(new String(b)); | |
} | |
} |
NewerOlder