febr//uary skips the second box, so I think they aimed to have an equal number of options in each column.
- 1 Post
- 16 Comments
Hoimo@ani.socialto Programming@programming.dev•AI coders think they’re 20% faster — but they’re actually 19% slower3·2 months agoIf there’s a clear pattern, regex is your friend. I use it for complex find-and-replace actions, or to generate code based on a template and a list of values (find a value, replace it with the template including the value). Full control over the output, more reliable even than manual copy-pasting.
Hoimo@ani.socialto Mildly Infuriating@lemmy.world•To join Facebook these days, one must record a video selfieEnglish12·3 months agoThe software exists, it’s called Flohmarkt.
Yeah, I had some webpages archived and tried to use javascript to clean them up, but I ended up parsing it as xml through Powershell instead. I’ve done something with Python and BeautifulSoup too, a long time ago. Both much easier than JS, but somehow JS is designed to work with web pages? Make it make sense.
Hoimo@ani.socialto Programming@programming.dev•YAML, SQL, or something else? Looking for recommendations for making a database of stories.1·5 months agoIt’s definitely possible to store the stories in columns, but there’s also very little reason to do it. I think filepath in SQL and the stories in separate files in whatever format makes the most sense (html, txt, epub). If you ever want to search the stories for keywords, write a python script to build indexes in SQL, performs much better than doing LIKE on a maxed out varchar column.
I was thinking maybe Elastisearch, but I don’t know how much work that is to set up. For a hobby project, writing your own indexer isn’t too hard and might be more fun and easier to maintain than an industry-grade solution.
Hoimo@ani.socialto Programmer Humor@programming.dev•Git, invented in 2005. Programmers on 2004:3·5 months agoIf your remote is completely empty and has no commits, you can just push normally. If it has an auto-generated “initial commit” (pretty sure Github does something like that), you could force push, or merge your local branch into the remote branch and push normally. I think cloning the repo and copying the contents of your local repo into it is the worst option: you’ll lose all local commits.
Hoimo@ani.socialto Programmer Humor@programming.dev•Git, invented in 2005. Programmers on 2004:1·5 months agodeleted by creator
There’s one valid use-case for LLMs: when you have writer’s block, it can help to have something resembling an end product instead of a blank page. Sadly, this doesn’t really work for programming, because incorrect code is simply worse than no code at all. Every line of code is a potential bug and every line of incorrect code is a guaranteed bug.
I use an LLM with great success to write bad fanfiction though.
You can save time at the cost of headaches, or you can save headaches at the cost of time. You cannot save both time and headaches, you can at most defer the time and the headaches until the next time you have to touch the code, but the time doubles and the headaches triple.
You can do either, but you usually do neither. The best way is to throw a new exception for your situation and add the caught exception as an inner exception. Because rethrowing resets the stack trace, removing the context from an exception message that is often pretty vague, and “bouncing” with
throw;
doesn’t tell the next exception handler that you already handled (part of) the exception.
I love regex and I use it a lot, but I very rarely use it in any kind of permanent solution. When I do, I make sure to keep it as minimal as possible, supplementing with higher level programming where possible. Backreferences and assertions are a cardinal sin and should never be used.
Did you know that the type of a variable is determined by the frequency of plasma oscillations among the objects valence electrons?
Nova also adds that quick menu with most used apps and recently used apps. And that also includes a search bar that will search installed apps by default but can be configured to search the web with your browser and search engine of choice. I used those features a lot, but these days I use Niagara.
Hoimo@ani.socialto Programming@programming.dev•Why do libraries define their own true and false?2·8 months agoI have seen this, but with “Y”, “N” instead. That was the way the database stored it and the way the UI displayed it, but everything inbetween converted to boolean instead, because there was logic depending on those choices. It wasn’t that bad, all things considered, just a weird quirk in the system. I think there was another system that did just use those strings plain (like
WHERE foo = 'Y'
in stored procedures), but nothing I had to work with. We just mapped “Y” to true when reading the query results and were done with it.(And before anyone asks, yes, we considered any other value false. If anyone complained that their “Yes”, “y” or empty was seen as false, we told them they used it wrong. They always accepted that, though they didn’t necessarily learn from it.)
Hoimo@ani.socialto Programmer Humor@programming.dev•You seen the jank? I live in it.. molded by it...1·10 months agodeleted by creator
GOTO is the only thing that makes sense. It’s the “high-level” concepts like for-loops, functions and list comprehension that ruined programming.
series.append(series[k-1]+series[k-2]) for k in range(2,5)]
RAVINGS DREAMT UP BY THE UTTERLY DERANGED
Hoimo@ani.socialto Mildly Infuriating@lemmy.world•I hate using mobile to read articlesEnglish1·2 years agodeleted by creator
And with “this decade” you mean within the last 10 years or since 2020? Either way, I’m scared… Just kidding, if this is a bank we’re talking about, they’re actually ahead of the curve.
I learned to code without a CS degree. I used a for Dummies book, W3schools, Stack Overflow and the good guidance of a senior developer. Learning to code was never the issue. And I think poking around in the code, experimenting, stumbling on unrelated but helpful answers, before finding your problem, are all great ways to become experienced that are prevented by the use of a tool like Bolt. If Bolt produces code that confuses experienced developers, how is the vibe coder supposed to learn anything useful from it?