WITNESS LIST Finance Committee May 25, 2004 - 8:00A Comprehensive Data Review of Health and Human Services Programs ON: Bays, Richard (Dept. of Health), Austin, TX Brown, Cindy CFO (Dept. of Family and Protective Services), Austin, TX Campbell, Bill Interim Commissioner (Dept. of Mental Health and Mental Retardation), Austin, TX Chapmond, Thomas Commissioner (Dept. of Family and Protective Services), Austin, TX Dudley Jr., Harold K. Director, State Mental Health Facilities (Dept. of Mental Health and Mental Retardation), Austin, TX Elder, Mary Deputy Commissioner (Dept. of Assistive and Rehabilitative Services), Austin, TX Hine, Jim Commissioner (Dept. of Aging and Disability Services), Austin, TX Murphy, Terry Commissioner (Dept. of Assistive and Rehabilitative Services), Austin, TX Pharr, Michelle CFO (Dept. of State Health Services), Austin, TX Sanchez, Eduardo Commissioner (Dept. of State Health Services), Austin, TX Stanley, Sharilyn K. Associate Commissioner (Dept. of Health), Austin, TX Taylor, Gordon CFO (Dept. of Aging and Disability Services), Austin, TX Wanser, Debra Associate Commissioner (Dept. of Health), Austin, TX Wheeler, Bill CFO (Dept. of Assistive and Rehabilitative Services), Austin, TX Registering, but not testifying: On: Neal, Glenn Dir., Center for Cons. and Ext. Affairs (Dept. of Assistive and Rehabilitative Services), Austin, TX


