« first day (757 days earlier)      last day (4200 days later) » 

7:00 PM
skill has nothing to do with it
 
Oh but I'm TERRIBLE haha
 
so are most of the people who ask questions here
 
This guy is a one man band... I'm in awe...
 
Really? Seems like most people are really advanced
 
7:02 PM
@user1150599 Quite.
 
@user1150599 It's not about silly questions. They're ok (they might be closed). It's about asking bad questions or simple questions in a bad way: by not showing any search effort, or by not showing exactly what your problem is. By including lots of irrelevant code. Things like that. Oh and saying "please" or "give me the code". I'm pretty sure you didn't do all that, but these are the kinds of things that lead to downvoting, and rightfully so
 
Wait, can you not reference arrays like in java in C?
buff[i]="q";
 
why are you using C?
 
Because it's a project for school.
 
and that syntax is perfectly legal if you have a const char*[]
 
7:07 PM
char buff[200];
 
nubbery
for one, 200? MAGIC_BUFFER_SIZE much? You're just hoping that's the right size?
and secondly, "q" is a C string, a const char*. buff[i] is a char. These two types are not the same.
 
Yeah, I'm doing socket operations
Sending messages over a buffer which are then written to a file
But there's such much bugs
 
oh, well, if you have an I/O function that returns X bytes, I guess.
 
Yep, sends 200 at a time
For some reason, it's appending a few weird characters every 200
 
probably fail null termination
 
7:10 PM
Hmm, could you explain?
One second, I can show you a picture of it
Running it on $script now
 
@R.MartinhoFernandes: are you present and accounted for?
 
lol
@DeadMG What's up?
 
wanted to write a trial version of that random-access UTF-8 thing
don't suppose you have some UTF-8 encoding and decoding code I could steal?
 
cheers
 
sbi
7:16 PM
@DeadMG I can attest that he's present. Whether he's accounted for is another matter, though.
 
https://gist.github.com/4055946
That's what I get when I transfer a text file. Lots of weird characters in there.
 
Xeo
@sbi Is he emptying your alcohol stock again?
 
sbi
@Xeo Nothing left.
 
I believe you, Robot
 
7:18 PM
lol
 
@TonyTheLion It was the first thing I noticed too :)
 
are you tarnishing the robot's repute again? :P
 
Do the characters "àÎÝvÿ" have any significance in C arrays?
 
@TonyTheLion Ok made me google the exact meaning of tarnish, as well as check whether 'repute' is actually a noun. Check on both accounts. I'm not. Others might
 
> ihm / es: you use when somebody does something with a dead thing
 
7:22 PM
@user1150599 mostly means you have junk in your array
 
@user1150599 ?! They might not be single-byte characters. In fact, I rather doubt there is a codepage/encoding that does
 
Xeo
Btw robot, got a new rented apartment already? Or a real one?
 
So, "ihm" and "es" are used for necrophilia in German?
 
Junk in my array? Hmmm. I can't seem to get rid of it.
 
@R.MartinhoFernandes "es" = it, "ihm" = (to) him
 
7:23 PM
@R.MartinhoFernandes erm.
 
Xeo
@R.MartinhoFernandes Wow, that's wrong.
 
@sehe I know. Sigh.
 
@user1150599 Null termination.
 
@user1150599 did you put something in?
 
Yes I did. I have the scripts right here: gist.github.com/4055946
 
7:23 PM
@R.MartinhoFernandes That's a laughable description though
 
ihm is just him with the letters rearranged
 
@user1150599 C scripts?
 
Nah, UNIX
 
Those are ANSI escape codes or something.
 
@user1150599 Where? I see nothing but raw terminal dumps, really
 
7:24 PM
I ran a script command in unix on client (ftp/client) and server (ftp/server), and that's the output.
 
@R.MartinhoFernandes some of it.
@user1150599 see ansifilter for the esc[...; codes.
 
@R.MartinhoFernandes you're sighing a lot tonight
are you ok?
 
rebirthing
 
I don't quite know what you mean, sehe
 
7:25 PM
I just did $script and ran the program on both sides
 
Xeo
@TonyTheLion He's probably wrongly blame and accuse the ape for it.
 
@Xeo oh
 
@Xeo No. I am waiting for a reply to know when the one I went to see the other day will be available.
 
@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.
 
7:27 PM
And meanwhile spamming some more.
Just in case.
 
Oh yes, you're right sehe
Would you like to see the loops?
 
@user1150599 the code, rather.
 
The code is very long, but okay
 
@user1150599 It's looking like a fairly simple client server thingie.
 
hmm
I wonder how std::deque avoids invalidating it's iterators when it's moved.
 
7:29 PM
~133 client, ~333 server
 
@DeadMG It does?
 
good point
well, I want to implement that functionality :P
but it's going to be funbuckets
 
@user1150599 numberoffrigginbytes, LMAO
 
I think I'll have to implement a proxy object or some BS like that.
 
Xeo
@R.MartinhoFernandes Don't all std containers except string preserve the iterators after moving?
 
7:32 PM
What's different about string?
 
Xeo
SSO
 
Oh yeah I was getting pretty damn frustrated hah, been working on this for a week
 
Xeo
same for std::swap on strings
 
@user1150599 no null-termination here:
 
yeah
 
7:32 PM
I hate these fucking ads that start playing randomly when you go on certain websites
FUCK YOU SHITTY ADS!!
 
you couldn't implement SSO if you had to preserve iterators on swap or move.
 
Xeo
std::deque just moves pointers, same as with vector, so I don't see why it shouldn't preserve iterators.
 
        numberoffrigginbytes=fread(buff, sizeof(char), sizeof(buff), afile);
        status = sendMessage(data_socket, buff, strlen(buff));
^ add a null terminator at buff[numberoffrigginbytes] = '\0'? @user1150599
 
So like this? :
numberoffrigginbytes=fread(buff, sizeof(char), sizeof(buff), afile);
buff[numberoffrigginbytes]='\0';
status = sendMessage(data_socket, buff, strlen(buff));
 
hmm
I could implement them as a buffer*, index pair.
then simply random-access into that buffer*.
would break as soon as you mutate the container, though.
 
Xeo
7:34 PM
What, deque-iterators?
 
@user1150599 check that buff is large enough (max size +1), but yeah, basically that
 
@Xeo It's not exactly the same, but similar.
 
strlen(buff)+1 on sendmessage, then?
 
@user1150599 don't get too excited - there are probably (a lot) more errors :)
@user1150599 Nope. strlen was getting confused because there was no null terminator, it was basically running wild after the end of the buffer
 
Oh there are
 
Xeo
7:35 PM
@DeadMG What about pair<deque*, unsigned>? :P
 
The sockets seem to never close and it's painfully frustrated
 
@Xeo Would break the instant you move the container.
 
Xeo
No, wait, that'd break on move
 
@user1150599 that's a networking FAQ related to binding TCP ports in UNIX, probably
 
Xeo
I see where your confusion with invalidation came from, now.
 
7:37 PM
Yeah, when I do put then recv one after the other, it locks up
 
I think that buffer*, index will do.
then I can simply say "Mutate the container at your own iterator-related risk."
 
@user1150599 there's a time_wait status. I think it is 30 or 60 seconds. Google for workarounds
 
Xeo
Btw what exactly is different? No map of buffers but a single continuous one?
 
each array is a variable size
instead of fixed
 
Xeo
mhm
 
7:38 PM
Does read return where it is in the document, or will it return between 0-200 every time (the number of characters read in) ?
 
so I've basically used std::vector<std::vector<T>>.
 
Because I feel like I need an int that keeps track of where I am in the document
 
@user1150599 also, note that there are C library calls for pwd (getcwd IRIC) and rm (unlink(2))
@user1150599 between 0-200. RTFM: linux.die.net/man/2/recv
@user1150599 calculate it yourself :)
 
> <sortiecat> What we really need is being able to override the ; operator.
 
foot in mouth
 
7:40 PM
yeah, like I'll keep an int total_bytes and total_bytes+=numberoffrigginbytes ?
 
@user1150599 I'm not sure when you'd need it, though. Is this some kind of homework? Reimplement a dumb ftp server in the most insecure fashion?
 
Indeed
I am a noob programmer
 
Xeo
@DeadMG: VC's deque-iterators atleast do seem to store a pointer to the parent deque
Now I need to double-check the invalidation thing.
 
Alright, now the problem with appending a '\0' is I think that the loop is interpreting it as an end of file and terminating
 
@Xeo You can avoid that problem with a proxy object, but it's a mess.
 
7:44 PM
no it isn't. the null isn't even getting sent. You'r probably seeing one end crash with a segfault
Try running with valgrind
 
Indeed, #11
Valgrind?
 
@user1150599 No that's sigpipe, right
 
Segmentation fault #11
 
valgrind.org - sudo apt-get valgrind. Then valgrind ./clientftp etc
 
Is that a debugger?
 
7:45 PM
@user1150599 okay I misremembered
@user1150599 a memory checker. Can also invoke debugger: valgrind --db-attach=yes
 
Xeo
@DeadMG Yeah, seems to be what they do.
 
What is a memory checker, exactly?
 
wtf
I thought that
 std::array<unsigned char, 1> buff { static_cast<code_unit>(u & 0x7F) };
was supposed to be legal now
 
That's narrowing conversion if code_unit is bigger than uchar
 
7:49 PM
@CatPlusPlus I actually didn't define it (whoops). But MSVC gives local function definition error, rather than undefined type error.
just bad error message?
 
Uhhh that seems really complicated
 
Xeo
Most likely.
 
MSVC is terrible
 
surprised much?!
 
lol
 
7:50 PM
@user1150599 If you plan on having a career or really become a programmer, you will need to learn to use such tools. A large part of programming is debugging.
 
I don't think I can get a job as a programmer hah I suck at it
 
maybe I should just go down the proxy object route for iterators
 
@user1150599 Well nobody is born with the knowledge needed to program or the skills. If you want it, realize that everybody once was a beginner. Just keep at it.
 
@user1150599 that's what I thought when I started, yet, I now write software as a profession in C++. So it can be done, when you dedicate yourself to it. :)
 
Programming sucks your soul
 
7:52 PM
I dunno man, I've been doing it for 2 years and I've only gotten this far, pretty pathetic imo. In 2 years of art I could make full Chuck Close style portraits
 
go do some gardening :)
 
@CatPlusPlus And that's why not everybody is meant to be a developer.
 
@Chimera I was born with both knowledge and skill.
 
@DeadMG lol
 
@DeadMG Prodigy!
 
7:53 PM
why
when I was just a tiny little thing at three years old, I wrote a program that could automatically insult my siblings
3
what more could I need?
 
Xeo
@DeadMG: Yep, VC's std::deque allocates a proxy object.
 
@DeadMG Indeed!
@user1150599 Do you have the passion and desire to be a software engineer?
 
@Xeo Then I can just define end() as size() + 1
 
Then you probably need to reconsider the path you are on.
 
7:56 PM
Unfortunately the only things I've ever been okay at are art, writing, and film. Can't get a job with that.
 
Because I don't know any GOOD developers who aren't passionate about software and at least like to write software.
@user1150599 Graphic artists are constantly in need. It's the fine artists that don't get jobs.
 
@user1150599 Cause there are no rich filmmakers, amirite?
 
@DeadMG Huh? How are 'rich' and 'job availability' related here?
 
well, those guys had to start from the bottom like everyone else
so there must be a bottom to start on.
 
I don't know, I've always felt mentally incapable of grasping anything mathematical or... logical.
 
7:58 PM
@user1150599 Worry not. As Einstein said, "Do not judge a fish by it's ability to climb a tree."
 
Yeah I'm just saying, I don't think I'll ever be good at programming
 
you wouldn't want to let down Einstein, would you?
 
@user1150599 using it isn't really complicated. Neither is passing -Wall -pedantic to the compiler
 

« first day (757 days earlier)      last day (4200 days later) »