Run the code:
elixir dayx.exs input.txt
Run the tests:
elixir dayx.exs --test
| /usr/local/bin/fish -c "bash -c '. /Users/lukasz.sarnacki/.asdf/asdf.sh && asdf local ruby 2.6.2 && /Users/lukasz.sarnacki/.asdf/shims/bundle exec ruby /Users/lukasz.sarnacki/.asdf/installs/ruby/2.6.2/lib/ruby/gems/2.6.0/gems/ruby-debug-ide-0.8.0.beta24/bin/rdebug-ide --key-value --step-over-in-blocks --disable-int-handler --evaluation-timeout 10 --evaluation-control --time-limit 100 --memory-limit 0 --rubymine-protocol-extensions --port 52914 --host 0.0.0.0 --dispatcher-port 52915 -- /Users/lukasz.sarnacki/projects/payments/bin/rails console -- --prompt simple'" | |
| Fast Debugger (ruby-debug-ide 0.8.0.beta24, debase 0.3.0.beta34, file filtering is supported, block breakpoints supported, smart steps supported, obtaining return values supported, partial obtaining of instance variables supported) listens on 0.0.0.0:52914 | |
| Uncaught exception: uninitialized constant Dry::Events |
Run the code:
elixir dayx.exs input.txt
Run the tests:
elixir dayx.exs --test
| 2018-12-04 06:46:50 install linux-modules-4.15.0-42-generic:amd64 <none> 4.15.0-42.45 | |
| 2018-12-04 06:46:51 install linux-image-4.15.0-42-generic:amd64 <none> 4.15.0-42.45 | |
| 2018-12-04 06:46:51 install linux-modules-extra-4.15.0-42-generic:amd64 <none> 4.15.0-42.45 | |
| 2018-12-04 06:46:54 install linux-headers-4.15.0-42:all <none> 4.15.0-42.45 | |
| 2018-12-04 06:46:57 install linux-headers-4.15.0-42-generic:amd64 <none> 4.15.0-42.45 | |
| 2018-12-05 08:36:59 install libmng2:amd64 <none> 2.0.2-0ubuntu3 | |
| 2018-12-05 08:36:59 install qtcore4-l10n:all <none> 4:4.8.7+dfsg-7ubuntu1 | |
| 2018-12-05 08:36:59 install libqtcore4:amd64 <none> 4:4.8.7+dfsg-7ubuntu1 | |
| 2018-12-05 08:36:59 install libqt4-xml:amd64 <none> 4:4.8.7+dfsg-7ubuntu1 | |
| 2018-12-05 08:37:00 install libqtdbus4:amd64 <none> 4:4.8.7+dfsg-7ubuntu1 |
| .git | |
| tmp |
| begin | |
| require "bundler/inline" | |
| rescue LoadError => e | |
| $stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
| raise e | |
| end | |
| gemfile(true) do | |
| source "https://rubygems.org" | |
| gem "rails", github: "rails/rails" |
| class Maclaurin | |
| attr_reader :x, :steps, :function | |
| DERIVATIVE = { | |
| "sin" => "cos", | |
| "cos" => "-sin", | |
| "-sin" => "-cos", | |
| "-cos" => "sin", | |
| "e" => "e" |
| 4 8 | |
| -2 -2 -3 1 | |
| 3 0 1 3 | |
| 1 3 -3 3 | |
| 2 0 0 -2 | |
| 0 0 2 1 | |
| 2 2 2 3 | |
| 1 2 1 3 | |
| 3 2 3 3 | |
| 3 0 3 3 |
| unless File.exist?('Gemfile') | |
| File.write('Gemfile', <<-GEMFILE) | |
| source 'https://rubygems.org' | |
| gem 'rails', github: 'rails/rails' | |
| gem 'arel', github: 'rails/arel' | |
| gem 'sqlite3' | |
| GEMFILE | |
| system 'bundle' | |
| end |
| @db = '' | |
| @user = '' | |
| @password = '' | |
| unless File.exist?('Gemfile') | |
| File.write('Gemfile', <<-GEMFILE) | |
| source 'https://rubygems.org' | |
| gem 'rails', github: 'rails/rails' | |
| gem 'arel', github: 'rails/arel' | |
| gem 'pg' |
| class ActionDispatch::Session::JsonSerializer | |
| def self.load(value) | |
| JSON.load(value) + " and loaded" | |
| end | |
| def self.dump(value) | |
| JSON.dump(value + " was dumped") | |
| end | |
| end |