| Package | Description |
|---|---|
| org.apache.commons.collections4 |
This package contains the interfaces and utilities shared across all the subpackages of this component.
|
| org.apache.commons.collections4.bidimap | |
| org.apache.commons.collections4.map |
| Class and Description |
|---|
| MultiValueMap
Deprecated.
since 4.1, use
MultiValuedMap instead |
| Class and Description |
|---|
| AbstractIterableMap
Provide a basic
IterableMap implementation. |
| AbstractMapDecorator
Provides a base decorator that enables additional functionality to be added
to a Map via decoration.
|
| AbstractSortedMapDecorator
Provides a base decorator that enables additional functionality to be added
to a Map via decoration.
|
| Class and Description |
|---|
| AbstractHashedMap
An abstract implementation of a hash-based map which provides numerous points for
subclasses to override.
|
| AbstractHashedMap.HashEntry
HashEntry used to store the data.
|
| AbstractHashedMap.HashIterator
Base Iterator
|
| AbstractIterableMap
Provide a basic
IterableMap implementation. |
| AbstractLinkedMap
An abstract implementation of a hash-based map that links entries to create an
ordered map and which provides numerous points for subclasses to override.
|
| AbstractLinkedMap.LinkEntry
LinkEntry that stores the data.
|
| AbstractLinkedMap.LinkIterator
Base Iterator that iterates in link order.
|
| AbstractMapDecorator
Provides a base decorator that enables additional functionality to be added
to a Map via decoration.
|
| AbstractOrderedMapDecorator
Provides a base decorator that enables additional functionality to be added
to an OrderedMap via decoration.
|
| AbstractReferenceMap
An abstract implementation of a hash-based map that allows the entries to
be removed by the garbage collector.
|
| AbstractReferenceMap.ReferenceEntry
A MapEntry implementation for the map.
|
| AbstractReferenceMap.ReferenceStrength
Reference type enum.
|
| AbstractSortedMapDecorator
Provides a base decorator that enables additional functionality to be added
to a Map via decoration.
|
| CaseInsensitiveMap
A case-insensitive
Map . |
| CompositeMap
Decorates a map of other maps to provide a single unified view.
|
| CompositeMap.MapMutator
This interface allows definition for all of the indeterminate
mutators in a CompositeMap, as well as providing a hook for
callbacks on key collisions.
|
| DefaultedMap
Decorates another
Map returning a default value if the map
does not contain the requested key. |
| EntrySetToMapIteratorAdapter
Adapts a Map entrySet to the MapIterator interface.
|
| FixedSizeMap
Decorates another
Map to fix the size, preventing add/remove. |
| FixedSizeSortedMap
Decorates another
SortedMap to fix the size blocking add/remove. |
| Flat3Map
A
Map implementation that stores data in simple fields until
the size is greater than 3. |
| HashedMap
A
Map implementation that is a general purpose alternative
to HashMap . |
| LazyMap
Decorates another
Map to create objects in the map on demand. |
| LazySortedMap
Decorates another
SortedMap to create objects in the map on demand. |
| LinkedMap
A
Map implementation that maintains the order of the entries. |
| ListOrderedMap
Decorates a
Map to ensure that the order of addition is retained
using a List to maintain order. |
| LRUMap
A
Map implementation with a fixed maximum size which removes
the least recently used entry if an entry is added when full. |
| MultiKeyMap
A
Map implementation that uses multiple keys to map the value. |
| MultiValueMap
Deprecated.
since 4.1, use
MultiValuedMap instead |
| PassiveExpiringMap.ExpirationPolicy
A policy to determine the expiration time for key-value entries.
|
| PredicatedMap
Decorates another
Map to validate that additions
match a specified predicate. |
| PredicatedSortedMap
Decorates another
SortedMap to validate that additions
match a specified predicate. |
| SingletonMap
A
Map implementation that holds a single item and is fixed size. |
| TransformedMap
Decorates another
Map to transform objects that are added. |
| TransformedSortedMap
Decorates another
SortedMap to transform objects that are added. |
Copyright © 2001–2019 The Apache Software Foundation. All rights reserved.


Wildcards (*) may not be used with the {{'in list'}} operator.
Wildcards (*) are not supported with the current selections.
Wildcards (*) may only be the first or last character in a term.
The current operator already functions with that wildcard (*).
The pipe (|) character is not supported with the current selections.
For {{'Molecular Weight'}} {{'in list'}} searches, please enter two or more positive numbers, separated by pipe (|) characters. Numbers may have up to four decimal places.
For {{'Molecular Weight'}} {{'between'}} searches, please enter two positive numbers separated by a hyphen or space. Each number may have up to four decimal places.
For {{'Molecular Weight'}} searches, please enter a single positive number with up to four decimal places.
For {{'Toxicity'}} {{'between'}} searches, please enter two positive numbers, separated by a hyphen or space. You may enter decimal numbers including scientific notation.
For {{'Toxicity'}} {{'in list'}} searches, please enter two or more positive numbers, separated by pipe (|) characters. You may enter decimal numbers including scientific notation.
For {{'Toxicity'}} searches, please enter a single positive number. You may enter decimal numbers including scientific notation.
For {{'Physical Property'}} {{'in list'}} searches, please enter two or more numbers, separated by pipe (|) characters. You may enter decimal numbers including scientific notation.
For {{'Physical Property'}} {{'between'}} searches, please enter two numbers, separated by a hyphen or space. You may enter decimal numbers including scientific notation.
For {{'Physical Property'}} searches, please enter a single number. You may enter decimal numbers including scientific notation.
{{'Registry Number'}} terms have 5 to 10 digits ending like ##-##-# and do not have leading zeroes.
{{'System ID'}} terms are 10 characters, either all digits or with one or more letters followed by digits.
{{'FDA UNII'}} terms are 10 digits and/or letters.
{{'InChIKey'}} terms are 25 letters, with hyphens after the 14th and 24th.
{{'Last Modified'}} search terms must be YYYY or YYYY-MM or YYYY-MM-DD or YYYYMMDD or 13 digits of milliseconds.
For {{'in list'}} searches, please enter two or more terms, separated by pipe (|) characters.
For {{'between'}} searches, please enter two numbers, separated by a hyphen or space.
A search term is required.
{{'(automatic)'}} search terms must be at least 3 characters.
Please wait, search results are pending...
No substances match the current expression.
No substances match the current term.
The search fields require at least one input.


Python CommentsComments in Python can be used to explain any program code. It can also be used to hide the code as well. Comments are the most helpful stuff of any program. It enables us to understand the way, a program works. In python, any statement written along with # symbol is known as a comment. The interpreter does not interpret the comment. Comment is not a part of the program, but it enhances the interactivity of the program and makes the program readable. Python supports two types of comments: 1) Single Line Comment: In case user wants to specify a single line comment, then comment must start with ?#? Eg: # This is single line comment. print "Hello Python" Output: Hello Python 2) Multi Line Comment: Multi lined comment can be given inside triple quotes. eg: ''' This Is Multipline comment''' eg: #single line comment print "Hello Python" '''This is multiline comment''' Output: Hello Python
Next TopicPython If Else
|
Python CommentsComments in Python can be used to explain any program code. It can also be used to hide the code as well. Comments are the most helpful stuff of any program. It enables us to understand the way, a program works. In python, any statement written along with # symbol is known as a comment. The interpreter does not interpret the comment. Comment is not a part of the program, but it enhances the interactivity of the program and makes the program readable. Python supports two types of comments: 1) Single Line Comment: In case user wants to specify a single line comment, then comment must start with ?#? Eg: # This is single line comment. print "Hello Python" Output: Hello Python 2) Multi Line Comment: Multi lined comment can be given inside triple quotes. eg: ''' This Is Multipline comment''' eg: #single line comment print "Hello Python" '''This is multiline comment''' Output: Hello Python
Next TopicPython If Else
|
Python CommentsComments in Python can be used to explain any program code. It can also be used to hide the code as well. Comments are the most helpful stuff of any program. It enables us to understand the way, a program works. In python, any statement written along with # symbol is known as a comment. The interpreter does not interpret the comment. Comment is not a part of the program, but it enhances the interactivity of the program and makes the program readable. Python supports two types of comments: 1) Single Line Comment: In case user wants to specify a single line comment, then comment must start with ?#? Eg: # This is single line comment. print "Hello Python" Output: Hello Python 2) Multi Line Comment: Multi lined comment can be given inside triple quotes. eg: ''' This Is Multipline comment''' eg: #single line comment print "Hello Python" '''This is multiline comment''' Output: Hello Python
Next TopicPython If Else
|
Python CommentsComments in Python can be used to explain any program code. It can also be used to hide the code as well. Comments are the most helpful stuff of any program. It enables us to understand the way, a program works. In python, any statement written along with # symbol is known as a comment. The interpreter does not interpret the comment. Comment is not a part of the program, but it enhances the interactivity of the program and makes the program readable. Python supports two types of comments: 1) Single Line Comment: In case user wants to specify a single line comment, then comment must start with ?#? Eg: # This is single line comment. print "Hello Python" Output: Hello Python 2) Multi Line Comment: Multi lined comment can be given inside triple quotes. eg: ''' This Is Multipline comment''' eg: #single line comment print "Hello Python" '''This is multiline comment''' Output: Hello Python
Next TopicPython If Else
|


--- layout: post type: post status: publish tags: - client - dabr - Technical - tweak - twitter meta: slider_style: default.css _wpbitly: http://q.bibhas.in/Hp4XqZ slide_redirect_url: http://bibhas.in/blog/2010/10/auto-refresh-your-dabr-client/ _wp_old_slug: "" _edit_last: "1" published: true title: Auto Refresh your Dabr client permalink: /blog/193/auto-refresh-your-dabr-client/ --- If you don't know yet, Dabr is an open source Twitter Mobile Web client which can be used from their own site dabr.co.uk or you can download the code from its Google Code page and upload it to your server and use it like your own client.. :) But Don't forget to read the documentation while installing. :) Now, about auto refreshing, First I thought about using AJAX, but that seemed a lot of work. So, I thought of an alternative. Open the theme.php file which is inside the common directory. Scroll to line no 137. You should see something like this ->
<head><title>',$_SERVER['SERVER_NAME'],' - ',$title,'</title><base href="',BASE_URL,'" /> '.theme('css').' </head>Just add this line just before the </html> tag,
<meta http-equiv="refresh" content="30">Like -
<head><title>',$_SERVER['SERVER_NAME'],' - ',$title,'</title><base href="',BASE_URL,'" /> '.theme('css').' <meta http-equiv="refresh" content="30"> </head>And save it and upload it to your server. You can change the value 30 as u wish, it'll be counted as seconds and the page will refresh with that interval. :D For reference,
"META tags with an HTTP-EQUIV attribute are equivalent to HTTP headers. Typically, they control the action of browsers, and may be used to refine the information provided by the actual headers."So, I'm just modifying the sent header data and saying the browser that, refresh the page with a 30 seconds interval. :D But be careful.  :)


snobol4dbm − SNOBOL4 NDBM interface
-INCLUDE ’ndbm.sno’
dbhandle = DBM_OPEN(file,flags,mode)
DBM_CLOSE(dbhandle)
DBM_STORE(dbhandle,key,datum,flags)
datum = DBM_FETCH(dbhandle,key)
DBM_DELETE(dbhandle,key)
key = DBM_FIRSTKEY(dbhandle)
key = DBM_NEXTKEY(dbhandle)
DBM_ERROR(dbhandle)
DBM_CLEARERR(dbhandle)
"NDBM" (for New Data Base Managemnt) is an industry standard fast hashed storage API first created in 4.3BSD, and included in the Unix 98 (SUSv2) standard. The original DBM API appeared in AT&T Research Unix Version 7, and only allowed access to a single file at a time.
There are many different implementations of this API, including:
|
• |
The original BSD 4.3 ndbm, based on AT&T dbm. Found in commercial Un*x offerings. | ||
|
• |
Berkeley DB v1 compatibility interface. Supplied with 4.4BSD based systems: (Free|Open|Net)BSD, MacOS X. | ||
|
• |
GNU DBM (GDBM) found in Linux distributions. | ||
|
• |
SDBM, Ozan Yigit’s Public Domain implementation of NDBM. Supplied with this distribution, and used as a last resort on Un*x systems (and by default on non Un*x systems). |
DBM_OPEN takes a filename (STRING), flags (either "R" for read-only, "W" for write access, or "CW" to create and write a new file), and a "mode" string, which defaults to "0660" (octal) and returns a database handle which can be passed to the remaining functions.
DBM_CLOSE closes the database file. DBM_CLOSE MUST be called to ensure that all your data is written.
DBM_STORE takes a database handle, key and datum strings, and a flag (either DBM_INSERT to insert a new pair, or fail if the key already exists, or DBM_REPLACE to insert or replace existing data). The key and datum strings may contain an arbitrary series of characters.
DBM_FETCH returns the stored datum (if any) for the supplied key, or fails.
DBM_DELETE deletes the stored datum (if any) for the supplied key, or fails.
DBM_FIRSTKEY and subsequent calls to DBM_NEXTKEY allow you to traverse all stored keys. The keys will be returned in arbitrary order, and the routines will fail at the end of the traversal.
DBM_ERROR is a predicate which succeeds if the database handle is valid and an I/O error has occurred on the file. DBM_CLEARERR is a predicate which succeeds if if the database handle is valid, and has the side effect of clearing the I/O error flag.
NDBM, GDBM, and SDBM create two files: filename.dir, filename.pag. Berkeley DB creates a single filename.db file.
ndbm(3), dbopen(3), gdbm(3).
Philip L. Budne
None of the implementations allow concurrent read and write.
Some implementations (classic NDBM and SDBM) place limits on the total size of key plus datum (typically slightly less than 1KB).
NOTE: Some implementations (classic NDBM and SDBM) create sparse file which appear (to "ls -l") to be larger than they are (see "ls -s"). Copying such files may cause the non-allocated blocks to be "filled" with zeroed disk blocks, and then the files really will be large!
Only GDBM provides locking to eliminate the possibility of file corruption, or reading of incomplete data.
GDBM locking sometimes fails on NFS mounted partitions (particularly on Linux systems). GDBM’s NDBM interface does not provide a way to disable locking.
DBM databases accessed concurrently by multiple processes are traditionally (re)created from text files and used for fast disk-based read-only table lookups. Programs which need to update the file generate a new temporary copy using a different name, and then rename the new file(s), so that the next reader gets the new copies (existing readers continue to see old data).


In this project, you'll use generative adversarial networks to generate new images of faces.
You'll be using two datasets in this project:
Since the celebA dataset is complex and you're doing GANs in a project for the first time, we want you to test your neural network on MNIST before CelebA. Running the GANs on MNIST will allow you to see how well your model trains sooner.
If you're using FloydHub, set data_dir
to "/input" and use the FloydHub data ID "R5KrjnANiKVhLWAkpXhNBe".
data_dir = './data'
# FloydHub - Use with data ID "R5KrjnANiKVhLWAkpXhNBe"
#data_dir = '/input'
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
helper.download_extract('mnist', data_dir)
helper.download_extract('celeba', data_dir)
show_n_images = 25
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
%matplotlib inline
import os
from glob import glob
from matplotlib import pyplot
mnist_images = helper.get_batch(glob(os.path.join(data_dir, 'mnist/*.jpg'))[:show_n_images], 28, 28, 'L')
pyplot.imshow(helper.images_square_grid(mnist_images, 'L'), cmap='gray')
The CelebFaces Attributes Dataset (CelebA) dataset contains over 200,000 celebrity images with annotations. Since you're going to be generating faces, you won't need the annotations. You can view the first number of examples by changing show_n_images
.
show_n_images = 25
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
mnist_images = helper.get_batch(glob(os.path.join(data_dir, 'img_align_celeba/*.jpg'))[:show_n_images], 28, 28, 'RGB')
pyplot.imshow(helper.images_square_grid(mnist_images, 'RGB'))
Since the project's main focus is on building the GANs, we'll preprocess the data for you. The values of the MNIST and CelebA dataset will be in the range of -0.5 to 0.5 of 28x28 dimensional images. The CelebA images will be cropped to remove parts of the image that don't include a face, then resized down to 28x28.

You'll build the components necessary to build a GANs by implementing the following functions below:
model_inputs
discriminator
generator
model_loss
model_opt
train
This will check to make sure you have the correct version of TensorFlow and access to a GPU
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
from distutils.version import LooseVersion
import warnings
import tensorflow as tf
# Check TensorFlow Version
assert LooseVersion(tf.__version__) >= LooseVersion('1.0'), 'Please use TensorFlow version 1.0 or newer. You are using {}'.format(tf.__version__)
print('TensorFlow Version: {}'.format(tf.__version__))
# Check for a GPU
if not tf.test.gpu_device_name():
warnings.warn('No GPU found. Please use a GPU to train your neural network.')
else:
print('Default GPU Device: {}'.format(tf.test.gpu_device_name()))
Implement the model_inputs
function to create TF Placeholders for the Neural Network. It should create the following placeholders:
image_width
, image_height
, and image_channels
.z_dim
.Return the placeholders in the following the tuple (tensor of real input images, tensor of z data)
import problem_unittests as tests
def model_inputs(image_width, image_height, image_channels, z_dim):
"""
Create the model inputs
:param image_width: The input image width
:param image_height: The input image height
:param image_channels: The number of image channels
:param z_dim: The dimension of Z
:return: Tuple of (tensor of real input images, tensor of z data, learning rate)
"""
inputs_real = tf.placeholder(tf.float32, (None, image_width, image_height, image_channels), name='inputs_real')
input_z = tf.placeholder(tf.float32, (None, z_dim), name='input_z')
learning_rate = tf.placeholder(tf.float32, name='learning_rate')
return inputs_real, input_z, learning_rate
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_model_inputs(model_inputs)
Implement discriminator
to create a discriminator neural network that discriminates on images
. This function should be able to reuse the variabes in the neural network. Use tf.variable_scope
with a scope name of "discriminator" to allow the variables to be reused. The function should return a tuple of (tensor output of the generator, tensor logits of the generator).
def discriminator(images, reuse=False):
"""
Create the discriminator network
:param image: Tensor of input image(s)
:param reuse: Boolean if the weights should be reused
:return: Tuple of (tensor output of the discriminator, tensor logits of the discriminator)
"""
alpha = 0.2
patch = 5
stride = 2
with tf.variable_scope('discriminator', reuse=reuse):
#Input 28x28x3
x1 = tf.layers.conv2d(images, 64, patch, strides=stride, padding='same')
relu1 = tf.maximum(alpha * x1, x1)
#14x14x64
x2 = tf.layers.conv2d(relu1, 128, patch, strides=stride, padding='same')
bn2 = tf.layers.batch_normalization(x2, training=True)
relu2 = tf.maximum(alpha * bn2, bn2)
#7x7x128
#x3 = tf.layers.conv2d(relu2, 256, patch, strides=stride, padding='same')
#bn3 = tf.layers.batch_normalization(x3, training=True)
#relu3 = tf.maximum(alpha * bn3, bn3)
#Hoping TF pads to 4 otherwise 3.5 x 3.5 x 256
#Flatten her up
#flat = tf.reshape(relu3, (-1, 4*4*256))
flat = tf.reshape(relu2, (-1, 7*7*128))
logits = tf.layers.dense(flat, 1)
out = tf.sigmoid(logits)
return out, logits
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_discriminator(discriminator, tf)
Implement generator
to generate an image using z
. This function should be able to reuse the variabes in the neural network. Use tf.variable_scope
with a scope name of "generator" to allow the variables to be reused. The function should return the generated 28 x 28 x out_channel_dim
images.
def generator(z, out_channel_dim, is_train=True):
"""
Create the generator network
:param z: Input z
:param out_channel_dim: The number of channels in the output image
:param is_train: Boolean if generator is being used for training
:return: The tensor output of the generator
"""
alpha = 0.2
patch = 5
stride = 2
with tf.variable_scope('generator', reuse=not is_train):
#Create the fully connected layer
#x1 = tf.layers.dense(z, 4*4*256)
x1 = tf.layers.dense(z, 7*7*128)
#reshape
#x1 = tf.reshape(x1, (-1, 4,4,256))
x1 = tf.reshape(x1, (-1, 7,7,128))
x1 = tf.layers.batch_normalization(x1, training=is_train)
x1 = tf.maximum(alpha * x1, x1)
#4x4x256
#x2 = tf.layers.conv2d_transpose(x1, 128, patch, strides=stride, padding='same')
x2 = tf.layers.conv2d_transpose(x1, 64, patch, strides=stride, padding='same')
#Note - May have to come back here and reshape to 7x7
#x2 = tf.reshape(x2, (-1, 7,7,128))
x2 = tf.layers.batch_normalization(x2, training=is_train)
x2 = tf.maximum(alpha * x2, x2)
#7x7x128
#x3 = tf.layers.conv2d_transpose(x2, 64, patch, strides=stride, padding='same')
#x3 = tf.layers.batch_normalization(x3, training=is_train)
#x3 = tf.maximum(alpha * x3, x3)
#14x14x64
#Output layer
#logits = tf.layers.conv2d_transpose(x3, out_channel_dim, patch, strides=stride, padding='same')
logits = tf.layers.conv2d_transpose(x2, out_channel_dim, patch, strides=stride, padding='same')
#28x28x?
out = tf.tanh(logits)
return out
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_generator(generator, tf)
Implement model_loss
to build the GANs for training and calculate the loss. The function should return a tuple of (discriminator loss, generator loss). Use the following functions you implemented:
discriminator(images, reuse=False)
generator(z, out_channel_dim, is_train=True)
def model_loss(input_real, input_z, out_channel_dim):
"""
Get the loss for the discriminator and generator
:param input_real: Images from the real dataset
:param input_z: Z input
:param out_channel_dim: The number of channels in the output image
:return: A tuple of (discriminator loss, generator loss)
"""
g_model = generator(input_z, out_channel_dim)
d_model_real, d_logits_real = discriminator(input_real)
d_model_fake, d_logits_fake = discriminator(g_model, reuse=True)
d_loss_real = tf.reduce_mean(
tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_real, labels=tf.ones_like(d_model_real)))
d_loss_fake = tf.reduce_mean(
tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_fake, labels=tf.zeros_like(d_model_fake)))
g_loss = tf.reduce_mean(
tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_fake, labels=tf.ones_like(d_model_fake)))
d_loss = d_loss_real + d_loss_fake
return d_loss, g_loss
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_model_loss(model_loss)
Implement model_opt
to create the optimization operations for the GANs. Use tf.trainable_variables
to get all the trainable variables. Filter the variables with names that are in the discriminator and generator scope names. The function should return a tuple of (discriminator training operation, generator training operation).
def model_opt(d_loss, g_loss, learning_rate, beta1):
"""
Get optimization operations
:param d_loss: Discriminator loss Tensor
:param g_loss: Generator loss Tensor
:param learning_rate: Learning Rate Placeholder
:param beta1: The exponential decay rate for the 1st moment in the optimizer
:return: A tuple of (discriminator training operation, generator training operation)
"""
t_vars = tf.trainable_variables()
d_vars = [var for var in t_vars if var.name.startswith('discriminator')]
g_vars = [var for var in t_vars if var.name.startswith('generator')]
#Perform optimization
with tf.control_dependencies(tf.get_collection(tf.GraphKeys.UPDATE_OPS)):
d_train_opt = tf.train.AdamOptimizer(learning_rate, beta1=beta1).minimize(d_loss, var_list=d_vars)
g_train_opt = tf.train.AdamOptimizer(learning_rate, beta1=beta1).minimize(g_loss, var_list=g_vars)
return d_train_opt, g_train_opt
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_model_opt(model_opt, tf)
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
import numpy as np
def show_generator_output(sess, n_images, input_z, out_channel_dim, image_mode):
"""
Show example output for the generator
:param sess: TensorFlow session
:param n_images: Number of Images to display
:param input_z: Input Z Tensor
:param out_channel_dim: The number of channels in the output image
:param image_mode: The mode to use for images ("RGB" or "L")
"""
cmap = None if image_mode == 'RGB' else 'gray'
z_dim = input_z.get_shape().as_list()[-1]
example_z = np.random.uniform(-1, 1, size=[n_images, z_dim])
samples = sess.run(
generator(input_z, out_channel_dim, False),
feed_dict={input_z: example_z})
images_grid = helper.images_square_grid(samples, image_mode)
pyplot.imshow(images_grid, cmap=cmap)
pyplot.show()
Implement train
to build and train the GANs. Use the following functions you implemented:
model_inputs(image_width, image_height, image_channels, z_dim)
model_loss(input_real, input_z, out_channel_dim)
model_opt(d_loss, g_loss, learning_rate, beta1)
Use the show_generator_output
to show generator
output while you train. Running show_generator_output
for every batch will drastically increase training time and increase the size of the notebook. It's recommended to print the generator
output every 100 batches.
def train(epoch_count, batch_size, z_dim, learning_rate, beta1, get_batches, data_shape, data_image_mode):
"""
Train the GAN
:param epoch_count: Number of epochs
:param batch_size: Batch Size
:param z_dim: Z dimension
:param learning_rate: Learning Rate
:param beta1: The exponential decay rate for the 1st moment in the optimizer
:param get_batches: Function to get batches
:param data_shape: Shape of the data
:param data_image_mode: The image mode to use for images ("RGB" or "L")
"""
#Build Model
#print(data_shape[0])
img_w, img_h, img_chan = data_shape[1], data_shape[2], data_shape[3]
inp_real, inp_z, _ = model_inputs(img_w, img_h, img_chan, z_dim)
d_loss, g_loss = model_loss(inp_real, inp_z, img_chan)
d_opt, g_opt = model_opt(d_loss, g_loss, learning_rate, beta1)
saver = tf.train.Saver()
sample_z = np.random.uniform(-1, 1, size=(72, z_dim))
display_interval = 100
num_img_to_disp = 25
steps = 0
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
for epoch_i in range(epoch_count):
for batch_images in get_batches(batch_size):
steps += 1
batch_images *= 2
#Random noise for generator
batch_z = np.random.uniform(-1, 1, size=(batch_size, z_dim))
#Run optimizers
_ = sess.run(d_opt, feed_dict={inp_real: batch_images, inp_z: batch_z})
_ = sess.run(g_opt, feed_dict={inp_z: batch_z, inp_real: batch_images})
if steps % display_interval == 0:
train_loss_d = d_loss.eval({inp_real: batch_images, inp_z: batch_z})
train_loss_g = g_loss.eval({inp_z: batch_z})
print( "Epoch: {} of {}".format(epoch_i, epoch_count),
"D-loss: {}".format(train_loss_d),
"G-loss: {}".format(train_loss_g) )
show_generator_output(sess, num_img_to_disp, inp_z, img_chan, data_image_mode)
Test your GANs architecture on MNIST. After 2 epochs, the GANs should be able to generate images that look like handwritten digits. Make sure the loss of the generator is lower than the loss of the discriminator or close to 0.
batch_size = 32
z_dim = 100
learning_rate = 0.0002
beta1 = 0.5
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
epochs = 2
mnist_dataset = helper.Dataset('mnist', glob(os.path.join(data_dir, 'mnist/*.jpg')))
with tf.Graph().as_default():
train(epochs, batch_size, z_dim, learning_rate, beta1, mnist_dataset.get_batches,
mnist_dataset.shape, mnist_dataset.image_mode)
Run your GANs on CelebA. It will take around 20 minutes on the average GPU to run one epoch. You can run the whole epoch or stop when it starts to generate realistic faces.
batch_size = 32
z_dim = 100
learning_rate = 0.0002
beta1 = 0.5
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
epochs = 1
celeba_dataset = helper.Dataset('celeba', glob(os.path.join(data_dir, 'img_align_celeba/*.jpg')))
with tf.Graph().as_default():
train(epochs, batch_size, z_dim, learning_rate, beta1, celeba_dataset.get_batches,
celeba_dataset.shape, celeba_dataset.image_mode)
When submitting this project, make sure to run all the cells before saving the notebook. Save the notebook file as "dlnd_face_generation.ipynb" and save it as a HTML file under "File" -> "Download as". Include the "helper.py" and "problem_unittests.py" files in your submission.


