Compiling C# Souce Code as a Dynamic Link Library

The following is the command to compile dllsource.cs as a dynamic link library instead of the executable file: $ mcs /target:library dllsource.cs We can also specify a different name of the binary with the /out option. For example: $ mcs /target:library /out:mylibrary.dll dllsource.cs Finally, if we want to compile a souce which depends on a dll file, we need to use the /reference option. $ mcs example.cs /reference:mylibrary.dll Note: mcs is the mono compiler. If you use Microsoft C# compiler, just replace mcs with csc.

February 16, 2007 · 1 min · 85 words · kenno

Sum of elements in list in Prolog

Recently I noticed that my prolog skill is becoming rusty for not putting it work for very long. For this reason, I’m going to randomly write some prolog snippets here and there. Let’s started with one predicate called “sum_list” which calculate the value of all elements in a list. % The sum of all elements in list in prolog % empty list list_sum([], 0). list_sum([Head | Tail], TotalSum) :- list_sum(Tail, Sum1), TotalSum is Head + Sum1. To run/test the above code, save it to a file called: list_sum.pl, fire-up your prolog interpreter and load it. In my case, I use swi-prolog. Here is the sample output: ...

February 4, 2007 · 1 min · 133 words · kenno

ចងក្រង RPM ពី Source RPMs

ជាធម្មតា ពេលខ្ញុំបញ្ចូល កញ្ចប់ថ្មីៗក្នុងអូផិនស៊ូស៊ី បើសិនជាមិនអាចរក binary rpm បានទេ ខ្ញុំតែងតែចងក្រង (compile) កញ្ចប់ទាំងនោះពីកូដប្រភពដើម។ កូដប្រភពដើម អាចត្រូវបានខ្ចប់ជា tar.gz ឬ .src.rpm។ ក្នុងករណីទីមួយ យើងគ្រាន់តែពន្លា កូដប្រភពដើម រួចបញ្ជា ./configure, make និង make install ជាធម្មតា។ ពេលនេះ ខ្ញុំសូមលើកយក វិធីចងក្រងកម្មវិធី ជាមួយនឹង កូដប្រភពដើម ខ្ចប់ជា .src.rpm។ $ rpmbuild -clean -rebuild packagename.src.rpm ក្រោយពីបាន វាយពាក្យបញ្ជាខាងលើហើយ កញ្ចប់ binary RPM នឹងត្រូវបានបង្កើតក្នុង subdirectory នៃ ថត /usr/src/packages/RPMS/។ សូមពិនិត្យមើល ក្នុងថតដែលមានឈ្មោះ ចាប់ផ្តើមដោយអក្សរ i\*** ឧទាហរណ៍ i386 ជាករណីរបស់ម៉ាស៊ីនខ្ញុំ។

December 19, 2006 · 1 min · 54 words · kenno

Enable Khmer Unicode support on Firefox

With fresh installation of SuSE Linux 10.1 or openSUSE 10.2, Firefox does not display Khmer Unicode font properly. However, there is a very easy fix, all you have to do is to add the “MOZ_ENABLE_PANGO=1” to your .profile. Go to your home directory, then edit the .profile file. I use vi (vi .profile) Scroll down to the last line of the file and add: export MOZ_ENABLE_PANGO=1 Save the .profile file, in my case I do (ESC, SHIFT+Z+Z). Restart the Firefox. Voilla! It’s done and the Firefox should display Khmer Unicode font nicely and correctly now.

December 13, 2006 · 1 min · 95 words · kenno

ស្ថាបនា និង ដំឡើង បានស៊ី លើ​ ស៊ូសាលីណាក់ ១០.១

ដោយ Magnus Hoglund ប្រសិនបើលោកអ្នកបានដំឡើង កំណែចាស់របស់បានស៊ី សូមចាប់ផ្តើមដោយលុបវាជាមុនសិន។ ដំឡើងកញ្ចប់ទាំងនេះ (ដោយប្រើ Yast)៖ mono-develop monodoc-core sqlite-devel libmusicbrainz-devel gstreamer010-devel libgnomeui-devel gnome-desktop-devel nautilus-cd-burner-devel យកកំណែថ្មីបង្អស់របស់ បានស៊ី ពី http://banshee-project.org។ ក្នុងសាច់រឿងនេះ កំណែចុងក្រោយគឺ ០.១១.២។ ទាញយកឯកសារ៖ banshee-0.11.2.tar.gz banshee-offical-plugins-0.11.2.tar.gz ស្រាយ បានស៊ី (banshee-0.11.2.tar.gz) ទៅថតបណ្តោះអាសន្នមួយ។ $ tar xzvf banshee-0.11.2.tar.gz បើកស្ថានីយ៍មួយ ក្នុងថតនេះ ហើយរត់៖ $ ./configure $ make ប្តូរទៅជាឫស (su) រួចរត់៖ $ make install ចេញទៅជាអ្នកប្រើធម្មតា និង ចាប់ផ្តើម បានស៊ី $ /usr/local/bin/banshee & ការដំឡើង plugins របស់ បានស៊ី អាចធ្វើបានដោយវិធីដូចគ្នា។ ក្នុងករណីរបស់ខ្ញុំ ខ្ញុំបានស្រាយ banshee-offical-plugins-0.11.2.tar.gz និងរត់ ពាក្យបញ្ជាដូចខាងលើ (មានន័យថា៖ ./configure; make; make install)នេះជាការស្រេច សូមរីករាយសប្បាយជាមួយបានស៊ី! ...

December 6, 2006 · 1 min · 84 words · kenno