Cody Casterline: Posts

Cody Casterlinecommented

“oh you’d” → Oculus

😣

The hazards of posting from a phone with autocorrect.

Cody Casterlinecommented

The hours-long splitting headache you get from playing oh you’d games? Still free! 😆

Cody Casterline

Fresh Looks Cool!

When Node became popular, I never understood the hype around server-side JavaScript, other than that it took what had before then been mostly client-side and making it usable on the server.

But the pitfalls of writing large systems on the server without type checking seemed too great. And I wasn't that fond of JavaScript at the time.

By the time I got around to playing with Node more seriously, TypeScript was a thing. In FeoBlog I wanted to write a browser-based client that would both be a nice UI and a great demo of the client/server capabilities of the system. I chose Svelte as my UI toolkit, and I very much enjoy the features it offers. However, bundling JavaScript for the browser is still a pain to get working. And if you ship everything as a Single-Page Application, you lose out on indexing, and old/underpowered browsers.

FeoBlog actually has remnants of an early server-side template system which it falls back on for that purpose, but you lose out on a lot of features, and it's lost parity with the new Svelte UI. It would be nice if I could write code once and have it render on the server OR the client.

So now I'm starting to see the appeal of server-side JS. But... I don't really want to run Node. Thankfully there's Deno, which I've already enjoyed writing some scripts for.

AND, there's a cool new web framework called Fresh. It's got the same super-fast dev cycle that I've enjoyed with Deno, and the result is code that can render things on the server OR client.

If you want to see a(n incidental) demo of Fresh, take a look at Deno Deploy: Crazy Fast Cloud Functions - Architecture Speedun, which is where I first discovered it.

Looking forward to see where this goes!

Cody Casterlinecommented

LOL. The two things Trump loves most are himself and an audience. He'll be back the second they allow him.

Cody Casterline

I do not have a kind view of anyone who brags about not voting. And anyone trying to convince you not to vote has motives you should definitely question.

… But watching the Democrats just roll over on every damned thing is really making it feel like a pointless ritual. Democracy Theater.

  • Continued and renewed efforts at voter suppression
  • Packing the supreme court
  • The timid handling of Jan. 6th insurrectionists. (Including a supreme court justice and former president!)
  • Now, their reaction to Roe v. Wade is
    • "Still not time to end the filibuster"
    • "Need more police protection for these poor SCOTUS judges!"
    • "Let's talk about something else."

They're guaranteed the vote of anyone like me who is against what Republicans are doing, so won't throw away their vote on a further-left party. But as a result they keep moving right to try to pick up more "middle" voters.

Feeling a bit frustrated and hopeless about the future for the U.S.

Just to be clear, though: I'll still be voting.

Cody Casterline

Uhh, WaPo… is this an ad for Trump? "Inaction" as democracy "came under attack"? He was and is continuing to attack democracy by continuing to lie about the legitimacy of the election. He spoke at the rally that ended up invading the capitol while the election was being finalized! And told them to do it! WTF kind of reframing is this?

This is as bad as the bootlicking "shots were fired and someone died at an altercation involving police" trope.

Screen Shot 2022-05-09 at 1.57.32 PM.jpg

Cody Casterline

I've been writing Java since before Generics and still ran into this landmine:

Coworker (reviewing my code): container.contains(null) can throw a NullPointerException.

Me: I don't think so, the docs say:

Returns true if this collection contains the specified element. More formally, returns true if and only if this collection contains at least one element e such that (o==null ? e==null : o.equals(e)).

And this code works as I expect:

import java.util.*;

public class Contains {
    public static void main(String[] args) {

        // Interestingly, List.of requires all its elements be non-null. Weird.
        // var list1 = List.of("foo", "bar", "baz");
        // var list2 = List.of("foo", "bar", null);

        var list1 = makeCollection("foo", "bar", "baz");
        var list2 = makeCollection("foo", "bar", null);
        
        check(list1);
        check(list2);
    }

    private static Collection<String> makeCollection(String... args) {
        // return Arrays.asList(args);
        return new HashSet<String>(Arrays.asList(args));
    }

    private static void check (Collection<String> list) {
        System.out.println(list.contains(null));
    }
}

