« first day (368 days earlier)      last day (4563 days later) » 

2:00 PM
not me
 
@LewsTherin MIT Scholarship + Financial Aid = $30,000
I still have to pay the remaining 50k
 
@LewsTherin the lower-level protocols are used simply to navigate the network and to provide a channel the application can use to send and receive data. They just ensure that sending data is possible. The HTTP protocol (or another application-level protocol) defines what data is sent, and is generally considered to be at the top of the stack
 
Anyway, University is still 3 years away. who knows I may win a billion dollar lottery and go to MIT anyway.
 
OMG, this job hunting is depressing
2
I'm running out of ideas
 
ah well need to study some more. My GCE O' Level Exams are in April. :( .
Bye
 
2:04 PM
@jalf I think I can remember that lol
@IntermediateHacker good luck
 
@LewsTherin Thanks
 
sbi
@TonyTheLion No ideas needed, just keep hammering at it!
 
@sbi that's what I do, but it seems an endless road...
 
sbi
@TonyTheLion I understand. My previous statement, however, still applies unaltered.
 
oh damn
 
sbi
2:09 PM
Good luck, @Tony!
 
oh thanks :)
 
Guys how'd you define a context?
who does Java EE here?
 
Java?? you make me sick!
 
lol
I'm going to hang out with my mates.
I'm getting the hang of it.
"I'm going to hang myself"
These are contexts right?
 
2:30 PM
I guess no one majored in English? lol!
 
this is a C++, not English grammar chat
 
Yes, but someone wants to understand a programming problem because of context
I think there is a class defined in Java EE RequestContext and he doesn't understand what that means..

Java

Dedicated to the discussion of the Java programming language a...
Seriously I think some of the names programmers use are questionable lol.
 
2:49 PM
Says the guy who named himself after a fictional character
 
aww come on
I didn't make myself clear. Variable, class names and so on
 
@jalf So the OS probably has some kind of map from handle to resource, I guess? And if the handle is a pointer, it doesn't even need a map, it just dereferences the pointer :) like in the case of FILE*.
 
3:05 PM
Yeah, but it is a file descriptor. So it uses some kind of table I guess. And that table holds a pointer maybe to the struct..I don't know
In unix I think that's how it works
 
@LewsTherin You don't know, and yet you can still use files without problems. That's the magic of abstraction.
 
It's an index into an array of pointers. At least, that's how a HANDLE works
 
@DeadMG Is HANDLE a Win32 type?
 
Yeah
They use it for files'n'whatnot
To, uh, HANDLE files, I guess
 
an index into the HANDLE table
 
3:13 PM
so the table is actually just an array of pointers? weird
 
HANDLE table is described in the Windows Internals book
 
From the book I am reading a table looks more like a map. Maybe an index of a map?
 
@LewsTherin what is name of book?
 
An array of T is just an efficient implementation of a dense map from integer to T.
 
@MrAnubis Computer Networking
@FredOverflow what does that mean.
dense map? :S
 
3:17 PM
A dense map is the opposite of a sparse map.
In a dense map, almost every possible key is mapped to a value.
 
I thought a map was like an associative array. ugh
 
@LewsTherin it's an ADT
 
It is
 
Associative array is another name, except it sucks, because maps aren't really related to arrays.
Also, woo, end of the day.
 
Associative array is a shitty name
 
3:20 PM
I guess..more like a relational database then?
 
Er, no.
 
No
 
lol
 
A map is the fundamental underlying structure
It isn't like anything - theyre like it
 
Relational databases are based on tuples and relations, not maps.
 
3:22 PM
How about the following definition: a map is dense if it takes more memory than an array that achieves the same thing.
 
Key-value stores are based on maps, obviously.
 
Sorry, it is a fundamental structure
 
Yeah I understand that.
But if they are not arrays what are they
 
Maps.
 
Fred, then all maps are dense... Really
 
3:23 PM
So if you put 1, 10, 1337 and 123456789 in your map, it is very sparse. But if you put 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 in your map, it is dense.
 
Lewd, fundamentally, it is a binary search tree
Usually refined into RB tree
 
Or a hash table.
 
@DeadMG Erm, no? Look at my last example with the four numbers. An array would take more than a megabyte.
 
@DeadMG I thought it was typically a hash table
 
3:24 PM
Depends on whether you need ordering, or not.
 
That's unordered map
 
std::map is based on trees, std::unordered_map is based on hash table.
 
