2011/02/08
World bank data prediction
Given an indicator, for example "School enrollment, primary (% gross)" of the United States.
We have a series of discrete data from 1980 to 2009, which is counted for every years.
We want to predict the data for the year 2010 so we need to find a relation between it
and the previous data.
The problem is that I don't know which rule it is subjected to.
# Of course, the rules are different from indicators to indicators.
It is unlikely that we can predict the data for the year 2010 by simple (linear or polynomial)
interpolation or extrapolation.
I don't think that the data is subjected to some probabilistic rule like Markov chains.
My guess is that the data may be subjected to some Auto-Regression Moving-Average Models (ARMA) rule
or some time series rule like GARCH.
Being said that, I also have no idea which is the right direction to go or it is a no-go.
Please give me some hints,
Best regards,
Nguyen Vu Hung
cf. http://groups.google.com/group/world-bank-api/browse_thread/thread/c3a9a38b9f014ba8
2011/01/26
Dinh huong cua LibreOffice: Khong ho tro write cac format khong open
Định hướng:
Với các format không mở và không chuẩn (ví dụ StarOffice, MSOffice), thì
1. LibO chỉ hỗ trợ đọc vào
2. Và không hỗ trợ đọc ra
Làm những việc này chỉ nối giáo cho giặc mã đóng và chuẩn đóng,
nghĩa là không khuyến khích LibO và ODF.
Quyết định này mang tính chính trị nhiều hơn là kỹ thuật.
Mời các bác chém thoải mải.
- Hide quoted text -
---------- Forwarded message ----------
From: Pierre-André Jacquod
Date: 2011/1/24
Subject: [Libreoffice] Announcement: StarOffice file-format not
available any more for saving
To: LibreOffice List
Hello,
from now I have started to delete within binfilter the code allowing to
*save* using the StarOffice file format. The import (read) is
still possible and will remain. Bye bye saving sdw, sxw ....
This will of course not happens in one go...
With this push, I have done the following changes:
* StarWriter does not export anymore
* start of deletion of functions within binfilter/bf_sw, i.e StarWriter
format
For testing:
I have my set of files created with those formats, allowing me to test
the reading functionality while deleting code. But if other wants to
test it to ensure also that nothing has been broken, I would be happy.
In order to allow interested to test easily, I will push my changes to
master at periodic intervals (each 2-3 weeks, I think/hope if free time
allows), grouping them and making a short announce as reply to this mail.
Best regards
Pierre-André
PS: do not forget the --enable-binfilter flag, if you want to check it
2010/12/10
Cách marketing
chú ý là các phần mềm nền dùng chung key và có kết nối tới server của Avast, do đó,
Avast nắm được số lượng warez (bị dùng lậu). Thay vì kêu ca, họ tìm cách "popup"
những người dùng lậu này và khuyến khích họ mua key chính thức.
Câu chuyện xảy ra tương tự với phần mềm miễn phí và mã mở. Đây là cách marketing khá
mới. Đầu tiên, phần mềm được phân phát miễn phí để thu hút users. Sau đó, nhà phân
phối tìm cách rẽ nhánh sản phẩm của mình thành cách phiên bản: Basic, Standard, Enterprise
có các tập chức năng khác nhau. Người dùng, khi không thỏa mãn với bản "Basic",
sẽ chuyển dần sang các bản có phí nhiều chức năng hơn.
cf. http://www.pcpro.co.uk/news/securicty/363379/single-software-licence-shared-774-651-times
2010/10/22
Install/Uninstall OpenOffice/LibreOffice on Centos 5
Install:
rpm -ivh --nodeps openoffice*rpm
Uninstall:
[vuhung@dhcppc0 src]$ sudo rpm -e --nodeps `rpm -qa | grep openoffice`
***
* Updating MIME database in /usr/share/mime...
Wrote 503 strings at 20 - 29c8
Wrote aliases at 29c8 - 2bc4
Wrote parents at 2bc4 - 35d0
Wrote literal globs at 35d0 - 362c
Wrote suffix globs at 362c - 6b94
Wrote full globs at 6b94 - 6bb8
Wrote magic at 6bb8 - c55c
Wrote namespace list at c55c - c56c
***
/usr/bin/gtk-update-icon-cache
Cache file created successfully.
/usr/bin/gtk-update-icon-cache
Cache file created successfully.
[vuhung@dhcppc0 src]$ sudo rpm -e --nodeps `rpm -qa | grep ooobasis3`
[vuhung@dhcppc0 src]$wget http://download.documentfoundation.org/libreoffice/testing/3.3.0-beta2/rpm/x86/LibO_3.3.0_beta2_Linux_x86_install-rpm_en-US.tar.gz
[vuhung@dhcppc0 src]$tar xvzf LibO_3.3.0_beta2_Linux_x86_install-rpm_en-US.tar.gz
cd en-US/RPMS
[vuhung@dhcppc0 RPMS]$ sudo rpm -ivh --nodeps *rpm desktop-integration/libreoffice3.3-redhat-menus-3.3-1.noarch.rpm
準備中... ########################################### [100%]
1:libreoffice-ure ########################################### [ 2%]
2:libobasis3.3-core01 ########################################### [ 4%]
3:libobasis3.3-en-US ########################################### [ 6%]
4:libobasis3.3-core02 ########################################### [ 8%]
5:libobasis3.3-core03 ########################################### [ 10%]
6:libobasis3.3-core04 ########################################### [ 12%]
7:libobasis3.3-core05 ########################################### [ 13%]
8:libobasis3.3-core06 ########################################### [ 15%]
9:libobasis3.3-core07 ########################################### [ 17%]
10:libobasis3.3-impress ########################################### [ 19%]
11:libobasis3.3-en-US-base########################################### [ 21%]
12:libobasis3.3-en-US-calc########################################### [ 23%]
13:libobasis3.3-en-US-draw########################################### [ 25%]
14:libobasis3.3-en-US-help########################################### [ 27%]
15:libobasis3.3-en-US-impr########################################### [ 29%]
16:libobasis3.3-en-US-math########################################### [ 31%]
17:libobasis3.3-en-US-res ########################################### [ 33%]
18:libobasis3.3-en-US-writ########################################### [ 35%]
19:libobasis3.3-base ########################################### [ 37%]
20:libobasis3.3-calc ########################################### [ 38%]
21:libobasis3.3-draw ########################################### [ 40%]
22:libobasis3.3-images ########################################### [ 42%]
23:libreoffice3 ########################################### [ 44%]
24:libobasis3.3-math ########################################### [ 46%]
25:libobasis3.3-writer ########################################### [ 48%]
26:libobasis3.3-binfilter ########################################### [ 50%]
27:libobasis3.3-en-US-binf########################################### [ 52%]
28:libobasis3.3-extension-########################################### [ 54%]
29:libobasis3.3-extension-########################################### [ 56%]
30:libobasis3.3-extension-########################################### [ 58%]
31:libobasis3.3-extension-########################################### [ 60%]
32:libobasis3.3-extension-########################################### [ 62%]
33:libobasis3.3-extension-########################################### [ 63%]
34:libobasis3.3-extension-########################################### [ 65%]
35:libobasis3.3-gnome-inte########################################### [ 67%]
36:libobasis3.3-graphicfil########################################### [ 69%]
37:libobasis3.3-javafilter########################################### [ 71%]
38:libobasis3.3-kde-integr########################################### [ 73%]
39:libobasis3.3-ogltrans ########################################### [ 75%]
40:libobasis3.3-ooofonts ########################################### [ 77%]
41:libobasis3.3-ooolinguis########################################### [ 79%]
42:libobasis3.3-pyuno ########################################### [ 81%]
43:libobasis3.3-testtool ########################################### [ 83%]
44:libobasis3.3-xsltfilter########################################### [ 85%]
45:libreoffice3-base ########################################### [ 87%]
46:libreoffice3-calc ########################################### [ 88%]
47:libreoffice3-draw ########################################### [ 90%]
48:libreoffice3-en-US ########################################### [ 92%]
49:libreoffice3-impress ########################################### [ 94%]
50:libreoffice3-math ########################################### [ 96%]
51:libreoffice3-writer ########################################### [ 98%]
52:libreoffice3.3-redhat-m########################################### [100%]
***
* Updating MIME database in /usr/share/mime...
Wrote 518 strings at 20 - 2d38
Wrote aliases at 2d38 - 2f34
Wrote parents at 2f34 - 3940
Wrote literal globs at 3940 - 399c
Wrote suffix globs at 399c - 7014
Wrote full globs at 7014 - 7038
Wrote magic at 7038 - ce48
Wrote namespace list at ce48 - ce58
***
/usr/bin/gtk-update-icon-cache
Cache file created successfully.
/usr/bin/gtk-update-icon-cache
Cache file created successfully.
Cách mount samba/windows network share trên mac
Cách mount
mount -t smbfs //vuhung@192.168.0.111/Public /path/testmount
Note:
1. mount có thể chạy bằng user thường hay root.
2. Phải chỉ định username
3. Có thể mount tới thư mục bất kỳ.
Xem thêm: man mount
2009/05/07
wget OpenOffice vi
wget ftp://ftp5.gwdg.de/pub/openoffice/extended/3.1.0rc2/*vi* &> download.log &
[hungnv@3.1.0rc2.vi]$ ls -l
total 2021744
-rw-rw-r-- 1 hungnv hungnv 3210258 Apr 28 19:19 download.log
-rw-rw-r-- 1 hungnv hungnv 154224360 Apr 27 14:56 OOo_3.1.0rc2_20090427_LinuxIntel_install_vi_deb.tar.gz
-rw-rw-r-- 1 hungnv hungnv 155897943 Apr 27 14:56 OOo_3.1.0rc2_20090427_LinuxIntel_install_vi.tar.gz
-rw-rw-r-- 1 hungnv hungnv 175985860 Apr 27 15:03 OOo_3.1.0rc2_20090427_LinuxIntel_install_wJRE_vi.tar.gz
-rw-rw-r-- 1 hungnv hungnv 16275653 Apr 27 15:11 OOo_3.1.0rc2_20090427_LinuxIntel_langpack_vi_deb.tar.gz
-rw-rw-r-- 1 hungnv hungnv 16252687 Apr 27 15:11 OOo_3.1.0rc2_20090427_LinuxIntel_langpack_vi.tar.gz
-rw-rw-r-- 1 hungnv hungnv 160087992 Apr 27 15:24 OOo_3.1.0rc2_20090427_LinuxX86-64_install_vi_deb.tar.gz
-rw-rw-r-- 1 hungnv hungnv 161735145 Apr 27 15:24 OOo_3.1.0rc2_20090427_LinuxX8
-rw-rw-r-- 1 hungnv hungnv 16276887 Apr 27 15:31 OOo_3.1.0rc2_20090427_LinuxX8
-rw-rw-r-- 1 hungnv hungnv 16262274 Apr 27 15:31 OOo_3.1.0rc2_20090427_LinuxX8
-rw-rw-r-- 1 hungnv hungnv 169324811 Apr 27 15:38 OOo_3.1.0rc2_20090427_MacOSXI
-rw-rw-r-- 1 hungnv hungnv 156397142 Apr 27 15:45 OOo_3.1.0rc2_20090427_Solaris
-rw-rw-r-- 1 hungnv hungnv 196655411 Apr 27 15:52 OOo_3.1.0rc2_20090427_Solaris
-rw-rw-r-- 1 hungnv hungnv 14990499 Apr 27 15:56 OOo_3.1.0rc2_20090427_Solaris
-rw-rw-r-- 1 hungnv hungnv 150194630 Apr 27 16:02 OOo_3.1.0rc2_20090427_Solaris
-rw-rw-r-- 1 hungnv hungnv 184565967 Apr 27 16:09 OOo_3.1.0rc2_20090427_Solaris
-rw-rw-r-- 1 hungnv hungnv 14714985 Apr 27 16:13 OOo_3.1.0rc2_20090427_Solaris
-rw-rw-r-- 1 hungnv hungnv 135463496 Apr 27 16:18 OOo_3.1.0rc2_20090427_Win32In
-rw-rw-r-- 1 hungnv hungnv 149920576 Apr 27 16:24 OOo_3.1.0rc2_20090427_Win32In
-rw-rw-r-- 1 hungnv hungnv 19663000 Apr 27 16:29 OOo_3.1.0rc2_20090427_Win32In
[hungnv@3.1.0rc2.vi]$ md5sum *vi*
de244f12f1ec9b1f2bf3f188f64b5d7a OOo_3.1.0rc2_20090427_LinuxIntel_install_vi_de
b47451c727422cb62a57fbf47f7aee39 OOo_3.1.0rc2_20090427_LinuxIntel_install_vi.ta
b15a10cc3f424d3283983afec012967d OOo_3.1.0rc2_20090427_LinuxIntel_install_wJRE_
d4422ac271a02458eefec7091cac99e0 OOo_3.1.0rc2_20090427_LinuxIntel_langpack_vi_d
ea739f372fbaee97cccfc29577509df8 OOo_3.1.0rc2_20090427_LinuxIntel_langpack_vi.t
4c089a8875076c16886dc0de7781b132 OOo_3.1.0rc2_20090427_LinuxX86-64_install_vi_d
2562ec5f2d99ce2215e864d648c40005 OOo_3.1.0rc2_20090427_LinuxX86-64_install_vi.t
8446eb57090edc98e9c0302f49bdff31 OOo_3.1.0rc2_20090427_LinuxX86-64_langpack_vi_
7fe08971d1ba2666fa77ae66615a89ae OOo_3.1.0rc2_20090427_LinuxX86-64_langpack_vi.
c874569a1e251a9b763db8d99c4fe5fc OOo_3.1.0rc2_20090427_MacOSXIntel_install_vi.dmg
794bfccec3bec32835615ce0f03733ec OOo_3.1.0rc2_20090427_SolarisSparc_install_vi.tar.gz
d9df627c91deb6b8b547054c656ef448 OOo_3.1.0rc2_20090427_SolarisSparc_install_wJRE_vi.tar.gz
1bd6bcf7794a1d63fa1254cf5d428c15 OOo_3.1.0rc2_20090427_SolarisSparc_langpack_vi.tar.gz
9f833858498e1ea2f7a8b24e97c00076 OOo_3.1.0rc2_20090427_Solarisx86_install_vi.tar.gz
a273b93c3049bc238396b947b1ea1b64 OOo_3.1.0rc2_20090427_Solarisx86_install_wJRE_vi.tar.gz
871ea78d03a1d621fc6f60999347d8fa OOo_3.1.0rc2_20090427_Solarisx86_langpack_vi.tar.gz
f2afb7b650499006138f484e671a732a OOo_3.1.0rc2_20090427_Win32Intel_install_vi.exe
8357e2b01f21f6b13b7ba1312903b282 OOo_3.1.0rc2_20090427_Win32Intel_install_wJRE_vi.exe
24cfce63751f05a8c7f293caa13ed15f OOo_3.1.0rc2_20090427_Win32Intel_langpack_vi.exe
2008/10/30
Kernel compiling speed(up)
make randconfig
time make
real 9m2.849s
user 8m11.189s
sys 0m57.763s
Intel(R) Xeon(TM) CPU 3.80GHz x 2
2GB RAM
2008/10/23
Thanh pho Aizuwakamatsu( Nhat Ban ) chuyen 840 may tinh sang OpenOffice
Chào cả nhà,
Thành phố Aizuwakamatsu( Nhật Bản ) chuyển 840 máy tính sang OpenOffice (
OOo).
Aizuwakamatsu đã để ý tới OpenOffice từ năm 2003. Sau nhiều lần thử nghiệm,
tính đến hết tháng 8 năm 2008, đã có 840 máy tính được chuyển thành công
sang OOo.
Dự tính đến tháng 10, sẽ chuyển tiếp 240 sang OOo.
Tất cả những tài liệu, schedule, báo cáo đều được công khai[1],
đây là một tài liệu tham khảo rất tốt cho Việt Nam.
Dưới đây là một số điểm đáng chú ý từ case study này.
1. Quá trình kiểm nghiệm OOo kéo dài 5 năm. Đây là thời gian tương đối dài
ngay cả đối với
Nhật Bản là nước có cơ sở ICT cao. Với Việt Nam, có lẽ cần thí điểm và
kiểm chứng chặt trẽ hơn.
Cụ thể xem ở dưới.
2. Lý do Aizuwakamatsu chuyển sang OOo, như họ nói: là lý do tài chính.
Theo dự toán, nếu sử dụng OOo trong 5 năm, kinh phí tiết kiệm được là
$150,000.
So với một thành phố, số tiền này chỉ bằng lương trong một năm của 2
hoặc 3 người, không phải là quá nhiều.
Nhưng nếu nhân rộng mô hình này trong cả tỉnh, hay toàn quốc. Nó sẽ là
con số đáng kể.
Con số $150,000 mặc dù không đáng kể so với Nhật, nhưng nó là số tiền
rất có ý nghĩa với một nước nghèo như VN.
3. Kinh phí chuyển sang OOo bao gồm: 3a) Huấn luyện, 3b) hỗ trợ người dùng,
3c) cài đặt+version up,
3d) huấn luyện nâng cao( cho user cao cấp ), 3e) chuyển đổi format
MS->OOo
Theo cá nhân tôi, với VN, 3a cần nhiều thời gian. 3b ở VN sẽ ít vì người
dùng ít thói quen đi hỏi!,
3c thực tế không tốn thời gian, 3d hiếm trong khi 3e sẽ là vấn đề lớn
nếu số lượng file
cần chuyển đổi nhiều.
4. Phản ứng của người dùng[2]
Đây là phần quan trọng và rất đáng tham khảo( mặc dù bằng tiếng Nhật)
74% người dùng trả lời có đủ tự tin dùng OOo.
2% nói "không thể điều khiển OOo".
24% còn lại bỏ phiếu trắng.
5. Aizuwakamatsu vẫn bỏ ra 15% kinh phí để mua những phần mềm thương mại.
# Cụ thể là những phần mềm nào không được đề cập đến.
[1]
http://www.city.aizuwakamatsu.fukushima.jp/ja/shisei/torikumi/ooo/info_index.htm
[2 ]
http://www.city.aizuwakamatsu.fukushima.jp/ja/shisei/torikumi/ooo/info_response.htm
--
Best Regards,
Nguyen Hung Vu ( Nguyễn Vũ Hưng )
vuhung16plus{remove}@gmail.dot.com , YIM: vuhung16 , Skype: vuhung16dg
A brief profile: http://www.hn.is.uec.ac.jp/~vuhung/Nguyen.Vu.Hung.html
2008/10/22
13 Awesome Javascript Animated Flash Like Menus
So why use flash for Web Menus when javascript has enough power to achieve similar effects.
Every web designer tries to be creative when it comes to designing the main navigation of the website. Today we would like to present you 13 awesome Javascript CSS menus that will be very handy and easy to modify to suit your needs. Popular javascript libraries are used: jQuery, Scriptaculous and Mootools.
Lets take a look at recent examples of these …
1. Vertical Animated Menus
1. Nice animated menu using CSS and Mootools
This tutorial illustrates how to implement a nice animated menu using Mootoolsand some lines of CSS and HTML code ready to reuse in your project.
2. jQuery iPod-style Drilldown Menu
A jQuery iPod-style drilldown menu to help users traverse hierarchical data quickly and with control. It's especially helpful when organizing large data structures that don't translate well into traditional dropdown or fly-out menus.
3. MenuMatic
MenuMatic is a MooTools 1.2 class that takes a sematic ordered or unordered list of links and turns it into a dynamic drop down menu system.
4. BDC DrillDown Menu
The BDC DrillDown Menu is a compact, hierarchical drilldown menu implemented as a jQuery plugin. A drilldown menu takes up constant space like an accordian menu but offers the deep hierarchy of a flyout menu at the same time.
2. Horizontal Animated Menus
5. Mootools animated sidebar menu
This tutorial explains how to implement an animated menu using mootools. You can see how it works directly from mootools site.
6.Simple Animated Menu for Mootools 1.2
A really nice animated menu created using Mootools, with a flash hover effect of an arrow.
7.Sliding JavaScript Menu Highlight
This sliding hover effect script is an easy method to add some flavor to your navigation. Using the CSS you can easily customize the navigation to fit your "look and feel".
8. Fancy Sliding Menu for Mootools
The menu is developed in Mootools with a nice sliding effect on each tab.
9. UvumiTools Dropdown Menu
A simple and lightweight menu that can be easily updated by simply editing a <ul> HTML element. Created using Mootools.
10. Superfish
Superfish is an enhanced Suckerfish-style menu jQuery plugin that takes an existing pure CSS drop-down menu and adds Suckerfish-style hover effect. Features include: Timed delay on mouseout, Animation of sub-menu reveal, Supports the hoverIntent plugin, drop shadows for capable browsers and more…
11. AJAX Dropdown Tab Menu
e24TabMenu is a plugin written for Scriptaculous. It is a tab menu that expands collapse smoothly.
12. Using jQuery for Background Image Animations
Snook wrote a straignforward script to produce a nice menu background image animation. The animation needs to run when the user moves their mouse over and out of the navigation. The key thing to note is that any animation is stopped before attempting to animate again. This avoids animations queuing up from repeatedly moving the mouse in and out of the element.
13. A Sliding Menu
It is a very simple sliding menu using the effects provided by Interface. The defauly behavior of the menu is to hide after 1000ms (1 sec.) and to display when your mouse hovers over the "menu" label. The menu will also auto-hide after 1000ms when the mouse leaves the menu area. Most of these values, including the sliding effect, can be customized.
2008/10/15
create and export shape data to csv file
#!/usr/bin/perl
#
# an attempt to create a polygon shapefile
# ref http://lists.osgeo.org/pipermail/mapserver-users/2005-March/005414.html
#
use strict ;
use warnings;
use Geo::Shapelib ;
# points of the polygon
my @lat = (45.0, 45.0, 55.0, 55.0, 45.0) ;
my @lon = (-75.0, -85.0, -85.0, -75.0, -75.0) ;
my @verts = (
[$lat[0], $lon[0]],
[$lat[1], $lon[1]],
[$lat[2], $lon[2]],
[$lat[3], $lon[3]],
[$lat[4], $lon[4]]
) ;
my $shape = new Geo::Shapelib;
$shape->{Shapetype} = 5;
$shape->{MinBounds} = [20,-100] ;
$shape->{MaxBounds} = [80,-10] ;
$shape->{FieldNames} = ['ID', 'SPD','DIR'];
$shape->{FieldTypes} = ['Integer','Integer','Integer'];
push @{$shape->{Shapes}}, {
SHPType=>5,
ShapeId=>1,
Nparts=>0,
NShapes=>0,
NVertices=>5,
Vertices=>\@verts
};
push @{$shape->{ShapeRecords}}, [1,13,250];
$shape->dump();
$shape->save('./test.shp');
#!/usr/bin/perl
use strict;
use Geo::Shapelib qw/:all/;
my $shapefile = new Geo::Shapelib {
Name => 'stations',
Shapetype => POINT,
FieldNames => ['Name','Code','Founded'];
FieldTypes => ['String:50','String:10','Integer:8'];
};
while () {
chomp;
my($station,$code,$founded,$x,$y) = split /\|/;
push @{$shapefile->{Shapes}},{ Vertices => [[$x,$y,0,0]] };
push @{$shapefile->{ShapeRecords}}, [$station,$code,$founded];
}
$shapefile->save();
***Standalone skia***
***Standalone skia***
Skia( as known as Graphics Engine) is the graphics engined used in Chrome[1] , a technology that Google has aquired[2].
It comes as a part of Chrominum but I want to taste it as a stand-alone.
So I tried.
You need scons[8] to build skia. scons 1.1.0 is known to work.
You also need to install cairo[9]. cairo version 1.8.0 is known to work.
Just download skia standalone for linux[10], then
tar xvzf skia-standalone-2008-10-15.tar.gz
cd skia
scons -c # clean the build ( equivelent to make clean )
scons # to build ( equivelent to make )
cd examples # vi SConstruct to ensure that you have correct cairo build settings
scons # build the example.
./helloworld #run the example.
vi helloworld.cpp #for more information [12]
If now have examples/snapshot.png[11] which is an .png ping.
[1] http://gigaom.com/2008/09/02/google-open-sources-skia-graphics-engine/
[2] http://gigaom.com/2007/09/03/google-phone-facts/
[3] Skia original code http://src.chromium.org/viewvc/chrome/trunk/src/skia/
[4] Chrome is out http://www.satine.org/archives/2008/09/02/skia-source-code-released/
[5] Chrome website http://www.google.com/chrome
[6] http://www.satine.org/archives/2007/03/05/the-skia-source-code-dilemma/
[7] http://www.atoker.com/blog/2008/09/06/skia-graphics-library-in-chrome-first-impressions
[8] http://www.scons.org
[9] http://cairographics.org
[10] http://aoclife.ddo.jp/~vuhung/foss/skia/skia-standalone-2008-10-15.tar.gz
[11] http://aoclife.ddo.jp/~vuhung/foss/skia/snapshot.png
[12] http://aoclife.ddo.jp/~vuhung/foss/skia/helloworld.cpp
2008/09/09
Cach tiep thu y kien cua nguoi Viet va FOSS
Cách tiếp thu ý kiến của người Việt và FOSS
phần mềm mã mở đầu tiên có từ những ngày đầu trong lịch sử máy tính . Mục đích của việc mở mã nguồn là để mọi người tham gia dự án có thể peer-review code cũng như những thành quả lao động của những thành viên khác trong dự án. Việc peer-review này ảnh hưởng lớn đến chất lượng cũng như độ lớn của dự án .
Trong những nghành nghiên cứu, peer-review có lịch sử lâu đời và nó có quy trình hoàn hảo hơn . A đệ trình luận văn của mình lên hội đồng và hội đồng sẽ "chấm" luận văn của anh ta. Việc "chấm" luận văn này được tiến hành bởi một số ít người có quyền review.
Với FOSS, điểm khác nhau là sự "mở" của mã nguồn, và hơn nữa là sự "mở" đối với ý kiến được đóng góp. Khác với ví dụ về luận văn ở trên, trong một dự án mở, bất kỳ thành viên nào cũng có thể review code của người khác. Anh ta có quyền góp ý, chỉ trích . Và nếu anh ta không tán thành với dự án hiện tại, anh ta hoàn toàn có thể dùng code hiện tại cả dự án và phát triển nó theo hướng riêng của mình .
Thông thường, nơi để trao đổi cho những dự án mã mở là mailing list hay forum. Bất kỳ thành viên nào cũng có quyền đóng góp. Ở Mỹ hay Âu Châu, do đặc thù văn hóa, thành viên không ngại khi chỉ trích người khác và không sợ khi bị chỉ trích. Họ tiến hành hai phần của công việc review: Chỉ trích người khác và bảo vệ ý kiến của mình khi bị chỉ trích . Họ không sợ bị chê cười khi ai đó chỉ ra rằng code của mình sai, hoặc người khác có giải pháp tốt hơn . Với Việt Nam, tình hình thay đổi. Mailing list hay forum thậm chí có hàng trăm, hay ngàn người tham gia trong khi số thành viên active ( tích cực tham gia trao đổi ), chỉ là con số đếm trên đầu ngón tay .
Ở một mailing list cũ mà tôi biết và lấy làm ví dụ: Vietlug . Số thành viên tham gia trong thời điểm nhiều nhất khoảng 250 . Số người gửi email lên mailing list chỉ khoảng 20. Những thành viên còn lại, im lặng và đọc . Họ thích tiếp thu kiến thức một chiều . Họ sợ rằng nếu mình "lỡ lời", bản thân sẽ bị chê cười về sự ngu ngốc của họ . Một giả định khác: Một số thành viên "cao thủ" coi những vấn đề thảo luận là hiển nhiên, không nhất thiết phải thảo luận. Họ không đóng góp những ý kiến quý giá của mình cho cộng đồng.
[1] http://blog.360.yahoo.com/blog-tNaZu7Qnbq4Tbr6XhJCFBA--?cq=1&p=1374
Why Microsoft Is Going Open Source
> http://www.linuxjournal.com/node/1000260
>
Bài này có 2 ý chính giải thích vì sao MS goes OSS
1. Try out new development methodologies ( FOSS )
2. OOXML ... 6000+ pages of documentation mean....a re-definition of a
closed standard as open.
IE chiếm 80% web browser share . Phần lớn share còn lại thuộc FireFox.
Em không hiểu MS involves vào Mozilla project để làm gì ? Để họ phương
pháp phát triển phần mềm mã mở?
Hay để đưa dần những key developers của dự án thành thành người của MS
và lái roadmap của dự náy này theo ý muốn của MS?
Đây chỉ là phỏng đoán của em thôi, chứ thực ra MS chỉ bỏ công sức để hỗ
trợ Mozilla chạy trên Vista[1]
Dù thế này đi chăng nữa thì đây cũng không là biểu hiện xấu.
Tác giả bài báo trên sai khi nói OOXML là "a re-definition of a closed
standard as open".
Nói chính xác hơn là: MS mở OOXML format. Mục đích chính trị của MS là
nâng cao CSR của bản thân họ.
Thêm nữa, nếu các bác đọc FAQ[2] của MS Open Source website [3], các bác
sẽ thấy mục đích của trang này không phải
là open source code của bất kì chương trình nào thuộc MS, mà chỉ để hỗ
trợ những dự án mở dùng công nghệ của MS.
Điều này tốt nhưng tốt hơn vẫn là mở hết mã nguồn của MS :D.
Điều phi lý này thực tế là không thể thực hiện được . MS và những đổi
thủ khác của MS như IBM hay Apple cũng dùng chung
chiến lược "Vendor lock-in"[4] đối với sản phẩm của mình.
[1]
http://download.microsoft.com/download/D/4/4/D44F6287-41F5-48EB-A93A-23D251B2704E/OpeninActionMozilla.pdf
[2] http://www.microsoft.com/opensource/faq.mspx#
[3] http://www.microsoft.com/opensource/
[4] http://en.wikipedia.org/wiki/Vendor_lock-in
[5] http://blog.360.yahoo.com/blog-tNaZu7Qnbq4Tbr6XhJCFBA--?cq=1&l=21&u=25&mx=534&lmt=5
Open Source is a ( social ) *MOVEMENT*
> sẵn sàng chạy qua chỗ bạn để in ngay poster rồi. Thanh toán sòng phẳng. Ấy
> là chưa nói đến chuyện bạn có lòng hảo tâm "miễn phí" cho anh em HanoiLUG.
> Cái này phải quý nhau lắm mới rộng rãi như vậy. Rất cảm ơn bạn vì điều này.
Hơi ngoài lề một chút mong các bác thông cảm...
Open Source, bắt đầu từ dự án nhân Linux cho đến Mozilla Project hay
OpenOffice bắt những nhà nghiên cứu xã hội phải nhìn lại FOSS như một
hiện tượng xã hội [1], chứ không phải đơn thuần là những dự án nhỏ trong
ngành IT.
Các bác có thời gian xin đọc links trên. "Free Software Movement" có
những đặc trưng của một cuộc vận động xã hội. "Free", theo định nghĩa
trong "Freedom" là từ tương đối nóng và đa số chúng ta tránh không nói đến.
# Nó gần như một đề tài cấm.
Mục đích của Hnlug, cũng như các Lugs khác, có nhiệm vụ chung là[1]:
1. Viết ( sản xuất ) FOSS.
2. Và truyền bá ( bao gồm PR ) FOSS.
Có lẽ nhiệm vụ của 1 LUG chỉ chú trọng vào 2. Theo tôi nghĩ, HNLug,
giống như những lugs khác, mặc dù là "hội người dùng Linux" nhưng có
nhiều thành viên có nhiều kinh nghiệm và người phát triển . Những người
này ngoài việc trao đổi thông tin, còn có nhiệm vụ quảng bá và hướng dẫn
những người mới sử dụng FOSS.
Trong 2., việc truyền bá thực sự rất có ý nghĩa. hanoilug.org chỉ phát
huy được 1 phần. Tôi nghĩ VTV2 và những người như bác Kiên rất có ý
nghĩa trong việc truyền bá. Có ai không biết VTV2 đâu ?
Các bác phang mạnh nhé
[1] http://en.wikipedia.org/wiki/Free_software_movement
[2] http://blog.360.yahoo.com/blog-tNaZu7Qnbq4Tbr6XhJCFBA--?cq=1&l=16&u=20&mx=534&lmt=5
2008/08/25
Thành phố Aizuwakamatsu( Nhật Bản ) chuyển 840 máy tính sang OpenOffice ( OOo).
tính đến hết tháng 8 năm 2008, đã có 840 máy tính được chuyển thành công sang OOo.
Dự tính đến tháng 10, sẽ chuyển tiếp 240 sang OOo.
Tất cả những tài liệu, schedule, báo cáo đều được công khai[1],
đây là một tài liệu tham khảo rất tốt cho Việt Nam.
Dưới đây là một số điểm đáng chú ý từ case study này.
1. Quá trình kiểm nghiệm OOo kéo dài 5 năm. Đây là thời gian tương đối dài ngay cả đối với
Nhật Bản là nước có cơ sở ICT cao. Với Việt Nam, có lẽ cần thí điểm và kiểm chứng chặt trẽ hơn.
Cụ thể xem ở dưới.
2. Lý do Aizuwakamatsu chuyển sang OOo, như họ nói: là lý do tài chính.
Theo dự toán, nếu sử dụng OOo trong 5 năm, kinh phí tiết kiệm được là $150,000.
So với một thành phố, số tiền này chỉ bằng lương trong một năm của 2 hoặc 3 người, không phải là quá nhiều.
Nhưng nếu nhân rộng mô hình này trong cả tỉnh, hay toàn quốc. Nó sẽ là con số đáng kể.
Con số $150,000 mặc dù không đáng kể so với Nhật, nhưng nó là số tiền rất có ý nghĩa với một nước nghèo như VN.
3. Kinh phí chuyển sang OOo bao gồm: 3a) Huấn luyện, 3b) hỗ trợ người dùng, 3c) cài đặt+version up,
3d) huấn luyện nâng cao( cho user cao cấp ), 3e) chuyển đổi format MS->OOo
Theo cá nhân tôi, với VN, 3a cần nhiều thời gian. 3b ở VN sẽ ít vì người dùng ít thói quen đi hỏi!,
3c thực tế không tốn thời gian, 3d hiếm trong khi 3e sẽ là vấn đề lớn nếu số lượng file
cần chuyển đổi nhiều.
4. Phản ứng của người dùng[2]
Đây là phần quan trọng và rất đáng tham khảo( mặc dù bằng tiếng Nhật)
74% người dùng trả lời có đủ tự tin dùng OOo.
2% nói "không thể điều khiển OOo".
24% còn lại bỏ phiếu trắng.
5. Aizuwakamatsu vẫn bỏ ra 15% kinh phí để mua những phần mềm thương mại.
# Cụ thể là những phần mềm nào không được đề cập đến.
[1] http://www.city.aizuwakamatsu.fukushima.jp/ja/shisei/torikumi/ooo/info_index.htm
[2 ]http://www.city.aizuwakamatsu.fukushima.jp/ja/shisei/torikumi/ooo/info_response.htm
2008/08/14
PNG8 opacity color doesn't display in Firefox 2, 3
When a PNG8 file has a color that is identical to its opacity color,
some software ( like Firefox 2 or 3 ) will not display this color.
The probability of this bug is 1/255*255*255*255
because each channel( R, G, B and alpha ) has 8 bits long.
In ImageMagick or GraphicsMagick,
the opacity color can be deleted with matte(false) function,like
/* g++ `pkg-config --libs --cflags ImageMagick++`cut_sasebo.cpp */
/* export LD_LIBRARY_PATH=/usr/local/lib */
#include
#include
using namespace std;
using namespace Magick;
int main()
{
Magick::Image image("sasebo_big.png") ;
image.crop( Magick::Geometry(256, 256,
1536, 2303));
image.matte(false);
image.quantizeColors(256);
image.quantizeDither(false);
image.quantize();
image.write("sasebo_256x256.png"); return 0;
}
Not that both ImageMagick and GraphicsMagick has left its PNG8 format unfnished.
The PNG8 format is not made by PNG group, but Adobe.
Technically, PNG8 is GIF format plus a opacity color.
if (LocaleCompare(image_info->magick,"PNG8") == 0)
{
(void) SetImageType(image,PaletteType);
if (image->matte)
{
/* To do: Reduce to binary transparency */
}
}
Ref:
http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=11406&p=38212 http://www.imagemagick.org/Usage/formats/#png http://www.graphicsmagick.org/www/Magick++/Image.html#Image%20Manipulation%20Methods
2008/07/28
cairo 1.6.4 jpeg I/O support patch
Hello all,
This is an unofficial patch to cairo 1.6.4 that addes jpeg I/O support to cairo.
The original patch( to an older version of cairo) is not mine.
Please take a look at src/cairo-jpeg.c for credit(s).
Installation:
1. ./configure --enable-jpeg; make; make install as usual, or better
2. autoreconf to adapt the changes in configure.in to your enviroment.
For more information, please use diff against the standard release cairo-1.6.4
ABIs added ( similar to PNG ) :
cairo_get_default_jpeg_parameter
cairo_surface_write_to_jpeg
cairo_image_surface_create_from_jpeg
cairo_image_surface_create_from_jpeg_stream
To download, click the link below:
http://www.hn.is.uec.ac.jp/~vuhung/patches/cairo-1.6.4.jpeg-patch.tar.gz
2008/07/23
A better average
double variance(long long *x, int n)
{
double m = x[0];
double s = 0;
int i;
for (i=0; idouble m_new = m + (x[i] - m)/(i+1);
s = s + (x[i] - m)*(x[i] - m_new);
m = m_new;
}
return s / (n - 1);
}
double mean(long long *x, int n)
{
double m = x[0];
int i;
for (i=0; im = m + (x[i] - m)/(i+1);
}
return m;
}
double stddev(long long *x, int n)
{
return sqrt(variance(x, n));
}
long long times[30];
printf("mean: %f stddev: %f\n", mean(times, 20), stddev(times, 20));
2008/06/04
OpenCV: Rebuild the library with Windows, GTK+ 2.x
Remove all the *Windows functions,
#include
#include
#define MAX_CLUSTERS (32) /* NX^ */
#include
#include
static struct rusage rusage_before;
static struct rusage rusage_after;
void
startTimer(void)
{
getrusage(RUSAGE_SELF, &rusage_before);
}
float
stopTimer(void)
{
long tsec, tusec;
getrusage(RUSAGE_SELF, &rusage_after);
tsec = rusage_after.ru_utime.tv_sec - rusage_before.ru_utime.tv_sec;
tusec = rusage_after.ru_utime.tv_usec - rusage_before.ru_utime.tv_usec;
return (tsec + ((float)tusec) / 1000000.0);
}
int
main (int argc, char **argv)
{
int i, size;
IplImage *src_img = 0, *dst_img = 0;
CvMat *clusters;
CvMat *points;
CvMat *color = cvCreateMat (MAX_CLUSTERS, 1, CV_32FC3);
CvMat *count = cvCreateMat (MAX_CLUSTERS, 1, CV_32SC1);
// (1)
if (argc != 2 || (src_img = cvLoadImage (argv[1], CV_LOAD_IMAGE_COLOR)) == 0)
return -1;
size = src_img->width * src_img->height;
dst_img = cvCloneImage (src_img);
clusters = cvCreateMat (size, 1, CV_32SC1);
points = cvCreateMat (size, 1, CV_32FC3);
// (2)sNZls
for (i = 0; i < size; i++) {
points->data.fl[i * 3 + 0] = (uchar) src_img->imageData[i * 3 + 0];
points->data.fl[i * 3 + 1] = (uchar) src_img->imageData[i * 3 + 1];
points->data.fl[i * 3 + 2] = (uchar) src_img->imageData[i * 3 + 2];
}
// (3)NX^O
startTimer();
cvKMeans2 (points, MAX_CLUSTERS, clusters, cvTermCriteria (CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 10, 1.0));
printf( "finished making cmapped pix: %7.3f secs\n", stopTimer());
// (4)eNX^lvZ
cvSetZero (color);
cvSetZero (count);
for (i = 0; i < size; i++) {
int idx = clusters->data.i[i];
int j = ++count->data.i[idx];;
color->data.fl[idx * 3 + 0] = color->data.fl[idx * 3 + 0] * (j - 1) / j + points->data.fl[i * 3 + 0] / j;
color->data.fl[idx * 3 + 1] = color->data.fl[idx * 3 + 1] * (j - 1) / j + points->data.fl[i * 3 + 1] / j;
color->data.fl[idx * 3 + 2] = color->data.fl[idx * 3 + 2] * (j - 1) / j + points->data.fl[i * 3 + 2] / j;
}
// (5)NX^F`
for (i = 0; i < size; i++) {
int idx = clusters->data.i[i];
dst_img->imageData[i * 3 + 0] = (char) color->data.fl[idx * 3 + 0];
dst_img->imageData[i * 3 + 1] = (char) color->data.fl[idx * 3 + 1];
dst_img->imageData[i * 3 + 2] = (char) color->data.fl[idx * 3 + 2];
}
#if 0
// (6)\CL[I
cvNamedWindow ("src", CV_WINDOW_AUTOSIZE);
cvShowImage ("src", src_img);
cvNamedWindow ("low-color", CV_WINDOW_AUTOSIZE);
cvShowImage ("low-color", dst_img);
cvWaitKey (0);
cvDestroyWindow ("src");
cvDestroyWindow ("low-color");
#endif
cvReleaseImage (&src_img);
cvReleaseImage (&dst_img);
cvReleaseMat (&clusters);
cvReleaseMat (&points);
cvReleaseMat (&color);
cvReleaseMat (&count);
return 0;
}
[vuhung@teriyaki c]$./kmeans
OpenCV ERROR: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support)
in function cvNamedWindow, window.cpp(71)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)