« first day (1266 days earlier)      last day (3683 days later) » 

9:00 PM
I just wanted: giefBmp(vres, hres, data); couldn't find it
 
@sehe I'm thinking chaticide.
 
:| I don't get this. In an OS, if there's a "user program area" that you can load arbitrary programs into and schedule, how do they know their offsets in memory...?
 
user1804599
You set the pointers and registers then jump to the code.
 
user1804599
Also paging is probably relevant.
 
@DeadMG It's working AFAICT. Only very few people haven't noticed yet :)
 
user1804599
9:10 PM
@sehe ban yourself.
 
I'm already banned in most countries of the european union
 
user1804599
Why?
 
@Crow They don't. The OS offsets all their pointers for them.
 
@DeadMG so if there is a jump instruction to address 15, for example, but the program is loaded with an offset starting at 10, it would simply know to make the jump go to 25 instead?
 
it won't "simply know" anything.
the OS will simply modify the jump target address when it knows the offset.
 
9:15 PM
@rightfold They're intimidated :)
 
user1804599
 
Never mind. I'll be having friday night in solitary confinement
 
user1804599
 
@sehe i thought that was how polar bears decided to spend the winter holidays
 
user1804599
Yum.
 
user1804599
9:17 PM
Cactus juice.
 
@sehe acceptable?
 
@rightfold I have a cactus but I never tried to get juice out of it
I'm still waiting for it to evolve into a cactuar
 
please double check
(I added a clarification of the difference between "default parameter" and "default argument")
 
@DeadMG oh... it seems the teacher said for this class you just write the assembly AT the offsets you'll load them at, that seems very... not good
 
@LightnessRacesinOrbit we need your precision now
 
9:22 PM
@JohannesSchaub-litb there is no mention there about default template parameters, is it intentional?
 
@gnzlbg ah please go ahead
 
seems weird to change a tag wiki with language specific construct
 
(but note that C++ has no default parameters.. it'S called default argument there, since this is not a property of the parameter, but of the call side)
 
@JohannesSchaub-litb default-parameters in C++ context means to me a default template parameter (as oppossed to a default function argument), but you are the standard expert IMO
 
@Rapptz unfortunately "default-argument" is a symonym to "default-parameter"
so in the tag wiki, both of them need to be explained
@gnzlbg c++ has no default parameters
 
9:24 PM
@Crow Depends on who is doing the loading. If you are loading programs then fixing up their offsets is your problem.
 
a parameter either is always there, or always absent
you cannot "default" it
 
ok :)
 
if you mean it in the sense of the tag wiki, that it has a default argument attached, then it makes more sense. but that is not the c++ model of it
 
@JohannesSchaub-litb so it is also default template argument then?
 
9:24 PM
if you are using the OS to load a dynamic library or other executable then the OS fixes up the offsets for you as part of their dynamic loading.
 
@Rapptz huh why does it not have a wiki?
how can one be created?
i will put my text there instead
@gnzlbg yes
 
a question must first use the tag
 
@Rapptz there are a couple of questions using it
 
@JohannesSchaub-litb TIL.. :)
 
not according to SO.
 
9:26 PM
@DeadMG that's what's odd about this though -- he is calling this assignment making a "dynamic time sharing operating system", but doesn't that mean all programs should be completely arbitrary?
 
and it's not a tag synonym to anything
 
ah it is "[default-arguments]"
 
@Crow Probably. And if you're the one writing the dynamic loader routine, then yes, you have to fix up the program's offsets.
 
oh oops
 
@DeadMG the process control blocks, user, and os memory have dynamic ready and waiting queues, etc, but the program area seems to be pretty dumb.
 
going native is being replaced by the C preprocessor conference since "it is just better in every way" :o
 
void printToScreen(istream &input = cin)
{
// this outputs any input to the screen
cout << input;
}
wtf wikipedia
does this work?
 
@Rapptz lol
does it?
i dont think so
 
iunno
In computer programming, a default argument is an argument to a function that a programmer is not required to specify. In most programming languages, functions may take one or more arguments. Usually, each argument must be specified in full (this is the case in the C programming language). Later languages (for example, in C++) allow the programmer to specify default arguments that always have a value, even if one is not specified when calling the function. For example, in the following function declaration: int my_func(int a, int b, int c=12); This function takes three arguments, of ...
 
It does, but it doesn't do what Wikipedia thinks it does.
 
9:36 PM
I don't see an operator<<(std::istream&)
 
maybe an istream implicitly converts to void* or something like that
or something streamable, and then it compiles
in C++03
no time to try it out :/
 
It indeed does ;)
 
then it would probably print the address of istream, i.e. it won't work, since it won't do what the user think it does
 
@gnzlbg See, there are different definitions of "works" :P
 
@Griwes :D IMO there is a difference between "works" and "compiles"
but yeah
 
9:42 PM
> It works it works! Omg omg omg! I mean it compiles. Now what's a segfault?
 
is like people writing stringstreams to cout
I have had people complain about replacing std::cout << stringstream with std::cout << stringstream.str() since it did work before, i.e. they mean it compiled before. It could have never worked unless their intent was to print the address of the stringstream, which from the context clearly it wasn't..
 
doesn'T cout << cin just print out the void* in c++03?
i believe it is ill-formed in c++11
 
@JohannesSchaub-litb Maybe. Still works for gcc, though.
 
in C++11 the conversion is indeed explicit
(hopefully, i haven't checked)
 
Yep, GCC seems to still like it, while clang dislikes it (at least according to geordi and clang on freenode).
 
9:47 PM
it has probably more to do with libc++ vs libstdc++
the thing is it is a breaking change
it only breaks already broken code, but still...
 
-std=c++11 is already a breaking change for broken code vOv
 
there are a lot more of older code bases relying on gcc than on clang, so their std lib moves much slower wrt to breaking changes
 
Everard Tiger, 4.2. Superb!
 
Yeah, clang on freenode uses libc++.
 
i mean the conversion to void* is so that you can use it in if(..) while(..) and so on, explicit operator bool fixes all that
@Griwes you can also use libstdc++ with clang, but then you will see the same errors as with gcc
 
9:50 PM
@gnzlbg ...again, the -std=c++11 option that is required for that to take effect already breaks shitloads of broken code.
 
they havent implemented explicit operator bool yet (AFAIK)
yes
 
@gnzlbg ...who?
 
the code is broken, so who cares
@Griwes libstdc++
 
lol
 
still lots of projects that do not want to fix broken code, want to use c++11
 
9:51 PM
That's a contradiction.
 
its retarded, but thats the world
i know
i mean
it is also an ABI breakage
lots of software does use gcc and libstdc++ and an ABI breakage like that is not trivial
i actually dont think we'll see that till gcc 5.0 or so
gcc is like one of the most critical infrastructure pieces we have
 
Yeah, ABI. The real problem, that lies in OSes being utterly incapable of doing proper library versioning.
 
ABI breakage on unix without a major version (see semantic versioning) is a no-no
 
And the library vendors incapable of doing that, but meh.
 
i mean, clang gets away with it
 
9:53 PM
libc++ is (mostly) doing it right.
 
but if gcc tries to do that in the 4.x cycle (breaking the ABI), fire would rain
 
glad I alt tabbed out of this libc++ superiority complex
 
@Rapptz lol
 
libc++ won't have it easier in the future tho
 
lua's pretty neat
 
9:54 PM
@gnzlbg Let it rain. :D
 
since it is critical now in BSDs and Mac
i.e. it wont be able to break its ABI easily in C++14/C++17
 
@gnzlbg It will. It uses this magical feature called inline namespaces.
 
oh
i forgot about those
yep
 
And thanks to that, they are going to have no problems with doing changes that don't break the ABI.
 
thats what they are there for
still, even when using inline namespaces
if you want to avoid code duplication
you have to be careful in order to not break the ABI
but it is doable, and they test the ABI for breakage
anyone watched Modern C++: What You Need to Know
?
 
9:57 PM
I did, it's not worth watching if you already know C++
 
:/
@Rapptz thanks for saving me an hour of my life :)
does he mention any interesting news or something like that at least?
 
just that there's a new CTP coming out at some point in the future
 
well
you gotta be fair to Microsoft; they have increased their release cycle.
there's been a new VS or CTP much more frequently than before
 
If they didn't, they would one day reach the point where clang becomes a real competitor for VS (:D)
 
@Rapptz there is always a new CTP coming out at some point in the future..
@Griwes why would they want to maintain their own compiler if others can maintain clang for them?
 
10:00 PM
@gnzlbg Because money.
 
like writing a compiler is a tonshit of work, and now that c++ is evolving faster, i bet that most of non-clang based compilers will die
@Griwes they can call clang VS and sell it
is BSD licensed
and they dont sell a compiler, they sell an IDE and all the tooling for windows
 
And become the second Embarcade-- Borland? :D
 
the compiler is just required for that to work
 
yeah, let's face it, nobody uses MSVC because the compiler is what's great.
 
the ide is pretty awesome, the compiler doesnt even have two-phase lookup
 
10:02 PM
@gnzlbg Unfortunately gnu still has something to say - gcc will not die anytime soon.
 
@gnzlbg You say that as if two-phase lookup isn't an annoying unnecessary feature that isn't one of the more difficult ones to implement.
 
You know, with Stallman calling llvm a problem for the free software community or whatever was the term he used.
 
i think that in the near future we will only have clang-based compilers, gcc, and edg based compilers
ibm is discontinuing xlc++ AFAIK
cray and nvidia's compilers are clang-based
pgi is clang based too
intel is edg based
so then there is vs, and then there is gcc
i dont know who else is using the edg front-end but intel icc is the only compiler that comes to my mind
 
personally I don't think that Microsoft's time is best spent maintaining their own compiler instead of branching Clang
 
me neither, however they have some really nice extensions, and clang is not there yet
 
10:07 PM
I can't really name any really nice extensions.
 
AMP
 
they have a couple really nice libraries, like PPL.
 
is awesome
 
MSVC has better #pragma support
 
do they support openmp?
the one i like most ist C++AMP, it is heterogeneous computing not done horribly wrong
then they have __await
 
10:08 PM
eh
it's much too early to say what value AMP and __await really have.
and certainly too early to say that Clang can't implement those features faster.
 
AMP has a lot of value
you can write kernel in lambdas
 
AMP is cool, but whether it's got value is another.
 
you can't do that with CUDA since nvcc doesn't support C++11
OpenCL is horrible, you can't even use function objects
not write generic code that uses it
 
I actually don't know of many programs that really benefit from GPU speedups.
 
in my field all of them
but then again, it depends on the field
 
10:11 PM
I was just about to say, that doesn't really add much to the conversation :P
 
i mean, I did some scalings of a program last week
and from 1 core to 1 GPU i got using nVidias thrust 44x speed-up
from 1 core to 16 cores i got using nvidias thrust TBB back-end 20x speed-up
and with openmp back-end 14x speed-up
any of those speed-ups is the difference between something being doable or not, so it really matters to us
and using Thrust, you just need to switch a compiler flag to get them
 
yeah, it's just not terribly common
 
most applications are limited by the user
others are throughput limited
idk, saying is not that common.. it depends on your field i guess
 
What's an anti-question?
 
@DeadMG anyways im going to sleep, good night!
 
user1804599
10:35 PM
 
-1
Q: stack exchange infested with content nazis

MichaelI have tried and been twice refused to post what I consider to be a reasonable question on Stack Exchange which is JavaScript related. When refused someone suggested the softwarerecs.stackexchange.com site, which I thought was going to accept my question, but alas no. I have noticed many helpfu...

 
People really do underestimate the power of standard algorithms in C++:
0
A: C++ Inserting a line at specific point in file

seheIf you carefully define a type to represent your data record: struct Record { std::string name; int score; friend std::istream& operator>>(std::istream& is, Record& r) { return is >> r.name >> r.score; } friend std::ostream& operator<<(std::ostream& os, Record const& ...

Just look at the complexity of the accepted answer... (that doesn't show any code)
 
user1804599
10:54 PM
Great.
 
user1804599
My code works.
 
@MatsPetersson Mmm. That's a good point, I write it to a different file (in this case, stdout). Updating text files in place is iffy business, but you can do it like this: how to swap one line with another in c++ - this example uses a memory-mapping to replaces a line inside a large text file.sehe 1 min ago
Maybe this will finally result in an upvote on that nifty ooooooooooold answer
@rightfold What does it mean?
 
user1804599
:E
 
I just found the mp3. My browser didn't
 
11:31 PM
Bad title of the day:
0
Q: Combinations in C. I r such n00b. Many try. Wow

user3498869I tried to do this in Java because someone in my class said this would be easier to do in Java, but I have no idea how to program in Java. All I really know how to program in is C. That being said, this is what I have come up with so far: The first line of my input file is going to contain some ...

 
@Mysticial I've seen worse.
Sadly can't find it now
 
@Mysticial wow much troll
so quality
impress
 
user1804599
11:48 PM
To sleep it is time.
 
well hello
 

« first day (1266 days earlier)      last day (3683 days later) »