« first day (760 days earlier)      last day (4183 days later) » 

sbi
8:00 PM
@MooingDuck While taking this empty bottle of beer out to the kitchen (and get me a new one), I just paused and told the robot "All it takes is a random-access iterator that provides random values." He answered "Yes, I know, that's what I am doing right now."
LOL!
There you have the difference between youth and age: I just throw the truth onto the table, open another beer, and will go to bed Real Soon Now™, knowing that I have defeated @MooingDuck's claim single-handedly with the flick of my wrist . He will sit half the night sorting through the inevitable mess coding this will turn into, and will be cross-eyed when I wake him tomorrow morning at 6:16.
 
Xeo
std::vector<int> v{(...10,rand())...}; if Richard's proposal gets accepted. I sooo want that.
 
Changing the front of a deque invalidates iterators but not pointers?
 
@Pubby Right. Except maybe pointers to the front, if you just popped it :)
 
Xeo
@Pubby Changing either side invalidates nothing, IIRC. Only inserts in the middle.
 
@Xeo Iterators are as brittle as vector's.
 
8:04 PM
sbi, you haven't "defeated my claim", you defeated my sample. iostream is a much better sample of my claim. (no ping in case you already went to bed)
 
@Xeo The deque's index has to be reallocated.
 
sbi
@Xeo You are going to work in the game industry. As @jalf so aptly noted, the only way for you to employ anything but C With Classes is to nuke that whole industry from orbit. Unfortunately for you, when we pull that off, you'll be on the receiving end of the nukes. But it was nice knowing you, cowboy.
 
Question:
 
@sbi 6:16 huh
 
Does C++ have strings like java, or is it more C like?
 
8:05 PM
@Crowz A bit more like java. But with value semantics
 
@sehe Explain?
 
@Crowz both, the "string literals" are almost identical to C, but we also have a std::string class.
 
@Crowz Closer to Java's (as in: poorly designed, bloated interface, ...)
 
sbi
@sehe Yeah, I was going wake him at 6:15, but then I felt that would be, you know, a bit brutal, so I decided to delay that until 6:16. I am humane, after all.
 
So for example, can I do String poop="I am shitting fire";
 
8:06 PM
@Crowz strings are mutable, and each string doesn't share anything.
@Crowz yes, creates a String object from a const char* probably.
 
@Crowz It's std::string, but yes.
 
@MooingDuck That's not comparable to the C situation though. In C, the situation with interfaces is often considerably worse because there cannot be abstraction
 
sbi
@Crowz Nope. you can't.
 
@R.MartinhoFernandes Alright. Can strings be written to a socket?
 
sbi
You have to do std::string poop="I am shitting fire";
 
8:07 PM
Except that it's `std::string poop = "I am shitting fire";` or (preferably)
`std::string poop("I am shitting fire");`.
 
@sbi Funny you should first consider your humane side, when dealing with a robot
 
@MooingDuck Yes, I agree that not all the abstractions present in the standard library are applicable to all situations.
 
@Crowz kindof
 
@MooingDuck Do I have to write byte by byte?
 
Xeo
@R.MartinhoFernandes Meh, you could implement an iterator that doesn't need that, but I double-checked and inserts at either end invalidates iterators. :/
 
8:07 PM
@Crowz no, usually you write the length, then you write the data.
 
@JerryCoffin std::string poop { "I am shitting fire" }; is cooler.
 
sbi
@JerryCoffin Good to see that there's users here that are even slower than I am.
 
@Xeo Where would you put that information, then?
 
@MooingDuck Okay, so if I show you a program, will you look at what I mean?
 
@sbi It'll happen to you too when you get to my age! :-)
 
8:08 PM
@Crowz will the program actually explain what you mean?
 
@MooingDuck Kinda. I am currently using char[]s, and I was wondering if it'd be easier to use Strings
 
@Crowz yes, it always is
 
@Crowz Are you arguing with someone who says you shouldn't do socket interfacing in C++? Because "it hasn't even got a decent string class", "you need to write byte by byte" etc? This is what it looks like from where I'm sitting
 
sbi
@sehe You forgot about the part where I am an ape, treating a robot humanely.
 
An Alien Freaking Zoo
 
8:10 PM
@sehe Arguing with myself, more or less. I am using C currently and the teacher had us using char[]s which seem to be causing problems
 
@Crowz I can picture that :)
 
I wasn't aware that building a fake reputation for being a drunkard counted as humane treatment.
 
294 server has it
 
@Crowz No, but even using C strings, you don't have to do that. Of course, given that it's a serial connection, at some point they all degenerate to one byte (or really, one bit) at a time, but it doesn't have to look that way in C or C++.
 
@Crowz I'm not looking at 650 lines of code for you!
 
8:10 PM
@Crowz Oh that code again. Seen it before
 
@MooingDuck It's closer to 10 lines, you can ignore a LOT of it
 
Xeo
@R.MartinhoFernandes Pointers, pointers everywhere! :D
 
@Crowz which 10?
 
sbi
@sehe Says a polar bear.
 
294, that elseif
On server
 
8:12 PM
@Crowz Your whitespace seems very unsure of itself.
2
 
@Crowz I don't even think anything was edited since I last reviewed it
 
It's client counterpart is on 138
 
@MooingDuck Wrong. That's just the second file. It's over 1000 total.
 
Is there any overhead with auto fun = lamba...?
 
sbi
@R.MartinhoFernandes Well, getting drunk is human, isn't it?
 
8:12 PM
@sehe No I edited it, but just didn't upload the revised edition because it's irrelevent
 
@Pubby No. (In Hell++ there is, because Hell++ has no copy elision)
 
@R.MartinhoFernandes Only one else if of the whole program
 
@Crowz status = sendMessage(data_socket, buff.data(), buff.size()); (if you're using std::string buff;)
 
@R.MartinhoFernandes The compiler just lifts it into a normal function?
 
@Pubby depends on the captures I think
 
8:13 PM
Or is it a std::function? :S
 
Xeo
@Pubby No.
 
@Crowz Oh really. You want a review to see what needs to change, yet you leave the obvious bugs in. I don't even remember what it was I fixed. Oh yeah, null termination
 
@Pubby It's a distinct function object type.
 
Xeo
@Pubby A lambda is a local (non-union) class-type with an operator() that does the stuff in the body. There is no overhead for syntactic sugar.
 
@Pubby No -- a lambda always produces a class, not a function (though under the right circumstances, you can still use in where a pointer to function is needed).
 
8:14 PM
@sehe Yeah sehe I fixed that by filling the array sizeof(buff)-1 full, and then at sizeof(buff) adding a NULL
 
Xeo
@Crowz Eh, isn't buff[sizeof(buff)] one-past-the-end? Aka an invalid element?
 
@Crowz Actually, you should take a hint from C++ and write a string struct.
 
@Crowz Well, I think it is mysterious priority to not upload the modified version. It is a gist as well, it's not like it would be too much effort.
 
it'll just be ugly as fuck
 
Xeo
sizeof(buff)-1 is the last valid index.
 
8:16 PM
@Xeo yeah precisely what I was anticipating
 
Well, more accurately, I did this:
numberoffrigginbytes=fread(...);
buff[numberoffrigginbytes]=NULL)
 
Xeo
That sounds saner.
 
Yeah it SEEMS to work, but I hate working with char[] or char*
As you've noticed, there's tons and tons of glitches or things that could go wrong in my program
 
For context, this all started with just output. Then my psychic prediction:
Nov 11 at 19:27, by sehe
@user1150599 There's no code, silly! So, after you remove the ansi escapes you get neat output with a lot of stray "àÎÝvÿn". My $100 says you fail to null terminate somewhere. 40% says you have a strncpy going with the exact same size as your buffer.
I still have my $100
Nov 11 at 19:33, by sehe
        numberoffrigginbytes=fread(buff, sizeof(char), sizeof(buff), afile);
        status = sendMessage(data_socket, buff, strlen(buff));
 
sbi
@Crowz If buff an array of pointers? Otherwise you should use '\0'.
 
8:19 PM
Turns out it was possible to 'fix' this wrong. I lost my version of the code (I fixed it right, but that just leads to the server crashing).
 
sbi
Not that it made a difference to the compiler, but you're mostly writing code for humans anyway.
 
Just saying. This could be a looooooooooooooooooooooong story which really doesn't fit in the lounge.
 
room topic changed to Lounge<C++>: We are made of long stories. [beep] [c++] [c++11] [c++-faq]
 
Writing codes for humans? But no humans see this code
 
@Crowz Take a look at some C++ code for sockets: boost.org/doc/libs/1_52_0/doc/html/boost_asio/examples.html Doesn't do ftp, but does chat, daytime, etc. -- all the sockets kinds of stuff. From there, it's purely a matter of deciding what data to send/receive on which ports.
 
8:20 PM
@Crowz you'd be wrong
@Crowz you've seen it, sehe has seen it, I've seen it...
 
@Crowz Right. GUYS, this means WE CAN NO LONGER LOOK AT IT.
Great. Problem solved
 
Eh whatever, I am done with the project it's just annoying me that that's so broken
 
@Crowz To be fair, I think the project (writing a simple ftp server/client) is bit much too ask for entry level C++ course.
 
@sehe It's actually C or C++, so I wrote it in C
No C experience though, so writing without strings was bad
 
Your teacher could/should have picked a less complicated task. Anyways, if it would make you feel better, should you happen to see the code the teacher comes up with, we'd be happy to tear that apart too.
My other $100 bucks says that the teacher won't have done this without unportable code, undefined behaviour, lack of error checking and serious security vulnerabilities. You know what: this isn't trivial.
 
8:24 PM
@Crowz did you learn your lesson?
 
@sehe There's NO security at all haha, you can also input 2000 characters into the prompt and destroy the program
 
the lesson is: always pick C++.
 
If I had to write C code, the first thing I would do is write a C struct "mpdstring" that is has data, size, and capacity, and a series of functions to act on it.
 
@Crowz I noticed. And you can just overwrite random files. If you 'put file.a' on the client, and the server runs on the same machine, the original file becomes truncated etc. etc.
 
@MooingDuck I've never used a struct, I'm very used to java constructors though, I love 'em
 
8:26 PM
@MooingDuck Really? IOW: you don't do C code :)
 
@sehe Yeah both the IPs are set to home, I am pretty sure, so I was having problems with that
 
@Crowz IPs are set to home? MOVE ZIG!
 
@sehe 127.0.0.1 haha
 
@MooingDuck hehe, that p.
 
@Crowz It really has nothing to do with that. It has to do with proper IO synch: see Eat My Data: How everybody gets File IO wrong. Again, this ain't trivial.
@R.MartinhoFernandes What's it stand for?
 
8:28 PM
@R.MartinhoFernandes I'd probably make the capacity one use a pointer, as a layer of safety to detect if someone screwed something up.
 
Probably full noob question here... but what are the similarity and differences between structs (C++) and constructors (java)?
 
@Crowz You mean, Levenshtein distance? There is no relation.
 
@Crowz there's... nothing in common. One is a block of data, the other is a function.
 
@MooingDuck I thought they were both collections of data?
 
@Crowz a constructor is a function.
 
8:30 PM
@Crowz Meet a Java class. And no, a Java class is more than a collection of fields: it is a type with full metadata and reference semantics
 
@Crowz you could compare a C struct to a Java class where everything is public, final, and has no functions whatsoever. Kindof.
 
... }
 
@Crowz Rubbish(TM)
 
class blah()?
 
sbi
@Crowz Shit.
 
8:31 PM
you, sir, are teh fails.
 
user1804599
Good evening, gentlemen.
 
Yeah but the thing inside is like a collection of data, isn't it?
 
@DeadMG The AmazingPaulaBean()
 
@Crowz yes, kindof
 
@sehe "Brillant"
 
8:32 PM
@Crowz It's a namespace.
@R.MartinhoFernandes indeed. This conversation is giving me insight in how coding the PaulaBean could take a month and be considered an ahievement
 
To actually write something meaningful... let's say I have a stack.
 
user1804599
Nice indentation style (hint: Ctrl+K).
 
Then I could make ListNode top;
 
Enough Rubbish(TM) already
 
@Crowz that was a class.
 
8:33 PM
Okay, then what exactly is a struct?
 
Xeo
A class-type in C++
 
@Crowz A word you'll find in a good book. Read it
 
@Crowz A type.
 
@sehe Ah, I'll never read those awful technical books... get more confused than when I'd just hack away at problems aimlessly
 
@Crowz in C++, there's virtually no difference between a class and a struct. C has no classes, and structs are like classes, but everything is public final and it has no functions. Both languages have value semantics.
 
8:35 PM
@Crowz Be sure to send us your teacher's "solution" to the ftp c/s assignment. That'd be fun. Cheers, bye
 
He won't post a version hah
 
@Crowz That's what you think
 
'Tis what my gut tells me
 
@Crowz Job security. Anyways, should you be able to screen capture parts of it, please do accidentally drop them on imgur
 
user1182183
do we have a biology expert here? :$
 
8:36 PM
@Crowz Don't trust it. Buy a new gut. It'll save you pain. And us agony
@GamErix The ape has some background IIRC
 
Why would he post his version? I doubt anyone in the class would read it
 
@Crowz Urfffff. So much for teaching
 
user1182183
 
user1182183
I don't know how that device is called
 
user1182183
but it's for electrocuting DNA
 
sbi
8:37 PM
@GamErix You are asking for for @Konrad.
 
user1182183
through some jelly
 
sbi
@sehe Nope.
 
@GamErix electromagnetic foresis or something?
 
user1182183
and you can see 'differences' between some dna strings
 
user1182183
@Crowz I think :X
 
user1182183
8:38 PM
I need the name for my 12 page homework, I forgot the damn name :/
 
user1182183
and from this one too:
 
user1182183
 
user1182183
forgot what it does -.-
 
8:39 PM
No no wrong thing
 
user1182183
@Crowz nah, it has to do with DNA stuff :F
 
sbi
@R.MartinhoFernandes Oi. Looks like @sehe got himself quite dirty!
 
user1182183
@DeadMG samsung?
 
user1182183
looks like my acer.
 
8:40 PM
it's not my laptop, what do I know?
 
user1182183
@DeadMG oh ok
 
@DeadMG Why did you post it?
 
@R.MartinhoFernandes everyone else was posting random pictures...
 
@R.MartinhoFernandes Because my idiot dog now thinks that "Underneath a laptop" is the ideal place to squish your face.
 
sbi
8:41 PM
@DeadMG There's a dog on that pic?
 
Ell
hmm. why do fat people tuck their Hawaiian shirts in?
 
@DeadMG is there a dog in the picture?
 
wat?
 
sbi
:b
 
@DeadMG it's warm.
 
8:42 PM
the face is right at the top of the laptop screen
y'know, it's actually a lot better when it hasn't been strangely rotated.
 
sbi
@DeadMG Have you considered returning your mobile phone? I can't remember a pic you posted that one could see anything on.
 
@DeadMG Oh, right, that dark shape on the top.
 
@DeadMG hmm, that black shadow above the laptop does look suspiciously non-shadow like...
 
how odd
it still posts in portrait
even though it should be in landscape
:(
 
Ell
8:44 PM
anyone play a graphical dwarf fortress?
 
sbi
@DeadMG Yeah, that bed looks like a moon landscape.
 
@R.MartinhoFernandes oh whoa! I didn't even see the legs!
 
@sbi Then I'd have to pay moneys for a decent one :P
 
@Ell I've dreamed of such a thing
 
Here's a random question, can you find someone's IP if they're using a proxy? I'm doing a project on proxies
 
user1182183
8:44 PM
@Crowz yep
 
Ell
@MooingDuck I've just seen this: artgoblin.pl/df.php but not played it
 
user1182183
sometimes the browser can send some headers with this information
 
sbi
@Crowz Here's a random answer: mebbe.
 
@GamErix Wut.
 
it'[s actually pretty easy to see the dog if you view the full resolution
 
8:45 PM
@Ell oh, it's only slightly better than the defaults. You still have to learn what everything is, and they're forced to reuse sprites.
 
user1182183
@R.MartinhoFernandes or at least php got some "get real ip " function
 
but the reduced resolution version is, well, quite suck
 
user1182183
2
Q: PHP get real IP (proxy detection)

codexI do get track the "real" IP of an user, if he has an proxy wich sends the header of the real IP... does any of have a better solution, or even more headers? Since this function is used very often in the script, it has to be very fast, and it does not seem in that constellation :/ A few sugges...

 
@Ell That's the same thing, except with a different skin.
 
sbi
@DeadMG Ah, now that is a reason I understand. (FWIW, my phone's camera is crappy, too, but for some odd reason I thought you had an iPhone.)
 
8:46 PM
@sbi I do- an iPhone 3GS
 
@Ell that's effectively just a really impressive font. (Actually, That's the one I use)
 
Ell
ohh
 
sbi
@DeadMG That's an expensive piece of hardware, IIRC.
 
s/hardware/shit/
 
@sbi Not anymore.
 
Ell
8:46 PM
I want to find that font then :P
 
user1182183
Samsung S3350
 
user1182183
nothing special
 
plus, it would be a lot more expensive if I had bought it new
instead I bought it on the very cheap from my brother when he upgraded
 
Can a seam carver be effecient enough to run on a website?
 
@Ell it's "mayday's" font (Dwarf fortress uses custom "fonts", it won't work for anything else) dwarffortresswiki.org/index.php/…
 
sbi
8:48 PM
@DeadMG I don't think even an iPhone 3G was supposed to have a camera as bad as the pix you are posting here are suggesting. (FWIW, I have an Huawei Sonic, that cost me €128, so wouldn't complain about my phone. But yours...)
 
user1182183
 
@sbi Eh, it's worse than most of them. It's just very dark in that room, and the dog is also dark and well-camouflaged against the bed.
 
sbi
@DeadMG It must always be dark where you take pictures, no matter where you are.
 
Can you implement C++ programs on websites?
 
@Crowz Sure (not sure if you mean "can use use a web site to develop a program in C++" or "can use use C++ to write a web server", but either way the answer is yes).
 
8:52 PM
Okay well here's my thought
 
user1182183
@Crowz a web server is a program? :P
 
sbi
Oh, c'mon, let's stop pretending. You're brother hornswoggled you, @Dead.
:)
 
user1182183
and as for apps, you need to download exe files and run them on windows
 
@sbi Naw, I paid practically nothing for it, and the camera is mostly irrelevant for me.
 
I wrote a seam carving program, can I use it to resize a banner image on my site as the size of browser changes?
 
Ell
8:53 PM
df looks majorly complicated :P
 
user1182183
@Crowz uh, have a C++ web server instead of PHP?
 
sbi
@DeadMG Yeah, I basically expected you to say something like this.
 
@sbi I have nothing to take pictures of except my dog. GPS and mobile interwebs are way more important.
 
@GamErix I just have a website with my school right now
 
user1182183
@DeadMG call/sms ur GF not? : P
 
8:55 PM
@RichardJ.RossIII That's the worst Spanish I've ever seen. — NullUserException อ_อ 6 mins ago
 
@Crowz You could almost certainly rewrite your program to work via CGI (For one example) and invoke it from a web server. Whether you'd really want to is a whole different question. Whether any particular provider will let you yet another.
 
user1182183
@Crowz I suppose you are limited to what they offer.. asp.net?
 
@GamErix What gf?
 
user1182183
@DeadMG oh sorry, didn't know u didn't have one? :/
 
@JerryCoffin Banner looks ugly. I can't stand when something is aesthetically incorrect. Any other coding error is fine, but when it makes something visual look wrong... Oh God that drives me crazy
 
user1182183
8:57 PM
@Crowz what you want to achieve is probbly achievable with javascript...
 
@GamErix I have it done in java
 
user1182183
@Crowz so... how do you want to run C++ code from a browser, for resizing you need javascript or not? (at least for detecting if the window size changed?)
 
@Crowz Some servers (e.g., GlassFish) let you write extensions in Java, unless my memory's working even more poorly than usual today.
 
sbi
"I can't stand when something is aesthetically incorrect." Wow. That's a funny thing to say for someone who just got criticized for not even getting his whitespaces right.
 
@sbi That's text, text is not visual it's abstract
 
8:59 PM
@Crowz I can see text.
 

« first day (760 days earlier)      last day (4183 days later) »