« first day (1565 days earlier)      last day (3609 days later) » 

15:00
No @lightNNess already I got rejected.. But I'm just curious only I can't do this in 10 mins — user3403111 54 secs ago
lightNNess
lol
Autocomplete 2hadr
whenever such a challenge appears
I brute force everything
Isn't there a straight forward way of finding all the combinations of a particular set of numbers? Like... my mind is fuzzy but permutations? combinatronics? something like that?
if I were in that interview
I'd have generated all possible sums and selected those that equaled what was requested
and called it a day LOL
I'd also write a brute force algorithm. I couldn't come up with anything better in 5 minutes
Robot already linked the problem
It's a lot harder than just enumerating all possible combinations
@AndyProwl It's a well-known NP-complete problem.
user1804599
Woooo.
15:03
I could probably come up with a half-assed solution for it, but if I was in the interview I'd mostly just name drop it.
user1804599
A thunderstorm.
He doesn't even state if it's subarray or subsequence :|
@CatPlusPlus By "a lot harder", you mean "doing it with better complexity"?
@AlexM. That's really bad, though because that runs in supra-polynomial time. (It's an NP-complete problem!)
@R.MartinhoFernandes Ok, didn't know that.
15:05
@R.MartinhoFernandes shrug
@AndyProwl More like "doing it with any useful complexity".
Enumerating all sums stops being practical very very fast.
People fight about functional programming because the fights are completely predictable, parallelize trivially, & also have no side effects.
@R.MartinhoFernandes What's the name of the problem? For curiosity's sake :)
@Rerito I linked it in comments.
In computer science, the subset sum problem is an important problem in complexity theory and cryptography. The problem is this: given a set (or multiset) of integers, is there a non-empty subset whose sum is zero? For example, given the set {−7, −3, −2, 5, 8}, the answer is yes because the subset {−3, −2, 5} sums to zero. The problem is NP-complete. An equivalent problem is this: given a set of integers and an integer s, does any non-empty subset sum to s? Subset sum can also be thought of as a special case of the knapsack problem. One interesting special case of subset sum is the partition problem...
15:06
@BartekBanachewicz why would a series of truths about functional programming be a reason to fight about it?
@R.MartinhoFernandes I see what you mean, although for inputs of small size, one may just be ok with the simplest solution.
very small size.
right
especially if the optimal algorithm is much more complicated (as Cat seems to suggest)
I bet this was a plot by the company
they keep asking interviewees that
in hopes that someone will come up with a linear algorithm
so they can patent it
That is very likely to happen, yes
15:08
no I'm serious, I'd still come up with the closest thing to brute force
@AlexM. Hopeless...
something is better than nothing
(in an interview)
@AndyProwl Not very complicated, though. Can be solved reasonably with dynamic programming.
The DP on this one is kinda elegant
@R.MartinhoFernandes Now I need to look up what dynamic programming is
15:10
You should.
something about divide et impera
> dynamic programming is a method for solving a complex problem by breaking it down into a collection of simpler subproblems
(It's an OR term, mind you; the "programming" in it doesn't mean what you think it means)
blah blah, put subsolutions together
isn't this just reductionism?
That's how I solve all problems. I'm a dynamic programmer! :P
is the binary search considered DP
it's an example of divide et impera that I know for sure
@AndyProwl The main idea is to increase the spatial complexity by storing intermediate results for subproblems to decrease the time complexity of the problem resolution
lol algorithmic design patterns
user1804599
@AlexM. No. Binary search is not considered double penetration.
15:11
sorting algorithms?
quicksort is also divide et impera IIRC
user1804599
Quick, sort!
so DP means divide et impera?
@AndyProwl It's not just that.
Quality jokes all around
15:12
For example computing factorial using DP => You store the first values of n! in a table to have later a quick access
@AndyProwl Dynamic Programming
@AlexM. yes that one
user1804599
@Rerito Memoise !!
divide et impera is a term for splitting a problem in multiple subproblems
@R.MartinhoFernandes Reading through
15:12
and combining the solutions to get the final solution
That misses the important idea of overlapping subproblems.
@рытфолд Doesn't DP rely on memoization?!
@Rerito Think I get it now
Ohoooo but people who are working in that company must have cleared these kinda questions rite — user3403111 4 mins ago
> The dynamic programming approach seeks to solve each subproblem only once, thus reducing the number of computations: once the solution to a given subproblem has been computed, it is stored or "memo-ized": the next time the same solution is needed, it is simply looked up
@Rerito ^ apparently
15:13
nope, I got my 2nd half of the interview completely broken
minus the code that was pretty and understandable <3
and still got the job
@AndyProwl Template Metaprogramming!
god so many botched merges
Fucking git
Autoresolving shit badly
en.wikipedia.org/wiki/… - first paragraph might help
@Rerito yes
I need to find a switch to stop autoresolving
15:14
it is often explained like having a vector of solutions
you calculate sol[0]
and you move on to sol[1] based on what you got so far
and so on
But as stated @R.MartinhoFernandes, subproblems need to be overlapping
I think I get what Dynamic Programming is, but the name is terrible
user1804599
Static programming ftw.
@AndyProwl The name comes from OR.
OR?
15:16
@AndyProwl dynamically building solutions
@рытфолд That's utopia. You have to move at least your fingers.
seems appropriate
@Rerito Yes, but not necessarily memoization as it's typically practiced. Most memoization is like caching--you decide on some maximum number of previous results to store, and throw out anything other than that. In DP, you often have a very specific set of previous results to save, such as the best result starting from point X, or finishing at point X, or something on that order.
@Rerito Operations research.
@R.MartinhoFernandes That means Overload Resolution to me
ah
15:17
@JerryCoffin I think I get what you mean though I've not yet come across an "exotic" case where some intermediate results were omitted
Not experienced enough!
@R.MartinhoFernandes wasn't that "Operational Research"?
or perhaps I'm mistranslating it from my mother tongue
2
A: Dynamic programming sum

