Discover and read the best of Twitter Threads about #AdventOfCode

Most recents (24)

I have been confused for a while on what's the best way to implement a "to string" functionality for a #Rust struct. 🦀

The reason why this has been confusing to me is that there are indeed many ways to do that and they all have different purposes!

This is what I learned

👇🧵
The first thing that you can do is to just implement a simple `to_string()` function directly on your struct!

play.rust-lang.org/?version=stabl…
This is easy and it works! But the implementation is very specific to our struct.

The rest of the codebase doesn't really know that this type can be converted to a String and therefore you cannot build abstractions on top of this... 🤨
Read 23 tweets
[DAY 24/24]
#MerryChristmas ✨❄️🎄

The whole Let's STEAM consortium is wishing to the great #STEAM community, #parents, #schools, #teachers, #kids, a very merry #Christmas!

May your holidays be filled with #joy, #food and #creativity 🥰🤩
Congratulations to all the amazing people and organisations thanks to whom we have so much inspiration in the field of #STEAM, #equity, #creativity and #education!

🙏🙌👏
Read 5 tweets
It's on! #AdventOfCode from my #Honeycomb_LX2K ARM64 machine starting in 5 min! twitch.tv/lizthegrey obs running showing a wayland desktop
Screensharing glitched first 5 min then was rock stable 60 FPS! #AdventOfCode

My application of De Morgan's Laws wasn't rock stable. I wasted 30 minutes on !(a || b) that should have been !a && !b instead of !a || !b

Video:
Code: github.com/lizthegrey/adv…
Timestamps say I was stuck for 35 minutes on that two character mistake. and reviewing it, I see _exactly_ what happened. It wasn't just !(a || b) expansion, I was simultaneously refactoring !(f(x) == 2 || f(x) == 3) to only eval f(x) once, so I forgot the intention #AdventOfCode
Read 4 tweets
In 2.5 hours: #AdventOfCode live with me in #GoLang. twitch.tv/lizthegrey

Just 10 more puzzles left!
Starting in on #AdventOfCode now!

Honestly hoping for a quick one as I have some job stuff to clean up after, having done errands/paperwork earlier in day, but we'll see what @ericwastl has in store for us! twitch.tv/lizthegrey
Oof. Got tripped up on parsing and then nested data structure mangling. But we got there with the help of the #AdventOfCode community!

Video: (processing may take a while, it's almost an hour...)
Code: github.com/lizthegrey/adv…
Read 4 tweets
I just completed "Rain Risk" - Day 12 - Advent of Code 2020 adventofcode.com/2020/day/12 #AdventOfCode

Today I learned that I really need coffee ☕️ to operate properly. Made a trivial mistake and it took me forever to catch it. This would have been obv. with a statically typed lang.
Also, I'm using a notebook-style env. to play (like jupyter.org, here it's colab.research.google.com). My take away from this fun experience + observations at work is that such notebooks are poison to the mind, fostering bad practices while not bringing much value.
I get that notebooks provide a nice environment for tutorials - you get a literate programming + a printf-debugger on steroids, which is very useful when suffering through tensor shape mismatch errors. It's useful for data science or ML 101.
Read 11 tweets
For this year's #AdventOfCode, my goal is to get each day's solution in the most readable format that will fit in a tweet. Striving for a compromise between conciseness and (subjective) elegance… 🧵
#AdventOfCode Day 1 (in Python 🐍):
# (relies on a few input assumptions)

data = [int(i) for i in open('01')]

print("Part 1:",
next(x*y for x in data for y in data if x+y == 2020))

print("Part 2:",
next(x*y*z for x in data for y in data for z in data if x+y+z == 2020))
#AdventOfCode Day 2 in 🐍

import re
L = [re.split('[: \-]', l) for l in open('02')]
L = [(int(p1), int(p2), [c == ch for c in pwd])
   for p1, p2, ch, _, pwd in L]

print("Part 1:",
sum(n1<= sum(m)<= n2 for n1, n2, m in L),
"Part 2:",
sum(m[p1-1]^m[p2-1] for p1, p2, m in L))
Read 48 tweets
[DAY2/24]
#ChristmasIsComing

