99真人注册平台|欢迎注册

Posts in the “technology” category

How to delete individual pages from your Firefox browser history

This website used to be based on Drupal, and as a result I have a bunch of URLs like this in my Firefox browser history:

  • www.deishei42.top/node/add/blog
  • www.deishei42.top/node/add/photo
  • www.deishei42.top/node/add/misc

Since this blog is no longer based on Drupal, having those pages in my history is annoying, so I wanted to delete those individual URLs from my Firefox history.

Deleting individual URLs from my Firefox history

The steps to delete individual pages from your Firefox history aren’t obvious, but they aren’t too hard either:

It’s almost all on your cellphone

Almost every product on this 1991 Radio Shack ad is now on your cellphone (sans the scanner and radar detector).

How to use a non-default table column separator in Asciidoc

As a brief note, if you ever need to use a different column separator when creating a table in Asciidoc, you can do so by specific the separator field in the table preamble.

For example, in the following Asciidoc table I can’t use the default pipe character | to separate the table columns, because I need to use that character in the content inside the table, so I set the separator character to be : instead:

<<methods_to_combine_cmds>> lists the ...

.Methods to combine external commands
[[methods_to_combine_cmds]]
[cols=",",options="header",separator=:,]
|===============================
:Methods :Description
:`cmd1 #| cmd2`  :The output of the first ...
:`cmd1 ### cmd2` :`cmd1` and `cmd2` will be ...
:`cmd1 #> cmd2`  :Normally used to write to ...
:`cmd1 #&& cmd2` :Run `cmd2` if `cmd1` runs ...
:`cmd1 #|| cmd2` :Run `cmd2` if `cmd1` ...
:`cmd1 #&& cmd2 #|| cmd3` :Run `cmd2` is ...
|===============================

I shortened that content so you don’t have to read through all the non-essential text, but the image shows the actual resulting Asciidoc table.

For more information, this asciidoctor.org URL was the most helpful resource for me. This other page shows how you can specify format="csv" to create a table from a CSV-style syntax.

In summary, if you needed to see how to create an Asciidoc table with a non-default table column separator, I hope this example is helpful.

Facebook deleted the “Lists (of friends)” link

When I use Facebook, I like to use lists to group people that I know, friends, relatives, people from different states, etc. But on Thanksgiving, or maybe the day before, Facebook deleted the “Lists” link from their web app. It used to be with this group of links. I don’t use their app on my phone, so it’s pretty crazy that they removed this.

So, dear friends, if I don’t see and like your stuff, it’s not my fault. I’m sure not going to type in the name of each friend to see if they posted anything.

Getting started converting documents with Pandoc

I’m looking into producing my Scala/FP book as a PDF, and as part of that I have been looking into Pandoc. With the exception of converting HTML tables into other formats such as Markdown or LaTeX, Pandoc has been working well so far.

Here are a couple of Pandoc commands to show you how easy this is:

# create a pdf from a markdown doc
pandoc test1.md -s -o test1.pdf

# create an html doc from a markdown doc, long form
pandoc test1.md -f markdown -t html -s -o test1.html

# convert markdown to latex
pandoc test1.md -s -o test1.tex
pandoc test1.md -f markdown -t latex -s -o test1.tex

# read a markdown doc and print html to stdout
pandoc -s table.md --to html

# convert a latex document to html
pandoc -s test.tex -o html

As a “note to self,” I confirmed that LaTeX to HTML approach in October, 2019. It creates a large, single-page HTML document. It’s not perfect, but it worked surprisingly well on a large LaTeX project.

As another note to self, this command helps a little bit with the Pandoc HTML to Markdown table conversion problem:

pandoc table.html --to=markdown_github -o table.md

As a better note, both of these commands work when converting tables in ODT and DOCX files to Markdown:

pandoc Test.odt -t markdown-simple_tables-multiline_tables-grid_tables -o ODT.md

pandoc Test.docx -t markdown-simple_tables-multiline_tables-grid_tables -o DOCX.md

I can confirm that those commands create pipe-delimited Markdown tables from ODT and DOCX input files.

For more information on Pandoc, see their getting started doc and user’s manual.

Markdown comments syntax: Comments that won’t appear in generated output

Markdown FAQ: How do I create comments in Markdown? Especially comments that won’t appear in the generated output.

