« first day (3302 days earlier)      last day (1540 days later) » 

12:49 AM
0
Q: Ruleset for RGS's Golfing Showdown

RGSFollowing the feedback on this meta-post and some more feedback I got through chat, I am writing this post to lay down all the rules for the RGS I will be hosting. RGS RGS stands for RGS's Golfing Showdown, a golfing competition. The format The RGS will be a golfing competition with 5 code-go...

 
 
5 hours later…
6:15 AM
0
Q: Do golfing languages support rational number arithmetic?

Dannyu NDosI proposed this code golf on sandbox: Integer Logarithm Take \$a \in ℤ_{>1}\$ and \$b \in ℤ_+\$ as inputs. Write a function \$f\$ that: $$ f(a,b) = \left\{ \begin{array}{ll} \text{Just} \space \log_ab & \quad \text{if} \space \log_ab \in ℚ \\ \text{Nothing} & \qu...

 
 
1 hour later…
7:16 AM
0
Q: Do golfing languages support arbitrary-length integers?

Dannyu NDosDuring a conversation in my proposed challenge in sandbox, there had been some objections about requirments in the challenge. I want to entirely ban a usage of floating-point numbers in the challenge, but as turned out in the discussion, that must be only if the inputs are arbitrary-length integ...

 
7:31 AM
0
Q: Count regex matches

RGSYour task Given a simple regular expression, you have to count how many strings of length n match said simple regular expression. This will just be a subset of regexs. Like, no lookaheads or named groups or recursion or whatever weird things regexs have. Simple regular expression For the purpo...

 
7:46 AM
@ChristianSievers k = 12 completed :) I guess k = 13 will in a few days. It is currently using around 11GB of RAM
 
 
3 hours later…
10:17 AM
CMC: Output the number of days until the next Friday 13th. Input can be any standard date format, or you can read the system date at the time the code is executed. Output for a Friday 13th can be 0 instead of a literal interpretation of the challenge.
 
 
2 hours later…
12:34 PM
1
Q: Predictor Generator

Baaing CowWrite a program that when given a string \$S\$, it generates a program of the same language as itself. The generated program, when given a continuous substring of \$S\$, should predict the next character in an occurence of the subtring in \$S\$. You are guaranteed that this substring occurs exac...

 
@Neil APL (Dyalog), 55 bytes: ⊃⊃⍸13 6⍷↑{2⎕NQ#'IDNToDate'⍵}¨(2⎕NQ#'DateToIDN'⎕TS)+⍳365 Try it online!
 
wow, that's quite long for APL!
 
@Neil It is the date conversions that are verbose.
Ugh, my solution is wrong too.
 
12:50 PM
is there a language where date conversion is really easy/compact?
 
@Anush Dyalog APL version 18.0
 
is that not the version you just used?
 
No, that's 17.1.
 
ah ok
does anyone here understand NFA to DFA conversion?
I am wondering why it is so slow
 
@Neil 18.0: ⊃⍸{(13=3⊃¨¯1⎕DT⍵)∧5=7|⍵}⌊(1⎕DT'J')+⍳365
 
12:53 PM
I am thinking of posing a NFA to DFA challenge.. but perhaps I should understand more about it first myself :)
 
1:05 PM
0
A: Sandbox for Proposed Challenges

buttercrabHello, World, but looong I couldn't find out that this challenge exists If this challenge exists, let me know Write a simple Hello, World! program. The winner is the person who has the longest code. However, any subsequence except itself cannot be the answer. Input You can have input i...

 
APL: wage > 5000
 
2
A: Do golfing languages support arbitrary-length integers?

AdámAPL … is not a golfing language. That said, some APL implementations, like NARS2000, feature arbitrary-length integers. Others, like Dyalog APL, have a library that provides this functionality. Additionally, some APL derivatives, like J, do too.

@Adám called it
 
@Fatalize I know. That's why I linked to your comment.
 
1:24 PM
@Adám ⊃⍋wage,5000⊣⎕IO←0
 
A tad obfuscated.
 
any bash experts in?
nohup top -b -d 60 -p 11086 | grep --line-buffered 11086 | while read line; do echo "$(date): $line"; done >> ramlog.txt &
it needs golfing :)
 
2:30 PM
Announcement: APL Cultivation now! Here.
 
it would be great if we had fans of lots of languages here, like we do for APL
 
We have fans for theoretically every language. However some of them aren't as active as others do.
 
right.. I meant active :)
 
PowerShell is great and does all things.
 
@Anush Money helps:
20
A: Do any of you golf for a living?

AdámYes, I do! I work for Dyalog. Part of my work is "spreading the word", and that officially includes code-golfs. In fact, our APL team is looking to hire, and we are more interested in golfers than regular programmers, as the former are more likely to have the right mindset. At least one active ...

 
2:42 PM
@Adám :)
I want to send myself an email as soon as a particular file is updated. I know how to send the email from the command line, but how do I detect when a file is updated? (In linux)
 
@Anush inotify
 
@Adám thanks! I will take a look
 
3:12 PM
@ChristianSievers well.. k = 13 gave me dfa completed
29158722
Error, Assertion failure
not in any function at seviers13.gap:105
so we know how large the dfa is :)
but the Assert line was a mistake. I'll start again without it unless you think it is important
Assert(0, FinalStatesOfAutomaton(dfa)=[1..size]);
does it fail if you use NFAtoDFA maybe?
that does indeed seem to be the problem
 
@Anush Did you do RemovedSinkStates?
 
no
I guess that's the problem.
 
You can still do it now, and will not take very long
 
