10584
coding style - C++ code in header files - Stack Overflow
There is occasionally some merit to putting code in the header, this can allow more clever inlining by the compiler. But at the same time, it can destroy your compile times since all code has to be processed every time it is included by the compiler.

Finally, it is often annoying to have circular object relationships (sometimes desired) when all the code is the headers.

Bottom line, you were right, he is wrong.

EDIT: I have been thinking about your question. There is one case where what he says is true. templates. Many newer "modern" libraries such as boost make heavy use of templates and often are "header only." However, this should only be done when dealing with templates as it is the only way to do it when dealing with them.
q-n-a  stackex  programming  best-practices  c(pp)  pls  compilers  types 
4 hours ago
Comparing within- and between-family polygenic score prediction | bioRxiv
https://twitter.com/StuartJRitchie/status/1116074740475736066
https://archive.is/bQnjM
See this thread for our new study on polygenic scores within fraternal twin pairs! Main point: take extra care with polygenic scores for traits like IQ & education, because they're confounded by (what seem to be) socioeconomic status effects. Not so for traits like height & BMI.
The idea is that the parenting is caused by the parental genotype, so it gets (mis)classified as a genetic effect on the children. It's really another way of looking at "genetic nurture" - see the papers from last year.
study  bio  preprint  biodet  behavioral-gen  genetics  sib-study  GWAS  class  s-factor  iq  education  attention  disease  psychiatry  embodied  health  environmental-effects  parenting  regularizer  spearhead  multi  twitter  social  commentary  backup 
9 days ago
c - What REALLY happens when you don't free after malloc? - Stack Overflow
keep this stuff in mind when writing competition stuff, can usually just omit deletes/frees unless you're really running up against the memory limit:
Just about every modern operating system will recover all the allocated memory space after a program exits.

...

On the other hand, the similar admonition to close your files on exit has a much more concrete result - if you don't, the data you wrote to them might not get flushed, or if they're a temp file, they might not get deleted when you're done. Also, database handles should have their transactions committed and then closed when you're done with them. Similarly, if you're using an object oriented language like C++ or Objective C, not freeing an object when you're done with it will mean the destructor will never get called, and any resources the class is responsible might not get cleaned up.

--

I really consider this answer wrong.One should always deallocate resources after one is done with them, be it file handles/memory/mutexs. By having that habit, one will not make that sort of mistake when building servers. Some servers are expected to run 24x7. In those cases, any leak of any sort means that your server will eventually run out of that resource and hang/crash in some way. A short utility program, ya a leak isn't that bad. Any server, any leak is death. Do yourself a favor. Clean up after yourself. It's a good habit.

--

Allocation Myth 4: Non-garbage-collected programs should always deallocate all memory they allocate.

The Truth: Omitted deallocations in frequently executed code cause growing leaks. They are rarely acceptable. but Programs that retain most allocated memory until program exit often perform better without any intervening deallocation. Malloc is much easier to implement if there is no free.

In most cases, deallocating memory just before program exit is pointless. The OS will reclaim it anyway. Free will touch and page in the dead objects; the OS won't.

Consequence: Be careful with "leak detectors" that count allocations. Some "leaks" are good!
q-n-a  stackex  programming  memory-management  performance  systems  c(pp)  oly-programming 
9 days ago
macos - AutoHotkey Equivalent for OS X? - Ask Different
hammerspoon looks like best option in that it's scriptable (but probably less featureful than the paid "Keyboard Maestro")
q-n-a  stackex  apple  osx  desktop  yak-shaving  integration-extension  tools 
17 days ago
List of languages by total number of speakers - Wikipedia
- has both L1 (native speakers) and L2 (second-language speakers)
- I'm guessing most of Mandarin's L2 speakers are Chinese natives. Lots of dialects and such (Cantonese) within the country.
wiki  reference  data  list  top-n  ranking  population  scale  language  linguistics  anglo  china  asia  foreign-lang  objektbuch  india  MENA  europe  gallic  demographics 
4 weeks ago
Sci-Hub | The genetics of human fertility. Current Opinion in Psychology, 27, 41–45 | 10.1016/j.copsyc.2018.07.011
very short

