« first day (796 days earlier)      last day (4135 days later) » 

11:00 AM
more or less
 
ah, I'm not planning to test it any further :)
 
lol
ITT lab penguin rebels.
 
I just created a vm to try installing steam, just to see how many games were supported
 
Oh boy. Our customer has borked the import of their SSL certificates. And their resident PKI admin is on leave. Haha. Leaves me to try and help them get their public facing web site(s) operational again
@jalf In a vm?
 
@jalf ¬_¬ why didn't you just check on the site?
@sehe It can wait till Monday
 
11:03 AM
@sehe yep
 
Hi all
 
@thecoshman because I wanted to check how many of my games. :)
 
@thecoshman haha. That's what I asked. I have a lunch meeting now. Oh well, I'll just grab some sandwiches and don my selfprofessed troubleshooting hat
 
@sehe top or bowler?
 
@Saeid87 hi
 
and plonk!
 
user142019
@Saeid87 You have UB. Also scanf is terrible.
 
user142019
And where is chWord.
 
oh I am just bad in C :(
 
user142019
May 2 at 18:35, by FredOverflow
@MooingDuck How would I know? This is Lounge<C++>, not LOUNGE_C.
 
11:10 AM
We don't want your crap
 
damn
I was just about to do that
 
user142019
lol
 
plonk ALL the idiots!
 
user142019
Input sucks.
 
Write ALL the programs without input
 
user142019
11:11 AM
You have to parse and validate it. :^(
 
wait...
users suck
 
user142019
@TonyTheLion Careful, you're talking to a user here.
 
We're all users. You suck.
 
user142019
You're all abusers.
 
87
A: Why does a C program containing a function prototype with no parameters (compared to the actual function definition) compile?

Tony The LionIn C func() means that you can pass any number of arguments. If you want no arguments then you have to declare as func(void). The type you're passing to your function, if not specified defaults to int.

dafuq do I have so many upvotes for this???
 
11:18 AM
Because it's a weird thing many people are not aware of.
 
user142019
Because it is correct.
 
heh, lol
 
what he said
 
@Zoidberg'-- That has never been a reason to have that many upvotes.
 
plus, it's a nice short answer
 
11:21 AM
 
in 1 day?
 
No love for medium length posts :(
 
@TonyTheLion repwhore
 
right
 
@irrelephant fuck, didn't notice that
 
11:22 AM
@LuchianGrigore :)
 
need to finish proving those noobs on the Committee wrong and showing a shared_ptr that can safely convert to unique_ptr.
 
@Pubby Train analogies help.
 
@Pubby the frequency distribution is a mirror image
 
@StackedCrooked ?
 
5432
A: Why is processing a sorted array faster than an unsorted array?

MysticialYou are the victim of branch prediction fail. What is Branch Prediction? Consider a railroad junction: Image by Mecanismo, from Wikimedia Commons: http://commons.wikimedia.org/wiki/File:Entroncamento_do_Transpraia.JPG Now for the sake of argument, suppose this is back in the 1800s - before...

 
user142019
11:24 AM
@StackedCrooked s/Train/Railroad junction/
 
@DeadMG only if you only have one reference to it though, I assume you mean
 
@thecoshman No.
 
user142019
I like my Chromium theme.
 
@DeadMG so you want to take an object that can have many things sharing ownership, and one of those shared owners will some how take sole ownership, whilst the others still have shared owenership
2
yeah, those standard guys are so stupid ¬_¬
 
@thecoshman No. The unique_ptr will still share ownership.
 
11:28 AM
@DeadMG shared_ptr<T> ptr = get_it(); auto unique = make_unique<shared_ptr<T>>(ptr);?
 
@DeadMG how is that unique owner ship?
 
@thecoshman It uniquely owns one strong reference.
 
what do you propose happens when the unique_ptr goes out of scope?
 
I don't think it is terribly useful though.
 
@thecoshman The same as when the source shared_ptr goes out of scope.
@R.MartinhoFernandes The principle use is that you can take unique_ptr<T, Del> and accomodate any ownership scheme.
 
11:30 AM
shared_ptr goes out of scope => reduce ref count, possible delete
unique_ptr goes out of scope => delete
 
or unique_ptr<T, std::function<void(T*)>>
 
Only if Del is a std::function.
 
@thecoshman Custom deleter.
@R.MartinhoFernandes Nah. Implementation-defined for shared_ptr.
 
to what end though?
 
i.e., Del should be a template param.
for a compile-time abstraction over ownership
 
11:31 AM
And yeah, I still don't see much use.
And you don't need to modify shared_ptr.
 
you want to abstract ownership to the point where, you don't even see if you have sole ownership or shared ownership?
 
Couldn't you just take a Ptr if you want any ownership scheme?
 
@thecoshman You mean, "If I want to use the same ownership scheme as my caller".
 
I want ptr_traits
 
11:32 AM
Take a Ptr.
 
@Pubby Presumably, only if template.
 
1 min ago, by DeadMG
i.e., Del should be a template param.
@DeadMG Not a problem.
 
2 mins ago, by DeadMG
or unique_ptr<T, std::function<void(T*)>>
 
nah, I still fail to see the point in this
but buy all means carry on
 
besides
the Committee didn't say it was useless, they said they couldn't see how it could be implemented
so all I need to do is implement it to show them up :P
 
11:34 AM
@DeadMG Because they are thinking of something entirely different.
 
ah, it's not often you get to solve architectural problems by calling rand() :)
 
that's what makes it all the sweeter
@jalf lolwot? What architectural problem did you solve with rand()?
 
@jalf what? you crazy man!
 
We have a setup with a number of clients trying to establish a VNC connection to a server, so that each client gets its own VNC session running on a unique port on the server. To avoid having to punch too many holes in the firewall, we have a small helper process listening on one single port, which forwards to the appropriate session on the server
With our old client, we just send a port number first, basically telling this helper process "please forward me to this port".
 
When you are writing such a function, how do you know the caller's ownership scheme is an acceptable fit?
 
11:37 AM
With the web-based client we're working on atm, we can't do that, so in a few corner cases, the helper process will have to guess at which session to forward to
 
@jalf ... no machine?
 
@R.MartinhoFernandes Unique ownership of a custom resource can be made to fit any ownership scheme.
 
which it does by calling rand()
@thecoshman huh?
 
@jalf oh well, first, are you connect to linux machines?
 
@thecoshman the server runs linux, yeah
 
11:39 AM
coworker is learning C++ on the job
uh oh
I should give him my C++ book
 
user142019
Tomorrow, PHP and Java will finally be gone for eternity.
 
@jalf then no machine, afaik, is the way to go. it will allow you have one open port, and many people can connect, each getting there own session, even with the same details
 
@thecoshman "no machine"?
 
virtualization?
 
11:41 AM
no
well... I guess you could call it that
 
why can't they just describe what it is on their website?
 
basically, you can run this on a headless server, one that is not running x. and people connect to it using the client and get full desktop, sort of like VNC, but each client gets it's own session
 
anyway, every session needs access to the GPU, so we can't virtualize. Also, the session is created separately, before the client connects
 
user142019
> Since its official launch onto the market in February 2003 NoMachine has establised itself as the choice in the Enterprise's decision for remote access and terminal services in its migration to the Linux platform.
 
So we are trying to match a client to an already running session which already exists on some specific port
 
11:43 AM
@jalf hmmm... not sure how well that could work... what you using the GPU for?
 
@thecoshman 3d rendering :)
 
user142019
@jalf But why can't the web-based client do that?
 
@jalf as in 3D art work rendering? the sort of thing you can send off to be job queue, the sort of thing that does not actually require GUI?
 
@thecoshman no, live realitime 3d rendering. Render to a framebuffer, which is presented to the client via vnc
 
user142019
Seems odd that a web-based client cannot do something a non-web-based client can.
 
11:45 AM
@Zoidberg'-- because websockets
 
what ever you are doing, I am sure you have over-engineered a very complex solution to a problem that didn't really exist in the first place
 
So what's the problem with this code? Something with VLAs, but I have no idea why it considers it a VLA?
 
user142019
Can't you handle those specific things on the server-side of the web client?
 
@jalf but with multiple clients all connect at once? seems.... strange
 
The web client uses websockets for the vnc connection. The websocket protocol specifies that if you want encryption, the TLS handshake goes first, so we can't send a port number, and then enable encryption
 
11:46 AM
@TonyTheLion Mark n as constexpr
 
user142019
@TonyTheLion use int constexpr, not int.
 
user142019
int constexpr n = size / 2;
 
@thecoshman no, clients don't connect at once, just occasionally whenever someone needs to log in and do stuff, they connect a client
 
@jalf but you could have more then one at once?
 
@Zoidberg'-- that doesn't fix the errors though
 
user142019
11:50 AM
Also, @TonyTheLion, you have infinite recursion.
 
@thecoshman yep
 
@TonyTheLion How about placing the *s before the argument names?
 
hmm
you think this would be enough of a sample?
 
anyway, we've had 3-4 people thinking about this since august or something, and trying to come up with a better solution. Trust me, we know it's ugly, but there really isn't a better approach (which doesn't involve half a year of work, and huge changes that would break backwards compatibility and risk introducing lots of new bugs)
 
