普通视图

发现新文章,点击刷新页面。
昨天以前首页

How To Create Software Diagrams With ChatGPT and Claude

作者 Jon Udell
2024年11月2日 23:18

Earlier efforts to diagram software with LLM assistance weren’t fruitful, but this time around things went really well. I ended up with exactly what I needed to explain the architecture of a browser extension, and along the way I learned a lot about a couple of formats — Mermaid and Graphviz — as well as their tool ecosystems.

How To Create Software Diagrams With ChatGPT and Claude

LLM series at The New Stack

What Claude and ChatGPT can see on your screen

作者 Jon Udell
2024年10月26日 00:35

“If you work with these cloud platforms every day, you have doubtless forgotten that you ever had questions like these. But every newcomer does. And on a continuing basis, we are all newcomers to various aspects of applications and services. In so many ways, the experience boils down to: I am here, what do I do now?

It’s nice if you can share your screen with someone who has walked that path before you, but that’s often impossible or infeasible. LLMs synthesize what others have learned walking the path. We typically use words to search that body of hard-won knowledge. Searching with images can be a powerful complementary mode.”

What ChatGPT and Claude can see on your screen

Part of the LLM series at The New Stack.

Mix Human Expertise With LLM Assistance for Easier Coding

作者 Jon Udell
2024年10月11日 07:37

There are plenty of ways to use LLMs ineffectively. For best results, lean into your own intelligence, experience, and creativity. Delegate the boring and routine stuff to closely supervised assistants whose work you can easily check.

Mix Human Expertise With LLM Assistance for Easier Coding

Part of the LLM series at The New Stack.

Geothermal power in the North Bay

作者 Jon Udell
2024年10月6日 02:42

I was aware of The Geysers, a geothermal field about 35 miles north of my home in Santa Rosa, but I never gave it much thought until my first bike ride through the area. Then I learned a number of interesting things.

It’s the world’s largest geothermal field, producing more than 700 megawatts.

It accounts for 20% of California’s renewable energy.

The naturally-occurring steam was used up almost 30 years ago, and steam is now recharged by pumping in 11 million gallons of sewage effluent daily, through a 42-mile pipeline, from the Santa Rosa plain.

That daily recharge is implicated in the region’s frequent small earthquakes. (But nobody seems too worried about that, and maybe it’s a good thing? Many small better than one big?)

An article in today’s paper reports that AB-1359, signed last week by governor Gavin Newsom, paves the way for new geothermal development in the region that could add 600 megawatts of geothermal production.

How much electric power is that? I like to use WolframAlpha for quick and rough comparisons.

So, 2/3 of a nuke plant. 4/5 of a coal-fired power plant. These kinds of comparisons help me contextualize so many quantitative aspects of our lives. They’re the primary reason I visit WolframAlpha. I wish journalists would use it for that purpose.

Making a Vote Forward checklist

作者 Jon Udell
2024年10月1日 02:08

In How and why to write letters to voters I discussed Vote Forward, my favorite way for those of us who aren’t in swing states to reach out to voters in swing states. The site works really well for adopting batches of voters, and downloading packets of form letters. As I close in on 1000 letters, though, I’m finding it isn’t great for tracking progress at scale. Here’s how my dashboard page looks.

With 50 bundles in play, many of which are farmed out to friends and neighbors who are helping with the project, it’s become cumbersome to keep track of which bundles are prepped (ready to mail) or not. Here is the checklist I needed to see.

VoteForward Dashboard Report

mmorg: 1-UNPREPPED
r23Pp: 2-UNPREPPED
v9Kbo: 3-UNPREPPED
wLMPw: 4-UNPREPPED
24L4o: 5-PREPPED
4nNnj: 6-PREPPED
5rQmV: 7-PREPPED
...
YV4dL: 48-PREPPED
zKjne: 49-PREPPED
ZrKJz: 50-PREPPED

If you’re in the same boat, here’s a piece of code you can use to make your own checklist. It’s gnarly, if you aren’t a programmer I advise you not even to look at it, just copy it, and then paste it into your browser to have it open a new window with your report.

