« first day (534 days earlier)      last day (4405 days later) » 

9:01 PM
ok, I asked, but I have had no reply
thank you
 
@user1285136 Having looked at the question and the answers, DeadMG’s is actually spot-on. The main problem in your code is the lack of data structures. If you used a boost::multi_array or nested std::vector all your initialisations could be condensed to just a few lines already.
 
That guy is persevering.
 
@user1285136 Next, you have way too many variables in the first place. I’m not convinced that those are all needed; at any rate, nobody understands a code which uses that many variables at once. Either separate the whole thing into several completely independent functions or (more likely) get rid of the variables altogether.
@user1285136 In either case, group related variables into classes and define appropriate operations on them. I can’t tell you what these would be since I don’t understand what the code does (as I said, too many things …).
@user1285136 Then, in the “adding PML” part you have the same loop three times. What?!
@user1285136 Also, this code shows that you can use way less variables. There is no sense in using different looping variables in subsequent loops.
 
Using functions would be a first good step.
And variables should have minimal scope.
 
put all (most?) of those variables in an array
 
9:07 PM
@user1285136 And I’m convinced that the multiple loops in “ABC” can also be reduced to a single loop. They look like they all do (almost) the same.
 
hey guys
 
@MooingDuck Better: appropriate data structures. I think arrays aren’t really appropriate here but the code is too complex to say for sure …
 
if you do a cross product, is it by default in a left-handed or right-handed system?
 
looking at some cross product on Wiki and it suggests that a x b is right-handed normally
 
9:10 PM
I'm left handed. That
is all I know.
 
which makes me kinda nervous since I'm working an LH system
so I figure that if I'm using a library which does a x b then I'm gonna need to actually take the inverse of that to get the equivalent LH result
 
"Using the cross product requires the handedness of the coordinate system to be taken into account (as explicit in the definition above). If a left-handed coordinate system is used, the direction of the vector n is given by the left-hand rule and points in the opposite direction."
 
ah, whatever, I don't even need cross-product right now
 
@DeadMG then it says something about " a mirror image transformation from a right-handed to a left-handed coordinate system"
 
9:28 PM
@KonradRudolph thank you very much
 
aaaargh
useless std::unordered_set index operator again
std::map<K*, std::unique_ptr<K>> here we come back
 
@DeadMG What's the trouble?
 
pretty simple
given an unordered_set<unique_ptr<T>> and a T*, determine if that T* is in the unordered_set
and if so, gain the ability to e.g. erase it and such things
 
std::find with a predicate?
 
O(N) instead of O(1)
 
9:32 PM
Oh never mind.
I see what you mean now. You want a set with intrusive keys.
 
not under any definition of "intrusive" I've ever seen
 
unordered_set is O(1)? Isn't it O(log n)?
 
