In this notebook, some template code has already been provided for you, and you will need to implement additional functionality to successfully complete this project. You will not need to modify the included code beyond what is requested. Sections that begin with '(IMPLEMENTATION)' in the header indicate that the following block of code will require additional functionality which you must provide. Instructions will be provided for each section, and the specifics of the implementation are marked in the code block with a 'TODO' statement. Please be sure to read the instructions carefully!
Note: Once you have completed all of the code implementations, you need to finalize your work by exporting the iPython Notebook as an HTML document. Before exporting the notebook to html, all of the code cells need to have been run so that reviewers can see the final implementation and output. You can then export the notebook by using the menu above and navigating to \n", "File -> Download as -> HTML (.html). Include the finished document along with this notebook as your submission.
In addition to implementing code, there will be questions that you must answer which relate to the project and your implementation. Each section where you will answer a question is preceded by a 'Question X' header. Carefully read each question and provide thorough answers in the following text boxes that begin with 'Answer:'. Your project submission will be evaluated based on your answers to each of the questions and the implementation you provide.
Note: Code and Markdown cells can be executed using the Shift + Enter keyboard shortcut. Markdown cells can be edited by double-clicking the cell to enter edit mode.
The rubric contains optional "Stand Out Suggestions" for enhancing the project beyond the minimum requirements. If you decide to pursue the "Stand Out Suggestions", you should include the code in this IPython notebook.
In this notebook, you will make the first steps towards developing an algorithm that could be used as part of a mobile or web app. At the end of this project, your code will accept any user-supplied image as input. If a dog is detected in the image, it will provide an estimate of the dog's breed. If a human is detected, it will provide an estimate of the dog breed that is most resembling. The image below displays potential sample output of your finished project (... but we expect that each student's algorithm will behave differently!).
In this real-world setting, you will need to piece together a series of models to perform different tasks; for instance, the algorithm that detects humans in an image will be different from the CNN that infers dog breed. There are many points of possible failure, and no perfect algorithm exists. Your imperfect solution will nonetheless create a fun user experience!
We break the notebook into separate steps. Feel free to use the links below to navigate the notebook.
In the code cell below, we import a dataset of dog images. We populate a few variables through the use of the load_files
function from the scikit-learn library:
train_files
, valid_files
, test_files
- numpy arrays containing file paths to imagestrain_targets
, valid_targets
, test_targets
- numpy arrays containing onehot-encoded classification labels dog_names
- list of string-valued dog breed names for translating labelsfrom sklearn.datasets import load_files
from keras.utils import np_utils
import numpy as np
from glob import glob
# define function to load train, test, and validation datasets
def load_dataset(path):
data = load_files(path)
dog_files = np.array(data['filenames'])
dog_targets = np_utils.to_categorical(np.array(data['target']), 133)
return dog_files, dog_targets
# load train, test, and validation datasets
train_files, train_targets = load_dataset('dogImages/train')
valid_files, valid_targets = load_dataset('dogImages/valid')
test_files, test_targets = load_dataset('dogImages/test')
# load list of dog names
dog_names = [item[20:-1] for item in sorted(glob("dogImages/train/*/"))]
# print statistics about the dataset
print('There are %d total dog categories.' % len(dog_names))
print('There are %s total dog images.\n' % len(np.hstack([train_files, valid_files, test_files])))
print('There are %d training dog images.' % len(train_files))
print('There are %d validation dog images.' % len(valid_files))
print('There are %d test dog images.'% len(test_files))
In the code cell below, we import a dataset of human images, where the file paths are stored in the numpy array human_files
.
import random
random.seed(8675309)
# load filenames in shuffled human dataset
human_files = np.array(glob("lfw/*/*"))
random.shuffle(human_files)
# print statistics about the dataset
print('There are %d total human images.' % len(human_files))
We use OpenCV's implementation of Haar feature-based cascade classifiers to detect human faces in images. OpenCV provides many pre-trained face detectors, stored as XML files on github. We have downloaded one of these detectors and stored it in the haarcascades
directory.
In the next code cell, we demonstrate how to use this detector to find human faces in a sample image.
import cv2
import matplotlib.pyplot as plt
%matplotlib inline
# extract pre-trained face detector
face_cascade = cv2.CascadeClassifier('haarcascades/haarcascade_frontalface_alt.xml')
# load color (BGR) image
img = cv2.imread(train_files[5])
# convert BGR image to grayscale
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# find faces in image
faces = face_cascade.detectMultiScale(gray)
# print number of faces detected in the image
print('Number of faces detected:', len(faces))
# get bounding box for each detected face
for (x,y,w,h) in faces:
# add bounding box to color image
cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)
# convert BGR image to RGB for plotting
cv_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
# display the image, along with bounding box
plt.imshow(cv_rgb)
plt.show()
Before using any of the face detectors, it is standard procedure to convert the images to grayscale. The detectMultiScale
function executes the classifier stored in face_cascade
and takes the grayscale image as a parameter.
In the above code, faces
is a numpy array of detected faces, where each row corresponds to a detected face. Each detected face is a 1D array with four entries that specifies the bounding box of the detected face. The first two entries in the array (extracted in the above code as x
and y
) specify the horizontal and vertical positions of the top left corner of the bounding box. The last two entries in the array (extracted here as w
and h
) specify the width and height of the box.
We can use this procedure to write a function that returns True
if a human face is detected in an image and False
otherwise. This function, aptly named face_detector
, takes a string-valued file path to an image as input and appears in the code block below.
# returns "True" if face is detected in image stored at img_path
def face_detector(img_path):
img = cv2.imread(img_path)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = face_cascade.detectMultiScale(gray)
return len(faces) > 0
Question 1: Use the code cell below to test the performance of the face_detector
function.
human_files
have a detected human face? dog_files
have a detected human face?  You will see that our algorithm falls short of this goal, but still gives acceptable performance. We extract the file paths for the first 100 images from each of the datasets and store them in the numpy arrays human_files_short
and dog_files_short
.
Answer: The algorithms gives the following results:
human_files_short = human_files[:100]
dog_files_short = train_files[:100]
# Do NOT modify the code above this line.
## TODO: Test the performance of the face_detector algorithm
## on the images in human_files_short and dog_files_short.
humans_detected = [face_detector(human_file) for human_file in human_files_short]
dogs_detected = [face_detector(dog_file) for dog_file in dog_files_short]
accuracy_human = sum(humans_detected) / 100
accuracy_dog = (100-sum(dogs_detected)) / 100
print("Human face detection accuracy: ", accuracy_human, "\nDog accuracy: ", accuracy_dog)
# Print one sample of the misclassified dogs
sample_false = random.sample(list(np.where(dogs_detected)[0]), 1)[0]
# load color (BGR) image
img = cv2.imread(dog_files_short[sample_false])
# convert BGR image to grayscale
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# find faces in image
faces = face_cascade.detectMultiScale(gray)
# get bounding box for each detected face
for (x,y,w,h) in faces:
# add bounding box to color image
cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)
# convert BGR image to RGB for plotting
cv_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
# display the image, along with bounding box
plt.imshow(cv_rgb)
plt.show()
Question 2: This algorithmic choice necessitates that we communicate to the user that we accept human images only when they provide a clear view of a face (otherwise, we risk having unneccessarily frustrated users!). In your opinion, is this a reasonable expectation to pose on the user? If not, can you think of a way to detect humans in images that does not necessitate an image with a clearly presented face?
Answer: We could use classic face detection algorithms like the one proposed here, then crop the image around the face. We could also use attention networks to localize faces as targets in an image.
We suggest the face detector from OpenCV as a potential way to detect human images in your algorithm, but you are free to explore other approaches, especially approaches that make use of deep learning :). Please use the code cell below to design and test your own face detection algorithm. If you decide to pursue this optional task, report performance on each of the datasets.
## (Optional) TODO: Report the performance of another
## face detection algorithm on the LFW dataset
### Feel free to use as many code cells as needed.
In this section, we use a pre-trained ResNet-50 model to detect dogs in images. Our first line of code downloads the ResNet-50 model, along with weights that have been trained on ImageNet, a very large, very popular dataset used for image classification and other vision tasks. ImageNet contains over 10 million URLs, each linking to an image containing an object from one of 1000 categories. Given an image, this pre-trained ResNet-50 model returns a prediction (derived from the available categories in ImageNet) for the object that is contained in the image.
from keras.applications.resnet50 import ResNet50
# define ResNet50 model
ResNet50_model = ResNet50(weights='imagenet')
When using TensorFlow as backend, Keras CNNs require a 4D array (which we'll also refer to as a 4D tensor) as input, with shape
$$ (\text{nb_samples}, \text{rows}, \text{columns}, \text{channels}), $$where nb_samples
corresponds to the total number of images (or samples), and rows
, columns
, and channels
correspond to the number of rows, columns, and channels for each image, respectively.
The path_to_tensor
function below takes a string-valued file path to a color image as input and returns a 4D tensor suitable for supplying to a Keras CNN. The function first loads the image and resizes it to a square image that is $224 \times 224$ pixels. Next, the image is converted to an array, which is then resized to a 4D tensor. In this case, since we are working with color images, each image has three channels. Likewise, since we are processing a single image (or sample), the returned tensor will always have shape
The paths_to_tensor
function takes a numpy array of string-valued image paths as input and returns a 4D tensor with shape
Here, nb_samples
is the number of samples, or number of images, in the supplied array of image paths. It is best to think of nb_samples
as the number of 3D tensors (where each 3D tensor corresponds to a different image) in your dataset!
from keras.preprocessing import image
from tqdm import tqdm
def path_to_tensor(img_path):
# loads RGB image as PIL.Image.Image type
img = image.load_img(img_path, target_size=(224, 224))
# convert PIL.Image.Image type to 3D tensor with shape (224, 224, 3)
x = image.img_to_array(img)
# convert 3D tensor to 4D tensor with shape (1, 224, 224, 3) and return 4D tensor
return np.expand_dims(x, axis=0)
def paths_to_tensor(img_paths):
list_of_tensors = [path_to_tensor(img_path) for img_path in tqdm(img_paths)]
return np.vstack(list_of_tensors)
Getting the 4D tensor ready for ResNet-50, and for any other pre-trained model in Keras, requires some additional processing. First, the RGB image is converted to BGR by reordering the channels. All pre-trained models have the additional normalization step that the mean pixel (expressed in RGB as $[103.939, 116.779, 123.68]$ and calculated from all pixels in all images in ImageNet) must be subtracted from every pixel in each image. This is implemented in the imported function preprocess_input
. If you're curious, you can check the code for preprocess_input
here.
Now that we have a way to format our image for supplying to ResNet-50, we are now ready to use the model to extract the predictions. This is accomplished with the predict
method, which returns an array whose $i$-th entry is the model's predicted probability that the image belongs to the $i$-th ImageNet category. This is implemented in the ResNet50_predict_labels
function below.
By taking the argmax of the predicted probability vector, we obtain an integer corresponding to the model's predicted object class, which we can identify with an object category through the use of this dictionary.
from keras.applications.resnet50 import preprocess_input, decode_predictions
def ResNet50_predict_labels(img_path):
# returns prediction vector for image located at img_path
img = preprocess_input(path_to_tensor(img_path))
return np.argmax(ResNet50_model.predict(img))
While looking at the dictionary, you will notice that the categories corresponding to dogs appear in an uninterrupted sequence and correspond to dictionary keys 151-268, inclusive, to include all categories from 'Chihuahua'
to 'Mexican hairless'
. Thus, in order to check to see if an image is predicted to contain a dog by the pre-trained ResNet-50 model, we need only check if the ResNet50_predict_labels
function above returns a value between 151 and 268 (inclusive).
We use these ideas to complete the dog_detector
function below, which returns True
if a dog is detected in an image (and False
if not).
### returns "True" if a dog is detected in the image stored at img_path
def dog_detector(img_path):
prediction = ResNet50_predict_labels(img_path)
return ((prediction <= 268) & (prediction >= 151))
Question 3: Use the code cell below to test the performance of your dog_detector
function.
human_files_short
have a detected dog? dog_files_short
have a detected dog?Answer:
### TODO: Test the performance of the dog_detector function
### on the images in human_files_short and dog_files_short.
humans_detected = [dog_detector(human_file) for human_file in human_files_short]
dogs_detected = [dog_detector(dog_file) for dog_file in dog_files_short]
accuracy_human = (100-sum(humans_detected)) / 100
accuracy_dog = sum(dogs_detected) / 100
print("Human accuracy: ", accuracy_human, "\nDog accuracy: ", accuracy_dog)
Now that we have functions for detecting humans and dogs in images, we need a way to predict breed from images. In this step, you will create a CNN that classifies dog breeds. You must create your CNN from scratch (so, you can't use transfer learning yet!), and you must attain a test accuracy of at least 1%. In Step 5 of this notebook, you will have the opportunity to use transfer learning to create a CNN that attains greatly improved accuracy.
Be careful with adding too many trainable layers! More parameters means longer training, which means you are more likely to need a GPU to accelerate the training process. Thankfully, Keras provides a handy estimate of the time that each epoch is likely to take; you can extrapolate this estimate to figure out how long it will take for your algorithm to train.
We mention that the task of assigning breed to dogs from images is considered exceptionally challenging. To see why, consider that even a human would have great difficulty in distinguishing between a Brittany and a Welsh Springer Spaniel.
| Brittany | Welsh Springer Spaniel |
|---|---|
It is not difficult to find other dog breed pairs with minimal inter-class variation (for instance, Curly-Coated Retrievers and American Water Spaniels).
| Curly-Coated Retriever | American Water Spaniel |
|---|---|
Likewise, recall that labradors come in yellow, chocolate, and black. Your vision-based algorithm will have to conquer this high intra-class variation to determine how to classify all of these different shades as the same breed.
| Yellow Labrador | Chocolate Labrador | Black Labrador |
|---|---|---|
We also mention that random chance presents an exceptionally low bar: setting aside the fact that the classes are slightly imabalanced, a random guess will provide a correct answer roughly 1 in 133 times, which corresponds to an accuracy of less than 1%.
Remember that the practice is far ahead of the theory in deep learning. Experiment with many different architectures, and trust your intuition. And, of course, have fun!
We rescale the images by dividing every pixel in every image by 255.
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
# pre-process the data for Keras
train_tensors = paths_to_tensor(train_files).astype('float32')/255
valid_tensors = paths_to_tensor(valid_files).astype('float32')/255
test_tensors = paths_to_tensor(test_files).astype('float32')/255
Create a CNN to classify dog breed. At the end of your code cell block, summarize the layers of your model by executing the line:
model.summary()
We have imported some Python modules to get you started, but feel free to import as many modules as you need. If you end up getting stuck, here's a hint that specifies a model that trains relatively fast on CPU and attains >1% test accuracy in 5 epochs:
Question 4: Outline the steps you took to get to your final CNN architecture and your reasoning at each step. If you chose to use the hinted architecture above, describe why you think that CNN architecture should work well for the image classification task.
Answer:
CNN will be more efficients to extract locality information from the target regularities in the training set. In images CNN do not flatten the input into a 1D vector, instead by using a 2D kernel, the spatial depedencies in-between pixels is preserved which will reduce the amount of hidden node or training time necessary to learn patterns in image. Also, using weight sharing for each filter, a pattern can be recognized whatever the position of the target in the input image, which is useful for datasets using real life photographs, which are not normalized with a target of a specific size at the center of the image. Using Convolutional and Pooling layers is a classic pattern in CNN, it allows to progressively loose spatial information by averaging out (or taking the max) accross filters to produce more abstract features (a gross example would be going from "dog face top left" to "dog face in image" - although dog face is already a very abstract concept that would certainly appear after multiple convolution layers)
from keras.layers import Conv2D, MaxPooling2D, GlobalAveragePooling2D
from keras.layers import Dropout, Flatten, Dense
from keras.models import Sequential
from keras import optimizers
model = Sequential()
### TODO: Define your architecture.
model.add(Conv2D(filters=32, kernel_size=3, strides=2, padding='same',
activation='relu', input_shape=(224, 224, 3)))
model.add(MaxPooling2D(pool_size=2, strides=2))
model.add(Conv2D(filters=64, kernel_size=3, strides=2, padding='same',
activation='relu', input_shape=(56, 56, 3)))
model.add(MaxPooling2D(pool_size=2, strides=2))
model.add(Conv2D(filters=64, kernel_size=3, strides=2, padding='same',
activation='relu', input_shape=(14, 14, 3)))
model.add(GlobalAveragePooling2D())
model.add(Dense(133, activation='sigmoid'))
model.summary()
model.compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=['accuracy'])
Train your model in the code cell below. Use model checkpointing to save the model that attains the best validation loss.
You are welcome to augment the training data, but this is not a requirement.
from keras.callbacks import ModelCheckpoint
### TODO: specify the number of epochs that you would like to use to train the model.
epochs = 5
### Do NOT modify the code below this line.
checkpointer = ModelCheckpoint(filepath='saved_models/weights.best.from_scratch.hdf5',
verbose=1, save_best_only=True)
model.fit(train_tensors, train_targets,
validation_data=(valid_tensors, valid_targets),
epochs=epochs, batch_size=20, callbacks=[checkpointer], verbose=1)
model.load_weights('saved_models/weights.best.from_scratch.hdf5')
Try out your model on the test dataset of dog images. Ensure that your test accuracy is greater than 1%.
# get index of predicted dog breed for each image in test set
dog_breed_predictions = [np.argmax(model.predict(np.expand_dims(tensor, axis=0))) for tensor in test_tensors]
# report test accuracy
test_accuracy = 100*np.sum(np.array(dog_breed_predictions)==np.argmax(test_targets, axis=1))/len(dog_breed_predictions)
print('Test accuracy: %.4f%%' % test_accuracy)
bottleneck_features = np.load('bottleneck_features/DogVGG16Data.npz')
train_VGG16 = bottleneck_features['train']
valid_VGG16 = bottleneck_features['valid']
test_VGG16 = bottleneck_features['test']
The model uses the the pre-trained VGG-16 model as a fixed feature extractor, where the last convolutional output of VGG-16 is fed as input to our model. We only add a global average pooling layer and a fully connected layer, where the latter contains one node for each dog category and is equipped with a softmax.
VGG16_model = Sequential()
VGG16_model.add(GlobalAveragePooling2D(input_shape=train_VGG16.shape[1:]))
VGG16_model.add(Dense(133, activation='softmax'))
VGG16_model.summary()
VGG16_model.compile(loss='categorical_crossentropy', optimizer='rmsprop', metrics=['accuracy'])
checkpointer = ModelCheckpoint(filepath='saved_models/weights.best.VGG16.hdf5',
verbose=1, save_best_only=True)
VGG16_model.fit(train_VGG16, train_targets,
validation_data=(valid_VGG16, valid_targets),
epochs=20, batch_size=20, callbacks=[checkpointer], verbose=1)
VGG16_model.load_weights('saved_models/weights.best.VGG16.hdf5')
Now, we can use the CNN to test how well it identifies breed within our test dataset of dog images. We print the test accuracy below.
# get index of predicted dog breed for each image in test set
VGG16_predictions = [np.argmax(VGG16_model.predict(np.expand_dims(feature, axis=0))) for feature in test_VGG16]
# report test accuracy
test_accuracy = 100*np.sum(np.array(VGG16_predictions)==np.argmax(test_targets, axis=1))/len(VGG16_predictions)
print('Test accuracy: %.4f%%' % test_accuracy)
from extract_bottleneck_features import *
def VGG16_predict_breed(img_path):
# extract bottleneck features
bottleneck_feature = extract_VGG16(path_to_tensor(img_path))
# obtain predicted vector
predicted_vector = VGG16_model.predict(bottleneck_feature)
# return dog breed that is predicted by the model
return dog_names[np.argmax(predicted_vector)]
You will now use transfer learning to create a CNN that can identify dog breed from images. Your CNN must attain at least 60% accuracy on the test set.
In Step 4, we used transfer learning to create a CNN using VGG-16 bottleneck features. In this section, you must use the bottleneck features from a different pre-trained model. To make things easier for you, we have pre-computed the features for all of the networks that are currently available in Keras:
The files are encoded as such:
Dog{network}Data.npz
where {network}
, in the above filename, can be one of VGG19
, Resnet50
, InceptionV3
, or Xception
. Pick one of the above architectures, download the corresponding bottleneck features, and store the downloaded file in the bottleneck_features/
folder in the repository.
In the code block below, extract the bottleneck features corresponding to the train, test, and validation sets by running the following:
bottleneck_features = np.load('bottleneck_features/Dog{network}Data.npz')
train_{network} = bottleneck_features['train']
valid_{network} = bottleneck_features['valid']
test_{network} = bottleneck_features['test']
### TODO: Obtain bottleneck features from another pre-trained CNN.
bottleneck_features = np.load('bottleneck_features/DogVGG19Data.npz')
train_VGG19 = bottleneck_features['train']
valid_VGG19 = bottleneck_features['valid']
test_VGG19 = bottleneck_features['test']
Create a CNN to classify dog breed. At the end of your code cell block, summarize the layers of your model by executing the line:
<your model's name>.summary()
Question 5: Outline the steps you took to get to your final CNN architecture and your reasoning at each step. Describe why you think the architecture is suitable for the current problem.
Answer: The architecture described below is is inspired from the previous questions. Using the bottleneck features of the VGG19 model greatly improves performance and learning rate because of the quality of the disantangled distributed representation of the images. Although the task VGG19 was not to classify dog breeds, the last convolutional layer holds relevant higher order features of the input. Those features are in particular information invariant to translation, and do not contain usually irrelevant visual information for classification task. Retraining convolutional layers after those bottleneck feature would mean that we think that further higher order information may be present in the new dataset, which is probably true but would necessitate longer time for training. A global pooling gets rid of any spatial information left, and a final fully connected layer will learn which of the higher order features obtained are the most predictive of each breed.
### TODO: Define your architecture.
cnn_model = Sequential()
cnn_model.add(GlobalAveragePooling2D(input_shape=train_VGG19.shape[1:]))
cnn_model.add(Dense(133, activation='sigmoid'))
cnn_model.summary()
### TODO: Compile the model.
cnn_model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
Train your model in the code cell below. Use model checkpointing to save the model that attains the best validation loss.
You are welcome to augment the training data, but this is not a requirement.
### TODO: Train the model.
checkpointer = ModelCheckpoint(filepath='saved_models/weights.best.VGG19.hdf5',
verbose=1, save_best_only=True)
cnn_model.fit(train_VGG19, train_targets,
validation_data=(valid_VGG19, valid_targets),
epochs=20, batch_size=20, callbacks=[checkpointer], verbose=1)
### TODO: Load the model weights with the best validation loss.
cnn_model.load_weights('saved_models/weights.best.VGG19.hdf5')
Try out your model on the test dataset of dog images. Ensure that your test accuracy is greater than 60%.
### TODO: Calculate classification accuracy on the test dataset.
VGG19_predictions = [np.argmax(cnn_model.predict(np.expand_dims(test_i, axis=0))) for test_i in test_VGG19]
# report test accuracy
test_accuracy = 100*np.sum(np.array(VGG19_predictions)==np.argmax(test_targets, axis=1))/len(VGG19_predictions)
print('Test accuracy: %.4f%%' % test_accuracy)
Write a function that takes an image path as input and returns the dog breed (Affenpinscher
, Afghan_hound
, etc) that is predicted by your model.
Similar to the analogous function in Step 5, your function should have three steps:
dog_names
array defined in Step 0 of this notebook to return the corresponding breed.The functions to extract the bottleneck features can be found in extract_bottleneck_features.py
, and they have been imported in an earlier code cell. To obtain the bottleneck features corresponding to your chosen CNN architecture, you need to use the function
extract_{network}
where {network}
, in the above filename, should be one of VGG19
, Resnet50
, InceptionV3
, or Xception
.
### TODO: Write a function that takes a path to an image as input
### and returns the dog breed that is predicted by the model.
def VGG19_predict_breed(img_path):
# extract bottleneck features
bottleneck_feature = extract_VGG19(path_to_tensor(img_path))
# obtain predicted vector
predicted_vector = cnn_model.predict(bottleneck_feature)
# return dog breed that is predicted by the model
return dog_names[np.argmax(predicted_vector)]
Write an algorithm that accepts a file path to an image and first determines whether the image contains a human, dog, or neither. Then,
You are welcome to write your own functions for detecting humans and dogs in images, but feel free to use the face_detector
and dog_detector
functions developed above. You are required to use your CNN from Step 5 to predict dog breed.
Some sample output for our algorithm is provided below, but feel free to design your own user experience!
### TODO: Write your algorithm.
### Feel free to use as many code cells as needed.
def plot_img(path):
img = cv2.imread(path)
cv_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
plt.imshow(cv_rgb)
plt.show()
def plot_breed(breed_name):
# Get a list of folders in the training set
# Find the folder corresponding to the breed
# Pick an image at random in the folder
breed_img = [glob(path+'/*')[0] for path in glob('dogImages/train/*') if path[20:] == breed_name ]
if len(breed_img)>0:
# Plot the image
plot_img(breed_img[0])
else:
raise 'Breed name is invalid'
def breed_me(path):
if dog_detector(path):
breed = VGG19_predict_breed(path)
print('Hmm, this dog is probably a ', breed, '!\nNo ?')
# Plot
plot_img(path)
plot_breed(breed)
elif face_detector(path):
breed = VGG19_predict_breed(path)
print('Hello, human !')
 What kind of dog does the algorithm think that you look like? If you have a dog, does it predict your dog's breed accurately? If you have a cat, does it mistakenly think that your cat is a dog?
Test your algorithm at least six images on your computer. Feel free to use any images you like. Use at least two human and two dog images.
Question 6: Is the output better than you expected :) ? Or worse :( ? Provide at least three possible points of improvement for your algorithm.
Answer: I was really impressed by the prediction made by the algorithm. A possible improvement could be to normalize images around faces for human and train another cnn on dog faces only so as to better match facial features. We could improve accuracy by continuing training, in the end, the final model was trained for a very short time. We could augment the dataset during training to favor domain generalization, croping, changing color hue (slightly), rotation etc. As a final product this app could be made into a backend, the frontend being either a mobile app or a web app sending user images to the back end and presenting results in a nice way.
## TODO: Execute your algorithm from Step 6 on
## at least 6 images on your computer.
## Feel free to use as many code cells as needed.
[breed_me(img) for img in glob('test_images/*')]
[breed_me(img) for img in glob('test_images_2/*')]


{% extends "base.html" %} {% block title %}fishr{% endblock %} {% block content %}
Some features may still be under developement.
ID your catch!
Regulations
Expert ID
Download Data
App Tour
About Us


The Church of St. Donatus was built in 15th century when Croatia struggled for an independent identity in the middle of big powers like Venice and Austria. People now gather around the building to watch the ¼ final against England. They won. That night our waiter/ former football player said it was his first time feeling proud of being a Croatian man, in 32 years. He happily offered us wine, went cheering, and left his POS machine on our table.


{% extends "layout.html" %} {% block stylesheets %} {% endblock %} {% block body %}
Estimate the values without using outside information. Your response must be between 0 and 100.
1. The area of the USA is what percent of the area of the Pacific Ocean?
2. What percent of the world's population lives in either China, India, or the European Union?
3. What percent of the world's airports are in the United States?
4. What percent of the world's roads are in India?
5. What percent of the world's countries have a higher fertility rate than the United states?
6. What percent of the world's telephone lines are in China, USA, or the European Union?
7. Saudi Arabia consumes what percentage of the oil it produces?
8. What percentage of the world's countries have a higher life expectancy than the United States?


--- layout: index-layout subject: Highview Email Templates --- Highview Email Templates 1 - Highview Email 2 - Highview Email E-News Student Parent Update Discipleship Blog Kids Ministry Student Ministry Missions Partial Templates Blue Header Body Footer Bottom Info


Whatís up, I'll start by saying that Iíve taken shrooms at least 4 times before this experience. Its all been around the same amount and pretty much the same potency. In the beginning it was just to have fun but I found out pretty soon that my brain wouldnít allow that to happen. I would always respond to the trip in a anti-social matter every one around me became annoyances. It seemed that they would want my attention for no reason and I would try to talk about stuff that really mattered to me but the conversations were mostly them talking about nothing and insisting that I listen to their nonsense. I mean.. Donít get me wrong I had the usual visuals an all. But the people I talked to were like two dimensional actors playing their roles in a play. And I always found myself wanting to get away from humanity. I never knew why until a very enlightening Saturday not two long ago.......
It was Saturday night and me and four of my friends went to my drug dealer's house to pick up a quad of gooms, half for me and half for the three of them, so we started mackin'em. There were a series of events that went down when we were driving around, (including a run in with a cop RIGHT when the shrooms hit me) But thatís not the point, this is. About two hours after consuming the shrooms we stumbled into my house and we were sitting talking to each other for a while until the 'show' started. Everyone started to annoy me as usual so I told them that I was about to puke, I then retreated to my room and locked myself in there not to emerge for the next six hours......
As I locked the door behind me I felt a sigh of relief to be able to get away from 'those' people outside my door, I then crashed on my bed to embark on my vision quest that I was yet unaware of. I started to think about why I hated people so much when I was shrooming, and in the middle of dissecting that thought it hit me, I hate all mankind even myself, but why? Just then I noticed that there were millions of pares of energetic eyes on the ceiling staring at me accompanied by a greater woman presence too; amidst all of them, like she was a teacher in an auditorium full of students and was their subject, their play thing, I say this because I perceived it not in my head but in my heart..

The trip then went on to the woman becoming one with me and I could feel her suffering, suddenly I was a Giant entity that I can best describe as a dying cow on its side with parasites, maggots, and cannibalistic creatures on all sides of me eating me, slithering and snarling and feasting on me until I was completely consumed then with nothing left to consume the parasites died out. Then I heard a knock at my door it was one of my friends and I wanted to kill him but I just stayed in my sanctuary and communicated with the beings in my room.
She showed me that we are 'from' her, a part of her that without she would cease to exist. Then the creator came into my room. For an instant I experienced what he felt and odd enough it was extreme boredom.
So you could do nothing ORRR.. you could reminisce and experience Innocence again IN the imperfection of mankind over and over, forever. She told me that itís been like this forever and with out us there would be no reason to have a universe and that even if we are so hideous and disgusting we are also an equal amount of love and beauty. And that both are constantly growing until we soak up all knowledge until we reach godliness ourselves and reach that point of boredom and create our own worlds to reminisce to, Its just one big infinite cycle.
Lastly she asked me how many times I must remember before I can live my life and just then I got the most incredible sense of dejavu I've ever had. I felt her sort of chuckling as she left my room but the eyes on the ceiling remained, then I got up and walked out to meet my friends I did not feel hate for them anymore and for hours I told them of my experience and we traded thoughts about religion and some how they got hold of a mango fruit when I was out and we all ate some slice after slice until it was gone.
Then two of my friends went in the other room and fucked while me and my other friend talked about Jesus, He said 'Think of him as the head of security at a mental institution. Hey lets give him a call' he then pulled out his cell phone and started dialing and put it to his ear. I started laughing, he then set down the phone and said 'He's busy right now' I replied 'Yeah, it must be tough working the late shift.'
 ;) The last thing I'm going to say is that you can spend your entire life dwelling over this stuff and not get anything accomplished or you can live life, fufill your human experiance for all its worth and then move on to the next one. In the words of the Eagle's 'Hotel California'
