« first day (1467 days earlier)      last day (3380 days later) » 

12:01 AM
@Geobits Hah, I was impressed that you even got Java down so far :P
 
Blame Rainbolt. I was at 106 until he wanted to make it a personal competition ;)
 
12:16 AM
What's a good physics approximation algorithm?
 
for what
4th order runge-kutta works for numerical integration pretty well
which is the main tool you need to approximate classical mechanics
 
I'm working on the hovercraft battle challenge (in the sandbox).
Each hovercraft is modeled by a disk. For a given segment of time, the disk experiences a constant "linear" acceleration and constant torque. The main problem is that the direction of acceleration depends on the orientation of the hovercraft, but the orientation changes over time.
I've been able to solve (exactly) all of the cases in which the disk experiences only linear acceleration and no torque.
 
I present to you the words in "Stack Exchange": pastebin.com/QNYC903y
 
Quick! Regex golf that list against all permutations which don't result in words :D
 
12:33 AM
"|".join(words) in python. Not very golfed though :)
 
You could do a lot better just with (accent|ace|agent|...)s?
Although I guess that's just compression
Which would probably work a lot better :P
 
Then all words would contain a match, not match directly.
 
@Sp3000, did you do the regex golf thing?
I couldn't figure out the "Abba" dataset
 
I think Martin posted a solution earlier, right? Use a lookahead
 
I couldn't see what we were trying to find, i mean
 
12:38 AM
@Eric ^(.(?!((.)(.)\2\4)))*$ Best I have so far. Martins solution didn't work.
 
oh, is it just no abcd dcba pattern?
 
I had ^(?!.*(.)(.)\2\1).*
 
ugh, I did it while woefully low on caffeine. That's it, right, just no reversed 2+ letter patterns?
I was looking at the lefthand side and trying to find patterns; I totally ignored the righthand side
 
@Sp3000 Copied from here?
 
No actually XD I just kept fiddling until the negation worked
 
12:40 AM
I've never used negation. I can't find a good place to explain it either :(
 
^(?!.*(.)(.)\2\1) is a better way to to do it
 
Oh true, the second .* is unnecessary
 
 
1 hour later…
1:58 AM
@Sp3000 Ugh. I can get it down to 97, but I think I might be stuck now.
 
which challenge is this?
 
Damn Java and its insistence that nothing autocasts to a boolean.
 
I think I just static-electrically shocked my own eyeball.
 
2:20 AM
That sounds suboptimal.
 
2:36 AM
Wow 97, that's close!
 
I need a ruling from Martin before possibly dropping to 88 ;)
 
D:
 
I just tried it in Java and got 85 (with the lambda)
 
Post it :)
 
ok
 
2:39 AM
I'm still trying to figure out the best ways to golf lambdas. Every time I try it's a disaster, so I like seeing good examples.
 
I just had to read up on the syntax to make this, lol
oh, I should have put the assignment in the bracket like Geobits
 
@Geobits I think I need to wait for Martin's answer to your question before I can make mine shorter too :)
 
Nah, I'm editing mine now. I can roll back if he says no ;)
@feersum You can save on that int casting, too. x=i--;x*=Math.random(); is shorter than x=(int)(i--*Math.random());
You just have to split it up since your assigning in the bracket.
 
ah well the answer is nearly identical anyway, I should just delete it
 
Eh, up to you.
I think we need a meta ruling on java lambdas, honestly. I'm not sure why the interface definition doesn't get counted, but I've seen it done that way several times.
 
3:06 AM
My new take is that the function exits by throwing an exception
 
D: 72
Damnit Java, since when were you actually golfy
 
Since python had that ugly-ass import for random :P
 
Will it cheer you up if I write a short python one?
 
Yes if it beats your own submission :D (I can only get 80-something with the modify-the-array rule)
 
3:24 AM
I have a 68 but it's not O(N)
 
I don't python, but is this tip helpful at all here?
I've played with it for a couple minutes, but can't get it working quite right. I figure maybe a better pythonista could ;)
 
@Geobits It generates a string with random ascii values - not exactly convenient
 
Yea, I was trying to figure out a way to convert it golfily, but failed.
 
3:46 AM
hmm, my Java answer does not actually work right now
 
@Geobits I'll wait for Martin's response first :)
 
I don't know why you would even need to ask
For example sort() in python returns nothing
 
@Sp3000 I just couldn't leave that comment alone there :P
 
