Searching yarn

Twts matching #programming
Sort by: Newest, Oldest, Most Relevant
In-reply-to » Nobody want to be a shitty programmer. The question is: Do you do anything not to not be one? Reading blogs or social media and watching YouTube videos is fun. After them, your code may be a little better, of course. But you need a lot. You need to study! Read good books and study the code of other programmers, for example. Maybe work with a new language, architectures and paradigms. You need break the routine.

@andros@twtxt.andros.dev Programming is art. You become good at art by practising your art. You learn artistic patterns by being inspired by and reading others art works. The most importance however is that you practise your art.

⤋ Read More

Nobody want to be a shitty programmer. The question is: Do you do anything not to not be one?
Reading blogs or social media and watching YouTube videos is fun. After them, your code may be a little better, of course. But you need a lot. You need to study! Read good books and study the code of other programmers, for example. Maybe work with a new language, architectures and paradigms. You need break the routine.

If you know Object-oriented programming, you learn functional programming.
If you know Model-View-Controller, you learn Model-View-ViewModel.
If you don’t know anything about architectures, you learn Clean Architecture, Hexagonal Architecture, etc.
If you know Python, you learn Ruby or Go.
If you know Clojure or Lisp… you don’t need to learn anything else. You are already a good programmer. Just kidding. You can learn Elixir or Scala.

Be a good programmer my friend.

⤋ Read More

@bender@twtxt.net Yes, you right. But is premium for more than that.
I use a feature I love a lot: customising different searches with different themes or links.
It’s easy to understand with an example. I have a search with the name ā€œDjangoā€. I set sources: Django documentation, stack overflow, topic ā€œprogrammingā€ and so on. It’s very quick to find Django solutions.
I also have another way to find my stuff: search my blog and repositories.
I had problems paying for the first mouths, now it’s a working tool for me.

⤋ Read More

Confession:

I’ve never found microblogging like twtxt or the Fediverse or any other ā€œmodernā€ social media to be truly fulfilling/satisfying.

The reason is that it is focused so much on people. You follow this or that person, everybody spends time making a nice profile page, the posts are all very ā€œego-centricā€. Seriously, it feels like everybody is on an ego-trip all the time (this is much worse on the Fediverse, not so much here on twtxt).

I miss the days of topic-based forums/groups. A Linux forum here, a forum about programming there, another one about a certain game. Stuff like that. That was really great – and it didn’t even suffer from the need to federate.

Sadly, most of these forums are dead now. Especially the nerds spend a lot of time on the Fediverse now and have abandoned forums almost completely.

On Mastodon, you can follow hashtags, which somewhat emulates a topic-based experience. But it’s not that great and the protocol isn’t meant to be used that way (just read the snac2 docs on this issue). And the concept of ā€œlikesā€ has eliminated lots of the actual user interaction. ā˜¹ļø

⤋ Read More
In-reply-to » To the parents or teachers: How do you teach kids to program these days? šŸ¤”

@movq@www.uninformativ.de Agreed, finding the right motivation can be tricky. You sometimes have to torture yourself in order to later then realize, yeah, that was actually totally worth it. It’s often hard.

I think if you find a project or goal in general that these kids want to achieve, that is the best and maybe only choice with a good chance of positive outcome. I don’t know, like building a price scraper, a weather station or whatever. Yeah, these are already too advanced if they never programmed, but you get the idea. If they have something they want to build for themselves for their private life, that can be a great motivator I’ve experienced. Or you could assign ā€˜em the task to build their own twtxt client if they don’t have any own suitable ideas. :-)

Showing them that you do a lot of your daily work in the shell can maybe also help to get them interested in text-based boring stuff. Or at least break the ice. Lead by example. The more I think about it, the more I believe this to be very important. That’s how I still learn and improve from my favorite workmate today in general. Which I’m very thankful of.

⤋ Read More
In-reply-to » To the parents or teachers: How do you teach kids to program these days? šŸ¤”

We’re all old farts. When we started, there weren’t a lot of options. But today? I’d be completely overwhelmed, I think.

Hence, I’d recommend to start programming with a console program. As for the language, not sure. But Python is probably a good choice

