Natural sort order is what we usually see in most file managers when browsing a list of numbered files, that it sorts the numerical part of the file name as a number instead of comparing it character by character. For instance:
Lexicographical sort can be easily implemented using
String::compareToIgnoreCase, but it is not very acceptable for end users. However for natural sort, things is actually a little more complicated.
For content-oriented Android application, how and where to store the content to display is a issue every developer will be concerned with. The Android framework provided a comprehensive solution with
ContentProvider (and a lot more) which suits quite well with a SQLite database; but in a lot of other scenarios, the app only need to have some information cached, while the majority of content is directly retrieved from network, thus eliminating the need for a database (and a complicated content scheme).
But when we look into the core of this issue, we will soon find out that it is in fact a problem of whether to have a central storage, and how to notify different components about a change.
This is my notebook for bash scripting.
Use Google style guide for shell.
This article is originally titled Abandoning treatment for X11, for my xkeymacs project.