In this Notebook, we'll focus on the development of a simple distributed algorithm. As for the Notebook on SGD, we focus on iterative algorithms, which eventually converge to a desired solution.
In what follows, we'll proceed with the following steps:
%matplotlib inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.stats import norm
from sklearn.cluster import KMeans
from sklearn.metrics import pairwise_distances
from sklearn.datasets.samples_generator import make_blobs
import time
from random import randint
$k$-means clustering aims to partition $n$ $d-$dimensional observations into $k$ clusters in which each observation belongs to the cluster with the nearest mean, serving as a prototype of the cluster. This results in a partitioning of the data space into Voronoi cells. The problem is computationally difficult (NP-hard); however, there are efficient heuristic algorithms that are commonly employed and converge quickly to a local optimum. In this Notebook we'll focus on one of them in particular: the Lloyd algorithm.
The $k$-means problem can be formalized as follows. Given a set of observations $(x_1, x_2, \cdots, x_n)$, where each observation is a $d$-dimensional real vector, $k$-means clustering aims to partition the $n$ observations into $k \leq n$ sets $S = \{S_1, S_2, \cdots, S_k\}$ so as to minimize the within-cluster sum of squares (WCSS) (i.e. variance). The objective is to find:
$$ \arg \min_S \sum_{i=1}^{k} \sum_{x \in S_i} || \boldsymbol{x} - \boldsymbol{\mu_i} ||^2 $$
The most common algorithm uses an iterative refinement technique. Given an initial set of $k$ centroids $\mu_1^{(1)}, \cdots, \mu_k^{(1)}$ , the algorithm proceeds by alternating between two steps: in the assignment step, observations are associated to the closest centroid, in terms of squared Euclidean distance; in the update step new centroids are computed based on the new points associated to each centroid. Note: $\mu_i^{(t)}$ stands for the $i$-th centroid as of the $t$-th iteration. So $\mu_1^{(1)}$ is the centroid 1 at iteration 1.
It is important to work on a principled approach to the design of large-scale algorithms, and this starts with using good data structures and scientific libraries, such as numpy
and scipy
. In particular, we will focus on the use of numpy
arrays, which come with efficient methods for array operations. A pseudo-code for the $k$-means algorithm is specified below:
def kmeans(X, k, maxiter, seed=None):
"""
specify the number of clusters k and
the maximum iteration to run the algorithm
"""
# randomly choose k data points as initial centroids
centroids = X[rand_indices]
for itr in range(maxiter):
# ---------------
# ASSIGNMENT STEP
# ---------------
# compute the distance matrix between each data point and the set of centroids
distance_matrix = # row Index = data point Index; col Index = centroid Index; value=distance
# assign each data point to the closest centroid
cluster_assignment = # array Index = data point Index; array value = closest centroid Index
# UPDATE STEP
# select all data points that belong to cluster i and compute
# the mean of these data points (each feature individually)
# this will be our new cluster centroids
new_centroids = ...
# STOP CONDITION
# if centroids == new_centroids => stop
Next, we use sklearn to generate some synthetic data to test our algorithm.
X, y = make_blobs(n_samples = 300, centers = 4,
random_state = 0, cluster_std = 0.6)
# change default figure and font size
plt.rcParams['figure.figsize'] = 8, 6
plt.rcParams['font.size'] = 12
# scatter plot
plt.scatter(X[:, 0], X[:, 1], s = 50)
plt.ylim(-2, 10)
plt.xlim(-6, 6)
plt.gca().set_aspect('equal')
plt.show()
centroid_history = []
def kmeans(X, k, max_iter, seed=None, select_centroids="random", centroid_history=None):
"""
#TODO
"""
#starting computational time
start_time = time.time()
n_row, n_col = X.shape
# randomly choose k data points as initial centroids
if seed is not None:
np.random.seed(seed)
# choice the initial centroids depending on the passed option
if select_centroids is "random":
rand_indices = np.random.choice(n_row, size = k, replace=False)
centroids = X[rand_indices]
elif select_centroids is "kmeanpp":
# 1) initilize the centroid vector and select the first random point
centroids = np.zeros((k, n_col))
rand_index = np.random.choice(n_row)
centroids[0] = X[rand_index]
# 2) compute all the distances from the selected centroid.
# Flaten due to np.random.choice(P-> requires a 1-D array)
distances = pairwise_distances(X, [centroids[0]], metric = 'euclidean').flatten()
# 3) compute the remaining k-1 centroids
for i in range(1, k):
# choose the next centroid, the probability for each data point to be chosen
# is directly proportional to its squared distance from the nearest centroid
prob = distances ** 2
rand_index = np.random.choice(n_row, size = 1, p = prob / np.sum(prob))
centroids[i] = X[rand_index]
if i == k - 1:
break
# if we still need another cluster,
# compute distances from the centroids to all data points
# and update the squared distance as the minimum distance to all centroid
distances_new = pairwise_distances(X, [centroids[i]], metric = 'euclidean').flatten()
distances = np.min(np.vstack((distances, distances_new)), axis = 0)
# save the initial centroid history
if centroid_history is not None:
centroid_history.append(centroids)
for epoch in range(max_iter):
# compute distances between each data point and the set of centroids
# and assign each data point to the closest centroid
distances_to_centroids = pairwise_distances(X, centroids, metric = 'euclidean')
# axis=1 is checking the row for the minimum index
cluster_assignment = np.argmin(distances_to_centroids, axis = 1)
# select all data points that belong to cluster i and compute
# the mean of these data points (each feature individually)
# this will be our new cluster centroids
# NOTE: cluster assignent is mapped as a boolean values which are used to filter the X vectot
# then the mean is perfomed for the resulting vector
new_centroids = np.array([X[cluster_assignment == i].mean(axis = 0) for i in range(k)])
# save the centroid history
if centroid_history is not None:
centroid_history.append(new_centroids)
# if the updated centroid is still the same,
# then the algorithm converged
if np.all(centroids == new_centroids):
break
centroids = new_centroids
# compute the heterogeneity
heterogeneity = 0
for i in range(k):
# we take the data points which are associated with the cluster i-th
cluster_data = X[cluster_assignment == i]
distances = pairwise_distances(cluster_data, [centroids[i]], metric = 'euclidean')
# we implement the summation
heterogeneity += np.sum(distances ** 2)
# end computational time
end_time = time.time()
return centroids, cluster_assignment, heterogeneity, end_time - start_time
# print the number of points for each cluster
def print_clust_size(cluster_assignment, k):
for i in range(k):
print ("Cluster " + str(i) + " contains: " + str(len(cluster_assignment[cluster_assignment == i])) + ' elements')
def plot_cluster(cluster_assignment, centroids, data, title=''):
# scatter plot
plt.scatter(X[:, 0], X[:, 1], s = 50, c=cluster_assignment)
plt.scatter(centroids[:, 0], centroids[:, 1], s = 200, alpha = 0.5)
plt.gca().set_aspect('equal')
plt.title(title)
plt.show()
def print_centroid_hist(centroid_history):
for centroid in centroid_history:
plt.scatter(centroid[:, 0], centroid[:, 1], s = 200, alpha = 0.5)
K = 4
MAX_ITER = 100
SEED = 1
centroids, label, heterogen, running_time = kmeans(X, K, MAX_ITER, centroid_history=centroid_history, seed=SEED)
print_clust_size(label, K)
plot_cluster(label, centroids, X)
#print_centroid_hist(centroid_history)
# the init='random' is similar to our implementation. init="k-means++" is a smart selection to speed up convergence
k_means = KMeans(K, 'random', 1, MAX_ITER)
labels = k_means.fit_predict(X)
centroids = k_means.cluster_centers_
plot_cluster(labels, centroids, X)
from sklearn import datasets
n_samples = 300
samples = {}
samples["circles"] = datasets.make_circles(n_samples=n_samples, factor=.5, noise=.05)
samples["moons"] = datasets.make_moons(n_samples=n_samples, noise=.05)
samples["blobs"] = make_blobs(n_samples=n_samples, centers=4, random_state=8, cluster_std=0.6)
samples["no_struct"] = np.random.rand(n_samples, 2), None
for key in samples:
X, y = samples[key]
centroids, label, heterogen, running_time = kmeans(X, K, MAX_ITER, centroid_history=centroid_history, seed=SEED)
print_clust_size(label, K)
plot_cluster(label, centroids, X, key)
One well-known weakness of $k$-means is that the algorithm's performance is closely tied with the randomly generated initial centroids' quality. If the algorithm starts with a set of bad inital centers, it will get stuck in a local minimum.
Instead of taking a formal approach to study the convergence of $k$-means, let's study it with an experimental approach. One thing we can do is to build a measure of clustering quality: intuitively, a good clustering result should produce clusters in which data points should be very close to their centroids, and very far from other centroids. In this Notebook, we'll look at a metric called the total within Sum of Squares, which is sometimes referred ot as heterogeneity. Mathematically, we define heterogeneity as:
$$ \mathcal{H} = \sum_{j=1}^{k} \sum_{i: z_i=j} || \boldsymbol{x_i} - \boldsymbol{\mu_j}||_{2}^{2} $$
Where $k$ denotes the total number of clusters, $x_i$ is the $i$-th data point, $\mu_j$ is the $j$-th centroid, and $|| \cdot ||_{2}^{2}$ denotes the squared L2 norm (Euclidean distance) between the two vectors.
Answer 4
Our function is already returning the hererogeneity value.
X, y = make_blobs(n_samples = 500, centers = 4,
random_state = 10, cluster_std = 0.6)
# change default figure and font size
plt.rcParams['figure.figsize'] = 8, 6
plt.rcParams['font.size'] = 12
# scatter plot
plt.scatter(X[:, 0], X[:, 1], s = 50)
plt.gca().set_aspect('equal')
plt.title('Dataset')
plt.show()
SEEDS = [randint(1, 1000) for x in range(5)]
res = {}
for s in SEEDS:
res[s] = kmeans(X, K, MAX_ITER, seed=int(s))
print("\n\nResults:")
for i in range(len(SEEDS)):
s = SEEDS[i]
print("SEED = {}\tH = {}".format(int(s), round(res[s][2], 2)))
The K-means algorithm converges to a local minimum: then, the quality of the final result strongly depends on the starting conditions of the algorithm. In our case, seeds are the main success factor because initial centroids are chosen randomly. As you can see from the results we obtained, there exist some seeds for which the computations lead us to worse final results
One effective way to produce good initial centroids to feed to $k$-means is to proceed as follows: instead of randomly generating initial centroids, we will try to spread them out in our $d$-dimensional space, such that they are not "too close" to eachother. If you are interested in the details of this technique, you should refer to the link to the original research paper below: in summary, the $k$-means++ technique allows to improve the quality of the local optima in which $k$-means settles, and to reduce the average runtime of the algorithm.
k-means++: the advantages of careful seeding, by David Arthur and Sergei Vassilvitskii (Stanford University) https://dl.acm.org/citation.cfm?id=1283494
A simplified workflow of the $k$-means++ approach is as follows:
Answer 6
Our function is already returning the hererogeneity value and is capable to select between "random" and "kmeans++" centroids initialization techniques.
# we use the same dataset used before
# change default figure and font size
plt.rcParams['figure.figsize'] = 8, 6
plt.rcParams['font.size'] = 12
# scatter plot
plt.scatter(X[:, 0], X[:, 1], s = 50)
plt.gca().set_aspect('equal')
plt.title('Dataset')
plt.show()
# Seeds are the same of the previous exercise
res_kpp = {}
for s in SEEDS:
res_kpp[s] = kmeans(X, K, MAX_ITER, seed=int(s), select_centroids="kmeanpp")
print("\n\nResults:")
for i in range(len(SEEDS)):
s = SEEDS[i]
print("SEED = {}\tH = {}".format(int(s), round(res_kpp[s][2], 2)))
# print the average for the heterogeneity obtained with the seeds
print("\n\nComparisons: ")
print("Heterogeieity with baseline selection: {}".format(round(np.average([x[2] for x in res.values()]), 2)))
print("Heterogeieity with kmean++ selection: {}".format(round(np.average([x[2] for x in res_kpp.values()]), 2)))
Comparing this result with the one obtained before, we can see that the "kmeans++" technique is able to provide better results also for "bad" seed values. The reason is the one explained above: this technique is specifically designed in order to be able to select a good initial set of centroids. This is remarked by comparing the average heterogeneity obtained with the two implementations.
Another problem of $k$-means is that we have to specify the number of clusters $k$ before running the algorithm, which we often don't know a priori. There are many different heuristics for choosing a suitable value for $k$, the simplest one being the Elbow method. Essentially, the idea is to run the $k$-means algorithm using different values of $k$ and plot the corresponding heterogeneity. This measure will decrease as the number of clusters increases, because each cluster will be smaller and tighter. By visual inspection of the plot heterogeneity vs. $k$, we will (hopefully!) see that the curve flattens out at some value of $k$: this is what we call an "elbow", and we'll select the value of $k$ corresponding to the "elbow" position.
heterogeneities = []
# we initialize the data set
X, y = make_blobs(n_samples = 300, centers = 4,
random_state = 0, cluster_std = 0.6)
for k in range(2, 11):
centroids, labels, heterogen, running_time = kmeans(X, k, MAX_ITER, select_centroids="kmeanpp", seed=SEED)
heterogeneities.append(heterogen)
# plotting the heterogeneity as a function of k
plt.plot(list(range(2, 11)), heterogeneities)
plt.title("Heterogeneity vs K", y=1.02)
plt.xlabel("k")
plt.ylabel("heterogeneity")
plt.grid()
plt.show()
According to the definition of heterogeneity, we can see that the its value decreases when the "k" value increases. This is due to the fact that, with high values of k, resulting clusters are smaller and more compact.
The graph shows what the introduction of this exercise states: the improvement in heterogeneity value is greater in the start: once k reaches the value of 4 (sometimes 5, depending on the seed) the improvement decreases. Clearly, the heterogeneity value will be zero when k is equal to the number of elements in the dataset (single-element clusters): anyway, this would not be a useful result because the classification will not be effective nor meaningful.
This is the reason why we are looking for a good value of k, able to generate a meaningful classification of tha data, avoid overfitting and alleviate the computation when we decide which cluster assign to every element of the dataset, at every iteration.
We're now ready to work on a distributed implmentation of the $k$-means algorithm, using the PySpark API.
By now, you should be rather familiar with the $k$-means algorithm, which means we can focus on its parallel and distributed design.
The basic idea of distributed $k$-means is as follows: data points to be clustered should be stored as a distributed dataset, namely a RDD. As in the Notebook on distributed SGD, we will take a shortcut and avoid using HDFS RDDs: rather, we'll use sklearn to generate the data points, similary to the serial version of the algorithms, then use the parallelize()
method to create an RDD, and determine the number of partitions.
We also need to manipulate the centroids array: indeed, all machines should hold a copy of the centroid vector, such that they can proceed independently and in parallel in the first phase of the $k$-means algorithm, that is the assignment step. Specifically, every worker has a set of data points, and it will use a copy of the centroid vector to compute cluster assignement: we compute the distance between each data point and each centroid, to assign data points to their closest centroid.
Once the assignement step is done, we need to recompute new centroids based on the assignement, that is, we execute the update step. Clearly, we will need to shuffle data over the network such that we will have, for each current centroid, the list of all data points that have been assigned to it. If you think about it, this problem should be familiar!! This is very similar to what we do in the Word Count example. As such, you will need to make sure the output of the update step is cast to a <key, value>
type, where the key corresponds to a centroid identifier, and the value contains the list of data points associated to that centroid. The framework will take care of the distributed group by operation, and organize data according to the semantic of our algorithm.
NOTE: since we will (potentially) work on large dataset sizes, we don't want our algorithm to return the final assignement after convergence, for otherwise we would need to collect a large amount of data in the driver machine, which has a finite and somehow limited amount of RAM.
The pseudo code of the algorithm you need to implement is as follows:
datapoints = # Use sklearn, as usual, and work on blobs
centroids = # Random initialization
for itr in range(maxiter): # This for loop is executed by the driver
bcCentroids = sc.broadcast(centroids) # Use broadcast variables
closest = datapoints.mapPartition(assignement_step) # This should happen in parallel
centroids = closest.reduceByKey(update_step_sum). \ # This should happen in parallel
map(update_step_mean). \ # This should happen in parallel
collect() # Here we collect new centroids in the driver
As you can see from the pseudo code, you need to figure out how to implement the assignement_step
function and the update_step function. For the latter, the pseudo code gives you a big hint! Remember what we discussed in class about computing the mean!
import sys
def kmeans_d(X, k, max_iter, seed=None):
'''
#TODO
'''
# staring time
start_time = time.time()
# randomly choose k data points as initial centroids
if seed is not None:
np.random.seed(seed)
n_row, n_col = X.shape
rand_indices = np.random.choice(n_row, size = k, replace=False)
centroids = X[rand_indices]
# assign portions of the datasets to the workers
dist_datapoints = sc.parallelize(X, 4).cache()
for epoch in range(max_iter):
# create a broadcast variable for the centroids
bc_centroids = sc.broadcast(centroids)
def assignment_step(worker_datapoints):
for datapoint in worker_datapoints:
# we want to keep, for every point, information about the nearest centroid
dist = pairwise_distances(datapoint, bc_centroids.value, metric = 'euclidean')
# the cluster id is the element position in the list
cluster = np.argmin(dist)
# output: key = cluster id, value = (datapoint, 1) [to retrieve the average later]
yield (cluster, [datapoint[0], datapoint[1], 1])
def update_step_sum(a, b):
# retrieve components of the value ("datapoint" and "counter")
# note: the function takes the values for a given key, for which the groupBy is applied
dp1_x = a[0]
dp1_y = a[1]
counter1 = a[2]
dp2_x = b[0]
dp2_y = b[1]
counter2 = b[2]
# sum the "datapoint" arrays content
sum_dp_x = dp1_x + dp2_x
sum_dp_y = dp1_y + dp2_y
# emit pair with both fields summed
return [sum_dp_x, sum_dp_y, counter1 + counter2]
def update_step_mean(a):
# to retrieve the mean, we divide the sum by the counter (getting rid of the key)
key = a[0]
value = a[1]
s_x = value[0]
s_y = value[1]
c = value[2]
return (key, [s_x/c, s_y/c])
# retrieve new centroid values from workers
res = dist_datapoints.mapPartitions(assignment_step, preservesPartitioning=True). \
reduceByKey(update_step_sum). \
map(update_step_mean). \
collectAsMap()
# retrieve the centroids coordinates
new_centroids = np.array([res[key] for key in sorted(res.keys())])
# stop condition
if np.all(centroids == new_centroids):
break
else:
# update centroid values, so that they will be broadcast in the next iteration
#print(str(centroids) + '\n' + str(new_centroids) + '\n\n')
centroids = np.copy(new_centroids)
# end time
end_time = time.time()
# return obtained centroids and running time
return new_centroids, end_time - start_time
# we initialize the data set
K = 8
SAMPLES = 3000
SEED = 12
MAX_ITER = 1000
X, y = make_blobs(n_samples = SAMPLES, centers = K,
random_state = 400, cluster_std = 0.6)
#print the dataset size
print('Dataset size is: {} KB'.format(round(sys.getsizeof(X)/1024, 2)))
centroids, running_time = kmeans_d(X, K, MAX_ITER, seed=SEED)
# print obtained centroids
print("Algorithm's running time: {} seconds".format(round(running_time)))
print("\nObtained centroids:")
for c in centroids:
print(c)
centroids = np.array(centroids)
# print the scatter plot, with the dataset and the evaluated centroids
plt.scatter(X[:, 0], X[:, 1], s = 50, cmap="viridis")
plt.scatter(centroids[:, 0], centroids[:, 1], s = 200, alpha = 0.5, c='r')
plt.gca().set_aspect('equal')
plt.title("Distributed K-means")
plt.show()
Answer 10.
DATASET_SIZES = [1e3, 1e4, 1e5, 1e6]
Ks = [4, 4, 4, 4]
MAX_ITER = 10
SEED = 11
serial_r_res = []
serial_pp_res = []
distributed_res = []
for i in range(len(DATASET_SIZES)):
#create the dataset
X, y = make_blobs(n_samples = int(DATASET_SIZES[i]), centers = Ks[i],
random_state = 11, cluster_std = 0.6)
#print the dataset size
print('Dataset size is: {} KB ({} elements)'.format(round(sys.getsizeof(X)/1024, 2), int(DATASET_SIZES[i])))
#run the serial algorithm (random initial centroids choice)
centroids, label, heterogen, running_time = kmeans(X, Ks[i], MAX_ITER, seed=SEED)
serial_r_res.append(running_time)
#run the serial algorithm (kmeans++)
centroids, label, heterogen, running_time = kmeans(X, Ks[i], MAX_ITER, select_centroids="kmeanpp", seed=SEED)
serial_pp_res.append(running_time)
#run the distributed algorithm
centroids, running_time = kmeans_d(X, Ks[i], MAX_ITER, seed=SEED)
distributed_res.append(running_time)
#plot the obtained results
print("\n")
x_axes = np.log10(DATASET_SIZES)
plt.plot(x_axes, np.log10(serial_r_res))
plt.plot(x_axes, np.log10(serial_pp_res))
plt.plot(x_axes, np.log10(distributed_res))
plt.title("Comparisons Between Serial and Distributed", y=1.05)
plt.xlabel("dataset size ($log_{10}$ elements)")
plt.ylabel("time ($log_{10}$ seconds)")
plt.legend(['Serial (random)', 'Serial (kmeans++)', 'Distributed'], loc='center left', bbox_to_anchor=(1, 0.5))
plt.grid()
plt.show()
Answer 11.