Vote Forward checklist maker (expand to copy)
javascript:(function(){
  // First part: Adjust height of divs with inline styles
  document.querySelectorAll('div[style]').forEach(div => {
    let inlineStyle = div.getAttribute('style');
    if (inlineStyle.includes('position: relative')) {
      div.style.height = '20000px';  // Set the height to 20000px
    }
  });

  // Introduce a delay before processing the list of items
  setTimeout(() => {
    const items = document.querySelectorAll('li.bundle-list-item.individual');

    let dataList = [];

    // Iterate over the items to capture data-testid and ID
    items.forEach(item => {
        let dataTestId = item.getAttribute('data-testid');
        
        // Use the id attribute of the input element to extract the ID
        const toggleInput = item.querySelector('input.slide-out-toggle');
        const toggleId = toggleInput ? toggleInput.getAttribute('id') : '';
        
        // Extract the ID part from the toggleId pattern "toggle-24L4o-PREPPED"
        const id = toggleId ? toggleId.split('-')[1] : 'ID not found';

        // Remove "bundle-" and the number part from dataTestId, keeping only "PREPPED" or "UNPREPPED"
        dataTestId = dataTestId.split('-').pop();  // Extract only the "PREPPED" or "UNPREPPED" part

        // Push the data into the array
        dataList.push({ dataTestId, id });
    });

    // Sort first by whether it's PREPPED or UNPREPPED (descending for UNPREPPED first), 
    // then by the ID within each group
    dataList.sort((a, b) => {
        if (a.dataTestId.includes("PREPPED") && b.dataTestId.includes("UNPREPPED")) {
            return 1;  // UNPREPPED comes before PREPPED
        } else if (a.dataTestId.includes("UNPREPPED") && b.dataTestId.includes("PREPPED")) {
            return -1;
        }
        // Sort by ID if they belong to the same category
        return a.id.localeCompare(b.id);
    });

    // Prepare the output string
    let output = '';
    dataList.forEach((item, index) => {
        output += `${item.id}: ${index + 1}-${item.dataTestId}\n`;
    });

    // Open a new window with the output in a text area for easy copying
    let newWindow = window.open('', '', 'width=500,height=500');
    newWindow.document.write('<html><body><h2>VoteForward Dashboard Report</h2><pre>' + output + '</pre></body></html>');
    newWindow.document.close();
  }, 2000);  // Adjust delay as needed
})();

Here are instructions for Chrome/Edge, Safari, and Firefox. You might need to tell your browser to allow the popup window in which it writes the report.

Chrome/Edge:

  1. Open the VoteForward dashboard in your browser.
  2. Open the developer console:
    • Windows/Linux: Press Ctrl + Shift + J.
    • Mac: Press Cmd + Option + J.
  3. Paste the code into the console.
  4. Press Enter to run the code.

Firefox:

  1. Open the VoteForward dashboard in your browser.
  2. Open the developer console:
    • Windows/Linux: Press Ctrl + Shift + K.
    • Mac: Press Cmd + Option + K.
  3. Paste the code into the console.
  4. Press Enter to run the code.

Safari:

  1. Open the VoteForward dashboard in your browser.
  2. Enable the developer console (if it’s not already enabled):
    • Go to Safari > Preferences.
    • Click the Advanced tab.
    • Check “Show Develop menu in menu bar” at the bottom.
  3. Open the developer console:
    • Press Cmd + Option + C.
  4. Paste the code into the console.
  5. Press Enter to run the code.

It would be nice to have this as a built-in feature of the site but, as we come down to the wire, this may be a helpful workaround.

Thanks, again, to the Vote Forward team for all you do! It’s a great way to encourage voter turnout.

deo absente deum culpa

作者 Jon Udell
2024年9月21日 13:24

On a recent trip I saw this pair of Latin phrases tattooed on the back of a flight attendant’s arms:

Left: Deo absente. Right: Deum culpa.

I took Latin in middle school, and could guess what the combination might mean. It’s not a common construction, and a search seems to confirm my guess. Both Google and Bing take you to a couple of Reddit posts in r/Latin.

Would this be the correct translation?

A song I like, Deus in absentia by Ghost, has that line in it intending to mean “In the absence of God”, so I was looking into alternate translations/syntax of the phrase intending to mean “In the absence of God; Blame/Fault God”. Would this make sense: “Deum in absente; Culpa Deus” or “Deus Culpa”?

Does the phrase “Deus In Absentia, Deus Culpa” make sense?

I’m using this for a tattoo and want to be absolutely sure it works in the sense of ‘In the absence of God, blame God’. All help appreciated!

Is that the same person I saw? If so, the responses in r/Latin seem to have guided them to the final text inked on their arms. And if so, the message is essentially what I had guessed. The intent of the message, though, is open to interpretation. I’m not quite sure how to take it. What do you think it means? Would it have been rude to ask?

SQL translation from Postgres to SQLite and DuckDB

作者 Jon Udell
2024年9月21日 03:59

Powerpipe dashboards can now connect not only to Steampipe but also to SQLite and DuckDB. This creates a combinatorial explosion of possibilities, including dashboards that use SQL to visualize large datasets read from Parquet files by DuckDB.

SQL Translation From Postgres to SQLite and DuckDB

Part of the LLM series at The New Stack.

Revisiting the Elm City project

作者 Jon Udell
2024年9月5日 23:08

