Blog 1

Random Talk on Random Thoughts

Comparison of $\rm \LaTeX$'s "Quote" and "Quotation" Environments

| Comments |

To quote another one’s words, one can paraphrase the words. For some reason(s), (Perhaps being too lazy, or want to accurately reflect another one’s words.) one would like to directly quote what another one has said.

To show the difference in $\rm \LaTeX$, I’ve made a PDF file a year ago. It’s now on Google Docs.

I created the above PDF document using quote.tex.

For many computer users who aren’t familiar with $\rm \LaTeX$’s syntax but HTML’s, they should find Markdown easy to write, and pandoc easy to use.

$ pandoc -s \
> --mathjax=http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML-full \
> foo.markdown foo.tex

The result is shown in quote.markdown.

Posted via UltraBlog.vim.

My First WordPress Post Using Gist

| Comments |

Note: This post won’t make sense here. Refer to the original post.

Note: I can now figure out a way to work with both UltraBlog and WordPress.com’s built-in online code highlighter. See my newer post for details.

Markdown is easy to write. However, writing code with code tag (surrounded with []) using UltraBlog in Vim doesn’t work. In order to post some code, one needs to use 3 backticks. (I’ve found a way to use the built-in SyntaxHighlighter now because I’ve realised that a blank line in Markdown will be changed to a <p> tag in HTML. Thus, don’t put any blank lines right above and below the the <code> tags.)

1
2
element1 = document.getElementById("foo");
element1.innerHTML = "Hello world!";

There’s some shortcomings of the above method. If you need to copy a list of source code, you’ll need to browse the source code, provided that the “gutter” option of the code list is “true”, which is the default. Moreover, if you include source code that consists of <angled blocks> in a blog post written in Markdown using the UltraBlog plugin, then the angled block may be interpreted as an HTML tag element, such as the statement #include <iostream> in a C++ program. More importantly, I’ve found out that this apporach doesn’t work with UltraBlog. The above code list verifies this assertion.

Screenshot of the "code list" in UltraBlog.vim

Figure 1: This is a screenshot of the “code list” in UltraBlog.vim. Markdown quick reference suggests the use of 3 backticks.

fig1

Figure 2: The above figure shows how the source code for the “code list” (in lines 12–15 in UltraBlog.vim, see Figure 1) is interpreted.

Posting Code to Gist Efficiently

| Comments |

Gist enables computer users to post their source code online. Since Gist is a GitHub repository, they can view each change to the code.

However, it is inconvenient to use the online editor in the homepage of Gist, especially for geeks. For example, Chen believes that it’s not good to manually type or paste the code onto Gist. I directly quote his words here.

但是阿,如果你是手動把 code 弄到 gist 上面,那這樣就太遜了,基本上各大編輯器都有跟 gist 互動的 plugin,如果你用 Vim,可以使用 gist-vim,可以讓你直接在 Vim 裡生成、編輯、讀取 gist,完成後還可以幫你把連結開起來。

Working With Vim's Autocommand Groups

| Comments |

Before including the autocommand group, I’d write about the reason of using it.

In my post titled Links to Good Posts, I’ve included some custom autocompletion keyboard mappings for the automatic completion of {}, [] and () blocks in my VIMRC file.

Last Thursday, I extended them to blocks enclosed by single or double quotes.

1
2
3
4
inoremap " ""<++><Left><Left><Left><Left><Left>
inoremap "" "
inoremap ' ''<++><Left><Left><Left><Left><Left>
inoremap '' '

Vim-Snippets has saved me a lot of time while writing blogs in Vim. With Vim-snippets and Vim-surround, the following question is not so useful.

How can Vim do the same type of job for angled block for HTML files only?

Standards for C++ Naming

| Comments |

This is what I’ve longed for. What makes it even better is that it’s a website from a domain that ends in .gov, making it a reliable source of information.

Having a good naming convention can greatly reduce the number of syntax errors in the source code and improve its readability.

Posted via UltraBlog.vim.

Heads Up While Creating Online Form

| Comments |

For what you can do using Google Form, you can refer to those online forms that are created by Google.

The focus of this post is what you shouldn’t do while using online forms that are accessible to the public, like Google Forms and other platforms that enable users to easily create questionnaire.

Migrated From Blogger

| Comments |

I tried finding a way to blog using Vim, and blogger.vim is what I’ve found. I’ve tried this plugin but it doesn’t work for my computer. Without Vim, writing code is painful for me. Read the authors’ last Blogger post, which was, ironically, about his switch to WordPress, I followed his footstep.1

Note: For posts about online syntax highlighting and Mathjax on Blogger, they won’t make sense here, so refer to my original blog if necessary.


  1. Ujihisa. (DEC 11, 2013). moved!. Retrieved from http://ujihisa.blogspot.hk/2013/12/moved.html