if I had saved the dfa!
is there any particular advantage in doing RemovedSinkStates?
What I mean is, should I kill the job I just started to add it?
what is the line to save the dfa?
I will kill the script to add it
 
You can explicitely print the dfa, e.g. to a file with PrintTo, then it will print a comand that will create the automaton
The Assert checks that all states are accepting, which must be true in the original construction. If it is not true, the assignmet of fin gives a value that's not correct.
 
3:29 PM
it seems to only be true if I use RemovedSinkStates
does that make sense?
 
@Anush Yes, the sink state is by definition not accepting
 
ok cool
the file you get from PrintTo (k = 6 in this case) is just a list it seems. i.e. Automaton("det",4531,"abcd",[ [ 2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, \
50, 54, 58, 62, 66, 70, 74, 78, 82, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62
...
I was expecting something that looked more like a graph
Automaton("det",21,"abcd",[ [ 2, 2, 6, 10, 2, 6, 7, 15, 14, 10, 17, 14, 7, 14, 15, 7, 17, 17, 7, 15, 7 ], [ 3, 3, 7, 11, 3, 7, 0, 1\
1, 7, 16, 0, 17, 18, 7, 19, 0, 0, 0, 0, 19, 18 ], [ 4, 4, 8, 7, 4, 13, 0, 0, 15, 7, 8, 7, 0, 7, 0, 20, 21, 21, 20, 0, 0 ], [ 5, 5, \
9, 12, 5, 14, 7, 13, 9, 14, 16, 12, 13, 14, 7, 16, 7, 7, 16, 7, 13 ] ],[ 1 ],[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1\
6, 17, 18, 19, 20, 21 ]);;
for k = 2
how can one read this?
 
@Anush That is very similar to what's in my codegolf answers
 
(It's not just a list which is clear from this smaller example)
restarted it all with code that actually saves the dfa this time
k= 13 takes a bit under 24 hours
 
@Anush Prepend sth. like dfa:= to it and use Read("filename");
 
3:38 PM
thanks
I am still not sure why it is so slow
I mean the dfa is not that large
so it must be doing a lot of work for each state of the dfa
 
@Anush I'm not 100% sure that all non-sink-states that NFAtoDFA returns must be accepting (it's true for the minimal automaton for this language). In any case, fin can also be computed as in the code I gave for k=3
 
it seemed to be true for k up to 10 when I tested it
 
Didn't you use NFAtoDFA for k=12 without problem?
@Anush Was that with NFAtoDFA and RemovedSinkStates?
Oh wait, I think it is true
 
@ChristianSievers it turns out I used the minimization for k = 12
with removedstates
I don't mind as really it's just impetus for finding a faster way to do the nfa to dfa step :)
 
@KritixiLithos right.. but if the DFA has size 10 million say, why does it take 24 hours to make?
 
how big is the nfa?
 
@KritixiLithos < epsilon automaton on 5 letters with 974 states >
@KritixiLithos I can give the whole nfa if you want to play with it
 
maybe i will
 
bpaste.net/D7RQ is how GAP gives it to you
it might be more helpful just to give you the GAP code that makes it?
it is written by Christian Seviers
 
4:19 PM
the gap manual is sufficient for deciphering that
 
I was sort of thinking of a fastest-code challenge to convert this NFA to a DFA
@KritixiLithos cool!
@KritixiLithos if there is way to do this conversion in linear time in the size of the resulting DFA, that would be very awesome
 
@Anush actually could you share the gap code? i would like to play with smaller nfas first
 
of course
@KritixiLithos bpaste.net/R7CA
it will run fast until the dfa:= line
which will take almost 24 hours
 
what does it output?
 
you just need to change the value 13 to something smaller like 2 to play with it
in the end it outputs the number of pairs of binary strings with Levenshtein distance up to k
but it's the NFA to DFA conversion part that I think is most interesting here
(It's all interesting.. but it's the really slow part)
 
5:08 PM
0
A: Sandbox for Proposed Challenges

RGSCodeDrawing one-liner math graph-theory code-golf decision-problem Teaser Behold this formidable drawing: Can you draw this in a single stroke? Give it a try. Can you do this one, now: Give it a try. How it works These "make this drawing with one pen stroke" problems are graph-theory p...

 
I found this riddle recently, and I greatly enjoyed it:
Each letter is a single digit, although not necessarily a unique one
 
2
Q: Are They Similar Polygons?

MukundanTask Given the x,y coordinates (coordinates are guaranteed to be integers) of the vertices of two simple polygons in clockwise or anti-clockwise order. Output a Truthy value if both the polygons are similar otherwise a Falsey value Testcases Input [(0, 0), (1, 0), (1, 1), (0, 1)] # Blue P...

 
 
2 hours later…
7:44 PM
> Server error in '\' Application. The requester has been terminated.
Jeez. A little harsh, killing someone just because the website broke.
2
 
@Anush why are you using top instead of ps?
 
8:05 PM
@Neil to get an update every 60 seconds
 
8:22 PM
at what point should i consider my answer to be valid? currently it passes the provided test cases of the challenge, but i have found edge cases which produce invalid results according to the rules
 
 
3 hours later…
11:21 PM
1
Q: Integer Logarithm

Dannyu NDosObjective Take \$a \in ℤ_{>1}\$ and \$b \in ℤ_+\$ as inputs. Write a function \$f\$ such that: $$ f(a,b) = \left\{ \begin{array}{ll} \log_ab & \quad \text{if} \space \log_ab \in ℚ \\ -1 & \quad \text{otherwise} \end{array} \right. $$ Rules Types and formats of the inp...

 

« first day (3302 days earlier)      last day (1540 days later) »