Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
/* | |
* Example of a singleton design pattern. | |
* Copyright (C) 2011 Radek Pazdera | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* This program is distributed in the hope that it will be useful, |
import numpy as np | |
def gs_cofficient(v1, v2): | |
return np.dot(v2, v1) / np.dot(v1, v1) | |
def multiply(cofficient, v): | |
return map((lambda x : x * cofficient), v) | |
def proj(v1, v2): | |
return multiply(gs_cofficient(v1, v2) , v1) |
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
* g o a t s e x * g o a t s e x * g o a t s e x * | |
g g | |
o / \ \ / \ o | |
a| | \ | | a | |
t| `. | | : t | |
s` | | \| | s | |
e \ | / / \\\ --__ \\ : e | |
x \ \/ _--~~ ~--__| \ | x | |
* \ \_-~ ~-_\ | * | |
g \_ \ _.--------.______\| | g |
/** | |
* Check if a given ip is in a network | |
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1 | |
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed | |
* @return boolean true if the ip is in this range / false if not. | |
*/ | |
function ip_in_range( $ip, $range ) { | |
if ( strpos( $range, '/' ) == false ) { | |
$range .= '/32'; | |
} |
git clean -xfd | |
git submodule foreach --recursive git clean -xfd | |
git reset --hard | |
git submodule foreach --recursive git reset --hard | |
git submodule update --init --recursive |
'use strict'; | |
// simple express server | |
var express = require('express'); | |
var app = express(); | |
var router = express.Router(); | |
app.use(express.static('public')); | |
app.get('/', function(req, res) { | |
res.sendfile('./public/index.html'); |
The API used for DTLS is mostly the same as for TLS, because of the mapping of generic functions to protocol specifc ones. Some additional functions are still necessary, because of the new BIO objects and the timer handling for handshake messages. The generic concept of the API is described in the following sections. Examples of applications using DTLS are available at [9].
DTLS の API は TLS とほぼ同じ。 BIO オブジェクトの生成とタイマのために追加でいくつか必要。
Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.
git revert {commit_id}
Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:
Here's how to make jQuery DataTables work with npm and webpack. This is the simplest way I found to do it. | |
See the previous revision of this gist for a way to do it with forcing AMD to be disabled if you need that. | |
Install DT core: npm install datatables.net | |
Install a DT style: npm install datatables.net-dt | |
Then to initialize DT in your app, do this in your main entry point: | |
// you can use import or require | |
import dt from 'datatables.net'; |