« first day (320 days earlier)      last day (4629 days later) » 

12:01 AM
what is better writing practice, for example Constructor(int day, int month, int year);
or Constructor(int, int, int); i will define constructor body out of class ?
 
usually you'd give the parameters names
often IDEs will show you the name in a popup and it can guide the user as to the intended content
 
Users are likely to look at headers. Plus, things like IntelliSense will also look at the headers.
 
> internal compiler error: Segmentation fault
Well fuck.
 
so to write names of parametars in prototype :D
 
auto consumer = [](annex::out_channel<int> take)
{
    int i = 0;
    try {
        for(;;) {
            int popped = take.pop();
            BOOST_CHECK_EQUAL( popped, i );
            ++i;
        }
    } catch(annex::channel_closed const&) {
        BOOST_CHECK_EQUAL( i, 1000 );
    }
};
Exceptions don't look that hot here.
 
12:06 AM
Ugh.
Closed channels are not exceptional.
 
I don't like while(auto pop = take.pop()) { auto&& popped = *pop; ... much either.
 
let's face it
you don't like most of the interfaces you've come up with
 
?
I'm liking the idea of iterators more and more.
Still, the 'real' work has to be somewhere.
@RMartinhoFernandes Not exceptional but it only happens once.
Also Boost.Optional still doesn't support move-only types.
What now?
 
still
I have an examination in (much too short a period of time) so good night
 
12:17 AM
Ciao
 
@DeadMG Good night.
 
@LucDanton Implement your own- it can't be that hard
 
@DeadMG But it will be coded against only one compiler, whereas Boost supports several.
 
true, but I don't think that optional is the kind of thing that requires much
all you'd need is to use the Boost config header to disable the rvalue refs for compilers that don't support it
 
Yeah, std::aligned_storage should be it.
Which Boost has, conveniently.
 
12:19 AM
see? I'm a Genius™
 
Self-certified genius.
 
No offense but I'm probably going for the exceptions :p
 
At least make that the "advanced" interface and provide the iterators for more simple uses.
 
Yep.
I'm considering while(chan.pop(t)) right now though.
i.e. while(some_stream >> put_stuff_here)
It requires MoveAssignable vs MoveConstructible.
 
1 hour ago, by Luc Danton
I dislike the idea of out parameters.
Changed your mind?
 
12:22 AM
No I still dislike them.
 
Hello!
 
Hi
I'm considering, is all.
 
First class was today.
Lots of fun.
 
int *&p, is reference to pointer, i only need to read from right to left ?
 
12:23 AM
@Moshe int main or void main?
@Srle Yes.
@Luc: tell me when you can run this: ideone.com/7SbFC :)
 
@Srle There are more complicated declarations that require something else than right to left but you're correct here.
 
thanks :)
 
@RMartinhoFernandes Today was int.
 
That's good!
 
@RMartinhoFernandes std::async(std::launch::async, ...) can be your go btw
 
12:24 AM
Oh there's that?
 
Indeedy
 
I should read more about the thread library.
 
Returns a std::future, too.
 
I focused too much on the memory model thing, and completely forgot the library.
 
which means it has better exception guarantees that using std::thread directly (which is horribly unsafe).
 
12:25 AM
Anyone know how to make my program copy the output to the clipboard? The SO post I found didn't work.
Professor wants us to leave the output in the bottom in a comment.
And I got to look smart for about thirty seconds, asking what characters are illegal inside multiline comments.
 
Well in any case I'm dropping all considerations right now and going for the iterators.
 
$ ./your_prog >> your_prog.cpp should work. (I'm both intrigued and horrified by the idea a program modifying it's own source code.)
 
5 hours ago, by Moshe
Intro to C++ http://t.co/x5RGsGm
 
12:41 AM
§19.5 System error support <- Nice, Boost.System is here!
 
Heh, if I have a nested class in a template (i.e. out_channel<T, Allocator>::iterator), I have to implement operators as members, don't I?
 
I'm not sure I understand.
 
What's "operators a member"?
 
Fixed!
 
Ah. Whose members, the nested class's or the containing class's?
 
12:44 AM
nested
 
As opposed to as free functions?
 
i.e. template<typename T, typename A> bool operator==(out_channel<T, A>::iterator lhs, out_channel<T, A>::iterator rhs); doesn't seem possible.
 
Missing typename?
 
Interesting... why not?
Maybe missing template, too.
 
iterator is not a template.
 
12:45 AM
Right
 
If it is, it's lacking <>.
 
You're right, no template.
 
There's also the possibility of an in-class friend definition
 
Oh, iterator is private?
 
It's not
 
error: no match for 'operator!=' in '__for_begin != __for_end'
 
Hey, here's a question for everyone: What sort of error message do you most associate with a programming language? I'll start: For C++, it's a 2-page template error beginning with std::__detail::hash.
 
How can the freestanding template ever match anything? I.e. no deduction allowed when doing typename out_channel<T, A>::iterator lhs, ...
 
Oh.
I thought you meant that the compiler rejected the operator.
 
Whereas using an in-class friend definition defines a function, not a template!
 
12:51 AM
For Java it has to be NullPointerException.
 
@KerrekSB Oh, certainly!
Same for .NET: "Object reference not set to an instance of Object."
 
For BASIC: "Syntax Error"
 
In a fit of irony, I do need an optional<T> for implementing the iterator.
 
@LucDanton You seem to be up to no good again ;-)
 
That's bad, isn't it? What with the copyable requirement.
 
12:52 AM
@RMartinhoFernandes Well I will be reimplementing it with support for move only types.
 
@KerrekSB Reimplementing a CSP-style channel into two classes: in_channel<T> and out_channel<T>
Now adding iterators for a neat interface.
 
@LucDanton A laudable plan!
 
    auto consumer = [](annex::out_channel<std::unique_ptr<int>> take)
    {
        int i = 0;
        for(auto&& popped: take) {
            BOOST_CHECK_EQUAL( popped, i );
            ++i;
        }
        BOOST_CHECK_EQUAL( i, 1000 );
    };
The unit test already looks neat.
 
OK, I'm struggling to come up with anything idiomatic of JavaScript. Maybe "Undefined reference to [NullReference]"?
 
12:54 AM
And is missing a dereference, oops.
 
@KerrekSB Never saw that.
 
@RMartinhoFernandes No, it's not quite right...
 
@LucDanton I would expect you to write to an output channel.
 
Yeah, one does read from istreams, not ostreams
 
So your out_channel has move-iterators only?
 
12:58 AM
Okay, fixing that was easy. Praise be to the Vim gods!
 
@KerrekSB Actually the iterators will need to have room for one element as 'look ahead'.
Because the actual pop operation has to take place during iterator comparison, not dereferencing.
 
Is that what optional is for?
 
Yep
 
@LucDanton I see. So the channels are templated on a basic, movable unit of data?
 
1:02 AM
Yes, so far the only requirements on the element type are MoveConstructible and some convertibility.
i.e. channel.push(arg0, arg1, arg2); does an emplace.
Oh wait since I already require MoveConstructible just that one is enough.
Move an element to an end, get it from the other; is the general idea :)
 
Is that pushing three values or constructing one from three arguments?
 
The latter.
(I could extend the interface to support emplacing/constructing a bunch of stuff in one go, which can be a useful optimization, but I'm not quite there.)
 
... how is it different from a deque?
 
For starters, the interface.
 
OK
 
1:05 AM
It separates reading from writing.
 
Thread-safety guarantees would be the motivation.
 
By changing the underlying buffer (or through some policy) you could use a leaky channel.
Considering that?
 
I don't understand.
What's leaking?
 
What happens when the buffer is full?
You can block, or drop the data.
 
Yes.
So dropping is the leaking here.
 
1:09 AM
It's a good kind of leaking :)
 
I get it.
Well first I'm going to find a convenient interface.
 
Then if I have a use for it I might try to work on QoI (i.e. bring lock-free containers to the table).
 
@LucDanton How about a concurrent queue, like Herb Sutter wrote about in Dr Dobbs?
 
Then I might extend the interface, partly depending on some new needs resulting from that use.
 
1:10 AM
What's QoI?
Qo inhibitors (QoI), or Quinone outside inhibitors are a group of fungicides used in agriculture. They represent the most important development made in fungicides by the chemicals industry. QoI are chemical compounds which act at the Quinol outer binding site of the cytochrome bc1 complex. QoI's are the resulting fusion of three fungicides families, the well-known family of strobilurins and two new families, represented by fenamidone and famoxadone. Some strobilurins are azoxystrobin, kresoxim-methyl, picoxystrobin, pyraclostrobin and trifloxystrobin. These fungicides are used on a wide r...
Not this I gather.
 
@KerrekSB In all likeliness I'm not going to write an implementation from scratch but delegate to something else.
Quality of Implementation.
Optimization, here.
 
I.e. first I write semantically correct channels with a nice interface. The nice interface motivates me to write neato algorithms/programs. Then I have use cases that I can profile and optimize.
 
Sounds like a plan!
Ooooh, 2:00 and raining. I'm going to sleep.
 
I don't really have any kind of hope that the first iterations will enable me to magically leverage all my cores and reap performance benefits :)
 
1:13 AM
Good night.
 
Tschuess
 
</>
 
Oh god I forgot about the exception guarantees of boost::optional.
 
Hey, check out this question: OP asks if std::vector<std::array<U, N>> is contiguous for U.
I think it is, but I'm not sure that's mandated.
 
Ah well, that seems similar to the argument for T[N][M]
It's not specified to be contiguous but the requirements are such that it makes no difference.
So whether it is or not is somewhat of a philosophical question. Possibly.
 
1:22 AM
Well, someone might want to address the whole byte range...
OK. I left a "not sure" answer. That part was added to the question late anyway.
 
1:36 AM
Just wondering, what tech are these rooms built on?
if there's a meta chat, sorry for asking here
 
What's end == end for a typical end iterator?
 
1:54 AM
@LucDanton What do you mean? True, usually, non?
 
Yes.
 
Otherwise you couldn't check for emptiness by begin() == end().
 
I figured as much :)
Have to take a break from code to take a bite though.
 
2:54 AM
@KerrekSB N3290 §23.3.2.1 guarantees contiguous array, and I guess you don't need me quoting any extra reference for contiguousness of vector buffer. So yes, the buffer is contiguous.
 
Hello
@AlfPSteinbach - Had my first C++ class today.
 
oh, that must be exciting
he he
 
3 hours ago, by Moshe
5 hours ago, by Moshe
Intro to C++ http://t.co/x5RGsGm
Yep.
 
looks good, but the system( "PAUSE" ) won't work in *nix
instead, find out how to run program with pausing in your fav IDE.
and in command interpreter you don't need the pause
 
3:59 AM
hi all
 
 
2 hours later…
5:50 AM
system( "FAUX PAUSE" )
 
6:06 AM
re room title, only bad programmers delve down to pointer level to reverse a linked list
 
Hi everyone
I am using netbeans with cygwin.
and for the following code:
#include <cstdlib>
#include <iostream>

int main()
{
	using namespace std;
	cout << "Hello world!";
	return 0;
}
I get RUN FAILED (exit value 1, total time: 35ms)
any idea ?
 
Run cygcheck -f mytest.exe.
 
@omeid: the program that failed was not the one whose source code you're showing.
 
@AlfPSteinbach no it is.
I know I return 0 so it shouldn't say exit value 1
 
s/shouldn't/doesn't/g
 
6:15 AM
@wilx why mytest.exe ?
 
@OmeidHerat: Ugh? Obviously, you should run it onto your own executable that is showing the problem.
 
@Omeid Herat: The code as presented should work.
I get "Hello world!" as expected from the output
 
@Insilico what is your compiler ?
I am using cygwin.
@wilx ok hold on.
 
I'm using a Visual C++ compiler, but the code you've presented is so trivial it should run on any reasonably standards-conforming compiler
 
@Insilico yup.
@wilx I get nothing return.
1 min
 
6:19 AM
If even cygcheck does not print anything, then your Cygwin installation is broken.
 
@Omeid: in cygwin bash, write g++ --version
 
Or you are executing it wrong.
 
4.3.4
 
good. modern version
can you cd over to your source code directory
and manually compile, like
 
yes I can
but how do I compile it
 
6:24 AM
g++ mytest.cpp -o bah
should produce executable called bah
 
Err.
lol
 
Access is denied. :|
 
i think that means that you're not actually in source code directory
pwd should tell you which directory you're in
if i recall correctly
 
Oh!
my bad I tried with windows CMD
not with cygwin.
cause I can't cd to source code.
maybe I should copy
but I want to fix my netbeans.
 
what's the advantage of cygwin over virtualbox?
seems sharing the filesystem is a blessing and a curse
 
6:30 AM
The advantage is that you do not have to install another operating system.
 
for some time microsoft also offered services for unix, which they had acquired. possibly still offering it (for free). with gcc.
 
Maybe not the kernel, but the bulk of the OS is the packages you need either way.
 
manged to cd with cygwin to source file and tried `g++ main.cpp -o app` the app.exe is created but when I run it returns the following error:
`0 [main] app 5996 exception ::handle: exception: Status Violation....`
 
do you run it like ./app (you should)?
 
does anyone know any good and FREE data compression software.
 
6:36 AM
7zip?
 
like some free clone of winrar?
 
Um, just download 7zip and/or the free command-line version of rar.
 
Thanks
Um... and does anyone know of any good c++ data compression library?
 
Take any open-source compression library in C (which is most of them) and write a light wrapper.
 
@Potatoswatter Thanks. I did the same with SDL .
 
6:41 AM
@AlfPSteinbach I run it like app.exe
 
A "light" wrapper for SDL is going to be much heavier than a data compression class.
All it needs to do is set configuration parameters and perform block I/O
heck, it might be better just to use the C interface as-is
 
@Potatoswatter You got that right, but SDL is much easier than you think. just read the documentation, make a list of all the structs (SDL_Surface etc.) and all the functions related to those structs, put them all in a class e.g SDL::Surface and you're done
 
That is not my interface design philosophy, but to each his own ;v)
 
@OmeidHerat it seems there's a problem with Cygwin, nobody knows what it is, but possibly involving Windows "security" and/or antivirus.
I suggest uninstalling CygWin and Netbeans
 
@Potatoswatter that is not mine as well, if i am writing my own code. but wrappers are just for ease of use... :D
 
6:45 AM
@AlfPSteinbach alright, thanks for the help so far.
 
install code::blocks, or better, Visual C++ Express
 
@AlfPSteinbach I love netbeans
 
@AlfPSteinbach Visual C++ is not better than code::blocks
 
and also I am use to it
 
oh, well
 
6:46 AM
code::blocks is the best!
 
I have all my PHP projects there
so not really thinking about moving to another IDE.
 
ok, maybe you can convince it to use MinGW version of g++
 
Yeah that is a good idea
you can pretty much set everything in netbeans.
 
if you wanted to make a vector of a template class would you do this?
std::vector<myclass<mytypename>> x;
 
Yes. I would still put the space between > >.
 
6:58 AM
so it is possible thank heavens
 
I would also potentially use a typedef for the vector.
 
does anyone know how to change the a property value of a stored object in google app engine?
 

« first day (320 days earlier)      last day (4629 days later) »