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


ACCEPT JS
Thank you! Your order has been successfully placed.
|
|
ACCEPT UI
Thank you! Your order has been successfully placed.
ACCEPT HOSTED
Thank you! Your order has been successfully placed.
ACCEPT CUSTOMER
Thank you! Your order has been successfully placed.


The aim of this puzzle is to find the fairest way to split the price of a gift. Given the budget of each participants and the price of the gift, you have to compute the contribution of each person, so that the highest contribution is minimal, the second highest too, and so on. This puzzle is very simple to solve once you got the following idea. The "fairest" distribution is the one where the poorest person pays her share (price of the gift)/(number of participants) if she has enough money or everything she has else, and the other people share the remaining price the fairest way possible. This recursive reasoning ends when the remaining price must be paid entirely by the last person.
#include <stdlib.h> #include <stdio.h> int cmp (const void * a, const void * b){ int aa = *(int*)a; int bb = *(int*)b; return aa<bb?-1:aa>bb?1:0; } int main(int argc, char **argv) { // Read input : number of participants, price of the gift, budgets int N, price; scanf("%d\n%d\n", &N, &price); int budgets[N]; int totalBudget = 0; for (int i = 0; i < N; i++) { scanf("%d\n", &budgets[i]); totalBudget += budgets[i]; } if (totalBudget < price) printf("IMPOSSIBLE\n"); else { /* sorts budgets, then starting from the lower budgets each particpant contributes (price left) / (number of participants left) or if he hasn't enough money, everything he has*/ qsort(budgets, N , sizeof(int), cmp); int contribution; for (int i = 0; i < N; i++) { contribution = (budgets[i] >= price/(N-i)) ? price/(N-i) : budgets[i] ; printf("%d\n", contribution); price -= contribution; } } return EXIT_SUCCESS; }


You're doing a good job managing your stress level with coping methods.
You seem moderately stressed. Check out these resources to help cope with or reduce your stress levels.
You are very stressed. Get help. See these resources for ways you can get help.


Black to Play 44
b2-w2/5
pips Black=138 White=120
(CorrectAnswer= 0/0, ErrorScore= 0)
1. 13/9(4) eq:+0.097 61.63% (G:5.33% B:0.24%) 38.37% (G:5.07% B:0.04%) 2. 13/9(2) 13/5 eq:+0.062 (-0.035) 60.16% (G:5.19% B:0.25%) 39.84% (G:5.21% B:0.13%) 3. 13/9(2) 7/3(2) eq:-0.110 (-0.206) 54.42% (G:3.31% B:0.05%) 45.58% (G:3.78% B:0.05%) 4. 13/5(2) eq:-0.213 (-0.309) 50.33% (G:3.50% B:0.05%) 49.67% (G:4.57% B:0.05%) 5. 13/1* 5/1 eq:-0.245 (-0.342) 49.07% (G:3.59% B:0.04%) 50.93% (G:5.20% B:0.04%)


1. I agree the 'auto-adjust order size' should be only used with 'max', that way MM2 can dynamically react to balance changes.
2. If the balance decreases after the order was created. This issue was filed because at the time MM2 was still broadcasting the 'full' order size. If the 'adjust order size down to reflect current balance' is already implemented, consider that part resolved.
The use case was not that a swap causes the balance to go down, but a (potentially malicious, or just in...


1. (start situation/pre-condition) Karli enters the Study-Right University in the math room. Karli has no credits yet and still a motivation of 214.
// =============================================================
storyboard.add("1. (start situation/pre-condition) Karli enters the Study-Right University \n"
+ "in the math room. Karli has no credits yet and still a motivation of 214. ");
storyboard.markCodeStart();
University university = new University()
.withName("StudyRight");
Student karli = university.createStudents()
.withId("4242")
.withName("Karli");
Assignment matrixMult = new Assignment()
.withContent("Matrix Multiplication")
.withPoints(5);
Assignment series = new Assignment()
.withContent("Series")
.withPoints(6);
Assignment a3 = new Assignment()
.withContent("Integrals")
.withPoints(8);
Room mathRoom = university.createRooms()
.withName("senate")
.withTopic("math")
.withCredits(17)
.withStudents(karli)
.withAssignments(matrixMult, series, a3);
Room artsRoom = university.createRooms()
.withName("7522")
.withTopic("arts")
.withCredits(16)
.withDoors(mathRoom);
Room sportsRoom = university.createRooms()
.withName("gymnasium")
.withTopic("sports")
.withCredits(25)
.withDoors(mathRoom, artsRoom);
Room examRoom = university.createRooms()
.withName("The End")
.withTopic("exam")
.withCredits(0)
.withDoors(sportsRoom, artsRoom);
2. Karli does assignment a1 on Matrix Multiplication and earns 5 points
(general rule: the student earns always full points for doing an assignment).
Karli's motivation is reduced by 5 points to now 209.
storyboard.add("2. Karli does assignment a1 on Matrix Multiplication and earns 5 points
\n"
+ "(general rule: the student earns always full points for doing an assignment).
\n"
3. Karli does assignment a2 on Series and earns another 6 points.
Thus Karli has 11 points now. Motivation is reduced to 203.
// ===============================================================================================
storyboard.add("3. Karli does assignment a2 on Series and earns another 6 points.
\n"
4. Karli does the third assignment on Integrals, earns
another 8 points and thus Karli has now 19 points and a motivation of 195.
// ===============================================================================================
storyboard.add("4. Karli does the third assignment on Integrals, earns
\n"
5. Since 19 points are more than the 17 points required
for the 17 math credits, Karli hands the points in and earns the credits
and has his assignmnet points reset to 0.
(General rule: if the points earned by the assignments are higher or equal than
the credit points, the credit points will be awarded to the student.)
+ "and has his assignmnet points reset to 0.
\n"
+ "(General rule: if the points earned by the assignments are higher or equal than \n"
+ "the credit points, the credit points will be awarded to the student.)");
storyboard.markCodeStart();
6. (end situation/post-condition) Karli has completed the math topic and moves to sports.
Check: Karli's credits: 17 actual 17
Check: Karli's assignment points: 0 actual 0
Check: Number of students: 1 actual 1


I have 7 dogs but no cats.
Their names are Dutch,Gajen,Sheena,Vi,Boss,Quty and Sphen.
The only dog that I own is Dutch.The others belong to my anutys and my grandma and grandpa.
Dutch is a girl.Gajen is a boy.Sheena is a girl.Vi is a girl.
Excercise your dog !!!!
Feed your cat


The Aesthetics of Source Code - Pierre Depaz
Further definition of topic and future outline of work
10.06.2020
main report
established software engineering practices
- explain why this is: most important aspect of writing in code so far
- programmers have been saying, both implicitly and explicitly, that aesthetics is for something
- where that really shines though is also in the “unexpected” in saying you care about one thing, but you also display something else (i.e. the phenomenon of “coming across”)
- “aesthetics alleviate cognitive pain” (from: the art of readable code)
sum up those aesthetic standards
- structures
- conceptual distancing everything is close to each other in a semantic way (having variables together, then functions together). there seems to be a first, superficial level of beautiful code as beautifully laid out code (it is an indicator, at least, somehow a requirement? but only for larger code bases), but then the deeper beauty is when that layout actually reflects the conceptual structure of the code because, before the code, there is the data.
- regarding layout vs. structure: it’s an indicator but not a proof.
- clean structure is a structure in which only one intent can and should be perceived. all the statements relate to only one task (but they relate to, which implies transitivity)
- related to the above: minimalism “the code that does the job while using the least amount of different ideas”. restraint (re: python code guide)
- separation of concerns
- code symmetry: using the same constructs for the same tasks
- linear relationship between the number of lines of code and the amount to be understood (the existence of this + one liners being a thing considered beautiful proves that there are mulitple kinds of beauty)
- SOLID
- single responsibility of classes
- open/close principle
- liskov substitution
- interface segregation
- dependency inversion
- blank space to show important separate steps (like senett’s decisive moment). that, at least has something in common with literatur insofar as they’re paragraphs
- when not enforced by the language, stepdown rule of function declaration (always have the more general functions at the top, the more specific at the bottom)
- no input/output rule: everything that happens in locally coherent
- vocabularies
- nouns as variables, verbs as functions, and both replace comments (comments are only acceptable for the “why” of programming logic)
- variables should answer why it exists, what it does and how it is used (not certain that all of these can be attained at the same time)
- ways of calling functions on objects or calling functions from objects (aka no output arguments)
- requirement of idiomatic usage
- pronounceable names
- one word per concept (1:1 relationship), don’t try to do multiple things at the same time, unless this is exactly what you would want to do
- functions don’t have too many arguments (< 3)
- no magic numbers
- differentiate between meaning/intention of a variable and value of a variable
- variable name length can hint at the importance/hierarchy of the variable
- some vocab in languages is haram (
unless
in perl, *
in C, etc.)
- syntax
- cross-referencing language knowledge is a tricky subject. using the idiomaticity of one language into another one (using ideas from C++ into C code is good, but writing ruby the way you write java is not good)
- do not reference variable name in comments (redundancy, DRY)
- regarding comments, there are no beautiful comments, apparently. does that mean that ornament is crime
- all caps is constant (bringing heuristics from C to more modern languages)
- natural language flows (ruby can shine at this, because ruby has multiple ways of doing it:
if people.include? person
vs. if person.in? people
)
- as similar as possible as natural language while retaining as much as possible the CLARITY of code
- eliminate nesting (one line instead of three)
- line alignment/indentation
shifted from singular understanding to plural understandings
- there could actually be multiple kinds of writing, which can all differ and relate to each other (cratt vs. engineering vs. literary)
highlighted code’s uncertainty as a literary object, and rather as a crafting resource
- code never lies (craft), comments do (literature)
next steps
- establish textbook aesthetics (relation to mathematics)
- leave room for language aesthetics
- esolangs and code poetry additional
- hardware aesthetic?
these understandings could be the interplay between theoretical, craft and literature
keep in mind
giving up the understanding in order to understand better
questions that i need help with
- am i reinventing the wheel at any point?
- e.g. surface vs. depth, syntax as beauty for the unexperienced and semantics for the experienced
words as problem solvers
(in reference to the book pat found, where the author states that programming is treated as a management problem, and not a mathematical one: but in both cases, we’re still talking about source code (and to what extent is it always the “same” source code?), a unique object/practice/paradigm which enables us to solve problems (and now, to what extent are these problems dependent on source code? or is it because source code (as computation) can solve theoretically any problem? and is that beautiful in itself?))


Toggle navigation
CityScope
Home
Counties
Michigan
Click on a state, then choose a county from the menu.
A visual snapshot of any city in seconds.
Click on a state, then choose a county from the menu.
Diversity
Poverty Trend
13
Farmers Market Density
Google Places feed


Imprint according to Section 5 Telemediengesetz (German Telemedia Act) and Section 18 Medienstaatsvertrag (German State Media Treaty)
Deutsches Zentrum fuer Luft- und Raumfahrt e. V.
German Aerospace Center (DLR)
Linder Hoehe
51147 Koeln (Cologne)
Germany
Tel: +49 2203 601-0
Fax: +49 2203 67310
email: contact-dlr [at] dlr.de
https://www.dlr.de/en
DLR's Executive Board, consisting of Prof. Dr. Anke Kaysser-Pyzalla (Chair of the DLR Executive Board), Klaus Hamacher (Vice Chairman of the Executive Board), Prof. Dr. rer. nat. Hansjörg Dittus, Prof. Dr.-Ing. Karsten Lemmer and Dr.-Ing. Walther Pelzer is empowered to act as DLR's representative. The Executive Board's seat is located at DLR, Executive Board, Linder Hoehe, D-51147 Koeln. The Executive Board can also authorise DLR employees to act on behalf of DLR. The head of DLR's legal department, Linder Hoehe, 51147 Cologne, can provide information about the extent of this authorisation. Registration court and registration number of DLR: District court of Bonn, VR 2780.
Value added tax identification number: DE 121965658
Responsible in the sense of Section 18 2nd paragraph of Medienstaatsvertrag (German State Media Treaty)
Rolf Hempel, Linder Hoehe, 51147 Koeln, Germany
This site is maintained by
Deutsches Zentrum fuer Luft- und Raumfahrt e. V. (DLR) | German Aerospace Center (DLR)
Institute for Software Technology, Intelligent and Distributed Systems
Linder Hoehe
51147 Koeln
Germany
Publisher
DLR German Aerospace Center -
The Executive Board, represented by
Prof. Dr. Anke Kaysser-Pyzalla and Klaus Hamacher, Cologne
Liability
DLR cannot be held liable either for mistakes in editorial or technical aspects, nor for omissions, nor for the correctness of the content. In particular, DLR does not guarantee completeness or correctness of information contained in external websites which can be accessed via links from DLR's websites. Despite accurate research on the content of such linked external websites, DLR cannot be held liable for their content. Only the content providers of such external sites are liable for their content. Should you notice any mistake in technical or editorial aspects of the DLR site, please do not hesitate to inform us.


?7
8
9
10
jpyright
reserved
The
New
York
Botanical
Garden
01442654
Chrysophyllum
<£?
New
York
Botanical
Garden
1Õ*1Ó
1
Arthur
Cronquist,
1944
NEW
YORK
BOTANICA!-
GARDEN
CARNEGIE
INSTITUTION
Op
WASHINGTON
UNITED
STATES
NATIONAL
MUSEUM
WEST
INDI
AN
EXPLORATION
1913
Santo
Domingo
City,
Santo
Domingo
J.
N.
rose,
collector
wm,
R.
fitch.
assistant
Paul
g.
Russell,
Assistant
MARCH
9-10,
1B13
01442654
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


Dial to get the IMEI of your device
Disclaimer : The exchange value will be credited to your account after pickup & verification of your device.
Device
Exchange Value
Your old -- phone name -- will be picked up after the delivery of your new --phone name-- . The exchange value will be credited to your account after pickup and verification of your old device at our collection center and may take upto 3-4 business days from time of pickup.
Trade-In powered by logo


Michael Bloomberg joins crowded US presidential race
by Sebastian McCarthyDonald Trump made history after becoming the first New York billionaire to move into the White House, but now it looks as if a fellow titan of the Big Apple is hot on his feels.
Michael Bloomberg officially kicked off his campaign to become the next US president today, entering an already-packed field of Democratic nominees.
Read more: FTSE 100 falls after Donald Trump threatens more tariffs
The former New York mayor and eighth-richest American is embarking on a $31m ad splurge as he looks to see off current frontrunners such as Elizabeth Warren, Bernie Sanders and Joe Biden.
The 77-year-old said he was running “to defeat Donald Trump and rebuild America”, despite having previously ruled out claims that he would enter the race.
The presidential hopeful, who owns media company Bloomberg, is believed to be worth roughly $54.4bn.
Bloomberg’s unusually late entry comes against a backdrop of increasing political pressure on billionaires, with several of his fellow candidates hitting out at the ultra-wealthy and pledging new wealth taxes on the super rich.
Read more: Twitter acquires London AI startup
Among Bloomberg’s initial campaign policies is a promise to expand health insurance, address climate change and raise taxes on the wealthy.
Trump has previously taken aim at Bloomberg amid speculation that he would run for President, telling reporters earlier this month: “There’s nobody I would rather run against than Little Michael.”


Files | |
| file | Affector.hpp [code] |
| Concrete particle affector classes. | |
| file | Emitter.hpp [code] |
| Concrete particle emitter classes. | |
| file | Particle.hpp [code] |
| Structure thor::Particle. | |
| file | ParticleInterfaces.hpp [code] |
| Interfaces thor::Emitter, thor::Affector. | |
| file | ParticleSystem.hpp [code] |
| Class thor::ParticleSystem. | |


pymatgen.electronic_structure.core module¶
-
class
Magmom
(moment, saxis=(0, 0, 1))[source]¶ Bases:
monty.json.MSONable
New class in active development. Use with caution, feedback is appreciated.
Class to handle magnetic moments. Defines the magnetic moment of a site or species relative to a spin quantization axis. Designed for use in electronic structure calculations.
- For the general case, Magmom can be specified by a vector, e.g. m = Magmom([1.0, 1.0, 2.0]), and subscripts will work as expected, e.g. m[0] gives 1.0
- For collinear calculations, Magmom can assumed to be scalar-like, e.g. m = Magmom(5.0) will work as expected, e.g. float(m) gives 5.0
Both of these cases should be safe and shouldn’t give any surprises, but more advanced functionality is available if required.
There also exist useful static methods for lists of magmoms:
- Magmom.are_collinear(magmoms) - if true, a collinear electronic structure calculation can be safely initialized, with float(Magmom) giving the expected scalar magnetic moment value
- Magmom.get_consistent_set_and_saxis(magmoms) - for non-collinear electronic structure calculations, a global, consistent spin axis has to be used. This method returns a list of Magmoms which all share a common spin axis, along with the global spin axis.
All methods that take lists of magmoms will accept magmoms either as Magmom objects or as scalars/lists and will automatically convert to a Magmom representation internally.
The following methods are also particularly useful in the context of VASP calculations:
- Magmom.get_xyz_magmom_with_001_saxis()
- Magmom.get_00t_magmom_with_xyz_saxis()
See VASP documentation for more information:
https://cms.mpi.univie.ac.at/wiki/index.php/SAXIS
Parameters: - moment – magnetic moment, supplied as float or list/np.ndarray
- saxis – spin axis, supplied as list/np.ndarray, parameter will
be converted to unit vector (default is [0, 0, 1]) :return: Magmom object
-
static
are_collinear
(magmoms)[source]¶ Method checks to see if a set of magnetic moments are collinear with each other. :param magmoms: list of magmoms (Magmoms, scalars or vectors) :return: bool
-
classmethod
from_global_moment_and_saxis
(global_moment, saxis)[source]¶ Convenience method to initialize Magmom from a given global magnetic moment, i.e. magnetic moment with saxis=(0,0,1), and provided saxis.
Method is useful if you do not know the components of your magnetic moment in frame of your desired saxis.
Parameters: - global_moment –
- saxis – desired saxis
Returns:
-
classmethod
from_moment_relative_to_crystal_axes
(moment, lattice)[source]¶ Obtaining a Magmom object from a magnetic moment provided relative to crystal axes.
Used for obtaining moments from magCIF file. :param magmom: list of floats specifying vector magmom :param lattice: Lattice :return: Magmom
-
get_00t_magmom_with_xyz_saxis
()[source]¶ For internal implementation reasons, in non-collinear calculations VASP prefers:
MAGMOM = 0 0 total_magnetic_moment SAXIS = x y z
to an equivalent:
MAGMOM = x y z SAXIS = 0 0 1
This method returns a Magmom object with magnetic moment [0, 0, t], where t is the total magnetic moment, and saxis rotated as required.
A consistent direction of saxis is applied such that t might be positive or negative depending on the direction of the initial moment. This is useful in the case of collinear structures, rather than constraining assuming t is always positive.
Returns: Magmom
-
static
get_consistent_set_and_saxis
(magmoms, saxis=None)[source]¶ Method to ensure a list of magmoms use the same spin axis. Returns a tuple of a list of Magmoms and their global spin axis.
Parameters: - magmoms – list of magmoms (Magmoms, scalars or vectors)
- saxis – can provide a specific global spin axis
Returns: (list of Magmoms, global spin axis) tuple
-
get_moment
(saxis=(0, 0, 1))[source]¶ Get magnetic moment relative to a given spin quantization axis. If no axis is provided, moment will be given relative to the Magmom’s internal spin quantization axis, i.e. equivalent to Magmom.moment
Parameters: axis – (list/numpy array) spin quantization axis Returns: np.ndarray of length 3
-
get_moment_relative_to_crystal_axes
(lattice)[source]¶ If scalar magmoms, moments will be given arbitrarily along z. Used for writing moments to magCIF file.
Parameters: - magmom – Magmom
- lattice – Lattice
Returns: vector as list of floats
-
static
get_suggested_saxis
(magmoms)[source]¶ This method returns a suggested spin axis for a set of magmoms, taking the largest magnetic moment as the reference. For calculations with collinear spins, this would give a sensible saxis for a ncl calculation.
Parameters: magmoms – list of magmoms (Magmoms, scalars or vectors) Returns: np.ndarray of length 3
-
get_xyz_magmom_with_001_saxis
()[source]¶ Returns a Magmom in the default setting of saxis = [0, 0, 1] and the magnetic moment rotated as required.
Returns: Magmom
-
global_moment
¶ Get the magnetic moment defined in an arbitrary global reference frame.
Returns: np.ndarray of length 3
-
static
have_consistent_saxis
(magmoms)[source]¶ This method checks that all Magmom objects in a list have a consistent spin quantization axis. To write MAGMOM tags to a VASP INCAR, a global SAXIS value for all magmoms has to be used. If saxis are inconsistent, can create consistent set with: Magmom.get_consistent_set(magmoms)
Parameters: magmoms – list of magmoms (Magmoms, scalars or vectors) Returns: bool
-
projection
¶ Projects moment along spin quantisation axis. Useful for obtaining collinear approximation for slightly non-collinear magmoms.
Returns: float
-
class
Orbital
[source]¶ Bases:
enum.Enum
Enum type for specific orbitals. The indices are basically the order in which the orbitals are reported in VASP and has no special meaning.
-
dx2
= 8¶
-
dxy
= 4¶
-
dxz
= 7¶
-
dyz
= 5¶
-
dz2
= 6¶
-
f0
= 12¶
-
f1
= 13¶
-
f2
= 14¶
-
f3
= 15¶
-
f_1
= 11¶
-
f_2
= 10¶
-
f_3
= 9¶
-
orbital_type
¶ Returns OrbitalType of an orbital.
-
px
= 3¶
-
py
= 1¶
-
pz
= 2¶
-
s
= 0¶
-


{{:msg}}
Your account must be verified by following a verification link sent to the email address and approved by an administrator before you are able to log in.


---
layout: post
title: Free Music
date: '2007-08-25T00:27:00.001-05:00'
author: Tom Ray
tags:
modified_time: '2007-08-25T00:27:23.581-05:00'
blogger_id: tag:blogger.com,1999:blog-11319466.post-7850234602193635355
blogger_orig_url: http://www.lorenzosmusic.com/2007/08/free-music.html
---
If you're a frequent visitor to our site you already know that all of our albums are free to download and distribute under Creative Commons License. Well recently we've been included with a list of others on Last.fm.
Check it out.
Some free artists found on Last.fm – mistermatcheu’s Journal – Users at Last.fm
Free albums and mp3 [last updated: 24.08.2007] – meyde’s Journal – Users at Last.fm


wt-window
The <wt-window>
is a component that implements a window
Open Window
This is a basic window (using the slot)
Example Using JQuery
Open Window
JQuery Example: This is a basic window (using the slot)
Example: Putting a wt-srch-grid into window
Open Window


Before Change
total=total if total is None else int(total),
) as t, path.open("wb") as f:
for chunk in resp.iter_content(chunk_size=8 * 1024):
t.update(len(chunk))
f.write(chunk)
except (KeyboardInterrupt, Exception):
// Make sure file doesn’t exist half-downloaded
After Change
total=total if total is None else int(total),
) as t, path.open("wb") as f:
block = resp.read(blocksize)
while block:
f.write(block)
blocknum += 1
t.update(blocknum * blocksize - t.n)
block = resp.read(blocksize)
except (KeyboardInterrupt, Exception):
// Make sure file doesn’t exist half-downloaded
if path.is_file():
path.unlink()


[next] [prev] [prev-tail] [tail] [up]
The periodic boundary condition is used for the electrical ﬁeld E, i.e., the electric ﬁeld on the right boundary is set equal to that on the left boundary.
[next] [prev] [prev-tail] [front] [up]


Cards are a convenient way of displaying content composed of different types of objects (buttons, links, icons, ect). They’re also well-suited for presenting similar objects whose size or supported actions can vary considerably, like photos with captions of variable length.


Why does the TXSCLCC chain output differently in iguana to BEER & PIZZA?
[KMD].81627 PIZZA 000d2008afd8d66799e1129638d23e4b2fba0a8fc0462e054863e4a87fefbf78 height.81628 vs last.81628
[KMD].90922 BEER 003c7de11399a66dd0142a2a3f68fb5633841a94a4352eb8b9e58440686d5b15 height.90923 vs last.90923
TXSCLCC kmdheight.1309191 CCid.2 MoMoM.["TXSCLCC", "1309191", "2"] -> {"coin":"TXSCLCC","kmdheight":1309191,"ccid":2,"MoMs":["4a9f3e5dd5d8c08f4519afdcd827d962be995f4884a42b2cc18c2518309b33c6"],"notarization_hash":"1052a71408bffc5949b1cb860ab04a51d8b9afc8


Already a member? Log in
By creating an account, you agree to KIOT's Terms of Service, Privacy Policy, Cookie Policy and Content Policies.


All Files
(90.21%
covered at
7.3
hits/line)
4 files in total.
143 relevant lines.
129 lines covered and
14 lines missed
Controllers
(100.0%
covered at
9.3
hits/line)
1 files in total.
55 relevant lines.
55 lines covered and
0 lines missed
Models
(84.09%
covered at
6.04
hits/line)
3 files in total.
88 relevant lines.
74 lines covered and
14 lines missed
Mailers
(100.0%
covered at
0.0
hits/line)
0 files in total.
0.0 relevant lines.
0.0 lines covered and
0.0 lines missed
| File |
% covered |
Lines |
Relevant Lines |
Lines covered |
Lines missed |
Avg. Hits / Line |
Helpers
(100.0%
covered at
0.0
hits/line)
0 files in total.
0.0 relevant lines.
0.0 lines covered and
0.0 lines missed
| File |
% covered |
Lines |
Relevant Lines |
Lines covered |
Lines missed |
Avg. Hits / Line |
Libraries
(100.0%
covered at
0.0
hits/line)
0 files in total.
0.0 relevant lines.
0.0 lines covered and
0.0 lines missed
| File |
% covered |
Lines |
Relevant Lines |
Lines covered |
Lines missed |
Avg. Hits / Line |
-
1
require_dependency "sensit/api_controller"
-
-
1
module Sensit
-
1
class ReportsController < ApiController
-
1
doorkeeper_for :index, :show, :scopes => [:read_any_reports, :read_application_reports]
-
1
doorkeeper_for :create, :update, :destroy, :scopes => [:manage_any_reports, :manage_application_reports]
-
-
1
respond_to :json, :xml
-
# GET /reports
-
# returns the name and query along with the results of the query
-
# accepts additional parameters which will be merged into each report
-
1
def index
-
8
joins = {:user_id => doorkeeper_token.resource_owner_id, :slug => params[:topic_id]}
-
8
joins.merge!(:application_id => doorkeeper_token.application_id) unless has_scope?("read_any_reports")
-
8
@reports = Topic::Report.joins(:topic).where(:sensit_topics => joins).page(params[:page] || 1).per(params[:per] || 10)
-
8
respond_with(@reports)
-
end
-
-
# GET /reports/1
-
# returns the name and query along with the results of the query
-
# accepts additional parameters which will be merged into the desired report
-
1
def show
-
8
if attempting_to_access_topic_from_another_application_without_privilage("read_any_reports")
-
4
raise ::ActiveRecord::RecordNotFound
-
else
-
4
@report = scoped_owner("read_any_reports").topics.find(params[:topic_id]).reports.find(params[:id])
-
4
results = @report.results
-
4
respond_with(@report)
-
end
-
end
-
-
# POST /reports
-
1
def create
-
10
if attempting_to_access_topic_from_another_application_without_privilage("manage_any_reports")
-
2
head :unauthorized
-
else
-
8
topic = scoped_owner("manage_any_reports").topics.find(params[:topic_id])
-
8
@report = topic.reports.build(report_params)
-
8
aggregations_params.each do |aggregation_params|
-
8
@report.aggregations.build(aggregation_params)
-
end
-
8
if @report.save
-
6
respond_with(@report,:status => :created, :template => "sensit/reports/show")
-
else
-
2
render(:json =><EMAIL_ADDRESS>:status => :unprocessable_entity)
-
end
-
end
-
end
-
-
# PATCH/PUT /reports/1
-
1
def update
-
10
if attempting_to_access_topic_from_another_application_without_privilage("manage_any_reports")
-
2
raise ::ActiveRecord::RecordNotFound
-
else
-
8
@report = scoped_owner("manage_any_reports").topics.find(params[:topic_id]).reports.find(params[:id])
-
-
8
(params[:report][:aggregations] || []).each do |aggregation_params|
-
3
aggregation = @report.aggregations.where( name: aggregation_params[:name]).first || nil
-
3
aggregation.update(query: aggregation_params[:query]) unless aggregation.blank?
-
end
-
-
8
if @report.update(report_params)
-
5
respond_with(@report,:status => :ok, :template => "sensit/reports/show")
-
else
-
3
render(:json =><EMAIL_ADDRESS>:status => :unprocessable_entity)
-
end
-
end
-
end
-
-
# DELETE /reports/1
-
1
def destroy
-
8
if attempting_to_access_topic_from_another_application_without_privilage("manage_any_reports")
-
3
raise ::ActiveRecord::RecordNotFound
-
else
-
5
@report = scoped_owner("manage_any_reports").topics.find(params[:topic_id]).reports.find(params[:id])
-
5
@report.destroy
-
5
head :status => :no_content
-
end
-
end
-
-
1
private
-
-
# Only allow a trusted parameter "white list" through.
-
1
def report_params
-
# fields = Topic::Field.joins(:topic).where(:sensit_topics => {:slug => params[:topic_id]}).map(&:key)
-
16
params.require(:report).permit(:name).tap do |whitelisted|
-
16
whitelisted[:query] = params[:report][:query] if params[:report].has_key?(:query)
-
end
-
end
-
-
# Only allow a trusted parameter "white list" through.
-
1
def aggregations_params
-
# fields = Topic::Field.joins(:topic).where(:sensit_topics => {:slug => params[:topic_id]}).map(&:key)
-
39
params.require(:report).require(:aggregations).map do |aggregation|
-
39
type = aggregation.delete(:type)
-
39
aggregation[:kind] = type
-
39
aggregation.tap do |whitelisted|
-
39
whitelisted[:name] = aggregation[:name] if aggregation.has_key?(:name)
-
39
whitelisted[:kind] = aggregation[:kind]
-
39
whitelisted[:query] = aggregation[:query] if aggregation.has_key?(:query)
-
end
-
end
-
end
-
-
-
-
end
-
end
-
1
module Sensit
-
1
class Topic::Report < ActiveRecord::Base
-
1
extend ::FriendlyId
-
1
friendly_id :name, use: [:slugged, :finders]
-
-
1
after_initialize :default_query
-
-
1
serialize :query, Hash
-
1
belongs_to :topic, class_name: "Sensit::Topic"
-
-
1
validates :name, presence: true, uniqueness: {scope: :topic_id}
-
-
# validate :valid_query?
-
1
has_many :facets, class_name: "Sensit::Topic::Report::Facet", dependent: :destroy
-
1
has_many :aggregations, class_name: "Sensit::Topic::Report::Aggregation", dependent: :destroy
-
-
1
validates_associated :topic, :aggregations
-
-
1
def total
-
18
results["hits"]["total"] || 0
-
end
-
-
1
def results
-
29
@results ||= send_query
-
end
-
-
1
def valid_query?
-
3
response = elastic_client.indices.validate_query(to_search_query.merge!(explain: true))
-
3
unless response["valid"]
-
2
response["explanations"].each do |explanation|
-
2
errors.add(explanation["index"], explanation["error"]) unless explanation["valid"]
-
end
-
end
-
3
response["valid"]
-
end
-
-
1
def to_search_query
-
48
{index: elastic_index_name, type: elastic_type_name, body: {query: self.query, aggregations: aggregations.inject({}){|h, aggregation| h.merge!(aggregation.to_query)}}}
-
end
-
-
1
private
-
-
1
def send_query
-
24
elastic_client.search(to_search_query.merge!(size: 0))
-
end
-
-
1
def self.elastic_client
-
24
@@client ||= ENV['ELASTICSEARCH_URL'] ? ::Elasticsearch::Client.new(url: ENV['ELASTICSEARCH_URL']) : ::Elasticsearch::Client.new
-
end
-
-
1
def elastic_client
-
24
self.class.elastic_client
-
end
-
-
1
def default_query
-
85
self.query = {:match_all => {}} if self.query.blank?
-
end
-
-
1
def elastic_index_name
-
24
self.topic.user.name.parameterize
-
end
-
-
1
def elastic_type_name
-
27
self.topic.to_param
-
end
-
-
-
end
-
end
-
1
module Sensit
-
1
class Topic::Report::Aggregation < ActiveRecord::Base
-
# extend ::FriendlyId
-
# friendly_id :name, use: [:slugged, :finders]
-
1
after_save :save_all_aggregations
-
1
has_ancestry
-
-
1
belongs_to :report
-
1
serialize :query, Hash
-
-
1
attr_reader :aggregations
-
-
1
AGGREGATION_TYPES = %w[min max sum avg stats extended_stats value_count global filter missing terms range date_range ip_range histogram date_histogram geo_distance geohash_grid]
-
-
1
validates :name, presence: true, uniqueness: {scope: :report_id}
-
1
validates :kind, presence: true, inclusion: { in: AGGREGATION_TYPES, message: "%{value} is not a valid aggregation type" }
-
62
validates :query, presence: true, unless: Proc.new { |a| a.kind == "global"}
-
-
1
def aggregations=(params_array)
-
@aggregations = params_array.map do |params|
-
aggs = params.delete(:aggregations)
-
child = self.class.new(params)
-
child.aggregations = aggs unless aggs.nil?
-
child
-
end
-
end
-
-
1
def results
-
7
query_results || []
-
end
-
-
1
def to_query
-
21
if has_children?
-
{self.name => {self.kind => self.query, "aggs" => children.inject({}){|h, aggregation| h.merge!(aggregation.to_query)}}}
-
else
-
21
{self.name => {self.kind => self.query}}
-
end
-
end
-
-
1
private
-
1
def query_results
-
7
@results ||= (report.results["aggregations"][self.name] || {})
-
end
-
-
1
def save_all_aggregations
-
aggregations.each do |agg|
-
agg.parent = self
-
agg.save
-
44
end unless aggregations.nil?
-
end
-
-
end
-
end
-
1
module Sensit
-
1
class Topic::Report::Facet < ActiveRecord::Base
-
1
extend ::FriendlyId
-
1
friendly_id :name, use: [:slugged, :finders]
-
-
1
belongs_to :report
-
1
serialize :query, Hash
-
-
1
FACET_TYPES = %w[terms range histogram date_histogram filter query statistical terms_stats geo_distance]
-
-
1
validates :name, presence: true, uniqueness: {scope: :report_id}
-
1
validates :kind, presence: true, inclusion: { in: FACET_TYPES, message: "%{value} is not a valid facet type" }
-
1
validates :query, presence: true
-
-
1
def total
-
query_results["total"] || 0
-
end
-
-
1
def missing
-
query_results["missing"] || 0
-
end
-
-
1
def results
-
query_results[query_results["_type"]] || []
-
end
-
-
-
1
def to_query
-
{self.name => {self.kind => self.query}}
-
end
-
-
1
private
-
1
def query_results
-
@results ||= (report.results["facets"][self.name] || {})
-
end
-
end
-
end


I Was a Male War Bride (1949)
Grade: 82
Cary Grant had to undergo various humiliations in many of his comedies. In "Mr. Blandings Builds His Dream House (1948)" he lurches from one disaster to another. But the worst was yet to come.
Grant is a French Army officer (with no French accent) who keeps getting assigned to work with American officer Ann Sheridan. Disguising their real feelings, they pretend to dislike each other, leading to much insulting and entertaining dialogue. While working on a mission to recruit a German lens-grinder, Grant gets into and out of trouble, getting arrested, having a motorcycle accident, etc.
Sheridan, a secret masochist, greatly enjoys Grant's humiliations, some of which she actually instigates.
Eventually the two recognize their true feelings, and get married. But when Sheridan must return to the States, Grant as an alien has only one recourse to return with her: as Sheridan's war bride.
"I Was a Male War Bride" was the third of four comedies starring Cary Grant that were directed by Howard Hawks. All four films (the others were "Bringing Up Baby", "His Girl Friday" and "Monkey Business") are excellent. All but "Bringing Up Baby" had scripts credited to Charles Lederer, whose talents never succeeded in getting an Oscar nomination. That's the trouble with writing comedies, they're not taken seriously!
<EMAIL_ADDRESS>http://members.tripod.com/~Brian_Koller/movies.html
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


|
Fig 1. The DoseNet device on a Raspberry Pi, with the Geiger probe positioned above it. Around both of them are pieces of radiation shielding. |
Fig 2. The Geiger counter dose reading (in rem) is in the lower left, and the DoseNet device counts are on the computer monitor on the right. The small red and white disk in the center is a sealed gamma source. |
|
Fig 3. A spreadsheet showing the calibration with our natural uranium sample. |


Finance Watchdogs
Open Dropdown
Sponsored • Paid for by Finance WatchDogs
ID:<PHONE_NUMBER>34993
❌ Never Make Another Mortgage Payment Again ❌
Homeowners Born Before 1957 are Getting their Monthly Mortgage Payments Forgiven!
1000's of Smart Seniors are Taking Advantage of this New Reverse Mortgage Program and are taking out tons of Cash!
This Program Could End In 30 Days So Check Now to Qualify Before the Program Ends...
Homeowners Born Before 1957 are Getting their Monthly Mortgage Payments Forgiven!
1000's of Smart Seniors are Taking Advantage of this New Reverse Mortgage Program and are taking out tons of Cash!
This Program Could End In 30 Days So Check Now to Qualify Before the Program Ends...
GOV.FINANCEWATCHDOGS.COM
Never Make Another Mortgage Payment Again
"I Reduced my monthly payment and received cash!"


{% extends "layout.html" %} {% block content %}
That page does not currently exist.
If you would like it to, feel free to update the code base


You may have a lot on your mind if you or someone you love has been involved in a car accident, and the thought of submitting a personal injury claim may seem like it would only add more stress to an already stressful situation. However, if you have a valid claim, taking legal action can help prevent further challenges in the long run brought on by medical expenses, lost wages, or the loss of a loved one. Call our Scottsdale car accident attorneys for immediate help if you have been injured.
You know who caused your traffic accident, but in order to have a legitimate claim to financial reimbursement, it will be necessary to prove that the other party was careless or negligent. A number of factors that indicate another driver or party failed to uphold his or her duty to be careful include:
It is crucial to gather as much evidence as possible to help support your claim. However, photographs or witness testimony may not be enough. A tenacious Scottsdale car accident lawyer will be a valuable asset during this process. The lawyers at the Goldman Accident Law Offices have the experience and resources to handle a thorough accident investigation. We work closely with forensic investigators, accident reconstructionist, and other experts in the field in order to build a strong case against the negligent party on behalf of our clients.
When you are in an auto accident it is important to immediately contact an auto accident lawyer. For timely service from an auto accident lawyer, please contact our personal injury law firm directly at {{phoneNumber}}. At Goldman Accident Lawyers we have a team of dedicated Scottsdale car accident lawyers that are here to help. No case is too small or too large for us to handle. Don’t attempt to deal with insurance companies alone, we do this every day and we know what your injury is worth.


{% extends "base.html" %} {% block content %}
Tyrion allows you to share secrets in a secure, ephemeral way. Input a single or multi-line secret, its expiration time, and click Generate URL. Share the one-time use URL with your intended recipient.
Enter your email and optionally context information about the secret. This information will only be available to you


PREFONTAINE A film review by Scott Renshaw Copyright 1997 Scott Renshaw
(Hollywood) Starring: Jared Leto, R. Lee Ermey, Ed O'Neil, Amy Locane. Screenplay: Steve James and Eugene Corr. Producers: Irby Smith, Mark Lutz, John Doonan, Peter Gilbert. Director: Steve James. MPAA Rating: PG-13 (profanity) Running Time: 103 minutes. Reviewed by Scott Renshaw.
As the opening scenes of PREFONTAINE unfold, you could be excused for worrying about its prospects as a drama. Those scenes include a lot of documentary-style footage of track races, as well as "talking head" shots of the actors playing Steve Prefontaine's friends and family, complete with captions identifying the characters. Is Steve James, director of the acclaimed 1994 documentary HOOP DREAMS, simply planning to tick off the significant events of Prefontaine's life, accompanied by predictably glowing commentary? Is he going to be able to tell us a story? Well, anyone concerned about James' ability as a story-teller didn't see HOOP DREAMS. Though he may have a few things to learn about directing actors and writing dialogue, James crafts PREFONTAINE into a compelling character study which takes surprising turns for a sports film.
Jared Leto stars as Steve "Pre" Prefontaine, a distance-running prodigy from the small Oregon town of Coos Bay. Courted out of high school in 1969 by dozens of colleges, Pre opts to stay close to home and attend the University of Oregon, where nationally renowned coach Bill Bowerman (R. Lee Ermey) leads the track team. Pre's intense desire to win makes him an instant success, transcending the sport to become a celebrity who brings attention to the previously under-appreciated 5,000 meter event. With success comes high expectations, however, and Pre heads to the 1972 Munich Olympics favored to take home a gold medal. Then tragedy strikes in Munich, changing the complexion of the Games and setting up a showdown with Swedish sensation Lasse Viren (Tracy Hollister) which will change Pre's life forever.
One of the things which makes PREFONTAINE more satisfying than the average underdog-makes-good bio-pic is that the style gives it a unique rhythm. James has cinematographer Peter Gilbert employ a hand-held camera for many sequences, creating a kind of urgent energy which matches Prefontaine's personality. The script does an efficient job of establishing how his lack of success as an under-sized youth baseball and football player drove him to find a place where his refusal to surrender would be enough, as well as the arrogant sense of personal invincibility which often made him reckless. Jared Leto (heartthrob Jordan Catalano from "My So-Called Life") gives a naturalistic performance encouraged by the documentary style, but his intensity isn't always as convincing as it could be. He has the golden boy charisma down pat, without all the ferocity.
He is convincing enough, however, to make the arc of his character intriguing. The pivot point of PREFONTAINE is Pre's Olympic final, which is delayed by the terrorist attack on the Israeli athletes in the Olympic village; as Pre's doubts begin to grow, the race becomes a frightening first opportunity to fail. Then PREFONTAINE makes the unexpected choice not to be about whether or not Pre wins his race, but about how he responds to a disappointing result. James' use of documentary clips from the Olympics does slow the film down somewhat, but it also establishes the 1972 Olympics as a kind of turning point in the perception of "amateur" athletics. As Pre becomes an unlikely advocate for the rights of amateur athletes, and for reforms in the governing process, his character shifts from a youth obsessed with the idea that only winning can earn him respect to a man who learns to find success in different ways. Most sports movies are about the main character(s) winning, and a few are about the main character(s) just doing their best. I can't think of many other sports movies which were about a character who learns to define himself apart from his sport.
There are plenty of places Steve James betrays his inexperience with fiction film-making, notably with some flat characters like Pre's girlfriend Nancy (Amy Locane) and the tough-but-caring coach played with enthusiasm by R. Lee Ermey, as well as a pace which makes PREFONTAINE feel long at only 105 minutes. Yet there are two scenes in which James shows the kind of handle he has on his material. The first is the Olympic 5,000 meter race, directed with a pulse-quickening energy; you know someone is doing an exceptional job of film-making if you know the result of the race and you are still sitting on the edge of your seat. The second is more subtle, but perhaps more important to the impact of Prefontaine's story. After showing us a number of early scenes in which the cocky Pre races his MG around treacherous curves, James gives us a late scene in which Pre, filled with satisfaction after organizing a successful challenge match with the Swedish national team, drives home from a party. There is an almost subliminal cut-away to his speedometer, showing him driving a cautious 35 miles per hour when he collides with another car. Prefontaine died in the crash at the age of 24, and the success of PREFONTAINE as a film comes from the fact that we appreciate this tragedy not as the loss of a fine athlete, but as the loss of someone who was becoming a fine human being. A subtle distinction, perhaps, but one which separates mediocre directors from good ones. Steve James knows his film-making, whether the subject is fact or fiction.
On the Renshaw scale of 0 to 10 gold medals: 7.
Visit Scott Renshaw's MoviePage http://www-leland.stanford.edu/~srenshaw Subscribe to receive reviews directly via email See details on the MoviePage
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


DBC Cultural Blog |
Post Title
The subtitle, if you want it
March 28th, 2015
Discuss a time you had a conflict. What was it about? What happened? What was the source of the conflict? What basic emotions did you feel upon analyzing the conflict? What actions did you take to resolve your conflict? If you could go back, what would you do differently, if anything? What did you learn from this experience?
I have experienced small conflicts with my brother about the state of our bathroom on multiple occasions. While not major, it is definitely a re-occurring source of friction.
The arguments stemmed from who's responsibility it was to clean the bathroom. The drains need to be unclogged on occasion, and of course everything needs to be wiped down regularly. Additionally, supplies like toilet paper and soap need to be refilled often.
I felt very frustrated whenever I would clean up parts of the bathroom, as I felt that at some points it was not my mess, and in other points that it would get dirty again immediately due to lack of respect.
I dealt with the problem by cleaning most of the bathroom in exchange for not having to do other chores elsewhere. I have a lower tolerance for mess than my brother, so this worked out well.
If I could go back, I would probably have tried to get my brother to understand my frustration more, instead of just trying to make a compromise without addressing the behavior.
Probably not the thing I should have taken away from this, but I really think that having my own bathroom is the best way for me to live in the future. In situations where that's impossible, having a talk about who is responsible for what might help.


{% comment %} Add content to be output before TOC (normally called from after_excerpt.html). {% endcomment %} {% unless site.affiliate == false or page.affiliate == false %}


Have you ever...?
 Pick all the ones you’ve done
Please, select one or more of the above categories to proceed
Step 1 of 3
You really did that? Well, you're not alone. Room 404 is getting quite full, so nominate just one of your mistakes to send there.
Choose one:
Rate your mistake against someone else's
Your mistake
Their mistake
Which is worse?
Your mistake is bad enough for Room 404


{% extends 'orders/layout.html' %} {% block content %}
Error: the order was not added
{% endif %} {% if status == 'success' %}Success: the order has been added
{% endif %}{{order.idOrder}} | {{order.marketplace}} | {{order.lastname}} | {{order.city}}
+Add| id | product | price |
|---|---|---|
| {{forloop.counter}} | {{product.title}} | {{product.price}}€ +Add |


Namespace SpiderGL.Math.Vec4
The SpiderGL.Math.Vec4 namespace defines operations on 4-dimensional vectors.
- Defined in: math.js
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
The SpiderGL.Math.Vec4 namespace.
|
Method Summary
| Method Attributes | Method Name and Description |
|---|---|
| <static> |
SpiderGL.Math.Vec4.abs(v)
Component-wise absolute value of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.acos(v)
Component-wise arccosine of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.add(u, v)
Component-wise addition of two 4-dimensional vectors.
|
| <static> |
SpiderGL.Math.Vec4.add$(u, v)
In-place component-wise addition of two 4-dimensional vectors.
|
| <static> |
SpiderGL.Math.Vec4.adds(v, s)
Component-wise addition of a 4-dimensional vector and a scalar.
|
| <static> |
SpiderGL.Math.Vec4.adds$(v, s)
In-place component-wise addition of a 4-dimensional vector and a scalar.
|
| <static> |
SpiderGL.Math.Vec4.asin(v)
Component-wise arcsine of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.atan(v)
Component-wise arctangent of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.atan2(y, x)
Component-wise arctangent of the quotient of two 4-dimensional vectors.
|
| <static> |
SpiderGL.Math.Vec4.ceil(v)
Component-wise ceil of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.clamp(v, min, max)
Component-wise clamp of a 4-dimensional vector with vector bounds.
|
| <static> |
SpiderGL.Math.Vec4.copy$(u, v)
In-place component-wise copy of two 4-dimensional vectors.
|
| <static> |
SpiderGL.Math.Vec4.cos(v)
Component-wise cosine of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.cross(u, v, w)
Cross product of three 4-dimensional vectors.
|
| <static> |
SpiderGL.Math.Vec4.degToRad(v)
Component-wise conversion of a 4-dimensional vector from degrees to radians.
|
| <static> |
SpiderGL.Math.Vec4.div(u, v)
Component-wise division of two 4-dimensional vectors.
|
| <static> |
SpiderGL.Math.Vec4.div$(u, v)
In-place component-wise division of two 4-dimensional vectors.
|
| <static> |
SpiderGL.Math.Vec4.divs(v, s)
Component-wise division of a 4-dimensional vector by a scalar.
|
| <static> |
SpiderGL.Math.Vec4.divs$(v, s)
In-place component-wise division of a 4-dimensional vector by a scalar.
|
| <static> |
SpiderGL.Math.Vec4.dot(u, v)
Dot product of two 4-dimensional vectors.
|
| <static> |
SpiderGL.Math.Vec4.dup(v)
Duplicates the input 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.exp(v)
Component-wise exponential of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.floor(v)
Component-wise floor of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.length(v)
Length of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.lerp(u, v, t)
Linear interpolation between two 4-dimensional vectors.
|
| <static> |
SpiderGL.Math.Vec4.ln(v)
Component-wise natural (base E) logarithm of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.log(v)
Component-wise natural (base E) logarithm of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.log10(v)
Component-wise base 10 logarithm of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.log2(v)
Component-wise base 2 logarithm of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.max(u, v)
Component-wise maximum of two 4-dimensional vectors.
|
| <static> |
SpiderGL.Math.Vec4.maxNumber()
Creates a 4-dimensional vector initialized with SpiderGL.Math.MAX_NUMBER.
|
| <static> |
SpiderGL.Math.Vec4.min(u, v)
Component-wise minimum of two 4-dimensional vectors.
|
| <static> |
SpiderGL.Math.Vec4.minNumber()
Creates a 4-dimensional vector initialized with SpiderGL.Math.MIN_NUMBER.
|
| <static> |
SpiderGL.Math.Vec4.mul(u, v)
Component-wise multiplication of two 4-dimensional vectors.
|
| <static> |
SpiderGL.Math.Vec4.mul$(u, v)
In-place component-wise multiplication of two 4-dimensional vectors.
|
| <static> |
SpiderGL.Math.Vec4.muls(v, s)
Component-wise multiplication of a 4-dimensional vector and a scalar.
|
| <static> |
SpiderGL.Math.Vec4.muls$(v, s)
In-place component-wise multiplication of a 4-dimensional vector and a scalar.
|
| <static> |
SpiderGL.Math.Vec4.neg(v)
Component-wise negation of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.neg$(v)
In-place component-wise negation of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.normalize(v)
Creates a normalized 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.normalize$(v)
In-place 4-dimensional vector normalization.
|
| <static> |
SpiderGL.Math.Vec4.one()
Creates a 4-dimensional vector initialized with one.
|
| <static> |
SpiderGL.Math.Vec4.pow(u, v)
Component-wise power of two 4-dimensional vectors.
|
| <static> |
SpiderGL.Math.Vec4.project(v)
Projects a homogeneous 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.radToDeg(v)
Component-wise conversion of a 4-dimensional vector from radians to degrees.
|
| <static> |
SpiderGL.Math.Vec4.random()
Creates a random 4-dimensional vector between 0 and 1.
|
| <static> |
SpiderGL.Math.Vec4.random01()
Creates a random 4-dimensional vector between 0 and 1.
|
| <static> |
SpiderGL.Math.Vec4.random11()
Creates a random 4-dimensional vector between -1 and 1.
|
| <static> |
SpiderGL.Math.Vec4.randomRange(min, max)
Creates a random 4-dimensional vector inside a range.
|
| <static> |
SpiderGL.Math.Vec4.rcp(v)
Component-wise reciprocal of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.round(v)
Component-wise round of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.scalar(s)
Creates a 4-dimensional vector initialized with a scalar.
|
| <static> |
SpiderGL.Math.Vec4.sdiv(s, v)
Component-wise division of a scalar by a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.sdiv$(s, v)
In-place component-wise division of a scalar by a 4-dimensional.
|
| <static> |
SpiderGL.Math.Vec4.sin(v)
Component-wise sine of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.sqLength(v)
Squared length of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.sqrt(v)
Component-wise square root of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.ssub(s, v)
Component-wise subtraction of a scalar and a 4-dimensional.
|
| <static> |
SpiderGL.Math.Vec4.ssub$(s, v)
In-place component-wise subtraction of a scalar and a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.sub(u, v)
Component-wise subtraction of two 4-dimensional vectors.
|
| <static> |
SpiderGL.Math.Vec4.sub$(u, v)
In-place component-wise subtraction of two 4-dimensional vectors.
|
| <static> |
SpiderGL.Math.Vec4.subs(v, s)
Component-wise subtraction of a 4-dimensional vector and a scalar.
|
| <static> |
SpiderGL.Math.Vec4.subs$(v, s)
In-place component-wise subtraction of a 4-dimensional vector and a scalar.
|
| <static> |
SpiderGL.Math.Vec4.tan(v)
Component-wise tangent root of a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.to2(v)
Creates a 2-dimensional vector from a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.to3(v)
Creates a 3-dimensional vector from a 4-dimensional vector.
|
| <static> |
SpiderGL.Math.Vec4.zero()
Creates a 4-dimensional vector initialized with zero.
|
Namespace Detail
SpiderGL.Math.Vec4
The SpiderGL.Math.Vec4 namespace.
The provided functions operate on 4-dimensional vectors, represented as standard JavaScript arrays of length 4.
In general, vectors are considered as column vectors.
Method Detail
-
<static> {array} SpiderGL.Math.Vec4.abs(v)Component-wise absolute value of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.abs(v[i]).
-
<static> {array} SpiderGL.Math.Vec4.acos(v)Component-wise arccosine of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.acos(v[i]), in radians.
-
<static> {array} SpiderGL.Math.Vec4.add(u, v)Component-wise addition of two 4-dimensional vectors.
- Parameters:
- {array} u
- The first addition operand.
- {array} v
- The second addition operand.
- Returns:
- {array} A new 4-dimensionals vector r, where r[i] = u[i] + v[i].
-
<static> {array} SpiderGL.Math.Vec4.add$(u, v)In-place component-wise addition of two 4-dimensional vectors.
- Parameters:
- {array} u
- The first addition operand.
- {array} v
- The second addition operand
- Returns:
- {array} The input vector u, where u[i] = u[i] + v[i].
-
<static> {array} SpiderGL.Math.Vec4.adds(v, s)Component-wise addition of a 4-dimensional vector and a scalar.
- Parameters:
- {array} v
- The vector addition operand.
- {number} s
- The scalar addition operand.
- Returns:
- {array} A new 4-dimensionals vector r, where r[i] = v[i] + s.
-
<static> {array} SpiderGL.Math.Vec4.adds$(v, s)In-place component-wise addition of a 4-dimensional vector and a scalar.
- Parameters:
- {array} v
- The vector addition operand.
- {number} s
- The scalar addition operand
- Returns:
- {array} The input vector v, where v[i] = v[i] + s.
-
<static> {array} SpiderGL.Math.Vec4.asin(v)Component-wise arcsine of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.asin(v[i]), in radians.
-
<static> {array} SpiderGL.Math.Vec4.atan(v)Component-wise arctangent of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.atan(v[i]), between -PI/2 and PI/2 radians.
-
<static> {array} SpiderGL.Math.Vec4.atan2(y, x)Component-wise arctangent of the quotient of two 4-dimensional vectors.
- Parameters:
- {array} y
- The numerator vector.
- {array} x
- The denominator vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.atan2(y[i], x[i]), between PI and -PI radians.
-
<static> {array} SpiderGL.Math.Vec4.ceil(v)Component-wise ceil of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.ceil(v[i]).
-
<static> {array} SpiderGL.Math.Vec4.clamp(v, min, max)Component-wise clamp of a 4-dimensional vector with vector bounds.
- Parameters:
- {array} v
- The input vector.
- {array} min
- The lower 4-dimensional bound.
- {array} max
- The upper 4-dimensional bound.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.clamp(v[i], min[i], max[i]).
-
<static> {array} SpiderGL.Math.Vec4.copy$(u, v)In-place component-wise copy of two 4-dimensional vectors.
- Parameters:
- {array} u
- The destination vector.
- {array} v
- The source vector.
- Returns:
- {array} The destination vector u, where u[i] = v[i].
-
<static> {array} SpiderGL.Math.Vec4.cos(v)Component-wise cosine of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector, in radians.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.cos(v[i]).
-
<static> {array} SpiderGL.Math.Vec4.cross(u, v, w)Cross product of three 4-dimensional vectors.
- Parameters:
- {array} u
- The first vector operand.
- {array} v
- The second vector operand.
- {array} w
- The third vector operand.
- Returns:
- {array} A new 4-dimensional array equal to the cross product of u, v and w.
-
<static> {array} SpiderGL.Math.Vec4.degToRad(v)Component-wise conversion of a 4-dimensional vector from degrees to radians.
- Parameters:
- {array} v
- The input vector, in radians.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.degToRad(v[i]).
-
<static> {array} SpiderGL.Math.Vec4.div(u, v)Component-wise division of two 4-dimensional vectors.
- Parameters:
- {array} u
- The numerator vector.
- {array} v
- The denominator vector.
- Returns:
- {array} A new 4-dimensionals vector r, where r[i] = u[i] / v[i].
-
<static> {array} SpiderGL.Math.Vec4.div$(u, v)In-place component-wise division of two 4-dimensional vectors.
- Parameters:
- {array} u
- The numerator vector.
- {array} v
- The denominator vector.
- Returns:
- {array} The input vector u, where u[i] = u[i] / v[i].
-
<static> {array} SpiderGL.Math.Vec4.divs(v, s)Component-wise division of a 4-dimensional vector by a scalar.
- Parameters:
- {array} v
- The numerator vector.
- {number} s
- The scalar denominator.
- Returns:
- {array} A new 4-dimensionals vector r, where r[i] = v[i] / s.
-
<static> {array} SpiderGL.Math.Vec4.divs$(v, s)In-place component-wise division of a 4-dimensional vector by a scalar.
- Parameters:
- {array} v
- The numerator vector.
- {number} s
- The scalar denominator.
- Returns:
- {array} The input vector v, where v[i] = v[i] / s.
-
<static> {number} SpiderGL.Math.Vec4.dot(u, v)Dot product of two 4-dimensional vectors.
- Parameters:
- {array} u
- The first vector operand.
- {array} v
- The second vector operand.
- Returns:
- {number} The dot product of u and v.
-
<static> {array} SpiderGL.Math.Vec4.dup(v)Duplicates the input 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = v[i] (same as v.slice(0, 4)).
-
<static> {array} SpiderGL.Math.Vec4.exp(v)Component-wise exponential of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.exp(v[i]).
-
<static> {array} SpiderGL.Math.Vec4.floor(v)Component-wise floor of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.floor(v[i]).
-
<static> {number} SpiderGL.Math.Vec4.length(v)Length of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {number} The length of v.
-
<static> {array} SpiderGL.Math.Vec4.lerp(u, v, t)Linear interpolation between two 4-dimensional vectors.
- Parameters:
- {array} u
- The start interpolation bound.
- {array} v
- The stop interpolation bound.
- {number} t
- The interpolation factor, between 0 and 1.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = (1-t)*u[i] + t*v[i].
-
<static> {array} SpiderGL.Math.Vec4.ln(v)Component-wise natural (base E) logarithm of a 4-dimensional vector. Same as SpiderGL.Math.Vec4.log.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.ln(v[i]).
-
<static> {array} SpiderGL.Math.Vec4.log(v)Component-wise natural (base E) logarithm of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.log(v[i]).
-
<static> {array} SpiderGL.Math.Vec4.log10(v)Component-wise base 10 logarithm of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.log10(v[i]).
-
<static> {array} SpiderGL.Math.Vec4.log2(v)Component-wise base 2 logarithm of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.log2(v[i]).
-
<static> {array} SpiderGL.Math.Vec4.max(u, v)Component-wise maximum of two 4-dimensional vectors.
- Parameters:
- {array} u
- The first vector.
- {array} v
- The second vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.max(u[i], v[i]).
-
<static> {array} SpiderGL.Math.Vec4.maxNumber()Creates a 4-dimensional vector initialized with SpiderGL.Math.MAX_NUMBER.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.MAX_NUMBER.
-
<static> {array} SpiderGL.Math.Vec4.min(u, v)Component-wise minimum of two 4-dimensional vectors.
- Parameters:
- {array} u
- The first vector.
- {array} v
- The second vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.min(u[i], v[i]).
-
<static> {array} SpiderGL.Math.Vec4.minNumber()Creates a 4-dimensional vector initialized with SpiderGL.Math.MIN_NUMBER.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.MIN_NUMBER.
-
<static> {array} SpiderGL.Math.Vec4.mul(u, v)Component-wise multiplication of two 4-dimensional vectors.
- Parameters:
- {array} u
- The first multiplication operand.
- {array} v
- The second multiplication operand.
- Returns:
- {array} A new 4-dimensionals vector r, where r[i] = u[i] * v[i].
-
<static> {array} SpiderGL.Math.Vec4.mul$(u, v)In-place component-wise multiplication of two 4-dimensional vectors.
- Parameters:
- {array} u
- The first multiplication operand.
- {array} v
- The second multiplication operand
- Returns:
- {array} The input vector u, where u[i] = u[i] * v[i].
-
<static> {array} SpiderGL.Math.Vec4.muls(v, s)Component-wise multiplication of a 4-dimensional vector and a scalar.
- Parameters:
- {array} v
- The vector multiplication operand.
- {number} s
- The scalar multiplication operand.
- Returns:
- {array} A new 4-dimensionals vector r, where r[i] = v[i] * s.
-
<static> {array} SpiderGL.Math.Vec4.muls$(v, s)In-place component-wise multiplication of a 4-dimensional vector and a scalar.
- Parameters:
- {array} v
- The first multiplication operand.
- {number} s
- The second multiplication operand
- Returns:
- {array} The input vector v, where v[i] = v[i] * s.
-
<static> {array} SpiderGL.Math.Vec4.neg(v)Component-wise negation of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 4-dimensionals vector r, where r[i] = -v[i].
-
<static> {array} SpiderGL.Math.Vec4.neg$(v)In-place component-wise negation of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} The input vector v, where v[i] = -v[i].
-
<static> {array} SpiderGL.Math.Vec4.normalize(v)Creates a normalized 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 4-dimensional array r representing the normalized v, where r[i] = v[i] / SpiderGL.Math.Vec4.length(v).
-
<static> {array} SpiderGL.Math.Vec4.normalize$(v)In-place 4-dimensional vector normalization.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} The input vector v, where v[i] = v[i] / SpiderGL.Math.Vec4.length(v)
-
<static> {array} SpiderGL.Math.Vec4.one()Creates a 4-dimensional vector initialized with one.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = 1.0.
-
<static> {array} SpiderGL.Math.Vec4.pow(u, v)Component-wise power of two 4-dimensional vectors.
- Parameters:
- {array} u
- The base vector.
- {array} v
- The exponent vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.pow(u[i], v[i]).
-
<static> {array} SpiderGL.Math.Vec4.project(v)Projects a homogeneous 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = v[i] / v[3].
-
<static> {array} SpiderGL.Math.Vec4.radToDeg(v)Component-wise conversion of a 4-dimensional vector from radians to degrees.
- Parameters:
- {array} v
- The input vector, in degrees.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.pow(v[i]).
-
<static> {array} SpiderGL.Math.Vec4.random()Creates a random 4-dimensional vector between 0 and 1.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.random().
-
<static> {array} SpiderGL.Math.Vec4.random01()Creates a random 4-dimensional vector between 0 and 1. Same as SpiderGL.Math.Vec4.random.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.random01().
-
<static> {array} SpiderGL.Math.Vec4.random11()Creates a random 4-dimensional vector between -1 and 1.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.random11().
-
<static> {array} SpiderGL.Math.Vec4.randomRange(min, max)Creates a random 4-dimensional vector inside a range.
- Parameters:
- {array} min
- The range vector lower bound.
- {array} max
- The range vector upper bound.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.randomRange(min[i], max[i]).
-
<static> {array} SpiderGL.Math.Vec4.rcp(v)Component-wise reciprocal of a 4-dimensional vector.
- Parameters:
- {array} v
- The input (denominator) vector.
- Returns:
- {array} A new 4-dimensionals vector r, where r[i] = 1.0 / v[i].
-
<static> {array} SpiderGL.Math.Vec4.round(v)Component-wise round of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.round(v[i]).
-
<static> {array} SpiderGL.Math.Vec4.scalar(s)Creates a 4-dimensional vector initialized with a scalar.
- Parameters:
- {number} s
- The input scalar.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = s.
-
<static> {array} SpiderGL.Math.Vec4.sdiv(s, v)Component-wise division of a scalar by a 4-dimensional vector.
- Parameters:
- {number} s
- The denominator scalar.
- {array} v
- The numerator vector.
- Returns:
- {array} A new 4-dimensionals vector r, where r[i] = s / v[i].
-
<static> {array} SpiderGL.Math.Vec4.sdiv$(s, v)In-place component-wise division of a scalar by a 4-dimensional.
- Parameters:
- {number} s
- The scalar numerator.
- {array} v
- The denominator vector.
- Returns:
- {array} The input vector v, where v[i] = s / v[i].
-
<static> {array} SpiderGL.Math.Vec4.sin(v)Component-wise sine of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector, in radians.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.sin(v[i]).
-
<static> {number} SpiderGL.Math.Vec4.sqLength(v)Squared length of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {number} The squared length of v, same as the dot product of v with itself.
-
<static> {array} SpiderGL.Math.Vec4.sqrt(v)Component-wise square root of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.sqrt(v[i]).
-
<static> {array} SpiderGL.Math.Vec4.ssub(s, v)Component-wise subtraction of a scalar and a 4-dimensional.
- Parameters:
- {number} s
- The scalar subtraction operand.
- {array} v
- The vector subtraction operand.
- Returns:
- {array} A new 4-dimensionals vector r, where r[i] = s - v[i].
-
<static> {array} SpiderGL.Math.Vec4.ssub$(s, v)In-place component-wise subtraction of a scalar and a 4-dimensional vector.
- Parameters:
- {number} s
- The scalar subtraction operand
- {array} v
- The vector subtraction operand.
- Returns:
- {array} The input vector v, where v[i] = s - v[i].
-
<static> {array} SpiderGL.Math.Vec4.sub(u, v)Component-wise subtraction of two 4-dimensional vectors.
- Parameters:
- {array} u
- The first subtraction operand.
- {array} v
- The second subtraction operand.
- Returns:
- {array} A new 4-dimensionals vector r, where r[i] = u[i] - v[i].
-
<static> {array} SpiderGL.Math.Vec4.sub$(u, v)In-place component-wise subtraction of two 4-dimensional vectors.
- Parameters:
- {array} u
- The first addition operand.
- {array} v
- The second addition operand
- Returns:
- {array} The input vector u, where u[i] = u[i] - v[i].
-
<static> {array} SpiderGL.Math.Vec4.subs(v, s)Component-wise subtraction of a 4-dimensional vector and a scalar.
- Parameters:
- {array} v
- The vector subtraction operand.
- {number} s
- The scalar subtraction operand.
- Returns:
- {array} A new 4-dimensionals vector r, where r[i] = v[i] - s.
-
<static> {array} SpiderGL.Math.Vec4.subs$(v, s)In-place component-wise subtraction of a 4-dimensional vector and a scalar.
- Parameters:
- {array} v
- The vector subtraction operand.
- {number} s
- The scalar subtraction operand
- Returns:
- {array} The input vector v, where v[i] = v[i] - s.
-
<static> {array} SpiderGL.Math.Vec4.tan(v)Component-wise tangent root of a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector, in radians.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = SpiderGL.Math.tan(v[i]).
-
<static> {array} SpiderGL.Math.Vec4.to2(v)Creates a 2-dimensional vector from a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 2-dimensional array r equal to v with the 3rd and 4th components dropped.
-
<static> {array} SpiderGL.Math.Vec4.to3(v)Creates a 3-dimensional vector from a 4-dimensional vector.
- Parameters:
- {array} v
- The input vector.
- Returns:
- {array} A new 3-dimensional array r equal to v with the 4th component dropped.
-
<static> {array} SpiderGL.Math.Vec4.zero()Creates a 4-dimensional vector initialized with zero.
- Returns:
- {array} A new 4-dimensional array r, where r[i] = 0.


