• 3 Posts
  • 49 Comments
Joined 1Y ago
cake
Cake day: Jul 24, 2023

help-circle
rss

I feel like all the points you raise could be replied by : if you do not like it, no one is forcing you into doing it.

It is my understanding that people do this for fun - to take the occasion to get into a new language and/or exercise their problem resolution skills.

Personally, although I love coding (it is a passion), after a whole day of coding I do not feel the energy to partake in a coding event. And during holidays I am busy doing other stuff. So I do not participate in the Advent of Code. But I am still glad that the event exists for people who enjoy it and have the time for it


For a first time don’t try to get the strongest character possible. It’s a time sink to do that. Usually the main campaign of games are beatable even if you screw up something. The worst that can happen is you backtracking a bit and spending time to level up before doing the next quest.

When you played the game once and got used to the mechanics you can make a 2nd char and plan it more deeply ahead if you wish. You know what mechanics you like so the prospect of finding what to invest in what is worth etc… becomes more streamlined. But you don’t have to. You can just be happy to have finished the game and call it a day.

That’s what I did for Diablo 4. After the main campaign I did not feel like venturing more into the game or making another character so I started playing another game. If you really want to 100% a game it does require a ton of time and planning but you don’t have to


On the world’s roads last year, there were over 20 million electric vehicles and 1.3 million commercial EVs such as buses, delivery vans, and trucks.

But these numbers of four or more wheel vehicles are wholly eclipsed by two- and three-wheelers. There were over 280 million electric mopeds, scooters, motorcycles, and three-wheelers on the road last year

There are about 20x more e-bikes than electric cars. Of course its going to demand more oil.

The real question is what is best in terms of oil demand between electric cars and e-bikes


Agreed that some people can find it easier with explicit names - however some people find it easier with short meaningless names as it makes them focus on the abstraction rather than the naming. There is no right or wrong here. It all depends on the reader.


A specialized architecture will always be better than a general purpose processor no matter how advanced the tech gets.

So you will always need a GPU as a GPU is quite literally a Graphical Programming Unit, that is a specialised architecture for Graphical computations


A friend of mine got asked if she had a boyfriend. She asked back “why that question”. It was to know whether she would be likely to get pregnant and miss work.

What a horrifying mentality some companies have


Hot take: Git is hard for people who do not know how to read a documentation.

The Git book is very easy to read and only takes a couple of hours to read the most significant chapters. That’s how I learnt it myself.

Git is meant for developers, i.e. people who are supposed to be good at looking up online how stuff works.


There are techniques like abstract interpretation that can deduce lower and upper bounds that a value can take. I know there is an analysis in LLVM called ValueAnalysis that does that too - the compiler can use it to help dead code elimination (deducing that a given branch will never be taken because the value will never satisfy the condition so you can get rid of the branch).

But I think these techniques do not work in all use cases. Although you could theoretically invent some syntax to say “I would like this value to be in that range”, the compiler would not be able to tell in all cases whether it’s satisfied.

If you are interested in a language that has subrange checks at runtime, Ada language can do that. But it does come at a performance cost - if your program is compute bound it can be a problem


Why would you have to choose between tests and compiler checks? You can have both. The more you have the less chance of finding bugs.

I would also add that tests cannot possibly be exhaustive. I am thinking in particular of concurrency problems - even with fuzzing you can still come across special cases where it goes wrong because you forgot a mutex somewhere. Extra static checks are complementary to tests.

I think you can write “unsafe” code in Rust that bypass most of the extra checks so you do have the flexibility if you really need it.


[Blog] Can Rust prevent logic errors?
Cross-posting this here as I saw some misconceptions about Rust language I think that blog describes well the pros of using a strongly-typed language like Rust is. You may fight the compiler and get slower build times but you get less bugs because of the restrictions the language imposes you. The biggest con of Rust is that it requires learning to be used, even for someone who has already programmed before. It's not like Python or Ruby where you can just dive in a code base and learn on the go. You really need to read the Rust book (or skim through it) to get through the notions. So it has a higher entry level, with all the misunderstandings that come with it.
fedilink

When I first got daily access to internet (back in 2009), I got curious about how programs are built. Like, if I wanted to make my own application, what should I do?

I googled something along that direction and it linked me to a famous french website for learning programming (site du zéro) where I learnt C language.

After the course I made a 2D Snake game with SDL2. How naive was I to think I could write it in one go without testing anything in between! I scrapped the 1st attempt because it was a disaster and randomly inserting/removing * was not helping.

I started again from scratch, testing in smaller steps, and I really liked it. After a couple of weeks I had my Snake game working! I was so proud of it that I showed it to my mom. I do not have the source files anymore but I still have the binary somewhere

Afterwards I sticked with it and continued programming - I was back in school without much access to internet so I programmed on my TI-83+ instead. Eventually I pursued computer science studies then a PhD… It got me hooked real good.


Looks cool! This reminds me of Freespace, another beautiful space fighter game


Yes, getting into a new project is hard. Even when you do know the languages and frameworks it’s still hard because you have to get into the mini ecosystem that the developers of that project built. In companies there is usually an expected amount of time (days? weeks? Months? Varies on the project) where a new developer is not really expected to do anything major, just getting used to the project.

I do not know if you are professional or hobbyist. But coding takes a lot of time, a lot of it is spent on just figuring out how you will code this or that feature ; then another bunch of time is spent debugging ; and finally, yet another bunch of time is spent integrating your new feature. That’s why it’s a whole job, and that’s also why you need a ton of free time to do this as a hobbyist.

But the good news is that once you spent that upfront time to get into the project, you can code more efficiently (that is, get right to the features you want to make) and you will also spend a little bit less time getting into other projects because although projects are different, there is always some level of organization that remains similar. The more advanced you become, the quicker you can get into a “production” state where you can code right away thanks to spending less time figuring out how things work.


The Christian Bible’s Matthew 24 had a prophecy that is about to become historical-fact, in the coming decade.

Here’s a decent version of it:

https://www.biblegateway.com/passage/?search=matt+24&version=AMPC

That bit around verses 15-20 is the pertinent area.

Simply wait 1 decade, and see: if Israel still exists, as a country, in 2033, I’ll eat a hat.

The nice thing about prophecies is that they can never be proven to be false. Indeed, one would have to examine the future to prove it wrong. Which is either impossible or unrealistic.

Me too I can make a ton of prophecies and claim they will be eventually right. I will never be wrong.

Let’s see. Let me prophesize that:

  • The US will cease to exist
  • We will encounter aliens
  • See where you are living right now? Eventually, it will be filled with lava.
  • See where you are living right now? Eventually, it will be flooded with water.
  • A giant comet populated with nyan cats will crash on Earth

However, you can be sure that in 2033 I will come back in this thread and have you eat a hat. Marking the date and the link in my calendar. If lemmy is still alive, that is


They are not making them more efficient. They are studying how to make them more efficient. It’s a really big difference because I am not yet ready to place my life in the hands of a CNN-based AI


Yeah exactly. Here follows some spoiler for those who have never played Dark Souls

spoiler

Once you escape from the asylum you can get to the catacombs right away. I did that and got my ass kicked so I figured I was not supposed to get there first.

So I went up towards the upper Bell. Which I did ring. But then afterwards it looked so clear to me, especially as you unlock the shortcut to Firelink : yes ! The other bell must be down in the catacombs! So I headed there.

I struggled a lot to handle all the monsters. I kept going until the valley where you face skeletons on wheels and the black Knight. I figured “no something isn’t right, I don’t think the game is supposed to be that hard. There are tips on the ground about using a divine weapon but I don’t even know how to get one.”. I read a post online and figured I went the wrong way… Once again

Once I fixed that and went the right way things got significantly easier. I heard how some players literally got down to the catacombs from the get go and somehow managed to get to the boss door only to be met by a yellow fog that can’t be passed, and how they struggled to get back to firelink without getting killed…

The bottom line is that I think you need to have someone telling you where not to go to really enjoy Dark souls. Because its not obvious whether you die because of your incompetence or just because you were not supposed to be there right now. I wouldn’t say its bad design though - but it’s not for everyone for sure


I used to dislike dark souls. Recently I tried it again - I struggled but I finally got the hang of it!

I think the hardest is to know what to do. I figured out I was struggling because I kept going in zones I was not expected to go yet.

Also it’s such a big shift compared to what I was used to. You have to wait for the right opportunity to attack rather than going in there and relying on reflexes.



I see. You want to offload AI-specific computations to the Nvidia AI cores. Not a bad idea, although it does mean that hardware that do not have them will have more CPU load so perhaps the AI will have to be tuned down based on the hardware they run on…


You could imagine training one AI for each game AI problem like pathfinding but what is see the benefit over just using classical algorithms?

Can DLSS and XeSS be used for something else than upscaling?


They are for providing special hardware for Neural Network inference (most likely convolutional). Meaning they provide a bunch of matrix multiplication capabilities and other operations that are required for executing a neural network.

Look at this page for more info : https://www.nvidia.com/en-us/data-center/tensor-cores/

They can be leveraged for generative AI needs. And I bet that’s how Nvidia provides the feature of automatic upscaling - it’s not the game that does it, it’s literally the graphic cards that does it. Leveraging AI of video games (like using the core to generate text like ChatGPT) is another matter - you want to have a game that works on all platforms even those that do not have such cores. Having code that says “if it has such cores execute that code on them. Otherwise execute it on CPU” is possible but imo that is more the domain of the computational libraries or the game engine - not the game developer (unless that developer develops its own engine)

But my point is that it’s not as simple as “just have each core implement an AI for my game”. These cores are just accelerators of matrix multiplication operations. Which are themselves used in generative AI. They need to be leveraged within the game dev software ecosystem before the game dev can use those features.


Well Ruby does exactly that though. The methods have good documentation so it’s easy to find what something does. There is no magic in the language that makes it do something else than what you wrote.


I love Ruby since I got introduced to it. The syntax is great and you can do many things in a simple manner.

Before that, Python was my go-to language for scripting but now I cannot stand the syntax anymore. I dislike the lack of braces and forced indent.


It’s not as simple as that. Those cores are specialised in handling graphics. Game devs have 0 control over it


Oh, it most definitely is scummy. It’s no news that Tinder does not care about people well-beings. Actually, they want you to get stuck to the platform as long as you can; if everyone was finding their partner after a week their platform would not be profitable anymore.


On Tinder it would not be in the same context that what you experienced. In OKCupid it’s part of the rules that you can send messages without a match. So people are OK (I guess) with it. On Tinder it’s going to come as unexpected and unwelcome. You will start with a disadvantage. Unless the woman is only interested in money (if you can spend $500/month on an app then you are probably among the wealthier half of the population).


Say I want to make an app on my phone for personal use. How to begin?
Hello there, I am an experienced programmer. I can do C/C++/Rust/assembly/Ruby/Perl/Python/ etc.. The language itself is not a barrier. The barrier to me is that I have never coded a single web or android application. I guess it must be surprising but I am more of a low-level programmer in my job (I develop a compiler backend) and I never really had the opportunity or idea to work on an app. What would be a good starting point for making an android application? A quick search got me this: https://google-developer-training.github.io/android-developer-fundamentals-course-concepts-v2/unit-1-get-started/lesson-1-build-your-first-app/1-1-c-your-first-android-app/1-1-c-your-first-android-app.html Would it be a good starting point? Side note: my app will not have to interact with any service. If I were to code it as a command-line program, it would not take me more than a day or two. The actual app would involve (for now) no more than a text field, a button, some logic attached to it - the hard part for me being to choose a framework to build it, "upload it" to my phone and use it.
fedilink

If the code base is arcane enough, code reviews won’t matter. You just won’t understand at all what is happening there. And the “Martin” will probably pressure you to accept anyway by telling the bosses “I can’t work, they won’t accept my code reviews”.


Absolutely. Just yesterday I tried asking stable diffusion to draw me “An elephant and a monkey dance while two cheetahs drink punch. The elephant and monkey look very happy. The cheetahs look bored.”

