I hereby claim:
- I am soumyaray on github.
- I am soumyaray (https://keybase.io/soumyaray) on keybase.
- I have a public key whose fingerprint is 8542 E525 71ED 93CB 27C4 925E 15D9 AACD CE51 0594
To claim this, I am signing this object:
| ## Original method | |
| # def type_of_result(search_type, search) | |
| # search_hash = {} | |
| # search.each do |key, song| | |
| # case search_type | |
| # when 'tracks' then search_hash[song.track_name] = key | |
| # when 'artists' then search_hash[song.track_name] = song.artist_name | |
| # when 'albums' then search_hash[song.track_name] = song.album_name | |
| # when 'links' then search_hash[song.track_name] = song.track_link | |
| # when 'images' then search_hash[song.track_name] = song.imgs |
| scatter_play <- function() { | |
| # create a blank plot (use and then remove a fake point) | |
| points = data.frame(x=c(-99), y=c(-99)) | |
| plot(points, xlim=c(-5,50), ylim=c(-5,50)) | |
| points = data.frame(x=c(), y=c()) | |
| cat("Click on plot to add points; [Esc] to quit") | |
| repeat { | |
| location <- locator(1) | |
I hereby claim:
To claim this, I am signing this object:
| > pca | |
| Principal Components Analysis | |
| Call: principal(r = agg.data.clean, nfactors = 17, rotate = "none", | |
| scores = TRUE) | |
| Standardized loadings (pattern matrix) based upon correlation matrix | |
| PC1 PC2 PC3 PC4 PC5 PC6 PC7 PC8 PC9 PC10 PC11 PC12 PC13 PC14 PC15 PC16 PC17 | |
| alive.days 0.73 -0.35 0.10 -0.04 -0.16 -0.07 0.04 0.18 -0.04 -0.16 -0.13 0.30 0.03 0.01 0.35 -0.12 0.00 | |
| average.downloads -0.12 0.26 0.29 -0.18 0.28 -0.24 0.29 0.33 0.68 0.02 -0.11 -0.03 0.01 0.00 0.01 -0.01 0.00 | |
| total.commits 0.63 0.51 -0.26 0.08 -0.08 -0.06 -0.02 0.03 0.05 -0.17 0.09 -0.04 0.01 0.46 -0.02 0.01 0.00 | |
| weekday.commits.percentage 0.19 -0.22 -0.01 0.12 -0.32 0.35 -0.58 -0.07 0.55 0.17 0.06 0.02 0.01 0.00 0.01 0.01 0.00 |
| adj_test <- function() { | |
| a <- rnorm(n=100, mean=50, sd=10) | |
| b <- rnorm(n=100, mean=60, sd=5) | |
| c <- rnorm(n=100, mean=65, sd=2) | |
| abc <- c(a,b,c) | |
| data <- data.frame(key=c(1:300), vals=abc) | |
| boot_mean <- c() | |
| boot_mean_adj <- c() | |
| for(i in 1:2000) { |
| -----BEGIN PGP MESSAGE----- | |
| Version: GnuPG/MacGPG2 v2.0.27 | |
| Comment: GPGTools - http://gpgtools.org | |
| hQIMAywH8gmncouzARAAuSGA0bwr9lftD/S5yJCqv5Y0kmYUn8zXdgbl2W/dmJNR | |
| T/3KNo1iKyI127UfhZxwl8/U8qW9lx8hjzj2wllpIOpK6qJF36/5V3ISQHwjUIUx | |
| gr3TzKbNLKBuLzxLNWoKZLmMw/ESEeNtFTfr7LLgR9pIQBJyPMT6OhS4fFWxLcSB | |
| MRmKB7QtQ9vNEp1DNtUgbWrW2nrp2uokbUPLA8val7qfZGUs2c0Wr3zK8GtbP4iD | |
| Tihe4WolnApSdu4SHKE5Y324S0I6VMLtV1yx+lyNuFwLJ4wANZBB/c44ja/0dGDk | |
| 57BcAsCE96uqQC0EUkRmNTq40rxvO2rIyQNb56N6RHBYLVxKfrlB/cjoGNuzfGTY |
| require 'net/http' | |
| def sync_call(urls) | |
| urls.each do |u| | |
| u['content'] = Net::HTTP.get( URI.parse(u['link']) ) | |
| end | |
| end | |
| def async_call(urls) | |
| threads = urls.map do |u| |
| # Good documentation and examples: http://ruby-doc.org/core-2.1.1/ | |
| # Contents: | |
| # - EVERYTHING IS AN OBJECT | |
| # - OBJECT COMPARISON | |
| # - STRINGS | |
| # - ARRAYS | |
| # - HASH | |
| # - HASH AND ARRAY CONVERSION |
| require 'json' | |
| hstr = ["name=ytutyu&email=tyutyu&bio=tyutyu"] | |
| params = hstr[0].split(/\&/).reduce({}) do |all, p| | |
| name, value = p.split(/=/) | |
| all.merge(name => value) | |
| end.to_json |