nhaliday + howto   376

Skin turgor: MedlinePlus Medical Encyclopedia
To check for skin turgor, the health care provider grasps the skin between two fingers so that it is tented up. Commonly on the lower arm or abdomen is checked. The skin is held for a few seconds then released.

Skin with normal turgor snaps rapidly back to its normal position. Skin with poor turgor takes time to return to its normal position.
tip-of-tongue  prepping  fluid  embodied  trivia  survival  howto  medicine  safety  measurement 
19 days ago by nhaliday
exponential function - Feynman's Trick for Approximating $e^x$ - Mathematics Stack Exchange
1. e^2.3 ~ 10
2. e^.7 ~ 2
3. e^x ~ 1+x
e = 2.71828...

errors (absolute, relative):
1. +0.0258, 0.26%
2. -0.0138, -0.68%
3. 1 + x approximates e^x on [-.3, .3] with absolute error < .05, and relative error < 5.6% (3.7% for [0, .3]).
nibble  q-n-a  overflow  math  feynman  giants  mental-math  calculation  multiplicative  AMT  identity  objektbuch  explanation  howto  estimate  street-fighting  stories  approximation  data  trivia  nitty-gritty 
4 weeks ago by nhaliday
58 Bytes of CSS to look great nearly everywhere | Hacker News
Author mentions this took a long time to arrive at.
I recommend "Web Design in 4 Minutes" from the CSS guru behind Bulma:

https://jgthms.com/web-design-in-4-minutes/
[ed.: lottsa sensible criticism of the above in the comments]
https://news.ycombinator.com/item?id=12166687
hn  commentary  techtariat  design  form-design  howto  web  frontend  minimum-viable  efficiency  minimalism  parsimony  move-fast-(and-break-things)  tutorial  multi  mobile  init  advice 
5 weeks ago by nhaliday
online resources - How to write special set notation by hand? - Mathematics Stack Exchange
Your ℕN is “incorrect” in that a capital N in any serif font has the diagonal thickened, not the verticals. In fact, the rule (in Latin alphabet) is that negative slopes are thick, positive ones are thin. Verticals are sometimes thin, sometimes thick. Unique exception: Z. Just look in a newspaper at A, V, X, M, and N.
nibble  q-n-a  overflow  math  writing  notetaking  howto  pic  notation  trivia 
6 weeks ago by nhaliday
Shuffling - Wikipedia
The Gilbert–Shannon–Reeds model provides a mathematical model of the random outcomes of riffling, that has been shown experimentally to be a good fit to human shuffling[2] and that forms the basis for a recommendation that card decks be riffled seven times in order to randomize them thoroughly.[3] Later, mathematicians Lloyd M. Trefethen and Lloyd N. Trefethen authored a paper using a tweaked version of the Gilbert-Shannon-Reeds model showing that the minimum number of riffles for total randomization could also be 5, if the method of defining randomness is changed.[4][5]
nibble  tidbits  trivia  cocktail  wiki  reference  games  howto  random  models  math  applications  probability  math.CO  mixing  markov  sampling  best-practices  acm 
12 weeks ago by nhaliday
Learn to speak vim — verbs, nouns, and modifiers! - Yan Pritzker
learn some verbs: v (visual), c (change), d (delete), y (yank/copy). these are the most important. there are others
learn some modifiers: i (inside), a (around), t (till..finds a character), f (find..like till except including the char), / (search..find a string/regex)
learn some text objects: w (word), s (sentence) p (paragraph) b (block/parentheses), t (tag, works for html/xml) there are others
techtariat  howto  objektbuch  top-n  list  editors  composition-decomposition  DSL  lexical  atoms  yak-shaving  language 
august 2019 by nhaliday
syntax highlighting - List known filetypes - Vi and Vim Stack Exchange
Type :setfiletype (with a space afterwards), then press Ctrl-d.
q-n-a  stackex  editors  howto  list  pls  config 
august 2019 by nhaliday
How can lazy importing be implemented in Python? - Quora
The Mercurial revision control system has the most solid lazy import implementation I know of. Note well that it's licensed under the GPL, so you can't simply use that code in a project of your own.
- Bryan O'Sullivan
q-n-a  qra  programming  python  howto  examples  performance  tricks  time  latency-throughput  yak-shaving  expert-experience  hg  build-packaging  oss  property-rights  intellectual-property 
august 2019 by nhaliday
How to make a fast command line tool in Python
An overview of why Python programs tend to be slow to start running, and some techniques Bazaar uses to start quickly, such as lazy imports.
techtariat  presentation  howto  objektbuch  tutorial  python  programming  performance  tricks  time  latency-throughput  yak-shaving  build-packaging 
august 2019 by nhaliday
Anti-hash test. - Codeforces
- Thue-Morse sequence
- nice paper: http://www.mii.lt/olympiads_in_informatics/pdf/INFOL119.pdf
In general, polynomial string hashing is a useful technique in construction of efficient string algorithms. One simply needs to remember to carefully select the modulus M and the variable of the polynomial p depending on the application. A good rule of thumb is to pick both values as prime numbers with M as large as possible so that no integer overflow occurs and p being at least the size of the alphabet.
2.2. Upper Bound on M
[stuff about 32- and 64-bit integers]
2.3. Lower Bound on M
On the other side Mis bounded due to the well-known birthday paradox: if we consider a collection of m keys with m ≥ 1.2√M then the chance of a collision to occur within this collection is at least 50% (assuming that the distribution of fingerprints is close to uniform on the set of all strings). Thus if the birthday paradox applies then one needs to choose M=ω(m^2)to have a fair chance to avoid a collision. However, one should note that not always the birthday paradox applies. As a benchmark consider the following two problems.