--- title: Review peer R package author: Peimin Lin date: '2020-10-26' slug: review-peer-r-package categories: [] tags: [] subtitle: '' summary: '' authors: [] lastmod: '2020-10-26T12:20:08+11:00' featured: no image: caption: '' focal_point: '' preview_only: no projects: [] ---
This post is going to review my peer Nguyễn Đăng Thành R package icecovid19
. Nguyễn Đăng Thành and I are both in Master of Business Analytics program in Monash University and this package was an assessment of unit Communicating with Data. The package is aiming to launch the shinyapp made before and refactor some output as function. Great job! Thanh!
To download the package, you can
# install.packages("devtools")
devtools::install_github("etc5523-2020/r-package-assessment-Thanh-8213")
The data set in package:
data_total
data_total_newdaily
The functions in package:
launch_app
addLabel
getSummaryDT
sliderDateinput
summariseData
summariseData_newdaily
Following the instruction of README.md, I downloaded icecovid19
package successfully in my rstudio. The package passed R-CMD
and pkgdown
checks. Thanh inserted data_total
and data_total_newdaily
two data set in package and when typed in the console, the data set structure and variable will display. The function getSummaryDT
is a refactor DT table in the shinyapp as the function output. Function launch_app
can load Thanh’s shinydashboard successfully. The function which refactor the shinyapp in ui and server were passed the test.
The package includes all the following forms of documentation:
URL
, BugReports
and Maintainer
(which may be autogenerated via Authors@R
).The package contains a paper.md
matching JOSS’s requirements with:
The dataset contains the number of COVID19 cases worldwide from 22/01/2020 to 06/10/2020 as well as the date and the region in which cases were recored. There are 3 type of cases: Confirmed, deceased and recovered.
The dataset contains the number of COVID19 cases worldwide from 22/01/2020 to 06/10/2020. Data is in longer format, with variable vars contains 6 types of cases: Confirmed, deceased, recovered, new daily confirmed, new daily death and new daily recovered.
launch_app
This function designed for launch the shinyapp relative the the COVID-19.
addLabel
This function create HTML label for the types of cases. When mouse is hovered
on leaflet map, the label will appear and give addition details.
getSummaryDT
This function create a summary data table that shows the detailed number of confirmed, deceased and Estimated recovered cases.
sliderDateinput
The function constructs a slider widget to select a date value from a range of value. Thanh test this ui refactor function and congratulate the test pass!
summariseData
The function summarise data creates a new data frame. It will have one row for each combination of grouping variables.
summariseData_newdaily
Summarise Data newdaily daily new cases.
The shiny dashboard that Thanh made is extraordinary that I really like the click event function inset the leaflet map. If I had to make suggestion I would suggest that adjust the plotly position in the plots section and look align would be better. It is better to add more introduction in README.md and regretted that Thanh set his pkgdown
website as invisible that the website of the package was missing that it not good for overview the package.
Thanh passed two R-CMD check
and pkgdown check
that the records in github shows the effort Thanh made to debugging the error and passed the checks at the end which I did not achieve it in my assessment. Also, I have clearly steps to create a plotly event and insert in shinyapp. There are a lot of little details that I won’t go into. Not only this review assessment I learned a lot, this whole unit also build a solid foundation for my further learning. Many thanks for teaching team!


