When you install WordPress to your server, the installation script will place a prefix in front of all the WordPress MySQL table names. This prefix is set to 'wp_' by default. The WordPress posts table will be called wp_posts for example. By changing the table prefix you can create some security by ...
The Shortest Common Super Sequence is a problem closely related to the longest common subsequence, which you can use as an external function for this task. The shortest common super sequence problem is a problem closely related to the longest common subsequence problem.
A shortest common superseque...
public class ShortestCommonSupersequence
{
private static int Max(int a, int b)
{
return a > b ? a : b;
}
private static int Lcs(string x, string y, int m, int n)
{
var l = new int[m + 1, n + 1];
for (var i = 0; i <= m; i++)
{...
Class can implement multiple traits. In case if one trait defines method with the same signature like another trait, there is a multiple inheritance problem. In that case the method from last declared trait is used:
trait Foo {
def hello() {'Foo'}
}
trait Bar {
def hello() {'Bar'}
}
cla...
The idea is to have one or more control machines from where you can issue ad-hoc commands to remote machines (via ansible tool) or run a sequenced instruction set via playbooks (via ansible-playbook tool).
Basically, we use Ansible control machine, this will typically be your desktop, laptop or s...
Install from npm chai, chai-immutable, and ts-node
npm install --save-dev chai chai-immutable ts-node
Install types for mocha and chai
npm install --save-dev @types/mocha @types/chai
Write simple test file:
import {List, Set} from 'immutable';
import * as chai from 'cha...
In the following example we will be creating a table called Membership using the AWS Java SDK for DynamoDB. The table will consist of items that represent team assignments. The table will be partitioned by TeamID. Each team will have multiple members, identified by the MemberID (as a sort key).
AWS...
When using PowerShell, you can use setx.exe to set environment variables permanently.
Start PowerShell
Type one of the following:
setx ASPNETCORE_ENVIRONMENT "development"
setx ASPNETCORE_ENVIRONMENT "staging"
Restart PowerShell
This approach will generate one table on the database to represent all the inheritance structure.
Example:
public abstract class Person
{
public int Id { get; set; }
public string Name { get; set; }
public DateTime BirthDate { get; set; }
}
public class Employee : Person
{
...
This approach will generate (n+1) tables on the database to represent all the inheritance structure where n is the number of subclasses.
How to:
public abstract class Person
{
public int Id { get; set; }
public string Name { get; set; }
public DateTime BirthDate { get; set; }
}
...
This will disable the SSH server side service, as if needed this will insure that clients cannot connect via ssh
Ubuntu
sudo service ssh stop
Debian
sudo /etc/init.d/ssh stop
Arch Linux
sudo killall sshd
here countInstance is a static class variable
class StaticTest{
static countInstance : number= 0;
constructor(){
StaticTest.countInstance++;
}
}
new StaticTest();
new StaticTest();
console.log(StaticTest.countInstance);
Parameters
Nullable type hint was added in PHP 7.1 using the ? operator before the type hint.
function f(?string $a) {}
function g(string $a) {}
f(null); // valid
g(null); // TypeError: Argument 1 passed to g() must be of the type string, null given
Before PHP 7.1, if a parameter has a typ...
VBScript is a weakly typed language; variables are all of type variant, though they usually have an implied subtype denoting the data they hold.
This means that your variable, no matter what you call it, can hold any value:
Dim foo
foo = "Hello, World!"
foo = 123.45
foo = #01-Jan-2016...
To create \DateTimeImmutable in PHP 5.6+ use:
\DateTimeImmutable::createFromMutable($concrete);
Prior PHP 5.6 you can use:
\DateTimeImmutable::createFromFormat(\DateTime::ISO8601, $mutable->format(\DateTime::ISO8601), $mutable->getTimezone());
Nested serializers by default don't support create and update. To support this without duplicating DRF create/update logic, it is important to remove the nested data from validated_data before delegating to super:
# an ordinary serializer
class UserProfileSerializer(serializers.ModelSerializer):
...
To get a list of possible time_zone values in your MySQL server instance, use this command.
SELECT mysql.time_zone_name.name
Ordinarily, this shows the ZoneInfo list of time zones maintained by Paul Eggert at the Internet Assigned Numbers Authority. Worldwide there are appproximately 600 time z...
CREATE TABLE times (
dt DATETIME(3),
ts TIMESTAMP(3)
);
makes a table with millisecond-precision date / time fields.
INSERT INTO times VALUES (NOW(3), NOW(3));
inserts a row containing NOW() values with millisecond precision into the table.
INSERT INTO times VALUES ('2015-01...