Archive

Author Archive

Vim tips and tricks

August 4, 2011 Leave a comment

Dạo này mình có thói quen sử dụng vim để view, edit hơn là dùng các editor khác, quả thực là nó gọn nhẹ, dễ dùng và thực sự flexible.

Mình sẽ note lại một số options mà mình hay sử dụng với vim

  • Trước tiên là tính năng indent khi edit source code, đây là option mình sử dụng nhiều nhất khi dùng vim vì tất cả các IDE đều support điều này.
    • :set smartindent – Mặc định, khi enter xuống dòng trong vim, sẽ tự động trở về vị trí đầu tiên của line, vì thế có thể sử dụng option này để cursor trở về đúng vị trí mong muốn.
    • :set shiftwidth=4 – Với chế độ mặc định, chức năng auto indent sẽ shift cursor sang trái hoặc phải 1 tab, sử dụng option này để shift 4 spaces thay vì 1 tab.
    • :set expandtab – Sử dụng spaces thay cho 1 tab, mặc định sẽ là 8 spaces,
    • :set tabstop=4 – Định nghĩa số spaces sẽ thay cho 1 tab, trong trường hợp này, khi ấn tab, sẽ là 4 spaces
  • Trong 1 file source code, có thể format bị sai, nên cần fai reformat cho cả file, có thể sử dụng = để format theo như những option đã được set ở trên. Ngoài ra, để chọn 1 vùng text, ấn V key, và dùng up, down, left, right key để select vùng cần chỉnh sửa, sau đó ấn = để re-format.
Categories: Uncategorized

GateIn document nightly build version

Recently, I had so much questions about new GateIn document such as how to configuration SSO, Portal navigation … although there are some updates for them in the development version. And today, I decide create a site for GateIn document nightly build version, it’s updated daily or whenever has updates, if you’re developer, administrator or user who want to find out how to use, configure the GateIn development version, don’t wait for new release, checkout now and use nightly build document version at here

  • Reference guide
    • HTML documentation with one page per chapter here
    • HTML documentation all in one page here
  • User guide
    • HTML documentation with one page per chapter here
    • HTML documentation all in one page here
Categories: GateIn, OSS

How to post source code on wordpress.com

Now, developer completely post source code block on a post by using
sourcecode tag in the post
For example, I want to post a JavaScript block

function test() {
   alert('this is only testing');
}
Categories: ICT News

Cài đặt và sử dụng GateIn portal

1. Giới thiệu GateIn portal
Portal, cổng thông tin, cổng thông tin điện tử tích hợp, … những cụm từ này chắc chắn chúng ta đã từng nghe đến nhưng chính xác khái niệm này như thế nào và ứng dụng nó ra sao thì không phải ai cũng nắm rõ. Bây giờ chúng ta thử phân tích một số khía cạnh để hiểu rõ hơn về portal như thế nào?
Categories: GateIn, OSS

eXo Noel Party

December 29, 2010 Leave a comment

Thế là một mùa Noel nữa lại đến, không khí tràn ngập trên đường phố, đây đó những âm thanh Xmas quen thuộc vang lên, thi thoảng bạn lại gặp trên đường một ông già noel đang trên đường đi làm ¨nhiệm vụ¨…Không khí chào đón năm mới đang tràn ngập khắp nơi và ở eXo cũng không ngoại lệ. Trước tiên, văn phòng công ty được trang hoàng bởi các eXoer từ hàng tuần trước đó. Các thành viên eXo tự tay làm những đồ trang trí xinh xắn để gắn lên cây thông giữa văn phòng và trang hoàng góc làm việc của mình. Tối ngày 23, công ty tạo điều kiện tổ chức một bữa tiệc nhỏ thân mật giữa các thành viên của đại gia đình eXo. Mở màn là vài lời tổng kết hoạt động năm 2010 của Tổng Giám Đốc eXo SEA, ông Brice Revenant.

Read more…

Categories: Uncategorized

How to disable Alt + drag in ubuntu

October 29, 2010 Leave a comment

Today, i encounter a problem with alt + drag to move a window to other place, IntelliJ supports viewing object tree while are debugging by press alt and left click.

This tutorial will lead you to disable Alt and right click key

First,go to System–>Preferences–>Windows

At Movement key: We select Super (or “Window logo”) instead of Alt

 

=>> successfully 🙂


Categories: My Day

Lâu…

Đã lâu rồi chẳng viết lách j trên blog này cả, mà nghĩ cũng chẳng có gì nhiều mà viết. Càng lúc càng thấy sống nhanh hơn, nhanh hơn trong cách nghĩ, và ngay cả trong cách viết. Đến status trên facebook cũng còn ngại viết, chỉ quen với twitte thôi, với 140 ký tự thì làm sao mà đủ nhỉ, thành ra cứ có j xảy ra, là lại tw 1 cái. Nghĩ cũng hay hay

Categories: My Day

Comparing between Guice and PicoContainer

  • Guice

The first thing u’ll notice is that Guice makes extensive use of Java 5 language features. ie, generics and annotations. While generics lead to the extraordinary type safety mentioned by Kevin Bourrillion, annotations couple your code to the Guice framework. If u’ve really picky about loose coupling you might ask why you should use a framework that adds a dependency to itself? You end up with lots of imports of the Inject annotation scattered all over your code base. And it’s getting worse if you have to use Singleton, ImplementedBy and so on and so forth. You may want to define that elsewhere because your classes shouldn’t know any thing about their usage or where dependencies should be Inject – That’s what inversion of control is all about, isn’t it :).

However, for those who aren’t so pickly there are some really cool things about Guice:
– it is type safe
– it reports same error messages
– it is small and very fast

Well it is really type safe: if you ask Guice to give you an object of type Bar, it’ll do so – no cast to Bar required. The authors of Guice don’t want it to be used as a simple service locator for a good reason: your code would still be coupled very tightly. That being said you want to call Guice only in some places in your code where it hand you a top-lever class where all the dependencies are injected. Whether you’ll have to do a cast on these few occasions shouldn’t be that bad; this puts the big feature of type safety into another perspective (read: isn’t that important). But this is definitely a plus for Guice though.

Reasonable error messages are one point for Guice: if something goes wrong you can identify the problem easily. From a user’s perspective this should be the case anyway but Guice manages this very well – as far as I noticed it.

  • Pico Container

PicoContainer is a nice piece of software that facilitates dependency injection without much overhead: no external configuration files (read XML files) and no annotations needed. All you have to do is register your components with the container; for small projects this is an effortless thing.

As with Guice you write everything in Java and can reap the benefits of your IDE’s refactoring capabilities: if you change a class’s name all references will be changed too

Categories: Java

…….

February 23, 2010 1 comment

Cảm giác
Lạ lắm
Buồn lắm
Xa xăm
Sâu thẳm
………
Quặn thắt

Categories: My Day

Programming Styles

January 26, 2010 Leave a comment

Over the years I’ve met many developers and got to know many different programming styles. Here are some of the odd ones. Do you know someone like that?

Shotgun Programming

It is a programming style where the developer tries random shots at the code. “Well, this method call is failing…. I’ll try changing this parameter from false to true!” Then of course it doesn’t work and the developer goes: “Well, maybe I could just comment out the whole method call!” and so on. It can go on forever until it works by pure chance or the developer is rescued by a peer who points the correct solution.

A regular developer can go crazy in a few hours if he finds himself pairing with a shotgun programmer. It can drive you NUTS. Two shotgun programmers should never do pair programming together, because their destructive results are magnified when they work together.
Read more…

Categories: Software Development