RSS

Author Archives: ភិរម្យ

working with GIT

Add to local memory first before commit (because you might not want to commit something that you dont’ want, so add something you want, and then commit)
>git add /your_resource_to_add

Commit to local repository, all the sources you have added
> git commit -a -m “Message to commit”

Then you need to pull rebase from server to match and see if there is conflict on this project.
> git pull –rebase

(if there is any error, you need to solve, if not then push to server)
I am not sure if you server install gerrit or not, the code review.
to push to server using
> git push

NOTE: if there is at least an error, you need to solve it, and then add again
> git add /add_any_files_you_have_solve

and to clear conflict by
> git rebase –continue

 
បញ្ចេញមតិ

បានចុះផ្សាយដោយ ៖ ​នៅ ខែវិច្ឆិកា 29, 2013 in គ្មាន​ចំណាត់ក្រុម

 

Add linux unity launcher

It is important to install gnome-panel using the following command, so as not to install the recommended not-needed packets along with it. So open a terminal using Ctrl+Alt+T and give the following command:

sudo apt-get install --no-install-recommends gnome-panel

It will ask you for your login password, which you have to fill (nothing will be shown, not even asterisks (*)) and press enter.

Without closing the terminal window, after the installation process is over, you have to type the following command:

gnome-desktop-item-edit ~/Desktop/ --create-new

where ‘~/Desktop/’ is any directory you want your launcher to appear, after its creation process is over. After running this command, a familiar window will pop-up, which lets you fill the Name, the Command and the Comment for your launcher. Also, you can specify an icon for your launcher by clicking on the big icon of the window on the top left of it.

You can also use ‘alacarte’, which you can execute by searching in the Dash for ‘Main Menu’ and once the application launches, then you click on “New Item” on the section you want your application to be. Then a window similar to the one being shown using the gnome-panel method will be shown.

Source: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles

 
បញ្ចេញមតិ

បានចុះផ្សាយដោយ ៖ ​នៅ ខែវិច្ឆិកា 27, 2013 in ចែករំលែក, Linux

 

Change java jre environment on linux

I assume you have already java installed.

1/ using command “whereis java”, you should see this directory “/usr/bin/java”

2/ Go to “cd /usr/bin”, and run command “sudo unlink java”

3/ link your environment by running command “sudo ln -s /{Your_java_Path}/jre/bin/java java”

4/ Verify works by running “java -version”

For my environment out put is:

java version “1.7.0_25”
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

 
បញ្ចេញមតិ

បានចុះផ្សាយដោយ ៖ ​នៅ ខែវិច្ឆិកា 26, 2013 in ចែករំលែក, JAVA, Linux

 

Expose Session to FreeMarker for create and get session in Spring

I have been searching a lots about an hour and I found some sites that explain how to expose session to FreeMarker Framework.

1. In View resolver for  Freemarker configuration, just need to enable the exposeSession to True.

<bean class=”org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver”>

<property name=”suffix” value=”.ftl” />
<property name=”contentType” value=”text/html” />
<property name=”exposeRequestAttributes” value=”true” />
<property name=”exposeSpringMacroHelpers” value=”true” />
<property name=”exposeSessionAttributes” value=”true” />

</bean>

2. In Java controller we will create a session like this.

 

public static HttpSession createSession(HttpServletRequest request, HttpSession session){

session.invalidate();
HttpSession newSession = request.getSession();
newSession.setAttribute(“user”, user);
return session;
}

3. in View Freemarker we just use the “user” object that we have exposed from Controller.

${user.getFirstName()}

 
បញ្ចេញមតិ

បានចុះផ្សាយដោយ ៖ ​នៅ ខែ​កុម្ភៈ 25, 2013 in ចែករំលែក, JAVA

 

Java script only numbers are allow in text box field

<script>
function isNumberKey(evt){

var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;

return true;
}
</script>

 
បញ្ចេញមតិ

បានចុះផ្សាយដោយ ៖ ​នៅ ខែវិច្ឆិកា 16, 2012 in គ្មាន​ចំណាត់ក្រុម

 

Get real path for folder in spring

//In order to get the real path of one folder in Spring we need to use context.getRealPath()

ServletContext context = request.getSession().getServletContext();
String imagePath = (String) context.getRealPath(“/images”);

//if you stay on local like me you will see this result after print imagePath

C:\Projects\SVN\TestingService\trunk.eclipse\src\main\webapp\images

 
បញ្ចេញមតិ

បានចុះផ្សាយដោយ ៖ ​នៅ ខែតុលា 4, 2012 in ចែករំលែក, JAVA

 

Tips you should not do with communication tools

Hey guys, this is not a must that you have to do, it is a tips which is consider as Objective (Objective=something people see the same in general not the only one opinion ) it is not a subjective that is thinking by me only.

here is the things you should not go through.

1/ Should not say only “Hi” and waiting them to reply back hi 
–  this means if you have something to talk about or asking, type the question in that greeting message. And I am 1000% sure that an expat (foreigners) doesn’t like this at all, and in my company we got one tips from out boss also about this. look like not professional at all, like a kids try to play around with Skype.

2/ Try to type a complete meaning before press”Enter”
– Imagine that you talk with a group of people or even only 1 person. And you all type with a little piece of sentence and enter, for example :

[Pherum]: hello friend
[Martin levis]: hello I also have one question
how can I install Linux on windows
without using VMware?
[Pherum]: I want to ask you one question.
[Jonh harves]: but this is not the best problem at all.
[Pherum]: how can I make this thing work
[Lovely girl]: how can we solve this Jonh?
[Pherum]: if I never know how to configure it
[Pherum]:and I really not sure what this mean

See this if you talk in group of at least 10 people like me. Someone might interrupt the talk. And those entire questions of PHERUM becoming meaningless, because they don’t understand what a little piece of separate sentences are. It take much time to investigate what pherum mean.

3/ If you see someone typing let them finish
– let them finish their writing, maybe they want to give more info that you willing to ask. Amazing if you talk in group then if you only type what you want to type without waiting to see your partner reason, then you both or group not understand each other. Otherwise it becoming like number 2.There should be many things more you can think of about being a professional 😉

 
បញ្ចេញមតិ

បានចុះផ្សាយដោយ ៖ ​នៅ ខែសីហា 30, 2012 in ចែករំលែក, សកម្មភាពជីវិត

 

Install module in linux SERVER

Run this command to install some module in your linux server

a2enmod

then type module name you want to install.

 
បញ្ចេញមតិ

បានចុះផ្សាយដោយ ៖ ​នៅ ខែមិថុនា 8, 2012 in ចែករំលែក

 

My virtual host

My virtual host

<VirtualHost *:80>
ServerAdmin technical@server.com
ServerName servername.local
DocumentRoot /var/www/phones
AcceptPathInfo On
AddOutputFilterByType DEFLATE text/html text/plain text/xml
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

<Directory /var/www/phones/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

ErrorLog /var/log/apache2/phones_error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/myphones.access.log combined
ServerSignature On

</VirtualHost>

 
បញ្ចេញមតិ

បានចុះផ្សាយដោយ ៖ ​នៅ ខែ​ឧសភា 31, 2012 in គ្មាន​ចំណាត់ក្រុម

 

confirmation when close broswer

html

<body  onbeforeunload=”return HandleOnClose()” >

java script:

  1. function HandleOnClose()
  2.  {
  3.   if (confirm(‘Do you want to leave’))
  4.          return true;
  5.   else
  6.          return false;
  7. }
 
បញ្ចេញមតិ

បានចុះផ្សាយដោយ ៖ ​នៅ ខែ​ឧសភា 4, 2012 in Java script

 
 
Design a site like this with WordPress.com
Get started