That’s what I usually do (when we have young people at work who never really programmed before), but it doesn’t really ā€œhitā€ them. They’ve seen so much, crazy graphics, web pages, it’s all fancy. Just some text output is utterly boring these days. ā˜¹ļø And that’s my problem: I have no idea how I could possibly spark some interest in things like pointers or something ā€œlow-levelā€ like that. And I truly believe that you need to understand things like pointers in order to program, in general.

⤋ Read More
In-reply-to » To the parents or teachers: How do you teach kids to program these days? šŸ¤”

@xuu@txt.sour.is Hahaha, that’s cool! You were (and still are) way ahead of me. :-)

We started with a simple traffic light phase and then added pedestrian crossing buttons. But only painting it on the canvas. In our computer room there was an actual traffic light on the wall and at the very end of the school year our IT basics teacher then modified the program to actually control the physical traffic light. That was very impressive and completely out of reach for me at the time. That teacher pulled the first lever for me ending up where I am now.

⤋ Read More
In-reply-to » To the parents or teachers: How do you teach kids to program these days? šŸ¤”

@movq@www.uninformativ.de I started with Delphi in school, the book (that we never ever used even once and I also never looked at) taught Pascal. The UI part felt easy at first but prevented me from understanding fundamental stuff like procedures or functions or even begin and end blocks for ifs or loops. For example I always thought that I needed to have a button somewhere, even if hidden. That gave me a handler procedure where I could put code and somehow call it. Two or three years later, a new mate from the parallel class finally told me that this wasn’t necessary and how to do thing better.

You know all too well that back in the day there was not a whole lot of information out there. And the bits that did exist were well hidden. At least from me. Eventually discovering planet-quellcodes.de (I don’t remember if that was the original forum or if that got split off from some other board) via my best schoolmate was like finding the Amber Room. Yeah, reading the ITG book would have been a very good idea for sure. :-)

In hindsight, a console program without the UI overhead might have been better. At least for the very start. Much less things to worry about or get lost.

Hence, I’d recommend to start programming with a console program. As for the language, not sure. But Python is probably a good choice, it doesn’t require a lot of surrounding boilerplate like, say Java or Go. It also does exceptionally well in the principle of least surprise.

⤋ Read More
In-reply-to » To the parents or teachers: How do you teach kids to program these days? šŸ¤”

I should probably clarify: Which language/platform? Something graphical or web-based right from the beginning or do you start with a console program?

⤋ Read More

TacOS: an x86_64 UNIX-like OS from scratch
TacOS is a UNIX-like kernel which is able to run DOOM, among various other smaller userspace programs. It has things like a VFS, scheduler, TempFS, devices, context switching, virtual memory management, physical page frame allocation, and a port of Doom. It runs both on real hardware (tested on my laptop) and in the Qemu emulator. ↫ TacOS GitHub page TacOS – great name – is written in C, and explicitly a hobby and toy project. The code’s licensed … ⌘ Read more

⤋ Read More

ā€œHow I use Kate Editorā€
I love the Kate Text editor. I use it for pretty much all the programming projects I do. Kate has been around for long time now, about 20 years! At least earliest blog post for it I could find was written in 2004. I wanted to go over my workflow with it, why I like it so much and hopefully get more people to try it out. ↫ Akseli Lahtinen Programmers and developers tend to be very set in their ways and have their preferred workflows – which profession doesn’t, honestly – and since there … ⌘ Read more

⤋ Read More

CISA extends funding to ensure ā€˜no lapse in critical CVE services’
CISA says the U.S. government has extended MITRE’s funding to ensure no continuity issues with the critical Common Vulnerabilities and Exposures (CVE) program. The announcement follows a warning from MITRE Vice President Yosry Barsoum that government funding for the CVE and CWE programs was set to expire today, April 16, potentially leading to widespread disruption across the cybersecurity industry. ↫ … ⌘ Read more

⤋ Read More

Elliptical Python programming
One thing I love about Python is how it comes with its very own built-in zen. In moments of tribulations, when I am wrestling with crooked code and tangled thoughts, I often find solace in its timeless wisdom. ↫ Susam Pal I can’t program and know nothing about Python, but this still made me laugh. ⌘ Read more

⤋ Read More

