Dumping some code from ~May 2022. Intended to accompany blog post or something.

Overview

An example project where Rust code prints the length of an uploaded file.

Run python3 -m http.server (or equivalent: https://gist.github.com/willurd/5720255), then access http://[::]:8000/

Writing a "pdf file object parser". Starting with parsing individual objects. There are 8 types of objects:

  • Boolean Objects
  • Numeric Objects
  • String Objects
  • Name Objects
  • Array Objects
  • Dictionary Objects
  • Stream Objects
  • Null Object

We will also need to parse

  • Indirect Object definitions (12 0 obj)
  • Indirect object references (12 0 R),
  • File structure: Header, body, cross-reference table, trailer.

Some notes:

  • It can now round-trip (objects, not yet an entire PDF file) via JSON. That is, if you dump to JSON and read back, you will get the exact same bytes.

    • This is not as big a deal as it sounds, because we could in principle dump the sequence of bytes into JSON as an array of numbers. However, here we're doing slightly more than that.
  • Assumes the input is valid, e.g. does not check in dict for unique keys, does not check for stream length, etc.

Status currently:

  • Out of 19560 PDF files I have, this works correctly for 8724 of them.

  • As of 2022-04-30 (970471e): Works for 19262 out of 19560 files. So fails for 298 (not all of which are actually PDF files).

  • As of 2022-05-01 (child of 970471e): Works for 19430 out of 19562 files. So fails for 132 files.

  • As of 2022-05-01 (after deleting some dupes): Works for 19382 out of 19493 files. So fails for 111 files.

  • As of 2022-05-01 11:52: Works for 19420 out of 19493 files. So fails for 73 files.

  • As of 2022-05-01 14:20 (e54b45e): Works for 19426 out of 19492 files. So "fails" for 66 files. Looked at each of them. They are all malformed in some way or the other.

You might also like...
Sample code of Yew (0.18). Something like a PuyoPuyo.

RusRus Requirements Docker Depend on Yew ver 0.18.0 Usase docker build -t rusrus . # start serve docker run -p 8080:8080 --rm -it -v $(pwd):/app -w /

Cassette A simple, single-future, non-blocking executor intended for building state machines.

Cassette A simple, single-future, non-blocking executor intended for building state machines. Designed to be no-std and embedded friendly. This execut

πŸ€– brwrs is a new protocol running over TCP/IP that is intended to be a suitable candidate for terminal-only servers

brwrs is a new protocol running over TCP/IP that is intended to be a suitable candidate for terminal-only servers (plain text data). That is, although it can be accessed from a browser, brwrs will not correctly interpret the browser's GET request.

xcp is a (partial) clone of the Unix cp command. It is not intended as a full replacement

xcp is a (partial) clone of the Unix cp command. It is not intended as a full replacement, but as a companion utility with some more user-friendly feedback and some optimisations that make sense under certain tasks (see below).

A cross-platform Mod Manager for RimWorld intended to work with macOS, linux and Windows

TODOs are available here. Discussions, PRs and Issues are open for anyone who is willing to contribute. rrm Inspired by Spoons rmm. This is a cross-pl

Programming language from down under, inspired by this Reddit post.
Programming language from down under, inspired by this Reddit post.

aussie++ Programming language from down under, inspired by this Reddit post. View live demo here. Special thanks to MarkWhyBird, louis100, and others

πŸ’« Small microservice to handle state changes of Kubernetes pods and post them to Instatus or Statuspages

πŸ’« Kanata Small microservice to handle state changes of Kubernetes pods and post to Instatus πŸ€” Why? I don't really want to implement and repeat code

A Supra + Pandoc post-processor for footnote cross-references.

AutoCref AutoCref is a Supra and Pandoc post-processor that turns footnote cross-references in a Word document into automatically updated fields. Abou

Command-line HTTP client for sending a POST request to specified URI on each stdin line.

line2httppost Simple tool to read lines from stdin and post each line as separate POST request to a specified URL (TCP connection is reused though). G

Code examples for https://www.poor.dev/blog/terminal-anatomy/

This repository contains examples from the Anatomy of a Terminal Emulator blog post. Each folder contains a separate example and can be run separately

Voluntarily contributed solutions for the first practical exercise for the Compilerbau lecture WiSe 2021/2022 of Ulm University

Solutions for the first practical exercise Compilerbau lecture WiSe 2021/2022 - Ulm University Contributing Want to add your solution? Great! Just add

🐳 πŸ“¦ Bringing docker containers to your AUR helper since 2022

zeus Releases | CI | Issues | Installing | Building Zeus. A simple AUR helper which utilizes docker containers allowing developers and users alike to

INFCON 2022 - Rust 크둜슀 ν”Œλž«νΌ ν”„λ‘œκ·Έλž˜λ° λ°œν‘œ 자료 및 예제 μ½”λ“œ

2022-INFCON-Rust-CrossPlatform INFCON 2022 - Rust 크둜슀 ν”Œλž«νΌ ν”„λ‘œκ·Έλž˜λ° λ°œν‘œ 자료 및 예제 μ½”λ“œ Contents Presentation Supplement Example Core library rust-cross rust-cr

An awesome CLI tool for effectively learning Rust and more. Project winner of the RustFi 2022 hackathon
An awesome CLI tool for effectively learning Rust and more. Project winner of the RustFi 2022 hackathon

rlrn An awesome CLI tool for effectively learning Rust and more Table of Contents About The Project Built With Getting Started Prerequisites Installat

Fortipwn - Forti CVE-2022-40684 enumeration script built in Rust

fortipwn Forti CVE-2022-40684 enumeration script built in Rust. Uploads an SSH public key into authorized_keys, allowing an attacker to SSH into a ser

A crate to convert bytes to something more useable and the other way around in a way Compatible with the Confluent Schema Registry. Supporting Avro, Protobuf, Json schema, and both async and blocking.
A crate to convert bytes to something more useable and the other way around in a way Compatible with the Confluent Schema Registry. Supporting Avro, Protobuf, Json schema, and both async and blocking.

#schema_registry_converter This library provides a way of using the Confluent Schema Registry in a way that is compliant with the Java client. The rel

πŸ“Ž Do something on your clipboard, automatically.

πŸ“Ž autoclip Do something on your clipboard, automatically. ✨ Features Automatic Customisable with Plugins πŸ“¦ Installation $ cargo build --release πŸ”Œ

Use enum to filter something, support | and & operator.
Use enum to filter something, support | and & operator.

Filter Use enum to filter something, support | and & operator. Just need to implement Filter Trait with filter-macros crate. How to work Example #[add

vault client using jwt authentication that define environment variables from vault secrets before executing into something else

envlt envlt, like env, allows you to define environment variables and then execute into something else, but instead of static values, it uses using si

Comments
  • Document everything

    Document everything

    I just read Coping strategies for the serial project hoarder by Simon Willison (simonw), which recommends writing everything down, working issue-first (create an issue, talk to yourself, etc) and basically leave things in a sane state that you can walk away from at any point, so that there isn't any guilt. Sounds like a great state to aspire to!

    The first step would be to document what already exists, from a POV of "if I don't do any more work on this project, whatever already exists should still make sense".

    opened by shreevatsa 0
Owner
Shreevatsa
Shreevatsa
Ointers is a library for representing pointers where some bits have been stolen so that they may be used by the programmer for something else

Ointers is a library for representing pointers where some bits have been stolen so that they may be used by the programmer for something else. In effect, it's a small amount of free storage

Irrustible 8 Jun 4, 2022
Something something B language.

badc A terrible, dirty, no-good, rotten B compiler. Written by one really great human being, and one obscenely terrible sheep. Contributing Don't. Ref

The Phantom Derpstorm 8 Nov 12, 2022
A demo blog post engine in Rust, using Rocket and MongoDB

A demo blog post engine written in Rust, using Rocket and MongoDB Quick Start Setup a new MongoDB cluster https://cloud.mongodb.com/ create a new data

Nabil Hachicha 5 Oct 19, 2022
Rust-blog - Educational blog posts for Rust beginners

pretzelhammer's Rust blog ?? I write educational content for Rust beginners and Rust advanced beginners. My posts are listed below in reverse chronolo

kirill 5.1k Nov 26, 2022
This is a small demo to accompany the Tauri + Yew tutorial

Tauri + Yew Demo This is a small demo to accompany the Tauri + Yew tutorial

Steve Pryde 89 Nov 23, 2022
A utility written in Rust for dumping binary information out of Mach-O files inspired by objdump

Mach-O Dump (macho-dump) An objdump like tool for exploring and manipulating Mach-O files. Note: This project is in an early stage and most of the fea

Irides 2 Oct 17, 2022
A tetris game I wrote in rust using ncurses. I'm sure that there's a better way to write a tetris game, and the code may be sus, but it techinically works

rustetris A tetris game I wrote in rust using ncurses. I'm sure that there's a better way to write a tetris game, and the code may be sus, but it tech

Eric G 3 Oct 15, 2022
TCP is so widely used, however QUIC may have a better performance.

TCP is so widely used, however QUIC may have a better performance. For softwares which use protocols built on TCP, this program helps them take FULL advantage of QUIC.

zephyr 15 Jun 10, 2022
A Rust library for evaluating log4j substitution queries in order to determine whether or not malicious queries may exist.

log4j_interpreter A Rust library for evaluating log4j substitution queries in order to determine whether or not malicious queries may exist. Limitatio

Fastly 22 Nov 7, 2022
Source code and documentation for our 'full stack on rust' meetup on 29-9-2022

Full stack on Rust This is the code and documentation repository for our 'Full stack on Rust' meetup on 29-9-2022. It includes step-by-step documentat

Baseflow 7 Oct 23, 2022