Đăng bởi: Tiendq | 9-02-2010

Lucene.Net 101: What is Lucene.Net?

Lucene.Net is a most simple class-per-class, API-per-API port of the Lucene Java to the .NET platform in C# language.
Lucene.Net is always released in much slower progress than Lucene, currently the latest release of Lucene is 2.9.0 and Lucene.Net is 2.0.3, although you can always get the newer code directly from SVN, which now is tagged 2.3.2.
Lucene.Net community is quite inactive in compare with Lucene’s.
You can build Lucene.Net successfully and use it in an .NET 3.5 application without any error.
Lucene.Net is not an application itself, it is an open source search framework that provide your application search capability with little coding. But you definitely have to code indexing, searching functions as well as creating a fancy UI yourself.

Vậy là cách đây ít phút mình đã chính thức tuyên chiến trên toàn mặt trận với cái kiểu làm việc 4` ở một cty mà ai cũng biết là cty nào đấy :D . Cuộc chiến đã khởi đầu từ cách đây 02 tuần với một mặt trận rất nhỏ, tuy nhiên sau đó do sự thờ ơ thiếu can thiệp kịp thời của các nước có vị thế lớn hơn dẫn đến tình hình trở nên xấu đi, chiến tranh lan rộng sang các nước lớn hơn (và có quyền lợi liên quan). Trong lúc đó thì một liên minh HC-IT lại bất ngờ nhảy vào tham chiến, tình huống này là hơi bất ngờ, và mặc dù là lực lượng chênh lệch khá lớn (1 chọi > 3) tuy nhiên bên mình có các vũ khí hạng nặng là sự chuyên nghiệp, rõ ràng, và đứng trên quyền lợi chung nên không có ngán gì hết, chơi luôn.

Dù biết rằng chiến tranh là không hay ho gì, các bên đều thiệt hại ít nhiều, mình vốn yêu hoà bình, nhưng thực sự thì “ta càng nhân nhượng thì thực dân Pháp càng lấn tới”, không trì hoãn được lâu hơn nữa.

Hiện tại các nước lớn nhất vẫn giữ thái độ im lặng  ”toạ sơn quan hổ đấu”, chưa biết tình hình sẽ tiếp diễn như thế nào. Kịch bản thường thấy, rất có thể xảy ra, là sẽ đàm phán để hoà hoãn và chìm xuồng dần theo thời gian. Các nước lớn không thể hay không muốn giải quyết dứt điểm nguồn gốc xung đột sẽ luôn là câu hỏi không có phần trả lời?

Mình đang đá pressing toàn sân, thỉnh thoảng thi đấu thể thao phát cũng thích heheheh :D

Life is not easy :)

Sau vài lần định mua một cái desktop mới để thỉnh thoảng xem mấy cái phim HD, nghe ít music, slideshow mấy cái photo, chơi ít game… (+ tăng độ utilization của cái TV mà đang chỉ thằng Gấu xem Bibi là chính :D ) tóm lại là toàn nhu cầu linh tinh @ home cho cả mình và thằng Gấu. Mấy lần vẫn chưa mua được vì cứ lắm options quá, rối mù cả lên. Cho đến sáng nay thằng Dũng nó mới bảo là anh mua cái x nào chẳng được, cứ ra chọn thích cái nào thì lấy, lởm như nhau ấy mà hê hê :D .

Thế là chiều nay lòng vòng cuối cùng mua ở bạn Pico Plaza, mấy lựa chọn ban đầu là mấy model Elead, eMachine nhỏ gọn hay HTPC của SPC với lại Phúc Anh bay mẹ nó đâu mất. Mua đúng cái chưa biết đến bao giờ :D .

Giờ đang cài quả Windows 7 Ultimate bản MSDN của thằng HùngNĐ cho nó máu, trong lúc cài thì Google phát thấy quả review của PC World VN cũng tàm tạm, vớ vẩn mai xem phim HD mà hình nó lại nhảy như phê thuốc lắc thì bỏ mẹ :D .

Thông tin chi tiết chi tiết cấu hình xem ở đây – Compaq Presario CQ4011L Desktop PC.

Update: HD movie capability is tested with Bee Movie, passed :)

Đăng bởi: Tiendq | 6-02-2010

Hội với chẳng chợ, nhí nha nhí nhố

Hôm trước vô tinh đọc đâu đó thấy cái tin này “Hội chợ Tết Việt 2010” (hội chợ 4`), thấy quảng cáo tùm lum thấy hay hay thế là cho ông nhóc đến đấy xem Tết truyền thống dân gian xưa nó thế nào. Hoá ra là nhí nhố, đưa tin bố láo ăn cắp, viết lăng nha lăng nhăng, hội chợ cái x gì mà lèo tèo mấy gian hàng, vài chục nhân viên, và khéo chưa được chục mống khách (đang ngày thứ hai/3 ngày). Mất công đi ra tận sân đấy thôi cũng phải cho thằng nhóc nó vào chạy loăng quăng tí.  Giờ nhìn lại cái link trên mới thấy bố của 4`, đến cái hình minh hoạ cũng không kiếm nổi một cái nào ra hồn.

Ngứa tay thôi cũng móc máy ảnh ra làm vài kiểu lấy hình minh hoạ cho blog vậy :) , chắc mấy đứa nhân viên nó tưởng mình dở hơi, có cái x gì đâu mà ảnh với ọt :D .

Toàn cảnh hội chợ, vắng hoe.

Và đây là hai vị khách hiếm hoi của hội chợ

Đăng bởi: Tiendq | 6-02-2010

Reading ebook on an iPod Touch

I’ve read eBooks on my Nokia E61, and its newest model Nokia E71 for now but their limited screen size is really an issue with my eyes (I’ve already worn a 3 diopter prescription glasses :D ). Suggested by Cuong, my former boss :) , an iPod Touch with 3.5 inches large – high resolution – true color screen and Kindle Reader application is really a great device for reading ebook, anywhere, anytime :D . I decided to replace my most favorite Nokia E71 today by an iPod Touch and a small/simplified Nokia 1202 mobile phone :D

Update: 1202 function is too limited, for example, I can’t sync. address book with Outlook so I replaced it by a new Nokia 6300 recently.

Đăng bởi: Tiendq | 5-02-2010

C# Naming Convention

One of the tasks that I often add to my to-do list at starting time of a new project is defining a project standard naming convention. The most useful source that I’ve always asked team members to refer to is MSDN’s Design Guidelines for Developing Class Libraries. Although its name is likely only for libraries, it is still a good reference for writing any piece of code in C#. You can also google for tons of free convention guidelines but most of them is long and mixed with personal style of the author so they are often not suitable for us, for example I really don’t like underscore in member field names even I was a C++/MFC programmer before .NET comes to the market. Inspired with a blog post that I’ve read somewhere before, I’d write a snippet of code that shows most common type of conventions which we use every day as a C# developer. I could not google that post again and just send its link to my team because it promoted underscores :) . Hopefully I will no longer have a chance to read code that written in several conventions from Java, VB, C# worlds all in a class.

   1: using System;
   2: 
   3: // All name spaces are PascalCased.
   4: namespace HappyProgramming.CSharpNamingConvention
   5: {
   6:     // Enum is PascalCased and singular. [Flags] enum is plural.
   7:     public enum VehicleType
   8:     {
   9:         Bus,
  10:         Train,
  11:         Boat,
  12:         Bycycle,
  13:         Motorbike
  14:     }
  15: 
  16:     /// <summary>
  17:     /// This is class header comment. Class name is PascalCased.
  18:     /// </summary>
  19:     public class NamingExample
  20:     {
  21:         // All public fields, including constants are PascalCased.
  22:         public const int MaxSpeed = 100;
  23: 
  24:         // All private fields are camelCased.
  25:         private DateTime createdDate = DateTime.Now;
  26: 
  27:         // All properties are PascalCased.
  28:         public DateTime CreatedDate
  29:         {
  30:             get { return createdDate; }
  31:             set { createdDate = value; }
  32:         }
  33: 
  34:         /// <summary>
  35:         /// This is method header comment.
  36:         /// All methods are PascalCased and start with a verb. All parameters are camelCased.
  37:         /// </summary>
  38:         /// <param name="routeName"></param>
  39:         /// <param name="vehicleType"></param>
  40:         public void CalculateAverageSpeed(string routeName, int vehicleType)
  41:         {
  42:         }
  43:     }
  44: }
Đăng bởi: Tiendq | 3-02-2010

Bad code, ugly code, and stupid code

I’ve conducted several thoroughly code review since last week, although adding cache support is most focused in these reviews, I couldn’t ignore low quality code snippets that our developers made with current code base. There are many pieces of code that duplicated itself, has completely no comment, mixed coding convention (there are even many coding styles in just a class ;) ), inefficient implementation of business rule, messy code ordering, long comment out code…

For example, we found this method yesterday that contains some coding issues:

1         /// <summary>

2         /// Gets the count item on page.

3         /// </summary>

4         /// <returns>top numberitemperpage for search</returns>

5         public string getCountItemOnPage(string viewDataKey)

6         {

7             string strvalue = string.Empty;

8             config = (PagingSortingConfig)configRepository.GetConfigData(viewDataKey,typeof(PagingSortingConfig));

9             pagingSortingViewData.Config = config;

10

11             foreach (string item in config.NumberPagingItem)

12             {

13                 strvalue = (string)item;

14                 break;

15             }

16             //return count item top of list number item per page (ex. [25, 50] then select 25…)

17             return strvalue;

18         }

1. Method name is camel-case so it doesn’t follow standard C# coding convention.
2. The first three lines can be replaced by a method that do exact same thing in the same class to increase reusability.
3. The variable strvalue doesn’t neither follow C# coding convention nor Hungarian style in old time (it makes you remember VB code).
4. Do you know why is there a strange foreach here that doesn’t have any comparison and break immediately in the first loop? I completely don’t know what the reason is, but I can guess that the developer lack both ability and attitude to write good code.
5. In the loop, is it necessary to cast a string into another string?
6. Is it appropriate to return a “number” value in string data type?
7. And you can hardly be aware that this method will change the global variable pagingSortingViewData.Config.

Đăng bởi: Tiendq | 3-02-2010

Links (re-post)

Tối qua mới thấy cái đoạn quảng cáo ăn theo tích thách cưới trong truyện Sơn Tinh – Thuỷ Tinh dài lê thê mà lại chẳng thấy có khỉ gì là creative của mấy bạn này (không hiểu là thuê cty quảng cáo nào làm cái clip này, mấy cty quảng cáo hay có chức danh Creative Director, ông CD nào mà nghĩ ra cái clip này thì nếu nhận là creative thì đến bò nó cũng phải cười, vớ vẩn lại đi cả hàm trên giống trâu trong một chuyện cổ tích của VN ấy chứ :D ).
Quảng cáo đã chuối, chỉ tổ béo các bạn truyền hình cứ đếm giây ăn tiền, đến cuối cùng mới biết hoá ra là sản phẩm thạch sữa chua Natty, không hiểu lúc nghĩ cái tên ra có chịu… thinking một tí không, chứ cứ cái này mà táng lên thì nghe/viết dễ nhầm sang nasty bỏ bố, bố bảo đứa nào dám ăn, hố hố :D
Đăng bởi: Tiendq | 8-08-2009

Tiendq.com

You’re welcome to visit my new home at http://www.tiendq.com :)

Bài viết cũ hơn »

Chuyên mục