Tutorial by Examples

To declare a bean, simply annotate a method with the @Bean annotation or annotate a class with the @Component annotation (annotations @Service, @Repository, @Controller could be used as well). When JavaConfig encounters such a method, it will execute that method and register the return value as a b...
Setup Ruby On Rails on Ubuntu 16.04 Xenial Xerus All commands should be run in Linux terminal (hotkey: Ctrl + Alt + T) You need to install Ruby on your local machine in development environment. The first step is to install some dependencies for Ruby. sudo apt-get update sudo apt-get install git...
JUnit is the leading testing framework used for testing Java code. The class under test models a simple bank account, that charges a penalty when you go overdrawn. public class BankAccount { private int balance; public BankAccount(int i){ balance = i; } public Bank...
In molecular biology and genetics, GC-content (or guanine-cytosine content, GC% in short) is the percentage of nitrogenous bases on a DNA molecule that are either guanine or cytosine (from a possibility of four different ones, also including adenine and thymine). Using BioPython: >>> from...
Enabled directory index means that if someone access to any folder which don't contains index.php , index.html, index.htm or any other default file defined in DirectoryIndex in apache configuration then all files in that folder will be listed in browser if you try to visit that page. Often director...
java.lang.ref package provides reference-object classes, which support a limited degree of interaction with the garbage collector. Java has four main different reference types. They are: Strong Reference Weak Reference Soft Reference Phantom Reference 1. Strong Reference This is the usual...
Problem There is a series of repeating elements in page that you need to know which one an event occurred on to do something with that specific instance. Solution Give all common elements a common class Apply event listener to a class. this inside event handler is the matching selector elemen...
When expecting someone to reproduce an R code that has random elements in it, the set.seed() function becomes very handy. For example, these two lines will always produce different output (because that is the whole point of random number generators): > sample(1:10,5) [1] 6 9 2 7 10 >...
Be aware that Microsoft Excel 2013 (and higher) uses Single Document Interface (SDI) and that Excel 2010 (And below) uses Multiple Document Interfaces (MDI). This implies that for Excel 2013 (SDI), each workbook in a single instance of Excel contains its own ribbon UI: Conversely for Excel...
A function is a block of code that will be called several times during the execution. Instead of writing the same piece of code again and again, one can write this code inside a function and call that function whenever it is needed. A function : Must be declared in a class or a module Returns a...
Configuring your environment RabbitMQ looks for an set of environment variables in /etc/rabbitmq/rabbitmq-env.conf. If it does not exist, it assumes default values. All values in rabbitmq-env.conf get exported to the environment the RabbitMQ server runs in with a RABBITMQ_ prefix; this prefix is no...
From the documentation : In C#, arguments can be passed to parameters either by value or by reference. Passing by reference enables function members, methods, properties, indexers, operators, and constructors to change the value of the parameters and have that change persist in the calling e...
Detailed instructions on getting silverlight set up or installed.
The DATE data type does not handle time zones or changes in daylight savings time. Either: use the TIMESTAMP WITH TIME ZONE data type; or handle the changes in your application logic. A DATE can be stored as Coordinated Universal Time (UTC) and converted to the current session time zone like...
Oracle does not handle leap seconds. See My Oracle Support note 2019397.2 and 730795.1 for more details.
Option Strict On prevents three things from happening: 1. Implicit Narrowing Conversion Errors It prevents you from assigning to a variable that has less precision or smaller capacity (a narrowing conversion) without an explicit cast. Doing so would result in data loss. Dim d As Double = 123.4 ...
You can switch it On at the Module/Class Level by placing the directive at the top of the code file. Option Strict On You can switch it on at the project level via the menu in Visual Studio Project > [Project] Properties > Compile Tab > Option Strict > On You ...
There is overflow in the following code int x = int.MaxValue; Console.WriteLine(x + x + 1L); //prints -1 Whereas in the following code there is no overflow int x = int.MaxValue; Console.WriteLine(x + 1L + x); //prints 4294967295 This is due to the left-to-right ordering of the operations...
Command line arguments parsing is Go is very similar to other languages. In you code you just access slice of arguments where first argument will be the name of program itself. Quick example: package main import ( "fmt" "os" ) func main() { progName := o...
Go standard library provides package flag that helps with parsing flags passed to program. Note that flag package doesn't provide usual GNU-style flags. That means that multi-letter flags must be started with single hyphen like this: -exampleflag , not this: --exampleflag. GNU-style flags can be d...

Page 540 of 1336