Tutorial by Examples

<p> Today: <span th:text="${#calendars.format(today,'dd MMMM yyyy')}">30 May 2017</span> </p>
<div th:if="*{userMessage!=null and #strings.length(userMessage)>0}"> <label th:text = "*{userMessage}"/> </div>
<div th:if="${#strings.contains(#httpServletRequest.requestURI, 'email')}"> <div th:replace="fragments/email::welcome"> </div>
Get year from date <p> Year: <span th:text="${#dates.year(today)}">2017</span> </p> Get month <p> Month number: <span th:text="${#dates.month(today)}">8</span> Month: <span th:text="${#dates.monthName(today)}"&...
<p> Order sum: <span th:text="${#numbers.formatDecimal(orderSum, 0, 'COMMA', 2, 'POINT')}">1,145,000.52</span> </p>
This example will help to verify the given time is within a period or not. To check the time is today, We can use DateUtils class boolean isToday = DateUtils.isToday(timeInMillis); To check the time is within a week, private static boolean isWithinWeek(final long millis) { return System.c...
You can use list variable to form <select> elements <select th:field="*{countries}"> <option th:each="country: ${countries}" th:value="${country.id}" th:text="#{${'selected.label.' + country.name}}"/> <...
<table id="countryList"> <thead> <tr> <th th:text="#{country.label.name}"> Country </th> <th th:text="#{country.label.capital}"> Capital </th> <th th:text="#{country.l...
\documentclass{beamer} \mode<presentation> \usetheme{AnnArbor} \usecolortheme{seahorse} \title[Short topic]{Awesome long topic} \author[Name]{Full name} \institute[Institute short form]{Full name of institute} \date{\today} \begin{document} \maketitle \end{document}
\documentclass[compress]{beamer} \mode\<presentation> \title[]{ABCDE for analysis of PQRS systems} \author[] { AA AAAA \inst{1} \and BB BBBB \inst{1} \and CC CCCC \inst{1} \and DD DDDD \inst{1} \and EE EEEE\inst{2} \and FF FFFF\i...
Large chunks of code can also be "commented out" using the preprocessor directives #if 0 and #endif. This is useful when the code contains multi-line comments that otherwise would not nest. #if 0 /* Starts the "comment", anything from here on is removed by preprocessor */ /*...
Blogger is a blog-publishing service by Google.
Step 1: Download Sublime: You can either download from their website or use the wget as I did: $ cd ~/Downloads ## On 32bit $ wget https://download.sublimetext.com/sublime_text_3_build_3126_x32.tar.bz2 ## On 64bit $ wget https://download.sublimetext.com/sublime_text_3_build_3126_x64.tar.bz2 ...
defmodule Selection do def sort(list) when is_list(list) do do_selection(list, []) end def do_selection([head|[]], acc) do acc ++ [head] end def do_selection(list, acc) do min = min(list) do_selection(:lists.delete(min, list), acc ++ [min]) end defp m...
Developers often need to design web sites that allow users to upload a CSV file. Usually there is no reason to save the actual CSV file since the data will processed and/or stored in a database once uploaded. However, many if not most, PYTHON methods of parsing CSV data requires the data to be rea...
In your method or any lifecycle hook that changes the array item at particuar index new Vue({ el: '#app', data:{ myArr : ['apple', 'orange', 'banana', 'grapes'] }, methods:{ changeArrayItem: function(){ //this will not work //myArr[2] ...
You can perform the same change instead of using Vue.$set by using the Array prototype's splice() new Vue({ el: '#app', data:{ myArr : ['apple', 'orange', 'banana', 'grapes'] }, methods:{ changeArrayItem: function(){ //this will not work ...
If yoi have nested array, the following can be done new Vue({ el: '#app', data:{ myArr : [ ['apple', 'banana'], ['grapes', 'orange'] ] }, methods:{ changeArrayItem: function(){ this.$set(this.myArr[1], 1, 'strawbe...
new Vue({ el: '#app', data:{ myArr : [ { name: 'object-1', nestedArr: ['apple', 'banana'] }, { name: 'object-2', nestedArr: ['grapes', 'orange'] } ] ...
If we want to look at a scene as if we had photographed it with a camera, we must first define some things: The position from which the scene is viewed, the eye position pos. The point we look at in the scene (target). It is also common to define the direction in which we look. Technically we n...

Page 1300 of 1336