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 tests whether the first point is east or west of the boundary | |
if (boundary[1] < point1[1]): | |
if (bearing < 30 and bearing > 230): | |
direction = 'Upstream' | |
else: | |
direction = 'Downstream' | |
else: | |
if (bearing < 270 and bearing > 120): | |
direction = 'Upstream' |
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
0.166898322139,59.9970928278,Downstream | |
0.00426075690575,54.9854929446,Downstream | |
0.0188063310586,220.337029895,Downstream | |
0.0365702125754,305.906672328,Downstream | |
0.0278539907523,316.560476554,Downstream | |
0.184274611676,307.479440894,Downstream | |
2.48424575672,306.973665439,Downstream | |
2.48128188418,309.37248466,Downstream | |
2.40545617578,270.465405831,Downstream | |
1.50952385385,313.037718076,Upstream |
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
['1', 0.16689832213912348, 59.99709282775342, 'East of boundary.'] | |
['1', 0.004260756905747937, 54.98549294460736, 'East of boundary.'] | |
['1', 0.018806331058633906, 220.33702989450754, 'East of boundary.'] | |
['1', 0.03657021257535287, 305.90667232816327, 'East of boundary.'] | |
['1', 0.02785399075226293, 316.5604765542264, 'East of boundary.'] | |
['1', 0.18427461167581766, 307.4794408936658, 'East of boundary.'] | |
['1', 2.484245756716924, 306.97366543906054, 'East of boundary.'] | |
['1', 2.4812818841756568, 309.3724846601186, 'East of boundary.'] | |
['1', 2.4054561757813238, 270.46540583116104, 'East of boundary.'] | |
['1', 1.5095238538513351, 313.03771807636167, 'East of boundary.'] |
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
λ node | |
> require("nodegit").Repository.open(".", function(err, repo) { console.log(err, repo); }); | |
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
def get_cruise_type_ticket_type_price_id_by_cruise_type_id_and_ticket_type_id(cruise_type_id, ticket_type_id): | |
with session_scope() as session: | |
result = session.execute(''' | |
SELECT id | |
FROM cruise_type_ticket_type | |
WHERE cruise_type_id = :cruise_type_id | |
AND ticket_type_id = :ticket_type_id | |
''', { | |
'cruise_type_id': cruise_type_id, | |
'ticket_type_id': ticket_type_id |
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 WebCam = { | |
capturing: false, | |
callbacks: [], | |
capture: function(cb) { | |
addCallback(cb); | |
_takePic(); | |
}, | |
addCallback(cb) { |
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
<?php | |
function base_26($num) | |
{ | |
$alpha = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'); | |
// Get the character | |
$i = $num%26; | |
// Get the rest of the characters "power/base" math | |
$num = ($num - $i)/26; |
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 | |
if [ !-d 'logs' ] | |
then | |
echo "No logs!" | |
exit 1 | |
fi | |
i=0 | |
count=$(ls logs | grep log | wc -l) | |
perc=$((100/$count)) |
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
<?php | |
$x = $y = 0; | |
$image = new Imagick('orig.jpg'); | |
//get_smallest_dimension | |
if ($image->getImageWidth() < $image->getImageHeight()) { | |
$x = 612; | |
} else { | |
$y = 612; | |
} |
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 | |
function uploadImage { | |
curl -s -F "image=@$1" -F "key=486690f872c678126a2c09a9e196ce1b" https://imgur.com/api/upload.xml | grep -E -o "<original_image>(.)*</original_image>" | grep -E -o "http://i.imgur.com/[^<]*" | |
} | |
import shot.png | |
url=`uploadImage "shot.png"` | |
echo $url | |
echo $url | xclip -selection c |
NewerOlder