On generating UUID

I have been using UUID for several different things now, and I have been using uuidgen program available on Linux.
Since I use Emacs, I wanted to better way of generating UUID right from Emacs.

Ergoemacs has good coverage about it back in 2011 about it.

There is a example that uses the uuidgen program:

(defun insert-random-uuid ()
  (shell-command "uuidgen" t))

The above pretty much solves problems for generating UUID, but I wanted to have a solution that generates UUID inside Emacs, just in case it’s needed.

The example codes, Ergoemacs have posted seems to the job, however, I’ve noticed the original piece of code fixed the first character of the fourth segment character “a” (which actually generates a valid UUID, as this character needs to be either 8, 9, A, or B. I’ve modified this code slightly to generate one of those characters instead of it being always “a” which would be the following.

;; by Christopher Wellons. 2011-11-18. Editted by Xah Lee.
;; Edited by Hideki Saito further to generate all valid variants for "N"
;; in xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx format. 
(defun insert-uuid-internal ()
  "Insert a UUID. This uses a simple hashing of variable data."
  (let ((myStr (md5 (format "%s%s%s%s%s%s%s%s%s%s"
    (insert (format "%s-%s-4%s-%s%s-%s"
                    (substring myStr 0 8)
                    (substring myStr 8 12)
                    (substring myStr 13 16)
            (format "%x" (+ 8 (random 4)))
                    (substring myStr 17 20)
                    (substring myStr 20 32)))))

Also one thing to note is that it’s generally better to use uuidgen where available, as it generates one from /dev/urandom, which tied to various random number sources — although, for the scope of generating uuid, it may not that be critical as likelihood of collision would still be low.

A full code is available on HidekiBin.

Upgrading Org-mode 8.0

Org-mode 8.0 is out, and overall, it looks like interesting update to already awesome package for Emacs.

This update is dirsruptive updates, which means there are something that can be broken and requires updates.

One of the issue I had was how it handles LaTeX output.

For instance, I had the following in my init.el (I opt to put my config into .emacs.d/init.el instead of .emacs…)

(require 'org-latex)
(add-to-list 'org-export-latex-classes
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
 ("\\paragraph{%s}" . "\\paragraph*{%s}")
 ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))

The above is actually an incompatible for 8.0, and it had to be updated so it is:

(require 'ox-latex)
(add-to-list 'org-latex-classes
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
 ("\\paragraph{%s}" . "\\paragraph*{%s}")
 ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))

The tricky part is that it won’t complain until you try to issue org-export-as-latex, which actually is not supposed to exist in 8.0. (the corresponding function of 8.0 is org-latex-export-to-latex) What happened was that by requiring org-latex, it loaded corresponding functions from 7.9.3 version built into Emacs itself.

So if you have any statements like above, do make sure to update or you will run into problems.

You can see if you have a correct installation of org by M-x org-version. You can also try to get a complete list of org-export- and if you see any more than the following, you may have some issue in your configuration.

Possible completions are:
org-export-dispatch org-export-insert-default-template
org-export-stack org-export-stack-clear
org-export-stack-mode org-export-stack-remove

Setting Emacs Custom Splash

Since there were some inquiries about this one… This is actually built-in function of Emacs.


First, prepare a graphic file for it. Any size probably will do as long as it’s small enough that fits on the screen. Default graphic is 270×217, so you may want to choose it. Any format that Emacs supports will do. Perhaps XPM will be the best choice.

Now, go into the customize screen using M-x customize


Typing in fancy splash, and it should filter entries to the single one. If it says Default, flip it to File, then specify full path to the graphic you have prepared earlier, and save.


Then it should be displayed when you go in by C-h C-a.

Have fun!

SKK Package

Since DDSKK’s official site is down for a week now, for those who needs installation file for SKK, I’ve created SKK package that can be used to install SKK. It has everything you need to install. This contains SKK package as well as some, but not all, dictionary files, as recent as two weeks ago.

Here is the list of dictionaries within this distribution:

-rw-rw-rw- 1 hideki None 14069 Jan 4 2006 SKK-JISYO.JIS2
-rw-rw-rw- 1 hideki None 3055 Apr 4 2007 SKK-JISYO.JIS2004
-rw-rw-rw- 1 hideki None 224791 May 19 14:00 SKK-JISYO.JIS3_4
-rw-rw-rw- 1 hideki None 4490621 Jun 8 17:10 SKK-JISYO.L
-rw-rw-rw- 1 hideki None 1388041 Jan 21 2011 SKK-JISYO.fullname
-rw-rw-rw- 1 hideki None 2857024 Feb 19 2006 SKK-JISYO.geo
-rw-rw-rw- 1 hideki None 629605 Feb 3 16:10 SKK-JISYO.jinmei
-rw-rw-rw- 1 hideki None 497649 Feb 19 2006 SKK-JISYO.propernoun
-rw-rw-rw- 1 hideki None 513848 Jan 4 2006 SKK-JISYO.station

Hope this helps.

My Random Emacs LISP Scripts

I’m not particularly, LISPer, but I do code some Emacs LISP for my convinience. Just to pick a few…

  • Create Random Buffer is a script to create some random buffer. I’m actually wondering why something like this doesn’t exist as default. (well, there’s scratch buffer, but…) Useful for experimenting.
  • Anti-Space Invader is a simple script to make two spaces after period, because you should never do that.

Whitepaper: Org-mode at Sakura-Con

This article explains use of Org-mode in a context of convention management.

Who am I?

I am Japanese Guest Manager appointed by relations department of Sakura-Con 2012. My duty at Sakura-Con involves management of Japanese guests of honor for Sakura-Con 2012; everything related to Japanese guests, from schedule managements, human resources, to the field management of the team consisting of a little less than 30 managing 17 guests of honor and their associates — about 60 in total. The team consists of Japanese guest liaisons assigned to each guest as well as 3 of event interpreters assigned to events such as panels.

The team managed more than 80 hours of programming spanning three days as well as times outside of convention hours.


Managing Japanese guest relations at Sakura-Con involved multiple considerations. Here are some aspects of such managements:

Sakura-Con used its own scheduling system, which is mainly used to schedule events on the global calendar, thus making it possible to coordinate scheduling between multiple departments. You can imagine this as a big conference room scheduling system. Unfortunately, the way the schedule is presented and solely chronological and was very hard to glance. (It was better designed to see what time tables are open but not designed to follow what each resource are assigned for.) Japanese guest relations required customized solution as we had to need of further digesting this information.

Japanese guest relations issues schedule sheet which consists of formatted schedule for each guest of honor as well as staff. This process was assigned to one of my staff, however this had to be handled somewhat concurrently while schedules were being finalized.

Aside from liaisons, Japanese guest interpreters had their own assignment. It is because they were assigned to events rather than guests. This presents interpreters different set of requirements in their scheduling. As the schedule called for many events concurrently occurring but greatest number of such concurrency were constrained by available resources. This also had to be updated on the fly when pertinent changes occur in the scheduling process.

Sakura-Con 2012 particularly hired many new staff due to its number of guests. Each of member had to be accounted for their availability for as well as number of “checklist” for signing them up.

Each staff is assigned to guest to manage. Assignments are done taking their ability in account as well as their preferences.

Management Using Org-mode

During the preparation of Sakura-Con 2012, there were so many type of information to process. Because Org-mode allows variety of output from its org file, it helped to produce output necessary for consumption by our staff.

Schedules had to be constructed so it is easy to glance as well as to have detailed information within. To carry out this, under heading for each guest, information contained table of events, which contained name of the event as well as time (with inactive timestamps) and venue. I can then sort this table based on the time, which generates chronological time table to each guest.

Furthermore, the list required some more information, therefore, it would contain subheading which lists each event by its type, but alphabetically for easy lookup.
This heading had active timestamp. This allowed each of those entry to be exported as iCal calendar file; this file can then be used by interpreters to schedule their assignment.

The following is the sample segment from the real schedule: (Due to confidentiality issues, some of information from the example are eradicated and does not show real schedule of the convention.)

Org-mode sample used at Sakura-Con

Yes, this is probably redundant having two representation of same event, but given calendar output from table seems to be not possible, this was a middle ground I had to reach.
Also having these sectional event subheading means they could be marked with various TODO field. I used this feature to label status of each event to signifying events still requiring changes.

From this file, I could derive HTML output for printed schedule as well as calendar file for interpreter schedules.

Other than some errors originating from input mistakes, the process supported the preparation effort very well.

When the convention added a guest, it involved multitude of process, such as guest invitations. These were managed using mainly by checkbox on Org-mode, among with relevant information linked to. Again, all those information could be converted to HTML and other format for sharing.

Staffs are managed same way as guests, except they had different type of checklist. Their contact information as well as interview processes were logged and amended as the process continued. Staff directory was also published utilizing same data compiled in this process.

The Team Website

Utilizing same data set above, the team website containing guest schedules, staff information as well other miscellaneous information could be produced and maintained very rapidly. Utilizing smartphones browser, everything from guest schedule to assignment information could be referenced everywhere there are coverages. While being static site, onsite update to the contents were very simple. Backend featured Git and new revision could be pushed to update the site from local machine. This was mainly done by a laptop with Clear hotspot. I have also designed emergency USB thumbdrive which contains all the necessary tools (including complete version of Emacs, SSH, Git, etc.) which could be used to continue updating the site in the event that laptop would be out of order. Fortunately, I did not have to resort to use it.

The team website was not only utilized by the team itself, but its reference was expanded to entire department as well as relevant personnel outside of the department, logging more than 3500 requests on the convention week alone, which would have been additional inquiry to the department otherwise.

Future Considerations

Org-mode was an integral part of Japanese Guest Relations at Sakura-Con 2012. While model based on static webpage has worked very well for the purpose, perhaps I can perhaps develop or utilize frameworks that can parse org file input to generate format better fit for many of use cases.

Also mobile integration utilizing tools such as MobileOrg was not within the scope of the project, this is certainly something I will want to explore in the future.

Org-mode and Why You Should Consider Using It

Org-mode is certainly best one of many things I’ve discovered in first 2 months in 2012. Now I use it for anything from note taking, convention management, and even writing full report.

This was great discovery to me, that recently, I have been started a lot of things on the web as well as on more specialized platforms such as Chromebook rather than on traditional PC. Sure I will have to use some type of computer to convert document prepared in Org-mode, more about it later.

Binary Blobs Suck

I have been complaining about various binary blobs in the past. I expressed my hate anything from proprietary format, as well as winmail.dat attached to E-mails. (I’m still seeing that, albeit less often. Hey Microsoft, if you are seeing it push some Windows Update to everyone and get rid of that thing altogether.)

Classic examples are documents generated by any office softwares traditionally had this problem. It started to improve when standardization efforts such as OpenDocument and some sense Office Open XML are introduced in the market. This may have changed significantly in standardized to approach to otherwise proprietary formats that was (and still is) dominating the market, was was very important movement.

However, what these standardization efforts did not solve was accessibility problem. No matter how open those formats are, they would still require use of some extra piece of software, that requires degree of complexity than what you could attain using plain text. TeX (and LaTeX) has been around for years allowing plain text edit, but it was far harder to use than, although, I consider TeX/LaTeX being 100 times better way of creating documents than on Microsoft Word.

Org-mode being plain text, I can be editing the document everywhere: I can do it on PC, I can do it on Mac, I can do it on Chromebook (considering ChromeOS does not have any software packages it is bit cranky to do it with) and I can do it on my phone. Eventually, I will be relying on actual PC to convert, but being able to write documents is very useful aspect of Org-mode and mark up languages in general.

Structured Documents Made Easy

One thing I like about Org-mode (and also TeX/LaTeX) is that it enforces structured documents. I often across many documents E-mail to me that are horribly created document – heading being mere font size change, table of contents written as text, rather than auto generated based on heading information, because it lacks document structure information because of the above.

Sure some people are apparently smart enough to do this properly even when they are using Microsoft Word, but the point is that Org-mode enforces this with positive motivation. By making sure the document has proper format on Org-mode, it makes Org-mode much more useful, as it is outline processor, you will be able to organize contents more efficiently when it is structured.

Project Management Made Easy

Most of things I do at my work is project management. I used to use Microsoft Project, which after I’ve used it for while, I found it wasn’t necessary solution to the problem. Yes, it is perhaps good at making graph that wows management in some companies, but constraints it assume is not always in-line with real life situation. Unless you are working for perfect company, schedule slips, requirements change, which causes heck of changes to the beautiful chart you’ve made using those project management softwares.

Past few days, I have been working on adjusting events which involves around 80 hours of sessions – Org-mode helped this process such a breeze, because getting the big picture of dependencies was very easy with Org-mode.

And what best, is that reports can be generated to number of format for others to review, which is my next point:

Document Creation Made Easy

Once authoring of the document is completed on Org-mode, it is very easy to generate reports for others to consume. Be it HTML, OpenDocument, LaTeX, etc., all it involve is to export as those format.

It is even possible to create table contains dynamically generated field, much like you can do in Microsoft Excel. It’s like text based spreadsheet.

This creates seamless pipeline of information management to document creation based on it.


It is fair to say there are some shortcoming to Org-mode. For example, it is harder to embed diagrams on the document. (It’s not impossible, but the diagrams need to be created externally.) Documents involving heavy use of diagram and drawing are much better done in applications like Microsoft Powerpoint, Microsoft Visio, or LibreOffice Draw. (And please don’t do it on Microsoft Excel!) Other than that, Org-mode is very good all-round information management and document authoring tool.