I think the most confusing thing that I have found about Ruby on Rails so far has been the transition from (trying to) write code myself to the use of the fabled "Rails Magic". So, to help my own understanding of a few core Ruby on Rails concepts, I have decided to write something on what I think is a CRITICAL topic... the idea of Convention over Configuration and why (in my mind) it is the most important thing that helps Rails become magic!
(This may be a topic that we cover in more detail in class but as I said, I'm writing this for my own understanding... I hope it helps someone else understand things too... Perhaps you can give me a hand when I'm crying next week!)
##Convention over configuration ###What does this "actually" mean...
Command-line gender analysis of New York Times articles, using wget and regex and highly simplified domain-specific methodology
This is a short proof-of-concept of how to use pattern matching and batch-downloading -- and, well, careful reading of New York Times style -- to perform a quickie gender analysis of New York Times articles by website section.
Sloppy analysis: Across virtually all of the nytimes.com section fronts, mentions of men outnumber women, except for Weddings (roughly 200 vs 190, Ms. vs Mr). Previous explanations for this phenomenon have generally boiled down to - more men are in the kinds of positions that get written about.
- See the full table of results here. Or look at the download log.
javascript:%28function%28%29%7Bvar%20n,walk=document.createTreeWalker%28document.body,NodeFilter.SHOW_TEXT,null,0%29%3Bwhile%28n=walk.nextNode%28%29%29%7Bif(n.textContent.trim%28%29.length>0)n.textContent=window.getComputedStyle(n.parentNode).fontSize%3B%7D%7D%29%28%29 |
by zach.dev
The early programmer struggles with the Javascript keyword this
. But understanding your this
context is easier than it seems.
This
is all about where a function is invoked.
Often, early programmers worry about where the function was declared. Perhaps the function was declared in a specific file or a particular object. Surely this changes it's this
!
Nope.
state | disagreement | |
---|---|---|
AK | 0.010694866 | |
AL | 0.018366074 | |
AR | 0.018639233 | |
AZ | 0.01110696 | |
CA | 0.007925225 | |
CO | 0.008944289 | |
CT | 0.008035614 | |
DC | 0.029248933 | |
DE | 0.014817887 |