@robjb Prior to C++11, there was no standard hashmap. Now we have unordered_map.
 
@FredOverflow I didn't realize we were talking about maps specifically in the context of C++, but good to know. :)
 
Other mainstream languages had standard hash maps long before C++.
Heck, Java had them since 1995.
 
3:26 PM
C++ map is RB Tree usually but depends on the implementation
 
Hash map is still a map, but map does not necessarily mean hash map.
 
unordered_map is an hash_table
right ?
 
C++ could have but wanted to keep the Standard library smaller
 
Batteries should be included, IMO. Because then you have those silly people saying "oh we don't want Boost/X, because it's big/not included/whatever, so we're going to reinvent the whole thing".
 
#include <batteries>
nice name for a library btw :)
 
3:30 PM
std::battery<N, Fn>, a wrapper for a function that can be called only N times before running out of power.
 
I definitely think more should be included, not less
 
#include <more>
// #include <less>
 
#include <me>
 
#include <genius>
 
Apparently, genius doesn't like fixed-size font :)
 
3:34 PM
More like, apparently genius is stuck on his phone
and there's no backtick
 
So you have nobody to scratch your back? :(
 
@DeadMG stuck on phone..... with Facebook glue?
 
Stuck on phone with lack of desktop glue
 
3:50 PM
@FredOverflow Could be both, yeah. The handle might be an array index, it might be a key into a map, or it might be a pointer to something (in your own or another address space)
 
Some guy would pay $30-$250 (£19-£160) because they "Project Description:
need some words put on a header image."
 
Windows handles are not pointers.
 
I'm hoping to get the job
I said I'd do it for $20 and it's a quick and easy $20 if you ask me
 
Installing GIMP probably takes longer than the actual job itself :)
 
Nothing is quick and easy when you have to do N versions before the client is satisfied.
And at the end you'll be doing something else entirely.
 
3:55 PM
@CatPlusPlus oh, I meant the general concept of a handle, not Windows HANDLE specifically :)
 
@CatPlusPlus But it's not gonna take more than a few hours
and seeing as I have NO job whatsoever
It's better than nothing
 
Well, they're usually not pointers. :P
No, wait, I'm not thinking.
@KianMayne Multiply the estimate by 4.
 
@CatPlusPlus Still
I'd probably end up procrastinating instead
 
If that's wrong, then I don't want to be right.
 
4:09 PM
LOL
 
4:25 PM
ha ha
 
4:39 PM
Mmmn there is something I don't get. I assume Skype uses a socket or some other other abstraction. All I know is it is assigned port number 80. For some reason other applications like apache can't use port 80 when Skype is running. Why doesn't the tcp create ephemeral port numbers for Skype or apache? Then port 80 is free
I think it uses tcp because apache needs tcp to work
 
4:49 PM
Er, what?
 
You can't use Skype and Wampserver apache together..they both use port 80...but if Skype is started first it blocks apache out
 
If you don't use 80 for Apache, it won't need 80.
 
@LewsTherin ephemeral?
 
Or for Skype. 80 is probably default to bypass crazy firewalls.
 
@jalf temporary or child ports?
@CatPlusPlus It is 80 by default I think.
 
4:52 PM
@LewsTherin apachye is a web server. That means it serves HTTP content, which uses the underlying TCP protocol. So yes, it ha to use TCP
 
What's "child port"? All ports are "temporary".
 
An ephemeral port is a short-lived transport protocol port for Internet Protocol (IP) communications allocated automatically from a predefined range by the TCP/IP software. It is used by the Transmission Control Protocol (TCP), User Datagram Protocol (UDP), or the Stream Control Transmission Protocol (SCTP) as the port assignment for the client end of a client–server communication to a well known port on a server. On servers, ephemeral ports may also be used to continue communications with a client that initially connected to one of the server's well-known service listening ports to make th...
 
and since apache is a web server, it defaults to serving on the port that browsers connect to by default
HTTP uses port 80 by default, so that's the port apache tries to use if you don't tell it to use a different port
and as @CatPlusPlus says, skype probably uses the same port because it's a free ticket through most firewalls
 
@jalf but since tcp sees that port 80 is being assigned to a connection, why does tcp not create a new port?
 
@LewsTherin because those applications specifically ask for port 80
If you ask for port 80 to be opened, then it's no use if the OS goes "oh sure, here's port 48491"
 
4:54 PM
@jalf I'm :S I thought it was the tcp that handles all that, and not the application
 
