12/30/2013

Memo that was setting Syntax Highlighter on Blogger.

I set appearance of program code on Blogger by Syntax Highlighter.
but, There was a little problem. So, I will write memo of solution.

Syntax Highlighter is able to appear with row number that  program code on html.
of course, that's appearance is beautiful.
also, you can get more information from search by google.

Setting of Syntax Highlighter is follows.

1. Page for the generation of Syntax Highlighter(below link), I generate code for CSS and JavaScript needed to configure the Syntax Highlighter.
    http://www.way2blogging.org/widget-generators/syntax-highlighter-scripts-generator


2. I set the head tag of the html code of CSS and JavaScript needed to configure the Syntax Highlighter generated.

3. The class attribute of the tag of where I want to display beautifully with line numbers of the program code  Completion to set the class name that is ready for Syntax Highlighter.


From here, and I was actually set, it is what was addicted.

* First, check the programming language to be displayed with line numbers in the program code page for the generation of Syntax Highlighter(below link).
    http://www.way2blogging.org/widget-generators/syntax-highlighter-scripts-generator




* Then, click the Generate button.




* Code of CSS and JavaScript required to set up the Syntax Highlighter is generated. Therefore
Code is incorporated into the clipboard by clicking the Copy To ClipBoard button.
(In select all the code, is acceptable. Also a copy)


* Click on the Settings screen of the Blogger "Template", and click the "Edit HTML".


* </ Head> just before the tag, I paste the code of CSS and JavaScript needed to configure the Syntax Highlighter that you just copied.


* I tried to click on the "Preview template" set of Syntax Highlighter is being reflected in the then, but the setting of the Syntax Highlighter is not reflected.
(Pacakage ~ is the relevant section, but. Line number has not been displayed, has become the only text)


* Although was confirmed I think that there are no errors in the text that you have posted to Blogger
Class name that is ready for Syntax Highlighter is set.
(<pre class = "brush: java"> is relevant location)



* When I am looking where to find there is no configuration error, looking at the page of the actual Blogger
Setting Syntax Highlighter had been reflected.



So, the setting of the Syntax Highlighter is
In the preview, it will not be reflected in the template,
It is do I have to check the page of the actual Blogger. (Dec. 30, 2013 point)

6/11/2013

Get new line code that readLine of BufferedReader in Java.

readLine of BufferedReader in Java is return contain string by new line code.
but it is not contain new line code.

I working simply that is make data replace tools of text file.
that text file has been edited by Mac or Windows.
Therefore, it is include some new line code.

So, when after replace data if new line code is no previous new line code then confuse where modified by replace data.

Next, I search this problem on the internet.
However, not found that return  new line code that readLine of BufferedReader.

So much trouble, I expand to contain new line code from return that readLine of BufferedReader.

Program is simple.
when reading data, if exist \r or \n in data then return value with new line code.

This code is below.

package extension.java.io;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;

public class ExtensionBufferedReader extends BufferedReader {

    public ExtensionBufferedReader(Reader in) {
        super(in);
    }

    public ExtensionBufferedReader(Reader in, int sz) {
        super(in, sz);
    }

    @Override
    public String readLine() throws IOException {
        int num = 0;
        StringBuffer strBfr = new StringBuffer();
        try {
            while ((num = this.read()) >= 0) {
                strBfr.append((char) num);
                switch ((char) num) {
                case '\r':
                case '\n':
                    return strBfr.toString();
                default:
                    break;
                }
            }
        } catch (IOException e) {
            throw e;
        }

        if (strBfr.length() == 0) {
            return null;
        } else {
            return strBfr.toString();
        }
    }
}

1/05/2013

New Year's visit to a Shinto shrine

I went to the shrine to ShoinJinsha of Hagi at January 1.

When I went to the shrine to ShoinJinsha in the past, the car is small
Although I was able to park your car in the parking lot of the nearest ShoinJinsha,
Car even more, than ShoinJinsha, we parked the car in the parking lot away a little.
At the same, but I did not that the New Year's visit to a shrine of ShoinJinsha, waited in line previously,
This time, is around about 30 minutes roughly, but I waited in line for the first time.






1/04/2013

Finally return home

I went from Seoul Airport Korea to Fukuoka Airport in Japan.
departure is  12/31 18:40,  arrival is 12/31 19:55.

Affairs and belongings and check luggage, immigration to people who have been assessed by
It was asked what was in Canada.
Yourself because 33-year-old age, thus, it was like was considered to be a job for people who have been assessed.
However, I was going to learn English. And reportedly, it came to an end immediately.

Then, move to Hakata Station subway from Fukuoka Airport.
From there, I moved to Asa Station is the nearest station of the home in the Shinkansen.

Time I come home, it was about 11 pm.
Family because it is New Year's Eve, I was looking at the Kohaku Uta Gassen.
I was very tired, but you can eat meal, bedtime was about 3 pm of 1/1 entering or bath.
It did not sleep for about 30 hours. Cheers for good work.


1/03/2013

I arrived Seoul Incheon Airport.

Evening of 12/31, South Korea arrived in Seoul Incheon Airport.
The Airport, there was a little snow.

Came to South Korea This is the first time I have tried.
It is a stay of only Incheon Seoul Airport, but it was very clean.
Perhaps because it is close to Japan, and is similar to Japan.

Once I have arrived in Incheon Seoul Airport, it checks the passport and luggage
After that, I moved in vehicles such as the subway to the place where I want to board a plane flying to Fukuoka.

A little, before boarding, because there was a time, I tried to drink draft beer.
It was paid by Visa card, but can also be used Japanese Yen.

Although I thought it was so much trouble, and either try to eat something,
I quit after a few hours after, it will return to the home.

1/02/2013

To South Korea from Detroit

America went to South Korea aboard the airplane 12/31 16:25 wearing Incheon Seoul Airport Korea of 12/30 12:20 shot Detroit Airport.

When heading to Canada via the United States from Japan, I did not drink liquor
I drank beer and wine this time.
By the way, wine and beer was free.
Long flight but was very painful to go
So, you are not a pain this time.
And had watching a movie, it might be because were able to relax a little alcohol enters.
After that, it is still in the flight of about 15 hours, and did not become sleepy at all that strange.









1/01/2013

American McDonald's in Detroit

The United States before returning to Japan I went to McDonald's in Detroit Airport.
As I do not have US $, I asked whether the use Visa card to go to the cash register,
Since such that it with the use, I bought a Coke and a cheeseburger.




By the way, Japan also Canada also did not know the difference in taste.
Speaking of a different place, it is that the menu is different in Japan, Canada and the United States.
(I do not remember what was the menu, and I have forgotten to take a photograph.)




After, Canada and Japan, cola Although it was Coca Cola,
America was a Pepsi. Canada and the United States I was a self-service drinks.



At the same, storage boxes of paper napkin is the same in Canada and Japan
The United States was a little different.