Showing posts with label parsing. Show all posts
Showing posts with label parsing. Show all posts

Wednesday, January 10, 2024

Rust: Finding dates in data-streams

#Rust pop-quiz answer to finding dates in data-streams.

You want a date? I got'cher date RIGHT HERE.




On a less silly note: did you know that Rust can have functions inside functions? I solve the 'where is the date?'-problem with the embedded extract_date-fn.

Parsing Kujira numbers from copypasta

#Rust pop-quiz answer for parsing Kujira numbers.

May I present kujira_nums.rs in my crypto/parsers library.




Tuesday, January 9, 2024

Parsing copypasta'd Kujira numbers

The problem of @TeamKujira numbers.

Kujira numbers, when copypasta'd come out as a mess:

0.9362 is pasted as

0.
9362



Ugh.

Write a Rust program that parses a Kujira number to its correct representation.


* be cognizant of parser-state.

Saturday, July 22, 2023

Announcement: automated CSV parsing in Rust

 🦀🦀🦀cRUSTaceans!🦀🦀🦀 

I've added a new fn to my csv_utils:

parse_csv<T>(skip: usize, f: Fn, lines: Lines)



  • skips <skip> lines (header
  • parses CSV with <f>
  • returns Vec<T> objects from CSV <lines>

This goes a long way towards automating CSV parsing for me.


Monday, January 30, 2023

Rust pop-quiz: Order book URLs

Rust pop-quiz.

Receive the @TeamKujira order book JSON from https://api.kujira.app/api/coingecko/pairs


Parse it into Rust structures so that you can answer the following question:

* what is the URL to the order book [some order book].

BONUS!

Some names are just wrong. Find and fix them.

Saturday, December 17, 2022

Rust pop-quiz: percentages

RUST POP-QUIZOFORTH! Yes: again!

  • "5.7%"
  • "4%"
  • "-345.9%"

Parse these numbers and represent as a Rust-type.