Archive for the ‘information technology’ Category

Adapting Images to Small Displays

Friday, 15 January 2021

This 'blog has yet to fully accommodate mobile computing. Images in entries have usually had an absolute width of 450 pixels, which made sense when displays were 640 pixels or more wide (and seldom more than 1920 pixels wide), but is now too wide for some devices.

I've been occasionally patching old entries to fix this problem. With IMG and IFRAME elements, the trick is to add

max-width: 100% ; max-height: Rvw ;

to the string-value of the style attribute, where R is the ratio of the height divided by the width, multiplied by 100. For example, if the image is 450 pixels wide and 900 pixels tall, then

R = 100 · (900 / 450) = 200

Just what happens when R is not an integer seems to be browser-dependent.

An example of an IMG element could be

<img src="wp-content/uploads/2020/11/A6_corrected.png" alt="[image of formula]" width="449" height="92" style="display: block ; margin-left: auto ; margin-right: auto ; margin-top: 1em ; margin-bottom: 1em ; border: none ; width: 26.4em ; height: 5.4em ; max-width: 100% ; max-height: 20.5vw ;" />

When BitChute gives code to embed a video, it looks something like this:

<iframe width="640" height="360" scrolling="no" frameborder="0" style="border: none;" src="https://www.bitchute.com/embed/QKOTRHgzsuQE/"></iframe>

It should look something like this:

<iframe width="640" height="360" scrolling="no" frameborder="0" style="border: none ; max-width: 100% ; max-height: 56.25vw ;" src="https://www.bitchute.com/embed/QKOTRHgzsuQE/"></iframe>

Privacy Concerns

Thursday, 14 January 2021

Those of you concerned with privacy may appreciate that no website in any of my domains has ever used Google Analytics. Nor have these websites ever had a reäction button (such as to Like an entry) connected to Facebook or any other such service. (Those reäction buttons allow visitors to be tracked even if the visitors do not click on them.)

On the other hand, the videos embedded in some of my entries use IFRAME elements, and those elements involve sending a request from your browser to the host of the video file, even if a visitor doesn't start the video, so they might be used to track him or her. All these videos were once hosted on YouTube, most but not all have since been moved to BitChute. I may move every video to BitChute, to reduce potential tracking of my visitors.

[Up-Date (2021:01/15): At this point, visitors are simply not tracked by Alphabet while here. All embedded videos are hosted on BitChute. There are links to some videos on YouTube; but, unless a visitor follows these links, Alphabet is unaware of the visit to a page containing the link.]

Stick That in Your Lexicon!

Saturday, 23 May 2020
bru·to·ri·al /bruːˈtɔːriəl/ adjective & noun
A. noun. An otherwise useless tutorial that one is not permitted to forgo.
B. adjective. Of or pertaining to a brutorial.

A New Projectionist

Tuesday, 3 December 2019

I am in the process of relocating video embedded in entries to this 'blog. (Only a few and rather old entries have such content.)

My experiences with YouTube have been unhappy. It routinely messed-up the synchronization of sound with image for my content. Without a ready appeal process, YouTube disabled videos that made fair use of copyrighted content. Although my content has not been affected by the political bias of Alphabet Inc. (the parent company of YouTube), it was grossly unethical for YouTube to get people to cluster at their site by representing itself as an honest broker, and then to bring a bias to bear. And, when YouTube disabled a video for one reason or for another, the embedding code responded inappropriately.

For now, I am moving most or all of my video content to BitChute; I don't know that my content will remain there. But any host that does not apply an ideologic filter will attract a disproportionate share of content from those penalized by the biases of YouTube; the main-stream of the media (who share the ideologic bias of YouTube) will seize upon this disproportion to claim or to insinuate that the host and those who use it are sympathetic with the more repellent of those filtered-out by YouTube. The sophistry will be evident to all but the rather stupid, but a much larger share of people will rôle-play as if the argument were sound.

'Blog Blues

Friday, 12 July 2019

DreamHost, the hosting service that I use, recently broke this 'blog in at least two ways.

First, they deleted one or more files from my installation of Wordfence, which deletion crippled security. Second, they corrupted the database that underlies the 'blog, causing an old entry on usernames to be very imperfectly duplicated, with a date-stamp of 30 June 2019.

I noticed the problems in the wake of an up-dating of the operating system used by DreamHost; I infer that something went wrong in that process.

I contacted DreamHost and then stewed for some days, leaving things as they were to allow the support staff to set things right. They repaired the installation of Wordfence, offering an implausible conjecture about what had gone wrong. They did not repair the database appropriately.