Doubloon Game
问题描述 :
Being a pirate means spending a lot of time at sea. Sometimes, when there is not much wind, days can pass by without any activity. To pass the time between chores, pirates like to play games with coins.
An old favorite of the pirates is a game for two players featuring one stack of coins. In turn, each player takes a number of coins from the stack. The number of coins that a player takes must be a power of a given integer K (1, K, K^2, etcetera). The winner is the player to take the last coin(s).
Can you help the pirates gure out how the player to move can win in a given game situation?
An old favorite of the pirates is a game for two players featuring one stack of coins. In turn, each player takes a number of coins from the stack. The number of coins that a player takes must be a power of a given integer K (1, K, K^2, etcetera). The winner is the player to take the last coin(s).
Can you help the pirates gure out how the player to move can win in a given game situation?
输入:
The first line of the input contains a single number: the number of test cases to follow. Each test case has the following format:
One line with two integers S and K, satisfying 1 <= S <= 10^9 and 1 <= K <= 100: the size of the stack and the parameter K, respectively.
One line with two integers S and K, satisfying 1 <= S <= 10^9 and 1 <= K <= 100: the size of the stack and the parameter K, respectively.
输出:
The first line of the input contains a single number: the number of test cases to follow. Each test case has the following format:
One line with two integers S and K, satisfying 1 <= S <= 10^9 and 1 <= K <= 100: the size of the stack and the parameter K, respectively.
One line with two integers S and K, satisfying 1 <= S <= 10^9 and 1 <= K <= 100: the size of the stack and the parameter K, respectively.
样例输入:
5 5 1 3 2 8 2 50 3 100 10
样例输出:
1 0 2 0 1
博弈题。。？这tm根本就是一道数论题！！f*。。
#include<iostream> #include<vector> using namespace std; int n,k; int main() { int T; cin>>T; while(T--) { cin>>n>>k; if(k%2) { if(n%2) { cout<<"1"<<endl; } else { cout<<"0"<<endl; } } else { if(n%(k+1)==k) { cout<<k<<endl; } else if((n%(k+1))%2) { cout<<"1"<<endl; } else { cout<<"0"<<endl; } } } return 0; }
版权声明：本文为博主原创文章，未经博主允许不得转载。
参考：http://blog.csdn.net/zz_1215/article/details/7527616
(adsbygoogle = window.adsbygoogle || []).push({});
凯要开八门遁甲之阵虐六道斑了
凯要开八门遁甲之阵虐六道斑了
凯要开八门遁甲之阵虐六道斑了
凯要开八门遁甲之阵虐六道斑了
凯要开八门遁甲之阵虐六道斑了
凯要开八门遁甲之阵虐六道斑了
凯要开八门遁甲之阵虐六道斑了
凯要开八门遁甲之阵虐六道斑了
凯要开八门遁甲之阵虐六道斑了
凯要开八门遁甲之阵虐六道斑了
凯要开八门遁甲之阵虐六道斑了
凯要开八门遁甲之阵虐六道斑了
凯要开八门遁甲之阵虐六道斑了
凯要开八门遁甲之阵虐六道斑了
反恐要充分发动群众，尤其是维族和MSL群众。
反恐要充分发动群众，尤其是维族和MSL群众。
反恐要充分发动群众，尤其是维族和MSL群众。
反恐要充分发动群众，尤其是维族和MSL群众。
反恐要充分发动群众，尤其是维族和MSL群众。
反恐要充分发动群众，尤其是维族和MSL群众。
反恐要充分发动群众，尤其是维族和MSL群众。
反恐要充分发动群众，尤其是维族和MSL群众。
反恐要充分发动群众，尤其是维族和MSL群众。
反恐要充分发动群众，尤其是维族和MSL群众。
反恐要充分发动群众，尤其是维族和MSL群众。
反恐要充分发动群众，尤其是维族和MSL群众。
反恐要充分发动群众，尤其是维族和MSL群众。


Every time I listen to the song Dusty Trails by Lucius I get a little bit sad.
There's a part at the end that speaks a lot to where I am right now. It goes:
"I'm halfway to misery
Some say when you go halfway there's still plenty of time to return
Oh, am I halfway to heaven?
Some may say when you go halfway, you only have halfway to go."
I can't believe sophomore year is over. I can't believe I'll be a junior soon. That feels so OLD.


Ravatar
An
identicon
implementation. Find me on
GitHub
.
Generate random
Options
Dark colorway
Has background
Rounded background


Edit Profile
First Name
Surname:
Username:
Phone:
Format:123-456-7890
E-mail:
Address:
Confirm Current Password:
Show Password
Save
Back


Chrome Canary Features For Developers Google Chrome
Github Googlearchive Chromedeveditor Chrome Dev Editor Is A Developer Tool For Building Apps On The Chrome Platform Chrome Apps And Web Apps In Javascript Or Dart No Longer In Active Development
Google Chrome Download The Fast Secure Browser From Google
Inspect Network Activity Chrome Developers
Chrome 89 Is Now Available In The Beta Channel Apk Download
Google Chrome Download The Fast Secure Browser From Google
Google S Chromium Browser Explained Computerworld
Throttling The Network In Chrome Devtools Css Tricks
Google Chrome Download The Fast Secure Browser From Google
Google Makes Chrome S Bleeding Edge Developer Version Available On Android The Verge
Sources Panel Overview Chrome Developers
Download Chrome Browser For Your Business Chrome Enterprise
Google Chrome Download The Fast Secure Browser From Google
Sources Panel Overview Chrome Developers
Launched Android Chrome Dev Tools Available Live Testing Real Devices The Sauce Labs Cookbook Sauce Labs Documentation Wiki
Google I O 2011 Chrome Dev Tools Reloaded Youtube
Google Chrome Dev Download
Optimize Website Speed Chrome Developers
Google Chrome の開発版v91 0 4442 4 Devが公開 ほか ダイジェストニュース 窓の杜
At Last Chrome For Android Gets A Dev Channel
Building Progressive Web Apps With Polymer Chrome Dev Summit 2015 Youtube
Accessibility Features Reference Chrome Developers
Google Chromeに新b版が登場 Javascript性能などが安定版よりアップ Codezine コードジン


{{house.description}}
Offering Price: ${{house.price}}
Location: {{house.street}}, {{house.city}} {{house.state}}, {{house.zip}}
Bedrooms: {{house.bedrooms}} Bathrooms: {{house.bathrooms}} Sq Feet: {{house.sqfeet}}


Create a new user
Insert the user's birthday date with the right format and save it!
Birthday date in the format "yyyy-MM-dd" (example: 1977-01-24):
Save
Proudly handcrafted by
Netgloo
:)


Lyrics of Lowly Life
by Paul Laurence Dunbar
"To the Memory of Mary Young"
Additional Information
- Year Published: 1913
- Language: English
- Country of Origin: United States of America
- Source: Dunbar, P.L. (1913). The Complete Poems of Paul Laurence Dunbar. New York: Dodd, Mead, and Company.
-
Readability:
- Flesch–Kincaid Level: 6.5
- Word Count: 292
- Genre: Poetry
- ✎ Cite This
Downloads
God has his plans, and what if we
With our sight be too blind to see
Their full fruition; cannot he,
Who made it, solve the mystery?
One whom we loved has fall’n asleep,
Not died; although her calm be deep,
Some new, unknown, and strange surprise
In Heaven holds enrapt her eyes.
And can you blame her that her gaze
Is turned away from earthly ways,
When to her eyes God’s light and love
Have giv’n the view of things above?
A gentle spirit sweetly good,
The pearl of precious womanhood;
Who heard the voice of duty clear,
And found her mission soon and near.
She loved all nature, flowers fair,
The warmth of sun, the kiss of air,
The birds that filled the sky with song,
The stream that laughed its way along.
Her home to her was shrine and throne,
But one love held her not alone;
She sought out poverty and grief,
Who touched her robe and found relief.
So sped she in her Master’s work,
Too busy and too brave to shirk,
When through the silence, dusk and dim,
God called her and she fled to him.
We wonder at the early call,
And tears of sorrow can but fall
For her o’er whom we spread the pall;
But faith, sweet faith, is over all.
The house is dust, the voice is dumb,
But through undying years to come,
The spark that glowed within her soul
Shall light our footsteps to the goal.
She went her way; but oh, she trod
The path that led her straight to God.
Such lives as this put death to scorn;
They lose our day to find God’s morn.


19 June 2003
Disease Outbreak Reported
From 28 April to 4 June 2003, a total of 73 laboratory-confirmed cholera cases have been reported in Iraq : 68 in Basra governorate, 4 in Missan governorate, 1 in Muthana governorate. No deaths have been reported.
From 17 May to 4 June 2003, the daily surveillance system of diarrhoeal disease cases in the four main hospitals of Basra reported a total of 1549 cases of acute watery diarrhea. Among these cases, 25.6 % occurred in patients aged 5 years and above.
The water supply situation is critical. Short-term measures have been undertaken by UNICEF and local authorities to improve accessibility to safe drinking water and to limit the spread of water-borne epidemics.
WHO is supporting local authorities in implementing an early warning communicable disease surveillance system, in strengthening laboratory capacity and in coordinating the cholera outbreak response.
The surveillance system is being expanded to the whole Lower South (all 4 governorates) and weekly reports from all facilities have begun.
UNICEF is also supporting the initiative by providing health education material in Arabic and chlorine tablets to all health directorates.


