Like I said, it looks like a beginning now, but have a look at http://www.shogi-lab.net/
You can browse through two games from Yoshiharu Habu "Habu's Words".
I hope the site will achieve its full potential...
Best wishes, Adam!
This blog traces progress of the project that's subject is to documenting shogi community standards for storing, representing, transmitting shogi-related data (games, tsume, etc.), building tools to translate between the formats, discuss Shogi software in general.
Google App Engine (GEA) finally got Java support. That's good. This is leaving me with no more excuses for delaying my Shogi Tools work.
) or choosing File->New->Other->Google->Web Application Project. "New Web Application Project" dialog shows up.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GAE file upload test</title>
</head>
<body>
<form name="filesForm" action="uploadtest" method="post" enctype="multipart/form-data">
File 1:<input type="file" name="file1"><br>
File 2:<input type="file" name="file2"><br>
File 3:<input type="file" name="file3"><br>
<input type="submit" name="Submit" value="Upload Files">
</form>
</body>
</html>



public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
try {
ServletFileUpload upload = new ServletFileUpload();
upload.setSizeMax(50000);
res.setContentType("text/plain");
PrintWriter out = res.getWriter();
try {
FileItemIterator iterator = upload.getItemIterator(req);
while (iterator.hasNext()) {
FileItemStream item = iterator.next();
InputStream in = item.openStream();
if (item.isFormField()) {
out.println("Got a form field: " + item.getFieldName());
} else {
String fieldName = item.getFieldName();
String fileName = item.getName();
String contentType = item.getContentType();
out.println("--------------");
out.println("fileName = " + fileName);
out.println("field name = " + fieldName);
out.println("contentType = " + contentType);
String fileContents = null;
try {
fileContents = IOUtils.toString(in);
out.println("lenght: " + fileContents.length());
out.println(fileContents);
} finally {
IOUtils.closeQuietly(in);
}
}
}
} catch (SizeLimitExceededException e) {
out.println("You exceeded the maximu size ("
+ e.getPermittedSize() + ") of the file ("
+ e.getActualSize() + ")");
}
} catch (Exception ex) {
throw new ServletException(ex);
}
}
upload.setSizeMax(50000);
fileContents = IOUtils.toString(in);

