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 python | |
import sys | |
import argparse | |
import os.path | |
from json import dump | |
from string import join | |
import time | |
import tempfile | |
import zipfile |
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 python | |
from libeuler import primes | |
if __name__ == '__main__': | |
p = primes(7100) | |
res = set() | |
for s in p: | |
for c in p: | |
for q in p: |
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 python | |
from libeuler import primes | |
if __name__ == '__main__': | |
p = primes(7100) | |
res = set() | |
for s in p: | |
for c in p: | |
for q in p: |
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
(defun factorial (n) | |
(defun i_factorial (n acc) | |
(if (= 0 n) | |
acc | |
(i_factorial (- n 1) (* acc n)))) | |
(i_factorial n 1)) | |
(defun print-factorial (n) | |
(format T "~D~%" (factorial n))) |
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
#lang racket | |
(define (factorial n) | |
(define (i_factorial n acc) | |
(if (= 0 n) | |
acc | |
(i_factorial (- n 1) (* n acc)))) | |
(i_factorial n 1)) | |
(map (lambda (n) |
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 python | |
from math import sqrt, floor | |
N = 100000000 | |
def is_palindrome(n): | |
return str(n) == str(n)[::-1] | |
def sum_list(n): |
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
(defun factorial (n) | |
(defun i_factorial (k acc) | |
(if (= 0 k) | |
acc | |
(i_factorial (- k 1) (* k acc)))) | |
(i_factorial n 1)) | |
(defun digits (n) | |
(defun i_digits (k acc) | |
(if (= 0 k) |
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
package main | |
import ( | |
"fmt" | |
"math/big" | |
"strings" | |
"strconv" | |
"time" | |
) |
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
function fetchInlineImage() { | |
var results = GmailApp.search("Subject: Inline Image Test"); | |
for(var i in results) { | |
var thread = results[i]; | |
messages = thread.getMessages(); | |
for(var j in messages) { | |
var msg = messages[j]; | |
var pattern = /<img.*src="([^"]*)"[^>]*>/; | |
var matches = pattern.exec(msg.getBody()); | |
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 point_on_arc(radius, start_x, start_y, end_x, end_y): | |
""" | |
Returns set of possible points on arc given by start and end points and | |
circle radius. | |
Return value is dictionary with keys 'center' and 'points'. | |
Center is associated with list of tuples with possible center coordinates. | |
Points is associated with list of tuples with possible points on the arc. | |
""" | |
X = start_x - end_x | |
Y = start_y - end_y |