@jalf well, not to sure how good noMachine would be for the real time rendering... not sure where it actually does the rendering side of things
 
user142019
11:52 AM
@TonyTheLion I don't know, really. Try std::array. :P
 
user142019
C-style arrays have a terrible syntax.
 
@thecoshman it looks like they provide their own X server too, which would probably cause lots of breakage too :)
Oh, and it doesn't actually solve the problem, because the X server is really an implementation detail. What the client sees is a VNC server
 
@jalf I've never had problems running things in it though
 
the VNC server just renders whatever goes on in the X server
 
@jalf well, if you used nomacine to connect to the server, you would not need to use VNC at all
@jalf yeah, but the rendering is done on the server that you connect to. the rendered screen is transferred, not instructions on how to render it like with x. I don't know how no machine does it, but I suspect more like a conventional x setup
 
11:55 AM
@thecoshman but we already use VNC for other reasons, and it'd be nice to keep both client types running the same code path as much as possible
 
0
Q: Still combating multidimensional arrays

tuan longI've put forward two issues with multidimension array before, I'm really appreciated those who had helped me with it. Now there's still a not fixed bug in my codes like the one showed below: #include "Algorithm.h" template<int size> void strassen_matrix_multiplication(int (*A)[size], int ...

"my codes", "my codes" everywhere.
 
