Skip to content

Instantly share code, notes, and snippets.

View dionyziz's full-sized avatar
🐼

Dionysis Zindros dionyziz

🐼
View GitHub Profile
function simulate(initial_capital) {
let optimalIncome = -Infinity
let optimalConfiguration = null
// greedy simulator (suboptimal)
for (let miner of miners) {
for (let n = 0; ; ++n) {
let technologyCost = miner.cost * n
if (technologyCost > initialCapital) {
break
const EventEmitter = require('events')
class MarketWatcher extends EventEmitter {
constructor (name) {
super()
this.name = name
let i = 0
const K = 128
const GENESIS_DISTRIBUTION_SC = {}
const GENESIS_DISTRIBUTION_MC = {}
const GENESIS_TRUST_KEY = 'some key'
class BalanceKeeper {
constructor(initialBalances = {}) {
this.balances = initialBalances
}
getBalance(account) {
Ορισμός Gödel αριθμών.
Έστω μία συμβολοσειρά s στο {0, 1}*. Τότε ο αριθμός Godel g(s) είναι:
(α) g(s) = 1, αν s = ε
(β) g(s) = 10f + x + 1, αν s = xp όπου x στο {0, 1} και p στο {0, 1}^* και f είναι ο αριμός Godel της p
Ορίζω G = {x: ∃s ∊ {0, 1}*: x = g(s)}.
Έστω S = {x | δυαδικός με άπειρο μέγεθος}
function delay(interval) {
return new Promise((resolve, reject) => {
setTimeout(resolve, interval)
})
}
async function watch(expression, interval=200) {
while (true) {
let value = expression()
dionyziz@erdos ~/workspace/jsmess/third_party/emscripten-fastcomp/build (incoming) % ../configure --enable-optimized --disable-assertions --enable-targets=host,js
################################################################################
################################################################################
The LLVM project no longer supports building with configure & make.
Please migrate to the CMake-based build system.
For more information see: http://llvm.org/docs/CMake.html
################################################################################
################################################################################
#include <algorithm>
#include <cstdio>
#include <cassert>
#include <vector>
#include <cmath>
#include <iostream>
const double R_MAX = 0.0001;
using namespace std;
const mysql = require('mysql')
const connection = mysql.createConnection({
host: 'localhost',
user: 'root',
password: '',
database: 'fatcat'
})
connection.connect((err) => {
if (err) {
console.log('Error connecting to MySQL database: ' + err)
import pygame
from datetime import datetime
import math
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
DIGITAL_H = 100 # height of digital clock
W = 700 # screen width
NUM_COUNT = 4
with open('data.txt') as f:
lines = f.read().strip().split('\n')
N = len(lines)
data = []
for line in lines:
line = line.split(' ')
numbers = map(int, line)
data.append(numbers)