“Communities that want to build comprehensive public calendars will be able to do so using a hybrid approach that blends existing iCalendar feeds with feeds synthesized from web calendars. It’s not a perfect solution, but with LLM assistance it’s a workable one. And who knows, maybe if people see what’s possible when information silos converge, the common tools that can ease convergence will seem more attractive.” — An LLM-Turbocharged Community Calendar Reboot

Part of the LLM series at The New Stack.

Building a Steampipe Plugin — and Powerpipe Dashboards — for WordPress

作者 Jon Udell
2024年8月21日 02:31

“Users of the WordPress API may enjoy the abstraction — and standardization — that a SQL interface provides. If you need to query multiple WordPress sites, Steampipe’s connection aggregator will be really handy. And if you want to integrate data from WordPress with data from other APIs wrapped by other plugins in the Steampipe hub, performing literal SQL JOINs across disparate APIs is a heady experience.” — Building a Steampipe Plugin — and Powerpipe Dashboards — for WordPress

Part of the LLM series at The New Stack.

How LLMs Guide Us to a Happy Path for Configuration and Coding

作者 Jon Udell
2024年8月11日 01:21

“Some argue that by aggregating knowledge drawn from human experience, LLMs aren’t sources of creativity, as the moniker “generative” implies, but rather purveyors of mediocrity. Yes and no. There really are very few genuinely novel ideas and methods, and I don’t expect LLMs to produce them. Most creative acts, though, entail novel recombinations of known ideas and methods. Because LLMs radically boost our ability to do that, they are amplifiers of — not threats to — human creativity.” – How LLMs Guide Us to a Happy Path for Configuration and Coding

Part of the LLM series at The New Stack.

When not to LLM

作者 Jon Udell
2024年7月31日 04:21

Here’s the latest installment in the series on working with LLMS: https://thenewstack.io/choosing-when-to-use-or-not-use-llms-as-a-developer/

For certain things, the LLM is a clear win. If I’m looking at an invalid blob of JSON that won’t even parse, there’s no reason to avoid augmentation. My brain isn’t a fuzzy parser — I’m just not wired to see that kind of problem, and that isn’t likely to change with effort and practice. But if there are structural problems with code, I need to think about them before reaching for assistance.

The rest of the series:

1 When the rubber duck talks back

2 Radical just-in-time learning

3 Why LLM-assisted table transformation is a big deal

4 Using LLM-Assisted Coding to Write a Custom Template Function

5 Elevating the Conversation with LLM Assistants

6 How Large Language Models Assisted a Website Makeover

7 Should LLMs Write Marketing Copy?

8 Test-Driven Development with LLMs: Never Trust, Always Verify

9 Learning While Coding: How LLMs Teach You Implicitly

10 How LLMs Helped Me Build an ODBC Plugin for Steampipe

11 How to Use LLMs for Dynamic Documentation

12 Let’s talk: conversational software development

13 Using LLMs to Improve SQL Queries

14 Puzzling over the Postgres Query Planner with LLMs

15 7 Guiding Principles for Working with LLMs

16 Learn by Doing: How LLMs Should Reshape Education

17 How to Learn Unfamiliar Software Tools with ChatGPT

18 Creating a GPT Assistant That Writes Pipeline Tests

19 Using AI to Improve Bad Business Writing

20 Code in Context: How AI Can Help Improve Our Documentation

21 The Future of SQL: Conversational Hands-on Problem Solving

22 Pairing With AI: A Senior Developer’s Journey Building a Plugin

23 How LLMs Can Unite Analog Event Promotion and Digital Calendars

24 Using LLMs to Help Write a Postgres Function

25 Human Insight + LLM Grunt Work = Creative Publishing Solution

How and why to write letters to voters

作者 Jon Udell
2024年7月29日 05:31

If you don’t live in a swing state, but would like to do more than just send money to help encourage voter turnout in those places, what are your options? For me the best one is Vote Forward, which orchestrates letter-writing to registered voters. I sent hundreds of such letters in 2020 and am aiming to do lots more, with help from friends, this time around.

Even if I lived in a swing state, I’m not someone who’d be comfortable knocking on doors. And the last thing I want to do is pester people in those places with yet another unwanted phone call or text message. The Vote Forward method is perfect for me personally, and I also think it’s the most clever and sensible way to encourage voters in other states. Here’s how it works.

You “adopt” voters in batches of 5 or 20. I just adopted my first 100: 20 in each of Ohio, Pennsylvania, Michigan, New Hampshire, and North Carolina. You download each batch as a PDF that prints 21 pages. Page one has the instructions and the list of registered voters’ names and addresses

