« first day (876 days earlier)      last day (4079 days later) » 

1:00 PM
@sehe :effort:
 
user142019
It connects to PostgreSQL and uses Heist to render a list of issues.
 
user142019
It's already useful if you have direct access to the DBMS!
 
@sehe Do they just keep getting bigger, then?
 
@MartinJames No. Why?
 
user1357851
I don't understand why they are not extinct
 
user1357851
1:01 PM
I mean they are so slow
 
@sehe 'cos the don't do shit but keep eating.
 
I'm surprised how the wild doesn't prefer the sloth as a source of slow food.
 
@Telkitty I don't understand why they are not exploding.
 
@MartinJames Well, not being extinct is technically "doing shit". (In fact, they do, shit, I mean)
 
Xeo
@MartinJames Wat
 
user1357851
 
user1357851
@DomagojPandža probably they are not very tasty, being slow ... but I am sure there are meat eaters who are desperate at times
 
Once a week? I guess they don't do curries then.
 
user1357851
I won't want to eat any animal who only excrete once a week
 
Why do people try to write C++ when they have no idea about programming?
 
I gotta go shower. I need to go out to watch Stoke match. Either that, or hang upside-down from the lighting catenary on the path and not do shit ;)
 
1:07 PM
it baffles me
 
Ell
If I make the constructor private, will the auto-generated copy ctor also be private?
 
@TonyTheLion Because they heard they can make money selling apps.
I pity the fools.
 
indeed, fools
 
@Ell No
If it even generates copy ctor, I never remember the rules
 
user1357851
@TonyTheLion cause C++ is a better known language and people try to do the best known first? of course experienced software developers know otherwise
 
1:08 PM
@CatPlusPlus AFAIK it doesn't if you write manual anything
 
"I can write programs, me! Oh -wot's all this debugging shit?"
 
Ell
Hmm. I'm not sure if I should make the constructor private or not.
 
@Telkitty that's not necessarily the case. Java and .NET are very well known too.
@Ell why would you want to make it private? Do you not want your object to be instantiated?
> I have written a code
I want to cry ^
 
Ell
@TonyTheLion well basically, the user shouldn't be instantiating the objects, they should only be got from a function. Smells like singleton, I know. That's why I don't know what to do o.O
 
@Ell Nah, it's called a factory.
 
user142019
1:10 PM
@Ell private ctor and friend function.
 
Ell
I guess the user could construct it themselves, but they wouldn't know how to fill it in
@Zoidberg that's what I'm thinking
 
Woo I made FOMM work
 
user142019
Anyway.
 
user142019
Unless you need polymorphism
 
Ell
I'm wrapping winpcap btw
 
user142019
1:11 PM
you don't need the friend function.
 
user142019
You can just write the ctor instead and publicize it.
 
Ell
just a good old static one? :3
 
user1357851
@TonyTheLion simple part of C++ is actually simpler than Java or C#, imagine:
 
user1357851
#include <iostream>
int main()
{
std::cout << "hello world" <<std::endl;
return 0;
}
 
user1357851
that's literally 30 seconds
 
user142019
1:12 PM
print "Hello, world!"
 
user142019
Python, three seconds.
 
user142019
@Ell no.
 
user142019
Constructor acquires resource.
 
user142019
Initialize in ctor.
 
@Telkitty No
 
1:13 PM
@Telkitty No
 
user142019
class pcap {
public:
    explicit pcap(device& device) : whatever{make_pcap(device.native_handle())} {
    }

private:
    pcap_handle whatever;
};
 
Why can't you friggin' google it? Seriously... This is asked like twice a day... Couldn't you just find one of the previous questions? Why? Why? Why?H2CO3 1 min ago
 
user142019
@Ell ^
 
someone making a point
 
Ell
@Zoidberg ta :)
 
user142019
1:15 PM
explicit y u no implicit.
 
> "Return reference to invoke move ctor"
what?
 
user142019
@Telkitty you're already doing it wrong.
 
MODS
Gimme more mods
 
@Zoidberg lolwut
 
user142019
Oh wait right, copy and move ctors.
 
user142019
1:19 PM
lol explicit copy ctor.
 
user142019
@TonyTheLion the question is tagged because it's garbage!
 
in DirectX9 when your making vertex buffers you need to use it to load vertices in memory, do you have a skype? might be easier to solve it there — Efex 12 mins ago
lol
no I don't have Skype for noobs
 
user1357851
@Zoidberg No
 
user1357851
 
Congratulations, you can write a hello world
 
user142019
1:22 PM
@Telkitty -1 too much std::endl.
 
Have a cookie
 
user1357851
@Zoidberg ?
 
user142019
SUCH A WASTE. PRECIOUS I/O.
 
user1357851
unless you use using namespace std, you have to call std::endl;
 
user142019
No wtf.
 
1:23 PM
No, endl
oh god
 
user142019
std::cout << "Hello, world!\n";
 
Zoidberg, you tell her. xd
 
user1357851
...
 
sigh
@Telkitty are you going to teach us C++ now?
:INB4 WE ARE ALL LEARNING SO MUCH THANK YOU:
 
user1357851
no, someone told me my program got error, I just showed them it did not contain any error or even cause any warning
 
user142019
1:25 PM
That your program behaves as expected doesn't make the programming style good.
 
@Telkitty no, he told you that your code is lame
error != lame
 
user1357851
lame is in the eyes of their beholders
 
whatever that means
 
user1357851
\n is the c way
 
@TonyTheLion If they need Skype to create a vertex buffer, load vertices into memory and stuff them there, I'd suggest moving to another field of computer science... Perhaps botany?
 
1:26 PM
@Telkitty wanna fucking biscuit?
 
@DomagojPandža hahahah
 
also, god, you suck
31 secs ago, by Telkitty
\n is the c way
 
Isn't it amazing?
 
chat needs downvotes
 
@Telkitty \n is language agnostic, dammit. xd
 
user1357851
1:27 PM
chat needs less herd mentality
 
@sehe what is amamzing?
 
@BartekBanachewicz Yes, it does. However, it doesn't need generalizing negativities :) -- edit: I misread: I thought you said "You guys suck". Objection withdrawn
@BartekBanachewicz You said that already.
 
std::endl flushes the buffer
you don't always need it
 
DRY rule, I guess
'\n' is the character, endl is the character and buffer flush
 
1:28 PM
@TonyTheLion The point is, \n still flushes IIRC
 
user1357851
thanks sherlock
 
I once read the difference between \n and std::endl is that the latter flushes the buffer, and the other doesn't
 
user142019
@sehe if the stream is line-buffered. :)
 
1:29 PM
@Telkitty well you wrote something different.
 
user142019
But I don't know how that works.
 
user142019
It doesn't always do that.
 
I don't think iostreams supports line buffering
 
Ell
how do I get char* from std::array<char, 20>, as in to pass to a function with an out param?
 
@Zoidberg That's true.
 
1:29 PM
@Ell .data()
 
user142019
In some cases I don't get output when I use \n instead of std::endl before segfaults.
 
@CatPlusPlus Think again. It's on by default, AFAIK
 
Ell
@BartekBanachewicz ta :)
 
It has buffering, but not line buffering
 
@Zoidberg That could be the corruption interfering with the stdlib. But yeah, it's not guaranteed.
 
user142019
1:30 PM
Highly unlikely.
 
How so? Segfault is segfault
 
user142019
That's like, one byte out of sixteen thousand gazillion.
 
user142019
> cplusplus.com
 
user1357851
endl is perferred way
 
1:31 PM
@Ell also, pass array by reference
 
user142019
@Telkitty On the website of all noobs and idiots, cplusplus.com, yes.
 
@Telkitty No
 
@Telkitty GET OUT (with links to cplusplus.com)
 
user142019
cplusplus.com is wrong in every respect.
 
It's not "preferred" because it's not the same
 
Ell
1:32 PM
@BartekBanachewicz the function expects char*, how do I pass it by reference? o.O isn't .data() good enough?
 
user142019
@Ell don't pass pointers by reference.
 
user142019
Pointers already are references, conceptually.
 
No, they're not
 
@Ell if a function expects char*, it's a problem there
 
user142019
Pointers reference objects.
 
user142019
1:33 PM
So they are references.
 
He's wrapping C library jesus
 
@Zoidberg wrong
 
@Zoidberg No
 
user142019
They're just not C++ references.
 
const char NL = ’\n’;
lol
 
user142019
1:34 PM
Not enough constexpr.
 
> The user is going to have the buffer flushed, like it or not, because of the fact that the ios::unitbuf bit is turned on by default. So using ’\n’ vs. endl is a moot point. If the buffer really should not be flushed, then this bit needs to be turned off.
 
Ah see I didn't know about that
But that's not line-buffering that's essentially no buffering
 
@sehe where is that from?
 
unitbuf is flushing after every output operation
 
> My guess is that cout is still buffered under many (if not most) implementations, but the standard will be the standard, so in the future, cout will not be buffered. Yet most of the places where I observe endl being used gratuitously, the destination stream is cout
@CatPlusPlus ikr. It's from that article by S. Meyer I linked previously /cc @bamboon
 
1:37 PM
I never use endl anyway so whatever
 
Mind you the article is from '95 so the standard may have addressed it differently now. Still, I remembered this
 
user1357851
I always use endl, makes it much easier to read since usually commercial system is maintained by multiple people, shortest code is not the best code, more reliable and easy to read is
 
@sehe interesting article
 
Did someone reference cplusplus.com?
 
user142019
@Telkitty wat
 
1:39 PM
When's the noob execution scheduled?
I want to cheer.
 
user142019
> easy to read
 
user142019
> C++ I/O streams
 
user142019
Pick one.
 
@Telkitty What the hell are you talking about
 
user142019
@CatPlusPlus std::endl
 
user142019
1:41 PM
std::endl has a terrible name.
 
user1357851
...
 
user142019
It should be std::newline_and_flush.
 
user142019
And then it does too many things; SRP.
 
user1357851
@DomagojPandža a newb can grow into a pro, but no cure for dumb people >_<
 
user142019
So it should be removed from the library.
 
user142019
1:42 PM
@Telkitty So I guess you're doomed.
2
 
AHAHAHAH
 
Jesus no I can't read this drivel
 
Zoidberg draws first blood.
 
user1357851
@Zoidberg is it going to be removed from the next version ... or ever?
 
It makes my brain hurt
 
user142019
1:43 PM
@Telkitty I hope so.
 
user142019
Seriously, if you want newline + flush do s << '\n'; s.flush();.
 
user1357851
you mean you wish so
 
user142019
Be explicit.
 
There's flush manipulator
 
user142019
Or turn on line buffering explicitly.
 
user1357851
1:44 PM
@CatPlusPlus 2nd that
 
user142019
Ah fuck it, I/O streams are FUBAR anyway.
 
user142019
Why are we even discussing them.
 
Ell
hmm. pcap uses "sources" to choose how to open stuff, like "file://path_and_filename [opens a local file]", "rpcap://host/devicename [opens the selected device available on a remote host]", etc. Should I accept an std::string, or wrap each one in a class, then have overloads for different types?
meh, idk
 
user142019
Stringly typed is terribru.
 
Ell
yeah
 
user142019
1:46 PM
Prefer to use custom types to represent things.
 
Having URI type can be nice because you can refer to parts
 
user142019
> We have std::string why do we need anything else!
 
Ell
@CatPlusPlus what do you mean?
 
user142019
Custom types can also error on invalid data (sometimes even at compile time).
 
user142019
So you cannot pass in shit like the empty string.
 
Ell
1:47 PM
Yeah that's another reason I was thinking custom types
 
@Ell Er, I mean you can refer to parts, what else
 
Ell
@CatPlusPlus well, why would you refer to parts? which parts?
 
user142019
@Ell protocol, username, password, host, port, path segments, query string, fragment.
 
Ell
Oh right
 
user142019
class url {
public:
    std::string protocol() const;
    std::string username() const;
    std::string etc() const;
private:
    std::string data;
};
 
user142019
1:49 PM
(Very basic, crappy interface. :P)
 
is there a JS function for HTML escaping?
 
Ell
If I did that, I would have some redundant data and I'd need an SourceType
 
user142019
var tagsToReplace = { '&': '&amp;', '<': '&lt;' };

function replaceTag(tag) {
    return tagsToReplace[tag] || tag;
}

function safe_tags_replace(str) {
    return str.replace(/[&<]/g, replaceTag);
}
 
@Ell What
 
Ell
Oh wait a second, ignore me
 
user142019
1:51 PM
 
Ell
:'(
 
user142019
:')
 
Woo Fallout crashes
 
user1357851
why do I always see that fish with the word plonk
10
 
@Mysticial: bomb guy posts problem PDF: deadline24.pl/assets/Uploads/dl24.elim.A.2012.pdf
 
user1357851
1:52 PM
plonk = cheap bad quality wine ... no?
 
user142019
plonk = cheap bad quality fool that needs to be ignored in chat.
 
No mod with new weapons
 
limits are 1 ≤ W,H ≤ 1000, 1 ≤ m_ij ≤ 1000
 
user1357851
@Zoidberg that too
 
user142019
1:54 PM
I should get out of bed.
 
user142019
It's flate.
 
@nneonneo what
Is it old Deadline?
 
Ell
How about some unnecessary polymorphism? Base Source type with std::string uri(), then LocalFileSource, LocalDeviceSource, RemoteDeviceSource
 
@BartekBanachewicz bomb guy
 
Ell
meh I think I'll just go with a different class for each source then overloads for each source. Because certain sources are allowed with certain functions
 
1:55 PM
@nneonneo Check 3 answers above — Kostek 4 mins ago
 
@nneonneo It's from the previous year! Damn, I knew I remember it. We didn't make it past eliminations though :/
 
@BartekBanachewicz you participated in it?
there's an SO question where we collectively display our ignorance of algorithms
 
@nneonneo I was in finals of 2011 edition. It's a nice contest.
 
Ell
wait a minute, a template :3 that allows only certain classes maybe o.O
 
user142019
@Ell no need for polymorphism.
 
1:56 PM
yesterday's SO Supercollider QuestionOfTheDay™
 
user142019
@Ell why.
 
user142019
Overloading will do.
 
I would like to try this year too but a) I suck at algorithms b) I have no team :(
 
@BartekBanachewicz it looks like ACM-style problem solving
 
Ell
@Zoidberg but then I have to write the same code 3 times!
 
user142019
1:57 PM
class local_file_source { ... };
class local_device_source { ... };
class remote_device_source { ... };
class pcap {
public:
    explicit pcap(local_file_source const& s);
    explicit pcap(local_device_source const& s);
    explicit pcap(remote_device_source const& s);
};
 
@nneonneo more or less, the problems on finals were much more interesting though
 
and I friggin loved ACM contests when I was in undergrad. Too bad I was no good at them
 
user142019
@Ell oh right.
 
user142019
You could use SFINAE and a source_traits struct or is_source structs.
 
Ell
because the sources won't differ besides only being allowed in certain functions
right. Time to learn SFINAE :3
 
1:57 PM
You don't have to distinguish sources on type level
 
user1357851
@nneonneo the one bomb -1 on and with the surrounding question?
 
@Telkitty: your favourite
 
user142019
@Ell Or just plain old duck typing.
 
Oh, @CatPlusPlus, maybe you want to tackle this year's D24 eliminations? :>
 
The what
 
user1357851
1:58 PM
@nneonneo not fair I did not have morning coffee :p ... what was the best answer ... in English, or Chinese for that matter >_<
 
Ell
@Zoidberg but that will allow any kind of source for any kind of function, won't it?
 
user142019
template<typename Source>
explicit pcap(Source const& source)
    : handle(source.pcap_handle()) { // will fail if there is no such function

}
 
> In case you missed it, that video shows them dumping chocolate all over a white canvas shoe, only to have it roll cleanly off like criminal charges on a banker.
 
@BartekBanachewicz Oh fuck no
 
1:59 PM
Oh Cracked, you so funny.
 
user142019
@Ell ohh you want that.
 
@CatPlusPlus because algorithms or something other?
 
user142019
Then you need overloading (and optionally SFINAE if you don't want duplicated code).
 
Ell
I think it's a good excuse to learn SFINAE
 
user142019
Or static_assert if that will do.
 
1:59 PM
@Telkitty: AFAIK nobody has solved it yet
 

« first day (876 days earlier)      last day (4079 days later) »