Wednesday, May 26, 2010

Learning

A Chinese saying:

I hear and I forget

I see and I remember

I do and I understand

 

Try to make sure your study is uninterrupted. You will need to find both the time and place where you can study.

 

It is important to remember that learning is not a race – everyone learns at their own rate. So don’t rush your leaning – make sure you get the most from the book.

-          An introduction to derivatives

Friday, May 21, 2010

Searching for more proof is futile. Searching for more determination makes more sense.

“That's the way a friend described someone she had just met. She was sure (just as I'm sure) that he's going places. Once the determination is in his eyes, the learning will take care of itself.

On the other hand, if I can see the fear in your eyes, then I'm not sure that learning alone will take care of the problem. No one can prove that the path you're on is risk free or guaranteed to work. Searching for more proof is futile. Searching for more determination makes more sense.”

-       Seth Godin

Thursday, May 20, 2010

Tuesday, May 18, 2010

Multiple tabs in gvim

The following will open all xml files found in the current directory (and its sub-directories) in multiple tabs in gvim

 

$ find . -name '*.xml' | xargs gvim -p

Thursday, May 13, 2010

The ability to choose who judges your work...is the key building block in becoming an artist in whatever you do.

Here's the mistake we make in high school:

We let anyone, just anyone, judge our work (and by extension, judge us.)

Sue, the airheaded but long-legged girl in Spanish class gets the right to judge our appearance.

Bill, the bitter former-poet English teacher gets the power to tell us if we're good at writing.

And on and on.

The cheerleaders are deputized as the Supreme Court of social popularity, and the gym teacher forever has dibs on whether or not we're macho enough to make it in the world. These are patterns we sign up for, and they last forever (or until we tell them to go away).

In high school, some people learn to ship, they learn to do work that matters and most of all, they learn to ignore the critics they can never possibly please. The ability to choose who judges your work--the people who will make it better, use it and reward you--is the key building block in becoming an artist in whatever you do.

-          Seth Godin

Wednesday, May 12, 2010

HTTP Debugging Proxy

To see the requests (http and ajax) being made from browser to server: FiddlerTool

 

 

Tuesday, May 11, 2010

Every moment of life is a new beginning point as we move from the old

“In the infinity of life where I am, all is perfect whole, and complete, and yet life is ever changing. There is no beginning and no end, only a constant cycling and recycling of substance and experiences. Life is never stuck or static or stale for each moment is ever new and fresh. I am one with the very Power that created me, and this Power has given me the power to create my own circumstances. I rejoice in the knowledge that I have the power of my own mind to use in any way I choose. Every moment of life is a new beginning point as we move from the old. This moment is a new point of beginning for me right here and right now. All is well in my world.”

~ Louise Hay (You Can Heal Your Life) through thinksimplenow

 

Thursday, May 06, 2010

To the change to comment/log on a existing svn revision

svn propset svn:log --revprop –r <revision_no> “<new_comment>”

can

“Your biggest challenge isn’t someone else. It’s the ache in your lungs and the burning in your legs, and the voice inside you that yells ‘CAN’T’. But you don’t listen, you just push harder. And then you hear the voice whisper ‘can’, and you discover that the person you thought you were is no match for the one you really are.”

- Author Unknown through Julie911

a born-pretty girl

“You take a born-pretty girl and you dress her up in pretty things, curl her pretty hair and she becomes empty. Vacuous. The only thing she can claim as a self identity is her one dimensional beauty. But take a pretty girl and throw some shit on her, and make her fight her way out of it and she’ll grow to be other-worldly radiant and a force to be reckoned with.”

- Beautiful, Depraved through Julie911

Some questions don't have answers, and that's a difficult lesson to learn.

“Some questions don’t have answers, and that’s a difficult lesson to learn.”

- Katherine Graham

You are braver than you believe, stronger than you seem, and smarter than you think

“If ever there is tomorrow when we’re not together, there is something you must always remember. You are braver than you believe, stronger than you seem, and smarter than you think. But the most important thing is, even if we’re apart, I’ll always be with you.”

- A. A. Milne through Julie911

the next try will be the right one

“No matter how big and tough a problem may be, get rid of confusion by taking one little step towards solution. Do something. Then try again. At the worst, so long as you don’t do it the same way twice, you will eventually use up all the wrong ways of doing it and thus the next try will be the right one.”

- George F. Nordenhold through Julie911

Tuesday, May 04, 2010

Migrating JSF 1 composition components to JSF 2

