205 results for "":

rock 0.9.8 is out

A little less than two months after the previous release, I’m happy to announce that the ooc compiler rock 0.9.8, codename columbia is now out.

The impatients can readily skip to the release notes, but for those who prefer a narrative, let me tell you why I’m excited about this release.

String interpolation

We’ve thrown around this idea a lot since the early versions of rock since we have a few rubyists in our ranks, but only recently Alexandros Naskos took matters into his own hands and just implemented the fuck out of it.

Crafting ICMP-bearing IPv4 packets with the help of bitvec

So. Serializing IPv4 packets. Easy? Well, not exactly.

IPv4 was annoying to parse, because we had 3-bit integers, and 13-bit integers, and who knows what else. Serializing it is going to be exactly the same.

Right now, we don’t have a way to serialize that.

Let’s take the version and ihl fields, both of which are supposed to take 4 bits, together making a byte. We could serialize them like this:

Day 15 (Advent of Code 2022)

The day 15 puzzle falls into the “math puzzle” territory more than “let’s learn something new about Rust”, but since several folks asked if I was going to continue… let’s continue.

The sample input is as follows:

Sensor at x=2, y=18: closest beacon is at x=-2, y=15 Sensor at x=9, y=16: closest beacon is at x=10, y=16 Sensor at x=13, y=2: closest beacon is at x=15, y=3 Sensor at x=12, y=14: closest beacon is at x=10, y=16 Sensor at x=10, y=20: closest beacon is at x=10, y=16 Sensor at x=14, y=17: closest beacon is at x=10, y=16 Sensor at x=8, y=7: closest beacon is at x=2, y=10 Sensor at x=2, y=0: closest beacon is at x=2, y=10 Sensor at x=0, y=11: closest beacon is at x=2, y=10 Sensor at x=20, y=14: closest beacon is at x=25, y=17 Sensor at x=17, y=20: closest beacon is at x=21, y=22 Sensor at x=16, y=7: closest beacon is at x=15, y=3 Sensor at x=14, y=3: closest beacon is at x=15, y=3 Sensor at x=20, y=1: closest beacon is at x=15, y=3

What's in a Rainbow table?

In Veronica Mars and password hashes, from my new Tech As Seen On TV series, we’ve explored “cracking passwords” using brute-force methods, and then using rainbow tables, which was much, much faster.

But how do rainbow tables actually work? Let’s start at the beginning.

What’s a password hash?

A very simple design for an authentication system is to store passwords in clear text, say, in a file named password.txt:

Thread-local storage

Welcome back and thanks for joining us for the reads notes… the thirteenth installment of our series on ELF files, what they are, what they can do, what does the dynamic linker do to them, and how can we do it ourselves.

I’ve been pretty successfully avoiding talking about TLS so far (no, not that one) but I guess we’ve reached a point where it cannot be delayed any further, so.

Doing geo-location and keeping analytics

I sold you on some additional functionality for catscii last chapter, and we got caught up in private registry / docker shenanigans, so, now, let’s resume web development as promised.

Adding geolocation

We kinda left the locat crate stubby, it doesn’t actually do any IP to location lookups. It doesn’t even have a dependency on a crate that can do that.

rock 0.9.6 is on the loose!

Just 8 days after the last release, rock 0.9.6 is out.

To update, run git pull && make rescue as usual. To install from scratch, clone the repo, cd into it, and run make rescue from there - it’ll download the latest bootstrap, compile itself from C, then recompile itself from ooc.

Running rock -V should give you something like this:

rock 0.9.6 codename loki, built on Wed Feb 20 15:09:08 2013

Day 14 (Advent of Code 2022)

I like how the day 14 puzzle sounds, because I think it’ll give me an opportunity to show off yet another way to have Rust embedded in a web page.

But first…

Cool bear

Let me guess: parsing?

You bet your furry ass, parsing.

Parsing

The input looks something like this:

498,4 -> 498,6 -> 496,6 503,4 -> 502,4 -> 502,9 -> 494,9

And each line is essentially… a polyline: we’re supposed to draw lines between every point on the path, and that determines rocks on the map.

The case for sans-io

The most popular option to decompress ZIP files from the Rust programming language is a crate simply named zip — At the time of this writing, it has 48 million downloads. It’s fully-featured, supporting various compression methods, encryption, and even supports writing zip files.

However, that’s not the crate everyone uses to read ZIP files. Some applications benefit from using asynchronous I/O, especially if they decompress archives that they download from the network.

Day 2 (Advent of Code 2022)

Part 1

In the day 2 challenge, we’re playing Rock Papers Scissors.

We’re given a strategy guide like so:

A Y B X C Z

Left column is “their move”: A means Rock, B means Paper, C means Scissors. Right column is “our move”: X means Rock, Y means Paper, Z means Scissors.

Each line corresponds to a turn, and we must calculate the total score we get. Picking “Rock” gives 1 point, “Paper” gives 2 points, and “Scissors” gives 3. Losing the round gives 0 points, drawing gives 3, winning it gives 6.