pr06lefs

joined 11 months ago
[–] pr06lefs@lemmy.ml 0 points 1 day ago

Lol is that all you got? Still looking for that list of moderates who stand ready to expand the supreme court.

[–] pr06lefs@lemmy.ml -2 points 1 day ago (2 children)

Again making up views of your opponents so you can go off on childish edgy rants.

[–] pr06lefs@lemmy.ml -2 points 1 day ago (4 children)

Who the fuck do you think you're talking to? I'm saying those moderates don't exist, that that support doesn't exist for packing the court. You're blaming me for saying they do exist, and that the support for packing the court wasn't there when I said it was? But I didn't fucking say that support was there dumbass.

[–] pr06lefs@lemmy.ml 0 points 1 day ago (6 children)

I don't think Manchin and Sinema would go for court packing. And I'd count on zero republicans to vote with that. Who exactly are these moderates you were thinking of?

[–] pr06lefs@lemmy.ml -2 points 1 day ago (8 children)

Striking down Roe v Wade was not an act of the Democrat administration. It was struck down by a Republican supreme court.

[–] pr06lefs@lemmy.ml 3 points 5 days ago

The debate site is stormed by fascist militia, most democrats in the building are killed. Trump survives thanks to far right connections and mainstream media plays him up as a profile in courage.

[–] pr06lefs@lemmy.ml 1 points 6 days ago

never stopped at my house

[–] pr06lefs@lemmy.ml 10 points 1 week ago

Plastic bottles weren't invented in the 21st century

[–] pr06lefs@lemmy.ml 52 points 1 week ago (1 children)

proof-of-work blockchains. instead of a utopian decentralized currency we have a utopia for scammers and day traders, and uses a ton of energy at a time when we need to conserve to combat global warming.

[–] pr06lefs@lemmy.ml 33 points 1 week ago (3 children)

In some religions walking away from the church means being excluded from family, social, and business contacts. So cutting ties with everyone you know basically.

[–] pr06lefs@lemmy.ml 10 points 2 weeks ago

more music related subs, like bluegrass, old time, etc. and active users to go in them.

[–] pr06lefs@lemmy.ml 6 points 3 weeks ago (1 children)

pricing is in line with the top ipad. I consider it kind of an activist move to buy one of these though, more about supporting a cause than getting a device with maximal functionality.

 

I've just been using the audio player on ES File Explorer. It tends to forget all its state and has various other UI problems.

I'm interested in an audio player that will keep playlists for me, and remembers its state so I can resume playback. My main use case is to cue up podcasts for driving, so I want it to save my place when I don't finish listening to a whole episode during my drive. Saving my place in multiple playlists would be great too, like an audiobook and a series of podcast episodes would both have saved state so I could switch between them.

Ideally it would also activate playback whenever the phone connects to a particular bluetooth device - my car audio. The use case is I hop in the car, turn on my bluetooth receiver, and audio resumes without me needing to take the phone out of my pocket. Turn off bluetooth, playback stops.

 

Is there a term for that phenomenon where someone gets so far into a topic that they become unaware of how much contextual knowledge they have about it?

Then they write some inscrutable technical docs, use unexplained acronyms, or tell a story about “he”, "she’ and/or “they” where you have no idea who they’re talking about.

 

Ed: solved with the help of the async_stream crate.

I'm struggling with the borrow checker!

My problem: I'm using actix-web and rusqlite. I want to return an unlimited number of records from an rusqlite query, and actix provides a Stream trait for that kind of thing. You just impl the trait and return your records from a poll_next() fn.

On the rusqlite side, there's this query_map that returns an iterator of records from a query. All I have to do is smush these two features together.

So the plan is to put the iterator returned by query_map into a struct that impls Stream. Problem is the lifetime of a var used by query_map. How to make the var have the same lifetime as the iterator??

So here's the code:

pub struct ZkNoteStream<'a, T> {
  rec_iter: Box<dyn Iterator<Item = T> + 'a>,
}

// impl of Stream just calls next() on the iterator.  This compiles fine.
impl<'a> Stream for ZkNoteStream<'a, serde_json::Value> {
  type Item = serde_json::Value;

  fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
    Poll::Ready(self.rec_iter.next())
  }
}

// init function to set up the ZkNoteStream.
impl<'a> ZkNoteStream<'a, Result<ZkListNote, rusqlite::Error>> {
  pub fn init(
    conn: &'a Connection,
    user: i64,
    search: &ZkNoteSearch,
  ) -> Result<Self, Box<dyn Error>> {
    let (sql, args) = build_sql(&conn, user, search.clone())?;

    let sysid = user_id(&conn, "system")?;
    let mut pstmt = conn.prepare(sql.as_str())?;

    // Here's the problem!  Borrowing pstmt.
    let rec_iter = pstmt.query_map(rusqlite::params_from_iter(args.iter()), move |row| {
      let id = row.get(0)?;
      let sysids = get_sysids(&conn, sysid, id)?;
      Ok(ZkListNote {
        id: id,
        title: row.get(1)?,
        is_file: {
          let wat: Option<i64> = row.get(2)?;
          wat.is_some()
        },
        user: row.get(3)?,
        createdate: row.get(4)?,
        changeddate: row.get(5)?,
        sysids: sysids,
      })
    })?;

    Ok(ZkNoteStream::<Result<ZkListNote, rusqlite::Error>> {
      rec_iter: Box::new(rec_iter),
    })
  }
}

And here's the error:

error[E0515]: cannot return value referencing local variable `pstmt`
   --> server-lib/src/search.rs:170:5
    |
153 |       let rec_iter = pstmt.query_map(rusqlite::params_from_iter(args.iter()), move |row| {
    |                      ----- `pstmt` is borrowed here
...
170 | /     Ok(ZkNoteStream::<Result<ZkListNote, rusqlite::Error>> {
171 | |       rec_iter: Box::new(rec_iter),
172 | |     })
    | |______^ returns a value referencing data owned by the current function

So basically it boils down to pstmt getting borrowed in the query_map call. It needs to have the same lifetime as the closure. How do I ensure that?

2
submitted 8 months ago* (last edited 8 months ago) by pr06lefs@lemmy.ml to c/nixos@lemmy.ml
 

I miss RPAN! I could connect with my phone and stream any time, and there would be viewers, if only a few at times. Sometimes a lot though. It was great practice playing for an audience. Lots of great feedback and interactions, helped get me through the pandemic.

What's out there in the fediverse that's similar, if anything?

26
submitted 11 months ago* (last edited 11 months ago) by pr06lefs@lemmy.ml to c/guitars@lemmy.world
 

Does having too many pickups affect guitar tone, or sustain? Let's suppose a guitar has eight pickups while another one has just one of the same type. Would there be a tone difference, if the mega-pickup one was only using one of its pickups in a similar position to the single pickup guitar? Or would the effect of the extra pickups be too small to notice?

 

cross-posted from: https://lemmy.ml/post/2365391

I'm on lemmy.ml, and I want to subscribe to https://lemmy.world/c/songaweek. There it says to put !songaweek@lemmy.world into search on my instance to subscribe, but it doesn't turn up anything. Anyone know why this might be, and/or how to work around it?

 

I'm on lemmy.ml, and I want to subscribe to https://lemmy.world/c/songaweek. There it says to put !songaweek@lemmy.world into search on my instance to subscribe, but it doesn't turn up anything. Anyone know why this might be, and/or how to work around it?

view more: next ›