Sunday, August 07, 2005

InfoNode - a cOoL Swing GUI

http://www.infonode.net/ is an open-source project which provides very cool GUI:
  • (advanced) Tabbed panel
  • (super) Docking window
  • and also with a cool Look-and-feel

Just try, you will like it!

Saturday, August 06, 2005

No "unsigned" int. in Java, NOP!

Nop! wob!

After a long long time working with Java, now I have "discovered" that there really NO UNSIGNED integer type there! E'ry int., byte(8b), short(16b), int(32b) and long(64b) is signED one ! :-?

The more surprising thing is that, there is no pre-built method for casting signed one to unsigned one, either !

Friday, August 05, 2005

Big-endian Vs. Little-endian

The mnemonics are that:

  • big-endian = "big-end-first" : 0x0201 --> 02,01
  • little-endian = "litle-end-first": 0x0201 --> 01,02

Mostly because of the nature of World's languages and of the world-wide used Arabic-numeral system, the Internet Protocol defines a standard "big-endian" network byte order.

To summarize, here are the default endian-formats of some common computer architectures:

It is interesting that... the very terms big-endian and little-endian were taken from the Big-Endians and Little-Endians of Jonathan Swift's novel Gulliver's Travels, two groups of people in conflict over which end of an egg to crack in the voyage to Lilliput and Blefuscu.

Thursday, June 30, 2005

Java applets can communicate with each other easily !

There are 2 ways to do inter-applet communication:

  • the basic way is to use the methods getApplet(), getApplets() in java.applet.AppletContext. An AppletContext can be fetched using method java.appet.Applet.getAppletContext(). This way is only for applets on the same page.


  • the "trick" way is to use a (shared) public static reference to store the reference to this Applet object instance, then other applet can simply access this applet through this reference. This way is only for applets with the same codebase (codebase attribute in APPLET tag).


ref: An alternative way for applet-to-applet communication

Sunday, May 15, 2005

Java GUIs

Glazed Lists - A toolkit for list transformations: Sort & Filter, Display a list in a JTable, JList or JComboBox, ect.

Laziness, the virtue !

Color Schemes and UIDefaults: "We all know that laziness is a virtue (at least for a programmer). "

Thursday, May 12, 2005

"PRN" file name on Windows

Windows NT 4.0, 95, 98 (?) networked PRN flaw

I suppose that, in an effort to maintain reverse compatibility with
old MS-DOS command line gurus, you cannot create a file or directory
named PRN.xxx where the xxx is replacable with any extension.
Old style MS-DOS command line-ing would allow you to do the following
to print your autoexec file:
C:\>copy autoexec.bat prn
what this actually does is redirect the contents of autoexec.bat to
the port LPT1.
...

Wednesday, January 12, 2005

What is a "Lang Spec" ?

...a complete specification of the syntax and semantics of the language. We intend that the behavior of every language construct is specified here, so that all implementations will accept the same programs. Except for timing dependencies or other non-determinisms and given sufficient time and sufficient memory space, a program written in the Java programming language should compute the same result on all machines and in all implementations.


The Java Language Specification

Thursday, January 06, 2005

Drawbacks to XML

XML : Java Glossary: "The primary function of XML is to consume RAM and datacommunication bandwidth. Presumably it was promoted to its current frenzy by companies who sell either RAM or bandwidth. Others promoting it have patents they hope to spring on the public once it is entrenched..."

Sunday, December 19, 2004

The Billionth Prime...



