Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Activity for celtschk
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #284510 |
Can you please be explicit on how that version differs from the original one? And what that crucial hint was? (more) |
— | over 2 years ago |
Comment | Post #284444 |
Well, for each dictionary *that you want to access this way.* And an instance is cheap, isn't it? However thinking of it, one useful addition would be to recursively treat dictionary values (possibly controlled by a constructor option), by automatically wrapping them as well if accessed as attributes... (more) |
— | over 2 years ago |
Comment | Post #284444 |
An additional class for each dictionary? You didn't actually read my code, did you?
But yes, the goal is syntactic sugar. Being able to use `proxy.foo` instead of `dictionary["foo"]`.
(more) |
— | over 2 years ago |
Edit | Post #284444 | Initial revision | — | over 2 years ago |
Question | — |
A class to access dicts using attribute syntax I've written a class that allows to access dictionary entries of arbitrary dicts with appropriate string keys through attribute access syntax on an instance of the class. My questions are: 1. Is this class a good idea to begin with? 2. Is there anything that should be done differently? ... (more) |
— | over 2 years ago |
Comment | Post #282566 |
The reason for the `-ansi` misunderstanding is history (and IMHO a bad choice by the compiler developers). Originally (at a time where only one version of the C standard and one version of the C++ standard existed), `-ansi` was indeed the correct way to enforce standards conformance; the `-std` optio... (more) |
— | over 2 years ago |
Comment | Post #284343 |
I notice that your Java installation line contains the word “headless”. “Headless” basically means “without screen”. Therefore I'd guess that the remaining problem is that you installed the wrong version of jdk. From a bit of internet search, I suspect that you'll get what you want with `sudo apt ins... (more) |
— | over 2 years ago |
Comment | Post #284343 |
On Linux (and generally, on Unix systems using the X11 window system), the DISPLAY environment variable tells how to connect to the X server, which manages the graphical display. Apparently something tried to open a window. I don't know anything about netbeans, but I see two possibilites:
* Eith... (more) |
— | over 2 years ago |
Comment | Post #284265 |
Yes, submarines can “collide” with each other (they just move through each other). If I were not distinguishing between bombs and submarines, then each such collision would cause a collision detection. While the submarines disappearing wouldn't be *that* bad (well, the submarines collided, after all)... (more) |
— | over 2 years ago |
Comment | Post #284265 |
I just noticed that I forgot replying to your remark on the movement code.
Actually when I started writing the code, I first went with the increments version, but given the various movement directions, I quickly realised that testing the end condition would be quite complex; therefore I decided to... (more) |
— | over 2 years ago |
Comment | Post #284265 |
Thank you very much for the analysis.
On the two line separation, I didn't now that convention, but it makes a lot of sense. I'll definitely do that.
On the 80 character line length, my Emacs opens up at that width, and I like to have space for a terminal (and occasionally other windows) beside... (more) |
— | over 2 years ago |
Edit | Post #284194 |
Post edited: Added missing part of settings.py |
— | over 2 years ago |
Edit | Post #284258 | Initial revision | — | over 2 years ago |
Answer | — |
A: Detecting balanced parentheses in Python You've got an inefficiency in your code, as you always do replacements 3/2 times the length of the string. That is unnecessarily expensive. By instead testing in each iteration whether the length actually changed, you get a much improved performance: ``` def isvalid(s: str) -> bool: if le... (more) |
— | over 2 years ago |
Comment | Post #284178 |
@#53185 4.3 billion cents is 43 million dollars. (more) |
— | over 2 years ago |
Comment | Post #284232 |
I may be wrong, but the way I interpret the text you quoted, it is deprecated because the corresponding functionality isn't there anymore. If so, you won't find a replacement. (more) |
— | over 2 years ago |
Edit | Post #284193 |
Post edited: Made exponent to actual minus sign (looks better) |
— | over 2 years ago |
Edit | Post #284194 | Initial revision | — | over 2 years ago |
Question | — |
A simple game with pygame I've just started playing around with pygame and have written a small game in it, of which I'd like a review. Note that I'm not only a complete beginner in pygame, but I also have very little experience in Python in general, therefore I also would welcome comments on my Python code that are not relat... (more) |
— | over 2 years ago |
Comment | Post #284192 |
Thank you. I'm going to post soon.
(more) |
— | over 2 years ago |
Edit | Post #284193 | Initial revision | — | over 2 years ago |
Answer | — |
A: Why is it considered bad practice to use float for representing currency? The main problem with using floating point is that the typical floating point type is binary floating point. But in binary floating point, most decimal fractions cannot be represented exactly. That is, if you store the number 9.95 in a floating point number, the number that you are actually storing i... (more) |
— | over 2 years ago |
Comment | Post #284178 |
Actually the correct way to deal with the rounding issue is to calculate not in cents (or whatever the minimum value is), but in units of e.g. a thousandth of a cent, and then explicitly round to cents only at the end of your calculation. This is mainly because of double-rounding errors. Of course th... (more) |
— | over 2 years ago |
Edit | Post #284188 | Initial revision | — | over 2 years ago |
Question | — |
Is this a good fit for Code Reviews, and if so, how to best post it? I've just dived into pygame and written a little game in it, of which I'd like a review (it's my first try of pygame). However I'm not sure if it is a good fit for the site, and if so, how exactly I should post it. First, the rules ask for complete code. Here's what `wc` says about all the Python ... (more) |
— | over 2 years ago |
- ← Previous
- 1
- 2
- Next →