--------------
fileName = log4j.properties
field name = file2
contentType = application/octet-stream
lenght: 1063
# A default log4j configuration for log4j users.
#
# To use this configuration, deploy it into your application's WEB-INF/classes
# directory. You are also encouraged to edit it as you like.
# Configure the console as our one appender
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] - %m%n
# tighten logging on the DataNucleus Categories
log4j.category.DataNucleus.JDO=WARN, A1
log4j.category.DataNucleus.Persistence=WARN, A1
log4j.category.DataNucleus.Cache=WARN, A1
log4j.category.DataNucleus.MetaData=WARN, A1
log4j.category.DataNucleus.General=WARN, A1
log4j.category.DataNucleus.Utility=WARN, A1
log4j.category.DataNucleus.Transaction=WARN, A1
log4j.category.DataNucleus.Datastore=WARN, A1
log4j.category.DataNucleus.ClassLoading=WARN, A1
log4j.category.DataNucleus.Plugin=WARN, A1
log4j.category.DataNucleus.ValueGeneration=WARN, A1
log4j.category.DataNucleus.Enhancer=WARN, A1
log4j.category.DataNucleus.SchemaTool=WARN, A1
This time I spent some time learning JavaScript and programing the browser. As a result I came up with JavaScript Shogi Board Viewer and Shogi FEN parser. They have similar functionality as the former, but it's easier to use it on one's own Web pages.
Well, I wanted my viewer to be "generic" (independent of the position data source) and possibly small. Therefore I decided that the position is provided with a javascript object. Feels like real pain, doesn't it? But fortunately, JSON notation comes to the rescue. Thanks to it we can build JavaScript objects that are understood both by computers and humans.
Besides, JSON is quite popular data exchange format, so there could be converters (i.e. from Shogi FEN or others) easily plugged in to the viewer.The description consists of 4 elements:
and could be expressed as JSON like this:
{
"sideOnMove":"black",
"blackHand":[],
"whiteHand":[],
"pieces":[]
}
Side on move is simple: it can be either "black" or "white".
Pieces in hand data is an array of numbers. Each number represent the count of pieces for a given rank. The rank is indicated by position in the array. Pieces info is stored in a given order:
So, for a Silver and 2 Pawns in hand the data would look like this:
[2,0,0,1,0,0,0,0,0,0]
I am not particularly happy with the format. I don't like the fact that a human has to remember position of piece ranks in the array. The format could be therefore change in the matter. [[Maybe better would be to have pairs rank:count?]]
Pieces on board are given by field:rank pairs. A field is described by 2 chars: column number and row char in the standard Shogi coordinate system. Leftmost column is named '9', rightmost is '1'. Uppermost row is 'a', lowermost is 'i'.
A piece symbol is "borrowed" from Shogi Ladder notation (http://www.shogi.net/ladder/shogiboard.html). The 'w' and 'b' in front of the piece symbol's abbreviations indicate white and black respectively. When a piece is promoted, it will be given with a preceding "+", as in "+bL" or "+wP".
Summing up, here is an example Tsume Shogi position and it's JSON object representation:
tsumeJson = { |
JS SFEN parser is a JavaScript class that is able to translate generate Shogi position data in SFEN to JavaScript objects. The parser and it's best friend, JS Shogi Board Viewer, make it easy to put a Shogi diagram for given SFEN on your Web page.
I won't explain SFEN here. I did my best on this ShogiTools wiki page so If you are interested in the details, please check it out.
The viewer consists of 2 elements:
tsumeJson = SfenParser.parse("7r1/6B1p/6Bsk/9/7P1/9/9/9/9 B 2S");Then you send it to the viewer and voila!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>PHP Test</title> </head> <body> <?php phpinfo(); ?> </body> </html>
English name | Unicode for abbr. Kanji | Kanji | Rōmaji | Meaning | Abbreviations | ||
|---|---|---|---|---|---|---|---|
Symbol | Kanji | Rōmaji | |||||
King (reigning) | 738B | 王将 | ōshō |
royal general
| K | 王 | ō |
King (challenging) | 7389 | 玉将 | gyokushō |
jeweled general
| K | 玉 | gyoku |
Rook | 98DB | 飛車 | hisha |
flying chariot
| R | 飛 | hi |
Promoted rook (Dragon) | 9F8D or 7ADC | 龍王 | ryūō |
dragon king
| +R | 龍 or 竜 | ryū |
Bishop | 89D2 | 角行 | kakugyō |
angle mover
| B | 角 | kaku |
Promoted bishop (Horse) | 99AC | 龍馬 | ryūma or ryūme |
dragon horse
| +B | 馬 | uma |
Gold general (Gold) | 91D1 | 金将 | kinshō |
gold general
| G | 金 | kin |
Silver general (Silver) | 9280 | 銀将 | ginshō |
silver general
| S | 銀 | gin |
Promoted silver | 5168 | 成銀 | narigin |
promoted silver
| +S | 全 | — |
Knight | 6842 | 桂馬 | keima |
horse
| N | 桂 | kei |
Promoted knight | 572D or 4ECA | 成桂 | narikei |
promoted laurel
| +N | (圭 or 今) | — |
Lance | 9999 | 香車 | kyōsha |
incense chariot
| L | 香 | kyō |
Promoted lance | 674F or 4EDD | 成香 | narikyō |
promoted incense
| +L | (杏 or 仝) | — |
Pawn | 6B69 | 歩兵 | fuhyō |
foot soldier
| p | 歩 | fu |
Promoted pawn (tokin) | 3068 or 4E2A | と金 | tokin |
reaches gold
| +p | と (or 个) | to |
description | char | unicode |
|---|---|---|
1st column | 1 | FF11 |
2nd column | 2 | FF12 |
3rd column | 3 | FF13 |
4th column | 4 | FF14 |
5th column | 5 | FF15 |
6th column | 6 | FF16 |
7th column | 7 | FF17 |
8th column | 8 | FF18 |
9th column | 9 | FF19 |
1st row | 一 | 4E00 |
2nd row | 二 | 4E8C |
3rd row | 三 | 4E09 |
4th row | 四 | 56DB |
5th row | 五 | 4E94 |
6th row | 六 | 516D |
7th row | 七 | 4E03 |
8th row | 八 | 516B |
9th row | 九 | 4E5D |
symbol | unicode | meaning |
|---|---|---|
直 | 76F4 | move straight |
引 | 5F15 | pull (back) |
上 | 4E0A | go forward (literally means “up”) |
寄 | 5BC4 | go to the side |
右 | 53F3 | right |
左 | 5dE6 | left |
右引 | right-back | |
右寄 | right-go to the side | |
右上 | right up | |
左引 | left-back | |
左寄 | left-go to the side | |
左上 | left up |
The reference-orientation property defines the direction for top for the content-rectangle of the reference-area.
| Value | Description |
|---|---|
| 0 | Default. The orientation of this area has the same orientation as the containing reference-area |
| 90 | The orientation is rotated 90 degrees from the orientation of the containing reference-area |
| 180 | The orientation is rotated 180 degrees from the orientation of the containing reference-area |
| 270 | The orientation is rotated 270 degrees from the orientation of the containing reference-area |
| -90 | Same as specifying 270 |
| -180 | Same as specifying 180 |
| -270 | Same as specifying 90 |
The commercial equivalent of FOP, RenderX' XEP, did better in this area. I used to produce my first version of the collection with Kanji for the Shogi pieces.
I described what I am doing and I asked the question about the strange FOP behaviour on public w3.org lists. I didn't have to wait long for the answer. Jeremias Maerki informed me that the situation I described is a known bug in Apache FOP which hasn't been resolved yet.
Bad news, but at least I finally knew what is going on...
The same day, few hours later, Jeremias posted his second answer: he fixed the bug!
After downloading the newest version of FOP from Apache's site I am now able to produce the collection the way I wanted to.
Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:yI tried to run the database's home page by running FireFox and entering http://127.0.0.1:8080/apex address.
Starting Oracle Net Listener...Done
Configuring Database...Done
Starting Oracle Database 10g Express Edition Instance...Done
Installation Completed Successfully.
To access the Database Home Page go to "http://127.0.0.1:8080/apex"
conn sys as sysdba;
alter user system identified by;
alter user sys identified by;
>> > *fat bold cyclop* wrote:
>> > > I think the only flaw of it is, I think, it insufficient for
>> > > storing positions with more than 9 pieces in hand.
>> > In my opinion, this is a rather serious problem.
>>
>> Just use A, B, C, ..., H for 10 through 18.
>>
>> Using A through F for 10 to 16 is pretty standard (hexadecimal).
>> This particular extension seems rather obvious.
I have implemened a FEN notation in MacShogi 2 years ago, but I don't
have added the GUI part to use it yet.
I first have chosen the hexadecimal option to store the number of
pawns in hand but finally, I have preferred to use only digits.
The algorithm is pretty simple for pawns: the pieces in hand part in
the notation has 7 digits in all, one digit for each piece type,
except for the pawn where 2 digits can be used. So, if the string
contains 8 digits, the pawn number uses 2 digits, otherwise only one
digit is used for the number of pawn pieces.
It works well. But this is only a matter of personal choice.
Foreword: I know that similar work have been undertaken by different people already.
I don't claim I am inventing something that others didn't think of before. If you know some sources I'd be glad to put links to them in this post.
Note.When runing applications, don't worry if you see something likeCan't contact servlet runner at 127.0.0.1:6905. MyJavaServer.com does this kind of things from time to time. Wait few moments and try again.MyJavaServer is down for good. The example has been moved to Google AppEngine.
Note 2.The page is best viewed with Mozilla browser. I could force Internet Explorer to cooperation. The elements are slightly misplaced.I think I finally won the IE battle.
... 4. Black: R4d, +B4c, +P2a In hand: G White: K2c, G3c, S4b, L1b, P4a 5. Black: R2b, G3e, S3a, L2e In hand: None White: K3c, G4c, S1d, P4e ...
Shogi-l file->(.jj + javacc + jibix)->xml file->(xslt 2.0, saxon)->(fo, fo)->pdf and in the future -> spd, psn -> database
1. Black:+B3d, +B1c In hand: G
White: K2a, +R3c, L1a
<Position> <number>1</number> <BlackDescription> <PiecesPositions> <PiecePosition> <Piece> <isPromoted>true</isPromoted> <rank>B</rank> </Piece> <col>3</col> <row>d</row> </PiecePosition> <PiecePosition> <Piece> <isPromoted>true</isPromoted> <rank>B</rank> </Piece> <col>1</col> <row>c</row> </PiecePosition> </PiecesPositions> <Hand> <Piece> <isPromoted>false</isPromoted> <rank>G</rank> </Piece> </Hand> </BlackDescription> <WhiteDescription> <PiecesPositions> <PiecePosition> <Piece> <isPromoted>false</isPromoted> <rank>K</rank> </Piece> <col>2</col> <row>a</row> </PiecePosition> <PiecePosition> <Piece> <isPromoted>true</isPromoted> <rank>R</rank> </Piece> <col>3</col> <row>c</row> </PiecePosition> <PiecePosition> <Piece> <isPromoted>false</isPromoted> <rank>L</rank> </Piece> <col>1</col> <row>a</row> </PiecePosition> </PiecesPositions> </WhiteDescription> </Position>
1. White in hand: 9 8 7 6 5 4 3 2 1 +---+---+---+---+---+---+---+---+---+ | | | | | | | | wK| wL|a +---+---+---+---+---+---+---+---+---+ | | | | | | | | | |b +---+---+---+---+---+---+---+---+---+ | | | | | | |+wR| |+bB|c +---+---+---+---+---+---+---+---+---+ | | | | | | |+bB| | |d +---+---+---+---+---+---+---+---+---+ | | | | | | | | | |e +---+---+---+---+---+---+---+---+---+ | | | | | | | | | |f +---+---+---+---+---+---+---+---+---+ | | | | | | | | | |g +---+---+---+---+---+---+---+---+---+ | | | | | | | | | |h +---+---+---+---+---+---+---+---+---+ | | | | | | | | | |i +---+---+---+---+---+---+---+---+---+ Black in hand:G