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
import statistics as stat | |
import math | |
def computeIntensity(list): | |
readings = [x * 1000 for x in list] | |
intensity = stat.mean(readings) - bg_intensity | |
return intensity | |
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
/* | |
Caeser's Cypher | |
implemented by your's truly :) | |
*/ | |
// since we are in a node environment, this is how we get input from the terminal | |
// note: i'm only get the first two arguments from the input array, excluding 'node app.js' | |
const [plainText, key] = process.argv.slice(2); | |
// makes sure plainText is in lowercase and trims |
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
/* | |
so uhm, up until about a week ago, my | |
defacto method for handling errors in an | |
async/await program-flow was to wrap my | |
entire code-block in a try/catch; performing | |
the operations in the `try {}` block and | |
handling any errors in the `catch(err) {}` block. | |
it worked well, but it didn't sit well with me |
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
const fs = require('fs').promises | |
const path = require('path') | |
const getData = async (dirName) => { | |
try { | |
const buffer = await fs.readFile(dirName) | |
const data = await JSON.parse(buffer) | |
return data | |
} catch (err) { | |
console.error(err) |