FreeDOS 1.4 released
With FreeDOS being, well, DOS, you’d think there wasn’t much point in putting out major releases and making big changes, and you’d mostly be right. However, being a DOS clone doesn’t mean there isn’t room for improvement within the confines of the various parts and tools that make up DOS, and that’s exactly where FreeDOS focuses its attention. FreeDOS 1.4 comes about three years after 1.2. This version includes an updated FreeCOM, Install program, and HTML Help system. This also includes i … ⌘ Read more

⤋ Read More

Sometimes, we spend months stuck in inertia, distracted by screens and routine. So I’d like to give you a simple reminder: creating-in whatever form-is what makes you feel alive.

The beauty of working on projects is not in their ā€˜success’, but in the simple act of working on them. Whether it’s writing, cooking, programming or redecorating the house: play with ideas without pressure, engage in an activity to test, fail and discover without judgement.

In the end, what remains is not a perfect product, but the satisfaction of completion and valuable lessons.

Find a project, no matter how small, and let it take you without expectations.

⤋ Read More

Playing multimedia with Dillo
What if you want to use a web browser like Dillo, which lacks JavaScript support and can’t play audio or video inside the browser? Dillo doesn’t have the capability to play audio or video directly from the browser, however it can easily offload this task to other programs. This page collects some examples of how to do watch videos and listen to audio tracks or podcasts by using an external player program. In particular we will cover mpv with yt-dlp which supports YouTube … ⌘ Read more

⤋ Read More
In-reply-to » When will the flat UI craze end? Can I get my buttons, scrollbars, and toolbars back, please?

@movq@www.uninformativ.de Yeah, most of the graphical applications are actually KDE programs:

  • KMail – e-mail client
  • Okular – PDF viewer
  • Gwenview – image viewer
  • Dolphin – file browser
  • KWallet – password manager (I want to check out pass one day. The most annoying thing is that when I copy a password, it says that the password has been modified and asks me whether I want to save the changes. I never do, because the password is still the same. I don’t get it.)
  • KPatience – card game
  • Kdenlive – video editor
  • Kleopatra – certificate manager

Qt:

  • VLC – video player
  • Psi – Jabber client (I happily used Kopete in the past, but that is not supported anymore or so. I don’t remember.)
  • sqlitebrowser – SQLite browser

Gtk:

  • Firefox – web browser
  • Quod Libet – music player (I should look for a better alternative. Can’t remember why I had to move away from Amarok, was it dead? There was a fork Clementine or so, but I had to drop that for some unknown reason, too.)
  • Audacity – audio editor
  • GIMP – image editor

These are the things that are open right now or that I could think of. Most other stuff I actually do in the terminal.

In the pastā„¢, I used the Python KDE4 bindings. That was really nice. I could pass most stuff directly in the constructor and didn’t have to call gazillions of setters improving the experience significantly. If I ever wanted to do GUI programming again, I’d definitely go that route. There are also great Qt bindings for Python if one wanted to avoid the KDE stuff on top. The vast majority I do for myself, though, is either CLI or maybe TUI. A few web shit things, but no GUIs anymore. :-)

⤋ Read More
In-reply-to » i really wanna learn golang it looks fun and capable and i can read it kind of but every time i try it i'm immediately stuck on basic concepts like "what the fuck is a pointer" (this has been explained to me and i still don't get it). i did have types explained to me as like notes on code which makes sense a bit but i'm mostly lost on basic code concepts

@kat@yarn.girlonthemoon.xyz Pointers can be a bit tricky. I know it took me also quite some time to wrap my head around them. Let my try to explain. It’s a pretty simple, yet very powerful concept with many facets to it.

A pointer is an indirection. At a lower level, when you have some chunk of memory, you can have some actual values sitting in there, ready for direct use. A pointer, on the other hand, points to some other location where to look for the values one’s actually after. Following that pointer is also called dereferencing the pointer.

I can’t come up with a good real-world example, so this poor comparison has to do. It’s a bit like you have a book (the real value that is being pointed to) and an ISBN referencing that book (the pointer). So, instead of sending you all these many pages from that book, I could give you just a small tag containing the ISBN. With that small piece of information, you’re able to locate the book. Probably a copy of that book and that’s where this analogy falls apart.

In contrast to that flawed comparision, it’s actually the other way around. Many different pointers can point to the same value. But there are many books (values) and just one ISBN (pointer).

