We observe Red Hand Day, today, also known as the International Day against the Use of Child Soldiers, which…deals with what the more verbose name says. If you prefer something a bit lighter-hearted, in the United States, many people celebrate today as Freedom to Marry Day, part of the movement to destigmatize support of same-sex marriage.

A sketch of a child soldier in the Ivory Coast

I assure you that none of these projects will remotely have the importance of either holiday, and I don’t think that I’d want them to, honestly, unless they actually advocated for protecting people.

Social Media

An interesting discovery came up during the week.

In my post on thinking about Free Culture works like businesses, I mentioned that the free tier at Lime Survey only included a limited number of responses for all surveys, and briefly worried that I might run out of space.

Well, I never got into any danger of running out of responses; only one person has touched the survey, and I would already have gone to that person for input on the project. I don’t come here to whine about the lack of artists flooding to work on an as-yet-unannounced project where I say that I’ll eventually start bringing people in for paid work, though. I have a tiny audience, after all, which probably doesn’t include many people who think of themselves as artists, and I haven’t really defined the value anywhere.

No, I come here to tell you that Lime Survey resets the number of responses remaining every month.

In other words, if (somehow) twenty-five people do suddenly fill out the survey to tell me about their artistic projects and what it would cost to have them do that work for a Free Culture project, I could tell the hypothetical twenty-sixth person to try again when the new month starts, instead of worrying about running my own instance of Lime Survey. That makes me feel far better about the process.

In other words, dear reader, you have no excuse for not filling out the survey.

OK, sure, you might still have legitimate excuses, like “I don’t make any art,” or “this project sounds terrible.” Touché.

Oh, but speaking of the project, I suppose that I should talk about…

The Secret Project Preview

I haven’t set up a repository for the project, yet, and haven’t released any of it. However, if you want the tiniest of sneak peeks into the project, can’t remember where to find the survey, or would like me to remind you when I finally release something, I have a quick placeholder page for The Light’s Edge, as readers of the Entropy Arbitrage newsletter have already heard.

With any luck, having spent some money on the domain name will force me to follow through and release at least the introduction soon.

Notoboto

GitHub - jcolag/NotobotoAnother attempt at a lightweight note-taking application - jcolag/Notoboto

The big effort, last week, went to getting whole-word searches to work, because every model that I had for it in my head failed miserably. For anybody who might need to do this for themselves, in the future, the correct model follows.

  • In Tcl’s implementation of regular expressions, \m anchors the pattern to the start of a word.
  • Likewise, \M anchors the pattern to the end of a word.
  • Therefore, slap one of those on each end of the search string, and…
  • Hold up, there: We need to mark this as a regular expression search.
  • If we didn’t mean to search by regular expressions, then we need to escape what the runtime would otherwise identify as a control character in the search string.
  • Tcl doesn’t have any native escape-the-string function.

To put that model into practice, for whole-word searches, if we don’t want to search by regular expressions, then we escape the usual set of command characters, using the ::regsub command. After we’ve escaped the string, assuming that we needed to, then we can add the aforementioned start- and end-of-word anchors, and set the regular expression search flag.

If that didn’t make any sense, I put together this code, which might make the flow a bit clearer.

if {$wordSearch} {
  if {!$regexSearch} {
    # Escape all command characters.
    ::regsub -all {[{$\^.?+*\\|()\[\]}]} $searchTerm {\\&} searchTerm

    # Without any regular expression, use a regular expression search.
    lappend searchOptions -regexp
  }

  # Add (regular expression) word boundaries.
  set searchPattern "\\m$searchTerm\\M"
}

The actual searching follows that snippet, in the application code.

Other than the whole-word search fiasco, I’ve mostly started cleaning up. The search interface now has check-boxes to turn on case-sensitivity, whole-word searching, and regular expression searching, which goes with the search functionality itself. Plus signs (+) now show up as part of URLs, as they always should have. Creating a new note can now happen when the user only has a category of notes selected, rather than needing to select a note to create a note; I don’t know how that got past me. And speaking of categories, the application now focuses input on the category list on start-up, to make it faster to get at the desired note.

Boring CSS

GitHub - jcolag/boring-cssA set of CSS files (for me) to use for prototyping - jcolag/boring-css

I discovered some new CSS styles, and integrated them into the existing stylesheets to make things look slightly more consistent.

Somehow, I had not heard about accent-color before now, which sets the internal color for checkbox, radio, range, and progress elements. Without it, the browser uses its default color, usually that jarring blue that we’ve all grown familiar with. Now, Boring CSS color schemes will use the “local” magenta color in dark mode, and the yellow in light mode.

Note that, because I “draw them in” with other CSS features, this won’t work with the custom-look controls with the more extensive “design language” files. I’ll need to set their colors separately, at some point.

Similarly new to me, text-wrap can now take the value balance, which tries to maintain a similar line length for the entire paragraph, so the style now does that, by default. Despite the temptation to do so, I decided not to apply this style to the blog, because the balanced paragraphs tend to have varying widths, which looked too distracting to me.

Next

I believe that I have Notoboto almost where I want it—though I do want to finish the replacement code, and I’ll certainly want more features over time—so I expect a fair amount of the week to clean up what I have. And following on the CSS changes mentioned above, I may also want to tweak some of the blog code to work better across languages, even though I haven’t given any thought to translating posts so far.


Credits: The header image is Child Soldier Afrika by Gilbert G. Groud, made available under the terms of the Creative Commons Attribution Share-Alike 2.0 Germany license.