I generally prefer to use Schwartz-Zippel to reason about collision probabilities w/ this kind of thing, eg, https://people.eecs.berkeley.edu/~sinclair/cs271/n3.pdf.

A good way to get more accurate results: just use multiple primes and the Chinese remainder theorem to get as large an M as you need w/o going beyond 64-bit arithmetic.

more on this: https://codeforces.com/blog/entry/60442
oly  oly-programming  gotchas  howto  hashing  algorithms  strings  random  best-practices  counterexample  multi  pdf  papers  nibble  examples  fields  polynomials  lecture-notes  yoga  probability  estimate  magnitude  hacker  adversarial  CAS  lattice  discrete 
august 2019 by nhaliday
The Compositional Nature of Vim - Ismail Badawi
https://medium.com/@mkozlows/why-atom-cant-replace-vim-433852f4b4d1
1976 was a good year for text editors. At MIT, Richard Stallman and Guy Steele wrote the first version of Emacs. And over at Berkeley, Bill Joy wrote vi (though it wouldn’t be called that for a few years yet).
It’s reductionist to say that these two editors were each built around one big idea, but what the hell, let’s be reductionist. Because what stands out today, looking at modern editors like Sublime Text and Atom, is how Emacs’ big idea has been thoroughly learned — and how vi’s big idea hasn’t.

Emacs and Extensibility
Vi and Composability
techtariat  editors  yak-shaving  productivity  workflow  composition-decomposition  metabuch  howto  syntax  lexical  objektbuch  degrees-of-freedom  flexibility  DSL  multi  integration-extension  org:med  atoms 
august 2019 by nhaliday
Call graph - Wikipedia
I've found both static and dynamic versions useful (former mostly when I don't want to go thru pain of compiling something)

best options AFAICT:

C/C++ and maybe Go: https://github.com/gperftools/gperftools
https://gperftools.github.io/gperftools/cpuprofile.html

