import os
from multiprocessing import cpu_count
from src.utils.parallel import parallel_process
from nussl import AudioSignal
import os
import glob
from multiprocessing import cpu_count
from . import cmd, document_parser
from argparse import ArgumentParser
import shutil
import logging
[docs]def resample_audio_file(original_path, resample_path, sample_rate, verbose=False):
"""
Resamples an audio file at one path and places it at another path at a specified
sample rate.
Args:
original_path (str): Path of audio file to be resampled.
resample_path (str): Path to save resampled audio file to.
sample_rate (int): Sample rate to resample audio file to.
"""
audio_signal = AudioSignal(original_path)
resample = True
if os.path.exists(resample_path):
resampled_signal = AudioSignal(resample_path)
resample = resampled_signal.sample_rate != sample_rate
if resample:
if verbose:
logging.info(
f'{original_path} @ {audio_signal.sample_rate} -> {resample_path} @ {sample_rate}'
)
audio_signal.resample(sample_rate)
audio_signal.write_audio_to_file(resample_path)
[docs]def ig_f(dir, files):
"""
Filter for making sure something is a file.
Args:
dir (str): Directory to filter to only look for files.
files (list): List of items to filter.
Returns:
list: Filtered list.
"""
return [f for f in files if os.path.isfile(os.path.join(dir, f))]
[docs]def resample(input_path, output_path, sample_rate, num_workers=1,
audio_extensions=['.wav', '.mp3', '.aac']):
"""
Resamples a folder of audio files into a copy of the same folder with the same
structure but with every audio file replaced with a resampled version of that
audio file. Relative paths to the audio file from the root of the folder will be the
same.
Args:
input_path (str): Root of folder where all audio files will be resampled.
output_path (str): Root of folder where all resampled files will be placed. Will match
the same structure as the input_path folder structure.
sample_rate (int): Sample rate to resample files to.
num_workers (int, optional): How many workers to use in parallel to resample files.
Defaults to 1.
audio_extensions (list, optional): Audio extensions to look for in the input_path.
Matching ones will be resampled and placed in the output_path at the
same relative location. Defaults to ['.wav', '.mp3', '.aac'].
"""
try:
shutil.copytree(input_path, output_path, ignore=ig_f)
except:
pass
input_audio_files = []
for ext in audio_extensions:
input_audio_files += glob.glob(
f"{input_path}/**/*{ext}",
recursive=True
)
output_audio_files = [
x.replace(input_path, output_path)
for x in input_audio_files
]
arguments = [
{
'original_path': input_audio_files[i],
'resample_path': output_audio_files[i][:-4] + '.wav',
'sample_rate': sample_rate,
'verbose': False if i > 0 else True
}
for i in range(len(input_audio_files))
]
parallel_process(
arguments,
resample_audio_file,
n_jobs=min(num_workers, cpu_count()),
front_num=1,
use_kwargs=True,
)
[docs]@document_parser('resample', 'scripts.resample.resample')
def build_parser():
parser = ArgumentParser()
parser.add_argument(
'--input_path', type=str,
help="""Root of folder where all audio files will be resampled."""
)
parser.add_argument(
'--output_path', type=str,
help="""Root of folder where all resampled files will be placed. Will match
the same structure as the input_path folder structure."""
)
parser.add_argument(
'--sample_rate', type=int,
help="""Sample rate to resample files to."""
)
parser.add_argument(
'--num_workers', type=int,
help="""How many workers to use in parallel to resample files.""",
default=1
)
parser.add_argument(
'--audio_extensions', nargs='+',
help="""Audio extensions to look for in the input_path. Matching ones will
be resampled and placed in the output_path at the same relative location.""",
default=['.wav', '.mp3', '.aac']
)
return parser
if __name__ == '__main__':
cmd(resample, build_parser)


