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
/* source: http://aa.quae.nl/en/reken/zonpositie.html */ | |
// source: http://en.wikipedia.org/wiki/Julian_day | |
int julian_jdn(int year, int month, int day) { // convert Gregorian calendar date to Julian Day Number | |
int a = (14 - month) / 12; | |
int y = year + 4800 - a; | |
int m = month + 12 * a - 3; | |
return day + (153 * m + 2) / 5 + 365 * y + y / 4 - y / 100 + y / 400 - 32045; | |
} |
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 os, sys | |
from datetime import datetime | |
from zipfile import ZipFile | |
dir = '.' | |
out = 'dir.html' | |
if len(sys.argv) > 1: | |
dir = sys.argv[1] | |
if len(sys.argv) > 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
// Coding Challenge 130.3: Drawing with Fourier Transform and Epicycles | |
// Daniel Shiffman | |
// https://thecodingtrain.com/CodingChallenges/130.1-fourier-transform-drawing.html | |
// https://thecodingtrain.com/CodingChallenges/130.2-fourier-transform-drawing.html | |
// https://thecodingtrain.com/CodingChallenges/130.3-fourier-transform-drawing.html | |
// https://youtu.be/7_vKzcgpfvU | |
// https://editor.p5js.org/codingtrain/sketches/ldBlISrsQ | |
class Complex { | |
constructor(a, b) { |
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
# From: https://gist.github.com/hdf/42f0895a091b4a6a6d5d9eeb5cca8edf | |
import time, sys, os#, arrow | |
import numpy as np | |
import matplotlib | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
import matplotlib.colors as colors | |
import matplotlib.ticker as ticker | |
import json |
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 BigO(arr, arr3) { // Second array is optional | |
this.accumulator = 0; // Can be set here, or when calling ClosestMatch | |
/* function factorial(n, i) { | |
if (n > 171) // Overflow prevention | |
return Infinity; | |
if (typeof i == 'undefined') | |
i = 1; | |
if (n < i) | |
return 1; | |
if (n === i) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<title>Google Drive Demo</title> | |
</head> | |
<body> | |
<div style="position: absolute; top: 40%; left: 50%; transform: translate(-50%, -40%); text-align: center;"> | |
<a href="https://drive.google.com/open?id=1v1-ApluL9dCGx4znKVSXGKnBf4dFVGuv">Letöltés</a><br><br> |
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
// Inspired by: | |
// https://interviewing.io/recordings/Go-Microsoft-1 | |
function NthClosest(points, match, n) { | |
if (n < 1 || n > points.length || points[0].length != match.length) | |
return false; | |
function distance(p1, p2) { // Works in any dimensions. | |
let out = 0, d = 0, len = p1.length; | |
for (let i3 = 0; i3 < len; i3++) { |
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
Mi a programozás? | |
Megmondani a gépnek hogy mit csináljon. Nagyon szájbarágósan. (Angol tudás elengedhetetlen.) | |
Számomra a programozás olyan mint a legózás, csak olcsóbb, nem megy tönkre a kezed tőle és sose fogysz ki a darabokból. | |
Engem azért vonzott a programozás, mert olyan volt mint a varázslás. Mintha pár varázs szó beírásával életet lehelnél az élettelenbe. Viselkedést adhatsz egy tárgynak. És érdekelt, hogy a játékok, meg egyéb programok, amiket használtam hogyan működnek. Illetve az automatizáció is mindig vonzott, mert olyan mint a csalás. Ráveszed a világot, hogy dolgozzon helyetted. | |
Mihez van szükség hozzá? | |
Kell egy feladat. | |
A feladat határozza meg, hogy melyik a megfelelő eszköz (program nyelv) hozzá. | |
Számítógép internet eléréssel, Google, program nyelv dokumentáció/referencia, fejlesztői környezet: Visual Studio (Code) / Notepad++, idő, érdeklődés. |
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 bubbleSort(arr, cmp) { | |
var len = arr.length, tmp, n; | |
if (typeof cmp !== 'function') | |
cmp = function(a, b) { | |
return a > b; | |
}; | |
do { | |
n = 0; | |
for (var i = 1; i < len; i++) { | |
if (cmp(arr[i], arr[i-1])) continue; |
This file has been truncated, but you can view the full 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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>vis.js Plot</title> | |
<style> | |
body {font: 10pt arial;} | |
#mygraph>div {border: 1px solid black;} | |
#mygraph,#controlls {display: inline-block; vertical-align: top;} | |
</style> |