I hereby claim:
- I am wizjo on github.
- I am wizjo (https://keybase.io/wizjo) on keybase.
- I have a public key ASDBdrtu0w47RZ0gJO4phuruQ9eUpHJf1iV5IDItdc6fxwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| /usr/libexec/java_home -V |
D3’s default path interpolation is the same as its string interpolation: it finds numbers embedded in strings, and interpolates those numbers. So, the default behavior when interpolating two paths is like this:
M x0, y0 L x1, y1 L x2, y2 L x3, y3
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
M x0, y1 L x1, y2 L x2, y3 L x3, y4
For example, the first point ⟨x0,y0⟩ is interpolated to ⟨x0,y1⟩. Since x0 is the same, all you see are the y-values changing (see example)—you don't see the path slide to the left as intended.
What you want to happen here is something like this:
| # parse_tablenames.rb | |
| table_freq = {} | |
| IO.foreach("query_frequency.txt") do |line| | |
| next if line =~ /^query_id/ | |
| next if line.nil? | |
| regex = /(from|join)\s+([^\s\(]+)/i | |
| matches = line.scan(regex) | |
| cnt = line.match(/\d+$/)[0].to_i |
| SELECT sub2.period_id, sub2.time_id, sub2.network_id, COUNT(1) as cnt | |
| FROM ( | |
| SELECT sub1.period_id, | |
| sub1.time_id, | |
| sub1.network_id, | |
| SUM(sub1.pct_squared) AS dept_concentration_hhi | |
| FROM (SELECT sub.period_id, | |
| sub.time_id, | |
| sub.network_id, | |
| sub.job_type, |
| SELECT FIRST_VALUE(pkey_id) OVER(PARTITION BY cnt ORDER BY cnt DESC, pkey_id) | |
| AS first_id | |
| FROM ( | |
| SELECT pkey_id, | |
| COUNT(*) AS cnt | |
| FROM dimension_attribute_histories | |
| GROUP BY 1 | |
| )sub | |
| LIMIT 1 |
| select sub.query_id, sub.result, sub.sql, | |
| avg(sub.time_lapse) as avg_time, | |
| max(sub.started_at) as last_run_at, | |
| count(1) as cnt | |
| from | |
| ( | |
| select qe.query_id, | |
| qe.result, | |
| qe.started_at, | |
| (qe.finished_at - qe.started_at) time_lapse, |
| ## here's how you do a "SELECT col1,col2,col3,col4, count(1) AS cnt FROM ds_subs_less_table GROUP BY 1,2,3,4" thing in R ## | |
| # first, find out all the unique combos of col1,col2,col3,col4 | |
| subs.geo <- data.frame(unique(cbind( | |
| as.character(ds.subs.less$source_tz), as.character(ds.subs.less$source_country), | |
| as.character(ds.subs.less$target_tz), as.character(ds.subs.less$target_country) | |
| ))) | |
| names(subs.geo) <- c("source_tz", "source_country", "target_tz", "target_country") | |
| # next, figure out the frequency of each combo shows up |
| scl = 3 | |
| r = .3 ## roundness of the rectangles | |
| size(100*scl, 100*scl) | |
| w=10*scl | |
| mat1=[ | |
| [0,2,2,0,2,2,2,0], | |
| [1,0,0,1,2,0,0,2], | |
| [1,0,0,1,2,0,0,2], | |
| [1,0,0,1,2,0,0,2], |