These pages are written by only Japanese.
|
Namazu for hns による簡易全文検索です。 詳細は 詳細指定/ヘルプをご参照下さい。 |
|||||||||||||||||||||||||||||||||||||||||||||
<?php $width = 8; $height = 8; $im = imagecreatetruecolor($width, $height); /* bitmap */ // $im = imagecreate($width, $height); /* palette */ $colors = array(); $colors []= imagecolorallocate($im, 255, 0, 0); // red $colors []= imagecolorallocate($im, 0, 255, 0); // green $colors []= imagecolorallocate($im, 0, 0, 255); // blue $colors []= imagecolorallocate($im, 255,255,0); // yellow for ($y=0 ; $y < $height ; $y++) { for ($x=0 ; $x < $width ; $x++) { $i = ($x + $y * $width) % 4; imagesetpixel($im, $x, $y, $colors[$i]); } } header("Content-type: image/png"); imagepng($im);
% ./a.out ~/lang/php/16x16palette.png png_filename=/home/yoya/lang/php/16x16palette.png png_buff.data_len=94 (width, height)=(8,8) bpp=2 color_type=3(PALETTE) palette_num=4 y=0: 1b 1b 24 00 80 11 24 00 y=1: 1b 1b 00 00 00 00 00 00 y=2: 1b 1b 00 00 00 00 00 00 y=3: 1b 1b 00 00 00 00 00 00 y=4: 1b 1b 00 00 00 00 00 00 y=5: 1b 1b 00 00 00 00 00 00 y=6: 1b 1b 00 00 00 00 00 00 y=7: 1b 1b 00 00 00 00 00 00ナルホド。
1b = 00011011 = 00 01 10 11 = 0 1 2 3って事か。
for (y=0; y < png_height; y++) { unsigned char *linedata = image_data[y]; bitstream_t *bs = bitstream_open(); bitstream_input(bs, linedata, png_get_rowbytes(png_ptr, png_info)); printf("y=%lu: ", y); for (x=0; x < png_width; x++) { int colorindex = bitstream_getbits(bs, bpp); printf("%02x ", colorindex); } bitstream_close(bs); printf("\n"); }実行結果
% ./a.out 16x16palette.png png_filename=16x16palette.png png_buff.data_len=94 (width, height)=(8,8) bpp=2 color_type=3(PALETTE) palette_num=4 y=0: 00 01 02 03 00 01 02 03 y=1: 00 01 02 03 00 01 02 03 y=2: 00 01 02 03 00 01 02 03 y=3: 00 01 02 03 00 01 02 03 y=4: 00 01 02 03 00 01 02 03 y=5: 00 01 02 03 00 01 02 03 y=6: 00 01 02 03 00 01 02 03 y=7: 00 01 02 03 00 01 02 03よし、完璧。(゜∇゜) コンパイル方法
% gcc -Wall -W png_dump.c -lpng bitstream.c使い方は上の通り。
% php sample/swfdump.phps bitmap.swf magic=FWS version=4 file_length=209 rect=(0, 0)-(240, 350) (f_size=14) frame_rate=12.0 frame_count=1 [0] tag=SetBackgroundColor(9) length=3 [1] tag=DefineBitsLossless(20) length=30 swf_tag_lossless_create_detail: indices_len != origsize - 4 * swf_tag_lossless->colormap_count at line(62) can't create tag detail (tag=20) swf_tag_lossless_print_detail: detail == NULL [2] tag=DefineBitsLossless(20) length=29 image_id=2 format=5 width=8 height=8 xrgb bitmap exists [3] tag=DefineShape2(22) length=95 [4] tag=PlaceObject2(26) length=6 [5] tag=ShowFrame(1) [6] tag=End(0)
% php sample/swfdump.phps bitmap.swf magic=FWS version=4 file_length=209 rect=(0, 0)-(240, 350) (f_size=14) frame_rate=12.0 frame_count=1 [0] tag=SetBackgroundColor(9) length=3 [1] tag=DefineBitsLossless(20) length=30 image_id=1 format=3 width=8 height=8 colormap_count=4 rgb colormap exists indices exists [2] tag=DefineBitsLossless(20) length=29 image_id=2 format=5 width=8 height=8 xrgb bitmap exists [3] tag=DefineShape2(22) length=95 [4] tag=PlaceObject2(26) length=6 [5] tag=ShowFrame(1) [6] tag=End(0)
% php sample/swfgetpngdata.phps bitmap.swf 1 > 1.png % php sample/swfgetpngdata.phps bitmap.swf 2 > 2.png % png_dump 1.png png_filename=1.png png_buff.data_len=119 (width, height)=(8,8) bpp=8 color_type=3(PALETTE) palette_num=4 y=0: 00 01 02 03 00 01 02 03 y=1: 00 01 02 03 00 01 02 03 y=2: 00 01 02 03 00 01 02 03 y=3: 00 01 02 03 00 01 02 03 y=4: 00 01 02 03 00 01 02 03 y=5: 00 01 02 03 00 01 02 03 y=6: 00 01 02 03 00 01 02 03 y=7: 00 01 02 03 00 01 02 03 % png_dump 2.png png_filename=2.png png_buff.data_len=103 (width, height)=(8,8) bpp=8 color_type=2(RGB) y=0: ff0000 00ff00 0000ff ffff00 ff0000 00ff00 0000ff ffff00 y=1: ff0000 00ff00 0000ff ffff00 ff0000 00ff00 0000ff ffff00 y=2: ff0000 00ff00 0000ff ffff00 ff0000 00ff00 0000ff ffff00 y=3: ff0000 00ff00 0000ff ffff00 ff0000 00ff00 0000ff ffff00 y=4: ff0000 00ff00 0000ff ffff00 ff0000 00ff00 0000ff ffff00 y=5: ff0000 00ff00 0000ff ffff00 ff0000 00ff00 0000ff ffff00 y=6: ff0000 00ff00 0000ff ffff00 ff0000 00ff00 0000ff ffff00 y=7: ff0000 00ff00 0000ff ffff00 ff0000 00ff00 0000ff ffff00問題なし。
[4] tag=DefineSound(14) length=2505 sound_id=1 format=2(MP3) rate=1 is_16bits=1 is_stereo=0 samples_count=11019 sound_data(length=2498)
mp3_filename=../game-1.mp3 mp3_data_len=2498 sync_word=0x7ff version=0 layer=1 no_protection=1 bit_rate=2 sample_rate=0 padding=0 reserved=0 channel_mode=3 mode_extension=0 copyright=0 original=0 emphasis=0 ---- sync_word=0x7ff version=2 layer=2 <略>試しに sync word を scan してみたところ、 一個目の header は正しく抽出されてそう *1 ですが、2つ目以降はボロボロ。
while (mp3_dump_frame(bs)) { // bitstream_incrpos(bs, 97, 0); // NG bitstream_incrpos(bs, 98, 0); // OK // bitstream_incrpos(bs, 100, 0); // OK }実行結果
% ./a.out ../game-1.mp3 | grep version=0 | wc bitstream_getbit: bs->data_len(2498) <= bs->byte_offset(2498) 24 24 240bitstream_getbit の警告は bitstream.c 側の問題なのでご容赦を。(⊃д⊂)
witch(fr->lay) case 1: fr->framesize = (long) tabsel_123[fr->lsf][0][fr->bitrate_index] * 12000; fr->framesize /= freqs[fr->sampling_frequency]; fr->framesize = ((fr->framesize+fr->padding)<<2)-4; fr->down_sample=0; fr->down_sample_sblimit = SBLIMIT>>(fr->down_sample); break; case 2: fr->framesize = (long) tabsel_123[fr->lsf][1][fr->bitrate_index] * 144000; fr->framesize /= freqs[fr->sampling_frequency]; fr->framesize += fr->padding - 4; fr->down_sample=0; fr->down_sample_sblimit = SBLIMIT>>(fr->down_sample); break; case 3: <略>なんだか、面倒そうなのでやっぱり自前はやめて mpglib を利用する事にします。(´Д`;)
struct buf { unsigned char *pnt; long size; long pos; struct buf *next; struct buf *prev; }; struct framebuf { struct buf *buf; long pos; struct frame *next; struct frame *prev; };あれ?
typedef struct mpstr_tag { <略> struct frame fr; /* holds the parameters decoded from the header */むむむ…
struct frame { int stereo; int jsbound; int single; <略> int bitrate_index; <略> int framesize; /* computed framesize */まさしく欲しいデータ構造がそのまま定義されてます。
% gcc lame_test.c -L/usr/local/lib -lmp3lame $ env LD_LIBRARY_PATH=/usr/local/lib ./a.out game-1.mp3何となく使い方は分かってきたけど、残念ながら frame header chain を作る API が見つからず。うーむ。
sql> CREATE DATABASE pxidb
% cat pxidb.sql | mysql -h <秘密のIP> pxidb -u pxi -p
127.0.0.1 ffxi00.pol.com
127.0.0.1 ffxi00.pol.com
問題が発生したため、pXI-Server-0.6.1.exe を終了します。 ご不便をおかけして申し訳ありません。○rz
WTF?? Did not find a match?!?!やっぱりダメか… ○rz
if((CGlobal::connectList.size() > 0)) { for(i = (CGlobal::connectList.size()-1); i >= 0; i--) { //Does the IP match and is the RecvKey free? if ((r.ip == CGlobal::connectList.at(i).ip) && (CGlobal::connectList.at(i).s == 0)) { //We found the RecvKey we were looking for!! CConsole::outTime("Found it"); break; } } } else { //We don't have a list........ CConsole::outTime("WTF??"); } //Confirm we are within range and it is valid if (i < CGlobal::connectList.size()){ //Store the newly made socket into the connectList CGlobal::connectList.at(i).s = r.s; CGlobal::connectList.at(i).out = ListenSocket2; mysql_thread_init(); //Run the PolLobbyComm thread CreateThread(0,0,PolLobbyComm,&CGlobal::connectList.at(i),0,0); } else { //How did we not find a match? :( CConsole::outTime("Did not find a match?!?!"); }この connectList に追加する部分は
DWORD WINAPI LobbyServ(LPVOID lpParam) { <略> while(1) { size = sizeof(ip); r->out = 0; //Listens for our client to connect r->s1 = accept(ListenSocket, (struct sockaddr *)&ip, &size); if (r->s1 == INVALID_SOCKET) { closesocket(ListenSocket); CConsole::outErr("accept failed: %d\n", WSAGetLastError()); WSACleanup(); return 1; } //Find the IP address of the client that connected to us r->ip = ip.sin_addr.S_un.S_addr; r->s = 0; //Push the client onto our list CGlobal::connectList.push_back(*r); }どうも、 54001 の前に 54230 のメッセージを受け取らないといけないのに、 54230 のメッセージが届いてないので、そんなの知らないって言われてそう。 きっと、54230 の thread が落ちてるんだろうなぁ… *1
o @zone - instantly zone yourself to a specified location (e.g. "@zone 0xZZ"). o @additem - puts an item of your choice in your inventory (e.g. "@additem 0xZZZZ"). o @pos - teleport your character to a given position (e.g. "@pos 1 2 3"). o @posr- changes your position relative to your current position (e.g. "@posr 0 2 0"). o @inject - load a packet to be sent to the client (e.g. "@inject packet.dat"). o @debug - print your characters charid and targid to the server o @gm - toggle GM flag o @changejob - change your job, the first parameter is the job, the second is the level (e.g. "@changejob 0xA 75") o @where - echos your current position to the server console. o @npc - echos the closest npc to you to the server console. o @zoneR - reloads a zone (e.g @zoneR 0xf5 (reloads lower jeuno)). o @hp - changes your hp, if it sinks to 0, you die. (e.g @hp 0x00 (you die)). o @mobani - change the animation of the selected mob (e.g @mobani 0x03 (it dies)). o @animation - change your character animation (e.g @animation 0x05 (mount a choco)). o @cs - play a cutscene in the current zone (e.g. @cs 0x01).自分以外いないけどねw
230 :既にその名前は使われています:2008/09/05(金) 02:02:50 ID:9PMMttxt WTHが出るのは同意画面に入る前にClientv動かした場合。 俺はすくなくともそうなった。README にもやり方が書いてあるのに。アホでした。
Launch FFXI and wait at the screen where you get to accept or decline the terms of agreement (which occurs after the POL version check, and before the character selection screen). Now launch the pXI-client.exeとはいえ、少し動かしてるとすぐ落ちるのは変わらず。
@pos -20 -20 -20 @pos -60 -60 -40
@pos 0 -200 140
% mkdir ming % cd ming % cvs -d:pserver:anonymous@ming.cvs.sourceforge.net:/cvsroot/ming login % cvs -z3 -d:pserver:anonymous@ming.cvs.sourceforge.net:/cvsroot/ming co -P .ming が PNG を処理するファイルは、ming/util/png2dbl.c,dbl2png.c の2つ。
png2dbl.c の中身 struct pngdata readPNG(FILE *fp) { <略> png_read_image(png_ptr, row_pointers);普通に libpng 経由で zlib 圧縮/伸張してるっぽいです。残念。
phpize ./configure --enable-qr --enable-qr-gd make make install vi /etc/php.d/qr.iniチェック
% php -v PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/qr.so' - /usr/lib/php/modules/qr.so: undefined symbol: php_input_from_zval in Unknown on line 0 PHP 5.1.6 (cli) (built: Jul 16 2008 19:53:00) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies怒られてる…
<?php $data = 'http://pwiki.awm.jp/~yoya/'; $options = array( 'format' => QR_FMT_JPEG, 'magnify' => 4, ); header('Content-Type: image/jpeg'); qr_output_symbol(null, $data, $options);