Tutorial by Examples: l

Directives, as the name suggests, are direction or instructions for the container to follow when translating a JSP to a servlet. There are 3 directives namely page, include and taglib which you can use in your JSP. Below is a simple example of using page directive: <%@ page isErrorPage="tr...
Send an HTTP response with status code 200 to indicate a successful request. The HTTP response status line is then: HTTP/1.1 200 OK The status text OK is only informative. The response body (message payload) should contain a representation of the requested resource. If there is no representation...
NOTE: In most cases, it is better to use a UIButton instead of making a UILabel you can tap on. Only use this example, if you are sure, that you don't want to use a UIButton for some reason. Create label Enable user interaction Add UITapGestureRecognizer The key to create a clickable UIL...
Assuming that you have successfully created a JFrame and that Swing has been imported... You can import Swing entirely import javax.Swing.*; or You can import the Swing Components/Frame that you intend to use import javax.Swing.Jframe; import javax.Swing.JButton; Now down to adding the J...
Leaflet is an open-source JavaScript library for making dynamic maps for the web. RStudio wrote R bindings for Leaflet, available through its leaflet package, built with htmlwidgets. Leaflet maps integrate well with the RMarkdown and Shiny ecosystems. The interface is piped, using a leaflet() funct...
PHP is a loosely typed language. This means that, by default, it doesn't require operands in an expression to be of the same (or compatible) types. For example, you can append a number to a string and expect it to work. var_dump ("This is example number " . 1); The output will be: ...
When reading from a file, we want to be able to know when we've reached the end of that file. Knowing that fgets() returns false at the end of the file, we might use this as the condition for a loop. However, if the data returned from the last read happens to be something that evaluates as boolean f...
When you install Oracle 11g or 12cR1, an older version of Apex is pre-installed. It is highly recommended to upgrade it to the latest version. Go to apex.oracle.com and download the latest version of Apex. Follow the documentation for the specific version to install it. Important Docu...
Add the following dependency to the build.gradle file: compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' Add the following permissions to the AndroidManifest.xml file: <uses-permission android:name="android.permission.INTERNET" /> <uses-permiss...
A very useful and logical follow-up to histograms would be to plot the smoothed density function of a random variable. A basic plot produced by the command plot(density(rnorm(100)),main="Normal density",xlab="x") would look like You can overlay a histogram and a density...
To change MySQL's root user password: Step 1: Stop the MySQL server. in Ubuntu or Debian: sudo /etc/init.d/mysql stop in CentOS, Fedora or Red Hat Enterprise Linux: sudo /etc/init.d/mysqld stop Step 2: Start the MySQL server without the privilege system. sudo mysqld_safe --skip-grant-tab...
Haskell has list comprehensions, which are a lot like set comprehensions in math and similar implementations in imperative languages such as Python and JavaScript. At their most basic, list comprehensions take the following form. [ x | x <- someList ] For example [ x | x <- [1..4] ] -...
Here is an example Picasso Circle Transform class based on the original, with the addition of a thin border, and also includes functionality for an optional separator for stacking: import android.graphics.Bitmap; import android.graphics.BitmapShader; import android.graphics.Canvas; import androi...
Using the Story Board: Select the tab bar item from the corresponding view controller and go to the attributes inspector If you want a built-in icon and title, set the 'System Item' to the corresponding value. For a custom icon, add the required images to the assets folder and set the 'System It...
If you need to delete a lot of records quickly, ActiveRecord gives .delete_all method. to be called directly on a model, to delete all records in that table, or a collection. Beware though, as .delete_all does not instantiate any object hence does not provide any callback (before_* and after_destroy...
for loop: arr=(a b c d e f) for i in "${arr[@]}";do echo "$i" done Or for ((i=0;i<${#arr[@]};i++));do echo "${arr[$i]}" done while loop: i=0 while [ $i -lt ${#arr[@]} ];do echo "${arr[$i]}" i=$(expr $i + 1) done Or i=0...
Break multiple loop: arr=(a b c d e f) for i in "${arr[@]}";do echo "$i" for j in "${arr[@]}";do echo "$j" break 2 done done Output: a a Break single loop: arr=(a b c d e f) for i in "${arr[@]}";do e...
It is very rare that you'll ever want to use Select or Activate in your code, but some Excel methods do require a worksheet or workbook to be activated before they'll work as expected. If you're just starting to learn VBA, you'll often be suggested to record your actions using the macro recorder, t...
You can send a block to your method and it can call that block multiple times. This can be done by sending a proc/lambda or such, but is easier and faster with yield: def simple(arg1,arg2) puts "First we are here: #{arg1}" yield puts "Finally we are here: #{arg2}" ...
Sometimes you may want to apply styling to a column or group of columns. Or for semantic purposes, you may want to group columns together. To do this, use <colgroup> and <col> elements. The optional <colgroup> tag allows you to group columns together. <colgroup> elements ...

Page 223 of 861