Online Ordering
Thank you for using our online ordering form for quick and easy orders, delivered free, fast, and hot to your door. If you need to talk to us directly, call Red Ball Pizza at (386) 555 - 7499.
Thank you for using our online ordering form for quick and easy orders, delivered free, fast, and hot to your door. If you need to talk to us directly, call Red Ball Pizza at (386) 555 - 7499.
Required values are marked by an asterisk (*)


|
Simbody
3.5
|
A Contact contains information about the spatial relationship between two surfaces that are near, or in contact with, each other. More...
Public Types | |
| enum | Condition { Unknown, Untracked, Anticipated, NewContact, Ongoing, Broken } |
| The Contact::Condition tracks the status of a Contact through its lifetime. More... | |
Public Member Functions | |
| Contact () | |
| The default constructor creates an empty handle. More... | |
| Contact (const Contact &source) | |
| Copy constructor is shallow and reference-counted; this handle will point to the same object as does the source. More... | |
| ~Contact () | |
| Destructor clears the handle, deleting the referenced object if this was the last reference. More... | |
| Contact & | operator= (const Contact &source) |
| Copy assignment is shallow and reference-counted; this handle will point to the same object as does the source. More... | |
| void | clear () |
| Clear this handle, deleting the referenced object if this was the last reference. More... | |
| bool | isEmpty () const |
| See if this handle is empty. More... | |
| ContactId | getContactId () const |
| Get the persistent ContactId that has been assigned to this Contact object if there is one (otherwise this will be invalid – you can check with isValid(). More... | |
| Condition | getCondition () const |
| Find out the current condition of this Contact object. More... | |
| ContactSurfaceIndex | getSurface1 () const |
| Get the first surface involved in the contact, specified by its index within its contact set or ContactTrackerSubsystem. More... | |
| ContactSurfaceIndex | getSurface2 () const |
| Get the second surface involved in the contact, specified by its index within its contact set or ContactTrackerSubsystem. More... | |
| const Transform & | getTransform () const |
| Return the transform X_S1S2 giving the pose of surface 2's frame measured and expressed in surface 1's frame, recorded at the time this Contact object was calculated. More... | |
| Contact & | setContactId (ContactId id) |
| Set the ContactId for this Contact object. More... | |
| Contact & | setCondition (Condition condition) |
| Set the current Condition. More... | |
| Contact & | setSurfaces (ContactSurfaceIndex surf1, ContactSurfaceIndex surf2) |
| Set the surfaces tracked by this Contact object. More... | |
| Contact & | setTransform (const Transform &X_S1S2) |
| Set the surface-to-surface relative transform X_S1S2. More... | |
| ContactTypeId | getTypeId () const |
| Return a unique small integer corresponding to the concrete type of Contact object being referenced by this handle. More... | |
| const ContactImpl & | getImpl () const |
| ContactImpl & | updImpl () |
Static Public Member Functions | |
| static const char * | nameOfCondition (Condition) |
| Returns a human-readable name corresponding to the given Condition; useful for debugging. More... | |
| static ContactId | createNewContactId () |
| This creates a new ContactId starting from 1 and increasing for a very long time (to a billion or so) before repeating. More... | |
Protected Member Functions | |
| Contact (ContactImpl *impl) | |
A Contact contains information about the spatial relationship between two surfaces that are near, or in contact with, each other.
It usually is created by a ContactTracker or CollisionDetectionAlgorithm, and is retrieved from a ContactTrackerSubsystem or GeneralContactSubsystem.
The base class records only the indices of the two surfaces that are in contact, and the relative Transform between them at the time the Contact was recorded. ContactTrackers or CollisionDetectionAlgorithms which characterize contacts in more complex ways will return objects that are subclasses of Contact that provide additional information.
The Contact::Condition tracks the status of a Contact through its lifetime.
| Enumerator | |
|---|---|
| Unknown |
this is an illegal value |
| Untracked |
this pair not yet being tracked; might not contact |
| Anticipated |
we expect these to contact soon |
| NewContact |
first time seen; needs a ContactId assigned |
| Ongoing |
was new or ongoing before; still in contact now |
| Broken |
was new or ongoing before; no longer in contact |
|
inline |
The default constructor creates an empty handle.
| SimTK::Contact::Contact | ( | const Contact & | source | ) |
Copy constructor is shallow and reference-counted; this handle will point to the same object as does the source.
|
inline |
Destructor clears the handle, deleting the referenced object if this was the last reference.
|
explicitprotected |
|
static |
Returns a human-readable name corresponding to the given Condition; useful for debugging.
If the Condition is unrecognized the method will return some text to that effect rather than crashing.
Copy assignment is shallow and reference-counted; this handle will point to the same object as does the source.
| void SimTK::Contact::clear | ( | ) |
Clear this handle, deleting the referenced object if this was the last reference.
|
inline |
See if this handle is empty.
| ContactId SimTK::Contact::getContactId | ( | ) | const |
| Condition SimTK::Contact::getCondition | ( | ) | const |
Find out the current condition of this Contact object.
| ContactSurfaceIndex SimTK::Contact::getSurface1 | ( | ) | const |
Get the first surface involved in the contact, specified by its index within its contact set or ContactTrackerSubsystem.
| ContactSurfaceIndex SimTK::Contact::getSurface2 | ( | ) | const |
Get the second surface involved in the contact, specified by its index within its contact set or ContactTrackerSubsystem.
| const Transform& SimTK::Contact::getTransform | ( | ) | const |
Return the transform X_S1S2 giving the pose of surface 2's frame measured and expressed in surface 1's frame, recorded at the time this Contact object was calculated.
| Contact& SimTK::Contact::setSurfaces | ( | ContactSurfaceIndex | surf1, |
| ContactSurfaceIndex | surf2 | ||
| ) |
Set the surfaces tracked by this Contact object.
Set the surface-to-surface relative transform X_S1S2.
| ContactTypeId SimTK::Contact::getTypeId | ( | ) | const |
Return a unique small integer corresponding to the concrete type of Contact object being referenced by this handle.
|
static |
|
inline |
|
inline |


In order to carry out Fourier analysis of fold shape, the fold must be upright. A vergency must therefore be eliminated by reshearing.
In case of vergency click on one point of the axial plane and then on a second point of that plane. The fold will be resheared to upright position.


Toggle navigation
Voting Wars: Vote your team to the top!
Voting for {{TEAMNAME}}
Add One Point
Add 5 Points.
Add 50 Points.


--- layout: default ---
June 29 Morning Service
Scripture: Luke 12:13-23 Lord's Day 44
Sermon: " The Love We Owe Our Neighbor:
Thou Shalt Not Covet”
1. The Goods Of The Neighbor
2. The Things On The Earth
3. That Contrary To The Law
June 29 Evening Service
Scripture: Acts 20:32 (Farewell)
Sermon: “Commending The Church To God”
1. A Wonderful Purpose
2. A Wonderful Meaning
3. A Wonderful Confidence


Connecting separated points. All three of the series should have their points connected with lines, and hovering over them should produce dot and legend overlays in the proper color.
Toggle ConnectSeparated:
All: true Series 1 disabled Series 2 disabled Series 3 disabled


What is good art?
In a speech by Neil Gaiman, he famously advises the graduating students to “make good art”.
Gaiman doesn’t qualify what “good art” should be, but he does give us some hints in the second part of this clip. First of all, Gaiman says you should make “your art”, “what only you can do”; something unique. And secondly, there should be vulnerability: “When you feel that just possibly, you’re walking down the street naked, exposing too much of your heart and your mind…showing too much of yourself, that’s the moment you may be starting to get it right”. It seems that Gaiman believes that good art should communicate something about the artist, in its uniqueness, or vulnerability.
When I first saw this, I thought this was something easy: to “put yourself in the artwork”. In junior college, my final artwork was an installation about fact and fiction, and how museums toe the line between the two. I thought this was plenty personal. I liked museums, and I put effort into the pieces in the installation.
But through the past four years of looking at art and continuously asking myself this question: “What is good art?”, I’ve been able to interact with Gaiman’s speech again and again, and come up with guidelines for making art that is personal.
In my second year, I saw a play put up by the USP Productions crew, called Somnogram. Many people said they didn’t understand the play after watching it, and the playwright/director had subsequently written an article that explained the plot(s) and timelines, and pointed out the play’s own symbolism.
Back then, I was certain that Somnogram was not “good art” based on its content. The lighting was dramatic and the sound design was immersive, but I felt that the characters had been trite and unrelatable. I also felt that the subsequent ‘explanation’ article was insulting to the audience. Saying that the audience “[wasn’t] meant to” understand the plot, “But if [they] did, it’s a bonus.” seemed to suggest that the plot was only accessible to those ‘smart enough’. I had tweeted these thoughts. To my surprise, the playwright/director looked my Twitter handle up in the NUS directory:
Rarely are we privy to the original intentions behind artworks, so the last sentence made me stop and think. She wanted to connect to people, to be relatable – to make, in my definition, good art. Yet I did not connect with her play, nor her explanation and emails. Why?
To me, the play had been too impersonal. It’s original sentiments had been intellectualised and distanced so much that they weren’t discernible in the play itself. The director’s emails make this clear. In the highlighted paragraph of the first email, she says she wanted to create a play that would make the audience prioritise feeling over thinking, and discusses the use of the dream structure to accomplish that. In her later emails, which I cannot disclose, she tells me a very personal story on why she wanted to do that.
But when I was watching it, I could not share those sentiments because they had been abstracted into the incoherent structure of the play. It seemed less like the “good art” ideal shared by the director and I, and more like a formal experiment, with a hypothesis like “people will focus on feeling more than thinking if the plot is incoherent”.
Looking back at my A level art, I realise that it suffers from the same intellectualisation that I criticise Somnogram for. This is one of my favourite parts of the installation, where I show an “alternative natural history” where animals were “evolved” from plants. I thought about how museums could construct narratives that weren't true, and then abstracted that into a broad topic, the “evolution of ideas”. The development board for that topic is pictured below - it shows how I thought about piecing together facts into imagined narratives.
Doing that had brought me further away from my original sentiments. So, to put it in Gaiman’s terms – was my installation good art? Was it unique? Perhaps. But vulnerable? Definitely not as much as I would like it to be. Perhaps if I had focused more on the feeling that had made me want to create a museum-like installation than trying to explain it, my installation might have had more heart to it.
Furthermore, in the article she wrote after the play and her emails to me, she explained the plot and highlighted its own symbolism. For me, that created too little room for interpretation. I am told what to think and what to feel; I don’t have the opportunity to think and feel with her. I couldn’t relate to it. So how do we make a work that is not only personal, but communicates that quality? In the email, she says she wanted people to understand the characters “in relation to the intensity of their own darker personal experiences”, but is that really how we connect to good art? Should we only understand someone else's experience in light of our own?
Recently, internet poets like Rupi Kaur and Lang Leav have attained commercial success, with many bestselling books.
I’ve always found these poems to be somewhat lacking. Recently, a spoken word poet, Trevor Viloria, made a series of tweets talking about the difference between relating and empathising.
I realised that, where poems such as the Lang Leav one above make the reader, as Viloria says, “put their own heart” into them by filling in the words with their own experience, the director of Somnogram had left us with no room to empathise, by directly telling us what we should get from the play. To make good art, it seems, we have to do a tough balancing act. We have to toe the line between saying too little, and saying too much.
To finish off this post, I’ll share my original reason for writing it, from two years ago. This was in my reply to Somnogram’s director’s email:
That review never materialised. It was too difficult to write.
But when I first shared my idea for this post to the class, Prof Ryan mentioned that I was nervous – and I was. I feel vulnerable putting my views on what “good art” is in public. Art is a tough topic to write about because everyone interprets it differently and each interpretation is usually very personal. But I really wanted to write about this, ever since I thought about it two years ago when I was replying to Somnogram's director. So perhaps like Gaiman says, vulnerability is a sign that you're going in the right direction. And, although my views here are only mine, I hope that you, my reader, will be able to empathise with it, even if you can’t relate.


pro
g
aid
Samuel Agyemang Prempeh
Home
Profile
My Questions
Subscriptions
Groups
Inbox
Log out
Ask a question
Sir Elvis
10 January 2018 at 15:00
Can someone please help me debug my code. Please find a screenshot of it below...Can someone please help me debug my code. Please find a screenshot of it below...
Feed from groups


Last week I talked about Coffeescript for scientists. Now we’re gonna get our hands dirty with D3.js to start our path on making visually stunning plots for the web. To follow this post you should have a setup similar to the one described in the Writing and debugging section of the previous post on Coffescript.
What D3.js is and is not
Before moving on, we should have a clear understanding of what D3.js is and is not. On the D3.js homepage, the main motto is “Data Driven Documents”. Think of an HTML page as a blank document and we can do anything we want with it, provided that we have the right tools. D3.js is the tool that allows us to bind arbitrary data to the document and apply data-driven operations, such as creating tables to rich, dynamic, and interactive visualizations. Hence, it’s not just a plotting package, but much more.
The beginning
Scientists are used to making static plots for journal publications, so we’ll begin with static outputs. In the next tutorial we’ll move into dynamic features. Continuing from the previous Coffeescript post, we revisit the polygon code with a small modification that includes a radius
parameter (for circle objects). You can follow these examples with the code I have created for this post here. This includes the HTML, Coffeescript, and javascscipt output to make the visuals shown below.
1 # Defining a function
2 polygon = (sides, size, radius, center) ->
3 # Setting up angles to get polygon vertices
4 circle = 2 * Math.PI
5 angle = circle / sides
6 points = []
7
8 # With the polygon defined we iterate through
9 # the sides to get the nth polygon we want.
10 for i in [0..sides]
11 x = (Math.cos(angle * i) * size) + center[0]
12 y = (Math.sin(angle * i) * size) + center[1]
13 points[i] = {"x": x, "y": y, "r": radius}
14
15 return points
To initiate the environment for D3.js we now include the following code with the polygon function.
1 # Creating data from our function, which is a sexagon
2 # centered at (250, 250).
3 polyData = polygon(6, 150, 20, [250, 250])
4
5 # Creating the d3.js object that will be called in a div class
6 # called "experimental".
7 svg = d3.select("#experimental")
8 .append("svg")
9 .attr("width", 500)
10 .attr("height", 500)
11
12 # Here we setup the object for circles along with the style
13 # Tip, think CSS.
14 circles = svg.selectAll("circle")
15 .data(polyData)
16 .enter()
17 .append("circle")
18 .style("fill", "gray")
19 .style("stroke", "none")
20 .style("stroke-width", 2)
21
22 # We passed polyData to '.data' above. In the 'circles' object
23 # data is stored as 'd'. Below we create functions that
24 # iteratively return the polyData values.
25 circleAttributes = circles
26 .attr("cx", (d) -> (d.x))
27 .attr("cy", (d) -> (d.y))
28 .attr("r", (d) -> (d.r))
Here’s the output in D3.js form.
This illustrates in terms of simple circles where the vertices of the polygon are located. What if we want to see the actual polygon itself? We can select the polygon
option and then use the same polyData
object.
1 # Similar to the circles object.
2 polygons = svg.selectAll("polygon")
3 .data([polyData])
4 .enter()
5 .append('polygon')
6 .style("stroke", "gray")
7 .style("stroke-width", 2)
8 .style("fill", 'none')
9
10 # This is setup such that we can add multiple polygons.
11 polygonAttributes = polygons
12 .attr("points",(d) -> (d.map((d) -> ([d.x, d.y]).join(",")).join(" ")))
Here we combine the circles with the polygon object, which are layered over one another.
With some of the basics we can play around with the polygon function to create some strange looking polygons. Here’s an example.
So far we have learned some basic operations on how to make static objects with D3.js and Coffeescript. If you look at js code that’s created from Coffeescript, you will see that Coffeescript is much more readable and easier to program in. This helps the scientist/researcher get work done in a short amount of time. Next week we’ll start looking into creating dynamic plots. Believe it or not, much of the code we went over here doesn’t have to changed much for dynamic operations.


Click the button to insert an item to the list.
Example explained: First create a LI node, then create a Text node, then append the Text node to the LI node. Finally insert the LI node before the first child node in the list.


Sen. Tom Cotton: Whistleblower statutes were not designed to launch impeachment proceedings
by Joshua NelsonSen. Tom Cotton said on Friday that the federal whistleblower statutes are designed to protect government employees from retaliation at work, not launch impeachment proceedings against a president.
“Our whistleblower statutes are designed to protect government employees from retaliation at work for reporting misconduct in their agency or their department,” the Arkansas Republican told “Fox & Friends,” taking issue with Democrats keeping the whistleblower shielded from Republican questioning.
"They are not there to allow you to launch impeachment proceedings against the President of the United States while colluding with Democratic operatives in Congress and throughout the government."
REP. JORDAN REJECTS WHISTLEBLOWER'S OFFER TO PROVIDE WRITTEN ANSWERS TO GOP QUESTIONS
In a letter penned late Wednesday to ranking Intelligence Committee member Rep. Devin Nunes, R-Calif., committee Chairman Adam Schiff said that Republicans must justify the relevance of any witnesses they would want to call in public hearings as part of the probe.
The rules, adopted last week, give Republicans the ability to subpoena witnesses, with the concurrence of Democratic committee chairs. If the chair does not consent, the minority can appeal to the full committee.
Cotton said that Schiff, D-Calif., would not say that the whistleblower qualifies to be questioned by Republicans under his impeachment proceeding's rules.
The process still gives Democrats final say over witnesses, however, making it unlikely they can follow through on their plan to call Schiff to testify about his contact with the whistleblower.
Cotton said that Schiff and House Speaker Nancy Pelosi, D-Calif., are going the "extra mile" to protect former Vice President Joe Biden from questions about his family's business dealings in Ukraine.
"I can't imagine that she wants to see Joe Biden or Hunter Biden called to account for this obvious conflict of interest during the Obama era," Cotton said.
CLICK HERE TO GET THE FOX NEWS APP
“These questions basically say the Republicans can only have witnesses if they will play into his storyline. Nothing that would actually portray what truly happened. Certainly, nothing that would allow the calling of what may be the most important witnesses in this matter,” Cotton said.
Fox News’ Julia Musto contributed to this report.


MY PLANTS
Species: Philodendron Age: 4 months old Watering: Once a week
Species: Nephthytis Age: 4 months old Watering: Every 2 days
Species: Begonia Age: 2 months old Watering: Twice a week
Species: Peperomia Age: 3 weeks old Watering: Once a week


Connected
IP: $(ip)
Mac: $(mac)
Voucher: $(username)
Remaining Time:
Expiration Time:
-
$(bytes-in-nice)
|
$(bytes-out-nice)
Select Vendo:
ADD TIME
PROMO RATES
LOGOUT
Please insert the coin
×
Coin
Total Time
0
0 Day 0 Hour 0 Min 0 Sec
Promo Rates
×
Rates
Validity(Expiration)
Rates loading....


About Me
My name is Michael Gutierrez and I am a Web Developer. Ever since I can remember I have been interested in computers and what they are capable of. I am always striving to push the boundaries and Web Development is the perfect environment to do so.
It all started when I was introduced to a trial version of Adobe Dreamweaver when I was 10 years old. I was fascinated by hyperlinks and the fact that you could display information in so many different and interactive ways.
When I made my first website I was so excited that I showed everyone that I knew and the positive reinforcement I received then led me to persue my passion.
I made several web sites in my free time throughout highschool but I spent most of my time with photo manipulation in Adobe Photoshop and dabbled in some animation.
Upon completing the HSC, while everyone else was still confused about their ambitions for the future, I was wholehearted in my decision to continue my studies in Web Development and obtain a prospective career in this field.
I originally anticipated studying at the University of Wollongong, but as they did not have a course specific to my interests, I decided to do a Diploma of Information Technology (Multimedia) at Wollongong TAFE.
I felt this course was more suitable to the field of IT that I wished to explore, so I pressed through the 18 month course in only one year, and luckily by then, the University of Wollongong had just released a Web Design and Development Major for the Bachelor of Information Technology course.
While this was good news, everytime I introduce myself to someone and they ask me what I do it can be a bit of a mouthful.


md-progress-bar
is a component for indicating progress and
activity, matching the spec of
Material Design Progress & Activity.

Example:
<md-progress-bar mode="indeterminate" color="primary"></md-progress-bar>
<md-progress-bar mode="indeterminate" color="accent"></md-progress-bar>
<md-progress-bar mode="indeterminate" color="warn"></md-progress-bar>
Properties:
| Name | Type | Description | |||
|---|---|---|---|---|---|
color
|
`"primary" | "accent" | "warn"` | The color palette of the progress indicator | |
mode
|
`"determinate" | "indeterminate" | "buffer" | "query"` | The mode of the progress indicator |
value
|
number | The current progress percentage for determinate indicators | |||
bufferValue
|
number | The current progress percentage for buffer secondary indicators |


{% include head.html %}
{% include navigation.html %} {% include carousel.html %}
{{ content }} {% include footer.html %}
{% include commonjs.html %}


| Class | Twig::Friend |
| In: |
lib/twig/friend.rb
|
| Parent: | Object |
| client | [RW] | |
| friended | [RW] | |
| info | [RW] | |
| timeline | [RW] |
# File lib/twig/friend.rb, line 232 def initialize(client, info) @client = client @info = info @friended = true end
Sets the Twig::Friend user as a friend on the Twitter server, and toggles the @friended variable to true.
If the Twig::Friend user is already set as a friend, or if Twig can‘t properly set the user as a friend on the Twitter server, an error will be raised.
# File lib/twig/friend.rb, line 299 def befriend(id=nil) if ! @friended result = @client.friend(:add, @info.id) if result self.toggle output = result else output = nil raise "Unable to befriend user<EMAIL_ADDRESS>end else output = nil raise ArgumentError<EMAIL_ADDRESS>is already your friend." end return output end
Removes the Twig::Friend user as a friend on the Twitter server, and toggles the @friended variable to false.
If the Twig::Friend user not already set as a friend, or if Twig can‘t properly remove the user as a friend on the Twitter server, an error will be raised.
# File lib/twig/friend.rb, line 323 def defriend(id=nil) if @friended result = @client.friend(:remove, @info.id) if result self.toggle output = result else output = nil raise "Unable to defriend user<EMAIL_ADDRESS>end else output = nil raise ArgumentError<EMAIL_ADDRESS>is not currently your friend." end return output end
Returns whether or not the Twig::Friend object is registered as a friend on the Twitter server: true or false
Twig does not contact the server to get this data. Instead, the @friended boolean is set to true when the Twig::Friend object is created, and is toggled between true and false if the Twig::Friend.befriend and Twig::Friend.defriend methods are called.
# File lib/twig/friend.rb, line 252 def is_friend? @friended end
Sends a message to a Twig::Friend user. text of the message must be no more than 140 characters or an ArgumentError will be raised.
# File lib/twig/friend.rb, line 259 def message(text) if text.size <= 140 @client.message(:post, text, @info) else raise ArgumentError, "Direct Messages (DMs) must be no longer than 140 characters. " + "Please trim #{text.size - 140} characters from your message " + "and try again." end end
Returns an array of all recent status objects for the Twig::Friend user.
If the timeline hasn‘t been fetched yet for the Twig::Friend user, it will be fetched from the server, otherwise, the array will be called from the @timeline variable.
The timeline can be refreshed from the server by calling timeline with the :update, :refresh or :sync Symbols for action.
# File lib/twig/friend.rb, line 278 def timeline(action=nil) if @timeline case action when :update, :refresh, :sync @timeline = @client.timeline_for(:user, :id => @info.id.to_s) when nil @timeline else raise ArgumentError, "#{action} is not a valid argument for friend.timeline." end else @timeline = @client.timeline_for(:user, :id => @info.id.to_s) end end


I have tried this compound twice, the last time being several months ago, though I took some notes at the time, as I always do.
4-FMP is definitely an amphetamine-like stimulant, though with a mellow, less edgy character. For me, the amphetamine side-effects are moderated and its euphoria is longer lasting. I got no special insights under this compound although it was an excellent social enhancer, like a very mellow methamphetamine. Most importantly for me, the come-down was very moderate; I tend to suffer very badly from the after-effects of dopamine related stimulants. I still got my usual 'sweaty armpits' and 'shrunken organ' side effects though.
Some people speak of a serotonin-like effect of 4-FMP. This may be true, though it is of far less magnitude than MDMA.
Pure 4-FMP has a pleasant, vaguely citrous smell and taste.
There was no chance of sleeping after taking 100 mg at 9:00 PM and I quite happily kept going until the next evening, when I slept soundly and awoke feeling fully refreshed. I never felt over-stimulated during the evening, and the next day, I didn't feel like the tweaker who wants to sleep but cannot.
For me, a far more pleasurable experience than meth and similar. 100mg of 4-FMP, a few glasses of red wine and some excellent company cannot be beaten. Set is everything.
Sredni
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


- Apple
- Orange
- Pineapple
- Pear
- Cherry
- Item 1 ✖
TAG
[tag]
- noun
-
- a label attached to someone or something for the purpose of identification or to give other information. "he gave his pet a collar with a metal name tag" synonyms: label, ticket, badge, mark, marker, tab, tally, sticker, docket, stub, chit, chitt, counterfoi, flag, stamp "a price tag"
- a small piece or part that is attached to a main body.
- verb
-
- attach a label to. "mothers suspected that their babies had been wrongly tagged during an alarm at the hospital" synonyms: label, attach tags to, put a label on, mark, ticket, earmark, identify, docket, flag, indicate "the bottles were tagged with colour-coded labels"
- add to something, especially as an afterthought or with no real connection. "she meant to tag her question on at the end of her remarks" synonyms: add, tack, join, attach, append, affix, annex "their heads were so large that the rest of their bodies seemed tagged on as an afterthought"


java.lang.Object java.io.InputStream cz.dhl.ftp.FtpInputStream
Allows reading from FTP file.
Ftp
,
FtpFile
| Constructor Summary | |
FtpInputStream(FtpFile file)
Open 'retreive' InputStream for given filename. |
|
FtpInputStream(FtpFile file,
FtpConnect connect,
CoConsole console)
Open 'retreive' concurent InputStream for given filename. |
| Method Summary | |
int |
available()
Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. |
void |
close()
Close current data transfer and close data connection. |
void |
mark(int readlimit)
Marks the current position in this input stream. |
boolean |
markSupported()
Tests if this input stream supports the mark and
reset methods. |
int |
read()
Reads the next byte of data from the input stream. |
int |
read(byte[] b)
Reads some number of bytes from the input stream and stores them into the buffer array b . |
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data from the input stream into
an array of bytes. |
void |
reset()
Repositions this stream to the position at the time the mark method was last called on this input stream.
|
long |
skip(long n)
Skips over and discards n bytes of data from this input
stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FtpInputStream(FtpFile file) throws java.io.IOException
RETR - retrieve
This command causes the server-DTP to transfer a copy of the file, specified in the pathname, to the server or user-DTP at the other end of the data connection. The status and contents of the file at the server site shall be unaffected.
file
- the file to be opened for reading
java.io.IOException
- socket error
FileNotFoundException
- Server file not found.public FtpInputStream(FtpFile file, FtpConnect connect, CoConsole console) throws java.io.IOException
Single ftp connection cannot handle multiple concurent data transfers. This limitation can be eliminated by creating new ftp connection for each concurent data transfer. This constructor creates separate Ftp instance.
Note (1) supplying same CoConsole instance for multiple sessions will produce messed output.
Note (2) This code may need to be run in separate thread to process multiple files concurently.
RETR - retrieve
This command causes the server-DTP to transfer a copy of the file, specified in the pathname, to the server or user-DTP at the other end of the data connection. The status and contents of the file at the server site shall be unaffected.
file
- the file to be opened for readingconnect
- login detailsconsole
- message output
java.io.IOException
- socket errorFtpInputStream(FtpFile)
| Method Detail |
public int available() throws java.io.IOException
The available
method for class InputStream
always returns 0
.
java.io.IOException
- if an I/O error occurs.public void close() throws java.io.IOException
If no reply ABOR - abort
This command tells the server to abort the previous FTP service command and any associated transfer of data. No action is to be taken if the previous command has been completed (including data transfer). The control connection is not to be closed by the server, but the data connection must be closed. There are two cases for the server upon receipt of this command:
(1) the FTP service command was already completed. The server closes the data connection (if it is open) and responds with a 226 reply, indicating that the abort command was successfully processed.
(2) the FTP service command is still in progress. The server aborts the FTP service in progress and closes the data connection, returning a 426 reply to indicate that the service request terminated abnormally. The server then sends a 226 reply, indicating that the abort command was successfully processed.
java.io.IOException
- socket errorpublic void mark(int readlimit)
reset
method repositions this stream at the last marked
position so that subsequent reads re-read the same bytes.
The readlimit
arguments tells this input stream to
allow that many bytes to be read before the mark position gets
invalidated.
The general contract of mark
is that, if the method
markSupported
returns true
, the stream somehow
remembers all the bytes read after the call to mark
and
stands ready to supply those same bytes again if and whenever the method
reset
is called. However, the stream is not required to
remember any data at all if more than readlimit
bytes are
read from the stream before reset
is called.
readlimit
- the maximum limit of bytes that can be read before
the mark position becomes invalid.reset()
public boolean markSupported()
mark
and
reset
methods.
true
if this true type supports the mark and reset
method; false
otherwise.mark(int)
,
reset()
public int read() throws java.io.IOException
int
in the range 0
to
255
. If no byte is available because the end of the stream
has been reached, the value -1
is returned. This method
blocks until input data is available, the end of the stream is detected,
or an exception is thrown.
-1
if the end of the
stream is reached.
java.io.IOException
- if an I/O error occurs.public int read(byte[] b) throws java.io.IOException
b
. The number of bytes actually read is
returned as an integer. This method blocks until input data is
available, end of file is detected, or an exception is thrown.
If b
is null
, a
NullPointerException
is thrown. If the length of
b
is zero, then no bytes are read and 0
is
returned; otherwise, there is an attempt to read at least one byte. If
no byte is available because the stream is at end of file, the value
-1
is returned; otherwise, at least one byte is read and
stored into b
.
The first byte read is stored into element b[0]
, the
next one into b[1]
, and so on. The number of bytes read is,
at most, equal to the length of b
. Let k be the
number of bytes actually read; these bytes will be stored in elements
b[0]
through b[
k-1]
,
leaving elements b[
k]
through
b[b.length-1]
unaffected.
If the first byte cannot be read for any reason other than end of
file, then an IOException
is thrown. In particular, an
IOException
is thrown if the input stream has been closed.
The read(b)
method for class InputStream
has the same effect as:
read(b, 0, b.length)
b
- the buffer into which the data is read.
-1
is there is no more data because the end of
the stream has been reached.
java.io.IOException
- if an I/O error occurs.read(byte[], int, int)
public int read(byte[] b, int off, int len) throws java.io.IOException
len
bytes of data from the input stream into
an array of bytes. An attempt is made to read as many as
len
bytes, but a smaller number may be read, possibly
zero. The number of bytes actually read is returned as an integer.
This method blocks until input data is available, end of file is detected, or an exception is thrown.
If b
is null
, a
NullPointerException
is thrown.
If off
is negative, or len
is negative, or
off+len
is greater than the length of the array
b
, then an IndexOutOfBoundsException
is
thrown.
If len
is zero, then no bytes are read and
0
is returned; otherwise, there is an attempt to read at
least one byte. If no byte is available because the stream is at end of
file, the value -1
is returned; otherwise, at least one
byte is read and stored into b
.
The first byte read is stored into element b[off]
, the
next one into b[off+1]
, and so on. The number of bytes read
is, at most, equal to len
. Let k be the number of
bytes actually read; these bytes will be stored in elements
b[off]
through b[off+
k-1]
,
leaving elements b[off+
k]
through
b[off+len-1]
unaffected.
In every case, elements b[0]
through
b[off]
and elements b[off+len]
through
b[b.length-1]
are unaffected.
If the first byte cannot be read for any reason other than end of
file, then an IOException
is thrown. In particular, an
IOException
is thrown if the input stream has been closed.
The read(b,
off,
len)
method
for class InputStream
simply calls the method
read()
repeatedly. If the first such call results in an
IOException
, that exception is returned from the call to
the read(b,
off,
len)
method. If
any subsequent call to read()
results in a
IOException
, the exception is caught and treated as if it
were end of file; the bytes read up to that point are stored into
b
and the number of bytes read before the exception
occurred is returned. Subclasses are encouraged to provide a more
efficient implementation of this method.
b
- the buffer into which the data is read.off
- the start offset in array b
at which the data is written.len
- the maximum number of bytes to read.
-1
if there is no more data because the end of
the stream has been reached.
java.io.IOException
- if an I/O error occurs.read()
public void reset() throws java.io.IOException
mark
method was last called on this input stream.
The general contract of reset
is:
markSupported
returns
true
, then:
mark
has not been called since
the stream was created, or the number of bytes read from the stream
since mark
was last called is larger than the argument
to mark
at that last call, then an
IOException
might be thrown.
IOException
is not thrown, then the
stream is reset to a state such that all the bytes read since the
most recent call to mark
(or since the start of the
file, if mark
has not been called) will be resupplied
to subsequent callers of the read
method, followed by
any bytes that otherwise would have been the next input data as of
the time of the call to reset
. markSupported
returns
false
, then:
reset
may throw an
IOException
.
IOException
is not thrown, then the stream
is reset to a fixed state that depends on the particular type of the
input stream and how it was created. The bytes that will be supplied
to subsequent callers of the read
method depend on the
particular type of the input stream.
java.io.IOException
- if this stream has not been marked or if the
mark has been invalidated.mark(int)
,
IOException
public long skip(long n) throws java.io.IOException
n
bytes of data from this input
stream. The skip
method may, for a variety of reasons, end
up skipping over some smaller number of bytes, possibly 0
.
This may result from any of a number of conditions; reaching end of file
before n
bytes have been skipped is only one possibility.
The actual number of bytes skipped is returned. If n
is
negative, no bytes are skipped.
n
- the number of bytes to be skipped.
java.io.IOException
- if an I/O error occurs.


Brainless Tales
The prices are based on daily (UTC time) performance
More features moon.. oh wait.. soon
Bitfinex
Bitstamp
Blockchain Explorer API
Bitcoinfees.21
You can also help the hodler coaster guy reach the moon: 1mPjCjdTMwAGXuj7v2DsrSK3AerqwtF5f
You can find me on reddit /u/roller-coaster-guy


Ice cream is a sweetened frozen food typically eaten as a snack or dessert. It may be made from dairy milk or cream and is flavoured with a sweetener, either sugar or an alternative, and a spice, such as cocoa or vanilla, or with fruit such as strawberries or peaches.
What are the harmful effects of ice cream?
Your obesity risk increases.
Your blood sugar stays somewhat normal.
blood pressure isn't affected.
You'll gain belly fat.
You'll feel happier.
Your muscles will get stronger.
Your bones will get stronger.
Your heart disease risk bumps up.


Testing, testing, 1.2.3.
A couple of things are going on here – 1 st and foremost, I've changed to the Hemingway theme. I'm not sure if I'll stay with it as I'm not convinced I can get content across with its layout but it's quite striking, I find.
This was prompted by Kev upgrading my installation of Wordpress to 2.0.4 – it may be that what he did I could have done myself. From what I see when I look at the directories, it certainly does seem that way. But I thought he'd do some magic that allowed him to keep everyone up to date at the same time.
Also happening here is the use of Textfile as a markup tool. Using 'confluence' at work now, so I've gotten use to Textile-style markup. The only thing is the url markup, which I prefer in confluence. e.g. in confluence [plain text|url|title=foo]
, in Textile, "plain text(foo)":url
. It's probably something I can handle, just unfortunate that I have to attend some neurons to one, and fire a few synapses to use the other. Oh, my, dendrites.
Another essential feature, which incidentally prompted the flurry of activity, is I had gotten sick of accidentally deep-sixing a post because I had clicked on a link in the preview for testing purposes, or had accidentally refreshed the page because I do that sometimes out of habit, or am too fast while switching windows in Firefox on a Mac (cause it's really well implemented – option-propeller-[left|right arrow]). In any case, wordpress now thoughtfully puts up a dialog confirming that I want to trash the entry. Confluence's behaviour of saving a draft would also have been acceptable, maybe preferred.
So it remains to be seen what will happen to my gallery most recent pictures, my 'gamercard': and my last.fm recently scrobbled list.
About this entry
You"re currently reading "Testing, testing, 1.2.3.," an entry on a crick in the net
- Published:
- 09.03.06 / 12am
- Category:
- Circular File
Well, everyone is up to date, it's just that we don't use a shared WP installation for everyone (like, say, wordpress.com). This gives everyone max flexibility, but it can be a bit of a pain to make sure everyone's current (we won't even speak of gallery, although g2 is a server based install for every site but one). It is striking, but I'm not sure if I dig it or not. I shall reflect upon it, and get back to you.
Also... typo – see 'Textile'
err... 'Textfile'. Ok, I shall stop spam-commenting now.
Neat layout. I've been thinking about switching to something cleaner, and with the 'interesting links' at the bottom rather than one side. I may yet follow suit. (This is of course after I complete my WordPress migration )


?I
O
a
IU
The
New
York
copyright
reserved
botanical
Garden
HERBARIUM
OF
THE
NEW
YORK
BOTANICAL
GARDEN
Plants
of
PORTO
RICO
No.
9491
Dipholis
salicifolia
(L.)
A.
DC.
Tree,
8
m.
high.
Berries
black.
Playa
Boqueron,
Cabo
Rojo.
BOTANlCAl
NEW
YORK
BOTANICAL
GARDEN
01443878
Collected
by
Bro#
Alain.
July
14,
1962
01443878
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


Select the traffic visulaizations that are loaded:
Day
Night
Weekday
Weekend
Monday
Tuesday
Friday
Friday Daytime
Friday Nighttime
Saturday
Saturday Daytime
Saturday Nighttime
Loading...


{% extends "base.html" %} {% block content %}
The purpose of this website/database is to collect and distribute statistical maps of the brain. Such maps are acquired by scientists all around the world using brain imaging techniques such as MRI or PET in a combined effort to map the functions and structures of the brain. Unfortunately, due to the limitations of the academic paper form (as in publication not pulp) in which most findings are disseminated, only coordinates of peaks are reported. This makes doing meta-analyses and hypothesis-driven studies very difficult. With unthresholded statistical maps, one can find subthreshold effects that are consistent across studies, which cannot be achieved using just peak coordinates. You can read more about NeuroVault in our paper.
When you submit data to NeuroVault you will be provided with a permanent link for each map. The links lead to an interactive visualization. You can share you results with other researchers without sending files around! Readers of your papers will also appreciate additional clarity provided by an interactive visualization. Therefore you can include links to your NeuroVault dataset in your paper (see this and this paper). On top of that, all the maps uploaded to NeuroVault can be decoded using neurosynth.org.
All of NeuroVault is backed up daily into off site storage. In addition all of the public collections that have been associated with a paper (through the DOI field) will be archived in Stanford Digital Repository (SDR). This operation is performed in bulk twice a year and ensures long term preservation of maps deposited in NeuroVault.
Decoding is an experimental feature that takes your map and compares it with patterns associated with cognitive terms in thousands of papers. All the hard work is provided by neurosynth.org, which will pull your map from NeuroVault and run spatial correlation restricted by a gray matter mask. Give it a try - just hit the "Decode" button above any image. This can potentially be very useful in interpreting your results. The feature is still experimental and we would be grateful for any feedback.
If you refer to NeuroVault in an academic context (manuscript or talk) please cite our paper:
Gorgolewski KJ, Varoquaux G, Rivera G, Schwartz Y, Ghosh SS, Maumet C, Sochat VV, Nichols TE, Poldrack RA, Poline J-B, Yarkoni T and Margulies DS (2015) NeuroVault.org: a web-based repository for collecting and sharing unthresholded statistical maps of the brain. Front. Neuroinform. 9:8. doi: 10.3389/fninf.2015.00008
Citing this paper is the best way to show your appreciation and will help us with securing funds necessary to run and improve NeuroVault.
No - not at all. We accept any brain data that is stored in a 3D NIFTI format and has been transformed into MNI space. This means that structural studies (for example VBM) as well as PET are more than welcomed here.
Yes there is a RESTful API - you can find it here. There are also python and R clients for the API. Please let us know if you build something cool using NeuroVault!
Excellent! Please use the "Give feedback" button in the toolbar.
NeuroVault is being built by a group of dedicated developers led by Chris Gorgolewski. They include (in no particular order): Tal Yarkoni, Yannick Schwartz, Camille Maumet, Vanessa Sochat, Joe Wexler, Daniel Margulies, Anton Burnashev, Joke Durnez and Asier Erramuzpe. Additionally many people have been consulting on this project, including Tom Nichols, Yaroslav Halchenko, Michael Hanke, Russell Poldrack, Michael Milham, Satrajit Ghosh and the INCF Neuroimaging Data Sharing group. The project is supported by International Neuroinformatics Coordination Facility and Max Planck Society (in particular Max Planck Institute for Human Cognitive and Brain Sciences and Gesellschaft für wissenschaftliche Datenverarbeitung mbH Göttingen).
Fantastic! You can send us a pull request on github.
NeuroVault is dedicated to just statistical maps, but you should check out OpenNeuro. Additionally you might consider publishing a data paper to get credit for your sharing efforts.
We use Papaya and pycortex for 3D view.
All data in NeuroVault (with exclusion of private collections) is distributed under CC0 license.
Use this command line FSL tool: fslcpgeom MNIatlas
image_with_weird_header
. (Many thanks to Leonie Lampe for
the
tip).
Linking unthresholded maps is a great way to allow the readers of your paper to explore your results and reuse them in their work. We recommend grouping all maps from one study/paper in a single collection and including a link to that collection in your manuscript. Additionally one can include links to individual maps in figure captions. An example can be found in the following publication, the caption of Fig. 3. Please note that if you decide to use a private collection (e.g., during peer-review), a unique string is added to the URL so people would not be able to guess the address. Additionally, it's worth mentioning that if your collection was initially private (so it got longer URLs) and you later made it public, both URLs (public and private) will resolve correctly. This allows users to keep collections private during peer-review and make them public after the paper gets published (which is not required but can be preferred by some).
The surface maps were obtained with the registration fusion approach. If you use the surface maps in a manuscript or talk, please reference the paper:
Wu J, Ngo GH, Greve DN, Li J, He T, Fischl B, Eickhoff SB, Yeo BTT (2018) Accurate nonlinear mapping between MNI volumetric and FreeSurfer surface coordinate systems. Human Brain Mapping. doi: 10.1002/hbm.24213
All transformations (including the reverse fsaverage-to-MNI transformations) are available here.


Home
Indexer
PDF File Upload
Choose a local file:
The content of the paper will be extracted and compared against an existing meta-data database and saved in XML-format. You are given the opportunity to correct this data if need be in the next step.
Upload
Edit Meta-Data
Index New Files
Choose and edit the files you want to index.
Show Files of Index Directory


Everyone who joins the Queer Scouts IRC Channel is a Queer Scout! Queer Scouts must follow the Queer Scout Law. Therefore, everyone who joins the Queer Scouts IRC Channel must follow the Queer Scout law.
The official viewpoint of the Queer Scouts IRC Channel is that diversity of belief strengthens a community. This viewpoint is drawn from experience in previous IRC channels and from evidence from irl (in real life) communities. Homogeneous groups tend to be closed-minded and unaccepting of differences.
This is good: "I disagree, and this is why."

Acting in a consistently mean or bullying manner is not accepted. People on the Queer Scouts IRC Channel are expected to be respectful of others. If you have a disagreement with someone, you can settle it with the person (unless that person refuses to).
The Queer Scouts IRC Channel are made so that we have a space where our genders are respected. Refusing to respect someone's gender is telling them that you don't respect them or care about them at all.
This is good: "What pronouns can I use to refer to you as?"
This is not good: "Are you a boy or a girl?"
This is part of respecting others' genders. (See #4)
This is good: "Sharon is agender and their pronouns are they/them/theirs."
This is not good: "Sharon says that they're agender but I think they're really a dude and they don't want to admit it."
We acknowledge that "uncomfortable" seems like a broad category. You may think this is unjust and could be used for the malicious silencing of your speech. However, please recognize that the Queer Scouts IRC Channel is not a nation and is not required to guarantee 100% unrestricted free speech. If you came into my house and started making me uncomfortable, I would tell you to stop or I'd kick you out. Furthermore, there are plenty of good reasons someone might want to change the topic. Realize that you don't know what's happening inside everybody's head and that everybody's experiences are not like your own.
This is good:
Mark: "This isn't the best subject for me. Can we talk about something else? :/"
Sharon: "Okay. Have you seen what I drew on the Drawpile?"
This is not good:
Mark: "This isn't the best subject for me. Can we talk about something else? :/"
Sharon: "No, you're so whiny, Mark. Grow a thicker skin."
See the explanation for #6 above.
This is good:
Mark: "Heyyyy cutie."
Sharon: "Please stop flirting with me. You're making me uncomfortable."
Mark: "Okay, sorry. It won't happen again!"
This is not good:
Mark: "Heyyyy cutie."
Sharon: "Please stop flirting with me. You're making me uncomfortable."
Mark: "Sheesh, what's your problem?"
Glamorizing illegal activities makes them seem acceptable. This encourages horrible behavior and systemic oppression. Even for morally ambiguous (yet illegal) activities, it can encourage people to participate in activities that can get them in trouble with the law. We here at the Queer Scouts IRC Channel do not tolerate poopy heads.The aim of this channel is to be safe for everyone.
The Queer Scouts IRC Channel is safe for people under 18. Plus, people may be at work. That means that gratuitous NSFW content is not acceptable outside of PM, and is only acceptable there when consent is given. Educational content is acceptable but must be tagged, for obvious reasons.
That's the rule! The Queer Scouts IRC Channel is supposed to be a safe place, and if you don't agree you can leave.
 Also, this rule does not imply that it's okay to say horrible things about people who aren't part of minorities. Rule #1 says to respect others and to be kind and empathetic. This rule enforces it in a necessary area.


Student Monitoring
Home
About
Settings
Logout
Admin
Changes saved
×
Courses
Monitored
Course
On
Off
MATH-3320-01
On
Off
MATH-3320-02
On
Off
MATH-3334-01
Other stuff


Tutorial: Step by step analysis
Prerequisites
- Make sure that MISA++ Kidney Glomeruli Segmentation and MISA++ Result Analyzer are installed
- Make sure that the MISA++ ImageJ plugin is installed
- Download the example data
Video tutorial
The video tutorial covers the same steps as the written tutorial.
Written tutorial
The following step-by-step tutorial shows the quantitative analysis of glomeruli by creating statistics and plots of their diameter.
Start ImageJ and open the MISA++ plugin by navigating to Plugins → MISA++ for ImageJ. This will open a list of all available MISA++ applications. Select “ MISA++ Kidney Glomeruli Segmentation”.
Launch to open a tool that allows preparation of the data and changing parameters.
|
Click Import folder and select the folder that contains the example data set to automatically add samples and import images.
|
Select the folder that contains our example data set and click Open.
New Sample”, as we already imported all necessary data. |
|
To enable multi-threading, select the Runtime tab and increase the number of threads.
Run and then Run now to start the analysis. After the analysis finished, the plugin will ask you to further analyze the results.
|
Example: Analyzing results
The analysis tool displays a list of all output data and (if available) input data and allows importing data back into ImageJ. If you want to import the glomeruli into ImageJ, click Bioformats Import next to the “glomeruli3d” data. |
|||
|
To analyze quantification results, click Browse quantification results.
|
To analyze the glomeruli, select Objects in the middle column and then “ Glomerulus” above the table. |
|
|
Due to performance reasons, the table does not contain all available information about each glomerulus. To add more, click Edit columns.
Clear selection and select the columns
|
||
|
If you are happy with the table, click Analyze.
|
To calculate mean and variance of the diameter, select a cell in the “diameter/value” column and navigate to Add column → Copy selected column. Then click “OK”.
|
Click “Integrate columns” at the top right corner and assign following roles to each column:
Click “Calculate”. |
|
The table now shows the mean and variance of the glomeruli, categorized by the sample and if the glomerulus is valid according to the segmentation algorithm.
Undo to restore the original table and then Create plot. |
||
|
Set the plot type to Box Plot, set the category to “Table.Sample”, X axis to “Table.valid” and the list of values to the diameter. |


OSR Testing h1 - Focus and blur
this page and will get this red black
- OnPaint should be called each time a page loads
- Move mouse
to require an OnCursorChange call
- Hover will color this with
red. Will trigger OnPaint once on enter and once on leave
- Right clicking will show contextual menu and will request
GetScreenPoint
- IsWindowRenderingDisabled should be true
- WasResized should trigger full repaint if size changes.
- Invalidate should trigger OnPaint once
- Click and write here with SendKeyEvent to trigger repaints:
- Click here with SendMouseClickEvent to navigate:
- Mouse over this element will
trigger show a tooltip
- SELECTED_TEXT_RANGE
Drag here


Our troops are preparing for the BIG-DAY landing on the beaches of Sardinia (we thought the weather was nicer there). For us to successfully land on the BIG-DAY, we need to know the enemy troop positions. Lucky, one of our seductive SSPA agents, Madame Moth, has wooed a new machine away from under the nose of an enemy general. The MARK IV (MARK III was canceled due to budget overruns) again builds off the design of the MARK II. Except this time (drum roll please...) it has THREE wheels.
The MARK IV's third wheel is more complicated than the first two in that it's setting is based off the previously pressed character position. The machine shifts the letter based off the first two wheels, then it further ADDS to the index TWO TIMES the PREVIOUS LETTER'S position in the machine's alphabet. Note that the third wheel's initial position starts at 0.
You have a deadline to get this working before the BIG-DAY. So get moving!
JSON question... using the first two wheel positions of 4,7 and an input message of 'The white cliffs of Alghero are visible at night', given the new 3rd variable wheel, what is the resulting output?


{% extends 'email_template.html' %} {% block content %}
Dear {{ username }}, We have received the report you have submitted concerning {{ article_slug }} by {{ author }}. As per your message, the article breaches our terms of service under the category {{ report_category }} as you described it in your message {{ user_smessage }}. We have received your report and an associate will take appropriate action.
Happy Writing!


AlertCloud
Home
About
Contact
Your emergency number is:
+13472817079
Advanced Directive:
Emergency Notification:
Submit


|
BTK Python wrapper
0.3dev.0
Python bindings for the Biomechanical ToolKit library (BTK)
|
Class to read/write TRC files. More...
Public Member Functions | |
| def | CanReadFile |
| def | CanWriteFile |
| def | GetByteOrder |
| def | GetByteOrderAsString |
| def | GetFileType |
| def | GetInternalsUpdateOptions |
| def | GetStorageFormat |
| def | GetStorageFormatAsString |
| def | HasInternalsUpdateOption |
| def | Read |
| def | SetByteOrder |
| def | SetInternalsUpdateOptions |
| def | SetStorageFormat |
| def | Write |
| Public Member Functions inherited from btk.btkAcquisitionFileIO | |
| def | CanReadFile |
| def | CanWriteFile |
| def | GetByteOrder |
| def | GetByteOrderAsString |
| def | GetFileType |
| def | GetInternalsUpdateOptions |
| def | GetStorageFormat |
| def | GetStorageFormatAsString |
| def | HasInternalsUpdateOption |
| def | Read |
| def | SetByteOrder |
| def | SetInternalsUpdateOptions |
| def | SetStorageFormat |
| def | Write |
Additional Inherited Members | |
| Static Public Attributes inherited from btk.btkAcquisitionFileIO | |
| ASCII = _btk.btkAcquisitionFileIO_ASCII | |
| Binary = _btk.btkAcquisitionFileIO_Binary | |
| DataBasedUpdate = _btk.btkAcquisitionFileIO_DataBasedUpdate | |
| FileFormatOption = _btk.btkAcquisitionFileIO_FileFormatOption | |
| Float = _btk.btkAcquisitionFileIO_Float | |
| IEEE_BigEndian = _btk.btkAcquisitionFileIO_IEEE_BigEndian | |
| IEEE_LittleEndian = _btk.btkAcquisitionFileIO_IEEE_LittleEndian | |
| Integer = _btk.btkAcquisitionFileIO_Integer | |
| MetaDataBasedUpdate = _btk.btkAcquisitionFileIO_MetaDataBasedUpdate | |
| NoUpdate = _btk.btkAcquisitionFileIO_NoUpdate | |
| OrderNotApplicable = _btk.btkAcquisitionFileIO_OrderNotApplicable | |
| StorageNotApplicable = _btk.btkAcquisitionFileIO_StorageNotApplicable | |
| TypeNotApplicable = _btk.btkAcquisitionFileIO_TypeNotApplicable | |
| UpdateNotApplicable = _btk.btkAcquisitionFileIO_UpdateNotApplicable | |
| VAX_LittleEndian = _btk.btkAcquisitionFileIO_VAX_LittleEndian | |
Class to read/write TRC files.
Interface to read/write TRC files (Motion Analysis Corp.).
| def btk.btkTRCFileIO.CanReadFile | ( | self, | args | ) |
CanReadFile(self, filename) -> bool Checks if the given filename can be read by this AcquisitionFileIO. This methods should try to read the file header instead to check the file's suffix.
| def btk.btkTRCFileIO.CanWriteFile | ( | self, | args | ) |
CanWriteFile(self, filename) -> bool Checks if the given filename can be write by this AcquisitionFileIO. This method should try to determine if the file's suffix corresponds to one of the supported file's suffixes by this btkAcquisitionFileIO.
| def btk.btkTRCFileIO.GetByteOrder | ( | self | ) |
GetByteOrder(self) -> btkAcquisitionFileIO_impl::ByteOrder Gets the byte order of the file (only for binary file).
| def btk.btkTRCFileIO.GetByteOrderAsString | ( | self | ) |
GetByteOrderAsString(self) -> std::string Gets the byte order as a string.
| def btk.btkTRCFileIO.GetFileType | ( | self | ) |
GetFileType(self) -> btkAcquisitionFileIO_impl::FileType Gets the type of the file.
| def btk.btkTRCFileIO.GetInternalsUpdateOptions | ( | self | ) |
GetInternalsUpdateOptions(self) -> int Returns the option(s) used to update internals.
| def btk.btkTRCFileIO.GetStorageFormat | ( | self | ) |
GetStorageFormat(self) -> btkAcquisitionFileIO_impl::StorageFormat Return the format used to store points and analog channels.
| def btk.btkTRCFileIO.GetStorageFormatAsString | ( | self | ) |
GetStorageFormatAsString(self) -> std::string Gets the storage format as a string.
| def btk.btkTRCFileIO.HasInternalsUpdateOption | ( | self, | args | ) |
HasInternalsUpdateOption(self, option) -> bool Returns true if the given @a option is used or false if not.
| def btk.btkTRCFileIO.Read | ( | self, | args | ) |
Read(self, filename, output) Read the file designated by the given filename and fill the given btkAcquisition
| def btk.btkTRCFileIO.SetByteOrder | ( | self, | args | ) |
SetByteOrder(self, b) Sets the byte order of the file.
| def btk.btkTRCFileIO.SetInternalsUpdateOptions | ( | self, | args | ) |
SetInternalsUpdateOptions(self, options) Sets the option(s) used to update internals.
| def btk.btkTRCFileIO.SetStorageFormat | ( | self, | args | ) |
SetStorageFormat(self, s) Set the format used to store points and analog channels.
| def btk.btkTRCFileIO.Write | ( | self, | args | ) |
Write(self, filename, input) Write the file designated by the given filename with the content of the given btkAcquisition.