Coworker: read a bit further. Docs also say:

Throws […] NullPointerException - if the specified element is null and this collection does not permit null elements (optional)

… sure enough. In my case I'm actually using a Set.of(predefined, elements), and that particular implementation will throw if passed a null.

UGHHh. NULLS.

FWIW, Kotlin handles this much more nicely:

fun main() {
    val c1 = setOf("foo", "bar")
    val c2 = setOf("foo", null)

    
    val value: String? = null
    println(c1.contains(value))
    println(c2.contains(value))
}

… though you can only depend on that sane behavior when using its setOf() constructor. If you might ever be passed a non-null-safe Java Collection you're back to needing to protect yourself against NPEs.

Cody Casterline

Roe v. Wade

So the Supreme Court is going to overturn Roe v. Wade and basically let religious fundamentalists control women's bodies.

I feel the need to write something about it.

But then the next thought is: Oh, I should take some time, really organize my thoughts, find links to sources, etc, etc. That way lies me never writing anything. "Perfect is the enemy of good [enough]", etc.

So instead, here's my stream-of-thought braindump.


First, this is terrible. It's terrible for women. Especially in states that want to ban abortion. (And even with RvW many had already effectively banned it by making it practically unavailable.) Especially poor women who don't have the means and connections to leave for more liberal states.

If the court is saying there is no right to privacy, next you'll have states start outlawing contraception.

Then they'll pass laws saying it's illegal to travel to another state to get an abortion. (I think some already exist for minors?)

Without a right to privacy, anti-sodomy laws are back on the table, and also gay marriage bans.

Without a right to privacy, the government can regulate all sorts of personal details about your life with … what limits?

The permissibility of abortion, and the limitations, upon it, are to be resolved like most important questions in our democracy: by citizens trying to persuade one another and then voting.

Yeah, because that worked out so well for slavery, and interracial marriage, and segregation, and gay marriage. And, oh, what's that? Abortion.

It's just such a big "fuck you". "If you want rights, you should merely convince the majority to stop taking them from you."

And, as I've seen others point out, that's a double "fuck you" in the context of the court recently gutting the Voting Rights Act and states ramping up voter suppression and gerrymandering.

The political process is broken and I don't see it getting better any time soon.

Cody Casterline

$OurProduct is a love letter to $audience. ❤️

Look, if you're describing something as a "love letter" and then charging money for it, that's "solicitation".

Cody Casterline

Cool flower

A803E7AA-3945-482A-A96A-005F8E7932B6.jpeg

Saw this one while out yesterday. Anybody know what kind of flower it is?

Cody Casterline

Uh-oh. "Svelte" has taken over as the language with the most lines of code in FeoBlog.

image.png

It's funny. I started FeoBlog because I wanted the data structure to be the way that distributed social networks work. But in order to make using that appealing, you've got to have a nice UI. And it turns out there's a lot involved in working toward one of those. Who knew?

Cody Casterline

Twitter

So sounds like Twitter's getting bought in a hostile takeover.

I've been working on the next version of FeoBlog and I had a couple more features that I wanted to sneak in, but I should just release what I've got. (Agile! (lulz))

If you want to help me test it, or just want to play around with an open, distributed platform let me know!

Cody Casterline

I've been working on the next version of FeoBlog quite a bit lately. It's been fun!

One of the new features will be allowing FeoBlog to remember your private key for you, since working with them can be a bit cumbersome. I enjoyed this little experimental UI for letting users configure that behavior based on their preferred security level:

SecurityLevel.gif.gif

However, it ended up being a bit cumbersome to use in practice, so I'm going to change it to instead give you all the options, and then details about the security implications of the options you set. That way, it's less about shaming the user to choose the higher security level, and more about letting them configure it how they want and informing them of the consequences.

Another of the new features is Windows support! I switched to using ESBuild instead of Snowpack. Not only is it able to properly bundle, on Windows, I think it's actually faster as well. AND I found a plugin that lets me write my web worker as a module and inline it within the app bundle. 🎉 Definitely would recommend trying it if you're deploying JS to the browser.

Cody Casterlinecommented