static: https://github.com/Vermeille/clang-callgraph
https://stackoverflow.com/questions/5373714/how-to-generate-a-calling-graph-for-c-code
I had to go through some extra pain to get this to work:
- if you use Homebrew LLVM (that's slightly incompatible w/ macOS c++filt, make sure to pass -n flag)
- similarly macOS sed needs two extra backslashes for each escape of the angle brackets

another option: doxygen

Go: https://stackoverflow.com/questions/31362332/creating-call-graph-in-golang
both static and dynamic in one tool

Java: https://github.com/gousiosg/java-callgraph
both static and dynamic in one tool

Python:
https://github.com/gak/pycallgraph
more up-to-date forks: https://github.com/daneads/pycallgraph2 and https://github.com/YannLuo/pycallgraph
old docs: https://pycallgraph.readthedocs.io/en/master/

static: https://github.com/davidfraser/pyan

various: https://github.com/jrfonseca/gprof2dot

I believe all the dynamic tools listed here support weighting nodes and edges by CPU time/samples (inclusive and exclusive of descendants) and discrete calls. In the case of the gperftools and the Java option you probably have to parse the output to get the latter, tho.

IIRC Dtrace has probes for function entry/exit. So that's an option as well.
concept  wiki  reference  tools  devtools  graphs  trees  programming  code-dive  let-me-see  big-picture  libraries  software  recommendations  list  top-n  links  c(pp)  golang  python  javascript  jvm  stackex  q-n-a  howto  yak-shaving  visualization  dataviz  performance  structure  oss  osx  unix  linux  static-dynamic 
july 2019 by nhaliday
python - Executing multi-line statements in the one-line command-line? - Stack Overflow
you could do
> echo -e "import sys\nfor r in range(10): print 'rob'" | python
or w/out pipes:
> python -c "exec(\"import sys\nfor r in range(10): print 'rob'\")"
or
> (echo "import sys" ; echo "for r in range(10): print 'rob'") | python

[ed.: In fish
> python -c "import sys"\n"for r in range(10): print 'rob'"]
q-n-a  stackex  programming  yak-shaving  pls  python  howto  terminal  parsimony  syntax  gotchas 
july 2019 by nhaliday
How to work with GIT/SVN — good practices - Jakub Kułak - Medium
best part of this is the links to other guides
Commit Often, Perfect Later, Publish Once: https://sethrobertson.github.io/GitBestPractices/

My Favourite Git Commit: https://news.ycombinator.com/item?id=21289827
I use the following convention to start the subject of commit(posted by someone in a similar HN thread):
...
org:med  techtariat  tutorial  faq  guide  howto  workflow  devtools  best-practices  vcs  git  engineering  programming  multi  reference  org:junk  writing  technical-writing  hn  commentary  jargon  list  objektbuch  examples  analysis 
june 2019 by nhaliday
Regex cheatsheet
Many programs use regular expression to find & replace text. However, they tend to come with their own different flavor.

You can probably expect most modern software and programming languages to be using some variation of the Perl flavor, "PCRE"; however command-line tools (grep, less, ...) will often use the POSIX flavor (sometimes with an extended variant, e.g. egrep or sed -r). ViM also comes with its own syntax (a superset of what Vi accepts).

This cheatsheet lists the respective syntax of each flavor, and the software that uses it.

accidental complexity galore
techtariat  reference  cheatsheet  documentation  howto  yak-shaving  editors  strings  syntax  examples  crosstab  objektbuch  python  comparison  gotchas  tip-of-tongue  automata-languages  pls  trivia  properties  libraries  nitty-gritty  intricacy  degrees-of-freedom  DSL  programming 
june 2019 by nhaliday
macos - Converting cron to launchd - MAILTO - Stack Overflow
one way to convert to launchd is the lazy way (how i do it)

You pay $0.99 for Lingon from the app store; then you can just fill out a few fields and it makes the launchd...

otherwise: a launchd would look like this
q-n-a  stackex  howto  yak-shaving  osx  desktop  automation 
june 2019 by nhaliday
c++ - How to check if LLDB loaded debug symbols from shared libraries? - Stack Overflow
Now this question is also answered in official LDDB documentation in "Troubleshooting LLDB" section, please see "How do I check if I have debug symbols?": https://lldb.llvm.org/use/troubleshooting.html#how-do-i-check-if-i-have-debug-symbols It gives a slightly different approach, even though the approach from the accepted answer worked quite fine for me. – dying_sphynx Nov 3 '18 at 10:58

One fairly simple way to do it is:
(lldb) image lookup -vn <SomeFunctionNameThatShouldHaveDebugInfo>
q-n-a  stackex  programming  yak-shaving  gotchas  howto  debugging  build-packaging  llvm  multi  documentation 
may 2019 by nhaliday
package writing - Where do I start LaTeX programming? - TeX - LaTeX Stack Exchange
I think there are three categories which need to be mastered (perhaps not all in the same degree) in order to become comfortable around TeX programming:

1. TeX programming. That's very basic, it deals with expansion control, counters, scopes, basic looping constructs and so on.

2. TeX typesetting. That's on a higher level, it includes control over boxes, lines, glues, modes, and perhaps about 1000 parameters.

3. Macro packages like LaTeX.
q-n-a  stackex  programming  latex  howto  nitty-gritty  yak-shaving  links  list  recommendations  books  guide  DSL 
may 2019 by nhaliday
« earlier      
per page:    204080120160

bundles : meta

related tags

-_-  2016-election  abstraction  academia  accretion  accuracy  acm  acmtariat  additive  adversarial  advice  africa  age-generation  aging  agriculture  ai  akrasia  algebra  algorithms  allodium  AMT  analogy  analysis  anglo  anomie  anthropology  api  app  apple  applicability-prereqs  applications  approximation  arbitrage  article  ascetic  asia  assembly  atmosphere  atoms  attention  audio  automata-languages  automation  axioms  backup  barons  baseball  beeminder  benchmarks  best-practices  better-explained  bible  big-peeps  big-picture  bio  biohacking  bioinformatics  biomechanics  biotech  bitcoin  blog  books  brands  britain  browser  build-packaging  business  c(pp)  caching  calculation  calculator  california  caltech  canon  career  CAS  censorship  chart  cheatsheet  checking  checklists  chemistry  china  christianity  civic  clarity  class  client-server  clothing  cloud  coalitions  cocktail  cocoa  code-dive  code-organizing  collaboration  commentary  communication  community  comparison  compensation  compilers  composition-decomposition  compression  computer-memory  concept  concurrency  config  consumerism  contrarianism  cooking  cool  core-rats  correctness  correlation  corruption  cost-benefit  counterexample  cracker-prog  crime  critique  crosstab  crypto  cultural-dynamics  culture  current-events  cycles  data  data-science  data-structures  database  dataset  dataviz  dbs  debt  debugging  deep-learning  degrees-of-freedom  demographic-transition  demographics  density  dental  design  desktop  developing-world  devops  devtools  differential  diogenes  direct-indirect  direction  dirty-hands  discrete  discussion  disease  distribution  divide-and-conquer  diy  documentation  dotnet  drama  driving  dropbox  drugs  DSL  duplication  duty  dynamic  early-modern  earth  ecology  econometrics  ecosystem  editors  education  efficiency  elections  electromag  email  embodied  embodied-cognition  embodied-pack  embodied-street-fighting  endurance  engineering  ensembles  environment  error  error-handling  estimate  ethanol  europe  events  evolution  examples  exegesis-hermeneutics  exocortex  expectancy  expert-experience  explanation  exploratory  facebook  faq  farmers-and-foragers  fermi  fertility  feynman  fields  finance  fire  fitness  flexibility  fluid  flux-stasis  food  foreign-lang  form-design  forum  fourier  frameworks  free  frequency  frontend  frontier  functional  games  gbooks  gelman  gender  general-survey  generalization  genetics  genomics  geography  get-fit  giants  gilens-page  git  github  gnon  gnosis-logos  gnu  gnxp  golang  google  gotchas  government  grad-school  gradient-descent  graphs  grokkability-clarity  grugq  guide  gwern  h2o  hacker  hardware  hashing  haskell  health  hg  high-dimension  higher-ed  history  hmm  hn  homo-hetero  housing  howto  huge-data-the-biggest  human-bean  hypochondria  ide  ideas  identity  ideology  idk  IEEE  impro  incentives  info-dynamics  info-foraging  infographic  inhibition  init  integration-extension  intellectual-property  interdisciplinary  internet  interpretation  intersection  intersection-connectedness  intervention  interview-prep  intricacy  investing  ios  iron-age  islam  iteration-recursion  japan  jargon  javascript  jvm  keyboard  keyboards  language  latency-throughput  latent-variables  latex  lattice  law  leadership  lecture-notes  left-wing  legacy  let-me-see  letters  lexical  libraries  lifehack  lifestyle  linear-algebra  linear-models  linguistics  links  linux  lisp  list  literature  llvm  lol  long-short-run  long-term  low-hanging  machine-learning  madisonian  magnitude  maker  map-territory  maps  markets  markov  math  math.CA  math.CO  math.GR  math.NT  matrix-factorization  measure  measurement  medicine  medieval  mediterranean  memory-management  MENA  mena4  mental-math  meta:prediction  meta:science  metabuch  metal-to-virtual  methodology  metrics  migration  minimalism  minimum-viable  mixing  ML-MAP-E  mobile  models  money  mostly-modern  move-fast-(and-break-things)  multi  multiplicative  music  n-factor  navigation  necessity-sufficiency  network-structure  networking  news  nibble  nihil  nitty-gritty  nlp  nootropics  northeast  notation  notetaking  numerics  nutrition  objektbuch  ocaml-sml  ocr  oly  oly-programming  oop  opsec  optimization  orders  ORFE  org:anglo  org:bleg  org:com  org:data  org:edu  org:fin  org:gov  org:health  org:junk  org:lite  org:local  org:mag  org:med  org:ngo  org:sci  org:theos  organization  os  oss  osx  outcome-risk  outdoors  overflow  PAC  papers  parenting  parsimony  paste  pdf  people  performance  personal-finance  phd  philosophy  physics  pic  pinboard  piracy  plan9  planning  plots  pls  poast  policy  polisci  politics  poll  polynomials  population  postrat  pragmatic  prediction  prepping  presentation  primitivism  priors-posteriors  privacy  pro-rata  probability  problem-solving  productivity  programming  project  properties  property-rights  protestant-catholic  protocol-metadata  publishing  puzzles  python  q-n-a  qra  quantified-self  quantitative-qualitative  quixotic  quotes  r-lang  random  ranking  rant  ratty  rec-math  recommendations  recruiting  reddit  redistribution  reference  regression  regularization  regularizer  regulation  religion  repo  retention  retrofit  review  rhetoric  rhythm  right-wing  rigidity  robust  roots  rsc  running  russia  rust  safety  sampling  scala  scale  scaling-tech  scholar  sci-comp  science  scitariat  search  securities  security  sequential  shakespeare  short-circuit  similarity  sinosphere  sky  sleep  sleuthin  slides  social  social-science  society  sociology  software  space-complexity  spanish  spatial  speaking  speed  sports  spreading  spring-2015  spring-2019  stackex  stamina  startups  state  statesmen  static-dynamic  stats  store  stories  strategy  stream  street-fighting  strings  structure  study  studying  sub-super  sublinear  summary  survey  survival  sv  swimming  syntax  system-design  systems  tactics  taxes  tech  technical-writing  technology  techtariat  temperance  terminal  tetlock  the-classics  the-monster  the-south  the-trenches  the-west  the-world-is-just-atoms  theos  things  thinking  tidbits  time  time-use  tip-of-tongue  todo  tools  top-n  traces  track-record  tradecraft  tradeoffs  transitions  transportation  travel  trees  trends  tribalism  tricks  trivia  troll  tutorial  twitter  types  ubiquity  ui  unaffiliated  uncertainty  unintended-consequences  unit  universalism-particularism  unix  unsupervised  urban-rural  us-them  usa  vague  values  vcs  video  virtualization  visual-understanding  visualization  visuo  vitality  volo-avolo  vulgar  waves  web  webapp  weightlifting  white-paper  whole-partial-many  wiki  wire-guided  within-group  wkfly  wonkish  wordlessness  workflow  working-stiff  world  worse-is-better/the-right-thing  writing  x-sports  yak-shaving  yoga  🐸  👳  🔬  🖥 

Copy this bookmark:



description:


tags: