Thursday, November 5, 2009

2007 Microsoft Office Add-in: Microsoft Save as PDF or XPS

I start using MS Office 2007 and also has Adobe Acrobat 8.0 install, I can print as PDF in MS Word 2003 but not with MS Office 2007. See below screen shots of error:

But in fact with MS Office 2007, Microsoft has provided an add-in for converting from DOC to PDF very easily, just download from: http://www.microsoft.com/downloads/details.aspx?FamilyId=4D951911-3E7E-4AE6-B059-A2E79ED87041&displaylang=en

After I install: SaveAsPDFandXPS.exe
I can convert by go to: Save As -> PDF or XPS
PDF loaded as expected!
Great!

Sunday, October 4, 2009

At BarCamp 2009, topic: The State of The Art of Web Development

Hi,
Here is my presentation at barcamp phnom penh 2009, on Sunday 4th of October at Pannasastra University (Norodom), in hall room, Room Phnom Tamao at 11:30am to 12:30pm.

It was about the state of the art of web development, wanna to express how web technologies going on since it was started and today; also a bit view on how the future is.

The presentation, it's just starting or a beginning of the topic. Among those points, parts related to technologies of Java/J2EE, Django/Ruby on Rails, PHP style coding need to improve in the presentation, hope to do it more in next part.

Enjoy here:

Thursday, October 1, 2009

Run maven commands in Eclipse as External Tool

You might already know what is maven; it's a tool to build / compile or package java project...
Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.
Here, I want to show how to configure maven to use as external tool in eclipse IDE so easy for you to execute maven commands from the Eclipse interface easy without needing to open a DOS prompt to use. Here is the procedure:

1. Suppose maven 2 already install some where on your PC, (mine is in D:\Work\install\Tools\maven-2.0.4)
2. From the menu bar, select Window > Preferences. Select the Run/Debug > String Substitution. Add a new variable e.g. maven_exec.
3. Set up a new external launcher from the menu bar, select Run > External Tools. Select Program
4. Create each maven task, example: in here, I create only the build classpath
  • On program, create a new program and name as: build_classpath (any name as you wish)
  • In location box: choose our created variable: maven_exec
  • In Working Directory: choose variable: project_loc
  • In Argument, give maven command, in here is: eclipse:clean eclipse:eclipse
  • Click on Apply and Run if you wish now
5. So you can execute the external tool program by execute Run button, result should be in console tab:

Enjoy,

Friday, September 25, 2009

Jibx XML loading & Digester, which one is more flexible?

Jibx is one of the popular XML parsing in Java and also Digester.

Jibx bases on binding.xml file to map XML nodes to Java Objects
Digester also base on digester-rule xml file to map to Java Objects

What I found here, in Jibx we need to map all fields of the XML to the binding but in digester, we can filter for which fields we want...

To prove, will see in next post for more analyze..

Friday, August 28, 2009

In brief about Eclipse IDE

Eclipse is a multi-language software development environment comprising an IDE and a plug-in system to extend it. It is written primarily in Java and can be used to develop applications in Java and, by means of the various plug-ins, in other languages as well, including C, C++, COBOL, Python, Perl, PHP, and others.[1]

Website: http://www.eclipse.org/

Download: http://www.eclipse.org/downloads/

Current version: Galileo, 3.5: http://wiki.eclipse.org/Galileo

Eclipse IDE is suitable with:

- J2EE Development (To use Eclipse IDE for Java EE Developers)

- Java Development (To use Eclipse IDE for Java Developer)

- PHP Development (To use Eclipse IDE for PHP Development)

- C/C++ Development (To use Eclipse IDE for C/C++ Development)

- Etc.

Installation/To start:

- Jdk requires to install before install Eclipse, in new version of Eclipse 3.5 requires at least jdk 1.5

- Just extract the eclipse and copy to some where in your PC

- Point to your workspace, create project and develop your application as well.