user142019
MASS NOUNZ
 
@jalf so... how does VNC fit in here, is it just a tool to work with the server, or are you actually transferring data/commands through the connection?
 
user142019
@Griwes . . . and it's being downvoted into oblivion.
 
Anyway, nomachine wouldn't solve the root problem: if two clients connect from the same IP to the same IP/port, it's impossible without any additional identifying information, to know which session to connect it to :)
 
user142019
11:57 AM
@TonyTheLion:can you tell me your email address.May be it's better to send the total codes to you in a email. — tuan long 10 mins ago
 
user142019
roflcopter
 
@jalf well, with nomachine, you get your own session, and you log in as a user, so they can each just keep their own session running
 
@Zoidberg'-- ain't getting things downvoted into oblivion the whole point of linking stuff here?
 
user142019
@Griwes lol
 
you still get to connect to one ip/port even for multiple connections, I believe it automatically passes of the ephemeral ports
 
11:58 AM
@Griwes:Thanks for your advice.I'm working hard in it. — tuan long 13 secs ago
 
@thecoshman but the session can't be created at connect-time. It is created previously (by a third party), and the client has to connect to it
and the session is not simply keyed on username. Multiple users can access the same session, and the same user can have multiple sessions etc
it's complicated :D
 
user142019
People y u no keep software simple.
 
@jalf that sounds very strange... would it be too extreme to reverse the flow? they make an initial session, and run a script that configures this session for them?
the session can be kept alive between uses
 