Blake Nissen—Each year the freshman class walk through college gateway on
College Green in Athens, Ohio, to start their college careers.
05.28.20
Each year, the university puts on a number of events to welcome the new freshmen to campus. Some of the events stand out as long-standing Ohio University traditions, and others are just plain ole fun. Some new Bobcats will be having their first campus experience when they arrive at school in the fall. Whether this is your first or hundredth time on campus, here are some of the time-honored traditions you should take part in as a Bobcat:
Although all first-year students are required to attend, the introduction to OU by President Duane Nellis and other high ranking members of OU’s administration has been a traditional moment in the life of a new Bobcat for decades. The President’s Convocation is held at the aptly named Convocation Center, better known as The Convo. Students hear speeches given by administrative members, have their first moments on campus with their entire graduating class and catch a glimpse of everyone’s favorite mascot, Rufus.
Each year after the President’s Convocation, the freshman class walks together, led by the Marching 110, from The Convo to the Alumni Gateway, and onto College Green for the first time. Alumni Gateway was dedicated in 1915, commemorating the centennial anniversary of the first graduating class from OU. Some have said reading the inscription on the back of the gateway is bad luck if done before you graduate.
The Student Involvement Fair on College Green brings together about 250 of OU’s 450 student organizations. Here new students can catch Greek life, club sports, performing groups, student publications and more. The Involvement Fair offers opportunities for students to find groups that fit their interests. Take a look around, pick up some free swag, sign up for your new favorite club, or just catch the performance by the 110.
Each year, the university gathers the incoming freshman class at Peden Stadium to take a photo in the shape of the year of their graduating class year’s numbers. Although it may not be the most exciting or engaging part of Welcome Week as you’re arranged into the distinct numbers, the photo captures a moment in time new freshmen will never forget.
Your first time walking down Court Street on your own, peering into shop and restaurant windows, you cannot miss your opportunity to catch your first glimpse of Athens’ favorite, chubby orange kitty: Pumpkin the cat.
Pumpkin is a long time Athens resident who resides in the Board of Elections window, 15 S. Court St., during its office hours. Stop by, take a peek and say hello. Pumpkin is the beloved figure of Court Street for many OU students, as well as a very good reminder to register to vote.
Back


