4 April 2016

30 August 2011

When was the last time you...?

I just realised that the last time I wrote an actual letter, on actual pulped-and-dried tree, was a decade ago. And the last time I'll use my God-and-Jobs-forsaken iPhone 3G will be in October (I really, really hope). This despite the fact that both paper and iPhone were the most naturally obvious and impressive tools I had available at the time. So here's an idea: Even as technological fuckwittery continues to mug you with obnoxiously prescient ideas about how you should go about your general day-to-day, the transitions from our previous behaviour seem with hindsight to be as natural and inevitable as the morning after's kebab hangover. So wouldn't it be interesting to capture those shifts in behaviour individually and en-masse so that we can really reflect on how much has changed for us and about us, and use that same introspection to anticipate future changes?


I'd like to record the last rough date when you used any particular technology to accomplish something, from writing letters on paper to using academic textbooks and public phone booths and sandy egg timers. When was the last time you used a paper map to get yourself home? Then we could also imagine the point in the future that might be the last time you use a technology you rely on right now, or even a technology that doesn't exist yet!


If we can collect and plot over time many peoples' retrospections and projections (when will be the last time you used crowd-sourced statistics as a crystal ball?), I reckon we can reveal some very interesting trends, including the rise and decline of particular technologies, and (if we can collect a little more information) how technology adoption and perception is distributed amongst geographical and demographic boundaries.


Any offers to collaborate on setting up such a project?

16 November 2010

TinySegmenter for C#

TinySegmenter is a text tokenizer for Japanese (and English). I wrote a translation to C#, which you can download from http://asheldritch.googlecode.com/files/TinySegmenter.cs

A tokenizer splits bodies of text into individual words, useful for example in keyword searching. Other implementations are:
  • Perl: http://search.cpan.org/~jiro/Text-TinySegmenter-0.01/lib/Text/TinySegmenter.pm
  • Javascript: http://chasen.org/~taku/software/TinySegmenter/
  • http://code.google.com/p/asheldritch/wiki/TinySegmenter: http://lilyx.net/pages/tinysegmenterp.html
  • Objective-C: http://blog.bornneet.com/Entry/276/
  • Lisp: http://miyamuko.s56.xrea.com/xyzzy/tiny-segmenter.html
  • Ruby: http://d.hatena.ne.jp/llamerada/20080224/1203818061
  • VBA: http://pub.ne.jp/arihagne/?cat_id=123314

25 May 2010

How Many Calories do you Burn when Running?

Simple:
calories burned while running = 0.86 * distance in kilometers * your weight in kilograms

Source (and interesting background):
http://www.runnersworld.com/article/0,7120,s6-242-304-311-8402-0,00.html



28 January 2010

Ridiculous Resume Career Objectives

"To obtain a challenging & inspiring position which sharpens my Talent and Creativity, looking forward to work with which keeps-up my zeal."

"My vision is to provide the highest quality IT services at a fair Cost with a focus on client delightment".

17 July 2009

The evils of BOMs

With my application currently using over 20,000 lines of Javascript spread over dozens of files, I figured it was about time to do some concatenation and minification and timestamping and contraflabulation. Concatenated and squished, I end up with a half-meg javscript file. Smegging hell.

So this is all well and good. Except that during concatenation using Windows command line tools (type and echo and copy) the utf8 BOM (byte order mark) that Visual Studio frivolously squirts into every file gets concatenated too. And web browsers just choke on it.

So after pissing around for many hours trying to get around the issue from the command line, I threw in the towl and just wrote a little command line tool of my own to ditch the BOM from a file, and optionally append the resulting file to another. Code is below. It's C#, and can be compiled to most platforms using Mono (probably). If requested, I can post a compiled Windows command line executable.

The bit that does the work:

string SourceFileName = "source.js";
string DestFileName = "withoutBom.js";
bool Append = true;

var text = File.ReadAllText(SourceFileName);
var streamWriter = new StreamWriter(DestFileName, Append, new UTF8Encoding(false));
streamWriter.Write(text);
streamWriter.Close();
}