Overall, there is a suggestion of two different reproductive strategies proving to be successful in modern Western societies: (1) a strategy associated with socially conservative values, including a high commitment to the bearing of children within marriage; and(2) a strategy associated with antisocial behavior, early sexual experimentation, a variety of sexual partners, low educational attainment, low commitment to marriage, haphazard pregnancies, and indifference to politics. This notion of distinct lifestyles characterized in common by relatively high fertility deserves further empirical and theoretical study.
pdf  piracy  study  fertility  biodet  behavioral-gen  genetics  genetic-correlation  iq  education  class  right-wing  politics  ideology  long-short-run  time-preference  strategy  planning  correlation  life-history  dysgenics  rot  personality  psychology  gender  gender-diff  fisher  giants  old-anglo  tradition  religion  psychiatry  disease  autism  👽  stress  variance-components 
4 weeks ago
Flammarion engraving - Wikipedia
A traveller puts his head under the edge of the firmament in the original (1888) printing of the Flammarion engraving.
art  classic  wiki  history  philosophy  science  enlightenment-renaissance-restoration-reformation  mystic  religion  christianity  eden-heaven  sky  myth  tip-of-tongue 
5 weeks ago
Catholics Similar to Mainstream on Abortion, Stem Cells
The data show that regular churchgoing non-Catholics also have very conservative positions on moral issues. In fact, on most of the issues tested, regular churchgoers who are not Catholic are more conservative (i.e., less likely to find a given practice morally acceptable) than Catholic churchgoers.
news  org:data  poll  data  values  religion  christianity  protestant-catholic  comparison  morality  gender  sex  sexuality  time  density  theos  pro-rata  frequency  demographics  abortion-contraception-embryo  sanctity-degradation 
6 weeks ago
Links 3/19: Linkguini | Slate Star Codex
How did the descendants of the Mayan Indians end up in the Eastern Orthodox Church?

Does Parental Quality Matter? Study using three sources of parental variation that are mostly immune to genetic confounding find that “the strong parent-child correlation in education is largely causal”. For example, “the parent-child correlation in education is stronger with the parent that spends more time with the child”.

Before and after pictures of tech leaders like Jeff Bezos, Elon Musk, and Sergey Brin suggest they’re taking supplemental testosterone. And though it may help them keep looking young, Palladium points out that there might be other effects from having some of our most powerful businessmen on a hormone that increases risk-taking and ambition. They ask whether the new availability of testosterone supplements is prolonging Silicon Valley businessmen’s “brash entrepreneur” phase well past the point where they would normally become mature respectable elders. But it also hints at an almost opposite take: average testosterone levels have been falling for decades, so at this point these businessmen would be the only “normal” (by 1950s standards) men out there, and everyone else would be unprecedently risk-averse and boring. Paging Peter Thiel and everyone else who takes about how things “just worked better” in Eisenhower’s day.

China’s SesameCredit social monitoring system, widely portrayed as dystopian, has an 80% approval rate in China (vs. 19% neutral and 1% disapproval). The researchers admit that although all data is confidential and they are not affiliated with the Chinese government, their participants might not believe that confidently enough to answer honestly.

I know how much you guys love attacking EAs for “pathological altruism” or whatever terms you’re using nowadays, so here’s an article where rationalist community member John Beshir describes his experience getting malaria on purpose to help researchers test a vaccine.

Some evidence against the theory that missing fathers cause earlier menarche.

John Nerst of EverythingStudies’ political compass.
ratty  yvain  ssc  links  multi  biodet  behavioral-gen  regularizer  causation  contrarianism  education  correlation  parenting  developmental  direct-indirect  time  religion  christianity  eastern-europe  russia  latin-america  other-xtian  endocrine  trends  malaise  stagnation  thiel  barons  tech  sv  business  rot  zeitgeist  outcome-risk  critique  environmental-effects  poll  china  asia  authoritarianism  alt-inst  sentiment  policy  n-factor  individualism-collectivism  pro-rata  technocracy  managerial-state  civil-liberty  effective-altruism  subculture  wtf  disease  parasites-microbiome  patho-altruism  self-interest  lol  africa  experiment  medicine  expression-survival  things  dimensionality  degrees-of-freedom  sex  composition-decomposition  analytical-holistic  systematic-ad-hoc  coordination  alignment  cooperate-defect  politics  coalitions  ideology  left-wing  right-wing  summary  exit-voice  redistribution  randy-ayndy  welfare-state 
6 weeks ago
“Give Anything” | An Algorithmic Lucidity
As a freshman on my high school's cross country team, our captain told me that to be a good runner, you needed to love pain.