Bitten

Friday, 28 December 2018

This 'blog has been bit hard by a bug in a plugin.

WP-Sweep includes an ostensible ability to purge categories and tags that are not used for any entries. Unfortunately, the programmer made an error such that the categories and tags purged are any not used in generally accessible entries; tags and categories used exclusively in restricted entries are therefore purged.

Still more unfortunately, I did not discover the bug until after I had made various content changes; simply restoring a previous version of the database would undo those changes. I don't remember what they were, and my only records are the database and saved versions thereöf.

I will, over time, try to repair the damage.

Technical Difficulties

Saturday, 14 April 2018

Readers may have noticed some technical problems with this 'blog over the previous few days. I believe that the problems are resolved.

Recently, browsers have become concerned to warn users when they are dealing with sites that do not support encryption. Simply so as not to worry my visitors, I have tried to support the HTTPS protocol.

But I found that WordPress was still delivering some things with the less secure HTTP protocol, which in turn was provoking the Opera browser to issue warnings. At the WordPress site, I learned that I needed to modify two fields.

Unfortunately, changing these two fields broke my theme — my presentation software — so that fall-back text, rather than the title graphic, was sometimes displayed; but I didn't discover the breakage for a while, because the symptom wasn't always present. Ultimately, I realized that something were amiss. I tracked the problem to inconsistencies in how WordPress determines the protocol of the URI of the 'blog versus that of the directory holding the themes.

