The first to thing to have: a model that contains a has_many relation with another model.
class Project < ApplicationRecord
has_many :todos
end
class Todo < ApplicationRecord
belongs_to :project
end
In ProjectsController:
class ProjectsController < ApplicationController
d...
An IP address to an interface could be obtained via DHCP or Static assignment
DHCP
If you are connected to a network with a DHCP server running, dhclient command can get an IP address for your interface
$ dhclient <interface>
or alternatively, you could make a change to the /etc/network/...
IMPORTANT This is just an example code, do not use in production.
In order to download an header chain we have to send a getHeaders message.
In this example we will require as much as possible headers after the 40000th one.The peer will respond with batch of 2000 headers so, we have to take the la...
This should always be your initial fix. A good policy is to decompile the database before each release.
Create a decompile shortcut. This loads the database with a "/decompile" switch.
Right Click your Database File. Select Copy
Right Click in the explorer window and select "...
If your crashes are random or sporadic, then do this step. If your crashes occur every single time you run the database, then this step won't fix the issue (although bad memory may be the reason why the corruption occurred in the first place).
Use a memory tester that boots outside the operating sy...
When you develop a C++ program, the next step is to compile the program before running it. The compilation is the process which converts the program written in human readable language like C, C++ etc into a machine code, directly understood by the Central Processing Unit. For example, if you have a...
Manipulate the IP routing table using route
Display routing table
$ route # Displays list or routes and also resolves host names
$ route -n # Displays list of routes without resolving host names for faster results
Add/Delete route
OptionDescriptionadd or delAdd or delete a route-host x.x.x.xA...
Appearance:
"Paamayim Nekudotayim" means "double colon" in Hebrew; thus this error refers to the inappropriate use of the double colon operator (::). The error is typically caused by an attempt to call a static method that is, in fact, not static.
Possible Solution:
$classname...
Grammar Example (Expr.g4)
grammar Expr;
prog: (expr NEWLINE)* ;
expr: expr ('*'|'/') expr
| expr ('+'|'-') expr
| INT
| '(' expr ')'
;
NEWLINE : [\r\n]+ ;
INT : [0-9]+ ;
Generating the visitor
To generate a Visitor, or to disable a visitor for your ...
We can statically bootstrap an application by taking the plain ES5 Javascript output of the generated factory classes. Then we can use that output to bootstrap the application:
import { platformBrowser } from '@angular/platform-browser';
import { AppModuleNgFactory } from './main.ngfactory';
//...
Retrieve Active Directory Group
Get-ADGroup -Identity "My-First-Group" #Ensure if group name has space quotes are used
Retrieve All Properties Associated with Group
Get-ADGroup -Identity "My-First-Group" -Properties *
Retrieve All Members of a Group
Get-ADGroupMember -Id...
This is a sample Fastfile setup for a multi-flavor app. It gives you an option to build and deploy all flavors or a single flavor. After the deployment, it reports to Slack the status of the deployment, and sends a notification to testers in Beta by Crashlytics testers group.
To build and deploy al...
Sublime Terminal. Terminal allows use to open your favourite terminal right at the current file or project location you are currently working on in Sublime Text, with handy keyboard shortcuts. It is available through Package Control.
SideBar Enhancements. This plugin adds additional functio...
For querying all the data from table MachineName we can use the command like below one.
$Query="Select * from MachineName"
$Inst="ServerInstance"
$DbName="DatabaseName
$UID="User ID"
$Password="Password"
Invoke-Sqlcmd2 -Serverinstance $Inst -Databa...