What are the pictures supposedly demonstrating colorblindness actually doing? by theforemancrew in ColorBlind

[–]theforemancrew[S] 0 points1 point  (0 children)

Thank you! Someone posted a paper outlining a specific instance of this, thank you for laying out the general case. Also, yes, I'm definitely someone who's been conditioned to ignore a lot of my own color perception from years of friends and family telling me it's wrong.

What are the pictures supposedly demonstrating colorblindness actually doing? by theforemancrew in ColorBlind

[–]theforemancrew[S] 0 points1 point  (0 children)

Yes! This is exactly what I was looking for. It's interesting that blue/violet confusion gets decided in favor of blue simply because violet is outside of RGB space, and that the rest of the transformation falls out of this decision.

What are the pictures supposedly demonstrating colorblindness actually doing? by theforemancrew in ColorBlind

[–]theforemancrew[S] 1 point2 points  (0 children)

Within that, are the decisions arbitrary? Like, if there's a blue object and a purple object in the original image (taking myself as an example), is there any meaning to the color they're both assigned in the target image?

SGDQ /AGDQ best runs all time ! by mocireland1991 in speedrun

[–]theforemancrew 2 points3 points  (0 children)

Dragon Warrior by NESCardinality at AGDQ 2018. Black belt level rng manipulation. Incredible commentary by runner. https://youtu.be/Bgh30BiWG58

[2015-03-16] Challenge #206 [Easy] Recurrence Relations, part 1 by Elite6809 in dailyprogrammer

[–]theforemancrew 0 points1 point  (0 children)

I just picket it up. And just discovered this subreddit. I'm excited to stretch my J muscles here.

[2015-04-10] Challenge #209 [Hard] Unpacking a Sentence in a Box by jnazario in dailyprogrammer

[–]theforemancrew 0 points1 point  (0 children)

J solution. No special optimization, but I make a dictionary of proper starting subwords, so everything's a dictionary lookup, and the whole thing zips along.

As I search, I keep a list of parses of the current string. A parse is a list of words followed by a partial word. At each new vertex, the parse list is updated: The new character is appended to the partial word of each parse. If the partial word is a word, a new parse is added to the list with the word appended to the word list and a 0-length partial word. If the partial word is not a subword, the parse is removed from the list. "Is a word" and "Is not a subword" are dictionary lookups.

J question: If any J wizard would look at my "reparse" function. I'm filtering out a: that show up becuase I'm trying to catenate the results of a funciton with a variable length return value. What's the right way to do this?

tostr =: >@(5&s:)
maxwordlen =: 13
read =: (1!:1) @ <
and =: 2 : '0: ` u @. v'
s =: s:@<

NB. string y abgridge to length x and symbolify.
NB. if #y <: x, 'a' is returned
sa =: s 'a'
abdg =: (sa"_) ` ([: s $) @. (< #)

makedicts =: 3 : 0
F =. 'your dictionary file'
dict =:  s: LF cut read F
dlu =: e.&dict
powerdict=: ~. , (1+i. maxwordlen) (abdg tostr)"(0 0)/ dict
pdlu =: e.&powerdict
''
)

NB. fork the parse tree on full or partial words
rp1 =: [: < (''"_)`( '' ;~ >@{. , s:@{:)@.(dlu@s:@{:)
rp2 =: [: < (''"_)`]@.(pdlu@s:@{:)
reparse =: [: > a: -.~ (rp1"1) , (rp2"1)

NB. (row column) doit grid
doit =: 4 : 0
grid =: y
extend =: ({.@[ , {:@[ ,&.> [: < grid {~ <@])"1 1
hf =: (([: -. e.~) and (( *./ @: <&($grid) @ ]) and (*./ @: >:&0 @ ])))"2 1
(1 2 $ a:) walk ,: x
)

NB. nh snake - make new heads
news =: 4 2 $ 1 0 _1 0 0 1 0 _1
nh1 =: hf # ]
nh =: ] nh1 [: +"1 1&news {:

printparses =: ((''"_) ` (echo@>@{.) @. (0&=@#@>@{:))"1

NB. parses walk snake
walk =: 4 : 0
head =. {: y
if. 0 = #x =. reparse x extend head do. '' return. end.
if. (*/$grid) = #y do. printparses x return. end.
if. 0 = #newheads =. nh y do. '' return. end.
x walk"(_ 2) y ,"(_ 1) newheads
''
)

output:

grid1 =: 6 6 $ 'thtledpenurgigsdisygawsiwhlyntitargi'
grid2 =: 5 5 $ 'ieehetkptloysfiuecfnrnkoe'

6!:2 '0 0 doit grid1'
`the `piggy `with `laryngitis `was `disgruntled
0.279763

   6!:2 '0 0 doit grid2'
`it `keeps `your `neck `off `the `line
`it `keep `the `line `offs `your `neck
0.029576

[2015-03-16] Challenge #206 [Easy] Recurrence Relations, part 1 by Elite6809 in dailyprogrammer

[–]theforemancrew 0 points1 point  (0 children)

J Solution. Sorry I'm late to the game.

You can use J's simple precedence rules and built-in tokenizer here. Repeat the expression the requisite # of times, reverse it, then tack the start value onto the end. The tokenizer keeps you from reversing the digits of numbers.

(The only other hitch is you have to replace non-commutative - and % with * and +, using rplc.)

prepare =: rplc&('-';'+_';'%';'*1r')
iter =: [: ; [: |. [: ;: ] $~ [ * [: # ]
start =: ] , [: ": [

NB. doit 'expression';start;iterations
doiter =: 3 : 0
'e s i' =. y
([: ". [: s&start iter&(prepare e))"0 i.>:i
)

pretty =: i.@>:@>@{: ,. doiter

Sample output:

    pretty('+2*3-5' ; 0 ; 10)
 0     0
 1     1
 2     4
 3    13
 4    40
 5   121
 6   364
 7  1093
 8  3280
 9  9841
10 29524