The fact that you write the letters (and address the envelopes) by hand is a great idea. We receive very few hand-addressed letters nowadays, I think they have a pretty good chance of being opened. And once opened, the hand-written message is again unusual. The fact that somebody made the effort to do that signals a rare kind of authenticity.

Likewise, I think the nonpartisan tone of the message is unusual and conveys authenticity. I wish voting were mandatory in the US, as it is in Australia and elsewhere. However the chips fall in November, I would like to know that the result truly reflects what everyone thinks. My message last time was something like:

“… because it’s not really a democracy unless everyone’s voice is heard.”

Pages 2-21 are the letter templates. They look like this:

The hardest part for me was the handwriting. I famously struggled with cursive writing in fifth grade. By the time I reached high school I had reverted to printing. Then, in college, I realized that cursive is more efficient and relearned how to do it. I had to relearn all over again in 2020 because cursive was the fastest way to write all those letters. And I’ll probably have to relearn again this time. I suspect many in younger generations never learned cursive at all, in which case writing the letters by hand will be even harder. So: keep the message short!

If you’ve received a link to this post directly from me, it’ll come with an invitation to drop by our house, hang out on the porch, and help me complete batches of these letters. Otherwise, I hope you might try this method yourself, and/or share it with others. In the past week I’ve switched from doomscrolling to hopescrolling and that’s a huge relief. But I also want to do something tangible (again, beyond donations) and this will be my focus. It feels good to do the work, and will feel really good when I visit the post office sometime in October and drop off a big stack of hand-addressed envelopes.

But is it effective? That’s another thing I like about Vote Forward. They’ve made a sincere effort to measure the impact. And they are honest about the findings: the measurable effect is small. I’ll give them the last word here.

Why should we get excited about small differences?

Because getting people who don’t vote to show up at the polls (or mail in a ballot) is actually pretty hard. Most of the factors that affect whether people vote are tied to big, structural issues (like voter ID laws or polling place accessibility) or deep-seated attitudes (e.g., a lack of faith that elections matter). Given these obstacles, boosting turnout by even a small amount is a real achievement! And, when it comes to politics, we know that many races are decided by tight margins, so a small boost in turnout can translate into a meaningful difference in electoral outcomes.

Seymour and Brownie

作者 Jon Udell
2024年7月8日 07:12

My family, on my dad’s side, were Jews from Poland and Ukraine. His parents came to America before the shit hit the fan, but I grew up knowing two people who weren’t so lucky. Seymour Mayer lived across the street during my teens. And Annie Braunschweig, who we knew as Brownie, had taken care of my sister and me as four- and five-year-old kids when our mom – unusually at that time – went back to work full-time teaching at a university. Both Seymour and Brownie were survivors of Nazi concentration camps, with tattooed numbers on their arms.

I never heard Seymour talk about it. Brownie rarely did, though I remember one story about a mother who tossed her swaddled baby to a stranger as the train was leaving to take her to the gas chambers.

Very few survivors remain. And there are not many of us who have known survivors. I’ve thought a lot, over the years, about what happens when that kind of personal connection ends, and living memories fall off the continental shelf into the deep ocean of history. I suspect the Holocaust may seem no more real, to many born in this century, than the Spanish Inquisition.

I don’t know if Seymour and Brownie ever read “It Can’t Happen Here” but I am pretty sure they’d have thought it absolutely can, they’d be even more horrified in this moment than many of us are, and they’d reject the fatalism that I see taking root among friends and acquaintances.

“It hasn’t happened yet,” they’d say, “you can still prevent it, do not despair prematurely, there is still time, but you must find a way to focus your efforts and unite all whose votes can matter.”

The things we carry

作者 Jon Udell
2024年7月1日 03:30

For a long time there were only two essential things that I carried everywhere: keys and wallet. Two was a manageable number of objects that I had to remember to put into pockets, and two was a manageable number of pockets to put them in.

Then my first phone bumped that number to three. When reading glasses became the fourth must-carry item, it started to feel like there were too many objects to always remember and too few pockets to put them in. When the seasons changed, or when traveling, it got harder to reset the canonical locations for all four things.

Although I listen to tons of podcasts, headphones never made the list of always-carry items. But when I emptied my pockets the other day I realized that my magic number is now five. AirPods are the new take-everywhere item.

For a while I resisted the recommendation to upgrade from a wired headset to AirPods. Did I really need another small, rechargeable, easy-to-lose object (actually, three of them)? I’ve learned not to expect that yet another electronic gadget will improve my life. But this one has. Dave Winer, you were right.

Obviously this trend can’t continue indefinitely. Will that thing we anachronistically call a “phone” absorb the wallet, and maybe even the keys? I’m not sure how I feel about that!

Meanwhile, there’s my trusty belt pack. It’s dorky but there’s a pocket for everything, and it works consistently across seasons and continents.

❌
❌