Notes about online course "Lean How to Learn": https://www.coursera.org/learn/learning-how-to-learn.
Goal: learn easily and get less frustrated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(rjson) | |
| library(httr) | |
| library(ggplot2) | |
| library(scales) | |
| if (interactive()) { | |
| token <- readline(prompt="Enter Strava access token: ") | |
| activities <- GET("https://www.strava.com/", path = "api/v3/activities", | |
| query = list(access_token = token, per_page = 200)) | |
| activities <- content(activities, "text") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| query { | |
| repository(owner: "softwarevidal", name: "arthur") { | |
| pullRequests(states: [OPEN]) { | |
| totalCount | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.ArrayList; | |
| import java.util.List; | |
| import static java.lang.System.out; | |
| import static java.util.stream.Collectors.toList; | |
| import static java.util.stream.Collectors.toSet; | |
| import static java.util.stream.IntStream.range; | |
| public class WonderlandNumbers { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Data.List | |
| main = do | |
| putStrLn $ unwords $ map show $ filter isWonderNumber [100000..10000000] | |
| isWonderNumber :: Integer -> Bool | |
| isWonderNumber x = all (== digits x) (map digits (multiples x)) | |
| multiples :: Integer -> [Integer] | |
| multiples x = map (* x) [2..6] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import System.CPUTime | |
| fibo :: Int -> Int | |
| fibo n | |
| | n <= 1 = n | |
| | otherwise = fibo(n - 1) + fibo(n - 2) | |
| getCPUTimeDouble :: IO Double | |
| getCPUTimeDouble = do t <- System.CPUTime.getCPUTime; return ((fromInteger t) * 1e-12) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # CPU & mem usage per process (sampling) | |
| top # list processes | |
| top -h # list threads | |
| top -c # show full command line | |
| htop | |
| # CPU usage per CPU: | |
| mpstat -P ALL 1 | |
| # Processes (uptime, hierarchy, CPU usage, etc...): |