Jerry's Blog  1.4.230
mi propio
Data Rings
Data arrays without beginning nor end
Fri April 30 2021  10:33amComputer

Recently participated in another online programming challenge at linuxquestions.org, and ended up learning a new (for me) programming concept.

In a typical database operation, the data are accessed and processed as individual values, or as single- or multi-dimensional arrays. The array has a defined beginning and end, and is usually processed forward from beginning to end. Not so with data rings, which are conceptualized as circular arrays, with no definite start or end points. The data are still stored in memory and on disk in a linear manner (the computer knows nothing of circles or rings), but the program or operation accesses the data in a circular manner.

The image represents in pictoral form one such data ring. The unique trait of this particular ring is that it consists of the numbers 1 through 32 with no repetition, and that each pair of adjacent numbers when added together equals a perfect square number. This is the case regardless of which point you start processing, and regardless of which direction you take, clockwise or counter-clockwise. So this datum is best treated as a ring, or circular array, of numbers.

Data rings could take many forms. Some might be of a static and unalterable size; others may allow the addition and removal of elements. Some rings might allow processing in either direction; others may facilitate either forward (clockwise) or backward (counter-clockwise) processing, but not both. Its elements may be numeric data, textual data, complex structures, or even more data rings. The data ring pictured contains simple integers, is static both as to its size and its contents, and is bi-directional.

The C++ header file 'DataRing.h', defines a data ring class along with structures, definitions, and functions, which you may download and include in your own C++ program. It currently treats of data rings of any static size whose elements are integers, and allows bi-directional processing. As with other CyberJerry stuff it is free software under the GNU General Public License version 3. The terms of this license can be found -> here.

 
Improbable Chess Graphics
html graphics without normal image rendering
Wed March 3 2021  7:31pmComputer

The highly unlikely chess scenario pictured has a couple of interesting aspects:

 
 
 
 
 
 
 
 
 

At first glance, black might seem to be winning. He has all 16 of his pieces (six are still in their original position), while white has lost four of his pawns and three of his power pieces, including the queen. But a closer look shows white to be in control. In fact, he can checkmate in one move (Rf8# 1-0). That is, if it's white's turn. A third look reveals a different twist: Black is so boxed in that, if it's his turn, he has no legal move, and the match ends in a stalemate.

Fine. A pretty cool, if improbable chess situation. But this blog article is categorized under 'Computer' for a different reason: The usual method for drawing the chess pieces would be to create 11 small image files for each of the chess pieces (white queen not needed here), then include them on the grid using the html <img> tag. Another method, not available on many browsers, would be to insert raw image data bits within html elements. In either case, a browser set to not display images would render no pieces on an empty chess board. Modern browsers could use the new html5 <canvas> element in conjunction with javascript, or SVG vector graphics. But such methods are even less widely available. I want my website to work on as wide a variety of browsers as possible, including old browsers, and browsers with image rendering turned off. I think the chess game pictured here should display correctly in any such browser.

For each chess piece, pixels and groups of pixels are individually drawn using html relative positioning of <div> elements whose background color is the color of the pixel(s). So, for example, the following draws 10 black pixels starting at the top of the container html element, 17 pixels from its left side:

<div style="position:relative; top:0px; left:17px; width:10px; height:1px; background:#000;"></div>

There are, of course, a great many such <div> tags for just a single chess piece image, and I certainly didn't type each one in manually, but used server-side php scripting to generate the html code for each chess piece. Can share this php code with anyone interested; just ask. You can also do 'View Source' in your browser to see the actual html code thus generated here.

Am not real sure what practical value lies in either the chess game or the non-standard method of rendering graphics. There may yet be a practical benefit to the latter. Meanwhile, my brain and possibly yours have been occupied with some harmless noodling.

 
Solar Panel
Harvesting the sun for my house
Sat January 30 2021  11:43amMisc.


solar panel

Have recently purchased and installed a solar panel with its various components. Not motivated primarily by ecological nor economic concerns. The grid for large areas of Nicaragua gets its power from a well engineered and environmentally friendly hydroelectric dam just north of Jinotega. My monthly light bill is typically between $U10 and 15 for around 80 to 100 kilowatt hours of energy consumption. But Disnorte is poorly administered and unreliable. Besides, I like the idea of being a bit more independent. Call it a learning experience, if nothing else, and a possible hedge against future needs.

This initial modest experiment isn't (read article)

  2 comments
rev. Fri Feb 12  8:31pm
 
Ode to Sudoku
Sudoku Analyzer development story
Tue November 24 2020  1:53pmSudoku

Sudoku is easy to understand: a 9x9 grid, 81 cells, in which every row, column, and 3x3 box must contain digits 1 through 9. Simple enough, but with enormous possibilities. If one were to write a little program to generate all possible 9x9 grids with all possible combinations of 9 digits in each of the 81 cells, it would have to generate 9^81 (9 to the 81st power) grids (that's a number with 78 digits). I did in fact write such a simple program over 15 years ago. But to complete the task within my lifetime, even on a powerful 5 gHz machine generating, (read article)

  0 comments
rev. Nov 24 2020  8:11pm
 
Version 3
Sudoku Analyzer v. 3.0 released
Wed October 7 2020  2:29pmSudoku

When you press the buttons 'Analyze', 'Hint', 'Peek', or 'Solve', the Sudoku Analyzer sends a small Ajax packet to the server. The 'X' in A.J.A.X. in this case stands for 'executable', a program that runs on the hosting server at cyberjerry.info as a native BSD excutable or binary. The binary performs the requested task and sends another small packet back to your computer to complete the Ajax transaction. This program is written in C and assembly, compiled on the server using gcc, for maximum execution speed. (Sudoku analysis would run way too slowly in a scripting language.) The original and core part of the program, written in assembly, solves the Sudoku by means of simple and fast (read article)

 
Successful Challenger
The first successful Sudoku Challenge respondent
Sun August 23 2020  10:09amSudoku

A few days ago, an astute visitor* to the CyberJerry Sudoku page successfully responded to the Sudoku Challenge, the first CyberJerry visitor to do so. He found the Sudoku grid pictured which the Analyzer couldn't solve, and told me (in Spanish) how to solve it:

este sudoku lo saque de la pagina https://www.sudoku-online.org de categoria sudoku extremo #717, y su analizar dice que no tiene una solución, sin embargo por metodo analitico encuentro que F6 = 4 debido al 4 de E3 y el 4 de G5, tambien encuentro que I9 = 5 debido al 5 de D8 y al 5 de H4, al colocar estos dos números, ahora si dice que tiene solución única lo anterior esta pasando
(read article)

  2 comments
rev. Aug 29 2020  8:31am
 
Ordinariate
How a pilgrim Church might emerge
Wed August 5 2020  5:09pmFaith/Philosophy

It would be unreasonable and unjust to expect priests and bishops in 2020 to forsake their lifestyle and social status and become poor homeless pilgrims. Likewise, the vast majority of Catholic homes of today are incapable of becoming true domestic churches, with the husband assuming the role of pastor and priest. This will take time, probably several generations. But there are a few who could begin, and here's one way it could possibly play out:

A single bishop somewhere might request permission to form an ordinariate (see box). Or a priest could request to do so, and then request ordination as bishop, so as to be able to ordain men to the priesthood. The by-laws of this ordinariate (read article)

If you think much of yourself, God can do little.
If you think little of yourself, God can do much.

Articles
All  
Faith/Philosophy
Sudoku
Computer
Misc.
4/30/21Data Rings  2
3/3/21Improbable Chess Graphics
1/30/21Solar Panel 2
11/24/20Ode to Sudoku
10/7/20Version 3
8/23/20Successful Challenger 2
8/5/20Ordinariate
7/30/20Amateur Priests 1
7/23/20Doctrines, Canons, Buildings 1
7/6/204 Sudoku Challenges
6/19/20Unavoidable Rectangle
6/1/20Sudoku Challenge (2) 1
4/7/20Fear of Death 3
2/14/20Heads Up
1/11/20Billionth Birthsecond 1
12/31/19Versus-2 1
12/18/19Versus
12/3/19Copyright/left 2
10/24/19DePyper 1
7/19/19Schizophrenia 4
7/11/19New Math 1
6/2/19Times and Seasons 4
11/29/18Data Security 1
10/2/18Until 7
9/15/18Empty Chair 11
8/28/18Riddle me this 6
8/1/18Sudoku Challenge Answered 3
7/4/18Unrest in Nicaragua 7
5/9/18Some Specifics
4/20/18Crisis of Authority 4
3/17/18Theocracy 2
3/1/18Self abnegation 1
12/14/17Sudoku Challenge
12/2/17Blog End
11/16/17Meta Blog 6
Copyright (c) 2017-2021 Gerald DePyper - Jinotega, Nicaragua, C.A.
rev. 2021.03.21