четвъртък, 24 юли 2008 г.

Maven properties (build.properties) -Properties Reference



The properties files in Maven are processed in the following order:

  1. Built-in properties are processed
  2. ${basedir}/project.properties (basedir is replaced by the directory where the project.xml file in use resides)
  3. ${basedir}/build.properties
  4. ${user.home}/build.properties
  5. System properties
* build.properties stores the path of local repository too

The built-in properties are specified in the plugin.properties file of a plugin, or in defaults.properties within Maven itself.

Both the project.properties and build.properties files in the project directory are also inherited along with the related project.xml file.

The last definition takes precedence, so ${user.home}/build.properties will override anything specified in a project, and properties given on the command line using -D will override everything.

Note: there are no per-user defaults, as there has not been a property shown where this concept makes sense. Currently, there are also no site-wide defaults, however this is planned for future versions of Maven.

http://maven.zones.apache.org/~continuum/staging-sites/m1-core/maven-1.x/reference/properties.html

вторник, 22 юли 2008 г.

Protocol Buffers - Google's Data Interchange Format



Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages – Java, C++, C#, Python and Perl.

It is used everyone inside Google.
The initial version Proto1 was developed in Google starting in early 2001.
Proto2 is a complete rewrite, though it keeps most of the design and uses many of the implementation ideas from Proto1. Some features have been added, some removed. Most importantly, though, the code is cleaned up and does not have any dependencies on Google libraries that have not yet been open-sourced...

...
Do we write hand-coded parsing and serialization routines for each data structure? Well, we used to. Needless to say, that didn't last long. When you have tens of thousands of different structures in your code base that need their own serialization formats, you simply cannot write them all by hand.

Instead, we developed Protocol Buffers. Protocol Buffers allow you to define simple data structures in a special definition language, then compile them to produce classes to represent those structures in the language of your choice. These classes come complete with heavily-optimized code to parse and serialize your message in an extremely compact format. Best of all, the classes are easy to use: each field has simple "get" and "set" methods, and once you're ready, serializing the whole thing to – or parsing it from – a byte array or an I/O stream just takes a single method call...
...
And, yes, it is very fast – at least an order of magnitude faster than XML.


Links:
http://google-opensource.blogspot.com/2008/07/protocol-buffers-googles-data.html
http://www.infoq.com/news/2008/07/google-protocol-buffers
http://code.google.com/apis/protocolbuffers/

Effective Java programming v2

Today I have been decided to put in my blog examples and recipes from the book - Effective Java programming, v2

петък, 18 юли 2008 г.

Hot water freezes faster than cold water

Hot water freezes faster than cold water!

This is one of the most unintuitive natural observation, which to date has no known reasonable, nor scientific accepted explanation.

http://math.ucr.edu/home/baez/physics/General/hot_water.html

http://www.apnoia.org/ivantic/fizika/faq/hot_water.html

четвъртък, 10 юли 2008 г.

JUnit 4



http://www.vogella.de/articles/JUnit/article.html
http://wsgi.net/~espeak/junit_tutorial.html

Installing and test if junit works:
* set CLASSPATH drive:\junit-4.4;drive:\junit-4.4.jar (see if is set echo "CLASSPATH")
* drive:\>java -classpath %CLASSPATH% org.junit.runner.JUnitCore org.junit.tests.AllTe
sts

събота, 5 юли 2008 г.

Продажба / покупка на злато

http://www.fibank.bg/inside.php?language=1&parent=59
http://jwswealth.info/722A9356-A868-4C2A-B694-485E1CC6733B/B634E71A-76CA-41EC-97BE-9CB1BCEB3C6E/982597AF-E998-453E-BE2A-1D065B9FCDA0.html
http://www.novini.net/2008/02/blog-post_26.html

Май е по добре да купуваш злато от колкото да харчиш в казино?
Вие как мислете?

сряда, 2 юли 2008 г.

context menu dos prompt

If we want to access to a folder in DOS prompt, we normally run the cmd command and get to that folder. However, I have another way to access to it by right-clicking on folder and selecting Command Prompt in the menu. This is easy to create like creating “Copy to Folder” in context menu that I wrote long before. To see how to create “Copy to Folder”, click here. OK, let you follow the steps below.

* Open Registry Editor by running command regedit.
* Access to the path below,

HKEY_CLASSES_ROOT\Directory\shell

* Right click on the shell folder and choose New > Key.
* Name the new key Command Prompt.
* Right click on Command Prompt and choose New > Key.
* Name it Command.
* In the right page of the Registry Editor window, double click on the Default.
* Type Cmd.exe /k cd “%1″ then click OK
* Now you obtain Command Prompt in Context Menu, try right-clicking on a folder you want to get in.

Key words for uncle Google: context menu dos prompt
Source article: http://www.computerfreetricks.com/2007/11/26/create-command-prompt-in-context-or-popup-menu/