'Some dance to remember some dance to forget'
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.


Found 1 record.
Errata ID: 145
Status: Held for Document Update
Type: Editorial
Reported By: Alfred Hoenes
Date Reported: 2005-12-20
Held for Document Update by: Brian Haberman
Section 4.1 says:
Broadcast and Multicast Service Controller Domain Name List for DHCPv4
It should say:
Broadcast and Multicast Service Controller Domain Name List Option for DHCPv4
Notes:


{% include "nav.html" %}
Delete {{ memory.title }} from {{ memory.date_of_memory }}
{% csrf_token %} {{ form }}
Delete
Cancel
{% include "footer.html" %}


Umbrella is an app I created with 3 other team members at TartanHacks February 2016. I was involved in both the App Development and the UX design process. I helped choose design elements for the user interface and I was implemented these. I also designed the logo.


| DOSE: |
30 mg |
oral |
Pharms - Phentermine |
(pill / tablet) |
When I first started taking phentermine, I was 14 years old. I had never dnoe drugs of any kind before, and I didn't really know what this would do. I just knew that it was illegal without prescription and would make me 'not hungry'. I smuggled some illegaly in to the states from mexico. I wanted to be thin, and at 14, drugs were the obvious way to do it!
Phentermine makes me happy, it makes me hyper... and it makes me manic depressive when abused. I developed a tolerance to taking one pill at a time pretty quickly, so I upped the dose to two. I also took it later in the day to give myself something to look forward to at the end of the day. Bad idea. this lead to entire nights where I would be up making lists. Lists of eveything. Lists of things to do, presents to get people for christmas, presents I wanted for christmas, things I should pick up at the store, songs I should download, CD's I should buy, money people owed me... I'd do it all night. I'd clean all night long sometimes. I'd fast for days. My diet was diet coke and speed. What a druggie.
I was 145lbs to begin with. I was 115lbs when I realized it was time to stop. For someone who is 5'7'', this is not good. Because I was skeletal. But at the time, I thought I looked great. Eventually, I started to run out and had to weedle myself off of it. I was anorexic and obsessive about the drug so this was difficult.
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.


