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
# This is a very simple Python 2.7 implementation of the Information Set Monte Carlo Tree Search algorithm. | |
# The function ISMCTS(rootstate, itermax, verbose = False) is towards the bottom of the code. | |
# It aims to have the clearest and simplest possible code, and for the sake of clarity, the code | |
# is orders of magnitude less efficient than it could be made, particularly by using a | |
# state.GetRandomMove() or state.DoRandomRollout() function. | |
# | |
# An example GameState classes for Knockout Whist is included to give some idea of how you | |
# can write your own GameState to use ISMCTS in your hidden information game. | |
# | |
# Written by Peter Cowling, Edward Powley, Daniel Whitehouse (University of York, UK) September 2012 - August 2013. |
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 class ArrayListString{ | |
private String[] arr; | |
private int capacity; | |
private int size; | |
public ArrayListString() { | |
arr = new String[10]; | |
capacity = 10; | |
size = 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
// The Grid component allows an element to be located | |
// on a grid of tiles | |
Crafty.c('Grid', { | |
init: function() { | |
this.attr({ | |
w: Game.map_grid.tile.width, | |
h: Game.map_grid.tile.height | |
}); | |
}, |
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
var saveAs=saveAs||"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,n=function(){return e.URL||e.webkitURL||e},o=t.createElementNS("http://www.w3.org/1999/xhtml","a"),r="download"in o,i=function(n){var o=t.createEvent("MouseEvents");o.initMouseEvent("click",!0,!1,e,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(o)},a=e.webkitRequestFileSystem,c=e.requestFileSystem||a||e.mozRequestFileSystem,s=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},u="application/octet-stream",f=0,d=500,l=function(t){var o=function(){"string"==typeof t?n().revokeObjectURL(t):t.remove()};e.chrome?o():setTimeout(o,d)},v=function(e,t,n){t=[].concat(t);for(var o=t.length;o--;){var r=e["on"+t[o]];if("function"==typeof r)try{r.call(e,n||e)}catch(i){s(i)}}},p=function(t,s){var d,p,w,y=this,m=t.type,S=!1,h=function(){v(y,"writestart progress write writeen |
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 FunWithRandoms { | |
public static void main(String[] args) | |
{ | |
Random helloWorld = new Random(95945573131518); | |
for(int i =0 ;i< 6;i++) { //Hello, | |
System.out.print((char)testRandom.nextInt(maxChar)); | |
} |
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 http://www.rgagnon.com/javadetails/java-detect-if-xls-excel-file-contains-a-macro.html | |
public void processPOIFSReaderEvent(POIFSReaderEvent event) { | |
POIFSDocumentPath path = event.getPath(); | |
if (path.length() == 0) { | |
return; | |
} | |
String firstFolder = path.getComponent(0); | |
if(firstFolder.startsWith("Macro") || firstFolder.startsWith("_VBA")) { | |
macroDetected = true; | |
} |
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 ansible.runner | |
from ansible.inventory import Inventory | |
runner = ansible.runner.Runner( | |
module_name='shell', | |
module_args='nginx -s stop', | |
pattern='*', | |
sudo=True, | |
forks=10, |
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
The MIT License | |
Copyright © 2010-2016 three.js authors | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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
//make sure resolveBindings() returns true in the Resolution class | |
@Override | |
@SuppressWarnings("unchecked") | |
public boolean visit(MethodInvocation node) { | |
if (this.lscMethodInvocation != null) { | |
return false; | |
} | |
// for checking the type of the receiver. Although it is tempting to try | |
// node.resolveTypeBinding(), that refers to the return value. |
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
Local $id = InputBox("Participant ID", "Enter userid (e.g. P123)") | |
If $id <> "" Then | |
Run("C:\Program Files (x86)\ATOMI\ActivePresenter\ActivePresenter.exe") | |
WinWaitActive("ActivePresenter") | |
Send("^n") | |
Send($id) |