Giter Club home page Giter Club logo

aoc's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @tjmahr

  • ๐Ÿ’ฌ I am a data scientist studying how children learn to talk.

  • ๐Ÿ‘€ I blog about stats and data occasionally on tjmahr.com.

aoc's People

Contributors

parmsam avatar tjmahr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

damarals parmsam

aoc's Issues

Undefined exports prevent installation

Love the idea for this package! I tried to install it, but remotes::install_github("tjmahr/aoc@main") throws an error because the NAMESPACE file tries to export functions that don't appear to exist in the package.

#> Error: package or namespace load failed for 'aoc' in namespaceExport(ns, exports):
#>  undefined exports: aoc_solutions, example_data_01, example_data_03, example_data_04, f01a, f01b, f03a, f03b, f04a, f04b
#> Error: loading failed
#> Execution halted
#> ERROR: loading failed
#> * removing '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/aoc'
#> Error: Failed to install 'aoc' from GitHub:
#>   (converted from warning) installation of package '/var/folders/48/xj0m1tkj5kd_smyyb1t9n2lc0000gq/T//Rtmpz1eVwg/file68f57353f76/aoc_0.0.0.9000.tar.gz' had non-zero exit status

update cli code

Some of the bullets produced by aoc and usethis are inconsistent.

#> โœ” Writing 'inst/input01.txt'
#> โ— Copy your problem input into this file
#> โœ” Writing 'tests/testthat/test-day01.R'
#> โ€ข Edit 'tests/testthat/test-day01.R'

Now that Windows can do UTF-8, we can probably do better?

Getting input using cookie does not work

Getting the input using the cookie does not work for me. It works when I use the following bash script from my terminal:

#!/bin/bash

# Fetches the input, prints to stdout and copies to clipboard.
# This gives both a quick overview of what the input looks like
# and makes it available on ctrl+v for use in the challenge.

if [ -z "$1" ]; then
  echo "Please provide a day number."
  echo "usage: $0 DAY"
  exit 1
fi

if [ -z "$AOC_SESSION" ]; then
  echo "No session token."
  exit 1
fi

URL="https://adventofcode.com/2021/day/$1/input"
curl $URL --cookie "session=$AOC_SESSION" -s | tee >(pbcopy)

source

So I know I have the right key. The aoc package is reading the cookie ok too, I think the problem for me is in the following lines:

h <- curl::new_handle()
h <- curl::handle_setheaders(h, Cookie = cookie)
r <- curl::curl_fetch_memory(url, handle = h)

I noticed the cookie is named "session" in the header of the website source and that's what the curl line from the script above uses. I tried changing the argument in curl::handle_setheaders to
cookie = cookie
session = cookie
Session = cookie

but none of these worked. I don't know if this problem is specific to me. Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.