« first day (1318 days earlier)      last day (1526 days later) » 

12:50 PM
In Git if you commit the same file twice (with or without changes) then do a push (with no conflicts etc), are both commits visible on the remote?
For example I did a commit in Netbeans and closed the IDE without push. When I reopened it I did the same commit then pushed, but only one commit showed up in the repo. Not sure if it's because the IDE was closed inbetween.
 
you can't really do "the same commit" unless you explicitly allow "empty commits"
 
right makes sense
 
you likely don't even have 2 commits locally
 
nwp
Try git log to see what you actually committed.
 
nwp
1:09 PM
It's hard to tell because it's incomplete. The print functions seem kinda useless. `get_smallest_from_vector` and `get_largest_from_vector` should be replaced by `std::min_element` and `std::max_element` or maybe `std::minmax_element`. `get_mean_from_vector` uses `0ULL` as the accumulator which is a bug. You want `0.` instead.
The single responsibility principle is tricky in that it's difficult to tell what a single responsibility is exactly. You're looping and adding in a single function. Are that 2 responsibilities? Is calculating the minimum and the maximum 2 responsibilities? Is reading
Oh, I put a newline in my message. Rip all my formatting.
 
1:45 PM
@nwp mmh, so I shouldn't make too tiny functions but also not too big ones in the end. Would in this case a function get_min_max_mean_from_vector_and_print be first: a too long name and second: be borderline in the context of single responsibility?
 
nwp
The length of the name is fine, but in my opinion the function does too much and is too specific. Generally you don't want to mix input/output with algorithms.
get_min_max should be a generic function that works on any container and people should be able to just do std::cout << get_min_max(some_vector);.
We mostly already have that with the standard library which you should know and use if applicable, so in this specific case you shouldn't write any function and just use std::minmax_element.
 
@nwp ah ok. But you said the print functions are useless, what should I do instead?
 
nwp
Just use std::cout directly.
 
@nwp inside the int main()?
 
nwp
One of the more successful styles is to write the minimal code that solves the immediate problem only and then use more advanced techniques as they become necessary. Overengineering is a problem.
@SAJW Yeah. With that size of program you might not even need functions.
I understand that you want to practice the single responsibility principle, but if you're only having a single thing to do in your program it's not really suitable for practice. Maybe make something more complicated. A pong or Sudoku clone. Then the principle becomes more useful.
 
2:24 PM
@nwp would a calculator like the one that comes with windows 10 be complicated enough to practice SRP?
 
nwp
Sure. You'd at least need to separate the GUI and parsing/evaluating expressions.
But making a GUI is somewhat complicated at first.
 
the one that comes with windows 10 is hugely over-engineered. It's open-source now, you can look at it
 
3:14 PM
@PeterT not really for what it was intended to do and the corner cases it deals with. Given how used calc is.. it's pretty small for what it could be
 
I mostly don't like how they handled the UI to code seperation in basically 3 layers, that seems superflous to me for that kind of program
It might just be there because they probably re-used the old calc code-base
 
@PeterT pretty much, it's also isolation of concerns
they didn't really want to rewrite all that very finely tuned numerics code
 
 
3 hours later…
6:45 PM
In visual studio, I have a breakpoint that is generated in a library; when VS "breaks" I have the call stack, but for each of the lines that are in the library, the line is greyed out, and I have the "Source Not Available" page when I double click on it. The .pdb is sorted with the .lib of the library. I wonder what else can I do to access the frames there..
(I'd gladly use the Debug version, but the issue does not happen in Debug.)
 
6:59 PM
@Vaillancourt is the *.pdb from the very same compile/link run as the library that's loaded?
then it should work just fine, if you manually load the pdb it'll tell you if they don't match
 
@PeterT Likely; I'll delete both and rebuild to make sure. How do I manually load a pdb?
Yes, I rebuilt the library and the PDB has been built with it; and the stack frames are still greyed out.
The lib is used as a static link library, and so I don't know how this is supposed to work, does the .pdb get integrated in to the app's pdb?
 
7:16 PM
Hm, does the binary you link it against not have a pdb?
I only ever used it with both having pdbs. Never tried to just load pdbs from a static lib. Since logically the offsets change when you link it into another DLL or exe
 
I have this library (OpenDynamicsEngine), which I build, it produces the ode.lib and ode.pdb, both stored in the same folder, then I build my app in release, with debug info, and I get the both the .exe and the .pdb of the app built.
But this thing generally "works" when it is done in debug mode.
Now I'm in "release" and so I have to jump through hoops...
 
 
1 hour later…
8:45 PM
@Vaillancourt is optimization turned on? because if it is... then the line may have been reordered or optimized out
 
Anyone have any pointers for building a program in Qt that simultaneously plays audio that's being recorded
>
 
@Mgetz I can try to disable it.
 
@Mgetz Maybe that was it! Thanks a lot, I can now look at the stack frame and see what garbage there is!
 
@Vaillancourt well remember optimization allows the compiler to do pretty much anything insofar as AS-IF is maintained
 
8:55 PM
Yes, I did not suspect it would have that effect, though!
 
9:10 PM
how to catch a off by one error in the context of accessing a vectors elements? consider this example:
for (int i= 0; i<=v.size(); i++)
    cout << "v[" << i <<"] == "<< v[i] << endl;
 
@SAJW use range based for loops, or don't use <=
 

« first day (1318 days earlier)      last day (1526 days later) »