Skip to content

Instantly share code, notes, and snippets.

View CodingBobby's full-sized avatar
👨‍🚀
Flying through the 11th dimension

CodingBobby CodingBobby

👨‍🚀
Flying through the 11th dimension
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CodingBobby
CodingBobby / colour_spaces.ipynb
Last active December 6, 2021 15:00
Colour Clipping in Gamut Conversion
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CodingBobby
CodingBobby / enthalpy_flash.ipynb
Last active April 23, 2020 20:09
Calculation of enthaply flash happening in a distillation column
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CodingBobby
CodingBobby / secondLowestValue.js
Last active December 19, 2019 20:33
Findet die zweitkleinste Zahl in einem zweidimensionalen Array.
let arr = [[1, 3, 4, 2], [5, 3, 2], [1, 1, 3, 7]]
let lowVal = arr[0][0]
let secLowVal = arr[0][0]
let preVal = arr[0][0]
for(let i=0; i<arr.length; i++) {
for(let j=0; j<arr[i].length; j++) {
// finden der kleinsten Zahl, die zuvor gefundene Zahl wird zwischengespeichert
if(arr[i][j] < lowVal) {
@CodingBobby
CodingBobby / excelReadynator.js
Created May 23, 2019 21:54
takes file name where you pasted an excel table, reformats it and saves it to a new .csv file
if (process.argv.length < 3) {
console.log('Usage: node ' + process.argv[1] + ' FILENAME')
process.exit(1)
}
const fs = require('fs')
let filename = process.argv[2]
fs.readFile(filename, 'utf8', function (err, data) {
if (err) throw err
@CodingBobby
CodingBobby / colMax.js
Last active May 12, 2018 16:19
returns array of a matrix collumn's max lengths
function colMax(mrx) {
let mLen = [];
let len = 0, lVal = true;
for(var m=0; m<mrx[0].length; m++) {
for(var n in mrx) {
let eLen = mrx[n][m].toString().length;
lVal = eLen ? lVal<eLen : lVal;
if(len<eLen)
len = eLen;
}
@CodingBobby
CodingBobby / makeString.js
Created May 12, 2018 15:57
returns string of given length from a given char
function makeString(len,cha) {
let str = "";
for(var i=0; i<len;i++)
str += cha;
return str;
}
// example:
// makeString(3, "foo") === "foofoofoo"
@CodingBobby
CodingBobby / GetWordsFromString.js
Created April 12, 2018 20:00
Basically a function which takes a string and gives back an array of all consisted words, takes numbers and underscores into account
//
// Made by Bob Walter in 2k18
// Version 1.2.0
//
// ––– INPUT ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– //
// input string
let str = "8fOo Bar8 fOo8bar fOo-Bar fOo_Bar 8.8 888 ,_?!";
if(cmd == 'top' || cmd == 'rank' || cmd == 'tr') { // top 10 users by given argument
cmdLog(cmd, args, msg);
let usrArr = sortArr(gidArrSrch(msg,args[0]),2);
let count = args[1] || 10;
if(usrArr.length < count)
count = usrArr.length;
console.log(`\n> Top ${count} on ${msg.guild.name} at ${args[0]}`);
const topList = () => {
let msg = "";
@CodingBobby
CodingBobby / PiCalc.c
Created March 17, 2018 22:42
calculates first 800 digits of pi
#include <stdio.h>
int main() {
int r[2800 + 1];
int i, k;
int b, d;
int c = 0;
for (i = 0; i < 2800; i++) {
r[i] = 2000;