Blog 1

Random Talk on Random Thoughts

Use Lynx Browser (2): Access Shell

| Comments |

Background

I often use Lynx due to several reasons.1

Problem

While browsing the Internet with Lynx, one can spawn the shell, so that one can resume the browsing session after executing some commands.

When one wants to exit the shell invoked by ‘!’ in Lynx, the command required is the same as the one needed for logging out: exit. These are pretty easy.

However, in Linux text mode, if one typed some commands and the contents in the browser were completely covered by the output of these commands, how can one distinguishs a shell started by Lynx from the one that simply exists after one has logged in?

Git Push to USB

| Comments |

Background

  1. I created a bare Git repository in my USB stick on GUI.
  2. I pushed some Git commits to the bare repository in the USB.

The commands for the above steps shouldn’t be difficult. In step 2, if one sets the upstream repository to the bare repository in the USB, the command to be issued is even easier: just git push will do, and the remote and branch names can be omitted.

Problem

I worked on Linux text mode instead of GUI. After committing the changes, I tried pushing them into the bare Git repository in the USB.

[owner@localhost ~/MATH2220]$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean
[owner@localhost ~/MATH2220]$ sudo mount -t vfat /dev/sdf1 \
> /media/owner/08F1-B181/
[owner@localhost ~/MATH2220]$ git push
Counting objects: 4, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 551 bytes | 0 bytes/s, done.
Total 4 (delta 1), reused 0 (delta 0)
remote: error: insufficient permission for adding an object to repository databa
se objects
remote: fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To /media/owner/08F1-B181/MATH2220/MATH2220.git
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to '/media/owner/08F1-B181/MATH2220/MATH2220.git
'

How can I push commits into the USB?

Read a Proof About the Transitivity of Characteristic Subgroups

| Comments |

On the day before yesterday, I read a proof about the transitivity of characteristic subgroups. The proof shouldn’t be too difficult. The key step is just to create a restriction automorphism.

Suppose $K\le H\le G$, and $f\in \Aut(G)$. Then $f(H)=H$. Define the restriction of $f$ on $H$ as $g:H\to H$ such that $g(h)=f(h) \,\forall h \in H$. Clearly, $g\in \Aut(H)$.

I couldn’t understand why $g(K)=K$. I googled “strongly normal transitivity”, but couldn’t find anything relevant. I changed the words, and found the proof on ProofWiki. Then I realised why I got stuck: when I wrote the definition of characteristic subgroup symbolically, I didn’t pay enough attention to ‘∀’.

Read an Alternative Proof of the Extreme Value Theorem Using Tagged Partitions

| Comments |

Background

Last Saturday, I read an article on using gauges defined on a close and bounded interval $I$ (i.e. strictly postive functions over $I$) and tagged partitions to prove the Extreme Value Theorem.1 Though the full text is not free, one can preview the first page, on which an attractive introduction is found.

Motivation

In ordinary proofs of the Extreme Value Theorem, one makes use of the fact that continuous functions defined on $I$ are bounded, which is proved by the Bolzano–Weierstrass Theorem, which has to be proved by either the Monotone Convergence Theorem or the Nested Interval Theorem. A student who prepares for an exam in math analysis will revise the lengthy proofs of these theorems.

However, the alternative proof of the Extreme Value Theorem is just a proof by contradiction making use of basic properties of $\delta$-fine partitions and the fact that continuous functions defined on $I$ are bounded, which is proved by basic properties of $\delta$-fine partitions only.

Octopress, PageSpeed, jQuery and fancyBox

| Comments |

Goal

To improve the Google PageSpeed scores of this site.

Background

I use MathJax and fancyBox for displaying math equations and images respectively.

Problem

As shown in the following two pictures, the PageSpeed scores of the homepage of this blog for “Mobile” and “Desktop” were very low.

</source> pagespeed score mobile </source> pagespeed score desktop

Solution

I followed the advice of Google Developers, and deferred loading of JavaScripts.

Results

After a week’s work, the PageSpeed has risen.

mobile pagespeed score

</source> pagespeed score desktop

An Up-to-date Git on Ubuntu

| Comments |

Background

Tonight, I read the most recent blog article on GitHub’s blog.1 It says that the version of Git Bash on my M$ Win* 7 is unsafe. Moreover, it is claimed that GNU/Linux computers aren’t affected since they’re case sensitive. At first, I believed that I didn’t need to upgrade my Git. However, after I clicked the link for the announcement of Git v2.2.1, I checked the version of the Git on Ubuntu, and found out that it wasn’t the newest one. The following paragraph convinced me to get this update on my Ubuntu desktop.

Even though the issue may not affect Linux users, if you are a hosting service whose users may fetch from your service to Windows or Mac OS X machines, you are strongly encouraged to update to protect such users who use existing versions of Git.

Edit Gist Descriptions With Gist.vim

| Comments |

Background

I use Gist.vim to post code to Gist directly in a Vim buffer for efficiency.1

Problem

In the manual of Gist.vim, it’s said that after opening the Gist buffer in Vim, one can add/change the description of a Gist with :Gist -e -s something. To add a description for a Gist, I typed :Gist -s foo bar ... in a buffer for the particular Gist — I tried to use it like :!echo foo bar — and what I got in the list of my Gists was just the last word.

Lessons learnt

After one encounters such a problem, he/she will be likely to solve the problem within seconds: use a double quote to surround the whole description.

When I was in doubt of the words in the manual, I used simple examples for testing, so I could quickly see the output and get the concepts written in the documentation.


  1. See Posting Code to Gist Efficiently in Blog 1 for the reasons of installing Gist.vim

Changed My FancyBoxLocal.js

| Comments |

Background

I’ve been using fancyBox for image popup since August.1

Problem

I would like to have large screenshots which belongs to the fancybox CSS class centre-aligned.

My Improved Custom Autocompletion Mappings in Vim

| Comments |

Background

Inspired by $\rm \LaTeX$-Suite, I added some autocompletion mappings in my VIMRC last year.1 Three months later, I saw the word “FileType” in Vim’s User Manual, and shortened these autocommand a little bit.2 In my opinion, it’s incredibly amazing since I can type text at the speed of thought.

Problem

If I’ve finished editing an HTML file and open another $\rm \LaTeX$ file, then my insert mode mappings will interfere with those defined by $\rm \LaTeX$-Suite. How can I restrict my custom mappings to the current working buffer only?