« first day (1313 days earlier)      last day (3527 days later) » 

12:02 AM
I'm on Windows. Sometimes I've heard sound notifications from other accounts that are logged in.
 
@COTO Ended up asking said question here: stackoverflow.com/q/25634191/765294 :)
 
I was once convinced I had some adware on my machine, because my computer kept making "ping" noises - I later realized this was my email client telling me I had mail. After that I changed all the system sounds to be completely ridiculous so I couldn't mistake them for anything else.
 
@Will: lol @ "a deviant number of parameters".
Just out of interest: have you compiled the C code to make sure it actually works?
I mean, just because something is on PPCG doesn't mean it's syntactically correct.
 
well
this would be semantics, I don't think anyone would argue against the syntax, but this is also irrelevant
dammit, I spend so much of my time arguing over semantics, now I'm probably going to rope myself into an argument about the actual word
 
@COTO Well, the strange thing is... it doesn't seem to work on my own comp, but it does work on ideone.com...
 
12:09 AM
...doesn't mean it's a legal overload. ;)
Also, when did C start accepting no-type arguments like main(a) { .... }?
I must be getting old.
 
type defaults to int in c
at least in params and ret vals
 
Is that a new feature or is it something that every piece of C code I've read for the past 20 years has (by random chance) never used?
 
This "feature" is as old as the language, but the reason nobody uses it is well... self-explanatory I assume :)
found very often in obfuscated C contests though
 
Feh. Learn something new every day.
 
Maybe the code example given isn't entirely correct, but I figured somebody would have pointed that out by now given its upvotes and exposure.
 
12:30 AM
@Will: People simply might not know for sure. There are literally thousands of library functions in C. You'd need to get somebody who i) reads the answer, ii) knows that the method requires three methods in every conceivable implementation of the C standard libraries, iii) notices the error, iv) is confident enough in his/her assessment to say something and risk appearing foolish if wrong, v) cares enough to say something, and vi) is either a PPCG user or willing to sign up as one, since guests can't comment.
The function wouldn't even appear to do what it claims to do. For example, the recursive invocation of main() leaves out the argument to main. So unless C has also started accepting function overloads, that's wrong too.
 
I updated the leaderboard for the Rosetta Stone Averages question.
(I don't think anyone in here is participating, actually...)
 
@COTO That last statement is false though. That variable is set by scanf() on every iteration, so it doesn't matter what it initially holds.
 
But main(void) isn't the same as main(int) in C. It should fail with a compiler error.
 
It doesn't. I've tried it in many forms succesfully. Just warnings.
 
Then that's another undocumented C hack somewhere. Every C language resource I've ever seen says that you can't have a function with signature abc( int ) and abc( void ). Maybe some compilers let you get away with it.
 
12:37 AM
i think it's supposed to be int main(), but most compilers allow other things
 
The newest gcc. BTW: function(void) != function()
 
You know what I mean. ;)
 
some compilers allow literal OR and AND too
 
The difference might be crucial though.
Using void tells the compiler that the function will have 0 parameters, using () won't tell it anything of the sort
 
@COTO: Did you come up with that recursive function yourself, or is it based on something else? For your "spy" question
 
12:40 AM
@EricTressler: If you mean the bit of code that converts an array into a nested series of loops, I just thought it up on the fly. I'd bet you could find it in countless code golfing and obfuscation challenges if you looked, though.
 
yeah, that. I tried to analyze it, but I gave up.
I think I probably could, but it's a serious amount of work
 
@EricTressler: When the time is up, I'll post an explanation. If I hadn't written the thing, I wouldn't in a million years be able to figure out how many outputs it produced. The other thing that makes the problem so nasty is that I tuned the constants just before deployment to values that make the code unrunnable on most machines.
 
@COTO Jerk
 
@Dennis' solution is (as I've come to see as a regular thing) far more elegant in that it relies on an actual, proven encryption technique rather than just obfuscation. Doing that kind of thing is beyond my ken.
 
I'll have to look at his, as well; I worked on very theoretical encryption for a couple of years, but not long enough to recognize it in practice or implement it practically
 
12:50 AM
@Will: My understand of C was that if you had a function int foo() { ... } in C, the compiler would complain if you tried passing any kind of argument into a call to foo(). Maybe that's not a strict requirement either. I'm obviously not the C authority here. ;)

I haven't written in C in ages. It's a defunct language for anything other than assembly-level stuff IMO, and there are better languages for that too.
 