The toString() method converts a number to a string.
The toExponential() method returns a string, with the number rounded and written using exponential notation.
An optional parameter defines the number of digits behind the decimal point.
The toFixed() method rounds a number to a given number of digits.
For working with money, toFixed(2) is perfect.
The toPrecision() method returns a string, with a number written with a specified length:
The valueOf() method returns a number as a number:
The Number() method converts variables to numbers:
The Number() method can convert a date to a number as in milliseconds:
MAX_VALUE returns the largest possible number in JavaScript.


The official example template of creating a blog with Bootstrap.
This blog post shows a few different types of content that's supported and styled with Bootstrap. Basic typography, images, and code are all supported.


Sophmore Year in COSI
These are some major contributions of mine during my Sophmore year.
- Project Updates (Summer 2015 - Present)
Similar to Meeting Minutes, Project Updates is a site where updates to projects in COSI can be presented. The site runs using Jekyll, so the ease of pushing an post to the site is only a git push.
- COSI / ITL Linux Build (Summer 2015 - Present)
Before the 2015-2016 semester, I was given the role of maintaining the lab builds for the year. The ITL build was a standard Debian 8 build which was extremely similar to the previous year's build. The COSI build, though, was built on top of the ITL build and also included NFS support through the Kerberos authentication system set up by other lab members through the summer.
I am likely to be handing it off to someone else after the 2016-2017 year.
- Docs (August 2015 - Present)
During the summer I was interested in maintaining our documentation server which is running a mediawiki website. The previous maintainer handed it off to me. Over the year, I have been keeping up to date with new hardware and updates to existing infrastructure.
- CSLabs Webpage Updates (Fall 2015)
I gave a refresh to COSI's main website after feeling a bit outdated. It now is mobile friendly and has more present and up to date content.
- Talks (Fall 2015 - Present)
Talks is a web application that serves as a place for people to post talks or topics that they'll be presenting at our Wednesday meetings.
It was originally built using the python web framework Flask, but since has been rewritten as a NodeJS application.
- Navigation Header (November 2015 - Present)
I added a navigation bar to the top of most of our web services that allows for easy access to other COSI sites.
- Directorship (November 2015 - Present)
I was offered and accepted the role as a lab director. The position is mainly a point of contact between COSI and the rest of the campus as well as a mediator at meetings and resolver of conflicts in the labs.
- Dubsdot (Spring 2016 - Present)
Dubsdot was a rebirth of previous COSI webservers. The server is running as a VM on one of our VM Hosts, Bennu, and is currently hosting Fsuvius, Talks, and Print.
- Mirror Website (December 2015 - Present)
With the building of the new FOSS Mirror for COSI, I built a brand new website for it. The style is much more modern, and it also presents statistics on the network traffic since it launched in April 2016.


