4/24/2014

Maven sources

# mvn dependency:sources
# mvn dependency:resolve -Dclassifier=javadoc

1/08/2014

Maven Tips and Tricks: Advanced Reactor Options

Source: http://blog.sonatype.com/2009/10/maven-tips-and-tricks-advanced-reactor-options
Docs: http://maven.apache.org/plugins/maven-reactor-plugin/examples.html


Starting with the Maven 2.1 release, there are new Maven command line options which allow you to manipulate the way that Maven will build multimodule projects. These new options are:
-rf, –resume-from
    Resume reactor from specified project
-pl, –projects
    Build specified reactor projects instead of all projects
-am, –also-make
    If project list is specified, also build projects required by the list
-amd, –also-make-dependents
    If project list is specified, also build projects that depend on projects on the list

5/15/2013

Learn English by Listening





source

 ... если вы хотите набрать словарный запас и перенять американские обороты речи, то я советую вам каждый день одевать наушники и час-полтора гулять по улицам или природе, прослушивая американские non-fiction книжки.

После пары лет таких занятий канонические американцы вас со своими не перепутают, но вот русские начнут утверждать, что вы не сами пишите тексты по английски, а ваши англоязычные комменты в интернете - копипаста.

Примеры книг для занятий такого рода - лекции по истории науки, популярные книжки по экономике, маркетингу, геологии, истории и т.д.

Художественная литература для этого не очень - речевые обороты из какого-нибудь Walden by Henry David Thoreau - не имеют никакого отношения к манере речи в научном, инженерном или бизнес-коммьюнити.

Примеры рекомендуемых мною книжек для занятий такого рода с audible.com:

Популярная геология - Basin and Range by John McPhee
История компьютеров - ENIAC by Scott McCartney
Популярная палеонтология - The History of Life by Michael J Benton и Your Inner Fish by Neil Shubin
Лекции по истории науки - нудно, но ставит интонацию американского лектора -
The History of Science by Professor Michael Shermer
Маркетинг - All Marketers Are Liars by Seth Godin
Полезная книжка как писать ясно - On Writing Well by William Zinsser

12/14/2012

Conf Calls Howtos

 Do you keep falling asleep in meetings and seminars? What about those long
 and boring conference calls? Here's a way to change all of that.

 1. Before (or during) your next meeting, seminar, or conference call,
 prepare yourself by drawing a square. I find that 5x5" is a good size.
 Divide the card into columns-five across and five down. That will give you
 25 one-inch blocks.

 2. Write one of the following words/phrases in each block:
 * synergy
 * strategic fit
 * core competencies
 * best practice
 * bottom line
 * revisit
 * expeditious
 * to tell you the truth (or "the truth is")
 * 24/7
 * out of the loop
 * benchmark
 * value-added
 * proactive
 * win-win
 * think outside the box
 * fast track
 * result-driven
 * empower (or empowerment)
 * knowledge base
 * at the end of the day
 * touch base
 * mindset
 * client focused)
 * paradigm
 * game plan
 * leverage

 3. Check off the appropriate block when you hear one of those
 words/phrases.
 4. When you get five blocks horizontally, vertically, or diagonally,
 you must stand up and shout "BULLSHIT!"

 Testimonials from satisfied "BullShit Bingo" players:
 * "I had been in the meeting for only five minutes when I won."- Adam W.,
 Atlanta
 * "My attention span at meetings has improved dramatically."- David
 T.,Florida
 * "What a gas! Meetings will never be the same for me after my first win." -
 Dan J., New York City
 * "The atmosphere was tense in the last process meeting as 14 of us waited
 for the fifth box." - Ben G., Denver
 * "The speaker was stunned as eight of us screamed 'BULLSHIT!' for the third
 time in two hours."-Bob Q., Indianapolis
 

10/18/2012

Null, null, Nil, Nothing, None, and Unit in Scala

Null- is a subtype of all reference types; its only instance is the null reference. Since Null is not a subtype of value types, null is not a member of any such type.
null- Is an only instance of Null. Similar to Java null.
Nil- Represents an emptry List of anything of zero length. Its not that it refers to nothing but it refers to List which has no contents.
Nothing is a subtype of every other type (including scala.Null); there exist no instances of this type.
None This case object represents non-existent values. Just to avoid null pointer exception. Option has exactly 2 subclasses- Some and None. None signifies no result from the method.
Unit - There is only one value of type Unit, (), and it is not represented by any object in the underlying runtime system. A method with return type Unit is analogous to a Java method which is declared void.
Note: Any is supertype of AnyRef and AnyVal. AnyRef is the supertype of all the reference classes (like String, List, Iterable) in scala. AnyVal is the supertype of all the value classes (like Int, Float, Double, Byte, Short..). Null is a subtype of all the reference classes. null is its only instance. Nothing is subtype of every other type i.e of reference and value classes.
Think- AnyRef == Object in Java.
The above is a breif summary of a wonderful post by Matt Malone where he has explained all these concepts in depth with examples. Read the blog post here.

9/26/2012

Wrapping the call in Seam contexts

http://seamframework.org/Documentation/ReplacingServletsWithSeamResources#H-WrappingTheCallInSeamContexts

1. You can map the <web:context-filter/> in components.xml to wrap all calls on a particular URL pattern, see reference documentation.

2. You can wrap a call manually in a particular Servlet:

class MyServlet extends HttpServlet {

    protected void service(final HttpServletRequest request, final HttpServletResponse response)
            throws ServletException, IOException {

        new ContextualHttpServletRequest(request) {
            @Override
            public void process() throws Exception {
                doWork(request, response);
            }
        }.run();
    }

    private void doWork(HttpServletRequest request, HttpServletResponse response) {
        Component.getInstance(...);
    }

}