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 jrh
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #280640 |
Ok, I'm [not really 100% sure](https://stackoverflow.com/a/37262781) whether you avoided type punning UB, to be very pedantic about it [`uint8_t*` is probably a char but might not be](https://stackoverflow.com/a/16138470), [you might not be completely off the hook in C either](https://stackoverflow.c... (more) |
— | almost 4 years ago |
Comment | Post #280640 |
@dmckee you can use [attributes](https://gcc.gnu.org/onlinedocs/gcc-4.0.2/gcc/Type-Attributes.html) to make specific types exempt from strict aliasing, also note that MSVC has no strict aliasing. Lundin, would you add this attribute to your post behind a "not MSVC" guard? Or mention [`fno-strict-alia... (more) |
— | almost 4 years ago |
Comment | Post #278932 |
I like the idea of providing higher quality selfie Q/A on here, SO definitely has some highly upvoted subpar content and this is a good chance to provide a better reference. (more) |
— | about 4 years ago |
Comment | Post #278924 |
It might be too hard for me to say without seeing some more realistic code, but I'm not 100% sure what these examples are trying to achieve; are you designing a codebase where you want to be able to switch between working with doubles or floats by changing something in the build script? Or is this ju... (more) |
— | about 4 years ago |
Comment | Post #278924 |
It seems like some projects are going in the direction of "offload every possible decision to the build script and templates" but in my opinion that's taking it much too far. I usually end up unscrambling the templates and 45 minutes later finding some UB or "it's just an int / double all the time". ... (more) |
— | about 4 years ago |
Comment | Post #278924 |
I don't know if this is a controversial opinion or not, but I think when you get sufficiently complicated with template programming, that becomes its own language, and just like macros, I think that language is much less readable than the rest of C++. The debugging options are far worse and the error... (more) |
— | about 4 years ago |
Comment | Post #278895 |
I've heard the "we don't need to do this anymore because modern editors are wonderful" argument a bunch of times, but I've found that these editors struggle in C++ with hokey macros, build scripts that set include directories that the IDE can't understand, and other weird tricks like that. Combine al... (more) |
— | about 4 years ago |
Comment | Post #278809 |
"If the targeted users are not comfortable using a CLI" -- another thing to keep in mind that affects both methods, there's a good bit of ambiguity in the exact format needed for the arguments when they are typed in manually instead of, e.g., provided through a UI. E.g., does the program accept `"par... (more) |
— | about 4 years ago |
Comment | Post #277152 |
The other thing I think would be necessary if you went that route is either establish a clear scope of what is/isn't ok to document here (I see Excel formula questions getting downvoted even though I can't find a reason why that'd be off topic here), or if you don't know right now, either disable que... (more) |
— | about 4 years ago |
Comment | Post #277152 |
I think it's important for a QA site to continue to focus on documentation as a purpose instead of "please answer my question"; that immediately would make homework, career advice, tool recommendations, code golf, and overly broad questions off topic. However the path to that probably requires making... (more) |
— | about 4 years ago |
Comment | Post #278472 |
I kind of think a new site for just CR might be better. IMO, 1) you need new close reasons, and most of the existing ones shouldn't be used (e.g., dupe close shouldn't happen), 2) research effort should probably not be a downvote reason (otherwise it might turn into "-1 because you didn't read / don'... (more) |
— | about 4 years ago |
Comment | Post #277882 |
@dmckee, yes, I am inclined to agree; I'll never use these macros again. Thanks for the tip that this is something carried over from Qt4, I did not know that. Though, does that mean that the function pointer syntax is "new"? Function pointers are built into the language, as somebody who's only used Q... (more) |
— | about 4 years ago |
Comment | Post #278363 |
This is a useful answer but readers should note that generally implementation is not a strong of a source as documentation, and could in theory change at any time. Though to be fair I think this implementation is likely to stick and I doubt they would change the meaning of the parameters. I wasn't ab... (more) |
— | about 4 years ago |
Comment | Post #277536 |
Note that for languages like C# the official answer is "you don't need to know" (which is actually a pretty important response for new C# coders so they don't go too deep into implementation details), you might want to edit this question to give a hint about what kind of computer program you're talki... (more) |
— | about 4 years ago |
Comment | Post #278189 |
I appreciate that you're thinking about selfie Q/A which is probably honestly the only kind of Q I'll ever ask, with sufficient "back door" methods you can kind of find the answer to anything (disassembly, look at library source code, etc.) well enough to get past the issue, though it might not be th... (more) |
— | about 4 years ago |
Comment | Post #278190 |
I'd have to agree that SO's Documentation project was a disaster, though I wonder if there's a subset of it that would have worked. There's plenty of small random bits of information I run into on a daily basis that aren't worth writing a blog over, and I personally never liked the "top 1000 tips for... (more) |
— | about 4 years ago |
Edit | Post #278306 |
Post edited: |
— | about 4 years ago |
Edit | Post #278307 |
Post edited: |
— | about 4 years ago |
Edit | Post #278307 |
Post edited: |
— | about 4 years ago |
Comment | Post #278306 |
I don't really know how to interpret a downvote on this, if you found official documentation somewhere on this please link it. I had to piece this together from 5 or 6 random websites to figure it out. There's [this](https://docs.sympy.org/latest/tutorial/calculus.html#derivatives) but it has `diff(e... (more) |
— | about 4 years ago |
Edit | Post #278307 | Initial revision | — | about 4 years ago |
Answer | — |
A: What do the number entries mean in the sympy poly.diff(...) tuple syntax? It appears that the tuple syntax works like this: `(variable index, order of derivative)` Where something like: ``` base = poly(xy2 + x, x, y) derivmysterious5 = base.diff((0,1)) print('derivmysterious5 is', derivmysterious5) ``` Means: "Take first derivative of `base` with respect ... (more) |
— | about 4 years ago |
Edit | Post #278306 | Initial revision | — | about 4 years ago |
Question | — |
What do the number entries mean in the sympy poly.diff(...) tuple syntax? I am looking to take a partial derivative of a sympy polynomial with respect to a symbol in the polynomial. In the sympy documentation for poly.diff(...) it gives sample code like this: ``` from sympy import Poly from sympy.abc import x, y Poly(xy2 + x, x, y).diff((0, 0), (1, 1)) ``` T... (more) |
— | about 4 years ago |
Edit | Post #277882 |
Post edited: Added an example of a connect statement that does not work |
— | about 4 years ago |
Edit | Post #277882 | Initial revision | — | about 4 years ago |
Answer | — |
A: connect with SLOT/SIGNAL: QPushButton clicked signal not received by main window Qt's `SLOT` macro is very specific in what it accepts. When specifying a slot in the `connect` function, it's required to put parenthesis, so the correct code would be: ``` connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(pushButtonClicked())); ``` With this syntax, the button `click... (more) |
— | about 4 years ago |
Edit | Post #277881 | Initial revision | — | about 4 years ago |
Question | — |
connect with SLOT/SIGNAL: QPushButton clicked signal not received by main window I added a `QPushButton` to my ui file named `pushButton`, and manually connected it using `connect`. - There are no errors or warnings emitted at any point in the compilation stage - The button does show up on the UI. - When I click on the button, nothing happens. MainWindow.cpp: ``` #in... (more) |
— | about 4 years ago |