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
function doPost(e) { | |
var prop = PropertiesService.getScriptProperties().getProperties(); | |
const BOT_NAME = 'hunter'; | |
const BOT_ICON = 'http://drive.google.com/uc?export=view&id=' + prop.ICON_ID; | |
if (prop.VERIFY_TOKEN != e.parameter.token) { | |
throw new Error("invalid token."); | |
} |
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
function hunt() { | |
var prop = PropertiesService.getScriptProperties().getProperties(); | |
/* Load Spread Sheet */ | |
var sheet = SpreadsheetApp.openById(prop.SPREAD_SHEET_ID).getSheetByName(prop.SHEET_NAME); | |
var names = sheet.getRange(1, 1, prop.ROW_NUM, 2).getValues(); | |
Logger.log(names); | |
var unuseNames = names.filter( | |
function(row){ |
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
init by gas-hub, just delete this file. |
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
module Main where | |
import Data.Maybe (isJust) | |
import Text.Read (readMaybe) | |
import Control.Monad (join) | |
main :: IO () | |
main = do | |
let initState = (Nothing, GradesCounter 0 0 0 0) | |
_ <- doWhileM updateGrade (isJust . fst) initState |
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 Data.List (unfoldr) | |
import Data.Tuple (swap) | |
solve :: Int -> Int | |
solve n = head $ filter isMultiPalidromic [n..] | |
isMultiPalidromic :: Int -> Bool | |
isMultiPalidromic n = countTwo . filter isPalidromic' $ map (`convertRadix` n) [2..n] | |
isPalidromic :: [Int] -> Bool |
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 radix(d: Int, n: Int): List[Int] = { | |
def loop(x: Int): List[Int] = | |
if (x == 0) Nil else { val a = x / d; val b = x % d; b :: loop(a) } | |
loop(n).reverse | |
} | |
def isPalin(ns: List[Int]): Boolean = ns == ns.reverse | |
def isMultiPalin(n: Int): Boolean = | |
(2 to n).toList.map(radix(_, n)).count(xs => xs.length > 2 && isPalin(xs)) >= 2 |
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.io.BufferedReader; | |
import java.io.InputStreamReader; | |
import java.util.ArrayList; | |
import java.util.function.Consumer; | |
public class Main { | |
public static void main(String[] args) throws Exception { | |
System.out.println("hello!!!"); | |
CanvasObj obj = Graphics.builder() | |
.newGroup() |
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 Control.Applicative (liftA2) | |
import Data.List (unfoldr) | |
import Data.Tuple (swap) | |
solve :: Int -> [Int] | |
solve = fmap (radix10 3 . uncurry gen) . filter (uncurry check) | |
. zip [(2,0),(1,0),(0,1),(0,2)] . repeat . radix 3 | |
check :: (Int, Int) -> [Int] -> Bool | |
check (x,y) = liftA2 (&&) (not . null) ((== x) . head) . dropWhile (== y) . reverse |
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
# coding: utf-8 | |
import math | |
def is_int(n): | |
return n % 1 == 0 | |
def int_sqrt(n): | |
a = math.sqrt(n) | |
if is_int(a): | |
return int(a) |
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
module Main exposing (..) | |
import Html exposing (Html, a, div, span, text, textarea) | |
import Html.Attributes exposing (class, readonly, type_, value, wrap) | |
import Html.Events exposing (onClick) | |
import List.Extra as List | |
type alias Key = | |
{ view : String |