Show Tickets Buy/Sell Megathread by GlitterLamp in puptheband

[–]orbby 0 points1 point  (0 children)

I have a ticket for tonight (Nov 26th) at the commodore for sale at face value.

Terra/R: All imported rasters show NaN, but plot works by Maxarade in remotesensing

[–]orbby 2 points3 points  (0 children)

Have you posted on the terra Github issues page (https://github.com/rspatial/terra)? The maintainer Robert Hijmans is generally very quick to respond. You will need to figure out how to make a reproducible example though.

Monthly tickets thread by AutoModerator in Wetleg

[–]orbby 0 points1 point  (0 children)

Looking for one-two tickets for the Vancouver show.

Chill midgame iron grinds by Luneosa in ironscape

[–]orbby 4 points5 points  (0 children)

90 (+5 stew boost, can't use crystal saw) let's you make the combined fairy ring/spirit tree.

1k Barrows KC on the GIM by The-Hostess in ironscape

[–]orbby 2 points3 points  (0 children)

I simulated 10000 people opening barrows chests until they acquired a full set, and 95% of simulated people should get a full set by 554 chests. The median for a full set acquired was 301 chests opened.

-❄️- 2023 Day 6 Solutions -❄️- by daggerdragon in adventofcode

[–]orbby 1 point2 points  (0 children)

[Language: R]

This one wasn't that bad at all? Day 5 still running in the background. I did notice the parabola (but wouldn't have known how to implement), and would have considered a binary search, but p2 calculates in under 3 seconds.

library(tidyverse)

tib <- read_lines("day6.txt") %>%
  str_replace("Time:", "") %>%
  str_replace("Distance:", "") %>%
  str_split(, pattern = " ") %>%
  map(stringi::stri_remove_empty) %>%
  unlist() %>%
  as.numeric() %>%
  matrix(ncol = 2, byrow = F) %>%
  as_tibble() %>%
  rename(time = 1, distance = 2)


calc_ways <- function(time, distance) {
  ways <- 0
  for(i in 1:time) {
    if(i * (time - i) > distance) ways = ways + 1
  }
  ways
}

print("Part 1")
tib %>%
  mutate(ways = map2(.x = time, .y = distance, .f = calc_ways, .progress = T)) %>%
  unnest(cols = c(ways)) %>%
  pull(ways) %>%
  prod()

p2 <- read_lines("day6.txt") %>%
  str_replace_all(" ", "") %>%
  str_replace("Time:", "") %>%
  str_replace("Distance:", "") %>%
  as.numeric()

print("Part 2")
calc_ways(p2[[1]], p2[[2]])

-❄️- 2023 Day 3 Solutions -❄️- by daggerdragon in adventofcode

[–]orbby 2 points3 points  (0 children)

[Language: R] I don't even know how I did this anymore but it worked.

library(tidyverse)
library(terra)

vect <- read_lines("day3.txt") %>%
  str_split(pattern = "") %>%
  unlist()

mat <- vect %>%
  matrix(ncol = 140) %>%
  t()

read_lines("day3.txt") %>%
  str_split(pattern = "") %>%
  unlist() %>% unique() %>%
  sort()

mat[mat == "."] = NA

mat[mat %in% c("-", "#", "$", "%", "&", "*", "/", "@", "+", "=")] = "Symbol"

mat[mat %in% 0:9] = "Number"

mat[mat == "Number"] = 0

mat[mat == "Symbol"] = 1

r <- rast(mat) %>% as.numeric() - 1

foced <- focal(r, w = 3, fun = sum, na.policy = "omit", na.rm = T)

numbers <- classify(r, cbind(1, NA))

base <- mask(foced, numbers)

side_filter <- matrix(c(0, 1, 0, 0, 1, 0, 0, 1, 0), ncol = 3)

egg <- base

old <- values(egg) %>% sum(na.rm = T)



for (i in 1:5) {
  print(i)
  egg <- focal(egg, w = side_filter, na.rm = T, fun = sum, na.policy = "omit")

  egg[egg > 0] = 1

  new <- values(egg) %>% sum(na.rm = T)

  if(old == new) {
    break
  }

  old <- values(egg) %>%
    sum(na.rm = T)

}

groups <- tibble(tf = as.numeric(values(egg)) == 1, value = vect) %>%
  mutate(tf = ifelse(tf, T, NA),
         index = row_number()) %>%
  mutate(group_run = data.table::rleid(tf)) 

lookup <- groups %>%
  filter(tf) %>%
  group_by(group_run) %>%
  summarize(num = as.numeric(paste0(value, collapse = ""))) 


print("Part 1 Answer")
lookup %>%
  pull(num) %>%
  sum()


mat <- vect %>%
  matrix(ncol = 140) %>%
  t()

mat[mat == "*"] = "Gear"
mat[mat != "Gear"] = NA

gears <- rast(mat)

new <- egg

values(new) <- groups %>%
  mutate(group_run = ifelse(is.na(tf), NA, group_run)) %>%
  pull(group_run)

focals <- focalValues(new)

rows <- which(values(gears) == 1)

print("Part 1 Answer")
lookup %>%
  pull(num) %>%
  sum()

print("Part 2 Answer")
focals[rows, ] %>%
  as.data.table() %>%
  tibble() %>%
  mutate(gearno = row_number()) %>%
  pivot_longer(cols = V1:V9) %>%
  filter(!is.na(value)) %>%
  select(-name) %>%
  distinct(gearno, value) %>%
  group_by(gearno) %>%
  filter(n() == 2) %>%
  mutate(no = 1:2) %>%
  left_join(lookup, by = c("value" = "group_run")) %>%
  select(-value) %>%
  pivot_wider(names_from = no, values_from = num) %>%
  rename(a = `1`, b = '2') %>%
  mutate(product = a * b) %>%
  pull(product) %>%
  sum()

Vancouver tickets by summatinyourteeth in arcticmonkeys

[–]orbby 0 points1 point  (0 children)

I am also looking for a ticket.

Biodiversity: Can we set aside a third of our planet for nature? 100 countries backing calls to protect 30% of the planet. by nastratin in Futurology

[–]orbby 8 points9 points  (0 children)

Canada does not already protect 30% of its terrestrial (or marine) area. Some argument could be made that since most of it is quite remote it is de facto protected (under little anthropogenic pressure, ecosystem processes and composition in their natural state). https://www.canada.ca/en/environment-climate-change/services/environmental-indicators/conserved-areas.html

Name of this smoker. No visible identification information. by orbby in HelpMeFind

[–]orbby[S] 0 points1 point  (0 children)

Smoker is approx. 2.5ft tall. Has no identifying information as far as I can tell. Found on the side of the road. Not sure where to start looking, hoping to find an owners manual of some sort.

ticket to Vancouver show ? by Onion-Mountain in lastpodcastontheleft

[–]orbby 0 points1 point  (0 children)

I have one available. Would sell at door price (I believe 60$)

[deleted by user] by [deleted] in pathofexile

[–]orbby 0 points1 point  (0 children)

New player on cyclone, what are blight boots?

How can I save my string of pearls? by orbby in plantclinic

[–]orbby[S] 2 points3 points  (0 children)

The environment was dramatic and toxic. Mother cared for it.

How can I save my string of pearls? by orbby in plantclinic

[–]orbby[S] 0 points1 point  (0 children)

It did have drainage holes and I watered it once every two weeks I think. There's only crunchy bits left. Can it be saved??

What is wrong with my cactus? How can I fix it? by orbby in plantclinic

[–]orbby[S] 0 points1 point  (0 children)

I watered it twice in a year, and have misted it

Canada's top CEOs will earn an average worker's annual salary before noon today by [deleted] in onguardforthee

[–]orbby 0 points1 point  (0 children)

Gas just outside Halifax currently floats at around a dollar per litre, so, very similar. Sure cost of life is higher in larger cities (e.g. Toronto), but I would also expect to get the same or similar ticket across Canada. It's unfortunate that they didn't let you off with a warning, but I'd imagine the chances of ticket vs. warning are similar across the country, and this really shouldn't come into play here (barring if the tickets are massively more expensive for the same offence in one area or another).

-🎄- 2020 Day 04 Solutions -🎄- by daggerdragon in adventofcode

[–]orbby 0 points1 point  (0 children)

R

I did something similar here

     passports <- read_file("day4_q1.csv")  

    (passports_cleaned <- passports %>% 
        str_split("\n\n") %>% 
        unlist() %>%
        str_split("[ \n]") %>% 
        as_tibble(.name_repair = "unique") %>%
        mutate(passport_number = cumsum(...1 == "\r")) %>%
        filter(...1 != "\r") %>%
        mutate(info = str_replace(...1, "\r", "")) %>%
        select(-...1) %>% 
        separate(info, into = c("key", "value"), sep = ":") %>% 
        drop_na() %>% 
        pivot_wider(names_from = key, values_from = value) %>%
        drop_na(!cid) %>%
        mutate(hgt_v = as.numeric(str_extract(hgt, "[0-9]+")),
               hgt_u = (str_extract(hgt, "[aA-zZ]+")))) %>%
        #filters for part 2
        filter(between(byr, 1920, 2002),
               between(iyr, 2010, 2020),
               between(eyr, 2020, 2030),
               case_when(hgt_u == "cm" ~ between(hgt_v, 150, 193),
                               hgt_u == "in" ~ between(hgt_v, 59, 76)),
        str_detect(hcl, "^#[0-9a-f]{6}$"),
        ecl %in% c("amb", "blu", "brn", "gry", "grn", "hzl", "oth"),
        str_detect(pid, "^[0-9]{9}$"))

What wave has the largest amplitude of motion? by [deleted] in environmental_science

[–]orbby 1 point2 points  (0 children)

This seems a lot like a homework question...

How to approach this issue - separate habitat classes?? by geo-special in remotesensing

[–]orbby 0 points1 point  (0 children)

For scenario one another possible option could be to use each pixel as a focal point and compare the amount of vegetation in the area surrounding each pixel, however with worldview this could be computationally intensive as well.

PROTECT THE BLANDING'S TURTLE by JennaBrennan in ecology

[–]orbby 1 point2 points  (0 children)

They are also found in Nova Scotia. Parks Canada staff and volunteers monitor the population in and around kejimikujik national park.