Another topic, another discovery!

Let's play with #programming in a challenging way and with no pressure! Discover the #AdventOfCode initiative!

adventofcode.com

#adventofcode2020
"After saving Christmas five years in a row, you've decided to take a vacation at a nice resort on a tropical island. Surely, Christmas will go on without you."
"The tropical island has its own currency and is entirely cash-only. The gold coins used there have a little picture of a starfish; the locals just call them stars."
Read 5 tweets
Day 1 of #AdventOfCode in Mathematica Image
I just completed "Password Philosophy" - Day 2 - Advent of Code 2020 adventofcode.com/2020/day/2 #AdventOfCode ImageImage
Turns out the hardcore Advent of Code folks have functions for the fetching of input and submission, so I hacked it together in Mathematica. Never used WebExecute before... it's very slick. Image
Read 40 tweets
There's been a lot of talk about how many states' unemployment systems are written in a 60-year-old programming language, COBOL. It raised a lot of emotions and commentary, for sure, but hardly the right ones, in my opinion.

Thread. 1/
The core of the operating system you're writing this on is pretty much certainly written in C. That programming language is 48 years old. Most of them, with the notable exception of Windows, are built upon a standardized system architecture that's about just as old. 2/
If COBOL is obsolete, then so are C and POSIX. But all of those have been maintained and improved upon over the years. The latest issue of the COBOL standard was in 2014. (2018 for C and POSIX). 3/
Read 29 tweets
So, I've interviewed a bunch of software engineers, done some interviews myself, and teach my students about interviewing.

Here's a thread of advice 👇🏻
Interviewing looks different everywhere. Things you may encounter:

1) Behavioral interview questions such as: "What are your career goals"

2) Technical questions like: "Pretend I know nothing about React, explain it to me from 0" or "What is a float in CSS"
3) Whiteboarding or live programming challenges like the ones you'd find on @hackerrank

4) Takehome code challenges, where you're given a task to solve asynchronously

5) Pair programming challenges where you're working with one of the company's engineers to solve a problem.
Read 17 tweets
I'll be doing #AdventOfCode catchup stream for days 23/24 (as well as recapping how I solved day 22) sometime this afternoon at twitch.tv/lizthegrey, keep it open :)
Taking a dinner break, then Day 24, and then doing Day 25 at midnight sharp :)
Read 8 tweets
Tackling #AdventOfCode day 22! It looks like a toughie, <1000 people have finished both parts and it's 13+ hours since unlock... twitch.tv/lizthegrey
Okay, how. How. I'm envious of @jnesselr who has both stars on the private leaderboard... #AdventOfCode
Okay, I hate you @ericwastl, that shouldn't have taken busting out Mathematica, and yes, I will go back and clean up my Go solution at some point, just... not today.

raw.githubusercontent.com/lizthegrey/adv… #AdventOfCode
Read 3 tweets
Deferring doing #AdventOfCode catchup until the weekend. See folks tomorrow night, probably 8pm Eastern :)
Starting in soon on #AdventOfCode days 19-20! twitch.tv/lizthegrey
back in about 45-60 min to do Day 20! #AdventOfCode
Read 5 tweets
Streaming belatedly #AdventOfCode day 18! twitch.tv/lizthegrey
Solved part (a), have a good idea how to solve part (b), but tomorrow!
Oh, actually, nevermind, it was a quick adaptation of Part A to solve Part B because I happened to pick the right algorithm :) #AdventOfCode

[spoilers] github.com/lizthegrey/adv…
Read 3 tweets
OH MY GOD I HATE YOU @ericwastl, I _had_ the real answer in front of me the WHOLE FUCKING TIME YOU MONSTER WITH YOUR TEXTUAL SLEIGHTS OF HAND #AdventOfCode
@ericwastl FUCKING FINALLY. That's the right answer! You are one gold star closer to rescuing Santa.  You have completed Day 16! You can [Shareon Twitter Mastodon] this victory or [Return to Your Advent Calendar].
didn't even bother streaming, because Elly and I had the realization together she's camera-shy, and once we'd had the lightbulb moment, the code to validate our assumption took literally 5 seconds to refactor on *cry*.

