cows_are_underrated

joined 2 years ago
[–] cows_are_underrated@feddit.org -2 points 8 hours ago

And for some reason the UN does not fucking about what its supposed to care, AS long AS Its not white people dying in a conflict.

The lack of a strict type system is, what drives me away from python (there is a lot of other stuff I also dont like, but its lack of a type systems is one of the biggest reasons). My first language was Java, which I learned during highschool and while I thought that the strict type system was annoying, working with Python made me realise how much I hate not having a strict type system. In every god damn function you have to manually check for the type you received to make sure everything works as expected.

That worked. Thanks :3

Working with a vector directly would probably be easier, however for a learning experience this was actually great. I read through quite a lot of documentation trying to figure out how I achieve what I want. Might reimplement it with vectors later just for the learning experience.

[–] cows_are_underrated@feddit.org 2 points 1 day ago (9 children)

Currently I am trying to figure out how to access and change single characters in a string (I am coding a basic version of hangman to get used to working with rust). The main problem I have is, that I can not figure out how to change the value of a single character in a string based on its index. I have a string (that has the same length as my "word to guess") containing only underscores and whenever the user correctly guesses a character I want to replace the underscores by the guessed character to show the user how much he has guessed so far. I was able to turn the string into a char iterator, but I could not figure out how to change elements of said iterator (this can be seen at line 55).

The code is here: https://pastebin.com/kfSYWT42`___`

 

I recently started learning rust, and I was ready for one hell of a fight. I heard all those horror Storys about the compiler complaining about every single detail and that developing rust means having a constant fight with the compiler about seemingly irrelevant things. However, so far I have to tell, that while its somewhat true, that the compiler is somewhat picky, it is incredibly helpful. Never before have I seen such good and helpful compiler messages. It not only says what you did wrong, but also gives direct help on what to do to fix your code. I also really like, that it gives you direct references to the rust book in the compiler messages.

Prior to starting my journey with rust I did quite a lot of python, some C and some bash and their interpreter/compiler messages are nothing when comparing them with rust. Especially the bash error messages are awful if you do not know what they mean and how to fix them.

[–] cows_are_underrated@feddit.org 6 points 1 day ago (1 children)

Can I use a password manager?

[–] cows_are_underrated@feddit.org 6 points 3 days ago* (last edited 3 days ago)

Ok, I somewhat have to correct myself. It seems like Germany itself does not buy russian oil anymore. However the picture isnt that clear for russian LNG (at least according to what I found).

It looks like, that russian LNG has been banned in March last year (as according to this article). However it is quite hard to find out if we still import russian LNG. Until the end of January last year germany was still happily buying russian gas (source). Since the european LNG network is a shared network it is impossible to determine, how much of russian gas, that still gets accepted at other terminals reaches germany. SEFE (the company that operates the gas terminals in countries like france and belgium) claims, that it is not sending russian gas to germany, but its basically impossible to track the origin and destination of the gas molecules as soon as they enter the pipeline. So while germany itself probably isnt buying it directly, we very probably still heavily depend on russian gas imports (source).

And it would still be great, if we could get access to drugs legally. People have always done drugs and will always do drugs. Not because they need an escape from reality, but because they are fun. Would be nice if we weren't forced to rely on shady people not lacing it with stuff just so that we can consume the drug of our choice.

[–] cows_are_underrated@feddit.org 5 points 3 days ago (5 children)

And why do we still buy Russian oil then?

The thing about rich people is, that Ehen you have the money to buy all the drugs you want, you can do quite a lot of them until it starts to affect you financially.

Just think about how much cocaine rich people like to snort.

I am still learning Rust, so I can Not really say that much about it, but especially when considering things like Error handling it seems very good. No more returning invalid values. You just return a Result type and implement error handling based on that.

 

I personally havent really used emacs for organizing, but I really like it for bash coding and writing software documenation in orgmode. I am even starting to get a little bit comfortable at writing my .emacs file but at some point I will have to do a lot of reorganizing and updating and I kind of dont want to do it (I still use .emacs and not emacs.d/init.el and all keybindings still use the legacy global-set-key command).