blasphemy. Why do you consider it to be defunct? C++ is basically equivalent to Java
 
Also, chances are if you're writing near assembly-level code in C, you're screwing yourself out of huge performance benefits because C compilers don't handle the massive expansion in instruction sets seen in newer processors at all well. You need libraries written by people with too much time on their hands for that.
 
@COTO I think you misremember. C is vey lenient when it comes to foo(), which is exactly why modern doing practicises recommend passing void, in order to avoid bugs and abiguity. I love C, as specified by the C11 standard. People who write C (outside of codegolf etc.) as if it's 1989 i disapprove of though
 
C++ is fine. C isn't C++.
 
To me C is nicer than C++. But let's not go there, argument-wise :)
 
12:54 AM
C is a great way to crash your system and produce a million obscure and totally untraceable errors, I'll give you that much. :D
 
I learned C/C++ at the same time, so I don't really draw a line there
but yeah, pointers and memory allocation in C are really tricky and it's totally feasible that even a really competent programmer will screw it up
 
I'm addicted to the power of higher-level languages. Let's put it that way.
 
I screwed up binary search in a recent technical interview, and they still want to talk to me
 
You had to write one?
 
I had infinite recursive descent if you tried to add something already in the list
No, they had 3 functions they wanted me to implement, one of which I had binary search as a helper function
but I had a "<" where I should have had a "<="
 
12:58 AM
Is this a red/black tree thing, or just an unbalanced binary tree?
 
nope, it was search on a vector for insertion
 
Right, but was the data structure balanced or not?
 
a sorted vector, but not sorted by the STL
vectors are just arrays on the back end, aren't they?
 
Arrays or linked lists. But you need balancing if you want O(log n) performance, which is the only reason to use a BST in the first place.
 
I know. actually, I should ask you about this
So the problem was to implement some functions that add items with a weight and an ID, and then implement "getWeightByID" and "getWeightAtPercentile"
so I pushed everything into a Map and also a vector
 
1:02 AM
Sounds good.
 
the Map allows for log n everything, and the vector allows for O(1) getWeightAtPercentile (if you maintain it as sorted)
but the vector is O(n) insertion
I couldn't think of a way to make both adding new items and getWeightAtPercentile O(log n)
 
The vector could be made O(log n) for all operations, but it would take way too long to write for an interview, etc.
You could use a balanced tree, or--better--a heap.
 
The most sophisticated thing I thought of was adding new items to a temp vector that's O(log n) and then adding them all at once and sorting the whole vector
 
Heaps are always best for partially sorted lists.
 
I'll have to read about that again; it's been 10 years since I implemented a sophisticated data structure
 
1:05 AM
But again, a heapsort takes way too long to program in just a sit-down.
A vector with linear time operations is fine.
 
yeah, it was clearly suboptimal to me at the time, but I had to write something
I knew there was a way to avoid having anything be O(n)
but I didn't know it well enough to just write it up.
I thought of putting the weights in a sorted skip list; that's the same as a heap in terms of performance, isn't it?
Also something you don't want to code during an interview, though
 
Heap gives log(n) search performance and log(n) amortized add performance. But heaps, sorted skip lists, balanced trees, etc. aren't things you're going to code during an interview unless you're John von Neumann.
 
Yeah; as I said, I screwed up my binary search for vector insertion
and I could hear Knuth in my head as I started it
I never met Knuth; I probably should have
 
I'm not a CS major. I'm an engineer. Programming is just a hobby. But programming is just like writing, I find. If you don't know how something is done, it's the easiest field in the world to simply wander out onto the Internet and look at how somebody else has done it. ;)
 
yeah. well, I'm a mathematician, and I feel the same about it
Programming isn't hard, but I use google as a crutch all the time
mostly for syntax and looking up algorithms I already mostly know
brb
 
1:25 AM
@PhiNotPi you available?
I need to bounce an idea off of you
 
@NathanMerrill Bounce away.
 
Ok. CodeBots2. Its all event based
basically, a line can have a condition attached to it, and if the condition is true, your code skips to that line
I'm debating whether or not to include an If as a command
because, I can always make my condition Cond and This=C
 
So, every line of code is read every turn, but only certain commands are executed (those with a True condition)?
 
no, 1 line per turn is executed
but the line is skipped to if its command is true
 
Okay, I think I understand now.
 
