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
javascript: (function () { | |
var p1 = $('.player1-name:first').html(); var p2 = $('.player2-name:first').html(); var now = new Date(); var dt = (now.getYear()-100)+'.'+(now.getMonth()+1)+'.'+now.getDate()+' '+now.getHours()+'.'+getZero(now.getMinutes()); $('#download_notation').attr('download', p1+' vs '+p2+' '+dt+'.ptn'); var res=''; res += getHeader('Site', 'PlayTak.com'); res += getHeader('Date', '20'+(now.getYear()-100)+'.'+(now.getMonth()+1)+'.'+now.getDate()); res += getHeader('Player1', p1); res += getHeader('Player2', p2); res += getHeader('Size', board.size); res += getHeader('Result', board.result); res += '\r\n'; var count=1; $('#moveslist tr').each(function() { $('td', this).each(function() { var val = $(this).text(); res += val; if(count%3 === 0) res += '\r\n'; else res += ' '; count++; }) }); | |
window.open('http://ptn.ninja/' + encodeURIComponent(res),'_blank'); | |
}()); |
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
//JavaScript implementation of winding number algorithm to determine whether a point is inside a polygon | |
//Based on C++ implementation of wn_PnPoly() published on http://geomalgorithms.com/a03-_inclusion.html | |
function pointInPolygon(point, vs) { | |
var x = parseFloat(point[0]), y = parseFloat(point[1]); | |
var wn = 0; | |
for (var i = 0, j = vs.length - 1; i < vs.length; j = i++) { | |
var xi = parseFloat(vs[i][0]), yi = parseFloat(vs[i][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
public static void main(String[] args) { | |
HashMap<Integer, String> map = new HashMap<Integer, String>(); | |
map.put(3, "Fizz"); | |
map.put(5, "Buzz"); | |
map.put(7, "Pop"); | |
for (int i = 1; i <= 100; i++) { | |
boolean special = false; | |
for (int j : map.keySet()) { |