Tutorial by Examples

Suppose you are comparing value with some variable if ( i == 2) //Bad-way { doSomething; } Now suppose you have mistaken == with =. Then it will take your sweet time to figure it out. if( 2 == i) //Good-way { doSomething; } Then, if an equal sign is accidentally left out, the ...
Download the latest apache commons daemon from Apache Commons Project Distributions. Extract the commons daemon in <Cassandra installed directory>\bin. Rename the extracted folder as daemon. Add <Cassandra installed directory> as CASSANDRA_HOME in windows environment v...
Create the /etc/init.d/cassandra startup script. Edit the contents of the file: #!/bin/sh # # chkconfig: - 80 45 # description: Starts and stops Cassandra # update daemon path to point to the cassandra executable DAEMON=<Cassandra installed directory>/bin/cassandra start() { ...
Background Model Listener hook's are a type of Liferay plugin that listens for events taken on an model and executes code in response. Model Listener hooks are similar to Custom Struts Action hooks in that they respond to an action taken in the portal. However while Struts actions respond to an a...
This example is a sample page that shows how to use Dojo to display a "Hello world" text inside <h1> tag. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Dojo sample</title> <script src="//ajax.go...
CHMOD Calculation CHMOD is binary. _ / _ _ _ / _ _ _ / _ _ _ = _/4+2+1/4+2+1/4+2+1 = 777 = _/rwx/rwx/rwx = 777 Therefore _rwx = _/4+2+1 = 7 D / _ _ _ / _ _ _ / _ _ _ (‘D’ = directory, another use is L = Link) So e.g. _rwxr_xr_x = _/rwx/rx/r_x = 755
To change own:group you use command chown user:group e.g. chown owner:group or if owner and group are same you can use chown owner: (because linus assumes owner:group are same).
Action Mailer provides hooks into the interceptor methods. These allow you to register classes that are called during the mail delivery life cycle. An interceptor class must implement the :delivering_email(message) method which will be called before the email is sent, allowing you to make modificat...
We have seen in those examples (ex_1, ex_2) how to use and override the pagination classes in any generic class base view. What happens when we want to use pagination in a function based view? Lets also assume that we want to create a function based view for MyModel with PageNumberPagination, res...
You can use TO_CHAR( date_value, 'D' ) to get the day-of-week. However, this is dependent on the NLS_TERRITORY session parameter: ALTER SESSION SET NLS_TERRITORY = 'AMERICA'; -- First day of week is Sunday SELECT TO_CHAR( DATE '1970-01-01', 'D' ) FROM DUAL; Outputs 5 ALTER SESSION SET ...
Visit http://sheets.google.com to try out now! Create a new spreadsheet and start playing around.
BottomSheet DialogFragment opens up in STATE_COLLAPSED by default. Which can be forced to open to STATE_EXPANDEDand take up the full device screen with help of the following code template. @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { BottomSheetDialog dialog = ...
If you have: operator fun <R> String.invoke(block: () -> R) = { try { block.invoke() } catch (e: AssertException) { System.err.println("$this\n${e.message}") } } You can write the following DSL-like code: "it should return 2" { parse("1 + 1").bu...
In PHP, variable values have an associated "truthiness" so even non-boolean values will equate to true or false. This allows any variable to be used in a conditional block, e.g. if ($var == true) { /* explicit version */ } if ($var) { /* $var == true is implicit */ } Here are some fun...
Small object optimization is a technique which is used within low level data structures, for instance the std::string (Sometimes referred to as Short/Small String Optimization). It's meant to use stack space as a buffer instead of some allocated memory in case the content is small enough to fit with...
Selenium Exception Documentation ElementNotInteractableException: Thrown when an element is present in the DOM but interactions with that element will hit another element due to paint order ElementNotSelectableException: Thrown when trying to select an unselectable element. Examples of unselecta...
For the most printing clients, is extremely useful to know if a print job has finished or failed. The Java Print Service API provide some functionalities to get informed about these scenarios. All we have to do is: provide an implementation for PrintJobListener interface and register this impl...
Suppose you are creating a function that requires no arguments when it is called and you are faced with the dilemma of how you should define the parameter list in the function prototype and the function definition. You have the choice of keeping the parameter list empty for both prototype and d...
There are two ways to uninstall a particular version of Ruby. The easiest is to simply remove the directory from ~/.rbenv/versions: $ rm -rf ~/.rbenv/versions/2.1.0 Alternatively, you can use the uninstall command, which does exactly the same thing: $ rbenv uninstall 2.1.0 If this version ha...
This is what I did to install CakePHP on a fresh installed minimal CentOS 7 Installed a CentOS-7-x86_64-Minimal-1611.iso in VirtualBox, two network interfaces: first NAT, second Host-Only set ONBOOT=yes in /etc/sysconfig/network-scripts/ifcfg-enp0s3 reboot yum update yum install net-tools (to...

Page 1282 of 1336