三日以内に終了?果たしてバンコクの伊勢丹が復活する日は来るのでしょうか。
ライチ祭

チェンライのライチ
近所のセントラルデパートでチェンライ県のライチ祭が開催されています。11日から13日までです。初日から行ってみて1キロ30バーツ(約90円)のライチを2キロ買って帰りました。時期的にそろそろ旬だと思いますが、このライチは少し酸っぱかったです。来月あたりきっといいのがいっぱい出回ると思います。
ちなみにライチの他にプーレー種のパイナップルがあるそうです。チェンライのお土産として初めて知りました。シンガポール種(シーラチャ種)よりこぶしくらい小さいです。
最近読んでいる国内旅行情報誌

最近読んでいる国内旅行情報誌です。この2ヶ月間タイの治安があまりよくないことと異常気象で気温が40度を超えているので、あまり旅行気分どころではありませんが、ずっと近所をウロウロするのもストレスが溜まってしまうので、とりあえずこの情報誌から面白そうな観光スポットを抽出することにしました。google mapなどで位置情報を確認したり、カーナビのドライブルートをセットしたりして事前に準備しておくこともなかなか楽しいです。タイ観光庁(TAT)が出版したオーソートーという情報誌です。75バーツでたいていの本屋に置いてあります。
位置情報:N12.825417, E99.36318
表紙の観光地名:PANOENTHUNG SCENIC POINT
バンコク伊勢丹からの所要時間:4時間19分
バンコク伊勢丹からの距離:224キロ
pngファイル解析
SyntaxHighlighter Evolvedというプラグインを使って、ソースコード表示してみました。
使い方がとても簡単、あっという間にできてしまいました。
サンプル画像「PNG形式」
「ソースコード(一部)」
// ------------
// File: png3.c
// ------------
#include <string.h>
#include "binfile.h"
#include "bindef.h"
// IHDR - Image Header -- 13 bytes
typedef struct {
dword width;
dword height;
byte depth;
byte color;
byte compression;
byte filter;
byte interlace;
} ihdr;
// symbolic names for critical chunks
// ----------------------------------
typedef enum { IHDR, PLTE, IDAT, IEND } chunktype;
// function prototype
// ------------------
void help ( char *pname );
void readIHDR ( ihdr *h, FILE *fp );
void dispIHDR ( const ihdr *h );
// --------------------------
// M A I N P R O G R A M
// --------------------------
int
main ( int argc, char *argv[] )
{
// PNG signature
const byte signature[8] = { 137, 80, 78, 71, 13, 10, 26, 10 };
byte fileheader[8];
FILE *png;
ihdr head; // image header
int n = 0; // chunk no.
dword size; // data size
byte type[5]; // 4-byte type + nul
dword crc;
int offset;
// PNG filename is supplied
// ------------------------
if ( argc < 2 )
help(argv[0]);
png = jopen(argv[1], "rb");
// read file header and test if it is 8-byte PNG signature
// -------------------------------------------------------
jread(fileheader, 8, png);
if ( memcmp(signature, fileheader, 8 ) != 0 )
jerror("Invalid PNG Image File");
offset = 8;
strcpy(type, "");
while ( strcmp(type, "IEND") != 0 ) {
printf("Chunk no. %3d, offset = %06X, ", n++, offset);
// read data size
// --------------
jread(&size, sizeof(size), png);
size = flip32(size);
printf("data size = %5u :", size);
offset += 4;
// read chunk type
// ---------------
jread(type, 4, png); type[4] = '\0';
printf("type = %s\n", type);
offset += 4;
// chunk data handling
// -------------------
if ( strcmp(type, "IHDR") == 0 ) {
// image header, read and display
// ------------------------------
readIHDR(&head, png);
dispIHDR(&head);
offset += 13;
} else {
// skip chunk data to CRC
// ----------------------
offset += size;
fseek(png, offset, SEEK_SET);
}
// 32-bit CRC marks the end of chunk
// ---------------------------------
jread(&crc, sizeof(crc), png);
crc = flip32(crc);
printf(" CRC = 0x%X\n", crc);
offset += 4;
}
printf("file size = %d bytes\n", offset);
jclose(png);
return 0;
}
// help - display application's usage information
// ----------------------------------------------
void
help ( char *pname )
{
printf("usage : %s <image-file.png>\n", pname);
exit(1);
}
// readIHDR - read crtical Imang HeaDeR, read one element at a time to
// avoid alignment problem, it's size is fixed to 13 bytes
// -------------------------------------------------------------------
void
readIHDR ( ihdr *h, FILE *fp )
{
jread(&h->width, sizeof(h->width), fp);
jread(&h->height, sizeof(h->height), fp);
jread(&h->depth, sizeof(h->depth), fp);
jread(&h->color, sizeof(h->color), fp);
jread(&h->compression, sizeof(h->compression), fp);
jread(&h->filter, sizeof(h->filter), fp);
jread(&h->interlace, sizeof(h->interlace), fp);
// flip 32-bit data read into network byte order
// ---------------------------------------------
h->width = flip32(h->width);
h->height = flip32(h->height);
}
// dispIHDR - display IHDR - image header information
// ---------------------------------------------------
void
dispIHDR ( const ihdr *h )
{
printf(" Image header information:\n");
printf(" width = %u\n", h->width);
printf(" height = %u\n", h->height);
// display one byte data as unsigned integer
// -----------------------------------------
printf(" bit depth = %u\n", (unsigned)h->depth);
printf(" color type = %u\n", (unsigned)h->color);
printf(" compression type = %u\n", (unsigned)h->compression);
printf(" filter type = %u\n", (unsigned)h->filter);
printf(" interlace type = %u\n", (unsigned)h->interlace);
}
「結果」
macmini:pnganlyze $ ./a.out test.png Chunk no. 0, offset = 000008, data size = 13 :type = IHDR Image header information: width = 400 height = 218 bit depth = 8 color type = 6 compression type = 0 filter type = 0 interlace type = 0 CRC = 0x880B1472 Chunk no. 1, offset = 000021, data size = 301 :type = iCCP CRC = 0xF1D37629 Chunk no. 2, offset = 00015A, data size = 9 :type = pHYs CRC = 0x9A9C18 Chunk no. 3, offset = 00016F, data size = 8192 :type = IDAT CRC = 0xC7D1619F Chunk no. 4, offset = 00217B, data size = 8192 :type = IDAT CRC = 0x4820D4C8 Chunk no. 5, offset = 004187, data size = 8192 :type = IDAT CRC = 0xBE901375 Chunk no. 6, offset = 006193, data size = 3089 :type = IDAT CRC = 0x67750D98 Chunk no. 7, offset = 006DB0, data size = 0 :type = IEND CRC = 0xAE426082 file size = 28092 bytes
ASUS A42Jノートパソコン

姪の新しいノートパソコンが壊れました。起動してからすぐブルースクリーンが出てwindows7の通常モードに入ることができませんでした。原因がよくわからなかったので結局2時間をかけて最初から再インストールすることにしました。
やはり最近のパソコンって速いですね。うちのパソコンは未だにcore2duoです。 ちなみにASUS A42JKのハードの構成はi5-430M + ATI Radeon HD5145 VRAM 1GB + DDR3 2GB です。価格性能比がなかなかよかったと思います。