In JSF 1, composition components are defined using <ui:composition>. The “template” attribute of ui:composition is optional. Meaning the composition component can opt to confirm to a template or not. So these components could be classified into those that confirmed to a template and those that did not.

 

Type 1: Composition components that confirm to a template:

A composition component confirms to a template by specifying the template name in the template attribute (e.g: ui:composition template=”section.xtml”).  Then it overrides certain aspects of the template. In the example 1 below, section.xhtml, which is the template, defines “contents” (at 1). The composition component defined in Student.xhtml specifies section.xhtml as its template at 2. Section.xhtml further defines-its-own or overrides “contents” at 3. Had there been no 3, 4 would get rendered.

 

Example 1

 

Section.xhtml

<ui:composition>

  <div…> …

  <ui:insert name=”contents”> 1

    This is the default text for “contents”. This text will be rendered when a component does not override this ui:insert with a ui:define name=”contents” 4

  </ui:insert>

</ui:composition>

 

Student.xhtml

<ui:composition template=”section.xhtml”> 2

  <ui:define name=”contents”> 3

    <h:outputText…..> <!—contents of the student section à

  </ui:define>

</ui:composition>

 

Type 2: Composition components that *do not* confirm to a template:

A composition component can be stand alone too. In this case the ui:composition tag will reference no template.

outputField.xhtml

<ui:composition >

  <h:outputText

    Value=”#{fieldLabel}”/>

  <h:inputText

    Value=”#{field.property}”/>

</ui:composition >

 

Company.xhtml

<ui:composition …>

  <a:outputField

    fieldLabel=”Company Name”

    field=”#{company}”

    property=”name”/>

</ui:”composition>

 

Migrating to JSF 2:

Type 2 components above are good candidates to become composite components in JSF 2 (as composite components, like type 2 composition components, are stand-alone and confirm to no templates).

JSF Composition Components vs. Composite components

 

Composition Components

Composite components

1

Composition components can use a template

e.g.

view.xhtml

<a:location …/>

location.xhtml

<ui:composition template=”section.xhtml”>

  <ui:define name=”contents”>

    <h:outputText …/>

  </ui:define>

</ui:composition>

Composite components cannot. The need to be decorated to confirm to a template.

e.g.

view.xhtml

<ui:decorate template=”section.xhtml”>

  <ui:define name=”contents”>

    <a:location…>

  </ui:define>

</ui:decorate>

Location.xhtml

<composite:interface>

  <composite:attribute …/>

</composite:interface>

<composite:implementation>

   …

</composite:implementation>

2

Composition components have no constructs to define action listeners and such

Composite components are more closer to a full blown custom component and can hence define action listeners

3

JSF 1 only

JSF 2 only

 

Monday, May 03, 2010

Separating what keeps changing from what does not

In an application, the UI keeps changing a lot more frequently than the underlying APIs. Designing bearing this in mind would help achieve a better design.

Effective seperation of concerns

To achieve a effective separation of concerns, the coupling among the separated concerns must be minimal. This way, the implementation of each of the separated concerns have a opportunity to have minimal coupling.

Saturday, May 01, 2010

Be thankful that the road is long and challenging, because that is where you’ll find the best that life has to offer.

Just because the road ahead is long, is no reason to slow down. Just because there is much work to be done, is no reason to get discouraged. It is a reason to get started, to grow, to find new ways, to reach within yourself and discover strength, commitment, determination, discipline.

The road ahead is long and difficult, and filled with opportunity at every turn. Start what needs starting. Finish what needs finishing. Get on the road. Stay on the road. Get on with the work.

Right now you’re at the beginning of the journey. What a great place to be! Just imagine all the things you’ll learn, all the people you’ll meet, all the experiences you’ll have. Be thankful that the road is long and challenging, because that is where you’ll find the best that life has to offer.



- Ralph Marston through Julie911

Dare

“Dare to look foolish; the real fools are those who never attempt anything. Dare to make mistakes; they are the best teachers you will ever know. Dare to take action; there’s a risk you may fail, yet if you take no action failure is a certainty. Dare to be fully alive. Dare to speak your mind. Dare to enjoy the beauty of the world. Dare to make a difference. Dare to love. Dare to be the person you know you can be. Dare to expect the best; you’ll usually get it. Dare to do what is right rather than what is convenient or expedient. It will truly make a difference in the way you see yourself, and the way others see you. You’re here, with this magnificent day available to you. Dare to make it the best you can.”

- Author Unknown through Julie911