I objected: a great runner could love to race, I said, and endure the pain only for the sake of competing and winning.

It's only fifteen years later (practically one foot in the grave), that I now see that I was wrong and he was right.
ratty  techtariat  aphorism  running  fitness  stoic  impetus  ends-means  biases  emotion  endurance 
6 weeks ago
Manifold – man·i·fold /ˈmanəˌfōld/ many and various.
https://infoproc.blogspot.com/2019/01/a-grand-experiment.html
Silicon Valley (Big Tech and startups and VC)
Financial Markets
Academia (Good, Bad, and Ugly)
The View from Europe
The View from Asia (Life in PRC? Fear and Loathing of PRC?)
Frontiers of Science (AI, Genomics, Physics, ...)
Frontiers of Rationality
The Billionaire Life
MMA / UFC
What Millennials think us old folks don't understand
True things that you are not allowed to say
Bubbles that are ready to pop?
Under-appreciated Genius?
Overrated Crap and Frauds?
podcast  audio  stream  hsu  scitariat  science  frontier  interview  physics  genetics  biotech  technology  bio  interdisciplinary  spearhead  multi  genomics  sv  tech  finance  academia  europe  EU  china  asia  wealth  class  fighting  age-generation  westminster  censorship  truth  cycles  economics  people  realness  arbitrage  subculture  ratty  rationality 
6 weeks ago
ellipsis - Why is the subject omitted in sentences like "Thought you'd never ask"? - English Language & Usage Stack Exchange
This is due to a phenomenon that occurs in intimate conversational spoken English called "Conversational Deletion". It was discussed and exemplified quite thoroughly in a 1974 PhD dissertation in linguistics at the University of Michigan that I had the honor of directing.

Thrasher, Randolph H. Jr. 1974. Shouldn't Ignore These Strings: A Study of Conversational Deletion, Ph.D. Dissertation, Linguistics, University of Michigan, Ann Arbor

...

"The phenomenon can be viewed as erosion of the beginning of sentences, deleting (some, but not all) articles, dummies, auxiliaries, possessives, conditional if, and [most relevantly for this discussion -jl] subject pronouns. But it only erodes up to a point, and only in some cases.

"Whatever is exposed (in sentence initial position) can be swept away. If erosion of the first element exposes another vulnerable element, this too may be eroded. The process continues until a hard (non-vulnerable) element is encountered." [ibidem p.9]
q-n-a  stackex  anglo  language  writing  speaking  linguistics  thesis 
7 weeks ago
OSF | Near and Far Transfer in Cognitive Training: A Second-Order Meta- Analysis
In Models 1 (k = 99) and 2 (k = 119), we investigated the impact of working-memory training on near-transfer (i.e., memory) and far-transfer (e.g., reasoning, speed, and language) measures, respectively, and whether it is mediated by the type of population. Model 3 (k = 233) extended Model 2 by adding six meta-analyses assessing the far-transfer effects of other cognitive-training programs (video-games, music, chess, and exergames). Model 1 showed that working-memory training does induce near transfer, and that the size of this effect is moderated by the type of population. By contrast, Models 2 and 3 highlighted that far-transfer effects are small or null.
study  preprint  psychology  cog-psych  intelligence  generalization  dimensionality  psych-architecture  intervention  enhancement  practice 
7 weeks ago
Verbal Edge: Borges & Buckley | Eamonn Fitzgerald: Rainy Day
At one point, Borges said that he found English “a far finer language” than Spanish and Buckley asked “Why?”

Borges: There are many reasons. Firstly, English is both a Germanic and a Latin language, those two registers.

...

And then there is another reason. And the reason is that I think that of all languages, English is the most physical. You can, for example, say “He loomed over.” You can’t very well say that in Spanish.

