DKerr Gallery

top Tab Notes System

Taking notes is a natural way for recording information for later use. Writing notes using html is also a good way to maintain a facility for html, and perhaps CSS and Javascript.
Beyand a small number of html files (perhaps one to a topic) it becomes apparent that a navigation layer among the files is essential.
Over the years, I've worked on maintaining my notes in an evolving series of navigation schemes.
The drawback of earlier schemes was the difficulty of adding new topics (files) to the system.
Here is my latest system that presents the same navigation to all member files, and is easy to maintain.
It's all self contained; no jQuery or other libraries, just my own css and js files.
Here's how it works:

The key idea is that the js/kymin.js file, imported just before the body tag, formats the tabs for all the note files in the system. Inside js/kymin.js is an array, files[], in which you put all the file names of the html files in the system. The rest of the javascript constructs and displays a menu system, using the file names as the tab label.
To add a new file, just use any of the other files as an html template, give the file some content and a unique file name, then add that file name to the files[] array in js/kymin.js

take a look at bash_notes.html

top Programming tasks, each done in many languages

In order to keep alive my knowledge of how to do things in different programming languages, I've collected my programming explorations into seven files, each focusing on a specific programming exercise, implemented in multiple programming languages.

When I start learning a new language, I start by trying to recreate a simple program I've finished in another language in the new language. Later I can review how to I learned to open a file, read text or binary data, operate on the data, etc. in the particular languages.
Then I feel more comfortable exploring what the new language offers in power and expressiveness, knowing I can at least do stuff I've done before in new language.

I use the tab notes system above, but instead of using js/kymin.js, I use a copy named js/pgmg.js, putting just the relevant files in the files[] array...

Intro: readme_pgmg.html

top Sudoku Solver

Here is a javascript program I wrote to solve sudoku puzzles, along with lots of puzzles I got from newspapers and airline flight magazines. The puzzles can be selected from a calendar on the left hand side; click on underlined days to load a puzzle. Calendar days backlit pale yellow have multiple puzzle links.

You can also load your own puzzle by putting the 81 characters in the horizontal window (use space to represent an empty cell)

Early steps began with displaying a puzzle using html tables and getting a calendar display to work. I use JSON to store solving status.

The first step is to Survey the puzzle and record all the possible candidate values of each cell.
Under the Survey button is the Mask button which implements one pass of a simple mask operation. For example, if the top two rows each have a "1", there is only one 3x3 quadrant that can have a "1" and it must be in it's 3rd row. If that 3rd quadrant has only one unresolved 3rd row cell, that cell must be "1".
It's often productive to repeat the Mask operation, as more opportunites for this strategy emerge as cell values get set. Cell values resolved using Mask operation are displayed in Green.
The CellSurvey button visits each cell's possible candidate values. If a cell has only one possible candidate value, that must be the cell's value, and the cell is promoted to solved status with that value. Displayed in Blue.
The Hide Candidate button removes the display of candidates in unresolved cells, Show Candidates restores the display of candidates.
The R rowcheck looks to see if any row has just one unresolved cell. If so, then unresolved cell's value is the one not in the row. Similarly for columns. Values displayed in Red and Pink
The P prun by row, column button looks at sets of candidates on a row or column, and compare with candidates in the 3x3 quadrants intersecting the row/columsn, prunning impossible redundancies.
The B pruning by 3x3 button starts with candidates in a 3x3 quadrant, compares with value candidates in intersecting rows and columns.
The D double prunning looks at double values in a row or column. If a row has two cells with the same 2 candidates, then those values can be eliminated from all other cells in that row. This is still in debug mode, and stops many times alerting with values/cells being examined.

The P, B, and D buttons prun candidates. Afterwards, the M, C, and R buttons may discover more cell values.
Some puzzles do not have solutions - e.g. 1-13-06, 1-29-06, which result in cells with no candidates left! Did I miscopy them?
Others get so far and no further progress occurs, but all unresolved cells seem to have candidate values... e.g. 2-3-06
These are all Friday Hard puzzles from the AC Press...

You can step B backward and F forward through the values discovered.
you can display a column of values discovered so far using the Toggle Solve Display (a "recent" enhancement, doesn't yet get cleared when you start a second puzzle...)

go to sudokuPlus92.html

9-29-2017 sudokuPlus95.html also lets you print the current state of the game!!

6-21-2019 sudokuPlus97.html uses a bigger database of games

6-29-2021 sudokuPlus100.html uses a bigger database of games

ToDo: branch and bound
Other Ideas - each sudoku puzzle is equivalent to Many puzzles by permutations of rows and columns, etc. Consider a completely solved sudoku puzzle; if you interchange any of the top 3 top rows, the result is also a valid sudoku result; suppose you interchanged the original puzzle the same way - would the same sequence of solution steps, eg M M C M C R R M still solve this new puzzle?
not all row interchanging results in a valid end point (or column interchages)

more ToDo - generate some of the permutations of a given puzzle, set it up to solve.

more ideas: if you pare off some of the original puzzle cell values, maybe the remaining puzzle has several "solutions". Maybe you can explore how sparse the initial set of cell values can be for a puzzle to have a unique solution.

Summary of set up: Download the html file (currently SudokuPlus92.html) and download the .js file containing the puzzles and the code to display the calendar (currently sudoku_games_aug17.js) into the same directory as the html file
6-21-2019 UPDATE: Summary of set up: Download the html file (currently SudokuPlus97.html) and download the .js file containing the puzzles and the code to display the calendar (currently sudoku_games_jun19.js) into the same directory as the html file
6-29-2021 UPDATE: Summary of set up: Download the html file (currently SudokuPlus100.html) and download the .js file containing the puzzles and the code to display the calendar (currently sudoku_games_jun21.js) into the same directory as the html file

Peter Norvig's Solving Every Sudoku Puzzle uses Python, constraint propagation and search. Good experiment: try my unsolved problems in his environment!
One greatful commenter says he learned python by going through Peter's code carefully.

top Unity

8-29-2017 In conjunction with my son, Alex, I wrote a pitch pipe app that can be installed on PC's, iPhones, Android Phones, and probably more platforms. The user can sound a pitch by clicking on a key.
It still needs some display refinements. And it's done with the whole 3D model overhead which Alex uses all the time, even though there's no 3D aspects to this application...
The exercise allowed me to appreciate how sophisticated and powerful Unity is! And learn to use Google Hangouts, bitbucket, and Source Tree.

try it out! pitch.html