Skip to content

Instantly share code, notes, and snippets.

View Saren-Arterius's full-sized avatar
💭
(^^)

Saren Arterius Saren-Arterius

💭
(^^)
View GitHub Profile
#!/usr/bin/env python3
from multiprocessing import Pool
from math import floor
from PIL import Image
from statistics import median_low
from os import listdir
from time import time
WIDTH = 3840
HEIGHT = 1634
#!/usr/bin/env python3
# from PIL import Image
import subprocess
import uinput
INPUT_EVENT_ID = 13
X_MAX = 1216
Y_MAX = 680
slots = [None] * 10
# 2, 3, 1, 6, 4, 5, 0
#!/usr/bin/env python3
from multiprocessing import Pool
from random import random
samples = 10000000
samples_mul = 8
states_repr = ['sleep', 'code', 'tg']
probs = [
[0.8, 0.1, 0.1],
[0.2, 0, 0.8],
#!/usr/bin/env python3
from multiprocessing import Pool
from random import randint
longstr = str(2 ** 1000000) * 1000 # 280mb string
searches = [str(randint(10 ** 8, 10 ** 9)) for i in range(10000)]
def search_fn(s):
return s, s in longstr
let trainExp = 7;
let datasetSize = 2000;
let printValidateEvery = 100;
let epoches = 1000;
let validateRatio = 0.2;
let accuracyThreshold = 0.99999;
let shouldPassAccuracyThresholdAtLeastEpoch = 300;
let network;
#!/bin/bash
# Copyright 2018 root@geeks-r-us.de
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#include <stdio.h>
int main(int argc, char const *argv[]) {
int cnt = 2;
for (int i = 1; i < 1000000000; i++) {
cnt += i % 2 == 0 ? -i : i;
}
printf("%d\n", cnt);
return 0;
#!/usr/bin/env python3
from constraint import *
N, magic = 3, 15
# N, magic = 4, 34
sq = N ** 2
def check(*a):
for j in range(N):
#
# Maintainer: Clemens Buchacher <drizzd@aon.at>
# Contributor: wangjiezhe <wangjiezhe AT yandex DOT com>
#
# You can use the newpkg script from
# https://github.com/drizzd/octave-forge-archlinux to automatically generate
# new octave-forge PKGBUILDs or update existing ones. Patches welcome.
#
_pack=fuzzy-logic-toolkit
@Saren-Arterius
Saren-Arterius / README.md
Created September 15, 2018 09:20 — forked from lifehome/README.md
Cloudflare API v4 Dynamic DNS Update in Bash

Cloudflare DDNS bash client with systemd

This is a bash script to act as a Cloudflare DDNS client, useful replacement for ddclient.

How to use?

  1. Put the cfupdater files to /usr/local/bin
  • If you are using IPv4 for A record, append -v4 to cfupdater in the following systemd service unit.
  • If you are using IPv6 for AAAA record, append -v6 to cfupdater in the following systemd service unit.
  • If you prefer a dual-stack record, append -dualstack to cfupdater in the following systemd service unit.
  1. chmod +x /usr/local/bin/cfupdater
  2. Create a systemd service unit at /etc/systemd/system/, the cfupdate.service is shown as an example.