3.3. Comparing Algorithms (WORK IN PROGRESS)¶
3.3.1. Comparing Algorithms¶
<IP_ADDRESS>. Introduction¶
How do you compare two algorithms for solving some problem in terms of efficiency? We could implement both algorithms as computer programs and then run them on a suitable range of inputs, measuring how much of the resources in question each program uses. This approach is often unsatisfactory for four reasons. First, there is the effort involved in programming and testing two algorithms when at best you want to keep only one. Second, when empirically comparing two algorithms there is always the chance that one of the programs was “better written” than the other, and therefore the relative qualities of the underlying algorithms are not truly represented by their implementations. This can easily occur when the programmer has a bias regarding the algorithms. Third, the choice of empirical test cases might unfairly favor one algorithm. Fourth, you could find that even the better of the two algorithms does not fall within your resource budget. In that case you must begin the entire process again with yet another program implementing a new algorithm. But, how would you know if any algorithm can meet the resource budget? Perhaps the problem is simply too difficult for any implementation to be within budget.
These problems can often be avoided by using asymptotic analysis. Asymptotic analysis measures the efficiency of an algorithm, or its implementation as a program, as the input size becomes large. It is actually an estimating technique and does not tell us anything about the relative merits of two programs where one is always “slightly faster” than the other. However, asymptotic analysis has proved useful to computer scientists who must determine if a particular algorithm is worth considering for implementation.
The critical resource for a program is most often its running time. However, you cannot pay attention to running time alone. You must also be concerned with other factors such as the space required to run the program (both main memory and disk space). Typically you will analyze the time required for an algorithm (or the instantiation of an algorithm in the form of a program), and the space required for a data structure.
Many factors affect the running time of a program. Some relate to the environment in which the program is compiled and run. Such factors include the speed of the computer’s CPU, bus, and peripheral hardware. Competition with other users for the computer’s (or the network’s) resources can make a program slow to a crawl. The programming language and the quality of code generated by a particular compiler can have a significant effect. The “coding efficiency” of the programmer who converts the algorithm to a program can have a tremendous impact as well.
If you need to get a program working within time and space constraints on a particular computer, all of these factors can be relevant. Yet, none of these factors address the differences between two algorithms or data structures. To be fair, if you want to compare two programs derived from two algorithms for solving the same problem, they should both be compiled with the same compiler and run on the same computer under the same conditions. As much as possible, the same amount of care should be taken in the programming effort devoted to each program to make the implementations “equally efficient”. In this sense, all of the factors mentioned above should cancel out of the comparison because they apply to both algorithms equally.
If you truly wish to understand the running time of an algorithm, there are other factors that are more appropriate to consider than machine speed, programming language, compiler, and so forth. Ideally we would measure the running time of the algorithm under standard benchmark conditions. However, we have no way to calculate the running time reliably other than to run an implementation of the algorithm on some computer. The only alternative is to use some other measure as a surrogate for running time.
<IP_ADDRESS>. Basic Operations and Input Size¶
Of primary consideration when estimating an algorithm’s performance is the number of basic operations required by the algorithm to process an input of a certain size. The terms “basic operations” and “size” are both rather vague and depend on the algorithm being analyzed. Size is often the number of inputs processed. For example, when comparing sorting algorithms the size of the problem is typically measured by the number of records to be sorted. A basic operation must have the property that its time to complete does not depend on the particular values of its operands. Adding or comparing two integer variables are examples of basic operations in most programming languages. Summing the contents of an array containing \(n\) integers is not, because the cost depends on the value of \(n\) (i.e., the size of the input).
Example 3.4.1
Consider a simple algorithm to solve the problem of finding the largest value in an array of \(n\) integers. The algorithm looks at each integer in turn, saving the position of the largest value seen so far. This algorithm is called the largest-value sequential search and is illustrated by the following function:
# Return position of largest value in integer array A
def largest(A):
currlarge = 0 # Position of largest element seen
for i in range(1, A.length): # For each element
if A[currlarge] < A[i]: # if A[i] is larger
currlarge = i # remember its position
return currlarge # Return largest position
Here, the size of the problem is A.length
,
the number of integers stored in array A
.
The basic operation is to compare an integer’s value to that
of the largest value seen so far.
It is reasonable to assume that it takes a fixed amount of time to
do one such comparison, regardless of the value of the two
integers or their positions in the array.
Because the most important factor affecting running time is normally size of the input, for a given input size \(n\) we often express the time \(\mathbf{T}\) to run the algorithm as a function of \(n\), written as \(\mathbf{T}(n)\). We will always assume \(\mathbf{T}(n)\) is a non-negative value.
Let us call \(c\) the amount of time required to compare two
integers in function largest
.
We do not care right now what the precise value of \(c\) might
be.
Nor are we concerned with the time required to increment
variable \(i\) because this must be done for each value in the
array, or the time for the actual assignment when a larger value is
found, or the little bit of extra time taken to initialize
currlarge
.
We just want a reasonable approximation for the time taken to
execute the algorithm.
The total time to run largest
is therefore approximately
\(cn\), because we must make \(n\) comparisons,
with each comparison costing \(c\) time.
We say that function largest
(and by extension, the largest-value sequential search algorithm for
any typical implementation) has a running time expressed
by the equation
This equation describes the growth rate for the running time of the largest-value sequential search algorithm.
Example 3.4.2
The running time of a statement that assigns the first value of an integer array to a variable is simply the time required to copy the value of the first array value. We can assume this assignment takes a constant amount of time regardless of the value. Let us call \(c_1\) the amount of time necessary to copy an integer. No matter how large the array on a typical computer (given reasonable conditions for memory and array size), the time to copy the value from the first position of the array is always \(c_1\). Thus, the equation for this algorithm is simply
indicating that the size of the input \(n\) has no effect on the running time. This is called a constant running time.
Example 3.4.3
Consider the following code:
sum = 0;
for (i=1; i<=n; i++) {
for (j=1; j<=n; j++) {
sum++;
}
}
sum = 0
for i in range(n):
for j in range(n):
sum += 1
What is the running time for this code fragment?
Clearly it takes longer to run when \(n\) is larger.
The basic operation in this example is the
increment operation for variable sum
.
We can assume that incrementing takes constant time;
call this time \(c_2\).
(We can ignore the time required to initialize sum
,
and to increment the loop counters i
and j
.
In practice, these costs can safely be bundled into time
\(c_2\).)
The total number of increment operations is \(n^2\).
Thus, we say that the running time is
\(\mathbf{T}(n) = c_2 n^2\).
<IP_ADDRESS>. Growth Rates¶
The growth rate for an algorithm is the rate at which the cost of the algorithm grows as the size of its input grows. The following figure shows a graph for six equations, each meant to describe the running time for a particular program or algorithm. A variety of growth rates that are representative of typical algorithms are shown.
The two equations labeled \(10n\) and \(20n\) are graphed by straight lines. A growth rate of \(cn\) (for \(c\) any positive constant) is often referred to as a linear growth rate or running time. This means that as the value of \(n\) grows, the running time of the algorithm grows in the same proportion. Doubling the value of \(n\) roughly doubles the running time. An algorithm whose running-time equation has a highest-order term containing a factor of \(n^2\) is said to have a quadratic growth rate. In the figure, the line labeled \(2n^2\) represents a quadratic growth rate. The line labeled \(2^n\) represents an exponential growth rate. This name comes from the fact that \(n\) appears in the exponent. The line labeled \(n!\) also grows exponentially.
As you can see from the figure, the difference between an algorithm whose running time has cost \(\mathbf{T}(n) = 10n\) and another with cost \(\mathbf{T}(n) = 2n^2\) becomes tremendous as \(n\) grows. For \(n > 5\), the algorithm with running time \(\mathbf{T}(n) = 2n^2\) is already much slower. This is despite the fact that \(10n\) has a greater constant factor than \(2n^2\). Comparing the two curves marked \(20n\) and \(2n^2\) shows that changing the constant factor for one of the equations only shifts the point at which the two curves cross. For \(n>10\), the algorithm with cost \(\mathbf{T}(n) = 2n^2\) is slower than the algorithm with cost \(\mathbf{T}(n) = 20n\). This graph also shows that the equation \(\mathbf{T}(n) = 5 n \log n\) grows somewhat more quickly than both \(\mathbf{T}(n) = 10 n\) and \(\mathbf{T}(n) = 20 n\), but not nearly so quickly as the equation \(\mathbf{T}(n) = 2n^2\). For constants \(a, b > 1, n^a\) grows faster than either \(\log^b n\) or \(\log n^b\). Finally, algorithms with cost \(\mathbf{T}(n) = 2^n\) or \(\mathbf{T}(n) = n!\) are prohibitively expensive for even modest values of \(n\). Note that for constants \(a, b \geq 1, a^n\) grows faster than \(n^b\).
We can get some further insight into relative growth rates for various algorithms from the following table. Most of the growth rates that appear in typical algorithms are shown, along with some representative input sizes. Once again, we see that the growth rate has a tremendous effect on the resources consumed by an algorithm.
Table 3.4.1
Costs for representative growth rates.
3.3.2. Growth Rates Ordering Exercise¶
Todo
- type: AV
To make students more engaged in the GrowthRates exercise, we may need a tool that allows students to input two growth rate functions. Then the tool should plot the graph of both functions and mark their crossing point. The student also should be allowed to play with the constant values for both functions and see that this only changes the crossing point but doesn’t change which function grows faster than the other.


Congress, JD(S) have a tacit pact for bypolls: Ashok
by Special CorrespondentRevenue Minister R. Ashok on Friday alleged that there was a tacit understanding between the Congress and the Janata Dal (Secular) for the byelections in 15 Assembly constituencies scheduled for December 5.
Addressing a press conference in Bengaluru, Mr. Ashok maintained that the statements by Congress leader Siddaramaiah that his party would focus on 12 constituencies, and the indication by JD(S) leaders of concentrating on three seats had proved that both the parties had a tacit understanding.
Remarking that the JD(S) was in a state of disarray, he ridiculed the party saying it was trying to assume different political positions every day.
“One day it tries to become closer to the Congress and the next day, it tries to come closer to the BJP, and the third day, it tries to maintain neutrality. Instead of creating confusion among the people about the party’s political stand, JD(S) leaders should dissolve the party,” he said.


More time sought to file charge-sheet against alleged Maoist Danish
He is accused off attempt to indoctrinate tribal residents in Nedugal Combai
by Staff ReporterThe prosecution has sought 90 days extension of the deadline to file a charge-sheet against alleged Maoist Danish alias Krishnan, who faces charges of attempt to indoctrinate tribal residents in Nedugal Combai in the Nilgiris in August of 2016.
Danish, along with seven other suspects, is accused of crossing over from Kerala in 2016 and meeting the residents of the village, where the Maoists allegedly put up posters calling for the people to rise up against the government.
According to the Criminal Procedure Code, if the police fail to file a charge-sheet before the lapse of 90 days after charging the accused, then the person is eligible for bail.
Public prosecutor Bala Nandhakumar submitted a petition to the district judge P Vadamalai citing Section 43D(2)(b) of the Unlawful Activities Prevention Act, which stated that an extension for filing the charge-sheet can be sought for people charged under the law if the prosecution provides valid arguments for the delay in filing a charge-sheet.
Mr. Nandhakumar had contended that the investigation was yet to be completed in the case and the co-accused were yet to be arrested. The next hearing was posted for December 20.