and same with qsort() in C
 
@feersum What does 'not working' mean? It looks fine to me except the ugly exception.
 
3:51 AM
I fixed it a couple of minutes ago
 
@feersum Because the spec as is specifically says return value or STDOUT
 
Yea, that's why I asked. +1 for version control, though. Easier to ask forgiveness than permission :P
 
The product of mindless boilerplate writing :P
of course, you must return if not in place
 
Well if Martin says in place is okay, I'll just remove the last line :P
 
 
4 hours later…
8:17 AM
In this question, the shortest answer is a Pyth translation given "just for fun" along a Python solution. Should I accept it?
The shortest "real" answer is this Mathematica solution, which I personally find awesome.
 
go for it
 
 
1 hour later…
9:43 AM
@Sp3000 response?
 
See shuffling - is it okay to in-place shuffle and modify the array without printing/returning it?
 
oh, yeah, I'll clarify that
 
Oh, so we don't need to print? Awesome.
Oh... but is that only for functions?
 
so everyone is following the same algorithm for shuffling ?
 
Fisher-Yates is just too good
 
9:54 AM
@Optimizer I'm not sure about J and APL
 
who ever is ? :D
 
@Sp3000 well, for a program it doesn't really make sense, does it? ;)
 
Fine :P
 
@Doorknob ... ummm... did you dispute my other flag or was that another mod?
@TheBestOne google "negative lookahead" ... regular-expressions.info is usually pretty good
 
Trying to completely classify "Is this even a word?" using regex and most of the non-words that are left look like plausible words lol (there's even ones like "chia", which is a word...)
 
10:11 AM
hi all
 
morning
 
another general question.. would a "Fastest code to compute the suffiix array of a large input" question be too boring/standard for PPCG?
I am always trying to work out the limits of this site :)
there a number of competing algorithms one could try
so it's not just question of implementing something that is known to be fastest
@MartinBüttner do you use your Pi to write the answers to PPCG questions? I mean do you use it as your normal web browser?
 
in that case it still seems to be a question of implementing a handful of things that are O(n) and then picking the fastest
@Lembik no, I'm currently barely using it at all
 
@MartinBüttner it's possible one of the O(n log n) algorithms is faster in practice
 
that depends on your test size I guess :P
 
10:15 AM
@MartinBüttner I was going to go for 270MB of text
 
but yes that's true of course... my point is... in the end I doubt someone will do anything more interesting than optimising a known algorithm
 
@MartinBüttner right... I personally would find it very interesting to find out which algorithm can best be optimized
 
well if it hasn't been done go for it
 
31
Q: What's the current state-of-the-art suffix array construction algorithm?

CameronI'm looking for a fast suffix-array construction algorithm. I'm more interested in ease of implementation and raw speed than asymptotic complexity (I know that a suffix array can be constructed by means of a suffix tree in O(n) time, but that takes a lot of space; apparently other algorithms have...

maybe that counts as being done?
 
possibly
 
10:22 AM
annoyingly the link for the fastest method is broken
I love that the options are all described in published papers except for one that is often the fastest which just exists in some online forum post by a Russian person :)
 
I wonder for a normal program, what is the size threshold at which base encoding benefits in CJam
57 -> 63
 
@Sp3000 did you compile Codemon from the command line? is it just javac *.java or something?
 
I compiled from Eclipse, then couldn't run from Eclipse and ran command line
Weirdly enough
 
@Optimizer that depends on whether you're counting by characters or bytes. for characters it's around 35 I think... for bytes more like 100 (maybe 80).
 
But normally it should be javac as far as I know
 
10:30 AM
could you figure eclipse's compilation command?
 
I hit the run button XD
(My Java experience amounts to first year university, if that's anything)
 
same here... but I'm sure somewhere in the project configuration of eclipse, there'll be a command that's run when compiling (at least that's what it's like in VS)
ah it worked after I copied player.conf into the src directory
I guess eclipse builds everything (and a copy of player.conf) into a separate build directory?
@Sp3000 what's the -3 option for python?
 
I use Windows, so it might be python or python3 for you
For me if I don't have -3 it runs as Python 2
 
oh, that's interesting... I've got separate py2 and py3 installations on my (Windows) machine
:D
java.lang.Exception: Timeout for DummyTeam
        at Team.sendReceive(Team.java:40)
        at Team.getBattleAction(Team.java:145)
        at Battle.turn(Battle.java:73)
        at Battle.run(Battle.java:30)
        at Tournament.run(Tournament.java:52)
        at Tournament.main(Tournament.java:30)
Removing faulty bot: DummyTeam
 
Oh... hmmm no idea!
Ahaha wow how did that happen
 
10:42 AM
@Geobits ^ ;)
 