Buckley: Asomo?
Borges: No; they’re not exactly the same. And then, in English, you can do almost anything with verbs and prepositions. For example, to “laugh off,” to “dream away.” Those things can’t be said in Spanish.

http://www.oenewsletter.org/OEN/print.php/essays/toswell43_1/Array
J.L.B.: "You will say that it's easier for a Dane to study English than for a Spanish-speaking person to learn English or an Englishman Spanish; but I don't think this is true, because English is a Latin language as well as a Germanic one. At least half the English vocabulary is Latin. Remember that in English there are two words for every idea: one Saxon and one Latin. You can say 'Holy Ghost' or 'Holy Spirit,' 'sacred' or 'holy.' There's always a slight difference, but one that's very important for poetry, the difference between 'dark' and 'obscure' for instance, or 'regal' and 'kingly,' or 'fraternal' and 'brotherly.' In the English language almost al words representing abstract ideas come from Latin, and those for concrete ideas from Saxon, but there aren't so many concrete ideas." (P. 71) [2]

In his own words, then, Borges was fascinated by Old English and Old Norse.
interview  history  mostly-modern  language  foreign-lang  anglo  anglosphere  culture  literature  writing  mediterranean  latin-america  germanic  roots  comparison  quotes  flexibility  org:junk  multi  medieval  nordic  lexical  parallax 
7 weeks ago
Applications of computational learning theory in the cognitive sciences - Psychology & Neuroscience Stack Exchange
1. Gold's theorem on the unlearnability in the limit of certain sets of languages, among them context-free ones.

2. Ronald de Wolf's master's thesis on the impossibility to PAC-learn context-free languages.

The first made quiet a stir in the poverty-of-the-stimulus debate, and the second has been unnoticed by cognitive science.
q-n-a  stackex  psychology  cog-psych  learning  learning-theory  machine-learning  PAC  lower-bounds  no-go  language  linguistics  models  fall-2015 
7 weeks ago
Language Log » English or Mandarin as the World Language?
- writing system frequently mentioned as barrier
- also imprecision of Chinese might hurt its use for technical writing
- most predicting it won't (but English might be replaced by absence of lingua franca per Nicholas Ostler)
linguistics  language  foreign-lang  china  asia  anglo  world  trends  prediction  speculation  expert-experience  analytical-holistic  writing  network-structure  science  discussion  commentary  flux-stasis  nationalism-globalism 
8 weeks ago
soft question - What are good non-English languages for mathematicians to know? - MathOverflow
I'm with Deane here: I think learning foreign languages is not a very mathematically productive thing to do; of course, there are lots of good reasons to learn foreign languages, but doing mathematics is not one of them. Not only are there few modern mathematics papers written in languages other than English, but the primary other language they are written (French) in is pretty easy to read without actually knowing it.

Even though I've been to France several times, my spoken French mostly consists of "merci," "si vous plait," "d'accord" and some food words; I've still skimmed 100 page long papers in French without a lot of trouble.

If nothing else, think of reading a paper in French as a good opportunity to teach Google Translate some mathematical French.
q-n-a  overflow  math  academia  learning  foreign-lang  publishing  science  french  soft-question  math.AG  nibble  quixotic 
9 weeks ago
T. Greer on Twitter: "Genesis 1st half of Exodus Basic passages of the Deuteronomic Covenant Select scenes from Numbers-Judges Samuel I-II Job Ecclesiastes Proverbs Select Psalms Select passages of Isiah, Jeremiah, and Ezekiel Jonah 4 Gospels+Acts Romans
https://archive.is/YtwVb
I would pair letters from Paul with Flannery O'Connor's "A Good Man is Hard to Find."

I designed a hero's journey course that included Gilgamesh, Odyssey, and Gawain and the Green Knight. Before reading Gawain you'd read the Sermon on the Mount + few parts of gospels.
The idea with that last one being that Gawain was an attempt to make a hero who (unlike Odysseus) accorded with Christian ethics. As one of its discussion points, the class can debate over how well it actually did that.
...
So I would preface Lord of the Flies with a stylized account of Hobbes and Rosseau, and we would read a great deal of Genesis alongside LOTF.

