« first day (531 days earlier)      last day (4431 days later) » 

3:02 PM
HUH? I got another one on that question.
Thank you, someone, I guess!
 
3:19 PM
I need to pass a pointer momentarily through a scripting interface (Tcl). Can I safely convert the pointer value to string and back using stringstreams like this?
 
sbi
I want to file this here for later reference, because it's a handy quote to have at haned, and while I'll forget about it very quickly, I am sure @RMartinho will remember it when the time comes:
> If you are an American, you must allow all ideas to circulate freely in your community, not merely your own. — Kurt Vonnegut
 
@StackedCrooked Yes.
 
Why does TCL need a pointer?
 
sbi
@Pubby Because it doesn't know where to go to on its own?
SCNR.
 
As long as you cast it to the original type and the 'address' (pointer value) isn't altered outside the control of the compiled code, there is no issue
@StackedCrooked interpret 'same type' strictly (including const-volatile qualifiers and alignment)
 
3:26 PM
Hehe
 
@RMartinhoFernandes Ohai.
Got soul left? Gonna stop reading Kafka yet?
 
@sehe Ok, thanks.
 
@sehe lol
It actually was less of a hassle than I was expecting.
I like how you can clearly see the copyright in this graph.
 
who are amazon warehouse?
 
3:35 PM
Amazon existed in 1800?
 
no
 
@DeadMG really :)
 
@DeadMG It's part of Amazon.
 
@RMartinhoFernandes link?
 
@sehe Books did.
 
3:36 PM
@RMartinhoFernandes gasp :)
 
@sehe I'm still tracing its source.
 
Ok, tineye doesn't have it
 
the founder of Amazon, Jeff Bezos, is still alive
that's impossible if he founded Amazon in 1800-1810
 
What if he is a vampire?
 
3:41 PM
^^ I thought that was the demonoid warehouse
 
sbi
@RMartinhoFernandes I am not sure what that means. What does "new books" refer to?
 
@sbi I suppose they research the requency at which new books are/were being published.
The confusion stems entirely from the tightly bound 'New Books From Amazon Warehouse' (seems to limit the subject to books from that warehouse)
 
sbi
@sehe But surely in 1900 they did not publish as many books as in 2000?!
 
@sbi Apparently so, but surely the robot will throw us a bone soon.
8 mins ago, by R. Martinho Fernandes
@sehe I'm still tracing its source.
 
sbi
@sehe That's nonsense. Who would have read all those books back then? They probably published a tenth of what was published a century later.
 
3:47 PM
they probably just published less copies
 
@DeadMG exactly. I haven't got a clue how they measured 'new books', but this is as good a guess as I have.
 
The "year" in the graph is the year of first publishing.
The bars give the number of new published editions.
 
sbi
@RMartinhoFernandes Ah, so this is the clue. Basically, this says what year books published today were first published in.
 
@sbi No, it tells that for books sold directly by Amazon.
 
from one warehouse of them, specifically
 
sbi
3:51 PM
@RMartinhoFernandes Yeah, I took that for granted.
And you claim the 100 year old books are published so much because they are already in public domain?
 
@DeadMG No, Amazon Warehouse is a branch of Amazon, not just one warehouse.
@sbi Not me, one Paul Heald
That particular graph appears at ~13minutes.
 
Incredificualicious
 
Oh it's just one of those important words everybody should know
 
Hello all! I came here to find out if some of you would have the time to help with this question about std::bind. It exposes a strange behavior when using duplicate placeholders in the bind expression, and I would like to have your opinion on the matter.
(By the way, this is my first time on the chat, so feel free to give me a roasting if I'm not respecting some rules or customs!)
 
4:01 PM
@LucTouraille My first thought was what is mentioned in the existing answer: the temporary gets moved into one argument.
 
But what temporary?
 
Both arguments are temporaries.
 
Not sure, I'm not that well versed in the intricacies of std::bind.
I use lambdas most of the time.
 
Aren't string literals lvalues?
 
String literals are not std::string.
 
4:06 PM
And by the way, the behavior seems to be identical when replacing the second string literal with a string variable defined above.
Yes, I know string literals are not std::string, but the parameters of the wrapper returned by bind are not std::string either (unless I'm mistaking).
 
sbi
SCNR.
 
@bamboon Definitely. But adding it to the title would have changed the question. Who would've guessed denormals anyway? (it took me about 15 min. of tinkering before I started to suspect them...)
 
0
A: Allow users to pay 2X of their own reputation to deal X damage to target user's reputation

Konrad RudolphI’m all in favour of this. It’s fun, and crunching trolls this way would be extremely satisfying. :-)

 
argh
my eyes, they so suck :(
 
@KonradRudolph epic proposal
 
4:13 PM
Friday strikes again.
 
@KonradRudolph I'm constantly amazed by how many people take these stupid proposals seriously.
Anyway, gotta go.
@LucTouraille From what I could understand from the standard, yeah, this behaviour does not look correct.
 
@RMartinhoFernandes “Stupid”? “Seriously”? Hey!
 
I don't see what's so bad about it
I can finally tell SK-Logic where to fuck himself up his worthless arsehole
 
@RMartinhoFernandes Ok, thanks for taking the time thinking about this, and good evening/afternoon/morning (delete as appropriate)!
 
4:25 PM
lol
 
> INPUT *buffer = new INPUT[1];
 
sbi
@Konrad, what's that "realtime score update" you were talking about?
 
the voting tally on posts seems to update live now
 
sbi
@awoodland Wait. If I sit staring at an answer, I will see the scores change in realtime?
 
@sbi yeah
 
4:34 PM
@sbi I think so, either that or I'm going mad
 
@awoodland I think I noticed that lately, yes.
(Not that you are going mad, that the scores update in real-time!)
 
sbi
Ah, thanks for the updates. (I haven't answered much lately, and thus hadn't noticed.)
 
Good day everyone.
 
some of you smart people, may know this
0
Q: Out of memory - why does the system not page out not recently used?

Tony The LionI have a program which does some very intensive graphics work, and requires a lot of memory (> 8GB), however my machine has only 8GB of RAM currently, which means the program throws a bad alloc when it runs out of memory. Besides this program, I had some other things open that used a bit of my m...

unless I've understood the purpose of paging wrong, this makes no sense as to why it behaves as such
 
4:40 PM
You might have a large chunk of the page file reserved for COW pages
 
ha, so if it's only reading in new stuff to memory, it won't write old stuff to the page file, as it's not COW, could be an answer
 
sbi
Hmm. Maybe I should have added smiley to my comments here. Given my repute at meta...
 
well it's more that it might be holding back some pagefile to honour other promises that have been made but not kept yet (as an optimisation)
 
You do not want this to swap.
Modify your program to work with <8GB window.
 
if you have a page that's currently shared between two processes, but not actually shared memory then some systems keep a page of swap so that if it does change they don't fail randomly and very ungracefully later
 
4:42 PM
If you exhaust RAM, you're dead either way.
 
hmmm, I see, so a lot more things to take into account then pure swapping into/out of a page file
 
@TonyTheLion I've always wondered that exact same thing
 
@TonyTheLion Never count on swap... run out of ram with a single program has a tendency to stall the system to a standstill if it allocates on to the pagefile.
 
@Mysticial ah, and I guess that's partly due to HDD latency
 
@Mysticial I discovered that once. My friend's program ran in 6 minutes. Mine was ~550 minutes.
 
4:57 PM
so this pagefile mechanism is no good if you run out of RAM
seems like a fatal flaw, I thought it was designed for this very reason
 
@TonyTheLion it should be used as a last case crash prevention, not as an extension of RAM
 
it's one of the reasons why I prefer not to test code on my main work machine... everytime I miscalculate how much memory it needs, or if I have a memory leak... BOOOM...
 
cause back in the old days, RAM was much more scarce
 
system stalls, music hangs
time to hit the reset button - along with all my work that isn't saved...
 
@Mysticial I habitually hit CTRL+S about every 5-10 seconds :(
 
4:59 PM
I have autocommand saving on focus loss.
 
@MooingDuck That's not a problem when I'm programming since compiling will save it. But I often have multiple temporary notepad windows with code or script snippets that I use to test or move code around...
 
sbi
@CatPlusPlus And what if you have a good day at work, and never lose your focus on the code?
 
@sbi Ahahahaha.
Anyway, periodic saving is taken care of by vim's swap file.
 
Hello!
Someone could tell me where is "../require.h"?
 
sbi
@unNaturhal It's one folder up.
 
5:10 PM
Up compared to what?
 
@unNaturhal paths that don't begin with C:/ (or similar) start in the "current directory".
.. is one up from the "current directory"
 
Aaah!
Ok, so I have a problem xD
 
if you're compiling in Visual Studio, the "current directory" is [solution]/[project] (the folder with the .cpp files). If you're running a program, the "current directory" is [solution]/Debug/
 
> SO has many similarities to an MMORPG
a new way to view things :P
 
sbi
@MooingDuck Actually I think it's the one with the project file. ICBWT.
 
5:13 PM
I'm trying to write a snippet of code from Thinking C++... But in this code is used
#include "../require.h"
And the compiler give me back an error...
 
@sbi by default, that's the same folder, but I clarified
 
@unNaturhal do you have a file called "require.h" somewhere?
 
sbi
@unNaturhal That certainly depends on what context you encountered that in.
 
Any ideas for an April Fools joke?
I'm trying to find a computer with a floppy drive...
 
5:14 PM
Nope, "require.h" is included as header, but never defined before in the book..
 
sbi
@Mysticial That meta question stole this year's April Fool's joke.
 
@Mysticial tell everyone how it's going to be awesome and how you spent a lot of money to make it good, then don't do anything
@unNaturhal Either you missed something or that's a stupid book.
 
It's actually one level up from the directory the including file is in.
 
Someone should put this on SuperUser complete with a picture and everything:
 
Hi guys!

which substring-search algorithm was designed in strstr() function? thanks!
 
sbi
5:15 PM
@MooingDuck I have worked in environments where code, headers, project files, and solutions files where all in different folders.
 
@user1131997 I doubt it's specified.
 
It's not. Why would it be.
 
@sbi I have as well, which is why I clarified, but by default, that's where new cpp files are placed by VS
 
@MooingDuck D:
@CatPlusPlus I don't have a directory with all code... I'm handwriting just a little part of the snippets
 
sbi
@MooingDuck Yeah, but I forgot about the default. :-/
 
5:16 PM
@unNaturhal If the code includes it, then it needs that code. If you don't have that code, you can't do those examples.
 
sbi
Handwriting? Now why does that remind me of James' April Fool's joke from a few years back?
 
@sbi I assumed he used the wrong word.
 
@MooingDuck :/
Thanks anyway
 
don't want to look at RFC or GCC sources :(

It's intetrsting, which algo exaclty was used... Knuth-Morris-Pratt or smth else...
 
sbi
@unNaturhal Have you tried googling for the problem? TIC++ is a rather popular book, so you can't be the first who ran into this problem.
 
5:20 PM
@sbi: I tried to search "require.h" as a C++ semi-standard library, 'couse I thought to find it on cplusplus.com.. But nothing.
 
@user1131997 I would assume the nieve algorithm, which is fast for small code.
 
It's a property of implementation, spec would be silly to say "use only this algorithm".
Also cplusplus.com sucks.
 
@CatPlusPlus it's common for the spec to say "it must be at least X fast" though (in big-O)
 
sbi
@unNaturhal Why don't you just click on the link I even provided? Damn. Tries to restrain himself. The very first hit google spits at me is that damn header.
 
@sbi Calm down bro.. I just downloaded it... Give me the time to open it in the folder...
 
5:24 PM
I'm trying to fscanf into a structure ` fscanf(album_file,"%d", album[j].num_tracks[j]);` but it is giving me this error `expected expression before 'album'
`
I'm trying to fscanf into a structure fscanf(album_file,"%d", album[j].num_tracks[j]); but it is giving me this error expected expression before 'album'
 
sbi
You can edit messages, you know.
 
I tried
 
@LearningC what is the type of album?
 
but I hit back button by accient
 
sbi
@LearningC Try harder. You can still edit it.
 
5:25 PM
`struct album_ {
int num_tracks;
char tracks;
int playlist_hits[];
};`
 
@LearningC and is that the first error in the code?
@LearningC sure? I asked for the definition of album, not album_.
 
yes
 
sbi
@LearningC Likely the compiler doesn't know either fscanf or album_file.
 
@LearningC --> newbie-hints
 
why the concept of pointers and address of?
 
sbi
5:27 PM
Also, this is the C++ room. We despise scanf(), because it's unsafe.
3
@FrankComputer Why Egypt? Why me? Why the universe?
 
@FrankComputer because it allows things otherwise impossible. Lots of things. Common things.
 
@CatPlusPlus why c++.com sucks?
 
@MooingDuck what do you mean definition of album?
 
@FrankComputer imagine you have a list of students. How would you say one is "it"? You need to get the address of whoever is "it" and store that in a pointer. You need to refer to a student, but which one changes.
 
I also did this typedef struct album_ album;
 
5:28 PM
it seems to promote the propagation of memory leaks, one shouldn't have to worry about that in programming
 
sbi
@MooingDuck So someone comes in here, drops a few strange terms with a "why" stuck in front of it, referring to nothing we have discussed, and you know what he's talking about??
 
Pointers and memory leaks are entirely different
 
@sbi I tend to do well at stabbing at the dark.
 
@user1131997 meh. we don't want to know what you don't want to do. If you're curious, find it out. If not, let it be.
 
@sbi I'm a habitual helper :(
 
sbi
5:29 PM
83
A: What is the difference between a definition and a declaration?

sbiA declaration introduces an identifier and describes its type, be it a type, object, or function. A declaration is what the compiler needs to accept references to that identifier. These are declarations: extern int bar; extern int g(int, int); double f(int, double); // extern can be omitted for...

 
@FrankComputer going outside promotes death as well. Should we forbid going outside?
 
sbi
@MooingDuck Good to know that. I'll try to avoid you in the dark then, lest I'll get stubbed.
 
@MooingDuck .. sorry to detour your topic, i'm new to C++ ..i'll keep quiet
 
@LearningC Are you 100% positive that that C file included the right headers and sees both those bits before the scanf line?
 
5:30 PM
@MooingDuck I put it in a header file. and I include it.
 
sbi
@FrankComputer Oh, so you were asking why that concept is used in C++?
 
@FrankComputer Sorry if I sounded aggressive, that wasn't my intent. Pointers allow a lot of things that aren't possible otherwise. Sure they're easy to screw up, but making them safe makes programs much slower.
 
@sehe my appologies ) forgot to add *.com )
 
@MooingDuck Perhaps it is time to create a room, didn't we do that earlier?
 
ello All
 
5:31 PM
@MooingDuck .. correct, i thought maybe one could address a variable via an SQL-like method
 
How SQL does it?
 
@MooingDuck thanks a lot! :)
 
@FrankComputer I don't know what you just said
 
sbi
@FrankComputer Remember that C was created as a portable assembler, in order to be able to do (almost) anything in it that can be done in assembler, but to be more easily portable than real assembler code. (C++ stuck to this close-to-the-metal attitude.) In assembler, you can certainly address individual memory cells. A pointer just models this (besides other stuff).
 
SELECT column WHERE column = x
 
sbi
5:34 PM
// Look, mama, no pointers.
auto iter = std::find_if(cols.begin(), cols.end(), x);
if(iter != cols.end()) found_it(*iter);
 
@sbi .. understood, so this gives absolute control, at the expense of having to provide adequate control
 
@FrankComputer blink whoa, he got it!
 
auto iter = std::find_if(cols.begin(), cols.end(), [](record& rec) {return rec.column == x });
 
sbi
@FrankComputer Basically, yes. It gives you a lot more freedom, at the expense of demanding a lot more responsibility from you.
 
what happens if i chose to not use pointer variables and just used type char, int, etc?
 
5:36 PM
 
sbi
@sehe Now you're just showing off.
@FrankComputer Then we will praise you for writing sane code.
Do not use pointers unless you know you have to. And as a newbie, you won't know.
 
@sbi ..lol, now i'm more confused
 
@sbi :)
 
sbi
@FrankComputer When writing C++, I rarely ever write T*. Mostly I'm writing either T& or plain T. With all the great stuff the standard library brought us, most uses of pointers are neatly wrapped.
Pointers are easily embarrassed, and don't want to be used naked. Always wrap them.
 
has looked at PHP-sources, it has a lot of goto & also many functions , which are in #define preprocessor

Is it really bad soft?
 
5:39 PM
I have to write a cfunc for INFORMIX-SQL and the example they give is this:
 
@user1131997 goto and define are generally bad, many functions is usually good.
 
sbi
@FrankComputer I suppose that is C. If so, you have come to the wrong room.
 
i can't make heads or tails out of this example
 
@FrankComputer don't paste code here. Post a link to ideone instead
 
sbi
5:42 PM
@MooingDuck :)
 
sorry
i'm also new to chat rooms.. what is bin? a unix-like directory?
 
sbi
@FrankComputer Nor can I. That doesn't even declare function return values.
@FrankComputer It's just a room we use as a garbage bin.
 
sbi
Mar 16 at 9:04, by sbi
If you are new here, please read the newbie hints. Thank you.
 
thousands of goto in PHP sources
 
5:44 PM
INFORMIX is telling me to use Microsoft C compiler Version 6.. is that a fosil?
 
@user1131997 Don't paste images of code... ever. Use ideone.com
 
sbi
@FrankComputer I suppose they are referring to Visual C++ 6. That is from 1998.
 
@user1131997 I see no goto in your picture.
@FrankComputer yes, use a newer version
 
no, not visual, im using a legacy INFORMIX-SQL version from 1989
 
@MooingDuck goto out
 
5:46 PM
@MooingDuck There are 2 goto out; stmts
but thats far from thousands
 
Escaping out of a block is one of the better uses of goto
 
@MooingDuck this just one piece, in all PHP source there are thousands
 
@Pubby I'm not an observant person
@user1131997 that's a bad sign, but doesn't immediately mean horrible code.
 
lol
 
the legacy version of INFORMIX-SQL runs in MS-DOS 6.22
 
5:47 PM
@FrankComputer sounds like u have a fun project ahead
 
its a fosil rescue project
 
@Pubby that's why at PHP.net there are a lot build-news "fixed memory corruption" ? )
 
sbi
@Pubby No.
 
@RMartinhoFernandes Dangit.... I forgot I was a person by the end of that. Began thinking I was just a etheral thought parser....
 
@sbi ?
 
5:48 PM
@MooingDuck also there are a lot of #define functions as goto in sources
 
I now know what autism is like!
 
@FrankComputer ? school/work/fun?
OOps
 
a customer who's been running the same app since 1989 on an MS-DOS 6.22 box
 
just one file ( cgi_main.c ) from PHP-sources:
http://ideone.com/XiR1R
 
jesus
 
sbi
5:49 PM
@Pubby Show me a piece of C++ code that can be improved by using goto which could not be improved further by some other means. (Or don't bother. In the 15 years I have been watching this debate nobody has ever produced such code.)
 
sounds like its time for an update:)
 
guess he's been getting his moneys worth out of his app?
 
True Story HA
 
@sbi there's some bits in the Linux kernel, where he uses them in conjunction with a switch block, that many claim is justified, for speed and readability.
 
sbi
@FrankComputer Please do not be offended when I will bow out of the discussion right here. (And you really do want to talk to C people. C++ folks will get mad over you for the code this will inevitably bring up.)
@MooingDuck TTBOMK the Linux kernel is not C++.
 
5:51 PM
goto in kernel is used mostly for cleanup.
 
@sbi Hey, I didn't say it was good code! How would you handle breaking out of two blocks?
 
so i cant use C++ if the informix rdbms says to use MS C ver.6?
 
sbi
@Pubby return?
 
@sbi Assuming you don't want to return yet
 
@FrankComputer i wouldnt think so
 
sbi
5:52 PM
@Pubby But I do want! I just put those two loops into their own (inlined) function, and return from that. (Besides this replacing an unstructured goto with a structured one, it also has the advantage that now the two loops have a name, which might make obsolete a comment explaining what they do.)
 
ok, thanx..
 
What is the best way to emulate asynchronous circuit?
 
@sbi Good point, although I still wouldn't say that's much better than the goto solution
 
@sbi when I looked up the details, I can't find any code where I agree with the usage of goto, so I concede.
 
Hmm, could lambdas be used? (although then you can't give it a name)
 
5:55 PM
@user1131997 carefully
 
@MooingDuck carefully what?
 
Carefully everything.
 
@CatPlusPlus okay, let it be everything, so why it should be carefully?
 
I carefully everything
 
@user1131997 so you don't have mistakes
 
5:56 PM
'asynchronous' == 'dangerous'
 
@user1131997 Because of the rabbits
 
sbi
@Pubby A goto is a jump-to-anywhere. It's directly modeling the machine's jump instruction. Over time, languages have developed structured alternatives to using jump-to-anywhere, like call, return, break, if, for... They fulfill the same task — in the way static_cast does the same as a C-style cast does.
 
@CollinHockey that's why you carefully.
 
@CatPlusPlus fantastic!
 
@MooingDuck So you don't accidentally.
3
 
sbi
5:58 PM
@MooingDuck Same here. As I said, I have seen this debate go on and on for at least 15 years. Every piece of code I saw where goto was better than any of its alternatives was C code. In C++ code (mostly thanks to RAII), you don't need goto.
 
in structured programming, i was told to use GOSUB's and never use GOTO's, unless absolutely necessary!
 

« first day (531 days earlier)      last day (4431 days later) »