public class TrakSim
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
class |
TrakSim.SimHookX |
| Modifier and Type | Field and Description |
|---|---|
private static double |
Acceleration |
private static int[] |
ActivAnima |
private static int |
ArtBase |
private static int |
ArtiColo |
private static double |
AverageAim |
private static int |
BackWall |
private static int |
BayerTile |
private static double |
Bcarx |
private static int[] |
BreadCrumbs |
private static int |
CarColo |
private static int |
CarTest |
private static int |
CheckerBd |
private static boolean |
ClockTimed |
private static java.lang.String[] |
CompNames |
private static int |
CreamWall |
private static int |
Crummy |
private static int |
Darken |
private static boolean |
DarkOnce |
private static int |
DarkWall |
private static double |
dFtime |
private static boolean |
DoCloseUp |
private static int |
DrawDash |
private static int |
DroppedFrame |
private static double |
Dzoom |
private static double |
effTurnRad |
private static double |
Facing |
private static int |
FakeRealTime |
private static int |
FakeTimeBase |
private static boolean |
Fax_Log |
private static double |
Fby3 |
private static double |
fFtime |
private static double |
fGratio |
private static double |
fImHaf |
private static double |
FltWi |
private static double |
fMapWi |
private static double |
fMaxSpeed |
private static double |
fMinESC |
private static double |
fMinSpeed |
private static int |
FrameNo |
private static int |
FrameTime |
private static double |
fSpeed |
private static double |
fSteer |
private static double |
fSweeper |
private static double |
fTime4mass |
private static double |
fTurn4m |
private static double |
fZoom |
private static int |
GasBrake |
private static int |
GasServo |
private static boolean |
GoodLog |
private static int |
GrasColo |
private static int |
GrasDk |
private int[] |
Grid_Locns |
private static int[] |
GridLocTable |
private static int |
GroundsColors |
private static int |
HalfMap |
private static int |
HalfTall |
private static double |
Hcarx |
private static double |
Hoffm |
private static double |
Hposn |
private static int |
Hramp |
private static double |
Hsee |
private static int |
ImageWide |
private static int |
ImHaf |
private static int |
ImHi |
private static int |
ImMid |
private static int |
ImWi |
private static boolean |
InWalls |
private static double |
Lcarx |
private int |
Left_X |
private static double |
LfDeScaleSt |
static int |
Lin2 |
private static boolean |
Log_Draw |
private static boolean |
Log_Log |
private static int |
LookFrame |
private static int |
MapHy |
private static int[] |
MapIndex |
private static int |
MapIxBase |
private static java.lang.String |
MapMacros |
private static int |
MapTall |
private static int |
MapWiBit |
private static int |
MapWide |
private static int |
MapWy |
private static int |
MarinBlue |
private static int |
MaxESCact |
private static double |
MaxRspeed |
private static int |
MinESCact |
private static boolean |
Mini_Log |
private static boolean |
Moved |
private static int[] |
myScreen |
private static int |
nClients |
private static int |
nCrumbs |
private static int |
NextFrUpdate |
private static boolean |
NoisyMap |
static int |
nPixels |
private static int |
NuData |
private static int |
nuIxBase |
private static int |
NumFax |
private static int |
OpMode |
private static int |
ParkDims |
private static int |
PavColo |
private static int |
PavDk |
private static int |
PilasterCo |
private static int |
PixScale |
private int |
PreViewAim |
private int |
PreViewLoc |
private static int[] |
PrioRaster |
private static int |
ProcessingTime |
private static int |
RampA |
private static boolean |
RampServos |
private static int[] |
RangeRow |
private static double[] |
RasterMap |
private static double |
Rcarx |
private static int |
RealTimeBase |
private static int |
RealTimeNow |
private static int |
RectMap |
private static boolean |
Reversible |
private int |
Rite_X |
private static int[] |
RowRange |
private static double |
RtDeScaleSt |
private static int |
SameData |
private static int |
SceneBayer |
private static java.lang.String |
SceneFiName |
private static int |
SceneTall |
private static int |
SceneWide |
private static int |
SeePaintImgP |
private static int |
SeePaintSize |
private static int |
SeePaintTopL |
private SimHookBase |
SerialCalls |
private static int |
ServoStepRate |
private static boolean |
ShoClikGrid |
private static int |
ShoSteer |
private static boolean |
ShoTrkTstPts |
private static boolean |
ShowMap |
private static boolean |
SimBusy |
private static boolean |
SimInTrak |
private static boolean |
SimSpedFixt |
private static double |
SloMotion |
private static int |
SpecGas |
private static int |
SpecWheel |
private static int |
SteerColo |
private static int |
SteerMid |
private static int |
SteerServo |
private static int |
SteerWhee |
private static boolean |
StepOne |
private static java.lang.String |
StopInfo |
private static int |
t2Radix |
private int[] |
TapedWheel |
private static double |
Tcarx |
private static java.lang.String |
TempStr |
private static int[] |
theFax |
private static int |
TimeBaseSeq |
private static int |
Tintx |
(package private) int[] |
TinyBits |
private static int |
TmpI |
private static int |
TopCloseView |
private static int |
tRadix |
private static int[] |
TrakImages |
private static boolean |
TrakNoPix |
private static int |
TripLine |
private static double |
TurnRadius |
private static int |
TweakRx |
private static boolean |
unScaleStee |
private static boolean |
UseTexTrak |
private static double |
Vcarx |
private static double |
Velocity |
private static double |
Voffm |
private static double |
Vposn |
private static int |
Vramp |
private static double |
Vsee |
private static double |
VuEdge |
private static int |
Waiting |
private static int |
Wally |
boolean |
wasted |
private static double |
WhiteLnWi |
private static double |
WhitLnSz |
static int |
WinWi |
private static double |
WiZoom |
private static int |
xCloseUp |
private static int |
xTrLiteTime |
private static int |
Zoom35 |
private static int |
ZooMapBase |
private static int |
ZooMapDim |
private static double |
ZooMapScale |
private static int |
ZooMapShf |
private static int |
ZooMapTopL |
private static double |
ZooMapWhLn |
private static int |
ZoomFocus |
private static int |
ZoomPix |
private static int |
zx50 |
| Constructor and Description |
|---|
TrakSim() |
| Modifier and Type | Method and Description |
|---|---|
private static int |
Ad2PntMap(int rx,
int cx,
int img,
int tall,
int wide,
int PaintIx,
int[] myMap,
int size) |
private int |
Animatron(int whar,
int locn,
boolean logy) |
private void |
BuildFrame() |
static int[] |
BuildMap(java.lang.String theList,
int ImDims,
int[] theImgs)
Builds a track map from a text description.
|
private static int |
Cast_F2I(double whom) |
private static double |
Cast_I2F(int whom) |
private int |
Color4ix(int whom) |
void |
CrashMe(boolean seen)
TrakSim will crash the car (stop simulation) if it runs off the track
(or other Bad Things Happen).
|
void |
DarkFlash()
Requests TrakSim to return its next NextFrame->GetFrame image black.
|
void |
DrawGrid()
Draws a rectangular grid on the screen according to the specification
array given to NewGridTbl.
|
void |
DrawLine(int colo,
int rx,
int cx,
int rz,
int cz)
Draws a line of TrakSim pixels.
|
void |
DrawRedX()
Draws a red "X" in the lower left corner of the TrakSim pixel buffer.
|
void |
DrawSteerWheel(int posn,
boolean scaled,
boolean dash2)
Draws a tan steering wheel slightly to the left of center at the bottom
of the TrakSim pixel buffer.
|
static int |
EncoPavEdge(int tall,
int wide,
int recell,
int why) |
void |
FreshImage()
Requests TrakSim to redraw its scene on next NextFrame->GetFrame call.
|
double |
GetFacing() |
int |
GetFrameNo()
Gets the current frame count.
|
int |
GetImgWide()
Gets the width of the image file (if loaded), or else =0.
|
int |
GetMapSize()
Gets the actual map size as read in from the file.
|
int[] |
GetMyScreenAry()
Gets a pointer to the current image TrakSim is drawing on.
|
int |
GetMyScreenDims()
Gets the size of the current image TrakSim is drawing on.
|
double |
GetPosn(boolean horz)
Gets one coordinate of the current car position.
|
boolean |
GetSimFrame(int rose,
int colz,
byte[] pixels)
Essentially the same as NextFrame in fly2cam.FlyCamera.
|
void |
GotBytes(byte[] msg,
int lxx) |
private static int |
GotImgOps(java.lang.String theList) |
int |
GridBlock(int rx,
int cx)
Converts a click location on the window to a row&column number
corresponding to the rectangular specification given to NewGridTbl.
|
private boolean |
InitIndex(int[] theInx) |
private void |
InTrackIt() |
boolean |
IsCrashed()
TrakSim will crash the car (stop simulation) if it runs off the track
(or other Bad Things Happen), this tells you if it did.
|
void |
LabelScene(java.lang.String aLine,
int rx,
int cx,
int colo)
Draws a text string (which must be only the characters: "<PHONE_NUMBER>NESW.-")
on the TrakSim pixel buffer.
|
static void |
LineSlope(double Vat,
double Hat,
double Vstp,
double Hstp,
boolean logy,
java.lang.String msg) |
private boolean |
LoadTrackInfo() |
private void |
MakeRangeTbl() |
private static void |
MapBucket(int deep,
int rx,
int cx,
int colo,
int[] myMap) |
int |
MapColor(int optn,
double Vat,
double Hat,
double ink)
Converts a park coordinate in meters to the scenery color to display
there, usually track pavement or non-track "grass" (or carpet or whatever).
|
static double |
MidAngle(double here,
double thar)
Returns an angle (in non-negative degrees) halfway between here and thar.
|
private void |
MoveCar() |
boolean |
NewGridTbl(int[] grids)
Uses a specially formatted integer array to specify a grid of click
regions on the window.
|
int |
PeekPixel(int rx,
int cx)
Gets the TrakSim pixel at the specified row and column.
|
void |
PokePixel(int colo,
int rx,
int cx)
Sets the TrakSim pixel at the specified row and column.
|
private void |
ReadTrakIndex() |
void |
RectFill(int colo,
int rx,
int cx,
int rz,
int cz)
Sets a whole rectangle of TrakSim pixels from one corner of the
rectangle in pixel coordinates, to the opposite corner.
|
void |
Refocus(int newFoc35)
Changes the focal length of the simulated camera.
|
double |
ScaleSpeed() |
void |
SeeOnScrnPaint(int rx,
int cx,
int tall,
int wide,
int here,
int colo)
Draw on-screen an image portion from TrakImages.
|
void |
SetCloseTop(int here)
Sets/overrides the top row for the close-up map (if showing).
|
void |
SetMyScreen(int[] theAry,
int tall,
int wide,
int tile)
Replaces the TrakSim pixel buffer with your own array.
|
void |
SetPixSize(int size)
Sets (enlarged) pixel size for ShoDigit.
|
void |
SetServo(int pin,
int set2) |
void |
SetStart(int Vat,
int Hat,
int aim)
Sets the position and direction of the simulated car.
|
private void |
ShoArtifax() |
void |
ShoDigit(int whom,
int rx,
int cx,
int colo)
Draws a tiny decimal digit (or one of six other special characters)
on the TrakSim pixel buffer.
|
void |
SimStep(int mode)
Requests TrakSim to set its simulation mode to one of three states.
|
boolean |
StartImage(int rose,
int colz,
int tile) |
void |
StartPatty(java.lang.String whom) |
int |
TurnRadRow()
Gets the pixel row corresponding to the car turn radius, and also
twice the turn radius.
|
private void |
Valid8consts() |
private int |
ViewAngle(int locn,
int info) |
static void |
WhiteAlfa(int tall,
int wide,
int[] theImgs)
Converts contiguous white RGB pixels into transparent for BuildMap.
|
int |
ZoomMap2true(boolean aim2,
int rx,
int cx)
Converts a row/column click location on the close-up map (if showing)
to a true (park) position in 64ths of a meter, packed into an integer.
|
int |
ZoomMapCoord(boolean yx,
double Vat,
double Hat)
Converts a row/column position on the perspective view generated by TrakSim
to an image pixel position of the close-up map (if shown) or zero otherwise.
|
private static final double fMinSpeed
private static final double fMinESC
private static final double fGratio
private static final java.lang.String SceneFiName
private static final boolean RampServos
private static final boolean Log_Draw
private static final boolean Log_Log
private static final boolean Mini_Log
private static final boolean DoCloseUp
private static final boolean ShowMap
private static final boolean TrakNoPix
private static final boolean NoisyMap
private static final boolean Reversible
private static final boolean UseTexTrak
private static final boolean Fax_Log
private static final boolean ShoClikGrid
private static final boolean GoodLog
private static final int Vramp
private static final int ImHi
private static final int ImWi
private static final int Hramp
private static final int RampA
private static final int HalfMap
private static final int HalfTall
private static final int SteerServo
private static final int GasServo
private static final int MinESCact
private static final int MaxESCact
private static final int DrawDash
private static final int FrameTime
private static final int Zoom35
private static final int xCloseUp
private static final int CreamWall
private static final int DarkWall
private static final int BackWall
private static final int PilasterCo
private static final int CarColo
private static final int ArtiColo
private static final int MarinBlue
private static final int SteerColo
private static final int xTrLiteTime
private static final int BayerTile
private static final int MapTall
private static final int MapWide
private static final int SteerMid
private static final int ImHaf
private static final int ImMid
private static final int MapWiBit
private static final int Tintx
private static final int ArtBase
private static final int zx50
private static final int ZoomPix
private static final int ParkDims
private static final int CheckerBd
private static final int ServoStepRate
private static final int TweakRx
private static final int Crummy
private static final double TurnRadius
private static final double LfDeScaleSt
private static final double RtDeScaleSt
private static final double WhiteLnWi
private static final double Fby3
private static final double Acceleration
private static final double fFtime
private static final double dFtime
private static final double fTurn4m
private static final double fSweeper
private static final double fMaxSpeed
private static final double MaxRspeed
private static final double fTime4mass
public static final int WinWi
public static final int Lin2
public static final int nPixels
private static final java.lang.String[] CompNames
private static final java.lang.String StopInfo
private static final java.lang.String MapMacros
private static int SceneTall
private static int SceneWide
private static int SceneBayer
private static int NuData
private static int Waiting
private static int ShoSteer
private static int SteerWhee
private static int GasBrake
private static int SpecGas
private static int SpecWheel
private static int CarTest
private static int tRadix
private static int t2Radix
private static int nClients
private static int ZoomFocus
private static int GroundsColors
private static int LookFrame
private static int ZooMapTopL
private static int ZooMapDim
private static int ZooMapShf
private static int ZooMapBase
private static int Wally
private static int Darken
private static int MapIxBase
private static int MapHy
private static int MapWy
private static int ImageWide
private static int nuIxBase
private static int FrameNo
private static int NextFrUpdate
private static int ProcessingTime
private static int OpMode
private static int DroppedFrame
private static int FakeTimeBase
private static int RealTimeBase
private static int FakeRealTime
private static int RealTimeNow
private static int TimeBaseSeq
private static int PixScale
private static int nCrumbs
private static int NumFax
private static int RectMap
private static int TopCloseView
private static int SeePaintTopL
private static int SeePaintSize
private static int SeePaintImgP
private static int TmpI
private static int TripLine
private static int SameData
private static int PavColo
private static int PavDk
private static int GrasColo
private static int GrasDk
private static double SloMotion
private static double Velocity
private static double VuEdge
private static double effTurnRad
private static double AverageAim
private static double WhitLnSz
private static double Facing
private static double Vposn
private static double Hposn
private static double Vcarx
private static double Hcarx
private static double Lcarx
private static double Rcarx
private static double Tcarx
private static double Bcarx
private static double fZoom
private static double Dzoom
private static double fSpeed
private static double fSteer
private static double FltWi
private static double fImHaf
private static double fMapWi
private static double WiZoom
private static double ZooMapScale
private static double ZooMapWhLn
private static double Vsee
private static double Hsee
private static double Voffm
private static double Hoffm
private static boolean StepOne
private static boolean SimBusy
private static boolean Moved
private static boolean DarkOnce
private static boolean ClockTimed
private static boolean unScaleStee
private static boolean InWalls
private static boolean SimInTrak
private static boolean ShoTrkTstPts
private static boolean SimSpedFixt
private static java.lang.String TempStr
private static int[] RangeRow
private static int[] RowRange
private static int[] MapIndex
private static int[] theFax
private static int[] ActivAnima
private static int[] TrakImages
private static int[] myScreen
private static int[] PrioRaster
private static int[] BreadCrumbs
private static int[] GridLocTable
private static double[] RasterMap
final int[] TinyBits
private final int[] Grid_Locns
private final int[] TapedWheel
public boolean wasted
private int Left_X
private int Rite_X
private int PreViewLoc
private int PreViewAim
private SimHookBase SerialCalls
private static double Cast_I2F(int whom)
private static int Cast_F2I(double whom)
public static void LineSlope(double Vat, double Hat, double Vstp, double Hstp, boolean logy, java.lang.String msg)
public static int EncoPavEdge(int tall, int wide, int recell, int why)
public static void WhiteAlfa(int tall, int wide, int[] theImgs)
tall
- The image height, in pixel rows.wide
- The image width, in pixels.theImgs
- An array of RGB pixels containing artifact images.private static int GotImgOps(java.lang.String theList)
private static int Ad2PntMap(int rx, int cx, int img, int tall, int wide, int PaintIx, int[] myMap, int size)
private static void MapBucket(int deep, int rx, int cx, int colo, int[] myMap)
public static int[] BuildMap(java.lang.String theList, int ImDims, int[] theImgs)
theList
- The text description. See ReadMe for detailsImDims
- The height & width of theImgs, packed as (H<<16)+W.theImgs
- An array of RGB pixels containing artifact images.public static double MidAngle(double here, double thar)
here
- First angle in dregreesthar
- Second angle in dregreespublic int[] GetMyScreenAry()
TrakSim maintains its own integer array to be used as a screen buffer, but a client can "borrow" TrakSim's drawing tools by saving the screen buffer, then restoring it when done.
public int GetMyScreenDims()
TrakSim maintains its own integer array to be used as a screen buffer, but a client can "borrow" TrakSim's drawing tools by saving the screen buffer, then restoring it when done.
public int GetFrameNo()
public int GetImgWide()
public void SetStart(int Vat, int Hat, int aim)
Vat
- The vertical (southward) component of the position in metersHat
- The horizontal (eastward) component of the position in metersaim
- The direction facing, in degrees clockwise from northpublic void SetCloseTop(int here)
here
- The image row to start map onpublic int ZoomMap2true(boolean aim2, int rx, int cx)
aim2
- If true, also points the car to be facing the click pointrx
- The image row clicked oncx
- The image column clicked on, relative to the window top/leftpublic int ZoomMapCoord(boolean yx, double Vat, double Hat)
This is useful for adding to the close-up map display information derived from examining the perspective view, which is the normal way a self-driving car program would be operating. Alternatively (yx=true) you can convert direct map coordinates (in park meters) to screen pixel in the close-up map.
The close-up map jumps around dynamically depending on the position and direction of the car. This allows your software to add information to the map view. Use ZoomMap2true to reverse the calculation.
yx
- If true, converts a position in meters instead of screen coordVat
- The image row in pixels, or map vertical in park metersHat
- The image column in pixels, or map horizontal in park meterspublic void SetMyScreen(int[] theAry, int tall, int wide, int tile)
theAry
- The pixel array, at least tall*wide in lengthtall
- The number of pixel rowswide
- The number of pixel columnstile
- Should be 1, because that's what TrakSim knowspublic int PeekPixel(int rx, int cx)
rx
- The pixel rowcx
- The pixel columnpublic void PokePixel(int colo, int rx, int cx)
colo
- The pixel to go in that position, = 0x00RRGGBBrx
- The pixel rowcx
- The pixel columnpublic void RectFill(int colo, int rx, int cx, int rz, int cz)
colo
- The pixel color to fill that rectangle, = 0x00RRGGBBrx
- The pixel row in one cornercx
- The pixel column in the same cornerrz
- The pixel row in the other corner (inclusive)cz
- The pixel column therepublic void DrawLine(int colo, int rx, int cx, int rz, int cz)
colo
- The pixel color to draw that line, = 0x00RRGGBBrx
- The pixel row at one endcx
- The pixel column at the same endrz
- The pixel row at the other endcz
- The pixel column therepublic void ShoDigit(int whom, int rx, int cx, int colo)
whom
- The digit to draw, a 4-bit index into "0123456789NESW.-"rx
- The pixel row at the bottom right cornercx
- The pixel column therecolo
- The color to draw that digit, = 0x00RRGGBBpublic void LabelScene(java.lang.String aLine, int rx, int cx, int colo)
aLine
- The text string to drawrx
- The pixel row at the bottom (right corner)cx
- The pixel column there, or the left end if negativecolo
- The color to draw that text, = 0x00RRGGBBpublic void SetPixSize(int size)
size
- The number of screen pixels per digit pixelpublic void DrawRedX()
public void DrawSteerWheel(int posn, boolean scaled, boolean dash2)
The steering wheel may be drawn with a piece of "white tape" on the top, so it's easy to see when it it turned off-center. The wheel has 23 positions from -11 to +11 where this tape is shown, and it is not shown if the position is out of range. Alternatively, you can give it a signed angle -127 to +127 and have it scaled non-linearly to fit in the shorter range.
posn
- The position to draw the white tape, -11 to +11,
or -127 to +127 if scaledscaled
- True if the position is to be scaleddash2
- Also draw the dashboard from available informationpublic void DrawGrid()
public int GridBlock(int rx, int cx)
rx
- The image row clicked oncx
- The image column clicked on, relative to the window top/leftpublic boolean NewGridTbl(int[] grids)
grids
- The arraypublic void SimStep(int mode)
mode
- True to get the horizontal (east-west) coordinateprivate int ViewAngle(int locn, int info)
private int Animatron(int whar, int locn, boolean logy)
private void ShoArtifax()
public int MapColor(int optn, double Vat, double Hat, double ink)
optn
- The bits of this parameter specify options:
+1 gives walls as small negative numbers,
so caller can branch off to build vertical walls;
+2 returns the car color on those locations covered by it;
+4 darkens walls (for map, so they are distinct from white);
+5 ignores CheckerBd (flat track)
+8 returns track values directly, all else as 0Vat
- The vertical coordinate, in park metersHat
- The horizontal coordinate, in park metersink
- The minimum width of the white line so it's visible
even at distances (this should be slightly wider than
your pixel width in park meters)public void SeeOnScrnPaint(int rx, int cx, int tall, int wide, int here, int colo)
rx
- The top pixel row of the image on the screencx
- The left pixel columntall
- The image height in pixelswide
- The image width in pixelshere
- The image offset in TrakImages, in ints/pix from top-leftcolo
- The border color, -1 omitsprivate void BuildFrame()
private void InTrackIt()
private void MoveCar()
public boolean GetSimFrame(int rose, int colz, byte[] pixels)
rose
- The number of image rowscolz
- The number of image columnspixels
- The array to fill with Bayer8-coded pixelspublic boolean StartImage(int rose, int colz, int tile)
public void SetServo(int pin, int set2)
public void DarkFlash()
public void FreshImage()
public boolean IsCrashed()
public double ScaleSpeed()
public double GetFacing()
public int GetMapSize()
public double GetPosn(boolean horz)
horz
- True to get the horizontal (east-west) coordinatepublic void CrashMe(boolean seen)
seen
- True to draw the red "X" on the screenpublic int TurnRadRow()
private void MakeRangeTbl()
public void Refocus(int newFoc35)
newFoc35
- The new focal length in 35mm-equivalent millimeterspublic void GotBytes(byte[] msg, int lxx)
private int Color4ix(int whom)
private boolean InitIndex(int[] theInx)
private void ReadTrakIndex()
private boolean LoadTrackInfo()
private void Valid8consts()
public void StartPatty(java.lang.String whom)


