This file contains hidden or 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 can_be_extended_to_solution(perm, n, m): | |
# Too many non diagonal squares | |
if perm.count(2) > m*m - n: | |
return False | |
new = len(perm) - 1 | |
# New square has no diagonal | |
if perm[new] == 2: | |
return True |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Snowplow test tracker</title> | |
<script> | |
; (function (p, l, o, w, i, n, g) { | |
if (!p[i]) { | |
p.GlobalSnowplowNamespace = p.GlobalSnowplowNamespace || []; | |
p.GlobalSnowplowNamespace.push(i); p[i] = function () { |
This file contains hidden or 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
{ | |
"type": "object", | |
"title": "dev_table", | |
"description": "A very simple custom context", | |
"properties": { | |
"affiliate_id": { | |
"type": "string" | |
}, | |
"c1": { | |
"type": "string" |
This file contains hidden or 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
// | |
// Miller-Rabin Algorithm | |
// | |
// Created by Hao Ling on 2014-03-19. | |
// Copyright (c) 2014 Hao Ling. All rights reserved. | |
// | |
#include <iostream> | |
#include "math.h" |
This file contains hidden or 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.handleApiRequest = function(request, sender, sendResponse) { | |
console.log(request) | |
if (!request || !request.endpoint) | |
return; | |
var response; | |
$.ajax({ | |
method: request.method, | |
url: 'https://admin.jumbleberry.com/jbx-api/' + request.method.toLowerCase() + request.endpoint | |
}).done(function(res) { |
This file contains hidden or 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 | |
$dict = file('basicWords'); | |
$file = 'domains.txt'; | |
$numOfDomains = 300; | |
$content = ''; | |
for ($i=0; $i < $numOfDomains; $i++) { | |
$content .= generateRandomDomain($dict) . "\n"; | |
} | |
file_put_contents($file, $content); |
This file contains hidden or 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
// Keep a copy of original runner | |
var originalRunner=Runner.prototype.gameOver | |
// Overwrite gameover function so we don't die | |
Runner.prototype.gameOver=function(){console.log("Its over when I say its over")} | |
// Super speed run | |
Runner.instance_.setSpeed(15000) | |
// Change back to original game when you are sick of cheating | |
Runner.prototype.gameOver=originalRunner |
This file contains hidden or 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 python3 | |
# The function maxDuffleBagValue() takes a list of cake type tuples | |
# and a weight capacity, it returns the maximum monetary value | |
# the duffel bag can hold. | |
# | |
# items are formated are formated as (weight, value) | |
# cap is the weight capacity | |
# isUnique indicates if there are multiple of the same item |
This file contains hidden or 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 python3 | |
# One chanllenge remains: | |
# 1. how to check if the download is completed and send a notification. | |
# Chanllenges solved: | |
# how to extract the magent link inside gamil from werid additional links. | |
# Write a program that checks an email acount every 15 minutes for | |
# any instructions you email it and executes those instructions automatically. |
NewerOlder