When constructing plots, the use of “pipes” makes the logic clear
and is recommended, so that is described first. All the code sequences
described here can be implemented by saving the result from each step
and then providing it to the next step, but pipes support the transmission
of the result of a calculation to the next stage in the calculation
without the need for intermediate storage. They are supported using
the “%>%” argument, which is enabled by the “magrittr” package
for R. Perhaps the strongest argument for using pipes is that they
make the logic of plot construction clear. You start with a data.frame,
optionally construct new variables, make appropriate selection of
variables and the time interval, apply filters to accept only data
meeting particular tests, and then construct the plot using the resulting
tailored data.frame. Here is an example, where the data.frame is piped
to “select()” (part of the dplyr package that passes on only the
listed variables) and where the result is then piped to “Ranadu::selectTime()”
where only the specified time range is transmitted forward. The result
is finally piped to Ranadu::plotWAC(), where the first argument is
a data.frame. That is supplied by the pipe. The result is shown in
Fig. . Alternately, ggplotWAC() could be used
to produce a similar result. In addition to showing the explicit steps
in the processing chain, code like this ensures that the plot will
be constructed the same way if the code is re-used or moved.
|
library(magrittr)
Ranadu::getNetCDF(fname, Variables) %>% ## load the data.frame
dplyr::filter(TASX > 90) %>% ## limit based on airspeed
dplyr::select(Time, ATX, DPXC) %>% ## select the variables to plot
Ranadu::Rmutate(DPD = ATX - DPXC) %>% ## add the dewpoint-depression DPD
Ranadu::selectTime(220500, 221500) %>% ## set the time range
Ranadu::plotWAC(col=c('blue', 'forestgreen', 'black')) ## construct the plot
Figure:
Example of a figure generated using pipes. The variables are air temperature (ATX), dew point temperature (DPXC), and a new generated variable representing the dew point depression (DPD=ATX-DPXC). From WECAN research flight 6, 3 August 2018.
|
More information on some of the utility functions used or available
when constructing plots is provided in the following list:
- dplyr::filter(): This function is used to limit the range
of accepted values. The arguments are a data.frame (provided above
by the pipe) and a logical statement. Only rows for which the specified
test is true are included in the resulting data.frame. An example
where a statement like this might be useful is when fitting to determine
the sensitivity coefficients for angle of attack, because it is useful
to exclude slow flight when the gear and/or flaps might be deployed.
Be sure to use the version from dplyr; the filter functions from the
packages “stats” or “signal” have different behavior. An alternative
method of creating a subset is to use the notation “Data[Data$TASX
> 90, ]”. The disadvantage of this method and of the “select(Data,
Data$TASX > 90)” function provided by base-R is that variable attributes
are lost.1
- dplyr::select(): This function creates a subset data.frame
with only the desired variables. The desired list of names can be
specified either as character names (with quotes) or variable names
(without quotes). This also has the advantage over the “[]”
or “[[]]” methods of subsetting that attributes of the
data.frame and the variables are preserved.
- Ranadu::Rmutate( ): This function adds new variables to the
data.frame according to formulas specified in the second argument.
In this processing chain, the first argument is the data.frame provided
by the pipe. This calls the routine dplyr::mutate() but then,
because that function does not preserve variable attributes, it transfers
attributes from the input to the output data.frame. New variables,
however, have no attributes (even the “Dimension” attribute) so
the resulting data.frame has some limitations, notably not being accepted
by “makeNetCDF( )”.
- Ranadu::selectTime( ): This function limits the time range
of the resulting data.frame to be between the times that are specified
in HHMMSS format (hours, minutes, seconds). This is equivalent to
using “dplyr::filter( )” with limits on the accepted times, but
it avoids the need to provide those times in the POSIXct format used
by Ranadu data.frames. It preserves attributes and is suitable for
use in pipes.
- Ranadu::Rsubset( ): This is not used in the present example
but could be. It accepts start and end times like “selectTime”,
selects variables like “dplyr::select”, and imposes limitations
on the data like “dplyr::filter( )”, so several functions could
be combined in one step: Ranadu::getNetCDF(fname, Variables) %>%
Ranadu::Rsubset(220500, 221500, c('ATX', 'DPXC')) %>% plotWAC( ).
This function also preserves attributes in the modified data.frame.
“Ranadu::plotWAC( )” is designed primarily for time-series plots,
but scatterplots can also be generated. In that case, the first two
variables in the data.frame should be the variables for the scatterplot,
not the Time variable, and an explicit label “xlab=xxx” should
be supplied. Here is an example:
|
- Preserving attributes is desirable because the attributes are often
used by Ranadu routines. The bin assignments for size distributions
are carried in an attribute, as is the data rate (used in spectral
analysis). Variables with the same “short_name” attributes are
redundant measurements of the same quantity, so it is often useful
to plot all with matching short_names together. Finally, the function
makeNetCDF( ) makes a new netCDF file with the variables and attributes
in the data.frame, and it requires some attributes (like the “Dimension”
attribute) to function.
|
|
Data %>% selectTime(220000, 221500) %>%
dplyr::select(ATX, DPXC) %>%
plotWAC(xlab='ATX', type='p')
Figure:
Example scatterplot.
|
|