| DOSE: T+ 0:00 |
1.5 hits |
oral |
LSD |
(blotter / tab) |
| T+ 1:45 |
|
smoked |
Cannabis |
(plant material) |
| T+ 2:45 |
|
smoked |
Cannabis |
(plant material) |
Several friends and I had planned on tripping after classes on Friday, and since none of us got out of class later than 3, we all decided to dose at around 2:30 and then meet up.
2:45 - I was in a good state of mind. This was only my second time tripping, and although my first time was a little weird, I felt that this was going to be different. It was a beautiful day out - sunny, about 75 degrees, Friday. I took my one and a half hits and went back to my dorm.
4:00 - I was starting to feel the effects, so I went to meet my friends. We walked the short distance to the city park to take in the scenery. I was also feeling a little edgy, and decided that it would be a good idea to smoke a bit when we got there to settle into the trip.
4:30 - We get to the park and find an amazing spot to smoke - right at the top of a lake that ran down a bed of rocks, hidden away in about fifty yards of trees. After smoking, we were all feeling really good about our trips, and we went to the grass to lie down and chill for a bit. Everything was shifting - especially the clouds. They were huge, perfectly white, billowy clouds, and there were shifting fractal patterns extending from the edges of them. We were all lost in our own little worlds, watching the grass grow (it really was!) or whatever images our minds decided to project onto the backs of our closed eyelids. Everything was going great - much better than my first experience with LSD.
5:30 - Four of us (out of eight) split off and started to smoke more. They thought that they had picked out a great spot, but they were really just fourty feet or so away from a major road. After a cop drives by twice we decide that it's a good time to head back to campus.
5:45 - Everything is still going strong, and four of us walk around campus on our own, talking about everything that we're thinking about and seeing. All is well in the world for the next several hours.
7:30 - Still peaking, but it's getting a little edgy as the skies turn dark. We decide to smoke. We headed behind one of the dorms to one of the better known smoking spots on campus, and just as we start a cop walks around one end of the building. Two of the four of us run, J and I stayed there and got taken into the campus police station (side note - these are real police, not rent-a-cops or anything).
7:45 - By this time they had tracked down the 2 of us who had ran, and the four of us are sitting in a police station getting interrogated. They thought that there was something up since two of had ran. They were right - J and I had leftover blotter in our rooms. The school has the right to search our rooms whenever they want, and J and I both had our stuff in places where it would have been found. We were still tripping hard, but we knew that we had to make sure they didn't check our rooms
Conclusion - We were in the station for two hours. Through all of their questions, all of the mugshots, all the searching, and all the evil I could see in this officer's face, neither J nor I said one word. The other two were fumbling over what they were trying to say, and they both ended up having their rooms searched.  Earlier in the interogation the cops had said they were going to search all of our rooms, but they didn't. The key to dealing with police is to STAY QUIET. The more you talk, the more potential slip-ups you're going to make.
My school is trying to rebuild a reputation shattered by alcohol and drug abuse, and there is no doubt in our minds that had they found the LSD they would have written an official police report. Instead, they let our school's judicial administrator deal with us.
The experience in the station was a horrible one.  I was overwhelmed with feelings of anger and hatred because I was being arrested for something which I felt was not even close to a crime. Since then I go through paranoid episodes if I see police when I'm doing ANYTHING I know I could be written up for. Whether it's smoking pot, speeding, or even J-walking, it happens. I just wanted to post this in hopes that it can help guide people in the decisions they will make or the experiences they have gone through.
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.


