« first day (2053 days earlier)      last day (1253 days later) » 

7:16 AM
Hello hello :-)
 
8:12 AM
aloha
after 40 years a famous Dutch christmas song has been translated to english by Todd Rundgren:
the text is a bit lugubrious
46 messages moved to Trash can
 
 
1 hour later…
9:24 AM
Recently, rud.is/rswitch has become available, which enables mac users to switch between versions of R. Is there anything like that (or virtual environments for Python) for other OSs, like linux?
Maybe a conda environment...
@zx8754 People went a bit overboard on that one.
 
9:59 AM
Hello
 
 
5 hours later…
3:01 PM
> R now provides a simple native pipe syntax ‘|>’ as well as a shorthand notation for creating functions, e.g. ‘(x) x + 1’ is parsed as ‘function(x) x + 1’. The pipe implementation as a syntax transformation was motivated by suggestions from Jim Hester and Lionel Henry. These features are experimental and may change prior to release.
 
3:21 PM
anyone want to post dt version? or dupe hammer it
https://stackoverflow.com/q/65141208/680068
@Jaap day 4 is for regex lovers... didn't enjoy it, was more about data cleaning rather than logic.
 
3:46 PM
 
4:34 PM
@zx8754 my solution for part one:
fields <- fread("field, description
byr, Birth Year
iyr, Issue Year
eyr, Expiration Year
hgt, Height
hcl, Hair Color
ecl, Eye Color
pid, Passport ID
cid, Country ID")

d4 <- scan(file = "day_4_data.txt",
           what = character(),
           blank.lines.skip = FALSE)

d4 <- data.table(id = cumsum(d4 == "")[d4 != ""],
                 do.call(rbind, strsplit(d4, ":")))
setnames(d4, 2:3, c("field","code"))

d4[, all(fields$field %in% field) | all(setdiff(fields$field, "cid") %in% field)
   , by = id][, sum(V1)]
 
 
1 hour later…
5:44 PM
@zx8754 the input data is different; I get other answers than you, but they are still correct
 
6:37 PM
@Jaap yes, data is per user, so people don't abuse other's solutions too much.
 

« first day (2053 days earlier)      last day (1253 days later) »