- list item #tag1
Enter function to be integrated for f(x): x**2 | |
Enter lower limit / bound of integration: 1 | |
<class 'str'> | |
<class 'int'> | |
You entered: 1 | |
Enter upper limit / bound of integration: 3 | |
You entered: 3 | |
Enter number of segments of integration: 20 | |
You entered: 20 | |
Result: 8.66666666666667 |
package main | |
import ( | |
"bufio" | |
"fmt" | |
"net" | |
"os" | |
"sync" | |
"github.com/alexflint/go-arg" |
const std = @import("std"); | |
pub fn main() !void { | |
const stdout = std.io.getStdOut().writer(); | |
const stdin = std.io.getStdIn().reader(); | |
const a = std.testing.allocator; | |
var buf = std.ArrayList(u8).init(a); | |
defer buf.deinit(); |
#!/usr/local/bin/python3 | |
import json | |
import sys | |
import os | |
fh = open("/tmp/out", "a") | |
env = dict(os.environ) | |
skip = ['HOME', 'TMPDIR', 'USER', 'LANG', 'PATH', 'PWD', 'SHLVL', 'SCRIPT_NAME' ] |
import requests | |
import json | |
from datetime import timedelta | |
from datetime import datetime | |
def calcAQI(Cp, Ih, Il, BPh, BPl): | |
a = (Ih - Il) | |
b = (BPh - BPl) |
Original revision: Sep 6, 2018
Most developers are familiar and proponents of the Unix Philosophy Unix philosophy - Wikipedia particularly, Write programs that do one thing and do it well. In practice though, the tooling just doesn’t exist to build useful network services which follow this approach.
Let’s take a lightweight WebSocket service. In 2018 we’ve no shortage of languages and frameworks - however largely incompatible with each other, to create the service.
I’m most familiar with the Python world so can break out the different frameworks in that world that you could use: twisted, eventlet, gevent, tornado, asyncio, sanic - and even though these use the same base language, using libraries designed to be used with one of these frameworks would likely be difficult to use with another framework. And then there are also a myriad of options with Java, Golang, Erlang, Rust.
$ jo foo=bar | \ | |
jq -r 'to_entries | map("\(.key)=\(.value | @sh)") | join(" ")'| \ | |
while read -r line ; do | |
eval "$line" | |
echo $foo | |
done | |
bar |
local levee = require("levee") | |
local _ = levee._ | |
local h = levee.Hub() | |
local r, w = h.io:pipe() | |
h:spawn(function() | |
w:write(("X"):rep(16*1024*1024)) | |
w:close() |
local levee = require("levee") | |
local _ = levee._ | |
local h = levee.Hub() | |
local r, w = h.io:pipe() | |
h:spawn(function() | |
for i = 1, 1000 do |