1:31 AM
however, the question is whether I should offer an If action
because it can be implemented with a condition
conditions can be copied
but the two are still somewhat fundamentally different
an If can perform a line without skipping to that line
 
How exactly would an If statement work to begin with? Given a condition, it sends execution to one of two lines. What happens if the target line has a false condition?
 
oooh, I didn't think though this...if the condition is false, but you are on a certain line, the line will still be executed
I do still need the If
thank you!
 
Sure thing.
There was a similar idea being bounced around for CB3, in which lines could be skipped unless specifically called by an If statement.
If D #1 #2
\\ Copy #3 *#*C
\\ Move
\\ Flag
(line here executed next turn)
 
2:00 AM
@PhiNotPi Each of the CodeBots will be a variation on the original, not an improvement from the last
And there will be a CB 3
 
@NathanMerrill I was working on a spec for CB3 a few days ago. It's in the sandbox. I called it CB3 because I knew you already claimed CB2.
 
I'm reading it now
I would change F
 
I really haven't devoted as much time to it as I will eventually.
 
F, instead of being a number 1-4, would be the sum of 2^n for each of the n directions
 
Options for F include the number of adjacent bots, or a number 0-16 indicating the locations of neighboring bots.
What you said.
@NathanMerrill I kinda want to create a version of Code Bots which uses a completely different programming paradigm.
 
2:16 AM
Anyways, I think all of them are good ideas. I personally wouldn't do all of them, because I'm trying to theme the challenges
The Event-based code bots is an attempt at that
However, I am ok if you create your own Code Bots challenge
 
@PhiNotPi Did you see what I said earlier about triangle centers?
 
Yes.
@NathanMerrill Okay, thanks for letting me create a Code Bots challenge.
Battling stack machines, anyone? en.wikipedia.org/wiki/Stack_machine
The goal could be to cause your opponents to have a stack overflow error.
 
2:47 AM
lol
 
@PhiNotPi I think that would be very difficult to specify/implement
but what if you do away with the board
and let bots mess with other bots' code
that might be fun
what is this number below my name? Is there a separate score each user has on chat, or what
 
3:31 AM
am I winning chat?
 
I believe the number is the sum of all of your rep across all sites
er...it's my rep on code golf + rep on SO
do we each have a main account?
 
I have no idea
 
are we talking about the number below your name?
 
3:46 AM
yeah
welcome back @Sparr
 
finally got through comcast hell and got my service activated, no more unreliable tethered phone connection
whoa
codebots leaderboard got destroyed by some new bots
 
yeah
I'm sure you can counter attack them
 
when did the spec change to allow multiple blocks of the same line?!?
 
you can have multiple blocks on the same line
but never a block from the same line
if that makes sense
 
