Skip to content

Mao Mao Dou Dou

Family

    • About

recent posts

  • who is your real friend
  • Dou Dou Study plan – P5
  • Mao Mao Secondary Study Plan
  • Scolding kids who bullied Chengyu
  • Middle Passage

about

  • Twitter
  • Facebook
  • Instagram
  • How to find out Port and Process details in Linux

    November 30, 2013

     

    netstat and ps
    netstat -tulpn | grep 3306

    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1138/mysqld

    ls -l /proc/3306/exe
    find out process details
    ps aux|grep 3306
  • What is the difference between JPA and hibernate?

    November 30, 2013

    JPA is a specification defined for java by sun. It does not provide any implementation. It was originally developed by EJB 3.0 software expert group, but it is not limited to EJB software components.

    Hibernate has an implementation of JPA.

  • How to setup A project with EJB, JPA and JSF in Linux JBoss

    November 30, 2013

    TBC

  • zip source code exclude svn files or git file

    November 30, 2013

    zip -r output.zip input -x “\*\*/.svn\*\*”
    zip -r output.zip input -x “\*.git\*”

  • Java: check a String is Integer value with regular expression

    November 30, 2013

    __str.matches(“\\\d+”);__
    d+ –> one or more digits
    It allows starting with 0, eg. 0000124

    __str.matches(“^[1-9]\\\d+”);__
    It doesn’t allow starting with 0

  • What you should know as a Software Engineer

    November 30, 2013

    Design Patterns and design principles
    Suggested to learn gang of four design pattern.

  • Oracle UCM: FolderStructureArchive problem – Folder out of sequence

    November 30, 2013

    Problem: Folder archive and replicated to target server are out of sequence

    Solution 1:
    Update the timestamp of collections record, this will trigger a new round of archiving.

    Solution 2:

    1. Go to content server -> Admin Applet -> Archiver;
    2. Open your archive in the list
    3. In the transfer to tab, disable automated transfer
    4. Made change in your collections record, then exam the batch file created.
    5. I found that in the batch view generated, one column is missing for the consumption server database.
    6. Add in the missing column.
    7. Re-test works.

  • VIM: clear file content

    November 30, 2013

    open the file
    press v
    shift + g
    press d

  • Remove index.php from URL

    November 30, 2013

    For Apache HTTP server, this can be done by turning on the URL rewriting engine and specifying some rewriting rules.
    Create .htaccess file and located it under project folder in webroot.

    RewriteEngine on

    \# if a directory or a file exists, use it directly
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    \# otherwise forward it to index.php
    RewriteRule . index.php

  • VIM: Save As

    November 30, 2013

    #####Save as in VIM, there are two ways – ( Assumed that I’m editing a.txt. )
    **:w b.txt** will write a.txt’s content to the file b.txt while keeping a.txt as the opened buffer in vim.
    **:sav b.txt** will first write a.txt’s content to the file b.txt, then close buffer a.txt, finally open b.txt as the current buffer.

Previous Page Next Page

Blog at WordPress.com.

  • Subscribe Subscribed
    • Mao Mao Dou Dou
    • Already have a WordPress.com account? Log in now.
    • Mao Mao Dou Dou
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar