• 0 Posts
  • 28 Comments
Joined 2 months ago
cake
Cake day: March 19th, 2025

help-circle


  • They’re the “independents”… they’ll vote for whoever comes along and tells them what they want to hear and they’ll not investigate further.

    This is why Bernie got so close. Trump’s messaging is cathartic for them. “We’re gonna get the guys who did this to you!” Trump yells, standing behind the guys that did this to them.

    Bernie’s messaging was “Shit has been bad for a long time. Let’s fix it. Tell me your problem and we’ll work something out. The rich fucked you over. We’re gonna make them pay taxes.”

    Dems if they want to stay one party, need to find that messaging again. Hell Dwight D Eisenhower could get elected as a dem these days.

    Shit’s fucked.














  • The Allure of the Fediverse and the Challenges of ActivityPub Implementation

    The fediverse—a decentralized social web powered by protocols like ActivityPub—is an exciting space to explore. If you’re considering building the next great federated app, connected to platforms like Mastodon, Lemmy, Pixelfed, and more, you might be tempted to implement ActivityPub from scratch. While this approach offers total control, it’s a daunting task due to the complexity of the standards involved.

    The Challenge: Data Modeling with ActivityStreams & JSON-LD

    At its core, ActivityPub relies on ActivityStreams 2.0 vocabulary and JSON-LD syntax. This combination introduces significant complexity:

    1. Understanding ActivityStreams Vocabulary:
      You need to model actions and objects (e.g., posts as Note or Article, profiles as Person or Organization, and actions like Create, Follow, Like, Announce) using the precise terms defined in the specification.

    2. JSON-LD Specifics:
      JSON-LD has unique rules that complicate direct JSON manipulation:

      • Missing vs. Empty Arrays: A property being absent is often semantically identical to it being present with an empty array.
        // No name property
        { "@context": "https://www.w3.org/ns/activitystreams", "type": "Note", "content": "…"}
        
        // Equivalent to:
        { "@context": "https://www.w3.org/ns/activitystreams", "type": "Note", "name": [], "content": "…"}
        
      • Single Value vs. Array: A property can hold a single value or an array.
        // Single value
        { "@context": "https://www.w3.org/ns/activitystreams", "type": "Note", "content": "Hello"}
        
        // Equivalent to:
        { "@context": "https://www.w3.org/ns/activitystreams", "type": "Note", "content": ["Hello"]}
        
      • Object References vs. Embedded Objects: Properties can contain either embedded objects or URI references.
        // Embedded object
        {
          "@context": "https://www.w3.org/ns/activitystreams",
          "type": "Announce",
          "actor": { "type": "Person", "id": "http://sally.example.org/", "name": "Sally" },
          "object": { "type": "Arrive", "id": "https://sally.example.com/arrive", /* ... */ }
        }
        
        // Equivalent to:
        {
          "@context": "https://www.w3.org/ns/activitystreams",
          "type": "Announce",
          "actor": "http://sally.example.org/",
          "object": "https://sally.example.com/arrive"
        }
        

    Fedify: Simplifying ActivityPub Development

    Fedify, a TypeScript framework, abstracts the complexity of ActivityPub development. It handles the heavy lifting, allowing you to focus on what makes your app unique.

    Example Code with Fedify

    Fedify simplifies federation logic:

    // Handle follow
    federation.on(Follow, async (ctx, follow) => {
      // Implement follow logic
    });
    
    // Handle post activity
    federation.on(Create, async (ctx, activity) => {
      // Implement post activity logic
    });
    

    Web Interface and Logs

    When running your app:

    Web interface available at: http://localhost:8000/
    

    Logs example:

    .lhr.life/r/2 | ╰─────────────────┴───────────────────────────────────────╯
    

    Conclusion

    Building a federated app with ActivityPub is challenging, but tools like Fedify make the process manageable. By abstracting away the complexity of JSON-LD and ActivityStreams, Fedify allows developers to focus on creating innovative applications for the fediverse.



  • mutual_ayed@sh.itjust.workstoTechnology@lemmy.world*Permanently Deleted*
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    2
    ·
    26 days ago

    How are C-level execs going to justify the bloated AI budget if they cannot point to a research study now? Actual research takes time they don’t have as the 1st quarter is almost over.

    How will the researchers get more grant money to spend on inefficient transform models if they have to waste time and resources conducting peer reviewed study? I need my name on 10 papers this year or I’ll lose my faculty position.

    Better yet, why not have AI draft a self report form and email it out to all of the students in my department and publish the results of that as research? I’m a genius.

    -Yu

    /s