After a long time waiting... Then the BILLIONTH PRIME has come !
p[1'000'000'000]=22'801'763'489

Friday, December 10, 2004

"Một nửa thế giới" với ngành CNTT

Tỉ mỉ, cẩn thận, tính ổn định cao... là những phẩm chất giúp người phụ nữ không thua kém gì nam giới trong lĩnh vực CNTT nói chung và làm phần mềm nói riêng. Nhưng thực tế, tỷ lệ phái yếu trong ngành rất khiêm tốn... !?
VnExpress - 'Một nửa thế giới' với ngành công nghệ thông tin

Google có phong cách CreatZy !

Để khuyến khích sáng tạo, Google thường tạo tự do tối đa cho nhân viên. “20% thời gian tại công ty, bạn được làm những gì mình cho là tốt nhất”, Page khẳng định.

Ngoài ra, không giống phần lớn các tập đoàn Mỹ, Google cho phép dắt chó vào phòng làm việc. Hãng lý giải họ thích không gian làm việc đông đúc, “với ba hay bốn nhân viên, cùng hàng loạt bàn ghế và lũ chó quây quần”. Điều đó “sẽ tăng lượng thông tin trao đổi và... tiết kiệm tiền sưởi ấm”.

VnExpress - Ông chủ Google khuyến khích nhân viên sáng tạo

Monday, November 29, 2004

Balanced trees

Red/Black Tree Demo applet
Red/Black Tree Demonstration: Maintenance Version
JAVA MODELS for behaviour of binary search trees: (SPL,R-B,AVL) This provide us a GREAT demonstration with fantastic graphics & sound & thinking & tree operations, but..... just a little large applet. Please wait for the first time loading it!

Wednesday, November 17, 2004

"MS-DOG"

30+ Reasons Why You Should Say MsDog and not MsDos:

*** You cannot make any file in form "prn.xxx"(xxx is arbitrary extension) ANY WHERE. Just because it has already stood for "printer" device!

- The read-only bits for directories are never used.
- You can rename files but not directories.
- Pipes, foo|bar, are implemented by >tempfile and <tempfile.
- You can open a file like c:\foo\..\config.sys even if you don't have a foo directory.
- Redirection doesn't work with batch files.
- Redirection doesn't work with the "For" command.
- You can only expand environment variables from batch files, not from the command line.
- The remainder of a "Rem" statement is not completely ignored. Rem > foo will create a zero-length file.
- Utilities like "sed" are not provided with MsDog so you cannot rely on users having them.
- and so on ...

Monday, October 25, 2004

Big O notation - Matters of notation

Big O notation - Wikipedia, the free encyclopedia:
The statement "f(x) is O(g(x))" as defined above is often written as f(x) = O(g(x)). This is a slight abuse of notation: we are not really asserting the equality of two functions. Here is a bad example:

O(x) = O(x2) but O(x2) ≠ O(x)

By this reason, some authors prefer a set notation and write f ∈ O(g), thinking of O(g) as the set of all functions dominated by g.
Furthermore, an "equation" of the form
f(x) = h(x) + O(g(x))
is to be understood as "the difference of f(x) and h(x) is O(g(x))".

In casual use, O is commonly used where Θ is meant, i.e., a tight estimate is implied. For example, one might say "heapsort is O(n log n) in average case" when the intended meaning was "heapsort is Θ(n log n) in average case". Both statements are true, but the latter is a stronger claim.

**) Here is a hint (and mnemonics) why Landau selected these Greek letters: "omicron" is "o-micron", i.e., "o-small", whereas "o-mega" is "o-BIG".


Sunday, October 24, 2004

Prime Number

from MathWorld:
Euler commented "Mathematicians have tried in vain to this day to discover some order in the sequence of prime numbers, and we have reason to believe that it is a mystery into which the mind will never penetrate" (Havil 2003, p. 163).

In a 1975 lecture, D. Zagier commented "There are two facts about the distribution of prime numbers of which I hope to convince you so overwhelmingly that they will be permanently engraved in your hearts. The first is that, despite their simple definition and role as the building blocks of the natural numbers, the prime numbers grow like weeds among the natural numbers, seeming to obey no other law than that of chance, and nobody can predict where the next one will sprout. The second fact is even more astonishing, for it states just the opposite: that the prime numbers exhibit stunning regularity, that there are laws governing their behavior, and that they obey these laws with almost military precision" (Havil 2003, p. 171).

Saturday, May 29, 2004

NetBeans, yet another Open-source Java IDE & JBean platform !!!

Welcome to NetBeans
* The NetBeans IDE is a development environment - a tool for programmers to write, compile, debug and deploy programs. It is written in Java - but can support any programming language. It is a free product with no restrictions on how it can be used.

* The NetBeans platform is an application runtime - a "generic large desktop application." Most desktop applications have common requirements - menus, document management, settings and so forth. Nobody enjoys writing menu code or setting storage code. With the NetBeans Platform, you don't have to. Just write modules to implement what you need, bundle them up with the NetBeans Platform, and you have a beautiful, branded, cross-platform application. And if you need custom functionality or components, the Platform is built to be flexible.

Saturday, May 01, 2004

[UML]: Architects & Software developers

Practical UML?: A Hands-On Introduction for Developers: "...Architects design buildings. Builders use the designs to create buildings. The more complicated the building, the more critical the communication between architect and builder. Blueprints are the standard graphical language that both architects and builders must learn as part of their trade.
Writing software is not unlike constructing a building. The more complicated the underlying system, the more critical the communication among everyone involved in creating and deploying the software. In the past decade, the UML has emerged as the software blueprint language for analysts, designers, and programmers alike. It is now part of the software trade. The UML gives everyone from business analyst to designer to programmer a common vocabulary to talk about software design."