« first day (1912 days earlier)      last day (2930 days later) » 

12:01 PM
Sorry, I can't open Imgur from where I am
 
Working?
 
And Imgur on mobile chat doesn't work either
Imgur is blocked in my country and by my data provider
 
@Sherlock9 I wouldn't worry too much about understanding dislike of golfing languages. It's a common response which most people move away from after seeing that they aren't a short cut to victory and still require creativity. Those who don't move away from it and don't express a good reason why probably don't have one.
 
And I'm nowhere near WiFi
 
Ok, we say we have an undirected tree. The BFS algorithm utilises a Queue to store source nodes and a Result array to store nodes visited
 
12:03 PM
@trichoplax You explained better than I could what I wanted to say. Thanks :)
 
@JesterTran alright
 
@Sherlock9 What I don't understand is the Result array, what is it?
 
@JesterTran The result is just showing the order in which the nodes will be visited. First A, then all the nodes directly connected to A, then all the nodes 2 steps away, and so on
 
@trichoplax But the aim is to find the shortest path from A to Z, how does the Result array help?
 
12:06 PM
"Breadth First" means that you look at all the close nodes before you move on to any of the more distant nodes. This contrasts with "Depth First" where you follow a single path all the way to the end before you try the next path.
@JesterTran The result isn't the answer, it is just showing the order in which you will search. Perhaps "result" isn't the best name for it...
 
@trichoplax I'm meant to use the BFS algorithm to find the shortest path which is least number of edges
@trichoplax oh, order of search
So how does the order of search yield shortest path..? I cannot see it
 
If you check all the nodes which are 1 step away, then all the nodes which are 2 steps away, then while checking all the nodes which are 3 steps away you find Z, then you know Z is 3 steps away. There can't be a shorter route because otherwise you would have found it while checking the 1 steps and 2 steps
 
@trichoplax ooooooh
 
64
Q: Hard code golf: Regex for divisibility by 7

CharlesMatthias Goergens has a 25,604-character (down from the original 63,993-character) regex to match numbers divisible by 7, but that includes a lot of fluff: redundant parentheses, distribution (xx|xy|yx|yy rather than [xy]{2}) and other issues, though I'm sure a fresh start would be helpful in sav...

Which of the below would count as a duplicate of this question?
A. regex for divisibility by 3
B. regex for divisibility by 7 in binary
C. regex for divisibility by 3 in binary
 
Result is written as one long list which isn't very informative. If you write it down separately: all the nodes 1 step away, then 2 steps away,... then it will be clearer what it means
 
12:12 PM
@trichoplax I see, thanks. I'll try it out
 
Oh Kenny, are you related to another user on here named Kevin Lau? Or is that just a coincidence?
 
@Sherlock9 That is a pure coincidence.
 
Thank you
 
@KennyLau If answers to the original cannot be trivially converted to answers to the new one then it isn't a duplicate, but may or may not be popular depending on how fresh the task seems
 
@trichoplax Well, then which would be a duplicate?
I also know this rule, but I have no idea how this rule applies to this problem.
 
12:13 PM
@KennyLau I guess you'd have to examine the top answers
 
"trivially converted"
 
Ah - then I'm out of my depth too :)
 
all of them would use the same method
called "Deterministic Finite Automaton"
 
I don't think so.
The shortest answer on the existing challenge uses balancing groups which are no longer regular.
 
@MartinBüttner What do you mean?
 
12:18 PM
most regex flavours aren't really regular expressions in the theoretical sense, because many regex features can match languages which aren't regular. in fact, something as simple as a backreference means that the regex is no longer regular, so there's no corresponding DFA.
.NET's balancing groups are a lot more powerful than that in fact.
 
Hey Martin, I just came up with an idea in the vein of your Sierpinski path-finding challenge
Going up and down Collatz sequences!
It's easier since there's only one path up and down. I just need to come up with a suitable representation for the moves
 
hmmm, interesting. I'm not sure there's a similarly efficient solution though.
there can be three paths from a number, I think
you can always apply the collatz procedure, you can always double it, but in some cases you can also subtract 1 and divide by 3
 
Well, say it's only add 1
Ah yes, the trouble is finding the sequence up to the second number
 
not following
 
Ah excuse me. With the usual algorithm it's just, if odd, *3+1, else, /2
The *3-1, /2, version is actually a different ruleset
 
12:25 PM
oh I thought you would allow going back and forth. otherwise, how is there any path to be found at all?
 
