I hereby claim:
- I am mhtocs on github.
- I am mhtocs (https://keybase.io/mhtocs) on keybase.
- I have a public key ASBpDm9BB_h-5nu6KndtKH1UL5SRcKpqpbpJHxa5vhYYAQo
To claim this, I am signing this object:
#[test] | |
fn test_trigram() { | |
let trigrams = trigram("Hello, wor杯ld!"); | |
assert_eq!( | |
trigrams, | |
vec![ | |
"hel", "ell", "llo", "lo,", "o, ", ", w", " wo", "wor", "or杯", "r杯l", "杯ld", "ld!" | |
] | |
); | |
} |
// SUPER-MARIO STATE MACHINE IN RUST | |
#[derive(Debug, PartialEq)] | |
enum State { | |
Mario, | |
SuperMario, | |
FireMario, | |
CapeMario, | |
} |
import React from "react"; | |
import ReactDOM from "react-dom"; | |
const App = () => { | |
const [counter, setCounter] = React.useState(0); | |
return ( | |
<div> | |
<h2>Counter: {counter}</h2> |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
function App() { | |
const [number1, setNumber1] = React.useState(); | |
const [number2, setNumber2] = React.useState(); | |
const [total, setTotal] = React.useState(0); | |
let calculateTotal = () => setTotal(number1 + number2); |
# bread | |
defmodule Game do | |
def play do | |
hints = "flour, water, yeast, bakery" | |
IO.puts "Hints: #{hints}" | |
guess = IO.gets "Guess the word: " | |
guess = String.trim guess | |
attempt guess | |
end |
I hereby claim:
To claim this, I am signing this object:
{ | |
"coc.preferences.formatOnSaveFiletypes": ["rust", "py", "yaml", "json"], | |
"python.linting.flake8Enabled": true, | |
"python.formatting.provider": "black" | |
} |
import math #import whatever | |
def list_callables(module): | |
all = [] | |
for k,v in module.__dict__.items(): | |
if callable(v): | |
try: | |
all.append(v.__name__) | |
except: |
import math | |
list_callables = lambda module : [ v.__name__ for k,v in module.__dict__.items() if callable(v)] | |
all_math_function = list_callables(math) #list_callables accepts a module name, the module (here math) must be imported already | |
print(all_math_function) |