11:05 AM
hm, now both bitterrivals and dummyteam timed out
@Geobits meh, are you catching STDERR as well? :/
 
11:44 AM
okay, I've got a bot ... now the hard part... coming up with names...
@Geobits You should probably do something about infinite rounds as well. I had a bug in my controller where it used Pain against Normal-type monsters... when I was paired against a metapod, we'd just indefinitely hit each other with Pain and Punch causing 0 damage.
 
I think there's a 1000 turn limit
 
oh okay
then I wasn't patient enough
 
12:41 PM
Starting out with a 1580 byte regex. Let's see how far my ultra-slow regex-golfing cleaner can get it down
 
@Peter, wow that 12 balls and a scale challenge by Joe Z... 5 answers and not a single one has an upvote
 
1:01 PM
I wonder if there are any others that aren't in the official list
 
Oh? :o there's sites like that?
 
It has over 1400 questions. That's crazy.
 
grc
for the anagram question, can we count “curly quotes” as "normal quotes"?
 
no
you have to use a character as is
even if its a very weird unicode character
 
grc
1:17 PM
as far as I can tell, SE converts all double quotes to the curly ones :/
 
@grc you shouldn't ask us though, but leave a comment on CH's challenge instead :P
@Sp3000 ^ this affects your answer as well
 
@grc If you click the "Edit" button and copy and paste the title they're normal quotes
 
ah, right
I'm glad CH thought of that then :D
 
grc
@Sp3000 thanks - I should have read the question more carefully
 
@Sp3000 no they are not
at least the ones I tried
 
1:22 PM
Well I just tried again now and it's definitely a normal quote - normal in the sense that I get
>>> '"' in """exception "SQLSTATE[HY000] [1049] Base 'symfony' inconnue" while updating schema after installing FOSUserBundle"""
True
 
@Optimizer the ones Sp3000 uses are
 
1:37 PM
@MartinBüttner Yea, there's a 1000 turn limit for that reason.
 
oh okay, fair enough
 
I've had DummyTeam time out before, but it was due to some zombie processes (from something else) running my CPU to max. Never had it happen besides that one.
 
I ran another test with all 6 bots in the meantime, and your two bots timed out again
I didn't check my CPU usage though
 
That's mighty strange, I haven't had that happen even with 16 copies of each of them runnning.
 
@MartinBüttner No, as far as I can see it was auto-disputed through a review queue.
 
1:45 PM
oh okay... I didn't know flags went through the queues
that makes sense though
 
NAA and VLQ have been being fed through review for, uhh, a few weeks now I think.
 
ah right
so I've got to blame Timtech and KSFT :P
would you mind taking care of it anyway? the post even says it's not a valid answer.
 
2:00 PM
hi all
hi @trichoplax
 
@MartinBüttner Are you talking about connect four?
 
I think not, since I don't know what you could possibly need
At best you would save processing time by storing the tree as you have explored it so far, and that circumvents the one second to respond rule
 
well MCTS (or any game tree-based approach) could reuse parts of the tree it has already explored in previous turns
yeah, this
I'm not sure I'd call it circumventing the one-second rule though... it's merely clever (re)use of resources
but okay
I mean, it's up to you
 
You suggested I write a bot to see how long it takes to solve optimally
I want to limit their time to something lower than that
 
2:03 PM
yep
 
@Rainbolt Am I imagining things or did your avatar change from a grass block to a snow block when winter started?
 
@Calvin'sHobbies Yes
 
I never know how to answer those things
I went with the CS approach this time
 
2:22 PM
can anyone smarter than me tell me how you actually make an executable from code.google.com/p/libdivsufsort/downloads/list ?
I can make a library
but I want to actually make a suffix array
code.google.com/p/libdivsufsort/source/browse/trunk/… only tells me how to install the library and header file
 
Does anyone here have experience cleaning their mousepad? Mine is cloth with what I assume to be rubber underneath
It's a playmat that I won in a MTG tournament and it has a pretty picture I don't want to ruin
 
@Rainbolt I'm sure youtube does
 
Lifehacks.SE!
(I kid)
 
Lol
 
