Set DNS to 8.8.8.8 My Network -> Property -> TCPIP -> Property -> DNS -> OK Access the website Change DNS back to the value it should be Linux Set DNS to 8.8.8.8 [vuhung@redmine-0.8.7]$ cat /etc/resolv.conf ; generated by /sbin/dhclient-script nameserver 8.8.8.8 #nameserver 192.168.51.1 Access the website Change DNS back to the value it should be
May 6, 2010
Clear (Flush) Windows and Linux DNS cache
Nov 13, 2009
Bài học
Được và các bài học : - Học được kỹ năng quản lý chung 20 người đồng thời làm team lead của 1 hay 2 dự án. - Rút ra được những bài học quý giá về lãnh đạo và kinh nghiệm lãnh đạo người Việt. - Một chút quyết đoán có tính độc tài (giúp cân bằng lại tính cách ôn hòa của cá nhân). - Hiểu được rằng trong môi trường doanh nghiệp Việt Nam, mô hình quản lý "silent lead" hay "vi vô vi" kiểu Lão Tử là bất khả thi. - Hiểu ra được rằng muốn tồn tại thì phải hy sinh quyền lợi cá nhân *nhiều* hơn và đặt cấp trên (có xu hướng bảo thủ và độc tài) lên trên. - Các kỹ năng khác. - Tác phong doanh nghiệp kiểu Việt Nam như: cách nói chuyện, cách viết email, dùng từ (bằng tiếng Việt). - Mô hình thiếu dân chủ không thể tồn tại, mặc dù trong doanh nghiệp. - Một công ty muốn phải triển phải dựa trên nguyên tắc win-win và tôn trọng lẫn nhau. - Học được cách maintain những conversation "vô bổ" (để giữ quan hệ, giải lao, xả stress). - Một cuộc cách mạng phải trả giá bằng máu. Một sự thay đổi có tính cách mạng phải trả giá đắt. Giá đắt trong short term có thể tốt trong long term. Chọn fast decision chứ không phải "better decision" vì không có thời gian. - Học được cách điều hòa với nhân viên và cấp trên. - Xác định lại và kiên định với career map của mình: Quản lý kỹ thuật. Mất: - Stress quá nặng. Bị ức chế tới mức không thể kiểm chế và không hồi phục được trong một vài tháng. - Mất tương lai: Chi phí cơ hội cho 6 tháng phí phạm không phải là nhỏ. - Tài chính: Thu nhập thấp, bỏ không nhận các offer về options (vì quyết định chi sẻ)
Oct 28, 2009
Chia se mot so kinh nghiem phong van
Chia sẻ một số kinh nghiệm phỏng vấn của bản thân. 1. Đọc kỹ trước CV của ứng viên, đặc biệt tìm hiểu về những công nghệ lạ mà ứng viên đề cập trong CV. Việc này cần chuẩn bị trước. HungNV dành khoảng 15-30 phút cho việc này. 2. Hỏi người quen ở các công ty cũ của ứng viên (optional, nếu có thế) 3. Mạo đầu phỏng vấn bằng cách giới thiệu vị trí người phỏng vấn (chính mình), giới thiệu công ty, giới thiệu vị trí, nhân sự mà công ty đang cần (AI-T tuyển tràn lan, không có tiêu chí rõ ràng gây khó khăn cho người phỏng vấn) 4. Di dần theo các điểm chính trong CV (đã tổng kết ở phần 1.) 5. Hỏi sâu và một dự án mà ứng viên cảm thấy tâm đắc nhất, qua đó nhìn ra: - Kỹ năng giải quyết vấn đề - Kỹ năng quản lý - Team work (khả năng giải quyễt xung đột trong team) - Kỹ thuật nói chung (test, lập trình) - Cách hiểu của ứng viên về quy trình phát triển phần mềm - Khả năng chịu pressure của công việc Nếu là sinh viên thì chỉ cần focus vào teamwork, các họat động ngoại khóa là đủ.
Aug 24, 2009
The Ubiquity of Evony
1. A New Perspective
I am an old school Age of Empire [the Conquer pack] (AOC) player and I have been playing this game for over 8 years. The one day I found Evony, which has a few nice features that AOC does not have:
1. The number of players is not limited.
2. Free (and technically free forever)
3. Evony is also a real-time strategy (RTS) game (I will explain later)
4. Can be played anywhere with just a browser.
2. Cutting-edge Technologies
The reason why Evony is Operation System independent is that, it uses the latest cutting-edge technology called Flash. This may sound obvious to most of the reader but this is the point that makes Evony unique. Network based games are hard to be developed and Flash makes it easier. Evony has made an excellent work on graphics. Do I need to compare Evony with the most popular among officers game called FarmTown?
The Internet doesn’t mean connectivity to everywhere. I still remember the day of TCP/IP dominated game era: We have to mess up with the router for port forwarding. With Evony, it is easy; all we need is just a browser (zero setup!) – Nothing can be simpler than that!
The “Map View” mode is very well done and I have never seen that kind of work in other text-based RTS games before: We can browse the map in the way we use Google map. Adding visualization to the game is the key factor that makes Evony easy to play and being unique.
3. In-game Booming and Rush
You are given 5000 resources of each kind (food, lumber, stone, iron and gold) and you have 7 days of protection, which means, you have 7 days of free booming without fear of being attacked from stronger users.
Of course, with 7 days, you can never be strong enough if decide going solo. You can buy items that make stronger but it will never be enough. And you have to find a good alliance to join. Otherwise, you won’t survive!
Army training in Evony goes the same way like other RTS games: We make a good economy, getting resources and training armies. The difference from Evony to AOC is that: Evony has only one kind of “army building”: The barrack. However, we can train dozen kinds of armies from it.
Fighting in Evony is not so visually: We choose a target, right-click it and choose “Attack”. A new window will popup letting we choose the armies. This is fine but after the attacked is launched, all we can do is WAITING! We can cancel the attack but we can not redirect (I mean set the targets to another coordinator). When the armies arrive the target, the fight instantly finished in a not-so-intuitive fashion way. AOC players like may ask: How to micro-management in Evony? Well, probably no, there is only macro-management in Evony.
4. Is This a True Real-Time Strategy Game?
Yes it is. However, to be precise, Evony belongs to a sub-genre of RTS game called Real-Time Tactics. Therefore, AOC players, who understand the meaning of the phase “Real-Time Strategy” in a misleading way, will find it strange at the first look. However, macro-management skills in AOC can be similarly applied here easily.
23/08/2009
Written by Nguyen Vu Hung
Email: vuhung16plus@gmail.com
Evony nickname: “VCF ksv9x” on server 30
Apr 25, 2009
Apr 8, 2009
Thống kê dung lượng kết nối Internet ở Việt Nam
Sơ đồ kết nối: http://www.hn.is.uec.ac.jp/~vuhung/vietnam/thong-ke-internet-vietnam.html Dung lượng kết nối: http://www.thongkeinternet.vn/jsp/dungluong/dungluongthang.jsp
Mar 26, 2009
Nikkor AF Nikkor 85mm f/1.4D IF review
Ưu điểm: * Sharpness là điểm nổi trội và output nhìn rất giống Nikon 85mm 1.2L và nhỉnh hơn một chút ít so với Nikkor 70-200 2.8 VR. * f/1.4 nhanh (hơn hẳn f/1.8) khi chụp ở điều kiện thiếu sáng. * Bokeh mịn nhìn giống kem mà Nikkor 50 1.4, 50 1.8, 85 1.8 không có. Đây là điểm nối bật của 85 1.4D so với 3 lens nói ở trên. * f/1.4 nhanh hơn hẳn Nikkor 70-200 2.8 VR ở điều kiện thiếu sáng * Chụp rất tốt khi trời sẩm tối (lúc này f/2.8 không thể lấy sáng cho dù tăng ISO 3200) * Distortion thấp có thể bỏ qua. * Vignetting hầu như không có và có thể bỏ qua ở f/1.4 và hoàn toàn không có ở f/2. * Có thể thay thế macro lens nếu biết sử dụng hợp lý. Nhược điểm: * Không thể zoom và thiếu cơ động hơn hẳn người anh em Nikkor 70 200 2.8 VR * Trở thành 135mm (hơi dài với crop body. * AF không nhanh bằng Nikkor 70 200 2.8 VR (tuy nhiên AF đủ nhanh để chụp in-door sport trong điều kiện low light. * Nhẹ và gọn hơn Nikkor 70 200 2.8 VR
Nov 14, 2008
Changing LS_COLORS
#Using bash 3.2.0 on CentOs 5.0 di=00 or di=01 means dar blue for folder in black background, which is quite hard to see. So I changed it to di=1;35;100( purple ). Old: LS_COLORS='no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35: New: LS_COLORS='no=00:fi=00:di=1;35;100:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:' |
Nov 12, 2008
A webalizer hack attempt
Aug 12, 2008
Finding nearest pow to 2
/* gcc pow_opt.c */ /* http://jeffreystedfast.blogspot.com/search/label/algorithms */ #include#include #include typedef long uint32_t; static uint32_t nearest_pow1(uint32_t num) { uint32_t n = 1; while (n < num) n <<= 1; return n; }static uint32_t nearest_pow2(uint32_t num) { uint32_t n = num > 0 ? num - 1 : 0; n |= n >> 1; n |= n >> 2; n |= n >> 4; n |= n >> 8; n |= n >> 16; n++; return n; } static uint32_t nearest_pow3(uint32_t num) { int bit; __asm__("bsrl %1,%0\n\t" "jnz 1f\n\t" "movl $-1,%0\n" "1:": "=r"(bit):"rm"(num)); return (1 << (bit + 1)); } static uint32_t nearest_pow4(uint32_t num) { uint32_t j, k; (j = num & 0xFFFF0000) || (j = num); (k = j & 0xFF00FF00) || (k = j); (j = k & 0xF0F0F0F0) || (j = k); (k = j & 0xCCCCCCCC) || (k = j); (j = k & 0xAAAAAAAA) || (j = k); return j << 1; } //A simple performance test might be: int main(int argc, char **argv) { uint32_t i, n = 0; uint32_t test_pow = atol(argv[1]); switch ( test_pow ) { case 1: for (i = 0; i < INT_MAX / 10; i++) n += nearest_pow1(i); case 2: for (i = 0; i < INT_MAX / 10; i++) n += nearest_pow2(i); case 3: for (i = 0; i < INT_MAX / 10; i++) n += nearest_pow2(i); case 4: for (i = 0; i < INT_MAX / 10; i++) n += nearest_pow2(i); } return n > 0 ? 1 : 0; } [vuhung@aoclife g++]$ for i in 1 2 3 4; do time ./a.out $i; done real 0m43.297s user 0m42.969s sys 0m0.318s real 0m20.455s user 0m20.343s sys 0m0.109s real 0m13.653s user 0m13.566s sys 0m0.082s real 0m6.817s user 0m6.769s sys 0m0.048s
Jul 23, 2008
Giám khảo thi ảnh Hà Nội cho xóm nhiếp ảnh
thang điểm 100. 1. SUNF - Hành tinh nhỏ Hà Nội 85/100. Đối với những nhiếp ảnh gia đạt đạo, kỹ thuật và máy móc luôn là yếu tố thứ yếu. Đây là quan điểm gây nhiều tranh cãi nhưng bộ ảnh "Hành tinh nhỏ Hà Nội" của bác Sunf bắt người xem phải có một cái nhìn khách quan và thấu đáo hơn. Bố cục, góc nhìn lạ. Tấm "Vinaconex - Trung Hòa Nhân Chính" có lẽ thành công nhất trong bộ, nhìn giống như bom, một thông điệp cho sự phát triển ổn định của Hà Nội. 2. Vision II - Hồ Gươm 60/100. Đây là đề tài cũ nên em nghĩ rất khó tìm được gì mới nếu tác giả chỉ đi một vòng quanh Hồ Gươm. Ở năm 2008 này mà bác vẫn đi chụp phim - mà là đen trắng nhé - thì quả là em phục thật! 3. Haitre - Những ngày trong nắng 80/100. Cái hay của bộ ảnh này là sự tương phản giữa sự hiện đại và cổ điển. Nhà cổ và ô tô. Ô tô và xe đạp. Và cả đám cưới phố cổ nữa, đúng không nhỉ? Có lẽ tác giả là người rất sành và rành Hà Nội! 4. m42 - Hồ Gươm 65/100. Đây là đề tài cũ và khó chụp. Ảnh có điểm nhấn nhưng chưa mô tả rõ được sự tương phản mà tác giả muốn mô tả. 5. ling - Hà Nội 85/100 Đây là bộ thứ 3 xóm nhà ta chụp Hồ Gươm. Như em nói rồi, khó chụp! Nhưng bộ này thì đúng là tác giả có bỏ thời gian để chùm ảnh nằm trong một đề tài. Tháp rùa, và người già? Có phải là sự già nua của Hà Nội không nhỉ? Có lẽ không vì ở tấm ảnh cuối, một cô gái váy trắng đi xuyên qua Tháp rùa, đằng sau là bà cụ nhìn với theo. Thật ghen tị với tác giả về thời gian quý hiếm này. 6. Haitre - Vỉa hè Hà Nội Em chưa gặp bác HaiTre ở ngoài đời, nhưng mạn phép đoán là bác là người rất thích đem theo máy ảnh và ngồi vỉa hè theo phong cách lomo. Tấm 1( cái niêu ), tấm 2 ( quạt con cóc ), tấm 5( Honda ) rất thành công và được đặt theo thứ tự về thời gian. Tầm chụp hoa hồng và xe đạp em nghĩ là không hợp trong chủ đề hiện tại. Một băn khoăn của em: Xe đạp Trung Quốc hay Nhật, thời nào? 7. hieubn - Hà Nội, Hà Nội 30/100. Như tác giả nói, đây là một bộ ảnh kỷ niệm của một cô gái Hà Nội. Nó chưa làm nổi bật được nét "Hà Nội" của tên bộ ảnh. Sự can thiệp bằng phần mềm làm cho bộ ảnh nhìn cũ đi, hợp hơn với cái tên cổ "Hà Thành" em nghĩ chưa thành công. 8. minhdesigner - Tết Hà Nội 50/100 Tấm này làm em suy nghĩ quá: Chủ nhân chiếc xe đạp cọc cạch có bán được cành đào hay không? http://xomnhiepanh.com/gallery.php?do=album_detail&album_id=341&id=3 9. 6unL - Nắng Hà Nội 70/100. Một Hà Nội thu nhỏ ở đây: Bán rong, xe máy, dây điện, xe máy. Em tiếc lá thiếu ô tô. http://xomnhiepanh.com/gallery.php?do=album_detail&album_id=397&id=1 Ba tấm còn lại em nghĩ chưa đạt, vì nắng Hà Nội gắt quá :D. 10. dan - màu của Gươm 70/100. Đây là đề tài cũ và khó chụp. Em đánh giá rất cao trình đọc sáng của tác giả. 11. m42 - Quán Hà Nội 90/100. Rất thành công trong việc bó hẹp đề tài. Bác có cái nhìn Việt Nam rất độc đáo mà người Việt Nam ở Việt Nam không hề có. 12. sonlam - Hà Nội mùa xuân 85/100. - Không có bình luận.
Jun 25, 2008
Notepad++ Japanese.
2. Download Japanese language pack.
Notepad++ 4.0.2 用日本語ロケール
http://homepage3.nifty.com/georgei/extension/notepadpp_jpl_v09.zip
3. Extract nativeLang.xml to npp.5.0.beta.bin\
4. Restart notepad++
5. From menu: Format -> UTF-8
Jun 23, 2008
ls awk to find filesizes
ls -lk | awk '{print $5;}'
[vuhung@aoclife src]$ ls -lk *c | head
-rw-r--r-- 1 vuhung vuhung 23 4月 5 07:45 cairo-analysis-surface.c
-rw-r--r-- 1 vuhung vuhung 9 4月 12 06:07 cairo-arc.c
-rw-r--r-- 1 vuhung vuhung 13 4月 8 07:30 cairo-array.c
-rw-r--r-- 1 vuhung vuhung 3 4月 4 01:25 cairo-atomic.c
-rw-r--r-- 1 vuhung vuhung 5 4月 5 07:45 cairo-base85-stream.c
-rw-r--r-- 1 vuhung vuhung 52 4月 5 07:45 cairo-bentley-ottmann.c
-rw-r--r-- 1 vuhung vuhung 11 4月 5 07:45 cairo-cache.c
-rw-r--r-- 1 vuhung vuhung 66 4月 8 07:30 cairo-cff-subset.c
-rw-r--r-- 1 vuhung vuhung 23 4月 5 07:45 cairo-clip.c
-rw-r--r-- 1 vuhung vuhung 5 1月 18 08:09 cairo-color.c
[vuhung@aoclife src]$ ls -lk *c | awk '{print $5;}' | head
23
9
13
3
5
52
11
66
23
5
Jun 5, 2008
Trojan.SpyBuddy
Mar 28, 2008
Add GPS info to EXIF
Browser Google map and get http://maps.google.com/?ie=UTF8&ll=35.675174,139.757635&spn=0.001181,0.002167&z=19 Pass the cordinators to exiftool: C:\temp>exiftool -GPSLatitudeRef=N -GPSLongitudeRef=E -GPSAltitude=5 -GPSAltitudeRef="Above Sea Level" -overwrite_original -GPSLatitude=35.675174 -GPSLongitude=139.757635 -c "%.6f" "Yokoshima DSC_3562.jpg" and we done. batch process: @echo off echo adding gps ... for %%nef in (dir /b *.NEF) DO exiftool -GPSLatitudeRef=N -GPSLongitudeRef=E -GPSAltitude=5 -GPSAltitudeRef="Above Sea Level" -overwrite_original -GPSLatitude=35.675174 -GPSLongitude=139.757635 -c "%.6f" %%nef echo DONE PAUSE Or simply use this: for %f in (*.JPG) DO exiftool -GPSLatitudeRef=N -GPSLongitudeRef=E -GPSAltitude=5 -GPSAltitudeRef="Above Sea Level" -overwrite_original -GPSLatitude=21.059562 -GPSLongitude=105.762752 -c "%.6f" %f for %f in (*.NEF) DO exiftool -GPSLatitudeRef=N -GPSLongitudeRef=E -GPSAltitude=5 -GPSAltitudeRef="Above Sea Level" -overwrite_original -GPSLatitude=21.059562 -GPSLongitude=105.762752 -c "%.6f" %f refs: http://owl.phy.queensu.ca/~phil/exiftool/TagNames/GPS.html http://www.carto.net/projects/photoTools/gpsPhoto/ http://hwat.sakura.ne.jp/hpod/200610/11-220000/ http://hwat.sakura.ne.jp/hpod/200609/28-200000/ http://en.wikipedia.org/wiki/Global_Positioning_System
Feb 26, 2008
squid configuration on Centos 5
squid configuration on Centos 5
Jan 16, 2008
Folding with vim, a cheat sheet
v|V, select zf or any other command ( fold in visual mode ) :20,101 fo[ld]: fold selected lines zf/string: fold until the first match of "string" . :mkview : save folds. :loadview : load folds. zf/string creates a fold from the cursor to string . Try within an "#ifdef" and "#endif". zf#j creates a fold from the cursor down # lines. zj moves the cursor to the next fold. zk moves the cursor to the previous fold. zo opens a fold at the cursor. zO opens all folds at the cursor. zm increases the foldlevel by one. zM closes all open folds. zr decreases the foldlevel by one. zR decreases the foldlevel to zero -- all folds will be open. zd deletes the fold at the cursor. zE deletes all folds. [z move to start of open fold. ]z move to end of open fold.
Jan 7, 2008
A C pointer FAQ ( kind of ) [ as of now for me ]
Of course, pointers are not limited to ints. It's quite common to use pointers to other types, especially char. Here is the innards of the mystrcmp function we saw in a previous chapter, rewritten to use pointers. (mystrcmp, you may recall, compares two strings, character by character.)
// p1, p2 point to the address of the first character in str1, str2 respectively
char *p1 = &str1[0], *p2 = &str2[0];
while(1)
{
// compare the values of str1[x], str[x] at the position x. Not equal
if(*p1 != *p2)
return *p1 - *p2;
// we reached the end of both str1, str2 -> they are equal.
if(*p1 == '\0' || *p2 == '\0')
return 0;
// p1++ and p2++ do the increment of p1 and p2.
// i.e., the next characters in str1 ( str[x + 1] and str2 ( str2[ x + 1]
p1++;
p2++;
}
As another example, here is the strcpy (string copy) loop from a previous chapter, rewritten to use pointers:
char *dp = &dest[0], *sp = &src[0];
while(*sp != '\0')
// *dp++ means *(dp++), i.e., the value of the pointer next to dp.
// to access the address of the next pointer of dp, use (*dp)++
*dp++ = *sp++;
*dp = '\0';
(One question that comes up is whether the expression *dp++ increments p or what it points to. The answer is that it increments p. To increment what p points to, you can use (*dp)++.)
ref: http://www.eskimo.com/~scs/cclass/notes/sx10b.html
Os type detection with uname
[vuhung@test_make]$make vh
SunOs
[vuhung@test_make]$cat Makefile
uname=$(shell uname)
ifeq ($(uname), Linux)
APP_OSTYPE = Linux
endif
ifeq ($(uname), SunOS)
APP_OSTYPE = SunOs
endif
vh:
@echo $(APP_OSTYPE)
Dec 21, 2007
C pointer FAQ :D
Of course, pointers are not limited to ints. It's quite common to use pointers to other types, especially char. Here is the innards of the mystrcmp function we saw in a previous chapter, rewritten to use pointers. (mystrcmp, you may recall, compares two strings, character by character.)
// p1, p2 point to the address of the first character in str1, str2 respectively
char *p1 = &str1[0], *p2 = &str2[0];
while(1)
{
// compare the values of str1[x], str[x] at the position x. Not equal
if(*p1 != *p2)
return *p1 - *p2;
// we reached the end of both str1, str2 -> they are equal.
if(*p1 == '\0' || *p2 == '\0')
return 0;
// p1++ and p2++ do the increment of p1 and p2.
// i.e., the next characters in str1 ( str[x + 1] and str2 ( str2[ x + 1]
p1++;
p2++;
}
As another example, here is the strcpy (string copy) loop from a previous chapter, rewritten to use pointers:
char *dp = &dest[0], *sp = &src[0];
while(*sp != '\0')
// *dp++ means *(dp++), i.e., the value of the pointer next to dp.
// to access the address of the next pointer of dp, use (*dp)++
*dp++ = *sp++;
*dp = '\0';
(One question that comes up is whether the expression *dp++ increments p or what it points to. The answer is that it increments p. To increment what p points to, you can use (*dp)++.)
ref: http://www.eskimo.com/~scs/cclass/notes/sx10b.html
Read and write png files bytes by bytes
#include#include #include #define WIDTH (3) #define HEIGHT (3) int main() { unsigned char **image; // image[HEIGHT][WIDTH]の形式です int i, j; image = (png_bytepp)malloc(HEIGHT * sizeof(png_bytep)); // 以下3行は2次元配列を確保します for (j = 0; j < HEIGHT; j++) image[j] = (png_bytep)malloc(WIDTH * sizeof(png_byte)); for (i = 0; i < WIDTH; i++) { // 以下5行は単純なテストパターンを作ります for (j = 0; j < HEIGHT; j++) { image[j][i] = (unsigned char)i; } } unsigned char *image2; image2 = (png_bytep) malloc( HEIGHT * WIDTH * sizeof(png_byte)); for (i = 0; i < WIDTH; i++) { // 以下5行は単純なテストパターンを作ります for (j = 0; j < HEIGHT; j++) { //printf("%d ", image[j][i]); image2[j * WIDTH + i] = image[j][i]; printf("%d ", image2[j * WIDTH + i]); } } // TODO: write image2 to png stream // http://www.jah.ne.jp/~naoyuki/Writings/MngPng.html return 0; }
Solaris 10: vim 7.1 color
Solaris 10 vim71 color wget vim-7.1.tar.gz tar xzvf vim-7.1.tar.gz cd vim71 ./configure --prefix=$HOME CC=gcc make; make install echo "syntax on" > .vimrc export TERM=sun-color ( or echo "export TERM=sun-color" >> $HOME/.bash_profile or TERM=xterm or TERM=xtermc
Dec 20, 2007
Solars 10: Graphics Magick 1.10 installation
/bin/bash ../../libtool --silent --mode=link g++ -D_REENTRANT -pthreads -version-info 1:3:0 -L/usr/sfw/lib -L/usr/lib -o libGraphicsMagick++.la -rpath /export/home/vuhung/lib Blob.lo BlobRef.lo CoderInfo.lo Color.lo Drawable.lo Exception.lo Functions.lo Geometry.lo Image.lo ImageRef.lo Montage.lo Options.lo Pixels.lo STL.lo Thread.lo TypeMetric.lo ../../magick/libGraphicsMagick.la
libtool: link: `/usr/sfw/lib/libstdc++.la' is not a valid libtool archive
make[3]: *** [libGraphicsMagick++.la] Error 1
make[3]: Leaving directory `/export/home/vuhung/usr/src/GraphicsMagick-1.1.10/Magick++/lib'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/export/home/vuhung/usr/src/GraphicsMagick-1.1.10/Magick++/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/export/home/vuhung/usr/src/GraphicsMagick-1.1.10/Magick++'
make: *** [all-recursive] Error 1
232 ~/bin/tar xjvf GraphicsMagick-1.1.10.tar.bz2
233 cd GraphicsMagick-1.1.10
257 ./configure --prefix=$HOME CC=gcc CXX=g++ --enable-ccmalloc -without-perl
258 ~/bin/make
269 make install
bash-3.00# diff /usr/sfw/lib/libstdc++.la /usr/sfw/lib/libstdc++.la.original.2007-12-19.vh
1,32d0
< # libstdc++.la - a libtool library file
< # Generated by ltmain.sh - GNU libtool 1.4a-GCC3.0 (1.641.2.256 2001/05/28 20:09:07 with GCC-local changes)
< #
< # Please DO NOT delete this file!
< # It is necessary for linking the library.
<
< # The name that we can dlopen(3).
< dlname='libstdc++.so.6'
<
< # Names of this library.
< library_names='libstdc++.so.6.0.3 libstdc++.so.6 libstdc++.so'
<
< # The name of the static archive.
< old_library='libstdc++.a'
<
< # Libraries that this one depends upon.
< dependency_libs='-lc -lm -L/usr/sfw/lib -lgcc_s'
<
< # Version information for libstdc++.
< current=6
< age=0
< revision=3
<
< # Is this an already installed library?
< installed=yes
<
< # Files to dlopen/dlpreopen
< dlopen=''
< dlpreopen=''
<
< # Directory that this library needs to be installed in:
< libdir='/usr/sfw/lib'
bash-3.00# cat /etc/release
Solaris 10 6/06 s10s_u2wos_09a SPARC
Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 09 June 2006
Preinstall P/N 259-4616-01
Built 13 August 2006
bash-3.00# uname -a
SunOS soltest01 5.10 Generic_118833-22 sun4u sparc SUNW,Sun-Fire-V215
bash-3.00#
http://forum.java.sun.com/thread.jspa?threadID=5073150