Screenshot: (Other screens see: http://www.eclipse.org/screenshots/)

Easy ways/Shortcuts:

- Wanna to go every where can start with shortcut: Ctrl + 3

- To see all shortcut: Ctrl + Shift + L

- Rename on variable/method to change all reference: Alt + Shift + R

- Search any file: Ctrl + Shift + R

- Go to line number: Ctrl + L

- Create View Object (set / get methods): Alt + Shift + S and choose: Generate Getters and Setters

- Etc.



[1] See wiki: http://en.wikipedia.org/wiki/Eclipse_(software)

Tuesday, August 18, 2009

[WordPress] Move integrated local wordpress to production server

First I have read some post and I though it was right but when I followed I got same error such as executing timeout (Fatal error: Maximum execution time of 30 seconds exceeded) when browse the website etc.

I have prepared the wordpress blog with some modification of the theme; integrated and tested my wanted plugin; prepare all pages, navigation etc. I have named my local site as: www.defondyann.loc but when I move to the server for website: www.defondyann.com I got above error and can't browse the page or went to the admin as well.

I tried as following post:
  • http://www.mydigitallife.info/2007/10/01/how-to-move-wordpress-blog-to-new-domain-or-location/
  • http://yoast.com/move-wordpress-blog-domain-10-steps/
  • http://codex.wordpress.org/Moving_WordPress
but not all worked for me so I took some points to do this way:

I. At my local server, I prepared the virtual host by naming as: www.defondyann.comI'm sure you guy know how to do virtual host in windows; any way, here it is:
  • apache2.2.6\conf\extra\httpd-vhosts.conf

ServerAdmin webmaster@defondyann.com
DocumentRoot "Z:/defondyann/wordpress"
ServerName defondyann.com
ServerAlias www.defondyann.com
ErrorLog "logs/defondyann.com-error_log"
CustomLog "logs/defondyann.com-common.log common" combined
  • Change at C:\WINDOWS\system32\drivers\etc\hosts
127.0.0.1 www.defondyann.com
II. I browsed the website locally with: www.defondyann.com login to admin as normal
III. Modified upload directory configuration in /wp-admin/options-misc.php
  • To change upload directory to: wp-content/uploads
IV. Modified database, by execute update script via phpMyAdmin or any mysql client:

UPDATE wp_options SET option_value = replace(option_value, 'http://www.defondyann.loc', 'http://www.defondyann.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.defondyann.loc','http://www.defondyann.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.defondyann.loc', 'http://www.defondyann.com');

It's working for me,
Good luck,

Sunday, July 26, 2009

[A Solution Game] A man bought a house

Can anyone write the procedure how to solve this below problem?
It seems we will have two answers according to the way of resolvers thinking can be thinking with Maths or with Business, please write down and share in the comment:

Problem:
======
"A person bought a house for $60,000. Soon thereafter they sold it for $70,000, upon moving out of town.
A few month later, they were transftered back to town and purchased the same house for $80,000, then the person grew tired of the house and resold it for $90,000."

Question: How much money did the person gain/lose (or break even) on the exchange? How you calculate this?

Monday, July 13, 2009

SQL Server with Unicode / Khmer Unicode characters

To be notice MS SQL supports only UCS-2 encoding so do not have encoding with UTF-8 as we expected as MySQL or some other database server as well. This means that you can't use UTF-8 character encoding with Microsoft SQL Server:

Here after I type Khmer Unicode and execute the query, I got question marks instead of characters:

So if you need to store national characters in Microsoft SQL Server - please consider using a national character encoding (U+1780 to U+17FF in Unicode/ISO10646 for Khmer Unicode characters, for example). Change data types:
  • varchar to nvarchar
  • text to ntext
  • char to nchar
Here is the example since I created a table and insert data:
1. Create database (mtr_db) as normally (default setting)

2. Create table (tblunicode) with two fields (id/name) but
name - data type nvarchar(MAX)


3. Insert Khmer Unicode and execute we got it as we typed!
Good luck!

Sunday, June 21, 2009

Chuon Nat - Khmer Dictionary 2.0 with Unicode font


Let's try to distribute Khmer Dictionary to help all Khmer or people get to know Khmer language enjoy using our right dictionary than some dictionary that wrote wrong Khmer word...

Here, it is Chuon Nat Khmer Dictionary (Khmer to Khmer) 2.0 to download.
The dictionary using Khmer Unicode so please download Khmer Unicode 2.0.
The dictionary contains also the short explanation about Khmer Language Grammar.

Thanks to Buddhist Institute of Cambodia.

You can find other related page for Khmer Dictionary:
1. http://code.google.com/p/khmer-dictionary-tools/
2. http://www.budinst.gov.kh/?q=node/314

Thursday, June 11, 2009

Optimizing the firefox 3.0.x for saving memories

Hum, I got so headache when using a slow computer so I have to find the issue... I know I have many programs installed on my system so these can be the problem but I use mostly the firefox for internet surfing...

I start finding that anytime I open many firefox or tabs at the same it crashes me for a while to use other applications. Check in the process, yes firefox using much memory than others:

Here is the process screen for firefox opens around 25 tabs

Here the way I optimize the firefox configuration:
I. Type about:config on firefox address box
II. Session cofingure:
  1. search "session" in filter box
  2. Edit browser.sessionhistory.max_entries – this is the number of pages stored in the history of your browsing session. Basically these are pages that can be reached using your Back and Forward buttons. The default is 50, I reduced it to 20.
  3. Edit browser.sessionhistory.max_total_viewers – this is the number of pages that are stored in RAM so that they aren’t re-processed by Firefox’s rendering engine. This is what allows you to go Back to a page in Firefox and have it load almost instantaneously. The number of pages stored actually depends on the amount of RAM on your machine. I reduced this to 4 (I have 2GB RAM).
  4. Edit browser.sessionstore.max_tabs_undo – the number of tabs you can restore after closing them (you can do this with Ctrl/Cmd-Shift-T). The default of 10 is more than I really need, so I reduced it to 5 tabs.
  5. Edit browser.sessionstore.interval – Firefox saves your session after every 10 seconds by default. I changed this to a more conservative 30000 milliseconds.

III. Network configuration: enable these to get faster network speed
  1. network.http.pipelining => true
  2. network.http.pipelining.ssl => true
  3. network.http.proxy.pipelining => true

IV. Release Memory When Firefox Minimized
  1. Right click at the content (anywhere) and choose New->Boolean.
  2. In the textbox, type config.trim_on_minimize and press OK.
  3. Set the value to true, and press OK
V. Restart firefox to take affection.

Here is the result of the process after optimize:

So seem it helps, so much different, isn't it? :)
Thanks to following posts also:
  1. http://support.mozilla.com/en-US/kb/high+memory+usage
  2. http://blog.codefront.net/2008/09/10/optimize-firefoxs-memory-usage-by-tweaking-session-preferences/
  3. http://www.go4expert.com/forums/showthread.php?t=8568

Enjoy!

Sunday, June 7, 2009

Welcome to Bing, live search engine


Recently, Microsoft has released a new live search engine called Bing (www.bing.com) (formerly Live Search, Windows Live Search and MSN Search), the question for us is will Bing become a popular search engine as or over Google (www.google.com)?

So this question will see during the long way, I think most people when they meet any issue or require some information, they always remember google than other search engine as yahoo etc. but now as bing become a good one of live search engine so the competition should be starting now.

Bing released online on June 3, 2009 according to the Wiki Pedia record and it has now 16% of statistics counting since it's online till now, it's still a small percentage if compare to google of 60% but see, how fast they are popular now.

Any way, welcome to the new competition of search engine!

Tuesday, January 13, 2009

[NEWS] THE TOP 25 MOST DANGEROUS PROGRAMMING ERRORS

Here is the list of the top 25 most dangerous programming errors to be notified by all programmers:
  1. CWE-20:Improper Input Validation
  2. CWE-116:Improper Encoding or Escaping of Output
  3. CWE-89:Failure to Preserve SQL Query Structure
  4. CWE-79:Failure to Preserve Web Page Structure
  5. CWE-78:Failure to Preserve OS Command Structure
  6. CWE-319:Cleartext Transmission of Sensitive Information
  7. CWE-352:Cross-Site Request Forgery
  8. CWE-362:Race Condition
  9. CWE-209:Error Message Information Leak
  10. CWE-119:Failure to Constrain Operations within the Bounds of a Memory Buffer
  11. CWE-642:External Control of Critical State Data
  12. CWE-73:External Control of File Name or Path
  13. CWE-426:Untrusted Search Path
  14. CWE-94:Failure to Control Generation of Code
  15. CWE-494:Download of Code Without Integrity Check
  16. CWE-404:Improper Resource Shutdown or Release
  17. CWE-665:Improper Initialization
  18. CWE-682:Incorrect Calculation
  19. CWE-285:Improper Access Control
  20. CWE-327:Use of a Broken or Risky Cryptographic Algorithm
  21. CWE-259:Hard-Coded Password
  22. CWE-732:Insecure Permission Assignment for Critical Resource
  23. CWE-330:Use of Insufficiently Random Values
  24. CWE-250:Execution with Unnecessary Privileges
  25. CWE-602:Client-Side Enforcement of Server-Side Security
Source: SANS Institute
News Source: Dangerous coding errors revealed

Sunday, January 4, 2009

How to kill virus: MS-DOS.com, Global.exe, system.exe, svchost.exe manually

The virus: MS-DOS.com which in the process we can see it as Global.exe, system.exe and svchost.exe (which confused to the system process) which are the main process of the virus.











I used to met them with my friends' PC but I could not do anything other than format their PC as most of the antivirus seem can't heal it after the PC affected but now it's with my PC and I don't want to format it again, I tried to kill it myself without any information of it for almost 2 days but I got nothing.

After research, I got some solutions that possible to try, thanks to:
With lecuong.info solution seem more closely to solve the issue:
B1: Use IceSword simultaneously kill 3 Process: system.exe, Global.exe, svchost.exe
B2: Find and delete all the files have been analyzed at above
B3: Using Autoruns to check & remove all key viruses created in the registry
B4: Reboot computer.
B5: Download antivirus program (such bkav) to scan again! (If the computer has antivirus program is removed and then installed again!)
B6: Open Run -> CMD: type in sfc /scannow or sfc /scanonce and XP disk to correct the file failed.
B7: Reboot computer. (If necessary)

With solution B2/ B3/ please use batch file to do it: (kill-msdos.zip)
But I recommend you to use another batch file below...

As for sure, everyone will difficult for point B1/ so I, myself tried to enhance on lecuong.info batch to add following command to try ending all processes of the virus:

taskkill /F /IM system.exe /IM Global.exe /IM svchost.exe /T

But we will face delete also svchost.exe which is the windows system one so that in 1 minute the PC will shutdown but don't worry, we can proceed the rest before 1 minute.

Please press any key and accept YES by press Y to confirm delete all virus files and regedit entries as in the batch.

As I face the virus, seem the batch needs to enhance for more file paths to delete such as:
c:\windows\system32\regedit.exe and its regedit entries so here what I added more:

ATTRIB -R -H -S -A c:\windows\system32\regedit.exe

DEL /f c:\windows\system32\regedit.exe

REG DELETE "HKEY_CURRENT_USER\Software\Microsoft\Search Assistant\ACMru\5603" /v "001" /F
REG DELETE "HKEY_CLASSES_ROOT\MSCFile\Shell\Open\Command" /f

Now I don't see any process of this virus on my task manager any more.

(DOWNLOAD)
Here is the full batch file:
kill-msdos-full (computerexperience.co.cc).zip


Don't forget to continue point B5/ and B6/ also.

Please report any issue/success related to this solution.