Apart from the work I am putting into it it is really great, because when I actually get to do stuff I can do so with great efficency. I am even starting to miss my emacs keybinds when not using emacs (especially ctrl-k for killing from your cursor position to the end of the line ctrl-a for jumping to the beginning of a line and ctrl-e for jumping to the end of a line). At this point when I am writing stuff in emacs (as example working on a bash script) I at maximum use my mouse for scrolling.

Fuck, I really did turn into the meme (and I am not even using it for longer than 4-5 months at maximum)___

 
 
 

Someone once told me somewhere, that if I am trying to learn rust, I should learn C first, so that I know how to shoot myself in the foot, learning to avoid doing so, so that the borrow checker of rust doesnt seam to unforgiving (since you somewhat know, what happens if you dont follow best practices). So thats what I did (somewhat) for the past 6 months. I wrote some stuff in C, but mainly I had quite of a deep dive into operating systems (mainly linux), working mechanics of memory and the CPU and a lot more (I will try to make a list of the stuff I learned and the ressources used below). My question to you is, if there are any additional concepts/things I should learn beforehand, to start learning rust.

The (somehwat complete) list of things learned for the past 6 months:

  • Stack Behaviour (Why its so fast, what its used for,....)
  • The heap (why its useful, but dangerous)
  • Theoretical Concepts of threading (Concurrency vs. paralellism)
  • Theory of race conditions (how and why they occur, and some tricks to avoid them)
  • Concepts of Memory allocation on an OS level (Address Spaces)
  • System calls and the separation between kernel and user space
  • Signals
  • Basics of Inter-Process-Communication
  • CPU-Scheduling (CPU-/IO-Bursts, context switches, different scheduling algorithms up to ROund RObin (based on complexity))
  • How loops, conditions and function calls get implemented in Assembly / how the CPU performs these
  • Bitwise Operations

I probably forgot a significant part of the stuff I learned, but its quite hard turning it into a list, without writing a whole book, and trying to remeber everything.
Most of these things are mainly theory, since I havent gotten around to code that much in C. However I definitively have some experience in C. This includes on how to handle pointers, basics of handling the heap, strings (even if I absolutely hate them in C) and some system calls (I played around with sbrk for custom memory management without malloc).

The ressources I used for learning is primarily the YouTube-Channel CoreDumped (I highly recommend), LowLevel and some other ressources, but these were the most helpful ones.

So, feel free to send me down my next rabbit hole before starting rust.

 
88
submitted 1 month ago* (last edited 1 month ago) by cows_are_underrated@feddit.org to c/selfhosted@lemmy.world
 

So, I am soon going to finally set up my first home server. Exams are not that far away, I am motivated as shit, my first own domain is bought and I want to level up my sysadmin skills.

Currently my plans look like this:

  • Host Jellyfin
  • Host my own NAS
  • Some form of hosted musicstreaming integration with my local music
  • Automate Backups and push them on my server
  • make all of the above things available where ever I want using my own self hosted domain.
  • run my own dns

In the long term I also want to be able to host my own webapps, since I will soon start to develop one for someone.

Now I want to know what suggestions do you have, for stuff thats really cool and that I can selfhost.

Edit: thanks for all the replies. Definitely going to look into this.

 

These times may also create some really strong women.

 

I am searching dor some form of software that I can use to watch all the different media I have stored locally, similar to Jellyfin. However the Problem is, that I do not have a dedicated media server (yet), so I am searching for something that I can use like Jellyfin, but that just runs locally. Everything that I have found is aimed at media servers. Do you have any suggestions?

 

So, I just started getting into emacs and now I am curious about what cool features there might be, that I dont even know exist. No matter if its packages or keybinds.

Would also like if someone has some suggestions for using emacs for coding (primarily python and c) and would really appreciate if someone knows how I can set a background image to emacs.

 
 
view more: next ›