Hacker Newsnew | past | comments | ask | show | jobs | submit | ElevenFiftyNine's commentslogin

I'm skeptical of the 'common knowledge' research that suggests men are better at spatial reasoning than women due to brain differences [1], in fact we should be careful with any assumptions about differences in brain structure dictating behavioral differences. In the past people thought differences in weight of the brain indicated intelligence, and this is clearly nonsense; likewise modern observable sex differences [2] in the structure of the brain cannot be assumed to produce observable behavioral distinctions.

Although we like to segregate traits into masculine and feminine, overlap is incredibly strong on any given psychological task measured. Go ahead and peek at the effect size of any of the spatial reasoning differences studies and you'll see what I mean. Differences in effect size for height between men and women is about 1.4. Now if you look at the mental rotation task, the spatial task for which there is the largest effect size difference between men and women, you see an effect size of 0.56 [3]. There are a number of spatial reasoning tasks, not just the 3D transform task, and they all show smaller effect sizes, with many showing next to none. How about "tender mindedness", a typically female gendered trait? An effect size of -0.26 to -0.31 [4]. For almost all psychological characteristics your sex really is not an effective predictor. What about the structural differences? The 'sex differences in the structural connectome of the human brain' study showed an effect size of 0.48. Here's a fun tool to visualize effect sizes https://rpsychologist.com/d3/cohend/

Contingency also matters- if you say women are more X and men are more Y, which kind of men and in which situation are you referring? Women are better at cognitive empathy, men are better at mathematics, women are more anxious / neurotic and have lower self esteem are all questions that contain components of contingency. Women are only better at cognitive empathy than men when they've been reminded that they are [5], men aren't better at math across all American ethnicities [6], and women are more anxious / neurotic, except in certain countries where they're not (Japan, for example) or white American women are, while black women aren't [7].

There's a great quote from Cordelia Fine (who assembled a lot of this research) [8] on risk-taking, "So when we say instead, more accurately, not 'males are more risk taking', but some males, of some cultural backgrounds, from some populations are more risk taking, in some domains, in some contexts, but not others, than are some, but not all women. It no longer seemed so likely that we'll be able to compare the brains in women and men and from average differences between the groups identify the neural basis of greater male risk taking."

1. https://www.ncbi.nlm.nih.gov/pubmed/21876159 2. https://www.pnas.org/content/111/2/823 3. Voyer et al (1995) Psych Bull 4. Costa et al (2001) J. Pers Social Psych 5. Ickes et al (2000) Personal Relationships 6. Lindberg et al (2010) Psych Bull 7. Hyde (2014) Annual Review Psych 8. https://www.youtube.com/watch?v=mEX9Usqdurs


That's a solid set and will take you far. I did eventually start peppering in a few pattern matching command things that don't require much regex.

* `:g` Global command, executes an Ex command on every line that matches via the pattern `:[range]g/pattern/cmd`

One common use I have for using `:g` is to delete all lines that match or do not match a pattern, like when I've removed an attribute from some data structure and I want to quickly fix all my mock objects to remove the attribute: `:g/pattern/d`

To delete patterns that do not match, useful for debugging: `:g!/pattern/d`

* `:norm` this thing motivated me to use more of the movement commands like `A`, `o`, `D`, `f`, `cw`, and `ci`. Used `:[range]norm cmd`, it acts like each key in the command is run on every line in range. I usually use it with a selection, for example to add a comma to the end of every line in range with `A`, or insert at the end of line: `:norm A,`

Or to delete everything after the first period in a range using `f` to move to character, `l` to move after that character, and `D` to delete everything after cursor: `:norm f.lD`

The best part about learning these two is that they can be used together. If you want to insert `fmt.Println(err)` after every line (using `o`), but only on the lines matching `err != nil`: `:g/err != nil/norm ofmt.Println(err)`

Or two write `time.Now(),` only on lines which have `"created_at":` and only after the colon: `:g/created_at/norm f:lDA time.now(),`

And if you've got hashes with string keys and string values i.e. `"key": "value"`, you can upper case the string values matching `"pattern"` with: `g/pattern/norm 3f"lvi"~` On lines it matches it finds the third double quote with `3f"` then moves a character over with `l`, visual selects inside the double quote with `vi"` and uppercases the selection with `~`.

One regex trick that I end up using with `:g` pattern matching is `^\s*`. When you put it before any pattern then the pattern matches only if it has some amount of whitespace preceding it, and that whitespace extends from the beginning of the line to the start of the pattern. It is good for targeting code indented with whitespace.

Final thought, when you're typing your commands in norm and you've entered insert mode, you can issue the escape command with <Ctrl-v><Esc> which when done right should look like `^[` but will not actually be those characters.

http://vim.wikia.com/wiki/Power_of_g


Very interesting.

>To delete patterns that do not match, useful for debugging: `:g!/pattern/d`

This is something I would normally use something like grep to achieve, nice to know it exists in vim as well.

>* `:norm` this thing motivated me to use more of the movement commands like `A`, `o`, `D`, `f`, `cw`, and `ci`. Used `:[range]norm cmd`, it acts like each key in the command is run on every line in range. I usually use it with a selection, for example to add a comma to the end of every line in range with `A`, or insert at the end of line: `:norm A,`

In this specific case, I would tend to (maybe in gvim) run a replace on `\n` -> `,\n` to achieve this. That's kind of what I'm looking for in terms of string replacement.

The rest is certainly interesting, but for my work flow I like to generally keep things as simple as possible (bad memory). I've never found myself thinking "I wish there were more movement commands" for example.


Thanks for this. Been using vim for 3-4 years and I've never seen the norm command.

This is next months habbit I guess!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: