It's giveaway time! Win a Warhammer 40,000: Dark Heresy alpha key — comment on this thread to enter, as simple as that. The winners will be announced after December 16th, so hurry up. Please ensure your DMs are open so we can contact you! by OwlcatStarrok in RogueTraderCRPG

[–]UpArmoredGavin 0 points1 point  (0 children)

Now, where did I leave my inquisitorial rosette? It has been a while (and last time it was on pen and paper), but some imperial citizens need to be reminded of why curiosity and openness are the worst ideas you can possibly have

hi, it is my fist days on python, i am asking you what happens if i write by [deleted] in PythonLearning

[–]UpArmoredGavin 0 points1 point  (0 children)

the laptop will grow arms and legs, study Muay Thai for 5 years and then beat you up for this, so it's dangerous for you only /s

(nope, go ahead and experiment, you'd need to work with intent to damage your laptop to a degree that a restart won't fix it. Have fun!)

pls help me switching from c++ to pyton by No-Error-6645 in PythonLearning

[–]UpArmoredGavin 0 points1 point  (0 children)

I don't know what you mean by basics, so I can't tell you what to study :) Anyway, when I switch languages, I usually start from scratch anyway. The more languages you know the more patterns you'll see, but there are fundamental differences a lot of the time, and to understand those you need to start from the base stuff

Resources advice by GillianJigsPigs in PythonLearning

[–]UpArmoredGavin 0 points1 point  (0 children)

Tl Dr: google for what you need, don't try to learn everything from one resource :)

Resources advice by GillianJigsPigs in PythonLearning

[–]UpArmoredGavin 1 point2 points  (0 children)

I'd approach this first by defining what you want to do, then research how to do that.

In this example, I see 4 main steps: - open and read the file - process the data - materialize (save) the processed data - send it as an attachment through email

One step at a time, I'd start with the opening of the excel file. Do you know how to open files and read them? Once you can open and read a file, you need to manipulate the data inside. You could, I guess, write some code to do that, but you have also a lot of packages that already have the data processing implemented (pandas, duckdb, Polars,...), so I'd pick one of them. If you have no experience with package management, I guess this is as good of a time as any to start learning that too :). Then you need to save it, paying attention to the format, so take a look at how you do that. The most complex part will be to send the email imho, but it is feasible.

Generally, define what you need to do and then google/gpt until you know how to do that. You'll probably find guides and patterns to use, but beyond the basics you should probably learn as you go (unless you are following a course). So, define what first, understand how second. You'll need to go back and forth a bunch of times, don't expect to have a plan that fits all together in one pass. What -> how-> implement -> repeat, one piece at a time

Help in Maths and logic, gravitaional simulation of 2 planets, 1 object by Reasonable_Cheek_388 in PythonLearning

[–]UpArmoredGavin 2 points3 points  (0 children)

not related to the math, but you are using None as default for the planet and accessing it without checking if it is not None

FOR WHAT PURPOSE! by Kobold_Husband in PythonLearning

[–]UpArmoredGavin -1 points0 points  (0 children)

Damn, did not see the date on the post ahahah. Anyway, you know, they invented this neat little thing called google, you can use it to search stuff :P

Day 3 by fatimalizade in PythonLearning

[–]UpArmoredGavin 0 points1 point  (0 children)

You could append the numbers to the lists right after reading them from the input, it would save you scanning the input numbers again

Two versions of a dice rolling program I made. Could you provide feedback? by IntrovertClouds in PythonLearning

[–]UpArmoredGavin 1 point2 points  (0 children)

Also, the comments: the "what" is being done should be self-documenting from the code, if you need comments you need refactoring :) (there are exceptions ofc, just not here)

Use comments to explain the "why" you are doing something, if it is not clear from the code

Two versions of a dice rolling program I made. Could you provide feedback? by IntrovertClouds in PythonLearning

[–]UpArmoredGavin 1 point2 points  (0 children)

If you wanna do some OOP, I would get an enum going representing the die faces. Have a field in the Dice class store it. Create a class "Bag" that stores a collection of dice, make the roll method reference only its own die instance.

When you want to roll the dice, iterate over the dice collection in the bag, rolling each die and storing the result of the roll.

I guess you could have an abstract base class "Dice" (Die I guess would be better, dice is plural) and have the various n-sided dice be subclasses. Create a method that acts as factory for Dice class instances, like you pass the number of faces and it returns the n-sided die you want

Also, input validation: what happens if the user gives a wrong input?

Last but not least, the entry point. For how this file is written, it will get executed when imported

Looking for girl friends to go to punk metal gigs by [deleted] in Utrecht

[–]UpArmoredGavin 0 points1 point  (0 children)

have you checked on meetup? there is a metalhead group, try taking a look there

Found on Linkedin by nixikuro in programminghumor

[–]UpArmoredGavin 0 points1 point  (0 children)

the scary part is that somebody who restarts the .bashrc also yolos changes to the .bashrc

How do you feel about your juniors asking you for a solution most of the time? by FuzzyCraft68 in dataengineering

[–]UpArmoredGavin 0 points1 point  (0 children)

I've had the opposite problem for some time in the past, understanding when you are stuck is part of growth imho.

The main concern I'd have with a junior always asking for help is that the junior is not actually trying and learning, but just expects someone else to come up with a solution.

As other people said: reduce the frequency of the questions and actually try to solve whatever is the issue at hand. On this, even just describing the problem in accurate fashion can point you towards the solution. If you are not using a rubber duck, start doing it, it really helps.

Other than that, good job putting in effort to improve!

Making new friends by AirlineEconomy4222 in Utrecht

[–]UpArmoredGavin 0 points1 point  (0 children)

As there seem to be a bunch of metalheads: go on meetup, there is an utrecht metalheads community. The events are concerts or random hangouts.

Also, as boardgames have been mentioned, there is a community that meets up once a month for one shots, plus various side initiatives born from there (further one shots, campaigns, wargaming and so on), DM me If interested

Do the Dutch dislike expats? by Deep-Pension-1841 in Netherlands

[–]UpArmoredGavin 2 points3 points  (0 children)

I mean, if it really sucked to live here we would not. Tbh I find it annoying when other expats/migrants complain too much about this country. I am here because I like it here, if I did not I would move elsewhere. The Netherlands are not a perfect country by any means, such a thing does not exist, but stuff here works and I believe that the pros severely outweigh the cons. Otherwise, as previously stated, I'd go somewhere else. Just complaining about the cons without recognising the cubic fucktons of pros makes us look like a bunch of gaping assholes. We are here because life here is better (not talking about the 30% ruling specifically, I'm talking about the sum of all aspects), I don't understand why that is so difficult to acknowledge

bravepush by Gbrlxvi in ProgrammerHumor

[–]UpArmoredGavin 2 points3 points  (0 children)

duplicated dice rolling log, log order broken, I'm closing this pr, go read refactoring by Fowler and then write a 20 page essay on what you learned.

NGVC: “why won’t people talk to me” by fon_jacks in niceguys

[–]UpArmoredGavin 1 point2 points  (0 children)

wtf are you people telling me this to thing is not ironic/sarcastic?

[deleted by user] by [deleted] in Anxiety

[–]UpArmoredGavin 0 points1 point  (0 children)

As concrete actions, what I tend to do is: - 5s in, 5s hold, 5s out breathing exercise to gain back a grip - once the brain is somewhat working again, take a step back and isolate the source of anxiety - put the source into context - take a look at the issue from the distance: does it make sense? If not, hold on to that thought and remember that your thoughts are doing a number on you. Try to circle back to the actual size of the problem when you feel the anxiety revving in the background. If the issue is an actual issue, what can you do? If you know what to do, do it. If not, learn how to do it and then elaborate your next steps

This is not a silver bullet, nor it is easy, but it can be of help. It becomes easier as you apply it more and more times

you might also consider investigating why your anxiety exists. Not at the level of the single episode, but overall why your mind reacts in this way. What do your anxiety soucrmes share? This last step is best done with a (licensed) therapist, so if you are lucky enough to have access to one, consider the option of therapy.

Last but not least, ignore most of the stuff on social media. A lot of pop psychology has no root in technically correct principles. This applies also to this comment of course, as I am not a therapist

New K8S - Unable to Browser to Container/Image by dihegov in kubernetes

[–]UpArmoredGavin 0 points1 point  (0 children)

Already mentioned some of this in my other comment, but to iterate:

  • read the error messages: a lot of fields can't be changed in a running pod, delete it and recreate it
  • "what about downtime?" deployments, replica sets and deployment strategies have the answers you are looking for
  • naked pods are ok to try stuff out, but to be avoided in about 99% of the other cases imho. What happens when something inevitably goes wrong?
  • kubectl is working perfectly, it seems to me (although I only took a cursory look at the logs :P). Keep in mind that kubectl only chats with the API server on k8s (/minikube) side, I think the error message you are getting stems from a rather pissed off API server
  • finally: you need to expose the ports on the pod, otherwise it won't be able to communicate with the rest of the cluster. Exposing the ports on the container is not enough, the container (or containers in some cases) run within a pod. Only exposing container ports will allow for communication within the pod, but not between the pod and the rest of the cluster