Ohh
Well going up again is going backwards. If x%3==2, (+1)/3 or *2, else, just *2
Hm, actually, that's trivially traveling down both sequences to 1 and reversing where they meet. Maybe allowing *3-1 is a better idea
Ah, I'm rambling. What do you think, Martin?
 
@MartinBüttner But is it used in that question?
 
25
A: Hard code golf: Regex for divisibility by 7

jimmy23013.NET regex, 119 118 105 bytes ^(?>(?=[1468](?<4>)|)(?=[2569](?<4>){2}|)([3-6]()|\d)((?<-2>)(){3}|){7}((?<-4>){7}|(?<2-4>)|){9})+$(?!\2) 111 characters disallowing initial 0s: ^(?!0.)(?>(?=[1468](?<4>)|)(?=[2569](?<4>){2}|)([3-6]()|\d)((?<-2>)(){3}|){7}((?<-4>){7}|(?<2-4>)|){9})+$(?!\2) 113 ...

 
oh
the accepted answer became the "top" answer for me
so would it count as a duplicate?
 
I didn't say that, just that DFAs tend to have very little to do with regex golf :P
 
12:30 PM
See, "other formulations of the conjecture" here: en.m.wikipedia.org/wiki/Collatz_conjecture
 
@MartinBüttner So would it count as a duplicate?
Or equivalently, can they be trivially converted (whatever that means)?
 
@Sherlock9 Still not following. You seem to be saying that both directions are allowed, but then also that search would be limited to one sequence of forward transformation followed by a sequence of backward transformations? I'm not sure which moves are allowed when yet.
@KennyLau I can't tell. I don't know how divisibility by 3 or 7 works in binary, but divisibility by 3 in decimal would probably be a lot easier than divisibility by 7.
 
@MartinBüttner Apologies. Been in a debate competition for the past four days and the explanation part of my brain is fried
 
@MartinBüttner Actually divisibility by 3 in binary is ^(0|1(01*0)*1)+$ using DFA.
 
then there's not much of a challenge is there? :P
 
12:33 PM
What would be the equivalent using "balance groups"?
 
Four moves. When going towards 1 (like the center triangle) *3+1 and /2. When headed away from 1, *2 and (-1)/3 (miswrote earlier)
Ah, I have another idea. Traversing a Ulam spiral with orthogonal and diagonal moves
 
@Sherlock9 it's not clear that every optimal path has to go via 1 though (and seems unlikely). I'd assume that the shortest paths will wiggle up and down on larger values to take shortcuts
@KennyLau it's so short that I don't think they'll be able to save anything
 
@MartinBüttner Well, would you mind saying it anyways?
 
@MartinBüttner Precisely. Why I said towards 1 :D Example to follow, let me type it up
 
I finished coding Brachylog's transpiler in Prolog, this was way less challenging than I thought it would, and now Brachylog's grammar is much more powerful
Lesson learned: don't use Java to hack an esolang :p
4
 
12:42 PM
Prolog added to languages to learn
 
@KennyLau I don't know. There's no "balancing groupify this regex" algorithm and neither is there an obvious way to solve it with balancing groups.
@Sherlock9 oh okay
 
@MartinBüttner I see.
 
it's also a bit like asking "how would you solve this with character classes". when character classes are useless in shortening it, why would you use them?
 
From 20 to 16, steps could be represented as D2, D2, M3A1. Intermediate steps, 20, 10, 5, 16
The trouble is, there's really only one algorithm for this that I can think of for an optimal solution. Is that enough leeway for good golfing?
 
seems a bit like standard BFS path-finding challenge, of which we've had quite a lot on various types of graphs
it's an interesting problem, in that I'd be interested in the shortest paths between various numbers, but I'm not sure it adds a lot to PPCG as a challenge
maybe ? I wonder if there's any interesting shortcuts one can take?
 
12:53 PM
Yeah, it seemed a bit simple.
 
I also wonder if it's on OEIS
(the path lengths)
let me compute the beginning of the triangle. should be easy enough with mathematica
 
@MartinBüttner Ooh, that sounds interesting
@MartinBüttner Hmm, if you could draw the Collatz paths as a shape, that would be cool
 
well I can easily get a graph of the moves, and then run some FindShortestPath queries on it
 
Not sure it would be a triangle since there are two choices at each path instead of three
 
@Fatalize Why were you even using Java? D:
 
12:57 PM
Wonder if I could draw it up as a fractal like the Sierpinski idea? As circles inside circles?
 
@MarsUltor Because that's the language I know the most
And because when I started Brachylog I didn't think I would actually try to make it a real thing
 
22
Q: Draw an Apollonian Gasket

Martin BüttnerGiven three mutually tangent circles, we can always find two more circles which are tangent to all three of those. These two are called Apollonian circles. Note that one of the Apollonian circles might actually be around the three initial circles. Starting from three tangent circles, we can crea...

 
@MartinBüttner Man, Apollonian gaskets could be their own path-finding challenge
Two endpoints, the parameters for the gasket and away we go
 
@Sherlock9 collatz paths don't appear to be in OEIS
 
Huh, I would have thought that the lengths of the paths to 1, at least, would be in there
 
1:08 PM
oh sure they definitely are
 
Ah
 
but not between arbitrary numbers
 
Well, we could start one with diagonalization. 1,2=1; 1,3=7; 1,4 = 2; 2,3 = 6, and so on
 
usually tables are just listed by rows
so the sequence might be d(1,2), d(1, 3), d(2, 3), d(1, 4), d(2, 4), d(3, 4), ...
 
Ah, fair enough
 
1:14 PM
I can't find one that does this, even if I include zeros for d(n, n) or reverse the rows.
(or add 1, in case they count vertices in the path instead of edges)
 
I'll wrote up all three of these challenge ideas in the Sandbox tonight or tomorrow
Sigh. I'll write those challenges up tomorrow
 
Time travelling Sherlock.
 
@MartinBüttner ?
 
1:29 PM
"I'll wrote" sounds like grammar for time travellers.
 
I will killed my grandfather
 
Time travel will have been made grammar more complicated.
5
 
Yup, I'm think so.
 
People are already(?) terrible at conjugating things, this will had made things even worse
 
@MartinBüttner It was a link, but okay :P
 
1:38 PM
that, uh... was not obvious.
oh, you don't even need fan fiction for time travelling sherlock: youtube.com/watch?v=93cQxkkBUfw
 
@MartinBüttner Touché, well played.
 
2:02 PM
@QPaysTaxes wat
@QPaysTaxes If you mean separating the value true from the word true, some languages are more extensible than others
But if you aren't gonna let users override primitive operators, then no
I mean, some languages let you redefine everything. Literally.
As in even redefining +(int, int) is less bad than that
@QPaysTaxes Well, it's really easy to make it into an entirely different language
@QPaysTaxes Probably depends on who you ask
If other people are editing it, probably not unless you have very good documentation
 
2:21 PM
^(0|1(0(01|1(001*0)*11)*(0|1(001*0)*1)0|1(01*00)*01*0(1(10)*11)*1(10)*0)*(0(01|‌​111)*1(001*0|1(10)*11)*0|1(01*0(1(10)*11)*0)*)1)+$
After >1 hour of work
 
that on the other hand could probably be done more cheaply with balancing groups
 
while I don't even know what a balancing group is
 
I've written an introduction on Stack Overflow some time ago, if you're interested. Basically, you can work with stacks in a .NET regex.
 
@Downgoat input Is i, o and n are output, and jolf eats input because jolf is like a calculator. I'm working on a new webpage for it.
^^ very informative
 
2:41 PM
@MartinBüttner do you like my example though?
 
@MartinBüttner Dankeschoen :)
 
@KennyLau what is this for?
 
@orlp Regex that matches binary numbers divisible by 7
Using DFA (Deterministic Finite Automata)
 
@KennyLau wtf
if I paste that string in my terminal it closes the interpreter
 
:o
it also does a magic trick
whoever pastes that string in his terminal would cause the interpreter to close
 
2:47 PM
SFGITW'd /o\
 
1
A: Hard code golf: Regex for divisibility by 7

SecSome years ago I created a regexp for divisibility by 7 for binary numbers: /^0*((1((0(01|1(001*0)*11)*(00|1(001*0)*10))|1(01*0(1(10)*11)*0)*01*0(1(10)*11)*1(10)*0)*(1(01*0(1(10)*11)*0)*1|0(01|1(001*0)*11)*1(001*0)*01))0*)+$/ I never found a good way to minimize regex' automatically, so this o...

I just found out someone already did that xd
 
@ChrisJester-Young I forgot to tell you that I finished that little Racket program. I really enjoyed making it; it taught me a lot about Racket
#lang racket

