« first day (413 days earlier)      last day (4535 days later) » 

12:02 AM
@DeadMG I'm here but I'm puzzled by sockets.
 
hmm
been thinking about my module system
I want to have a system where unqualified function calls can have their resolution guaranteed- i.e., if you do f(args), then you can guarantee that it resolves to a function either in the current module or in a module you usingd
 
Will it support unicode modules?
 
that's not terrifically important
 
Xeo
@DeadMG How could it resolve to anything else?
 
if some random other module defined it in the global namespace
perhaps I should just ban functions in the global namespace
 
12:18 AM
@DeadMG How about requiring everything to be a class?
You could have "static" classes inside other classes.
 
TIL that popup notifications are called toast in the world of UI design.
 
no
module != class
 
@KerrekSB Oh God. Please no.
 
Think about it, though. If everything were a class, you could also make the fundamental types into classes. Like "Integer" etc.
 
That is the single thing I hate the most about Java.
 
12:20 AM
Gone are the cryptic short type names
 
Xeo
@Maxpm Wait, what?
 
@CatPlusPlus still enjoying feeding the bottomless pit of knowledge?
 
In software engineering, a toast is a small, informational window displayed by certain kinds of software, especially instant messaging clients such as AOL Instant Messenger, Windows Live Messenger, XFire and Trillian. Toasts notify users of various kinds of events, such as reception of new e-mail, a change in a peer's availability, or a change in network connectivity. An ex-Microsoft employee of Google is credited with coining the term during the development of MSN Messenger, since Messenger's small notification windows slide upward into view, like toast popping out of a toaster. Goog...
 
0
A: C++ templates and code generation for Variadic Sequence: How to create similar code block for each argument/type?

Cat Plus PlusYou cannot overload functions based only on a return type, so no, it's not possible. If you take the argument names and my_class_function out of the picture, you're left with std::tuple<T0, ..., Tn>. You can use std::get<N> to get N-th argument then (but it's entirely compile-time co...

 
Xeo
@Maxpm Well, remembering that it pops up from below like a toast out of a toaster..
 
12:23 AM
@Xeo Yep.
I wonder if you could have a throbbing toast spinner.
It sounds dirty.
 
Xeo
12:45 AM
5 hours ago, by StackedCrooked
I think table flipping should be the idiomatic way for error handling in lolcode.
Actually, I think that should be the idiomatic way in every language. What is more exceptional than flipping a table?
2
#define throw flip

struct table : public std::exception { ... };
// ....
 
1:13 AM
posted on December 03, 2011 by Herb Sutter

The solution to GotW #101 is now live. Filed under: C++

posted on December 03, 2011 by Herb Sutter

JG Question 1. In each of the following statements, what can you say about the order of evaluation of the functions f, g, and h and the expressions expr1 and expr2? Assume that expr1 and expr2 do not contain more function calls.   Guru Questions 2. In your travels through the dusty corners of your [...]

 
PIMPL is like singletons - it's a code smell
 
Xeo
@Kerrek #define abusing using sounds nice. :D abusing namespace std; me really likes.
And I just noticed I made an error in the table-flipping message. should've been #define flip throw. :(
 
harhar u suck :P
 
Xeo
Was thinking of typedef syntax. Preprocessor sucks.
 
ever had a PIMPL explode in your face?
 
1:28 AM
no, typedef sucks
 
Xeo
well, yeah, the new aliasing syntax is certainly nicer
 
@KerrekSB i've done a bit with linux sockets...why?
 
@cHao I'm struggling to estimate the maximum throughput
I have this basic echo server...
the server sits in a busy loop (or select() loop) and bounces everything right back
 
k...
 
(select is actually better when running server and client on the same system; seems to be a good opportunity for context switching.)
the client floods messages; after each message it blocked-receives the response
 
1:34 AM
select is generally better anyway, unless you have poll or epoll
 
Now I have no idea how much throughput I can expect.
@cHao Even for one single connection?
So I can do 100000 packets in over 4 seconds
(8 byte each, TCP)
That feels abysmally slow
But now I did ping -f localhost -c 100000, and that also takes over 4 seconds!
 
800KB in 4 seconds?
 
So... is TCP just that slow?
Yeah. Bear in mind I have tiny packets
This isn't a bulk throughput test
It's a latency test rather
Point is, I seem to take between 100 and 200 microseconds for a single send/receive
 
it's not insanely fast, but it shouldn't be that slow. are you sending and then waiting for a response, or sending them all then reading responses?
 
This is on localhost!
Send-then-wait
so it's while(true) { send(...); recv(...); } on the client
Am I missing something really important?
E.g. should I use a select loop on the client, too?
Given that even ping can't do much better (and that's just ICMP), I have a feeling that that's just how IP works
 
1:38 AM
tcp (by default, i think) likes to store up data into bigger chunks before sending it out, in order to minimize traffic. it's called nagle's algorithm, iirc, and disabling it tends to improve performance when you're sending lots of small packets
 
@cHao Ahh, yes, that's the sort of information I might need.
Disable all buffering and flood control
 
800kb in 4 seconds isn't that bad, you know
my Internet connection at my parent's house is worse than that
 
An unrelated problem occurs when I try to open many simultaneous connections. As long as I open 100 or 150, it takes about 5ms. But when I try 200 or 300, the server freezes entirely and only permits new connections after about 2 or 3 seconds.
 
That's really irritating. Is there some sort of SYN limit?
(I already did sudo sysctl -w net.ipv4.tcp_max_syn_backlog="10000", enabled tcp_low_latency and disabled SYN cookies)
@DeadMG On localhost?
@DeadMG Over Gigabit ethernet?
 
1:41 AM
oh
 
(A real connection is even slower, btw, about 14 seconds for 100000 packets.)
@cHao Ahhhhh. Thanks! Let me test that baby.
 
there's a listen backlog, which may be different than the syn backlog (i'm not sure)...but last i heard, there was a hard-coded max to it
 
If anyone wants to try ping localhost -c 100000 -f and see if they do better than 4 seconds...
@cHao I got listen() called with backlog 10000
Ah, a hardcoded max is plausible
 
root@web2 [~]# ping localhost -c 100000 -f
PING localhost (127.0.0.1) 56(84) bytes of data.

--- localhost ping statistics ---
100000 packets transmitted, 100000 received, 0% packet loss, time 7034ms
rtt min/avg/max/mdev = 0.004/0.008/0.125/0.006 ms, pipe 2, ipg/ewma 0.070/0.005 ms
root@web2 [~]#
 