Search Apps on App Stores
Google Play
Search
iOS
Search
Export to CSV
GO to Bundle Id Finder
Bundle ID
URL
Delete


Implement the classic game of Tic Tac Toe on the Lightpad Block.
Launch the BLOCKS CODE application and open the script called TicTacToe.littlefoot
. You can find the script in the littlefoot/scripts/Example Scripts
folder. If you don't have the BLOCKS CODE IDE installed on your system, please refer to the section Getting started with BLOCKS CODE for help.
Let's start by defining global variables to save the current state of the game. To define global variables in LittleFoot simply place your variables outside any function declaration and at the top of the file for convenience. We first have 9 variables for the state of each cell in the grid, a currentTurn
variable for the current player's turn and a winner
variable to determine which player is the winner.
The initialise() function in the littlefoot language is useful to initialise variables and the state of your script as the function is called once when the program is loaded onto the device. Here we set all the cells to 0, a number chosen to define the blank state of a cell, the current turn to player 1 and the winner to 0, again a number chosen to define the ongoing state of the game.
In the repaint() function, we first clear the display as usual and check if a winner has been selected. If not, this means the game is still ongoing and we proceed to draw a grid and signs if there are any. Otherwise we draw the winner screen.
In order to draw the default grid, we have created a helper function called drawGrid() which is called in the previously defined repaint() function. We first define a variable to the colour white and proceed to draw a rectangle if the cell is still unoccupied.
This is performed on each cell using the helper function drawRect() defined below which takes as argument a colour, the coordinates and the size of the rectangle.
Notice here we use the built-in fillRect() function with either a width or height of 1 to draw lines for the four sides of the rectangle because we don't want the rectangle to be filled.
Now let's see how we can draw the player signs if any of the cells are occupied. The drawSigns() function called in the repaint() loop checks every cell using the evaluate() helper function defined after. It passes the cell variables along with the coordinates in case we need to draw the signs.
The evaluate() function below checks if the cell variable has been switched to a player index of 1 or 2 in which case we need to draw the corresponding player sign. If the cell variable is still set to 0 this means that the cell is still blank and we keep the white default square.
To draw player 1's "X" sign, we first define the player colour and draw each point in the two diagonals as follows:
To draw player 2's "O" sign, we first define the player colour and draw the four sides like so:
In its current implementation state, our script won't receive any touch events and therefore the game will stay in the blank state with a white grid showing. Let's implement the touchStart() callback to receive player moves.
In the above function, we first convert the device coordinates into LED grid coordinates by multiplying both x and y variables by 7. Device coordinates are defined using the number of DNA connectors on the side of the device so for example in the case of a Lightpad Block, the device has a size of 2x2 and therefore the device coordinates will range from 0.0 to 2.0 on each x and y dimensions. Multiplying this range by 7 gives us the LED grid coordinates ranging from 0 to 14 inclusive.
Now using these grid coordinates, we use the getIndex()
helper function defined below to retrieve the cell index ranging from 0 to 8 from our 3x3 game grid.
When the index is retrieved we attempt to set a cell variable value only if the touched cell is unoccupied. If a value has been successfully set for the current player, the function returns true and the currentTurn
variable is switched to the other player.
We were able to implement the basic gameplay but we don't have a mechanism to select a winner yet. As a last step to the touchStart() callback, we check if a winner has been selected by calling respectively the xHasWon()
and oHasWon()
helper functions defined as follows:
These in turn call the hasWon()
function with the player number which checks all 8 possible combination of winning lines (3 horizontal, 3 vertical and 2 diagonal).
If a winner is selected the repaint() function will call the drawWinner()
function defined below and fill the screen with the appropriate winner's colour:
As a final step we can implement a simple way to reset the game back to the beginning by calling the initialise() function ourselves when the side button of the device is pressed. This is achieved by implementing the handleButtonDown() callback function like this:
In this example, we learnt how to recreate the classic game of Tic Tac Toe on the Lightpad Block.