"The same rules apply to you and me" said the rich man to the poor, as if needing to say it out loud weren't proof that it wasn't so.

Cody Casterlinecommented

Their own article contradicts their headline:

Removing Trump from Twitter and other platforms surely spared us a year’s worth of lies and incitements to violence; it was and remains the right thing to do.

But I do agree that:

But in a larger sense, it’s clear that deplatforming Trump did little to improve the underlying political situation in this country. It seems that situation is getting worse all the time.

Cody Casterlinecommented

Not even going to click on that clickbait-y title, but:

On the one hand: Yes, his presidency is a disappointment. I wanted Warren or Sanders. I wanted stronger action against the Jan. 6th attackers & organizers. I wanted voting rights legislation.

On the other hand: I'm still quite happy that he's president vs. the alternative. And isn't that what most of us were voting for?

Cody Casterlinecommented

Hmm. This might convince me to pay for AppleTV+. ♥ Jon Stewart.

Cody Casterlinecommented

Pay no attention to the TikTok addiction behind the curtain.

Cody Casterline

Since about v0.5.0, I've been using FeoBlog as my own sort of RSS reader. I've got a few scripts that read Twitter, Mastodon, and some RSS feeds into FeoBlog for me, and then I just view my "My Feed" page and there's everything in one convenient place.

One surprising benefit of this is that I actually feel less of an urge to keep on top of things. The feed isn't going to get reordered by some unknown algorithm. There's no little "unread" counter telling me how many more I have to read until I'm "caught up". Plus, those posts aren't going to go away, I'll always be able to find them in the feed history. (Though it could be easier.)

So, generally a more healthy relationship with social media. Which is to say: I'm reading a bit less than before.

Cody Casterlinecommented

Soooo, it helps if you remember which airline you're flying on. 😂

While American does allow carry-on bags for economy tickets, United (with whom I was flying) does not.

Cody Casterline

Cody Casterline updated their profile.

Cody Casterline

Bags or no bags?

I’m flying home to San Diego today. Trying to check in to my American Airlines flight, they’re telling me I can’t carry on my bag, and offering to charge me to check it.

9D6F54D3-18D1-4774-AF0A-766F4E43C7FF.png

But their web site says:

DE9F9B53-3AFA-404B-BBA0-B16F767A8FA6.png

… sooo which is it? I guess I’ll check in at the counter and see. Hopefully the lines aren’t bad. 🤞

Cody Casterline

TableStream

So, working on FeoBlog, I wanted to print some data into a table in a terminal, and I was picky about how I wanted to do so, so I wrote my own.

In particular, I wanted to be able to:

  • Stream data without worrying about how much memory it'll use.
  • Let the table formatter
    • Pick column sizes
    • truncate data
    • align data.
    • choose a table width based on the size of the data and/or the terminal window.

The existing ones I found on crates.io required holding the table in memory.

So I just wrote my own:

https://github.com/NfNitLoop/tablestream

tablestream.gif

Cody Casterlinecommented

"Grandma should be happy to die for the economy!"

s/grandma/my employees/

Cody Casterlinecommented

Our choice to reopen was not without consequence. Some people at our firm did get sick with the virus after we reopened

Who is this jerk and why is NYT publishing this? Especially w/ Delta spreading, this feels very irresponsible.

Cody Casterline

Cody Casterline updated their profile.

Cody Casterlinecommented

👋 Hello! 😊

Just writing some (more) code to copy tweets to FeoBlog. s'fun.

Cody Casterlinecommented

🎉 Welcome. 😊

Cody Casterline

Cody Casterline updated their profile.

Cody Casterline

FeoBlog Changes

Whew. Have been working on some nice FeoBlog changes that I'll probably release this weekend.

  • Better handling of post timestamps.
  • Filtering and searching of your follow feed! (Which has become important now that my feed is basically 99% Twitter.)
  • ... which is now the default view if you visit feoblog and are logged in.
  • Oh yeah, and a fancy header to show you what posts/feed you're viewing, since that could sometime be ... unclear in the previous version.

I should probably make another video. The UI is looking much better now than the one I showed in v0.1. Plus, I've learned a couple things about video capture since then.

But for now, shower and bed. 😴