Tutorial by Examples: ti

The Set object lets you store unique values of any type, whether primitive values or object references. You can push items into a set and iterate them similar to a plain JavaScript array, but unlike array, you cannot add a value to a Set if the value already exist in it. To create a new set: cons...
To check if a given value exists in a set, use .has() method: mySet.has(someVal); Will return true if someVal appears in the set, false otherwise.
One is able to nest one exception / try catch block inside the other. This way one can manage small blocks of code which are capable of working without disrupting your whole mechanism. try { //some code here try { //some thing which throws an exception. For Eg : divide by 0 ...
Hibernate has some strategies of inheritance. The JOINED inheritance type do a JOIN between the child entity and parent entity. The problem with this approach is that Hibernate always bring the data of all involved tables in the inheritance. Per example, if you have the entities Bicycle and Mounta...
System.Threading.Timer - Simplest multithreaded timer. Contains two methods and one constructor. Example: A timer calls the DataWrite method, which writes "multithread executed..." after five seconds have elapsed, and then every second after that until the user presses Enter: using Sys...
The map operation is a useful tool when working with arrays and vectors, but it can also be used to deal with Option values in a functional way. fn main() { // We start with an Option value (Option<i32> in this case). let some_number = Some(9); // Let's do some consecutive ...
1) Form Request Validation You may create a "form request" which can hold the authorization logic, validation rules, and error messages for a particular request in your application. The make:request Artisan CLI command generates the class and places it in the app/Http/Requests director...
public class MainApplication extends Application { private static Context context; //application context private Handler mainThreadHandler; private Toast toast; public Handler getMainThreadHandler() { if (mainThreadHandler == null) { mainThreadHand...
Content has been moved back to good 'ol Servlets wiki page
Onsen UI is an open-source framework that helps you build hybrid apps with native like performance. It can be used along with several well known JavaScript frameworks such as AngularJS (1 & 2), ReactJS and jQuery. Loading OnsenUI in a project is as easy as writing some standard tags of HTML in ...
One common use for the FOR XML function is to concatenate the values of multiple rows. Here's an example using the Customers table: SELECT STUFF( (SELECT ';' + Email FROM Customers where (Email is not null and Email <> '') ORDER BY Email ASC FOR XM...
;; disable automatic loading of packages after the init file (setq package-enable-at-startup nil) ;; instead load them explicitly (package-initialize) ;; refresh package descriptions (unless package-archive-contents (package-refresh-contents)) ;;; use-package initialization ;;; install ...
app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); This will match requests for /Home/Index, /Home/Index/123 and /
Download the Datastax PHP driver for Apache Cassandra from the Git project site, and follow the installation instructions. We will be using the "users" table from the KillrVideo app and the Datastax PHP driver. Once you have Cassandra up and running, create the following keyspace and tabl...
If you have a multi-parameter type-class with arguments a, b, c, and x, this extension lets you express that the type x can be uniquely identified from a, b, and c: class SomeClass a b c x | a b c -> x where ... When declaring an instance of such class, it will be checked against all other in...
Writes an error message to the console if the assertion is false. Otherwise, if the assertion is true, this does nothing. console.assert('one' === 1); Multiple arguments can be provided after the assertion–these can be strings or other objects–that will only be printed if the assertion is fals...
HTML comments (optionally preceded by whitespace) will cause code (on the same line) to be ignored by the browser also, though this is considered bad practice. One-line comments with the HTML comment opening sequence (<!--): Note: the JavaScript interpreter ignores the closing characters of H...
To setup a new credential profile with the name myprofile: $ aws configure --profile myprofile AWS Access Key ID [None]: ACCESSKEY AWS Secret Access Key [None]: SECRETKEY Default region name [None]: REGIONNAME Default output format [None]: text | table | json For the AWS access key id and se...
Activity is the root UserInterface in Android and have it's own life-cycle. MainActivity.java public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Toast.makeText(this, "Activ...
In ASP.NET Core there are several different ways we can localize/globalize our app. It's important to pick a way that suits your needs. In this example you'll see how we can make a multilingual ASP.NET Core app that reads language specific strings from .json files and store them in memory to provi...

Page 142 of 505