|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vividsolutions.jts.algorithm.math.VectorMath
public class VectorMath
Functions for performing mathematics on vectors in the 2D plane.
Vectors are represented as single Coordinate
s;
the implied vector is assumed to start at the origin.
Vector arithmetic is useful in computing various geometric constructions.
| Constructor Summary | |
|---|---|
VectorMath()
|
| Method Summary | |
|---|---|
static Coordinate |
average(Coordinate v0,
Coordinate v1)
Computes the average of two vectors. |
static Coordinate |
difference(Coordinate v0,
Coordinate v1)
Computes the difference of two vectors [v0 - v1]. |
static double |
dotProduct(Coordinate v1,
Coordinate v2)
Computes the dot-product of two vectors |
static Coordinate |
multiply(double s,
Coordinate v)
Computes the product of a scalar and a vector. |
static Coordinate |
normalize(Coordinate v)
Normalizes a vector to have magnitude 1 |
static void |
normalizeSelf(Coordinate v)
Normalizes a vector to have magnitude 1 in-place |
static Coordinate |
pointAlong(Coordinate v0,
Coordinate v1,
double lengthFraction)
Computes a point a given fraction of length along the line joining the endpoints of two vectors. |
static Coordinate |
rotateByQuarterCircle(Coordinate v,
int numQuarters)
Rotates a vector by a given number of quarter-circles (i.e. |
static Coordinate |
sum(Coordinate v0,
Coordinate v1)
Computes the sum of two vectors. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public VectorMath()
| Method Detail |
|---|
public static Coordinate normalize(Coordinate v)
v
- the vector to normalize
public static void normalizeSelf(Coordinate v)
v
- the vector to normalizepublic static double dotProduct(Coordinate v1, Coordinate v2)
v1
- a vectorv2
- a vector
public static Coordinate average(Coordinate v0, Coordinate v1)
v0
- a vectorv1
- a vector
public static Coordinate multiply(double s, Coordinate v)
s
- a scalar valuev
- a vector
public static Coordinate pointAlong(Coordinate v0, Coordinate v1, double lengthFraction)
This is equivalent to computing the weighted sum of the two vectors:
ws = frac * v0 + (1 - frac) * v1
v0
- a vectorv1
- a vectorlengthFraction
- the fraction of the length
public static Coordinate sum(Coordinate v0, Coordinate v1)
v0
- a vectorv1
- a vector
public static Coordinate difference(Coordinate v0, Coordinate v1)
v0
- a vectorv1
- a vector
public static Coordinate rotateByQuarterCircle(Coordinate v, int numQuarters)
v
- the vector to rotate.numQuarters
- the number of quarter-circles to rotate by
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


G116.5+1.1
- Right Ascension: 23 53 40
- Declination: +63 15
- Size (/arcmin): 80×60
- Type: S
- Flux density at 1 GHz (/Jy): 10
- Spectral Index: 0.5
- Radio: Distinct shell, with high polarisation.
- Optical: Detected.
- Distance: Association with HI features implies 1.6 kpc.
References:
- Reich & Braunsfurth 1981, A&A, 99, 17. Effelsberg 100-m at 2.7 GHz (4.'4: S=4.7±0.4 Jy) and S1.4 GHz=8.0±0.8 Jy from 1.4 GHz survey data, plus HI from Maryland–Green Bank survey.
ADS
- Fesen et al. 1997, AJ, 113, 767. Optical observations.
ADS
- Lorimer et al. 1998, A&A, 331, 1002. Pulsar search.
ADS
- Yar-Uyanıker et al. 2004, ApJ, 616, 247. CGPS at 1.4 GHz (49''×55''), including HI (1.'0×1.'1).
ADS
- Mavromatakis et al. 2005, A&A, 435, 141. Optical observations.
ADS
- Tian & Leahy 2006, ChJAA, 6, 543. CGPS at 408 MHz (3.'4×3.'8: S=15.0±1.5 Jy) and 1.4 GHz (1.'0×1.'1: S=10.6±0. Jy).
ADS
- Kothes et al. 2006, A&A, 457, 1081. CGPS at 408 MHz (~3': S=12.5±1.6 Jy) and 1420 MHz (~1': S=10.3±0.70 Jy), including polarisation and review of flux densities.
ADS
- Gao et al. 2011, A&A, 529, A159. Urumqi 25-m at 5 GHz (9.'5: S=5.7±0.6 Jy), including polarisation and review of flux densities.
ADS
Last updated: 28 Apr 2014
home |
documentation |
detailed listings |
summary listings
Dave Green/Cambridge, UK/


In this turorial you'll learn how to run and customize Keptn-in-a-Box. Keptn-In-A-Box is a Bash script that will convert a plain Ubuntu machine in a Single Node Kubernetes Cluster with Keptn installed and configured (among other cool features which will set sail for your autonomous cloud journey). The script is programmed in a modular way so you can select the 🧩 installationBundle that better suits your needs.
Keptn-in-a-Box is a 🚀 rocket launcher for enabling tutorials or workshops in an easy, fast and ressource efficient way.
In a matter of minutes you'll have a fully configured Single Node Kubernetes Cluster for learning Keptn tutorials, trying out new functionalities, building your own pipeline or even delivering Performance-as-a-Self-Service.
Keptn-in-a-Box runs on microk8s, which is a simple production-grade upstream certified Kubernetes made for developers and DevOps.
The mantra behind Keptn-In-A-Box is that you
You can actually just run the program without any customization, but let's take the time to understand what Keptn-in-a-Box does for you and how you can customize the installation.
Recommended | ⦿ |
Optional | ○ |
The only prerequisite for Keptn-in-a-Box is that you get an Ubuntu machine and that it has an internet connection. This can be a VirtualMachine running in your datacenter, on your laptop or in a cloud provider such as Microsoft Azure, Amazon Web Services, Google Cloud among others.
The tested distributions are Ubuntu Server 18.04 LTS & 20.04 LTS
Don't have a VM or a Cloud Account? Don't worry, here you can sign for a free tier in:
Want to try it locally? Not a problem. Check out multipass! a great way for spinning instant Ubuntu VMs in Windows, Mac or Linux computers.
For most usecases we recommend 4 Cores
, 16 Gigs of RAM
and 20 Gigs of diskspace
. Our tests on aws have shown that the minimum required for running Keptn-in-a-Box with the default installation bundle
is a t2.medium (2 vCPU and 4 Gib of RAM) and 10 Gigabytes of disk space. Nevertheless this won't leave much space for spinning other services or onboarding applications.
For the 😎 ultimate experience you could get a t2.2xlarge
with 8 Cores, 32 Gigs of RAM and 20 Gigs of diskspace.
Below is a table for the sizing reference.
- | Size | vCPUs | Memory (GiB) |
😓 | t2.medium | 2 | 4 |
🙂 | t2.large | 2 | 8 |
😊 | t2.xlarge | 4 | 16 |
🤓 | t2.2xlarge | 8 | 32 |
If you define security rules in the Cloud provider or on your datacenter, your instance only needs to have the following ports accessible:
When your Ubuntu machine is up and running, let's log in into it.
ssh yourusername@the-bind-ip-or-dns
keptn-in-a-box.sh
Now let's download the keptn-in-a-box.sh
file and make it executable.
curl -O https://raw.githubusercontent.com/keptn-sandbox/keptn-in-a-box/release-0.6.2/keptn-in-a-box.sh
chmod +x keptn-in-a-box.sh
For the best experience we recommend that you enable Dynatrace monitoring.
By only providing your Dynatrace credentials, Keptn-in-a-Box will:
If you don't have a Dynatrace tenant yet, sign up for a free trial or a developer account.
Log in to your Dynatrace tenant and go to Settings > Integration > Dynatrace API. Then, create anew API token with the following permissions
Take a look at this screenshot to double check the right token permissions for you.
In your Dynatrace tenant, go to Settings > Integration > Platform as a Service, and create a new PaaS Token.
Now that you have an API-Token and a PaaS-Token, we can enter the credentials.
In the keptn-in-a-box.sh
file enter your credentials under the section "Define Dynatrace Environment".
# ---- Define Dynatrace Environment ----
# Sample: https://{your-domain}/e/{your-environment-id} for managed or https://{your-environment-id}.live.dynatrace.com for SaaS
TENANT="https://mytenant.live.dynatrace.com"
PAASTOKEN="myDynatracePaaSToken"
APITOKEN="myDynatraceApiToken"
That's it! When you run the program, it will detect that you enter your credentials and will download and configure Dynatrace for you.
By default Keptn-in-a-Box will curl ifconfig.me
to get the public IP where it's running and will convert the IP into a magic 🧙♂ domain with nip.io. For example if your Box is public accessible over the IP <IP_ADDRESS>
it will convert it to 116-203-255-68.nip.io
. NIP.IO is a simple wildcard DNS resolution for any IP Address.
✅ If your box has a public ip, you can go with the defaults and leave the DOMAIN
variable empty.
For example, I want to run Keptn-in-a-Box inside my home network and the VM get's the ip <IP_ADDRESS>
. I will convert the IP to a magic domain. This way the requests to any subdomain, for example to https://api.keptn.<IP_ADDRESS>.nip.io will get resolved to <IP_ADDRESS>
and then kubernetes will take care of forwarding the request internally to the Keptn API service.
Just enter the IP in a magic domain notation as shown below. The ip can contain dashes (-) or dots (.). I just like dashes more, they are prettier 💄.
# ---- Define your Domain ----
DOMAIN="192-168-0-10.nip.io"
With the above example you'll be able to access the teaser at http://192-168-0-10.nip.io
👨💻 A common feature is to use this box for workshops providing access to a guest user. If you spin the instances with a private key and you don't want to share your SSH Key, this feature will create a user, clone the home directory of the $USER
who runs the program with its folders (such as keptn-examples) and configurations for the bash
and clients like helm
, istioctl
,kubectl
, docker
and keptn
.
The following variables will define the User Account and the SSH password. Set the variables as you desire:
# ---- Workshop User ----
NEWUSER="dynatrace"
NEWPWD="dynatrace"
This functionality is disabled by default but can be independently enabled with any installation bundle. The function flag
create_workshop_user=true
needs to be active and defined after the installation bundles section. More about functions, control flags and installationBundles in the step select the Installation Bundle.
Before selecting the installation Bundle, let's understand how Keptn-in-a-box.sh
works and what it will do.
keptn-in-a-box.sh is the controller. Here we have been defining our variables. When executing this script, it will download and load the functions defined in functions.sh. Which ⨍ functions to execute are controled by their 🚦control flags. Now, an 🧩installation Bundle is the enablement for multiple control flags.
Now that we have understood the delegation of the program's logic and it's main components, here is a table of the installation Bundles and their respective enabled flags:
🚦control flag | Demo | Workshop | KeptnOnly | QualityGates | PerfAaS | All |
update_ubuntu | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
docker_install | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
microk8s_install | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
setup_proaliases | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
enable_k8dashboard | ✅ | ✅ | - | ✅ | ✅ | ✅ |
enable_registry | - | ✅ | - | - | - | ✅ |
istio_install | ✅ | ✅ | ✅ | - | - | ✅ |
helm_install | ✅ | ✅ | ✅ | - | ✅ | ✅ |
certmanager_install | - | - | - | - | - | ✅ |
certmanager_enable | - | - | - | - | - | ✅ |
keptn_install | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
keptn_examples_clone | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
resources_clone | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
dynatrace_savecredentials | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
dynatrace_configure_monitoring | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
dynatrace_activegate_install | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
dynatrace_configure_workloads | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
keptndeploy_homepage | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
keptndemo_cartsload | ✅ | ✅ | - | - | - | ✅ |
keptndemo_unleash | ✅ | ✅ | - | - | - | ✅ |
keptndemo_cartsonboard | ✅ | ✅ | - | - | - | ✅ |
expose_kubernetes_api | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
expose_kubernetes_dashboard | ✅ | ✅ | - | ✅ | ✅ | ✅ |
patch_kubernetes_dashboard | ✅ | ✅ | - | - | - | ✅ |
create_workshop_user | - | - | - | - | - | ✅ |
jenkins_deploy | - | - | - | - | - | ✅ |
jmeter_extended_service | - | - | - | ✅ | ✅ | ✅ |
keptn_install_qualitygates | - | - | - | ✅ | ✅ | ✅ |
certmanager_install | - | - | - | ✅ | ✅ | ✅ |
certmanager_install | - | - | - | ✅ | ✅ | ✅ |
The dynatrace_ control flags will be disabled if you don't enter your Dynatrace credentials.
🧩The default installation bundle is installationBundleDemo. You can change installation bundles by commenting them out in the section.
# ==================================================
# ----- Select your installation Bundle ----- #
# ==================================================
# Uncomment for installing only Keptn
# installationBundleKeptnOnly
# - Comment out if selecting another bundle
installationBundleDemo
You can also override and enable/disable specific modules after you select the installationBundle. For example lets enable the workshop account regardless of the installationBundle we selected.
# ==================================================
# ---- Enable or Disable specific functions ----- #
# ==================================================
create_workshop_user=true
# ==================================================
# ----- Call the Installation Function ----- #
# ==================================================
doInstallation
At the end of keptn-in-a-box.sh
we call the installation function. This function is defined at the end of the functions.sh
file. This function defines the order in which the different modules are to be executed since they have a chronological dependency. For example, in order to onboard an application we first need to have Keptn installed, and Keptn needs Microk8s installed and so on...
Yay! now let's see Keptn-in-a-box in action 🤘!
Now that we understand how it works and we have customized the box as we want, let's trigger the installation.
Run the script with sudo rights and send the process to the background.
sudo bash -c './keptn-in-a-box.sh &'
Why run it in the background and where is the output of the program you say? Well, keptn-in-a-box is actually optimized to be executed for non-interactive shells at the initialization of an instance. This is done programatically passing the script as user data while creating dynatrace environments and spininning multiple instances for each student. This is achieved with the Dynatrace Rest Tenant Automation programm. Yes, we love ❤ automation 🤖and the customization, creation and configuration of environments and instances is done programatically.
The script will clone the keptn-in-a-box repository in the 🏠home directory of the user that executed it. It will execute the functions marked as true
. The installation will take between 4 and 10 minutes, depending on the amount of features, internet connection speed and computing power available.
To inspect how the installation is going, type
less +F /tmp/install.log
This will open the installation log and read from the input stream. To exit just type CTRL + C
and then quit
.
At the end of the installation file you should see something similar
[Keptn-In-A-Box|INFO] [2020-05-25 10:54:40] |======================================================================
[Keptn-In-A-Box|INFO] [2020-05-25 10:54:40] |============ Installation complete :) ============
[Keptn-In-A-Box|INFO] [2020-05-25 10:54:40] |______________________________________________________________________
[Keptn-In-A-Box|INFO] [2020-05-25 10:54:40] |>->-> It took 8 minutes and 57 seconds <-<-<|
[Keptn-In-A-Box|INFO] [2020-05-25 10:54:40] |>->-> Keptn & Kubernetes Exposed Ingress Endpoints <-<-<|
NAMESPACE NAME HOSTS ADDRESS PORTS AGE
default kubernetes-api-ingress api.kubernetes.192-168-0-10.nip.io <IP_ADDRESS> 80, 443 4m51s
istio-system istio-ingress 192-168-0-10.nip.io,api.keptn.192-168-0-10.nip.io,bridge.keptn.192-168-0-10.nip.io + 5 more... <IP_ADDRESS> 80, 443 4m50s
kube-system kubernetes-ingress kubernetes.192-168-0-10.nip.io <IP_ADDRESS> 80, 443 4m51s
Let's say we selected the 🧩installationBundleWorkshop and we installed keptn-in-a-box in a VM in our home network and the student is dynatrace
with the password dynatrace
and the domain is 192-168-0-10.nip.io (for ip <IP_ADDRESS>)
After a shell login
ssh<EMAIL_ADDRESS>List the content of the home directory:
ls
examples keptn-in-a-box snap
You'll have 3 directories; a clone of the keptn examples, a clone of keptn-in-a-box repository and the configuration of microk8s in snap.
The clients are configured and ready to use helm
, istioctl
,kubectl
, docker
and keptn
.
For example type:
keptn status
Starting to authenticate
Successfully authenticated
Using a file-based storage for the key because the password-store seems to be not set up.
CLI is authenticated against the Keptn cluster https://api.keptn.192-168-0-10.nip.io
to see that keptn is installed and already configured or type
kubectl get all -n sockshop-dev
to list the cart sample pods and services of the development stage. You'll notice that autocomplete is also enabled.
Service | URL |
Teaser | https://192-168-0-10.nip.io |
Kubernetes Dashb. | https://kubernetes.192-168-0-10.nip.io |
Kubernetes API | https://api.kubernetes.192-168-0-10.nip.io |
Keptn API (swagger) | https://api.keptn.192-168-0-10.nip.io/swagger-ui |
Keptn Bridge | https://bridge.keptn.192-168-0-10.nip.io |
Unleash | https://unleash.unleash-dev.192-168-0-10.nip.io |
Carts pipeline overview | https://192-168-0-10.nip.io/pipeline/ |
The Teaser contains links to most of the available services. You can print also the services by showing the configured ingresses in kubernetes
kubectl get ing -A
Now that you have your single node Kubernetes Cluster configured and up and running, you are all set to continue your journey to the autonomous cloud. Start typing kubectl
commands, onboard applications with keptn
, or maybe create your own unbreakable pipeline locally? What about creating your own Keptn Service? Take a look at more Keptn tutorials.
Please visit us in our Keptn Slack and tell us how you like Keptn and this tutorial! We are happy to hear your thoughts & suggestions!
Also, please follow us on Twitter to get the latest news on Keptn, our tutorials and newest releases!


About
Theme: Current challenges and future directions in automation, systems, and controls.
Goals: Our overarching goal is to spark discussions around the following questions: What are the key challenges in the development of control and automation solutions to the complex problems of today? What are unique future opportunities and problems where control and automation would play a key role? How do we increase diversity, equity, and inclusion in our branches of engineering?
The 4th NorCal Control Workshop provides a forum to bring together university students, postdocs, and faculty, along with industry representatives, working in the broad area of systems and control.
The workshop aims to share knowledge and build new connections in the Northern California region.
Venue
UC Santa Cruz, Baskin Engineering, E2 180 (Baskin Events Center)
Registration
Registration is currently closed. Talks will be posted below
Talks
| Presenter | Affiliation | Title | Time |
|---|---|---|---|
| Ricardo/Gabe | UCSC | Welcome and logistics | |
| Zhonyu Li | UC Berkeley | Bridging Model-based Safety and Model-free Reinforcement Learning through System Identification of Low Dimensional Linear Models | |
| Samuel Pfrommer | UC Berkeley | Safe Reinforcement Learning with Chance-constrained Model Predictive Control | |
| Shreyas Kousik | Stanford University | Safe Control in Uncertain, Dynamic, Multi-Agent Scenes | |
| Anni Zhao | UC Merced | Robustness and performance of reduced order model based control design | |
| Break, Poster Sessions | |||
| Aaron Hunter | UCSC | A Distributed Control System for Resource Constrained Autonomous Vehicles | |
| Jerry Tang | UC Berkeley | Design of passively morphing drone | |
| Jay Ryan Roldan | UCSC | Suture Looping Task Pose Planner in a Constrained Surgical Environment | |
| Nan Wang | UCSC | Hybrid RRT: Motion Planning for Hybrid Dynamical Systems | |
| Lunch and Keynote Speaker Dave Powell of Stanford University | |||
| Giovanny Marquez | UCSC | Controlling cellular response with bioelectronics and feedback control | |
| Shourya Bose | UCSC | Microgrid Load Restoration: Formluation and Solution Strategies | |
| Iman Nodozi | UCSC | Neural Schrodinger Bridge for Minimum Effort Self Assembly | |
| Kimberly Chan | UC Berkeley | Automated Tuning of Generic Embedded Controllers using Multi-objective Bayesian Optimization | |
| Break, Poster Sessions | |||
| Jon Wagstaff | UCSC | Gaussian Process Kernel Selection for Performance Prediction based on Physiological Data | |
| Luis Burbano and Juanita Gomez | UCSC | Private Anomaly Detection | |
| Neelay Junnarkar | UC Berkeley | Synthesis of Stabilizing Recurrent Equilibrium Network Controllers |
Logistics
Directions: UCSC campus maps and directions. Directions to Baskin Engineering Complex.
Parking lots: Core West Structure (closest parking lot to the Engineering Building 2). Additional campus parking lots.
Parking permits: You must purchase a parking permit from the Information Kiosk located on Coolidge Drive near the main campus entrance at Bay and High Streets. A map of this location is available here. Parking permits are available at the kiosk for $10.
Food: Breakfast, lunch and coffee will be available for the workshop participants.
WiFi: eduroam
Contact
Ricardo Sanfelice<EMAIL_ADDRESS>Gabriel Elkaim (elkaim@soe.ucsc.edu)


In order to facilitate parsing of http requests and creating
appropriate responses this package provides two classes to handle a lot of
the housekeeping involved in working with http exchanges. The infrastructure
builds upon the 'rook' specification and is thus well suited to be combined
with 'httpuv' based web servers.
| Version: |
0.2.2 |
| Depends: |
R (≥ 2.10) |
| Imports: |
R6, assertthat, stringi, urltools, tools, brotli, jsonlite, xml2, webutils, utils |
| Suggests: |
fiery, testthat, covr |
| Published: |
2018-11-12 |
| Author: |
Thomas Lin Pedersen [cre, aut] |
| Maintainer: |
Thomas Lin Pedersen <thomasp85 at gmail.com> |
| BugReports: |
https://github.com/thomasp85/reqres/issues |
| License: |
MIT + file LICENSE |
| URL: |
https://github.com/thomasp85/reqres#reqres |
| NeedsCompilation: |
no |
| Materials: |
README NEWS |
| In views: |
WebTechnologies |
| CRAN checks: |
reqres results |


--- layout: post title: Breaking user-agent news date: 2010-03-15 00:00:00 categories: mobile software-development ---
Via the WMLProgramming mailing list, see this bug report, and listen to the sound of an assumption creaking gently in the wind.
For quite some time now, folks in the mobile industry have been using the User-Agent HTTP header to identify devices, look up capabilities (using a device database like the WURFL), and deliver appropriate versions of content. Industry initiatives like transcoding which threaten the ability to do this have been met with a variety of flavours of opposition... but it looks like there's a new threat to this practice:
"The different User-Agents are an expected outcome of how Android works. Different parts of the Android system handle different actions.The browser renders the various mark-up languages, but it will hand off to other applications to handle various file types. In the case of the video player, it uses the OpenCORE framework as you indicated to play video files where the source is HTTP."
Despite the problems such an approach might cause, it isn't actually wrong, either. RFC1945 defines a user agent as:
The client which initiates a request. These are often browsers, editors, spiders (web-traversing robots), or other end user tools.
So what happens now? Do we start expanding device databases to include not only browser user agents, but also those of individual applications on individual platforms - even presuming that we can distinguish different devices by the apps that run on them? Or do we use some other mechanism to determine device capabilities?


Here are some great services that we provide to help our customer without spending so much money!
Looking for the best cars in United Kingdom made easy. Simply look for them in this website!
Name of the car
£5000
Click for more details ...
Price: £5000
Short description of the car.
Read more ..


This domain hosted an aspiring college student's webpage.
You can find me here!
Email: me AT nandythoughts.com.
2021 © Nathan A


Review: The Astronaut's Wife (1999)
Written and directed by Rand Ravich Starring Charlize Theron, Johnny Depp, Joe Morton, Nick Cassavetes, Donna Murphy, Clea DuVall
Here `Rosemary's Baby' meets `The Right Stuff,' or, more accurately, the wrong stuff. A near total lack of characterization torpedoes this lackluster film, and Theron's somnolent acting doesn't help.
It has been said that science fiction is about ideas, not character. Bad science fiction certainly is, and `The Astronaut's Wife' qualifies as bad sci-fi. While Theron's character, Jillian, is front and center throughout the movie, I left the theater without a clue as to who this woman is. Or her husband Spencer (Depp) either, for that matter. Depp at least has an excuse for looking blank and empty inside: he's been reprogrammed by space aliens and is a pod person. In Theron's case, it's just bad acting.
Really bad acting. She can't even manage a convincing American accent. In scene after scene, things happen to her-- mostly bad things--and she looks like she simply doesn't know how she should be reacting, and would be incapable of conveying the emotion even if she did know. She's hopelessly vague, except for a couple of scenes where she overacts.
Admittedly, the material is not very good. But Theron does absolutely nothing with it. Jillian is pregnant; there's something wrong with her husband, he's changed, and she becomes gradually convinced that he's possessed. There may be something wrong with the twins inside her. Nobody will believe her of course: to complicate matters, she has a history of mental illness. At first she loves her husband (or so we're told), then she suspects him, finally she's afraid of him; throughout, she reacts with the same stony indifference.
Depp's character is a confused mess too. Is he a good ol' boy who drinks Budweiser from the bottle or a corporate shark who sips Scotch? His hair style and accent give him an uncanny resemblance to an Elvis impersonator, which doesn't help his credibility as the film's heavy. He does at least manage to come across as creepy at times. He keeps appearing unexpectedly behind Jillian; it had me thinking maybe she should hang a bell around his neck, like a miscreant cat.
Both Depp and Theron are way too pretty to be believable in these roles. He looks like he stepped off the cover of GQ, she from Vogue. One moment she's uneasy about uprooting from their Florida home; in the very next scene she's mixing with New York society, wearing expensive clothes well. Theron should have stuck to modeling; she's always striking poses in the film. I half expected there to be a man just offscreen with a Nikon calling out, `Pouty, pouty ... work it!' Jillian and Spencer's cavernous NY apartment is straight out of Architectural Digest, too. It just isn't a believable transition from Cocoa Beach. Even NASA offices look fabulous in this absurd film. There are lots of extravagant camera angles and unnecessary camera movement too, in order to jazz up the visuals. This movie is all surface.
There are some clever bits, including one where creepy Spencer caresses Jillian and lets his fingers pause to feel the pulse points in her neck and wrist. This lets the audience know there's something odd about this guy. (It also had me wondering why Jillian didn't notice.) There's another clever scene where Jillian turns Spencer's radio on and is so relived that it's not tuned to interstation static (he receives messages from his pals the aliens that way) that she starts doing a little dance to the music. It's the closest Jillian ever comes to being charming and real in this movie, plus there's a nice shock when the ever-lurking Spence pops up and scares the bejezus out of her. Never mind that we've already seen this gag done on a 30-second hair color commercial....
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


|
Helix
|
#include <ProjectTable.h>
Public Member Functions | |
| ProjectTable () | |
| Standard Constructor. More... | |
| ProjectTable (const ProjectTable &c) | |
| Standard Copy Constructor. More... | |
| ProjectTable & | operator= (const ProjectTable &c) |
| Standard Assignment Operator. More... | |
| virtual | ~ProjectTable () |
| Standard Destructor. More... | |
| ProjectTable & | init () |
| Initialize this data object to have all empty or 0 values. More... | |
| ProjectTable & | checkSize () |
| Call check_size() on all of our twine members. More... | |
| ProjectTable (xmlNodePtr node) | |
| Construct from an XML Node. More... | |
| ProjectTable & | readXmlNode (xmlNodePtr node) |
| Read an XML Node to set our contents. More... | |
| xmlNodePtr | createXmlNode (xmlNodePtr parent) const |
| Create an XML Node as a child of the given parent. More... | |
| xmlDocPtr | createXmlDoc () const |
| Create an XML Document from this data object. More... | |
Static Public Member Functions | |
| static vector< ProjectTable * > * | readXmlChildren (xmlNodePtr parent) |
| Create a series of these objects by reading all children of the given parent. More... | |
| static void | createXmlChildren (xmlNodePtr parent, vector< ProjectTable * > *vect) |
| Create a series of xml child nodes based on the input vector. More... | |
| static void | deleteVector (vector< ProjectTable * > *vect) |
| Handle deleting a vector and its contents. More... | |
| static twine & | Name () |
| Static method to retrieve the name of this object. More... | |
| static void | insert (SqlDB &sqldb, ProjectTable &obj) |
| static void | insert (SqlDB &sqldb, twine &stmt, bool useInputs, ProjectTable &obj) |
| static void | insert (SqlDB &sqldb, vector< ProjectTable * > *v) |
| static twine | insert_prepSQL (IOConn &ioc, ProjectTable &obj) |
| static twine | insert_getSQL () |
| static void | update (SqlDB &sqldb, twine &TableName, twine &Description, twine &guid) |
| static void | update (SqlDB &sqldb, twine &stmt, bool useInputs, twine &TableName, twine &Description, twine &guid) |
| static twine | update_prepSQL (IOConn &ioc, twine &TableName, twine &Description, twine &guid) |
| static twine | update_getSQL () |
| static void | deleteByID (SqlDB &sqldb, twine &guid) |
| static void | deleteByID (SqlDB &sqldb, twine &stmt, bool useInputs, twine &guid) |
| static twine | deleteByID_prepSQL (IOConn &ioc, twine &guid) |
| static twine | deleteByID_getSQL () |
| static vector< ProjectTable * > * | selectAllForProject (SqlDB &sqldb, twine &projguid) |
| static vector< ProjectTable * > * | selectAllForProject (SqlDB &sqldb, twine &stmt, bool useInputs, twine &projguid) |
| static twine | selectAllForProject_prepSQL (IOConn &ioc, twine &projguid) |
| static twine | selectAllForProject_getSQL () |
Public Attributes | |
| twine | DataName |
| All Data Members are public. More... | |
| twine | Description |
| twine | TableName |
| twine | guid |
| twine | projdataguid |
| twine | projguid |
| TableCol_svect | Columns |
| Any Child Vectors will be defined here. More... | |
This is a generated data object class that is used for interfacing with a database. This class was generated based on the settings in the file: ../logic/dev/ProjectTable.sql.xml
| ProjectTable::ProjectTable | ( | ) |
Standard Constructor.
| ProjectTable::ProjectTable | ( | const ProjectTable & | c | ) |
Standard Copy Constructor.
|
virtual |
Standard Destructor.
| ProjectTable::ProjectTable | ( | xmlNodePtr | node | ) |
Construct from an XML Node.
| ProjectTable & ProjectTable::checkSize | ( | ) |
Call check_size() on all of our twine members.
|
static |
Create a series of xml child nodes based on the input vector.
| xmlDocPtr ProjectTable::createXmlDoc | ( | ) | const |
Create an XML Document from this data object.
| xmlNodePtr ProjectTable::createXmlNode | ( | xmlNodePtr | parent | ) | const |
Create an XML Node as a child of the given parent.
|
static |
This is an DELETE method. It is designed to run a single delete statement and return. If something goes wrong, we will throw AnException.
Developer Comments:
This removes a project table by guid
Sql Statement:
delete from projtable where guid = ?
|
static |
This one matches the above in functionality, but allows you to pass in the sql statement and a flag to indicate whether the input parameters will be used.
|
inlinestatic |
This method returns the sql statement that is used by the above functions.
|
static |
This method will do a replacement of all of the parameter markers in the sql statement with the standard parameter list that is defined. This is useful for automatically prepping a SQL statement that doesn't work with parameter markers.
|
static |
Handle deleting a vector and its contents.
| ProjectTable & ProjectTable::init | ( | ) |
Initialize this data object to have all empty or 0 values.
|
static |
This is an INSERT method. It is designed to run a single insert statement and return. If something goes wrong, we will throw AnException.
Developer Comments:
This adds a new project table entry to our database
Sql Statement:
insert into projtable (guid, projdataguid, TableName, Description) values ( ?, ?, ?, ?)
|
static |
This one matches the above in functionality, but allows you to pass in the sql statement and a flag to indicate whether the input parameters will be used.
|
static |
This version of the method allows you to pass in a vector of objects to be inserted, and we will ensure that all of them are inserted within a single commit block within Sqlite.
|
inlinestatic |
This method returns the sql statement that is used by the above functions.
|
static |
This method will do a replacement of all of the parameter markers in the sql statement with the standard parameter list that is defined. This is useful for automatically prepping a SQL statement that doesn't work with parameter markers.
|
static |
Static method to retrieve the name of this object.
| ProjectTable & ProjectTable::operator= | ( | const ProjectTable & | c | ) |
Standard Assignment Operator.
|
static |
Create a series of these objects by reading all children of the given parent.
| ProjectTable & ProjectTable::readXmlNode | ( | xmlNodePtr | node | ) |
Read an XML Node to set our contents.
|
static |
This is a SELECTTODO method. It is designed to run a single select statement and create a vector of data objects that represent the result set. This method returns the resulting vector of data objects. If something goes wrong, we will throw a SQLException.
Developer Comments:
This selects all project tables in the database for a given project
Sql Statement:
select projtable.guid, project.guid, projdata.guid, projdata.DataName, TableName, projtable.Description from project, projdata, projtable where project.guid = projdata.projguid and projdata.guid = projtabl.projdataguid order by projdata.DataName, TableName where project.guid = ?
DataObject Attributes Used:
|
static |
This one matches the above in functionality, but allows you to pass in the sql statement and a flag to indicate whether the input parameters will be used.
|
inlinestatic |
This method returns the sql statement that is used by the above functions.
|
static |
This method will do a replacement of all of the parameter markers in the sql statement with the standard parameter list that is defined. This is useful for automatically prepping a SQL statement that doesn't work with parameter markers.
|
static |
This is an UPDATE method. It is designed to run a single update statement and return. If something goes wrong, we will throw AnException.
Developer Comments:
This updates the settings for a given project table in the database
Sql Statement:
update projtable set TableName = ?, Description = ? where guid = ?
|
static |
This one matches the above in functionality, but allows you to pass in the sql statement and a flag to indicate whether the input parameters will be used.
|
inlinestatic |
This method returns the sql statement that is used by the above functions.
|
static |
This method will do a replacement of all of the parameter markers in the sql statement with the standard parameter list that is defined. This is useful for automatically prepping a SQL statement that doesn't work with parameter markers.
| TableCol_svect Helix::Logic::dev::ProjectTable::Columns |
Any Child Vectors will be defined here.
| twine Helix::Logic::dev::ProjectTable::DataName |
All Data Members are public.
| twine Helix::Logic::dev::ProjectTable::Description |
| twine Helix::Logic::dev::ProjectTable::guid |
| twine Helix::Logic::dev::ProjectTable::projdataguid |
| twine Helix::Logic::dev::ProjectTable::projguid |
| twine Helix::Logic::dev::ProjectTable::TableName |


Campus AddressRose-Hulman Institute of Technology |
Braxton T. K. H<EMAIL_ADDRESS>|
Permanent Address7228D Hawaii Kai Drive |
|---|---|---|
Objective: |
Seeking a computer science or software engineering internship for the summer of 2021 |
|
Education: |
Bachelor of Science, Computer Science Relevant Courses: Introduction to Software Development, Object-Oriented Software Development, Introduction to Computer Systems, Computer Architecture I, Data Structures and Algorithm Analysis, Database Systems, Introduction to Web Programming, Operating Systems |
May 2023 |
Skills: |
Software: C, Java, Python, T-SQL, SQL Server, HTML/CSS, MIPS Assembly, ARM assembly, Arduino, Xilinx ISE Design Suite, PyCharm, Eclipse, Maple, Google Suite Digital Fabrication: Laser cutter, 3D printer |
|
Experiences: |
|
9/2019 - Current |
Projects: |
|
1/2021 - 2/2021 |
|
|
9/2020 – 11/2020 |
|
|
|
1/2020 – 2/2020 |
|
Honors: |
Dean’s List |
(4/4) Quarters |
Activities/Clubs: |
Alpha Lambda Delta, member (Freshman Honors Society) |
5/2020 - Current |


public interface IPersistenceStore
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getObjectNames()
Return iterator over the names of all already loaded objects in the
storage.
|
Collection<IPersistable> |
getObjects()
Return iterator over the already loaded objects in the storage.
|
boolean |
load(IPersistable obj)
Load state of an already instantiated persistent object.
|
IPersistable |
load(String name)
Load a persistent object with the given name.
|
void |
notifyClose()
Notify store that it's being closed.
|
boolean |
remove(IPersistable obj)
Delete the passed persistent object.
|
boolean |
remove(String name)
Delete the persistent object with the given name.
|
boolean |
save(IPersistable obj)
Persist given object.
|
boolean save(IPersistable obj)
obj
- Object to storetrue
on success, false
otherwiseIPersistable load(String name)
name
- the name of the object to loadnull
if no such object was
foundboolean load(IPersistable obj)
obj
- the object to initializboolean remove(IPersistable obj)
obj
- the object to deletetrue
if object was persisted and thus can be removed, false
otherwiseboolean remove(String name)
name
- the name of the object to deletetrue
if object was persisted and thus can be removed, false
otherwiseSet<String> getObjectNames()
Collection<IPersistable> getObjects()
void notifyClose()
Copyright © 2005-2013. All Rights Reserved.


Archiva is a feature rich repository manager. Below is a short tour of some of the features that are available.


Launchpad Project Wizard
Create functional applications (quickstarts) or project frameworks that enable you to quickly develop cloud-native applications using the Eclipse Vert.x, WildFly Swarm, or Spring Boot runtimes. You can:
- Select an existing fully functional quickstart or create a runtime project framework.
- Import the quickstart or runtime project into JBoss Developer Studio (or your preferred IDE). Then adapt, run, and test it locally.
- Deploy your completed project to Red Hat OpenShift Online.
For more information, see: Release Notes and Supported Runtime Versions.


You can import any of the types of comma-delimited or tab-delimited files listed below.
If the system returns a message "No importer for file", this means the file does not have all the fields listed below.
You can also import QIF files - but you should have transactions for all your accounts in a single file, because if you use a separate file for each account, transfers between accounts in different files will appear twice.
Quick books does not show the full name of sub-accounts in its reports. It is therefore essential that you edit any subaccounts to give them unique names. E.g. rename the Taxes subaccount under Payroll to Payroll/Taxes.
To transfer data from Quick Books, you only need 2 files.
Use File, Utilites, Export to produce an IIF File - if you tick all the boxes, you can create a single file containing most of your data. The only other data you will need is a Custom Transaction Detail Report for the transactions. Customize the report, make sure all the fields listed below are selected, select All dates, run the report and then print it to a tab-delimited file.
When importing, import your IIF Import File first, then go to Admin, Settings in this accounts package, and make sure everything is filled in, especially your financial year start - this is vital to ensure your VAT payments are matched correctly.
Finally, import your Transaction Detail Report.
Note that there is currently no way of importing payment history from Quick Books.
| Report type | Field name |
| {{{Name}}} | {{#each Fields}}{{{TheirName}}} |
| {{/each}} |


Toggle navigation
Menu
the foo[di]
New Report
Our Story
Uses
Price Calculator
Contact
1. Name of Restaurant:
2. Type of Cuisine:
Select one...
American
Canadian
Chinese
Coffee
Dessert
Filipino
French
Greek
Indian
Italian
Japanese
Korean
Malaysian
Mexican
Thai
Singaporean
Spanish
Taiwanese
Vietnamese
3. Style of Food:
4. Price Point
$
$$
$$$
$$$$
5. Featured Dish
5. Details:
6. The Verdict
7. Notes:
submit
Restaurant Report


Brevet Distance in km: (200, 300, 400, 600, or 1000)
Input distances are in (miles or km):
Brevet Start Date and Start Time (Time is in 24 Hour Format, YYYY/MM/DD HH:MM):
Checkpoint#
Distance
Location
Open Date & Time
Close Date & Time
{{x}}
0 (start)


2 writes to _isEntered
System.Management.Automation (2)
engine\remoting\common\fragmentor.cs (2)
534
_isEntered
= true;
551
_isEntered
= false;
3 references to _isEntered
System.Management.Automation (3)
engine\remoting\common\fragmentor.cs (3)
533
Dbg.Assert(!
_isEntered
, "Stream is already entered. You cannot enter into stream again.");
576
Dbg.Assert(
_isEntered
, "Stream should be Entered before writing into.");
614
Dbg.Assert(
_isEntered
, "Stream should be Entered before writing into.");


A Developer
I'm a web developer and programmer from Lucknow, India. I am currently pursuing bachelor's degree in Information Technology from BIT Mesra, Ranchi.
I have a passion for web development and love to create for web and mobile devices. I know how to create websites, to run across devices using the latest technologies available.
I am also into competetive programming and love playing with alogrithms and data-structures.
If you have a project that you want to get started, think you need my help with something or just fancy saying hey, then get in touch.
CONTACT ME


?New
York
Botanical
Garden
lbOM5bfl
°
«
botanical
.«AR^
/P
Plant*
Cubenses
Wrightian®.
(b^'oo-i
£
c
t/v^-h
£us-
Y*^
(ąy^Y'
(',
L.
Catasus
Diciembre
2003
V,
PlantŌ
Cubenses
WrightianK.
Com,.
C.
WRIGHT,
1865.
Coll.
C.
WRIGHT,
1865.
1604568
1604569
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


Action Recognition
Feature Fusion
[HP]THOTH Team
[HP] Ivan Laptev
[HP] Xiaojiang Peng
[HP] WILLOW
[HP] Xiaodong Yang
[HP] Chi Keung Tang
Review/Survey Papers
Going Deeper into Action Recognition - A Survey
Online Resources
Awesome Action Recognition
行为识别(HAR)调研


In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code, but left the implementation of the neural network up to you (for the most part). After you've submitted this project, feel free to explore the data and the model more.
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
A critical step in working with neural networks is preparing the data correctly. Variables on different scales make it difficult for the network to efficiently learn the correct weights. Below, we've written the code to load and prepare the data. You'll learn more about this soon!
data_path = 'Bike-Sharing-Dataset/hour.csv'
rides = pd.read_csv(data_path)
rides.head()
This dataset has the number of riders for each hour of each day from January 1 2011 to December 31 2012. The number of riders is split between casual and registered, summed up in the cnt
column. You can see the first few rows of the data above.
Below is a plot showing the number of bike riders over the first 10 days in the data set. You can see the hourly rentals here. This data is pretty complicated! The weekends have lower over all ridership and there are spikes when people are biking to and from work during the week. Looking at the data above, we also have information about temperature, humidity, and windspeed, all of these likely affecting the number of riders. You'll be trying to capture all this with your model.
rides[:24*10].plot(x='dteday', y='cnt')
Here we have some categorical variables like season, weather, month. To include these in our model, we'll need to make binary dummy variables. This is simple to do with Pandas thanks to get_dummies()
.
dummy_fields = ['season', 'weathersit', 'mnth', 'hr', 'weekday']
for each in dummy_fields:
dummies = pd.get_dummies(rides[each], prefix=each, drop_first=False)
rides = pd.concat([rides, dummies], axis=1)
fields_to_drop = ['instant', 'dteday', 'season', 'weathersit',
'weekday', 'atemp', 'mnth', 'workingday', 'hr']
data = rides.drop(fields_to_drop, axis=1)
data.head()
To make training the network easier, we'll standardize each of the continuous variables. That is, we'll shift and scale the variables such that they have zero mean and a standard deviation of 1.
The scaling factors are saved so we can go backwards when we use the network for predictions.
quant_features = ['casual', 'registered', 'cnt', 'temp', 'hum', 'windspeed']
# Store scalings in a dictionary so we can convert back later
scaled_features = {}
for each in quant_features:
mean, std = data[each].mean(), data[each].std()
scaled_features[each] = [mean, std]
data.loc[:, each] = (data[each] - mean)/std
We'll save the last 21 days of the data to use as a test set after we've trained the network. We'll use this set to make predictions and compare them with the actual number of riders.
# Save the last 21 days
test_data = data[-21*24:]
data = data[:-21*24]
# Separate the data into features and targets
target_fields = ['cnt', 'casual', 'registered']
features, targets = data.drop(target_fields, axis=1), data[target_fields]
test_features, test_targets = test_data.drop(target_fields, axis=1), test_data[target_fields]
We'll split the data into two sets, one for training and one for validating as the network is being trained. Since this is time series data, we'll train on historical data, then try to predict on future data (the validation set).
# Hold out the last 60 days of the remaining data as a validation set
train_features, train_targets = features[:-60*24], targets[:-60*24]
val_features, val_targets = features[-60*24:], targets[-60*24:]
Below you'll build your network. We've built out the structure and the backwards pass. You'll implement the forward pass through the network. You'll also set the hyperparameters: the learning rate, the number of hidden units, and the number of training passes.
The network has two layers, a hidden layer and an output layer. The hidden layer will use the sigmoid function for activations. The output layer has only one node and is used for the regression, the output of the node is the same as the input of the node. That is, the activation function is $f(x)=x$. A function that takes the input signal and generates an output signal, but takes into account the threshold, is called an activation function. We work through each layer of our network calculating the outputs for each neuron. All of the outputs from one layer become inputs to the neurons on the next layer. This process is called forward propagation.
We use the weights to propagate signals forward from the input to the output layers in a neural network. We use the weights to also propagate error backwards from the output back into the network to update our weights. This is called backpropagation.
Hint: You'll need the derivative of the output activation function ($f(x) = x$) for the backpropagation implementation. If you aren't familiar with calculus, this function is equivalent to the equation $y = x$. What is the slope of that equation? That is the derivative of $f(x)$.
Below, you have these tasks:
self.activation_function
in __init__
to your sigmoid function.train
method.train
method, including calculating the output error.run
method.class NeuralNetwork(object):
def __init__(self, input_nodes, hidden_nodes, output_nodes, learning_rate):
# Set number of nodes in input, hidden and output layers.
self.input_nodes = input_nodes
self.hidden_nodes = hidden_nodes
self.output_nodes = output_nodes
# Initialize weights
self.weights_input_to_hidden = np.random.normal(0.0, self.hidden_nodes**-0.5,
(self.hidden_nodes, self.input_nodes))
self.weights_hidden_to_output = np.random.normal(0.0, self.output_nodes**-0.5,
(self.output_nodes, self.hidden_nodes))
self.lr = learning_rate
#### Set this to your implemented sigmoid function ####
# Activation function is the sigmoid function
self.activation_function = self.__sigmoid
def __sigmoid(self, x):
return 1 / (1 + np.exp(-x))
def train(self, inputs_list, targets_list):
# Convert inputs list to 2d array
inputs = np.array(inputs_list, ndmin=2).T
targets = np.array(targets_list, ndmin=2).T
#### Implement the forward pass here ####
### Forward pass ###
# TODO: Hidden layer
hidden_inputs = np.dot(self.weights_input_to_hidden, inputs) # signals into hidden layer
hidden_outputs = self.activation_function(hidden_inputs) # signals from hidden layer
# TODO: Output layer
final_inputs = np.dot(self.weights_hidden_to_output, hidden_outputs) # signals into final output layer
final_outputs = final_inputs # signals from final output layer
#### Implement the backward pass here ####
### Backward pass ###
# TODO: Output error
output_errors = targets - final_outputs # Output layer error is the difference between desired target and actual output.
# TODO: Backpropagated error
hidden_errors = np.dot(self.weights_hidden_to_output.T, output_errors) # errors propagated to the hidden layer
hidden_grad = hidden_outputs * (1 - hidden_outputs) # hidden layer gradients
# TODO: Update the weights
self.weights_hidden_to_output += self.lr * np.dot(output_errors, hidden_outputs.T)
self.weights_input_to_hidden += self.lr * np.dot(hidden_grad * hidden_errors, inputs.T) #* inputs # update input-to-hidden weights with gradient descent step
def run(self, inputs_list):
# Run a forward pass through the network
inputs = np.array(inputs_list, ndmin=2).T
#### Implement the forward pass here ####
# TODO: Hidden layer
hidden_inputs = np.dot(self.weights_input_to_hidden, inputs) # signals into hidden layer
hidden_outputs = self.activation_function(hidden_inputs) # signals from hidden layer
# TODO: Output layer
final_inputs = np.dot(self.weights_hidden_to_output, hidden_outputs) # signals into final output layer
final_outputs = final_inputs # signals from final output layer
return final_outputs
def MSE(y, Y):
return np.mean((y-Y)**2)
Here you'll set the hyperparameters for the network. The strategy here is to find hyperparameters such that the error on the training set is low, but you're not overfitting to the data. If you train the network too long or have too many hidden nodes, it can become overly specific to the training set and will fail to generalize to the validation set. That is, the loss on the validation set will start increasing as the training set loss drops.
You'll also be using a method know as Stochastic Gradient Descent (SGD) to train the network. The idea is that for each training pass, you grab a random sample of the data instead of using the whole data set. You use many more training passes than with normal gradient descent, but each pass is much faster. This ends up training the network more efficiently. You'll learn more about SGD later.
This is the number of times the dataset will pass through the network, each time updating the weights. As the number of epochs increases, the network becomes better and better at predicting the targets in the training set. You'll need to choose enough epochs to train the network well but not too many or you'll be overfitting.
This scales the size of weight updates. If this is too big, the weights tend to explode and the network fails to fit the data. A good choice to start at is 0.1. If the network has problems fitting the data, try reducing the learning rate. Note that the lower the learning rate, the smaller the steps are in the weight updates and the longer it takes for the neural network to converge.
The more hidden nodes you have, the more accurate predictions the model will make. Try a few different numbers and see how it affects the performance. You can look at the losses dictionary for a metric of the network performance. If the number of hidden units is too low, then the model won't have enough space to learn and if it is too high there are too many options for the direction that the learning can take. The trick here is to find the right balance in number of hidden units you choose.
# Grid search
import sys
### Set the hyperparameters here ###
epochs = [2000, 1000, 500]
learning_rates = [0.3, 0.2, 0.1, 0.08, 0.06, 0.01, 0.001]
hidden_nodes = [30, 25, 20, 18, 16, 14, 12, 10, 8]
output_nodes = 1
N_i = train_features.shape[1]
print('epoch\tlr\tnodes\ttrain\tvalidation\tscore')
for epoch in epochs:
for rate in learning_rates:
for nodes in hidden_nodes:
network = NeuralNetwork(N_i, nodes, output_nodes, rate)
losses = {'train':[], 'validation':[]}
for e in range(epoch):
# Go through a random batch of 128 records from the training data set
batch = np.random.choice(train_features.index, size=128)
for record, target in zip(train_features.ix[batch].values,
train_targets.ix[batch]['cnt']):
network.train(record, target)
# Printing out the training progress
train_loss = MSE(network.run(train_features), train_targets['cnt'].values)
val_loss = MSE(network.run(val_features), val_targets['cnt'].values)
losses['train'].append(train_loss)
losses['validation'].append(val_loss)
print('{0:.0f}\t{1:.3f}\t{2:.0f}\t{3:.3f}\t{4:.3f}\t\t{5:.5f}'.format(epoch, rate, nodes,
np.min(losses['train']),
np.min(losses['validation']),
np.min(losses['train']) * np.min(losses['validation'])))
import sys
### Set the hyperparameters here ###
# This seems to generalise better
epochs = 500
learning_rate = 0.08
hidden_nodes = 16
# This looks like is overfits
# epochs = 2000
# learning_rate = 0.3
# hidden_nodes = 30
output_nodes = 1
N_i = train_features.shape[1]
network = NeuralNetwork(N_i, hidden_nodes, output_nodes, learning_rate)
losses = {'train':[], 'validation':[]}
for e in range(epochs):
# Go through a random batch of 128 records from the training data set
batch = np.random.choice(train_features.index, size=128)
for record, target in zip(train_features.ix[batch].values,
train_targets.ix[batch]['cnt']):
network.train(record, target)
# Printing out the training progress
train_loss = MSE(network.run(train_features), train_targets['cnt'].values)
val_loss = MSE(network.run(val_features), val_targets['cnt'].values)
sys.stdout.write("\rProgress: " + str(100 * (e+1)/float(epochs))[:4] \
+ "% ... Training loss: " + str(train_loss)[:5] \
+ " ... Validation loss: " + str(val_loss)[:5])
losses['train'].append(train_loss)
losses['validation'].append(val_loss)
plt.plot(losses['train'], label='Training loss')
plt.plot(losses['validation'], label='Validation loss')
plt.legend()
plt.ylim(ymax=0.5)
Here, use the test data to view how well your network is modeling the data. If something is completely wrong here, make sure each step in your network is implemented correctly.
fig, ax = plt.subplots(figsize=(8,4))
mean, std = scaled_features['cnt']
predictions = network.run(test_features)*std + mean
ax.plot(predictions[0], label='Prediction')
ax.plot((test_targets['cnt']*std + mean).values, label='Data')
ax.set_xlim(right=len(predictions))
ax.legend()
dates = pd.to_datetime(rides.ix[test_data.index]['dteday'])
dates = dates.apply(lambda d: d.strftime('%b %d'))
ax.set_xticks(np.arange(len(dates))[12::24])
_ = ax.set_xticklabels(dates[12::24], rotation=45)
Answer these questions about your results. How well does the model predict the data? Where does it fail? Why does it fail where it does?
Note: You can edit the text in this cell by double clicking on it. When you want to render the text, press control + enter
Run these unit tests to check the correctness of your network implementation. These tests must all be successful to pass the project.
import unittest
inputs = [0.5, -0.2, 0.1]
targets = [0.4]
test_w_i_h = np.array([[0.1, 0.4, -0.3],
[-0.2, 0.5, 0.2]])
test_w_h_o = np.array([[0.3, -0.1]])
class TestMethods(unittest.TestCase):
##########
# Unit tests for data loading
##########
def test_data_path(self):
# Test that file path to dataset has been unaltered
self.assertTrue(data_path.lower() == 'bike-sharing-dataset/hour.csv')
def test_data_loaded(self):
# Test that data frame loaded
self.assertTrue(isinstance(rides, pd.DataFrame))
##########
# Unit tests for network functionality
##########
def test_activation(self):
network = NeuralNetwork(3, 2, 1, 0.5)
# Test that the activation function is a sigmoid
self.assertTrue(np.all(network.activation_function(0.5) == 1/(1+np.exp(-0.5))))
def test_train(self):
# Test that weights are updated correctly on training
network = NeuralNetwork(3, 2, 1, 0.5)
network.weights_input_to_hidden = test_w_i_h.copy()
network.weights_hidden_to_output = test_w_h_o.copy()
network.train(inputs, targets)
self.assertTrue(np.allclose(network.weights_hidden_to_output,
np.array([[ 0.37275328, -0.03172939]])))
self.assertTrue(np.allclose(network.weights_input_to_hidden,
np.array([[ 0.10562014, 0.39775194, -0.29887597],
[-0.20185996, 0.50074398, 0.19962801]])))
def test_run(self):
# Test correctness of run method
network = NeuralNetwork(3, 2, 1, 0.5)
network.weights_input_to_hidden = test_w_i_h.copy()
network.weights_hidden_to_output = test_w_h_o.copy()
self.assertTrue(np.allclose(network.run(inputs), 0.09998924))
suite = unittest.TestLoader().loadTestsFromModule(TestMethods())
unittest.TextTestRunner().run(suite)


background to be seen as in battlelog BF4 will see its own set background.
thank you in advance.
sorry for my english.
BrainFooLong
Administrator
Stop spamming here please.
Theme request in the theme section.
Moved again.
Topicstarter
Pawlo123456
I'm sorry I did not notice that I created a previous topic. :(
Browser I suspended
if possible Remove the two previous topics with the same content :)
sorry again I'm very keen on this theme.


Ranges can only match single chars (mentioned due to duplicates).
echo [100-999].txt
echo [1-9][0-9][0-9].txt
ShellCheck found a glob range expression (such as [a-z]
) that contains multiple of the same character.
Range expressions can only be used to match a single character in a given set, so [ab]
and [abba]
will both match the same thing: either one a
or one b
.
Having multiple of the same character often means you're trying to match more than one character, such as in the problematic example where someone tried to match any number from 100 to 999. Instead, it matches a single digit just like [0-9].txt
, and specifies 0, 1 and 9 multiple times.
In Bash, most uses can be rewritten using extglob and/or brace expansion. For example:
cat *.[dev,prod,test].conf # Doesn't work
cat *.{dev,prod,test}.conf # Works in bash
cat *.@(dev|prod|test).conf # Works in bash with `shopt -s extglob`
In POSIX sh, you may have to write multiple globs, one after the other:
cat *.dev.conf *.prod.conf *.test.conf
There is currently a bug in which a range expression whose contents is a variable gets parsed verbatim, e.g. [$foo]
. In this case, either ignore the warning or make the square brackets part of the variable contents instead.
v0.7.2 and below would unintentionally show this warning for subscripts in arrays in [[ -v array[xx] ]]
and other dereferencing operators. In these versions, you can either [[ignore]] the message or quote the word (as in [[ -v 'array[xx]' ]]
)


Michael is a current student in Code Fellows 301 and plans to graduate from the Python course in December. He lives in Pierce County with his wife and children. He enjoys outdoors activities, travel and living life to the fullest with his family.
marco is a developer, researcher, data-analyst, and cook, who lives in seattle, wa. marco insists on living life without capitalization.
Max is a full-time student after previously working in a deli for the past few years. When he is not spending all of his time coding, he enjoys watching sports, playing video games, and listening to all kinds of music. His goal is to complete the Code Fellows program and become a full time back-end developer.
An Anti-Money Laundering Investigator by day, a photographer by night and now a code monkey by day and night, some say David is as versatile as a Swiss Army Knife. David would disagree and explain that's impossible, he is Scottish. A diehard footy fan and avid yet mediocre outdoorsman, you can find him on the weekends either cheering on Liverpool FC or adventuring in the mountains with his camera in tow.


NOTE: this font was NOT made by me.


 You are currently accessing {{ APPLICATION_TITLE }} via one of the device accounts you created.
This restriction is applied as a security protection for your account information.
You are currently using the following Sub-account:


The Playwright Trace Viewer must be loaded over the http:// or https:// protocols.
http://
https://
For more information, please see the docs.


I had read about Salvia divinorum, so I ordered some. Supposedly it was very powerful and shouldn't be tried alone, but anybody I trusted was too far away. So I divided the stuff up into piles with a credit card and measured out 1/16 of a gram, and smoked that. It was like really good marijuana that wore off very quickly. So I thought, well if that's all it does, I'll just take some more and it'll last longer.
 I took one long, slow inhalation, which burned the entire contents of the pipe. It was like going immediately to the peak of an acid trip. At this level, the body, or any kind of matter, simply is not an issue. With acid, I knew matter was still there but I wasn't concerned about it. With Salvia I didn't even know it was there and I was even less concerned about it.  Some things seemed more important than others, but all functioned outside the realm of language. it was like a nonverbal philosophical debate. I felt like I was about to see something incredibly enlightening, but I first had to be willing to die right now and give up everything I had and everything I believed in.
That happened to me once before when I was on acid and I had said to the gods 'sure, why the hell not, I have lived my life wanting to know the truth so why stop short,' and it had been shown to me but I lost it after a few days. It happened to me again drug-free, much more gradually, after long periods of intense meditation every day for weeks, and again I had accepted, but then I had lost control of everything, completely lost touch with the popular conception of reality, and ended up in a mental hospital, which was probably the most horrible experience of my life. So this time, I wasn't willing to make the sacrifice. Also, those other 2 times I hadn't had much to live for anyway and this time I was in love with somebody, and we had promised each other we wouldn't kill ourselves. So the door closed.
I came down within like 15 minutes, and it was another 15 minutes after that that my environment regained its previous level of recognizeability. I was like 'holy shit.'
I wanted to do it again, but this time focusing on something more concrete. I took a painting off the wall that the girl I mentioned gave me, and I filled the pipe with an equal dose. I smoked it and it was probably a good 7 minutes before I was aware of my body again. By the time I was capable of recognizing the painting, looking at it wasn't much different from looking at it sober.
That was the most I've ever taken at once but I plan on experimenting with it more. Every time I do it it's like the first time. The effect has not dulled.
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.


{% extends 'base.html' %} {% load static %} {% block body %}
To delete this place press here.
To duplicate press here.


Avarage age is: {{avarage}}
There are {{counter}} persons with the age between {{slider.min}} and {{slider.max}} (of which {{countFemale}} females and {{countMale}} males)


Unit #{{unit.address.unit_no}}-{{unit.address.unit_no_2}}
Home > Resident's Database > Unit #{{unit.address.unit_no}}-{{unit.address.unit_no_2}}
General Details
Unit No. : #{{unit?.address?.unit_no}}-{{unit?.address?.unit_no_2}}
Block : {{unit?.address?.block_no}}
Block : {{unit?.address?.block_no}}
Owner : {{unit?.landlord?.data?.resident?.username | capitalize}}
Status : Owned Occupied Empty
Status : Owned Occupied Empty
No. of Occupier : {{ tenantTotal }}
Vehicle : {{vehicles.length}}
Vehicle : {{vehicles.length}}
| Code | Authentication Type | Generated on | |
| {{unit.code.landlord | uppercase}} | Owner | {{unit.code.create_at_landlord | date:'d/M/y'}} | |
| {{unit.code.tenant | uppercase}} | Tenant | {{unit.code.create_at_tenant | date:'d/M/y'}} |
Resident/Occupier
{{residents.resident.email}}
Registered Vehicle
-
{{ a.name }},
Adding a Resident
Register a Vehicle
Resident/Tenant {{ resident.resident.username }}
Resident
: {{ resident.resident.username | capitalize }}
Type
: {{ resident.type | capitalize}}
Added on
: {{ resident.created_at | date:'fullDate' }}
Contact No
: {{resident.resident.phone}}, {{resident.resident.email}}
Social Page
: Yes
: -
Remarks
: {{ resident.remarks | capitalize}}
: -
Registered Vehicle {{ vehicle.license_plate }}
License Plate
: {{ vehicle.license_plate }}
Owner
: {{ vehicle.user | capitalize}}
Transponder
: {{ vehicle.transponder }}
: -
Document
: -
Registered on
: {{ vehicle.created_at | date:'fullDate'}}
Remarks
: {{ vehicle.remarks | capitalize}}
: -


{% extends "base.html" %} {% block body %}
Starring resources lets you export or graph several resources as once, click the star icon next to labels of a few things, then come here and export or graph them together.
Click the stars in the list below to deselect individual resources.
Draw the a diagram of the RDFS Classes and Properties, if you did not select any - the graph may be empty!


Malefice
Focuses Enigma's power on a target, causing it to take damage and become repeatedly stunned for multiple instances. An instance strikes every 2 seconds.
| Mana Cost: | 110/130/150/160 |
| Cooldown: | 15 |
| ABILITY: | Unit Target |
| AFFECTS: | Enemy Units |
| DAMAGE TYPE: | Magical |
| PIERCES SPELL IMMUNITY: | No |
| STUN DURATION: | 0.25 / 0.5 / 0.75 / 1 |
| DAMAGE PER HIT: | 25 / 40 / 55 / 70 |
| INSTANCES: | 3 / 3 / 3 / 3 |
Strange gravities pull at the core of those who would oppose you, holding them in place.
Demonic Conversion
Transforms a creep into three fragments of Enigma himself. These eidolons are all under Enigma's control, and repeated successful attacks cause them to multiply. When this happens, the eidolons have their health restored.
| Mana Cost: | 170/170/170/170 |
| Cooldown: | 35 |
| ABILITY: | Unit Target |
| ATTACKS TO MULTIPLY: | 6 / 6 / 6 / 6 |
| EIDOLON HP: | 180 / 200 / 220 / 240 |
| EIDOLON DAMAGE: | 20 / 28 / 38 / 47 |
| DURATION: | 35 |
Enigma is capable of drawing aspects of himself from other dimensions - the result is a trio of dark eidolons that hunt the corporeal plane.
Midnight Pulse
Steeps an area in dark resonance, damaging enemy units based on their max HP.
| Mana Cost: | 95/110/125/140 |
| Cooldown: | 35 |
| ABILITY: | Point Target |
| DAMAGE TYPE: | Pure |
| PIERCES SPELL IMMUNITY: | Yes |
| RADIUS: | 600 |
| DAMAGE PER SECOND: | 3% / 3.75% / 4.5% / 5.25% |
| DURATION: | 11 |
A section of the world slowly descends into the void.
 Enemies affected by Black Hole cannot move, attack, or cast spells. Upgradable by Aghanim's Scepter.
| Mana Cost: | 275/325/375 |
| Cooldown: | 200/190/180 |
| ABILITY: | Channeled, Point Target |
| DAMAGE TYPE: | Magical |
| PIERCES SPELL IMMUNITY: | Yes |
| DAMAGE PER SECOND: | 55 / 110 / 165 |
| RADIUS: | 400 |
| DURATION: | 4 / 4 / 4 |
The ground trembles as Enigma channels his ultimate vortex of destruction, a singularity with the power to end worlds.


Dispersed Phases User’s Guide¶
| Release: | 1.1 |
|---|---|
| Date: | Nov 08, 2017 |
Scripts¶
The class objects and method functions defined in the dispersed_phases
module provide provide an interface to the dbm
objects, methods, and
functions through the definition of two new objects: the SingleParticle
object, used to describe one particle, and the PlumeParticle object used to
describe one group of particle in a plume model simulation. These functions
are almost never used alone, but rather as part of a model simulation. To see
examples of how these are used in the context of the various models, see the
scripts in ./bin/sbm
, ./bin/spm
, and ./bin/bpm
.
The bent_plume_model
contains one more object, the bent_plume_model.Particle
object, which inherits the PlumeParticle object and adds functionality for
particle tracking within the Lagrangian plume model solution.
Examples¶
This example illustrates the tasks involved in using the PlumeParticle
object to create a set of particles that will eventually be used by the
stratified_plume_model
. The procedure is similar for the other objects in
this module, as well as for the bent_plume_model.Particle
object.
Before running these examples, be sure to install the TAMOC
package and
run all of the tests in the ./test
directory. The commands below should be
executed in an IPython session. Start IPython by executing:
ipython --pylab
at the command prompt. The --pylab
flag is needed to get the correct
behavior of the output plots.
The first step in any spill simulation is to define the ambient CTD data. The
TAMOC
module ambient
provides the tools needed to read in CTD data from
text files and organize it into the netCDF files used by the TAMOC
simulation modules. Examples of how to do this are provided in the
./bin/ambient
directory of the TAMOC distribution. Here, we use the CTD
data created by the TAMOC
test files and stored in the ./test/output
directory. Open a CTD file as follows (path names in this tutorial are from
any subdirectory of the TAMOC
source distribution, e.g.,
./notebooks
):
>>> ctd_file = '../test/output/test_BM54.nc'
>>> ctd = ambient.Profile(ctd_file, chem_names='all')
These various particle objects are typically supplied to the models as a list. For this example, begin with an empty list:
>>> particles = []
Gas Bubbles¶
For a blowout, we might expect both gas and oil. Here, we create a few
gas bubbles to add to the simulation. The first step is to create a dbm
particle object. In this case, we choose a dissolvable particle of natural
gas:
>>> composition = ['methane', 'ethane', 'propane', 'oxygen']
>>> mol_frac = [0.93, 0.05, 0.02, 0.0]
>>> gas = dbm.FluidParticle(composition)
Next, we have to get the mass of each component in a single bubble and the
total bubble flux. A helper function is provided in the TAMOC
model called
dispersed_phases.initial_conditions
. Here, we use the function to create six
different sized bubbles:
>>> x0 = np.array([0., 0., 1000.])
>>> T0 = 273.15 + 30.
>>> # Initial bubble diameter (m)
>>> de = np.array([0.04, 0.03, 0.02, 0.01, 0.0075, 0.005])
>>> # Total mass flux (kg/s) of gas in each bubble size class
>>> m0 = np.array([0.5, 1.5, 2.5, 3.5, 1.5, 0.5] )
>>> # Associate spreading ratio (--)
>>> lambda_1 = np.array([0.75, 0.8, 0.85, 0.9, 0.9, 0.95])
>>> # Append to the disp_phases list
>>> for i in range(len(de)):
m, T, nb, P, Sa, Ta = dispersed_phases.initial_conditions(
ctd, x0[2], gas, mol_frac, m0[i], 2, de[i], T0)
particles.append(dispersed_phases.PlumeParticle(gas, m, T, nb,
lambda_1[i], P, Sa, Ta))
Oil Droplets¶
Following the same procedure as for the gas but with different equations of state, liquid droplets can be added to the simulation. Start, by defining a new set of equations of state. Here, we assume a non-dissolving oil phase:
>>> composition = ['inert']
>>> rho_o = 890. # density in kg/m^3
>>> gamma = 30. # API gravity in deg API
>>> beta = 0.0007 # thermal expansion coefficient in K^(-1)
>>> co = 2.90075e-9 # isothermal compressibility coefficient in Pa^(-1)
>>> oil = dbm.InsolubleParticle(True, True, rho_o, gamma, beta, co)
Then, define the droplet characteristics and append them to the
particles
list as we did for the gas bubbles. Note that all particles go
in the same list and could be in any order:
>>> de = np.array([0.02, 0.01, 0.0075, 0.005, 0.003])
>>> m0 = np.array([1., 2.5, 5., 1., 0.5])
>>> lambda_1 = np.array([0.85, 0.90, 0.95, 0.95, 1.])
>>> for i in range(len(de)):
m, T, nb, P, Sa, Ta = dispersed_phases.initial_conditions(
ctd, x0[2], oil, 1., m0[i], 2, de[i], T0)
particles.append(dispersed_phases.PlumeParticle(oil, m, T, nb,
lambda_1[i], P, Sa, Ta))