Tutorial by Examples: sin

For all my projects, Django-Allauth remained one that is easy to setup, and comes out of the box with many features including but not limited to: Some 50+ social networks authentications Mix signup of both local and social accounts Multiple social accounts Optional instant-signup for social ac...
Add the slf4j dependency to your pom.xml: <properties> <slf4j.version>1.7.21</slf4j.version> </properties> <!-- ... --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version&gt...
In case you need different settings for your various applications, there is (as of Flink 1.2) no easy way to do that. If you use the one-yarn-cluster-per-job mode of flink (i.e. you launch your scripts with: flink run -m yarn-cluster ...), here is a workaround : create a conf directory somewhe...
Yarn does not by default aggregate logs before an application finishes, which can be problematic with streaming jobs that don't even terminate. A workaround is to use rsyslog, which is available on most linux machines. First, allow incoming udp requests by uncommenting the following lines in /etc/...
Let's go through the problem first. Have a look on the code below: public class BankAccount { public BankAccount() {} public string AccountNumber { get; set; } public decimal AccountBalance { get; set; } public decimal CalculateInterest() { // Co...
Ordered broadcasts are used when you need to specify a priority for broadcast listeners. In this example firstReceiver will receive broadcast always before than a secondReceiver: final int highPriority = 2; final int lowPriority = 1; final String action = "action"; // intent filter ...
The message you want to serialize and send that you can include into a file test.proto, containing package example; enum FOO { X = 17; }; message Test { required string label = 1; optional int32 type = 2 [default=77]; repeated int64 reps = 3; optional group OptionalGroup = 4 { ...
Introduction SRP can be defined as “a class handles only one responsibility”. This is a very short definition for something influential on to the other principles of S.O.L.I.D. I believe that if we get this right, it will have a positive knock-on effect on the upcoming principles, so let’s get star...
A docstring is a multi-line comment used to document modules, classes, functions and methods. It has to be the first statement of the component it describes. def hello(name): """Greet someone. Print a greeting ("Hello") for the person with the given name. &...
All documents from students collection. > db.students.find().pretty(); { "_id" : ObjectId("58f29a694117d1b7af126dca"), "studentNo" : 1, "firstName" : "Prosen", "lastName" : "Ghosh", "age" ...
ArgumentCaptor will to receive the actual invocation arguments that has been passed to method. ArgumentCaptor<Foo> captor = ArgumentCaptor.forClass(Foo.class); verify(mockObj).doSomethind(captor.capture()); Foo invocationArg = captor.getValue(); //do any assertions on invocationArg For ...
# It creates vendor folder and vendor.json inside it govendor init # Add dependencies in vendor.json govendor fetch <dependency> # Usage on new repository # fetch depenencies in vendor.json govendor sync Example vendor.json { "comment": "", "ignore&qu...
In this example 2000 bytes will be transfered using DMA, Transmit Half Complete and Transmit Complete interrupts achieving the best performance. The first half of the transmit buffer is loaded with new data by the CPU in the Transmit Half Complete interrupt callback while the second half of the buf...
Sometimes, you need to override one or more attributes of a particular Data Access Class (DAC) field just for a particular screen, without changing the existing behavior for other screens. Replacing All Attributes Suppose the original DAC field attributes are declared as shown below: public class...
ecosystem.json { "name": "app-name", "script": "server", "exec_mode": "cluster", "instances": 0, "wait_ready": true "listen_timeout": 10000, "kill_timeout": 500...
This example is a quick setup of Angular and how to generate a quick example project. Prerequisites: Node.js 6.9.0 or greater. npm v3 or greater or yarn. Typings v1 or greater. Open a terminal and run the commands one by one: npm install -g typings or yarn global add typings npm install -...
The MSBuildWorspace is built around the concept of handling MSBuild solutions (.sln files) and their respective projects (.csproj, .vbproj). Adding new projects and documents to this workspace is not supported. string solutionPath = @"C:\Path\To\Solution\Sample.sln"; MSBuildWorkspace ...
If you are using Bootstrap Modal then be sure that Model tabindex=-1 is removed. $('#targetId').select2({ width: '100%', dropdownParent: $("#myModal") })
You can easily navigate the a Syntax Tree using LINQ. For example it is easy to get all the ClassDeclarationSyntax nodes (declared classes), that have a name starting with the letter A: var allClassesWithNameStartingWithA = syntaxRoot.DescendantNodes() .OfType<ClassDeclarationSyntax>()...
The CSharpSyntaxWalker class is out of the box implementation of the Visitor pattern, that we can use to traverse our Syntax Tree. Here is a simple example of a Syntax Walker that collects all the struct-s that have a name, starting with the letter A: public class StructCollector : CSharpSyntaxWa...

Page 148 of 161