Skip Navigation
My workflow for writing SQL(ite) queries (2024 edition)
  • Neat, I also saw something recently using https://github.com/kristijanhusak/vim-dadbod-ui to tinker, test and save SQL.

  • NeoVim 0.10 Released!
  • Also my CPU now longer overheats when holding space. WTF?

  • Denethor's Facebook posts are getting out of control
  • I can already seen it, you chipping a tooth and splitting a lip because you figured it would look cool to nun-chuck the food into your mouth.

  • Logitech being Logitech
  • Not sure recently, had the same issue and busted 2 deathadders within 12 months of purchase. The clicker had a little stem to push the switch which cracked off. Ended up getting a zowie next and haven't had any issues.

  • Iced Tutorial 0.12

    Original submission text (Bruce Hopkins): >Iced is an amazing library. I chose it for building a simple Code Editor. But Iced severely lacks documentation. I wrote this article as a good entry point into using Iced that can be easy to understand as long as you know Rust. I explain the parts that confused me when I began using the library, so I hope that my mistakes can be useful for someone else. >I might write articles into the more advanced topics in Iced, so if this article is something that you like, let me know.

    0
    Removed
    Rust, implemented in something real
  • Create a struct in Rust called Statistics that holds a list of numbers and implement methods to calculate these statistics. For example, you could have methods to calculate the mean, median and mode of the numbers stored in the structure.

    The code

    use std::collections::HashMap; 
    struct Statistics { numbers: Vec, } 
    
    impl Statistics { fn new(numbers: Vec) -> Self { Statistics { numbers } } fn mean(&self) -> Option { let sum: f64 = self.numbers.iter().sum(); let count = self.numbers.len() as f64; if count > 0 { Some(sum / count) } else { None } } fn median(&mut self) -> Option { self.numbers.sort_by(|a, b| a.partial_cmp(b).unwrap()); let len = self.numbers.len(); if len == 0 { return None; } if len % 2 == 0 { let mid = len / 2; Some((self.numbers[mid - 1] + self.numbers[mid]) / 2.0) } else { Some(self.numbers[len / 2]) } } fn mode(&self) -> Option { let mut map = HashMap::new(); for &num in &self.numbers { *map.entry(num).or_insert(0) += 1; } let max_value = map.values().max()?; let mode = map.iter().find(|&(_, &count)| count == *max_value)?; Some(*mode.0) } } fn main() { let numbers = vec![1.0, 2.0, 3.0, 4.0, 5.0, 5.0, 6.0, 6.0, 6.0]; let stats = Statistics::new(numbers.clone()); 
    println!("Numbers: {:?}", numbers); 
    println!("Mean: {:?}", stats.mean()); 
    println!("Median: {:?}", stats.median()); 
    println!("Mode: {:?}", stats.mode()); 
    } ```
     This code creates the struct Statistics, which has a vector of numbers. It implements methods to calculate the mean, median and mode of these numbers. The mean method calculates the mean of the numbers, median calculates the median and mode calculates the mode. Note that these methods return Option, as they may not be applicable (for example, if the array of numbers is empty).
  • [Louis Rossmann] Is All Piracy Equal? Exploring Gray Areas: When Is It REALLY "Stealing" ??
  • Confusing by-line for link goes to an older video by Louis, actual yt link for video is https://www.youtube.com/watch?v=7yo8av6w4sc

  • Twelve years after the death of Steve Jobs, the cracks are starting to appear at Apple
  • Sure, ultimately I dismissed it at the time as a fancy iPod and chose a Nokia.

  • Twelve years after the death of Steve Jobs, the cracks are starting to appear at Apple
  • At the time iPhone 1 didn't seem like anything smarter than an iPod that could take calls. I was hyped over the Nokia 770 and eager to see what else would come out with Meamo OS. It took till mid 2008 until iPhone 3G and iOS 2 (and app store) were released.

  • What is your favourite Open-Source game?
  • That's a continuation of TA Spring? Neat, played that a looong time ago.

  • Do we have to share a stapler?
  • Pretty sure the strong smell of 'lynx' or 'axe' style spray just enhances the repulsiveness of BO stank.

  • Exam Answer
  • Nah, just using one of those handy pens with blue, black & 2 red ink. ;)

  • Pick One: Which is your favorite way to read books?
  • I think there is a similar effect with speed-reading v slow-reading. Slow reading gives me time to mull over and digest what I'm reading, while speed can be good to skim for information.

  • Btw
  • ILoveCandy

  • mice
  • Btw
  • (yes sir)

  • rule shame
  • Huh, dickhead confirmed

  • Modern web bloat means some pages load 21MB of data - entry-level phones can't run some simple web pages, and some sites are harder to render than PUBG
  • Haven't done this type of optimizing in a long time, I had a quick look at the network graph for your front page (F12 dev tools in desktop browser), my understanding is it looks like you are getting blocked from loading additional resources (fonts + background) until your style sheets are fully read --pink line is document loaded i believe.

    It may be worthwhile to experiment with adding some preload links to the html template? or output? like below and assessing if it makes things faster for you.

    <link rel="preload" as="image" href="https://volcanolair.co/img/bg1-ultracompressed.webp" fetchpriority="high">

    <link rel="preload" as="font" href="https://volcanolair.co/fonts/Inter-Regular.woff2">

    <link rel="preload" as="font" href="https://volcanolair.co/fonts/Inter-Bold.woff2">

    ___

  • autokludge autokludge @programming.dev
    Posts 1
    Comments 169