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
// Needs Guava to compile: | |
// | |
// compile group: 'com.google.guava', name: 'guava', version: '23.4-jre' | |
// | |
import com.google.common.io.LittleEndianDataInputStream; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.util.Arrays; | |
import java.util.List; |
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
public static void main(String[] args) throws IOException { | |
ObjectMapper mapper = new ObjectMapper(); | |
mapper.enable(SerializationFeature.INDENT_OUTPUT); | |
ObjectNode rootNode = (ObjectNode) | |
mapper.readTree(Main.class.getResource("toModify.json")); | |
ArrayNode listOfObjectsToModify = | |
(ArrayNode) rootNode.get("listOfObjectsToModify"); |
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
// see: https://archive.org/stream/byte-magazine-1981-06/1981_06_BYTE_06-06_Operating_Systems#page/n393/mode/2up | |
function word(x) { return (x & 0xffff); } | |
function wordstr(x) { return ('0000000000000000' + x.toString(16)).slice(-4); } | |
function divide(dividendWords, divisorWord, prevRest) { | |
var BITS_PER_WORD = 16; | |
var MAX_DIVISOR = (1 << 16) - 1; |
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 | |
const NKEYS = 4; | |
function arrayOfSize(size) { | |
var a = Array(size); | |
for (var i = 0; i < size; i += 1) | |
a[i] = null; |
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 | |
// board is single array | |
// [x, x, x, | |
// x, x, x, | |
// x, x, x] | |
// where x may be string 'X', 'O', or null | |
var readline = require('readline-sync'); |
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
using System; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Castle.Core; | |
using Castle.DynamicProxy; | |
using Castle.MicroKernel; |
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 f() { console.log(['(',f.toString(),')()'].join('')); })() |
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
using System; | |
public static class ObjectHelpers { | |
public static TResult WhenNotNull<T, TResult>(this T @object, Func<T,TResult> expression) | |
//where T: class | |
where TResult: class | |
{ | |
if (@object == null) | |
return null; | |
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
hciconfig hci0 reset | |
hciconfig hci0 -a | |
hciconfig hci0 noscan | |
sleep 1 | |
hciconfig hci0 noleadv | |
sleep 1 |
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
use TSQL2012; | |
if exists (select * from sys.schemas where name = 'gol') | |
begin | |
drop function gol.global_variable; | |
drop procedure gol.print_board; | |
drop procedure gol.init_board; | |
drop procedure gol.iteration; | |
drop procedure gol.iterate; |