From b429f884c4bb793a658e8161e62167d74058f545 Mon Sep 17 00:00:00 2001 From: Jan Bergen Date: Thu, 5 Mar 2026 15:54:13 +0100 Subject: [PATCH] new todos --- autotodo/data/patterns.ron | 8 + autotodo/src/main.rs | 1 - fourier_epicycles/src/main.rs | 912 ++++++++++++++++++++++++- linear_algebra_test.py | 5 + notes.md | 147 +++- pandasay/.gitignore | 1 - pandasay/Cargo.lock | 1199 --------------------------------- pandasay/Cargo.toml | 11 - pandasay/src/main.rs | 47 -- pandasay/src/speech.rs | 110 --- 10 files changed, 1042 insertions(+), 1399 deletions(-) create mode 100644 linear_algebra_test.py delete mode 100644 pandasay/.gitignore delete mode 100644 pandasay/Cargo.lock delete mode 100644 pandasay/Cargo.toml delete mode 100644 pandasay/src/main.rs delete mode 100644 pandasay/src/speech.rs diff --git a/autotodo/data/patterns.ron b/autotodo/data/patterns.ron index bea9ee8..f45ee11 100644 --- a/autotodo/data/patterns.ron +++ b/autotodo/data/patterns.ron @@ -1,4 +1,8 @@ [ + ( + name: "P5 rückmelden", + pattern: MonthlyOpt(dom: 10, months: ["March"]), + ), ( name: "Morello updaten", pattern: Weekly(dow: "Monday"), @@ -11,6 +15,10 @@ name: "Rechnung Gertrudenhof", pattern: Monthly(dom: 1), ), + ( + name: "Rechnung Remagen", + pattern: Monthly(dom: 1), + ), ( name: "Rechnung Sholti", pattern: Monthly(dom: 1), diff --git a/autotodo/src/main.rs b/autotodo/src/main.rs index 8b85576..953583f 100644 --- a/autotodo/src/main.rs +++ b/autotodo/src/main.rs @@ -168,7 +168,6 @@ fn update_notes(notes_path: &PathBuf, patterns_path: Option) { } } Pattern::Weekly { dow } => { - dbg!(dow, today); let mut date_idx = latest_date.clone() + Duration::days(1); while date_idx <= today { dbg!(date_idx); diff --git a/fourier_epicycles/src/main.rs b/fourier_epicycles/src/main.rs index 880b28c..9427fdf 100644 --- a/fourier_epicycles/src/main.rs +++ b/fourier_epicycles/src/main.rs @@ -1,12 +1,12 @@ use eframe::egui; +use egui::ecolor::Color32; +use egui_plot::Line; use egui_plot::Plot; use egui_plot::PlotBounds; use egui_plot::Points; -use egui_plot::Line; use num::complex::Complex; use std::collections::VecDeque; use std::f64::consts::PI; -use egui::ecolor::Color32; type C = Complex; fn z(re: f64, im: f64) -> C { @@ -47,8 +47,830 @@ fn star_points() -> Vec { } fn pl_points() -> Vec { - let x: Vec = vec![-0.51683, -0.5175970934423306, -0.518354060356653, -0.519087791495199, -0.5197265482083357, -0.5200158499596517, -0.5200606483568466, -0.5201245610270648, -0.5202127069594011, -0.5203231480090157, -0.5204790003906012, -0.519300192280936, -0.5172525623338785, -0.5151890488911149, -0.5130799236833181, -0.511021380729033, -0.508787012065353, -0.5057737340345604, -0.5022504618885519, -0.4964265433953864, -0.48636074196716683, -0.4764403364220719, -0.46643530981687087, -0.45621444778362136, -0.44630923486471685, -0.4363901728024042, -0.42604223131220376, -0.4155014249009841, -0.4058483245679939, -0.3956550567196297, -0.3851559202678762, -0.3758495147475159, -0.36703196232295404, -0.3585483139424033, -0.3499590157776108, -0.34116555495780165, -0.3326543580380893, -0.3240731575215475, -0.31664918162339645, -0.3096570153323872, -0.3028242475979054, -0.29284108982901147, -0.2845606146146703, -0.2761603975681723, -0.2676682527756908, -0.2586141983038218, -0.2500177100048542, -0.2406698388847149, -0.2319785185185185, -0.2230836285309992, -0.21412117260761887, -0.20410621532125664, -0.19461170494868074, -0.1861732531930878, -0.17727609247252651, -0.16724912507381742, -0.1579175910621365, -0.1484630227074335, -0.139, -0.12944822669094783, -0.11986916967862482, -0.11012672929684561, -0.10030578512396693, -0.09015481855592966, -0.08002834948814745, -0.06940427983539094, -0.05850052715709281, -0.0482599302792232, -0.038, -0.02772790036885537, -0.017678447447642437, -0.007649362794355151, 0.002433400395135929, 0.013098064874847864, 0.0238371240926766, 0.03357945042713639, 0.043484832067228765, 0.0533314864490224, 0.06310185185185183, 0.07260417123999918, 0.08156318711036493, 0.09008171035938405, 0.09833894504683605, 0.10600330788756862, 0.11031914850989236, 0.10803366279878676, 0.10822147411261887, 0.11320115702479337, 0.11951197734925008, 0.12715715641261094, 0.13595350145676746, 0.1455836738469276, 0.15510569524445558, 0.16519252134651277, 0.1748900137174211, 0.18456332488233007, 0.1939605556843818, 0.2036259101782028, 0.21253689584344618, 0.2214850228846984, 0.23073356429306843, 0.23969915852742296, 0.24865996681435304, 0.25696743484224965, 0.26513401673092524, 0.27440373234435983, 0.28209604986710285, 0.2884955944404765, 0.29531399052250895, 0.30262330363114875, 0.31051322024448147, 0.3186081010492642, 0.3270241078162505, 0.33555989928877583, 0.3443841422283234, 0.35314904219214904, 0.3626550891632373, 0.3716970047789393, 0.3812689462114255, 0.3909313757305737, 0.4013315768438389, 0.41107626335799585, 0.42114852687676685, 0.4312147568326877, 0.4414696933625615, 0.45147048027463704, 0.4612822814926121, 0.47129575356668424, 0.47843737997256525, 0.4818288287115622, 0.48482275927317253, 0.48763306278786234, 0.49024, 0.4919217543870499, 0.493491178801586, 0.49495206461101166, 0.4962927717950859, 0.4974446141653244, 0.4984715775034294, 0.49924021372793337, 0.49981671872278544, 0.49940021513986926, 0.4982659049220909, 0.4971584869303173, 0.4959469196093162, 0.4945711458426731, 0.4930390809327846, 0.4914486706778013, 0.48978999999999995, 0.4873052697776665, 0.48660930156580606, 0.49615530944585123, 0.5038818252930283, 0.5114730277986477, 0.5191480424075465, 0.5267040789694724, 0.5342749761877525, 0.5419673263190007, 0.5491946957175057, 0.556934072239588, 0.5641584504570241, 0.571464566716033, 0.5786052752605126, 0.5843518445345198, 0.5901247110220664, 0.5960441651490934, 0.6017804279711719, 0.6075314603436672, 0.6130161800640834, 0.6187243864829296, 0.6240702133672197, 0.6288934268302864, 0.6347772892273412, 0.6315034078773657, 0.6278428229648799, 0.6240502788521889, 0.6201672757572667, 0.6160564835375488, 0.6122031914492337, 0.6084009553137745, 0.6042768422517184, 0.6000061682842093, 0.5954346024885113, 0.5906520224384442, 0.5859750835154937, 0.5808925920360631, 0.5762523237888527, 0.571384190110471, 0.5663205409466566, 0.5610937262431477, 0.5557360959456826, 0.55028, 0.5434335681887749, 0.5373713554275538, 0.5311603936724659, 0.5250095416979714, 0.519022629601803, 0.5125850282232589, 0.5065530459992228, 0.5003283290202298, 0.49399874782927733, 0.4873715775034293, 0.48046554915546646, 0.473922043019729, 0.46677286694101516, 0.4650967440757951, 0.4671385185185185, 0.47073242410844496, 0.47499843716215306, 0.47962850480109753, 0.48469781395219413, 0.489944164613176, 0.49589100137174214, 0.5021474188677924, 0.5093361718707328, 0.5165904324646322, 0.5241801190973092, 0.5320335748155981, 0.5398829688065225, 0.5475249940585324, 0.5512354086936089, 0.5466945343857924, 0.5403588728835133, 0.5337845440219974, 0.5270690400381738, 0.520534883546206, 0.5136541325096696, 0.5067531179564236, 0.49965592435939843, 0.4927937988702451, 0.4857468870420355, 0.47871436459276984, 0.4706007888290104, 0.4628720438957475, 0.4537688759444254, 0.44517449931412906, 0.4356989030803908, 0.4275063197220651, 0.41878810737721056, 0.40956131118345984, 0.39984297627844617, 0.38965014779980195, 0.3789998708851602, 0.37072221637866265, 0.3622040259342739, 0.35345249046943267, 0.3444748009015778, 0.33527814814814816, 0.3258697231265827, 0.3162567167543201, 0.3064463199487993, 0.29644572362745913, 0.28626211870773854, 0.27590269610707635, 0.2653746467429112, 0.2546851615326822, 0.2438414313938281, 0.23285064724378776, 0.22172000000000003, 0.2102234641177617, 0.19930716197790582, 0.18895287002253944, 0.1759898879726765, 0.1639504411217573, 0.15279133288810975, 0.1424693666900615, 0.1306783326376715, 0.12004347003346391, 0.10868899062041701, 0.09873211924365581, 0.08868769346356122, 0.07790450037565738, 0.06731264432922221, 0.05730647828143694, 0.046793462891335534, 0.036609191063785476, 0.02637943846175251, 0.016089533607681755, 0.006028739594702249, -0.004123535116495025, -0.014949861846709114, -0.025228394546423324, -0.03527672397889723, -0.04531550068587106, -0.055752060962651714, -0.06653625738045696, -0.07658552281307103, -0.08660990297836031, -0.0966306635686526, -0.10649882544452792, -0.11545865569272974, -0.1250112581379554, -0.13466714705467084, -0.14495400645574205, -0.15492764131468753, -0.16502313298271976, -0.1751122503063489, -0.1854325925925926, -0.19559714305590342, -0.2065397401007319, -0.21687907113168214, -0.2273115593440785, -0.2369466994503756, -0.24714921863260703, -0.2572209771214852, -0.2666261274308229, -0.27667892668136324, -0.28731764017071026, -0.2965862695828812, -0.3061831864610805, -0.31607266470438494, -0.32621897821187085, -0.3365864008826145, -0.3471392066156927, -0.3578416693101817, -0.36865806286515806, -0.3773691999888694, -0.38611209639502875, -0.39486846031996325, -0.40362, -0.4124193906517475, -0.4208349599247242, -0.42888371288644017, -0.43658265460440554, -0.44538357695926717, -0.45373464317699996, -0.46166523801426157, -0.46920474622770925, -0.47754575145393335, -0.48544110215510894, -0.4929374602364838, -0.5000814876033058, -0.5078745227811221, -0.5153379698216736, -0.5225414814814816, -0.5291362617708563, -0.5352953565756535, -0.5414323173166209, -0.547587979519715, -0.5539393944959234, -0.5600507493669478, -0.5661431930879038, -0.5719573388203019, -0.5759792995664224, -0.5709925845229151, -0.563022962962963, -0.5552984391306184, -0.5476710415449257, -0.5404991896930739, -0.5337838756713137, -0.527100191446142, -0.5204963666457453, -0.5146160306874479, -0.5092286111806772, -0.5038748342521223, -0.4987630954582041, -0.4929323591284748, -0.4831027707232513, -0.4730251834949845, -0.46292259359228444, -0.4527223316936326, -0.45863119405461605, -0.46603259259259255, -0.473368566678931, -0.48065602248379113, -0.4874457400450789, -0.4946519464618638, -0.5021940740740741, -0.5086776612982185, -0.5152919525630759, -0.5219903230653644, -0.5287261480018015, -0.535452802569105, -0.5421236619639925, -0.5481950575853423, -0.5531199236317879, -0.5583966540210803, -0.563777254763738, -0.5690535146382713, -0.5740944429294476, -0.5788890554148773, -0.5835945085999265, -0.5881644511227984, -0.5930734508847274, -0.5976736879662867, -0.6024301582089645, -0.606570177450456, -0.6105561908339595, -0.6147862597611665, -0.6187700923735879, -0.6229572001104815, -0.6271117325793389, -0.6308779661630074, -0.6343433305506858, -0.6244102689789438, -0.6188936489679986, -0.6131270451170207, -0.6072879411191808, -0.6017086590422127, -0.595838393897139, -0.5895137266553918, -0.5829680852603167, -0.5762330879038317, -0.569614885906303, -0.5626214913547267, -0.5550844043330974, -0.5479009963320584, -0.5407378764277815, -0.5336358858042727, -0.5266685655040353]; - let y: Vec = vec![0.194, 0.20425147918322084, 0.2143676268861454, 0.22440466392318248, 0.2346247713333725, 0.24465433953863705, 0.25480620530372594, 0.2650117295802634, 0.27554658847427443, 0.28561912096168296, 0.2963206836243261, 0.30649866683362553, 0.31672548892660923, 0.3269862467651725, 0.3373464962140536, 0.34716609776986274, 0.3571808124093707, 0.3669701577761081, 0.3765027505542106, 0.38470577594123045, 0.3853431510390096, 0.3837508907254361, 0.38180086283712544, 0.3797904132231405, 0.37769629690435624, 0.375124199849737, 0.37233137170088804, 0.36937832683533633, 0.36657351615326816, 0.3634967295132737, 0.3601861201031847, 0.356526496358339, 0.3508484200128002, 0.34537804499437796, 0.3398199023290759, 0.33408176643488247, 0.328424987514158, 0.3225158011808731, 0.3156139560898238, 0.308420747975624, 0.30072967242056314, 0.3018060172276793, 0.30768904419153276, 0.3134892896210344, 0.3188403389264547, 0.32422401900857367, 0.3293356232048059, 0.33489401118624257, 0.33998888888888884, 0.3450011509648057, 0.3496251350975319, 0.35006702117594685, 0.3469263958635431, 0.341439196093163, 0.3367647496081105, 0.3356054976558772, 0.339216547012828, 0.34289871712740094, 0.34658, 0.34986687167563807, 0.352866008271677, 0.35566675068200626, 0.35801051840721254, 0.35984492705856647, 0.3613916569634721, 0.3628968998628258, 0.3644109702267033, 0.36582600876636995, 0.366, 0.36685600830259535, 0.367041293415741, 0.3671371932878422, 0.36728513036703125, 0.3675125190791705, 0.36824867947921214, 0.3710387937223475, 0.3739357216796061, 0.3769753595025863, 0.38031444444444445, 0.38407356859071273, 0.38870015740508856, 0.3943605931676731, 0.40034880884139834, 0.406803655213496, 0.3977426443498344, 0.38779904500571466, 0.37779409891177873, 0.3686394966190834, 0.360561467011715, 0.3538190227342293, 0.348687393659068, 0.3451357451878236, 0.34193553329437626, 0.33846923204084517, 0.3350236351165981, 0.33143172659149395, 0.3277358722723614, 0.32350859356754974, 0.31879722828736295, 0.3140353867519187, 0.3090252770125498, 0.3039873553719008, 0.298645050051582, 0.2930641700960219, 0.2871298571780451, 0.2832281996992679, 0.28999627016002283, 0.29783117812138316, 0.3053168433132467, 0.3126256343560078, 0.3193897986393886, 0.32533991567547726, 0.33116631495034005, 0.3367242619852231, 0.3421207133883473, 0.34714557495163867, 0.3522307270233196, 0.35672436438664784, 0.36112327795864985, 0.3648575468180426, 0.3674561265548043, 0.369890708183766, 0.37240639786292673, 0.3749190377605254, 0.37747730194507056, 0.3799715713609929, 0.38228878453961107, 0.3831911451521645, 0.37594827160493827, 0.3664421578193939, 0.3567259787962267, 0.3468575798078737, 0.33702, 0.326708360804247, 0.3163511856242252, 0.3058265519597566, 0.29511109775440353, 0.2846815927255413, 0.2737739917695473, 0.2636902034733623, 0.2534832446287175, 0.24332806790484168, 0.232786520216964, 0.22281011111008048, 0.2127505935386927, 0.20269912039484733, 0.19254803840877915, 0.1824313000425642, 0.172, 0.1622115159863094, 0.1521979833535848, 0.1555462962344597, 0.16210148336749808, 0.16862852742299028, 0.17523555639034982, 0.18207516764420045, 0.18921380099330212, 0.1966423435353432, 0.2037862584522915, 0.21162961962240504, 0.21915701033392798, 0.22700951499486238, 0.23518486738623864, 0.24345694546732502, 0.25178854439713944, 0.2604067668625857, 0.2689290513954977, 0.27770645497934143, 0.2862293911773588, 0.2951644761460127, 0.3036168097050497, 0.31247948687981747, 0.30434254675105304, 0.2948609108326402, 0.2855512218398658, 0.27601263565148476, 0.26625746860503824, 0.2559335152978618, 0.24625741484841268, 0.23670988797267645, 0.22720080947213178, 0.21776085833335904, 0.20786944975723978, 0.19773348704883748, 0.18802194115422152, 0.1776906160781367, 0.16846246626040012, 0.15899598603110998, 0.1493913373403456, 0.13974868213818625, 0.13016818237471128, 0.12075, 0.11120642374154772, 0.1027622714750814, 0.09412790902598064, 0.0856138241923366, 0.07739537941397445, 0.06869180324827706, 0.06071549980985242, 0.05267017280240421, 0.04462628117724536, 0.03628086419753086, 0.027617017280240415, 0.01997354036230068, 0.012956707818930024, 0.002871961271731689, -0.007027777777777809, -0.016360980264846225, -0.025688587641541433, -0.03502953360768178, -0.044368101121406926, -0.0531573841980668, -0.06211589849108368, -0.07014739586457369, -0.07732204501911266, -0.08444478471069228, -0.09155903219523054, -0.09861588932895946, -0.10557011881904448, -0.11212481834980764, -0.12148988903420489, -0.13059103826758556, -0.13844293769240204, -0.1464849947078169, -0.1546933945928008, -0.16228566491359883, -0.17012659487436343, -0.17791969947407962, -0.18585701675462923, -0.1934478253610485, -0.20114203714525108, -0.20869403709578183, -0.21621945377661939, -0.22281196159122085, -0.23046494078629373, -0.23756828532235943, -0.24525944402704736, -0.25179019922724855, -0.2586193304125842, -0.26571224865737264, -0.27303436503593226, -0.2805510906225813, -0.2882278364916382, -0.29406960180315556, -0.29996733004980947, -0.30590642902857784, -0.3118723065364388, -0.3178503703703704, -0.3238260283273507, -0.32978468820435763, -0.33571175779836937, -0.34159264490636393, -0.34741275732531934, -0.35315750285221365, -0.35881228928402487, -0.3643625244177311, -0.3697936160503103, -0.3750909719787406, -0.38024, -0.3817891557447756, -0.3832600228177089, -0.3846549737039819, -0.3864009169647707, -0.3880217395359575, -0.3895230650861229, -0.3909105172838475, -0.39249326543673657, -0.39391785718629, -0.39543406592194785, -0.3967573258861444, -0.39808258452291506, -0.3994870548459805, -0.4008331527498225, -0.40204937668698004, -0.4029735573776743, -0.40300357444457835, -0.4031885711105546, -0.4037022908093279, -0.4038787497462122, -0.4036311332898416, -0.4033670765403242, -0.40311638062081895, -0.40251981811792037, -0.4016836213991769, -0.4008857295328553, -0.40006126032284894, -0.39897504068333584, -0.3975329143696944, -0.39706491211471945, -0.39875064362634616, -0.40322152263374483, -0.40690367396029475, -0.4097354328717231, -0.4100902092550853, -0.4088556691391003, -0.4073323441021788, -0.4055593390800156, -0.4035018518518518, -0.4012436499986087, -0.3985618568606172, -0.39579240472266797, -0.39267341482367807, -0.3887995344218638, -0.384620954169797, -0.38039422327550565, -0.37634564029232226, -0.37190255136818656, -0.36706346055185046, -0.3627273041711885, -0.35811424190893726, -0.3532234080525693, -0.34805393688955666, -0.3426049627073716, -0.33687561979348635, -0.33086504243537296, -0.3245723649205039, -0.3193345290369257, -0.31391515175219187, -0.30831378982148794, -0.30252999999999997, -0.2945714774208774, -0.2869551771876504, -0.2796609096474386, -0.2726684851473618, -0.26464758152899265, -0.2569973710680934, -0.24968296604448734, -0.2426694787379973, -0.23482085955978518, -0.22727893635879248, -0.21998830872751596, -0.2128935762584523, -0.20495411462858354, -0.19711545953360768, -0.1892949141553274, -0.18125667284002145, -0.17330314444310466, -0.1653605665882372, -0.15734095778723875, -0.14892763447143612, -0.14063392047193699, -0.13224368895567243, -0.12409492455418385, -0.11485983145401572, -0.10604558978211873, -0.09973407407407404, -0.09328355119401337, -0.0867059359434566, -0.07940332136794948, -0.07197136433202549, -0.06428391240225949, -0.05630440773411079, -0.048012512040103074, -0.039401090797785, -0.030562400352880915, -0.02195036420732166, -0.013734124718256953, -0.010869347963875103, -0.008716523710732494, -0.006553087326690035, -0.004368816560668413, 0.004243652709113373, 0.012479259259259252, 0.02083118310953633, 0.02930657094359572, 0.03736456799398947, 0.046093218688259996, 0.055434074074074066, 0.06364360855777446, 0.07220387101295579, 0.08108103681442523, 0.09024128133698993, 0.09965077995545703, 0.10927570804463366, 0.11905179250931928, 0.12816169275656264, 0.1379289639997568, 0.14790551207411326, 0.15772451640164528, 0.1671724096592906, 0.1762711402567662, 0.18537071762415502, 0.19440276038623144, 0.2042796965265346, 0.213626793390491, 0.22332690966392835, 0.23284806642076308, 0.24249286250939145, 0.2527281899703081, 0.26236770933495757, 0.27249908533349, 0.2825516402675876, 0.29185315635695797, 0.3014666800233743, 0.3027282130972, 0.29413708380612574, 0.2851891970001, 0.27613125525224697, 0.26776733895428106, 0.259648985127265, 0.2511829352807743, 0.2427021726910983, 0.23427797145003756, 0.22631643668601123, 0.218621426714858, 0.21107944221317348, 0.2038679007192628, 0.1966116266841458, 0.18928945650773626, 0.18195654825986635]; + let x: Vec = vec![ + -0.51683, + -0.5175970934423306, + -0.518354060356653, + -0.519087791495199, + -0.5197265482083357, + -0.5200158499596517, + -0.5200606483568466, + -0.5201245610270648, + -0.5202127069594011, + -0.5203231480090157, + -0.5204790003906012, + -0.519300192280936, + -0.5172525623338785, + -0.5151890488911149, + -0.5130799236833181, + -0.511021380729033, + -0.508787012065353, + -0.5057737340345604, + -0.5022504618885519, + -0.4964265433953864, + -0.48636074196716683, + -0.4764403364220719, + -0.46643530981687087, + -0.45621444778362136, + -0.44630923486471685, + -0.4363901728024042, + -0.42604223131220376, + -0.4155014249009841, + -0.4058483245679939, + -0.3956550567196297, + -0.3851559202678762, + -0.3758495147475159, + -0.36703196232295404, + -0.3585483139424033, + -0.3499590157776108, + -0.34116555495780165, + -0.3326543580380893, + -0.3240731575215475, + -0.31664918162339645, + -0.3096570153323872, + -0.3028242475979054, + -0.29284108982901147, + -0.2845606146146703, + -0.2761603975681723, + -0.2676682527756908, + -0.2586141983038218, + -0.2500177100048542, + -0.2406698388847149, + -0.2319785185185185, + -0.2230836285309992, + -0.21412117260761887, + -0.20410621532125664, + -0.19461170494868074, + -0.1861732531930878, + -0.17727609247252651, + -0.16724912507381742, + -0.1579175910621365, + -0.1484630227074335, + -0.139, + -0.12944822669094783, + -0.11986916967862482, + -0.11012672929684561, + -0.10030578512396693, + -0.09015481855592966, + -0.08002834948814745, + -0.06940427983539094, + -0.05850052715709281, + -0.0482599302792232, + -0.038, + -0.02772790036885537, + -0.017678447447642437, + -0.007649362794355151, + 0.002433400395135929, + 0.013098064874847864, + 0.0238371240926766, + 0.03357945042713639, + 0.043484832067228765, + 0.0533314864490224, + 0.06310185185185183, + 0.07260417123999918, + 0.08156318711036493, + 0.09008171035938405, + 0.09833894504683605, + 0.10600330788756862, + 0.11031914850989236, + 0.10803366279878676, + 0.10822147411261887, + 0.11320115702479337, + 0.11951197734925008, + 0.12715715641261094, + 0.13595350145676746, + 0.1455836738469276, + 0.15510569524445558, + 0.16519252134651277, + 0.1748900137174211, + 0.18456332488233007, + 0.1939605556843818, + 0.2036259101782028, + 0.21253689584344618, + 0.2214850228846984, + 0.23073356429306843, + 0.23969915852742296, + 0.24865996681435304, + 0.25696743484224965, + 0.26513401673092524, + 0.27440373234435983, + 0.28209604986710285, + 0.2884955944404765, + 0.29531399052250895, + 0.30262330363114875, + 0.31051322024448147, + 0.3186081010492642, + 0.3270241078162505, + 0.33555989928877583, + 0.3443841422283234, + 0.35314904219214904, + 0.3626550891632373, + 0.3716970047789393, + 0.3812689462114255, + 0.3909313757305737, + 0.4013315768438389, + 0.41107626335799585, + 0.42114852687676685, + 0.4312147568326877, + 0.4414696933625615, + 0.45147048027463704, + 0.4612822814926121, + 0.47129575356668424, + 0.47843737997256525, + 0.4818288287115622, + 0.48482275927317253, + 0.48763306278786234, + 0.49024, + 0.4919217543870499, + 0.493491178801586, + 0.49495206461101166, + 0.4962927717950859, + 0.4974446141653244, + 0.4984715775034294, + 0.49924021372793337, + 0.49981671872278544, + 0.49940021513986926, + 0.4982659049220909, + 0.4971584869303173, + 0.4959469196093162, + 0.4945711458426731, + 0.4930390809327846, + 0.4914486706778013, + 0.48978999999999995, + 0.4873052697776665, + 0.48660930156580606, + 0.49615530944585123, + 0.5038818252930283, + 0.5114730277986477, + 0.5191480424075465, + 0.5267040789694724, + 0.5342749761877525, + 0.5419673263190007, + 0.5491946957175057, + 0.556934072239588, + 0.5641584504570241, + 0.571464566716033, + 0.5786052752605126, + 0.5843518445345198, + 0.5901247110220664, + 0.5960441651490934, + 0.6017804279711719, + 0.6075314603436672, + 0.6130161800640834, + 0.6187243864829296, + 0.6240702133672197, + 0.6288934268302864, + 0.6347772892273412, + 0.6315034078773657, + 0.6278428229648799, + 0.6240502788521889, + 0.6201672757572667, + 0.6160564835375488, + 0.6122031914492337, + 0.6084009553137745, + 0.6042768422517184, + 0.6000061682842093, + 0.5954346024885113, + 0.5906520224384442, + 0.5859750835154937, + 0.5808925920360631, + 0.5762523237888527, + 0.571384190110471, + 0.5663205409466566, + 0.5610937262431477, + 0.5557360959456826, + 0.55028, + 0.5434335681887749, + 0.5373713554275538, + 0.5311603936724659, + 0.5250095416979714, + 0.519022629601803, + 0.5125850282232589, + 0.5065530459992228, + 0.5003283290202298, + 0.49399874782927733, + 0.4873715775034293, + 0.48046554915546646, + 0.473922043019729, + 0.46677286694101516, + 0.4650967440757951, + 0.4671385185185185, + 0.47073242410844496, + 0.47499843716215306, + 0.47962850480109753, + 0.48469781395219413, + 0.489944164613176, + 0.49589100137174214, + 0.5021474188677924, + 0.5093361718707328, + 0.5165904324646322, + 0.5241801190973092, + 0.5320335748155981, + 0.5398829688065225, + 0.5475249940585324, + 0.5512354086936089, + 0.5466945343857924, + 0.5403588728835133, + 0.5337845440219974, + 0.5270690400381738, + 0.520534883546206, + 0.5136541325096696, + 0.5067531179564236, + 0.49965592435939843, + 0.4927937988702451, + 0.4857468870420355, + 0.47871436459276984, + 0.4706007888290104, + 0.4628720438957475, + 0.4537688759444254, + 0.44517449931412906, + 0.4356989030803908, + 0.4275063197220651, + 0.41878810737721056, + 0.40956131118345984, + 0.39984297627844617, + 0.38965014779980195, + 0.3789998708851602, + 0.37072221637866265, + 0.3622040259342739, + 0.35345249046943267, + 0.3444748009015778, + 0.33527814814814816, + 0.3258697231265827, + 0.3162567167543201, + 0.3064463199487993, + 0.29644572362745913, + 0.28626211870773854, + 0.27590269610707635, + 0.2653746467429112, + 0.2546851615326822, + 0.2438414313938281, + 0.23285064724378776, + 0.22172000000000003, + 0.2102234641177617, + 0.19930716197790582, + 0.18895287002253944, + 0.1759898879726765, + 0.1639504411217573, + 0.15279133288810975, + 0.1424693666900615, + 0.1306783326376715, + 0.12004347003346391, + 0.10868899062041701, + 0.09873211924365581, + 0.08868769346356122, + 0.07790450037565738, + 0.06731264432922221, + 0.05730647828143694, + 0.046793462891335534, + 0.036609191063785476, + 0.02637943846175251, + 0.016089533607681755, + 0.006028739594702249, + -0.004123535116495025, + -0.014949861846709114, + -0.025228394546423324, + -0.03527672397889723, + -0.04531550068587106, + -0.055752060962651714, + -0.06653625738045696, + -0.07658552281307103, + -0.08660990297836031, + -0.0966306635686526, + -0.10649882544452792, + -0.11545865569272974, + -0.1250112581379554, + -0.13466714705467084, + -0.14495400645574205, + -0.15492764131468753, + -0.16502313298271976, + -0.1751122503063489, + -0.1854325925925926, + -0.19559714305590342, + -0.2065397401007319, + -0.21687907113168214, + -0.2273115593440785, + -0.2369466994503756, + -0.24714921863260703, + -0.2572209771214852, + -0.2666261274308229, + -0.27667892668136324, + -0.28731764017071026, + -0.2965862695828812, + -0.3061831864610805, + -0.31607266470438494, + -0.32621897821187085, + -0.3365864008826145, + -0.3471392066156927, + -0.3578416693101817, + -0.36865806286515806, + -0.3773691999888694, + -0.38611209639502875, + -0.39486846031996325, + -0.40362, + -0.4124193906517475, + -0.4208349599247242, + -0.42888371288644017, + -0.43658265460440554, + -0.44538357695926717, + -0.45373464317699996, + -0.46166523801426157, + -0.46920474622770925, + -0.47754575145393335, + -0.48544110215510894, + -0.4929374602364838, + -0.5000814876033058, + -0.5078745227811221, + -0.5153379698216736, + -0.5225414814814816, + -0.5291362617708563, + -0.5352953565756535, + -0.5414323173166209, + -0.547587979519715, + -0.5539393944959234, + -0.5600507493669478, + -0.5661431930879038, + -0.5719573388203019, + -0.5759792995664224, + -0.5709925845229151, + -0.563022962962963, + -0.5552984391306184, + -0.5476710415449257, + -0.5404991896930739, + -0.5337838756713137, + -0.527100191446142, + -0.5204963666457453, + -0.5146160306874479, + -0.5092286111806772, + -0.5038748342521223, + -0.4987630954582041, + -0.4929323591284748, + -0.4831027707232513, + -0.4730251834949845, + -0.46292259359228444, + -0.4527223316936326, + -0.45863119405461605, + -0.46603259259259255, + -0.473368566678931, + -0.48065602248379113, + -0.4874457400450789, + -0.4946519464618638, + -0.5021940740740741, + -0.5086776612982185, + -0.5152919525630759, + -0.5219903230653644, + -0.5287261480018015, + -0.535452802569105, + -0.5421236619639925, + -0.5481950575853423, + -0.5531199236317879, + -0.5583966540210803, + -0.563777254763738, + -0.5690535146382713, + -0.5740944429294476, + -0.5788890554148773, + -0.5835945085999265, + -0.5881644511227984, + -0.5930734508847274, + -0.5976736879662867, + -0.6024301582089645, + -0.606570177450456, + -0.6105561908339595, + -0.6147862597611665, + -0.6187700923735879, + -0.6229572001104815, + -0.6271117325793389, + -0.6308779661630074, + -0.6343433305506858, + -0.6244102689789438, + -0.6188936489679986, + -0.6131270451170207, + -0.6072879411191808, + -0.6017086590422127, + -0.595838393897139, + -0.5895137266553918, + -0.5829680852603167, + -0.5762330879038317, + -0.569614885906303, + -0.5626214913547267, + -0.5550844043330974, + -0.5479009963320584, + -0.5407378764277815, + -0.5336358858042727, + -0.5266685655040353, + ]; + let y: Vec = vec![ + 0.194, + 0.20425147918322084, + 0.2143676268861454, + 0.22440466392318248, + 0.2346247713333725, + 0.24465433953863705, + 0.25480620530372594, + 0.2650117295802634, + 0.27554658847427443, + 0.28561912096168296, + 0.2963206836243261, + 0.30649866683362553, + 0.31672548892660923, + 0.3269862467651725, + 0.3373464962140536, + 0.34716609776986274, + 0.3571808124093707, + 0.3669701577761081, + 0.3765027505542106, + 0.38470577594123045, + 0.3853431510390096, + 0.3837508907254361, + 0.38180086283712544, + 0.3797904132231405, + 0.37769629690435624, + 0.375124199849737, + 0.37233137170088804, + 0.36937832683533633, + 0.36657351615326816, + 0.3634967295132737, + 0.3601861201031847, + 0.356526496358339, + 0.3508484200128002, + 0.34537804499437796, + 0.3398199023290759, + 0.33408176643488247, + 0.328424987514158, + 0.3225158011808731, + 0.3156139560898238, + 0.308420747975624, + 0.30072967242056314, + 0.3018060172276793, + 0.30768904419153276, + 0.3134892896210344, + 0.3188403389264547, + 0.32422401900857367, + 0.3293356232048059, + 0.33489401118624257, + 0.33998888888888884, + 0.3450011509648057, + 0.3496251350975319, + 0.35006702117594685, + 0.3469263958635431, + 0.341439196093163, + 0.3367647496081105, + 0.3356054976558772, + 0.339216547012828, + 0.34289871712740094, + 0.34658, + 0.34986687167563807, + 0.352866008271677, + 0.35566675068200626, + 0.35801051840721254, + 0.35984492705856647, + 0.3613916569634721, + 0.3628968998628258, + 0.3644109702267033, + 0.36582600876636995, + 0.366, + 0.36685600830259535, + 0.367041293415741, + 0.3671371932878422, + 0.36728513036703125, + 0.3675125190791705, + 0.36824867947921214, + 0.3710387937223475, + 0.3739357216796061, + 0.3769753595025863, + 0.38031444444444445, + 0.38407356859071273, + 0.38870015740508856, + 0.3943605931676731, + 0.40034880884139834, + 0.406803655213496, + 0.3977426443498344, + 0.38779904500571466, + 0.37779409891177873, + 0.3686394966190834, + 0.360561467011715, + 0.3538190227342293, + 0.348687393659068, + 0.3451357451878236, + 0.34193553329437626, + 0.33846923204084517, + 0.3350236351165981, + 0.33143172659149395, + 0.3277358722723614, + 0.32350859356754974, + 0.31879722828736295, + 0.3140353867519187, + 0.3090252770125498, + 0.3039873553719008, + 0.298645050051582, + 0.2930641700960219, + 0.2871298571780451, + 0.2832281996992679, + 0.28999627016002283, + 0.29783117812138316, + 0.3053168433132467, + 0.3126256343560078, + 0.3193897986393886, + 0.32533991567547726, + 0.33116631495034005, + 0.3367242619852231, + 0.3421207133883473, + 0.34714557495163867, + 0.3522307270233196, + 0.35672436438664784, + 0.36112327795864985, + 0.3648575468180426, + 0.3674561265548043, + 0.369890708183766, + 0.37240639786292673, + 0.3749190377605254, + 0.37747730194507056, + 0.3799715713609929, + 0.38228878453961107, + 0.3831911451521645, + 0.37594827160493827, + 0.3664421578193939, + 0.3567259787962267, + 0.3468575798078737, + 0.33702, + 0.326708360804247, + 0.3163511856242252, + 0.3058265519597566, + 0.29511109775440353, + 0.2846815927255413, + 0.2737739917695473, + 0.2636902034733623, + 0.2534832446287175, + 0.24332806790484168, + 0.232786520216964, + 0.22281011111008048, + 0.2127505935386927, + 0.20269912039484733, + 0.19254803840877915, + 0.1824313000425642, + 0.172, + 0.1622115159863094, + 0.1521979833535848, + 0.1555462962344597, + 0.16210148336749808, + 0.16862852742299028, + 0.17523555639034982, + 0.18207516764420045, + 0.18921380099330212, + 0.1966423435353432, + 0.2037862584522915, + 0.21162961962240504, + 0.21915701033392798, + 0.22700951499486238, + 0.23518486738623864, + 0.24345694546732502, + 0.25178854439713944, + 0.2604067668625857, + 0.2689290513954977, + 0.27770645497934143, + 0.2862293911773588, + 0.2951644761460127, + 0.3036168097050497, + 0.31247948687981747, + 0.30434254675105304, + 0.2948609108326402, + 0.2855512218398658, + 0.27601263565148476, + 0.26625746860503824, + 0.2559335152978618, + 0.24625741484841268, + 0.23670988797267645, + 0.22720080947213178, + 0.21776085833335904, + 0.20786944975723978, + 0.19773348704883748, + 0.18802194115422152, + 0.1776906160781367, + 0.16846246626040012, + 0.15899598603110998, + 0.1493913373403456, + 0.13974868213818625, + 0.13016818237471128, + 0.12075, + 0.11120642374154772, + 0.1027622714750814, + 0.09412790902598064, + 0.0856138241923366, + 0.07739537941397445, + 0.06869180324827706, + 0.06071549980985242, + 0.05267017280240421, + 0.04462628117724536, + 0.03628086419753086, + 0.027617017280240415, + 0.01997354036230068, + 0.012956707818930024, + 0.002871961271731689, + -0.007027777777777809, + -0.016360980264846225, + -0.025688587641541433, + -0.03502953360768178, + -0.044368101121406926, + -0.0531573841980668, + -0.06211589849108368, + -0.07014739586457369, + -0.07732204501911266, + -0.08444478471069228, + -0.09155903219523054, + -0.09861588932895946, + -0.10557011881904448, + -0.11212481834980764, + -0.12148988903420489, + -0.13059103826758556, + -0.13844293769240204, + -0.1464849947078169, + -0.1546933945928008, + -0.16228566491359883, + -0.17012659487436343, + -0.17791969947407962, + -0.18585701675462923, + -0.1934478253610485, + -0.20114203714525108, + -0.20869403709578183, + -0.21621945377661939, + -0.22281196159122085, + -0.23046494078629373, + -0.23756828532235943, + -0.24525944402704736, + -0.25179019922724855, + -0.2586193304125842, + -0.26571224865737264, + -0.27303436503593226, + -0.2805510906225813, + -0.2882278364916382, + -0.29406960180315556, + -0.29996733004980947, + -0.30590642902857784, + -0.3118723065364388, + -0.3178503703703704, + -0.3238260283273507, + -0.32978468820435763, + -0.33571175779836937, + -0.34159264490636393, + -0.34741275732531934, + -0.35315750285221365, + -0.35881228928402487, + -0.3643625244177311, + -0.3697936160503103, + -0.3750909719787406, + -0.38024, + -0.3817891557447756, + -0.3832600228177089, + -0.3846549737039819, + -0.3864009169647707, + -0.3880217395359575, + -0.3895230650861229, + -0.3909105172838475, + -0.39249326543673657, + -0.39391785718629, + -0.39543406592194785, + -0.3967573258861444, + -0.39808258452291506, + -0.3994870548459805, + -0.4008331527498225, + -0.40204937668698004, + -0.4029735573776743, + -0.40300357444457835, + -0.4031885711105546, + -0.4037022908093279, + -0.4038787497462122, + -0.4036311332898416, + -0.4033670765403242, + -0.40311638062081895, + -0.40251981811792037, + -0.4016836213991769, + -0.4008857295328553, + -0.40006126032284894, + -0.39897504068333584, + -0.3975329143696944, + -0.39706491211471945, + -0.39875064362634616, + -0.40322152263374483, + -0.40690367396029475, + -0.4097354328717231, + -0.4100902092550853, + -0.4088556691391003, + -0.4073323441021788, + -0.4055593390800156, + -0.4035018518518518, + -0.4012436499986087, + -0.3985618568606172, + -0.39579240472266797, + -0.39267341482367807, + -0.3887995344218638, + -0.384620954169797, + -0.38039422327550565, + -0.37634564029232226, + -0.37190255136818656, + -0.36706346055185046, + -0.3627273041711885, + -0.35811424190893726, + -0.3532234080525693, + -0.34805393688955666, + -0.3426049627073716, + -0.33687561979348635, + -0.33086504243537296, + -0.3245723649205039, + -0.3193345290369257, + -0.31391515175219187, + -0.30831378982148794, + -0.30252999999999997, + -0.2945714774208774, + -0.2869551771876504, + -0.2796609096474386, + -0.2726684851473618, + -0.26464758152899265, + -0.2569973710680934, + -0.24968296604448734, + -0.2426694787379973, + -0.23482085955978518, + -0.22727893635879248, + -0.21998830872751596, + -0.2128935762584523, + -0.20495411462858354, + -0.19711545953360768, + -0.1892949141553274, + -0.18125667284002145, + -0.17330314444310466, + -0.1653605665882372, + -0.15734095778723875, + -0.14892763447143612, + -0.14063392047193699, + -0.13224368895567243, + -0.12409492455418385, + -0.11485983145401572, + -0.10604558978211873, + -0.09973407407407404, + -0.09328355119401337, + -0.0867059359434566, + -0.07940332136794948, + -0.07197136433202549, + -0.06428391240225949, + -0.05630440773411079, + -0.048012512040103074, + -0.039401090797785, + -0.030562400352880915, + -0.02195036420732166, + -0.013734124718256953, + -0.010869347963875103, + -0.008716523710732494, + -0.006553087326690035, + -0.004368816560668413, + 0.004243652709113373, + 0.012479259259259252, + 0.02083118310953633, + 0.02930657094359572, + 0.03736456799398947, + 0.046093218688259996, + 0.055434074074074066, + 0.06364360855777446, + 0.07220387101295579, + 0.08108103681442523, + 0.09024128133698993, + 0.09965077995545703, + 0.10927570804463366, + 0.11905179250931928, + 0.12816169275656264, + 0.1379289639997568, + 0.14790551207411326, + 0.15772451640164528, + 0.1671724096592906, + 0.1762711402567662, + 0.18537071762415502, + 0.19440276038623144, + 0.2042796965265346, + 0.213626793390491, + 0.22332690966392835, + 0.23284806642076308, + 0.24249286250939145, + 0.2527281899703081, + 0.26236770933495757, + 0.27249908533349, + 0.2825516402675876, + 0.29185315635695797, + 0.3014666800233743, + 0.3027282130972, + 0.29413708380612574, + 0.2851891970001, + 0.27613125525224697, + 0.26776733895428106, + 0.259648985127265, + 0.2511829352807743, + 0.2427021726910983, + 0.23427797145003756, + 0.22631643668601123, + 0.218621426714858, + 0.21107944221317348, + 0.2038679007192628, + 0.1966116266841458, + 0.18928945650773626, + 0.18195654825986635, + ]; let mut pts = Vec::with_capacity(x.len()); for (val_x, val_y) in x.iter().zip(y) { @@ -63,10 +885,7 @@ fn circle(center: [f64; 2], r: f64) -> Line<'static> { for k in 0..=steps { let a = 2.0 * PI * k as f64 / steps as f64; - pts.push([ - center[0] + r * a.cos(), - center[1] + r * a.sin(), - ]); + pts.push([center[0] + r * a.cos(), center[1] + r * a.sin()]); } Line::new("circle", pts) @@ -87,6 +906,9 @@ fn fourier_coeff() -> Vec { } fr }; + for f in 0..10 { + println!("{:?}, {:?}", fourier[f].norm(), fourier[f].arg()); + } fourier } @@ -94,7 +916,6 @@ fn disp(fourier: &[C], deg: usize, t: f64) -> Vec<[f64; 2]> { let n = fourier.len(); let deg = std::cmp::min(deg, n); - let i = z(0.0, 1.0); let mut acc = z(0.0, 0.0); @@ -113,6 +934,11 @@ fn disp(fourier: &[C], deg: usize, t: f64) -> Vec<[f64; 2]> { poly.push([acc.re, acc.im]); acc += fourier[idx(-m)] * (2.0 * PI * i * -m as f64 * t).exp(); poly.push([acc.re, acc.im]); + if m < 10 { + dbg!(fourier[0].arg()); + dbg!(&m, idx(m), fourier[idx(m)].arg()); + dbg!(&-m, idx(-m), fourier[idx(-m)].arg()); + } m += 1; } @@ -134,7 +960,10 @@ struct MyApp { impl eframe::App for MyApp { fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { egui::CentralPanel::default().show(ctx, |ui| { - ui.add(egui::Slider::new(&mut self.disp_deg, 2..=self.fr.len()).text("Degree of animation (epicycles - 1)")); + ui.add( + egui::Slider::new(&mut self.disp_deg, 2..=self.fr.len()) + .text("Degree of animation (epicycles - 1)"), + ); ui.add(egui::Slider::new(&mut self.period, 0.1..=25.0).text("Period")); ui.checkbox(&mut self.focus_mode, "focus mode"); let time = ctx.input(|i| i.time) as f64; @@ -150,18 +979,26 @@ impl eframe::App for MyApp { } } - let trail_points: Vec<[f64;2]> = self.trail.iter().map(|p| p.1).collect(); + let trail_points: Vec<[f64; 2]> = self.trail.iter().map(|p| p.1).collect(); Plot::new("scatter_plot").show(ui, |plot_ui| { if !trail_points.is_empty() { for idx in 0..trail_points.len() - 1 { - let alpha = 255 - ((time - self.trail[idx].0) / self.period * 255.0).round() as u8; + let alpha = + 255 - ((time - self.trail[idx].0) / self.period * 255.0).round() as u8; // let alpha = (255.0 * (idx as f32) / trail_points.len() as f32).round() as u8; - plot_ui.add(Line::new("trace", vec![trail_points[idx], trail_points[idx+1]]).width(2.0).color(Color32::from_rgba_unmultiplied(240, 100, 100, alpha))); + plot_ui.add( + Line::new("trace", vec![trail_points[idx], trail_points[idx + 1]]) + .width(2.0) + .color(Color32::from_rgba_unmultiplied(240, 100, 100, alpha)), + ); } for idx in 0..points.len() - 1 { - plot_ui.add(Line::new("vec", vec![points[idx], points[idx+1]]).color(Color32::from_rgb(150, 150, 150))); + plot_ui.add( + Line::new("vec", vec![points[idx], points[idx + 1]]) + .color(Color32::from_rgb(150, 150, 150)), + ); } let n = self.fr.len(); @@ -171,38 +1008,57 @@ impl eframe::App for MyApp { 0 } else { let k = (idx + 1) / 2; - if idx % 2 == 1 { k as isize } else { -(k as isize) } + if idx % 2 == 1 { + k as isize + } else { + -(k as isize) + } }; let fr_idx = ((freq % n as isize) + n as isize) as usize % n; - plot_ui.add(circle(points[idx], self.fr[fr_idx].norm()).color(Color32::from_rgb(150, 150, 150))); + plot_ui.add( + circle(points[idx], self.fr[fr_idx].norm()) + .color(Color32::from_rgb(150, 150, 150)), + ); } } // Smooth bounds transition - + let last = *points.last().unwrap(); - + if self.focus_mode { - self.target_bounds = ([last[0] - 0.1, last[1] - 0.1], [last[0] + 0.1, last[1] + 0.1]); + self.target_bounds = ( + [last[0] - 0.1, last[1] - 0.1], + [last[0] + 0.1, last[1] + 0.1], + ); } else { self.target_bounds = ([-0.7, -0.5], [0.7, 0.5]); } self.current_bounds = ( [ - self.current_bounds.0[0] + (self.target_bounds.0[0] - self.current_bounds.0[0]) * 0.1, - self.current_bounds.0[1] + (self.target_bounds.0[1] - self.current_bounds.0[1]) * 0.1, + self.current_bounds.0[0] + + (self.target_bounds.0[0] - self.current_bounds.0[0]) * 0.1, + self.current_bounds.0[1] + + (self.target_bounds.0[1] - self.current_bounds.0[1]) * 0.1, ], [ - self.current_bounds.1[0] + (self.target_bounds.1[0] - self.current_bounds.1[0]) * 0.1, - self.current_bounds.1[1] + (self.target_bounds.1[1] - self.current_bounds.1[1]) * 0.1, - ] + self.current_bounds.1[0] + + (self.target_bounds.1[0] - self.current_bounds.1[0]) * 0.1, + self.current_bounds.1[1] + + (self.target_bounds.1[1] - self.current_bounds.1[1]) * 0.1, + ], ); - plot_ui.set_plot_bounds(PlotBounds::from_min_max(self.current_bounds.0, self.current_bounds.1)); + plot_ui.set_plot_bounds(PlotBounds::from_min_max( + self.current_bounds.0, + self.current_bounds.1, + )); - // points - let scatter = Points::new("a1", points).radius(1.0).color(Color32::from_rgb(150, 150, 150)); + // points + let scatter = Points::new("a1", points) + .radius(1.0) + .color(Color32::from_rgb(150, 150, 150)); plot_ui.points(scatter); }); ctx.request_repaint(); @@ -218,7 +1074,6 @@ fn main() { println!("deg is higher than points in dataset"); } - let _ = eframe::run_native( "fourier epicycles", options, @@ -235,4 +1090,3 @@ fn main() { }), ); } - diff --git a/linear_algebra_test.py b/linear_algebra_test.py new file mode 100644 index 0000000..492f718 --- /dev/null +++ b/linear_algebra_test.py @@ -0,0 +1,5 @@ +n = [1, 2, -1] +d = 8 +p = [3, 5, 7] + +print(1) diff --git a/notes.md b/notes.md index d0ca9c9..dec113e 100644 --- a/notes.md +++ b/notes.md @@ -1583,6 +1583,8 @@ Nicht zwingend heute Hassan Schuldenliste: 02-23: 12.50 +03-04: 15.50 +03-05: 5.00 # 2026-02-24 @@ -1699,7 +1701,7 @@ Hassan Schuldenliste: - [x] Cow Hours - [x] Zuletzt geschickte Steuerunterlagen durchschauen -> Das von vor paar Monaten waren von HTB erstellte Steuererklärungen, das jetzt waren AW von Finanzamt -- [ ] Localbenefits: PIN? Gebühren? +- [q] Localbenefits: PIN? Gebühren? - [ ] Übersicht aktiver Verträge? - [ ] island Hero Frame Vorschläge - [ ] Mails schreiben für mündliche Prüfungen @@ -1725,3 +1727,146 @@ Hassan Schuldenliste: - [ ] Hold notary appointment for both Anteilskauf and GF-Abberufung - [ ] Change Handelsregister (Notar does this) +# 2026-03-02 + +- [ ] Kino +- [x] Lennart GoT +- [x] Gita +- [x] Wojtek schreiben +- [ ] Remagen + - [ ] Zusammenfassung Remagen + - [ ] Mindmap Remagen +- [ ] Ella Media + - [ ] Vertragsentwurf erstellen +- [x] Pandasay 4, 8, 128px +- [ ] Morello updaten +- [p] Rechnung Gertrudenhof +- [p] Rechnung Remagen +- [p] Rechnung Sholti +- [ ] Sachbezüge überweisen +- [ ] Localbenefits + - [x] PIN + - [ ] Gebühren? +- [ ] Übersicht aktiver Verträge? +- [ ] island Hero Frame Vorschläge +- [ ] Mails schreiben für mündliche Prüfungen +- [ ] Ust Eigenbelege +- [ ] Büro nochmal anfragen? +- [ ] Weitere Leads Thomas +- [ ] Physik +- [ ] Führerschein informieren + - [ ] Finanzierung durch GmbH + - [ ] Fink: 65€/h? + - [ ] Theorie üben +- [ ] Bob +- [ ] csv Editor +- [ ] Wojtek & R1 + - [p] Termin vereinbaren + - [ ] Hold GSV for Wojteks end at PL + - [ ] Hold notary appointment for both Anteilskauf and GF-Abberufung + - [ ] Change Handelsregister (Notar does this) + +# 2026-03-03 + +- [x] Notar antworten +- [p] Kino +- [ ] Remagen + - [ ] Zusammenfassung Remagen + - [ ] Mindmap Remagen +- [ ] Ella Media + - [ ] Vertragsentwurf erstellen +- [x] Morello updaten +- [x] Rechnung Gertrudenhof +- [x] Rechnung Remagen +- [ ] Rechnung Sholti +- [x] Sachbezüge überweisen +- [x] Localbenefits + - [x] Gebühren? + -> Siehe Mail +- [ ] Übersicht aktiver Verträge? +- [ ] island Hero Frame Vorschläge +- [ ] Mails schreiben für mündliche Prüfungen +- [ ] Ust Eigenbelege +- [ ] Büro nochmal anfragen? +- [ ] Weitere Leads Thomas +- [ ] Physik +- [ ] Führerschein informieren + - [ ] Finanzierung durch GmbH + - [ ] Fink: 65€/h? + - [ ] Theorie üben +- [ ] Bob +- [ ] csv Editor +- [ ] Wojtek & R1 + - [ ] Termin vereinbaren + - [ ] Hold GSV for Wojteks end at PL + - [ ] Hold notary appointment for both Anteilskauf and GF-Abberufung + - [ ] Change Handelsregister (Notar does this) + +# 2026-03-04 + +- [x] SEO Meeting: + - Keine Kontaktmöglichkeit / kein Secondary CTA im Heroframe + - Keywords im gleichen Teich mit großen Fischen + - Erstempfehlung: Lokalseiten + - Nicht mit Sichtbarkeit warten + - Dynamische contents gehen nicht + - Basiert auf FTP-Zugang mit Wordpress + +- [ ] Pandasay deployen +- [x] Kino +- [ ] Kino: Extraticket bestellen +- [ ] Remagen + - [x] Zusammenfassung Remagen + - [x] Mindmap Remagen + - [ ] Mindmap Remagen #2? +- [ ] Ella Media + - [ ] Vertragsentwurf erstellen +- [ ] Rechnung Sholti +- [ ] Übersicht aktiver Verträge? +- [ ] island Hero Frame Vorschläge +- [ ] Mails schreiben für mündliche Prüfungen +- [ ] Ust Eigenbelege +- [ ] Büro nochmal anfragen? +- [ ] Weitere Leads Thomas +- [ ] Physik +- [ ] Führerschein informieren + - [ ] Finanzierung durch GmbH + - [ ] Fink: 65€/h? + - [ ] Theorie üben +- [ ] Bob +- [ ] csv Editor +- [ ] Wojtek & R1 + - [ ] Termin vereinbaren + - [ ] Hold GSV for Wojteks end at PL + - [ ] Hold notary appointment for both Anteilskauf and GF-Abberufung + - [ ] Change Handelsregister (Notar does this) + +# 2026-03-05 + +LinkedIn-Notizen +- [ ] Pandasay deployen +- [ ] Kino: Extraticket bestellen +- [ ] Remagen + - [ ] Mindmap Remagen #2? +- [ ] Ella Media + - [ ] Vertragsentwurf erstellen +- [ ] Rechnung Sholti +- [ ] Übersicht aktiver Verträge? +- [ ] island Hero Frame Vorschläge +- [ ] Mails schreiben für mündliche Prüfungen +- [ ] Ust Eigenbelege +- [ ] Büro nochmal anfragen? +- [ ] Weitere Leads Thomas +- [ ] Physik +- [ ] Führerschein informieren + - [ ] Finanzierung durch GmbH + - [ ] Fink: 65€/h? + - [ ] Theorie üben +- [ ] Bob +- [ ] csv Editor +- [ ] Wojtek & R1 + - [ ] Termin vereinbaren + - [ ] Hold GSV for Wojteks end at PL + - [ ] Hold notary appointment for both Anteilskauf and GF-Abberufung + - [ ] Change Handelsregister (Notar does this) + diff --git a/pandasay/.gitignore b/pandasay/.gitignore deleted file mode 100644 index eb5a316..0000000 --- a/pandasay/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target diff --git a/pandasay/Cargo.lock b/pandasay/Cargo.lock deleted file mode 100644 index 8d8ecb7..0000000 --- a/pandasay/Cargo.lock +++ /dev/null @@ -1,1199 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - -[[package]] -name = "aligned" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee4508988c62edf04abd8d92897fca0c2995d907ce1dfeaf369dac3716a40685" -dependencies = [ - "as-slice", -] - -[[package]] -name = "aligned-vec" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc890384c8602f339876ded803c97ad529f3842aba97f6392b3dba0dd171769b" -dependencies = [ - "equator", -] - -[[package]] -name = "anstream" -version = "0.6.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" - -[[package]] -name = "anstyle-parse" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" -dependencies = [ - "anstyle", - "once_cell_polyfill", - "windows-sys", -] - -[[package]] -name = "anyhow" -version = "1.0.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" - -[[package]] -name = "arbitrary" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" - -[[package]] -name = "arg_enum_proc_macro" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "arrayvec" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" - -[[package]] -name = "as-slice" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" -dependencies = [ - "stable_deref_trait", -] - -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - -[[package]] -name = "av-scenechange" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f321d77c20e19b92c39e7471cf986812cbb46659d2af674adc4331ef3f18394" -dependencies = [ - "aligned", - "anyhow", - "arg_enum_proc_macro", - "arrayvec", - "log", - "num-rational", - "num-traits", - "pastey", - "rayon", - "thiserror", - "v_frame", - "y4m", -] - -[[package]] -name = "av1-grain" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfddb07216410377231960af4fcab838eaa12e013417781b78bd95ee22077f8" -dependencies = [ - "anyhow", - "arrayvec", - "log", - "nom", - "num-rational", - "v_frame", -] - -[[package]] -name = "avif-serialize" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375082f007bd67184fb9c0374614b29f9aaa604ec301635f72338bb65386a53d" -dependencies = [ - "arrayvec", -] - -[[package]] -name = "bit_field" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e4b40c7323adcfc0a41c4b88143ed58346ff65a288fc144329c5c45e05d70c6" - -[[package]] -name = "bitflags" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" - -[[package]] -name = "bitstream-io" -version = "4.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60d4bd9d1db2c6bdf285e223a7fa369d5ce98ec767dec949c6ca62863ce61757" -dependencies = [ - "core2", -] - -[[package]] -name = "built" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ad8f11f288f48ca24471bbd51ac257aaeaaa07adae295591266b792902ae64" - -[[package]] -name = "bumpalo" -version = "3.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" - -[[package]] -name = "bytemuck" -version = "1.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" - -[[package]] -name = "byteorder-lite" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" - -[[package]] -name = "cc" -version = "1.2.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2" -dependencies = [ - "find-msvc-tools", - "jobserver", - "libc", - "shlex", -] - -[[package]] -name = "cfg-if" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" - -[[package]] -name = "clap" -version = "4.5.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2797f34da339ce31042b27d23607e051786132987f595b02ba4f6a6dffb7030a" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24a241312cea5059b13574bb9b3861cabf758b879c15190b37b6d6fd63ab6876" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.5.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a822ea5bc7590f9d40f1ba12c0dc3c2760f3482c6984db1573ad11031420831" - -[[package]] -name = "color_quant" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" - -[[package]] -name = "colorchoice" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" - -[[package]] -name = "core2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" -dependencies = [ - "memchr", -] - -[[package]] -name = "crc32fast" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "crunchy" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" - -[[package]] -name = "either" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" - -[[package]] -name = "equator" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4711b213838dfee0117e3be6ac926007d7f433d7bbe33595975d4190cb07e6fc" -dependencies = [ - "equator-macro", -] - -[[package]] -name = "equator-macro" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "exr" -version = "1.74.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4300e043a56aa2cb633c01af81ca8f699a321879a7854d3896a0ba89056363be" -dependencies = [ - "bit_field", - "half", - "lebe", - "miniz_oxide", - "rayon-core", - "smallvec", - "zune-inflate", -] - -[[package]] -name = "fax" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f05de7d48f37cd6730705cbca900770cab77a89f413d23e100ad7fad7795a0ab" -dependencies = [ - "fax_derive", -] - -[[package]] -name = "fax_derive" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0aca10fb742cb43f9e7bb8467c91aa9bcb8e3ffbc6a6f7389bb93ffc920577d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "fdeflate" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" -dependencies = [ - "simd-adler32", -] - -[[package]] -name = "find-msvc-tools" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" - -[[package]] -name = "flate2" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "getrandom" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" -dependencies = [ - "cfg-if", - "libc", - "r-efi", - "wasip2", -] - -[[package]] -name = "gif" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5df2ba84018d80c213569363bdcd0c64e6933c67fe4c1d60ecf822971a3c35e" -dependencies = [ - "color_quant", - "weezl", -] - -[[package]] -name = "half" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" -dependencies = [ - "cfg-if", - "crunchy", - "zerocopy", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "image" -version = "0.25.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6506c6c10786659413faa717ceebcb8f70731c0a60cbae39795fdf114519c1a" -dependencies = [ - "bytemuck", - "byteorder-lite", - "color_quant", - "exr", - "gif", - "image-webp", - "moxcms", - "num-traits", - "png", - "qoi", - "ravif", - "rayon", - "rgb", - "tiff", - "zune-core 0.5.1", - "zune-jpeg 0.5.12", -] - -[[package]] -name = "image-webp" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3" -dependencies = [ - "byteorder-lite", - "quick-error", -] - -[[package]] -name = "imgref" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c5cedc30da3a610cac6b4ba17597bdf7152cf974e8aab3afb3d54455e371c8" - -[[package]] -name = "interpolate_name" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" - -[[package]] -name = "itertools" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" -dependencies = [ - "either", -] - -[[package]] -name = "jobserver" -version = "0.1.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" -dependencies = [ - "getrandom", - "libc", -] - -[[package]] -name = "lebe" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8" - -[[package]] -name = "libc" -version = "0.2.182" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" - -[[package]] -name = "libfuzzer-sys" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12a681b7dd8ce12bff52488013ba614b869148d54dd79836ab85aafdd53f08d" -dependencies = [ - "arbitrary", - "cc", -] - -[[package]] -name = "log" -version = "0.4.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" - -[[package]] -name = "loop9" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" -dependencies = [ - "imgref", -] - -[[package]] -name = "maybe-rayon" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" -dependencies = [ - "cfg-if", - "rayon", -] - -[[package]] -name = "memchr" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" - -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", - "simd-adler32", -] - -[[package]] -name = "moxcms" -version = "0.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac9557c559cd6fc9867e122e20d2cbefc9ca29d80d027a8e39310920ed2f0a97" -dependencies = [ - "num-traits", - "pxfm", -] - -[[package]] -name = "new_debug_unreachable" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" - -[[package]] -name = "nom" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" -dependencies = [ - "memchr", -] - -[[package]] -name = "noop_proc_macro" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" - -[[package]] -name = "once_cell_polyfill" -version = "1.70.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" - -[[package]] -name = "pandasay" -version = "0.1.0" -dependencies = [ - "clap", - "image", - "showie", - "textwrap", - "unicode-width", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "pastey" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec" - -[[package]] -name = "png" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" -dependencies = [ - "bitflags", - "crc32fast", - "fdeflate", - "flate2", - "miniz_oxide", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "proc-macro2" -version = "1.0.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "profiling" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773" -dependencies = [ - "profiling-procmacros", -] - -[[package]] -name = "profiling-procmacros" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52717f9a02b6965224f95ca2a81e2e0c5c43baacd28ca057577988930b6c3d5b" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "pxfm" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7186d3822593aa4393561d186d1393b3923e9d6163d3fbfd6e825e3e6cf3e6a8" -dependencies = [ - "num-traits", -] - -[[package]] -name = "qoi" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" -dependencies = [ - "bytemuck", -] - -[[package]] -name = "quick-error" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" - -[[package]] -name = "quote" -version = "1.0.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r-efi" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" - -[[package]] -name = "rand" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" -dependencies = [ - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rav1e" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b6dd56e85d9483277cde964fd1bdb0428de4fec5ebba7540995639a21cb32b" -dependencies = [ - "aligned-vec", - "arbitrary", - "arg_enum_proc_macro", - "arrayvec", - "av-scenechange", - "av1-grain", - "bitstream-io", - "built", - "cfg-if", - "interpolate_name", - "itertools", - "libc", - "libfuzzer-sys", - "log", - "maybe-rayon", - "new_debug_unreachable", - "noop_proc_macro", - "num-derive", - "num-traits", - "paste", - "profiling", - "rand", - "rand_chacha", - "simd_helpers", - "thiserror", - "v_frame", - "wasm-bindgen", -] - -[[package]] -name = "ravif" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef69c1990ceef18a116855938e74793a5f7496ee907562bd0857b6ac734ab285" -dependencies = [ - "avif-serialize", - "imgref", - "loop9", - "quick-error", - "rav1e", - "rayon", - "rgb", -] - -[[package]] -name = "rayon" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "rgb" -version = "0.8.53" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b34b781b31e5d73e9fbc8689c70551fd1ade9a19e3e28cfec8580a79290cc4" - -[[package]] -name = "rustversion" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "showie" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98ecfb576a8715489f726c70fbbd26d56c83422fce4bfe55722ed374db6984e0" -dependencies = [ - "image", -] - -[[package]] -name = "simd-adler32" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" - -[[package]] -name = "simd_helpers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" -dependencies = [ - "quote", -] - -[[package]] -name = "smallvec" -version = "1.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" - -[[package]] -name = "smawk" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" - -[[package]] -name = "stable_deref_trait" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "textwrap" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" -dependencies = [ - "smawk", - "unicode-linebreak", - "unicode-width", -] - -[[package]] -name = "thiserror" -version = "2.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tiff" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af9605de7fee8d9551863fd692cce7637f548dbd9db9180fcc07ccc6d26c336f" -dependencies = [ - "fax", - "flate2", - "half", - "quick-error", - "weezl", - "zune-jpeg 0.4.21", -] - -[[package]] -name = "unicode-ident" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" - -[[package]] -name = "unicode-linebreak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" - -[[package]] -name = "unicode-width" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" - -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - -[[package]] -name = "v_frame" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666b7727c8875d6ab5db9533418d7c764233ac9c0cff1d469aec8fa127597be2" -dependencies = [ - "aligned-vec", - "num-traits", - "wasm-bindgen", -] - -[[package]] -name = "wasip2" -version = "1.0.2+wasi-0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" -dependencies = [ - "wit-bindgen", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.113" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60722a937f594b7fde9adb894d7c092fc1bb6612897c46368d18e7a20208eff2" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.113" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac8c6395094b6b91c4af293f4c79371c163f9a6f56184d2c9a85f5a95f3950" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.113" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3fabce6159dc20728033842636887e4877688ae94382766e00b180abac9d60" -dependencies = [ - "bumpalo", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.113" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0e091bdb824da87dc01d967388880d017a0a9bc4f3bdc0d86ee9f9336e3bb5" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "weezl" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" - -[[package]] -name = "windows-link" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" - -[[package]] -name = "windows-sys" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" -dependencies = [ - "windows-link", -] - -[[package]] -name = "wit-bindgen" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" - -[[package]] -name = "y4m" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5a4b21e1a62b67a2970e6831bc091d7b87e119e7f9791aef9702e3bef04448" - -[[package]] -name = "zerocopy" -version = "0.8.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d35d663eadb6c932438e763b262fe1a70987f9ae936e60158176d710cae4a" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "zune-core" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" - -[[package]] -name = "zune-core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb8a0807f7c01457d0379ba880ba6322660448ddebc890ce29bb64da71fb40f9" - -[[package]] -name = "zune-inflate" -version = "0.2.54" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" -dependencies = [ - "simd-adler32", -] - -[[package]] -name = "zune-jpeg" -version = "0.4.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ce2c8a9384ad323cf564b67da86e21d3cfdff87908bc1223ed5c99bc792713" -dependencies = [ - "zune-core 0.4.12", -] - -[[package]] -name = "zune-jpeg" -version = "0.5.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "410e9ecef634c709e3831c2cfdb8d9c32164fae1c67496d5b68fff728eec37fe" -dependencies = [ - "zune-core 0.5.1", -] diff --git a/pandasay/Cargo.toml b/pandasay/Cargo.toml deleted file mode 100644 index 1ad4710..0000000 --- a/pandasay/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "pandasay" -version = "0.1.0" -edition = "2024" - -[dependencies] -image = "0.25.9" -showie = "2.0.1" -clap = { version = "4.5.60", features = ["derive"] } -textwrap = "0.16.2" -unicode-width = "0.2.2" diff --git a/pandasay/src/main.rs b/pandasay/src/main.rs deleted file mode 100644 index 1dbaa44..0000000 --- a/pandasay/src/main.rs +++ /dev/null @@ -1,47 +0,0 @@ -use clap::Parser; -use image::load_from_memory; - -use std::io::{self, Read}; - -mod speech; - -#[derive(Parser)] -struct Args { - #[arg(short, long, default_value_t = 32)] - res: u8, -} - -const BYTES_32: &[u8] = include_bytes!( - "/home/jan/pl/nextcloud/Pandaloop/Intern/logos/pl_logo_r1/logo_pixel_art_32.png" -); -const BYTES_64: &[u8] = include_bytes!( - "/home/jan/pl/nextcloud/Pandaloop/Intern/logos/pl_logo_r1/logo_pixel_art_64.png" -); - -fn main() { - let args = Args::parse(); - - let mut input_buffer = String::new(); - let _ = io::stdin().read_to_string(&mut input_buffer); - - let bytes = match args.res { - 32 => BYTES_32, - 64 => BYTES_64, - _ => panic!("Res should be 32 or 64"), - }; - - let img = load_from_memory(bytes).expect("Failed to decode embedded image"); - let s = showie::render(&img); - - println!( - "{}\n{}", - speech::print( - &input_buffer.trim(), - &speech::FormatOptions { - think: false, - width: 300, - }, - ), - s - ); -} diff --git a/pandasay/src/speech.rs b/pandasay/src/speech.rs deleted file mode 100644 index b46e967..0000000 --- a/pandasay/src/speech.rs +++ /dev/null @@ -1,110 +0,0 @@ -use textwrap::wrap; - -use unicode_width::UnicodeWidthStr; - -pub struct FormatOptions { - pub think: bool, - pub width: u16, -} - -struct Chars { - arrow: &'static str, - top: &'static str, - bottom: &'static str, - left: &'static str, - right: &'static str, - single_left: &'static str, - single_right: &'static str, - angled_up_right: &'static str, - angled_up_left: &'static str, - angled_down_right: &'static str, - angled_down_left: &'static str, -} - -static SAY_CHARS: Chars = Chars { - arrow: "\\", - top: "-", - bottom: "-", - left: "|", - right: "|", - single_left: "<", - single_right: ">", - angled_up_right: "/", - angled_up_left: "\\", - angled_down_right: "\\", - angled_down_left: "/", -}; - -static THINK_CHARS: Chars = Chars { - arrow: "○", - top: "⏜", - bottom: "⏝", - left: "(", - right: ")", - single_left: "(", - single_right: ")", - angled_up_right: "⎛", - angled_up_left: "⎞", - angled_down_right: "⎝", - angled_down_left: "⎠", -}; - -#[must_use] -pub fn generate(message: &str, format_opts: &FormatOptions) -> String { - let think = format_opts.think; - let width = format_opts.width; - - let chars = if think { &THINK_CHARS } else { &SAY_CHARS }; - let mut lines = wrap(message, width as usize); - let longest = lines.iter().map(|line| line.width()).max().unwrap(); - - format!( - " - {} -{} - {} - {} - {}", - chars.top.repeat(longest), - if lines.len() == 1 { - format!("{} {} {}", chars.single_left, lines[0], chars.single_right) - } else { - let mut result = format!( - "{} {}{}{}", - chars.angled_up_right, - lines[0], - " ".repeat(longest - lines[0].width() + 1), - chars.angled_up_left - ); - lines.remove(0); - let last = lines.pop().unwrap(); - - for line in lines { - result = format!( - "{}\n{} {}{}{}", - result, - chars.left, - line, - " ".repeat(longest - line.width() + 1), - chars.right, - ); - } - - format!( - "{}\n{} {}{}{}", - result, - chars.angled_down_right, - last, - " ".repeat(longest - last.width() + 1), - chars.angled_down_left, - ) - }, - chars.bottom.repeat(longest), - chars.arrow, - chars.arrow, - ) -} - -pub fn print(message: &str, format_opts: &FormatOptions) -> String { - format!("{}", generate(message, &format_opts)) -}