If application wants to bind listen socket to 80, the network stack (not TCP) cannot give it anything else, because that misses the point.
 
you can either say "give me a port", in which case the OS will find a free port for you, or you can say "give me port N", in which case it gives you port N or nothing
 
Ephemeral ports are usually used only for outgoing connections.
 
most (client) applications just say "give me a port", because they don't care which port they're using. But servers typically need to listen on a fixed well-known port
It's no good hosting a public web server on port 81. Every browser in the world is going to try to connect on port 80, so if the server can't get port 80, you want it to error out, rather than continue running on the wrong port
 
oh right I think I understand. so servers prefer to listen at a specific port and if it is already in use, it wouldn't work unless I specify another port
 
4:56 PM
Well, that wouldn't be a problem if browsers implemented SRV record lookup.
:P
 
@LewsTherin yeah exactly
@CatPlusPlus you know, if browsers could be relied on to implement everything that's sensible, the world would be a very different place ;)
 
@jalf But once a server is allocated the port 80, it can then create an ephemeral port to handle all incoming requests.
 
@LewsTherin yeah, but it still needs to keep port 80 open to listen for other requests
 
@jalf I meant it can create ephemeral ports for each incoming request, leaving port 80 free to handle other incoming requests..ugh sounds convulated
 
@LewsTherin yeah, that's how a lot of servers do it
 
4:59 PM
The incoming requests are already handled through 80.
 
@jalf I guess clients don't use ephemeral ports because they don't listen at a specific port?
 
@LewsTherin exactly :)
 
Right it kind of makes sense. I wish I could start programming, but I don't understand this api :(
 
what, for sockets? There's like two billion tutorials available online :)
 
@jalf lol that's true but how they are written doesn't make sense to me
For example, we have a struct object I believe holds the IP address.. then a function is called to assign the strings to null characters. Except that the function takes a char* a pointer to a char
 
5:04 PM
@LewsTherin no one said it was a pretty api ;)
you just have to close your eyes and follow along
 
Yet they do `termin((char*)structVar,sizeof(structVar)) `
How does that work? (char*)structVar does it return a pointer to a member string in structVar?
 
networking code is always ugly. That's a universal fact of life :p
 
@jalf lol they should be made pretty :)
 
what does that have to do with sockets?
 
That function takes a pointer to a character (a string)
@jalf It clears the arrays that holds the Ip address so it can be a null terminated string. From what I understand
 
5:06 PM
The Berkeley sockets application programming interface (API) comprises a library for developing applications in the C programming language that perform inter-process communication, most commonly for communications across a computer network. Berkeley sockets (also known as the BSD socket API) originated with the 4.2BSD Unix operating system (released in 1983) as an API. Only in 1989, however, could UC Berkeley release versions of its operating system and networking library free from the licensing constraints of AT&T's copyright-protected Unix. The Berkeley socket API forms the de facto st...
has nice simple code examples of client and server
For Windows the function names are different (they're prefixed WSA, iirc), but it's basically the same api
and I guess that's one reason why it isn't "made pretty". It's one of the few apis that people have actually been able to agree on across practically all platforms ;)
 
@Jalf that is actually the api I am using ;) I will post a code question that bothers me
 
@LewsTherin don't expect me to help you. I've always tried to keep away from network code
 
Als
Holler
 
@jalf It isn't network code :) At least it should be "basic" C
 
it has sockets,doesn't it?
 
5:10 PM
@jalf not in this example
struct myStruct
{
    int n;
   char str[12];
}myStruct;
bzero((char*)myStruct,sizeof(myStruct.str)) ;
Am I right in saying a pointer to myStruct.str is returned and passed into bZero
 
does that compile?
 
yeah it does, I don't know how
 
Als
what is bzero?
 
also what is this mks thing? Looks awful ;)
also on the page you linked to, it says that bzero is deprecated in favor of memset.
 
What is mks? bzero assigns each element in a string to null character
 
5:13 PM
@LewsTherin the mks toolkit thing you just linked to
 
@jalf that explains why memset was used in Wiki
 
apparently the API you're using
for some reason
 
I think it just happens to host the api. I am using BSD
 
although I don't see why.
 
@jalf I have to lol
#include<iostream>
using namespace std;
struct myStruct
{
    int num ;
    char myName[12];
}myStruct;
void bZero(char *s, int N)
{

}
int main()
{


   bZero((char*)&myStruct,sizeof(myStruct)) ;
}
That's basically what I think it looks like... I don't understand how bZero((char*)&myStruct,sizeof(myStruct)) ; works
 