from tensorflow import keras
from sklearn.model_selection import train_test_split
import numpy as np
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPool2D
from keras.optimizers import RMSprop
from keras.preprocessing.image import ImageDataGenerator
from keras.callbacks import ReduceLROnPlateau
Exercise: Convolutional Neural Networks¶
In the lectures, we have been introduced to a variety of neural network layers: 1) dense layers, 2) dropout layers, 3) convolutional layers and 4) pooling layers. With this set of layers, it is already possible to achieve new state-of-the-art performance i.e. \(\geq\) 99.7% accuracy on the MNIST dataset. In this exercise, we will walk through an example of a simple convolutional network with the main objective of familiarising oneself with a general machine learning workflow.
First let us load and prepare the data set. Notice that we have split the data into training, validation and testing sets. In addition, we have reshaped the images to include an additional dimension which is required for convolutional layers. Convolutional layers take as input images from one or more channels and output images to one or more channels. The additional dimension stores the information from these multiple channels.
(x_train, y_train),(x_test, y_test) = keras.datasets.mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
x_train = x_train.reshape(-1,28,28,1)
x_test = x_test.reshape(-1,28,28,1)
x_train, x_val, y_train, y_val = train_test_split(
x_train, y_train, test_size = 1/6, random_state=42)
print('x_train.shape =', x_train.shape)
print('y_train.shape =', y_train.shape)
print('x_val.shape =', x_val.shape)
print('y_val.shape =', y_val.shape)
print('x_test.shape =', x_test.shape)
print('y_test.shape =', y_test.shape)
Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz
11493376/11490434 [==============================] - 0s 0us/step
x_train.shape = (50000, 28, 28, 1)
y_train.shape = (50000,)
x_val.shape = (10000, 28, 28, 1)
y_val.shape = (10000,)
x_test.shape = (10000, 28, 28, 1)
y_test.shape = (10000,)
A simple convolutional network¶
In this first part, we simply want to try out a very simple convolutional neural network and compare its performance with a dense network with similar number of parameters.
def make_conv_model():
model = Sequential()
model.add(Conv2D(filters = 10, kernel_size = (5,5),padding = 'Same',
activation ='relu', input_shape = (28,28,1)))
model.add(Conv2D(filters = 10, kernel_size = (5,5),padding = 'Same',
activation ='relu'))
model.add(MaxPool2D(pool_size=(2,2)))
model.add(Flatten())
model.add(Dense(64, activation = "relu"))
model.add(Dropout(0.2))
model.add(Dense(10, activation = "softmax"))
optimizer = keras.optimizers.Adam()
model.compile(optimizer=optimizer,
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
return model
def make_dense_model():
model = Sequential()
model.add(Flatten(input_shape = (28,28,1)))
model.add(Dense(512, activation = "relu"))
model.add(Dropout(0.2))
model.add(Dense(256, activation = "relu"))
model.add(Dropout(0.2))
model.add(Dense(10, activation = "softmax"))
optimizer = keras.optimizers.Adam()
model.compile(optimizer=optimizer,
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
return model
simple_conv_model = make_conv_model()
dense_model = make_dense_model()
simple_conv_model.summary()
dense_model.summary()
Model: "sequential"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
conv2d (Conv2D) (None, 28, 28, 10) 260
_________________________________________________________________
conv2d_1 (Conv2D) (None, 28, 28, 10) 2510
_________________________________________________________________
max_pooling2d (MaxPooling2D) (None, 14, 14, 10) 0
_________________________________________________________________
flatten (Flatten) (None, 1960) 0
_________________________________________________________________
dense (Dense) (None, 64) 125504
_________________________________________________________________
dropout (Dropout) (None, 64) 0
_________________________________________________________________
dense_1 (Dense) (None, 10) 650
=================================================================
Total params: 128,924
Trainable params: 128,924
Non-trainable params: 0
_________________________________________________________________
Model: "sequential_1"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
flatten_1 (Flatten) (None, 784) 0
_________________________________________________________________
dense_2 (Dense) (None, 512) 401920
_________________________________________________________________
dropout_1 (Dropout) (None, 512) 0
_________________________________________________________________
dense_3 (Dense) (None, 256) 131328
_________________________________________________________________
dropout_2 (Dropout) (None, 256) 0
_________________________________________________________________
dense_4 (Dense) (None, 10) 2570
=================================================================
Total params: 535,818
Trainable params: 535,818
Non-trainable params: 0
_________________________________________________________________
Now let us train the models and compare its validation and test accuracies.
epochs = 40
batch_size = 86
simple_conv_history = simple_conv_model.fit(x_train, y_train, batch_size=batch_size, epochs=epochs, validation_data=(x_val, y_val), verbose=0)
dense_history = dense_model.fit(x_train, y_train, batch_size=batch_size, epochs=epochs, validation_data=(x_val, y_val),verbose=0)
Having trained the models, we can now evaluate and plot the accuracies on the validation and training sets.
simple_conv_test_loss, simple_conv_test_acc = simple_conv_model.evaluate(x_test, y_test)
dense_test_loss, dense_test_acc = dense_model.evaluate(x_test, y_test)
plt.plot(dense_history.history["accuracy"], "b--",label="dense training accuracy")
plt.plot(dense_history.history["val_accuracy"], "b-",label="dense val accuracy")
plt.axhline(dense_test_acc, color="k", linestyle=":", label="dense test accuracy")
plt.plot(simple_conv_history.history["accuracy"], "g--",label="simple conv training accuracy")
plt.plot(simple_conv_history.history["val_accuracy"], "g-",label="simple conv val accuracy")
plt.axhline(simple_conv_test_acc,color="k", linestyle="--", label="simple conv test accuracy")
plt.xlabel("epochs")
plt.ylabel("accuracy")
plt.ylim(0.94, 1.005)
plt.legend()
313/313 [==============================] - 1s 2ms/step - loss: 0.0432 - accuracy: 0.9907
313/313 [==============================] - 1s 2ms/step - loss: 0.1149 - accuracy: 0.9806
We do indeed see that the validation accuracies are an extremely good approximation of the test accuracies as one would expect if the datasets were split randomly and each set still contains sufficient number of samples. However, in practice, if we were selecting hyperparameters based on the validation data, the accuracies would then be biased towards the validation set and then the true generalisation accuracy of the model should then be evaluated using the testing set. On the hand, we do see that models are overfitted since the training accuracies are exceeding the validation and test accuracies significantly.
On a separate note, we do see that the convolutional layers do improve the performance substantially despite having similar number of parameters. This is particular to this problem since image classification are often insensitive towards translations which are well handled by convolutional layers.
Data Augmentation¶
It is obvious that with more data, we would be able to achieve better performances. One reason for this is that with more data, the problem of overfitting is reduced. Hence, there have been many elaborate schemes for expanding a dataset. For image classification tasks such as here, a common approach is simply to augment the data with small translations and rotations of the original data samples. This works for our case because we know that even if a digit is rotated and translated, the classification of that digit would not change. This can be done easily using the following function from keras.
datagen = ImageDataGenerator(
featurewise_center=False, # set input mean to 0 over the dataset
samplewise_center=False, # set each sample mean to 0
featurewise_std_normalization=False, # divide inputs by std of the dataset
samplewise_std_normalization=False, # divide each input by its std
zca_whitening=False, # apply ZCA whitening
rotation_range=10, # randomly rotate images in the range (degrees)
zoom_range = 0.1, # Randomly zoom image
width_shift_range=0.1, # randomly shift images horizontally
height_shift_range=0.1, # randomly shift images vertically
horizontal_flip=False, # randomly flip images
vertical_flip=False) # randomly flip images
datagen.fit(x_train.reshape(-1,28,28,1))
simple_conv_model = make_conv_model()
epochs = 40
batch_size = 86
simple_conv_aug_history = simple_conv_model.fit(
datagen.flow(x_train,y_train, batch_size=batch_size),
epochs = epochs, validation_data = (x_val,y_val),
steps_per_epoch=x_train.shape[0]//batch_size, verbose=0)
Now lets reevaluate our test and validation accuracies.
simple_conv_aug_test_loss, simple_conv_aug_test_acc = simple_conv_model.evaluate(x_test, y_test)
plt.plot(simple_conv_aug_history.history["accuracy"], "g--",label="simple conv aug training accuracy")
plt.plot(simple_conv_aug_history.history["val_accuracy"], "g-",label="simple conv aug val accuracy")
plt.axhline(simple_conv_aug_test_acc,color="k", linestyle="--", label="simple conv aug test accuracy")
plt.axhline(simple_conv_test_acc,color="r", linestyle="--", label="simple conv test accuracy")
plt.xlabel("epochs")
plt.ylabel("accuracy")
plt.ylim(0.94, 1.005)
plt.legend()
313/313 [==============================] - 1s 2ms/step - loss: 0.0209 - accuracy: 0.9937
With the data set augmentation, we do indeed see some improvement in the final test or generalisation accuracy. Notice also that the training accuracy is now below the validation and test accuracy. This is because in each epoch, new data samples are generated via translations and rotations such that it is extremely difficult for the model to overfit.
Learning rate reduction¶
To further improve accuracies, it can sometimes be helpful to reduce the learning as one approach convergence. There are many different scheme to achieve this. A common method is to monitor a certain metric, for instance the validation accuracy, and to reduce the learning rate when the chosen metric is not improving for a certain number of epochs. Here, we monitor the validation accuracy and reduce the learning rate by half when the accuracy is not improving after 3 epochs.
learning_rate_reduction = ReduceLROnPlateau(monitor='val_accuracy',
patience=3,
verbose=1,
factor=0.5,
min_lr=0.00001)
epochs = 30
batch_size = 86
simple_conv_model = make_conv_model()
simple_conv_aug_lr_history = simple_conv_model.fit(
datagen.flow(x_train,y_train, batch_size=batch_size),
epochs = epochs, validation_data = (x_val,y_val),
steps_per_epoch=x_train.shape[0]//batch_size,
callbacks=[learning_rate_reduction],
verbose=0)
Epoch 00013: ReduceLROnPlateau reducing learning rate to 0.0005000000237487257.
Epoch 00022: ReduceLROnPlateau reducing learning rate to 0.0002500000118743628.
Epoch 00025: ReduceLROnPlateau reducing learning rate to 0.0001250000059371814.
simple_conv_aug_lr_test_loss, simple_conv_aug_lr_test_acc = simple_conv_model.evaluate(x_test, y_test)
plt.plot(simple_conv_aug_lr_history.history["accuracy"], "g:",label="simple conv aug lr training accuracy")
plt.plot(simple_conv_aug_lr_history.history["val_accuracy"], "g-",label="simple conv aug lr val accuracy")
plt.axhline(simple_conv_aug_lr_test_acc,color="k", linestyle="--", label="simple conv aug lr test accuracy")
plt.axhline(simple_conv_aug_test_acc,color="g", linestyle="--", label="simple conv aug test accuracy")
plt.axhline(simple_conv_test_acc,color="r", linestyle="--", label="simple conv test accuracy")
plt.xlabel("epochs")
plt.ylabel("accuracy")
plt.ylim(0.94, 1.005)
plt.legend()
313/313 [==============================] - 1s 2ms/step - loss: 0.0180 - accuracy: 0.9944
Committee Machine¶
Finally, a possible way to improve the accuracy is simply to train multiple models and then to average the output from the various models. This is a form of committee machine known as ensemble averaging. The functional api of keras provides a very simple way to average across multiple models. This might take a while so it would be helpful to run it on google colab or some other external servers.
# Create an ensemble of models
models = [make_conv_model() for i in range(5)]
epochs = 30
batch_size = 86
# Fit the model
history = [model.fit(datagen.flow(x_train,y_train, batch_size=batch_size),
epochs = epochs, validation_data = (x_val,y_val),
steps_per_epoch=x_train.shape[0]//batch_size,
callbacks=[learning_rate_reduction], verbose=0
) for model in models]
for i, model in enumerate(models):
print("model", i, "loss and accuracy:", model.evaluate(x_test, y_test))
Epoch 00009: ReduceLROnPlateau reducing learning rate to 0.0005000000237487257.
Epoch 00013: ReduceLROnPlateau reducing learning rate to 0.0002500000118743628.
Epoch 00022: ReduceLROnPlateau reducing learning rate to 0.0001250000059371814.
Epoch 00025: ReduceLROnPlateau reducing learning rate to 6.25000029685907e-05.
Epoch 00028: ReduceLROnPlateau reducing learning rate to 3.125000148429535e-05.
Epoch 00014: ReduceLROnPlateau reducing learning rate to 0.0005000000237487257.
Epoch 00020: ReduceLROnPlateau reducing learning rate to 0.0002500000118743628.
Epoch 00024: ReduceLROnPlateau reducing learning rate to 0.0001250000059371814.
Epoch 00018: ReduceLROnPlateau reducing learning rate to 0.0005000000237487257.
Epoch 00027: ReduceLROnPlateau reducing learning rate to 0.0002500000118743628.
Epoch 00009: ReduceLROnPlateau reducing learning rate to 0.0005000000237487257.
Epoch 00018: ReduceLROnPlateau reducing learning rate to 0.0002500000118743628.
Epoch 00028: ReduceLROnPlateau reducing learning rate to 0.0001250000059371814.
Epoch 00014: ReduceLROnPlateau reducing learning rate to 0.0005000000237487257.
Epoch 00022: ReduceLROnPlateau reducing learning rate to 0.0002500000118743628.
Epoch 00026: ReduceLROnPlateau reducing learning rate to 0.0001250000059371814.
313/313 [==============================] - 1s 2ms/step - loss: 0.0195 - accuracy: 0.9932
model 0 loss and accuracy: [0.01947448030114174, 0.9932000041007996]
313/313 [==============================] - 1s 2ms/step - loss: 0.0182 - accuracy: 0.9938
model 1 loss and accuracy: [0.01823325641453266, 0.9937999844551086]
313/313 [==============================] - 1s 2ms/step - loss: 0.0192 - accuracy: 0.9935
model 2 loss and accuracy: [0.01915612816810608, 0.9934999942779541]
313/313 [==============================] - 1s 2ms/step - loss: 0.0197 - accuracy: 0.9938
model 3 loss and accuracy: [0.019724765792489052, 0.9937999844551086]
313/313 [==============================] - 1s 2ms/step - loss: 0.0212 - accuracy: 0.9930
model 4 loss and accuracy: [0.02119877189397812, 0.9929999709129333]
Now we can average across the models and evaluate the ensemble average as follows:
x = keras.layers.Input(shape=(28,28,1))
yi = [model(x) for model in models]
y = keras.layers.Average()(yi)
Committee = keras.models.Model(inputs=x, outputs=y)
Committee.compile(optimizer=keras.optimizers.Adam(),
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
committee_conv_loss, committee_conv_acc = Committee.evaluate(x_test,y_test)
313/313 [==============================] - 1s 3ms/step - loss: 0.0145 - accuracy: 0.9950
Comparing with the accuracy of the individual models, we do see an increase in the performance over each individual model.
State-of-the-art performance¶
Now lets see if we can push the accuracy of our models close to the state-of-the-art performance of about 99.7%. We shall use all the techniques so far, except that we would use a larger convolutional model with more layers.
def make_deep_conv_model():
model = Sequential()
model.add(Conv2D(filters = 32, kernel_size = (5,5),padding = 'Same',
activation ='relu', input_shape = (28,28,1)))
model.add(Conv2D(filters = 32, kernel_size = (5,5),padding = 'Same',
activation ='relu'))
model.add(MaxPool2D(pool_size=(2,2)))
model.add(Dropout(0.25))
model.add(Conv2D(filters = 64, kernel_size = (3,3),padding = 'Same',
activation ='relu'))
model.add(Conv2D(filters = 64, kernel_size = (3,3),padding = 'Same',
activation ='relu'))
model.add(MaxPool2D(pool_size=(2,2), strides=(2,2)))
model.add(Flatten())
model.add(Dense(256, activation = "relu"))
model.add(Dropout(0.2))
model.add(Dense(10, activation = "softmax"))
# optimizer = RMSprop(lr=0.001, rho=0.9, epsilon=1e-08, decay=0.0)
optimizer = keras.optimizers.Adam()
model.compile(optimizer=optimizer,
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
return model
# Create an ensemble of models
deep_models = [make_deep_conv_model() for i in range(5)]
epochs = 30
batch_size = 86
# Fit the model
history = [model.fit(datagen.flow(x_train,y_train, batch_size=batch_size),
epochs = epochs, validation_data = (x_val,y_val),
steps_per_epoch=x_train.shape[0]//batch_size,
callbacks=[learning_rate_reduction], verbose=0
) for model in deep_models]
for i, model in enumerate(deep_models):
print("model", i, "loss and accuracy:", model.evaluate(x_test, y_test))
x = keras.layers.Input(shape=(28,28,1))
yi = [model(x) for model in deep_models]
y = keras.layers.Average()(yi)
deep_Committee = keras.models.Model(inputs=x, outputs=y)
deep_Committee.compile(optimizer=keras.optimizers.Adam(),
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
deep_committee_conv_loss, deep_committee_conv_acc = deep_Committee.evaluate(x_test,y_test)
Epoch 00019: ReduceLROnPlateau reducing learning rate to 0.0005000000237487257.
Epoch 00025: ReduceLROnPlateau reducing learning rate to 0.0002500000118743628.
Epoch 00029: ReduceLROnPlateau reducing learning rate to 0.0001250000059371814.
Epoch 00010: ReduceLROnPlateau reducing learning rate to 0.0005000000237487257.
Epoch 00017: ReduceLROnPlateau reducing learning rate to 0.0002500000118743628.
Epoch 00020: ReduceLROnPlateau reducing learning rate to 0.0001250000059371814.
Epoch 00027: ReduceLROnPlateau reducing learning rate to 6.25000029685907e-05.
Epoch 00030: ReduceLROnPlateau reducing learning rate to 3.125000148429535e-05.
Epoch 00008: ReduceLROnPlateau reducing learning rate to 0.0005000000237487257.
Epoch 00014: ReduceLROnPlateau reducing learning rate to 0.0002500000118743628.
Epoch 00019: ReduceLROnPlateau reducing learning rate to 0.0001250000059371814.
Epoch 00025: ReduceLROnPlateau reducing learning rate to 6.25000029685907e-05.
Epoch 00028: ReduceLROnPlateau reducing learning rate to 3.125000148429535e-05.
Epoch 00015: ReduceLROnPlateau reducing learning rate to 0.0005000000237487257.
Epoch 00022: ReduceLROnPlateau reducing learning rate to 0.0002500000118743628.
Epoch 00026: ReduceLROnPlateau reducing learning rate to 0.0001250000059371814.
Epoch 00029: ReduceLROnPlateau reducing learning rate to 6.25000029685907e-05.
Epoch 00010: ReduceLROnPlateau reducing learning rate to 0.0005000000237487257.
Epoch 00014: ReduceLROnPlateau reducing learning rate to 0.0002500000118743628.
Epoch 00023: ReduceLROnPlateau reducing learning rate to 0.0001250000059371814.
Epoch 00026: ReduceLROnPlateau reducing learning rate to 6.25000029685907e-05.
Epoch 00029: ReduceLROnPlateau reducing learning rate to 3.125000148429535e-05.
313/313 [==============================] - 1s 2ms/step - loss: 0.0117 - accuracy: 0.9957
model 0 loss and accuracy: [0.011735166423022747, 0.9957000017166138]
313/313 [==============================] - 1s 2ms/step - loss: 0.0094 - accuracy: 0.9966
model 1 loss and accuracy: [0.009402372874319553, 0.9965999722480774]
313/313 [==============================] - 1s 2ms/step - loss: 0.0091 - accuracy: 0.9971
model 2 loss and accuracy: [0.009083079174160957, 0.9970999956130981]
313/313 [==============================] - 1s 3ms/step - loss: 0.0121 - accuracy: 0.9962
model 3 loss and accuracy: [0.012146216817200184, 0.9962000250816345]
313/313 [==============================] - 1s 3ms/step - loss: 0.0111 - accuracy: 0.9971
model 4 loss and accuracy: [0.01112508587539196, 0.9970999956130981]
313/313 [==============================] - 2s 5ms/step - loss: 0.0076 - accuracy: 0.9974
x = keras.layers.Input(shape=(28,28,1))
yi = [model(x) for model in deep_models]
y = keras.layers.Average()(yi)
deep_Committee = keras.models.Model(inputs=x, outputs=y)
deep_Committee.compile(optimizer=keras.optimizers.Adam(),
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
deep_committee_conv_loss, deep_committee_conv_acc = deep_Committee.evaluate(x_test,y_test)
313/313 [==============================] - 2s 5ms/step - loss: 0.0076 - accuracy: 0.9974
We get quite close to the state of the art performance (check https://en.wikipedia.org/wiki/MNIST_database). The question is how much further can one go. Is it possible to get 100% accuracy? Actually it should not be possible, because some samples in the dataset might be wrongly labelled or is completely unreadable even for a human. Lets look at some of the misclassified samples in the testing set.
predictions = np.argmax(deep_Committee.predict(x_test), axis=1)
misclassified_samples = np.where(predictions != y_test)[0]
print("number of misclassified samples =", misclassified_samples.shape[0])
plt.figure(figsize=(8,8))
for i, s in enumerate(misclassified_samples):
plt.subplot(6,5,i+1)
plt.xticks([])
plt.yticks([])
plt.grid(False)
plt.imshow(x_test[s][:,:,0], cmap=plt.cm.binary)
plt.xlabel(str(y_test[s]), color='blue', fontsize=20)
plt.ylabel(str(predictions[s]), color='red', fontsize=20, rotation=0)
plt.tight_layout()
number of misclassified samples = 26
In the above plot, we have shown the true prediction in blue and the network prediction in red. Inspecting some of the figures, we might actually agree with the network prediction on some occassions.


{% extends 'base.html' %} {% block page_content %}
{{ _('Your account has been suspended by the manager.') }} {{ _('For more details please contact the management team.') }}


Try out our Premium Member services: Virtual Legal Assistant, Query Alert Service and an ad-free experience. Free for one month and pay only if you like it.
23 02.07.10 W.P. 13583 (W) of 2010 2 Mr. S. C. Hazra, Ms. Sima Ghosh. ... For the Petitioner. Mr. Kallol Basu. ... For WBPCB. The petitioner has filed this petition relating to the subject-matter in which this Court had already on earlier occasion disposed of the petition, i.e. W.P. No. 23356 (W) of 2009 by order dated 29th January, 2010 directing the petitioner to file an appeal under Section 31 of the Air (Prevention and Control of Operation) Act, 1981. It appears that the petitioner has not resorted to the alternative remedy available to him. We are, therefore, not inclined to entertain this petition. Accordingly we dismiss this writ petition with liberty to the petitioner to seek alternative remedy in accordance with law, if so advised. (J.N.PATEL,CHIEF JUSTICE)
(BHASKAR BHATTACHARYA, J.)


Built on top of the DOM4J package, gives DOM4J built-in support for CSS style
sheets. You can use the XHTMLDocumentFactory
as you would use a
DOMDocumentFactory
, and the produced documents (and elements) will
be style-aware.
To use the library with dom4j (using dom4j-like documents, elements and factory) you need the css4j-dom4j
module in addition to the core
module. The -dom4j module optionally depends on the -agent module, you do not need it unless you plan to use the DOM4J agent.
This is the easiest way to use this package with DOM4J, using that library's SAXReader
:
Reader re = ... [reader for XHTML document] InputSource source = new InputSource(re); SAXReader reader = new SAXReader(XHTMLDocumentFactory.getInstance()); reader.setEntityResolver(new DefaultEntityResolver()); XHTMLDocument document = (XHTMLDocument) reader.read(source);
And once you got the element you want the computed style for (see, for example,
the DOM4J Quick Start Guide),
just get it with a procedure analogous to the
ViewCSS
interface:
CSSComputedProperties style = ((CSSStylableElement) element).getComputedStyle(null); String display = style.getPropertyValue("display");
It is also possible to parse an HTML5 document into a css4j-dom4j tree with the validator.nu HTML5 parser:
XHTMLDocumentFactory factory = XHTMLDocumentFactory.getInstance(); // Next line is optional: default is TRUE, and is probably what you want // factory.setLenientSystemValues(false); HtmlDocumentBuilder builder = new HtmlDocumentBuilder(factory); // We do not set the EntityResolver, the HtmlDocumentBuilder does not need it Reader re = ... [reader for HTML document] InputSource source = new InputSource(re); XHTMLDocument document = (XHTMLDocument) builder.parse(source);
Or use a SAX parser to parse an XML document into a css4j-dom4j tree, with
XMLDocumentBuilder
instead of dom4j's SAXReader
:
XHTMLDocumentFactory factory = XHTMLDocumentFactory.getInstance(); // Next line is optional: default is TRUE, and is probably what you want // factory.setLenientSystemValues(false); XMLDocumentBuilder builder = new XMLDocumentBuilder(factory); builder.setEntityResolver(new DefaultEntityResolver()); Reader re = ... [reader for XML document] InputSource source = new InputSource(re); XHTMLDocument document = (XHTMLDocument) builder.parse(source); re.close();
The code above uses the default JAXP SAX parser. You could use a different SAXParserFactory
:
SAXParserFactory parserFactory = ... XMLDocumentBuilder builder = new XMLDocumentBuilder(factory, parserFactory);
To set the user agent sheet, first obtain an instance of the factory that you are using:
XHTMLDocumentFactory docFactory = XHTMLDocumentFactory.getInstance();
If css4j's default HTML5 UA sheet is appropriate for you, just do:
docFactory.getStyleSheetFactory().setDefaultHTMLUserAgentSheet();
But if you want to set your own UA sheet, first obtain a reference to it:
BaseCSSStyleSheet sheet = docFactory.getStyleSheetFactory().getUserAgentStyleSheet(CSSDocument.ComplianceMode.STRICT);
This is assuming the STRICT
mode, i.e. that you use a DOCTYPE
,
otherwise use QUIRKS
.
If the UA sheet already contains rules (it is empty by default), clean it:
sheet.getCssRules().clear();
And now load the new sheet:
sheet.parseStyleSheet(reader, CSSStyleSheet.COMMENTS_IGNORE);


A well-conceived approach
Get Started Quickly
The whole project is open source and can be downloaded from GitHub. This includes the source code as well as the vocabulary.
A Solid Basis
Our system is based on OntoWiki, an industry-established tool providing support for agile, distributed knowledge engineering scenarios.
Extensible
amsl already includes several extensions that improve or add functionality. See the complete list here.
Modern Technologies
To simplify workflows amsl has been extended with modern technologies like real-time search and various import tools.


CindyJS: Advanced Julia Feedbackloop
O(1) per frame. Encode intermediate results in texture; requires float textures.


--- layout: newsstory title: A CLEAN SHEET AT LEAST match: Yeltz 0 Worcester 0 ---
The first point under John Chambers was gained in a 0-0 draw against local rivals Worcester at The Grove. I guess we should celebrate a second clean sheet in a row, but three points would have been nice the way we're gradually slipping down the table.


To download the Excel and JSON files to use, please choose a filter type.
Choosing "Area" will let you see which workers entered to this area. Choosing
"Personnel" will let you see where did this worker have been, it will also
show you if they were on a leave. After choosing this, you can specify the
dates and choose the area or personnel belonging to your company.


THE LAST OF THE MOHICANS A film review by Ellen Eades Copyright 1992 Ellen Eades
THE LAST OF THE MOHICANS was originally a novel by the execrable James Fenimore Cooper (and was pilloried by Mark Twain in an unforgettable essay titled "The Further Literary Offenses of James Fenimore Cooper," in which he sharpens his sword of wit and his pen of editing to razor's edges and has a great deal of fun). This new screenplay, based on the original 1936 screen-play, has been updated for modern audiences considerably. In my opinion, it's a huge improvement.
I was never able to plow through Cooper's novels as a child. I was riveted by the movie. The cinematography alone is worth the full price of admission; sweeping views of mist-covered rolling mountains, roaring rapids, rocky pinnacles and virgin forest are the backdrop for an impressively romantic storyline. Far less grim and sophisticated than BLACK ROBE, THE LAST OF THE MOHICANS manages to cloak its absurdities in a reasonably historic style, where even villains have reasons and heroes are capable of demi-godlike achievements of strength, endurance and spirit.
Daniel Day-Lewis stars as Nathaniel (Hawkeye in the novel), a white orphan raised by the Mohawk, Chingachgook, alongside his own son. This trio seems as much a part of the Atlantic forests as the deer and the cougar. Also starring is Madeleine Stowe as Cora Munro, the daughter of the British general commanding Fort William Henry. Several other supporting roles are very well done, among them Alice Munro, Cora's sister; Major Duncan, Cora's suitor; and Chingachgook's Indian son. A special mention goes to the villain of the piece, Magua, a Huron Indian who allies his war-party with the French general besieging Fort William Henry to revenge himself on General Munro and his colonial and Mohawk allies. Far from being wholly evil, as in the novel, Magua by the end of the movie is still brutal, vicious, and vengeful, but managed to evoke not a little sympathy from me.
Daniel Day-Lewis never fails to impress me, whether in MY BEAUTIFUL LAUNDRETTE, MY LEFT FOOT, or THE LAST OF THE MOHICANS. The man is simply splendid, bringing a nobility to the character of Nathaniel which even a jaded modern cannot fail to find humbling. As Cora, Madeleine Stowe manages to find a balance between strength, spirit, and the need to make her character a believable woman of the 1700s. But the true strength of the movie is in the camera's eye and the magnificent backdrop (filmed mainly in North Carolina's Chimney Rock State Park, but beautifully evoking the Green Mountains of Vermont), against which the heroic characters almost pale.
Anyone with an interest in period films must see this movie; anyone who admires native American history, early colonial history, or simply loves the forests of the Atlantic seaboard, should go see this on the big screen. Pay what you need to.
.
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


--- layout: post-index description: index page --- {% for post in paginator.posts %}
{{ post.description }}


in "nomal" raw tx scriptPubKey:
0x19 = OP_DUP
0x76 = OP_HASH160
0x88 = OP_EQUALVERIFY
0xac = OP_CHECKSIG
in "pubkey" raw tx (in the same location as OP_DUP OP_HASH160 "would be"):
0x23 = ?
0x21 = ?
I can't seem to find this documented anywhere (but it's not the most search-friendly set of terms, anyway)


Stuff
archived activities of
Danny Ayers
Sketch
Links - nearby
Link
Link
Link
Link
Links - elsewhere
Link
Link
Link
Link


Louisville Community Bail Fund Thank you so much! To learn more and to share our manifesto, please take a look here and share: http://bit.ly/LCBFManifesto To build transformative communities, we must perform transformative acts of liberation. Cash bail is one of the aspects of the cri...
Support Reclaim the Block By donating, you will support Reclaim the Block's work to make sure that our communities have the resources they need to thrive. Our grassroots group is up against the deep pockets of the Minneapolis police union, and we need your support.
Oracle.EntityFrameworkCore 3.19.0-beta1 Oracle Data Provider for .NET (ODP.NET) Entity Framework Core for Oracle Database.
Beta Release: Oracle Entity Framework Core 3.1 I’m happy to announce the release of Oracle Entity Framework Core (EF Core) 3.19.0 beta on NuGet Gallery. This beta supports the new…
Summary of the role of MDbg and Cordbg I want to summarize in one place our views on Mdbg and Cordbg, and our plans for their future.
How does the Gmail unsubscribe button work? How exactly does the Gmail unsubscribe button work and how can you make sure it always shows for your mailing-list emails?
Things we learned about sums · QuestDB In the world of databases, benchmarking performance has always been the hottest
An Introduction to Apache Airflow Airflow is a platform created by the community to programmatically author, schedule, and monitor workflows. In this blog we will underestand the basics of airflow
Cloud Native Apps with .NET and AKS | BOD105 Learn latest features and support for building enterprise-grade solutions with C#, .NET Core and Azure Kubernetes Service. See how we make .NET the most productive platform for building microservices. Microsoft Learn -- https://docs.microsoft.com/learn/?...
Campaign Zero The comprehensive platform of research-based policy solutions to end police brutality in America.
CNN reporter arrested live on air while covering Minneapolis protests A CNN reporter and crew have been arrested live on air while covering the Minneapolis protests over the killing of George Floyd. Black correspondent Omar Jimenez had just shown a protester being arrested when about half a dozen white police officers surr...
Scaling up Anime with Machine Learning and Smart Real Time Algorithms Authored By Chris Kennedy, Nick Fujita & Michael Dale
Minnesota Freedom Fund Every dollar of financial donations to Minnesota Freedom Fund helps us help free people. Support us — and them — today by making a one-time gift or setting up a recurring donation.
Git Made Fetch Happen Do you remember Regina George telling Gretchen Wieners to "Stop trying to make fetch happen, it's not gonna happen!"? Looks like Regina was wrong! Let's thank `git` for making `fetch` finally happen! Details Pre-shrunk to make sure your size is maintain...
I wrote a SaaS product because the internet made me believe it'd make me rich In May of 2018 I decided I wanted to launch a SaaS product. There was only one problem. I'd never worked on, built, designed or even coded a fully fledged web app or SaaS product. y thoSaaS was to be the holy grail. A magic money machine that you creat...
Exclusive: AFL fans have phone numbers, passwords, private chats exposed in mass data breach A large data leak from an AFL fan website has exposed more than 70 million records online, including privat...
Language Models are Few-Shot Learners Recent work has demonstrated substantial gains on many NLP tasks and benchmarks by pre-training on a large corpus of text followed by fine-tuning on a specific task. While typically task-agnostic in architecture, this method still requires task-specific f...
DavidWengier - Hacking away at Roslyn stuff for Comet - Twitch Twitch is the world's leading video platform and community for gamers.
Weekly Update 193 First time back in a restaurant! Wandering down my local dining area during the week, I was rather excited to see a cafe that wasn't just open, but actually had spare seating. Being limited to only 10 patrons at present, demand is well in excess of supply...
StreamElements - The Ultimate Live Streaming Platform StreamElements is the leading platform for live streamers on Twitch and Youtube. StreamElements includes Overlay management, ChatBot, Tipping, Alerts & Loyalty
Learn with Visual Studio Remote Office Hours | Visual Studio Blog A new live broadcast directly from the Visual Studio team (my garage to be exact) is now streaming near you every Thursday morning. It’s about everything Visual Studio and you get rare insights into the inner workings of features, processes, and the peopl...
Patterns for Managing Source Code Branches Mainline, Feature Branching, Continuous Integration, Release Branch and a clutch of other handy patterns.
A Guide to Threat Modelling for Developers Threat modelling is a risk based approach to cyber security requirements analysis.
Developing on Docker with the new and improved Visual Studio Container Tools (and WSL2) I've been spending a lot of time with Docker lately. Docker Desktop on Windows is great and getting better every day. ...
Dark Patterns—What Not to Do to Your Users Dark patterns manipulate or trick users, rather than help them. It's easy to try and trick your users with your UI, but don't—it only breeds distrust.
Don't Code Tired | Conditional HTML Rendering with Microsoft Feature Flags (Microsoft.FeatureManagement) Don't Code Tired - Jason Roberts on Software Development and .NET -
Write high-quality TypeScript code - .NET Tools Blog TypeScript has become a popular language, for use on both the client and server. In this blog post, you’ll learn some basics about writing TypeScript, and how Rider can make TypeScript enjoyable. TypeScript overview TypeScript is a superset of JavaScript ...
Why use Azure Functions for ML inference ? This article highlights the current limitations in offerings by FaaS providers for ML inference applications and how capabilities in Azure Functions overcome these making it an ideal platform for such applications. It also links to an end to end sample il...
Continuous integration workflow template for .NET Core desktop apps with GitHub Actions | .NET Blog Learn how to use a starter workflow in GitHub to help you set up and showcase DevOps for your .NET Core desktop apps using GitHub Actions.
How does ASP.NET Core processes a request? - Code Rethinked In this post, we will see how ASP.NET Core processes a request from start to finish. We will also understand the importance of having a reverse proxy
API versioning in ASP.NET Core Describing the most common API versioning methods using Microsoft.AspNetCore.Mvc.Versioning package functionality
Putting Mix, Silverlight, the CoreCLR and the DLR into context Updated: I got some feedback from some MSFTies and this is an updated ecosystem diagram. For reference, here's the ...
Idea Generation The most common question prospective startup founders ask is how to get ideas for startups. The second most common question is if you have any ideas for their startup. But giving founders an idea...
r/techsupport - I wrote Task Manager and I just remembered something... 10,154 votes and 274 comments so far on Reddit
r/dotnet - Is dotnet completely free for commercial usage ? 44 votes and 79 comments so far on Reddit
Tools for better thinking Collection of thinking tools and frameworks to help you solve problems, make decisions and understand systems.

TechEmpower Web Framework Performance Comparison Performance comparison of a wide spectrum of web application frameworks and platforms using community-contributed test implementations.
Where Did Software Go Wrong? Software is broken, but it's not because of NPM, startups, AI, or venture capitalists. A deep dive into how we think about and produce code, and how our software systems reflect the manic state of the modern world.


{{ form.csrf_token }}
Sign In Page
{{ form.user_name() }}
{{ form.password() }}
{{ message }}
Don't have account?
Sign UP


These are the Burton roads set to be hit by roadworks
Make sure you take note of where they are
by Ben WaldronBurton roads are set to be hit by a number of sets of roadworks within the coming weeks.
Many well-used roads in the town will be impacted, including Derby Road, Branston Road, Evershed Way and Shobnall Road as work is carried out and the temporary lights will be in place.
Drivers are being warned to make a note of where they will be as they are about to be rolled out on roads in their area as they will impact their commute to and from work.
Nothing can quite ruin a good mood in the morning like the sudden appearance of roadworks when you are not expecting it.
All of the following cases of roadworks will happen within the next two weeks, according to monitoring website one.network .
We have done the hard work for you and collected a list of all the roadworks coming up from now until Friday, November 29.
Upcoming roadworks in Burton
-
Newton Road
Where: Near Burton Canoe Club.
When: From Friday, November 22 until Thursday, November 28.
For: Works on the road system.
-
Derby Road
Where: Near Tile Choice.
When: Monday, November 18 until Friday, November 22.
For: Lay new pipes.
-
Moor Street
Where: Near the junction of Moor Street and Mosley Street
When: Friday, November 15 to Tuesday, November 19.
For: Works on the road system.
-
Parkway
Where: On one exit of the roundabout near McDonald's.
When: Monday, November 4 to Friday, December 6.
For: Left hand filter lane up to the main roundabout by McDonald's. This is for the installation of a rising main sewer section in the footpath.
-
Wellington Road
Where: On the entrance to the roundabout near Morrison's.
When: Until Tuesday, December 3.
For: To lay a new cable.
-
Branston Road
When: Until New Year's Eve.
Where: On the approach to the roundabout with Orchard Street.
For: Laying cables in the footpath and road.
There are further works in Branston Road, with one set of traffic lights near the junction with All Saints Road until Tuesday, December 3, and a second set near Queen Street, also until December 3.
-
Derby Street
When: Tuesday, November 19.
Where: Near The Alfred pub.
For: To replace a sunken manhole cover.
-
Watson Street
When: Until Wednesday, July 1, 2020.
Where: Towards the end of Watson Street, near the entrance for the Washlands.
For: Flood defence improvement works.
-
Evershed Way
When: Until Thursday, December 5.
Where: On the roundabout with Anglesey Road.
For: Laying cables in the footpath and road.
-
Ashby Road
When: From Friday, November 15 to Thursday, November 21.
Where: Near the junction with Mervyn Road.
For: To lay a new gas service.
-
Shobnall Road
When: Monday, November 25 to Wednesday, November 27.
Where: Near The Albion pub.
For: Maintaining flood monitoring equipment in the water system.
-
Burton Road
When: Thursday, November 28 and Friday, November 29.
Where: Near junction with Jephson Road.
For: For highway works.
-
Stanton Road
When: Sunday, November 24 until Wednesday, November 27.
Where: Near Saxon Street.
For: To complete road maintenance.
We've got apps for both Android and Apple devices which can be tailored to deliver the news and sport that you're interested in.
And if you download our app, you can sign up for push notifications for Burton by selecting 'discover' and choosing 'Burton' from the 'more topics' list.


On the 21st of April Mindera will open its doors and welcome everyone who wants to meet our Code and Culture.
During this Open Day, you will have the opportunity to participate in our tech talks and workshops, have a job interview to join our fantastic team and know our offices (from where you can have a breathtaking Porto's view!).


“Where are the people?” resumed the little prince at last. “It’s a little lonely in the desert…” “It is lonely when you’re among people, too,” said the snake.”

“Where are the people?” resumed the little prince at last. “It’s a little lonely in the desert…” “It is lonely when
you’re among people, too,” said the snake.”

- The Little Prince by Antoine de Saint-Exupéry

The blockquote element is used simply, as it is a semantic element.
It lets HTML parsers know that the content inside of it is a quote.


Goal Experiment Summary
My goal for Google Analytics was for visitors of the site to get to the tester page that I created with a nature theme. I wanted something simple and designed the page in this theme to make sure it looked different from the others in the journal. It was a way to show that they had landed on the intended destination.
I added the goal by creating a new page the way I did the other blog pages. I just set it with photos, no text and tranquility video. I named it test page although I understand now that it should not have been so obvious. This was my first time working with GA so it I was coming up with these ideas and learning my way around it assignment by assignment. I should have named something nature-y for sure. I added the page to the index drop down. The funnels I looked at the trending page at time which was post 6 then onward down the funnel to the test page. The content experiment was to see if anyone watched my tranquility video added to the nature page. This was definitely hard to get hits on.
I think that I should have made the goal, funnel and content a lot easier to follow and had organized the site better in order for users to be able to land on these goals. I know I had traffic because I did see I would get about 6 users a week but only one of them was lead through the funnel. If I were to continue working on the site, I would add more to the nature page and move the video up for it to be easier to find and see. I would change the name to make it obvious that the page is separate from the blog and not have it be so formal and obvious. I would also take the time to make it easier for visitors to navigate through the site. It was definitely a learning experience that crept up slowly, but in the end I think I got a lot more out of it than knowing what I knew about GA before these assignments.


X019 Xbox Flash Sale discounts Gears 5, Destiny 2, Red Dead 2 and more
by James PickardFresh off their mega X019 presentation in London yesterday, Microsoft has launched the shortest of Xbox Flash Sales on a handful of games including Gears 5, Destiny 2 and Red Dead Redemption 2.
You’ll need to act fast, though, as these prices will only be available until the end of the day. If you’re looking for some highlights, then I’ve picked out a few of them for you.
Let’s start with the Sea Of Thieves Anniversary Edition for 50% off. We already knew this discount was coming after Microsoft announced it in their first wave of Black Friday deals. I think you can expect this one to return throughout the Black Friday period, though.
What else do we have? Well, there’s the Red Dead Redemption 2 Ultimate Edition at 55% off. This version of the game includes all the bonus story content from the Special Edition, plus Bonus Outfits for your online character, Rank Bonuses, the Black Chestnut Thoroughbred and free access to the Survivor Camp Theme. A few neat little extras, then, all for even less than what you’d be paying for the base game.
Here’s the full list. Before you go too wild, it’s important to know that some of these are unquestionably trash. And we can’t help feel a little ripped off that there’s a whole bunch of super special editions in there when we’d be just as happy for the standard edition for cheaper. Sadface. Oh well, there’s bound to be something better when the actual Xbox One Black Friday deals arrive.
- Assassin’s Creed Odyssey Gold Edition for $34.99
- Assassin’s Creed Origins Gold Edition for $29.99
- Borderlands 3 Super Deluxe Edition for $80.39
- Code Vein Deluxe Edition for $55.99
- Control for $44.99
- Destiny 2 Forsaken for $14.99
- Destiny 2 Shadowkeep – Digital Deluxe Edition for $44.99
- FIFA 20 Champions Edition for $63.99
- Far Cry 5 for $14.99
- Far Cry New Dawn Deluxe Edition for $24.99
- Forza Horizon 4 Ultimate Edition for $49.99
- Gears 5 Ultimate Edition for $55.99
- Madden NFL 20 Superstar Edition for $63.99
- Mortal Kombat 11 Premium Edition for $44.99
- NBA 2K20 Legend Edition for $49.99
- NHL 20 Deluxe Edition for $55.99
- Playerunknowns Battlegrounds for $13.39
- Red Dead Redemption 2 Ultimate Edition for $39.99
- Sea Of Thieves Anniversary Edition for $24.99
- The Dark Pictures Anthology: Man Of Medan for $20.99
- Ghost Recon Breakpoint Gold Edition for $64.99
- Rainbow Six Siege Gold Edition for $27.99
- The Division 2 Gold Edition for $29.99
- Watch Dogs 2 Gold Edition for $26.99
If these prices don’t inspire you, how about 3 Months Xbox Game Pass Ultimate for $1? Yeah, that’s what we’re talking about. I mean, just look at all the games coming to Game Pass in the next few months.
As for that colossal retail event we see threatening approaching us from afar? Well, you can find out pages dedicated to all the best PS4 Black Friday deals and Nintendo Switch Black Friday bargains here too. They will all be regularly updated over the next few weeks until the deals have claimed us all.


{% extends 'layout.html' %} {% block title %}about_us{% endblock title %} {% block content %}
For those with pure food indulgence in mind, come next door and sate your desires with our ever changing internationally and seasonally inspired small plates. We love food, lots of different food, just like you.
We promise you a new look and more importantly, a new attitude. We build that by getting to know you, your needs and creating the best looking clothes.
There are two me's when I take a picture. As Wolf I take pictures to be sold and as Bear all of them are free of charge, take his as a philanthropist.
Web designer @geemix
Server side programmer @Shopify
Product Designer @Xerox


---
layout: archive
title: Lean Prover Zulip Chat Archive
permalink: 116395maths/60281Howtoproveunboundprop.html
---
The archive URL format has changed. Please find this page at:
https://leanprover-community.github.io/archive/stream/116395-maths/topic/How.20to.20prove.20unbound_prop.html


General Interface Test Automation Kit Extensions Reference
Assertion Commands
Action Commands
Locators
For information about Selenium commands and locators, see
Selenium Reference
.


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/_refl_lemma.html ---
How does _refl_lemma
work?
inductive X | x : X namespace X def R : X → X → Prop | x x := true lemma R_refl : ∀ t : X, R t t := begin intro t, cases t, trivial, end lemma R_refl' : reflexive R := R_refl attribute [_refl_lemma] X.R_refl' X.R_refl example (t : X) : R t t := begin refl, -- fails end end X
I'm trying to make provable by refl
in level 5-1 of the natural number game, and my incantation does not cut it, as has been pointed out to me.
_refl_lemma
is only for lemmas whose proof is rfl
. dsimp
uses it
Kevin, you're looking for @[refl]
Last updated: Apr 24 2020 at 19:02 UTC


A few days ago I was reviewing a pull request at work and one line of code catch my eye:
At my workplace we are using standard ILogger
interface from
Microsoft.Extensions.Logging.Abstractions
package. Also logged variable name starts with @
(@event
).
And so I started to suspect that
the log statement contains an error and instead it should be written as:
Without thinking any further I put a friendly comment, that this logging statement should be fixed. After half an hour, instead of a fix I get the following response:
In this microservice we are using Serilog as third-party logging provider.
In Serilog
@
is used as destructuring operator, please see: https://github.com/serilog/serilog/wiki/Structured-Data#preserving-object-structureBasically this means that the argument will be logged in JSON form.
So @
character was put there on purpose. OK, fine.
But there still was something fishy about this code.
On the one hand we are using ILogger
from
Microsoft.Extensions.Logging.Abstractions
to decouple ourselves
from any specific logging provider,
on the other hand we are using Serilog specific extensions.
This results in a false sense of security.
We may think that since we are
using standard ILogger
, changing logging provider to e.g.
Azure Web App Diagnostics would be as simple as changing Startup
class of our application.
Unfortunately since we coupled ourselves with Serilog
(by Serilog specific extensions to the log message template),
some of our log statements may not work with the new logging provider.
So what is the solution to this problem? We must choose whatever we
want to use Serilog specific features. If we want to use them, then
we should not hide the fact that we are using Serilog. Fortunately for
us Serilog provides it’s own, ready to use ILogger
interface.
And we should use that interface instead of standard one accross
the entire application.
On the other hand, if we expect that we may need to change logging
provider in the future, we should stick with
Microsoft.Extensions.Logging.Abstractions
ILogger
and we should
use only the features that are described in
the official documentation.
If our needs are not fully covered
by the standard ILogger
e.g. we must log objects as JSON, then we must implement them
ourselves by e.g. creating wrappers around parameters:
It is really interesting that a similar coupling happens when using
IEnumerable<T>
interface as the return type of a method.
How many times have you seen a code similar to:
Again we have here a bad case of hidden coupling to the interface implementation.
We are using IEnumerable<T>
interface but we are assuming that it is backed by
a collection for which multiple enumerations always
return the same elements.
Our code will break
when someone will change FindAllUsers
implementation to
e.g.:
The solution to this problem is honesty. If you have
a value of type IEnumerable<T>
, tread it as
a value of type IEnumerable<T>
. Nothing more, nothing less.
Do not assume that multiple enumerations
will return the same elements.
This is not guaranteed by that interface.
If you want to return a sequence of elements from a method with
this additional guarantee, then please use a more specific
interface like ICollection<T>
or IReadOnlyList<T>
or
maybe even something from System.Collections.Immutable
package.


45% Complete
loading...
Browse Projects
About Me
Profile
Websites
Acixs
Tinderlight
12 Days of Indie
Multicraft
Control Panels
Starmap
Web Projects
3D Buttons
3D Switch
New Acixs
BCSS Lib
Launch Button
RD Navigation
Design
8BitBlocks Banner
Statistics
Cups of Coffee
608
Vision Degration
20%
Bugs Squashed
Lots!
Stuff I Know
HTML5, CSS3, Sass, Slim HTML, jQuery, JavaScipt, PHP, MySQL, Python, AngularJS, jQueryUI, jQueryMobile, Bootstrap, Photoshop, Illustraitor, Shell Scripting, CentOS Server, Ubuntu Server.
Project Browser
45% Complete
Reload
Open in tab
Source
About
Help fill my coffee mug
Donate
60% Satisfied
60% Complete (warning)


"x" "1" "TIKKANEN,L AND KRONBERG,L, GENOTOXIC EFFECTS OF VARIOUS CHLORINATEDBUTENOIC ACIDS IDENTIFIED IN CHLORINATED DRINKING WATER, MUTAT. RES.240(2):109-16, 1990"


This library enables the communication with an R process started as a shared library. Version 1, was the result of the efforts of two research groups that have worked in parallel. The syntactic emphasis on a minimalistic interface. Versions between 1.4 and 2.0, also work done by others particularly in interfacing to web applications. See credits for more details.
In the doc/ directory of the distribution there is user's guide, a published paper
and html documentation from PlDoc. There is large number of examples in examples/for_real.pl
.
By default when the library is loaded an R object is started which will serve the
R commands. If current_prolog_flag(real_start,false)
succeeds, the R object is not loaded and the user
needs to issue r_start/0 to do that.
A single predicate (<-/2,<-/1) channels the bulk of the interactions between Prolog and R. In addition to using R as a shared library, real uses the c-interfaces of SWI/Yap and R to pass objects in both directions. The usual mode of operation is to load Prolog values on to R variables and then call R functions on these values. The return value of the called function can be either placed on R variable or passed back to Prolog. It has been tested extensively on current SWI and YAP on Linux machines but it should also compile and work on MS operating systems and Macs.
Since v1.1 Real supports threads for web services.
In this scenario, the R object is served by the main thread. This is compatible
with the current Prolog servers ran as Unix services although you need a patched version of
http_unix_daemon.pl
for this type of demployment (one such file is included in Real sources).
See http://stoics.org.uk/~nicos/sware/real/ws.html
and in directory examples/ws_hist
Since v1.3 Real supports running an R server in any thread, not just the main thread. The library now has the concept of a designated R server thread. By default, there is no designated server thread, and the evaluation/execution of R expressions/commands is done in the calling thread. This should be done in a single threaded way. A designated server thread can come into existence in one of three ways:
r(r_thread_loop_stop)
or <- r_thread_loop_stop
in any thread.r_call_as_server(G)
. While G is running, the thread that
it is running in becomes the designated server thread, and G should call r_serve/0
periodically to answer any R requests that accumulate.
While there is a designated server thread, a call to r/1, r/2, (<-)/1 or (<-)/2 in any
thread results in the request being posted to the server thread and the current thread
blocking until a reply is received.The main modes for utilising the interface are
<- +Rexpr <- +Rvar
Print Rvar or evaluate expression Rexpr in R
+Rvar <- +PLdata +Rexpr <- +PLdata -PLvar <- +Rvar -PLvar <- +Rexpr +Rexpr1 <- +Rexpr2
Pass Prolog data to R, pass R data to Prolog or assign an R expression to an assignable R expression.
There is a raft of examples packed in a sinlge file that test the library.
?- [pack(real/examples/for_real)]. ?- for_real. ?- edit( pack(real/examples/for_real) ).
There are syntactic conventions in R that make unparsable prolog code. Notably function and variable names are allowed to contain dots, square brackets are used to access parts of vectors and arrays and functions are allowed empty argument tuples. We have introduced relevant syntax which allows for easy transition between prolog and R. Prolog constructs are converted by the library as follows:
..
within atoms -> .
(ex. as..integer(c(1,2,3)) -> as.integer(c(1,2,3))
)^[]
after atoms -> []
(ex. a^[2] -> a[2]
)(.)
at the end of atoms that are known R functions -> ()
(ex. dev..off(.) -> dev.off()
)[]
-> c()
(which equal to R's NULL value)f(x)
:- (..)) -> f(x)
(...)foo()
is valid syntax: <- dev..off()
works now (with no need for dev..off(.)
)m[1] <- 4
works now (with no need for m^[...])R vectors are mapped to prolog lists and matrices are mapped to nested lists. The convention works the other way around too.
There are two ways to pass prolog data to R. The more efficient one is by using
Rvar <- PLdata
Where Pldata is one of the basic data types (number,boolean) a list or a c/n term. This transfers via C data between R and Prolog. In what follows atomic PLval data are simply considered as singleton lists. Flat Pldata lists are translated to R vectors and lists of one level of nesting to R matrices (which are 2 dimensional arrays in R parlance). The type of values of the vector or matrice is taken to be the type of the first data element of the Pldata according to the following :
Booleans are represented in prolog as true/false atoms. Currently arrays of aribtrary dimensions are not supported in the low-level interface. Note that in R a scalar is just a one element vector. When passing non-scalars the interface will assume the type of the object is that of the first scalar until it encounters something different. Real will currently re-start and repopulate partial integers for floats as illustrated below:
r <- [1,2,3]. % pass 1,2,3 to an R vector r R <- r. % pass contents of R vector r to Prolog variable R R = [1, 2, 3]. i <- [1,2,3.1]. % r is now a vector of floats, rather than integers I <- i. I = [1.0, 2.0, 3.1].
However, not all possible "corrections" are currently supported. For instance,
?- c <- [a,b,c,1]. ERROR: real:set_r_variable/2: Type error: `boolean' expected, found `a'
In the data passing mode we map Prolog atoms to R strings-
?- x <- [abc,def]. true. ?- <- x. [1] "abc" "def" true. ?- X <- x. X = [abc, def].
In addition, Prolog data can be passed through the expression mechanism. That is, data appearing in an arbitrary R expression will be parsed and be part of the long string that will be passed from Prolog to R for evaluation. This is only advisable for short data structures. For instance,
tut_4a :- state <- c(+"tas", +"sa", +"qld", +"nsw", +"nsw"), <- state. tut_4b :- state <- c(+tas, +sa, +qld, +nsw, +nsw), <- state.
Through this interface it is more convenient to be explicit about R chars by Prolog prepending atoms or codes with + as in the above example.
The Prolog atoms '$NaN' and '' are passed to NA values in R. '$NaN' is the bidirectional value, '' is only understood in the Prolog -> R direction as it is useful for passing missing values from CSV read matrices.
nan_ex :- x <- [c(1,2,''),c(3,4,'$NaN')], X <- x, write( x(X) ), nl. ?- nan_ex. x( [[1, 2, '$NaN'], [3, 4, '$NaN']] )
Use r_citation/2 to access publication information about the interface. Although the original name was R..eal, when citating please use Real as the name for this library.
The library listens to
?- debug(real). ?- nodebug(real).
Predicate <<-/2 is a shorthand that ensures that the R variable on the left is fresh/new at the time of call, and <<-/1 blanks R variable out (r_remove/1).
?- e <- numeric(.). yes ?- e^[3] <- 17. yes ?- e[3] <- 17. yes ?- Z <- e. Z = ['$NaN','$NaN',17.0] ?- e^[10] <- 12. yes ?- Z <- e. Z = ['$NaN','$NaN',17.0,'$NaN','$NaN','$NaN','$NaN','$NaN','$NaN',12.0] rtest :- y <- rnorm(50), % get 50 random samples from normal distribution <- y, % print the values via R x <- rnorm(y), % get an equal number of normal samples <- x11(width=5,height=3.5), % create a plotting window <- plot(x,y) % plot the two samples r_wait, % wait for user to hit Enter % <- dev..off(.). % old syntax, still supported <- dev..off(). % close the plotting window. foo() now acceptable in supported Prologs tut6 :- d <- outer(0:9, 0:9), fr <- table(outer(d, d, "-")), <- plot(as..numeric(names(fr)), fr, type="h", xlab="Determinant", ylab="Frequency"). tut4b :- state <- [tas,sa,qld,nsw,nsw,nt,wa], statef <- factor(state), incmeans <- tapply( c(60, 49, 40, 61, 64, 60, 59), statef, mean ), <- incmeans. logical :- t <- [1,2,3,4,5,1], s <- t==1, <- s, S <- s, write( s(S) ), nl.
current_prolog_flag( real_start, false)
succeeds.
Only 1 instance should be started per Prolog session.
Calls to the predicate when the R object is loaded and connected to succeed
silently but have no useful side-effects.Pass PLdata to an assignable R expression.
Pass Rvar to PLvar variable via the C-interface.
Evaluate Rexpr and store its return value to PLvar.
Pass Rexpr1 <- Rexpr2 to R.
Note that all Rexpr* are first processed as described in the section about syntax before passed to R. Real also looks into Rexpressions and passes embeded lists to hidden R variables in order to pass large data efficiently.
c/n terms are recognised as PLdata
if and only if they contain basic data items in all their arguments that can be
cast to a single data type. This builds on the c()
function of R that is a basic
data constructor. Currently c/n terms are not recognised within nested expressions.
But a mechanism similar to the hidden variables for Prolog lists in expressions should
be easy to implement.
r_remove( Rvar )
.
See r_remove/1.
See r_new/1 for a predicate that fails instead in a similar context.
?- x <<- [1,2,3]. true. ?- x <<- [1,2,3]. ERROR: First argument of <<- exists as R variable: x.
<- r_thread_loop_stop.
This predicate must be called in the context of r_call_as_server/1; this is required to ensure that the current thread is designated as an R server thread, so that R evaluations from other threads are properly redirected to this thread.
By default and when the flag is not defined messages are suppressed
by wrapping the call to R's suppressPackageStartupMessages()
.
If you want the messages, use
?- set_prolog_flag( real_suppress_lib_messages, false ).
The predicate first looks into all subdirs of R_LIB_REAL for Rlib, Rlib.r and Rlib.R which allows to use local implementations rather than library packages. This is useful if you have made changes to a publically available R package that has a single file entry point. You can then use the local version for your purposes but allow others to also use your Real code with the puablic R function without any changes to the interface calls. The usual scenario is that the local version has a couple of extra arguments that specialises usage. Interface predicates to the R package can happily thus work with either version.
For instance, assume file '/home/user/r/lib/pheatmap.r' is a local file that can be independently sourced and corrensponds to the main function file of R's package pheatmap. Then the following code will source the local copy rather than look for the package installed via R.
?- setenv( 'R_LIB_REAL', '/home/user/r/lib' ), debug(real), r_library(pheamap). % Sending to R: source("/home/nicos/islp/r/lib/pheatmap.R")
If you want to use locally installed packages include their root location to R_LIB_USER (as per R documentation).
Examples:
?- r_library( ggplot2 ). ?- r_library( "ggplot2" ). ?- r_library( [ggplot2,goProfiles] ). ?- debug( real ). ?- <- library("ggplot2"). % Sending to R: suppressPackageStartupMessages(library(ggplot2)) ?- set_prolog_flag( real_suppress_lib_messages, false ). ?- <- library("ggplot2"). % Sending to R: library(ggplot2)
<- library(Rlib)
also re-directs here. These are the best ways
to include R libraries from within Real. Rlib is allowed to be atomic or
a string, or a list of atoms each corresponding to an R library name.
data(Y,M,D)
term). Note is either a note or nickname
for the release. In git development sources this is set to <Something>_dev.This predicate ucceeds once for each publication related to this library.
Atom is the atom representation % suitable for printing while Bibterm
is a bibtex(Type,Key,Pairs)
term of the same publication.
Produces all related publications on backtracking.
remove(Rvar)
).plot(width=3)
.
The predicate also supports multiple output destinations.
Opts a single or list of the following:
call(Call=true)
whether to call the constructed functiondebug(Dbg=false)
turn on debug(real)
and restore at end of callfcall(Fcall)
returns the constructed Fcalloutputs(Outs=false)
a single or list of [false,x11,pdf] also terms of those (eg x11(width=7)
)post_call(Post)
call this after the function call. this can be an arbitrary callable including another <-/2 or r_call/2rmv(Rmv=false)
when Rvar is given, should it be removed from R workspace at end? (see r_remove/1)rvar(Rvar)
when given call is expanded to Rvar <- Fcall, else <- Fcall is calledstem(Stem=real_plot)
stem to use for output files
Only the first Ropt=Rarg for each matching Ropt is used. This is also the case
for =pairs in args of Func. These are pre-pended for the check, so they always have
precedence.?- r_call( plot([1,2,3]), [debug(true)] ). ?- <- plot(c(1,2,3)) ++ debug(true). ?- <- plot(c(1,2,3)) ++ xlab=+an_xlab
The following predicates are exported, but not or incorrectly documented.


{% extends "base.html" %} {% block content %}
The administrator has been notified. Sorry for the inconvenience!
Back


Sys : Authentication based on the UNIX permission scheme (weak).
Krb5 : Security based on Kerberos 5.
Lipkey : Use username/password to authenticate the client and an asymetric key to authenticate the server. Encryption is done with a 128-bit symetric key.
Spkm3 :


{% extends "base.html" %} {% block body %}
You can update the email address we have on record for you, which will be used by the sysadmins should they need to contact you, and which will be used for subscriptions to any soc-srcf mailing lists.
This does not affect the delivery of emails sent to {{ member.crsid<EMAIL_ADDRESS>{% endblock %}


--- name: modal url: /modal title: Modal controller: ModalController ---
Modals are made with the custom zf-modal
tag. To create a trigger to open the modal, add the attribute zf-open="id"
to an element, where id
is the ID of the modal.
Add the attribute zf-close
to an element inside the modal to create a close button. We also have a handy close button element you can use—just add the class close-button
to an element.
You can embed a grid inside of a modal, complete with scrolling panels, fixed areas, and responsive adjustments. Start by nesting a grid block directly inside the modal container, and go from there. Note that you also need to add a collapse
class to the zf-modal
element if you want the grid elements to be flush with the edge of the modal.
You can add the classes tiny
, small
, or large
to change the maximum width of the modal. The widths of each size are:
You can change the names and widths of the sizing classes by modifying the $modal-sizes
Sass variable in your settings file.
Modals can have unique in and out animations, using our motion classes. Refer to the Motion UI documentation for a full list of animations.
On small screens, the modal becomes full-width and full-height, to make scrolling its contents easier. This behavior can be disabled by adding the class dialog
to a zf-modal
element.
Modals can be created on the fly using the ModalFactory
. Clicking the button will execute the code shown below.
You can override the styling of the default modal overlay by styling .modal-overlay
in your Sass. The class name of the modal overlay can be changed by changing the $modal-overlay-class
variable in your Sass settings file.
Any CSS classes on a zf-modal
element will be applied to the modal overlay, not the modal itself. This allows you to style both elements with one class.
Write a modal with a custom class using our Sass mixins. Note that the class for the modal overlay can't be changed.
You can customize with the Sass variables in the _settings.scss
file:


{% extends "global/Base.html" %} {% load staticfiles otree_tags %} {% block title %} Section 3 of Part 1 {% endblock %} {% block content %}
You will now start the Group Task.
In this task, you will see two more paintings. Please select the artist who you think made each painting.
You and your group members will be rewarded 100 tokens if more than half of your group correctly identifies the artist of each painting.
You and your group members will earn an additional 100 tokens if your group gave the most correct answers.
You will find out your payoff from Part 1 at the end of the experiment.
{% endblock %}


--- layout: post title: "Who's Funding Corporate Training Startups?" date: 2016-12-12 09:35:00 +0000 tags: image: https://s3.amazonaws.com/hackedu/2016-12-12-pigeon.jpg imagecredits: https://www.flickr.com/photos/pierre-selim/7944832694 ---
This article helps provide funding data for part 6 of my annual review of the year in ed-tech
According to the data I track on education technology startups, more investments flow to those who sell to K–12 than to higher education or to corporations. But I think that’s likely a flaw with how I gather my data – relying on publications like Edsurge, for example, to rewrite funding press releases. Corporate training is big business.
Those startups raising money this year to deliver corporate training include:


Remote Interface
Join
LEFT
RIGHT
Currently in room
...
Leave
Send
Field
Data
BPM
Temperature
Humidity
Audio input source:
Video source:
Switch to Local Device Interface


|
FrequentlyAskedQuestions
Frequently Asked Questions
Featured
Frequently Asked QuestionsWhy am I getting NoSuchMethodError exceptions on GAE classes?You probably are running an old version of the Google App Engine SDK; check the Objectify ReleaseNotes to see what minimum version is required. Google is rapidly developing Appengine; as they add new features, we add support to Objectify. This tends to require up-to-date versions of the SDK. Can I use Dependency Injection (Spring, Guice, Weld) with Objectify?Yes! Objectify was designed with this in mind.

Can I change data after it is loaded or before it is stored?Absolutely:
Should I Use a String (Name) Id?If it is a natural key, sure; Objectify allows this no problem. Here is a little more of a discussion about it. How can I integrate with memcached?See the Caching documentation. Hint, add @Cached to your (entity) class. How do I do a like query (LIKE "foo%")You can do something like a startWith, or endWith if you reverse the order when stored and searched. You do a range query with the starting value you want, and a value just above the one you want. String start = "foo"; ... = ofy.query(MyEntity.class).filter("field >=", start).filter("field <", start + "\uFFFD"); See this discussion for more background and details How do I migrate from JDO to Objectify?You should have no trouble using Objectify side-by-side with JDO. Just don't use the javax.persistence.Entity annotation on Objectify entities, it will likely make the JDO bytecode enhancer try to enhance it. You can either leave the annotation absent or use the com.googlecode.objectify.annotation.Entity substitute annotation instead. For the most part, migrating JDO classes to Objectify classes should be pretty straightforward. The only trick will be mapping the relationships. Look at the raw Entity objects to see what structure JDO created - relationships are just a Key on one end or both. If you make this field a Key<?> (or Collection<Key<?>>) in your Objectify entities, it will map just fine. Does Objectify support JDO Fetch Groups?There is no such thing as a fetch group in the GAE datastore; entities are fetched in their entirety or not at all. Objectify reflects the underlying nature of the datastore so it does not require this JDO-ism. Does Objectify support JDO detach copy?There is no need for this JDO-ism either. Objectify entities are exactly as you define them. They are not bytecode-enhanced, proxied, or manipulated in any way. Want to serialize your entity? Just make sure it is Serializable. Can I mix Low Level and Objectify writes in a single Objectify transaction?Example... Objectify ofy = ObjectifyService.beginTransaction(); ofy.put(makeSomeObject()); ofy.getDatastore().put(makeSomeLowLevelEntity()); ofy.getTxn().commit(); Yes you can! With a few caveats...
But yeah, you're free to interleave Objectify and Low-Level API calls. Why can't I use @Embedded on List<String> ?@Embedded tells Objectify to break classes down to their component parts based on their fields and store each field separately. Therefore, this annotation must not be used on primitive types or types that are stored natively by the datastore (eg String , Integer , GeoPt , User , Email , etc). The datastore knows how to persist these native types as-is. You do not need the @Embedded annotation to persist a List<String> - just declare the field normally. |


- Cersei Lannister
All these quotes and more
available for a limited time only!
Click here for more


Dear Alex,
You have received a new message from {{ from_name }}
Telephone Number: {{ phone }}
Email Address: {{ email }}
Message: {{ message_body }}


{% extends "tutorial.html" %} {% block head %} {% endblock %} {% block browsersupport %} Operaunsupported Internet Explorerunsupported Safarisupported Firefoxunsupported Chromesupported {% endblock %} {% block content %}
Displays with high pixel density are quickly becoming the norm. Content creators need to adapt to this fact. This is a short guide on how to serve high quality images on the web today, without polyfills, JavaScript, CSS hacks, and browser features that aren't quite implemented yet. In a word: without drastic changes to your workflow.
There are many responsive image proposals today, many of which involve
significant changes for the web developer. The standards-track srcset

attribute is difficult to implement, especially with the
complexity of srcset
's additional viewport-based selection:
banner-HD.jpeg 2x, banner-phone.jpeg 100w, banner-phone-HD.jpeg 100w 2x
Even though the image-set
CSS property only uses devicePixelRatio
to
decide which image to load, it still forces developers to write a lot
of extra markup for every image.
Other proposals, like the <picture>
element are even more verbose.
Furthermore, they are not standards-track, so their ubiquitous
availability is even further out than the srcset attribute. JavaScript
and server side solutions are the only other alternative, but these
approaches have their own drawbacks as covered in other
articles.
This article will go through several uses of images commonly found on
the web and propose simple solutions that work on screens with high
pixel densities as well as ordinary ones. For the purposes of this
discussion, any device that reports window.devicePixelRatio
greater
than 1 can be considered high DPI, since that means that CSS pixels
aren't the same as device pixels, and that images are being scaled up.
Here a summary in tl;dr format:
Small images can often be avoided entirely by using CSS features or SVG.
There is no need to use images for rounded corners, for example, since
the border-radius
CSS property is widely supported. Similarly, custom
fonts are widely supported, so using "imaged" text is unadvisable.
However, in some cases, like logos, an image may be the only way forward. For example, this Chrome logo has a natural size of 256x256. On a Retina display, you can see the line aliasing at diagonals and curves, which looks chunky and bad, especially when compared to crisply rendered text:
Natural dimensions: 256x256px
, asset size: 31 kB
, format: PNG
Convinced? Good. Now let's use a high density image. You might be tempted to save space by storing your logo as a JPEG, but this may not be a good idea, since saving logos and other graphics in a lossy format tends to introduce artifacts. In this case, I've exaggerated the problem by using a very high compression, but notice the banding on the gradients, the speckles on white backgrounds and the messy lines:
Natural dimensions: 512x512px
, asset size: 13 kB
, format: JPEG
The thing to do for relatively small images is to use 2x PNGs. Be aware that the difference in size between a 1x and 2x PNG is generally quite high (52 kB in this case). However, in the case of a logo, it is your website's face and the first thing your visitors will see. By skimping too much on quality in exchange for size, it will also be the last thing your visitors will see!
Here is the Chrome logo in all its glory, sized down to half its natural dimensions for 2x displays:
Natural dimensions: 512x512px
, asset size: 83 kB
, format: PNG
The markup to make the above render is the following:

Note that I have specified a width and height on the image. This is necessary because the natural size of the image is 512px. It's also good for performance because the rendering engine has a good grasp on the size of the element and won't need to work too hard to compute it.
One possible optimization that might work is to reduce the 24-bit PNG to a paletted 8-bit one. This works for images with a small number of colors, the Chrome logo included. To do this optimization, you can use a tool such as http://pngquant.org/. You can see a bit of banding here, but this file is just 13 kB, which is a whopping 6x size saving compared to the original 512x512 PNG.
Natural dimensions: 512x512px
, asset size: 13 kB
, format: PNG,
8-bit palette
I wrote an HTML5Rocks article surveying a number of different responsive image techniques, and did some research around compressing 1x and 2x JPEG and comparing resulting sizes and visual quality. Here's one such tile from the above article:
I've labeled the images with their compression level (indicated by JPEG quality), their size (in bytes), and my subjective opinion on their comparative visual fidelity (ranked by numbers). The interesting bit here is that the highly compressed 2x image (labeled 3) is smaller in size and looks better than the uncompressed 1x image (labeled 4). In other words, between images 4 and 3, we've managed to improve the quality of the image by doubling each dimension and significantly increasing the compression, while at the same time, reducing the size by 2 kB.
I wanted to get a bit more insight into tradeoffs between compression level, image dimensions, visual quality and image size. I ran a study with the following hypothesis based on the study above:
With enough compression, a 2x image will look equivalent to the same image in 1x size at some other (lower) compression. However, in this case, the highly compressed 2x image will be smaller in size than the 1x image.
I built a side-by-side image comparison app similar to Lightroom's compare view. The intention is to show a 1x and a 2x images side-by-side, but also allow you to zoom into any section of the image to get more detail. You can also select between JPEG and WebP formats and change compression quality to see file size and image quality comparisons. The idea is to tweak settings over several images, figure out what compression quality, scaling and format vs. image quality tradeoff you are comfortable with, and use that setting for all of your images.
The tool itself is available for you to play with. You can zoom into the image by selecting a sub-area to zoom into.
I'll say up front that image quality is a subjective thing. Also, your particular use case will likely dictate where your priorities lie in the visual fidelity vs. filesize spectrum. Additionally, different kinds of image features react differently to scaling and compression quality, so a one-size-fits-all solution may not necessarily work here. The point of the tool is to help you build up an intuition for image quality compressions, scales and formats.
From playing with the image zoomer, a few things quickly became apparent
to me. Firstly, I prefer quality=30 dpr=2x
images to quality=90
dpr=1x
images for the increase in detail. These images are comparable
in file size as well (in the plane case, the compressed 2x image is 76
kB whereas the uncompressed 1x is 80 kB).
Exceptions to this rule are highly compressed (quality<30
) images with
gradients. These tend to suffer from color banding, which is equally bad
regardless of image scale. The bird and car samples found in the tool
are examples of this.
WebP images look way cleaner than JPEG, especially at low compression levels. This color banding seems to be much less of an issue. Lastly, WebP images are much more compact.
Making images look good on high density displays is only half of the image related problems caused by a huge variation in screens. In some cases, you might want to serve entirely different images depending on viewport size. For example, Obama's headshot might be appropriate for a phone-sized screen, but the stand in front of him and flag behind him and some might be a better fit for a laptop display.
I deliberately avoided this "art direction" topic to focus on high DPI
images only. This problem can be solved by a number of different
approaches: using media queries and background images, via JavaScript,
via some new features like image-set
, or on the server. This topic is
covered in High DPI Images for Variable Pixel Densities.
I'll sign off with a few open issues:
To summarize, opt for CSS and SVG instead of using raster images. If raster images are strictly required, use PNGs for images with a limited palettes and many solid colors, and use JPEGs for images with many colors and gradients. The great thing about this approach is that your markup is virtually unchanged. All that is required of the web developer is to generate 2x assets and size your images properly in the DOM.
For further reading, check out Scott Jehl's article on a similar topic. May your images look sharp and your cell data usage be low!
{% endblock %}


The call arr[2]()
is syntactically the good old obj[method]()
, in the role of obj
we have arr
, and in the role of method
we have 2
.
So we have a call of the function arr[2]
as an object method. Naturally, it receives this
referencing the object arr
and outputs the array:
```js run let arr = [“a”, “b”];
arr.push(function() { alert( this ); })
arr2; // a,b,function(){…} ```
The array has 3 values: initially it had two, plus the function.


--- layout: page title: "About" description: "Safe for Babies" header-img: "img/about-bg.jpg" ---
This is a safe space for all things frivolous. I don't intend to discuss serious or tragic topics here.