« first day (480 days earlier)      last day (4466 days later) » 

12:00 AM
Oh, I'm talking about writing.
 
@TonyTheLion I think those without any passion are even more annoying
 
@TonyTheLion It's odd to me to be a c++ guy and have that kind of passion about singletons
 
is there a way to tell pandora "NO LIVE SONGS"?
 
I find %ebx(%eax, %ecx, 8) better (less noise), if only it weren't for all the %s.
 
12:01 AM
@CaptainGiraffe wut?
 
@RMartinhoFernandes Oh... yeah, I don't write assembly either. Just small snippets of inline assembly to do things I can't do efficiently in C/C++.
 
@MooingDuck erm... yank power cord
 
@RMartinhoFernandes I hate that percentage sign everywhere
 
@sehe that's only a temporary solution
 
@TonyTheLion a global map is of course the way to go!
 
12:01 AM
same reason why I don't like printf and it's variants
@CaptainGiraffe DUDE, GTFO
 
:%s/%//g 'works when reading
 
gibberish?
 
@TonyTheLion =)
 
@TonyTheLion It's "replace all % with nothing", in vim.
 
12:02 AM
oh vim
 
You can even put that as an auto command and get it run everytime you open an asm file.
 
vim only 25 Megs on a base install
 
vim seems to have a community of fanatic users all by itself
I never got the hang of vim fully
 
Someone has to oppose the evil of RMS and emacs.
 
12:03 AM
@RMartinhoFernandes is that your reason to use vim?!
 
I need to edit this as to suggest that RMS means Root Mean Square
 
@TonyTheLion Root Mean Square :)
@RMartinhoFernandes phew
 
In mathematics, the root mean square (abbreviated RMS or rms), also known as the quadratic mean, is a statistical measure of the magnitude of a varying quantity. It is especially useful when variates are positive and negative, e.g., sinusoids. RMS is used in various fields, including electrical engineering. It can be calculated for a series of discrete values or for a continuously varying function. The name comes from the fact that it is the square root of the mean of the squares of the values. It is a special case of the generalized mean with the exponent p = 2. Definition Th...
wtf
meh, I should got to bed, I have to travel tomo
but I'm not tired
 
k sleep well
 
12:05 AM
vim rocks though
2
 
RMS Titanic...
I almost typoed that as "RMA". RMA Titanic... How much would return shipping cost?
 
Captain Failboat.
 
@Mysticial What's the shipping for return shipment of a ship? Ship! It sunk
 
0
Q: How to save a linked list to a text file?

falnirGreetings I've been working on a homework in which I must create a linked list program which can save and restore its data from a text file. I have gotten most of it working but I'm having some problems with restoring the linked list using the data from the text file that was created from it. Whe...

how NOT to ask a question
Code dump.
 
Speaking of which... I can't seem to find that 800-line Portuguese code-dump from 3-4 months ago... I didn't have 10k at the time. So I couldn't save it after it got deleted.
 
12:09 AM
0
Q: fscanf type function for streams?

JcrackI'm used to using fscanf for simple file input, because it makes it simple. I'm trying to move to streams though and I'd like to be able to do this: fscanf(file, %d %s, int1, str1); as you can see it's relatively easy to read through a file, stick the first int you come across into one contai...

switching on a bool
strange
 
@TonyTheLion and it's a duplicate no less
 
MSVC will warn/error if there is no default in a switch. I wonder if it does that for bool as well.
 
@MooingDuck You were quick with your arrow while I was editing =)
 
@CaptainGiraffe :P I'll review it
 
12:13 AM
@MooingDuck I deleted, Its not important.
 
inFile != NULL Owww. Broken iostreams safe bool strikes again.
 
@TonyTheLion that's impressive
 
ugly yea
 
@RMartinhoFernandes Tony's question has while((fGet = File.get() != EOF)) where fGet is supposed to read in a string.
 
The first c++ course should include a sh shell and getopt.
 
12:16 AM
Tony's question?
 
@RMartinhoFernandes the last one he linked. I choose to imply its his for no apperent (or fair) reason whatsoever
 
Oh, sorry, I'm sleepy.
Right now it looks like my optional code makes sense, but I'm sure it won't in the morning.
You know what'd be cool?
 
@RMartinhoFernandes ice
 
If we could have template <typename... Args> void operator=(Args&&...); be called like x = { 1, "foo" };
 
@RMartinhoFernandes what the... void return type?
@RMartinhoFernandes other than the void thing, what can't we?
 
12:24 AM
Saves typing. And I'm not a big fan of assignments as expressions.
@MooingDuck Because assignment operators can't have more than one argument.
 
@RMartinhoFernandes oh yeah, operators
@RMartinhoFernandes can't you do that with a constructor, with initializer lists?
 
I don't mind different syntax. What I wanted was to use = for emplacement.
@MooingDuck Oh, yeah, and I keep forgetting to return *this;.
 
@RMartinhoFernandes can we do template <typename... Args> void operator=(std::initializer_list<Args&&...>& args);?
 
@MooingDuck No, initializer lists are homogeneous.
And pass them by value!
It's a pair of const pointers (that's also why you can't have initializer lists of references).
 
@RMartinhoFernandes I'm sure I'll learn once I get a compiler that does them
template <typename... Args> void operator=(std::tuple<Args...> args); maybe? No, that won't work...
@RMartinhoFernandes that would be cool
 
12:29 AM
Needs fugly std::make_tuple syntax :(
tuple's ctors are explicit, for some inane reason.
 
1
Q: C struct is unboxed while C++ struct is a boxed type?

qinsoonAs many books mentioned, the difference with C++ struct and class is the access control descriptor. Thus I am wondering if the following statement is right: struct in C is unboxed: members in the struct are plainly located next to where the struct is allocated. But struct in C++ is a boxed...

cool question :D Makes no sense at all
 
Ok, now that I reinvented optional with move semantics, I forgot what I needed it for.
I'm going to sleep. Bye.
 
Why is C++ tagged as *~294?
 
> ?! It worked now. :). Removing the InFile >> value; fixed the problem. Thanks. – falnir 13 mins ago
Shotgun debugging at its worst.
 
12:47 AM
@RMartinhoFernandes Quite impressively so.
Sleep well
Plin q k no more
 
This looks like a good one for Robot or Xeo: stackoverflow.com/questions/9179114/… I'm too slow - RMF already commented!
 
@CaptainGiraffe what happened to your question on this question? It was better than the one still up :(
 
1:11 AM
It amazes me that people don't understand that file:x:y tells where compiler errors are located.
 
@Pubby they may have been confused by template error obfuscation (if using gcc)
 
Nice highlight," C++, Sorry, I couldn't resist. "
 
@kfmfe04 I can understand template errors, but this one was an incredibly simple Haskell error: "s.hs:6:1: Parse error: naked expression at top level". How can anyone who writes a 50 line program not understand that?
 
" The purpose of the FENV_ACCESS pragma is to allow certain optimizations that could subvert flag
tests and mode changes (e.g., global common subexpression elimination, code motion, and constant
folding). In general, if the state of FENV_ACCESS is ‘‘off’’, the translator can assume that default
modes are in effect and the flags are not tested. "
 
@Pubby - ya - that sounds pretty bad
 
1:22 AM
I have no idea what does common subexpression elimination means, any help for it, in plain English, please? :)
 
1:42 AM
0
Q: C++ operator used when creating a new object

user399540I have a question about the way objects are created in C++. If I define a class, say CSomeClass, i can create a new object of CSomeClass using the following line: CSomeClass* pSomeClass = new CSomeClass; and in this case I also have the ability to control the way the new object is created by ov...

 
I hate hungarian notation.
 
1:56 AM
@EtiennedeMartel what do you find to be an useful alternative? The only partial hungarian notation I use these days is g_ for globals and m_ for members, but I'm always open to new/better ideas...
 
The only thing I use is a _ suffix for member variables.
And that's only for private ones.
 
I've been seeing a lot of that notation lately...
 
I used to use _t but posix doesn't allow it :(
 
Yeah, I think Boost popularized it.
 
@Pubby ouch - uint64_t, etc... conflict
btw, is _ prefix reserved by the OS or some other system?
 
1:58 AM
I think it's reserved for the implementation.
But I might be wrong.
 
ah... ...maybe compiler keywords: stackoverflow.com/a/111804/975129
 
2:19 AM
the more I use templates, the more I appreciate the decoupling between modules that it provides... ...unfortunately, the increase in link-times is becoming noticeable...
 
The thing I hate about templates is that I have to put almost everything in the header.
 
yeah - the recompiles that it causes is a real pain - that's why when I'm fixing a class template, I just make a copy of the header and work with the renamed copy (less dependencies = faster builds)
 
3:22 AM
What is the website that you post code to and it compiles it>
 
3:44 AM
Thank you.
http://ideone.com/wYxAE Can someone tell me why line 90 causing problems? `enter move 1 0 1 1
Segmentation fault (core dumped)`
 
@LearningC Line:88 scanf needs addresses &
&x_from, etc...
 
Wow thank you
I can't belive i missed that
 
np
I can't wait until llvm 3.1 is ready - so tired of gcc template pukage on errors...
 
4:13 AM
Is @CatPlusPlus here?
 
 
1 hour later…
5:22 AM
I'm finding boost::any quite useful, recently
 
user406009
What's really useful is a std::map<std::string, boost::any>.
 
user406009
Nice way to practically avoid the whole type system when needed.
 
6:10 AM
@EthanSteinberg that's >exactly< what I used it for - I needed to store arbitrary maps in the map's value parameter - arbitrary maps instantiated by function templates
I was trying to get my head around the problem of storing information generated by function templates
 
user868935
6:24 AM
Hey all
 
Hello friend
 
user868935
@Pubby do you much about opening a specified directory from a console application?
 
cd?
 
user868935
not like that. Im writing an application that when you enter '1' and press ENTER, a list of files in the pre-determined directory will list the names
 
ls?
 
user868935
6:36 AM
@Pubby Whats "ls?"
 
Get contents of directory
 
user868935
Yes. Thats what I'm trying to do
 
Dammit, everything has already been invented :)
 
@Paul So use it?
 
user868935
@how? any tutorials you know of?
 
user868935
6:41 AM
@Pubby
 
Are you on Windows?
 
std::flush(std::cout);
system("ls");
 
Poco libs have an easy to use DirectoryIterator utility if you really want to do something in C++. Boost also has a filesystem library, which I'm not familiar with yet.
 
user868935
flush(cout);
 
user868935
@pubby not working
 
6:50 AM
Oh noes!
 
Flush harder?
 
user868935
....
 
user868935
toilet humor... (wah wah waaaaah)
 
7:11 AM
So I'm writing a transform/map like algorithm for std::tuple. Should the result type be shallow or deep?
e.g. should &transform(std::tie(a), identity_functor {}) == &a where &identity_functor {}(a) == &a?
If providing an additional overload that does decaying, that do I call it, decay_transform? transform_decay? Or do I provide a utility named decay_tuple such that decay_tuple(std::forward_as_tuple(foo, bar, baz)) is semantically equivalent to std::make_tuple(foo, bar, baz)?
I'm leaning towards the latter.
 
What's std::tie?
 
If you have int a; int b;
Then you can do std::tie(a, b) = std::make_tuple(42, 3);
And that will assign 42 and 3 to a and b respectively.
This works because std::tie returns a tuple of references.
So that's assigning std::tuple<int, int> to std::tuple<int&, int&>, which in turns assign each tuple elements from the one (the values) to the other (the references).
 
I am still confused
 
(There are three helpers to create tuples: std::make_tuple, std::tie and std::forward_as_tuple.)
Well, there are several ways to implement a helper to create a tuple out of values.
Let's call that hypothetical helper tuple_factory.
It's quite obvious what you would want tuple_factory(42) to do: return a std::tuple<int> { 42 }.
But what should int a = 42; tuple_factory(a); do?
Sometimes you'd want &get<0>(tuple_factory(a)) == &a to hold, but sometimes not.
Does that make sense?
 
Yeah, but I don't really understand what you're doing. Why would &transform(std::tie(a), identity_functor {}) == &a?
 
user868935
7:19 AM
anyone know how to list files in a directory using c++?
 
Not &transform(std::tie(a), identity_functor {}) == &std::tie(a)?
 
@Pubby You're right, that's what I'd want. Wouldn't work with multiple elements otherwise.
Well, that's not exactly correct either.
The question is, should the result of transform be a tuple of references where that applies or a tuple of values only?
 
Shouldn't it be the same as its argument?
 
Well no. What if I have a functor of the kind [](int* i) { return *i; } (except polymorphic): then it accepts values, returns references.
So in the argument of transform(tuple, func) the argument can be a tuple of values, but it's possible to return a tuple of references.
Does that make sense?
 
Oh, right.
Do you have to support references?
 
7:28 AM
I'm trying to be generic. So I'll do it.
 
It just seems like they would cause lots of problems
 
I'm going to investigate that carefully, yeah.
Don't want values to be forwarded as rvalue references, that'd be disaster.
 
Any good uses for mapping over tuples?
 
You need polymorphic functors for it to be worth it. Think Boost.Phoenix and the like.
Oh yeah, I wonder if I can support an n-ary form of transform.
> error: lambda-expression in unevaluated context
Uh, that a real error?
Yep, that made it into C++11. Oh well.
 
7:45 AM
Lambda as template argument?
 
That's not a problem.
 
How did you get that error then?
 
decltype( [] {} ) should be enough.
 
Ah
 
Okay, transform is fine, perfectly forwards the results into a tuple.
 
7:47 AM
Bonjour :)
Anyone alive?
 
Hello friend
 
damn! , seems Zombie'sLounge<C++> :)
@Pubby Hi, seems one is alive :)
 
I am just here for the delicious brains
 
You won't get that from me xD (little shortage here)
@Pubby btw you're really 92 0_o?
 
No, as I've said before, 100000 wouldn't fit.
 
7:56 AM
@Pubby you know verbatim in C#?
 
@MrAnubis Not really. You mean verbatim strings?
 
((my).code = ((looks).like(), JFrame.this. :(
 
@MrAnubis var @var = @"verbatim string literatal";
You can escape keywords to be used as identifiers and using @"" is like a raw string literal (only "" is interpreted as single ")
@Pubby the funky @syntax @for variables is due the CLR interoperability with other languages that have different keywords
 
8:12 AM
OCaml is pretty disapointing
var @sehe = @"Okay";
 
Xeo
@TonyTheLion That site isn't loading for me oO
 
It works for me
 
Xeo
GRAAAH, fuck that. Damn router. -.-
 
I can send you the pdf with the C++ proposal for it
if you want
lol
 
Xeo
8:22 AM
Nah, at some point it surely will start to load.. -.-
THE FUCK! Now I can't even connect to the router itself, although Stackoverflow and some other sites work just fine..
 
what brand is that
 
Xeo
Some Siemens whatever
From Alice
 
whokay
not used one before
 
well, that's just what I wanted to come into in the morning... fuck all from the guy I have to work with, who is 5 hours ahead of me.
 
8:28 AM
Wanted to find out where he is up to with all he is working on and get some help with shit I need to do as well
not a word
 
sbi
@Xeo It's not the router. It doesn't load for me either.
 
besides that, good morning all
 
Xeo
@sbi Well, my router config site doesn't load either, so...
 
sbi
@Xeo ...you got another problem that's likely to do with the router.
 
Xeo
:P
 
8:31 AM
@Xeo - aye, I can't load that site either
looks like software.intel.com isn't reachable for me
 
meh stopped loading for me too
wtf
it loaded earlier
 
wow, intel got DDOS with just a few people
 
Xeo
lol
 
intel fail
if you google it, it's the first result: google.co.uk/…
anybody heard of Boost.Heap yet?
 
user868935
anyone worked with displaying a list of files from a directory for a console application? for some reason, my FindFirstFile() works fine, but FindNextFile() gives me errors...
 
8:40 AM
boost filesystem
 
Xeo
Or <filesystem> in VC11
@TonyTheLion They had me at "Iterators"
 
user868935
@ Xeo "VC11?"
 
user868935
@Xeo
 
@Xeo what do you mean?
@Paul the new edition of Visual C++ from Microsoft
it's in Dev preview right now I think
 
Xeo
@TonyTheLion std::priority_queue doesn't have iterators
 
8:47 AM
oh
 
Xeo
Damn, but it seems those iterators are pretty inefficient or iterate in an unspecified order..
 
@All goood afternooooon............
 
@Xeo Who needs range-for for tuples when algorithms for tuples are possible!
 
Xeo
@LucDanton Reference implementation that allows control flow. :P
 
9:05 AM
@Xeo Good luck on writing the complete proposal!
 
Xeo
xD
 
sbi
Oh, wow! It's above -10°C this morning at my bedroom window. Really, -7.8°! It must almost feel tropical outside. I wonder whether I should leave my jacket home and just go to work in a sweater...
Anyway, gotta go, no matter what I'm wearing. See you later, guys.
 
@sbi You are wearing something I hope :)
 
Xeo
@LucDanton Oh well, when we get polymorphic lambdas, this won't be needed anyway anymore most of the time
 
user868935
can someone help read a list of files?
 
9:14 AM
create a std::vector<std::string> my_files with a list of names of your files
 
@Paul affirmative.
 
iterate them, and open each one using a fstream
then read what's in them using mystream >> intosomestring
 
user868935
@sehe I get this error:
 
user868935
"WIN32_FIND_DATAA *" is incompatible with parameter of type "LPWIN32_FIND_DATAW"
 
@Paul ah win32 stuffs. Nice!!! (not)
 
9:16 AM
LPWIN32_FIND_DATAW my_data_ptr
is what you need to do
 
And also, you are reading a list of FILENAMES from a directory
 
because LPWIN32_FIND_DATAW is a type by itself
 
user868935
@sehe WIN32_FIND_DATAA FindData;

HANDLE hFind;
hFind = FindFirstFileA(dirName.c_str(), &FindData);
do
{

}while(FindNextFile(hFind, &FindData));
 
user868935
The problem is in FindNextFile(hFind, &FindData). The address is whats causing the error, but it's fine in "FindFirstFileA"
 
@Paul: don't use Find*A, use the encoding neutral macros:
WIN32_FIND_DATA FindData;

HANDLE hFind;
hFind = FindFirstFile(dirName.c_str(), &FindData);
do  { } while(FindNextFile(hFind, &FindData));
Never use the encoding specific calls (unless you know what you're doing and know you need to. Which is: never, mostly)
 
9:21 AM
class test
{
        std::thread *pt;
public:
        test()
        {
                pt = new std::thread(*this);
        }

        void operator()() const
        {
                printf("thread start\n");
                sleep(5);
                printf("thread end\n");
        }
};
I find this a rather strange way to start a thread
inside the ctor of a class, using the overloaded operator() of the same class
 
@TonyTheLion is there a point? Don't do it, then?
 
I'm not doing it, it was in an SO question
 
Even more interestingly, the thread is leaked
 
@TonyTheLion: I suggest you link to the culprit rather than copy the code in chat. Makes the context clear, and doesn't cause so much vertical space pollution
 
user868935
@sehe I was told by my professor not to use "malloc"
 
malloc is a C function
 
@Paul huh. I was told things too, by various people.
 
if you're doing C++, then you don't need it
lol
 
 
9:33 AM
both very good answers, shame you can't combine the two together
@Tony helped explain what is wrong, @sehe helped provide a valid (and much cleaner) solution.
 
Xeo
-1
A: How do I disable downlevel rendering in ASP.NET?

Michael BorgwardtWhile glancing over the SO frontpage, I read this question as "How do I disembowel..." I think I need to take a deep breath and get off this bug for a while...

lol
 
@thecoshman added useless quips about move construction :)
 
@Tony are you not aware of the excitement of self threading classes?
 
@Xeo hilarious. apparently his ray bans polarized the 'add comment' button (does he have a 3D capable monitor... ?)
 
@sehe sorry, still can't really up-vote either answer :(
 
9:42 AM
@thecoshman so? you don't need to (did you ask the q?)
 
@sehe I think you might be confusing up-vote and accept :P
 
You can upvote both.
 
@thecoshman and you might be misrepresenting 'can't make my mind up' as a problem
 
@RMartinhoFernandes I would, but I believe they both lack what the other is offering
 
So, you're just trying really hard to make an issue out of it.
 
9:47 AM
@thecoshman so (1) upvote both, and (2) write an answer which combines tehm
or (3) edit one of them with the missing information
 
IOW: stop bitching and do something.
 
@jalf ¬_¬ combine them it is
 
@thecoshman not aware of that excitement
 
@thecoshman It's a pattern.
 
@TonyTheLion positively pant wetting
 
9:48 AM
hahaha
Y U NO GIVE ME MORE UPVOTES?
> as I remember in C we used static declaration for methods in order to make them private
wut?
 
static (in one of its many dresses) means internal linkage.
 
:( I give up... I don't know enough to be able to make sense of combining them
 
1
Q: Method to check if something has been changed through the iterator

Vektor88I have made a List of Lists implementation of a sparse matrix, and I've implemented iterator and const_iterator with success. The iterator doesn't point directly to the container where the value is stored, but creates a struct, named element, so defined: template <typename T> struct eleme...

I think he's using iterators wrongly here
adding too much knowledge about the type it's supposed to iterate
but maybe that's ok for a specific type of iterator
 
... why... why would yo do that?
 
9:57 AM
donno
 

« first day (480 days earlier)      last day (4466 days later) »