What about me?
Born in Kalamata (Gr) the 14.10.1996, I came to Italy at the age of five.
In high school I studied arts and applied arts and that helped me to fall in love with graphics and photography.
Those became two of the most important things in my life.
Not just a hobby or something to do when I have nothing else.
So I decided to open my personal website, like a portfolio, to show the stuff that I have done in the past years and that I am doing already.
Hope you enjoy!
About my latest photographs
La sensualità del corpo femminile


| ********** Mapped Logic ********** |
|
LD2 <= NOT (((NOT SW3_CPLD AND NOT SW11_CPLD)
OR (NOT SW2_CPLD AND NOT SW10_CPLD AND s_result(3)) OR (s_result(3) AND s_result(2) AND N_PZ_21))); |
|
N_PZ_12 <= ((SW9_CPLD AND NOT SW1_CPLD)
OR (NOT SW9_CPLD AND SW1_CPLD)); |
|
N_PZ_17 <= ((N_PZ_12 AND SW0_CPLD AND SW8_CPLD)
OR (NOT N_PZ_12 AND NOT SW0_CPLD AND NOT SW8_CPLD)); |
|
N_PZ_21 <= ((NOT SW9_CPLD AND NOT N_PZ_12)
OR (N_PZ_12 AND NOT N_PZ_17)); |
|
N_PZ_35 <= ((SW0_CPLD AND NOT SW8_CPLD)
OR (NOT SW0_CPLD AND SW8_CPLD)); |
| disp_dig_o(0) <= '0'; |
| disp_dig_o(1) <= NOT ('0'); |
| disp_dig_o(2) <= NOT ('0'); |
| disp_dig_o(3) <= NOT ('0'); |
|
disp_seg_o(0) <= ((s_result(3) AND s_result(2) AND N_PZ_17)
OR (NOT s_result(3) AND NOT s_result(2) AND N_PZ_17) OR (NOT s_result(3) AND s_result(2) AND N_PZ_12 AND N_PZ_35) OR (NOT s_result(3) AND NOT s_result(2) AND NOT N_PZ_12 AND N_PZ_35)); |
|
disp_seg_o(1) <= ((NOT s_result(3) AND NOT s_result(2) AND NOT N_PZ_17)
OR (NOT s_result(3) AND N_PZ_12 AND NOT N_PZ_17 AND N_PZ_35) OR (s_result(3) AND s_result(2) AND NOT N_PZ_12 AND NOT N_PZ_17 AND N_PZ_35)); |
|
disp_seg_o(2) <= ((NOT s_result(3) AND N_PZ_35)
OR (NOT s_result(3) AND s_result(2) AND N_PZ_17) OR (NOT s_result(2) AND NOT N_PZ_12 AND N_PZ_35)); |
|
disp_seg_o(3) <= ((NOT s_result(3) AND s_result(2) AND N_PZ_17)
OR (s_result(2) AND N_PZ_12 AND N_PZ_35) OR (NOT s_result(2) AND NOT N_PZ_12 AND N_PZ_35) OR (s_result(3) AND NOT s_result(2) AND NOT N_PZ_17 AND NOT N_PZ_35)); |
|
disp_seg_o(4) <= ((s_result(3) AND s_result(2) AND NOT N_PZ_35)
OR (s_result(3) AND s_result(2) AND N_PZ_12 AND N_PZ_35) OR (NOT s_result(3) AND NOT s_result(2) AND NOT N_PZ_17 AND NOT N_PZ_35)); |
|
disp_seg_o(5) <= ((s_result(3) AND s_result(2) AND NOT N_PZ_35)
OR (s_result(3) AND N_PZ_12 AND N_PZ_35) OR (NOT s_result(3) AND s_result(2) AND NOT N_PZ_12 AND NOT N_PZ_17) OR (NOT s_result(3) AND s_result(2) AND NOT N_PZ_17 AND NOT N_PZ_35)); |
|
disp_seg_o(6) <= ((NOT s_result(3) AND s_result(2) AND N_PZ_17)
OR (s_result(3) AND s_result(2) AND NOT N_PZ_12 AND N_PZ_35) OR (s_result(3) AND NOT s_result(2) AND N_PZ_12 AND N_PZ_35) OR (NOT s_result(3) AND NOT s_result(2) AND NOT N_PZ_12 AND N_PZ_35)); |
|
s_result(2) <= SW2_CPLD
XOR ((SW10_CPLD AND N_PZ_21) OR (NOT SW10_CPLD AND NOT N_PZ_21)); |
|
s_result(3) <= ((SW3_CPLD AND SW11_CPLD AND SW2_CPLD AND NOT s_result(2))
OR (SW3_CPLD AND SW11_CPLD AND SW10_CPLD AND NOT N_PZ_21) OR (SW3_CPLD AND NOT SW11_CPLD AND NOT SW2_CPLD AND NOT SW10_CPLD) OR (SW3_CPLD AND NOT SW11_CPLD AND s_result(2) AND N_PZ_21) OR (NOT SW3_CPLD AND SW11_CPLD AND NOT SW2_CPLD AND NOT SW10_CPLD) OR (NOT SW3_CPLD AND SW11_CPLD AND s_result(2) AND N_PZ_21) OR (NOT SW3_CPLD AND NOT SW11_CPLD AND SW2_CPLD AND NOT s_result(2)) OR (NOT SW3_CPLD AND NOT SW11_CPLD AND SW10_CPLD AND NOT N_PZ_21)); |
|
Register Legend:
FDCPE (Q,D,C,CLR,PRE,CE); FDDCPE (Q,D,C,CLR,PRE,CE); FTCPE (Q,D,C,CLR,PRE,CE); FTDCPE (Q,D,C,CLR,PRE,CE); LDCP (Q,D,G,CLR,PRE); |


Received Bytes:
var receiver1 = new IRReceiver(); // set up an infrared receiver receiver1.setup( 1, // unit 1 8 // pin 8 ); // set the callback for receiving bytes receiver1.whenReceive = function(bytes) { document.getElementById("status").innerHTML = "received data: " + bytes; };
IRReceiver
setup(unit, pin)
initialize an infrared receiver object with a specified pin on a specified unit.
return value: true if successful, otherwise false.
Return Value Note:
The function will return a value when your h5control program uses waitRsp mode, but no return value when uses nowaitRsp mode.
whenSetup(done)
receive the callback when setup done. parameter done is true if successful or false otherwise.
whenReceive(bytes)
receive the callback when received the new incoming data carried in parameter bytes that is a byte array.