The key is part of the object.
(int this case it also happens to be the whole object, but that's a coincidence)
 
@StackedCrooked No, that's a regular set.
 
@StackedCrooked unordered_set is a hash table.
 
9:33 PM
Oh, right.
 
@RMartinhoFernandes Not really, because the object's address is the key.
and it's not really "the object"'s address, it's the address it contains
 
Right, the address is a part of the unique_ptr.
 
what I want to is for an unordered_set<V>, for any key type K, search into it given K k; V v; hash(k) == hash(v) if k == v
 
The standard set containers are crappy because search operations are worthless.
 
not sure I'd call them worthless..?
 
9:35 PM
You can only use them to test for membership.
 
less useful than they could be
 
@RMartinhoFernandes as opposed to?
 
Yeah, that.
 
@RMartinhoFernandes Isn't that the purpose of a search function?
 
I feel I'm missing something here
 
9:37 PM
@jalf If you use a custom hash that only uses part of the object, you still can't search for an object given only that part: you need a full object.
If you already have a full object, searching for it is not useful.
 
ooh right, yeah, that's annoying
 
somebody should submit a DR :P
hmm
I wish I could make free functions member scope without having to declare them first :(
 
9:59 PM
I often put functions in an anonymous namespace in .cpp file.
Or do I misunderstand what you're aiming for?
 
@StackedCrooked I think he wants member functions to not be in the class' declaration. Some languages can do that
 
Open classes?
 
@StackedCrooked it's not quite open classes, you can't add member data, nor access protected/private
@StackedCrooked they're free functions that pretend to be member functions syntactically.
 
Like D's syntax?
 
@StackedCrooked I've heard D can do that yes.
 
10:03 PM
damn Lua, y u no offer a traceback function from your C API
:(
oh well
 
Ell
@MooingDuck are they "extension methods" of .net?
 
@MooingDuck Access private data was absolutely what I wanted
 
@DeadMG oh, no, you'd risk invalidating invariants.
 
I'm the author of the class, I know exactly what I'm doing
 
@DeadMG then author it into the class
 
10:10 PM
but that's so much effort to have to declare it in the class declaration every damn time
especially since they're all effectively private functions anyway and would never be called externally
plus, I'd have to declare and define 999999 wrapper functions
 
Phew. finally having made it to the end of the backlog, I salute you
The limerick was the best, just so you know.
Then the 'gathering storm' parody, golden
 
I agree
 
And the consolation prize goes to the poor chap with the Matlab generated code that should really have been in Fortran.(And @KonradRudolph trying to salvage things from the wreckage)
Good night :)
 
Ell
:L good night ;)
 
any female here?
 
10:24 PM
@LearningC what is this strange species you talk of?
You don't mean gurrrls, do you? They don't exist on the interwebs
 
user406009
@LearningC There are no real women on the internet.
 
@sehe There is one in my chatroom right now!
@EthanSteinberg That because your in the wrong chat room..
 
@LearningC Oh, lock the doors
 
user406009
Do those C++ to C compilers still exist?
 
user406009
I have an interesting idea for a project.
 
10:26 PM
a compiler that converts C++ into C and C into C++?
 
@LearningC Clang does at least one of those directions, but I'm not sure which.
 
user406009
A compiler that compiles C++ down to C. I think I might be able to modify tcc to generate some custom assembly for a fake cpu.
 
So if I get one of those and I know C, that means I know 2 languages?
 
@LearningC no, you don't know the language. It's just a hack.
 
user406009
No more than you would know assembly from compiling C++.
 
10:29 PM
@EthanSteinberg I don't know how up-to-date CFront is, but you might find another compiler that can do the translation
 
CFront was dropped because Stroustrup added exceptions and couldn't implement them in CFront
so it's waaaaay pre-Standard
 
Cfront was the original compiler for C++ (then known as "C with Classes") from around 1983, which converted C++ to C; developed by Bjarne Stroustrup. The preprocessor did not understand all of the language and much of the code was written via translations. Cfront had a complete parser, built symbol tables, and built a tree for each class, function, etc. Cfront was based on CPre (C with classes compiler, which started at 1979). As Cfront was written in C++, it was a challenge to bootstrap on a machine without a C++ compiler/translator. Along with the Cfront C++ sources, a special "half-pre...
It wasn't even called a C++ compiler at the time.
 
> tell me how to make it working....
lurrvely
 
@DeadMG simply fix the bugs! Easy!
 
what could possibly go wrong in this situation
 
10:37 PM
@MooingDucK: Psh. Real developers write bug-free code the first time around.
 
@Insilico you're new aren't you?
 
@In silico: On Chat, or on Stack Overflow? :-P
 
@Insilico programming :D
 
the sack: I'm gonna hit it
night night nubcakes
 
@MooingDuck Of course. How else was I able to get 22,261 rep on Stack Overflow? :-P
 
10:42 PM
programmers.stackexchange.com/a/5061/37547 "This implies that it is common for teams to spend more than 90 percent of their effort fixing defects." He cites an example provided by one of his colleagues of a company that spends 90% of the time fixing their bugs."
I cant reinterpet_cast from an int to an HFILE. Interesting.
 
@Insilico luck ;)
 
@MooingDuck: HFILEs are essentially opaque pointers, no?
They're not the same size as an int on 64-bit builds
 
@Insilico knowing answers is slightly different from programming practice :D
 
@jalf @MooingDuck: True. :-)
 
@Insilico Actually, turns out, it failed because an HFILE is an int.
 
10:45 PM
#ifndef _MAC
typedef int HFILE;
#else
typedef short HFILE;
#endif
Actually it's a short or an int depending on the build target, apparently. I was thinking of HANDLEs, not HFILEs.
 
newer WinAPI builds come with HWNDS and stuff not being void* but normal opaque pointers
 
@DeadMG: Right. It's something like struct name__{int unused;}; typedef struct name__ *name when you're compiling with STRICT defined.
 
Ell
@DeadMG I swear you just said yo were going to hit the sack?
 
@Ell: Perhaps DeadMG meant "hitting the sack" in the literal sense
 
@Ell you shouldn't swear, I'll call your mother :P
 
Ell
10:48 PM
:L
i just found out about eduke32
it rocks!
im stuck in the red light district though >.<
its duke nukem 32 bye the bye, so dont take that sentence out of context
 
@Insilico Yeah, fuck that sack.
 
gah! Someone posted half an answer, I edited in the missing half. It got accepted, and then he rolled back my change :/ Now it doesn't answer the question anymore.
 
Ell
im off to bed now anyway
nighty nighty :D
 
@Ell: Night.
 
huh
already midnight
 
11:14 PM
0
A: Do not show console window in release but show in debug

Cheers and hth. - AlfThis is an answer to the first part of the question, "Here I managed to prevent the window form popping up", i.e. how to set the Windows subsystem for an application in Visual C++. I will answer the second part of the question, about command line arguments, separately. // How to create a Window...