This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Namespaces | |
| namespace | TCLAP |
Classes | |
| struct | TCLAP::ValueLike |
| A value like argument value type is a value that can be set using operator>>. More... | |
| struct | TCLAP::StringLike |
| A string like argument value type is a value that can be set using operator=(string). More... | |
| struct | TCLAP::StringLikeTrait |
| A class can inherit from this object to make it have string like traits. More... | |
| struct | TCLAP::ValueLikeTrait |
| A class can inherit from this object to make it have value like traits. More... | |
| struct | TCLAP::ArgTraits< T > |
| Arg traits are used to get compile type specialization when parsing argument values. More... |


How to Screen Record on an iPhone
by Tegan JonesI recently discovered that I've been dragging iPhone apps the hard way for my entire adult life. And I certainly wasn't the only one.
To demonstrate the easier way to do it, I took a screen recording of my phone. As it turns out, not everyone knows how to do this.
So here's an explainer.
How to set it up
Before you go on a screen recording frenzy, you'll want to set it up for ease of use later.
- Open 'Settings'
- Go to 'Control Center' and then 'Customise Controls'
- Tap the green '+' symbol next to 'Screen Recording'
These instructions will also work for iPad and iPod Touch.
How to use it
For iOS 12 and later you'll see the round recording icon when you swipe down from the top right corner of your screen.
If you're on iOS 11 or earlier, you'll need to swipe up from the bottom edge of your screen to find the record icon.
Tap the icon to trigger a 3 second countdown. Your screen will then start recording. Tap the red icon in the top left corner when you want to stop recording.
The footage will save in the photos app.
It's as simply as that! Happy recording.
Featured image: iStock/borchee
Gizmodo Australia is gobbling up the news in a different timezone, so check them out if you need another Giz fix.