And here it is wrapped in lots of fluff to make it into a command line app (yes, it looks like crap. Use http://couponmeister.com/beautify.aspx to uncrapify it):

using System;
using System.IO;
using System.Text;

namespace RemoveBom
{
class Program
{
private static void CommandHelp(string message)
{
Console.WriteLine("\n " + message + "\n");
Console.WriteLine(" -----------------------------------------------------------------------------");
Console.WriteLine();
Console.WriteLine(" RemoveBom.exe will clean the UTF-8 BOM marker from a file");
Console.WriteLine();
Console.WriteLine(" Usage: RemoveBom.exe [-a] sourceFileName [destinationFileName]");
Console.WriteLine();
Console.WriteLine(" sourceFileName Name of file containing BOM character");
Console.WriteLine();
Console.WriteLine(" destinationFileName Name of file to write to");
Console.WriteLine(" If not specified, the source file is modified");
Console.WriteLine();
Console.WriteLine(" -a Append the cleaned sourceFile to the destination file");
Console.WriteLine(" If not specified, the destination file is overwritten");
Console.WriteLine();
Console.WriteLine(" -----------------------------------------------------------------------------");
}


private class Arguments
{
public string SourceFileName;
public string DestFileName;
public bool Append;

public Arguments(string[] args)
{
switch (args.Length)
{

// RemoveBom.exe sourceFileName
case 1:
this.SourceFileName = args[0];
this.DestFileName = args[0];
this.Append = false;
break;

// RemoveBom.exe sourceFileName destFileName
case 2:
if (args[0] == "-a")
throw new Exception("When specifying -a switch, a destination filename must be given");
this.SourceFileName = args[0];
this.DestFileName = args[1];
this.Append = false;
break;

// RemoveBom.exe -a sourceFileName destFileName
case 3:
if (args[0] != "-a")
throw new Exception("Invalid parameters");
this.SourceFileName = args[1];
this.DestFileName = args[2];
this.Append = true;
break;

default:
throw new Exception("No arguments were provided");
}
}
}


private static void RemoveBom(Arguments args)
{
var text = File.ReadAllText(args.SourceFileName);
var streamWriter = new StreamWriter(args.DestFileName, args.Append, new UTF8Encoding(false));
streamWriter.Write(text);
streamWriter.Close();
}


static void Main(string[] args)
{
try {
var arguments = new Arguments(args);
RemoveBom(arguments);
}
catch (Exception e)
{
CommandHelp(e.Message);
}
}

}
}

13 June 2007

How to Incorporate a Godo Kaisha in Japan

The following is a step-by-step guide and glossary of terms for self-incorporating a Godo Kaisha in Japan. I've also created document templates for everything you'll need.
I would recommend budgeting 80,000 yen for the whole process, including the inkan. Bear in mind that you have to register for corporate tax within a month of incorporation, and I won't be posting any how-to on that one; it's a form-filling nightmare that only an accountant with a strong stomach should have to deal with. Also, although I've tried to make things as simple as possible you will still need some strong Japanese language ability on hand and a fair amount of spare time, so if you have more money than time then you might want to fob the whole thing off on a lawyer. Finally, there are many reporting and compliance requirements that come with incorporation, so you'll still need to do your homework.
If you have any questions, feel free to ask. If anything's unclear, let me know and I'll make some edits.

A useful article:
http://www.japaninc.com/mgz_autumn_2006_incorporate

Another guide, with some details not included here: http://www.juridique.jp/incorporation_bis.html

The templates (MS Word 2003 format)

The process
1. Get an office to use as your registered company address. A regular office, an incubator, a virtual office, or even your home will do.
2. Create your articles of incorporation document.
3. Go to the Legal Affairs Bureau of the ward your company office will be located in.
1. Get a company inkan registration form and an OCR application form (actually grab a couple of OCR forms, as they’re a bit fiddly to print onto properly).
2. Also have them look through your articles of incorporation to check they are okay.
4. Buy a company inkan, plus a personal inkan for each director who doesn’t already have one.
5. Each director must register their personal inkan at their local ward office, and get a personal inkan registration certificate.
6. Complete the company inkan registration form.
7. Choose one of the directors’ personal bank accounts that will hold startup capital, or open a new account.
8. Transfer startup capital to the personal bank account.
9. Produce evidence that startup capital has been deposited.
10. Make declaration of capital deposit document.
11. Make LLC application document.
12. Make acceptance of responsibility as company representative document.
13. Make decision on incorporation details document.
14. Print out all documents.
15. Ensure that personal and company inkan stamps are on all documents and forms where required (these are markedand代表印respectively in the sample documents provided).
16. Take everything to the Legal Affairs Bureau.
1. Go to the consultation counter to have them check that the documents are okay. They will add a number of inkan stamps and staple everything together.
2. Buy a 60,000 yen revenue stamp and stick it on the LLC application form.
3. Submit everything to them.
4. Pick up a company inkan registration card application form, an inkan registration certificate application form, and an incorporation certificate application form.
5. They will give you a date to come back once the application has been processed.
17. Return to the Legal Affairs Bureau on the set date.
1. Submit the completed company inkan registration card application form, inkan registration certificate application form, and incorporation certificate application form, and receive your inkan registration card, inkan registration certificates, and incorporation certificates.
2. While you’re there, you should head for the tax department and collect the mountains of forms required to register for corporate tax, which you must do within a month. Better still, get an accountant to do it.
19. You should also have a lawyer “digitally sign” your articles of incorporation (Google for 電子定款), which will cost from 12,000 yen upwards. The alternative is to attach a 40,000 yen revenue stamp obtained from the Legal Affairs Bureau, but why pay the extra money? There is some disagreement about whether this is required, but it seems that whilst the company law does not require this stamp, the stamp tax law does.

Glossary
  • Articles of incorporation (定款/teikan) - A document setting out basic information about your company, such as its purpose, address, directors, share distribution, etc.
  • LLC application (合同会設立登記申込書) – A document setting out basic information about your company in order to apply for incorporation.
  • Declaration of capital deposit (出資金払込証明書) – Declares that an amount of money has been transferred into the personal bank account designated to hold startup capital. Each director should be listed and must stamp the document with their personal inkan.
  • Acceptance of responsibility as company representative (就任承諾書) – A declaration by one director that they are the representative (i.e. president) for the company. If you’re the only director then this should of course be you.
  • Decision on incorporation details (代表社員、本店所在地および資本金決定) – Summary of a meeting between directors stating office location, name of company representative, and amount of startup capital. I don’t think this document is actually a requirement, but the Legal Affairs Bureau asked for it so best to play safe.
  • OCR application form () – A B5-sized piece of paper which you can get from the Legal Affairs Bureau, on which you print out the same details as on the LLC application document, but formatted in a certain way so that it can be easily scanned into a computer and optical character recognition (OCR) can turn it into a computer document. Madness.
  • Company inkan registration form – A form which you can get from the Legal Affairs Bureau to register your company inkan.
  • Personal inkan registration certificate – Proof that your personal inkan has been registered. Available at your local ward office for a few hundred yen.
  • Inkan (印鑑) – Also known as a hanko. A stamp or seal that is used in place of a signature on documents. The company inkan should be 18mm in diameter. Any inkan shop will sell them, otherwise just Google for 印鑑 and you’ll find plenty of online shops. You only need a single, round company inkan, 18cm in diameter, and they start from 7,000 yen.
  • Legal Affairs Bureau (法務局/houmukyoku) – Bureaucratic government machine under the Ministry of Justice. You can find your office’s local bureau at houmukyoku.moj.go.jp/homu/static.
  • Virtual office – Provides the facilities of an office, including mailing address, receptionist, meeting rooms, etc., for a considerably reduced fee compared to renting physical offices. Servcorp and Regus are the two big ones, and a few others operate in Japan.
  • Startup capital – Although this can in theory be one yen, it should in practice be an amount “reasonable to operate your business.” I’ve no idea how that’s assessed, given that you’re not required to show any operations figures. The capital deposited by each director must be proportional to their percentage ownership of the company. You can include in your startup capital the 60,000 yen required to purchase the revenue stamp. Once you have photocopied the bank book or printed out the online statement showing the startup capital deposited, you can then withdraw that amount in order to purchase the revenue stamp.
  • Revenue stamp (収入印紙/Shuunyuuinshi – A 60,000 yen stamp available from the Legal Affairs Bureau or post offices, which is attached to your LLC application form and covers the Bureau’s fee for incorporation.
  • Evidence that startup capital has been deposited – Take photocopies of front page and inner page of the bank book for the account, with the startup capital deposit shown. Shinsei Bank do not provide a bank book, but a printout of your online activity statement and photocopies of the front and back of your cash card should suffice (check this with your ward’s Legal Affairs Bureau, as the situation may differ from ward to ward).
  • Company inkan registration card application form – A blue form available at the Legal Affairs Bureau. You should complete it and return it when you return to the Legal Affairs Bureau, in exchange for a company inkan registration card that you use when you want to purchase further inkan registration certificates.
  • Inkan registration certificate application form – A brown form available at the Legal Affairs Bureau. You should complete it and return it when you return to the Legal Affairs Bureau, in exchange for inkan registration certificates (印鑑証明書). You will need at least two certificates as they are used for various purposes such as registering for corporation tax and opening a corporate bank account. Each inkan registration certificate will cost 500 yen, which you will need to pay by purchasing revenue stamps at the Legal Affairs Bureau.
  • Incorporation certificate application form – A purple form available at the Legal Affairs Bureau. You should complete it and return it when you return to the Legal Affairs Bureau, in exchange for incorporation certificates (履歴事項全部証明書). You will need at least two certificates as they are used for various purposes such as registering for corporation tax and opening a corporate bank account. Each incorporation certificate will cost 1,000 yen, which you will need to pay by purchasing revenue stamps at the Legal Affairs Bureau.