[spoilers] github.com/lizthegrey/adv… already existed at 1am.
Read 6 tweets
Last night's #AdventOfCode part B was so painful that my computer crashed near 2am and I realized that I needed to sleep, as I was crashing too.

Employing the "maximize fun" rule, I might need to read some of the spoilery hints to get an idea of how to proceed, as I'm stuck :/
tl;dr lizf is great at translating algorithms into code but rubbish at actually coming up with new algorithms
Hm, I have a good idea for saving the stream. Hey @nicuveo or other streamers: if you _haven't_ cracked part (b) and are stuck, do you want to brainstorm solutions together on a joint stream? #AdventOfCode
Read 4 tweets
#AdventOfCode livestream starting now-ish: twitch.tv/lizthegrey
uh, that was super weird, so sorry to people, my stream got left on overnight because @Lightstream kept the connection alive and never stopped streaming despite the source feed dying suddenly.

I have... no idea why 22 of you were watching a black screen overnight.
honestly I'm kind of hurt that empty screen gets more people watching it than me actually coding :cry:
Read 3 tweets
Trying something different prior to #AdventOfCode stream at midnight Eastern; will be streaming #TransportFever2 for ~90 min. twitch.tv/lizthegrey
just battling a few issues with getting a new game to stream, urgh.
Shit, I accidentally streamed as @opentelemetry, revert revert revert.
Read 5 tweets
Will attack the backlog and resume #AdventOfCode streaming tomorrow, probably 9am Eastern. Too brain fogged still to code effectively.
Okay, let's power through days 12-14 of #AdventOfCode together! twitch.tv/lizthegrey
Wow, 110 simultaneous viewers!!! that's... amazing :) at that rate, Twitch Partner might even be in reach! Videos will be up at youtube.com/playlist?list=… shortly :) #AdventOfCode
Read 4 tweets
I'll be doing #AdventOfCode 2 hours late today, around 6pm AEDT. There are two afternoon talks at YOW that I absolutely cannot miss :) twitch.tv/lizthegrey
Starting now! Word on the street is it's pretty easy, so maybe I'll be able to finish in 15 min before the next talk slot! also OMG this conf venue has 80 megabit symmetric <3 <3 twitch.tv/lizthegrey #AdventOfCode
Okay *how* did y'all solve it in less than an hour, top 200 folks? (rhetorical, don't spoiler me with an answer) #AdventOfCode
Read 3 tweets
Going to be streaming #AdventOfCode as soon as I get situated at my hotel, probably in an hour! twitch.tv/lizthegrey
Starting now after all, that was surprisingly efficient.
Replay available at #AdventOfCode
Read 3 tweets
.@starbuxman livedemos like an auctioneer after pausing to dramatically repeat that start.spring.io is the panacea for all your problems. #YOW19
@starbuxman (what it does is it collects a list of
version requirements/dependencies, and then gives you a starter zip file you can load in your favorite editor and run)... #YOW19
[ed: it is going to be super fun to pair up @starbuxman and me on a livedemo, I suspect that we'll wind up doing the hackertyper four hands on keyboard thing while emitting narrative like an auctioneer]
Read 8 tweets
Having a lie down for 30 min (argh fatigue), then will be livestreaming the Day 9 #AdventOfCode unlock! twitch.tv/lizthegrey
That felt like that really should have taken me less time, probably order 5-10 min less. Surprised I still wound up in top 500. #AdventOfCode
Video now available at #AdventOfCode
Read 3 tweets
After lunch, I'll be attending (but not livetweeting) @erikdoe's Rust talk at #YOW19, in the possible interest of going back and redoing my #AdventOfCode solutions in Rust to compare/contrast with Go after I get home from Australia...
Borrowing reminds me so much of shared_ptr and unique_ptr from C++... also cute rustacean! #YOW19 Rust gear shelled crab with a ? Next to it.
Also the `mut` keyword in Rust is fundamentally the opposite of the `const` flag in C, except... it only allows one mutable copy at a time, and it defaults to immutable references unless otherwise specified. #YOW19
Read 9 tweets

Related hashtags

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!