svn error : parameter is incorrect ,cant create tunnel

preferences – > svn ->svn interface ->svn kit

Advertisements

“Wed Oct 11 00:00:00 IST 2017” to date object in java

String dateStr = "Wed Oct 11 00:00:00 IST 2017";
DateFormat formatter = new SimpleDateFormat("E MMM dd HH:mm:ss Z yyyy");
Date date = (Date)formatter.parse(dateStr);
System.out.println(date);        

Calendar cal = Calendar.getInstance();
cal.setTime(date);
String formatedDate = cal.get(Calendar.DATE) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" +         cal.get(Calendar.YEAR);
System.out.println("formatedDate : " + formatedDate);    

java.lang.IllegalArgumentException: Illegal pattern character ‘j’

Your error is because simple date formatter doesn’t accept ‘j’, and this is coming from the JDK. Please use only SDF approved patterns (the locale will determine how those patterns are interpretted).

String dateStr = “Mon Jun 18 00:00:00 IST 2012”;
DateFormat formatter = new SimpleDateFormat(“E MMM dd HH:mm:ss Z yyyy”);
Date date = (Date)formatter.parse(dateStr);
System.out.println(date);

Calendar cal = Calendar.getInstance();
cal.setTime(date);
String formatedDate = cal.get(Calendar.DATE) + “/” + (cal.get(Calendar.MONTH) + 1) + “/” + cal.get(Calendar.YEAR);
System.out.println(“formatedDate : ” + formatedDate);

PrimeFaces lazydatamodel load method not called

<p:dataTable id=”table” var=”data” class=”table”<p:dataTable id=”table” var=”data” class=”table” selection=”#{myBean.plan}” rowKey=”#{data.planId}”  value=”#{myBean.lazyPlanList}” lazy=”true” emptyMessage=”No records found” paginatorTemplate=”{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}” rows=”5″ paginator=”true” paginatorPosition=”bottom” tableStyleClass=”” rowsPerPageTemplate=”5,10,15″ rowIndexVar=”idx”>

Note : Remember value should be lazyList

Difference between Trunc and Round functions Oracle

SQL> select trunc(25.67),round(25.67) from dual;

TRUNC(25.67)    ROUND(25.67)
————                      ————
25                                    26

Below chart clearly explains the difference

TRUNC ROUND
25.67,0 25 26
25.67,1 25.6 25.7
25.34,1 25.3 25.3
25.34,2 25.34 25.34
25.67,-1 20 30

So next time when you are using TRUNC and ROUND remember that both might give different results !