I think a couple of us explicitly asked about that back in the sandbox :(
 
3:51 AM
So, executing Block #8 on line 1 and line 2 will block it twice
 
anyway, glad to see some winning blocking strategies.
 
And I don't remember ever saying that it was the other way :P
but that was a while ago
 
Cadmyllion is the most interesting new submission, I think.
 
 
1 hour later…
4:59 AM
@Martin that idea is eerily similar to mine.
And no, but I might get to working on a marbelous solution if no one else does.
 
5:10 AM
solution to what?
 
5:49 AM
was on mobile, didn't manage to link
@MartinBüttner there
but marbelous doesn't have a floating point library (yet)
 
 
1 hour later…
7:17 AM
1
Q: Chess Tournament

ManuThis is a chess-KOTH with simplified rules (because chess itself is already complicated, playing it via a simple program doesn't make it easier). At the moment it is limited to java (version 8), but creating a wrapper-class isn't that difficult (in case someone wants to do this). Chessboard The...

That's a really big question, what do we make of it?
I mean, is this going to be our definitive version of a PPCG chess tournament?
 
7:39 AM
@overactor lol right... variadic functions are also a bit of a problem, right?
 
@MartinBüttner yup
it's possible, definitely
but..
@MartinBüttner what's your take on the chess tournament?
 
sounds hardcore. but my main concern that it will just be dominated by people who can be bothered to write up established algorithms and squeeze them into 30k characters.
 
@MartinBüttner There's no requirement that says the code has to fit in an answer
 
@COTO In JS if you're effectively allowing string literals you're allowing numeric literals as well. (And object and array literals if you don't explicitly forbid eval).
 
We only get to have one full chess tournament.
And I feel like that should spend some time in the sandbox, to make sure it's written up perfectly
 
7:48 AM
@COTO How do you search in a binary heap in better than O(n) time? You can't do it from the top down, because the heap invariant doesn't contain enough information to know which side of a branch to pick, and if you do it from the bottom up then there are worst-case Theta(n/2) elements on the bottom level.
 
@overactor it was in the sandbox
the new xkcd is sick :D
 
@MartinBüttner I'll shut up then
 
@VisualMelon thanks for catching the braces. the aggregate problem is more easily fixed by applying the Math.pow outside
 
@MartinBüttner wow
 
8:19 AM
@overactor I think your counting rods challenge could use some clarification
you always write stuff like "3 horizontal lines on top", but then in the example, all the horizontal lines are below the vertical one
 
@MartinBüttner I'm all ears
 
also, all those typos :D
 
@MartinBüttner My spell checker doesn't work properly and I can't type
I'll look through it again
 
an example for multiple digits would be nice too
oh wait
there's more at the bottom
ah I see
 
where do I talk about several horizontal lines on top?
I'll inclide som example outputs though
 
8:22 AM
it just confused me that you didn't have an example of a horizontal digit before going on to vertical ones
@overactor no you don't. never mind.
 
I'll include some examples
 
I think I get it now
most likely I just didn't read properly on the first go
 
I added some examples
 
8:54 AM
@PeterTaylor: eval is forbidden. Specifically, the only things allowed are: string literals, string concatenations, calls to user-defined functions (no library functions) that accept no arguments, this, jQuery selections using $(), the .length property of a jQuery object, the DOM traversal and manipulation jQuery methods, and the .attr() jQuery method for reading and writing to attributes.
Absolutely nothing else. No numeric constants, arrays, objects, library functions, variables, arguments, operators, ifs, fors, try blocks, you name it.
As for your argument about heaps: point taken. I was rattling off complexity specs from memory, and I obviously remembered wrong. >___<
 
 
1 hour later…
10:06 AM
@EricTressler A suggestion how you could do the triangle centres challenge: List as many centre definitions as you care to. The task is, given the coordinates of a triangle, a list of centre types (e.g. encoded as integers) and a depth, to implement the fractals you mentioned by cycling through the list of centre types at each stage. Participants can choose how many definitions to include (and how to associate them with integers), and the final score is code size/no. of definitions supported.
There is enough boilerplate code to get the rendering and recursion implemented so that it's worthwhile to implement multiple definitions, but at some point, some might be too complicated to fit into the savings you gain from including them.
Also "over a hundred" was a careless underestimation en.wikipedia.org/wiki/Encyclopedia_of_Triangle_Centers :P
Ah you qualified that with "well-known"
 
@MartinBüttner Yes, there are many. I forget how many, but if you pressed me, I think 250 is a decent estimate
wow, apparently not
okay, so there are a lot more triangle centers than I supposed; but it's still a reasonable challenge
 
10:22 AM
well you don't need to include all 5000 :D
 
Asking people to weed through 5000 different definitions to see which ones go well togetehr might be asking a bit much.
 
I'm also pretty sure, some of those will be numerically the same to reasonable accuracy except in some edge cases
something like 50 would certainly be enough if not already too much for a PPCG challenge
 
So those 50 are preselected them?
 
that's what I'd suggest
 
My friend went through a lot of them, and found the ones the recursively give a cool picture
there are probably a lot more
 
10:31 AM
especially when you combine them ;)
 
but I doubt there are many "duh, look" ones
 
no clue
 
me either. I couldn't get in touch with him yesterday
but if you find a neat picture, I can get you in touch with a real mathematician who cares
 
do you wanna write something up for the sandbox?
 
I may, but it would follow the mathematical art post
 
10:35 AM
which one was that?
 
the tweetable art one
mathematical art is usually creepy or hard to understand
 
okay in that case I don't know what you mean by "it would follow the mathematical art post"
are you working on an answer for that one?
or do you mean it would be in a similar vein to that one?
 
the latter
 
0
Q: Musical Quines on an ASCII Piano

Calvin's HobbiesThere are 88 keys on a standard piano and 95 printable ascii characters (hex codes 20 through 7E): !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ('character' refers to any printable-ASCII character from here on) In this JSFiddle I've taken adv...

 
but it was a great postholder, so I might steal it
 
10:38 AM
I'm not too fond of that being a pop-con
am I alone in that?
 
@overactor how would you make it a code golf?
 
@MartinBüttner In its current form, not at all
 
@EricTressler I'm not sure it would work here. The scope is much narrower, so it's just about being lucky to find a good centre. And once you have the basic framework, that devolves into an art contest more than a programming contest, even more than tweetable maths did. It's also quite well-specified, so there's no problem with making it a code golf. I think once people have the framework in place, they'll experiment with interesting definitions automatically.
 
yes, true; but I love mathematics; what can I do?
 
I don't see how code golf is between you and mathematics here :D
 
10:43 AM
I sent links to some of the tweetable art stuff
to my friends who are math profs
 
@overactor I find the new underhanded contest much more meh :/
 
but Hofstatder's a lot tougher to link to
 
@EricTressler aaaaaaand? :)
 
@MartinBüttner are you in school?
 
@MartinBüttner I agree there
 
10:47 AM
@EricTressler if by school you mean university, yes
 
yeah, I do
We mathematicians don't really value age over brilliance; most of the big advances in math are by 20-25 year old people
who seem to die in duels or whatever
 
see Galois etc.
 
@MartinBüttner what do you study?
 
I somehow don't follow your train of thought any more though... how did we get from tweetable maths to Hofstadter to advances in mathematics made by university students?
@overactor theoretical physics
 
10:52 AM
@MartinBüttner sorry, but it's all theoretical
 
@MartinBüttner didn't you tell me yesterday to direct my question to a theoretical physicist?
 
@MartinBüttner I worked on quantum physics and it was mostly just implementing new algorithms
 
@overactor Nope, to an experimental physicist :P
 
@MartinBüttner That does make more sense
 
@EricTressler well, I don't do labs :D
 
10:54 AM
well, i have a ph.d. in math. i stay as far away from actual things as possible
 
so when I asked you about the accuracy of a hypothetical experiment, your inner theoritical physicist thought: 3"who cares about accuracy?"*
 
@EricTressler I'm actually currently doing an internship in the maths department (in fluid dynamics though)
@overactor I think I rather thought "what do I know about carrying out experiments?" :D
 
you'll never understand the stokes equations. get out now
 
@EricTressler I'm just working on the SWEs
 
@MartinBüttner very humble
 
10:56 AM
sorry, what is SWE
 
shallow water equations
 
so do you assume laminar flow, or what
I hope you've read Feynman on the topic?
 
well, we mostly assume flow independent of the vertical coordinate and all pressure being hydrostatic
@EricTressler no I haven't
 
Oh man. You really should
but he's negative about what you're doing
 
10:59 AM
he basically thinks that turbulence is the great unexplained thing
 
btw, understanding the Navier-Stokes equation isn't too bad... the derivation we were given actually made sense... using it is a completely different matter though :D
 
but he's fun to read anyway
so do you need to publish something to graduate?
 
what's the requirement, then?
 
well, there's a final-year project with a master's thesis. but I wouldn't count that as publishing something.
 
11:03 AM
you're an undergrad?
 
you could get a ph.d. if you worked hard on something you like; you're lucky in that
 
yeah I'm currently considering applying for phd positions next year.
I might move back a bit towards computer science (graphics) though if I do
I'm not entirely sure yet
 
which country?
 
probably Germany... although the ETH Zurich sounds really tempting, too. most likely not the UK (more for personal than academic reasons)
 
11:06 AM
I knew a guy who got a ph.d. in math and CS concurrently, and then he died by crashing his bicicle
 
that's sad
 
yeah, it was very sad
he was a genious to most of us
 
11:22 AM
I do not like Android programming. I do not like it, Sam-I-am.
 
11:46 AM
@EricTressler I've set up the basic code for the triangle centers... all that's left to do is add more definitions and experiment with them :)
(using the standard incentre)
10 iterations
 
that does look pretty cool
 
it looks even better with reduced opacity
20%:
something's buggy, I think
I don't get three-fold symmetry for an equilateral triangle
 
how can all definitions of the center of a triangle not give the same point for an equilateral triangle anyway?
Or am I uninformed about what exactly you are doing?
 
found the bug
I'm only using one centre definition so far
:O
 
so what do those points represent?
 
11:57 AM
^ after fixing the bug
those points are recursively plotting the centres of the resulting triangles
 
oohh
cool
are the new triangles defined by the points of the original triangle and its center?
 

« first day (1313 days earlier)      last day (3527 days later) »