Of course, if we rewrote the whole thing from scratch, we could simplify the stack somewhat, but that would be a lot of work
 
@jalf nah
simple as pie
 
user142019
12:00 PM
We had to work on some complex and terrible code base once and rewriting the whole thing was our dream.
 
it's how I earn my pennies :(
 
user142019
We inherited a code base written by morons. :^(
 
@thecoshman well, these sessions run on one machine in a cluster. The sessions are created by a separate manager process which monitors the cluster, and decides which machine should host new sessions. So the client authenticates against this manager process, and gets back information on which ip/port to connect to to reach the session that was created for him
 
@jalf it this third party actually one of your own tools? something that you could modify your self, say to dynamically create a user and send it to you?
 
@thecoshman yeah, it's our code
 
12:02 PM
hmm...
 
it's also something we don't want to fiddle with too much because if it isn't 100% stable, it causes a lot of problems
 
all the more reason to change it then
 
That wouldn't really change anything in that regard
 
can you trust the users to connect to the machine they are told to?
 
sec, phone
 
user142019
12:04 PM
user image
3
 
@DeadMG I think showing use cases would be a lot more convincing than an implementation.
 
@R.MartinhoFernandes that sounds too sensible for the puppy :P
 
The implementation is not complicated at all, once you know what the fuck you want to implement.
 
user142019
Hmm. I'm wondering how to accept TCP connections in Erlang.
 
You know, theoretical work with no attachment to reality is starting to sound tempting
No build systems
No IDEs
 
12:05 PM
ITT Cat's gone full bananas now.
 
lunch time :D
 
I've been thinking about languages again
 
user142019
Oh I need to use gen_tcp. Thank God it has a decent interface.
 
What's that square
 
12:06 PM
A banana. Your browser/font selection sucks.
 
Yes, it does
 
user142019
 
Chrome still can't do font fallback
It's apparently too hard
 
@thecoshman In theory no, but it doesn't matter, because each session is password-protected, and when you authenticate, you get a password to connect one specific session. So if you try to connect to any other, you'll get a password mismatch :)
 
(Just steal the code from Firefox already)
 
12:08 PM
Anyway, enough about that. Like I said, we really can't see a plausible alternative. I just wanted to brag about getting to use rand() in a "serious" context :D
 
🐱 is 🍌🍌. 😉
 
@R.MartinhoFernandes Normally, I'd agree, but the Committee seems to think the other way around on this particular item.
 
user142019
@jalf We once used rand in a school project but that was a terrible hack.
 
I still think the implementation they say is hard or not possible is for something entirely different, but well. Do go on.
Unless I still don't understand what you want.
 
@R.MartinhoFernandes The whole point of what I'm saying is that they got the semantics wrong and therefore their arguments about implementation inability do not apply.
 
12:12 PM
Yes, but you did not show them the right semantics.
(The fact that they are still asking you if what you want is X or Y should be a hint)
 
user142019
We used rand() to generate a unique random number, using a while loop to check if it wasn't already taken. gist.github.com/4344961. Obviously, after 999999 orders it would loop forever and query the database server to death.
 
well, at first, I didn't even realize it had already been proposed, let alone under the wrong semantics
but those other two guys, you're right in that I am not entirely certain if they understand the semantics I propose
 
god, how can Alexandrescu spend over an hour talking about three optimization tips?
Is there anything surprising in the vid?
 
@jalf Which one?
The one with the Expected thing and the ScopeGuard crap?
 
@R.MartinhoFernandes vimeo.com/55639112
No clue what's in it. That's what I'm asking :D
 
12:17 PM
> Aw fiddlesticks! This video can't be played with your current setup.
 
because I don't really want to spend an hour just to find out if any of the three tips is something I don't know
 
Haven't seen that one, so can't help you.
 
C++ Templates: Y U NO OBVIOUS?
 
I'll watch it in a few minutes
@TonyTheLion Problem?
 
Also what's so bananas about not having to deal with shitty tools eh
 
