Tutorial by Examples

Some people have issues regarding error messages not being displayed if an existing value is being entered. For example I'm not allowing a user signup with an existing email. View <?php ...................... <?= $form->field($modelUser, 'email')->textInput(['class'=&gt...
Lets assume you have a class called Person with just name private class Person { public String name; public Person(String name) { this.name = name; } } Code: Gson g = new Gson(); Person person = new Person("John"); System.out.println(g.toJson(person)); /...
Lets assume you have a class called Person with just name private class Person { public String name; public Person(String name) { this.name = name; } } Code: Gson gson = new Gson(); String json = "{\"name\": \"John\"}"; Person person ...
String json = "{\"name\": \"John\", \"age\":21}"; JsonObject jsonObject = new JsonParser().parse(json).getAsJsonObject(); System.out.println(jsonObject.get("name").getAsString()); //John System.out.println(jsonObject.get("age").getAs...
In Python 2, range function returns a list while xrange creates a special xrange object, which is an immutable sequence, which unlike other built-in sequence types, doesn't support slicing and has neither index nor count methods: Python 2.x2.3 print(range(1, 10)) # Out: [1, 2, 3, 4, 5, 6, 7, 8, 9...
With any variadic function, the function must know how to interpret the variable arguments list. With the printf() or scanf() functions, the format string tells the function what to expect. The simplest technique is to pass an explicit count of the other arguments (which are normally all the same ...
Use the following steps to create a topic: Click Create New Topic on the tag's dashboard. Name the topic. Provide detailed examples in the "Examples" section. If you have more to share, use the "Syntax," "Parameters," and "Remarks" sections. You have ...
A topic is made up of several sections: Title: What is the subject of the topic. Search existing topics first to make sure you are not repeating content that already exists. Topics already covered elsewhere on Stack Overflow may be deleted. Versions: The versions where the material covered by the ...
Python 3.x3.0 In Python 3, you can unpack an iterable without knowing the exact number of items in it, and even have a variable hold the end of the iterable. For that, you provide a variable that may collect a list of values. This is done by placing an asterisk before the name. For example, unpacki...
using namespace System; int main(array<String^>^ args) { Console::WriteLine("Hello World"); }
LINQ requires .NET 3.5 or higher (or .NET 2.0 using LINQBridge). Add a reference to System.Core, if it hasn't been added yet. At the top of the file, import the namespace: C# using System; using System.Linq; VB.NET Imports System.Linq
The Dart SDK includes everything you need to write and run Dart code: VM, libraries, analyzer, package manager, doc generator, formatter, debugger, and more. If you are doing web development, you will also need Dartium. Automated installation and updates Installing Dart on Windows Installing Da...
Module serves as a container of different parts of your app such as controllers, services, filters, directives, etc. Modules can be referenced by other modules through Angular's dependency injection mechanism. Creating a module: angular .module('app', []); Array [] passed in above example ...
angular .module('app') .controller('SampleController', SampleController) SampleController.$inject = ['$log', '$scope']; function SampleController($log, $scope){ $log.debug('*****SampleController******'); /* Your code below */ } Note: The .$inject will make sure your...
There are a couple different ways to protect your controller creation from minification. The first is called inline array annotation. It looks like the following: var app = angular.module('app'); app.controller('sampleController', ['$scope', '$http', function(a, b){ //logic here }]); The...
As long as the element is a block, and it has an explicitly set width value, margins can be used to center block elements on a page horizontally. We add a width value that is lower than the width of the window and the auto property of margin then distributes the remaining space to the left and the ...
Overview Unity runs on Windows and Mac. There is also a Linux alpha version available. There are 4 different payment plans for Unity: Personal - Free (see below) Plus - $35 USD per month per seat (see below) Pro - $125 USD per month per seat - After subscribing to the Pro plan for 24 consecut...
In a loop (for, foreach, do, while) the break statement aborts the execution of the innermost loop and returns to the code after it. Also it can be used with yield in which it specifies that an iterator has come to an end. for (var i = 0; i < 10; i++) { if (i == 5) { break; ...
In your Visual Studio open the Solution Explorer window then right click on your project then choose Manage NuGet Packages from the menu: In the window that opens type EntityFramework in the search box in the top right. Or if you are using Visual Studio 2015 you'll see something like this: ...
The static (compile-time) type is used rather than the dynamic (run-time type) to match parameters. public class Base { public virtual string GetName() { return "Base"; } } public class Derived : Base { public override string GetName() { ...

Page 107 of 1336