Showing posts with label ease. Show all posts
Showing posts with label ease. Show all posts

Monday, April 21, 2025

Wendell Berry's The Unsettling of America: Culture & Agriculture

The following are extracts (for review purposes) from The Unsettling of America: Culture & Agriculture, Wendell Berry, 1977:

Chapter One: The Unsettling of America

"Generation after generation, those who intended to remain and prosper where they were have been dispossessed and driven out, or subverted and exploited where they were, by those who were carrying out some version of the search for El Dorado. Time after time, in place after place, these conquerors have fragmented and demolished traditional communities, the beginnings of domestic cultures. They have always said that what they destroyed was outdated, provincial, and contemptible." – p. 4

"Bernard DeVoto wrote[,] in The Course of Empire [(see note 1):] 'The first belt-knife given by a European to an Indian was a portent as great as the cloud that mushroomed over Hiroshima....Instantly the man of 6000 B.C. was bound fast to a way of life that had developed seven and a half millennia beyond his own. He began to live better and he began to die.'...

"The principal European trade goods were tools, cloth, weapons, ornaments, novelties, and alcohol. The sudden availability of these things produced a revolution that 'affected every aspect of Indian life.' " – p. 5

"DeVoto...is so clearly describing a revolution that did not stop with the subjugation of the Indians, but went on to impose substantially the same catastrophe upon the small farms and the farm communities, upon the shops of small local tradesmen of all sorts, upon the workshops of independent craftsmen, and upon the households of citizens. It is a revolution that is still going on. The economy [of today] is still substantially that of the fur trade, still based on the same general kinds of commercial items: technology, weapons, ornaments, novelties, and drugs. The one great difference is that by now the revolution has deprived the mass of consumers of any independent access to the staples of life: clothing, shelter, food, even water....The Indian became a redskin, not by loss in battle, but by accepting a dependence on traders that made necessities of industrial goods. This is not merely history. It is a parable." – p. 6

"One cannot help but see the similarity between this foreign colonialism and...domestic colonialism[.] Now, as then, we see the abstract values of an industrial economy preying upon the native productivity of land and people. The fur trade was only the first establishment on this continent of a mentality whose triumph is its catastrophe." – pp. 6–7

"We can understand a great deal of our history...by thinking of ourselves as divided into conquerors and victims. In order to understand our own time and predicament and the work that is to be done, we would do well to shift the terms and say that we are divided between exploitation and nurture....

"Let me outline as briefly as I can what seem to me the characteristics of these opposite kinds of mind. I conceive a strip-miner to be a model exploiter, and as a model nurturer I take the old-fashioned idea or ideal of a farmer. The exploiter is a specialist, an expert; the nurturer is not. The standard of the exploiter is efficiency; the standard of the nurturer is care. The exploiter's goal is money, profit; the nurturer's goal is health—his land's health, his own, his family's, his community's, his country's. Whereas the exploiter asks of a piece of land only how much and how quickly it can be made to produce, the nurturer asks a question that is much more complex and difficult: What is its carrying capacity? (That is: How much can be taken from it without diminishing it? What can it produce dependably for an indefinite time?)" – p. 7

Chapter Four: The Agricultural Crisis as a Crisis of Culture

"A healthy culture is a communal order of memory, insight, value, work, conviviality, reverence, aspiration. It reveals the human necessities and the human limits. It clarifies our inescapable bonds to the earth and to each other. It assures that the necessary restraints are observed, that the necessary work is done, and that it is done well." – p. 43

Chapter Nine: Margins

"Whatever their claims to 'objectivity,' [certain] people will not examine [a] problem and apply the most fitting solution; [instead] they will reverse that procedure and define the problem to fit the solution in which their ambitions and their livelihoods have been invested. They are thriving on the problem and so can have little interest in solving it.

"And so the first necessary public change is simply a withdrawal of confidence from the league of specialists, officials, and corporation executives who for at least a generation have had almost exclusive charge of the problem and who have enormously enriched and empowered themselves by making it worse....

"[A]s a people, we must learn again to think of human energy, our energy, not as something to be saved, but as something to be used and to be enjoyed in use. We must understand that our strength is, first of all, strength of body, and that this strength cannot thrive except in useful, decent, satisfying, comely work. There is no such thing as potential bodily energy. By saving it—as our ideals of labor-saving and luxury bid us to do—we simply waste it, and waste much else along with it." – p. 219

"[T]he land-grant schools...should be required, as the Hatch Act instructs, 'to assure agriculture a position in research equal to that of industry.' These schools, and their professors individually, should be forbidden to accept work on assignment from any corporation or other outside interest that might wish to market any resulting product[, except] on their own time[.]" – p. 221

"[F]aculty members could be paid half their salary in cash and given the use of a boundary of college farmland the potential annual income from which would be equivalent to the other half. [T]he professor would be in a position to 'take his own advice before offering it to other people.' And much good might be expected from that. Professors might again become people of experience rather than experts. They might again be able to apply their learning to the small problems of ordinary people and to recommend means and methods not profitable to the suppliers of 'purchased inputs.'...

"[W]e must address ourselves seriously, and not a little fearfully, to the problem of human scale. What is it? How do we stay within it? What sort of technology enhances our humanity? What sort reduces it? The reason is simply that we cannot live except within limits, and these limits are of many kinds: spatial, material, moral, spiritual. The world has room for many people who are content to live as humans, but only for a relative few intent upon living as giants or as gods....

"[H]aving exploited 'relativism' until, as a people, we have no deeply believed reasons for doing anything, we must now ask ourselves if there is not, after all, an absolute good by which we must measure ourselves and for which we must work. That absolute good, I think, is health—not in the merely hygienic sense of personal health, but the health, the wholeness, finally the holiness, of Creation, of which our personal health is only a share." – p. 222


1 – The Course Of Empire, Bernard DeVoto, 1952

Copyright (c) 2025 Mark D. Blackwell.