Jerry CoffinThe usual phrasing for this is that you're looking for the value closest to, but not exceeding K. If you mean "less than K", it just means that your value of K is one greater than the usual. If you truly mean just "not equal to K", then you'd basically run through the algorithm twice, once findin...

@LightnessRacesinOrbit The only pieces of MLP-related merch I own are two t-shirts and two pint glasses.
@R.MartinhoFernandes I still don't get why "dynamic"
@Rerito As written, this does actually keep all the intermediate results, but it arranges the data in rows, and only uses the two most recent rows of the table.
15:19
@JerryCoffin I've pinned it. Thanks for the heads up :)
@AndyProwl The basic idea is that instead of attempting to just solve the whole problem at once, it builds the problem dynamically, and produces a solution (or set of possible solutions) at each step of building up the problem (and each solution is based on the previous solution).
@JerryCoffin "Incremental" or "multi-stage" seems more apt to me
@MarcoA. Both work.
@Andy solving this problem was how I grokked it, : web.archive.org/web/20130220232313/http://uva.onlinejudge.org/…
@AndyProwl Dunno. I learned it in OR class as a counterpart of LP, linear programming.
15:25
Apparently he picked it to make it sound acceptable to a guy who hated research
Optimisations ain't fun
> He was Secretary of Defense, and he actually had a pathological fear and hatred of the word research. I’m not using the term lightly; I’m using it precisely. His face would suffuse, he would turn red, and he would get violent if people used the term research in his presence.
@AndyProwl ...and mathematics.
I really don't think I can find a way for dynamic programming to not make sense
11 mins ago, by Alex M.
@AndyProwl dynamically building solutions
what more do you need?
is the "programming" part that throws people off?
15:28
> Time limit: 3.000 seconds
like e.g. in functional programming?
That's a thousands separator right?
Ah, the program has to produce the correct result within 3 seconds?
@AndyProwl Yes.
15:29
I see
@AlexM. That still sounds super-ambiguous to me
and partly redundant
IIRC brute force was actually enough at some point, but then they increased the input sizes and you had to switch to DP.
(how can you "build" something statically?)
@AndyProwl @JerryCoffin
@Nooble Actually, you should probably call him God until you offer some virgins in sacrifice
Fixed it.
T'was a typo.
Somehow my browser auto-corrects "Jerry Coffin" into "God".
@AndyProwl These virgins, do they have to be female?
15:32
i cant write unit tests to save my life... ugh why is this so hard
Thinking is hard
@Nooble And hot
@Pris it was a joke
@Nooble self-sacrifice is not an option
I found the bug in my code, I had to delare std::vector<xAOD::Electron *> electrons = el->GetParticle(); first and then use std::count_if on this vector
15:33
@ArneMertz lol
How about LRiO?
he's not a female
Also not an option
@BartekBanachewicz what part? was it supposed to sarcasm alluding that functional programmers never fight?
@AndyProwl (Shhh)
15:34
still I'm not sure why it didn't work in the first place
@Pris it was supposed to laugh at all discussions about FP boiling down to the same arguments
@Nooble you don't mess with God, you know
@ArneMertz I don't think he accepts marsupials.
Actually, do they have to be human?
Or of the wasp kind?
@drkg4b does el->GetParticle return a temporary? then it twice will give you two different vector objects whose begin and end iterators don't define a proper range for find_if
15:36
snack overflow
I might start teaching on another uni soon
@BartekBanachewicz Sounds fun.
@Nooble Human, female, and hot. Actual virginity isn't particularly important.
Space oddity
@Nooble I'm not sure about that yet
it'd mean allocating my time
but then again, it's a pretty cool experience and a nice CV addition
15:37
@ArneMertz yeah, most probably that's it
the fun part is that I'd actually be finishing my studies at the same time :d
@CatPlusPlus i like testing stuff where its easy input/output... but 'behavioural' testing with longer procedures feels pretty aimless
@Pris see that's why FP
everything is easy input-output
Everything has input and output
@BartekBanachewicz agreed, testing stateless functions is wonderful
15:38
So I'm running an Unturned server, and there is one massive memory leak.
@Pris stateless -> contextless. And not even that actually, because purity is more important.
@CatPlusPlus Black holes are write-only.
There are stateful pure functions in Haskell and they are also quite easy to test
@JerryCoffin So are btrfs partitions!
@CatPlusPlus black holes are more fun (and exotic) though.
15:39
so who here listens to Alphaville
im trying out catch though and its really nice (github.com/philsquared/Catch)
@BartekBanachewicz Apparently not many (or maybe they just don't listen to you).
@Pris so 2014
@ArneMertz yeah, that's definitely that, thanks I didn't know, next time I will be more carefull!
Good morning. Can some one confirm if my understanding is correct please. If I have the following code
 enum
{
      checkForValidComponent = 1L
};
then does the L signify it's of type Long?
15:42
You're missing a semicolon.
@MyDaftQuestions rtfm
fail
I can't find it in the manual
don't start this again
@MyDaftQuestions that's not the semicolon you were looking for
15:44
D'oh
the exact same question exists on SO
@MyDaftQuestions again? You mean this isn't the first time?
Ah I see
I had found answers but they said string literal
confused me more
hence me asking
@MyDaftQuestions How the fuck could a direct answer confuse you more?
because I can't get my head around a literal being a number
15:46
wat.
to the shameboard with you
unless my English is bad
isn't literal a word for word?
Literal is a word for literal.
Jeez.
so a string literal
means a word
The answer explicitly says "integer literal".
@MyDaftQuestions no
15:46
holy shit....
sorry for bad word
It means specifically that: a string literal.
meaning it is literally a string
So, this is implying that a string may not literally be a string
@MyDaftQuestions No problem. We tolerate the use of "literal", to some degree.
and in fact could be some rope
to hang myself with...
The meaning of string literal is string literal, since that's literally the name of the thing "string literal" means.
15:47
please don't agree or encourage that thought ha ha ha
Yes, my previous sentence was tautological and is indeed meant to confuse you further.
I will never undertstand that sentence :(
let me Google tautological, hang on
@EtiennedeMartel ahaha MLP pint glasses
What outlandish language is your native one if you don't know the word "tautology"?
15:49
Isn't that the word for the thing in virtually every language?
English :)
Right, I'm off. Thank you though
Next time a word troubles you... Look it up in an online dictionary
C++ is really fucking cool you guys
4
@DonLarynx the oracle has spoken
15:53
@DonLarynx As PITA pieces of crap (i.e., programming languages) go, it's better than most.
class Something
{
private:
static int s_nValue;
};
int Something::s_nValue = 1; // initializer
is that even legal?
why not?
@BartekBanachewicz C'mon now. Just because you don't like him doesn't mean you can be so nasty as to compare him to Larry Ellison.
Because s_nValue is private
It's not only legal, it's what you must do.
the access specifier is entirely irrelevant for a data definition
15:54
lol the flag
access specifiers control access
^
that's initialization
is it still Abyx flagging the F words? :P
probably yes.
dat flag
15:55
fuck [test]
@drkg4b That doesn't make sense but okay
@AndyProwl huh, I'm not? Shit
@BartekBanachewicz I'm almost tempted to flag, just to fuck with your mind.
@BartekBanachewicz maybe someone just wanted to star and clicked on the flag instead
that requires confirmation
@DonLarynx since the static variable is going to be shared across the instances, you need to specify a definition point
15:58
@LightnessRacesinOrbit why not?
@MarcoA. Why not just static int s_nValue = 1;?
@BartekBanachewicz definition
the initialisation is almost tangential
@DonLarynx because that wouldn't have anything to do with the class..
@drkg4b well it's a vacuous statement. we have no idea what code you had before the change. and if you didn't even declare the thing you were iterating over, well, I don't see how you even got it to compile!
@LightnessRacesinOrbit well I'm not sure how C++14 in-class initializers work with static data
probably don't.
@DonLarynx Because the name of the variable is Something::s_nValue. ` int s_nValue = 1;` would define another (global) variable.
@JerryCoffin he means inside of the class
16:00
Oh sorry all
What Bartek said
@DonLarynx That would be OK if it were const you didn't ODR-use it
(i.e. unless a function needs to know the address of that thing, give or take)
@DonLarynx Ah, in that case: "because the thing inside the class is only a declaration, not a definition (and therefore can't have an initializer)."
@BartekBanachewicz oh, if he means inside the class def, ok
in-class initialization won't be legal in that case though
the member is not const
@DonLarynx a static variable into a class hasn't its storage allocated each time the class gets allocated, that syntax would be confusing. The variable needs a definition point, and the way to do it is to use the other syntax
16:04
@AndyProwl waaait
as a hint: if something in the language itself doesn't make sense to you, go a bit lower-level and take a look at how memory is laid out by the compiler
@BartekBanachewicz That's how it works IIRC
Thanks @MarcoA.
@BartekBanachewicz They work fine. Still need out of class definition (lacking initializer) in a TU
Time to commute back home!
16:06
@AndyProwl sure?
struct X
{
      static int member = 42;
};

// in a TU
int X::member;
@sehe aha, that's what I suspected.
This is addressed somewhere - as a sidenote of sorts - in Scotts latest book (so I know I'm not seeing iffy compiler behaviour)
baaaah, class C { auto x = 42; } doesn't work! :(
#fixplz
@sehe Can you HL me with a ref to this stuff? I'm interested to see how that's resolved
16:08
I see no reason why it should be forbidden
@BartekBanachewicz That's not static
@AndyProwl ah I thought you were talking about nonstatic members at that time, my bad
0
Q: Is this a proper Mercurial merge?

GREBENOTS2 main branches: stable - used for release and for hotfixes. default - used for all other development and all features Please see revisions 8 and 9 specifically. I added a 2 separate features in revisions 3 and 4, worked on them separately, merged them into default in revisions 7 and 8. They a...

@Rerito Scott Meyers
@Mysticial ^
16:09
@sehe needs moar const
@AndyProwl nope. The same deal regardless (AFAIR)
lol -std=c++1z
that doesn't change anything AFAIK
16:10
@AndyProwl Okay. Mmm. Time to reread that book. (In my defense, I'd make things constexpr and be done)
@sehe shouldn't that be -std=c++2x?
@sehe Yeah, constexpr is what it should be
-std=c++waffles
-std=c++next
Haskell of course uses < Haskell' >
16:11
-std=(c++)++
@Griwes cpp-next.com is off-the-air
@sehe Actually I've read that book and I don't remember this. Could it be from a different book?
(it could also be that my memory sucks)
hmpfh that being said, Haskell Prime looks dangerous
because all of the compilers are dying
@sehe can I use this with -fshrek and -fdonkey?
76
Trolling

Proposed Q&A site for this site is for any part of Trolling. For those who want to prevent trolling, design systems that discourage trolling, or for people who want to successfully troll others.

Closed before being launched.

16:17
The goal doesn't make a lot of sense to me
It sounds like an arena
> or for people who want to successfully troll others.
A place where people can to discuss how to prevent trolling while being trolled
@ThePhD merged. Thanks.
> Why is it called trolling and not something else like goblining or orcing?
ahahaha
orcing
stop orcing pls
uruk-hai-ing
16:20
uruguaying
let's do a game jam
@BartekBanachewicz ¬_¬
I'm at work :(
I went to pick up my coffee machine
so hyped for those Oreo drinks
16:22
Let's do a work jam.
@R.MartinhoFernandes lol
let's do a strawberry jam
let's do an AI competition
Where can I find metadata about stackoverflow? How many users have more than 3k rep, etc.
@BartekBanachewicz Can I submit myself?
16:22
I've a better idea
let's do a complete-a-project jam
@R.MartinhoFernandes :D
two weeks => you must submit a completed something
@AlexM. Potato is almost finished :S
but my colleague left the city for a week and I don't want to sit to it alone
so I was fiddling with Hate a bit, nudge'd GLFW-b maintainers
but since Jefff isn't here either working on Hate isn't as fun
@R.MartinhoFernandes Very cool
16:27
my arms always get shaky after I stop carrying something heavy
@AndyProwl No it isn't. Like I said, it's only as a sidenote (might be an actual footnote)
it's like I have parkinson's right now
@Mgetz -fno-ogre -Wboulders
@AlexM. I have that
@R.MartinhoFernandes submission, finally
> The compiler can make up its own calling conventions, within limits OldNewThing
And wow:
> "Neuroscience Meets Cryptography: Designing Crypto Primitives Secure Against Rubber Hose Attacks" Subconscious Keys
@sehe OK, I somehow missed the sidenote part
@LightnessRacesinOrbit Tells you a lot about the state of the fandom.
16:35
new Vector2(Input.mousePosition.x, -1f * (Screen.height - Input.mousePosition.y))
I wish Unity aligned their GUI canvas with the screen coordinates
having to calculate that y coordinate while not having to calculate the x coordinate pisses me off
@sehe R. Daneel references :D
Holy frick, I did it everyone. I wrote an algorithm for the extended Euclidean algorithm.
fuck me, you're a fucking genius
brb erecting a statue for Don Larynx
@AlexM. thanks this took me 24 hours of torture.
erects statue at gf
@sehe -fno-onion
16:51
> Life as a Bionic Woman
A brain implant offers relief to an epilepsy patient http://spectrum.ieee.org/biomedical/bionics/life-as-a-bionic-woman
so awesome
imagine how great it would be to have the possibility of overcoming any natural condition through man-made means
I was especially impressed by that guy living with an artificial heart, that I posted sometime ago
@AlexM. Sure. That's called "transhumanism".

« first day (1565 days earlier)      last day (3609 days later) »