5:15 PM
that makes two of us. I'm pretty sure it doesn't
 
Als
bZero is a function!
 
@jalf I'm telling you, it compiles lol..
@Als yes it is :)
 
oh, there's a & now
next time you want to ask us how code works, could you please just copy/paste the actual code
rather than rewriting it over the next 8 edits?
 
Als
lol
 
well, the way it looks now, it just zeros out the entire struct.
you take the address of the myStruct object, and cast that to a char pointer, because that is what bZero expects
 
5:17 PM
@jalf yeah sorry :(
 
so you have a char pointer pointing to the start of the object
 
Als
@LewsTherin: Why do you think it should not compile?
 
and bzero zeroes out a chunk of memory starting from the pointer specified in its first argument, and with the size specified in the second argument
where you give it the size of the object
so you're just telling it to zero out the object
 
@jalf so in the function it does something like *s = 0 ; If we take this struct
struct myStruct
{
    int num ;
    char myName[12];
    char myNames[12];
}myStruct;
s points to num? so it does *s=0 ; num is 0 then s++ points to myName ?
 
if s is the char pointer, then no. s++ would make it point to the second byte of num
 
5:23 PM
yeah that's true
 
I'm not sure why this was starred twice
3 hours ago, by Tony The Lion
OMG, this job hunting is depressing
 
ok when the pointer gets to myName 32 iterations later. s points to myName it also assigns the 12bytes to 0
 
it's not a happy fact
 
Als
@TonyTheLion: Oh Hola
Long time
 
yea been kinda busy, being social mostly and lacking huge amounts of sleep
 
Als
5:25 PM
Social sounds good
 
sbi
@TonyTheLion It's not only the happy and funny sayings that are good.
 
@sbi lol, I still find it a weird thing to star
 
Als
@sbi: Hello Mr Grumpy!
 
sbi
@TonyTheLion I think it might have been starred by those who know the experience, no?
 
@sbi I guess, possibly yea. Never looked at it that way
 
Als
5:27 PM
Apparently, someone thinks everything you say here is said as a joke
 
I just star anything that I agree with or which is amusing, most of the time
 
sbi
@Als What I forgot to ask you the other day: What about that downvoting idiot? From how you suddenly reacted it seemed the thing was resolved. What happened? Did you get your rep back? Do you know what happened to him?
 
doesn't have to be a nice hapy statement
or happy, for that matter
 
oh lol
 
Als
@sbi: I didn't get my rep back, but this happened:
Foo Bah, New York, NY
1 1 6 29
 
5:28 PM
@jalf: how are you doing? Haven't seen you around for a while?
 
Als
He got banned for a week
 
or was it me that wasn't around???
 
@TonyTheLion been busy with work and all sorts of things
got a friend living in my living room too, which makes me spend a bit less time at the computer :p
 
@jalf oh good for you :)
 
sbi
@Als Ah. Well, it's not that it really hurt your rep, is it? And it's good he had been slapped for misbehaving. I'd be very interested what happens when he comes back tomorrow.
 
5:31 PM
@TonyTheLion dunno, wouldn't mind getting my apartment to myself again, but she needs a place to stay temporarily, so... :)
 
@jalf hehe
 
Als
@sbi: No it didn't hurt the rep as much, it was just a nuisance that had to be dealt with.Thanks to you it was done so.I wonder though,most of the mods(except @TimPost) seemed very disinterested about pursuing to resolve this.
Atleast one of the Mods tried to act as an defence lawyer instead of Police, which was kinda disappointing.
And I am sure this person would create some ruckus on Meta when he comes back,whenever.
 
@Als So why was this Foo Bah person mad at you?
 
Als
@Praetorian: Because we had an argument over an answer of mine.
 
Wow, talk about petty reasons!
 
Als
5:38 PM
:) A user with 6k+ rep indulging in such practices
 
Not 6k+ anymore, or will he get his rep back when the ban ends?
 
Als
Yes,He will get it back
But atleast the mods know the existence of this bad apple from hereon.
 
True
 
Als
The whole thing was pretty much an nuisance and disturbing actually.
 
Als
5:43 PM
@TonyTheLion: expecting the payload now that you sent out the metadata.
:P
 
this ^
 
Oh no, hipster attack.
 
Als
lulz
 

« first day (368 days earlier)      last day (4563 days later) »