Some pretty cool code from the 70s'-80s' that a Reddit user shared at this question.
Here's what u/snarkuzoid wrote:
5x5 Knight's Tour in APL
It puts an A in the middle, then randomly does a knight's tour,
| <table> | |
| <thead><tr><th>Id<th>First Name<th>Last Name<th>Email<th>Gender<th>IP Addree | |
| <tbody> | |
| <tr><td><a href='/contacts/1'>1</a><td>Ciel<td>Chaters<td>[email protected]<td>Genderqueer<td>37.149.169.69 | |
| <tr><td><a href='/contacts/2'>2</a><td>Demetre<td>Peche<td>[email protected]<td>Male<td>149.106.111.35 | |
| <tr><td><a href='/contacts/3'>3</a><td>Corbett<td>Kigelman<td>[email protected]<td>Male<td>135.110.34.105 | |
| <tr><td><a href='/contacts/4'>4</a><td>Kelley<td>Hovington<td>[email protected]<td>Male<td>103.45.159.37 | |
| <tr><td><a href='/contacts/5'>5</a><td>Arnuad<td>Souness<td>[email protected]<td>Male<td>87.72.73.84 | |
| <tr><td><a href='/contacts/6'>6</a><td>Hakeem<td>Toland<td>[email protected]<td>Male<td>46.84.81.173 | |
| <tr><td><a href='/contacts/7'>7</a><td>Guntar<td>Gouley<td>[email protected]<td>Male<td>197.227.198.128 |
| ⍝ Helper functions for the problem | |
| ⍝ here: https://open.kattis.com/problems/mnist10class | |
| ⍝ NB: This set of functions does NOT solve the problem. | |
| ⍝ For that, you need a training function, and real inputs | |
| ⍝ that you can check the results against. | |
| ⍝ Generate a random weightset | |
| weightset ← {×0.5-2|?10 15 51⍴2} |
Some pretty cool code from the 70s'-80s' that a Reddit user shared at this question.
Here's what u/snarkuzoid wrote:
5x5 Knight's Tour in APL
It puts an A in the middle, then randomly does a knight's tour,
| Let ( $$_globalConfig = JSONSetElement ( $$_globalConfig ; path ; value ; type ) ; "" ) |
| Let ([b="" | |
| ; raw = JSONGetElement ( $$_globalConfig ; path ) | |
| ; err = Case ( Left ( raw ; 1 ) = "?" ; "" ; raw ) | |
| ]; | |
| err | |
| ) |
| git filter-branch --commit-filter 'git commit-tree -S "$@";' <COMMIT>..HEAD | |
| Then when you're done: | |
| git push -f | |
| NB: This DOES re-trigger any project management automation you have based on the commit messages you're rewriting. | |
| (e.g. "Closes #14" or "Fixes #509") |
| // JSONGetLayoutData ( fields ; config ) | |
| /**** | |
| * PURPOSE | |
| * To grab all the fields off the current layout and process their values into a JSON object. | |
| * | |
| * PARAMETERS | |
| * OPTIONAL : fields : List : Can be used instead of allowing the fields to be grabbed from the layout. | |
| * OPTIONAL : config : JSONObject : Can be used to override the default handling configuration for the various use cases. | |
| * ignore : JSONObject | |
| * containers : JSONBoolean |
| // JSON.ArraySlice ( data ; start ; numberOfValues ) | |
| // Orignally done by Steve Allen (GitHub: @steveAllen0112) of Richard Carlton Consulting (RCC) 05/2018 | |
| // With some "polishing" suggestions from Michael Wallace (GitHub: @mw777rcc), also of RCC | |
| Case ( | |
| /* Check if it's even trying to be an array */ | |
| Left ( Trim ( data ) ; 1 ) <> "[" | |
| ; "? Invalid input; this function only accepts arrays." | |
| / * Check if it's valid JSON */ | |
| ; Let ( $check = JSONGetElement ( data ; 0 ) ; Left ( $check ; 1 ) = "?" ) |