12:21 PM
15 mins ago, by Cat Plus Plus
You know, theoretical work with no attachment to reality is starting to sound tempting
Coming from you, I think this is clear indication of banananess.
 
Why :v
 
@jalf The video is terrible. You cannot even see the slides properly, and that sucks balls since large portions of the slides are actual code.
 
I found the video to be reasonably watchable.
And the performance tips were mostly me.
 
@StackedCrooked ok, so what's in it? :)
anything we don't already know?
 
> This does not seem to be a compelling case. It's not clear what semantics it is supposed to have and how it can be implemented.
@DeadMG see? Told ya.
 
12:27 PM
@StackedCrooked You were the performance tips? :o
 
Compile 64-bit, but prefer to use 32-bit integers. Array indexing with 32-bit index is faster than pointer arithmetic. Erm, what else..
 
@jalf Well at around 17:30 he explains how we should use array instead of pointer indexing which is something we have figured out yesterday on our own :)
 
Take strength hierarchy into account.
The slides are online btw :)
@AndreiTita You did?
 

Iterating arrays by indexing or with pointers

22 hours ago, 1 hour 10 minutes total – 189 messages, 15 users, 6 stars

Bookmarked 6 secs ago by R. Martinho Fernandes

 
@StackedCrooked There was this little discussion. Some interesting information came out of it (like stackoverflow.com/questions/13955162/…)
Cool thanks, I didn't know how to do that.
 
12:31 PM
@DeadMG I can't figure why this doesn't compile argggghhhh
 
IIRC Alexandrescu explained that it's an aliasing issue.
 
0
Q: For float a: Does a*0.0 == 0.0 always evaluate true for finite values of a ?

MartinI was always assuming that the following test will always succeed for finite values of somefloat: assert(somefloat*0.0==0.0); In Multiply by 0 optimization it was stated that double a=0.0 and double a=-0.0 are not strictly speaking the same thing. So I was wondering whether this can lead to ...

 
@TonyTheLion Array refs.
 
wut?
I just want to learn why this doesn't work... I don't want to use std::array or whatever, just the plain C way.
 
@StackedCrooked Our testing showed little to no difference under GCC (it generates identical assembly for the loop bodies). VisualC++ once again revealed how awesome it is by not vectorizing the version with pointers.
It's all in the bookmark anyway.
 
12:33 PM
@StackedCrooked He said that if you use pointer arithmetic the compiler can't optimize because it can't assume the pointers don't overlap, which is pretty much what we saw.
 
@R.MartinhoFernandes yeah, in most cases I wouldn't expect it to make a difference, but using array notation does make the compiler's job a bit easier :)
of course, given a sufficiently smart compiler, it'll make no difference
 
@TonyTheLion What I mean is that the functions should take array refs.
 
@TonyTheLion The error message is quite descriptive.
 
Maybe.I don't want to think about it right now.
 
@TonyTheLion Just use explicit template parameters
 
12:35 PM
@jalf that's a big "if" :)
 
your specialization of strassen_matrix_multiplication takes int, but you try to give it an int[1][1].
 
@DeadMG not descriptive enough for a noob
 
in addition
your specialization will likely never get referenced, you need to refer to strassen<n>::strassen_matrix_multiplication.
 
@StackedCrooked Which is why the advice is relevant :) When given the choice, and if performance matters, prefer array notation
 
@R.MartinhoFernandes Agreed. Also I forgot that GCC actually optimized both.
 
12:41 PM
So, I need a list of character names in French and German. I asked on the Unicode mailing list if there is one. Now instead of actual translations I have a non-native English speaker arguing that there is no use for character names in a language other than English, and a native English speaker arguing otherwise.
 
Crazy, innit?
lol, I got a hat for posting on December 21st.
 
What's the url for the online gcc - assembler Alexandrescu mentions in his talk? I can't make it out.
 
@R.MartinhoFernandes I agree that there is no use for character names in a language other than English.
 
I wonder how a screen reader should read 🍌, then.
 
@R.MartinhoFernandes FF doesn't even display it
 

« first day (796 days earlier)      last day (4135 days later) »