It drew me two elephants with monkey hair and two cheetahs. No punch, no dance.

If what you ask is somewhere in the bank of images it will draw it. But if what you ask is a situation the AI has never encountered before in any image, it will fail to invent it.

If all artists used AI we would be stuck on a loop of content that is not novel. Years from now we would stop seeing amazing incredible art. There would be no evolution at all in the styles.

I am glad that there are artists who continue to draw without AI even if it must be hard for them.


Yeah sometimes you just have to take a step back and think again. Then you will think more clearly and actually know what you wrote :) good luck!


Instead of blindly trying code until it works I would suggest you to write on paper the distinct steps that are required to solve the problem.

Imagine you are the computer and you can do nothing else but what Python allows you. How do you solve the problem ?

Usually people do this exercise on a small example. Then they generalise the approach when they find examples where it does not work.


Make sure to specify you only use spaces before asking for the raise! It works!


Interesting take. I prefer spaces because each piece of code that I see with tabs has an implicit tabsize you really need to have if you don’t want the code to look ugly - especially if the person has been mixing tabs and spaces - and they usually do. Sometimes unadvertently.

When you remove all tabs at least everyone is on the same page.

To the actual problem raised by the article:

I have ADHD. Two spaces per indent makes it damn near impossible for me to scan code. My brain gets too distracted by the visual noise. Someone who’s visually impaired might bump their font size up really large, and need to scale up or down the amount of space per indent. Someone might just prefer it because…

I wonder if it could be possible to adjust the “indent number of spaces you see” in code editors. Code editors are able to figure out what are indents and what are not, so in theory it should be possible. Perhaps that would be an idea for a new feature?


I understand that video games dev and Web dev does not overlap but the developer field is more vast than just Web. For example embedded development uses a lot of C/C++ so knowledge would be transferable there.

I would also say that even though the engines or framework is not the same, surely there are human skills that can be transferred like managing a project, solving problems, algorithms, performance analytics and debugging.

But that’s only my theory and I have no experience on switching field like that




I highly disagree with the 2nd point

I hate RTS because there are so much going on everywhere at the same time that I just can’t handle it. You gotta master your production while scouting while repelling raids while strategizing to see what kind of army the opponent is building while exploring the tech tree and… damn how did they just send an army of 50 fellas??

MOBAs allow me to fully focus on the moment and whatever I’m doing instead of being perpetually late on the actions that need doing


I’m yet to find a single field where most tasks couldn’t be replaced by an AI

Critical-application development. For example, developing a program that drives a rocket or an airplane.

You can have an AI write some code. But good luck proving that the code meets all the safety criteria.


Then you have to ask yourself, is it worth it to add yet another function that can crash your program if misused just for that 10% in a situation where they might not even matter

C/C++ already exposes a ton of undefined behaviors: it is part of the language to give full control to the programmer. If you want a language that minimizes the number of undefined behaviors you can get into, C/C++ is not the right candidate anyway. Something like Ada or Rust is much more relevant for that.

So I would say yes, just as long as it is properly documented.


That explains a lot of things! I couldn’t get into Morrowind for this very reason


Any game that requires regular playtime is a nope for me now. I switched to games that you can put off easily - games that are playable under a fixed amount of hours and that do not require dedication.

Typically right now i am playing Dark Souls on twitch - I can turn it on, play a bit (even just 30 minutes) then put it down easily.

I also switched to board games - my SO is not into video games but she is into board games so we can enjoy that together. We are playing Gloomhaven Jaws of the Lion right now it’s a blast


Apologies - I am not good with names and the “Show context” feature only shows one message. I did not even realize I was talking to a different person. Thanks for clarifying


Should we create a community for programming help?
I used to be a lurker of r/C_programming where people would ask questions and get answers. It mostly consisted of students wanting to get a human answer to their problem. I liked chiming in there and answering from time to time. Although you always had that one student who ordered to do the homework for them, there were some nice and helpful interactions in that subreddit. Would people be interested in a community focused around helping each others in programming? Or would this very community do the job already?
fedilink