BLOG

DESIDERATA

Desiderata means things that are needed or required.  I have known and heard of this poem by Max Ehrmann before.  In fact, it spoke to me and became one of my favorites.  It speaks about what we need to know and need to do. I want to share it with […]

How to calculate age from date of birth in Java using Joda-Time API

Here I used the java date and time API – Joda-Time http://www.joda.org/joda-time/ import org.joda.time.LocalDate; import org.joda.time.Period; import org.joda.time.PeriodType; int dob_y = 1983; int dob_m = 12; int dob_d = 08; int iAge = 0; LocalDate dob = new LocalDate(dob_y, dob_m, dob_d); LocalDate date = new LocalDate(); Period period = new […]

How to use the conditional operator “?:” in C#

A much cleaner and shorter way to handle an IF-ELSE scenario is to use the conditional operator “?:” SYNTAX condition ? expression_1 : expression_2 If “condition” statement evaluates to true, “expression_1” will be evaluated.  Otherwise, if the “condition” statement evaluates to false, “expression_2” will be the one evaluated. EXAMPLE #1 […]