« first day (2076 days earlier)      last day (2889 days later) » 

10:08 PM
Just finished day 2 of a 16-hour Andrei Alexandrescu course on "Modern C++1x Design". The guy really loves to abuse templates and macros in very interesting ways.
 
M A C R O A B U S E B O Y S
 
He implemented a thread-safe container with transactional semantics using a combination of reader/writer locks, variadic templates, and variadic macros.
 
The compiler must love it.
 
I hope he comes back for the optimization class. There's enough demand for it in the company.
 
Compile times don't matter
the longer the better, so less work is done at runtime
 
10:17 PM
Not according to my latest Sol2 issue.
 
The guy has an SO account with like 1k unclicked rep.
 
He doesn't mind sacrificing performance for better compile-times.
 
@ThePhD tell'im 'e's dum'
 
Fix'd
 
@Mysticial wow he came to tech you guys in person?
@Mysticial yeah, he's not afraid to use all the tools in the box
 
10:28 PM
@набиячлэвэлиь You just had to comment on the issue, didn't you. :v
 
someone used google cloud and bsd?
 
@StackedCrooked It's a big company. Had about 100 people in there for yesterday and today. 16 hour class.
 
I don't know who's pulling the strings, but it looks like there's "significant desire" to get him to come back for a single day 9-hour session on performance.
 
10:33 PM
Hmm, performance
 
The cool part is that he offered to get me a beer when I was the only one in the audience to be come even remotely to being able to answer this question:
Given:
unsigned x = 123;
long y = -654;
What is the type of: auto z = x * y?
 
long?
 
He was ranting mixing signed and unsigned stuff.
 
I can see why it would be confusing.
Since signed usually gets promoted to unsigned when using types of same size.
 
@StackedCrooked Nobody had an answer for that. I sorta blurted out that it might depend on whether unsigned and long are the same size.
 
10:37 PM
Hm. Didn't consider that one.
 
But I couldn't give an answer for each case - since I didn't know the promotion rules well enough.
And he was like. I owe you a beer!
 
Nice :D
 
Hey guys, just a random thought - how did you guys learn dynamic programming? As in, what approach do you guys have in solving a DP problem in a given amount of time(like an interview)
I can do them, but it takes me a while to come up with the correct way to implement it. Meanwhile, some people can realize the solution within 3-4 minutes.
 
@StackedCrooked The guy offers a ton of (short) courses. It looks like the 2 day one we got was a combination of a bunch of them.
 
nwp
10:54 PM
@OneRaynyDay I had to look up dynamic programming. It sounds like its a thing until you realize that it means to break down complex problems into less complex sub-problems. That is the arguably the essence of programming. I will never understand why this has a name. I cannot imagine anything that is not dynamic programming.
 
@OneRaynyDay Haven't you studied those in uni?
 
@nwp Yeah, you're right in the sense that breaking complex problems into less complicated subproblems is just programming, but
imho, I think it's more like the fact that the subproblems answers would not be changed as your subproblems are "surrounded" by bigger more complicated problems
 
It has a name because it's an optimisation method, like linear programming
And has little do with the other term
 
@Shoe You see, I wanted to take the algo class next quarter, but my enrollment time random number god is not very nice to me
 
Isn't DP basically aggressive caching of calculated values?
My algorithms class is pretty far away.
 
10:57 PM
Something like that yeah
 
therefore I can't take it next quarter, even though I really want to learn algorithms, so I'm trying to learn it by scavenging whatever I can find online.
@EtiennedeMartel Yeah pretty much from what I've read
A lot of times it's like taking a matrix of possible states, but some other times it's not necessarily like that
 
Ell
@EtiennedeMartel it seems that way to me
 
@nwp Dynamic programming is much more specific than that. It's not just breaking the problem down into sub-problems, but of defining those sub-problems so they can be memoized and composed. Consider a (nearly) textbook example.
 
@sehe I recall he showed funny.com, funnybuy.com or something like that. He logged in to it!
@JerryCoffin This is the core of the value of SO.
 
@JerryCoffin I see, but as you can see the top commenter
just was able to "do" it. His explanation was totally understandable and concise
but what was his thought process in constructing that matrix?
For a simple dp problem like this I could probably figure it out after writing on a notebook for a while, but for more complex problems like speeding up TSP is much harder to think of the solution(that one took me almost 2-3 days)
 
11:19 PM
@OneRaynyDay To the best of my recollection, Vaughn is a sharp enough guy that his being able to just "do" it doesn't really indicate a lot. I'd guess he recognized this as a classic example of DP, and just implemented it based on already having a pretty solid idea of the, or at least one, right approach (just about like I did).
 