class RuleGeneratorBuilder<ItemType : Item> : AbstractBuilder<ItemType>
A builder that allows to configure and create instances of the class Apriori, which are configured to generate association rules.
ItemType
- The type of the items, which are processed by the algorithm
val configuration: Configuration
The configuration that is configured by the builder. |
fun confidenceDelta(confidenceDelta: Double): RuleGeneratorBuilder<ItemType>
Sets the value, the minimum confidence should be decreased by after each iteration, when trying to generate a specific number of association rules. |
|
fun frequentItemSetCount(frequentItemSetCount: Int): RuleGeneratorBuilder<ItemType>
Sets the number of of frequent item sets, the Apriori algorithm should try to find. |
|
fun maxConfidence(maxConfidence: Double): RuleGeneratorBuilder<ItemType>
Sets the minimum confidence that should initially be used, when trying to generate a specific number of association rules. |
|
fun maxSupport(maxSupport: Double): RuleGeneratorBuilder<ItemType>
Sets the minimum support that should initially be used, when trying to find a specific number of frequent item sets. |
|
fun minConfidence(minConfidence: Double): RuleGeneratorBuilder<ItemType>
Sets the minimum confidence that must at least be reached by association rules. |
|
fun minSupport(minSupport: Double): RuleGeneratorBuilder<ItemType>
Sets the minimum support that must at least be reached by an item set to be considered frequent. |
|
fun ruleCount(ruleCount: Int): RuleGeneratorBuilder<ItemType>
Sets the number of association rule, the Apriori algorithm should try to generate. |
|
fun supportDelta(supportDelta: Double): RuleGeneratorBuilder<ItemType>
Sets the value, the minimum support should be decreased by after each iteration, when trying to find a specific number of frequent item sets. |
fun create(): Apriori<ItemType>
Creates and returns the Apriori algorithm, which has been configured by the builder. |


NCSI HPC Cluster
Cluster Status
System Information
Administrator
Jianbo He<EMAIL_ADDRESS>Room F502
Please visit the following link for more information!
https://github.com/njau-sri/hpc/wiki


Social Activities
To inculcate humanly nature and kindness into the hearts of students from childhood LFS has a unique club named POSCAP.
POSCAP stands for People Organized Social Community Awareness Program.
Here are some activities conducted by these clubs.
POSCAP conducted Flood Relief Programme,Staff along with Principal Sister visited Sathenapalli and distributed clothes and house hold items to the vicitims of Flood.
Visit to Old Age Home to spread happyness - Along with Principal Sister, Students went to Old Age Home to celebrate Chirstmas along with members of old age home.
Share Happiness Programme - Little sisters visited poor to distribute snacks, fruits to share their happiness and bring smiles on their faces.


Paused
Press Q and W to turn or E to get an I piece (only in Powermode)
Start
Pause
Restart
Easy
Medium
Hard
Back to lobby
Tetris
Highscore


give it a look!
Some are show pieces, some are just for fun, and some are commercial projects which my clients were kind enough to allow me to include here. If you like what you see let me know, any feedback is always good. If you want something similar and want to contract me for work just get in touch and I'll get back to you as quickly as possible.


*italic* **bold**
Inline:
A [link](http://url.com/)
A [link](http://url.com/
"with a title")
Reference-style labels:
A [link][id]. Then, anywhere
else, define the link:
[id]: http://url.com/ "title"
`<code>` spans are delimited
by backticks.
You can include literal
backticks like `` `this` ``.
Indent every line of a code block by at least 4 spaces.
This is a normal paragraph.
This is a preformatted
code block.
1. an ordered
2. list
* an unordered list
* '-' bullets work too
# Header 1
## Header 2
###### Header 6
> Email-style angle brackets
> are used for blockquotes.
> > And, they can be nested.
> ## Headers in blockquotes
>
> * You can quote a list.
> * Etc.
End a line with two or more spaces:
Roses are red,
Violets are blue.


Web Developer/Full Stack Developer/C# .Net Web Developer
Hi, I am Sunny Sun.
I use JavaScript (ES6), React (with Redux), C#, HTML, CSS, MongoDB (with Mongoose), MySQL (with Entity Framework), REST, .NET Core (with ASP.NET and Web API), algorithms, data structures, and more.


LIST IT. DO IT. CROSS IT OFF.
"Success is never getting to the bottom of your to-do list." -Marissa Mayer, CEO of Yahoo
Add Task:
Add Task
To Do:
Done:


HI my name is Amy and this is my digital fabrication webpage. I come from Engalnd and thought I would take this class to try something new. I have no experience with technology so this will be a challenge.