I recoded my theme to handle this inconsistency. (In the process of this recoding, my 'blog was made still more dysfunctional over several brief intervals.) My code is now sufficiently robust that it should not break if WordPress is made consistent in these determinations.

A Minor Note on the Myth of admin

Sunday, 12 February 2017

This evening, I was looking at a record of recent failed attempts to log into this 'blog. I found that relatively few attempts tried to do so with the popular username of admin, whereäs by far the majority were with the username oeconomist (that it to say with the second-level domain name). There is not and never has been an account here with username oeconomist; the would-be intruder was guessing mistakenly — but not unreasonably. If my logs are representative, then having an account name match a second-level domain name is less secure than having it be admin. With people avoiding admin, it is natural for crackers to try other likely candidates, including candidates whose probabilities are conditional upon the domain names.

Mind you that the reasoning of my earlier explanation of why the avoidance of admin doesn't add a discernible amount of security if passcodes are properly selected can be applied to avoiding a username that matches a domain name. An account with a known username and a well-chosen password of m+n characters is more secure than an account with a secret m-character username and an n-character password.

Choose a username that pleases you. Choose a password that is long and that looks like chaos, and make occasional changes to it.

Accuracy, Exactitude, and Precision

Monday, 5 September 2016

Dictionaries and thesauri often treat accuracy and precision as synonymous, or as nearly so. But the words accuracy and precision and their coördinates[1] are each most strongly associated with a distinct and important notion. The word exactitude (often treated as synonymous with the previous two) and coördinates are most strongly associated with something rather like the combined sense of those other two, but with a notable difference.

When we say that a specification is precise, we do not necessarily mean that it were correct when judged against the underlying objectives. We may merely mean that it were given with considerable explicit or implicit detail. If I tell you that a musical show will begin at 8:15:03 PM, then I am being precise (indeed, surprisingly so). But the show may begin at some other time; in fact, it may never have been planned to begin at that stated time; I can be both precise and wrong.

If your friend tells you that the show will begin shortly after 9 PM, then she may be accurate, though she was far less precise than I.[2] The word accuracy and coördinates are associated with closeness to the truth; and, in everyday discourse, she might be said to be more accurate were she to be more precise while remaining within the range implied by shortly after 9 PM. But the word is also associated with encompassing the truth; if the precision seemed to narrow the range of possibilities in a way that excluded what proved to be the truth, then she might be regarded a having become less accurate. (If one is told that the show is to begin at 9:15 PM, but it begins at 9:05 PM, then one might feel more misled than had one been less precisely told shortly after 9 PM.)

(Note that it would be seen as self-contradiction to say that someone were accurately wrong, though we sometimes encounter the phrase precisely wrong. The latter carries with it the sense — usually hyperbolic — that the someone had managed to be so wrong that even the slightest deviation from what he or she had said or done would be an improvement.)

Although some people might jocularly, eristically, or sophistically pretend that one truth were somehow truer than another, any meaningful proposition is either simply true or simply false (though which may be unknown and there are degrees of plausibility). If Tom and Dick each go to the store, then it is true that one of them has gone to the store. It is not closer to the truth that two of them have gone to the store. It might be said that it were more accurate that two of them have gone to the store, but this seems to imply that it is truer that two went than that one went, and this implication is false. Fortunately, we have a word and coördinates that can carry with them a particular sense of accuracy and precision, with exclusion. These words are exact, exactly, and exactitude.[3] It is true that one person has gone to the store, but it is not true that exactly one person has gone to the store.[4]

(The expression exactly wrong is usually in hyperbolic contrast with exactly right, but is sometimes applied elliptically, when there is believed to be exactly one way in which to have been wrong.)

Even if one is not greatly concerned with rigor, these distinctions can be important. Asking members of an audience to be more accurate when one wants them to be more precise may inadvertently suggest to the audience that one thinks them to have been untruthful! Typically, risking that inference brings no benefit. It would then be better to ask them to be more precise or more exact.[5] The latter may work best with the passive-aggressive or with the autistic, who might otherwise be more precise while less accurate.


[1] The coördinates of a word are simply the other parts of speech built of the same root and carrying the same general sense adapted to a different grammatical rôle. For example, the adjective accurate and the adverb accurately are coördinate with the abstract noun accuracy.

[2] In discussions of computer science, the everyday distinction between accuracy and precision is made more emphatic, because the mathematics of computing is discrete, and limitations in detail have important implications. For example, ordinary floating-point encoding imperfectly represents numbers such as 1/10. That's why calculators and computers so often seem to add or to subtract tiny fractions to or from the ends of numbers. Number-crunching scientist who do not themselves recognize this issue have generated spurious results by proceeding as if computers have unlimited precision, and thus by mistaking artefacts of limited precision for something meaningful within the data. I strongly suspect that a major reason that so many reported econometric results were not subsequently found by other researchers poring over the very same data was that the original researchers (or, sometimes, the later researchers!) were not taking into account the implications of limited precision.

[3] The words just and only can carry the same meaning, but often bring normative implications.

[4] In mathematics, x translates to for some x, while ∃!x translates to for exactly one x.

[5] Asking a person to be more just or more only would almost surely provoke bafflement.

Styling Programs

Saturday, 3 September 2016

Just as in a natural language there are issues of style on top of those of grammar, of orthography, and of syntax, there are issues of style in computer languages.

For example, in some languages, var = 3 sets var to 3, while var == 3 tests whether var is (already) equal to 3. Omit an = in a test, and the test accidentally becomes an assignment; many programs silently fail as a result of such an omission. But adopt the style of always putting any constant on the left side of the test (eg, 3 == var) and the error (eg, 3 = var, which attempts to set 3 to something) is noticed as soon as the compiler or interpetter reaches it. (There are compilers, interpretters, and separate utilities that will spot possible instances of errors of this sort. It's good to use tools with these features, but best not to be dependent upon them; and one doesn't want the notice of a genuine error to be lost in a sea of largely spurious warnings.)

The specifications of some computer languages, especially of those that are older, significantly limit the lengths of names and of labels; but it's otherwise stylistically best to chose names and labels that clearly identify the nature of whatever is named or labelled. Transparent names and labels then function as integrated documentation. One identifies a lazy or thoughtless programmer by the needless use of opaque names and labels. In Java, the stylistic convention is to name things in ways that clearly identify them; and the convention is to camel-case the names of variables, methods, and classes (eg, countOfBadBits); other languages also allow names to be clearly identifying, but the convention is to separate naming words with underscores (eg, count_of_bad_bits). One uses the naming convention that prevails amongst programmers of that language, so as not to throw-off other programmers who have to deal with the code; it is literally uncivil[1] to use the convention prevailing amongst programmers of one language when writing code in a language where a different convention prevails. (Had it been up to me, then we'd use a different naming style in Java; but it wasn't up to me and I abide by the prevailing convention.)

Many languages end statements with ;. When I helped other students debug SAS programs, I found that the error that they most often made was to omit that semicolon. Sometimes the program wouldn't compile, but sometimes it would compile and silently do something unintended. So I told them to put a space just before the semicolon. The program would still compile just fine if otherwise properly done; but, with all the semicolons visually floating instead of being up against something else, an omission would more easily be spotted. I don't myself use this style for every language in which it would work, but I adopt it for languages in which I notice myself or others omitting the semicolon.

(I was reminded of the general issue of coding style when working on some code written in Python, and wondering whether to put a space before each semicolon.)


[1] Civility is not conterminous with pleasantry; but, rather, a matter of behaving to avoid and to resolve conflict in interaction with other persons.