Sunday, March 17, 2019

A rewrite of the Ruby example programs from the Tcl/Tk tutorial at TkDocs

Arguably, for the Ruby computer programming language, the default graphical user interface (GUI) toolkit is Tk (a part of Tcl/Tk). A high-level toolkit, it is cross-platform as well. Some ways of installing Ruby include Tk automatically.

Tk has been given a beautiful introduction in a tutorial by Mark Roseman at TkDocs. Begun in 2008 (its full history can be seen here), it covers multiple languages: Perl 5, Python 3, Ruby, and Tcl.

Roseman's tutorial provides eighteen (18) code examples. They are all written in each of the four languages listed above. Naturally, the code is written in a way which eschews each language's idiomatic features. At least, uncomfortably, I experienced this for Ruby!

In order to learn more fully how to use Tk, I borrowed the tutorial's Ruby example code and rewrote it, using the kind of programming style I might use for production. All eighteen of the resulting Ruby production-style example programs (each in its own file) together comprise my GitHub repository, tutorial-tkdocs.

Copyright (c) 2019 Mark D. Blackwell.

Thursday, March 31, 2016

Mega.co.nz, web-based file streaming & Copy.com users

The following is an open letter to Mega.co.nz about implementing web-based audio file streaming (and attracting Copy.com users):

March 31, 2016
To the management (and developers) of Mega.co.nz:

In two months, on May 1, 2016 (as you may know), Barracuda Networks will close its (reportedly) "highly rated" Copy.com service.

They are directing "millions of users" to convert to Microsoft's similar service.

Instead, to attract some of those users, it might be in Mega.co.nz's best interest to implement certain Copy.com features. I'm thinking of one in particular:

Copy.com's web-based file manager directly automatically streams audio files (particularly Ogg-Vorbis files: those with extension OGG; and MP3 files).

Thus, whenever users shared (with other people) a web link to a directory tree on Copy.com, then the recipients, simply by navigating there, could stream that audio immediately and directly.

In other words, the recipients of the link could find and stream (in a web browser) any audio file: this without any additional (bothersome or worrisome) steps required; i.e., to:
  1. Download the audio file;
  2. Choose an audio player program; or even
  3. Install a special audio player for Ogg-Vorbis files.
In many cases—for many recipients—these additional steps can be show-stoppers.

This is particularly true in the case of public links.

Many Copy.com users would find this direct-streaming feature highly useful, IMO.

Mega.co.nz could attract more Copy.com users to their service by duplicating this feature.

Does Mega.co.nz plan to add this functionality—of direct-streaming Ogg-Vorbis (extension .ogg) or MP3 files—to their web-based file manager? Would Mega.co.nz's management consider it?

Already, Mega.co.nz's phone apps stream audio. In the web-based file manager, a need for this exists also, for the easiest possible access when sharing web links.

With warm regards,

Copyright (c) 2016 Mark D. Blackwell.

Wednesday, July 29, 2015

GNU nano on Windows with UTF-8 and color, howto

Ever since the day I first installed the Debian GNU/Linux distribution, I've been using their default text editor, called GNU nano.

I quite like GNU nano. It can edit multiple files at once (combined with grep, find, or a shell glob); it has syntax highlighting; it can undo (as well as redo); etc. Plus, it's extremely simple to use!

For general use on Windows, IMO the best text editor is Notepad2. Yet when I'm developing software, GNU nano is my editor of choice—even when I'm (forced to be) on Windows—for instance, in Git Bash (Git for Windows).

More broadly, if GNU nano is installed on Windows, it might form a good "bridge" to help Windows users adapt to the UNIX command line (in advance, partially—if they will ever need it). Then (at least) the editor will be familiar. This IMO is the first hurdle.

But first, a little history. Elm (etymology: ELectronic Mail) is a text-based email client. Pine (etym.: the word itself, or Pine Is Nearly Elm) is a text-based email client developed at the University of Washington, where evergreen trees abound. Pico (etym.: PIne COmposer) is a text editor. GNU nano (etym.: a word similar to pico in meaning, or Nano’s ANOther editor) is a free software rewrite of pico which includes many improvements. All of this software is for Unix.

Currently, GNU nano's website says its latest Windows build is version 2.5.3 (of GNU nano). As the download directory informs us, this was last modified on 2016-02-25. Its README.TXT says 'this version of nano for Win32 systems was compiled using...cygwin and PDCurses 2.4.'

Also, however, this GNU nano build was compiled with option '--disable-utf8' (as the command 'nano --version' reveals).

At present, Windows (even as far back as XP SP3) is pretty thoroughgoing in its use of UTF-8. So, because some of my projects need UTF-8, I decided to look into how I could work around this problem.

Ultimately, I extracted nano.exe from a recent version (at that time, 2.1.0-1) of Cygwin. That, as well as copying just a few other files from Cygwin, created a standalone GNU nano which works fine (without the bulk of Cygwin) on my Windows box—and it displays UTF-8. (BTW, I use several Windows computers; I haven't installed Cygwin on all of them.)

Note: you must set the following Windows environment variable (but you can change the 'en_US' part if you like):
  • LANG   :   en_US.UTF-8
You must unset the following Windows environment variable (unless it happens already to have the value 'cygwin'):
  • TERM
If you like, you can do this in a Windows 'batch' file, which then starts GNU nano.

EDIT: Previously, I had suggested setting Windows environment variables HOME and TERM (partly in line with the GNU nano editor's recommendations) but when unconventionally set, these can conflict with other software, notably Ruby.

Typically, when adapted to Windows, most software will calculate the correct 'home' location of user data, but will defer to our choice if we ourselves set the HOME variable. Sometimes that creates problems among the different console-like programs (such as cmd.exe, ConEmu, Git for Windows, Cygwin, etc., especially with their different pathname string formats for the root of a disk drive). One seemingly working value for the HOME variable is %USERPROFILE%.

Also, some software may require the Windows environment variable TERM to be set to some particular value other than 'cygwin'.

The necessary files copied from Cygwin are just:
  • bin\cyggcc_s-1.dll
  • bin\cygiconv-2.dll
  • bin\cygintl-8.dll
  • bin\cygmagic-1.dll
  • bin\cygncursesw-10.dll
  • bin\cygwin1.dll
  • bin\cygz.dll
  • bin\nano.exe
  • etc\nanorc
  • lib\terminfo
  • usr\share\misc\magic
  • usr\share\misc\magic.mgc
  • usr\share\terminfo\63\cygwin
Place these in the same-named folders under your 'nano' program folder. Create an additional folder (in the same place):
  • home\%USERNAME%\
and enjoy.

If you want syntax highlighting, pick up all the syntax highlighting files as well:
  • usr\share\nano\*.nanorc
Although you might run it from cmd.exe, GNU nano can do color-highlighting of syntax nevertheless. To do this, edit etc\nanorc in the following way, but keep its line endings as LF only.

Uncomment any (or all) of that configuration file's lines containing 'include ...' in order to make it pull in the various files above, which you desire. They define the particular sets of syntax which GNU nano will highlight.

The extension of the file you're editing usually determines which '*.nanorc' syntax file GNU nano will apply. (A regular expression atop each syntax file determines this.)

To highlight trailing spaces (often disliked by Git—the version control software), you might find it useful to append usr\share\nano\default.nanorc (and any other syntax-highlighting file you choose) with:

      # Trailing whitespace
      color ,blue "[[:space:]]+$"

To highlight the following as well, add:

      # Spaces in front of tabs
      color ,red " + +"

If you want to make all tabs and spaces visible whenever you type Alt-P, then uncomment and change the 'set whitespace' line in etc\nanorc to:

      set whitespace "»·"

Also, Lubomir I. Ivanov reports he has made a build for Windows of GNU nano 2.2.6. In addition to '--enable-utf8', he compiled with '--enable-extra' obtaining GNU nano's experimental features such as undo. He added a customized Windows command console as well, so his build may be even better.

Copyright (c) 2015 Mark D. Blackwell.

Monday, October 20, 2014

Why I enjoy Evensong

I enjoy Evensong, because weekly for about a year I volunteered (in former days) as an Evensong singer.

This was at The Church of St. Michael and All Angels, directed by the excellent David Riley. That church (in Baltimore, MD) no longer does Evensong, though.

Apparently, they had an ironclad budget for only the music director's part in this (perhaps from a donation), although absolutely no congregation members ever attended (!) that I know of. So, the singers' experience was all fun, performing only for the aesthetic sense of the director.

We (music students) rehearsed a different musical Evensong setting every week during the hour before, and thereupon immediately went "on stage." We even had a countertenor.

Whoever might appear got to sing, so we did so completely for our own pleasure. Most of us attended consistently.

We covered quite a variety of Evensong settings and always (each time) enjoyed an after-party at a Chinese restaurant. :)

So, that's indeed why I enjoy Evensong.

Copyright (c) 2014 Mark D. Blackwell.

Tuesday, January 7, 2014

GitHub should ease line-specific links to the latest commit while browsing master

While (naturally) browsing on branch 'master', GitHub currently requires three(!) clicks to generate any line-specific link for future (permanent) use. These clicks are: History, Browse code (at the top of the history list), and (again) clicking the desired line.

But (only) rarely do people follow these three (extra) steps.

You can blame people (posters) for not following these extra steps, but (as a matter of human nature, IMHO) we can't expect most people actually to follow them, because currently (as they observe it) their gathered links are correct. They merely become obsolete over time.

In practice, this screws up blog and StackOverflow posts, etc. which contain links to specific locations inside source code (on GitHub). For most of these links, their reasonable use is to point to source code (sometimes source lines) visible in the latest commit. Yet these posters (almost always) gather links which actually point to an evolving branch (usually 'master'). As source code evolves, these links quickly become obsolete.

This obsolescence is especially bad with line-specific links, but also happens for file-specific ones.

Here let me say that GitHub's wonderfully good UI is GitHub's greatest and best feature! :)

But the clumsiness of this detail of GitHub's UI (here) is at fault IMHO for this problem. :(

I tried to enlist StackExchange's help to argue this case with GitHub, but to no avail. Also, I asked GitHub directly. We shall see.

This screwup (of obsolete links in people's posts) is apparent, bothersome, and quite frequent!

As a solution, GitHub should consider implementing the following UI improvement:

Make generating such permanent, line-specific links (in browsers' address bars) much easier for their users by adding a button (to all source-display web pages on branches). This button (with a single click) would:
  • Switch from viewing the source code (including a line reference) on a branch, to viewing that source code (including the same line reference) in a blob. To be helpful, that blob must be the latest commit of that branch.

GitHub already distinguishes branch heads from blobs. This is apparent in GitHub's sometime use of the word 'blob' as an URL path segment name (versus the words 'commits/master').

Therefore, GitHub seems easily able to find the latest commit SHA1 for a given branch and do what is desired here: that is, redirect the browser to the corresponding line in the latest commit.

UPDATE: Just four(!) hours later, this nice reply came back from a GitHub staffperson:

"Great idea, thanks! There is a shortcut key "y" that you can hit on any code page to change the URL to the permanent link. But you're right that people may not always choose to do that.

"I've added your idea to our internal Feature Request List. We can't say if/when we may add a feature, however your feedback has definitely been recorded."

Although GitHub's pages don't present this feature in an obvious way, GitHub's Help here further describes their 'Y' shortcut key's hidden access (to it) that she's talking about.

UPDATE: StackExchange support replied with:

I'm not entirely certain what you were trying to accomplish with that post. First, it was on meta.stackoverflow.com, where users go to talk about Stack Overflow itself. We discuss features, community governance, file bugs and similar activities on meta.

However, your post would not have been on topic for Stack Overflow either, it's a complaint about how Github works, as far as I can tell, not a question. We're not a typical forum, we're a Q&A site. To get a better idea of how our engine works, take a brief tour of the features.

Sorry that you had a bad experience, but there's not much we can do about it at this point. If you've got a succinct programming question where the problem can be demonstrated with a short code snippet, you're more than welcome to ask on Stack Overflow. If you have a question about Stack Overflow itself, how it works, or an idea to improve it - then feel free to post on meta.

Regards
Stack Exchange Team

I replied to StackExchange support with:

Hi, Team,
> it was on meta.stackoverflow.com, where users go to talk about Stack Overflow[.]
> about Stack Overflow itself, how it works, or an idea to improve it -
> then feel free to post on meta.
> it's a complaint about how Github works, as far as I can tell, not a question.

Yes, this is about StackExchange.

If you think about it, permanent links, including those to GitHub.com, comprise part of the business value of the StackExchange family of sites.

Your reply doesn't answer my suggestion that it's in the interest of StackExchange, the company, to try to encourage GitHub, the company, to improve their GUI, so that permanent links are easier (and less error-prone) to make.

I'm sure there are ways the staff of StackExchange can convey this interest (of the StackExchange company) to the staff of GitHub.

I cast about for how I can communicate this (I believe helpful) idea to the staff of StackExchange, and the two methods I tried (which you already know about) came to mind. Yes, I have contacted GitHub about this, but I am suggesting that StackExchange do this for itself, as well.

Who else can I contact, besides the StackExchange support team? Do tell!

> Sorry that you had a bad experience

To me, that has little importance. Much more important is the business suggestion for StackExchange, and (as you know) to improve the world, if I can.

From a reply from GitHub, I learned that hitting the 'Y' key switches their webpages to permanent links, easily.

For StackExchange, the problem is that accessing this GitHub switching functionality by hitting 'Y' is not widely known. So, in questions and answers on StackExchange, many people (perhaps) are sharing transient GitHub links.

GitHub may be reluctant to use a half-square inch of real estate on their webpages to make this functionality visible, since that visibility wouldn't help them directly.

But as good neighbors (or something like that) GitHub may be willing to "do the right thing," especially if StackExchange and Wikipedia, et al, ask them to. That's what I think.

Who knows whether GitHub might actually respond? Why doesn't StackExchange try? (i.e., for the purpose of aiding StackExchange's own business interest).

With warm regards,
Mark D. Blackwell

Copyright (c) 2014 Mark D. Blackwell.

Monday, July 8, 2013

Use file extension ".yml" for YAML

Generally, YAML files should be referred to by extension ".yml" (instead of ".yaml", if they have one).

Currently, any remaining use of the extension ".yaml" seems (in my view) slightly silly.

Commonly, the letter X is used for a great variety of meanings including "cross", "extensible", "variable", etc. (e.g. in XML). On the other hand, Y (e.g. in YML or YAML) carries no such extra baggage.

Relatively speaking, Y's use is rather uncommon. The acronym YACC comes to mind (for "Yet another compiler compiler"—BTW, its extension is simply ".y" when generating C language files). Actually, YACC assists more than it conflicts, because historically (as you may know) YAML was an acronym for the similar phrase, "Yet another markup language".

Linguistically speaking, therefore, the acronym "XML" has (in a way) only two informative letters. By contrast, all three of the letters of "YML" are fully informative. Indeed, the existing set of acronyms beginning with Y seems extremely small.

Per Wikipedia's article on information theory, "Abstractly, information can be thought of as the resolution of uncertainty." By implication, this is why a four letter YAML file extension feels greatly overspecified.

For the sake of completeness (though less important), this Ansible project comment (regarding their choice of extension) exemplifies other motivations:

> Three letter extensions owe historical relevance from DOS.
> They also save typing.

But these last two aren't the important reasons—instead, see above.

This comment (from March, 2014 in the Symphony project) also seems relevant:

> Once you have two of the biggest industry players doing ".yml" as the extension, it is the standard.

Information from the YAML.org website dates the organization's most recent activity to 2009 (approximately). Evidence of this comes from:

1. > © 2001-2006 YAML.org All Rights Reserved

2. > [The latest] News:
> 20-NOV-2011 -- JS-YAML, a JavaScript YAML parser by Alexey Zapparov and Vitaly Puzrin.

3. > [The latest] YAML Resources:
> YAML 1.2 (3rd Edition): http://yaml.org/spec/1.2/spec.html

Their latest specification (1.2 above) is from 2009, presumably before much of YAML's worldwide adoption:

> YAML Ain’t Markup Language (YAML™) Version 1.2
> 3rd Edition, Patched at 2009-10-01

Even their latest news item, the above-referenced JS-YAML, uses BTW the extension '.yml":

> var doc = require('/home/ixti/example.yml');

Therefore the staleness of YAML.org's information should greatly lessen the impact today from the recommendation in their FAQ:

> Is there an official extension for YAML files?
> FAQ
> 1. Please use ".yaml" when possible.

Here is a URL for web-searching the usage of the two YAML data file extensions (.yml and .yaml). I found time-wasting discussions of which extension to use here, here and here. Apparently these discussions are a result of the official organization exerting its influence uphill, against prevailing practice.

Maybe the public should complain. Maybe YAML.org would listen!

Here are merely some (of the many existing) usage examples of the shorter extension ".yml" in common use:

Per http://php-mysql-mvc.gajdaw.pl/instalacja/download/DoctrineExport.grt.lua:

> -- NOTES:
> -- 1. The YAML file extension usually is ".yml"

Per http://wiki.catalystframework.org/wiki/howtos/forms/formfu.view:

> NOTES:
> If you want a YAML file extension of .yaml (instead of .yml), you have to configure that.

Per https://code.google.com/p/javabuilders/issues/detail?id=114:

> The default YAML for most projects seems to be .yml, instead of .yaml.
> In NetBeans in particular, the YAML wizard only allows creating a file with a .yml extension

Per http://docs.doctrine-project.org/en/latest/reference/yaml-mapping.html:

> All mapping documents should get the extension ”.dcm.yml” to identify it as a Doctrine mapping file.
> $driver->setFileExtension('.yml');
> The Symfony project sponsored a driver that simplifies usage of the YAML Driver. The changes between the original driver are:
> File Extension is .orm.yml
> Filenames are shortened, “MyProject\Entities\User” will become User.orm.yml
> $driver->setGlobalBasename('global'); // global.orm.yml
> As a quick start, here is a small example document that makes use of several common elements:
> # Doctrine.Tests.ORM.Mapping.User.dcm.yml

Per http://www.fileinfo.com/extension/yaml:

> NOTE: YAML files more often use the .YML extension.

Per https://github.com/jasedit/rypple/issues/3:

> Configuration files should end in .yml, not .yaml
> That's the standard file ending, and should be consistent with expectations.

Per https://drupal.org/node/1935708:

> Posted by cweagans on March 6, 2013
> .info files are now .info.yml files

The only counterexample I have found (using ".yaml") comes from cPanel (in their EasyApache interface, apparently a cPanel product). Generally, cPanel seems somewhat "stuffy" and old-fashioned (i.e., likely to prefer the recommendation of an official organization over common usage). Per cPanel's EasyApacheHowToMoveProfiles:

> Profile are located in the /var/cpanel/easy/apache/profile/custom directory. The filename will be identical to the name you save it with, plus the .yaml file extension.

EDIT: The above reference is from the Wayback machine. However, as of August, 2016, we can still see cPanel using only extension ".yaml".

Copyright (c) 2013 Mark D. Blackwell.

Wednesday, July 3, 2013

Use Ruby-like Mirah to develop for Android

I have minimal experience in Android development—I have set up its development environment and merely compiled something that another has written. I work mainly in Ruby on Rails.

However, for the intrinsic joy from developing something on an Android device, I'm particularly interested in the language Mirah created by Charles Oliver Nutter (the developer of JRuby). I keep Mirah in mind, for whenever it will become practicable to use in Android development.

Perhaps Mirah is ready now—a Google search shows plenty of people using Mirah on Android.

Back in 2011, Nutter wrote an article about Mirah in Dr. Dobb's Journal. To sum up, this is a Ruby-like language designed in such a way that, for any program feature (or user feature) a programmer desires to implement, she would create a new keyword or plugin for the language (somewhat directly in the compiler—this being Mirah's main point of departure) rather than add a new Java package. And, it compiles to the JVM.