-
cherokee county tax data base
Human dignity and human rights as a common ground for ... - Unesco
Declaration does not explicitly define human dignity, it would be a mistake to see the emphasis . a better person?, the key question of law is: What rules do we need to promote a peaceful and . Indeed, some studies show that, surprisingly, .
http://www.unesco.org.uy/ci/fileadmin/shs/redbioetica/dignidad_Andorno.pdf
-
cb 750 super sport
Dignity - Wikipedia, the free encyclopedia
This article is about dignity as a matter of philosophy, religion, human rights, . the self-respect of people who came before them: "Let not human dignity be light in . A Benetton advertisement showing human buttocks with an "H.I.V. positive" .
http://en.wikipedia.org/wiki/Dignity
-
bowhunting girl wall papers
PCBE: Human Dignity and Bioethics:Essays Commissioned by the ...
Finally, I will show how this vigorous understanding of dignity helps to give . If we did not believe that human dignity remains even if people are disabled and .
http://bioethics.georgetown.edu/pcbe/reports/human_dignity/chapter18.html
-
coupon casual living usa
Human Rights and Human Dignity: An Analytic Critique of Non ...
It is regularly argued that human rights are not a Western discovery and that . the inherent dignity of the human person. . In each case I will show that the .
http://olympiaseminars.org/2012/readings/Cycle_B/Donnelly%20Rights%20and%20Dignity.pdf
-
united parcel service accident
The NCCW Campaign for Human Dignity Manual - CatholicWeb
?human life is sacred and the dignity of the human person is the foundation of a moral vision for society.? . The economy must serve people, not the other way around. . We show our respect for the Creator by our stewardship of creation.
http://home.catholicweb.com/NCCW/files/000-CampaignforHumanDignityManual.pdf
-
air charged lathe chucks
Human Dignity | Dearborn Academy
Too often in our society, people don't receive the compassion, respect or . The fundamental principles of the human dignity program are not complicated, but the more . Showing generosity to peers and staff; Acts of kindness and compassion .
http://www.dearbornacademy.org/high-school/school-community-high-school/human-dignity
-
identify parked document sap bkpf
Chapter 10: Modern and American Dignity - National Reference ...
Our understanding of the dignity of the individual or the person originates, I think, . of the physicist, but not the whole human person who, among other things, . reason can show us that our true practical standard is not merely an arbitrary .
http://bioethics.georgetown.edu/pcbe/reports/human_dignity/chapter10.html
-
humphrey advanced guestbook 2.3.1
Human Dignity and the Jewish Tradition - Jewish Law
yet recognize that the principle of human dignity should not be used to disregard . gratitude but to show honor or pay tribute to another person, it is permitted.
http://www.jlaw.com/Articles/HumanDignity.pdf
-
issues eticos en la psicoterapia
Human Dignity: George Kateb:<PHONE_NUMBER>379: Amazon.com: Books
To injure or even to try to efface someone's dignity is to treat that person as not human or less than humanas a thing or instrument or subhuman creature.
http://www.amazon.com/Human-Dignity-George-Kateb/dp/0674048377
-
word of grace church pineville
Defining human dignity
Nov 22, 2009 . Under an inherent dignity approach, dying people are still human . for human life and that while suffering must be relieved, life must not be .
http://www.catholiceducation.org/articles/euthanasia/eu0058.htm
-
zone ii finals results
The New Atlantis » Human Dignity and Public Bioethics
The tension between these two notions of human dignity is evident, and I suspect . Of course, treating people equally need not and should not mean treating . that Christians are enjoined to show to every human being made in God's image.
http://www.thenewatlantis.com/publications/human-dignity-and-public-bioethics
-
unique printers cicero illinois
The Concept of 'Human Dignity' in the Post-War Human Rights ...
The idea of human dignity is old, with various theological and philosophi- cal roots (see e.g. . not signify that by virtue of natural law, the human person has the right to be respected, is the . He hoped that his colleagues would show equal .
http://saavedrafajardo.um.es/WEB/archivos/respublica/numeros/27/08.pdf
-
directory 301 outlets maryland
The Nature and Basis of Human Dignity - Patrick Lee
Some people hold that all human beings have a special type of dignity which is the basis for (1) the obligation all of us have not to kill them, (2) the obligation to .
http://patrickleebioethics.homestead.com/dignity--ratio_juris.pdf
-
muddy moose cottage grove
Chapter 14: Human Dignity and Political entitlements - National ...
I shall show how such an account might ground basic political entitlements (in . People usually give reverence and awe to the outward trappings of wealth . So we grant that human dignity is inalienable, not damaged in itself by bad fortune.
http://bioethics.georgetown.edu/pcbe/reports/human_dignity/chapter14.html
-
chihuahua puppies teacup tiny
Human dignity
These essays are not the work of our own expert essay writers. . Dignity is possessed by one who is a person or human, and therefore this is the distinction . Researches and statistics show that there are three elements that the economy .
http://www.ukessays.com/essays/theology/human-dignity-theology-essay.php
-
skyline pittsburgh pittsburgh pa
HEALTH ETHICS, EQUITY AND HUMAN DIGNITY
recognized as guides and justifications people use for choosing goals, priorities and measures. . ethics to achieve equity and respect human dignity should not wait. . to ensuring equity in health care would show we mean business. 3.3.
http://www.humiliationstudies.org/documents/GabrHealthEthics.pdf
-
traditional houses in mexico
The Notions of the Human Person and Human Dignity in Aquinas ...
fact that the human person is not just an abstract and logically defined concept, but more . But in order to show the essence of the person and his dignity, he .
http://www.kritike.org/journal/issue_5/aguas_june2009.pdf
-
horse and stable for kids
Quotes About Dignity (124 quotes)
Quotes tagged as "dignity" (showing 1-30 of 124) . 4,205 people liked it . acts of courage which help to preserve man's self-respect and inherent human dignity. It is not easy for a people conditioned by fear under the iron rule of the principle .
http://www.goodreads.com/quotes/tag/dignity
-
where is benedict aquino
International Policy and a Universal Conception of Human Dignity ...
If human dignity (and not merely contingent agreement) is the foundation of human . If people would not have any inherent value, then there would be no reason to . To show this it is helpful to consider the syllogism that, as James Rachels .
http://www.academia.edu/1253952/International_Policy_and_a_Universal_Conception_of_Human_Dignity
-
us army support kuwait
RESPECT FOR HUMAN DIGNITY
Many codes of rights, like Arrican Charter on Human and People's Rights, . However the convention in the present form may not be perfect according to certain . Then show a few toy guns briefly and ask the class how they affect their minds.
http://www.ncte-india.org/pub/unesco/ch14.htm


Basic functions and operations using TensorFlow library.
import numpy as np
import tensorflow as tf
# un-initialized tensor
a = tf.placeholder(tf.float32, shape=(3, 4), name='a')
# initialized tensor
b = tf.constant(np.arange(12).reshape(3, 4), name='b')
print(a, a.shape, a.dtype)
print(b, b.shape, b.dtype)
a = tf.constant(np.arange(4), name='a')
b = tf.constant(np.arange(4)*10, name='b')
c = tf.add(a, b)
print(c)
# Iteractive session
sess = tf.InteractiveSession()
out = c.eval()
sess.close()
print(out)
# Non-Iteractive session
sess = tf.Session()
out = c.eval(session=sess)
sess.close()
print(out)
# Non-Iteractive session using context manager
with tf.Session() as sess:
out1 = sess.run(c)
out2 = c.eval()
print(out1)
print(out2)
a = tf.placeholder(tf.int32, name='a')
b = tf.placeholder(tf.int32, name='b')
c = tf.add(a, b)
with tf.Session() as sess:
out = sess.run(c, feed_dict={a: 3, b: 4})
print(out)
s = tf.constant(3) # scalar
v = tf.constant(np.arange(5)) # vactor n=5
m = tf.constant(np.arange(20).reshape(4, 5)) # matrix 4 x 5
# print S
with tf.Session() as sess:
print(' S:', sess.run(s))
# V x S product
vs = tf.multiply(v, s) # could be v*s as well
with tf.Session() as sess:
print('V x S:', sess.run(vs))
# M x S product
ms = tf.multiply(m, s) # could be m*s as well
with tf.Session() as sess:
print('M x S:\n', sess.run(ms))
# print V
with tf.Session() as sess:
print(' V:', sess.run(v))
# V x V > dot product
vv = tf.tensordot(v, v, axes=1)
with tf.Session() as sess:
print('V x V:', sess.run(vv))
# M x V product
mv = tf.tensordot(m, v, axes=1)
with tf.Session() as sess:
print('M x V:', sess.run(mv))
# print M
with tf.Session() as sess:
print(' M:\n', sess.run(m))
# M x M product
m1 = tf.constant(np.arange(15).reshape(5, 3)) # the M1's dimensions are 5 x 3
mm = tf.matmul(m, m1) # the result dimensions must be 4 x 3
with tf.Session() as sess:
print('\nM x M1:\n', sess.run(mm))


In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code, but left the implementation of the neural network up to you (for the most part). After you've submitted this project, feel free to explore the data and the model more.
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
A critical step in working with neural networks is preparing the data correctly. Variables on different scales make it difficult for the network to efficiently learn the correct weights. Below, we've written the code to load and prepare the data. You'll learn more about this soon!
data_path = 'Bike-Sharing-Dataset/hour.csv'
rides = pd.read_csv(data_path)
rides.head()
This dataset has the number of riders for each hour of each day from January 1 2011 to December 31 2012. The number of riders is split between casual and registered, summed up in the cnt
column. You can see the first few rows of the data above.
Below is a plot showing the number of bike riders over the first 10 days or so in the data set. (Some days don't have exactly 24 entries in the data set, so it's not exactly 10 days.) You can see the hourly rentals here. This data is pretty complicated! The weekends have lower over all ridership and there are spikes when people are biking to and from work during the week. Looking at the data above, we also have information about temperature, humidity, and windspeed, all of these likely affecting the number of riders. You'll be trying to capture all this with your model.
rides[:24*10].plot(x='dteday', y='cnt')
Here we have some categorical variables like season, weather, month. To include these in our model, we'll need to make binary dummy variables. This is simple to do with Pandas thanks to get_dummies()
.
dummy_fields = ['season', 'weathersit', 'mnth', 'hr', 'weekday']
for each in dummy_fields:
dummies = pd.get_dummies(rides[each], prefix=each, drop_first=False)
rides = pd.concat([rides, dummies], axis=1)
fields_to_drop = ['instant', 'dteday', 'season', 'weathersit',
'weekday', 'atemp', 'mnth', 'workingday', 'hr']
data = rides.drop(fields_to_drop, axis=1)
data.head()
To make training the network easier, we'll standardize each of the continuous variables. That is, we'll shift and scale the variables such that they have zero mean and a standard deviation of 1.
The scaling factors are saved so we can go backwards when we use the network for predictions.
quant_features = ['casual', 'registered', 'cnt', 'temp', 'hum', 'windspeed']
# Store scalings in a dictionary so we can convert back later
scaled_features = {}
for each in quant_features:
mean, std = data[each].mean(), data[each].std()
scaled_features[each] = [mean, std]
data.loc[:, each] = (data[each] - mean)/std
scaled_features
We'll save the data for the last approximately 21 days to use as a test set after we've trained the network. We'll use this set to make predictions and compare them with the actual number of riders.
# Save data for approximately the last 21 days
test_data = data[-21*24:]
# Now remove the test data from the data set
data = data[:-21*24]
# Separate the data into features and targets
target_fields = ['cnt', 'casual', 'registered']
features, targets = data.drop(target_fields, axis=1), data[target_fields]
test_features, test_targets = test_data.drop(target_fields, axis=1), test_data[target_fields]
We'll split the data into two sets, one for training and one for validating as the network is being trained. Since this is time series data, we'll train on historical data, then try to predict on future data (the validation set).
# Hold out the last 60 days or so of the remaining data as a validation set
train_features, train_targets = features[:-60*24], targets[:-60*24]
val_features, val_targets = features[-60*24:], targets[-60*24:]
train_features.head(5)
train_targets.head(5)
Below you'll build your network. We've built out the structure and the backwards pass. You'll implement the forward pass through the network. You'll also set the hyperparameters: the learning rate, the number of hidden units, and the number of training passes.
The network has two layers, a hidden layer and an output layer. The hidden layer will use the sigmoid function for activations. The output layer has only one node and is used for the regression, the output of the node is the same as the input of the node. That is, the activation function is $f(x)=x$. A function that takes the input signal and generates an output signal, but takes into account the threshold, is called an activation function. We work through each layer of our network calculating the outputs for each neuron. All of the outputs from one layer become inputs to the neurons on the next layer. This process is called forward propagation.
We use the weights to propagate signals forward from the input to the output layers in a neural network. We use the weights to also propagate error backwards from the output back into the network to update our weights. This is called backpropagation.
Hint: You'll need the derivative of the output activation function ($f(x) = x$) for the backpropagation implementation. If you aren't familiar with calculus, this function is equivalent to the equation $y = x$. What is the slope of that equation? That is the derivative of $f(x)$.
Below, you have these tasks:
self.activation_function
in __init__
to your sigmoid function.train
method.train
method, including calculating the output error.run
method.class NeuralNetwork(object):
def __init__(self, input_nodes, hidden_nodes, output_nodes, learning_rate):
# Set number of nodes in input, hidden and output layers.
self.input_nodes = input_nodes
self.hidden_nodes = hidden_nodes
self.output_nodes = output_nodes
# Initialize weights
self.weights_input_to_hidden = np.random.normal(0.0, self.input_nodes**-0.5,
(self.input_nodes, self.hidden_nodes))
self.weights_hidden_to_output = np.random.normal(0.0, self.hidden_nodes**-0.5,
(self.hidden_nodes, self.output_nodes))
self.lr = learning_rate
#### TODO: Set self.activation_function to your implemented sigmoid function ####
self.activation_function = lambda x : 1. / (1 + np.exp(-x))
def train(self, features, targets):
''' Train the network on batch of features and targets.
Arguments
---------
features: 2D array, each row is one data record, each column is a feature
targets: 1D array of target values
'''
n_records = features.shape[0]
delta_weights_i_h = np.zeros(self.weights_input_to_hidden.shape)
delta_weights_h_o = np.zeros(self.weights_hidden_to_output.shape)
for X, y in zip(features, targets):
# Forward pass
# Hidden layer - Replace these values with your calculations.
hidden_inputs = np.dot(X, self.weights_input_to_hidden) # signals into hidden layer
hidden_outputs = self.activation_function(hidden_inputs) # signals from hidden layer
# TODO: Output layer - Replace these values with your calculations.
final_inputs = np.dot(hidden_outputs, self.weights_hidden_to_output) # signals into final output layer
final_outputs = final_inputs # signals from final output layer
# Backward pass
# Output error
error = y - final_outputs # Output layer error is the difference between desired target and actual output.
output_error_term = error # * 1 == (f'(final_outputs))
# Calculate the hidden layer's contribution to the error
hidden_error = self.weights_hidden_to_output * output_error_term
# Backpropagated error terms
hidden_error_term = hidden_error.reshape(self.hidden_nodes,) * hidden_outputs * (1 - hidden_outputs)
# Weight step (input to hidden)
delta_weights_i_h += np.matmul(X.reshape(self.input_nodes, 1), hidden_error_term.reshape(1, self.hidden_nodes))
# Weight step (hidden to output)
delta_weights_h_o += np.matmul(hidden_outputs.reshape(self.hidden_nodes, 1), output_error_term.reshape(1, self.output_nodes))
# Update the weights
self.weights_hidden_to_output += (self.lr/n_records) * delta_weights_h_o # update hidden-to-output weights with gradient descent step
self.weights_input_to_hidden += (self.lr/n_records) * delta_weights_i_h # update input-to-hidden weights with gradient descent step
def run(self, features):
''' Run a forward pass through the network with input features
Arguments
---------
features: 1D array of feature values
'''
# since the activataion function for the regression -> f(x) = x
return np.dot(self.activation_function(np.dot(features, self.weights_input_to_hidden)),
self.weights_hidden_to_output)
def MSE(y, Y):
return np.mean((y-Y)**2)
Run these unit tests to check the correctness of your network implementation. This will help you be sure your network was implemented correctly befor you starting trying to train it. These tests must all be successful to pass the project.
inputs = np.array([[0.5, -0.2, 0.1], [0.5, -0.2, 0.1]])
targets = np.array([[0.4]])
test_w_i_h = np.array([[0.1, -0.2],
[0.4, 0.5],
[-0.3, 0.2]])
test_w_h_o = np.array([[0.3],
[-0.1]])
network = NeuralNetwork(3, 2, 1, 0.5)
network.weights_input_to_hidden = test_w_i_h.copy()
network.weights_hidden_to_output = test_w_h_o.copy()
# assert network.run(inputs[0]) == np.dot(network.activation_function(np.dot(inputs[0], test_w_i_h)), test_w_h_o)
# Train method (test)
network.train(inputs, targets)
import unittest
inputs = np.array([[0.5, -0.2, 0.1]])
targets = np.array([[0.4]])
test_w_i_h = np.array([[0.1, -0.2],
[0.4, 0.5],
[-0.3, 0.2]])
test_w_h_o = np.array([[0.3],
[-0.1]])
class TestMethods(unittest.TestCase):
# Unit tests for data loading
def test_data_path(self):
# Test that file path to dataset has been unaltered
self.assertTrue(data_path.lower() == 'bike-sharing-dataset/hour.csv')
def test_data_loaded(self):
# Test that data frame loaded
self.assertTrue(isinstance(rides, pd.DataFrame))
# Unit tests for network functionality
def test_activation(self):
network = NeuralNetwork(3, 2, 1, 0.5)
# Test that the activation function is a sigmoid
for x in range(5):
self.assertTrue(np.all(network.activation_function(x) == 1/(1+np.exp(-x))))
def test_train(self):
# Test that weights are updated correctly on training
network = NeuralNetwork(3, 2, 1, 0.5)
network.weights_input_to_hidden = test_w_i_h.copy()
network.weights_hidden_to_output = test_w_h_o.copy()
network.train(inputs, targets)
# print (network.weights_hidden_to_output)
self.assertTrue(np.allclose(network.weights_hidden_to_output,
np.array([[ 0.37275328],
[-0.03172939]])))
self.assertTrue(np.allclose(network.weights_input_to_hidden,
np.array([[ 0.10562014, -0.20185996],
[0.39775194, 0.50074398],
[-0.29887597, 0.19962801]])))
def test_activation_function(self):
network = NeuralNetwork(3, 2, 1, 0.5)
self.assertEqual(network.activation_function(0), 0.5)
def test_run(self):
# Test correctness of run method
network = NeuralNetwork(3, 2, 1, 0.5)
network.weights_input_to_hidden = test_w_i_h.copy()
network.weights_hidden_to_output = test_w_h_o.copy()
self.assertTrue(np.allclose(network.run(inputs), 0.09998924))
suite = unittest.TestLoader().loadTestsFromModule(TestMethods())
unittest.TextTestRunner().run(suite)
Here you'll set the hyperparameters for the network. The strategy here is to find hyperparameters such that the error on the training set is low, but you're not overfitting to the data. If you train the network too long or have too many hidden nodes, it can become overly specific to the training set and will fail to generalize to the validation set. That is, the loss on the validation set will start increasing as the training set loss drops.
You'll also be using a method know as Stochastic Gradient Descent (SGD) to train the network. The idea is that for each training pass, you grab a random sample of the data instead of using the whole data set. You use many more training passes than with normal gradient descent, but each pass is much faster. This ends up training the network more efficiently. You'll learn more about SGD later.
This is the number of batches of samples from the training data we'll use to train the network. The more iterations you use, the better the model will fit the data. However, if you use too many iterations, then the model with not generalize well to other data, this is called overfitting. You want to find a number here where the network has a low training loss, and the validation loss is at a minimum. As you start overfitting, you'll see the training loss continue to decrease while the validation loss starts to increase.
This scales the size of weight updates. If this is too big, the weights tend to explode and the network fails to fit the data. A good choice to start at is 0.1. If the network has problems fitting the data, try reducing the learning rate. Note that the lower the learning rate, the smaller the steps are in the weight updates and the longer it takes for the neural network to converge.
The more hidden nodes you have, the more accurate predictions the model will make. Try a few different numbers and see how it affects the performance. You can look at the losses dictionary for a metric of the network performance. If the number of hidden units is too low, then the model won't have enough space to learn and if it is too high there are too many options for the direction that the learning can take. The trick here is to find the right balance in number of hidden units you choose.
import sys
### Set the hyperparameters here ###
iterations = 6000
learning_rate = 0.27
hidden_nodes = 10
output_nodes = 1
N_i = train_features.shape[1]
network = NeuralNetwork(N_i, hidden_nodes, output_nodes, learning_rate)
losses = {'train':[], 'validation':[]}
for ii in range(iterations):
# Go through a random batch of 128 records from the training data set
batch = np.random.choice(train_features.index, size=128)
X, y = train_features.loc[batch].values, train_targets.loc[batch]['cnt']
network.train(X, y)
# Printing out the training progress
train_loss = MSE(network.run(train_features).T, train_targets['cnt'].values)
val_loss = MSE(network.run(val_features).T, val_targets['cnt'].values)
sys.stdout.write("\rProgress: {:2.1f}".format(100 * ii/float(iterations)) \
+ "% ... Training loss: " + str(train_loss)[:5] \
+ " ... Validation loss: " + str(val_loss)[:5])
sys.stdout.flush()
losses['train'].append(train_loss)
losses['validation'].append(val_loss)
plt.plot(losses['train'], label='Training loss')
plt.plot(losses['validation'], label='Validation loss')
plt.legend()
_ = plt.ylim()
Here, use the test data to view how well your network is modeling the data. If something is completely wrong here, make sure each step in your network is implemented correctly.
fig, ax = plt.subplots(figsize=(8,4))
mean, std = scaled_features['cnt']
predictions = network.run(test_features).T*std + mean
ax.plot(predictions[0], label='Prediction')
ax.plot((test_targets['cnt']*std + mean).values, label='Data')
ax.set_xlim(right=len(predictions))
ax.legend()
dates = pd.to_datetime(rides.loc[test_data.index]['dteday'])
dates = dates.apply(lambda d: d.strftime('%b %d'))
ax.set_xticks(np.arange(len(dates))[12::24])
_ = ax.set_xticklabels(dates[12::24], rotation=45)
Answer these questions about your results. How well does the model predict the data? Where does it fail? Why does it fail where it does?
Note: You can edit the text in this cell by double clicking on it. When you want to render the text, press control + enter
The model predicts very well the first days of the December month (until the 20th of December) then it fails to generalize at the end of the month. One plausible interpretation is that the model did not get enough (relevant) data to learn the specific seasonality of the end of the december month (chrismtas vacation season). The only data allowing some learning is weather or season (probably with a vacation feature the prediction could be a bit improved).
rides = pd.read_csv(data_path)
dummy_fields = ['season', 'weathersit', 'mnth', 'hr', 'weekday']
for each in dummy_fields:
dummies = pd.get_dummies(rides[each], prefix=each, drop_first=False)
rides = pd.concat([rides, dummies], axis=1)
fields_to_drop = ['instant', 'dteday', 'season', 'weathersit',
'weekday', 'mnth', 'workingday', 'hr'] # , 'atemp'
data = rides.drop(fields_to_drop, axis=1)
# print(data.head(3))
quant_features = ['casual', 'registered', 'cnt', 'temp', 'hum', 'windspeed']
# Store scalings in a dictionary so we can convert back later
scaled_features = {}
for each in quant_features:
mean, std = data[each].mean(), data[each].std()
scaled_features[each] = [mean, std]
data.loc[:, each] = (data[each] - mean)/std
# Alternative data split (Stripes of dayes p+q where p is the number of training days and q the number of testing days)
from itertools import chain
training_stripe_width_days = 2
test_stripe_width_days = 1
total_stripe_width_day = test_stripe_width_days + training_stripe_width_days
stripe_width = 24 * total_stripe_width_day
indexes = list(range(data.shape[0]))
train_validation_stripes = [indexes[i:i+(training_stripe_width_days*24)] for i in range (0, len(indexes), stripe_width)]
test_stripes = [indexes[i+(training_stripe_width_days*24):i+stripe_width] for i in range (0, len(indexes), stripe_width)]
# Prepare train/test data
test_data = data.loc[chain.from_iterable(test_stripes)]
train_validation_data = data.loc[chain.from_iterable(train_validation_stripes)]
# TODO: stripe based on hours ...
# Separate the data into features and targets
target_fields = ['cnt', 'casual', 'registered']
features, targets = train_validation_data.drop(target_fields, axis=1), train_validation_data[target_fields]
test_features, test_targets = test_data.drop(target_fields, axis=1), test_data[target_fields]
# Hold out the last 60 days or so of the remaining data as a validation set
train_features, train_targets = features[:-60*24], targets[:-60*24]
val_features, val_targets = features[-60*24:], targets[-60*24:]
def train_network(train_features, iterations=500, learning_rate=0.2, hidden_nodes=20, output_nodes=1, batch_size=128):
N_i = train_features.shape[1]
network = NeuralNetwork(N_i, hidden_nodes, output_nodes, learning_rate)
losses = {'train':[], 'validation':[]}
for ii in range(iterations):
# Go through a random batch of 128 records from the training data set
batch = np.random.choice(train_features.index, size=batch_size)
X, y = train_features.loc[batch].values, train_targets.loc[batch]['cnt']
network.train(X, y)
# Printing out the training progress
train_loss = MSE(network.run(train_features).T, train_targets['cnt'].values)
val_loss = MSE(network.run(val_features).T, val_targets['cnt'].values)
sys.stdout.write("\rProgress: {:2.1f}".format(100 * ii/float(iterations)) \
+ "% ... Training loss: " + str(train_loss)[:5] \
+ " ... Validation loss: " + str(val_loss)[:5])
sys.stdout.flush()
losses['train'].append(train_loss)
losses['validation'].append(val_loss)
return network, losses
def plot_losses_progress(losses):
""" expects losses as a dict as {'train':[], 'validation':[]} """
plt.plot(losses['train'], label='Training loss')
plt.plot(losses['validation'], label='Validation loss')
plt.legend()
_ = plt.ylim()
network, losses = train_network(train_features, iterations=7000, learning_rate = 0.25, hidden_nodes=10)
plot_losses_progress(losses)
fig, ax = plt.subplots(figsize=(16,4))
tail_days = 10
mean, std = scaled_features['cnt']
predictions = network.run(test_features[-tail_days*24:]).T*std + mean
vl = range(0, 24*(tail_days+1), 24)
ax.plot(predictions[0], label='Prediction')
ax.plot((test_targets[-tail_days*24:]['cnt']*std + mean).values, label='Data')
for pos in vl:
ax.axvline(pos, color='g', linestyle='--')
ax.set_xlim(right=len(predictions))
ax.legend()
dates = pd.to_datetime(rides.loc[test_data[-tail_days*24:].index]['dteday'])
dates = dates.apply(lambda d: d.strftime('%b %d') + ', {} day(s)'.format(test_stripe_width_days))
ax.set_xticks(np.arange(len(dates)+13)[12::24])
_ = ax.set_xticklabels(dates[12::24], rotation=45)


The DCMB plays a wide variety of music, ranging from the occasional march to popular songs to movie and video game music and more. Some of our favorites include "Hey Baby", "Build me up Buttercup", "The Muppets Theme", "Pirates of the Caribbean", and "Time Warp".
In addition to these, in our weekly parade, and while marching on and off the field, and whenever the football team scores, we play the school fight songs, aka "Dartmouth Tunes" (DT's).
Here are a few more Dartmouth songs the band either plays or sings:
[There are recordings of the wind symphony playing these, and there are not-as-nice recordings on the old band site, so these pages should include those.]


Game Events
Info Updates
Real time Game Data
The background controller of this app is listening to all the game events and info updates, and sends them to this window, that prints them to the screen. Some specific events (startMatch, Kill and Death) are painted in teal and logged to the developers console.


| Date | Game | Venue | Result |
|---|---|---|---|
| 23/04/2019 | Beavers @ Brew Jays | Wandsworth Common (Bellevue Road) | |
| 30/04/2019 | London Raiders Green @ Beavers | Clissold Park | |
| 14/05/2019 | Pimlico Parrots @ Beavers | Clissold Park | |
| 21/05/2019 | The Jets @ Beavers | Clissold Park | |
| 30/05/2019 | Beavers @ Meteor Green | Blackhorse Road | |
| 04/06/2019 | London Raiders Orange @ Beavers | Clissold Park | |
| 13/06/2019 | Beavers @ Diamond Dogs | Clissold Park | |
| 19/06/2019 | Beavers @ London Raiders Green | Colliers Wood Recreation Ground | |
| 02/07/2019 | Beavers @ Pimlico Parrots | Parliament Hill | |
| 11/07/2019 | Beavers @ The Jets | Regents Park | |
| 16/07/2019 | Meteor Green @ Beavers | Clissold Park | |
| 25/07/2019 | Beavers @ London Raiders Orange | Wandsworth Common (Bellevue Road) | |
| 30/07/2019 | Diamond Dogs @ Beavers | Clissold Park | |
| 07/08/2019 | Beavers @ BYOB | Wandsworth Common (John Archer Way) | |
| 13/08/2019 | Brew Jays @ Beavers | Clissold Park | |
| 20/08/2019 | BYOB @ Beavers | Clissold Park |
12th January 2018: the night was cold and the beer was flowing. On this special night (with no influence of alcohol at all) three queen beavers conceived an idea that would change the course of history forever. An idea so great, so brilliant that it birthed the greatest group that ever was.
“Hey, let’s start our own softball team!”
Several more drinks and some (partially) sober planning later, and the GLSML Beavers were born.
The queens were then tasked with the job of recruiting their clunge* of beavers. They sought out to build a super team, a team so talented, so unbeatable that they would be the ultimate force to be reckoned with... at the pub.
The 2018 Beavers proved their infinite talents. Balls were hit. Games were played. But most importantly fun was had and the team proved themselves to be the most fun and friendly team in the league.
*clunge: a badass group of beavers (I encourage you to Google this)


Here's a sneak peek at some of the HCI projects I've worked on. Please visit my real website
www.heidijwang.com
for more info!


OFFICE OF THE CHAIRMAN CONTRACT AWARDING COMMITTEE ECOWAS HEADQUARTERS LOME,REPUBLIC OF TOGO 00228-9077-231 ACCOUNT PROVISION FOR USD45M Greetings!!. Dear, Forgive my indignation if this message comes to you as a surprise and if it might offend you without your prior consent and writing through this channel. I am DR Robinson Dike,The Chairman, Contract Awarding Committee of the ECONOMIC COMMUNITY OF WEST AFRICAN STATES (ECOWAS) with Headquarters in Lome, Togo.I got your information in a business directory from the Internet Website.when I was searching for a reliable,honest and trustworthy person to entrust this business with.I was simply inspired and motivated to pick your contact from the many names and lists in the directory. After discussing my view and your profile with my colleagues,they were very much satisfied and decided to contact you immediately for this mutual business relationship.We wish to transfer the sum of USD45,000,000.00 (Forty-five Million United States Dollars only.)into your personal or company`s bank account. This fund was a residue of the over invoiced contract bills awarded by us for the supply of ammunitions, hard/soft wares,phamaceauticals/medical items,light and heavy duty vehicles, apperals and other administrative logistics etc for the ECOMOG in Sierria-Leone and Liberia during the Peace Keeping Projects. This DEAL was deliberately hatched out and carefully protected with all the attendant lope holes sealed off.As the Chairman of CAC,I have the cooperation and mandate of the Financial Director and the Secretary of the Organisation.We arranged and over invoiced the contract funds supplied by different companies from different countries during the crisis. It was our consensus to seek the assistance of a willing foreigner to provide us with the facilities to transfer this money out of West Africa.This is borne out of our beleif in the non-stable and sporous political nature of this sub-region. The original contractors have been duely paid by the (Central Bank of the West African States)through our bankers-Progress Bank Of Africa Plc Lome Togo. This balance is suspended in the escrow accounts awaiting claims by any foreign company of our choice.We intend to pay out this fund NOW as the organisation is winding up its activities since the aim of returning PEACE to the countries and the coast has been achieved. Based on the laws and ethics of employment,we as civil servants working under this organisation, are not allowed to operate a foreign account.This is the more reason why we needed your assistance to provide an account that can sustain this fund for safe keeping and our future investment with your comprehensive advise,assistance and partnership in your country. It is however agreed,as the account owner in this deal to allow you 30% of the entire sum as compensation, 65% will be held on trust for us while 5% will be used to defray any incidental charges and cost during the course of the transaction. This transaction will be successfully concluded within 10 days if you accord us your unalloyed and due cooperation if you should provide the following: YOUR COMPANY`S NAME WITH COMPLETE ADDRESS,TEL AND FAX NUMBERS.(if available) YOUR COMPLETE MAILING ADRRESS WITH TELEPHONE AND FAX NUMBERS. YOUR COMPLETE BANK PARTICULARS;NAME,ADDRESS,ACCOUNT NO,SWIFT CODE,TEL/FAX NOS ETC.. Upon the receipt of this informations,the documents and approval with the texts will be sent to you for confirmaton and then forwarded to the organisation for ratification and subsequent payment. As with the case of all organised (sensitive)and conspired DEALS,we solicit for your unreserved confidentiality and utmost secret in this business. We hope to retire peacefully and lead a honourable business life afterwards.There are no risks involved. I await your urgent response. Yours faithfully, Dr.Robinson Dike.


Subprime Auto Loans Blowout
On today’s double-header episode of Double Down, Max Keiser and Stacy Herbert discuss the epic blowout happening in the subprime auto loan market with Wolf Richter of WolfStreet.com.
by by Stacy Herbert, Max KeiserAs the Dow Jones passes 28,000 for the first time, are things really looking groovy for the US economy? Or is this time different? Max suggests the Dow can go to 70,000; there is nothing in the way of the Fed and higher stock market valuations. DOUBLE DOWN talks to Wolf Richter for his thoughts. When markets are this divorced from reality and it has already done the impossible, there is nothing stopping it from going even higher. They also discuss the absolute blowout in the subprime auto loans market where serious delinquencies on the loans are at near-record levels - despite the booming economy. Wolf suggests that this is due to the dealers and loan providers getting greedy; many of these loans default before the very first payment is ever made! Tune into Double Down to hear more on what Wolf has to say about this crazy market.
We'd love to get your feedback at radio@sputniknews.com


For 3 days I repeatedly used opiates. The pills were acquired from the depths of the medicine cabinet; leftovers from past operations and sleeping problems of my family members. I wasn't doing anything all week but hanging out around my parent's house, which is mindnumbingly dull, so the finding the pills was a joyous event.
In the afternoon I took 3 hydrocodones and 2 oxycontins. after about 20 minutes I started feeling pretty good, and while waiting for the pills to take full affect, I crushed a oxycontin and snorted through a cut straw and took two more hydrocodone pills and one more oxycontin.
The oxy-snuff hit me in seconds.  My head seemed to float up from my body, my hands were shaking and fidgeting like a speedfreak's, and every movement I made felt fluid and wonderful, like I was dancing in warm water. I felt happy, talkative, and hyper. impulsively, I called up old friends from high school and college and ranted to whoever answered the phone (or their answering machine). My words sounded fast and highpitched. I couldn't control what I was saying... that is, I couldn't think before I spoke, I just thought outloud, and made some embarrassing revelations.
Eventually I decided I had frightened enough people and jumped into my bed.  I wrote pages and pages in my journal about my state of mind, by this time I was very tired (but knew it was I bad idea to go to sleep). the entry is barely legible, but here are samples:
'the safest place in the world is not any room, or building or forest, or valley or cave. it is a state of mind, and of body: it is in sleep. here you are protected, in the numb cushion of darkness and dreams. you can never really be hurt here.'
'I'm seeing falling white spots and diagonal lines traveling downward from the ceiling. these dark shapes on the wall are mutating too quickly for me to dicern what they are. this pink wall is discolored and dirty. graffiti dance around on it and make bright phasers of past messages when it changes.'
'how much longer can this go on.  I need to get up and move.'
'I feel deep, soothing relaxation... my skin soft and pleasing to touch. I blink slowly; my eyelids feel nice as they slide up and down. my lips are electricity. when I move my head, blood rushes to my brain, and I lay back with my eyes closed, and I feel my spirit rise from my heavy, fragile body... my ghost floats up up, and dances, it dances like an ameba would dance- with no shape or rigidity or boundaries- it hovers over me and gyrates and expands and the music changes and the vision disappears.'
'pulling, slowly, slowly... my muscles and pulling my skin, my organs, my bones down. they embrace gravity. I sink down down into the mattress. soon it will engulf me, and cover me warmth and darkness. I must resist sleep. no matter how nice it is to lie still with my eyes shut and my breathing so slow and spread out I almost forget to take them.'
'is this a nice feeling or not? am I happier now than I was an hour ago?'
'I am going to overdose. I am going to have a seizure.'
'we are the privildged numb-cheeked light-headed smilers that will laugh and talk and float past the doors.'
There is much more of this mood-swing nonsense, but it gets irritating very quickly. this state of mind lasted from three days, in which and slowly increased the dosage of narcotics. Whenever I would start to come down, I would feel lethargic and panicked, and I would itch all over my body. it was an itching that was UNBEARABLE: it was behind my eyes, deep in my ears, on every inch of my skin, EVERYWHERE. The itching was all I could think about, and it would not go away. I scratched my skin raw trying. I was also painfully constipated during and after the experience. I was miserable, and it prompted me to take more and get high again so I wouldn't feel so bad.
I had very little experience with the recreational consumption of painkillers, and in retrospect I see that the dose I took was very dangerous. I was able to function somewhat during the experience, but I was constantly dizzy and I laughed at everything, especially at times when it inappropriate: like when I heard my cousin was in a mental ward at the hospital.
Overall I had fun, maybe a bit too much, because I really want (almost crave) to do it again, and that makes me worry.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Tech Stuff provides you a platform to post your electronics and gear for rent. With Tech Stuff, you can also browse local listings and find what you need. Instead of buying higher-end electronics for less frequent projects, you can borrow or share your resources.
Our goal is simple. Eliminate the middle-man. By bringing together the community through our platform, we hope to help reduce costs and provide simple access to technology. Join us in building a strong community for creativity and innovation.


On Veterans Day, Mike Pence Reaches Out to Struggling Veterans
Vice President Mike Pence specifically reached out to struggling veterans on Monday, during his speech at Arlington Cemetery on Veterans Day.
by Charlie SpieringHe said:
Let me say from the heart, if you are a veteran who is struggling with the return to civilian life or if you have a family member or a friend or a neighbor who you know is similarly burdened, just know that there is help available today, and just as you were there for us, we will be there for you to see you through this time.
The Vice President delivered the keynote speech at Arlington Ceremony this year, as President Donald Trump traveled to New York City to speak at the 100th Anniversary of the New York City Veterans Day parade.
“The Bible tells us if you owe debts, pay debts; if honor then honor, if respect, then respect,” Pence said, noting that Veterans Day was a day for all Americans to pay tribute to those who had served.
He thanked all veterans for their courage and patriotism for answering the call to service.
“You came from the rest of us, but we know that you are the best of us,” he said.
Pence told the story of Medal of Honor recipient Kyle Carpenter who recalled a moment that an Uber driver thanked him for his service, to which Carpenter replied, “You’re worth it.”
Pence choked up as he explained Carpenter’s belief that the man, his family, his freedom, and his rights were worth sacrificing for in the military.
“Thank you,” Pence said as the crowd stood and applauded. “Thank you for considering us worthy of your all and service to this country.”
After Pence was finished with his speech, one man shouted “Four More Years!” earning cheers and applause from the crowd at the ceremony.


The character escaping facility is prescribed by the ISO Prolog standard, and allows escape sequences to occur within strings and quoted atoms, so that programmers can put non-printable characters in atoms and strings and still be able to see what they are doing.
Strings or quoted atoms containing escape sequences can occur in terms
obtained by read/[1,2]
, compile/1
, and so on.
The `0'' notation for the integer code of a character is also affected by
character escaping.
The only characters that can occur in a string or quoted atom are the printable characters and <SPC>. All other layout characters must be expressed with escape sequences (see ref-syn-syn-esc).


Prime rib is one of the sweetest dishes if cooked well.Here are some easy to follow steps on while cooking prime rib.
Add soy sauce with abit of water in a bowl and mix with the spices;in a ratio preffered by you.Stirr thoroughly and dip the ribs inside the mixture ensuring all sides are coated.
Refrigirate for 4-8hours. Remove from fridge and apply soy sauce using a brush before placing on grill.
Let it cook for 15 minutes on each side and ccassinally sprinkle salty water to add flavor and prevent meat from drying.
Apply barbeque sauce and grill for another 3 minutes on each side.
Served glazed as a main dish or side dish.


| Top |
| #define | P11_KIT_URI_SCHEME |
| #define | P11_KIT_URI_SCHEME_LEN |
| enum | P11KitUriType |
| enum | P11KitUriResult |
| typedef | P11KitUri |
| typedef | p11_kit_uri |
| #define | P11_KIT_URI_NO_MEMORY |
PKCS#11 URIs can be used in configuration files or applications to represent PKCS#11 modules, tokens or objects. An example of a URI might be:
pkcs11:token=The\%20Software\%20PKCS#11\%20softtoken;
manufacturer=Snake\%20Oil,\%20Inc.;serial=;object=my-certificate;
model=1.0;type=cert;id=\%69\%95\%3e\%5c\%f4\%bd\%ec\%91
You can use p11_kit_uri_parse()
to parse such a URI, and p11_kit_uri_format()
to build one. URIs are represented by the P11KitUri structure. You can match
a parsed URI against PKCS#11 tokens with p11_kit_uri_match_token_info()
or attributes with p11_kit_uri_match_attributes()
.
Since URIs can represent different sorts of things, when parsing or formatting a URI a 'context' can be used to indicate which sort of URI is expected.
URIs have an unrecognized
flag. This flag is set during parsing
if any parts of the URI are not recognized. This may be because the part is
from a newer version of the PKCS#11 spec or because that part was not valid
inside of the desired context used when parsing.
P11KitUri *
p11_kit_uri_new (void
);
Create a new blank PKCS#11 URI.
The new URI is in the right state to parse a string into. All relevant fields are zeroed out. Formatting this URI will produce a valid but empty URI.
CK_INFO_PTR
p11_kit_uri_get_module_info (P11KitUri *uri
);
Get the CK_INFO
structure associated with this URI.
If this is a parsed URI, then the fields corresponding to library parts of the URI will be filled in. Any library URI parts that were missing will have their fields filled with zeros.
If the caller wishes to setup information for building a URI, then relevant fields should be filled in. Fields that should not appear as parts in the resulting URI should be filled with zeros.
int p11_kit_uri_match_module_info (const P11KitUri *uri
,const CK_INFO *info
);
Match a CK_INFO
structure against the library parts of this URI.
Only the fields of the CK_INFO
structure that are valid for use
in a URI will be matched. A URI part that was not specified in the URI will
match any value in the structure. If during the URI parsing any unrecognized
parts were encountered then this match will fail.
CK_SLOT_INFO_PTR
p11_kit_uri_get_slot_info (P11KitUri *uri
);
Get the CK_SLOT_INFO
structure associated with this URI.
If this is a parsed URI, then the fields corresponding to slot parts of the URI will be filled in. Any slot URI parts that were missing will have their fields filled with zeros.
If the caller wishes to setup information for building a URI, then relevant fields should be filled in. Fields that should not appear as parts in the resulting URI should be filled with zeros.
int p11_kit_uri_match_slot_info (const P11KitUri *uri
,const CK_SLOT_INFO *slot_info
);
Match a CK_SLOT_INFO
structure against the slot parts of this
URI.
Only the fields of the CK_SLOT_INFO
structure that are valid
for use in a URI will be matched. A URI part that was not specified in the
URI will match any value in the structure. If during the URI parsing any
unrecognized parts were encountered then this match will fail.
CK_SLOT_ID
p11_kit_uri_get_slot_id (P11KitUri *uri
);
Get the 'slot-id' part of the URI.
void p11_kit_uri_set_slot_id (P11KitUri *uri
,CK_SLOT_ID slot_id
);
Set the 'slot-id' part of the URI.
CK_TOKEN_INFO_PTR
p11_kit_uri_get_token_info (P11KitUri *uri
);
Get the CK_TOKEN_INFO
structure associated with this URI.
If this is a parsed URI, then the fields corresponding to token parts of the URI will be filled in. Any token URI parts that were missing will have their fields filled with zeros.
If the caller wishes to setup information for building a URI, then relevant fields should be filled in. Fields that should not appear as parts in the resulting URI should be filled with zeros.
int p11_kit_uri_match_token_info (const P11KitUri *uri
,const CK_TOKEN_INFO *token_info
);
Match a CK_TOKEN_INFO
structure against the token parts of this
URI.
Only the fields of the CK_TOKEN_INFO
structure that are valid
for use in a URI will be matched. A URI part that was not specified in the
URI will match any value in the structure. If during the URI parsing any
unrecognized parts were encountered then this match will fail.
CK_ATTRIBUTE_PTR p11_kit_uri_get_attributes (P11KitUri *uri
,CK_ULONG *n_attrs
);
int p11_kit_uri_set_attributes (P11KitUri *uri
,CK_ATTRIBUTE_PTR attrs
,CK_ULONG n_attrs
);
int p11_kit_uri_match_attributes (const P11KitUri *uri
,const CK_ATTRIBUTE *attrs
,CK_ULONG n_attrs
);
Match a attributes against the object parts of this URI.
Only the attributes that are valid for use in a URI will be matched. A URI part that was not specified in the URI will match any attribute value. If during the URI parsing any unrecognized parts were encountered then this match will fail.
CK_ATTRIBUTE_PTR p11_kit_uri_get_attribute (P11KitUri *uri
,CK_ATTRIBUTE_TYPE attr_type
);
Get a pointer to an attribute present in this URI.
int p11_kit_uri_set_attribute (P11KitUri *uri
,CK_ATTRIBUTE_PTR attr
);
Set an attribute on the URI.
Only attributes that map to parts in a PKCS#11 URI will be accepted.
P11_KIT_URI_OK
if the attribute was successfully set.
P11_KIT_URI_NOT_FOUND
if the attribute was not valid for a URI.
int p11_kit_uri_clear_attribute (P11KitUri *uri
,CK_ATTRIBUTE_TYPE attr_type
);
Clear an attribute on the URI.
Only attributes that map to parts in a PKCS#11 URI will be accepted.
P11_KIT_URI_OK
if the attribute was successfully cleared.
P11_KIT_URI_NOT_FOUND
if the attribute was not valid for a URI.
void p11_kit_uri_set_unrecognized (P11KitUri *uri
,int unrecognized
);
Set the unrecognized flag on this URI.
The unrecognized flag is automatically set to 1 when during parsing any part of the URI is unrecognized. If the unrecognized flag is set to 1, then matching against this URI will always fail.
int
p11_kit_uri_any_unrecognized (P11KitUri *uri
);
Get the unrecognized flag for this URI.
The unrecognized flag is automatically set to 1 when during parsing any part of the URI is unrecognized. If the unrecognized flag is set to 1, then matching against this URI will always fail.
const char *
p11_kit_uri_get_pin_value (const P11KitUri *uri
);
Get the 'pin-value' part of the URI. This is used by some applications to read the PIN for logging into a PKCS#11 token.
void p11_kit_uri_set_pin_value (P11KitUri *uri
,const char *pin
);
Set the 'pin-value' part of the URI. This is used by some applications to specify the PIN for logging into a PKCS#11 token.
const char *
p11_kit_uri_get_pin_source (const P11KitUri *uri
);
Get the 'pin-source' part of the URI. This is used by some applications to lookup a PIN for logging into a PKCS#11 token.
void p11_kit_uri_set_pin_source (P11KitUri *uri
,const char *pin_source
);
Set the 'pin-source' part of the URI. This is used by some applications to lookup a PIN for logging into a PKCS#11 token.
const char *
p11_kit_uri_get_pinfile (const P11KitUri *uri
);
p11_kit_uri_get_pinfile
is deprecated and should not be used in newly-written code.
void p11_kit_uri_set_pinfile (P11KitUri *uri
,const char *pinfile
);
p11_kit_uri_set_pinfile
is deprecated and should not be used in newly-written code.
const char *
p11_kit_uri_get_module_name (const P11KitUri *uri
);
p11_kit_uri_get_module_name
is deprecated and should not be used in newly-written code.
Get the 'module-name' part of the URI. This is used by some applications to explicitly specify the name of a PKCS#11 module.
void p11_kit_uri_set_module_name (P11KitUri *uri
,const char *name
);
Set the 'module-name' part of the URI. This is used by some applications to explicitly specify the name of a PKCS#11 module.
const char *
p11_kit_uri_get_module_path (const P11KitUri *uri
);
Get the 'module-path' part of the URI. This is used by some applications to explicitly specify the path of a PKCS#11 module.
void p11_kit_uri_set_module_path (P11KitUri *uri
,const char *path
);
Set the 'module-path' part of the URI. This is used by some applications to explicitly specify the path of a PKCS#11 module.
const char * p11_kit_uri_get_vendor_query (const P11KitUri *uri
,const char *name
);
Get the vendor query part of the URI, identified by name
. This is
used by some applications to explicitly specify the path of a
PKCS#11 module.
int p11_kit_uri_set_vendor_query (P11KitUri *uri
,const char *name
,const char *value
);
Set the vendor query part of the URI, identified by name
. This is
used by some applications to explicitly specify the path of a
PKCS#11 module.
int p11_kit_uri_format (P11KitUri *uri
,P11KitUriType uri_type
,char **string
);
Format a PKCS#11 URI into a string.
Fields which are zeroed out will not be included in the resulting string. Attributes which are not present will also not be included.
The uri_type of URI specified limits the different parts of the resulting
URI. To format a URI containing all possible information use
P11_KIT_URI_FOR_ANY
It's up to the caller to guarantee that the attributes set in uri
are
those appropriate for inclusion in a URI, specifically:
CKA_ID
, CKA_LABEL
and CKA_CLASS
. The class must be one of
CKO_DATA
, CKO_SECRET_KEY
,
CKO_CERTIFICATE
, CKO_PUBLIC_KEY
,
CKO_PRIVATE_KEY
.
The resulting string should be freed with free()
.
uri |
The URI. |
|
uri_type |
The type of URI that should be produced. |
|
string |
Location to store a newly allocated string. |
P11_KIT_URI_OK
if the URI was formatted successfully,
P11_KIT_URI_UNEXPECTED
if the data in uri
is invalid for a URI.
int p11_kit_uri_parse (const char *string
,P11KitUriType uri_type
,P11KitUri *uri
);
Parse a PKCS#11 URI string.
PKCS#11 URIs can represent tokens, objects or modules. The uri_type argument
allows the caller to specify what type of URI is expected and the sorts of
things the URI should match. P11_KIT_URI_FOR_ANY
can be used to parse a URI
for any context. It's then up to the caller to make sense of the way that
it is used.
If the PKCS#11 URI contains unrecognized URI parts or parts not applicable to the specified context, then the unrecognized flag will be set. This will prevent the URI from matching using the various match functions.
string |
The string to parse |
|
uri_type |
The type of URI that is expected |
|
uri |
The blank URI to parse the values into |
P11_KIT_URI_OK
if the URI was parsed successfully.
P11_KIT_URI_BAD_SCHEME
if this was not a PKCS#11 URI.
P11_KIT_URI_BAD_SYNTAX
if the URI syntax was bad.
P11_KIT_URI_BAD_VERSION
if a version number was bad.
P11_KIT_URI_BAD_ENCODING
if the URI encoding was invalid.
const char *
p11_kit_uri_message (int code
);
Lookup a message for the uri error code. These codes are the P11_KIT_URI_XXX
error codes that can be returned from p11_kit_uri_parse()
or
p11_kit_uri_format()
. As a special case NULL
, will be returned for
P11_KIT_URI_OK
.
A PKCS#11 URI can represent different kinds of things. This flag is used by
p11_kit_uri_parse()
to denote in what context the URI will be used.
The various types can be combined.
|
The URI represents one or more objects |
||
|
The URI represents one or more tokens |
||
|
The URI represents one or more slots |
||
|
The URI represents one or more modules |
||
|
The URI represents a module with a specific version. |
||
|
The URI represents one or more objects that are present on a specific token. |
||
|
The URI represents one or more objects that are present on a specific token, being used with a certain module. |
||
|
The URI can represent anything |
Error codes returned by various functions. The functions each clearly state which error codes they are capable of returning.
typedef struct p11_kit_uri P11KitUri;
A structure representing a PKCS#11 URI. There are no public fields visible in this structure. Use the various accessor functions.
#define P11_KIT_URI_NO_MEMORY P11_KIT_URI_UNEXPECTED
Unexpected memory allocation failure result. Same as P11_KIT_URI_UNEXPECTED.