Tutorial by Examples

And to finish off, let's briefly look at the case when both sides are optional. By now you should be really bored with these examples :), so I'm not going into the details and play with the idea of having two FK-s and the potential problems and warn you about the dangers of not enforcing these rule...
Basics require('http').globalAgent.maxSockets = 25 // You can change 25 to Infinity or to a different value by experimenting Node.js by default is using maxSockets = Infinity at the same time (since v0.12.0). Until Node v0.12.0, the default was maxSockets = 5 (see v0.11.0). So, after more tha...
const http = require('http') const fs = require('fs') const zlib = require('zlib') http.createServer((request, response) => { const stream = fs.createReadStream('index.html') const acceptsEncoding = request.headers['accept-encoding'] let encoder = { hasEncoder ...
""" CannyTrackbar function allows for a better understanding of the mechanisms behind Canny Edge detection algorithm and rapid prototyping. The example includes basic use case. 2 of the trackbars allow for tuning of the Canny function and the other 2 help with understanding h...
So let's say you have two different entities, something like this: public class Person { public int PersonId { get; set; } public string Name { get; set; } } public class Car { public int CarId { get; set; } public string LicensePlate { get; set; } } public class MyDemoCon...
In the last example, you can see that EF figures out which column is the foreign key and where should it point to. How? By using conventions. Having a property of type Person that is named Person with a PersonId property leads EF to conclude that PersonId is a foreign key, and it points to the prima...
In the previous examples a car cannot exist without a person. What if you wanted the person to be optional from the car side? Well, it's kind of easy, knowing how to do one-to-many. Just change the PersonId in Car to be nullable: public class Car { public int CarId { get; set; } public s...
Let's move on to the other scenario, where every person can have multiple cars and every car can have multiple owners (but again, the relationship is bidirectional). This is a many-to-many relationship. The easiest way is to let EF do it's magic using conventions. Just change the model like this: ...
You might want to rename the fields in the join table to be a little more friendly. You can do this by using the usual configuration methods (again, it doesn't matter which side you do the configuration from): public class CarEntityTypeConfiguration : EntityTypeConfiguration<Car> { publi...
I have to admit, I'm not really a fan of letting EF infer the join table wihtout a join entity. You cannot track extra information to a person-car association (let's say the date from which it is valid), because you can't modify the table. Also, the CarId in the join table is part of the primary ke...
HERE Android Premium SDK samples Now available on Github! [https://github.com/heremaps/here-android-sdk-examples][1] HERE iOS Premium SDK samples Now available on Github! [https://github.com/heremaps/here-ios-sdk-examples][1] Please refer to the README.md on how to get started. Note the samples ...
As an example we want to set all string properties of a sample class class TestClass { val readOnlyProperty: String get() = "Read only!" var readWriteString = "asd" var readWriteInt = 23 var readWriteBackedStringProperty: String = "" ...
Extra goals enable to add processing to DCG clauses, for example, conditions that the elements of the list must satisfy. The extra goals are observed between curly braces at the end of a DCG clause. % DCG clause requiring an integer int --> [X], {integer(X)}. Usage: ?- phrase(int, [3]). t...
The extra arguments add results to predicates of a DCG clause, by decorating the derivation tree. For example, it's possible to create a algebraic grammar that computes the value at the end. Given a grammar that supports the operation addition: % Extra arguments are passed between parenthesis afte...
Let's consider the predicate sumDif/2, verified if the structure of a list matches several constraints. The first term represents the list to analyze and the second term another list that holds the part of the first list that is unknown to our constraints. For the demonstration, sumDif/2 recognizes...
Let's define a grammar enabling us to perform additions, multiplications with the usage of parenthesis. To add more value to this example, we are going to compute the result of the arithmetic expression. Summary of the grammar: expression → times expression → times '+' expression times → elemen...
In general, MIDI protocol is broken down into "messages". There are 4 general classes of messages: Channel Voice Channel Mode System Common System Real-Time Messages Messages start with a byte value above 0x80. Any value below 0x7F is considered data. Effectively meaning that 1...
Step 1 – Install LAMP To start with Laravel, we first need to set up a running LAMP server. If you have already running LAMP stack skip this step else use followings commands to set up lamp on Ubuntu system. Install PHP 5.6 $ sudo apt-get install python-software-properties $ sudo add-apt-reposit...
Suppose we want to know how many users have the same name. Let us create table users as follows: create table users( id int primary key auto_increment, name varchar(8), count int, unique key name(name) ); Now, we just discovered a new user named Joe and would like to take hi...
Suppose we want to know how many users have the same name. Let us create table users as follows: create table users( id serial, name varchar(8) unique, count int ); Now, we just discovered a new user named Joe and would like to take him into account. To achieve that, we need to d...

Page 1184 of 1336