Part 1 of my answer is that technically there is no way — or at least no standard way — to create comments in Markdown documents, other than to use HTML comments like this:

<!--
    this is a an html comment.
    the bad part of this is that it will appear in
    any document you generate from this markdown, such as if
    you convert this markdown to HTML with MacDown or Pandoc.
-->

The bad part about using an HTML comment is that most Markdown-to-HTML conversion tools keep those comments in the output you generate. I know that Pandoc and MacDown will both include your comments in the HTML output they generate.

Solution: A trick to create Markdown comments

Part 2 of the answer is that a user on Stack Overflow came up with this way to create Markdown comments that won’t appear in generated output:

[//]: # (This syntax works like a comment, and won't appear in any output.)
[//]: # (It’s a little bizarre, but it works with MacDown and Pandoc.)

As they note on that SO page, this approach uses an “unintended side effect of the use of YAML for metadata, but it works.”

This syntax is ugly and I’ll never remember it, but I guess that’s what macros are for. I’ve read that some people have no idea why someone would want to create comments in Markdown text, and to that I reply, “Try writing a book.”

As a summary, I can confirm that this fake Markdown comment syntax works with both MacDown and Pandoc. When I put comments like this in my Markdown source, they do not end up in my generated HTML or LaTeX output, which is what I want.

I realize that most inventions fail not because ...

“I realize that most inventions fail not because the R&D department can’t get them to work, but because the timing is wrong? — not all of the enabling factors are at play where they are needed. Inventing is a lot like surfing: you have to anticipate and catch the wave at just the right moment.”

~ Ray Kurzweil

How to put multiple lines in a Markdown table cell (multiline table)

To create an HTML table in Markdown where a cell in the table has multiple lines (a multiline cell), use the HTML <br> tag to make the line into multiple lines, like this:

| Format   | Tag example |
| -------- | ----------- |
| Headings | =heading1=<br>==heading2==<br>===heading3=== |
| New paragraph | A blank line starts a new paragraph |
| Source code block |  // all on one line<br> {{{ if (foo) bar else   baz }}} |

I made the <br> tags in that Markdown text bold so they’re easy to see.

That Markdown text produces this HTML table output:

Format Tag example
Headings =heading1=
==heading2==
===heading3===
New paragraph A blank line starts a new paragraph
Source code block // all on one line
{{{ if (foo) bar else baz }}}

In summary, if you need to have a table cell span multiple lines when writing Markdown, use the HTML <br> tag, as shown.

Performance is important to acquiring and retaining customers.

I used to use wunderground.com all the time. Then, over time, I noticed that it kept getting slower and slower. Out of frustration I looked around for other good weather websites. Today I use accuweather.com.

On the web and with apps, performance — or lack of performance — is important to acquiring and retaining customers.

Bill Gates’ greatest mistake

TechCrunch has a nice, full quote from Bill Gates on what he considers his greatest mistake. I include part of the quote in this image because his “winner-take-all” comment is so important.

Things I don’t like about Facebook today (June, 2019)

I was writing with a friend about Facebook, and realized how much I dislike facebook.com because (a) they don’t let me control my own timeline — not surprisingly, humans don’t like to be controlled by algorithms — and (b) you definitely get the feeling that you’re a piece of meat and they’re trying to sell you. If they were perceived as a kind, benevolent company that didn’t constantly force their version of “what’s important” on people, people might use it more.

Mobile is not a neutral platform

Ben Evans has an interesting article from 2015 titled, Mobile is not a neutral platform. Here’s a good quote:

“Of course, all this sort of stuff is a big reason why Google bought Android in the first place — Google was afraid that Microsoft (it was that long ago) would dominate mobile operating systems and shut it out. The obvious fear was around things like preloads, and the justice of that fear was proven right with Maps, where Apple Maps now has 2-3x more users on iOS than does Google Maps, despite being a weaker product — the ‘good enough’ default wins and the platform owner chooses what that is.”

How to convert Docbook to AsciiDoc

If you ever need to convert Docbook to AsciiDoc, this Pandoc command seems to work well:

pandoc --wrap=none -f docbook -t asciidoc \
       DocbookFile.xml > AsciiDocFile.adoc
99真人注册平台 <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <文本链> <文本链> <文本链> <文本链> <文本链> <文本链>