<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-228218856178051930</id><updated>2009-11-12T22:30:23.531-08:00</updated><title type='text'>Share knowledge</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default?start-index=26&amp;max-results=25'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>57</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-750086823074240111</id><published>2009-11-10T21:44:00.001-08:00</published><updated>2009-11-12T22:30:23.541-08:00</updated><title type='text'>Solr</title><content type='html'>sudo rake solr:install&lt;br /&gt;&lt;br /&gt;1./ apt-get install tomcat5.5 libtomcat5.5-java tomcat5.5-admin tomcat5.5-webapps&lt;br /&gt;2./apt-get install solr-common solr-tomcat5.5 libxpp3-java&lt;br /&gt;3./ etc/init.d/tomcat5.5 restart&lt;br /&gt;&lt;br /&gt;java -jar start.jar&lt;br /&gt;&lt;br /&gt;Uninstall solr: sudo apt-get remove solr-tomcat5.5&lt;br /&gt;&lt;br /&gt;jar xvf filename to extract .war file&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-750086823074240111?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/750086823074240111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=750086823074240111&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/750086823074240111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/750086823074240111'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/11/solr.html' title='&lt;u&gt;&lt;i&gt;Solr&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-9021981604780064475</id><published>2009-10-18T21:01:00.000-07:00</published><updated>2009-11-11T01:10:24.941-08:00</updated><title type='text'>WIX Free Flash template design</title><content type='html'>I have seen many free template websites but those are only for the normal webpage generated as HTML. This morning I've played around with &lt;a href="http://www.wix.com"&gt;WIX&lt;/a&gt; which allows me to create my flash website with many pretty templates. It's easy to customize and change everything.&lt;br /&gt;&lt;br /&gt; You can do it by yourself with &lt;a href="http://www.wix.com"&gt;www.wix.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is mine: &lt;a href="http://www.wix.com/samneang/samneang"&gt;www.wix.com/samneang/samneang&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blog.aisleten.com/2007/04/14/getting-started-with-acts_as_solr/"&gt;flash fly characters&lt;/a&gt; should be checked for it's flash animation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-9021981604780064475?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/9021981604780064475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=9021981604780064475&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/9021981604780064475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/9021981604780064475'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/10/wix-free-flash-template-design.html' title='&lt;u&gt;&lt;i&gt;WIX Free Flash template design&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-2644264425737847455</id><published>2009-10-08T19:09:00.000-07:00</published><updated>2009-10-11T21:05:21.139-07:00</updated><title type='text'>Testing ActiveResource</title><content type='html'>I was suffered at the begining of this testing but later I've found some sample ways to solve it.&lt;br /&gt;&lt;br /&gt;&lt;code&gt; //Testing with mocking object's method&lt;br /&gt;  //Sample structure of HttpMock: mock.http_method(path, request_headers = {}, body = nil, status = 200, response_headers = {})&lt;br /&gt;&lt;br /&gt;    def setup&lt;br /&gt;    @matz  = { :id =&gt; 1, :name =&gt; "Matz" }.to_xml(:root =&gt; "person")&lt;br /&gt;    ActiveResource::HttpMock.respond_to do |mock|&lt;br /&gt;      mock.post   "/people.xml",   {}, @matz, 201, "Location" =&gt; "/people/1.xml"&lt;br /&gt;      mock.get    "/people/1.xml", {}, @matz&lt;br /&gt;      mock.put    "/people/1.xml", {}, nil, 204&lt;br /&gt;      mock.delete "/people/1.xml", {}, nil, 200&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  def test_get_matz&lt;br /&gt;    person = Person.find(1)&lt;br /&gt;    assert_equal "Matz", person.name&lt;br /&gt;  end&lt;br /&gt;------------------------------------&lt;br /&gt;&lt;br /&gt;  def setup&lt;br /&gt;    @matz  = { :id =&gt; 1, :name =&gt; "Matz" }.to_xml(:root =&gt; "person")&lt;br /&gt;    ActiveResource::HttpMock.respond_to do |mock|&lt;br /&gt;      mock.get "/people/1.xml", {}, @matz&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  def test_should_request_remote_service&lt;br /&gt;    person = Person.find(1)  # Call the remote service&lt;br /&gt;&lt;br /&gt;    # This request object has the same HTTP method and path as declared by the mock&lt;br /&gt;    expected_request = ActiveResource::Request.new(:get, "/people/1.xml")&lt;br /&gt;&lt;br /&gt;    # Assert that the mock received, and responded to, the expected request from the model&lt;br /&gt;    assert ActiveResource::HttpMock.requests.include?(expected_request)&lt;br /&gt;  end&lt;br /&gt;------------------------------------&lt;br /&gt;&lt;br /&gt;      def test_delete&lt;br /&gt;        assert Person.delete(1)&lt;br /&gt;        ActiveResource::HttpMock.respond_to do |mock|&lt;br /&gt;          mock.get "/people/1.xml", {}, nil, 404&lt;br /&gt;        end&lt;br /&gt;        assert_raises(ActiveResource::ResourceNotFound) { Person.find(1) }&lt;br /&gt;      end&lt;br /&gt;------------------------------------&lt;br /&gt;&lt;br /&gt;  @matz  = { :id =&gt; 1, :name =&gt; 'Matz' }.to_xml(:root =&gt; 'person')&lt;br /&gt;  ActiveResource::HttpMock.respond_to do |mock|&lt;br /&gt;    mock.get "/people/1.xml", {}, @matz&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt; //Testing by deleting the record and return RecordNotFound(404)&lt;br /&gt;   def test_delete&lt;br /&gt;     assert Person.delete(1)&lt;br /&gt;     ActiveResource::HttpMock.respond_to do |mock|&lt;br /&gt;       mock.get "/people/1.xml", {}, nil, 404&lt;br /&gt;     end&lt;br /&gt;     assert_raises(ActiveResource::ResourceNotFound) { Person.find(1) }&lt;br /&gt;   end&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-2644264425737847455?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/2644264425737847455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=2644264425737847455&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/2644264425737847455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/2644264425737847455'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/10/testing-activeresource.html' title='&lt;u&gt;&lt;i&gt;Testing ActiveResource&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-4379173319569989688</id><published>2009-10-07T00:37:00.000-07:00</published><updated>2009-10-07T21:17:54.239-07:00</updated><title type='text'>HTTParty, Awesome_nested_set, rdoc option(s)</title><content type='html'>For those who wanna use HTTParty well with RoR, you can follow this link: &lt;a href="http://rdoc.info/projects/jnunemaker/httparty"&gt;HTTParty&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Talking about listing data as Tree and easy to search, I would like to present you about &lt;a href="http://wiki.github.com/collectiveidea/awesome_nested_set/awesome-nested-set-cheat-sheet"&gt;awesome_nested_set&lt;/a&gt; which is cool.&lt;br /&gt;&lt;br /&gt;It was not bad that some guys don't know how to generate their Rdoc as the whole structure after they generate it first time because they don't delete the doc folder when they wanna generate it as the whole again.&lt;br /&gt;To generate your RDoc without some specific folders or files you need to type as bellow:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;rdoc --exclude folder1 --exclude folder2 --exclude folder3&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-4379173319569989688?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/4379173319569989688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=4379173319569989688&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/4379173319569989688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/4379173319569989688'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/10/httparty.html' title='&lt;u&gt;&lt;i&gt;HTTParty, Awesome_nested_set, rdoc option(s)&lt;/u&gt;&lt;/i&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-1772743892862682740</id><published>2009-10-05T21:49:00.000-07:00</published><updated>2009-10-05T22:02:01.790-07:00</updated><title type='text'>RESTful Pagination with Ruby on Rails</title><content type='html'>Currently I'm working on RoR project and I've seen one plug-in call Will-paginate but it works well with ActiveRecord. There's one blog posts that it also work with ActiveResource but I'm not quiet clear about it. here is the link: &lt;a href="http://blog.smartlogicsolutions.com/tag/rails-will_paginate-to_xml-activeresource/"&gt;Will-paginate&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;But I've seen another web in &lt;a href="http://stackoverflow.com/questions/776448/pagination-in-a-rest-web-application"&gt;stackoverflow&lt;/a&gt; which also talk about the way to do pagination with REST. I think, I'll try with Stackoverflow first and combine with will-paginate by using ActiveRecord, otherwise I will use Will-paginate with both ActiveRecord and ActiveResource.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-1772743892862682740?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/1772743892862682740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=1772743892862682740&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/1772743892862682740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/1772743892862682740'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/10/restful-pagination-with-ruby-on-rails.html' title='&lt;u&gt;&lt;i&gt;RESTful Pagination with Ruby on Rails&lt;/u&gt;&lt;/i&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-6820835492625875427</id><published>2009-09-28T19:51:00.000-07:00</published><updated>2009-09-28T19:52:15.790-07:00</updated><title type='text'>ActiveResource Error response</title><content type='html'>&lt;code&gt;    * 200..399 - Valid response, no exception (other than 301, 302)&lt;br /&gt;    * 301, 302 - ActiveResource::Redirection&lt;br /&gt;    * 400 - ActiveResource::BadRequest&lt;br /&gt;    * 401 - ActiveResource::UnauthorizedAccess&lt;br /&gt;    * 403 - ActiveResource::ForbiddenAccess&lt;br /&gt;    * 404 - ActiveResource::ResourceNotFound&lt;br /&gt;    * 405 - ActiveResource::MethodNotAllowed&lt;br /&gt;    * 409 - ActiveResource::ResourceConflict&lt;br /&gt;    * 422 - ActiveResource::ResourceInvalid (rescued by save as validation errors)&lt;br /&gt;    * 401..499 - ActiveResource::ClientError&lt;br /&gt;    * 500..599 - ActiveResource::ServerError&lt;br /&gt;    * Other - ActiveResource::ConnectionError&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-6820835492625875427?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/6820835492625875427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=6820835492625875427&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/6820835492625875427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/6820835492625875427'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/09/activeresource-error-response.html' title='&lt;u&gt;&lt;i&gt;ActiveResource Error response&lt;/u&gt;&lt;/i&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-5884342299799717317</id><published>2009-08-20T00:29:00.001-07:00</published><updated>2009-08-20T21:58:50.647-07:00</updated><title type='text'>My first time with Rails</title><content type='html'>&lt;code&gt;&lt;br /&gt;---------RSpec red/green/refactor&lt;br /&gt;module AccountExampleHelperMethods&lt;br /&gt;  def helper_method&lt;br /&gt;    …&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;shared_examples_for "all editions" do&lt;br /&gt;  it "should behave like all editions" do&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;describe "SmallEdition" do&lt;br /&gt;  include AccountExampleHelperMethods&lt;br /&gt;&lt;br /&gt;  helper_method&lt;br /&gt;  it_should_behave_like "all editions"&lt;br /&gt;  it "should also behave like a small edition" do&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;---------&lt;br /&gt;rake db:create                 ..create database&lt;br /&gt;rake db:drop                   ..drop database&lt;br /&gt;rake db:sessions:clear         ..empty sessions table&lt;br /&gt;rake db:migrate                ..run db migrations&lt;br /&gt;rake db:migrate VERSION=&lt;version to roll back to&gt;  ..rollback db&lt;br /&gt;rake rails:update:javascripts  ..update javascript libraries&lt;br /&gt;rake routes  ...list available routes in application&lt;br /&gt;&lt;br /&gt;gem server&lt;br /&gt;script/server&lt;br /&gt;script/console&lt;br /&gt;rake db:migrate&lt;br /&gt;rake db:fixtures:load&lt;br /&gt;rake spec:db:fixtures:load&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;script/generate rspec_model user&lt;br /&gt; -&gt; create data in spec/fixtures/users.yml&lt;br /&gt; -&gt; write our test in spec/models/user_spec.rb&lt;br /&gt;&lt;br /&gt;script/generate rspec_controller users&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-5884342299799717317?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/5884342299799717317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=5884342299799717317&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/5884342299799717317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/5884342299799717317'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/08/my-first-time-with-rails.html' title='&lt;u&gt;&lt;i&gt;My first time with Rails&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-5665410721263594327</id><published>2009-08-19T18:38:00.000-07:00</published><updated>2009-08-20T21:59:23.368-07:00</updated><title type='text'>Install/uninstall rails with specific version</title><content type='html'>&lt;code&gt;sudo gem uninstall rails&lt;br /&gt;sudo gem install -v=2.3.2 rails&lt;br /&gt;&lt;br /&gt;sudo aptitude remove rake&lt;br /&gt;sudo aptitude install git-core&lt;br /&gt;sudo gem install rake&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-5665410721263594327?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/5665410721263594327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=5665410721263594327&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/5665410721263594327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/5665410721263594327'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/08/installuninstall-rails-with-specific.html' title='&lt;u&gt;&lt;i&gt;Install/uninstall rails with specific version&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-3696973452681792278</id><published>2009-08-05T21:50:00.000-07:00</published><updated>2009-09-29T00:28:02.008-07:00</updated><title type='text'>Mulitple inheritance in RUBY</title><content type='html'>Normally Ruby is a single inheritance language but you can do multiple inheritance by using Mix-ins which is the module that contains many classes inside or I can separate each classes in each modules as bellow then I include them in to wherever I want.&lt;br /&gt;======================================&lt;br /&gt;&lt;code&gt;module ToolBox&lt;br /&gt;  class Ruler&lt;br /&gt;    attr_accessor :length&lt;br /&gt;  end&lt;br /&gt;  def mesure&lt;br /&gt;    @length = 10&lt;br /&gt;  end&lt;br /&gt;  def whatever&lt;br /&gt;    ....&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;module Country&lt;br /&gt;  class Ruler&lt;br /&gt;    attr_accessor :name&lt;br /&gt;  end&lt;br /&gt;  def unit&lt;br /&gt;    @type = 'meter'&lt;br /&gt;  end&lt;br /&gt;  def whatever&lt;br /&gt;    ....&lt;br /&gt;  end&lt;br /&gt;end&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-3696973452681792278?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/3696973452681792278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=3696973452681792278&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/3696973452681792278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/3696973452681792278'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/08/mulitple-inheritance-in-ruby.html' title='&lt;u&gt;&lt;i&gt;Mulitple inheritance in RUBY&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-4036452723259340608</id><published>2009-08-05T00:40:00.001-07:00</published><updated>2009-08-05T00:42:03.985-07:00</updated><title type='text'>Sample of Ruby basic</title><content type='html'>&lt;code&gt;stop_words = %w{the a by on for of are with just but and to the my I has some in}&lt;br /&gt;lines = File.readlines("text.txt")&lt;br /&gt;line_count = lines.size&lt;br /&gt;text = lines.join&lt;br /&gt;&lt;br /&gt;# Count the characters&lt;br /&gt;character_count = text.length&lt;br /&gt;character_count_nospaces = text.gsub(/\s+/, '').length&lt;br /&gt;&lt;br /&gt;# Count the words, sentences, and paragraphs&lt;br /&gt;word_count = text.split.length&lt;br /&gt;sentence_count = text.split(/\.|\?|!/).length&lt;br /&gt;paragraph_count = text.split(/\n\n/).length&lt;br /&gt;&lt;br /&gt;# Make a list of words in the text that aren't stop words,&lt;br /&gt;# count them, and work out the percentage of non-stop words&lt;br /&gt;# against all words&lt;br /&gt;all_words = text.scan(/\w+/)&lt;br /&gt;good_words = all_words.select{ |word| !stop_words.include?(word) }&lt;br /&gt;good_percentage = ((good_words.length.to_f / all_words.length.to_f) * 100).to_i&lt;br /&gt;&lt;br /&gt;# Summarize the text by cherry picking some choice sentences&lt;br /&gt;sentences = text.gsub(/\s+/, ' ').strip.split(/\.|\?|\!/)&lt;br /&gt;sentences_sorted = sentences.sort_by { |sentence| sentence.length }&lt;br /&gt;one_third = sentences_sorted.length / 3&lt;br /&gt;ideal_sentences = sentences_sorted.slice(one_third, one_third + 1)&lt;br /&gt;ideal_sentences = ideal_sentences.select { |sentence| sentence =~ /is|are/ }&lt;br /&gt;&lt;br /&gt;# Give the analysis back to the user&lt;br /&gt;puts "#{line_count} lines"&lt;br /&gt;puts "#{character_count} characters"&lt;br /&gt;puts "#{character_count_nospaces} characters (excluding spaces)"&lt;br /&gt;puts "#{word_count} words"&lt;br /&gt;puts "#{sentence_count} sentences"&lt;br /&gt;puts "#{paragraph_count} paragraphs"&lt;br /&gt;puts "#{sentence_count / paragraph_count} sentences per paragraph (average)"&lt;br /&gt;puts "#{word_count / sentence_count} words per sentence (average)"&lt;br /&gt;puts "#{good_percentage}% of words are non-fluff words"&lt;br /&gt;puts "Summary:\n\n" + ideal_sentences.join(". ")&lt;br /&gt;puts "-- End of analysis"&lt;br /&gt;------------------RESULT&lt;br /&gt;121 lines&lt;br /&gt;6165 characters&lt;br /&gt;5055 characters (excluding spaces)&lt;br /&gt;1093 words&lt;br /&gt;18 paragraphs&lt;br /&gt;45 sentences&lt;br /&gt;2 sentences per paragraph (average)&lt;br /&gt;24 words per sentence (average)&lt;br /&gt;76% of words are non-fluff words&lt;br /&gt;Summary:&lt;br /&gt;' The surgeon leaned over the body, and raised the left hand. Think what it is&lt;br /&gt;to be a mother, there's a dear young lamb do. 'The old story,' he said, shaking&lt;br /&gt;his head: 'no wedding-ring, I see. What an excellent example of the power of&lt;br /&gt;dress, young Oliver Twist was. ' Apparently this consolatory perspective of a&lt;br /&gt;mother's prospects failed in producing its due effect. ' The surgeon had been&lt;br /&gt;sitting with his face turned towards the fire: giving the palms of his hands a&lt;br /&gt;warm and a rub alternately. ' 'You needn't mind sending up to me, if the child&lt;br /&gt;cries, nurse,' said the surgeon, putting on his gloves with great deliberation.&lt;br /&gt;She had walked some distance, for her shoes were worn to pieces; but where&lt;br /&gt;she came from, or where she was going to, nobody knows. ' He put on his hat,&lt;br /&gt;and, pausing by the bed-side on his way to the door, added, 'She was a&lt;br /&gt;good-looking girl, too; where did she come from&lt;br /&gt;-- End of analysis&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-4036452723259340608?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/4036452723259340608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=4036452723259340608&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/4036452723259340608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/4036452723259340608'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/08/sample-of-ruby-basic.html' title='&lt;u&gt;&lt;i&gt;Sample of Ruby basic&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-8148664783644016754</id><published>2009-08-05T00:40:00.000-07:00</published><updated>2009-10-11T21:33:44.439-07:00</updated><title type='text'>Sample of Ruby basic</title><content type='html'>&lt;code&gt;stop_words = %w{the a by on for of are with just but and to the my I has some in}&lt;br /&gt;lines = File.readlines("text.txt")&lt;br /&gt;line_count = lines.size&lt;br /&gt;text = lines.join&lt;br /&gt;&lt;br /&gt;# Count the characters&lt;br /&gt;character_count = text.length&lt;br /&gt;character_count_nospaces = text.gsub(/\s+/, '').length&lt;br /&gt;&lt;br /&gt;# Count the words, sentences, and paragraphs&lt;br /&gt;word_count = text.split.length&lt;br /&gt;sentence_count = text.split(/\.|\?|!/).length&lt;br /&gt;paragraph_count = text.split(/\n\n/).length&lt;br /&gt;&lt;br /&gt;# Make a list of words in the text that aren't stop words,&lt;br /&gt;# count them, and work out the percentage of non-stop words&lt;br /&gt;# against all words&lt;br /&gt;all_words = text.scan(/\w+/)&lt;br /&gt;good_words = all_words.select{ |word| !stop_words.include?(word) }&lt;br /&gt;good_percentage = ((good_words.length.to_f / all_words.length.to_f) * 100).to_i&lt;br /&gt;&lt;br /&gt;# Summarize the text by cherry picking some choice sentences&lt;br /&gt;sentences = text.gsub(/\s+/, ' ').strip.split(/\.|\?|\!/)&lt;br /&gt;sentences_sorted = sentences.sort_by { |sentence| sentence.length }&lt;br /&gt;one_third = sentences_sorted.length / 3&lt;br /&gt;ideal_sentences = sentences_sorted.slice(one_third, one_third + 1)&lt;br /&gt;ideal_sentences = ideal_sentences.select { |sentence| sentence =~ /is|are/ }&lt;br /&gt;&lt;br /&gt;# Give the analysis back to the user&lt;br /&gt;puts "#{line_count} lines"&lt;br /&gt;puts "#{character_count} characters"&lt;br /&gt;puts "#{character_count_nospaces} characters (excluding spaces)"&lt;br /&gt;puts "#{word_count} words"&lt;br /&gt;puts "#{sentence_count} sentences"&lt;br /&gt;puts "#{paragraph_count} paragraphs"&lt;br /&gt;puts "#{sentence_count / paragraph_count} sentences per paragraph (average)"&lt;br /&gt;puts "#{word_count / sentence_count} words per sentence (average)"&lt;br /&gt;puts "#{good_percentage}% of words are non-fluff words"&lt;br /&gt;puts "Summary:\n\n" + ideal_sentences.join(". ")&lt;br /&gt;puts "-- End of analysis"&lt;br /&gt;------------------RESULT&lt;br /&gt;121 lines&lt;br /&gt;6165 characters&lt;br /&gt;5055 characters (excluding spaces)&lt;br /&gt;1093 words&lt;br /&gt;18 paragraphs&lt;br /&gt;45 sentences&lt;br /&gt;2 sentences per paragraph (average)&lt;br /&gt;24 words per sentence (average)&lt;br /&gt;76% of words are non-fluff words&lt;br /&gt;Summary:&lt;br /&gt;' The surgeon leaned over the body, and raised the left hand. Think what it is&lt;br /&gt;to be a mother, there's a dear young lamb do. 'The old story,' he said, shaking&lt;br /&gt;his head: 'no wedding-ring, I see. What an excellent example of the power of&lt;br /&gt;dress, young Oliver Twist was. ' Apparently this consolatory perspective of a&lt;br /&gt;mother's prospects failed in producing its due effect. ' The surgeon had been&lt;br /&gt;sitting with his face turned towards the fire: giving the palms of his hands a&lt;br /&gt;warm and a rub alternately. ' 'You needn't mind sending up to me, if the child&lt;br /&gt;cries, nurse,' said the surgeon, putting on his gloves with great deliberation.&lt;br /&gt;She had walked some distance, for her shoes were worn to pieces; but where&lt;br /&gt;she came from, or where she was going to, nobody knows. ' He put on his hat,&lt;br /&gt;and, pausing by the bed-side on his way to the door, added, 'She was a&lt;br /&gt;good-looking girl, too; where did she come from&lt;br /&gt;-- End of analysis&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-8148664783644016754?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/8148664783644016754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=8148664783644016754&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/8148664783644016754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/8148664783644016754'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/08/sample-of-ruby-basic_05.html' title='&lt;u&gt;&lt;i&gt;Sample of Ruby basic&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-6249094656446652547</id><published>2009-08-04T21:52:00.000-07:00</published><updated>2009-09-29T00:28:31.084-07:00</updated><title type='text'>Ruby scan only useful/key words</title><content type='html'>It maybe useful for me later to develop English testing system.&lt;br /&gt;======================================&lt;br /&gt;&lt;code&gt; text = %q{Los Angeles has some of the nicest weather in the country.}&lt;br /&gt; stop_words = %w{the a by on for of are with just but and to the my I has some}&lt;br /&gt; words = text.scan(/\w+/)&lt;br /&gt; key_words = words.select { |word| !stop_words.include?(word) }&lt;br /&gt; puts key_words.join(' ')&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-6249094656446652547?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/6249094656446652547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=6249094656446652547&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/6249094656446652547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/6249094656446652547'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/08/ruby-scan-only-useful-words.html' title='&lt;u&gt;&lt;i&gt;Ruby scan only useful/key words&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-6563766016865615701</id><published>2009-08-04T19:33:00.000-07:00</published><updated>2009-09-29T00:28:45.741-07:00</updated><title type='text'>Hashes in Ruby</title><content type='html'>It is just only one part of Ruby which I interested in and It is similar to JSON Object in JavaScript.&lt;br /&gt;======================================&lt;br /&gt;&lt;code&gt;people = {&lt;br /&gt;  'fred' =&gt; {&lt;br /&gt;     'name' =&gt; 'Fred Elliott',&lt;br /&gt;     'age' =&gt; 63,&lt;br /&gt;     'gender' =&gt; 'male',&lt;br /&gt;     'favorite painters' =&gt; ['Monet', 'Constable', 'Da Vinci']&lt;br /&gt;  },&lt;br /&gt;  'janet' =&gt; {&lt;br /&gt;     'name' =&gt; 'Janet S Porter',&lt;br /&gt;     'age' =&gt; 55,&lt;br /&gt;     'gender' =&gt; 'female'&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;puts people['fred']['age']&lt;br /&gt;puts people['janet']['gender']&lt;br /&gt;puts people['janet'].inspect&lt;br /&gt;puts people['fred']['favorite painters'].length&lt;br /&gt;puts people['fred']['favorite painters'].join(", ")&lt;br /&gt;&lt;br /&gt;-----------------Result&lt;br /&gt;63&lt;br /&gt;female&lt;br /&gt;{"name"=&gt;"Janet S Porter", "gender"=&gt;"female", "age"=&gt;55}&lt;br /&gt;3&lt;br /&gt;Monet, Constable, Da Vinci&lt;br /&gt;-----------------&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-6563766016865615701?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/6563766016865615701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=6563766016865615701&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/6563766016865615701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/6563766016865615701'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/08/hashes-in-ruby.html' title='&lt;u&gt;&lt;i&gt;Hashes in Ruby&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-6881970748068965026</id><published>2009-08-03T19:39:00.000-07:00</published><updated>2009-08-03T19:40:55.348-07:00</updated><title type='text'>Update Ruby to version 1.8.7 in Ubuntu</title><content type='html'>&lt;code&gt;$ sudo apt-get install build-essential libssl-dev libreadline5-dev zlib1g-dev&lt;br /&gt;$ wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p22.tar.gz&lt;br /&gt;$ tar zxvf ruby-1.8.7-p22.tar.gz&lt;br /&gt;$ cd ruby-1.8.7-p22&lt;br /&gt;$ ./configure --prefix=/usr/local --with-openssl-dir=/usr --with-readline-dir=/usr --with-zlib-dir=/usr&lt;br /&gt;$ make&lt;br /&gt;$ sudo make install&lt;br /&gt;&lt;br /&gt;$ which ruby&lt;br /&gt;/usr/local/bin/ruby&lt;br /&gt;$ ruby --version&lt;br /&gt;ruby 1.8.7 (2008-06-20 patchlevel 22) [i686-linux]&lt;br /&gt;$ ruby -ropenssl -rzlib -rreadline -e "puts :success"&lt;br /&gt;success&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-6881970748068965026?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/6881970748068965026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=6881970748068965026&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/6881970748068965026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/6881970748068965026'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/08/update-ruby-to-version-187-in-ubuntu.html' title='&lt;u&gt;&lt;i&gt;Update Ruby to version 1.8.7 in Ubuntu&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-3401203239127632430</id><published>2009-07-30T20:47:00.000-07:00</published><updated>2009-07-30T20:51:35.617-07:00</updated><title type='text'>JavaScript Custom Event</title><content type='html'>&lt;code&gt;var CustomEvent = function(){&lt;br /&gt; //name of the event&lt;br /&gt; this.eventName = arguments[0];&lt;br /&gt; var mEventName = this.eventName;&lt;br /&gt;&lt;br /&gt; //function to call on event fire&lt;br /&gt; var eventAction = null;&lt;br /&gt;&lt;br /&gt; //subscribe a function to the event&lt;br /&gt; this.subscribe = function(fn){&lt;br /&gt;  eventAction = fn;&lt;br /&gt; };&lt;br /&gt;&lt;br /&gt; //fire the event&lt;br /&gt; this.fire = function(sender, eventArgs){&lt;br /&gt;  this.eventName = eventName2;&lt;br /&gt;  if(eventAction != null){&lt;br /&gt;   eventAction(sender, eventArgs);&lt;br /&gt;  }&lt;br /&gt;  else {&lt;br /&gt;   alert('There was no function subscribed to the ' + mEventName + ' event!');&lt;br /&gt;  }&lt;br /&gt; };&lt;br /&gt;};&lt;br /&gt;========= example&lt;br /&gt;var myEvent = new CustomEvent("my event");&lt;br /&gt;myEvent.subscribe(function(sender, eventArgs){&lt;br /&gt; alert(eventArgs.message);&lt;br /&gt;});&lt;br /&gt;========= Fire the event&lt;br /&gt;myEvent.fire(null, {&lt;br /&gt; message: 'you just witnessed the firing of a custom event called ' + this.eventName + '!'&lt;br /&gt;});&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.geekdaily.net/2008/04/02/javascript-defining-and-using-custom-events/"&gt;Reference&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-3401203239127632430?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/3401203239127632430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=3401203239127632430&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/3401203239127632430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/3401203239127632430'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/07/javascript-custom-event.html' title='&lt;u&gt;&lt;i&gt;JavaScript Custom Event&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-1369614250000577293</id><published>2009-07-19T19:45:00.000-07:00</published><updated>2009-07-19T19:47:15.829-07:00</updated><title type='text'>Function as Data in Javascript</title><content type='html'>&lt;code&gt;function multiplyByTwo(a, b, c, callback){&lt;br /&gt;    var i, ar = [];&lt;br /&gt;    for(i = 0; i &amp;lt; 3; i++){&lt;br /&gt;        ar[i] = callback(arguments[i] * 2);&lt;br /&gt;    }&lt;br /&gt;    return ar;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function addOne(value){&lt;br /&gt;    return value + 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;multiplyByTwo(2,4,6, addOne);&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-1369614250000577293?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/1369614250000577293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=1369614250000577293&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/1369614250000577293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/1369614250000577293'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/07/function-as-data-in-javascript.html' title='&lt;i&gt;&lt;u&gt;Function as Data in Javascript&lt;/u&gt;&lt;/i&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-7610394620627300715</id><published>2009-07-06T01:39:00.000-07:00</published><updated>2009-07-06T01:41:20.222-07:00</updated><title type='text'>CSS float for firefox and IE</title><content type='html'>&lt;code&gt;Dom.styleFloat // for IE&lt;br /&gt;Dom.cssFloat // for firefox&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-7610394620627300715?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/7610394620627300715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=7610394620627300715&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/7610394620627300715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/7610394620627300715'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/07/css-float-for-firefox-and-ie.html' title='&lt;u&gt;&lt;i&gt;CSS float for firefox and IE&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-5355028689643312161</id><published>2009-06-24T00:19:00.000-07:00</published><updated>2009-09-29T00:29:06.999-07:00</updated><title type='text'>Set class path for java:</title><content type='html'>I almost forget how to run Java command outside Java's root folder, bin. Here are the steps to set class path for java.&lt;br /&gt;======================================&lt;br /&gt;&lt;code&gt;1./ Go into Advanced system settings in Control Panel/System&lt;br /&gt;2./ Click on Environment Variables&lt;br /&gt;3./ Click on New... to create "JAVA_HOME" with value "C:\Program Files (x86)\Java\jdk1.6.0_02"&lt;br /&gt;4./ Edit "Path" with value "%JAVA_HOME%\BIN"&lt;br /&gt;5./ Open your new CMD.&lt;br /&gt;&lt;br /&gt;Note: Each value in "Path" is seperated by ";"&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-5355028689643312161?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/5355028689643312161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=5355028689643312161&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/5355028689643312161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/5355028689643312161'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/06/set-class-path-for-java.html' title='&lt;u&gt;&lt;i&gt;Set class path for java:&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-7340604941387077588</id><published>2009-06-21T18:44:00.000-07:00</published><updated>2009-09-29T00:29:23.264-07:00</updated><title type='text'>TileCache with Geoserver</title><content type='html'>When we use many layers in one map, we should better use Tilecache which stores all of those images in temporary in local computer, hence our map will load much faster than normal. Here are some ways to configure Tilecache.&lt;br /&gt;======================================&lt;br /&gt;&lt;code&gt;1./ you need to have Apache server installed and make sure your Geoserver is available.&lt;br /&gt;&lt;br /&gt;2./ Define your temp folder to store those temporary images and your layers which is already generated from Geoserver in "tilecache.cfg"&lt;br /&gt;//temp folder&lt;br /&gt;[cache]&lt;br /&gt;type=Disk&lt;br /&gt;base= C:/temp/tilecache&lt;br /&gt;// layer from Geoserver&lt;br /&gt;[cambodia]&lt;br /&gt;type=WMS&lt;br /&gt;url=http://127.0.0.1:8080/geoserver/wms?transparent=true&lt;br /&gt;extension=png&lt;br /&gt;layers= mango:cam_DistrictCenter&lt;br /&gt;srs= EPSG:41001&lt;br /&gt;#metatile= yes&lt;br /&gt;metaBuffer=10&lt;br /&gt;metaSize=20,20&lt;br /&gt;&lt;br /&gt;3./ Define tilecache folder in "httpd.conf"&lt;br /&gt;&amp;lt;Directory C:\wamp\www\tilecache&amp;gt;&lt;br /&gt;     AddHandler cgi-script .cgi&lt;br /&gt;     Options +ExecCGI&lt;br /&gt;&amp;lt;/Directory&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Reference: &lt;a href="http://tilecache.org/docs/README"&gt;Tilecache's docs&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-7340604941387077588?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/7340604941387077588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=7340604941387077588&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/7340604941387077588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/7340604941387077588'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/06/tilecache.html' title='&lt;u&gt;&lt;i&gt;TileCache with Geoserver&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-3011747897659321197</id><published>2009-06-05T23:20:00.000-07:00</published><updated>2009-09-29T00:29:36.328-07:00</updated><title type='text'>Artisteer</title><content type='html'>It is a cool program which helps you to design any website in a few minutes by some easy steps. I can only use Artisteer v2.1.0 since I haven't found the cracked for other versions yet. Artisteer supports either many technologies such as CodeCharge Studio4, WordPress(2.5-2.7), Joomla 1.5 and Drupal(5.x, 6.x) or Browsers like IE 6+, Firefox 2+, Opera 9+, Safari 1+ and Chrome 1+. You should watch it's &lt;a href="http://www.artisteer.com/?p=demo"&gt;demo&lt;/a&gt; then you will know how cool it is.&lt;br/&gt;&lt;br /&gt;Here are some steps to use Artisteer v2.1.0 without trial version:&lt;br /&gt;======================================&lt;br /&gt;1./ You must download Artisteer v2.1.0 by this url: &lt;br/&gt;&lt;a href="http://download.cnet.com/Artisteer/3000-10247_4-10886734.html?part=dl-Artisteer"&gt;Artisteer v2.1.0&lt;/a&gt; and install it.&lt;br/&gt;&lt;br /&gt;2./ Download this video which tells you how to remove trial: &lt;br/&gt;&lt;a href="http://www.esnips.com/doc/7ee78388-91aa-4e2f-9fbc-7c6519f48e69/untrial.artisteer"&gt;Untrial artisteer video&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;3./ &lt;a href="http://www.esnips.com/doc/781c3d45-34a3-4d44-bde9-baa730bc7e8d/art"&gt;Bat file&lt;/a&gt; is the key file to remove it's trial.&lt;br/&gt;&lt;br /&gt;4./ &lt;a href="http://www.esnips.com/doc/5069ee2c-65df-4f4b-8add-b8f2b649bb38/Artisteer2_User_Manual"&gt; Artisteer's doc &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Note&lt;/u&gt;&lt;/b&gt; You may not be able to view Artisteer's doc directly on the internet but you can download and view it in your own PC.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-3011747897659321197?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/3011747897659321197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=3011747897659321197&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/3011747897659321197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/3011747897659321197'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/06/artisteer.html' title='&lt;u&gt;&lt;i&gt;Artisteer&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-4752149067999137305</id><published>2009-05-27T03:18:00.000-07:00</published><updated>2009-05-29T00:55:51.624-07:00</updated><title type='text'>Remote Desktop in Ubuntu</title><content type='html'>You will be able to remote other ubuntu desktop by this following command:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;vinagre 192.168.0.174&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-4752149067999137305?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/4752149067999137305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=4752149067999137305&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/4752149067999137305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/4752149067999137305'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/05/remote-desktop-in-ubuntu.html' title='&lt;u&gt;&lt;i&gt;Remote Desktop in Ubuntu&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-72763026050152164</id><published>2009-05-18T02:00:00.000-07:00</published><updated>2009-09-29T00:29:52.857-07:00</updated><title type='text'>Javascript Unique Item in Array</title><content type='html'>After we follow this code bellow, we'll get tempArr[] which store unique items.&lt;br /&gt;Example: array[1,10,2,2,5,4,5,6,6,8,10,8] =&gt; array[1,2,4,5,6,10,8]&lt;br /&gt;======================================&lt;br /&gt;&lt;code&gt;&lt;br /&gt;function contains(a, e) {&lt;br /&gt; for(j=0;j&amp;lt;a.length;j++)if(a[j]==e)return true;&lt;br /&gt; return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(!contains(tempArr, urlObj[i].group)){&lt;br /&gt;  tempArr.length +=1;&lt;br /&gt;  tempArr[tempArr.length-1] = urlObj[i].group;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-72763026050152164?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/72763026050152164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=72763026050152164&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/72763026050152164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/72763026050152164'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/05/javascript-unique-item-in-array.html' title='&lt;u&gt;&lt;i&gt;Javascript Unique Item in Array&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-442228952784316244</id><published>2009-05-09T21:11:00.000-07:00</published><updated>2009-09-29T00:31:37.068-07:00</updated><title type='text'>Selenium</title><content type='html'>Selenium is a test tool that allows you to write automated web application UI tests in any programming language against any HTTP website using any mainstream JavaScript-enabled browser. &lt;br /&gt;======================================&lt;br /&gt;&lt;code&gt;1./ You need to have Ruby in your pc then install selenium by a command below.&lt;br /&gt;&lt;br /&gt;sudo gem install Selenium&lt;br /&gt;&lt;br /&gt;2./ cd to our JSSpec's path then run command below in order to access HTTP Server from that directory by default it's "http://localhost:8000"&lt;br /&gt;&lt;br /&gt;python -m SimpleHTTPServer&lt;br /&gt;&lt;br /&gt;3./ run you JSSpec file by putting it's name after the http's path above&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;u&gt;Reference:&lt;/u&gt;&lt;br /&gt;&lt;a href="http://bitbucket.org/ChrisInCambo/jsspec_ci/wiki/Home"&gt;ChrisinCambo - jsspec_ci&lt;/a&gt;&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-442228952784316244?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='related' href='http://seleniumhq.org/projects/remote-control/' title='&lt;u&gt;&lt;i&gt;Selenium&lt;/i&gt;&lt;/u&gt;'/><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/442228952784316244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=442228952784316244&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/442228952784316244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/442228952784316244'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/05/selenium.html' title='&lt;u&gt;&lt;i&gt;Selenium&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-6795514306307855404</id><published>2009-04-27T21:02:00.000-07:00</published><updated>2009-09-29T00:31:43.777-07:00</updated><title type='text'>GeoServer in Ubuntu</title><content type='html'>It's not difficult to setup Geoserver on your local Ubuntu by following these steps bellow:&lt;br /&gt;======================================&lt;br /&gt;&lt;code&gt;&lt;br /&gt;1./ install java&lt;br /&gt;2./ download binary Geoserver then unzip it in usr/local&lt;br /&gt;&lt;br /&gt;3./ edit file startup.sh:&lt;br /&gt; #PATH=/usr/sbin:/usr/bin:/sbin:/bin;&lt;br /&gt; #DESC="Description of the service";&lt;br /&gt; #NAME="geoserver";&lt;br /&gt; #SCRIPTNAME=/etc/init.d/$NAME;&lt;br /&gt;&lt;br /&gt; JAVA_HOME="/usr/lib/jvm/java-6-sun";&lt;br /&gt; #GEOSERVER_USER="geoserver";&lt;br /&gt; #GEOSERVER_DATA_DIR="/usr/local/geoserver/data_dir";&lt;br /&gt; GEOSERVER_HOME="/usr/local/geoserver";&lt;br /&gt;&lt;br /&gt;4./ to change default port 8080 to other by :&lt;br /&gt; edit file jetty.xml&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-6795514306307855404?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/6795514306307855404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=6795514306307855404&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/6795514306307855404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/6795514306307855404'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/04/geoserver-in-ubuntu.html' title='&lt;u&gt;&lt;i&gt;GeoServer in Ubuntu&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-228218856178051930.post-3633908121582383700</id><published>2009-04-21T18:37:00.000-07:00</published><updated>2009-09-29T00:31:56.189-07:00</updated><title type='text'>Mercurial</title><content type='html'>It's the way to access mercurial by hg command.&lt;br /&gt;======================================&lt;br /&gt;&lt;code&gt;Clone from webserver to local-1&lt;br /&gt;Clone from local-1 to local-2&lt;br /&gt;After modifying local-2 then &lt;br /&gt; "hg add filename/foldername"&lt;br /&gt; "hg commit and write file"&lt;br /&gt;Go back to local-1 then&lt;br /&gt; "hg pull ../local-2"&lt;br /&gt; "hg update"&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/228218856178051930-3633908121582383700?l=samneang-ngeth.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samneang-ngeth.blogspot.com/feeds/3633908121582383700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=228218856178051930&amp;postID=3633908121582383700&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/3633908121582383700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/228218856178051930/posts/default/3633908121582383700'/><link rel='alternate' type='text/html' href='http://samneang-ngeth.blogspot.com/2009/04/mercurial.html' title='&lt;u&gt;&lt;i&gt;Mercurial&lt;/i&gt;&lt;/u&gt;'/><author><name>samneang</name><uri>http://www.blogger.com/profile/05048964240052734132</uri><email>nsamneang@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15809074268166704071'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>