Therefore in Mirah (unlike in JRuby-based approaches such as Ruboto) no program needs a package or library beyond what is already in standard Java and Android. Programs written in it are extremely tiny (due to running without huge, additional language libraries) and they load and run (both) extremely quickly on Android devices (with their Dalvik Java virtual machine).

To use Mirah to build an Android app, see the Pindah project.

In order for someone to use Mirah (essentially syntax sugar on top of Java) BTW not only should they be familiar with Ruby, but they must also know Java well.

There's more about Mirah here:

For Android development, other JVM languages, Scala, Clojure, etc., as well as Ruboto, are also interesting.

Various StackOverflow questions relate to Android development using Mirah, JRuby, Ruboto, etc.:

Copyright (c) 2013 Mark D. Blackwell.

Friday, June 28, 2013

Ongoing open-source Rails secret_token vulnerability

Today I was re-alerted to a somewhat dangerous insecurity for open-source Rails apps if their Application.config.secret_token is kept under version control. The relevant file:

config/initializers/secret_token.rb

Rails itself generates this file in this way (without an entry in .gitignore) but it's still dangerous. There's lots of discussion here.

Presumably easily an environment variable could be set in config/application.yml (often kept out of version control) and retrieved at run time into config/initializers/secret_token.rb.

Remembering this would seem the only way to solve the problem and protect one's apps into the future from this known security vulnerability.

Here are Ruby on Rails Security Guide's recommendations:

'[P]lease secure your database configuration, e.g. config/database.yml, and your server-side secret, e.g. stored in config/initializers/secret_token.rb. You may want to further restrict access, using environment-specific versions of these files and any others that may contain sensitive information.' — per its Environmental Security section.

'If you have received an application where the secret was exposed (e.g. an application whose source was shared), strongly consider changing the secret.' — per its Session Storage section.

BTW, newly, Rails 4 has added Application.config.secret_key_base (described in the previous link and Guide for Upgrading Ruby on Rails' section, Action Pack).

'If you happen to share your code publicly, make sure your secret_key_base value is kept private.' — per this blog post.

Presumably, however, this new variable name setting does not remove the current security vulnerability either in Rails 3 or 4 since the Rails secret_token still is under version control.

Copyright (c) 2013 Mark D. Blackwell.

Wednesday, June 19, 2013

Raspberry Pi hobbyist computer

Just now (albeit belatedly) I came across a small, fun $35 computer for hobbyists: the Raspberry Pi.

Have you heard of it?

This recalls _why and others' passionate advocacy of "The Little Coder's Predicament" with projects such as hackety-hack that provide hackable computers again for children.

BTW, Raspberry Pi runs Debian Linux (wheezy).

Copyright (c) 2013 Mark D. Blackwell.

Tuesday, June 4, 2013

Blog posts' date position

Just now I was reading a blog to avoid emailing its author with questions they already blogged about. Like others with this purpose, I read it reverse-chronologically (i.e. from the top).

While reading a blog purposefully to learn the current status of a fast-changing software system it seems important to gather a quick sense of time context for each post.

Inevitably I observe myself sliding my browser window downward to the bottom of each post to get a sense of how long prior to the post above it each was released—just in case the time interval is much, much longer than those above.

Then I slide the window back, indeed with resulting uncertainty that I have recovered the proper beginning of the proper post.

Some blogs may never have a delay of more than two weeks between posts.

If I knew this were the case always I wouldn't even look. But since I am not sure, I find myself looking at the dates.

Viewing a blog's archive helps somewhat (and furthermore I can read a whole blog by clicking its posts in an archive list; but this seems less natural).

So the minor suggestion here, for blog formatters' consideration, comprises the usefulness of placing the date of each post immediately below its title.

Copyright (c) 2013 Mark D. Blackwell.

Thursday, April 25, 2013

Meetup authentication & email addresses

As part of its OAuth authentication process with other apps, Meetup doesn't provide email addresses of its users. (I refer to this official Meetup forum question, and to this page in the Meetup API docs—search the page for 'email'.)

Twitter doesn't provide email addresses either. However, Meetup seems nicer than Twitter.

People use multiple Twitter accounts (I know some who do). But people don't use multiple Meetup accounts (at least supposedly not).

When registering new users through this difficult class of OAuth authentication providers (those which don't supply an email address) one might ask each new user directly for some email address, or might not. Requesting this is normally recommended.

If an app uses Meetup authentication (and it doesn't request and confirm an email address during user registration), and uses another form of authentication also (even added later) then there's no way to identify the same user, if or when they sign on by a different way.

So Meetup authentication (without email) is only good if the app is forever limited to using Meetup authentication alone. With that permanent limitation, in such an app, nobody (mysteriously) will run into the problem of having more than one account.

Of course, having Meetup as the single method of authentication is useful, reasonably, only to apps which are already limited to Meetup users.

Keeping the UI simple (by not requesting an email address when people register) means the app might never have email addresses. But that might be okay if an app uses Meetup authentication alone, forever.

Then one need not bother people with asking for their email address when they first use an app. The ease of that emotional UX moment when new customers are forming their first impression of an app (and making their initial commitment to it), from the standpoint of building a customer base—depending on the app—could be considered more important than ever knowing their email addresses.

BTW, omniauth-meetup is a good gem for doing Meetup authentication in Rails.

Copyright (c) 2013 Mark D. Blackwell.

Saturday, April 20, 2013

Flat UI and Twitter Bootstrap "Mobile First" for Rails

Designmodo's announcement for their free Flat UI (which uses Sass) mentions plans (in the discussion) to release a pay version containing LESS code. And an issue on their Flat UI gem floats a suggestion of possibly porting it to LESS.

Darthdeus' gem flat-ui-rails contains Flat UI precompiled to CSS with no LESS code.

Whether Flat UI will continue to be maintained and useful for Rails doesn't relate to Darthdeus' trivially easy to maintain gem but therefore instead to Designmodo's free Flat UI product itself. So far, BTW, their Pro version seems to be vaporware.

There is a rumor Twitter Bootstrap version 3 "Mobile first" will have a flatter UI, but that's only temporary (for development purposes) according to this article.

Web searching revealed no sign how Designmodo's Flat UI might be affected by Twitter's new "Mobile first" initiative otherwise.

Copyright (c) 2013 Mark D. Blackwell.

Wednesday, November 7, 2012

Install Opa language on 32-bit Debian squeeze, howto

The coolest feature of the Opa web programming language is that it automatically divides developers' programs into server and client sides, compiling to JavaScript.

Though the Opa compiler (as of this writing) doesn't have a 32-bit binary for Windows, I got it working in an easy way on (32-bit) Debian squeeze, after upgrading my nodejs installation.

Following Opa's instructions to install as a user (under the heading, Other Linux Distribution), I downloaded and ran their 32-bit Linux self-extracting package. When prompted, I chose to install it into ~/progra/mlstate-opa.

Then, after navigating to A tour of Opa in the sidebar, under the heading, Easy Workflow, I found and typed into a file, 'hello.opa' their sample program. The command:

$ opa hello.opa --

errored out, asking for more npm modules to be installed.

Rather than exactly following their suggested course of action, which would have installed node modules to root-owned directories, I typed:

$ npm install mongodb formidable nodemailer simplesmtp imap

After that the compiler worked just fine.

Copyright (c) 2012 Mark D. Blackwell.

Friday, November 2, 2012

PC timer for online tests, howto

I needed a timer to take online tests with (on an IBM PC).

And I found PC Timer. It seems ideal for this purpose:

http://www.brothersoft.com/the-pc-timer-1862.html

In order to alert me when a timed test is nearly over, I configured it to run this simple batch file:

@echo off
mode con: cols=100 lines=8
color 4e
echo .
echo .
echo "Time's up"
echo .
echo .
pause

Simple!

Presumably, it will be useful in timing other things, as well.

Beyond the timer, it also has two alarms (for moments, rather than durations, as of version 4.0).

Copyright (c) 2012 Mark D. Blackwell.

Monday, October 29, 2012

Free private hosting, howto

Recently, I came across this discussion of inexpensive alternatives for project source code hosting of private projects:

http://stackoverflow.com/questions/109440/best-git-repository-hosting-for-a-commercial-project

I investigated, and of those with apparent substance, the cheapest (actually free of charge for five users) is Bitbucket:

https://bitbucket.org/plans

I thought someone might appreciate a free alternative to GitHub for their private projects. If so, I recommend you follow these steps:

1. Download a backup of the current version of the source code, and save it on your computer. It should be available here:

https://github.com/{your username}/{your private project}/zipball/master

2. Open a free account with Bitbucket and there create a free, private repository (under your control, for your safety).

Possibly BitBucket will let your developers themselves push to the original repository, just as they can on GitHub.

Copyright (c) 2012 Mark D. Blackwell.

Saturday, July 28, 2012

Select online wikis and discussion boards for startups

In GitHub, there's no email notification associated with wiki changes. That's not very good! They specialize in source control, instead. For more:

http://rants.arantius.com/github-sucks

Stackexchange here discusses GitHub wiki change notifications, but only by setting up another server and programming it. Certainly a startup doesn't have time for that:

http://developer.github.com/v3/repos/hooks/

The old Google groups was bad. But not even the new Google Docs has change notification, either.

So today I researched online wikis and discussion boards for startups, and found this Stackexchange answer. GitHub's wiki does not include notifications, BTW.

Zoho's products seem excellent to me! Generally, their collaboration apps are widely used and integrated with Google Docs. They seem quite good (and cheap) both for their wiki and their discussion forum:

http://www.zoho.com/collaboration-apps.html

Zoho wiki: 'Access controls' (private?). Notifications. Comment threads. Free of charge for three (3) users, $12 per month for four (4) users:

http://www.zoho.com/wiki/wiki-pricing.html
http://www.zoho.com/wiki/wiki-notifications.html
http://www.zoho.com/wiki/enterprise-level-security.html
http://www.zoho.com/wiki/google-apps.html

Zoho online forums: Private (by Google Docs integration). Notifications, but I don't know if they're universal. One forum is free of charge:

http://discussions.zoho.com/
http://www.zoho.com/discussions/features.html
http://www.zoho.com/discussions/intranet-discussions.html
http://www.zoho.com/discussions/features.html#topicadministration
http://www.zoho.com/discussions/solutions.html
https://www.google.com/enterprise/marketplace/viewListing?productListingId=2533+14374228673760475061

--------------
Other online wiki sites:

Wikidot: No integration with Google Docs. Non-public. Private for $50 per year ($4 per month equivalent). Free of charge with advertising:

http://www.wikidot.com/plans
http://www.wikidot.com/faq:private-sites

--------------
Other online forum sites:

ProBoards: $7 per month for ad-free. Oriented to public access; seems somewhat disreputable:

http://www.proboards.com/premium-forum-features

QuickTopic: $49 per year ($4 per month equivalent):

http://www.quicktopic.com/gopro?ref=faq

Teamlab: No pricing found!

Wetpaint: No access control.

Wikispaces: $20 per month for restricted access.

Wikimatrix: for comparing wiki software, said they include online but seem to be installable software. It might not be worth running one's own wiki server.

http://www.wikimatrix.org/wizard.php?d[branding]=&d[domain]=&d[flag]=2&d[language]=&d[support]=&d[wysiwyg]=yes&d[history]=yes&d[go]=1&x=77&y=14

Copyright (c) 2012 Mark D. Blackwell.

Tuesday, July 24, 2012

Getting started with Ajax live updating, howto

Complexity is the enemy of troubleshooting. Remove as many dimensions as possible—it helps in a big way!

To create (with Ajax) your first live-updated web page, this no less applies. (Of course, these kinds of web pages don't require full page refreshes to change their appearance—familiar, right?)

The chosen web stack also makes its own recommendations. For getting Ajax to work, the elements of complexity include:
  • Understanding normally what happens in Ajax on the server and getting that to work, especially in an evolving web stack like Rails. (Googling gives obsolete information.)
  • Learning the details of the recommended language for the browser (naturally it gets compiled into Javascript). This is CoffeeScript for Rails now.
  • Learning the details of the particular Javascript library; Rails now recommends jQuery.
  • Getting from an external server the chosen Javascript library into the browser (which might not be working, giving no sign).
  • Learning in the chosen Javascript library (jQuery, e.g.) how to do Ajax.
  • Learning in (raw) Javascript how to do Ajax in a combination of browsers (using try-and-catch).
  • Learning in (raw) Javascript in a chosen, single browser how to do Ajax (e.g., doing XMLHttpRequest).
  • Learning to troubleshoot Javascript in a browser.
  • Learning the (browser) Document Object Model.
  • Learning Javascript.
For getting first-time Ajax working, all but the last four are unnecessarily complicated dimensions for troubleshooting.

Obviously if Ajax isn't working and nothing's happening, one had better remove all possible dimensions and get one thing working at a time!

So I have written a simple Ajax testbed server for the cloud:
  • It is always running.
  • It is extremely simple.
  • It doesn't have to be installed or configured by you.
  • It responds absolutely identically to:
    • GET and POST requests.
    • Header-specified HTML, JSON, XML and JS requests.
    • URL extension-specified HTML, JSON, XML and JS requests.
  • It simply returns the same JSON no matter what you do.
The testbed is running. Fork it on GitHub! Or tell me how it's not working for you.

Here's some browser client code to match (it runs on Mozilla's browsers):

<!DOCTYPE html>
<html> <head>
<title>bare Ajax</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<script type="text/javascript">
<!--

//Browser support code:

function getAjaxObject(){
  var result;
  try{ //Gecko: Mozilla, Firefox; Webkit: Chrome, Safari; ?: Opera; (etc.?) browsers:
    result = new XMLHttpRequest();
  } catch (e){ //Internet Explorer browsers:
    try{
      result = new ActiveXObject('Msxml2.XMLHTTP');
    } catch (e) {
      try{
        result = new ActiveXObject('Microsoft.XMLHTTP');
      } catch (e){ //Something went wrong:
        alert('Unable to obtain an Ajax object.');
        return false;
      }
    }
  }
  return result;
}

//Non-browser support code:

function targetId() {
  return 'replaceable';
}

function Target(id) {
  this.id = id;
}

function alterTarget(s) {
  var target = new Target(targetId());
  var elem = document.getElementById(target.id);
  elem.innerHTML = s;
}

function requestAjaxUpdate() {
  var req = getAjaxObject();
  //req.open('GET', 'http://localhost:5000/ajax',false);
  req.open('GET', 'http://ajax-testbed-simple.herokuapp.com/ajax',false); //Synchronous.
  req.send();
  //alert(req.status);
  var myJSON = JSON.parse(req.responseText);
  var s = myJSON.message;
  alert(s);
  alterTarget(s);
}

// When the DOM is fully loaded:
window.document.addEventListener('DOMContentLoaded', function() {
  //alert('window document ready');
}, false);

// When images, etc. are fully loaded:
window.onload = function() {
  //alert('window load');
  requestAjaxUpdate();
};

//-->
</script> </head> <body>

<div id="replaceable"  >replaceable-content</div>

</body> </html>

References:

http://ajaxpatterns.org/XMLHttpRequest_Call
https://developer.mozilla.org/en/AJAX/Getting_Started
https://developer.mozilla.org/en/DOM/
https://developer.mozilla.org/en/DOM/About_the_Document_Object_Model
https://developer.mozilla.org/en/DOM/DOM_event_reference/DOMContentLoaded
https://developer.mozilla.org/en/DOM/XMLHttpRequest
https://developer.mozilla.org/en/DOM/XMLHttpRequest/Using_XMLHttpRequest
https://developer.mozilla.org/en/DOM_Client_Object_Cross-Reference/DOM_Events
https://developer.mozilla.org/en/JavaScript/
https://developer.mozilla.org/en/JavaScript/A_re-introduction_to_JavaScript
https://developer.mozilla.org/en/JavaScript/Guide
https://developer.mozilla.org/en/JavaScript/Reference/
https://developer.mozilla.org/en/JavaScript_technologies_overview
https://developer.mozilla.org/en/Server-Side_Access_Control
http://en.wikipedia.org/wiki/Ajax_(programming)
http://en.wikipedia.org/wiki/JSON
http://en.wikipedia.org/wiki/XMLHttpRequest
http://linuxgazette.net/123/smith.html
http://molily.de/weblog/domcontentloaded
http://stackoverflow.com/questions/1457/modify-address-bar-url-in-ajax-app-to-match-current-state
http://stackoverflow.com/questions/6410951/how-to-simplify-render-to-string-in-rails-3
http://www.hunlock.com/blogs/Mastering_JSON_(_JavaScript_Object_Notation_)
http://www.json.org/js.html
http://www.mousewhisperer.co.uk/ajax_page.html
Ajax Tutorial – tizag.com/
http://www.w3.org/TR/XMLHttpRequest/
http://www.w3schools.com/json/default.asp
http://www.w3schools.com/xml/xml_http.asp
http://www.xml.com/pub/a/2005/02/09/xml-http-request.html

Copyright (c) 2012 Mark D. Blackwell.

Thursday, March 1, 2012

Bret Victor - Inventing on Principle

Bret Victor's recent extremely interesting and captivating video, for creators of all kinds, is based on a guiding principle: "Creators need an immediate connection." (His title is, 'Inventing on Principle').

His examples are visually amazing:

Coding a picture (2:46 to 9:39)
Coding a game (12:15 to 14:22)
Discovering new games (15:01 to 16:24)
Coding an algorithm (18:05 to 22:39)
Circuit design (23:02 to 28:05)
Making a video (29:19 to 34:07)
General (34:07 to 36:47)

The rest is interesting in a different way--he talks about principle and personal identity (36:47 onward). I think he organizes his life by means of the first choice, though he says they can be combined. (And in what follows, I paraphrase.)

Choices:
* Stand for a guiding principle; fight for a cause
* Craftsman
* Problem solver

Examples in software:

Larry Tesler (PARC) 38:07 to 44:22
* Vision: "Personal computing."
* Guiding principle: "No person should be trapped in a mode."

People who fight for a guiding principle, unlike Thomas Edison, are not well described primarily as inventors.

A guiding principle embodies a specific nugget of insight. Both Tesler and Elizabeth Cady Stanton (see next):
* Recognized a cultural wrong;
* Envisioned a world without that wrong; and
* Dedicated themselves to fighting for a principle.

Elizabeth Cady Stanton 43:32 to 44:22
* Goal, vision and guiding principle: "Women should vote."

Doug Engelbart 44:22 to 45:25
* Goal: "Enable mankind to solve the world's urgent problems."
* Vision: "Knowledge workers, using complex powerful information tools, which harness their collective intelligence."
* Guiding principle: "Interactive computing."

Alan Kay (PARC) 45:25 to 46:35
* Goal: "Amplify human reach and bring new ways of thinking to a faltering civilization that desperately needs it."
* Vision: "If children became fluent in thinking in the medium of the computer, then they'd become adults with new forms of critical thought and new ways of understanding the world, and we'd have a more-enlightened society, similar to the difference brought by literacy."
* Guiding principle: "Children, fluent in the medium of the computer."

Everything Kay did, and invented, came out of pursuing this guiding principle (vision and goal) with children, following principles that he adopted from Piaget, Montessori, [Papert] and Jerome Bruner. (See also Discovery learning.)

[BTW, this puts into context why the lucky stiff's interest (in Hackety Hack) in programming by children.]

Richard Stallman 46:45 to 47:10
* Goal, vision and guiding principle: "Software must be free."

Copyright (c) 2012 Mark D. Blackwell.

Tuesday, January 10, 2012

Lisp & Ruby metaprogramming

I just reread Paul Graham's article, Beating the Averages, on Lisp being the most powerful computer programming language because of Lisp macros (which, BTW, are not like assembly language macros). It led me to the obvious perception that because Ruby lacks Lisp macros, metaprogramming in it is weaker than in Lisp.

He explains the essence of Lisp macros: '[I]n general, for application software, you want to be using the most powerful ...language you can get, and using anything else is a mistake. ...Lisp code, after it's read by the parser, is made of data structures that you can traverse. If you understand how compilers work, [in Lisp you] write programs in the parse trees that get generated within the compiler when other languages are parsed. But these parse trees are fully accessible to your programs. You can write programs that manipulate them. In Lisp, these programs are called macros. [P]ower ...refers to features you could only get in [a] less powerful language by writing an interpreter for [a] more powerful language in it.'

So, for someone who wants to know where to go next after Ruby, and thinks that, in a Ruby code base, having a high proportion of metaprogramming code, like some say Rails 3 has these days, results in awkwardness, the next step is Lisp. Lisp apparently is perhaps a better metaprogramming language.

Copyright (c) 2012 Mark D. Blackwell.