Same approach was taken to Greece and Rome. Classical myths would be paired with poems from the 1600s-1900s that alluded to them.
...
Genesis
1st half of Exodus
Basic passages of the Deuteronomic Covenant
Select scenes from Numbers-Judges
Samuel I-II
Job
Ecclesiastes
Proverbs
Select Psalms
Select passages of Isiah, Jeremiah, and Ezekiel
Jonah
4 Gospels+Acts
Romans
1 Corinthians
Hebrews
Revelation
twitter  social  discussion  backup  literature  letters  reading  canon  the-classics  history  usa  europe  the-great-west-whale  religion  christianity  ideology  philosophy  ethics  medieval  china  asia  sinosphere  comparison  culture  civilization  roots  spreading 
10 weeks ago
A cross-language perspective on speech information rate
Figure 2.

English (IREN = 1.08) shows a higher Information Rate than Vietnamese (IRVI = 1). On the contrary, Japanese exhibits the lowest IRL value of the sample. Moreover, one can observe that several languages may reach very close IRL with different encoding strategies: Spanish is characterized by a fast rate of low-density syllables while Mandarin exhibits a 34% slower syllabic rate with syllables ‘denser’ by a factor of 49%. Finally, their Information Rates differ only by 4%.
pdf  study  language  foreign-lang  linguistics  pro-rata  bits  communication  efficiency  density  anglo  japan  asia  china  mediterranean  data 
10 weeks ago
Perseus Digital Library
This is actually really useful.

Features:
- Load English translation side-by-side if available.
- Click on any word and see the best guess for definition+inflection given context.
tools  reference  history  iron-age  mediterranean  the-classics  canon  foreign-lang  linguistics  database  quixotic  stoic  syntax  lexical  exocortex 
10 weeks ago
Vladimir Novakovski's answer to What financial advice would you give to a 21-year-old? - Quora
Learn economics and see that investment and consumption levels (as percentages) depend only marginally on age and existing net worth and mostly on your risk preferences and utility function.
qra  q-n-a  oly  advice  reflection  personal-finance  ORFE  outcome-risk  investing  time-preference  age-generation  dependence-independence  economics 
10 weeks ago
« earlier      

bundles
worrydreampeepspatternsparanoianoveltyngmysticmetametametamathinterwebinterlockinginitinfophysicspredictionproblem-solvingvulgarvirtuevaguetkthinkingtechietcsstarsspsoftscipubpropshackerguvnorbiznessacmacademeabstractcoordcrculturegrowthgood-vibesglobefrontierframefinengemojiembodiededecondismalitydiscipline

2016-election academia acm acmtariat advice ai analysis anglo anthropology aphorism article asia backup behavioral-gen big-peeps big-picture bio biodet books britain broad-econ business career chart china christianity civil-liberty civilization class cocktail cog-psych commentary comparison compensation concept conquest-empire contrarianism coordination correlation cost-benefit critique cultural-dynamics culture culture-war current-events data database demographics developing-world discussion disease distribution early-modern economics econotariat education egalitarianism-hierarchy embodied engineering error essay europe evolution explanation finance foreign-policy frontier gender genetics genomics gnon government growth-econ hanson health higher-ed history hmm hn howto ideas ideology inequality info-dynamics innovation institutions internet iq iron-age labor language law letters leviathan links list machine-learning math media medicine medieval mediterranean mena metabuch methodology microfoundations migration models money mostly-modern multi nationalism-globalism neuro news nibble objektbuch org:anglo org:biz org:bleg org:data org:edu org:lite org:mag org:nat org:ngo org:rec org:sci organization overflow pdf people philosophy physics policy polisci politics prediction programming psychology q-n-a qra race rationality ratty realness reference reflection regularizer religion research review rhetoric right-wing roots rot sapiens scale science scitariat sinosphere social social-psych society sociology software spearhead speculation ssc startups stats stories stream study stylized-facts summary tcs tech technology techtariat the-classics the-great-west-whale theos thinking tools top-n trends tribalism trivia trump twitter unaffiliated unit usa values video visualization war west-hunter wiki wonkish world yoga zeitgeist 🌞 🎩

Copy this bookmark:



description:


tags: