Never finished...
Never finished...
| //! A small program that computes the stats of an LMDB Meilisearch index. | |
| //! | |
| //! ```cargo | |
| //! [dependencies] | |
| //! anyhow = "1.0.71" | |
| //! clap = { version = "4.3.5", features = ["derive"] } | |
| //! heed = "0.20.0-alpha.1" | |
| //! ``` | |
| use std::path::PathBuf; |
We extract the movie titles along with the crew names and much more. You can also look at what BurntSushi have done for renaming series titles. The original IMDb datasets (TSVs) can be found on there official documentation.
We use the imdb-sqlite python script to help us do that. The command line generates an SQLite database in the imdb.db file.
pip install imdb-sqlite| fswatch --exclude '.git' --exclude 'target' . | while read num; do | |
| rsync -azP --exclude=.git --exclude=target -e 'ssh -i ~/.ssh/id_rsa' . root@xxx.xxx.xxx.xxx:<DEST> | |
| done |
| /// An adapter function that returns an iterator associated | |
| /// to a boolean indicating if this is the first item returned. | |
| /// | |
| /// https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=7ea95cd91a26de21c680ad7de8669c8d | |
| /// | |
| /// ``` | |
| /// let words = ["Hello", "world", "!"]; | |
| /// let mut iter = is_first(&words); | |
| /// | |
| /// assert_eq!(iter.next(), Some((true, "Hello"))); |
| pub enum Cor<'a, T: 'a> { | |
| Borrowed(&'a mut [T]), | |
| Owned(Vec<T>), | |
| } | |
| impl<T: Clone> Cor<'_, T> { | |
| pub fn as_resizable(&mut self) -> &mut Vec<T> { | |
| match self { | |
| Cor::Borrowed(slice) => { | |
| *self = Cor::Owned(slice.to_vec()); |
| full_query = "I love paris and new york with my friends " | |
| length = 1 | |
| local char_to_hex = function(c) | |
| return string.format("%%%02X", string.byte(c)) | |
| end | |
| local function urlencode(url) | |
| if url == nil then | |
| return |
| use std::{io, marker, str}; | |
| use std::borrow::Cow; | |
| use zerocopy::{LayoutVerified, AsBytes, FromBytes}; | |
| use serde::{Serialize, Deserialize, de::DeserializeOwned}; | |
| // Do not forget to patch zerocopy to make it support str | |
| // by using the `trivial_bounds` feature | |
| pub trait EPAsBytes { | |
| fn as_bytes(&self) -> Cow<[u8]>; |
| #!/bin/bash | |
| while true; do | |
| ps -p $1 -o\%cpu,rss | awk 'NR>1 { gsub(",",".",$1); print $1","$2}' | |
| sleep 0.2 | |
| done |
| #!/usr/bin/env bash | |
| # usage: memlog.sh $(pidof PROCESS_NAME) [ PATH_FOLDER ] | |
| # on osx pidof can be replaced by pgrep | |
| # usage: memlog.sh $(pgrep PROCESS_NAME) [ PATH_FOLDER ] | |
| set -e | |
| PID=$1 |