« first day (3267 days earlier)      last day (1568 days later) » 

2:06 AM
@Adám @Neil what are your thoughts on multiple * in a row?
 
2:27 AM
(I'm all ears for anybody else's thoughts on that, as well. I tagged those who wrote answers for it and are here.)
Aw, I didn't want Giuseppe's SNOBOL4 answer to be deleted, I just wanted the bugs fixed, or at least an explanation of why they can't be fixed. And there's a reply to my comment but I can't read it, because the whole answer was deleted.
I used to have deleted-answer-reading privilege, but that's been bumped up from 2,000 to 10,000 rep now. I'd appreciate if anybody would read me what that comment reply says, please.
 
2:46 AM
@Deadcode It's definitely a valid input in that challenge because it matches the recursive definition.
> hmmm, well, I'll delete this for now and come back to it. – Giuseppe 17 mins ago
 
Ah, thanks @Bubbler
@Bubbler so would it be acceptable etiquette to put in a brief comment in everybody's answer, so that each of them are alerted their answer needs to be edited to be correct?
 
 
2 hours later…
4:23 AM
@Deadcode Yes, it's a recommended action in that case.
 
4:36 AM
So, if we want to use an ordinary regex to solve that challenge properly, we should delete +s and replace runs of *s to single *s and _s to .{0}s before actually running the given regex.
 
Good point about _*. I'm fixing my answer
Fixed.
(Went with a golfier way of doing it, but what you suggested would work too.)
 
4:58 AM
0
A: Sandbox for Proposed Challenges

MukundanReverse Hashing Background You have invented a new hashing algorithm which is equiprobable to generate a number between \$1\$ and \$n\$. To show off how good your hash function is to your friends you have decided to tell them the amount of time (measured in units of time given below) it will ta...

 
 
1 hour later…
6:19 AM
@Bubbler Amazing, but how does it work? Haven't you just delegated the task of backtracking to having to try different ways of changing R to R'?
 
@Deadcode No, R' is a single regex derived from R and c.
 
Can you describe for me step by step how it matches (((a+a)|a)+(a+b)) against aab?
Or even something simpler, matching ((a|_)+(a+b)) against ab
 
Given R='(((a+a)|a)+(a+b))' and c='a', the derivation is R'=(((_+a)|_)+(a+b)).
Then, the next char is also 'a', and the next derivation is (((((0+a)|_)|0)+(a+b))|(_+b))
(where 0 denotes a regex that never matches)
 
Okay, figured that's what 0 did
But that second step is a doozy...
 
And with the next char 'b', the final regex is ((((((0+a)|0)|0)+(a+b))|(0+b))|((0+b)|_)) (don't try to read it manually though)
and the final test is to see if it matches the empty string.
It passes the test, so the result is 1
 
6:29 AM
What are the mechanics behind the second step, though? Why did it add a |0 for example? Isn't r -> (r|0) a no-op?
 
(((0+a)|_)|0) part is the result of transformation from ((_+a)|_).
And _ can't accept any next char, so it is transformed to 0.
The code doesn't do any logical reasoning to reduce the size of the resulting regex; it simply traverses the recursive structure and mechanically replaces parts of it.
 
Figured that, just trying to understand what the mechanics are.
 
Okay, wait a sec, will add some comments to the "Concept" section.
 
Thanks.
 
Comments added. Hope it helps.
 
6:42 AM
I'll try.
Doesn't help that I don't know APL or any language like it ;)
 
The concept section is actually written in a style close to Haskell or Ocaml, but it's just a pseudocode.
 
@Deadcode Will you allow me to fix that?
 
@Adám You mean change the question rather than the answer?
 
I guess he wants to teach you a bit of APL :)
 
Ahhhh
 
6:48 AM
@Deadcode What? I changed my answer. I just want to fix the fact that you don't know APL.
 
Sure!
 
@Deadcode When would be a good time for you?
 
@Adám Tomorrow sometime in the afternoon would be great. What's a good time for you?
 
@Deadcode Define "afternoon" ;-)
 
Oh, of course. I'm in UTC-0800
How about you propose a time :)
 
6:54 AM
Ah, then I can't do tomorrow afternoon. Saturday afternoon is OK for me though as long as it isn't too late in the "afternoon", since I'm in UTC.
 
There's actually a problem I'd like to aim at tackling in APL. Do you think it'd be suitable for porting this algorithm to? tinyurl.com/rudolph-Java-v0-62 - with the dictionary passed to it in some way that doesn't count in bytes
I'm hoping it's possible to break 135 bytes, maybe even 131.
 
@Deadcode APL is a general purpose language, so I don't see why not, but then again, IANAJP.
 
Right, well I also have a C/C++ version of it, would that be better?
Also, does the algorithm need to be "rephrased" to be explicitly recursive to translate well into APL?
 
We'll probably be fine, but you may want to start learning APL with simple stuff. APL doesn't in any way prefer recursive solutions.
 
Awesome.
Yep, this is just something I'd like to aim for.
 
7:00 AM
I think I get it now, eat Morse tokens one-by-one and attempt to decode at each step until it is valid Morse and matches a dictionary word, then continue. Right?
 
Pretty much, also being able to backtrack through Morse tokens.
 
@Deadcode It should probably be revised to a greedier algorithm to fix ha dahad a and glow sallglows all and nam est heynames they
 
glows isn't in the dictionary
names isn't either
 
Hm, but why did it make gamest hen and not games then?
 
games isn't in the dictionary either.
And a isn't in it either.
 
7:04 AM
Bad dictionary.
 
Well, I tried a larger dictionary, and each word took more than 6 bits.
(The maximum "choice" exceeded 63)
And it'd be cheating to specifically add just the needed words without counting it towards the byte size of the solution :)
Adding the words in a way that counts would negate the benefit of using the algorithm, I think.
Of course, a separate version of this challenge in which the spaces are required to be present, and in the correct places, would be interesting for that.
 
Anyway, it is an interesting exercise. One could even use word and letter frequencies to find the most probably message.
 
Yes, I'd like to do a version that takes as input the most common N-grams.
Have to find a good source for that first.
 
But that's not for now. Is Saturday afternoon good for you?
 
Absolutely. What UTC time would that be?
 
7:08 AM
I'm available from 7 UTC and onwards.
 
How long would you be willing to devote to my lesson?
 
As long as it takes. I've found that for the mathematically inclined, 3 hours (not necessarily consecutive) gives a very solid foundation for continuing on one's own with increasing one's vocabulary and solving general tasks.
Can I ask what your background is?
 
My mathematical knowledge is rather spotty. In terms of formal study haven't gone beyond AP Calculus, and although I know many of the concepts of proofs, I wouldn't consider myself all that good at them.
I've been programming for a very long time though, since age 8 (so 34 years)
QuickBASIC, Turbo Pascal, x86 asm, dabbled in other asm (6502, Z80, 68000), C, C++, dabbling in many others
 
@Deadcode OK that's good. How about linear algebra?
 
Well I know the basics of solving a system of linear equations, and have worked with some code doing that... (though I'm not intimately familiar with it). I reverse-engineered a hard drive's ECC algorithm and wrote code to reconstruct the missing parts of bad sectors, adapting a matrix inversion function to Galois fields.
Then later puzzled through a document on Reed-Solomon encoding and figured out how to actually detect which portion is bad (if it doesn't exceed half the number of bits devoted to the ECC).
I still don't know how to adapt that code to do a mixture of both things though: tag some bad bits, and then figure out which of the remaining bits are bad, if possible. I have a hunch it's possible.
 
7:22 AM
We don't need that much. Just basic familiarity with matrix operations.
 
Yep, I've got that for sure.
 
APL will be a breeze for you.
 
Nice.
 
Btw, we can even get started in an hour (when I arrive to my office). Otherwise, ping me in the APL Orchard Saturday.
 
 
1 hour later…
8:23 AM
@Adám Thanks for your offer to start now, but I will wait until Saturday. I look forward to it! :)
 
8:38 AM
@Deadcode No problem. Do you know what time you'll be available? If so, then we can schedule it officially so others can join in.
 
 
1 hour later…
9:42 AM
 
 
7 hours later…
4:56 PM
hello all!
 
0
A: Sandbox for Proposed Challenges

simonalexander2005Is it time? Input Any integer, as a string or an integer type, in the range 0..240000 Output Truthy/Falsy value The Challenge Given the input integer, figure out if the number represents a time (truthy) or not (falsy). A number represents a time if a time (hhMMss) with leading 0s removed i...

 
 
1 hour later…
6:00 PM
CMC If we have n binary strings, each of length n, we can compute the smallest hamming distance between any pair. If the strings are chosen independently and uniformly at random the expected smallest hamming distance between any pair has some value. E.g . if n = 4 it is 3/4. What is the smallest n so that the value is greater than 1?
 
Strictly greater than 1? Because n=2 gives you 1, doesn't it?
 
 
1 hour later…
7:12 PM
@AdmBorkBork strictly greater. And yes it does
 
 
2 hours later…
ngn
9:04 PM
@Anush random sampling should work with very high probability
@Anush n=8?
actually, n=7. the values i'm getting are: 3->0.75,4->0.75,5->0.83,6->0.95,7->1.09,8->1.26,9->1.44
 
9:27 PM
Oh that's cool!
Try it online?
 
ngn
@Anush tio
or you can clone and compile ngn/k to run it locally, it should be faster
 
Thanks!
How big a value of n can that get to?
Might have another challenge coming on :)
Hmm..0.75 for n=3 isn't right I think
 
ngn
@Anush i create the samples all at once, so it depends on n, s (the number of samples) and how much ram you have
 
9:49 PM
I am just wondering what the asymptotics are
ie what is the result for large n
Roughly n/2?
 
ngn
@Anush no idea
@Anush what value do you get for n=3?
 
lol any vim golfers wanna show off? vi.stackexchange.com/questions/22469/…
 
47/81 I think
 
ngn
@Anush you've got an algorithm that calculates it exactly? i tried different sample sizes and different prng seeds and i still get around 0.75, so theory and empirical evidence are clashing :)
i'll try to rewrite it in a different language, in case i've made a mistake here
 
ngn
10:13 PM
@Anush similar results with python
 
10:31 PM
1
Q: Javascript Golf: Lodash Open Round 1 — Convert arbitrary string to snake_case

John Bartlet Lots of developers import all 69.2kb of Lodash into their apps. Often to use one function. I thought it would be useful and interesting to code golf all the lodash functions and collate them in one place. So that developers have no excuse. Lodash Open Round 1 _.snakeCase https://lodash.co...

 

« first day (3267 days earlier)      last day (1568 days later) »