I'd try steam if it were me. Blasting things with hot water usually does the trick.
 
2:33 PM
Hmmm maybe I can test hot water and shampoo on a brightly colored mat that I don't like very much.
 
Laundry detergent might work better, since it's designed to brighten/clean cloth.
 
Just do it by hand so that you can tell if it starts peeling at the edges that you should stop or find a new method
 
3:14 PM
Errr... cold water would be better. That would prevent peeling in the event that the cloth is glued to the rubber
Also, this guy appears to have found the answer to "What is orthogonal plus diagonal?" english.stackexchange.com/a/225389/72792
But I'll wait on accepting the answer because in my experience, the moment you accept an answer on that site, all traffic on the question ceases to exist.
And also because no dictionary I can find even thinks that it is a word
Octopussianly sounds very sexual
... and also made up. What the heck ELU? Why do so many users on that site make up words?
 
Because it's English and making up words is a big part of it.
 
3:44 PM
How would I use the Runge-Kutta method to estimate the position if I know the acceleration?
Or is that even the right method to use?
 
second order? fourth order?
 
I don't really know the difference. I'm just Googling stuff.
 
have a look at wikipedia ... in your case, y is your spatial coordinate (x, say), and f(y,t) is simply v_0 + a*t (where v_0 is the velocity at time 0). the rest you can probably just write down from there
since you're in two dimensions, the two spatial coordinates can be computed independently with this method (using the appropriate components of v and a)
this does get trickier with rotation though
 
grc
is there any way to use up a question mark in python without a syntax error?
I'm 1-2 characters off a one line python anagram :/
 
If you still have your "spare" character the easy option is #, right?
Hurts the score a bit, though.
 
grc
3:59 PM
I need one extra 's' and I need to use up one '?'
I guess I could use Pyth
 
@grc In Pyth, you'd have to be able to solve the entire thing on a single line
 
grc
I can't work out how to use .title() in Pyth
 
4:16 PM
@MartinBüttner The problem that I see is that acceleration is also a function of time. Does that affect anything?
 
@PhiNotPi I thought you had constant acceleration?
oh but you mean because of the rotation?
yeah, that's what I meant
well, it's always possible to work out the equations of motion as a set of first-order equations (using Hamiltonian dynamics). it shouldn't be too hard in this case. I can give it a go, but I'm not sure I'll get around to it before the weekend.
 
Ugh. I get that my Codemon spec is long, but why do people bother asking questions in comments if they're answered in bold in the spec?
 
@Geobits because they're blind?
@MartinBüttner I've solved (exactly) all cases with either "linear" acceleration or torque, but not both.
 
yeah an exact solution might not exist
 
Using the mighty powers of Wolfram Alpha, an exact solution involves the Fresnel integrals, which have no closed form.
 
4:26 PM
but with the Hamiltonian e.o.m.s Runge Kutta should be fairly straightforward
hm, actually it won't be completely trivial to use Hamiltonian dynamics because you've got non-conservative forces
 
I could always..... make it so that the hovercraft can't do that.
 
what, accelerate, you mean? :P
 
Make it so that the hovercraft can only shoot.
 
oh I see
 
that was a joke... But there might actually be an idea here....
If the hovercraft has commands like accelerate forward, turn right, turn left, and backwards, then there would never be torque and linear acceleration at the same time... Thus allowing it to be exactly solved.
 
4:34 PM
Until it's getting pushed around by other hovercraft, right?
 
yeah, I guess....
 
I think this paper derives the Hamiltonian equations you need
looks like you simply give one of them the force term (eq. 21)
and (22) remains unchanged
 
If all else fails, I could apply the Runge-Kutta method twice.
 
4:54 PM
yeah, that works , too (to a degree)
 
It's just that the errors add up.
 
5:45 PM
Question for anyone familiar with machine learning or this type of problem, if I was making a program that deals with natural language and the outcome is determined by what the user is asking (Siri-like), what would be the most effective and least resource intensive machine learning algorithm to implement to score the inputs probabilistically?
I was thinking something like Multinomial Logistic Regression or the Naive Bayes Classifier
Perhaps @MartinBüttner @grc or @PeterTaylor could be able to answer
 
I have no clue :D
 
just to throw out some more terms - SVM random Forest ..
 
It was so much easier but so much more crude when I implemented it with regexes XD
But testing hundreds of regexes isn't the most computationally cheap thing to do
 

« first day (1467 days earlier)      last day (3380 days later) »