^ I answered half of a question, yay!
 
SEVEN MINUTES DOWN, TWENTY SECONDS TO GO...
 
@CheersandhthAlf I dislike the whole console/window subsystem thing in windows. Why can't I have an application that doesn't require a console, but uses the one it launched from if available?
 
@MooingDuck I think mainly because the DOS command interpreter lacked a way to launch a process (like a GUI app) without waiting for it. Now there is the start command. So now the command interpreter could wait by default, for any program.
 
@CheersandhthAlf I want an option to have a console app that doesn't require a new console window to be shown.
If wishes were horses...
 
@MooingDuck That is essentially what a GUI subsystem app is, but the command interpreter lacks a simple way to run it with the streams attached to the console. One way for the output stream is to pipe it through cat. But: Windows does not have a built-in cat command... :-(
^ It works!
 
11:25 PM
@CheersandhthAlf everything I've seen says compile two versions, the .exe is the GUI, and the .somethingElseIForgot was the console version. That's apperently what the VS compiler does.
 
That's dumb
Unless it's an efficiency thing
 
.com I think.
 
The output from the GUI subsystem app, without explicitly attaching its output stream, is just discarded. No trouble.
 
@CheersandhthAlf but when launched from the cmd window, cannot keep that as it's window and output to it.
 
when I open up the console window, and enter the name of a GUI subsystem application, the application cannot put any text in that console window. It's not possible, unless it's a console application.
@Insilico exactly
 
@MooingDuck huh, I just told you how to do it
 
> In VisualStudio case, there are actually two binaries: devenv.com and devenv.exe. Devenv.com is a Console app. Devenv.exe is a GUI app. When you type devenv, because of the Win32 probing rule, devenv.com is executed. If there is no input, devenv.com launches devenv.exe, and exits itself. If there are inputs, devenv.com handles them as normal Console app.
 
maybe i have entered the twilight zone
after all, it's past midnight here
:-)
 
11:30 PM
@CheersandhthAlf if you explained how to do it, the internet disagrees with you and I didn't understand it.
 
well what did you not understand, and what exactly is "it" now?
lemme list some facts then...
(1) it is easy to let a GUI subsystem app present text in a console window. just pipe it through cat. or more, or whatever.
(2) that demonstrates that it's false it cannot put text in the console window.
(3) the devenv hack is a very silly way to have two different apps, with different behavior, appear as if they were the same app.
 
@CheersandhthAlf: In the devenv case, you still have one application, that happens to be implemented via two binaries
 
@Insilico debatable
 
hm, splitting hairs methinks
 
-1
Q: Changing size of a dynamically allocated matrix

user1309174Trying to re-size the shape matrix dynamically. This is part of a drawing program where _capacity is the number of shapes drawn on a frame. Get the error in new Shape about _capacity saying expression needs to have a constant value. void ShapeStore::Grow(int minimumCapacity) { _capacity...

 
11:35 PM
@CheersandhthAlf I don't think it should be normal to use cat or more in the console to see the output. I think windows should have a better option than that. Forcing consumers to use cat seems like a hack.
 
That's one of the most painful questions I've answered
 
yes i agree
;)
 
It took me 5 minutes to figure out what the hell new [][] does. :-/
 
@Insilico allocates an array of arrays?
 
@MooingDuck A better way to have a GUI/console "hybrid" app IMO is to make it a GUI app and have it open a console window if needed.
@MooingDuck: No, an array of pointers to arrays
so new int[10][20] gives you an array of 10 pointers to arrays of 20 ints.
 
11:39 PM
@Insilico that means if a user doubleclicks an icon, then a console window will appear. You can't prevent it.
@Insilico no, I think it allocates an array of 10 int(&)[20]
 
@MooingDuck: The other way around
Make it a GUI app, so that it doesn't show anything on startup
And either show Windows windows, if needed
or emulate a console
@MooingDuck: The expression new int[10][20] has the type int (*)[20]
 
@Insilico oh right, so it is
@Insilico oh, so it allocates an array of 10 int[20], right, makes sense.
@Insilico but then when launched from the console, you can't put any output in the console window without making users jump through hoops like cat.
 
@MooingDucK: Yeah, it's not perfect. :-/
@MooingDuck I put in short i = new int[10][20]; and looked at the compiler error message to figure that out. :-)
 
@Insilico I actually went with flashing the console window myself :/
 
Another way is to implement the actual program as a console app
And the GUI app is just a front end for the console app
(communication done via IPC, standard input/output, etc)
That's probably the best way to do it depending on the application.
 
11:45 PM
@Insilico that would have been the far better option, but I was updating existing code. Separating the logic wasn't in the budget.
 

« first day (534 days earlier)      last day (4405 days later) »