Skip to main content

Search

Items tagged with: programming


Coding Matrix in Rust | 2023-03-14


Coding our Matrix bot in Rust. This time:

  • Finished !greet, making sure it only affects this room
  • Started on a schema upgrade for the arnie plugin, so we can have multiple personalities

Next time:

  • More work on allowing multiple people, so we can !arnie !person !add and make a new one


I'm going to make a prediction. In less than five years, Microsoft is going to give up on C# even on the backend, in favor of multiple languages such as Typescript/Javascript, Rust, Go and even Java. You're going to see them writing their newer backends primarily in Typescript and Rust. #dotnet #programming


Rust web frameworks have subpar error reporting

https://www.lpalmieri.com/posts/rust-web-frameworks-have-subpar-error-reporting/

Discussions: https://discu.eu/q/https://www.lpalmieri.com/posts/rust-web-frameworks-have-subpar-error-reporting/

#programming #rustlang


This should be the default in #git


[branch] sort = -committerdate

Adding it to your git config will make the command `git branch` sort by last used branches instead of alphabetical. No more trying to remember what I called that last branch!

#programming #tips


So I think I am actually suffering from #burnout or what the fuck it is. I have looked at a pretty large, major app for MacOS on Github and when browsing through its code I found many places where I was like „Oh yeah, it works but the code is messy" and I had a mental map of fixing it, yet, if someone asked me to sit in front of Xcode and fix, I would die, even thugh I really love #programming and I want to do much more of it. What can I do?


As much as it conflicts with convention, I actually think arrays starting at 1 in Lua is more programmer-friendly.

#Lua #arrays #programming #ProgrammingLanguages


Question for #programmers:

I maintain that there is exactly 1 correct usage of a `goto` (language doesn't matter, you know the construct). I'm not the first person to make the claim; I'm not the only person (certainly not the most famous); and I know other people know the answer to this.

Feel free to say what it is in the comment/scoop me. I have a disassembled comparison to show after the poll to explain.

#programming #controlFlow #shitpost

Do you know the appropriate place to use a `goto`?

  • I know what a goto is supposed to be used for. (53%, 8 votes)
  • I do not know what a goto is for. (13%, 2 votes)
  • There are no correct uses of goto. (26%, 4 votes)
  • What's a goto? (6%, 1 vote)
15 voters. Poll end: 2 months ago


What I love about #Apple #programming interfaces and frameworks is that basic #CoreML is easier done right than basic remote playback of a live-streamed audio. Yet its still far ahead of Win32 IMHO.


I really love #Programming but I feel I am still too stupid to land a proper #job. I have no idea how to search, how to apply, how to introduce what I know and how to prove that I am willing to learn. I wish to work professionally as a programmer mainly to learn from colleagues to be stronger as a programmer. Money is less important factor.


#Swift is a very expressive programming language. Many of us seem to overlook a very interesting method that is available to us on sequence types. That method is `forEach` don't mistake it with the `ForEach` view of the #SwiftUI framework. The `forEach` method executes a given closure on *every* elemnt of the sequence in same order as a for loop does. The closure takes one parameter, and that parameter is, obviously the element ofthe sequence that is currently iterated over. So for an array defined as so
```

let countries = ["Russia", "Poland", "belarus", "China"]
```
something that most programmers would do would be
```

for country in countries {
print("\(country) is a very interesting country.")
}
```
Using the array's forEach methdo we can simplify this code to that
```
countries.forEach {
country in
print("\(country) is a very interesting country.")
}
```
There is a way we can simplify our code. It is shorthand parameter names for closures, where we can omit `country in` part and replace it with $0 in our print statement,
There are two important things to consider when thinking of using the forEach over a traditional forr loop.
1. We should really interpret the name name literally in this content. There is no break or continue statements here. The forEach method will iterate through *every* element of the collection, essentially stripping us from all the control we have over the execution flow.
2. It is pretty obvious but can make some people frustrated: when our closure returns, we return only from the current iteration, ski pping to the next one. It cannot be used like break.
#swift #apple #programming #tip


We used to have programming books.

(patch notes: added a more detailed description of the man to the alt text)

#programming #atari #forth


So I've been working with GTK4/Libadwaita in Python (in Flatpak), and I'm trying to get notifications to work.

I keep getting this error: "gi.repository.GLib.GError: g-io-error-quark: Error calling StartServiceByName for org.freedesktop.Notifications: Timeout was reached (24)"

Am I missing Flatpak overrides? (Docs seem to say no https://docs.flatpak.org/en/latest/portals.html )

Am I doing this wrong? (Code at https://github.com/TheKrafter/Groupings/blob/rewrite/src/groupings/internal/push.py#L31 )

#AskFedi #GTK4 #Python #LibAdwaita #gnome #Programming


loco-rs: releasing a framework inspired by Rails on Rust

https://loco.rs/

Discussions: https://discu.eu/q/https://loco.rs/

#programming #rails #ruby #rustlang #webdev


I've been looking at this for 20 minutes and I am still not sure whether this is real programming language or extremely sophisticated trolling.

Uiua https://www.uiua.org/

#programming


Since other people are discussing these things, always a good reminder that on #scala using cats-effect library and using #FunctionalProgramming these thing are properly abstracted away nowadays and on daily usage one finally barely has to care at all about it. - https://typelevel.org/cats-effect/docs/thread-model

----

Two kinds of threads pools, and why you need both | Lobsters - https://lobste.rs/s/k8knw4/two_kinds_threads_pools_why_you_need_both

#programming


I've written a #tutorial on how to program #accessible #native #gui #windows applications in #rust using the native-windows-gui library: https://modulus.isonomia.net/tech/nwg/

Also available in Spanish: https://modulus.isonomia.net/tech/nwg-es/

#a11y #programming


Bueno, ya he sacado tutorial. Aquí os explico como programar una aplicación de #gui nativa para #windows con #rust, y #accesible. https://modulus.isonomia.net/tech/nwg-es/

#a11y #programming


Feedback wanted: I made a drop-in JSON replacement that produces smaller payloads. It's for busy programmers who want a quick win. https://evanhahn.com/jsos-proof-of-concept/

It might be a bad idea! Please let me know what you think.

#JSON #compression #programming


Announcement: All-in-one JMAP, IMAP and SMTP server written in Rust

https://github.com/stalwartlabs/mail-server

Discussions: https://discu.eu/q/https://github.com/stalwartlabs/mail-server

#programming #rustlang #selfhosted


Let's get this show on the road, then. In my early days of composition, I used a #midi #programming #language called Zel, which I first found in June of 2001. In fact, you can still find it at its website! https://zelsoftware.org This youtube video is the first completed tune in Zel, from december of 2001. Its simple, I don't do any fancy synth tricks, except some delay on the final piano line, and it's rendered with my #Roland sc-8820. Well, i say simple, at least in comparison to what I'd pull off later. https://www.youtube.com/watch?v=lK9dg5CMWxc


#Yaga #mod for the #Gothic #game status update.
Recently the Open Gothic reimplementation of the ZenGin engine became quiet stable which let me to wonder whether it wouldn’t be easier to port YAGA to this engine, instead of relying on the Union SDK which is basically a set of reverse-engineered classes of the original ZenGin engine. This way, we get macOS compatibility, future-proof support for future Windows releases, ETC. That means a lot of Yaga’s code base would have to be rewritten from scratch, but that’s with the benefit.
Tell me what you guys think, and let’s comment on this issue if you have some valuable insights

https://github.com/try/opengothic/issues/479
#programming #GameDev #accessibility #blind


Coders: keep your computer responsive while building the #LibreOffice source code! Learn how: https://dev.blog.documentfoundation.org/2023/07/04/parallel-build-tuning-the-performance/ #coding #programming #foss


Early #Perl luminary and author (#OReilly camel and llama books, many magazine articles, etc.) Randal Schwartz, a/k/a merlyn, is in dire financial straits.

He needs gainful #employment NOW of any kind, and although his #programming language of choice now is #Dart and the #Flutter framework, he’s willing to fall back on his @Perl chops.

Refer or reach him at https://linkedin.com/in/randalschwartz

Or do what I’m doing and sign up for his #Patreon at https://www.patreon.com/randalschwartz

#OpenToWork #FediHire


🆕 blog! “Regular Expressions make me feel like a powerful wizard - and that's not a good thing”

(This is a rant because I'm exhausted after debugging something. If you've made RegEx your whole personality, I'm sorry.) The other day I had to fix a multi-line Regular Expression (RegEx). After a few hours of peering at…

👀 Read more: https://shkspr.mobi/blog/2023/02/regular-expressions-make-me-feel-like-a-powerful-wizard-and-thats-not-a-good-thing/

#ComputerScience #programming #regex


A two-month beginner's project: Machine Learning from scratch

https://github.com/Raibows/MLinRust

Discussions: https://discu.eu/q/https://github.com/Raibows/MLinRust

#programming #rustlang