LNK1104	cannot open file 'E:\Documents\Visual Studio 2015\Projects\_Sandbox\Debug\_Sandbox.exe'
 
how in the hell... the file doesnt even exist =/ Most questions about this error are like "lol it sstill running just kill it"... well i cant run an exe that doesnt exist now can i
 
@JerryCoffin I see... so all it takes is practice?
 
@Borgleader Working out of dropbox or lack of permissions?
 
11:24 PM
@OneRaynyDay I'm not sure about all, but it sure helps.
 
@JerryCoffin gotcha :)
thanks man! I'll just go find some more problems then
 
@ThePhD No dropbox, and I dont know why I wouldnt have permissions, I did last time I opened that damn solution... its my scratch solution whenever i wanna hash something out.
 
@OneRaynyDay Have fun.
 
@Borgleader vOv Just recompile and hope for the best.
 
I did, no change. I even restarted VS.
 
11:29 PM
Will do - hoping to get the google internship this fall :)
 
Who the fuck puts error checking code in a benchmark
If I turn on my error checks my performance goes to shit because I SPECIFICALLY DO LOTS OF SHITTY CHECKS
wadhawdjhfahgaw Fucking
Fuck this repo
I need to get my own shit online already
 
So I was watching this: youtube.com/watch?v=92WHN-pAFCs
which shows how the existance of a machine that solves the halting problem would incur in a paradox
But I have a doubt
Isn't that like saying that you can't determine whether a statement is true or false just because if you would, then if you take "this statement is false" you can't determine if it's true or false?
 
@ThePhD Also, its capable of writing the .pdb in that folder so clearly it has permissions.
Stupid antivirus, i shut it off for 2 seconds and guess fucking what
 
@Shoe This isn't about saying whether a statement is false, but a way of determining whether any possible statement is true or false. And yes, statements like "this statement is false" make that impossible.
 
@Borgleader Lel
What Antivirus do you use?
 
11:41 PM
@JerryCoffin So, in theory you can solve the halting problem in some cases, but not always?
 
@ThePhD I'm seriously considering switching, I've also found out it does some shady shit inside ntdll.dll and its causing my apps to crash unless I put them in the exclusion list.
@ThePhD Bitdefender
 
@Borgleader Just get Windows Defender or whateve rit's called these days
Comes bundled with Microsoft and actually performs better than most antivirus.
It also doesn't stick its foot up your program's ass.
 
kinky
 
@Shoe Exactly. It's trivial for a huge number of programs. You run them, and they halt, so you've proven that they halt. But if you run them for a while, and they haven't halted, it's essentially impossible to determine whether they never halt, or just haven't halted yet. In theory, I could run it indefinitely, and store each machine state as its entered, then check that state against all previous ones to determine whether it's entered a loop.
 
@jaggedSpire ;; Why must you arrive at precisely this moment.
 
11:45 PM
:3
 
@ThePhD I know when I'm unwanted, and that's the moment I arrive
:3
 
In reality, that's completely impractical though, because 1) it uses too much storage, and 2) it causes a massive slow-down, and 3) "indefinitely" is obviously a long time. Even using a few hundred bits, and programming it to count from 0 to N, it runs longer than the age of the universe before it finally overflows and repeats.
 
There's a disco channel for that qq
 
@ThePhD oh dear it seems that quarantine is no longer effective :3
 
@JerryCoffin But if you take like an Agda program, for example, which is not turing complete AFAIK, you know for certain it will always halt
 
11:47 PM
@jaggedSpire Do you have printer genes?
 
@Borgleader I don't get that reference so I'm going to agree
 
and here I thought it was a sci-fi reference
 
@Shoe Yes, in Agda it's trivial to assert that all programs halt because that's part of the definition of the language.
 
@Borgleader that is amazing
 
11:53 PM
@JerryCoffin nice
 
@jaggedSpire Unfortunately, it's grossly inaccurate. Printers most assuredly do not smell fear--that's clearly impossible. They only smell the hormones that are produced by the human body in reaction to the experience of fear.
 
lol
 
0
Q: Get_IP_info freebsd c++ function

Markchar g_szPublicIP[16] = "0"; char g_szInternalIP[16] = "0"; bool GetIPInfo() { struct ifaddrs *ifaddrp = NULL; if(0 != getifaddrs(&ifaddrp)) { return false; } for(struct ifaddrs *ifap = ifaddrp ; NULL != ifap ; ifap = ifap->ifa_next) { struct sockaddr_in...

 

« first day (2076 days earlier)      last day (2889 days later) »