Smart contracts for RSK are written using Solidity (a Javascript like programming language) and are fully compatible with Ethereum Smart Contracts, so you can migrate your existing Ethereum Smart Contract to RSK Smart without doing any changes.
If you are new to Solidity, you can learn through a good introduction here solidity doc.
You can edit Sodility using any text edtor but it is a good idea to use more advanced tools, the folling is a list of some of them:
There is an open source tool called Truffle that facilitates development a lot since it allows you to connect to your local RSK Smart node and call the compiler, run unit tests and publish your contracts in a very easy way. We have an example project showing the usage of Truffle and Ganache with a local RSK node here.
In this tutorial, we will use Truffle for compiling and publishing your smart contracts.
Run the following commands to install truffle on your local machine
npm install -g truffle
Then create a new folder and create an empty project
mkdir rsk-truffle-example
cd rsk-truffle-example
truffle init
The init command will create 3 folders and a configuration file for this project. The solidity files are in the contracts folder.
In this tutorial, we are going to use the token contract code from [Consensys/Token] (https://github.com/ConsenSys/Tokens) as the example.
Now create two files named EIP20.sol and
EIP20Interface.sol content:
pragma solidity ^0.4.21;
contract EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
EIP20.sol content:
pragma solidity ^0.4.21;
import "./EIP20Interface.sol";
contract EIP20 is EIP20Interface {
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string public name; //fancy name: eg Simon Bucks
uint8 public decimals; //How many decimals to show.
string public symbol; //An identifier: eg SBX
function EIP20(
uint256 _initialAmount,
string _tokenName,
uint8 _decimalUnits,
string _tokenSymbol
) public {
balances[msg.sender] = _initialAmount; // Give the creator all initial tokens
totalSupply = _initialAmount; // Update total supply
name = _tokenName; // Set the name for display purposes
decimals = _decimalUnits; // Amount of decimals for display purposes
symbol = _tokenSymbol; // Set the symbol for display purposes
emit Transfer(msg.sender, msg.sender, 0);
emit Approval(msg.sender, msg.sender, 0);
}
function transfer(address _to, uint256 _value) public returns (bool success) {
require(balances[msg.sender] >= _value);
balances[msg.sender] -= _value;
balances[_to] += _value;
emit Transfer(msg.sender, _to, _value); //solhint-disable-line indent, no-unused-vars
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
uint256 allowance = allowed[_from][msg.sender];
require(balances[_from] >= _value && allowance >= _value);
balances[_to] += _value;
balances[_from] -= _value;
if (allowance < MAX_UINT256) {
allowed[_from][msg.sender] -= _value;
}
emit Transfer(_from, _to, _value); //solhint-disable-line indent, no-unused-vars
return true;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value); //solhint-disable-line indent, no-unused-vars
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
We also need to create a migration script in the migration folder. migrations/2_deploy_tokens.js
const EIP20 = artifacts.require('./EIP20.sol');
module.exports = (deployer) => {
deployer.deploy(EIP20, 10000, 'Simon Bucks', 1, 'SBX');
};
We are going to deploy the example smart contract on to RSK Testnet.
First we need to obtain an account on RSK Testnet and get some free RSK token from the testnet Faucet.
Create new Account with MetaMask
Get free token Visit the faucet website to gain some free RSK token for Testnet
Enter the account address from MetaMask and wait several minutes for MetaMask to refresh the new balance.
Now edit the truffle-config.js to be same as the following. It directs Truffle to connect to the public Testnet node.
var HDWalletProvider = require('truffle-hdwallet-provider')
var mnemonic = 'thing tuition ranch ... YOUR MNEMONIC'
var publicNode = 'https://public-node.testnet.rsk.co:443'
module.exports = {
networks: {
rskTestnet: {
provider: () =>
new HDWalletProvider(mnemonic, publicNode),
network_id: '*',
gas: 2500000,
gasPrice: 183000
}
},
compilers : {
solc: {
version: "0.4.24",
evmVersion: "byzantium"
}
}
}
Run the following commands in Terminal to compile and deploy the contracts.
truffle console --network rskTestnet
truffle compile
truffle migrate
Once the deployment is successful. We can call smart contract methods directly in truffle console.
Check Account Balance
Now type the following command into truffle console.
EIP20.deployed().then((instance=>instance.balanceOf("0xa07982385a16f0C7a9eEbAD5F44d2093A2856997")))
EIP20 is the name of our contract. This command will print out the balance of account address 0xa07982385a16f0C7a9eEbAD5F44d2093A2856997 as a big number. To see it as an integer, change the command to
EIP20.deployed().then((instance=>instance.balanceOf("0xa07982385a16f0C7a9eEbAD5F44d2093A2856997").then(b=>b.toNumber())))
Transfer Token Directly Between Two Accounts
Now use the following command to transfer 1 token from the minter account to another account
EIP20.deployed().then((instance=>instance.transfer("0x7dadb9d442cfe7fc75fd472d63afc16934d7aa44", 1)))
After its success execution, check the minter account’s balance again to see that it has changed.
EIP20.deployed().then((instance=>instance.balanceOf("0xa07982385a16f0C7a9eEbAD5F44d2093A2856997").then(b=>b.toNumber())))
Deploying Smart Contracts to RSK MainNet can follow the same steps as the TestNet.
The public node of RSK Main Net is https://public-node.rsk.co
You will be able to check the MainNet’s transactions and blocks in real time at this address https://explorer.rsk.co/
To deploy onto MainNet, we need to get some RBTC through the 2-way pg mechanism between BTC and RBTC.
For detailed tutorial on pedding, please visit this link.


Better
Use
AsyncJS
below CSS could make DOMContentReady fire earlier
At least lengthy script evaluation will not block DOMContentReady.


Loading...
Toggle navigation
My Timetable
FSKTM Homepage
Contribute
About
Drop file here
Today
Now
Next
My Subjects
Add Subject
Refresh
Warning!
Some of the classes are clashing, or maybe you did not specify a group for certain classes.
Monday
Tuesday
Wednesday
Thursday
Friday
×
My Timetable
Version 1.0.0
Author: Burhanuddin bin Baharuddin


Take a minute to reflect on what you have learned about over the course of reading this content. Then, spend some time writing down how you will work to engage more cultures in your classrooms. Come up with three concrete methods of exposing your students to these different groups.
You are the teacher representative on a search committee for a new teacher for your school. Develop a list of qualities or characteristics you would be looking for. Whold race, ethnicity, gender, or language background make a difference? Why or why not? What if the school were very culturally diverse or entirely monocultural? Would this change your answer?
Give some examples of collaboration between schools and parents that could help students achieve more in schools. Think across the board, from meetings, to curriculum, to outside of school activities such as sports, student government, and publications.
You have a student in an English classroom whose primary language is not English. He is acting out, not responding to instruction, and disrespecting peers. Considering his language differences, devise an action plan to help your student reform.


Tutorial¶
This tutorial can help you get started with using this Python package to optimise semiconductor optical amplifiers (SOAs) with particle swarm optimisation (PSO).
Pre-requisites (key concepts described in the following such as what rise time, settling time, overshoot, dynamic PSO, transfer functions etc. will not be re-explained in this tutorial):
An Artificial Intelligence Approach to Optimal Control of Sub-Nanosecond SOA-Based Optical Switches (and any references in the paper not recognised by the reader)
Chapter 16 of S. Kiranyaz’s 2014 book ‘Particle Swarm Optimisation’
Basic Python
Introduction¶
SOA Switch Optimisation¶
Particle Swarm Optimisation (PSO) is a metaheuristics used to solve a range of optimisation problems, and falls under the broad category of ‘artificial intelligence’ techniques. For an excellent in-depth summary, see chapter 16 of S. Kiranyaz’s 2014 book ‘Particle Swarm Optimisation’.
Semiconductor optical amplifiers (SOAs) are devices which, given (1) an electronic driving signal and (2) an optical input signal, will amplify the light signal by a combination of spontaneous and stimulated emission. This allows SOAs to act as a switch capable of switching light on and off. Light is a popular medium in which to communication information owing to its associated high bandwidth, energy efficiency, speed and equipment costs. However, to communicate with light, you must be able to switch and change the properties of your light signal. For certain applications, such as next-generation optical circuit switched data centre networks, the speed with which you can switch light signals is extremely important. It turns out that SOAs are excellent for switching light quickly, with theoretical switching speeds limited only by their ~100 pico- (10^-12) second excitation times. However, due to instability issues, this switching speed is in practice much slower (on the nano- (10^-9) second scale), which is too slow for many desirable applications.
To help fix instability issues and improve SOA switching times, researchers need to optimise their SOA. Optimisation can come in two forms; optimising the physical properties of the SOA and its surrounding setup, or optimising the electronic drive signal passed into the SOA in order to turn the SOA ‘on’. The most basic electronic drive signal to apply is the step drive signal:
However, this simple signal results in the following unstable optical output, resulting in nanosecond-scale switching times:
To remedy this, researchers previously attempted to apply a range of different electronic drive signals, from standard PID solutions from control theory to carefuly tuned PISIC and MISIC formats. However, none of these solutions proved to work sufficiently well to achieve sub-nanosecond (hundred-picosecond scale) switching, and none were scalable to the thousands/millions of SOAs each with different properties that you would find in a real optical communication network such as a data centre.
PSO Applied to SOA Drive Signal Optimisation¶
To help solve this short-coming in SOA drive signal optimisation, this package uses a particle swarm optimisation approach to optimising the electronic drive signal put into the SOA. The below figure is a step-by-step visualisation of how PSO was applied to the problem of SOA drive signal optimisation at the most basic level.
The paper implements a couple of other key ideas such as the concept of a PISIC shell to reduce the PSO algorithm’s search space and dynamic PSO, however the above is a succinct visualisation of the core idea.
Running Simulations¶
Note
As mentioned, this PSO code has not been cleanly implemented for the most part and is not actively maintained. There are definitely better ways of constructing it. This tutorial is intended to help you get started with the code and understand how PSO can be used to optimise SOAs.  Contact<EMAIL_ADDRESS>if you are interested in merging your code.
Note
In the below examples, to save time, only n = 3
particles have been used.
Having such a low number of particles allows for short optimsation times, but
will signficantly reduce the efficacy of the final optimal solution. To find
better solutions, you should increase the number of particles. If you change
certain hyperparameters, you may also need to change e.g. the number of particles.
For example, increasing the number of dimensions (i.e. number of points) in the
particles/drive signals will increase the size of the search space and therefore
also likely require more particles to find sufficiently good solutions.
A Walkthrough Example¶
In this example, you will see how to use PSO to optimise the driving signals for 10 different SOAs by simulating 10 different transfer functions.
In your Python script, start by importing the following core functionalities from the soa module:
from soa import devices, signalprocessing, analyse, distort_tf
from soa.optimisation import PSO, run_test
The purpose of each of the above is the following:
devices.py
: Module for interfacing with the SOA experimental setup (not needed if only using transfer function simulations)signalprocessing.py
: Module for generating standard literature SOA driving signals (e.g. PISIC, MISIC, etc.) and for evaluating optical response cost in terms of e.g. mean squared erroranalyse.py
: Module for analysing signal performance and retrieving optical output signal metrics (e.g. rise time, settling time, overshoot etc.)distort_tf.py
: Module for distorting the original SOA transfer function to generate new transfer functions and therefore simulate different SOAs (useful for testing the generalisability of your optimisation method(s))optimisation.py
: The main module that holds thePSO
class (the key class with the PSO algorithm, send & receive functionality for drive & optical signal(s) respectively, plotting, etc.) and therun_test
function, which is a function used for multiprocessing (running multiple PSO experiments in parallel - not required but recommended to speed up your tests).
Note
Use the above as a guide for when you want to add more functionality/find
a specific function being used by this soa
package/see how things work etc.
Feel free to add to, rewrite or replace any of the above modules/functions/methods/classes.`
Import any other useful packages you’d like to use
import numpy as np
import multiprocessing
import pickle
from scipy import signal
import os
import matplotlib.pyplot as plt
Create a folder on your local machine in which to store your PSO/SOA data and
create a directory
variable with the path to this folder:
directory = '../data/'
Initialise the basic parameters of the input and output signal you want to optimise:
num_points = 240 # number of points in the signal (corresponds to number of dimensions *m* for each particle)
time_start = 0 # time at which signal period should begin
time_stop = 20e-9 # time at which signal period should end
t = np.linspace(time_start, time_stop, num_points) # time axis of all signals
Configure the basic PSO hyperparameters:
n = 3 # number of particles (i.e. number of signals)
iter_max = 150 # maximum number of iterations to perform before stopping the PSO algorithm
rep_max = 1 # number of times to repeat PSO optimisation
max_v_f = 0.05 # maximum velocity factory by which to multiply the maximum parameter values by to get the maximum particle velocity for each iteration
init_v_f = max_v_f # factor by which to multiply initial positions by to get initial velocity for first iteration
cost_f = 'mSE' # cost function to use to evaluate performance. Must be 1 of: 'mSe', 'st', 'mSE+st', 's_mse+st', 'mse+st+os', 'zlpc'
w_init = 0.9 # initial intertia weight value (0 <= w <= 1)
w_final = 0.5 # final inertia weigth value (0 <= w <= 1)
on_suppress_f = 2.0 # factor by which to multiply initial guess by when in 'off' state and add to this to get space constraint
Define the initial drive signal (e.g. a step):
init_OP = np.zeros(num_points) # initial drive signal (e.g. a step)
init_OP[:int(0.25*num_points)],init_OP[int(0.25*num_points):] = -1, 0.5
Define the SOA(s) transfer function(s) you want to optimise for (N.B. init_OP must have a low point of -1 for the transfer function):
# initial transfer function numerator and denominator coefficients
num = [2.01199757841099e85]
den = [
1.64898505756825e0,
4.56217233166632e10,
3.04864287973918e21,
4.76302109455371e31,
1.70110870487715e42,
1.36694076792557e52,
2.81558045148153e62,
9.16930673102975e71,
1.68628748250276e81,
2.40236028415562e90,
]
tf = signal.TransferFunction(num, den)
tfs, _ = distort_tf.gen_tfs(num_facs=[1.0,1.2,1.4],
a0_facs=[0.8],
a1_facs=[0.7,0.8,1.2],
a2_facs=[1.05,1.1,1.2],
all_combos=False)
Get the initial output of the initial transfer function and derive the target set point that you want to optimise towards as your target:
init_PV = distort_tf.getTransferFunctionOutput(tf,init_OP,t)
sp = analyse.ResponseMeasurements(init_PV, t).sp.sp
Run your experiments in parallel using the multiprocessing functionality provided by run_test
:
pso_objs = multiprocessing.Manager().list()
jobs = []
test_nums = [test+1 for test in range(len(tfs))]
direcs = [directory + '/test_{}'.format(test_num) for test_num in test_nums]
for tf, direc in zip(tfs, direcs):
if os.path.exists(direc) == False:
os.mkdir(direc)
p = multiprocessing.Process(target=run_test,
args=(direc,
tf,
t,
init_OP,
n,
iter_max,
rep_max,
init_v_f,
max_v_f,
w_init,
w_final,
True,
'pisic_shape',
on_suppress_f,
True,
None,
cost_f,
None,
True,
True,
sp,
pso_objs,))
jobs.append(p)
p.start()
for job in jobs:
job.join()
Pickle your PSO objects so you can re-import and analyse them later:
PIK = directory + '/pickle.dat'
data = pso_objs
with open(PIK, 'wb') as f:
pickle.dump(data, f)
Pulling all of the above together, your script should look something like:
from soa import devices, signalprocessing, analyse, distort_tf
from soa.optimisation import PSO, run_test
import numpy as np
import multiprocessing
import pickle
from scipy import signal
import os
import matplotlib.pyplot as plt
# set dir to save data
directory = '../../data/'
# init basic params
num_points = 240
time_start = 0
time_stop = 20e-9
t = np.linspace(time_start, time_stop, num_points)
# set PSO params
n = 3
iter_max = 150
rep_max = 1
max_v_f = 0.05
init_v_f = max_v_f
cost_f = 'mSE'
w_init = 0.9
w_final = 0.5
on_suppress_f = 2.0
# define initial drive signal
init_OP = np.zeros(num_points) # initial drive signal (e.g. a step)
init_OP[:int(0.25*num_points)],init_OP[int(0.25*num_points):] = -1, 0.5
# initial transfer function numerator and denominator coefficients
num = [2.01199757841099e85]
den = [
1.64898505756825e0,
4.56217233166632e10,
3.04864287973918e21,
4.76302109455371e31,
1.70110870487715e42,
1.36694076792557e52,
2.81558045148153e62,
9.16930673102975e71,
1.68628748250276e81,
2.40236028415562e90,
]
tf = signal.TransferFunction(num, den)
tfs, _ = distort_tf.gen_tfs(num_facs=[1.0,1.2,1.4],
a0_facs=[0.8],
a1_facs=[0.7,0.8,1.2],
a2_facs=[1.05,1.1,1.2],
all_combos=False)
# get initial output of initial signal and use to generate a target set point
init_PV = distort_tf.getTransferFunctionOutput(tf,init_OP,t)
sp = analyse.ResponseMeasurements(init_PV, t).sp.sp
# run PSO tests in parallel with multiprocessing
pso_objs = multiprocessing.Manager().list()
jobs = []
test_nums = [test+1 for test in range(len(tfs))]
direcs = [directory + '/test_{}'.format(test_num) for test_num in test_nums]
for tf, direc in zip(tfs, direcs):
if os.path.exists(direc) == False:
os.mkdir(direc)
p = multiprocessing.Process(target=run_test,
args=(direc,
tf,
t,
init_OP,
n,
iter_max,
rep_max,
init_v_f,
max_v_f,
w_init,
w_final,
True,
'pisic_shape',
on_suppress_f,
True,
None,
cost_f,
None,
True,
True,
sp,
pso_objs,))
jobs.append(p)
p.start()
for job in jobs:
job.join()
# pickle PSO objects so can re-load later if needed
PIK = directory + '/pickle.dat'
data = pso_objs
with open(PIK, 'wb') as f:
pickle.dump(data, f)
Run the above by executing your Python script. Some information will be printed out in your terminal telling you how many iterations have passed and how much the ‘cost’ (in the above example, the mean squared error) has been reduced by so far.
Note
Since the above example uses multiprocessing by running the 10 tests
in parallel, the information will be printed out to your terminal in parallel,
which is quite messy. Feel free to go into the PSO code in optimisation.py
and organise this
to improve the message printed out (if any message at all).
In your directory
path, you should now have a folder for each of the tests
you ran (in the above example, you used multiprocessing to run a PSO optimisation
for 10 different transfer functions (SOAs) in parallel, so you have 10 test folders
(one for each test you ran)). You should also have the PSO objects saved as a
pickle so that you can re-load them later if needed.
In each test file, there is a data folder which contains a folder whose name is automatically determined by the hyperparameters you used. Inside this folder is some key data:
The data saved is either a .png
file (for quick visualisation of what your
PSO run has done) or a .csv
file (for loading and analysing yourself). In the
above folder, the key data are:
0_gen_inputs.png
: The input driving signals at the 0th generation of the PSO i.e. before any optimisation has begun (as described in the paper, we embed a particle whose position is equivalent to a step driving signal, which initially will be better than all other particles since other particle positions are randomly initialised (within the PISIC shell constrained area)). In the above example, we usedn = 3
particles, therefore there are 3 driving signals (and a 4th driving signal, which is the embedded step signal)
0_gen_outputs.png
: The corresponding output driving signals of the 0th generation particles
For each repetition of the PSO, there will be a rep_X
folder. Since you set
rep_max = 1
in the above example, there is only one repetition folder, rep_1
.
Inside this rep_1
folder are they key PSO data.
Again, the raw data is saved as a .csv
file, and some .png
images are
saved for quick visualisation of the PSO optimisation process. In the above folder,
the PSO class was configured to save data every 7 generations. Some of the key data
saved includes:
X_gen_inputs
: Particle (driving signal) positions at generation XX_gen_outputs
: Corresponding SOA optical output in response to particle driving signals at generation Xcurr_inputs_X
: Raw data of particle positions at generation X (useful to save incase PSO crashes and want to resume without having to start over)curr_outputs_X
: Raw data of corresponding optical outputs of particle positionsfinal_input
: The final ‘optimal’ driving signal found by the PSO optimisation process after finishing all iterationsfinal_output
: The corresponding SOA optical output of the final optimal driving signalfinal_learning_curve
: How the ‘cost’ (in the above example, the mean squared error) varied with the number of PSO iterationsg_best_cost_history
: The global best costs that were found across all iterationsiter_gbest_reached
: The corresponding iteration that each global best cost value was found at (use these data to plot cost curves)initial_OP
: The initial driving signal (in the above example, a step driving signal)initial_PV
: The corresponding optical output of the initial driving signaloptimised_OP
: The final optimised driving signal found by the PSOoptimised_PV
: The corresponding optical output of the final optimsed driving signalpbest_post_X
: The personal best position found by each particle at iteration Xrt_st_os_analysis
: The rise time, settling time, overshoot, and settling time index (i.e. the index in the output signal at which the signal was registered as having settled) of the best particle’s corresponding optical output at each iteration of the PSOrtstos_learning_curve
: Hoe rise time, settling time and overshoot varied across iterationsSP
: The target set point that was used as the target SOA optical output signal that the PSO was trying to achieve (in the above example, a step signal with 0 rise time, settling and rise time generated from the initial PV)time
: The time axis used by all signals
Looking at what the PSO did in the above examples, you can see that it converged on an interesting final driving signal with an improved corresponding optical output signal:
This led to a significant decrease in settling time, which is usually considered the key metric for switching time:
Additional Example Scripts¶
Running PSO with 120, 140, 160, 180, 200, 220 and 240 dimensions (number of points in the drive signal):
from soa import devices, signalprocessing, analyse, distort_tf
from soa.optimisation import PSO, run_test
import numpy as np
import multiprocessing
import pickle
from scipy import signal
import os
import matplotlib.pyplot as plt
# set dir to save data
directory = '../../data/'
# init basic params
num_points_list = np.arange(120, 260, 20)
time_start = 0
time_stop = 20e-9
# set PSO params
n = 3
iter_max = 150
rep_max = 1
max_v_f = 0.05
init_v_f = max_v_f
cost_f = 'mSE'
w_init = 0.9
w_final = 0.5
on_suppress_f = 2.0
# initial transfer function numerator and denominator coefficients
num = [2.01199757841099e85]
den = [
1.64898505756825e0,
4.56217233166632e10,
3.04864287973918e21,
4.76302109455371e31,
1.70110870487715e42,
1.36694076792557e52,
2.81558045148153e62,
9.16930673102975e71,
1.68628748250276e81,
2.40236028415562e90,
]
tf = signal.TransferFunction(num, den)
# run PSO tests in parallel with multiprocessing
pso_objs = multiprocessing.Manager().list()
jobs = []
for num_points in num_points_list:
# make directory for this test
direc = directory + '/num_points_{}'.format(num_points)
if os.path.exists(direc) == False:
os.mkdir(direc)
# basic params
t = np.linspace(time_start, time_stop, num_points)
# define initial drive signal
init_OP = np.zeros(num_points) # initial drive signal (e.g. a step)
init_OP[:int(0.25*num_points)],init_OP[int(0.25*num_points):] = -1, 0.5
# get initial output of initial signal and use to generate a target set point
init_PV = distort_tf.getTransferFunctionOutput(tf,init_OP,t)
sp = analyse.ResponseMeasurements(init_PV, t).sp.sp
p = multiprocessing.Process(target=run_test,
args=(direc,
tf,
t,
init_OP,
n,
iter_max,
rep_max,
init_v_f,
max_v_f,
w_init,
w_final,
True,
'pisic_shape',
on_suppress_f,
True,
None,
cost_f,
None,
True,
True,
sp,
pso_objs,))
jobs.append(p)
p.start()
for job in jobs:
job.join()
# pickle PSO objects so can re-load later if needed
PIK = directory + '/pickle.dat'
data = pso_objs
with open(PIK, 'wb') as f:
pickle.dump(data, f)
Overview of Backend PSO and SOA Code¶
The following Python files make up the backend of this package:
devices.py
: Module for interfacing with the SOA experimental setup (not needed if only using transfer function simulations)signalprocessing.py
: Module for generating standard literature SOA driving signals (e.g. PISIC, MISIC, etc.) and for evaluating optical response cost in terms of e.g. mean squared erroranalyse.py
: Module for analysing signal performance and retrieving optical output signal metrics (e.g. rise time, settling time, overshoot etc.)distort_tf.py
: Module for distorting the original SOA transfer function to generate new transfer functions and therefore simulate different SOAs (useful for testing the generalisability of your optimisation method(s))optimisation.py
: The main module that holds thePSO
class (the key class with the PSO algorithm, send & receive functionality for drive & optical signal(s) respectively, plotting, etc.) and therun_test
function, which is a function used for multiprocessing (running multiple PSO experiments in parallel - not required but recommended to speed up your tests).
You are encouraged to change the code in these, add new functionality, re-write parts
etc. Each file has reasonably good comments and you should be able to follow the code.
optimisation.py
is the key file which holds the PSO code, so this is likely the file
you will want to become most familiar with.


Recursion
| About Me | Media | Blog | Contact |
1/31/2016
Hey there, this post will be me doing some research on recursion and attempting to explain it.
So I haven't really worked with recursion yet, so what I'm about to write is just based on some prelimiary research I've done.
Recursion is the idea that a solution to a problem depends on solution to smaller instances of the same problem. It is executed by having a function call itself. Recrusion is an alternative to interation.
Recursion is the combination of base cases and recursive cases. A recursive case is a case where the function is required to call itself to progress, whereas a base case is when the problem has been reduced enough for the function to solve it without calling itself again. A base case must be tested and must existed or else an infinite loop is triggered.


Broker: Allows information to be stored and consumed by the various modules in the project.
Broker Topics:"moodprismTopic" -> Raw data generated by the client. This data is consumed by MoodPrism and presented directly in the dashboard. "moodTopic" -> Data sent to be consumed by the moodApp. The moodApp then consumes the data and assings to each user a mood classification. This mood is then sent to the broker with the topic "moodPrismTopic".
Moodprism: Application that consumes all the data stored in the broker and sends it in JSON format to a web application.
MoodApp: Application that consumes data from the broker and assigns a mood classification. This classification is then inserted into the broker.
ClientApp: Application inicitialized on the client size, sends the information obtained through the keyboard and mouse to the broker. When starting, this application acepts two arguments, the first being the username and the second being the ip to where the information is being sent.
FrontEnd: The front-end is built with React, that allows the injection of the information obtained in the back-end, and is dynamic, meaning that it is capable of handling a different number of users at any given time.
How to access: The web application with just JSON information can be accessed on <IP_ADDRESS>:10080. The web application with information organized through React can be accessed on <IP_ADDRESS>:1070.
Logging:
For the logging of our microservices we use the logging framework Logback and the ELK Stack. The Logback framework allows us to send logs about kafka messages directly to the Logstack via configuration file with a Logback appender.
The Logstash then process the JSON Log Data and sends it to the ElasticSearch that, with Kibana, allows us to visualize statistical data about the kafka messages that were sent over time in a chronological order.
We can also track how many messages are exchanging in our system and therefore analyze its performance.
Jenkins Pipeline:
Stage Build: Used to generate jar file.
Stage Test: Used to start the tests created. (Tests are not 100% funcitional)
Stage Deploy: Used t send the jar to the Artyfactory.
Stage Build Docker Image: Used to generate Docker Image, tag and push it to the Registry.
Stage Deploy RunTime: Used to send the image to the VM.


Class: Sunspot::Search::PaginatedCollection
- Inherits:
-
Object
- Object
- Sunspot::Search::PaginatedCollection
- Defined in:
- sunspot/lib/sunspot/search/paginated_collection.rb
Instance Attribute Summary (collapse)
-
- (Object) current_page
readonly
Returns the value of attribute current_page.
-
- (Object) per_page
(also: #limit_value)
readonly
Returns the value of attribute per_page.
-
- (Object) total_count
(also: #total_entries)
readonly
Returns the value of attribute total_count.
Instance Method Summary (collapse)
- - (Boolean) first_page?
-
- (PaginatedCollection) initialize(collection, page, per_page, total)
constructor
A new instance of PaginatedCollection.
- - (Boolean) last_page?
- - (Object) next_page
- - (Object) offset
- - (Boolean) out_of_bounds?
- - (Object) previous_page
- - (Object) total_pages (also: #num_pages)
Constructor Details
- (PaginatedCollection) initialize(collection, page, per_page, total)
A new instance of PaginatedCollection
11 12 13 14 15 16 |
# File 'sunspot/lib/sunspot/search/paginated_collection.rb', line 11 def initialize(collection, page, per_page, total) @collection = collection @current_page = page @per_page = per_page @total_count = total end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
- (Object) method_missing(method, *args, &block) (private)
49 50 51 |
# File 'sunspot/lib/sunspot/search/paginated_collection.rb', line 49 def method_missing(method, *args, &block) @collection.send(method, *args, &block) end |
Instance Attribute Details
- (Object) current_page (readonly)
Returns the value of attribute current_page
7 8 9 |
# File 'sunspot/lib/sunspot/search/paginated_collection.rb', line 7 def current_page @current_page end |
- (Object) per_page (readonly) Also known as: limit_value
Returns the value of attribute per_page
7 8 9 |
# File 'sunspot/lib/sunspot/search/paginated_collection.rb', line 7 def per_page @per_page end |
- (Object) total_count (readonly) Also known as: total_entries
Returns the value of attribute total_count
7 8 9 |
# File 'sunspot/lib/sunspot/search/paginated_collection.rb', line 7 def total_count @total_count end |
Instance Method Details
- (Boolean) first_page?
23 24 25 |
# File 'sunspot/lib/sunspot/search/paginated_collection.rb', line 23 def first_page? current_page == 1 end |
- (Boolean) last_page?
27 28 29 |
# File 'sunspot/lib/sunspot/search/paginated_collection.rb', line 27 def last_page? current_page >= total_pages end |
- (Object) next_page
35 36 37 |
# File 'sunspot/lib/sunspot/search/paginated_collection.rb', line 35 def next_page current_page < total_pages ? (current_page + 1) : nil end |
- (Object) offset
43 44 45 |
# File 'sunspot/lib/sunspot/search/paginated_collection.rb', line 43 def offset (current_page - 1) * per_page end |
- (Boolean) out_of_bounds?
39 40 41 |
# File 'sunspot/lib/sunspot/search/paginated_collection.rb', line 39 def out_of_bounds? current_page > total_pages end |
- (Object) previous_page
31 32 33 |
# File 'sunspot/lib/sunspot/search/paginated_collection.rb', line 31 def previous_page current_page > 1 ? (current_page - 1) : nil end |
- (Object) total_pages Also known as: num_pages
18 19 20 |
# File 'sunspot/lib/sunspot/search/paginated_collection.rb', line 18 def total_pages (total_count.to_f / per_page).ceil end |


--- layout: post date: 2012-12-01 17:27:00 +0100 title: "rc bug #694670: kscd does not play any CD" categories: Artikel tags: - debian ---
Dear Lazyweb,
I recently investigated #694670 - kscd
does not play any CD — essentially, at least on my machine, phonon-based
applications such as kscd won’t play Audio CDs when your CD drive is not called
/dev/cdrom
, but e.g. /dev/cdrom5
because I have had
multiple CD drives connected to my machine.
Now, I am not very deeply involved into KDE or phonon in particular. Therefore,
I am asking: Is there anyone who could have a look into this issue? It should
be easy to reproduce, you can simply append "5" to "cdrom" in
/etc/udev/rules.d/70-persistent-cd.rules
and reboot afterwards.
As an outsider, I am somewhat baffled by the complexity of C++, phonon, gstreamer, etc. All these layers of abstraction are not that easy to debug, at least not for me. Good blog posts about digging into this issue are appreciated :-).


{% extends 'base.html' %} {% block content %}
These guidelines are meant to help frame a focused conversation about education. Any set of guidelines requires interpretation, so please read between the lines and consider how we can use these guidelines to help establish and maintain a focused and constructive conversation.
These guidelines are written half as an introduction for people to read when they join Educator News, and half as a reference when people are helping new users understand how to interact on the site. Feel free to read them all the way through or skim them, but please also consider linking to them when you are helping new users learn what kinds of submissions to make.
Most submissions should be related to education in some direct way. That said, education covers many areas: teaching, learning, school structures, policy, social interactions, and much much more. If you think an article will stimulate meaningful discussion about an issue related to education, go ahead and submit it.
This is a more specific list than what to submit, because there are a number of submission types that we want to avoid. Most submissions that fall into these categories will be quickly flagged and ignored.
Please write comments that add something to the discussion. React to something from the article, or something specific that another commenter said. Add some of your own experience, or a point that someone missed.
Please don't write the following kinds of comments:
In general, voting is for the quality of submissions, not whether you agree or disagree with a submission. Flagging is for distracting and abusive submissions only, and definitely not for submissions you simply disagree with.
Please upvote articles that you find interesting. Articles that spur meaningful, constructive discussion. Articles that help you understand how teaching and learning can be done well. Articles that shed light on contentious issues in education.
Please flag articles that are off-topic, and should not have been submitted in the first place. Please don't flag articles that you simply don't like, or just disagree with.
Please upvote comments that add to the overall discussion. Comments that make an insightful observation, that share relevant experiences, that help people see the issue in a different light.
Please don't downvote comments that you disagree with. Downvoting is for comments that detract from the overall conversation. If you downvote someone, please consider letting them know why they are being downvoted, so they will make better comments next time.
Flagging is for comments that go pretty clearly against the overall spirit of the site. Flagging is for abusive, aggressive, or spam-type comments. Flagged comments will disappear pretty quickly, and users with many flagged comments may have their accounts reviewed. Users who consistently write abusive and unwanted comments will simply be ignored. Their posts will become invisible by default.
topDownvoting and flagging serve very specific purposes in framing a meaningful conversation. They should not be used against people you simply disagree with. People gain downvoting and flagging privileges when their overall karma reaches a certain threshold. People have to interact meaningfully on the site before they can start downvoting and flagging.
Users who demonstrate a pattern of downvoting and flagging well-constructed comments that they simply disagree with may have their downvoting and flagging privileges revoked.
topThank you for looking over these guidelines, and helping us frame a meaningful conversation about education. Please share feedback if you have any constructive criticism of the guidelines.
{% endblock %}


{% extends "_layouts/sidebar-left.html" %} {% set bodyClass = "docs-samples" %} {% set headline = 'Developer Documentation' %} {% set tagline = 'Let’s Build Something Powerful Together!' %} {% set stickyNavOffsetTop = 332 %} {% block sidebar %}
{% endblock %} {% block content %}You can list the servers in a particular region in summary form, with only the name and ID returned, or in detailed form, with all available fields returned.
To retrieve a summary list of servers in a particular region, send a GET
HTTP request to /v2/{tenantId}/servers
, replacing {tenantId}
with your tenant ID.
To retrieve a detailed list of servers in a particular region, send a GET
HTTP request to /v2/{tenantId}/servers/detail
, replacing {tenantId}
with your tenant ID.
Various filters may be applied to either the summary or detailed lists by appending any of the following query string parameters to the request:
| Parameter Key | Description |
|---|---|
image |
Only list servers with this image ID. For a list of images, see Section 2.7.1, “List Images”. |
flavor |
Only list servers with this flavor ID. For a list of flavors, see Section 2.6.1, “List Flavors”. |
name |
Only list servers with this name. |
status |
Only list servers with this status. See Server Status Values. |
marker |
The ID of the last item in the previous page of entries. See Section 1.6, “Paginated Collections”. |
limit |
The number of servers to show in a single page. |
changes-since |
Only show servers that have changed since this date/time. See Section 1.7, “Efficient Polling with the Changes-Since Parameter”. |
RAX-SI:image_schedule |
Whether scheduled images are enabled or not. If the value is the boolean keyword TRUE , the list contains all servers that have an image schedule resource set on them. If the value is the boolean keyword FALSE , the list contains all servers that do not have an image schedule. (This URI parameter is added by the Rackspace Scheduled Images API Extension. See Section 3.5, “Scheduled Images Extension”). |
GET /v2/123456/servers
X-Auth-Token: your_auth_token
Accept: application/json
GET /v2/123456/servers/detail
X-Auth-Token: your_auth_token
Accept: application/json
GET /v2/123456/servers/detail?status=SUSPENDED
X-Auth-Token: your_auth_token
Accept: application/json
The API will respond with a JSON document that has a single property named servers
. This property will contain an array of objects, each of which represents a single server.
{
"servers": [
{
"status": "ACTIVE",
"updated": "2015-07-17T13:54:56Z",
"hostId": "0b192345b527aa1d97ea4e989aeeff8582fd404e9c50f65b97a32834",
"addresses": {
"public": [
{
"version": 4,
"addr": "<IP_ADDRESS>"
},
{
"version": 6,
"addr": "2001:4800:7810:512:be76:4eff:fe04:f021"
}
],
"private": [
{
"version": 4,
"addr": "<IP_ADDRESS>"
}
]
},
"links": [
{
"href": "https://dfw.servers.api.rackspacecloud.com/v2/123456/servers/39e6d789-52be-448a-b949-9b6f4b5865e2",
"rel": "self"
},
{
"href": "https://dfw.servers.api.rackspacecloud.com/123456/servers/39e6d789-52be-448a-b949-9b6f4b5865e2",
"rel": "bookmark"
}
],
"key_name": null,
"image": {
"id": "3afe97b2-26dc-49c5-a2cc-a2fc8d80c001",
"links": [
{
"href": "https://dfw.servers.api.rackspacecloud.com/123456/images/3afe97b2-26dc-49c5-a2cc-a2fc8d80c001",
"rel": "bookmark"
}
]
},
"RAX-PUBLIC-IP-ZONE-ID:publicIPZoneId": "695c1e46fe17571fe18fe724680b1ee21ecc3c9846561e7b00755941",
"OS-EXT-STS:task_state": null,
"OS-EXT-STS:vm_state": "active",
"flavor": {
"id": "2",
"links": [
{
"href": "https://dfw.servers.api.rackspacecloud.com/123456/flavors/2",
"rel": "bookmark"
}
]
},
"id": "39e6d789-52be-448a-b949-9b6f4b5865e2",
"user_id": "90422bda06e645b081afa9c96d6e6eea",
"name": "test-server",
"created": "2015-07-17T13:50:51Z",
"tenant_id": "123456",
"OS-DCF:diskConfig": "AUTO",
"accessIPv4": "<IP_ADDRESS>",
"accessIPv6": "2001:4800:7810:512:be76:4eff:fe04:f021",
"progress": 100,
"OS-EXT-STS:power_state": 1,
"config_drive": "",
"metadata": {}
}
]
}
Servers may have a variety of statuses during their lifecycle:
| Status | Description |
|---|---|
ACTIVE |
The server is active and ready to use. |
BUILD |
The server is being built. |
DELETED |
The server was deleted. The list servers API operation does not show servers with a status of DELETED. To list deleted servers, use the changes-since parameter. See Section 1.7, “Efficient Polling with the Changes-Since Parameter”. |
ERROR |
The requested operation failed and the server is in an error state. |
HARD_REBOOT |
The server is going through a hard reboot. A hard reboot power cycles your server, which performs an immediate shutdown and restart. See Section 2.4.2, “Reboot Server”. |
MIGRATING |
The server is being moved from one physical node to another physical node. Server migration is a Rackspace extension. |
PASSWORD |
The password for the server is being changed. See Section 2.4.1, “Change Administrator Password”. |
REBOOT |
The server is going through a soft reboot. During a soft reboot, the operating system is signaled to restart, which allows for a graceful shutdown and restart of all processes. See Section 2.4.2, “Reboot Server”. |
REBUILD |
The server is being rebuilt from an image. See Section 2.4.3, “Rebuild Server”. |
RESCUE |
The server is in rescue mode. Rescue mode is a Rackspace extension. See Section 3.3, “Rescue Mode Extension”. |
RESIZE |
The server is being resized and is inactive until the resize operation completes. See Section 2.4.4, “Resize Server”. |
REVERT_RESIZE |
A resized or migrated server is being reverted to its previous size. The destination server is being cleaned up and the original source server is restarting. For a server that was resized, see Section 2.4.4, “Resize Server”. Server migration is a Rackspace extension. |
SUSPENDED |
The server is inactive, either by request or necessity. Review support tickets or contact Rackspace support to determine why the server is in this state. |
UNKNOWN |
The server is in an unknown state. Contact Rackspace support. |
VERIFY_RESIZE |
The server is waiting for the resize operation to be confirmed so that the original server can be removed. |
| Code | Description |
|---|---|
400 |
Bad Request. Typically caused by a parameter of the wrong type. |
401 |
Unauthorized. Typically caused by an invalid authentication token or tenant ID. |
403 |
Forbidden. |
405 |
Method Not Allowed. Caused by sending a request with an invalid HTTP verb. For listing servers, GET is the only valid request type. |
413 |
Over Limit. You have exceeded your limit for API requests of this type. |
503 |
Service Unavailable. An internal error is is preventing the API from serving requests. |
This operation asynchronously provisions a new server. After submitting a JSON document with configuration details for the new server, the API will provide a progress URL that can be polled to monitor the server's creation status.
To create a server, send a POST
HTTP request to /v2/{tenantId}/servers
, where {tenantId}
is the tenant ID for which you would like to create the server.
Your request body should be a JSON document with a single object named server
, containing several properties that will determine what kind of server you will create.
| Parameter | Type | Description |
|---|---|---|
name |
string | The name of your server |
imageRef |
string | The id of the image you want to use when creating your server. This is often referred to as the operating system. |
flavorRef |
string | The id of the flavor you want to use when creating your server. This is often referred to as the size of the instance. |
key_name optional |
string | The name of the SSH Key to use when creating your server. The name must already exist. See creating SSH keys for more information.key_name is required if the flavorRef is an OnMetal flavor. |
metadata optional |
object | Key/Value pairs for metadata to attach to your server. |
networks optional |
array | One or more object with the key uuid and value of the network id to attach to this instance. See using networks when creating a server for more information. |
personality optional |
array | One or more object with the path of the file to create and contents (Base64 encoded) of the file contents. See using personality when creating a server for more information. |
user_data optional |
string | The base64 contents of a file to be created. |
OS-DCF:diskConfig optional |
string |
Used to set the disk configuration to MANUAL . Default is set to AUTO . See more details about disk configuration.
|
config_drive optional |
boolean | If set to true , the system will use data in one or both of user_data and personality to configure the server. Defaults to false . |
If an image has OS-DCF:diskConfig
value of MANUAL
, you cannot create a server from that image with a OS-DCF:diskConfig
value of AUTO
.
OnMetal servers must be created using an ssh key pair. Thus you should ignore the administrator password returned by a Create Server operation because it does not allow access to the OnMetal server. See Section 2.2, “Server Key Pairs” for more information about key pairs.
POST /v2/123456/servers
X-Auth-Token: your_auth_token
Content-Type: application/json
Accept: application/json
{
"server" : {
"name" : "api-test-server-1",
"imageRef" : "3afe97b2-26dc-49c5-a2cc-a2fc8d80c001",
"flavorRef" : "2",
"key_name":"name_of_keypair",
"config_drive": true,
"OS-DCF:diskConfig" : "AUTO",
"metadata" : {
"My Server Name" : "API Test Server 1"
},
"networks": [
{
"uuid": "4ebd35cf-bfe7-4d93-b0d8-eb468ce2245a"
},
{
"uuid": "00000000-0000-0000-0000-000000000000"
},
{
"uuid": "11111111-1111-1111-1111-111111111111"
}
],
"personality" : [
{
"path" : "/etc/banner.txt",
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
}
],
"config_drive": true
}
}
Although the API will respond immediately with some information, the process of actually creating the server will take some time. The initial response from the API gives you all the information you need in order to check on the server's status while it's being created.
The full URL to the newly created server is returned through the Location
header and is available as a self and bookmark link in the server representation. See Links and References.
When you create a server, only the server ID, its links, and the administrator password are guaranteed to be returned in the request.
The API will respond with the status code 202 Accepted
if the creation request was successful. Any other status code indicates an error.
| Status Code | Reason |
|---|---|
400 |
Bad Request. Often as a result of invalid arguments. |
401 |
Unauthorized. Check your Auth-Token . See Authentication for more on Authentication Tokens. |
403 |
Forbidden. |
404 |
Item not found. |
405 |
Method not allowed. |
413 |
Over limit. You may need to request increased limits for your account. See limits for more on resource limits. |
415 |
Bad media type. |
500 |
Compute fault. |
503 |
Service unavailable. |
503 |
Server capacity unavailable. This is an exceptional error that may only occur when region capacity has been exhausted. |
202 Accepted
Content-Type: application/json
Location: https://dfw.servers.api.rackspacecloud.com/010101/servers/ed5c7754-29b6-45fa-96cb-ab64958c8c0a
{
"server": {
"id":"2f881cd9-44c5-4178-a176-1bc07eb1cfb9",
"adminPass":"PkJ68cNqoQP2",
"OS-DCF:diskConfig":"AUTO",
"links": [
{
"href":"https://dfw.servers.api.rackspacecloud.com/010101/servers/ed5c7754-29b6-45fa-96cb-ab64958c8c0a",
"rel":"self"
},
{
"href":"https://dfw.servers.api.rackspacecloud.com/010101/servers/ed5c7754-29b6-45fa-96cb-ab64958c8c0a",
"rel":"bookmark"
}
]
}
}
After a successful request to create a server, the API will provide a URL that can be used to monitor the server creation process. You can check the progress of your server build by sending a GET
request to the new server's URI.
The progress
property will be an integer between 0 and 100, indicating the completion percentage.
The status
property will be "BUILD"
until the build has either succeeded or failed. If the build was successful, this property will change to "ACTIVE"
. If the build failed, this property will change to "ERROR"
Several other properties of the server object may not be populated until the server has completed building.
Tip
For OnMetal server builds, even after the status is ACTIVE, wait a few additional moments for the network configuration to complete. Once the new OnMetal server pings successfully, you may begin to use it.
GET /v2/123456/servers/d54891dd-584f-43c4-9c7a-e95815392f7d
X-Auth-Token: your_auth_token
Accept: application/json
{
"server": {
"status": "BUILD",
"updated": "2015-07-16T21:22:38Z",
"hostId": "73f8f30edf612f5bd28637e3fab0edbcc3dd87faf1f3d81aa9c9f83b",
"addresses": {},
"links": [
{
"href": "https://dfw.servers.api.rackspacecloud.com/v2/123456/servers/d54891dd-584f-43c4-9c7a-e95815392f7d",
"rel": "self"
},
{
"href": "https://dfw.servers.api.rackspacecloud.com/123456/servers/d54891dd-584f-43c4-9c7a-e95815392f7d",
"rel": "bookmark"
}
],
"key_name": null,
"image": {
"id": "3afe97b2-26dc-49c5-a2cc-a2fc8d80c001",
"links": [
{
"href": "https://dfw.servers.api.rackspacecloud.com/123456/images/3afe97b2-26dc-49c5-a2cc-a2fc8d80c001",
"rel": "bookmark"
}
]
},
"RAX-PUBLIC-IP-ZONE-ID:publicIPZoneId": "695c1e46fe17571fe18fe724680b1ee21ecc3c9846561e7b00755941",
"OS-EXT-STS:task_state": "spawning",
"OS-EXT-STS:vm_state": "building",
"flavor": {
"id": "2",
"links": [
{
"href": "https://dfw.servers.api.rackspacecloud.com/123456/flavors/2",
"rel": "bookmark"
}
]
},
"id": "d54891dd-584f-43c4-9c7a-e95815392f7d",
"user_id": "904224da0696454081afa9c96d69699a",
"name": "api-test-server-1",
"created": "2015-07-16T21:22:33Z",
"tenant_id": "123456",
"OS-DCF:diskConfig": "AUTO",
"accessIPv4": "",
"accessIPv6": "",
"progress": 30,
"OS-EXT-STS:power_state": 0,
"config_drive": "",
"metadata": {}
}
}
You can get additional attributes by issuing a GET requests on the server. See Section 2.1.4, “Get Server Details”.
See Section 3.8, “Config Drive Extension” for details about using config_drive when creating servers.


Sakoi Restaurant at the Sakoi Hotel, Kensington, London. A twist on the traditional Japanese izakaya style of informal dining.
Our bars feature expertly crafted cocktails and lorem ipsum dolor.
Teppanyaki dishes theatrically sliced, diced and cooked at diners' tables on a hibachi grill.
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Ex labore, tempora tempore magni nihil vitae quod quis ullam cumque consectetur. Veritatis dignissimos soluta laudantium aspernatur velit adipisci, aliquid at natus, vitae iste, id obcaecati ipsam pariatur ratione.


Government accused of allocating GHC6m to NPP communicators in 2020 budget
A budget line in the 2020 Budget has come under scrutiny as being a possible tool to fund the New Patriotic Party (NPP) communicators.
The issue was first raised by the Ranking Member of the Parliamentary Select Committee on Agriculture, Food and Cocoa Affairs, Eric Opoku, on the Floor of Parliament on Wednesday.
He noted that there was a GHC6 million allocation to Government Communication in the budget under the section for expenditure under Government flagship programmes.
In his submission, Mr Opoku said more clarity was needed on that budget line.
“Mr Speaker that programme is to cost the Ghanaian taxpayer GHS6 million. Information on this programme is scanty in the budget and to erase the impression that in an election year, the government intends using state resources to pay NPP communicators, we demand further and better particulars.”
Speaking on Eyewitness News, later on, the Member of Parliament for Ningo Prampram, Sam George said he was convinced the government was taking taxpayer money and putting it into “partisan affairs.”
He argued that the various flagship policies already had funding for communications.
“Almost all of these flagship programmes have a secretariat and those secretariats have spokespersons… again they have sectorial spokespersons.”
But a Deputy Information Minister, Pius Enam Hadzide, however, defended the budget line as necessary to the government’s communication strategy.
Also speaking on Eyewitness News, he said the money was in service of “an open and transparent government system.”
“The instruction of His Excellency are that the Ministry of Information, which has the mandate of informing the people of Ghana on the projects, programmes and policies of government… we have to pay particular attention to educating the people about the far-reaching implications of these [flagship] policies with the view that we can carry the people with the government.”


|
reVision
5.0.0
Video game engine project.
|
A rendering technique responsible for rendering/updating shadow casters in the scene. More...
#include <Shadow_Technique.h>
Public Member Functions | |
| ~Shadow_Technique () | |
| Destroy this shadow technique. More... | |
| Shadow_Technique (Engine &engine, std::vector< Camera * > &sceneCameras) | |
| Construct a shadow technique. More... | |
| void | clearCache (const float &deltaTime) noexcept final |
| Prepare this technique for the next frame, swapping any of its buffers. More... | |
| void | updateCache (const float &deltaTime, ecsWorld &world) final |
| Update any data needed before rendering this frame. More... | |
| void | updatePass (const float &deltaTime) final |
| Perform any pre-requisite rendering passes. More... | |
| ShadowData & | getShadowData () noexcept |
| Retrieve this technique's shadow data. More... | |
| Public Member Functions inherited from Graphics_Technique | |
| virtual | ~Graphics_Technique ()=default |
| Virtual Destructor. More... | |
| Graphics_Technique () noexcept=default | |
| Default constructor. More... | |
| Graphics_Technique (const Technique_Category &category) noexcept | |
| Constructor. More... | |
| Graphics_Technique (Graphics_Technique &&) noexcept=default | |
| Move constructor. More... | |
| Graphics_Technique (const Graphics_Technique &) noexcept=default | |
| Copy constructor. More... | |
| Technique_Category | getCategory () const noexcept |
| Retrieve the category this technique belongs to. More... | |
| void | setEnabled (const bool &state) noexcept |
| Turn this technique on or off. More... | |
| Graphics_Technique & | operator= (Graphics_Technique &&) noexcept=default |
| Move assignment. More... | |
| Graphics_Technique & | operator= (const Graphics_Technique &) noexcept=default |
| Copy assignment. More... | |
| virtual void | renderTechnique (const float &deltaTime, Viewport &viewport, const std::vector< std::pair< int, int >> &perspectives) |
| Apply this lighting technique. More... | |
Additional Inherited Members | |
| Public Types inherited from Graphics_Technique | |
| enum | Technique_Category : unsigned int { GEOMETRY = 0b0000'0001, PRIMARY_LIGHTING = 0b0000'0010, SECONDARY_LIGHTING = 0b0000'0100, POST_PROCESSING = 0b0000'1000, ALL = 0b1111'1111 } |
| The category of the technique. More... | |
| Protected Attributes inherited from Graphics_Technique | |
| bool | m_enabled = true |
| Technique_Category | m_category |
A rendering technique responsible for rendering/updating shadow casters in the scene.
| Shadow_Technique::~Shadow_Technique | ( | ) |
Destroy this shadow technique.
Construct a shadow technique.
| engine | reference to the engine to use. |
| sceneCameras | reference to the scene cameras to use. |
|
finalvirtualnoexcept |
Prepare this technique for the next frame, swapping any of its buffers.
| deltaTime | the amount of time passed since last frame. |
Reimplemented from Graphics_Technique.
|
noexcept |
Retrieve this technique's shadow data.
|
finalvirtual |
Update any data needed before rendering this frame.
| deltaTime | the amount of time passed since last frame. |
| world | the ecsWorld to source data from. |
Reimplemented from Graphics_Technique.
|
finalvirtual |
Perform any pre-requisite rendering passes.
| deltaTime | the amount of time passed since last frame. |
Reimplemented from Graphics_Technique.


I learnt that I sometimes read into things with that person, because they don't like to expand on certain things. They don't want to make things seem "over the top". They realised that they sometimes don't communicate effectively, as they aren't aware of what they are saying. I learnt that I am a good communicator when I slow down and think before I speak.
Without a doubt I will use the circuit training technique. I think it was interesting to train your mind using different techniques, as these different techniques help strengthen the overall ability to meditate. What I mean by this is focussing on something neutral for three minutes and thinking about my breathing, then for three minutes, focus on everything but be aware of each thing that crosses my mind.
I think it was interesting to be fully involved with listening to someone, that you don't even let your emotions come into play and "inner chat".


Always in under 5 minutes.
Export text selections to video sequence.
See the user manual for for a walkthrough on how to use it.
Sign up to the mailing list, follow on twitter and/or facebook to keep up to date with the latest releases. Say hi at<EMAIL_ADDRESS>always curious to hear what autoEdit is helping you with.
This is an open source project in it’s current version it was originally created as part of a Knight-Mozilla fellowship by Pietro Passarelli with the Vox Media product team. You can contribute and/or propose ideas you have for this project.
autoEdit.io is free and open source. Free as in free speech as well as in free beer. Help support the autoEdit project to keep it that way. Support will go towards fixing bugs, adding features, provide support for users etc.


Definition at line 177 of file opencl_runtime_api.cc.
◆ _cl_program()
| _cl_program::_cl_program |
( |
cl_context |
context, |
|
|
cl_uint |
count, |
|
|
const char ** |
strings, |
|
|
const size_t * |
lengths |
|
) |
| |
◆ Build()
| void _cl_program::Build |
( |
const char * |
options | ) |
|
◆ CreateKernel()
| cl_kernel _cl_program::CreateKernel |
( |
const char * |
kernel_name, |
|
|
cl_int * |
errcode_ret |
|
) |
| |
◆ get_context()
| cl_context _cl_program::get_context |
( |
| ) |
|
|
inline |
◆ get_ptx()
| char * _cl_program::get_ptx |
( |
| ) |
|
◆ get_ptx_size()
| size_t _cl_program::get_ptx_size |
( |
| ) |
|
◆ m_context
| cl_context _cl_program::m_context |
|
private |
◆ m_kernels_compiled
| unsigned _cl_program::m_kernels_compiled = 0 |
|
staticprivate |
◆ m_pgm
| std::map<cl_uint,pgm_info> _cl_program::m_pgm |
|
private |
The documentation for this struct was generated from the following file:


In the following the reference formats will be explained based on five examples:
The citation is also explained.

 [Gao2008]	 Z. Gao, T. G. Habetler, R. G. Harley, and R. S. Colby, "A sensorless rotor temperature estimator for induction machines based on a current harmonic spectral estimation scheme," IEEE Transactions on Industrial Electronics, vol. 55, no. 1, pp. 407-416, Jan. 2008.

 [Andronov1973]	 A. Andronov, E. Leontovich, I. Gordon, and A. Maier, Theory of Bifurcations of Dynamic Systems on a plane, 1st ed. New York: J. Wiley & Sons, 1973.

 [Woehrnschimmel1998]	 R. Wöhrnschimmel, "Simulation, modeling and fault detection for vector controlled induction machines," Master's thesis, Vienna University of Technology, Vienna, Austria, 1998.

 [Farnleitner1999]	 E. Farnleitner, "Computational Fluid dynamics analysis for rotating electrical machinery," Ph.D. dissertation, University of Leoben, Department of Applied Mathematics, Leoben, Austria, 1999.

 [Marlino2005]	 L. D. Marlino, "Oak ridge national laboratory annual progress report for the power electronics and electric machinery program," Oak Ridge National Laboratory, prepared for the U.S. Department of Energy, Tennessee, USA, Tech. Rep. FY2004 Progress Report, January 2005.

appears as
| [Gao08] | Z. Gao, T. G. Habetler, R. G. Harley, and R. S. Colby, "A sensorless rotor temperature estimator for induction machines based on a current harmonic spectral estimation scheme," IEEE Transactions on Industrial Electronics, vol. 55, no. 1, pp. 407-416, Jan. 2008. |
| [Andronov1973] | A. Andronov, E. Leontovich, I. Gordon, and A. Maier, Theory of Bifurcations of Dynamic Systems on a plane, 1st ed. New York: J. Wiley & Sons, 1973. |
| [Woehrnschimmel1998] | R. Wöhrnschimmel, "Simulation, modeling and fault detection for vector controlled induction machines," Master's thesis, Vienna University of Technology, Vienna, Austria, 1998. |
| [Farnleitner1999] | E. Farnleitner, "Computational Fluid dynamics analysis for rotating electrical machinery," Ph.D. dissertation, University of Leoben, Department of Applied Mathematics, Leoben, Austria, 1999. |
| [Marlino2005] | L. D. Marlino, "Oak ridge national laboratory annual progress report for the power electronics and electric machinery program," Oak Ridge National Laboratory, prepared for the U.S. Department of Energy, Tennessee, USA, Tech. Rep. FY2004 Progress Report, January 2005. |


|
Bullet Collision Detection & Physics Library
|
Public Member Functions | |
| btSingleRayCallback (const btVector3 &rayFromWorld, const btVector3 &rayToWorld, const btCollisionWorld *world, btCollisionWorld::RayResultCallback &resultCallback) | |
| virtual bool | process (const btBroadphaseProxy *proxy) |
| Public Member Functions inherited from btBroadphaseRayCallback | |
| virtual | ~btBroadphaseRayCallback () |
| Public Member Functions inherited from btBroadphaseAabbCallback | |
| virtual | ~btBroadphaseAabbCallback () |
Public Attributes | |
| btVector3 | m_rayFromWorld |
| btVector3 | m_rayToWorld |
| btTransform | m_rayFromTrans |
| btTransform | m_rayToTrans |
| btVector3 | m_hitNormal |
| const btCollisionWorld * | m_world |
| btCollisionWorld::RayResultCallback & | m_resultCallback |
| Public Attributes inherited from btBroadphaseRayCallback | |
| btVector3 | m_rayDirectionInverse |
| added some cached data to accelerate ray-AABB tests More... | |
| unsigned int | m_signs [3] |
| btScalar | m_lambda_max |
Additional Inherited Members | |
| Protected Member Functions inherited from btBroadphaseRayCallback | |
| btBroadphaseRayCallback () | |
Definition at line 930 of file btCollisionWorld.cpp.
|
inline |
what about division by zero? –> just set rayDirection[i] to INF/BT_LARGE_FLOAT
Definition at line 941 of file btCollisionWorld.cpp.
|
inlinevirtual |
terminate further ray tests, once the closestHitFraction reached zero
Implements btBroadphaseAabbCallback.
Definition at line 966 of file btCollisionWorld.cpp.
| btVector3 btSingleRayCallback::m_hitNormal |
Definition at line 936 of file btCollisionWorld.cpp.
| btTransform btSingleRayCallback::m_rayFromTrans |
Definition at line 934 of file btCollisionWorld.cpp.
| btVector3 btSingleRayCallback::m_rayFromWorld |
Definition at line 932 of file btCollisionWorld.cpp.
| btTransform btSingleRayCallback::m_rayToTrans |
Definition at line 935 of file btCollisionWorld.cpp.
| btVector3 btSingleRayCallback::m_rayToWorld |
Definition at line 933 of file btCollisionWorld.cpp.
| btCollisionWorld::RayResultCallback& btSingleRayCallback::m_resultCallback |
Definition at line 939 of file btCollisionWorld.cpp.
| const btCollisionWorld* btSingleRayCallback::m_world |
Definition at line 938 of file btCollisionWorld.cpp.


{% include '_partial.html' %} {% load static %}
Hey!
My name is Phil Henning, I am a web developer, and I’m fueled by medium roast coffee, 2 milk, 2 sugar.
It’s a 50/50 whether or not I’ve woken up in a good mood or not, but a stack of flapjacks, by virtue of name alone, is usally enough to turn my mood around. Regardless of my disposition to the abreviation ‘am’ however, from morning until night I am productive and passionate about my work, thinking through my actions, and investigating issues, all the while hoping I gain a bit of knowledgable during the pursuit.
TL;DR
I provide front to back web solutions.
A little more info? Fair enough. Making use of emerging and proven technologies and leveraging powerful langauges and frameworks, I create meaningful, robust, and secure web based solutions.
Project architecture, backend configuration & ongoing maintentence, and clean, stlyish front end design. I’m creative, have a knack for User Design and love my job!
What more is there to say? Thanks for stopping by! A link to my resume’s can be found on the homepage.


To edit content group options, click the Edit Content Group icon .
| Option | Data Type | Function |
|---|---|---|
| Image | Media Library | Set background image from media library |
| Image Link | Content Selector | |
| Title | Input | |
| Image Caption | Text Area | |
| Responsive Image | Checkbox | Check to constrain image to parent container (i.e. width:100%) |
| Image Utility * | Selection | Select image utility style using bootstrap default class options
|
| Image Contextual * | Selection | Select image contextual style using bootstrap default class options
|
| CSS Class | Input | Add CSS class |
| Style | Input | Add CSS styles (inline) |
Center-block centers an image within its parent container.
IMPORTANT — Items that are grayed out will not work within this componentTo select an image, click the Choose an Image icon.
To edit an image, click the Modify Image Appearance icon.
| Option | Data Type | Function |
|---|---|---|
| Text | Input | Alternate Text |
| Width | Input | Set the width of the image if they are different than the dimensions of the original |
| Height | Input | Set the height of the image if they are different than the dimensions of the original |
| Keep Aspect Ratio | Checkbox | |
| Horizontal space | Input | Set the horizontal space around the image |
| Vertical Space | Input | Set the vertical space around the image |
To delete an image, click the Remove the Image icon.
.img-responsive {
display: block;
height: auto;
max-width: 100%;
}
.center-block {
display: block;
margin-left: auto;
margin-right: auto;
}


{% extends "base.html" %} {% from "macros.jinja" import window_vars with context %} {% block page %}
Current: {{ currentaddress }}
{{ data.address }}


Folders
<Go Back>
File
File
File
File
avl_tree.py
binary_tr…als.py
merge_two…ees.py
segment_tree.py
basic_bin…ree.py
fenwick_tree.py
non_recur…ree.py
segment_t…her.py
binary_se…ree.py
lazy_segm…ree.py
number_of…ees.py
treap.py
binary_se…ive.py
lowest_co…tor.py
red_black_tree.py
init
.py
binary_tr…ror.py
Folders: 1
Files: 17
Size of all files: 98750 KB


Training Images:
Feature Centers:
Model:
Linear SVC
Multinomial Naive Bayes
Gaussian Naive Bayes
Logistic Regression
Random Forest
Decision Tree


CrimPapers
Articles published on 16 December 2019
On 16 December 2019, 14 new articles were published in 7 journals.
Prevalence, Dynamics and Characteristics of Forced Marriage in Spain
Responding to Somali Piracy By Providing Sustainable Alternatives: Addressing the Motivation to Offend
Why Have Public Mass Shootings Become More Deadly? by Adam Lankford,
james Silver
Patterns and Prevalence of Lethal Mass Violence by Grant Duwe
Identifying High‐risk Firearm Owners to Prevent Mass Violence by Hannah S. Laqueur,
garen J. Wintemute
Algorithmic Approach to Forecasting Rare Violent Events by Richard A. Berk,
susan B. Sorenson
Desperate Identities by Peter Langman
What Role Does Serious Mental Illness Play in Mass Shootings, and How Should We Address It? by Jennifer Skeem,
edward Mulvey
Elia Apostolopoulou and Jose A. Cortes-Vazquez (eds): the Right to Nature: Social Movements, Environmental Justice and Neoliberal Natures
From “We Didn’t Do It” to “We’ve Learned Our Lesson”: Development of A Typology of Neutralizations of Corporate Crime
Money Laundering in the Commercial Sex Market in the United States
Benefits and Limits of Autonomous Systems in Public Security
Age-Graded Informal Social Control and Motivations Among Street Sex Buyers
Public Order Policing Approaches to Minimize Crowd Confrontation During Disputes and Protests in Australia


1 The word of the LORD that came to Micah the Morasthite in the days of Jotham, Ahaz, and Hezekiah, kings of Judah, which he saw concerning Samaria and Jerusalem.
2 Hear, all ye people; hearken, O earth, and all that therein is: and let the Lord GOD be witness against you, the Lord from his holy temple.
3 For, behold, the LORD cometh forth out of his place, and will come down, and tread upon the high places of the earth.
4 And the mountains shall be molten under him, and the valleys shall be cleft, as wax before the fire, and as the waters that are poured down a steep place.
5 For the transgression of Jacob is all this, and for the sins of the house of Israel. What is the transgression of Jacob? is it not Samaria? and what are the high places of Judah? are they not Jerusalem?
6 Therefore I will make Samaria as an heap of the field, and as plantings of a vineyard: and I will pour down the stones thereof into the valley, and I will discover the foundations thereof.
7 And all the graven images thereof shall be beaten to pieces, and all the hires thereof shall be burned with the fire, and all the idols thereof will I lay desolate: for she gathered it of the hire of an harlot, and they shall return to the hire of an harlot.
8 Therefore I will wail and howl, I will go stripped and naked: I will make a wailing like the dragons, and mourning as the owls.
9 For her wound is incurable; for it is come unto Judah; he is come unto the gate of my people, even to Jerusalem.
10 Declare ye it not at Gath, weep ye not at all: in the house of Aphrah roll thyself in the dust.
11 Pass ye away, thou inhabitant of Saphir, having thy shame naked: the inhabitant of Zaanan came not forth in the mourning of Bethezel; he shall receive of you his standing.
12 For the inhabitant of Maroth waited carefully for good: but evil came down from the LORD unto the gate of Jerusalem.
13 O thou inhabitant of Lachish, bind the chariot to the swift beast: she is the beginning of the sin to the daughter of Zion: for the transgressions of Israel were found in thee.
14 Therefore shalt thou give presents to Moreshethgath: the houses of Achzib shall be a lie to the kings of Israel.
15 Yet will I bring an heir unto thee, O inhabitant of Mareshah: he shall come unto Adullam the glory of Israel.
16 Make thee bald, and poll thee for thy delicate children; enlarge thy baldness as the eagle; for they are gone into captivity from thee.
1 Woe to them that devise iniquity, and work evil upon their beds! when the morning is light, they practise it, because it is in the power of their hand.
2 And they covet fields, and take them by violence; and houses, and take them away: so they oppress a man and his house, even a man and his heritage.
3 Therefore thus saith the LORD; Behold, against this family do I devise an evil, from which ye shall not remove your necks; neither shall ye go haughtily: for this time is evil.
4 In that day shall one take up a parable against you, and lament with a doleful lamentation, and say, We be utterly spoiled: he hath changed the portion of my people: how hath he removed it from me! turning away he hath divided our fields.
5 Therefore thou shalt have none that shall cast a cord by lot in the congregation of the LORD.
6 Prophesy ye not, say they to them that prophesy: they shall not prophesy to them, that they shall not take shame.
7 O thou that art named the house of Jacob, is the spirit of the LORD straitened? are these his doings? do not my words do good to him that walketh uprightly?
8 Even of late my people is risen up as an enemy: ye pull off the robe with the garment from them that pass by securely as men averse from war.
9 The women of my people have ye cast out from their pleasant houses; from their children have ye taken away my glory for ever.
10 Arise ye, and depart; for this is not your rest: because it is polluted, it shall destroy you, even with a sore destruction.
11 If a man walking in the spirit and falsehood do lie, saying, I will prophesy unto thee of wine and of strong drink; he shall even be the prophet of this people.
12 I will surely assemble, O Jacob, all of thee; I will surely gather the remnant of Israel; I will put them together as the sheep of Bozrah, as the flock in the midst of their fold: they shall make great noise by reason of the multitude of men.
13 The breaker is come up before them: they have broken up, and have passed through the gate, and are gone out by it: and their king shall pass before them, and the LORD on the head of them.
1 And I said, Hear, I pray you, O heads of Jacob, and ye princes of the house of Israel; Is it not for you to know judgment?
2 Who hate the good, and love the evil; who pluck off their skin from off them, and their flesh from off their bones;
3 Who also eat the flesh of my people, and flay their skin from off them; and they break their bones, and chop them in pieces, as for the pot, and as flesh within the caldron.
4 Then shall they cry unto the LORD, but he will not hear them: he will even hide his face from them at that time, as they have behaved themselves ill in their doings.
5 Thus saith the LORD concerning the prophets that make my people err, that bite with their teeth, and cry, Peace; and he that putteth not into their mouths, they even prepare war against him.
6 Therefore night shall be unto you, that ye shall not have a vision; and it shall be dark unto you, that ye shall not divine; and the sun shall go down over the prophets, and the day shall be dark over them.
7 Then shall the seers be ashamed, and the diviners confounded: yea, they shall all cover their lips; for there is no answer of God.
8 But truly I am full of power by the spirit of the LORD, and of judgment, and of might, to declare unto Jacob his transgression, and to Israel his sin.
9 Hear this, I pray you, ye heads of the house of Jacob, and princes of the house of Israel, that abhor judgment, and pervert all equity.
10 They build up Zion with blood, and Jerusalem with iniquity.
11 The heads thereof judge for reward, and the priests thereof teach for hire, and the prophets thereof divine for money: yet will they lean upon the LORD, and say, Is not the LORD among us? none evil can come upon us.
12 Therefore shall Zion for your sake be plowed as a field, and Jerusalem shall become heaps, and the mountain of the house as the high places of the forest.
1 But in the last days it shall come to pass, that the mountain of the house of the LORD shall be established in the top of the mountains, and it shall be exalted above the hills; and people shall flow unto it.
2 And many nations shall come, and say, Come, and let us go up to the mountain of the LORD, and to the house of the God of Jacob; and he will teach us of his ways, and we will walk in his paths: for the law shall go forth of Zion, and the word of the LORD from Jerusalem.
3 And he shall judge among many people, and rebuke strong nations afar off; and they shall beat their swords into plowshares, and their spears into pruninghooks: nation shall not lift up a sword against nation, neither shall they learn war any more.
4 But they shall sit every man under his vine and under his fig tree; and none shall make them afraid: for the mouth of the LORD of hosts hath spoken it.
5 For all people will walk every one in the name of his god, and we will walk in the name of the LORD our God for ever and ever.
6 In that day, saith the LORD, will I assemble her that halteth, and I will gather her that is driven out, and her that I have afflicted;
7 And I will make her that halted a remnant, and her that was cast far off a strong nation: and the LORD shall reign over them in mount Zion from henceforth, even for ever.
8 And thou, O tower of the flock, the strong hold of the daughter of Zion, unto thee shall it come, even the first dominion; the kingdom shall come to the daughter of Jerusalem.
9 Now why dost thou cry out aloud? is there no king in thee? is thy counseller perished? for pangs have taken thee as a woman in travail.
10 Be in pain, and labour to bring forth, O daughter of Zion, like a woman in travail: for now shalt thou go forth out of the city, and thou shalt dwell in the field, and thou shalt go even to Babylon; there shalt thou be delivered; there the LORD shall redeem thee from the hand of thine enemies.
11 Now also many nations are gathered against thee, that say, Let her be defiled, and let our eye look upon Zion.
12 But they know not the thoughts of the LORD, neither understand they his counsel: for he shall gather them as the sheaves into the floor.
13 Arise and thresh, O daughter of Zion: for I will make thine horn iron, and I will make thy hoofs brass: and thou shalt beat in pieces many people: and I will consecrate their gain unto the LORD, and their substance unto the Lord of the whole earth.
1 Now gather thyself in troops, O daughter of troops: he hath laid siege against us: they shall smite the judge of Israel with a rod upon the cheek.
2 But thou, Bethlehem Ephratah, though thou be little among the thousands of Judah, yet out of thee shall he come forth unto me that is to be ruler in Israel; whose goings forth have been from of old, from everlasting.
3 Therefore will he give them up, until the time that she which travaileth hath brought forth: then the remnant of his brethren shall return unto the children of Israel.
4 And he shall stand and feed in the strength of the LORD, in the majesty of the name of the LORD his God; and they shall abide: for now shall he be great unto the ends of the earth.
5 And this man shall be the peace, when the Assyrian shall come into our land: and when he shall tread in our palaces, then shall we raise against him seven shepherds, and eight principal men.
6 And they shall waste the land of Assyria with the sword, and the land of Nimrod in the entrances thereof: thus shall he deliver us from the Assyrian, when he cometh into our land, and when he treadeth within our borders.
7 And the remnant of Jacob shall be in the midst of many people as a dew from the LORD, as the showers upon the grass, that tarrieth not for man, nor waiteth for the sons of men.
8 And the remnant of Jacob shall be among the Gentiles in the midst of many people as a lion among the beasts of the forest, as a young lion among the flocks of sheep: who, if he go through, both treadeth down, and teareth in pieces, and none can deliver.
9 Thine hand shall be lifted up upon thine adversaries, and all thine enemies shall be cut off.
10 And it shall come to pass in that day, saith the LORD, that I will cut off thy horses out of the midst of thee, and I will destroy thy chariots:
11 And I will cut off the cities of thy land, and throw down all thy strong holds:
12 And I will cut off witchcrafts out of thine hand; and thou shalt have no more soothsayers:
13 Thy graven images also will I cut off, and thy standing images out of the midst of thee; and thou shalt no more worship the work of thine hands.
14 And I will pluck up thy groves out of the midst of thee: so will I destroy thy cities.
15 And I will execute vengeance in anger and fury upon the heathen, such as they have not heard.
1 Hear ye now what the LORD saith; Arise, contend thou before the mountains, and let the hills hear thy voice.
2 Hear ye, O mountains, the LORD's controversy, and ye strong foundations of the earth: for the LORD hath a controversy with his people, and he will plead with Israel.
3 O my people, what have I done unto thee? and wherein have I wearied thee? testify against me.
4 For I brought thee up out of the land of Egypt, and redeemed thee out of the house of servants; and I sent before thee Moses, Aaron, and Miriam.
5 O my people, remember now what Balak king of Moab consulted, and what Balaam the son of Beor answered him from Shittim unto Gilgal; that ye may know the righteousness of the LORD.
6 Wherewith shall I come before the LORD, and bow myself before the high God? shall I come before him with burnt offerings, with calves of a year old?
7 Will the LORD be pleased with thousands of rams, or with ten thousands of rivers of oil? shall I give my firstborn for my transgression, the fruit of my body for the sin of my soul?
8 He hath shewed thee, O man, what is good; and what doth the LORD require of thee, but to do justly, and to love mercy, and to walk humbly with thy God?
9 The LORD's voice crieth unto the city, and the man of wisdom shall see thy name: hear ye the rod, and who hath appointed it.
10 Are there yet the treasures of wickedness in the house of the wicked, and the scant measure that is abominable?
11 Shall I count them pure with the wicked balances, and with the bag of deceitful weights?
12 For the rich men thereof are full of violence, and the inhabitants thereof have spoken lies, and their tongue is deceitful in their mouth.
13 Therefore also will I make thee sick in smiting thee, in making thee desolate because of thy sins.
14 Thou shalt eat, but not be satisfied; and thy casting down shall be in the midst of thee; and thou shalt take hold, but shalt not deliver; and that which thou deliverest will I give up to the sword.
15 Thou shalt sow, but thou shalt not reap; thou shalt tread the olives, but thou shalt not anoint thee with oil; and sweet wine, but shalt not drink wine.
16 For the statutes of Omri are kept, and all the works of the house of Ahab, and ye walk in their counsels; that I should make thee a desolation, and the inhabitants thereof an hissing: therefore ye shall bear the reproach of my people.
1 Woe is me! for I am as when they have gathered the summer fruits, as the grapegleanings of the vintage: there is no cluster to eat: my soul desired the firstripe fruit.
2 The good man is perished out of the earth: and there is none upright among men: they all lie in wait for blood; they hunt every man his brother with a net.
3 That they may do evil with both hands earnestly, the prince asketh, and the judge asketh for a reward; and the great man, he uttereth his mischievous desire: so they wrap it up.
4 The best of them is as a brier: the most upright is sharper than a thorn hedge: the day of thy watchmen and thy visitation cometh; now shall be their perplexity.
5 Trust ye not in a friend, put ye not confidence in a guide: keep the doors of thy mouth from her that lieth in thy bosom.
6 For the son dishonoureth the father, the daughter riseth up against her mother, the daughter in law against her mother in law; a man's enemies are the men of his own house.
7 Therefore I will look unto the LORD; I will wait for the God of my salvation: my God will hear me.
8 Rejoice not against me, O mine enemy: when I fall, I shall arise; when I sit in darkness, the LORD shall be a light unto me.
9 I will bear the indignation of the LORD, because I have sinned against him, until he plead my cause, and execute judgment for me: he will bring me forth to the light, and I shall behold his righteousness.
10 Then she that is mine enemy shall see it, and shame shall cover her which said unto me, Where is the LORD thy God? mine eyes shall behold her: now shall she be trodden down as the mire of the streets.
11 In the day that thy walls are to be built, in that day shall the decree be far removed.
12 In that day also he shall come even to thee from Assyria, and from the fortified cities, and from the fortress even to the river, and from sea to sea, and from mountain to mountain.
13 Notwithstanding the land shall be desolate because of them that dwell therein, for the fruit of their doings.
14 Feed thy people with thy rod, the flock of thine heritage, which dwell solitarily in the wood, in the midst of Carmel: let them feed in Bashan and Gilead, as in the days of old.
15 According to the days of thy coming out of the land of Egypt will I shew unto him marvellous things.
16 The nations shall see and be confounded at all their might: they shall lay their hand upon their mouth, their ears shall be deaf.
17 They shall lick the dust like a serpent, they shall move out of their holes like worms of the earth: they shall be afraid of the LORD our God, and shall fear because of thee.
18 Who is a God like unto thee, that pardoneth iniquity, and passeth by the transgression of the remnant of his heritage? he retaineth not his anger for ever, because he delighteth in mercy.
19 He will turn again, he will have compassion upon us; he will subdue our iniquities; and thou wilt cast all their sins into the depths of the sea.
20 Thou wilt perform the truth to Jacob, and the mercy to Abraham, which thou hast sworn unto our fathers from the days of old.
| << Jonah | Contents | Nahum >> |


I started writing R packages in early 2017. For a while I found the initial set up for a new package involved more guess-work than I'd like (e.g. start from GitHub first or RStudio? When do you normally add a license?).
Here's my personal checklist for getting a minimal R package started in a consistent way:
This checklist reflects how I currently work. So it'll most likely change as my workflow evolves.
Some extras to make life easier for others (including future self):
This book is an excellent resource for taking best practice further.