Privacy statement
BP and its affiliated companies welcome your interest in this website (bp.com). The BP company responsible for it is:
BP International Limited
Chertsey Road, Sunbury on Thames, Middlesex, TW16 7BP
registered in England and Wales with company number 00542515
We take your privacy seriously and want you to understand our practices with respect to the handling of your personal data. This privacy statement explains how we do this.
This website has different sub-sites for BP business, products and services, which may also have their own privacy statements. Please read these if you visit our sub-sites.
When we collect your personal data
If you decide to contact us or make use of personalized services (e.g. by subscribing to a newsletter or by setting your personal preferences for webcast services), then you will be asked to submit the limited personal data which is necessary for us to provide that service or handle your query. This is completely voluntary.
If you ask us to send you newsletters, webcasts or other communications, we rely on your active consent in order to do so. You may opt out of receiving these communications at any time.
If any form which collects your personal data allows you to voluntarily provide additional information, we seek this information because we think it will help us to give you a better quality service. You do not have to provide such information if you do not wish to do so.
We also collect personal data from cookies, which we explain more about below.
Site traffic information and cookies
On your first visit to this site you were asked (by a notification banner) to accept our use of cookies and similar technologies and we'd like to explain how we use these technologies.
To learn about what cookies and similar technologies are, we recommend that you visit the following third-party website: http://www.allaboutcookies.org/.
Like many websites, we use cookies for a variety of purposes. These technologies collect information about your device hardware and interactions with our site.
This information helps us to
- continuously improve our site's content and functionality by analyzing where, on which types of devices and how our site is used, how many visitors we receive, and where they click through to the site from; and
- remember you in case you re-visit our site, so we will know if you have already been served with cookie banners, surveys, or (where site content is undergoing testing) which version of the content you were served.
To delete or stop cookies being placed on your computer, please check the help menu of your internet browser. Blocking cookies will reduce the functionality of this website.
Who do we share your personal data with and where does it go?
Any transfer of personal data to this site will be secured by encryption. We may store or transfer your personal data to our other BP companies around the world. We do this under our group-wide Binding Corporate Rules, which guarantee an adequate level of data protection wherever your data is physically kept.
We also use the services of third-party service providers to host our webcasts and offer technical support. Any third-party provider we appoint must act in accordance with our written instructions when processing your personal data and must protect your personal data in line with the contractually required security measures. Where we store or transfer your personal data to a third-party provider based outside the European Economic Area, we take steps to ensure your personal data is adequately protected.
We have the right to disclose your personal data as required by law, or when we believe that disclosure is necessary to protect our rights and/or comply with a judicial proceeding, court order, request from a regulator or any other legal process served on BP. If there is a takeover, sale or purchase of our business, we may disclose your personal data to the new (or prospective) owner of the business.
How long do we keep your information?
We will only hold your information for as long as necessary to fulfil the purposes for which it was collected, before making it non-identifiable or deleting it.
If you send us any ‘contact us’ messages, we will delete or de-identify these messages once we have finally satisfied your query.
If you choose to unsubscribe from a service, we may keep a ‘suppression list’ containing your details so we know you have unsubscribed.
Your rights, complaints and how to contact us
You have the right to access your personal data and ask for it to be rectified or deleted at any later time.
If you have questions or concerns relating to the handling of your personal data, or other privacy related query, please get in touch with us using www.bp.com/contact or the 'Contact us' functionality in the website's footer. Please also use these links for non-privacy related queries.
If you are in the EU, you also have the right to raise a privacy concern with the Data Protection Authority established in the relevant EU country. However, please consider using BP’s EU-approved complaint resolution mechanism under our BCRs using the contact address set out above.
Third-party websites we link to
Our website may contain links to third-party sites. This privacy statement does not apply to those third-party sites.
We recommend that you read the privacy statements of any other sites that you visit as we cannot accept responsibility for the privacy practices of these sites, which may be different to ours.
Freedom of Information enquiries
If you represent a public authority governed by the Freedom of Information Act and you wish to consult with a BP stakeholder about a potential disclosure of BP information pursuant to a request you have received, please get in touch using www.bp.com/contact, giving your name, the name of the public authority you represent, your contact details, the nature of the request and the deadline for disclosure and a responsible BP person will contact you.
Changes to the privacy statement
We may update this privacy statement from time to time and recommend that you revisit it on occasion to see the latest version.
This statement was last updated in March 2018.


Predict Price
I want to predict the rent of my dream house.
Predict»
Price Distribution
I want to find out the distribution of rent .
Distribution »
Distance
I want to know the relationship between price and distance to school.
Distance »
Bedrooms
What's the price for different bedroom numbers?
Bedroom »
<


The Information Processing in Computer-Assisted Interventions (IPCAI) is one of the most important forums to innovation in the domain of computer-assisted surgery. The IPCAI conference is a truly international interdisciplinary conference bringing clinicians, computer scientists, engineers, and other researchers at a unique setting. The format of the meeting is designed specifically for active engagement from the attendees.


Packet #1: Send Date: January 1st 2021. Phase 1: Sending
Provide a name for yourself, which can be any semi-unique identifier.
Either think of something or someone to send a message to, or let random chance decide for you.
When writing your message, keep in mind the medium of the message, but otherwise consider it a free writing prompt.


{% extends "ct/portal.html" %}
{% comment %}
Main page of the portal.
{% endcomment %}
{% block title %}
Welcome
{% endblock %}
{% block content %}
Courselets.org is currently in a private alpha release.
Access to the private alpha is by invitation only.
You are currently in a live session. Either click here
to go to its exercises or else
| Your classes | Role |
|---|---|
| {% if role.role == 'prof' %} {{ role.course.title }} {% else %} {{ role.course.title }} {% endif %} | {{ role.get_role_display }} |