The pointer’s target might actually be another pointer. You typically then would follow both of them. There are no limits on how long your pointer chains can become.

One important property of pointers is that they can also point into nothingness, signalling a dead end. This is typically called a null pointer. Following such a null pointer calls for big trouble, it typically crashes your program. Hence, you must never follow any null pointer.

Pointers are important for example in linked lists, trees or graphs. Let’s look at a doubly linked list. One entry could be a triple consisting of (actual value, pointer to next entry, pointer to previous entry).

  _______________________
 /               ________\_______________
↓               ↓         |              \
+---+---+---+   +---+---+-|-+   +---+---+-|-+
| 7 | n | x |   | 23| n | p |   | 42| x | p |
+---+-|-+---+   +---+-|-+---+   +---+---+---+
      |         ↑     |         ↑
       \_______/       \_______/

The ā€œxā€ indicates a null pointer. So, the first element of the doubly linked list with value 7 does not have any reference to a previous element. The same is true for the next element pointer in the last element with value 42.

In the middle element with value 23, both pointers to the next (labeled ā€œnā€) and previous (labeled ā€œpā€) elements are pointing to the respective elements.

You can also see that the middle element is pointed to by two pointers. By the ā€œnextā€ pointer in the first element and the ā€œpreviousā€ pointer in the last element.

That’s it for now. There are heaps ;-) more things to tell about pointers. But it might help you a tiny bit.

⤋ Read More
In-reply-to » Hmmm, when I Ctrl+Left to jump a word left, I get 1;5D in my tt2 message text. My TERM is set to rxvt-unicode-256color. In tt, it works just fine. When I change to TERM=xterm-256color, it also works in tt2. I have to read up on that. Maybe even try to capture these sequences and rewrite them.

@movq@www.uninformativ.de Hahaha, that name is certainly fitting! :-D

Yeah, I should revert that and try to figure out which programs misbehaved. But that’s something for future Lyse. 8-) Right now, I just redefine TERM in my Makefile when the USER happens to be me.

⤋ Read More
In-reply-to » Hmmm, when I Ctrl+Left to jump a word left, I get 1;5D in my tt2 message text. My TERM is set to rxvt-unicode-256color. In tt, it works just fine. When I change to TERM=xterm-256color, it also works in tt2. I have to read up on that. Maybe even try to capture these sequences and rewrite them.

@lyse@lyse.isobeef.org There’s a reason it’s called ā€œ(n)cursesā€. šŸ˜ The only advice I can give is to never fiddle with reassigning control sequences and $TERM variables. Leave $TERM at whatever value the terminal itself sets and use an appropriate terminfo file for it. If there are programs misbehaving, they probably blindly assume XTerm and should be fixed (or have XTerm as a hard requirement). If you try to fix this on your end, it’ll likely just break other programs. 🄓

⤋ Read More
In-reply-to » Hmmm, when I Ctrl+Left to jump a word left, I get 1;5D in my tt2 message text. My TERM is set to rxvt-unicode-256color. In tt, it works just fine. When I change to TERM=xterm-256color, it also works in tt2. I have to read up on that. Maybe even try to capture these sequences and rewrite them.

Well, some time ago I put this in my ~/.Xdefaults:

URxvt.keysym.Control-Up:    \033[1;5A
    URxvt.keysym.Control-Down:  \033[1;5B
URxvt.keysym.Control-Left:  \033[1;5D
    URxvt.keysym.Control-Right: \033[1;5C

Probably to behave more like XTerm and fix a few other issues I had with other programs. But, it turns out, tcell expects the original sequence: https://github.com/gdamore/tcell/blob/main/terminfo/r/rxvt/term.go#L487

Hmm.

⤋ Read More

Java 24 released
Oracle, the company owned by a guy who purchased a huge chunk of the Kingdom of Hawaii from the Americans, has released Java 24. I’ll be honest and upfront: I just don’t care very much at all about this, as the only interaction I’ve had with Java over the past, I don’t know, 15 years or so, is either because of Minecraft, or because of my obsession with ancient UNIX workstations where Java programs pop up in the weirdest of places. I know Java is massive and used everywhere, but going through the … ⌘ Read more

⤋ Read More

A more robust raw OpenBSD syscall demo
Ted Unangst published dude, where are your syscalls? on flak yesterday, with a neat demonstration of OpenBSD’s pinsyscall security feature, whereby only pre-registered addresses are allowed to make system calls. Whether it strengthens or weakens security is up for debate, but regardless it’s an interesting, low-level programming challenge. The original demo is fragile for multiple reasons, and requires manually locating and entering addresses for each bu … ⌘ Read more

⤋ Read More

NetBSD on a JavaStation
Back when Java was still a new programming language, Sun had the idea of building a computer specifically designed for Java, unique processor running byte-code as its native machine code and all. This whole endeavour proved to be more complicated than Sun had hoped, and as such, they eventually abandoned the idea of a Java processor in favour of plain SPARC. When the JavaStation shipped, it was a regular SPARC workstation without a hard drive, running something called JavaOS from fla … ⌘ Read more

⤋ Read More

C++ creator calls for help to defend programming language from ā€˜serious attacks’
Bjarne Stroustrup, creator of C++, has issued a call for the C++ community to defend the programming language, which has been shunned by cybersecurity agencies and technical experts in recent years for its memory safety shortcomings. C and C++ are built around manual memory management, which can result in memory safety errors, such as out of bounds reads and writes, though bo … ⌘ Read more

⤋ Read More

Short summary of Project2025 and Trump’s plans for the US:

  • Abolish the Federal Reserve
    Why? To end what is seen as an unelected, centralized body that exerts too much influence over the economy and monetary policy, replacing it with a more transparent, market-driven approach.

  • Implement a national consumption tax
    Why? To replace the current federal income tax system, simplify taxation, and increase government revenue through a broader base that includes all consumers.

  • Lower corporate tax rates
    Why? To promote business growth, increase investment, and stimulate job creation by reducing the financial burden on companies.

  • Deregulate environmental policies
    Why? To reduce government intervention in the economy, particularly in energy and natural resources sectors, and to foster a more business-friendly environment.

  • Restrict abortion access
    Why? To align with conservative pro-life values and overturn or limit abortion rights, seeking to restrict the practice at a federal level.

  • Dismantle LGBTQ+ protections
    Why? To roll back protections viewed as promoting LGBTQ+ rights in areas like employment and education, in line with traditional family values.

  • Eliminate diversity, equity, and inclusion (DEI) programs
    Why? To end policies that are seen as divisive and to promote a merit-based system that prioritizes individual achievements over group identity.

  • Enforce stricter immigration policies, including mass deportations and detentions
    Why? To prioritize border security, reduce illegal immigration, and enforce existing laws more aggressively, as part of a broader strategy to safeguard U.S. sovereignty.

  • Eliminate the Department of Education
    Why? To reduce federal control over education and shift responsibilities back to local governments and private sectors, arguing that education decisions should be made closer to the community level.

  • Restructure the Department of Justice
    Why? To ensure the department aligns more closely with the administration’s priorities, potentially reducing its scope or focus on areas like civil rights in favor of law-and-order policies.

  • Appoint political loyalists to key federal positions
    Why? To ensure that government agencies are headed by individuals who are committed to advancing the administration’s policies, and to reduce the influence of career bureaucrats.

  • Develop training programs for appointees to execute reforms effectively
    Why? To ensure that political appointees are equipped with the knowledge and skills necessary to implement the proposed changes quickly and effectively.

  • Provide a 180-day transition plan with immediate executive orders
    Why? To ensure that the incoming administration can swiftly implement its agenda and make major changes early in its term without delay.

Do y’all agree with any/all/some of these poliices? Hmmm šŸ¤”

#Project2025 #US #Trump

⤋ Read More

Does anybody know a right mouse click save and reduce a screen saver image to a smaller file, say 50KB?
My usual method is slow, place in image program and re-save it smaller.

I used to have a Window’s way to reduce file images from 1MB to 50 KB with right mouse click.

⤋ Read More

Did the Windows 95 setup team forget that MS-DOS can do graphics?
One of the reactions to my discussion of why Windows 95 setup used three operating systems (and oh there were many) was my explanation that an MS-DOS based setup program would be text-mode. But c’mon, MS-DOS could do graphics! Are you just a bunch of morons? Yes, MS-DOS could do graphics, in the sense that it didn’t actively prevent you from doing graphics. You were still responsible for everything you … ⌘ Read more

⤋ Read More