Tutorial by Examples: c

<!doctype html> <html> <head> <title>Page Title</title> <meta charset="UTF-8"> <meta name="viewport" content="initial-scale=1.0"> <script src="vue.js"></script> <style> ...
Yarn uses the same registry that npm does. That means that every package that is a available on npm is the same on Yarn. To install a package, run yarn add package. If you need a specific version of the package, you can use yarn add package@version. If the version you need to install has been tag...
To add a component with a selector [prefix]-user-list, run: $ ng g c user-list installing component create src/app/user-list/user-list.component.css create src/app/user-list/user-list.component.html create src/app/user-list/user-list.component.spec.ts create src/app/use...
To add a directive with a selector [prefix]Highlight, run: $ ng g d highlight installing directive create src/app/highlight.directive.spec.ts create src/app/highlight.directive.ts update src/app/app.module.ts To prevent prefix usage add --prefix false or -p false flag ...
To add a service with a name UserService, run: $ ng g s user installing service create src/app/user.service.spec.ts create src/app/user.service.ts To prevent .spec files creation add --spec false or -sp false flag $ ng g s user --spec false installing service ...
The default configuration <C-b> is not the easiest to use. It'd be better to use something like ctrla. To do so, add this to tmux.conf # remap prefix from 'C-b' to 'C-a' unbind C-b set-option -g prefix C-a bind-key C-a send-prefix
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...
Here, we try to explain OCP using codebase. First we'll show a scenario that violate OCP and then we'll remove that violation. Area Calculation (OCP violation Code) : public class Rectangle{ public double Width {get; set;} public double Height {get; set;} } public class Circle{ public do...
If your Internet connection is provided via a proxy Maven will not be able to download jars from remote repositories - a common problem faced by companies. To solve this, Maven needs to be provided the details and credentials of the proxy by going to {Maven install location} → conf → settings.xml. ...
Renaming a variable or class is usually a tedious task, by searching for all the locations where it is used. This can be significantly speeded up by highlighting the word, pressing Alt+Shift+R and then typing the new word. Eclipse will automatically rename the word in every file where it is called. ...
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 ...
Scimax is an Emacs starter kit focused on reproducible research, targeted mainly at scientists and engineers. Scimax customizes Org-Mode with features that make cross-referencing, exporting, and coding (in particular Python), simpler. Installation instructions can be found on the landing page of th...
To understand Dependency Inversion Principle (DIP) we need to clear concept about Inversion Of Control(IOC) and Dependency Injection(DI). So here we discuss all about the terms with Dependency Inversion Principle (DIP). Inversion Of Control(IOC) : The control or logic which is not the part of t...
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...
Here we give an example of ISP violation and then refactor that violation. Without talking unnecessary things let's jump into the code. ISP violation : public interface IMessage{ IList<string> ToAddress {get; set;} IList<string> BccAddresses {get; set;} string MessageBody {get; s...
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. &...
First Select Or Create a database. > use mydb switched to db mydb Using db.createCollection("yourCollectionName") method you can explicitly create Collection. > db.createCollection("newCollection1") { "ok" : 1 } Using show collections command see all col...
All documents from students collection. > db.students.find().pretty(); { "_id" : ObjectId("58f29a694117d1b7af126dca"), "studentNo" : 1, "firstName" : "Prosen", "lastName" : "Ghosh", "age" ...
MongoDB's db.collection.drop() is used to drop a collection from the database. First, check the available collections into your database mydb. > use mydb switched to db mydb > show collections newCollection1 newCollection2 newCollection3 system.indexes Now drop the collection with...
Ajax calls, request and retrieve data for giving the user a sense of a better interactive user interface experience. This article will show you how to use jQuery and send data through Ajax calls. For this example, we’re going to POST the following JavaScript object to our server. var post = { ...

Page 756 of 826