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
| Tuple<double, double> LinearLeastSquaresFit(List<Point> points) | |
| { | |
| double length = points.Count; | |
| double Sx = points.Sum(p=> p.X); | |
| double Sy = points.Sum(p => p.Y); | |
| double Sxx = points.Sum(p => Math.Pow(p.X,2)); | |
| double Sxy = points.Sum(p => p.X * p.Y); | |
| var a = (Sxy * length - Sx * Sy) / (Sxx * length - Sx * Sx); | |
| var b = (Sxy * Sx - Sy * Sxx) / (Sx * Sx - length * Sxx); |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Net; | |
| using System.Security.Cryptography; | |
| namespace PasswordGenerator | |
| { | |
| class Program | |
| { |
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
| <html> | |
| <head> | |
| <script> | |
| function getDictionary() { | |
| var wordDictionary = {}; | |
| document.getElementById("wordlist").value.trim().split("\n").forEach(line => { | |
| var tokens = line.split("\t"); | |
| wordDictionary[tokens[0]] = tokens[1]; | |
| }); | |
| return wordDictionary; |
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 get_revision(): | |
| try: | |
| with open('/proc/cpuinfo','r') as f: | |
| for line in f: | |
| if line.startswith('Revision'): | |
| return line.split(":")[1].strip() | |
| except: | |
| return None | |
| # sourced from: http://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/ |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Wallet worth estimator</title> | |
| <meta name="description" content="Small snippet of code for estimating worth of your crypto wallet"> | |
| <meta name="author" content="Michał Drzał - michal.drzal@gmail.com"> | |
| <meta name="version" content="0.1.1"> | |
| <script> | |
| var portfolio = (function() { | |
| function add(currency, amount, usdValue) { |
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
| for D in `find . -mindepth 1 -type d` | |
| do | |
| ffmpeg -i ${D}/img%05d.jpg -c:v libx264 -vf fps=25 ${D}.mp4 | |
| done | |
OlderNewer