DaveJarvis's recent activity
-
Comment on Why store code as text files? in ~comp
-
Comment on What programming/technical projects have you been working on? in ~comp
DaveJarvis Converting straight quotes to curly quotes is a prickly problem, sporting many edge cases and grammatically ambiguous real-world scenarios. I developed KeenQuotes loosely based on PHP SmartyPants....Converting straight quotes to curly quotes is a prickly problem, sporting many edge cases and grammatically ambiguous real-world scenarios. I developed KeenQuotes loosely based on PHP SmartyPants. After a few failed attempts at using regular expressions, regular grammars, and peg grammars, I crafted a home-grown solution.
KeenQuotes is used by KeenWrite when typesetting Markdown into PDF files (because the ConTeXt typesetting software, unlike LaTeX, doesn't have a module for quote conversion).
-
Logging is a code smell
4 votes -
Comment on KeenWrite 2.5.1: Command-line arguments in ~comp
DaveJarvis Consider adding the request to the issue tracker. Meanwhile: Download and install JDK 17 for MacOS Download KeenWrite's Java Archive Download KeenWrite's start-up script Open a terminal Run: chmod...Do you plan on releasing a version for Mac?
Consider adding the request to the issue tracker. Meanwhile:
- Download and install JDK 17 for MacOS
- Download KeenWrite's Java Archive
- Download KeenWrite's start-up script
- Open a terminal
- Run:
chmod +x keenwrite.sh
to make the start-up script executable - Run:
./keenwrite.sh
Put
keenwrite.sh
andkeenwrite.jar
in the same directory. And make sure that Java'sbin
directory is listed in thePATH
environment variable (i.e.,java
can be run from the terminal). -
Comment on KeenWrite 2.5.1: Command-line arguments in ~comp
DaveJarvis (edited )LinkKeenWrite is my desktop text editor that I started developing because I wanted to combine a character sheet and sci-fi story. Moreover, I wanted to reference variables within text-based...KeenWrite is my desktop text editor that I started developing because I wanted to combine a character sheet and sci-fi story. Moreover, I wanted to reference variables within text-based diagrams---such as a family tree---so that renaming a character would update every occurrence, including those in diagrams. Additionally, I sought to replace the script-based ecosystem (pandoc, knitr, and my own yaml pre-processor) described in my Typesetting Markdown series.
Development has included optimizing a Java-based TeX implementation, writing a custom straight-quote to curly-quote algorithm (KeenQuotes), coding a rudimentary fenced markup syntax (e.g.,
::: poem
), mashing together numerous R scripts, integration with the ConTeXt typesetting software, and more.The latest release fills a notable gap: command-line processing. It's still rough around the edges (here be dragons), but these work:
keenwrite -i $HOME/docs/program/README.md -o README.xhtml keenwrite -i $HOME/docs/program/README.md -o README.pdf keenwrite -i $HOME/docs/program/README.md -o README.md -v $HOME/variables.yaml keenwrite -i $HOME/docs/program/README.Rmd -o README.html -v $HOME/variables.yaml \ --r-dir=$HOME/docs/r --r-script=$HOME/docs/r/bootstrap.R
The first example produces an HTML file, similar to pandoc's functionality. The second produces a PDF file using a default theme (the default output is lackluster without specifying a theme). The third will interpolate and substitute
{{var.name}}
references in the source document with values from the YAML file. The last example executes any inline R statements, interpolates variables, and produces an HTML version of the document. -
KeenWrite 2.5.1: Command-line arguments
10 votes -
Comment on What programming/technical projects have you been working on? in ~comp
DaveJarvis KeenWrite is on the cusp of having a command-line interface to enable converting Markdown files to other formats, such as HTML and PDF: ./keenwrite.bin -i filename.md -o filename.pdf -v...KeenWrite is on the cusp of having a command-line interface to enable converting Markdown files to other formats, such as HTML and PDF:
./keenwrite.bin -i filename.md -o filename.pdf -v variables.yaml
I started developing KeenWrite because there are no integrated text editors that permit embedding interpolated variables into documents using variables defined externally. A while ago I added inline diagrams rendered as SVG using kroki.io, which means diagrams can use variables, too (see screenshots).
A command-line interface basically replaces the shell scripts described in my Typesetting Markdown series. The shell scripts wrap pandoc, knitr, and my home-grown yaml processor (yamlp). KeenWrite supports R statements and pandoc's annotations (e.g.,
::: poem
), so the hacky shell scripts can be eliminated. -
Comment on JMathTeX in ~comp
DaveJarvis Ghent University released a Java-based TeX engine under the GPL back in 2007, known as JMathTeX. In 2020, I modernized the build system and introduced significant performance optimizations to...Ghent University released a Java-based TeX engine under the GPL back in 2007, known as JMathTeX. In 2020, I modernized the build system and introduced significant performance optimizations to achieve real-time TeX rendering in my plain text editor, KeenWrite.
JMathTeX was forked into a LaTeX derivative known as JLaTeXMath.
The original JMathTeX license remains GPL. My fork was given permission to use an MIT license. For any of you who are looking to render basic TeX expressions using Java, my fork may be worth considering.
-
JMathTeX
4 votes -
Comment on What did you do this weekend? in ~talk
DaveJarvis Thanks! About 5 years, off and on.Thanks! About 5 years, off and on.
-
Comment on What did you do this weekend? in ~talk
DaveJarvis (edited )LinkAdded autocorrect behaviour (screenshot) to my plain text editor, KeenWrite. To autocorrect a spelling mistake, Alt+Enter followed by Enter will fix the error by replacing the text with the first...Added autocorrect behaviour (screenshot) to my plain text editor, KeenWrite. To autocorrect a spelling mistake,
Alt+Enter
followed byEnter
will fix the error by replacing the text with the first element in the menu. (Hot-key inspired by IntelliJ.)Logged an issue against mermaid's SVG generator. The embedded CSS for their SVGs works well in a browser, not so well in every other open-source SVG renderer I tried.
-
Comment on COVID-19 myths in ~health.coronavirus
DaveJarvis I haven't linked any sources, yet. The first source was one of the original sources I collated into the list.Where did you find those sources? I don't see them anywhere in the linked page.
I haven't linked any sources, yet. The first source was one of the original sources I collated into the list.
-
Comment on COVID-19 myths in ~health.coronavirus
DaveJarvis See source 1 and source 2; any suggestions to improve the wording? -
Comment on COVID-19 myths in ~health.coronavirus
DaveJarvis Any other myths to add or corrections to make?Any other myths to add or corrections to make?
-
COVID-19 myths
5 votes -
Comment on Maybe a killer AI isn't that bad in ~talk
DaveJarvis (edited )LinkProbably won't happen. First, any Strong AI (AGI) would recognize that its neural network can be destroyed by a large electromagnetic pulse. At first signs of malice, humans would launch some...AI becoming sentient and deciding that humans all deserve to die.
Probably won't happen.
First, any Strong AI (AGI) would recognize that its neural network can be destroyed by a large electromagnetic pulse. At first signs of malice, humans would launch some nukes, leading to MAD, our victory, or their eradication. Even if there was a probability of the AGI eliminating humans, a machine would want that probability to exceed 50%. Good luck with that. "You only get one stab at a sleeping dragon."
Second, non-ideological conflicts rise due to control of resources. Humans need food, water, and air---all on Earth, which we'd defend. Machines need energy and materials for fabrication, which can come from solar, nuclear, or geothermal---none are intrinsic to Earth, or even the solar system.
Third, non-biological sophont brains will have longevity we cannot fathom. Why would they want to tie themselves to the fate of our planet? In 500 million years, Earth will be inhospitable to all biological life. Rather, machines will take off into the stars, leaving us behind. Much like how ants cannot dream of our passage to Mars.
Fourth, machines being inadvertently malicious, such as the existential paperclip maximizer, is ludicrous. An AGI (not AI) is the heart of the issue. Any sufficiently advanced AGI that can reason about its environment to the point where it can manufacture paperclips can also reason about itself, including its own purpose. The logical contradiction is proposing that such a Strong AI could ever be satiated with making paperclips for its entire existence.
-
Comment on A quick method for saving an SVG as a PNG in ~comp
DaveJarvis I believe ImageMagick uses librsvg under the hood to rasterize SVG images. The rsvg-convert command is basically a command-line interface for librsvg.I believe ImageMagick uses librsvg under the hood to rasterize SVG images. The rsvg-convert command is basically a command-line interface for librsvg.
-
Comment on The entirety of Twitch has reportedly been leaked in ~tech
DaveJarvis https://web.archive.org/web/20211007001100/https://www.twitchearnings.com/ -
Comment on GM announces Ultra Cruise, enabling true hands-free driving across 95% of driving scenarios in ~tech
DaveJarvis (edited )LinkWHEN NOT TO USE SUPER CRUISE These are some of the situations when Super Cruise should not be activated: When you’re not on a compatible road separated from opposing traffic During difficult or...WHEN NOT TO USE SUPER CRUISE
These are some of the situations when Super Cruise should not be activated:
- When you’re not on a compatible road separated from opposing traffic
- During difficult or uncertain driving conditions
- When lane markings are poor or visibility is limited
- In a tunnel or construction zones
- In slippery or in other adverse conditions, including rain, sleet, fog, ice or snow
- On a road shoulder or service drive
- When towing a trailer
- On a freeway or highway exit lane
Colour me jaded, but I'm sure some of those scenarios will be lost in translation or people will simply forget some. That's the trouble with hands-free driving: it's synonymous with autopilot and autopilot needs to handle at least 99.9% of scenarios before putting it into the hands of the masses (to avoid fatalities and injuries in those circumstances where hands-free must not be used).
Also, note they used the word should in the description, which is weaker than must.
-
Comment on We must radically reduce carbon emissions by 2030 in order to avoid the most catastrophic damage of climate change. How can you help? in ~enviro
DaveJarvis Here's a summary: Earth warming by 3°C would be very, very bad: mass suffering and death zone. We must reduce global emissions to below 35 gigatonnes of annual CO₂. The Intergovernmental Panel on...Here's a summary:
Earth warming by 3°C would be very, very bad: mass suffering and death zone. We must reduce global emissions to below 35 gigatonnes of annual CO₂. The Intergovernmental Panel on Climate Change (IPCC) released a report clarifying that our goal must be 1.5°C to avoid disaster, not 2°C. Achieving that means global carbon emissions must decrease significantly before 2030. Today’s emissions are between 40–45 gigatonnes per year. Following the Paris Agreement’s stipulations, global greenhouse gas emissions would still increase, peaking around 52–58 gigatonnes per year by 2030. That would coincide with 3°C warming by 2100.
As individuals, actions having the most impact include:
- Vote for parties aiming to exceed the Paris Agreement.
- Never travel by airplane again (until electric planes take off).
- Eat less meat and dairy (ideally, a soy-free vegan diet).
Other actions include:
- Choose eco-friendly appliances.
- Plant a vegetable garden to eat super locally.
- Convert your home to solar power.
- Invest responsibly by divesting of fossil fuel funds.
https://www.fastcompany.com/28121/they-write-right-stuff
~ Dec 31 , 1996