(define grid (make-vector (* 80 24)))
(vector-fill! grid " ")

(let*-values
  ([(side1 side2) (partition (lambda (x) (zero? (bitwise-and x 2))) (shuffle (range 16)))]
   [(chunks) (append-map list side1 side2)]
   [(rooms) (random 6 11)])

  (for ([chunk chunks] [room rooms])
    (define chunkPoint (make-rectangular (* 20 (modulo chunk 4)) (* 5 (quotient chunk 4))))
    (define randomPoint (+ chunkPoint (make-rectangular (random 20) (random 5))))

    (define farthestCorner (argmax
It could be prettier I contend but it works :P
It kinda sucks that (range doesn't work when the first argument is greater than the second
I have to do (range (min x y) (max x y))
 
I'm having trouble understanding this code:
G`^(?>(?=[1468](?<4>)|)(?=[2569](?<4>){2}|)([3-6]()|\d)((?<-2>)(){3}|){7}((?<-4>){7}|(?<2-4>)|){9})+$(?!\2)
([3-6]()|\d)?!
 
What flavor of regex?
 
should be .NET
the G` is retina
(?=[2569](?<4>){2}|) means for each digit in [2569] push to \4 twice?
 
3:00 PM
Can't help you with that then :P I don't know .NET regex
Could ask Martin
 
I don't think he's here
([3-6]()|\d) is the most confusing to me
Ahh... () is the 4th capture group
which is what (?<4>) was always referring to...
oh it's actually the second
 
@orlp I haven't tried solving any of the box-256 problems myself, but it looks clever.
Regarding the intrinsic size limit of Box-256, that seems as arbitrary as classic Befunge's 80x25 limit, which we're also ignoring.
 
@MartinBüttner Hi
 
@MartinBüttner but is befunge's limit fundamental?
e.g. could it be changed to 100x25 without issue?
 
in what sense?
I think so
 
3:14 PM
because in box256, you can't
it's an 8-bit machine
the fact that it has a limited size of 256 memory slots is fundamental to it
 
ah I see
right, but we do ignore this for 16-bit or 32-bit assembler answers
 
@MartinBüttner sure, because there the fixed-size limit isn't really relevant
another unwanted side effect of your scoring is that it makes editing certain answers a real pain
 
honestly, I prefer Riker's upvoted solution. we always score answers by the bytes in string representation of the source code. it would only be consistent to score Box-256 by the length of the shortest string which you can feed into its "load" feature.
 
@MartinBüttner why? it would penalize box256 to be literally 4x as expensive as it really is
we don't score x86 assembly that way either
 
I don't see us comparing Box-256 to any other language
 
3:23 PM
Anybody use Mac OS X with homebrew?
 
I'm assuming that any challenge where box-256 can be used will be a box-256-only challenge
 
@MartinBüttner I can see it being used for some graphical challenges
not very many, but some
 
@VTCAKAVSMoACE Everyone uses Linux with other package managers, according to my philosophy.
 
@MartinBüttner Could you help me with balancing groups?
 
@KennyLau possibly?
 
3:25 PM
Could you explain this regex to me?
(?>(?=[1468](?<4>)|)(?=[2569](?<4>){2}|)([3-6]()|\d)((?<-2>)(){3}|){7}((?<-4>){‌​7}|(?<2-4>)|){9})+$(?!\2)
 
@zyabin101 Mac is sorta like an overpriced bad version of Linux. :P
 
maybe just part of it
I know it is very long
What does (?<4>){2} do?
 
pushes two empty captures onto group 4
 
But there's only 1 when I try it?
 
how do you test that?
 
@KennyLau probably a bug with regexstorm. if you use 3 instead of 4 it works
 
And then this: ([3-6]()|\d)
Does it mean c[2]++ if pointer.match(/[3-6]/)?
 
((?<-2>)(){3}|){7}
this seems to me c[2]-=7; c[4]+=21;
which seems odd to me
 
It's more like this:
for(i = 0; i < 7; ++i)
  if(c[2]) {
    --c[2];
    c[4]+=3;
  }
or:
c[4]+=3*min(7, c[2]);
c[2]-=min(7, c[2]);
 
3:42 PM
I see
And ((?<-4>){‌​7}|(?<2-4>)|){9}?
 
either subtracts 7 from 4, or moves one from 4 to 2 or does nothing, nine times
 
@CᴏɴᴏʀO'Bʀɪᴇɴ thanks!
 
I see
 
Should Cheddar have implicit cast when you try to add a string and number?
 
@Downgoat no
 
3:50 PM
ok
 
explicit is better
(IMO)
 
oh god, I think I just broke everything ;_;
 
@Downgoat oh dear
 
T_REPL:ERROR - An unexpected error occured while erroring an internal error
  (String:2)+"hello"
  ^
4
 
errorception
 
3:55 PM
@Downgoat no problem
 
@CᴏɴᴏʀO'Bʀɪᴇɴ though a bit of a problem is I lost my program that I wrote yesterday >_>
 
@CᴏɴᴏʀO'Bʀɪᴇɴ fyi you're missing (Gol)?><> from your polyglot answer
 
@Sp3000 wait I didn't explain it? XD
 
Nope
 
3:58 PM
Wow, I missed 12, 13
Fixed @Sp3000 ;)
 
@Downgoat for a side bit of information: javascript's implementation tries to concat by whatever type is on the left
("" + 2 + 3) // "23"
("" + (2 + 3)) // "5"
 
^ so the message is: don't copy Javascript
 
Actually, it's a good idea not to copy any language, to make it distinct.
 
You could throw exceptions on implicit casting, like Python or whatever
TypeError: unsupported operand type(s) for +: 'int' and 'str'
 
4:09 PM
yeah, there's quite a few posts that triggers that
it should check for a h2/hwhatever element first >_<
 
@CᴏɴᴏʀO'Bʀɪᴇɴ I fixed that but somehow it got unfixed with no changes
 
huh
@Quill Could you write a blog post on when vars take on the exact same value in JS, and which value types do this? E.g. a = b = [] means any changes done to one is done to the other, but a = b = 0 has a and b independent.
 
That sounds like a good blog post
You could always write one you know :)
 
I could, but I don't quite understand it myself ^^"
I never get it right :/
 
it looks like non primitives types are referenced, and primitives types become unique
 
4:16 PM
@Quill it does
He has no "bytes" in the header which is a problem
 
yeah, I know, it's a wonder you rep'd up people don't just edit bytes into the post
 
@Quill So, a=b=... would create independent variables iff ... is a primitive?
 
if the value is a primitive type
 
a = b = 2
++a // 3
b
> 2
a = b = []
a.push('goat') // ['goat']
b
> ['goat']
 
4:20 PM
And primitive types are booleans, strings, and numbers, right?
 
yeah
 
@Quill I approve of your choice of example strings
 
I like how your edits got more condescending
Usually people edit the other way around
 
@Quill I disapprove of your word choice
 
@Downgoat Haha, that edit^^
 
4:26 PM
\o/ \o/ finished the first version of arithmetic classes in Cheddar \o/ \o/ \o/ \o/ \o/
 
YAY!
That reminds me, I need to finish Dyia >_<
 
> Note: The PNaCl toolchain is currently restricted to newlib.
fml
 
Gg
hey @mods, can we un-CW this question?
38
Q: What's my name? Produce the name of the language indirectly

Ty AuvilProduce only the name of a programming language using only the facilities of the language itself. The name of the language can only be invoked indirectly, i.e., from non custom environment variables, built-in functions or methods or the interpreter/compiler of the language. Output should be the n...

 
community wiki
 
community-wiki
 
4:32 PM
I should sleep
 
holy crap where did that come from
I typed the message and the ninja came
 
Cat warning!
 
quantum ninja
 
@CᴏɴᴏʀO'Bʀɪᴇɴ When you do, link me to it.
 
4:37 PM
Okay ^_^
 
> 15 packets transmitted, 5 received, 66% packet loss, time 14263ms
"Hi ISP, please no internet problems today, I have to prepare a talk!" - "Sure, here, have 66% packet loss, but only on these specific IP's."
ಠ_ಠ
 
Oh hey, someone made a port of Perl to pNaCL it looks like
how considerate
 
4:53 PM
:|
12 upvotes
>:|
¯\_(ツ)_/¯
More the reason to learn Ruby
You've made the smart choice.
 
@QPaysTaxes Why does 2.3 not support ?c notation?
afaik, it just switched from representing integers to representing single-character strings
so it wouldn't actually work in 1.8 as advertised
I've definitely used ?c past 2.0
 

« first day (1912 days earlier)      last day (2930 days later) »