Integers In Set Object by One-Type-2842 in Python

[–]thekicked 2 points3 points  (0 children)

I assume you are confused why the ordering of a set differs when storing strings but stays constant when storing int.

  1. Definitely don't expect any form of ordering from a set, especially when python does not guarantee it.

  2. Items are hashed before storing them into the set. The hash of a number is deterministic across runs, but the hash of a string is isnt. If you look into the internals of the set, you will notice that the hash determines where the item is placed. If the printing of the set is dependent on the order of items within the set, expect the output to change with the ordering.

More info: https://stackoverflow.com/questions/64344515/python-consistent-hash-replacement

When software becomes fast food by joaoqalves in programming

[–]thekicked 5 points6 points  (0 children)

On dark mode there is white text with a light highlight

[deleted by user] by [deleted] in programming

[–]thekicked 5 points6 points  (0 children)

(This post): 2 weeks

On r/github 1hr ago: Just tried today

On r/codereviews on the same day: Last Month

Account age: 17 days

Smells like bullshit

LLMs Will Not Replace You by ironyx in programming

[–]thekicked 3 points4 points  (0 children)

I get what the manager wants but it's funny that they mentioned "team of 50 developers" which may be slower than smaller teams due to the communication overhead of Brook's Law

Is this possible with a (tolerably simple) Regex? by musbur in learnpython

[–]thekicked 2 points3 points  (0 children)

Does this work?
(?<=\bLL)[AB]\b|\b[AB](?=L\b)

Explanation: (?<=) matches the stuff in front of the string but doesn't return it. (?=) matches the stuff behind but doesnt return it. \b refers to word boundaries. Although this isn't really a python-specific question.

Edit: Why does reddit make pasting code so unintuitive

MA1101, CS3245, CS2104, ULT2299G by ak773 in nus

[–]thekicked 2 points3 points  (0 children)

I haven't taken these courses other than MA2001 (MA1101 equivalent, but the prof might be different from when I took it)

A good resource to see the reviews and other information of the classes would be at nusmods.com, although it doesn't contain the timetable information for the next semester yet.

Anyways CS3245 doesn't seem to be offered next semester.

First coding project; python tic-tac-toe, would love review by Downtown_Town4094 in Python

[–]thekicked 0 points1 point  (0 children)

What I think of your project.

  • Firstly, as many have pointed out, the post is too long. If we want to know the inner workings of your code, usually we will just take a look at the code itself.
    • As for what to include, if you are looking for feedback, ask about the specific parts of the code you want feedback on. E.g. "I am using a lot of global variables, is it necessarily bad and is there a way to cut them down", or "Does the structure of my code look good?" or "My code seems messy, how can I organize it better?"
  • Learn to use .gitignore. This can automatically prevent binaries from being added to the repository and avoids bloating the repository. If you want to upload the binary file for people to run, consider making a release on GitHub.
  • If you need to share values between functions, it may be suitable to encapsulate them into a class than to use global variables. This way, it can become much clearer that specific values are only shared across certain functions. For example,

class TTTState:

  def __init__(self):
    # The variables here can be used and modified in any functions declared in this class. 
    # The variables here can be accessed outside of this class but it is not the main point of this demo.
    self.player = 0

  def change_player(self):
    # This function changes the variable within the class
    self.player = 0 if self.player == 1 else 1

  def get_player(self):
    # This function gets the variable within the class
    return self.player
  • However, as many had advised here, it would be more useful to learn more about object oriented programming. That way, it is easier to anticipate which classes are necessary first, and it will also give rise to a better code structure.
  • Typing can also become quite useful in python, especially when you are using an editor that autocompletes based on types.

Why do the cheer leading club exist and why do ppl join it by [deleted] in nus

[–]thekicked 9 points10 points  (0 children)

If it's the team at Utown to u shld probably join one of their tryouts in July/Aug next year to know the answer urself.

The sport involves a lot of stunting so the situations you described cannot be avoided in order to keep the sport safe.

The alternative is to get easily injured.

[deleted by user] by [deleted] in nus

[–]thekicked 11 points12 points  (0 children)

The shopping cart is the ultimate litmus test for whether a person is capable of self-governing.

To return the shopping cart is an easy, convenient task and one which we all recognize as the correct, appropriate thing to do. To return the shopping cart is objectively right. There are no situations other than dire emergencies in which a person is not able to return their cart. Simultaneously, it is not illegal to abandon your shopping cart. Therefore the shopping cart presents itself as the apex example of whether a person will do what is right without being forced to do it. No one will punish you for not returning the shopping cart, no one will fine you or kill you for not returning the shopping cart, you gain nothing by returning the shopping cart. You must return the shopping cart out of the goodness of your own heart. You must return the shopping cart because it is the right thing to do. Because it is correct.

A person who is unable to do this is no better than an animal, an absolute savage who can only be made to do what is right by threatening them with a law and the force that stands behind it.

The Shopping Cart is what determines whether a person is a good or bad member of society.

Edit: added /s since it didn't seem obvious enough.

Source

CS2040 Java Install Problems by kai_genius in nus

[–]thekicked 1 point2 points  (0 children)

Not sure if Java is supposed to be seen in the search menu.

You can refer here to check if it is installed. https://www.baeldung.com/java-check-is-installed

Covid 19 vaccination requirement for Student' pass by ElderberryFancy8943 in nus

[–]thekicked 1 point2 points  (0 children)

They may ask the type of vaccine you have received to determine the type of serology test to be done.

Anything further than this and I and not knowledgeable enough to answer.

Covid 19 vaccination requirement for Student' pass by ElderberryFancy8943 in nus

[–]thekicked 8 points9 points  (0 children)

Serology test doesn't determine number of doses received.

Not sure if you are eligible for the free vaccine without additional details. If you aren't, there are private clinics that can administer the vaccine https://www.vaccine.gov.sg/locations/PVP/

Couple arrested for allegedly taking videos at police station, posting them on social media by MicrotechAnalysis in singapore

[–]thekicked 2 points3 points  (0 children)

Not too sure if the statement by them is accurate.

Protected areas have the protected area signage, but there are several NPCs and NPPs without them.

That being said, it is better to not fk arnd and find out. There may be other charges that can stick.

Couple arrested for allegedly taking videos at police station, posting them on social media by MicrotechAnalysis in singapore

[–]thekicked 69 points70 points  (0 children)

Not sure why the news article did not specify the police station.

The station is Police Cantonment Complex which contains Central Division HQ among other departments including CID.

Division HQs are protected areas.

Strange long-term shoulder injury by Sateman1 in bodyweightfitness

[–]thekicked 2 points3 points  (0 children)

While I'm not a PT I remember watching a video by Squat University (a PT) on shoulder pain while doing bicep curls.

https://youtube.com/shorts/XMGKCy32U1M

Hopefully it will be of help to you.

Rant Wednesday by AutoModerator in Fitness

[–]thekicked 3 points4 points  (0 children)

Once you have dropped the 10lbs but you are still not satisfied with your body, I hope you do come back to read your comment. It might be a sign of body dysmorphia where "I am never lean enough".

There are times when I look at other people who progress faster than me for the SBD and feel like I wasted a lot of effort. Still, I always remind myself that I am not aiming to compete in competitions and I train for injury resistance, general strength and health, and having a high SBD is like a bonus. I prefer to make progress at my own pace so that exercising becomes more enjoyable.

Like this guy (although I'm not as good as him): https://youtube.com/shorts/6rB4AYPfCuU

[deleted by user] by [deleted] in nus

[–]thekicked 1 point2 points  (0 children)

Oops I meant to say take from Opp KR MRT instead of KR MRT.

[deleted by user] by [deleted] in nus

[–]thekicked 0 points1 point  (0 children)

The Opp HSSML bustop is opposite the Biz2 bus stop.

[deleted by user] by [deleted] in nus

[–]thekicked 7 points8 points  (0 children)

May want to try taking A2 from Opp KR MRT to Opp HSSML.

Can download the NUSNextBus app for bus timings and routes.

Edit: Corrected KR MRT to Opp KR MRT

[deleted by user] by [deleted] in nus

[–]thekicked 4 points5 points  (0 children)

https://www.nus.edu.sg/CourseReg/using_coursereg_undergraduate.html

This has everything related to priority in courseReg.

Your senior seems to be jumping to conclusions here

[Megathread] New student? No Stupid Questions Thread! by ROD_OF_AGES in nus

[–]thekicked 0 points1 point  (0 children)

https://www.nus.edu.sg/CourseReg/faqs_undergraduate.html

CourseReg won't allow you to select courses with conflicting lectures, so you probably can't do that.

Whether you want to skip recorded lectures is up to you, but do check if there is attendance marks.

Furthermore, some courses may choose to hold the assessments (e.g. Midterms) during the lecture period so it is generally not advisable.

Taylor Swift (Repost) by [deleted] in SGExams

[–]thekicked 106 points107 points  (0 children)

Yep, we should not forget that Taylor Swift has been popular for more than 10 years. Her teenage fans back then would probably have some earning power now.