JUNGLE 2 JUNGLE A film review by Steve Rhodes Copyright 1997 Steve Rhodes
RATING (0 TO ****): ** 1/2
Let's play make a movie!  Your company has entrusted you with zillions of dollars to spend on films. Big budget is your middle name. You are paid the big bucks because you can make movies that will sell popcorn like there's no tomorrow.
All of the producers are pitching their hot projects to you. Everyone assures you that theirs will be the runaway hit that can make your career in Hollywood. Although your life could not look rosier, you do have this one fear.
You need some insurance.  Couldn't go wrong with that choice. You tell your underlings to get cracking on it. The movie to be remade is a 1994 French film called UN INDIEN DANS LA VILLE and released in the US with a dubbed version called LITTLE INDIAN, BIG CITY. Your film will be called JUNGLE 2 JUNGLE.
After production begins, you finally getting around to asking how well LITTLE INDIAN, BIG CITY was received. You find out that it made the worse 10 of the year list of many of the major critics and one of the biggest critics called LITTLE INDIAN, BIG CITY one of the worse films ever made. You break out the antacid tablets and rediscover religion.
Well, you lucked out. Not a great show but a nice if unremarkable kids' movie. You'll probably end up in the black, and your position is still secure. Next time, however, you'll do better upfront research.
Disney's JUNGLE 2 JUNGLE is a live action film featuring popular actor Tim Allen. Allen was the comedic foundation of Disney's successful 1994 film THE SANTA CLAUSE. Both pictures were directed by John Pasquin. Allen's not nearly as funny this time, but it's not his fault. Most of his lines are lame, thanks to the script by Bruce A. Evans, Ray Gideon and Charlie Peters. His lines are targeted toward the adults in the audience with mostly ineffective jokes involving such things as the brand of a shaver. All of the writer's creative energy seems to have been focused on developing the part of the boy.
In the story, Michael Cromwell (Tim Allen) and Richard (Martin Short) are traders in the commodities pit. One day, Michael leaves his jungle to go to the Amazon rain forest. He goes on a simple mission to get his wife, Dr. Patricia Cromwell (JoBeth Williams), to sign their divorce papers. Simple, but essential, since he is scheduled to be married in 30 days to a vivacious, but slightly airheaded, fashion designer named Charlotte (Lolita Davidovich).
Wearing his suit and expensive shoes, and taking along his laptop, he looks stranger than the natives in the jungle. Charlotte introduces him to his son Mimi Siku (Sam Huntington) whom he never knew he had -- she left Michael 13 years ago. (The film relishes symmetry. Later Michael's costume will look proper, but Mimi Siku's will seem totally out of place in Michael's jungle.)
Since the focus of the film is the wild boy, the effectiveness of the picture hangs on the casting of this role. Huntington tries hard and shows promise as an actor, but is miscast in several ways. For a boy who has roughed it in the wilderness all of his life, I would not expect such a delicate looking boy. He lives in the searing sun of a river encampment and spends his days hunting in his canoe, but his skin shows little tan and is smooth as silk. He looks like a musical prodigy who has never been outdoors nor ever been bruised from a fall. The press kit, on CD-ROM no less, says his only movie before this one was in a small part in BOYS that was left on the cutting room floor. Even though I think he was all wrong for the part, I ended up liking him anyway.
Since the film is called JUNGLE 2 JUNGLE, the action soon switches back to New York where Michael takes Mimi Siku to get the fire from the Statue of Liberty for his village chief. The Amazon part is cliche-ridden and predictable, but the New York locale, where most of the action occurs, provides a richer and more interesting terrain for comedy. Tony Pierce-Robert's cinematography, however, is shown off best in the sweeping rain forest vistas. The music by Michael Convertino comes alive with the rhythm of jungle drums and flutes during the Amazon section.
Once back in The Big Apple subplots appear around every turn: the Russian Mafia, a losing position in coffee futures, a Fashion Channel documentary, a teenage love story, a spider with an attitude, and the list goes on. Some of the jokes are quite funny with the best involving a dart from a blowgun that accidentally anesthetizes the cat.
Lolita Davidovich, much better known for her dramatic roles, gives the best small performance in the film. Dressed to kill in one revealing gown after another, she plays her role with great panache. Other actresses might have given it the tired old brainless routine, but Davidovich imbues her character with a subtle but detectable intelligence. She also makes her character look alluring rather than cheap.
The physical humor dominates as in, for example, the running joke about Mimi Siku urinating in all the wrong places. Michael coaches him too about when to raise and lower the toilet lid. "Females in the tribe start war with this," he warns his son.
Some of the shortest lines have the most punch. When Mimi Siku first sees Charlotte's cat, he misinterprets why she has it. "Cat fat. We eat?" he asks.
When the film attempts serious themes, it quickly loses the audience. Most effective are the attempts at humor. Some, like the coffee futures part, will go over the kids' heads and bore the grown-ups. Others such as the Russian Mafia are little more than tedious plot devices to move the story along. Still, on balance, a mildly funny film. With the dearth of kids' movies, it's good to see one even if it's only mildly funny.
JUNGLE 2 JUNGLE runs 1:51. It is rated PG for a couple of scenes of threatened violence. (The film at the press screening had a G rating so perhaps it was re-rated. The press kit says PG as does the advertising.) The film would be fine for kids of all ages. Most Saturday morning cartoons are scarier than this film. My son Jeffrey, almost 8, found the film "very hilarious." He liked the character of the boy, especially when he was climbing big places. I thought it was an imminently forgettable film, but one funny enough for me to give it a thumbs up and ** 1/2.
**** = A must see film. *** = Excellent show. Look for it. ** = Average movie. Kind of enjoyable. * = Poor show. Don't waste your money. 0 = Totally and painfully unbearable picture.
REVIEW WRITTEN ON: March 4, 1997
Opinions expressed are mine and not meant to reflect my employer's.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


1.2.1
Some small changes1.2
Resolution independentNew icons
Fixed an issue when selecting an application containing a space in the assisant
Fixed possible temporary hang at start
Some other small fixes
1.1.3
Fixed a bug which would show an incorrect error when saving1.1.2
Various small bugfixes1.1.1
Some small improvementsSome small bugfixes
1.1
Added DeleteAdded Move
Added Change Filename
Added Open In External Editor
Added drag and drop to import, export, delete, move and open externally
One can now drag and drop a command to ProgramArguments
One can now drag and drop from ProgramArguments to test it in e.g. Terminal
Added reordering of values in tables
Added many keyboard shortcuts
One can now change the font in text views
Many other fixes
Many other interface improvements
Updated the appearance
1.0.2
Fixed an issue when using FileVaultSome other small improvements
1.0.1
Handles malformed plists more gracefullyBetter handling of volumes that does not support priviledged helper tools
Now honours the system settings for automatic deauthorisation
Some small improvements
1.0
Some small fixes0.9.2
You now only need to authenticate once every five minutesMade sure that all values set are actually saved
Made sure that all integers are saved as integers
Some other small changes
0.9.1
Fixed a bug if one chose not to authenticateSome other small changes


paths¶
-
class
dlinputs.paths.
ShardEntry
(name, prefix, index, suffix)¶ -
index
¶ Alias for field number 2
-
name
¶ Alias for field number 0
-
prefix
¶ Alias for field number 1
-
suffix
¶ Alias for field number 3
-
-
dlinputs.paths.
extract_shards
(url)[source]¶ Extract a shard list from a shard URL.
Shard URLs are URLs containing a string of the form @000123. This denotes that the shards are given by a six digit string and that there are 123 shards.
Parameters: url – shard url Returns: list of URLs for shard
-
dlinputs.paths.
find_basenames
(top, extensions)[source]¶ Finds all basenames that have all the given extensions inside a tree.
Parameters: - top – root of directory tree
- extensions – required extensions
Returns: iterator over basenames
-
dlinputs.paths.
find_directory
(path, target='', tests=[], verbose=False, error=True)[source]¶ Finds the first instance of target on a path.
If tests is supplied, requires those targets to be present as well. This only works if the target is a directory.
Parameters: - path (list) – colon separated path along which to search or list
- target (str) – target to search for (if empty, finds first path element that exists)
- tests (list) – list of functions of additional predicates
- verbose (bool) – output information about tests performed
- error (bool) – not finding the target is an error
Returns: path to target
Return type:
-
dlinputs.paths.
find_file
(path, target, tests=[], verbose=False, error=True)[source]¶ Finds the first instance of file on a path.
Parameters: - path (list) – colon separated path along which to search or list
- target (str) – target to search for (if empty, finds first path element that exists)
- tests (list) – list of functions of additional predicates
- verbose (bool) – output information about tests performed
- error (bool) – not finding the target is an error
Returns: path to target
Return type:
-
dlinputs.paths.
find_url
(paths, extra=None)[source]¶ Given a list of url paths, find the first one that matches.
Parameters: - paths – list of base urls
- extra – extra relative URL to be joined before testing
Returns: first path that succeeds
-
dlinputs.paths.
findurl
(url)[source]¶ Finds a URL using environment variables for helpers.
If DLP_URLREWRITER is set in the environment, it is loaded. If dlinputs. url_rewriter is not None, it is applied to the url. If DLP_URLBASE is not None, it is joined to the url as a base url.
FIXME: make DLP_URLBASE a path
Parameters: url – url to locate Returns: located URL Return type: str
-
dlinputs.paths.
iterate_shards
(url)[source]¶ Iterates over shards.
Given a string of the form “prefix-@000123-suffix”, yields objects containing:
- obj.name: expanded name
- obj.prefix: prefix value
- obj.index: index value (as zero-padded string)
- obj.suffix: suffix value
Parameters: url – shard url Returns: iterator over shards
-
dlinputs.paths.
openurl
(url)[source]¶ Open a URL with findurl followed by urlopen.
Parameters: url – url to be opened Returns: result of urlopen Return type: stream
-
dlinputs.paths.
path_shards
(path)[source]¶ Given a path shard spec, return an iterator over the shards.
-
dlinputs.paths.
read_shards
(url, shardtype='application/x-tgz', urlpath=None, verbose=True)[source]¶ Read a shards description file from a URL and convert relative URLs in shard file.
Parameters: - url – url to read shard file from (JSON format)
- shardtype – default shard type
- urlpath – path on which to search for the shard file
- verbose – output progress
Returns: list of URLs for shard
-
dlinputs.paths.
read_url_path
(url, urlpath, verbose=False)[source]¶ Attempts to find url on the urlpath.
Parameters: - url – relative URL
- urlpath – list or space separated string of base URLs
- verbose – inform user about trials
Returns: contents first URL that can be opened, base url
Return type:
-
dlinputs.paths.
readfile
(fname)[source]¶ Helper function to read a file (binary).
Parameters: fname – file name to be read Returns: contents of file
-
dlinputs.paths.
split_sharded_path
(path)[source]¶ Split a path containing shard notation into prefix, format, suffix, and number.
-
dlinputs.paths.
splitallext
(path)[source]¶ Helper method that splits off all extension.
Returns base, allext.
Parameters: path – path with extensions Returns: path with all extensions removed


Hello World!
With great web scraping skills comes great responsibility!
The
Lecture Notes
.
paragraph 1
and paragraph 2:
This is span 1
Second span element
Here is the third span


Yes. Children of the same parent have their parent's characteristics in common, but each child has additional methods and variables.
The Java AWT (Abstract Windowing Toolkit) contains the
fundamental classes used for
constructing GUIs.
The abstract Component
class is the base class for the AWT.
Many other AWT classes are derived from it.
(We will not look at most of these classes).
Button
, Canvas
, and Container
are some AWT classes derived from Component
.
The JComponent
class
is derived from Container
and is one of the base classes of Swing.
The JFrame
class
is derived from the AWT Frame
class.
It is usually the main container for a GUI application.
The JApplet
class
(derived from the AWT Applet
class)
is sometimes used for Web programming, but the
Applet
class is more frequently used.


The Golden Ratio has unique mathematical properties. It is the only positive number whose square is one greater than itself. It is the only positive number whose reciprocal is one less than itself. It is also the found in limits and the Fibonacci series. These properties make it the unique solution to optimize design, in practicality and in beauty.
• If you square Φ , you get a number exactly 1 greater than itself: 2.618…, or
Φ² = Φ + 1.
• If you divide Φ into 1 to get its reciprocal, you get a number exactly 1 less than itself: 0.618…, or
1 / Φ = Φ – 1.
The powers of Φ have unusual properties in that they are related not only exponentially, but are additive as well. We know that
Φ²= Φ + 1
Which is the same as:
Φ² =Φ^1 + Φ^0
And this leads to the fact that for any n:
Φ^(n+2) = Φ^(n+1) + Φ^(n)
Thus each two successive powers of Φ add to the next one!
Another little curiosity involves taking Φ to a power and then adding or subtracting its reciprocal:
For any even integer n:
Φ^n + 1 / Φ^n = a whole number
For any odd integer n:
Φ^n – 1 / Φ^n = a whole number
Examples are shown in the tables below:
for n = even integers
| n | Φ^n | 1/Φ^n | Φ^n + 1/Φ^n |
|---|---|---|---|
| 0 | 1.000000000 | 1.000000000 | 2 |
| 2 | 2.618033989 | 0.381966011 | 3 |
| 4 | 6.854101966 | 0.145898034 | 7 |
| 6 | 17.944271910 | 0.055728090 | 18 |
| 8 | 46.978713764 | 0.021286236 | 47 |
| 10 |<PHONE_NUMBER>81 | 0.008130619 | 123 |
for n = odd integers
| n | Φ^n | 1/Φ^n | Φ^n + 1/Φ^n |
|---|---|---|---|
| 1 | 1.618033989 | 0.618033989 | 1 |
| 3 | 4.236067977 | 0.236067977 | 4 |
| 5 | 11.090169944 | 0.090169944 | 11 |
| 7 | 29.034441854 | 0.034441854 | 29 |
| 9 | 76.013155617 | 0.013155617 | 76 |
| 11 |<PHONE_NUMBER>99 | 0.005024999 | 199 |
The whole numbers generated by this have a relationship among themselves, creating an additive series, similar in structure to the Fibonacci series, and which also converges on Φ
The term “mean” in mathematics simply reflects a specific relationship of one number as the middle point of two extremes.
The arithmetic mean is thus the simple average between two numbers.
The geometric mean is similar, but based on a common multiplier that relates the mean to the other two numbers.
The Golden Mean is a very specific geometric mean. In the geometric mean above, we see the following lengths of line segments on the number line:
Yellow line = 2
Blue line = 4
White line = 8
Here, 2 x 2 = 4 and 4 x 2 = 8, but 2 + 4 = 6, not 8. The Golden Mean imposes the additional requirement that the two segments that define the mean also add to the length of the entire line segment:
This occurs only at one point, which as you can see above is just a little less than 5/8ths, or 0.625. The actual point of the Golden Mean is at 0.6180339887…, where:
A is to B as B is to C AND B + C = A
If we instead let the length of line B equal 1, this gives Phi its unusual properties:
B = √ ( A * C ) AND B + C = A
1 = √ ( Φ* 1/Φ ) AND 1 + 1/Φ = Φ
1 = √ ( 1.618 … * 1/1.618 … )
AND 1 + 1 / 1.618 … = 1.618 …
Note also that:
1 / Φ = 0.618… = Φ – 1


This example compares the behavior of the ideal thyristor and the ideal GTO thyristor with Vknee=1 both. The thyristors IdealThyristor1 and IdealGTOThyristor1 are controlled by an unregular Boolean fire signal. The aim is to show several cases for the fire signal in combination with the state (s<0 or s>0)of the thyristors. Please simulate until 6 seconds and compare IdealThyristor1.v with IdealGTOThyristor1.v, the same with IdealThyristor1.s and IdealGTOThyristor1.s (attention: s is a protected variable in each thyristor). Also compare IdealThyristor1.off and IdealGTOThyristor1.off and have a look at the fire signal (e.g. IdealThyristor1.fire). It can be seen that the IdealGTOThyristor1 reacts on switching off the fire signal whereas the IdealThyristor1 does not show this behavior.
The other thyristors IdealThyristor2 and IdealGTOThyristor2 are controlled by an periodic Boolean fire signal to show a typical use case. Please compare IdealThyristor2.v with IdealGTOThyristor2.v
Release Notes:


--- layout: post title: Rough storyboard date: '2016-04-02T06:27:30+02:00' categories: - Sketches - Sketchbooks - Horses picture_url: https://film-Storyboards.tumblr.com/post/142117446156 ---


|
Leddar™ SDK
3.2
Programmer's interface to Leddar™ sensors
|
Some examples using the SDK are installed with the Leddar™ SDK. Under Windows they are installed in a LeddarTech folder in your Documents folder. If you intend to modify the examples, it is recommended that you copy them to another location, otherwise they will be overwritten if you install a newer version of the SDK.
Under Linux the examples are in the SDK directory.
Examples are provided for:
All example code is commented and should be easy to understand.
Under Windows this example is in the Examples solution with the LeddarNET example. This is a Visual Studio 2013 solution. If you are using a more recent version, Visual Studio should convert it without any issues. Before executing the example, select the proper platform for your installation (Win32 or x64).
The LeddarC example is a console application driven by simple text menus. This was done so that usage of the LeddarC interface is not obscured by complex and lengthy GUI code.
This example is in the Examples.sln solution with the LeddarC example. This is a Visual Studio 2013 solution. If you are using a more recent version, Visual Studio should convert it without any issues.
The LeddarNET example is a simple Windows Forms application. This application is neither very user-friendly nor powerful. Its goal is to illustrate the usage of all LeddarNET features.
Before executing the example, select the proper platform for your installation (Win32 or x64).
All products mentioned are the trademarks of their respective owners.


Modify the list below to control which sites get muted when navigated to. Use wildcards to filter entire domains/subdomains/subfolders.


dotsDrawableExplosion draws lots of particles as they move through parabolic trajectories. When a particle hits the ground, it bounces and enters a new trajectory. After a few bounces, it comes to rest on the ground.
Each particle is constrained by its starting position, its resting position, and the total time it must spend in reaching its resting position. The system of particles uses a constant downward acceleration, velocity damping each time a particle bounces, and a fixed number of trajectories that each particle must trace before resting.
This is enough information to solve the system, so that the position of any particle can be computed for any time between starting and resting. This page describes how dotsDrawableExplosion solves the system.
Easy System
Consider a simplified system, in which a particle starts out on the ground, bounces on the ground, and comes to rest on the same ground. This system is relatively easy to solve.
The diagram below depicts the y-position of a particle as a function of time.
http://snow-dots.googlecode.com/svn/wiki/diagrams/explosion-algebra-easy.png
http://latex.codecogs.com/gif.latex?\rm v{y0}%.png' /> is the initial upward velocity of the particle
http://latex.codecogs.com/gif.latex?\rm v{y3}%.png' /> is the upward velocity of the particle after three bounces
http://latex.codecogs.com/gif.latex?\rm dampy%.png' /> is the damping applied the particle's velocity at each bounce
http://latex.codecogs.com/gif.latex?\rm t0%.png' /> is the time the particle spends in the air before the first bounce
http://latex.codecogs.com/gif.latex?\rm t3%.png' /> is the time the particle spends in the air after the third bounce, before coming to rest
http://latex.codecogs.com/gif.latex?\rm t{rest}%.png' /> is the total time spend coming to rest
http://latex.codecogs.com/gif.latex?\rm a_{y}%.png' /> is the constant, downward acceleration of the system
the number of trajectories http://latex.codecogs.com/gif.latex?\rm n%.png' /> is 4 in this diagram
First let's consider just vertical motion. A large constraint on vertical motion is the total time that a particle must spend coming to rest. This is the sum of times from each trajectory.
http://latex.codecogs.com/gif.latex?\rm t{rest} = \sum{i=0}^{n-1} t_i%.png' />
To solve each trajectory http://latex.codecogs.com/gif.latex?\rm i%.png' />, we would like to know each http://latex.codecogs.com/gif.latex?\rm ti%.png' /> and each starting upward velocity http://latex.codecogs.com/gif.latex?\rm v{yi}%.png' />. Since the particle starts and ends each trajectory on the ground, and since downward acceleration is constant, http://latex.codecogs.com/gif.latex?\rm ti%.png' /> and http://latex.codecogs.com/gif.latex?\rm v{yi}%.png' /> are related by simple projectile motion.
http://latex.codecogs.com/gif.latex?\rm 0 = v{yi}ti + \frac{1}{2}ayti^2 = v{yi} + \frac{1}{2}ayt_i%.png' />
http://latex.codecogs.com/gif.latex?\rm ti = \frac{-2v{yi}}{a_y}%.png' />
We can also express http://latex.codecogs.com/gif.latex?\rm v{yi}%.png' /> in terms of the initial upward velocity http://latex.codecogs.com/gif.latex?\rm v{y0}%.png' />, and the velocity damping applied at the start of each trajectory http://latex.codecogs.com/gif.latex?\rm damp_y%.png' />.
http://latex.codecogs.com/gif.latex?\rm v{yi} = v{y0} damp_y^i%.png' />
Combining equations, we have the time spend in each trajectory in terms of the initial velocity http://latex.codecogs.com/gif.latex?\rm v_{y0}%.png' />.
http://latex.codecogs.com/gif.latex?\rm ti = \frac{-2 v{y0} dampy^i}{ay}%.png' />
Taking the sum over all trajectories, we can replace the unknown trajectory times http://latex.codecogs.com/gif.latex?\rm ti%.png' /> with the known total resting time http://latex.codecogs.com/gif.latex?\rm t{rest}%.png' />.
http://latex.codecogs.com/gif.latex?\rm t{rest} = \sum{i=0}^{n-1} ti = \sum{i=0}^{n-1} \frac{-2v{y0} dampy^i}{ay} = \frac{-2v{y0}}{ay} \sum{i=0}^{n-1}damp_y^i%.png' />
We can solve this for http://latex.codecogs.com/gif.latex?\rm v_{y0}%.png' />.
http://latex.codecogs.com/gif.latex?\rm v{y0} = \frac{t{rest} ay}{-2\sum{i=0}^{n-1}damp_y^i}%.png' />
So the initial upward velocity is proportional to the total time spend coming to rest, and to the downward acceleration. It varies inversely with the number of trajectories that a particle must trace before resting, and the velocity damping between trajectories.
From http://latex.codecogs.com/gif.latex?\rm v{y0}%.png' />, we can calculate any http://latex.codecogs.com/gif.latex?\rm v{yi}%.png' /> and in turn any http://latex.codecogs.com/gif.latex?\rm ti%.png' />. We can also use the http://latex.codecogs.com/gif.latex?\rm ti%.png' /> solutions to solve for horizontal motion (see below).
So this "easy" system is solved. On to a more general, harder system.
Harder System
Now consider a more general system, in which a particle may start out in mid-air. This system is harder to solve because the non-zero starting height introduces a degree of freedom. The system has two solutions, one in which the starting particle velocity is upward, and one in which it's downward.
The diagram below depicts the y-position of a particle as a function of time, along with its mid-air starting position.
http://snow-dots.googlecode.com/svn/wiki/diagrams/explosion-algebra-hard.png
http://latex.codecogs.com/gif.latex?\rm y{\alpha}%.png' /> is the non-negative starting height of the particle
http://latex.codecogs.com/gif.latex?\rm v{y\alpha}%.png' /> is the new starting upward velocity of the particle
http://latex.codecogs.com/gif.latex?\rm v{y\alpha-}%.png' /> is an alternative starting downward velocity of the particle
http://latex.codecogs.com/gif.latex?\rm t{\alpha}%.png' /> is a time in the past, spent reaching the mid-air starting position
http://latex.codecogs.com/gif.latex?\rm t{\beta}%.png' /> is the new time spent coming to rest, from the mid-air starting position.
The intuition for this system is that same as for the easy system. If we knew http://latex.codecogs.com/gif.latex?\rm v{y0}%.png' /> and http://latex.codecogs.com/gif.latex?\rm t{rest}%.png' /> we could solve all of the trajectories. The particle has a known starting position http://latex.codecogs.com/gif.latex?\rm y{\alpha}%.png' /> and a known time http://latex.codecogs.com/gif.latex?\rm t{\beta}%.png' /> that it must spend coming to rest. But it has traveled for some unknown time http://latex.codecogs.com/gif.latex?\rm t{\alpha}%.png' /> since leaving the ground.
The starting velocity http://latex.codecogs.com/gif.latex?\rm v{y \alpha}%.png' /> is also unknown. Since http://latex.codecogs.com/gif.latex?\rm t{\alpha}%.png' /> and http://latex.codecogs.com/gif.latex?\rm v{y \alpha}%.png' /> are both unknown, there are two possible values for http://latex.codecogs.com/gif.latex?\rm v{y \alpha}%.png' />. The particle may have recently left the ground, and have a positive http://latex.codecogs.com/gif.latex?\rm v{y \alpha}%.png' />. Or, the particle may have been in the air for a long time and have a negative http://latex.codecogs.com/gif.latex?\rm v{y \alpha -}%.png' />-. In the diagram above, the dashed purple trajectory shows this second case.
If we knew http://latex.codecogs.com/gif.latex?\rm t{\alpha}%.png' />, it would be easy to reuse the solution for the easy system and calculate each http://latex.codecogs.com/gif.latex?\rm ti%.png' />. But http://latex.codecogs.com/gif.latex?\rm t{\alpha}%.png' /> depends on http://latex.codecogs.com/gif.latex?\rm v{y0}%.png' />, via projectile motion.
http://latex.codecogs.com/gif.latex?\rm y{\alpha} + v{y0}t{\alpha} + \frac{1}{2}ayt_{\alpha}^2%.png' />
http://latex.codecogs.com/gif.latex?\rm 0 = -y{\alpha} + v{y0}t{\alpha} + \frac{1}{2}ayt_{\alpha}^2%.png' />
http://latex.codecogs.com/gif.latex?\rm t{\alpha} = \frac{-v{y0} \pm \sqrt{v{y0}^2 + 2ay y{\alpha}}}{ay}%.png' />
This is a quadratic for http://latex.codecogs.com/gif.latex?\rm t{\alpha}%.png' />, which has two solutions, as expected. We can't yet solve for http://latex.codecogs.com/gif.latex?\rm t{\alpha}%.png' /> because we don't know http://latex.codecogs.com/gif.latex?\rm v{y0}%.png' />. In the easy system, we had used http://latex.codecogs.com/gif.latex?\rm t{rest}%.png' /> to solve for http://latex.codecogs.com/gif.latex?\rm v{y0}%.png' />. Now we have http://latex.codecogs.com/gif.latex?\rm t{\beta}%.png' /> instead, but the two times are clearly related.
http://latex.codecogs.com/gif.latex?\rm t{\beta} = t{rest} - t_{\alpha}%.png' />
We can expand this to view http://latex.codecogs.com/gif.latex?\rm t{\beta}%.png' /> in terms of http://latex.codecogs.com/gif.latex?\rm v{y0}%.png' />.
http://latex.codecogs.com/gif.latex?\rm t{\beta} = \left (\frac{-2v{y0}}{ay} \sum{i=0}^{n-1}dampy^i \right) - \left (\frac{-v{y0} \pm \sqrt{v{y0}^2 + 2ay y{\alpha}}}{ay} \right)%.png' />
Rearranging terms isolates the square root.
http://latex.codecogs.com/gif.latex?\rm t{\beta}ay = \left (-2v{y0} \sum{i=0}^{n-1}dampy^i \right) - \left (-v{y0} \pm \sqrt{v{y0}^2 + 2ay y_{\alpha}} \right)%.png' />
http://latex.codecogs.com/gif.latex?\rm t{\beta}ay + \left (2v{y0} \sum{i=0}^{n-1}dampy^i \right) -v{y0} = \pm \sqrt{v{y0}^2 + 2ay y_{\alpha}}%.png' />
Squaring both sides eliminates the square root. It also incurs a lot of algebra!
http://latex.codecogs.com/gif.latex?\rm \left[ t{\beta}ay + \left (2v{y0} \sum{i=0}^{n-1}dampy^i \right) -v{y0} \right ]^2= v{y0}^2 + 2ay y_{\alpha}%.png' />
The end result is a new quadratic for http://latex.codecogs.com/gif.latex?\rm v_{y0}%.png' />.
http://latex.codecogs.com/gif.latex?\rm 0 = t{\beta}^2ay^2-2ay y{\alpha} \hspace{2mm}+\hspace{2mm} 2t{\beta}ay\left[2\left(\sum{i=0}^{n-1}dampy^i\right)-1\right]v{y0} \hspace{2mm}+\hspace{2mm} 4\left[\left(\sum{i=0}^{n-1}dampy^i\right)^2 - \sum{i=0}^{n-1}dampy^i\right]v{y0}^2%.png' />
The coefficients http://latex.codecogs.com/gif.latex?\rm A%.png' />, http://latex.codecogs.com/gif.latex?\rm B%.png' />, and http://latex.codecogs.com/gif.latex?\rm C%.png' /> are cumbersome, but allow us to solve for http://latex.codecogs.com/gif.latex?\rm v_{y0}%.png' />.
http://latex.codecogs.com/gif.latex?\rm A = 4\left[\left(\sum{i=0}^{n-1}dampy^i\right)^2 - \sum{i=0}^{n-1}dampy^i\right]%.png' />
http://latex.codecogs.com/gif.latex?\rm B = 2t{\beta}ay\left[2\left(\sum{i=0}^{n-1}dampy^i\right)-1\right]%.png' />
http://latex.codecogs.com/gif.latex?\rm C = t{\beta}^2ay^2-2ay y{\alpha}%.png' />
http://latex.codecogs.com/gif.latex?\rm V_{y0} =\frac{-B \pm \sqrt{B^2 - 4AC}}{2A}%.png' />
Since http://latex.codecogs.com/gif.latex?\rm i%.png' /> starts at 0, the sums are always at least 1, and http://latex.codecogs.com/gif.latex?\rm A%.png' /> is always non-negative. Assuming http://latex.codecogs.com/gif.latex?\rm t{\beta}%.png' /> > 0 and http://latex.codecogs.com/gif.latex?\rm ay%.png' /> < 0, http://latex.codecogs.com/gif.latex?\rm B%.png' /> is always negative. Assuming http://latex.codecogs.com/gif.latex?\rm y_{\alpha}%.png' /> > 0, http://latex.codecogs.com/gif.latex?\rm C%.png' /> is always positive. Thus, the "-" root is always less than the "+" root.
The "-" root of http://latex.codecogs.com/gif.latex?\rm v{y0}%.png' /> should correspond to small, low velocity bounces, and a small value of http://latex.codecogs.com/gif.latex?\rm t{\alpha}%.png' />. This would correspond to a positive value of http://latex.codecogs.com/gif.latex?\rm v_{y \alpha}%.png' />.
Conversely, the "+" root of http://latex.codecogs.com/gif.latex?\rm v{y0}%.png' /> should correspond to large, high-velocity bounces and a longer value of http://latex.codecogs.com/gif.latex?\rm t{\alpha}%.png' />. This would correspond to a negative value of http://latex.codecogs.com/gif.latex?\rm v_{y \alpha}%.png' /> and the dashed purple trajectory in the diagram above.
Minimum Resting Time
In order for http://latex.codecogs.com/gif.latex?\rm v_{y0}%.png' /> to have real roots, the quadratic discriminant must be non-negative.
http://latex.codecogs.com/gif.latex?\rm 0 < B^2 - 4AC%.png' />
There are many ways to manipulate this inequality, to emphasize one parameter or another. We can also interpret the inequality with physical intuition: real roots should represent scenarios that are plausible in the physical world, imaginary roots should represent impossible scenarios.
One impossible scenario would require a particle to come to rest in too short a time. For example, if the starting height or velocity were too high, or the downward acceleration too small, the particle might be unable to reach the ground and trace out all of its trajectories before the resting time elapsed. Scenarios like this should lead to imaginary roots.
What is the minimum resting time that a particle can satisfy, given other parameters? A key factor would be starting velocity http://latex.codecogs.com/gif.latex?\rm v_{y \alpha}%.png' />. Whether upward or downward, large velocities should lead to larger bounces, which would demand longer resting times.
This intuition suggests that "dropping" a particle with zero starting velocity should lead to the smallest resting times. What is the smallest plausible resting time http://latex.codecogs.com/gif.latex?\rm t{\beta min}%.png' />, given http://latex.codecogs.com/gif.latex?\rm v{y \alpha} = 0%.png' />?
Consider the time it takes to trace the 0th partial trajectory. Let http://latex.codecogs.com/gif.latex?\rm t{drop}%.png' /> be the time it takes to fall from starting height http://latex.codecogs.com/gif.latex?\rm y{\alpha}%.png' />, with http://latex.codecogs.com/gif.latex?\rm v_{y \alpha} = 0%.png' />. This is straightforward projectile motion.
http://latex.codecogs.com/gif.latex?\rm 0 = y{\alpha} + 0*t{drop} + \frac{1}{2}ayt{drop}^2%.png' />
http://latex.codecogs.com/gif.latex?\rm t{drop} = \sqrt{\frac{-2y{\alpha}}{a_y}}%.png' />
Since the particle began with zero velocity, it must have begun at the vertex of the 0th trajectory. Thus, the falling time http://latex.codecogs.com/gif.latex?\rm t{drop}%.png' /> must be symmetric with the rising time http://latex.codecogs.com/gif.latex?\rm t{\alpha}%.png' />. Thus, the initial velocity http://latex.codecogs.com/gif.latex?\rm v_{y0min}%.png' /> follows from projectile velocity.
http://latex.codecogs.com/gif.latex?\rm 0 = v{y0min} + t{drop}a_y%.png' />
http://latex.codecogs.com/gif.latex?\rm v{y0min} = -t{drop}a_y%.png' />
This accounts for the 0th trajectory. The time required for the remaining trajectories follows from the number of trajectories and the damping at each bounce.
http://latex.codecogs.com/gif.latex?\rm t{1:nmin} = \frac{-2v{y0min}}{ay}\sum{i=1}^{n-1}damp_y^i%.png' />
Adding up times for the 0th and the remaining trajectories, we have the minimum plausible resting time http://latex.codecogs.com/gif.latex?\rm t_{\beta min}%.png' />.
http://latex.codecogs.com/gif.latex?\rm t{\beta min} = t{drop} + t{1:nmin} = \sqrt{\frac{-2ya}{ay}} + \frac{-2\sqrt{-2ayy{\alpha}}}{ay} \sum{i=1}^{n-1}dampy^i%.png' />
dotsDrawableExplosion clips resting times to this minimum value.
Horizontal Motion
The explanations above account for with vertical motion and trajectory times. Once we know the trajectory times, we can also solve for horizontal motion.
Consider a total horizontal displacement http://latex.codecogs.com/gif.latex?\rm x{rest}%.png' />, displacements within each trajectory http://latex.codecogs.com/gif.latex?\rm xi%.png' />, and horizontal velocity damping applied at each bounce http://latex.codecogs.com/gif.latex?\rm dampx%.png' />. What are the horizontal velocities at the start of each trajectory http://latex.codecogs.com/gif.latex?\rm v{xi}%.png' />?
If we knew the initial horizontal velocity http://latex.codecogs.com/gif.latex?\rm v_{x0}%.png' />, each subsequent trajectory velocity would follow from velocity damping.
http://latex.codecogs.com/gif.latex?\rm v{xi} = v{x0} damp_x^i%.png' />
We can also relate individual velocities to the known total displacement.
http://latex.codecogs.com/gif.latex?\rm x{rest} = \sum{i=0}^{n-1} xi = \sum{i=0}^{n-1} ti v{xi}%.png' />
Combining equations, we can solve for http://latex.codecogs.com/gif.latex?\rm v_{x0}%.png' />.
http://latex.codecogs.com/gif.latex?\rm x{rest} = \sum{i=0}^{n-1} ti v{x0} dampx^i = v{x0}\sum{i=0}^{n-1} ti damp_x^i%.png' />
http://latex.codecogs.com/gif.latex?\rm v{x0} = \frac{x{rest}}{\sum{i=0}^{n-1} ti damp_x^i}%.png' />
This is how dotsDrawableExplosion solves for horizontal motion, after solving for vertical motion and time.


M
c
D
onald's
W
eek
Menu
Home
Events
Photos
Partners
About Us
Menu
Social
© Copyright 2017 uiCookies:Bold. All Rights Reserved.
Photos
Scroll down
Wednesday Photos


Email notification trigger sends an email to the defined receiver when the trigger executes. To set up the trigger
settings, aside from setting up the basic configuration (common for all types of the triggers,
it is necessary to configure additional settings:
- SMTP Server name SMTP server IP address.
- Port SSL Port supported SSL protocol.
- Account name Your login to the email account.
- Password Password to the email account.
- Sender email Your full email address.
- Receiver email Email address to which the email will be sent.
- Title Title of the email.
- Content Content of the message.
|


Nitobi Grid uses XMLHttpRequest
s to load and save data to a database.
An API is provided to format data according to the Nitobi XML schema on a variety of platforms
including Java, PHP, Classic ASP, and Coldfusion.
getHandler
- As the page loads, the grid makes a call to its getHandler
for its initial page of data. Whenever the user requests more data (a paging event, or scrolling into unloaded rows) the getHandler
is called again.saveHandler
- When the user makes changes to the grid and clicks the SAVE
button, the saveHandler
is invoked and the grid's log of changes is posted to the server.keyGenerator
- When a row is inserted, the keyGenerator
is invoked to request a primary key for this new row.


Werner Thie -<EMAIL_ADDRESS>Meet me every Friday 1700-1830 @ the Coder Dojo, building PB-19, Holualoa Elementary
(F)ree and (O)pen (S)ource (S)oftware
is achieved when mass flow is balanced
A lot of data can be more effectively gathered manually
Human usage
Irrigation
Coffee processing water
Rainfall
Wind speed
Temperature
Humidity
Radiation
Feed, water, organics
Slurry, temperature, pH
Methane, volume, composition
Effluent, temperature, pH, turbidity
Feed, water, organics
Temperature
Produce
pH
HELLCO
PV
Methane, (generator)
Methane, (roasting, cooking)
Fertilizer
Herbicides/Pesticides
Human Medication
Human produced effluents/septic tank
Plastic softeners outwash
Nano particles
Composition
Humidity
pH
Manual picture taking
Autonomous picture taking
Plant health, evolution
Erosion
Plant, location
local data base
| Property | Price | Calibration | Precision | Longevity | Energy | Speed |
|---|---|---|---|---|---|---|
| Temperature | --- | no/once | ++ | +++ | --- | secs |
| Humidity | --- | no | + | +++ | --- | secs |
| Vol liquid | --- | yes | - | ++ | --- | NA |
| Vol gas | +++ | yes | - | ++ | --- | NA |
| Gas/Wind Speed | ++ | yes | - | + | --- | NA |
| pH liquid | ++ | yes | - | 1 year | - | mins |
| pH solid | ++ | yes | -- | 5 years | - | mins |
| Flammability | - | yes | +- | 5 years | +++ | secs |
| Radiation | - | no | + | +++ | - | secs |
| Voltage/Current | - | no | +++ | +++ | -- | secs |
| Magnetic field | - | yes | + | +++ | -- | < secs |
| Location/Position | ++ | yes | + | +++ | + | secs |
is mowing, mowing mowing
Robotic mopping
Tinkerforge, powerful, pricey and power hungry
The garden lamp approach
Moteino - Arduino type Uno - a tiny and only 3.3V FOSS implementation
Decent documentation
Great radio from Hope RF
Solar power source
Base station
3D printing - design with SCAD and Cura
3D printed enclosures
3D printed enclosures
pH Meter commercial broken
pH Meter replacement
Swimming thermometer - worked for more than a year
mowing
mowing
mowing
mowing
mowing :)
Mahalo nui loa!


Pugs
I don't know what I'm doing, but this text is centered and in a border!
This is why Pugs are the best dog breed
- Unmatched Cuteness
- Unmatched Stupidity
- Called Pugs
This is a pug playing basketball
Pugs make me happy. Pugs make me smile. I enjoy the presence of pugs.  My life would not be the same without pugs


- Jiffy12 Jun 2020
- Jiffy12 Jun 2020
- Jiffy02 Jun 2020
-
Jiffy29 May 2020
Converting A Virtual Image To A Physical Machine
This tutorial shows how to convert an existing CentOS VM to a Physical machine. This tutorial covers the cloning of the VM to an unpartitioned HDD and troubleshoot some of the possible errors that you may have booting the OS on your new hardware. To illustrate this procedure I will use VMware Workstation 7 as the handler to transfer the VM installation to a physical HDD.