Wow, 7 seconds
@cHao This appears to make no difference at all :-(
 
Xeo
1:50 AM
root@void:~# ping localhost -c 100000 -f
PING void (127.0.0.1) 56(84) bytes of data.

--- void ping statistics ---
100000 packets transmitted, 100000 received, 0% packet loss, time 60641ms
rtt min/avg/max/mdev = 0.000/0.065/45.806/0.502 ms, pipe 3, ipg/ewma 0.606/0.035 ms
On VirtualBox xD
 
(Though I'm not really sure when to call the setsockopt -- before connect? after bind? after accept?)
 
kinda looking like it. seems like a lot of wasted capacity, though...unless the ip and ethernet headers take up that much space
 
@Xeo My grandma delivers packets faster than that.
@cHao Well, clearly you can get 1GB/s actual throughput on the wire if you send large packets...
 
Xeo
Are you picking on my virtualbox?
 
@Xeo I'm sure it is beautiful on the inside...
Actually: ping localhost -c 1 gives me...
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.044 ms
#                                                           ^^^^^^^^
 
1:53 AM
close to it, anyway. but eh. even as slow as it is, the speed might make sense...i mean, headers alone are probably 90% or more of the traffic
 
Xeo
Yay for llvm make... I should've timed it.. :s
 
So that is 440 microseconds per round
No surprise after all
 
Xeo
PING void (127.0.0.1) 56(84) bytes of data.
64 bytes from void (127.0.0.1): icmp_req=1 ttl=64 time=0.096 ms
Just double your time! :D
 
it's still a bit of a surprise to me...lol...i didn't realize the network was that slow...
 
Xeo
But then I don't understand why the 100k packages took so incredibly long
 
1:55 AM
esp not to localhost
100k * 0.044 = 4400
if my math is right
 
damn
just realized I did a stupid design with my parser
 
Xeo
Okay, so youtube changed its layout... but still doesn't allow a middle-click on "Search" to open the search in a new tab..
 
:P
 
@cHao Well, 38B ethernet frame (though I think that's excluded from the "1GB/s" already?!), 128B IP header...
@Xeo I think you've got the sign of this competition wrong :-)
 
Xeo
:(
 
1:58 AM
don't count on anything being excluded from the "1GB/s". hardware makers luuuurve to exaggerate to a point just shy of outright lying
 
OK. Well, I'm happy to leave it at that. Now on to many simultaneous connections. I hear that epoll is better than select...
 
Xeo
"2TB external HDD!!" - "1.81TB free"
 
@cHao I've been wondering about this for the longest time
 
@Xeo "2TB external HDD!!" - "1.81TiB free"
They're not actually lying.
 
for a bunch of sockets, it is. select has a max of how many sockets it can watch
 
1:59 AM
I mean, it's "Ethernet", so patently the Ethernet frame header is implied in the medium -- it shouldn't be included in the payload!
 
Just being technically accurate.
 
It's like charging you the production costs of a bill of paper money.
 
Xeo
@RMartinhoFernandes :/
Still sucks, this double standard on units
 
@cHao just a handful, or hundreds of thousands?
Err, wait, you can only have 64k open connections anyway
 
over like....64, i think?
 
2:00 AM
@cHao Ohh
 
@RMartinhoFernandes The funny thing is that you can't blame them. Technically it's correct.
 
Another thing I was thinking (though the ping test seems to refute that) is that if the server and the client both run on the same machine, then if they're both in a busy loop, they might not get enough runtime
so I was wondering how one could encourage a context switch
I think select() already does that, so it might actually be better than a straight busy loop
 
i'd think sleep(0) ought to do it...but eh. haven't busy waited in a long time. and yeah, select blocks too, which would cause a context switch, unless there's a socket ready immediately
 
@cHao No, I do select with a {0,0} timeval.
 
eww. don't do that...lol
 
2:03 AM
Anything slower degrades the packet rate
I have AC, I don't mind the extra heat :-)
 
lol
 
Is there an intermediate between "zero" and "non-zero"?
Like, "zero, but context switch"
 
could set the timeout to 1 μs...i'd think that'd case a context switch
(i don't feel like finding the mu in character map...deal with it. :P )
 
Xeo
Let's call for @RMartinhoFernandes! He has it handy any time
 
2:07 AM
lol
 
I don't need the charmap for that now.
 
thanks :)
 
Xeo
yeah, I meant you have the mu handy
 
what...you learning apl? lol
 
@cHao Hm, that brought it up to 11s.
&mu;
&mu;
 
Xeo
2:08 AM
no μ for you
 
Hah, nice try.
Markdown wins.
 
Performance is actually better with 500 μs than with 1μs!
 
lol
 
Xeo
or not, depending on your perspective
 
I'd love to be able to use some nice entities here... and spoilers, of course!
>! Shhhh.
 
Xeo
2:09 AM
Spoilers, yeah
 
that's not terribly surprising. busy-waiting on the network is usually a pretty stupid thing to do
 
Xeo
Those would be nice
But it's half-easy to achieve
hidden
;)
 
@cHao No no, busy-waiting is the best option by far it seems. I mean, select() with {0,0} time.
 
There was a spoiler in this message. Find it.
 
@cHao busy-waiting? you mean like a long-running request?
 
2:10 AM
Worst is "microwaiting" with {0,1}
 
why are you sending a bunch of tiny packets, anyway?
 
@cHao It's a latency test
"generous-waiting" with {0,500} is in the middle.
 
"microwaiting" is basically busywaiting + context switching :P
 
@StackedCrooked No, busy-waiting means using CPU time to wait.
 
"Flood as much as possible with as little latency as achievable."
 
2:12 AM
then send more data. :)
 
I'm still fairly shocked at the 100kP in 4 seconds. That's the worst latency I've seen since HL2-Ep3.
 
yeah, that's kinda...eh.
 
@RMartinhoFernandes I meant "busy-waiting on the network" as mentioned by @cHao a few lines before.
 
I realized that integrating this stuff into mah compiler is going to be Hardâ„¢
 
but 100k pings == like 5MB + frame headers
 
2:14 AM
@cHao On the loopback interface! How many MB/s does that have?
 
i wonder....
one sec...testing something
 
I did some throughput testing on our product today and got 900 Mbps speeds.. At 1000 Mbps it got lossy. It was a back-to-back test (two interfaces on the same machine connected with an ethernet cable) with large packet size of 1504 bytes.
 
i got about 8s going to the network card and back
 
With small packets the throughput is much less.
 
yeah...with small packets there's more being sent in headers than in actual data
 
2:19 AM
@StackedCrooked Yeah, if you have full frames you're already in better shape. What protocol did you use? Raw ethernet?
 
@KerrekSB UDP
 
But small packets need less energy to accelerate! Send one byte at a time!
 
@cHao The bottleneck is on the receiving end. It must count the packets and the sizes in order to generate a report at the end. It must also differentiate the packets that do not take part in the test being executed.
 
lol
 
It uses BPF filters for that.
A higher packet / byte ratio means that more CPU processing is going on at the receiving end.
 
2:23 AM
> The best thing about UDP jokes is that I don’t care if you get them or not.
2
 
lol
 
My brain is melting. Some posted this link earlier; I'll look at that tomorrow...
 
That UDP joke seems to be an easy way to get starred around here.
I've seen it starred here at least three times now.
 
@RMartinhoFernandes Nano blogging. It's the future.
Only single characters
 
2:25 AM
@KerrekSB The future is quantum computing. I don't know if it's easy to accelerate qubits. Maybe it is, maybe it's not.
 
@RMartinhoFernandes no way, I posted the same thing earlier and got no love. But you know me, just keep going back to the well...
 
that's ignorant, imo
I hope quantum computing never comes to pass
 
@DeadMG Maybe it is, maybe it's not.
 
no
it's ignorant to want quantum computers
you'd be throwing the only useful known encryption algorithms out the window
 
Dammit! Get my joke and stop going all serious on me. Or not.
 
2:27 AM
@RMartinhoFernandes Will there be a CHAR_QBIT?
 
no computer security for anyone, ever
 
Don't say, "yes, and no."
@keithlayne Ah, that was you then -- it was much appreciated!
I was just not in a position to finish it and comment on it at the time, sorry
(And I haven't yet, short of learning about epoll)
 
like a Boss
 
It won't matter, we'll all be clones with a hive consciousness, so there will be no need for security
 
@KerrekSB It's an UDP joke, it doesn't matter if you missed it.
 
2:28 AM
@RMartinhoFernandes boo rescinded
 
@RMartinhoFernandes Enough stars for you for today
 
But since he retransmitted it, maybe it's actually a TCP joke under the guise of a UDP joke.
 
man, I forgot my whole implementation design
 
Hey, none of you slackers contributed to the ASTL topic! :-) Bring it on!
@RMartinhoFernandes Lake Eerie.
 
@KerrekSB I'm watching the videos as I have seen you recommend...but it's kinda no fun.
 
2:30 AM
@KerrekSB You lost me.
 
@RMartinhoFernandes Where does Dracula spend Halloween?
(See, that was a TCP joke.)
Or rather, a joke told via TCP. I trust you can do the recombining yourself.
 
chat logs may be the easiest way to explain TCP
 
@keithlayne Which ones? Oh, STL's videos? Theyyyy're Grreat!
@RMartinhoFernandes Argh, I need RST!
 
@KerrekSB clearly I'm part of the 99%, but even ol' me is competent enough with the STL to not really learn anything... so far . I've decided though to quit putting off c++11 and make it my default immediately.
@KerrekSB I want frosted flakes now. Damn you!
 
2:34 AM
Another trick to repfarm on : Give C++ answers to masquerading C questions:
1
A: Reading line from text file and putting the strings into a vector?

FailedDevSimplest form: std::string line; std::vector<std::string> myLines; while (std::getline(myfile, line)) { myLines.push_back(line); } No need for crazy c thingies :)

 
@keithlayne Sure, you don't always have to pay attention, and you can run the videos while you're ironing your shirts or whatever. The "advanced" series has more meat.
 
Hmm, meat.
 
@RMartinhoFernandes Ah, I just pasted an FPA to similar effect.
 
@KerrekSB I knew you would!
Oh, different question.
 
@KerrekSB where is the advanced series? was it linked on the wiki "celeb video" page?
 
2:37 AM
I think so.
 
@RMartinhoFernandes Shall I say, in the Advanced series there's more at steak. All those containers and their push and popcorn operations, that's only the entree. The advanced series goes past the crust and into the steaming heart of the matter.
 
@RMartinhoFernandes Yeah, that one is too short to warrant an FPA
 
@KerrekSB Poetry for carnivores, love it!
 
I'm The Boss
 
2:39 AM
You're managing pointers?
 
@KerrekSB thanks for the link. And whatever the other thing was.
 
indeed
actually, I think that what I'm trying to work through the logic of may even be two-star
 
that's not really fair, it's probably about eight star
I know what I want, but trying to put it in code or even pseudocode is rather hard
 
Yeah, girls don't transform well into pseudocode.
 
2:42 AM
rofl
was more thinking about my semantic analysis
I need to create a program which, when executed, yields the program which I want to execute
I'd need to start with a master list of functions, types, etc
 
@DeadMG You mean like a compiler? Or the lisp way?
 
uh, I've never used lisp, so I doubt that
it's more like generating a compiler
 
This one is a candidate for the Java FPA. But enough pasting for a day, there'll be more Java questions tomorrow.
 
Generating a compiler which will generate your programs. That's very meta.
 
its the only efficient implementation
not that much different to a jit, i guess
 
2:50 AM
A JIT doesn't generate a compiler.
 
it takes instructions of one form and outputs another
 
That's a compiler.
Not a compiler generator.
 
ok
 
You need a generate-compiler instruction.
 
yea
well, I'm fairly certain that I'm working on three levels
I've got to think about the code I'm hardcoding, the code I'm generating, and the code that that code generates
 
2:56 AM
Arrgh, annoying arrays again.
0
Q: using pointers to arrays in a function

user1060993I have declared a 2_D array as int array [NO_OF_ROWS][NO_OF_COL]; NO_OF_ROWS and NO_OF_COL are constants. I then have pointers *rowPtr and *seatPtr. I pass all of these to a function so I can save data from a binary file to the array along with an enumerated status as follows void loadArray...

 
mainly, I need to deal with metafunctions
auto library = LoadLibrary("Standard/Containers/Vector.dll");
auto vec = (Type*(*)(Type*)) GetProcAddress(library, 0);
func->ArgTypes[0] = vec(c->GetStaticType("Standard.String"));
 

« first day (413 days earlier)      last day (4535 days later) »