Scripts Reference¶
train_mrcnn_model.py
¶
Train a new mrcnn
model starting from pretrained COCO weights
- optional arguments:
- -h, --help
show this help message and exit
- --steps STEPS
1, 2, or 3. How many of the steps to train: (heads, 4+, entire model)
- --model_dir MODEL_DIR
Directory in which to create new training subdirectory for checkpoints and tensorboard logs.
- --data_dir DATA_DIR
Directory in which to find
train
andtest
subdirectories containing labeled images.Extract OCR top and base depths from images with pytesseract
get_ocr_depths.py
¶
Extract OCR top and base depths from images with pytesseract
- optional arguments:
- -h, --help
show this help message and exit
- --root_dir ROOT_DIR
A common parent directory of all target
<subdir>
directories.- --subdir SUBDIR
A string contained in the name of all target subdirectories.
- --save_name SAVE_NAME
Name of depths csv file(s) to be saved in matching subdirs.
- --force
Flag to force overwrite of any existing
<save_name>.csv
files.- --inspect
Flag to inspect images and print OCR output whenever there is an issue.
As an example, you can test the script by running:
$ cd scripts
$ python get_ocr_depths.py --root_dir ../tests/data --subdir two_image_dataset --save_name auto_depths_test
This should save a new file at tests/data/two_image_dataset/auto_depths_test.csv
, with contents like:
,top,bottom
S00101409.jpeg,2348.0,2350.0
S00111582.jpeg,7716.0,2220.0
Note that 7716.0
is a misread, and should have been 2218.0
. At least with our BGS images, some manual corrections are usually required, but this provides a template for the --depth_csv
file required to run process_directory.py
.
process_directory.py
¶
Process directory of raw images with Mask R-CNN and save results as a CoreColumn
.
The path
given should contain images as jpeg files, and a depth_csv
file in the format:
, top, bottom
<filename1>, <top1>, <bottom1>
...
<filenameN>, <topN>, <bottomN>
NOTE: model Config
, class_names
, and segmentation layout_params
can only be
changed manually at the top of script, and default to those configured in defaults.py
- positional arguments:
path Path to directory of images (and depth information csv) to process.
- optional arguments:
- -h, --help
show help message and exit
- --model_dir MODEL_DIR
Directory to load
mrcnn
model from. Default=``defaults.MODEL_DIR``- --weights_path WEIGHTS_PATH
Path to model weights to load. Default=``defaults.CB_MODEL_PATH``
- --add_tol ADD_TOL
Gap tolerance when adding
CoreColumn
objects, default=5.0.- --add_mode ADD_MODE
CoreColumn.add_mode
. One of {‘fill’, ‘collapse’}.- --depth_csv DEPTH_CSV
Name of filename + (top, bottom) csv to read from
path
, default=``’auto_depths.csv’``- --save_dir SAVE_DIR
Path to save
CoreColumn
to, default=None will save topath
- --save_name SAVE_NAME
Name to use for
CoreColumn.save
, default=None results inCoreColumn_<top>_<base>
- --save_mode SAVE_MODE
One of {‘pickle’, ‘numpy’}. Whether to save as single
pkl
file or multiplenpy
files
Assuming you’ve downloaded and unzipped the assets folder in the default location, you can test the script with default parameters by running:
$ cd scripts
$ python process_directory.py ../tests/data/two_image_dataset --depth_csv dummy_depths.csv
This should save the aggregated CoreColumn
to tests/data/two_image_dataset/CoreColumn_1.00_5.00.pkl
.
prune_imageData.py
¶
Remove the imageData
field from all JSON files in tree below path
:
- positional arguments:
path Path to parent of all target JSON files.
- optional arguments:
- -h, --help
show this help message and exit


0h n0 is a little logic game
that complements 0h h1.
It was created by
Martin Kool.
The concept is inspired by
the Japanese Kuromasu.
© 2015 by Q42
q42.com · 0hn0.com
Blue dots can see others
in their own row and column.
Their numbers tell how many.
Red dots block their view.
Our game 0h h1 is also available as a free app:
And playable on the web:


WARNING: Excludes are ignored by diff.groovy.


Type command '/showlocation' in Global Chat to manually to trigger a location update.
You can always access these settings via [Alt]+[.].
Use shortcut [Alt]+[,] to hide the VerseGuide overlay.
Automatically sends the '/showlocation' command every minute.
You need to have Global Chat visible for this to work (F12).
DirectX framerate.
For performance testing.
made possible by Citizens Pitapa, justMurphy, xabdiben, Graupunkt, StoicMako and LordSkippy
based on github.com/hiitiger/gelectron (forked by honzapatCZ) under MIT License
more crazy awesomeness at verseguide.com


16 Dec 2015
Update 01/12/16 - Scrollbar locked when using tmux I’ve been wanting to write this one for a while now. This summer, I got learn two very exciting tools, Vim an Tmux. These two are a must-have for any terminal junkie and together they’ve taken my workflow to a whole new level. Although tmux has some extended functionality, in this post I am going to focus on how I personally use it....
[Read More]
03 Dec 2015
This semester I had to partake in 2 group projects. Both of which I ended up taking leadership roles in, AKA Project Management. Up until now, other than writing I haven’t really collaborated much on any other type of project. For this 2 projects, one of them involved mostly writing and the second was software collaboration. I can’t say that it has been easy nor I’ve done a great job at it, all I can...
[Read More]
27 Nov 2015
Incredibly annoyed that it took me so long to set things up with jekyll here. I began customization through the index page, making edits to the html and every darn time I restarted the server, the changes would never go through. It was by chance that I decided to mess with the _config.yml file and found that some parameters defined here were being passed to the index. This meant that no matter how many times...
[Read More]


Graduate teachign assistant for undergraduate course with over 200 students on linear algebra and its applications in engineering. Designed and taught the module on ordinary least squares method.
Serving as a community TA on the Coursera Machine Learning after being invited for exception performance and participation in the course and completing Coursera's two week training on the same. Involved with solving learner's issues related to the topics and programming assignments via discussion forums as well as mediating with Coursera for the same.
Worked to develop novel ideas for application of AI techniques to multimedia streaming for the SVC-SW team.


This content does not float.
This content does not float.
This floater is constrainted within a container and has a top offset of 50px.
This content does not float.
This is the bottom of the page.


HOME
PORTFOLIO
PROJECTS
SKILLS
CONTACT
Portfolio
Stress Relief SPA
View Project
Online AP Music Theory Prep
View Project
Hangman
View Project
"Battleship"
View Project
Random Trivia
View Project
Giphy API App
View Project
Rock, Paper, Scissors
View Project


Tennis Ball Detection and Tracking
Jan 29, 2015
Tracking the trajectory of the tennis ball in videos of tennis matches!
Why is there a separate post for this?
Observe a video of a tennis match and notice if you can see the ball at all times. The answer is no. Even our eyes- one of the finest visual detectors cannot keep track of the ball. This is because of two reasons:
- The ball is a very small object compared to the other objects in the frame.
- It moves very fast during a match sequece.
All this made ball tracking a challenge.
Initial attempts:
We had already had an amazing experience with the efficiency of RCNN. So we decided to give it a shot- and included the tennis ball in one of the classes that it should be detecting in the frame. The result? The ball could not be detected.
What next?
One of the key features that made the ball different from all the other objects in the frame was its fast motion. And that could be utilized to detect it. We started with using the Luke Kanade optical flow to see if the ball could be detected. Although this approach had one major flaw- it first tracks the object and then monitors its motion. And in most of the cases, the algorithm was not able to detect the ball in the first place. Luckily for us, we found an approach that gave significant weightage to the motion of the object in the detection process.
Detecting of the position and velocity of the ball using Thomas Brox’s optical flow: The algorithm for optical flow by Thomas Brox took into account the high-speed motion of relatively smaller objects in the frame- something that no other optical flow manages. So given two consecutive frames in a video, we can detect the speed and direction of motion of the large as well as the smaller objects. The output is observed in the optical flow wheel coloring scheme. Here is the exact sequence of steps:
- Break the video into its constituent frames.
- Apply optical flow for pairwise frames, to obtain velocity map of the objects.
- Perform morphological processing on the obtained maps to retain the players and the ball. (Since the players and ball will have considerably high speed as compared to everything else on the court, we can threshhold the intensity of the velocity map.
- Using connected component analysis, obtain the ball (assuming it will be the component of the smallest area).
- Using the optical flow color wheel, obtain the direction and magnitude of the ball’s velocity.


The Outer Banks is a 200 mile long stretch of barrier islands that make up the majority of the North Carolina coastline. During the summer season, which takes place from Memorial Day in May to Labor Day in September, the region is a popular tourist destination, with thousands of visitors flocking to the OBX, as the Outer Banks is coined, for its expansive beaches and parks. Additionally, visitors frequent for the several historic lighthouses and shipwrecks that dominate the coastline. Continue to read on for more information about the Outer Banks!
This video gives an overview of the Outer Banks and its points of interest, which include beaches, parks, lighthouses, and the Wright Brothers National Memorial.
Up and down the Outer Banks, there are a multitude of lighthouses, which were once used to serve as a navigational aid to ships at sea. One lighthouse, Ocracoke, is the US's second oldest lighthouse and still in operation, and Cape Hatteras Lighthouse is the tallest lighthouse in the US. Here is a list of lighthouses from north to south, and clicking on the names will link to visitor information.
The Wright Brothers National Memorial is a museum and memorial located in Kill Devil Hills. It commemorates the first successful airplane flight by the Wright brothers in 1903. The memorial is a successful tourist destination, with over 400,000 visitors each year.
Perhaps the most popular attraction the Outer Banks offers is its beaches. They span the entire coastline, bordered by dunes towards land and the Atlantic Ocean. All of the beaches are public and free of businesses and boardwalks. There are a great amount of rental houses and hotels that have been built near the beach in recent years, making both getting to the beach and being able to spend it with family a breeze.


{{photoDetailModalMetadata['Photographer']}}/The Polytechnic
Want to use this photo?
The Polytechnic photographs events of relevance to the Rensselaer community. Our goal is to serve you, and to this end, we allow redistribution of our photos under specific circumstances.
If you are any of these:
Then you may use The Polytechnic's photos under the following conditions:
If you have any questions, do not hesitate to email<EMAIL_ADDRESS>We also look forward to hearing any comments or feedback you have about PhotoArk.


{{well.WellName}}
Well Name: {{selectedWell.WellName}}
Well Code: {{selectedWell.WellCode}}
Operator: {{selectedWell.Operator}}
Field: {{selectedWell.Field}}
Country: {{selectedWell.Country}}
Type: {{selectedWell.Type}}
Depth: {{selectedWell.TerminalDepth}} {{selectedWell.Units}}
Depth Datum: {{selectedWell.DepthDatum}}
Depth
Classification from input data: {{selectedSample.Label}}
Classification from model: {{classification.classification}}


Banka
Dashboard
Accounts
Users
Profile
Logout
Welcome,
Anakin
Dashboard
Accounts
Profile
Users
USERS
Add Staff
First Name:
Last Name:
Email:
Staff Type:
-- Select staff type
Admin
Non-Admin
×


Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV LETTER
NEXT LETTER
FRAMES
NO FRAMES
All Classes
A
B
C
D
E
F
G
I
K
L
M
N
O
P
R
S
T
U
V
W
C
c
- Variable in class gui.
MainApplet
changeVolumes()
- Method in class util.midi.
MidiControl
Puts each instruments volume through the algorithm needed to generate the proper volume
channelNumber
- Variable in class engine.
Instrument
The channel number of the instrument
channels
- Variable in class util.midi.
MidiControl
number of channels being used by the MIDI file
channelVolume
- Variable in class engine.
Instrument
The unadjusted volume of the channel of the instrument
chooseSong(int)
- Method in class util.midi.
MidiControl
Find out what file to load
clip
- Variable in class gui.
ConcertHallPanel
the sound clip that tells what seat you have selected
clipStage
- Variable in class gui.
ConcertHallPanel
the stage of the clip 0 = not playing 1 = section location 2= "press 1 for preview 1" 3 = "press 2 for preview 2"
ConcertHallPanel
- Class in
gui
The main panel that has all the buttons.
ConcertHallPanel()
- Constructor for class gui.
ConcertHallPanel
make the rows of buttons
ConcertHallPanel.ALineListener
- Class in
gui
ConcertHallPanel.ALineListener()
- Constructor for class gui.
ConcertHallPanel.ALineListener
currentSelectedCol
- Variable in class gui.
ConcertHallPanel
current col of seats cursor is on
currentSelectedRow
- Variable in class gui.
ConcertHallPanel
current row of seats cursor is on
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV LETTER
NEXT LETTER
FRAMES
NO FRAMES
All Classes
A
B
C
D
E
F
G
I
K
L
M
N
O
P
R
S
T
U
V
W


The field name for the refinement.
Either the value for a value refinement, or the low for a range refinement.
Either the high for a range refinement, or left out for a value refinement.
Updates the past purchase sorts using the data provided.
An object containing the sort labels and options.
Updates the sorts using the data provided.
An object containing the sort labels and options.
Adds state for a given tag or section to the ui store.
The name of the tag or a unique identifier.
The id of the component or a unique id to use.
The state to add in the store.
In the past purcahse page, removes a given refinement based on navigationId and index.
The navigationId for the navigation to fetch more refinements against.
The index of the refinement intended to be selected.
Removes a given refinement based on navigationId and index.
The navigationId for the navigation to fetch more refinements against.
The index of the refinement intended to be selected.
Makes a request for autocomplete products.
An object with the query and refinements, and a request object for override.
{ query, refinements, request }
.Makes a request for autocomplete products.
Search term to fetch autocomplete products against.
The applied refinements.
{ query, refinements }
.Makes a request for autocomplete suggestions.
An object with the query term to fetch autocomplete suggestions against, and a request object for override.
{ query, request }
.Makes a request for autocomplete suggestions.
Search term to fetch autocomplete suggestions against.
{ query }
.Makes a request for the collection count for a given collection.
An object with the collection name, and a request object for override.
{ collection, request }
.Makes a request for the collection count for a given collection.
Collection name.
{ collection }
.Makes a request for more past purchase products.
An object with amount number, forward boolean, and a request object for override.
{ amount, forward, request }
.Makes a request for more past purchase products.
The amount of additional products to fetch.
Whether to fetch the next page or previous page. and a request object for override.
{ amount, forward }
.Makes a request for more past purchase refinements for given navigation.
An object with the navigationId for the navigation to fetch more refinements against and a request object for override.
{ navigationId, request }
.Makes a request for more past purchase refinements for given navigation.
The navigationId for the navigation to fetch more refinements against.
{ navigationId }
.Makes a request for additional products beyond currently requested products.
An object with the amount and forward values, and a request object for override
{ amount, forward, request }
.Makes a request for additional products beyond currently requested products.
Amount of more products to fetch.
true
to fetch forward
{ amount, forward }
.Makes a request for more refinements for given navigation.
An object with the navigationId for the navigation to fetch more refinements against and a request object for override.
{ navigationId, request }
.Makes a request for more refinements for given navigation.
The navigationId for the navigation to fetch more refinements against.
{ navigationId }
.Makes a request for past purchase products.
An object with a request object for override.
{ query, request }
.Makes a request for past purchases.
An object with a query string, and a request object for override.
{ query, request }
.Makes a request for past purchases.
A search term
{ query }
.Makes a request for the details for a given product.
An object with the id for a specific product, and a request object for override.
{ id, request }
.Makes a request for the details for a given product.
The id for a specific product.
Indicates whether fetch is a result of a single product redirect.
{ id }
.Makes a request for products.
An object with a request object for override.
{ request }
.Wrapper for fetchProducts, dispatches it within saga when store is rehydrated
An object with a request object for override.
{ request }
.Makes a request for products without history being set afterwards.
An object with a request object for override.
{ request }
.Makes a request for recommendations products.
An object with a request object for override.
{ request }
.Makes a request for sayt past purchases.
An object with a query string, and a request object for override.
{ query, request }
.Makes a request for sayt past purchases.
A search term.
{ query }
.The fetch state of infinite scroll request.
Whether is fetching forward or backward.
The autocomplete products to receive and update state with.
The products to add to the autocomplete state.
The autocomplete response to receive and update state with.
Response object, as returned in the request.
The autocomplete suggestions to receive and update state with.
The suggestions to update the state to.
The autocomplete template to receive and update state with.
The template to add to the autocomplete state.
The collection count to receive and update the state with.
The count to update the collection count to.
Sets the details product in the store.
The product to use as the details product.
Adds the more past purchase products in the store.
The response to use.
The more past purchase refinements to receive and update state with.
The navigation the more refinements correspond to.
The more refinements.
The selected array, indicating which indexes of the refinements are set to selected.
The more products to receive and update state with. Products will be added on to the products array in the store.
The more refinements to receive and update state with.
The navigation the more refinements correspond to.
The more refinements.
The selected array, indicating which indexes of the refinements are set to selected.
The navigation sort to receive and update navigation sort state with.
The navigations to be sorted and order of sort.
The navigations to receive and update state with.
The navigations that state will update to.
The page to receive and update state with.
Sets the past purchase all record count in the store.
The count to use.
Sets the past purchase current record count in the store.
The count to use.
The page to receive and update state with.
The current recordCount.
The current page.
Sets the past purchase products in the store.
The products to use.
Sets the past purchase refinements in the store.
The refinements to use.
Sets the past purchases siteParams in the store.
The siteParams to use.
Sets the past purchase skus in the store.
The product skus to use.
Sets the past purchase template in the store.
The template to use.
The products to receive and update the state with.
Products that will be received and updated to in the state.
The response to receive and update state with.
Response object, as returned by the request.
The query object to receive and update state with.
Query object.
The recommendations products to receive and update state with.
The products to add to the recommendations state.
The record count to receive and update state with.
The record count state will update to.
The redirect to receive and update state with.
The redirect state will update to.
Sets the past purchase sayt products in the store.
The products to use.
The siteParams to receive and update state with.
The siteParams from the response.
The template to receive and update state with.
The template state will update to.
Updates state with given state.
The state to use.
Removes state for a given tag from the store.
The name of the tag or a unique identifier.
The id of the component or a unique id to use.
Removes the currently selected past purchase refinements and selects the given one.
The navigationId for the refinement intending to be selected.
The index of the refinement to be selected in the store.
Sets the current page in the store to page 1, but does not update the search.
In the past purchase section, sets the current page in the store to page 1, but does not update the search.
Removes the current past purchase query and selects the given past purchase refinement.
The navigationId for the refinement intending to be selected.
The index of the refinement to be selected in the store.
In the past purchase page, removes the selected refinements from the search.
true to reset all refinements, or navigationId to reset all refinements on a specific navigation.
Clears the query.
Performs a new search with query or selected refinement, and resets recallId.
The query to use in the search.
The navigation for the refinement to select.
The index for the refinement.
Removes the selected refinements from the search.
true to reset all refinements, or navigationId to reset all refinements on a specific navigation.
Performs search with query, removes current refinements.
Search term to perform search with. If not supplied, search with current query is performed, removing current refinements.
Selects a given collection based on id.
The id of the selected collection.
In the past purchase section, selects the given refinements based on navigationId and indices.
The navigationId for the navigation to fetch more refinements against.
The indices of the refinements intended to be selected.
Selects the given refinements based on navigationId and indices.
The navigationId for the navigation to fetch more refinements against.
The indices of the refinements intended to be selected.
In the past purchase section, selects a given refinement based on navigationId and index.
The navigationId for the navigation to fetch more refinements against.
The index of the refinement intended to be selected.
Updates the past purchase sort.
The index of the sort in the store to use.
Selects a given refinement based on navigationId and index.
The navigationId for the navigation to fetch more refinements against.
The index of the refinement intended to be selected.
Selects a given sort based on index.
The index of the selected sort.
Set the sessionId in the store to the given id.
The sessionId to set.
Fires the START_APP action.
Fires the START_REDIRECT action.
Fires the DONE_REDIRECT action.
Removes all refinements for a given navigation field and adds the given refinement to the search.
The field name for the navigation.
Either the value for a value refinement, or the low for a range refinement.
Either the high for a range refinement, or left out for a value refinement.
Updates the autocomplete query with the given term.
The search term to update the autocomplete query to and get suggestions based on.
The biasing object to receive and update biasing with
Biasing object
Updates the current page to the given page.
The page to switch to.
Updates the details product in the store.
The product to use as the details product.
Updates the history state.
The history state to use.
Updates the location in the store to the given location.
The location to update to.
Updates the page size to given size.
The size the page is updated to. Must correspond to a size in the pageSize in the store.
Updates the current page to the given page.
The page to switch to.
Updates the past purchase page size to given size.
The size the page is updated to. Must correspond to a size in the pageSize in the store.
Removes the selected past purchase refinements and updates the past purchase query.
The query to use.
Updates the search query.
Search term to use.
Updates the search with given parameters.
Search object for requested search.
Generated using TypeDoc
Adds a given refinement to the search.


vignettes/ValidityChecksForCohortDefinitions.Rmd
ValidityChecksForCohortDefinitions.Rmd
PhenotypeLibrary is part of HADES
This document is a DRAFT guidance.
Concept set mismatch - No unused concept sets. Cohort Definitions should not have concept sets that are not used. - Match concept id domain to atlas criteria. E.g. if Atlas criteria says ‘at least 1 occurrence of ‘condition_occurrence’ - but the conceptId’s do not even have one conceptId belonging to the condition domain.
Measurement units - Units should be specified. Since values may be on different scales units should be used. - Use valid, standard unit concept id. See Measurement_unit_concept_id options Athena - One criterion should have only one scale. - Exceptions: unit less measurements.
Concept Sets used in Cohort Definitions - Concept set names: We expect the names of the concept sets to be meaningful to a broad audience i.e. please remove any internal identifiers that are specific to an organization or project e.g. ‘[raos] Hypertension’ is not acceptable. - Use of Non-standard concept codes: Justification is required to accept a cohort definition with non-standard concepts such as why a standard equivalent is not used, if use of the non standard concepts changes the operating characteristics of the cohort definition compared to the use of standard concepts, attempt to improve vocabulary mapping. - Concept optimization: we expect the concept set to be an expression that is as parsimonious in its representation. At a minimum, the concept set should be optimized, should not have duplicate concepts with same selection of included and exclude. - Use of mapped concepts: Concept set expression should not have mapped selected. Mapped concepts are rarely needed.
Event cohorts - We expect cohorts to be event cohorts, i.e. a person may enter the cohort more than once in different time periods. If a cohort definition is modeled as a first occurrence/earliest event, we ask for an explanation. To model a cohort as an event cohort, rules for cohort end date should be thought through.


This document describes how to build and install Open vSwitch using a DPDK datapath. Open vSwitch can use the DPDK library to operate entirely in userspace.
Warning
The DPDK support of Open vSwitch is considered 'experimental'.
In addition to the requirements described in the installation guide, building Open vSwitch with DPDK will require the following:
DPDK 16.07
Only required when physical ports are in use
A suitable kernel
On Linux Distros running kernel version >= 3.0, only IOMMU needs to enabled via the grub cmdline, assuming you are using VFIO. For older kernels, ensure the kernel is built with UIO, HUGETLBFS, PROC_PAGE_MONITOR, HPET, HPET_MMAP support. If these are not present, it will be necessary to upgrade your kernel or build a custom kernel with these flags enabled.
Detailed system requirements can be found at DPDK requirements, while more detailed install information can be found in the advanced installation guide.
Download the DPDK sources, extract the file and set DPDK_DIR:
$ cd /usr/src/ $ wget http://dpdk.org/browse/dpdk/snapshot/dpdk-16.07.zip $ unzip dpdk-16.07.zip $ export DPDK_DIR=/usr/src/dpdk-16.07 $ cd $DPDK_DIR
Configure and install DPDK
Build and install the DPDK library:
$ export DPDK_TARGET=x86_64-native-linuxapp-gcc $ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET $ make install T=$DPDK_TARGET DESTDIR=install
If IVSHMEM support is required, use a different target:
$ export DPDK_TARGET=x86_64-ivshmem-linuxapp-gcc
OVS can be installed using different methods. For OVS to use DPDK datapath, it has to be configured with DPDK support (--with-dpdk).
Note
This section focuses on generic recipe that suits most cases. For distribution specific instructions, refer to one of the more relevant guides.
Ensure the standard OVS requirements, described in the installation guide, are installed.
Bootstrap, if required, as described in the installation guide.
Configure the package using the --with-dpdk flag:
$ ./configure --with-dpdk=$DPDK_BUILD
where DPDK_BUILD is the path to the built DPDK library. This can be skipped if DPDK library is installed in its default location.
Note
While --with-dpdk is required, you can pass any other configuration option described in the installation guide.
Build and install OVS, as described in the installation guide.
Additional information can be found in the installation guide.
Allocate a number of 2M Huge pages:
For persistent allocation of huge pages, write to hugepages.conf file in /etc/sysctl.d:
$ echo 'vm.nr_hugepages=2048' > /etc/sysctl.d/hugepages.conf
For run-time allocation of huge pages, use the sysctl utility:
$ sysctl -w vm.nr_hugepages=N # where N = No. of 2M huge pages
To verify hugepage configuration:
$ grep HugePages_ /proc/meminfo
Mount the hugepages, if not already mounted by default:
$ mount -t hugetlbfs none /dev/hugepages``
VFIO is prefered to the UIO driver when using recent versions of DPDK. VFIO support required support from both the kernel and BIOS. For the former, kernel version > 3.6 must be used. For the latter, you must enable VT-d in the BIOS and ensure this is configured via grub. To ensure VT-d is enabled via the BIOS, run:
$ dmesg | grep -e DMAR -e IOMMU
If VT-d is not enabled in the BIOS, enable it now.
To ensure VT-d is enabled in the kernel, run:
$ cat /proc/cmdline | grep iommu=pt $ cat /proc/cmdline | grep intel_iommu=on
If VT-d is not enabled in the kernel, enable it now.
Once VT-d is correctly configured, load the required modules and bind the NIC to the VFIO driver:
$ modprobe vfio-pci $ /usr/bin/chmod a+x /dev/vfio $ /usr/bin/chmod 0666 /dev/vfio/* $ $DPDK_DIR/tools/dpdk-devbind.py --bind=vfio-pci eth1 $ $DPDK_DIR/tools/dpdk-devbind.py --status
Open vSwitch should be started as described in the installation guide with the exception of ovs-vswitchd, which requires some special configuration to enable DPDK functionality. DPDK configuration arguments can be passed to ovs-vswitchd via the other_config column of the Open_vSwitch table. At a minimum, the dpdk-init option must be set to true. For example:
$ export DB_SOCK=/usr/local/var/run/openvswitch/db.sock $ ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true $ ovs-vswitchd unix:$DB_SOCK --pidfile --detach
There are many other configuration options, the most important of which are listed below. Defaults will be provided for all values not explicitly set.
If allocating more than one GB hugepage (as for IVSHMEM), you can configure the amount of memory used from any given NUMA nodes. For example, to use 1GB from NUMA node 0, run:
$ ovs-vsctl --no-wait set Open_vSwitch . \ other_config:dpdk-socket-mem="1024,0"
Similarly, if you wish to better scale the workloads across cores, then multiple pmd threads can be created and pinned to CPU cores by explicity specifying pmd-cpu-mask. For example, to spawn two pmd threads and pin them to cores 1,2, run:
$ ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=6
For details on using ivshmem with DPDK, refer to the advanced installation guide.
Refer to ovs-vswitchd.conf.db(5) for additional information on configuration options.
Note
Changing any of these options requires restarting the ovs-vswitchd application
You can now use ovs-vsctl to set up bridges and other Open vSwitch features. Bridges should be created with a datapath_type=netdev:
$ ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev
Now you can add DPDK devices. OVS expects DPDK device names to start with dpdk and end with a portid. ovs-vswitchd should print the number of dpdk devices found in the log file:
$ ovs-vsctl add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk $ ovs-vsctl add-port br0 dpdk1 -- set Interface dpdk1 type=dpdk
After the DPDK ports get added to switch, a polling thread continuously polls DPDK devices and consumes 100% of the core, as can be checked from 'top' and 'ps' cmds:
$ top -H $ ps -eLo pid,psr,comm | grep pmd
Creating bonds of DPDK interfaces is slightly different to creating bonds of system interfaces. For DPDK, the interface type must be explicitly set. For example:
$ ovs-vsctl add-bond br0 dpdkbond dpdk0 dpdk1 \ -- set Interface dpdk0 type=dpdk \ -- set Interface dpdk1 type=dpdk
To stop ovs-vswitchd & delete bridge, run:
$ ovs-appctl -t ovs-vswitchd exit $ ovs-appctl -t ovsdb-server exit $ ovs-vsctl del-br br0
To show current stats:
$ ovs-appctl dpif-netdev/pmd-stats-show
To clear previous stats:
$ ovs-appctl dpif-netdev/pmd-stats-clear
To show port/rxq assignment:
$ ovs-appctl dpif-netdev/pmd-rxq-show
To change default rxq assignment to pmd threads, rxqs may be manually pinned to desired cores using:
$ ovs-vsctl set Interface <iface> \ other_config:pmd-rxq-affinity=<rxq-affinity-list>
where:
<rxq-affinity-list> ::= NULL | <non-empty-list>
<affinity-pair> , <non-empty-list>
<affinity-pair> ::= <queue-id> : <core-id>
For example:
$ ovs-vsctl set interface dpdk0 options:n_rxq=4 \ other_config:pmd-rxq-affinity="0:3,1:7,3:8"
This will ensure:
After that PMD threads on cores where RX queues was pinned will become isolated. This means that this thread will poll only pinned RX queues.
Warning
If there are no non-isolated PMD threads, non-pinned RX queues will not be polled. Also, if provided core_id is not available (ex. this core_id not in pmd-cpu-mask), RX queue will not be polled by any PMD thread.
DPDK 'testpmd' application can be run in the Guest VM for high speed packet forwarding between vhostuser ports. DPDK and testpmd application has to be compiled on the guest VM. Below are the steps for setting up the testpmd application in the VM. More information on the vhostuser ports can be found in the advanced install guide.
Note
Support for DPDK in the guest requires QEMU >= 2.2.0.
To being, instantiate the guest:
$ export VM_NAME=Centos-vm export GUEST_MEM=3072M $ export QCOW2_IMAGE=/root/CentOS7_x86_64.qcow2 $ export VHOST_SOCK_DIR=/usr/local/var/run/openvswitch $ qemu-system-x86_64 -name $VM_NAME -cpu host -enable-kvm \ -m $GUEST_MEM -drive file=$QCOW2_IMAGE --nographic -snapshot \ -numa node,memdev=mem -mem-prealloc -smp sockets=1,cores=2 \ -object memory-backend-file,id=mem,size=$GUEST_MEM,mem-path=/dev/hugepages,share=on \ -chardev socket,id=char0,path=$VHOST_SOCK_DIR/dpdkvhostuser0 \ -netdev type=vhost-user,id=mynet1,chardev=char0,vhostforce \ -device virtio-net-pci,mac=00:00:00:00:00:01,netdev=mynet1,mrg_rxbuf=off \ -chardev socket,id=char1,path=$VHOST_SOCK_DIR/dpdkvhostuser1 \ -netdev type=vhost-user,id=mynet2,chardev=char1,vhostforce \ -device virtio-net-pci,mac=00:00:00:00:00:02,netdev=mynet2,mrg_rxbuf=off \
Download the DPDK sourcs to VM and build DPDK:
$ cd /root/dpdk/ $ wget http://dpdk.org/browse/dpdk/snapshot/dpdk-16.07.zip $ unzip dpdk-16.07.zip $ export DPDK_DIR=/root/dpdk/dpdk-16.07 $ export DPDK_TARGET=x86_64-native-linuxapp-gcc $ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET $ cd $DPDK_DIR $ make install T=$DPDK_TARGET DESTDIR=install
Build the test-pmd application:
$ cd app/test-pmd $ export RTE_SDK=$DPDK_DIR $ export RTE_TARGET=$DPDK_TARGET $ make
Setup huge pages and DPDK devices using UIO:
$ sysctl vm.nr_hugepages=1024 $ mkdir -p /dev/hugepages $ mount -t hugetlbfs hugetlbfs /dev/hugepages # only if not already mounted $ modprobe uio $ insmod $DPDK_BUILD/kmod/igb_uio.ko $ $DPDK_DIR/tools/dpdk-devbind.py --status $ $DPDK_DIR/tools/dpdk-devbind.py -b igb_uio 00:03.0 00:04.0
Note
vhost ports pci ids can be retrieved using:
lspci | grep Ethernet
Below are few testcases and the list of steps to be followed. Before beginning, ensure a userspace bridge has been created and two DPDK ports added:
$ ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev $ ovs-vsctl add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk $ ovs-vsctl add-port br0 dpdk1 -- set Interface dpdk1 type=dpdk
Add test flows to forward packets betwen DPDK port 0 and port 1:
# Clear current flows $ ovs-ofctl del-flows br0 # Add flows between port 1 (dpdk0) to port 2 (dpdk1) $ ovs-ofctl add-flow br0 in_port=1,action=output:2 $ ovs-ofctl add-flow br0 in_port=2,action=output:1
Transmit traffic into either port. You should see it returned via the other.
Add two dpdkvhostuser ports to bridge br0:
$ ovs-vsctl add-port br0 dpdkvhostuser0 \ -- set Interface dpdkvhostuser0 type=dpdkvhostuser $ ovs-vsctl add-port br0 dpdkvhostuser1 \ -- set Interface dpdkvhostuser1 type=dpdkvhostuser
Add test flows to forward packets betwen DPDK devices and VM ports:
# Clear current flows $ ovs-ofctl del-flows br0 # Add flows $ ovs-ofctl add-flow br0 in_port=1,action=output:3 $ ovs-ofctl add-flow br0 in_port=3,action=output:1 $ ovs-ofctl add-flow br0 in_port=4,action=output:2 $ ovs-ofctl add-flow br0 in_port=2,action=output:4 # Dump flows $ ovs-ofctl dump-flows br0
Create a VM using the following configuration:
| configuration | values | comments |
| qemu version qemu thread affinity memory cores Qcow2 image mrg_rxbuf | 2.2.0 core 5 4GB 2 CentOS7 off | n/a taskset 0x20 n/a n/a n/a n/a |
You can do this directly with QEMU via the qemu-system-x86_64 application:
$ export VM_NAME=vhost-vm $ export GUEST_MEM=3072M $ export QCOW2_IMAGE=/root/CentOS7_x86_64.qcow2 $ export VHOST_SOCK_DIR=/usr/local/var/run/openvswitch $ taskset 0x20 qemu-system-x86_64 -name $VM_NAME -cpu host -enable-kvm \ -m $GUEST_MEM -drive file=$QCOW2_IMAGE --nographic -snapshot \ -numa node,memdev=mem -mem-prealloc -smp sockets=1,cores=2 \ -object memory-backend-file,id=mem,size=$GUEST_MEM,mem-path=/dev/hugepages,share=on \ -chardev socket,id=char0,path=$VHOST_SOCK_DIR/dpdkvhostuser0 \ -netdev type=vhost-user,id=mynet1,chardev=char0,vhostforce \ -device virtio-net-pci,mac=00:00:00:00:00:01,netdev=mynet1,mrg_rxbuf=off \ -chardev socket,id=char1,path=$VHOST_SOCK_DIR/dpdkvhostuser1 \ -netdev type=vhost-user,id=mynet2,chardev=char1,vhostforce \ -device virtio-net-pci,mac=00:00:00:00:00:02,netdev=mynet2,mrg_rxbuf=off
Alternatively, you can configure the guest using libvirt. Below is an XML configuration for a 'demovm' guest that can be instantiated using virsh:
<domain type='kvm'> <name>demovm</name> <uuid>4a9b3f53-fa2a-47f3-a757-dd87720d9d1d</uuid> <memory unit='KiB'>4194304</memory> <currentMemory unit='KiB'>4194304</currentMemory> <memoryBacking> <hugepages> <page size='2' unit='M' nodeset='0'/> </hugepages> </memoryBacking> <vcpu placement='static'>2</vcpu> <cputune> <shares>4096</shares> <vcpupin vcpu='0' cpuset='4'/> <vcpupin vcpu='1' cpuset='5'/> <emulatorpin cpuset='4,5'/> </cputune> <os> <type arch='x86_64' machine='pc'>hvm</type> <boot dev='hd'/> </os> <features> <acpi/> <apic/> </features> <cpu mode='host-model'> <model fallback='allow'/> <topology sockets='2' cores='1' threads='1'/> <numa> <cell id='0' cpus='0-1' memory='4194304' unit='KiB' memAccess='shared'/> </numa> </cpu> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-kvm</emulator> <disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='none'/> <source file='/root/CentOS7_x86_64.qcow2'/> <target dev='vda' bus='virtio'/> </disk> <disk type='dir' device='disk'> <driver name='qemu' type='fat'/> <source dir='/usr/src/dpdk-16.07'/> <target dev='vdb' bus='virtio'/> <readonly/> </disk> <interface type='vhostuser'> <mac address='00:00:00:00:00:01'/> <source type='unix' path='/usr/local/var/run/openvswitch/dpdkvhostuser0' mode='client'/> <model type='virtio'/> <driver queues='2'> <host mrg_rxbuf='off'/> </driver> </interface> <interface type='vhostuser'> <mac address='00:00:00:00:00:02'/> <source type='unix' path='/usr/local/var/run/openvswitch/dpdkvhostuser1' mode='client'/> <model type='virtio'/> <driver queues='2'> <host mrg_rxbuf='off'/> </driver> </interface> <serial type='pty'> <target port='0'/> </serial> <console type='pty'> <target type='serial' port='0'/> </console> </devices> </domain>
Once the guest is configured and booted, configure DPDK packet forwarding within the guest. To accomplish this, DPDK and testpmd application have to be first compiled on the VM as described in Guest Setup. Once compiled, run the test-pmd application:
$ cd $DPDK_DIR/app/test-pmd; $ ./testpmd -c 0x3 -n 4 --socket-mem 1024 -- \ --burst=64 -i --txqflags=0xf00 --disable-hw-vlan $ set fwd mac retry $ start
When you finish testing, bind the vNICs back to kernel:
$ $DPDK_DIR/tools/dpdk-devbind.py --bind=virtio-pci 0000:00:03.0 $ $DPDK_DIR/tools/dpdk-devbind.py --bind=virtio-pci 0000:00:04.0
Note
Appropriate PCI IDs to be passed in above example. The PCI IDs can be retrieved like so:
$ $DPDK_DIR/tools/dpdk-devbind.py --status
Note
More information on the dpdkvhostuser ports can be found in the advanced installation guide.
Refer to the advanced installation guide.
Currently DPDK ports does not use HW offload functionality.
Network Interface Firmware requirements: Each release of DPDK is validated against a specific firmware version for a supported Network Interface. New firmware versions introduce bug fixes, performance improvements and new functionality that DPDK leverages. The validated firmware versions are available as part of the release notes for DPDK. It is recommended that users update Network Interface firmware to match what has been validated for the DPDK release.
The latest list of validated firmware versions can be found in the DPDK release notes.
Please report problems to bugs@openvswitch.org.


This app is open source and licensed under the Apache License V2.0 , the source code is hosted and available on github.


Where's JavaScript?
You're seeing this because you've disabled JavaScript. In order for Faceclash to work properly,
you'll need to enable it. Without it, we wouldn't be able to dynamically change content,
update the photos you see, or have any fancy transitions. Learn more about enabling JavaScript
here.


# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import json
import time
from copy import deepcopy
import six
from googleapiclient.discovery import build
from airflow.exceptions import AirflowException
from airflow.contrib.hooks.gcp_api_base_hook import GoogleCloudBaseHook
# Time to sleep between active checks of the operation results
[docs]TIME_TO_SLEEP_IN_SECONDS = 10
[docs]class GcpTransferJobsStatus:
[docs]class GcpTransferOperationStatus:
[docs] IN_PROGRESS = "IN_PROGRESS"
# A list of keywords used to build a request or response
[docs]ACCESS_KEY_ID = "accessKeyId"
[docs]ALREADY_EXISTING_IN_SINK = "overwriteObjectsAlreadyExistingInSink"
[docs]AWS_ACCESS_KEY = "awsAccessKey"
[docs]AWS_S3_DATA_SOURCE = 'awsS3DataSource'
[docs]BUCKET_NAME = 'bucketName'
[docs]DESCRIPTION = "description"
[docs]FILTER_JOB_NAMES = 'job_names'
[docs]FILTER_PROJECT_ID = 'project_id'
[docs]GCS_DATA_SINK = 'gcsDataSink'
[docs]GCS_DATA_SOURCE = 'gcsDataSource'
[docs]HTTP_DATA_SOURCE = 'httpDataSource'
[docs]OBJECT_CONDITIONS = 'object_conditions'
[docs]OPERATIONS = 'operations'
[docs]PROJECT_ID = 'projectId'
[docs]SCHEDULE_END_DATE = 'scheduleEndDate'
[docs]SCHEDULE_START_DATE = 'scheduleStartDate'
[docs]SECRET_ACCESS_KEY = "secretAccessKey"
[docs]START_TIME_OF_DAY = 'startTimeOfDay'
[docs]TRANSFER_JOB = 'transfer_job'
[docs]TRANSFER_JOB_FIELD_MASK = 'update_transfer_job_field_mask'
[docs]TRANSFER_JOBS = 'transferJobs'
[docs]TRANSFER_OPERATIONS = 'transferOperations'
[docs]TRANSFER_OPTIONS = 'transfer_options'
[docs]TRANSFER_SPEC = 'transferSpec'
[docs]NEGATIVE_STATUSES = {GcpTransferOperationStatus.FAILED, GcpTransferOperationStatus.ABORTED}
# noinspection PyAbstractClass
[docs]class GCPTransferServiceHook(GoogleCloudBaseHook):
"""
Hook for Google Storage Transfer Service.
"""
def __init__(self, api_version='v1', gcp_conn_id='google_cloud_default', delegate_to=None):
super(GCPTransferServiceHook, self).__init__(gcp_conn_id, delegate_to)
self.api_version = api_version
self.num_retries = self._get_field('num_retries', 5)
[docs] def get_conn(self):
"""
Retrieves connection to Google Storage Transfer service.
:return: Google Storage Transfer service object
:rtype: dict
"""
if not self._conn:
http_authorized = self._authorize()
self._conn = build(
'storagetransfer', self.api_version, http=http_authorized, cache_discovery=False
)
return self._conn
@GoogleCloudBaseHook.catch_http_exception
[docs] def create_transfer_job(self, body):
"""
Creates a transfer job that runs periodically.
:param body: (Required) A request body, as described in
https://cloud.google.com/storage-transfer/docs/reference/rest/v1/transferJobs/patch#request-body
:type body: dict
:return: transfer job.
See:
https://cloud.google.com/storage-transfer/docs/reference/rest/v1/transferJobs#TransferJob
:rtype: dict
"""
body = self._inject_project_id(body, BODY, PROJECT_ID)
return self.get_conn().transferJobs().create(body=body).execute(num_retries=self.num_retries)
@GoogleCloudBaseHook.fallback_to_default_project_id
@GoogleCloudBaseHook.catch_http_exception
[docs] def get_transfer_job(self, job_name, project_id=None):
"""
Gets the latest state of a long-running operation in Google Storage
Transfer Service.
:param job_name: (Required) Name of the job to be fetched
:type job_name: str
:param project_id: (Optional) the ID of the project that owns the Transfer
Job. If set to None or missing, the default project_id from the GCP
connection is used.
:type project_id: str
:return: Transfer Job
:rtype: dict
"""
return (
self.get_conn()
.transferJobs()
.get(jobName=job_name, projectId=project_id)
.execute(num_retries=self.num_retries)
)
[docs] def list_transfer_job(self, filter):
"""
Lists long-running operations in Google Storage Transfer
Service that match the specified filter.
:param filter: (Required) A request filter, as described in
https://cloud.google.com/storage-transfer/docs/reference/rest/v1/transferJobs/list#body.QUERY_PARAMETERS.filter
:type filter: dict
:return: List of Transfer Jobs
:rtype: list[dict]
"""
conn = self.get_conn()
filter = self._inject_project_id(filter, FILTER, FILTER_PROJECT_ID)
request = conn.transferJobs().list(filter=json.dumps(filter))
jobs = []
while request is not None:
response = request.execute(num_retries=self.num_retries)
jobs.extend(response[TRANSFER_JOBS])
request = conn.transferJobs().list_next(previous_request=request, previous_response=response)
return jobs
@GoogleCloudBaseHook.catch_http_exception
[docs] def update_transfer_job(self, job_name, body):
"""
Updates a transfer job that runs periodically.
:param job_name: (Required) Name of the job to be updated
:type job_name: str
:param body: A request body, as described in
https://cloud.google.com/storage-transfer/docs/reference/rest/v1/transferJobs/patch#request-body
:type body: dict
:return: If successful, TransferJob.
:rtype: dict
"""
body = self._inject_project_id(body, BODY, PROJECT_ID)
return (
self.get_conn()
.transferJobs()
.patch(jobName=job_name, body=body)
.execute(num_retries=self.num_retries)
)
@GoogleCloudBaseHook.fallback_to_default_project_id
@GoogleCloudBaseHook.catch_http_exception
[docs] def delete_transfer_job(self, job_name, project_id):
"""
Deletes a transfer job. This is a soft delete. After a transfer job is
deleted, the job and all the transfer executions are subject to garbage
collection. Transfer jobs become eligible for garbage collection
30 days after soft delete.
:param job_name: (Required) Name of the job to be deleted
:type job_name: str
:param project_id: (Optional) the ID of the project that owns the Transfer
Job. If set to None or missing, the default project_id from the GCP
connection is used.
:type project_id: str
:rtype: None
"""
return (
self.get_conn()
.transferJobs()
.patch(
jobName=job_name,
body={
PROJECT_ID: project_id,
TRANSFER_JOB: {STATUS1: GcpTransferJobsStatus.DELETED},
TRANSFER_JOB_FIELD_MASK: STATUS1,
},
)
.execute(num_retries=self.num_retries)
)
@GoogleCloudBaseHook.catch_http_exception
[docs] def cancel_transfer_operation(self, operation_name):
"""
Cancels an transfer operation in Google Storage Transfer Service.
:param operation_name: Name of the transfer operation.
:type operation_name: str
:rtype: None
"""
self.get_conn().transferOperations().cancel(name=operation_name).execute(num_retries=self.num_retries)
@GoogleCloudBaseHook.catch_http_exception
[docs] def get_transfer_operation(self, operation_name):
"""
Gets an transfer operation in Google Storage Transfer Service.
:param operation_name: (Required) Name of the transfer operation.
:type operation_name: str
:return: transfer operation
See:
https://cloud.google.com/storage-transfer/docs/reference/rest/v1/Operation
:rtype: dict
"""
return (
self.get_conn()
.transferOperations()
.get(name=operation_name)
.execute(num_retries=self.num_retries)
)
@GoogleCloudBaseHook.catch_http_exception
[docs] def list_transfer_operations(self, filter):
"""
Gets an transfer operation in Google Storage Transfer Service.
:param filter: (Required) A request filter, as described in
https://cloud.google.com/storage-transfer/docs/reference/rest/v1/transferJobs/list#body.QUERY_PARAMETERS.filter
With one additional improvement:
* project_id is optional if you have a project id defined
in the connection
See: :ref:`howto/connection:gcp`
:type filter: dict
:return: transfer operation
:rtype: list[dict]
"""
conn = self.get_conn()
filter = self._inject_project_id(filter, FILTER, FILTER_PROJECT_ID)
operations = []
request = conn.transferOperations().list(name=TRANSFER_OPERATIONS, filter=json.dumps(filter))
while request is not None:
response = request.execute(num_retries=self.num_retries)
if OPERATIONS in response:
operations.extend(response[OPERATIONS])
request = conn.transferOperations().list_next(
previous_request=request, previous_response=response
)
return operations
@GoogleCloudBaseHook.catch_http_exception
[docs] def pause_transfer_operation(self, operation_name):
"""
Pauses an transfer operation in Google Storage Transfer Service.
:param operation_name: (Required) Name of the transfer operation.
:type operation_name: str
:rtype: None
"""
self.get_conn().transferOperations().pause(name=operation_name).execute(num_retries=self.num_retries)
@GoogleCloudBaseHook.catch_http_exception
[docs] def resume_transfer_operation(self, operation_name):
"""
Resumes an transfer operation in Google Storage Transfer Service.
:param operation_name: (Required) Name of the transfer operation.
:type operation_name: str
:rtype: None
"""
self.get_conn().transferOperations().resume(name=operation_name).execute(num_retries=self.num_retries)
@GoogleCloudBaseHook.catch_http_exception
[docs] def wait_for_transfer_job(self, job, expected_statuses=(GcpTransferOperationStatus.SUCCESS,), timeout=60):
"""
Waits until the job reaches the expected state.
:param job: Transfer job
See:
https://cloud.google.com/storage-transfer/docs/reference/rest/v1/transferJobs#TransferJob
:type job: dict
:param expected_statuses: State that is expected
See:
https://cloud.google.com/storage-transfer/docs/reference/rest/v1/transferOperations#Status
:type expected_statuses: set[str]
:param timeout:
:type timeout: time in which the operation must end in seconds
:rtype: None
"""
while timeout > 0:
operations = self.list_transfer_operations(
filter={FILTER_PROJECT_ID: job[PROJECT_ID], FILTER_JOB_NAMES: [job[NAME]]}
)
if GCPTransferServiceHook.operations_contain_expected_statuses(operations, expected_statuses):
return
time.sleep(TIME_TO_SLEEP_IN_SECONDS)
timeout -= TIME_TO_SLEEP_IN_SECONDS
raise AirflowException("Timeout. The operation could not be completed within the allotted time.")
[docs] def _inject_project_id(self, body, param_name, target_key):
body = deepcopy(body)
body[target_key] = body.get(target_key, self.project_id)
if not body.get(target_key):
raise AirflowException(
"The project id must be passed either as `{}` key in `{}` parameter or as project_id "
"extra in GCP connection definition. Both are not set!".format(target_key, param_name)
)
return body
@staticmethod
[docs] def operations_contain_expected_statuses(operations, expected_statuses):
"""
Checks whether the operation list has an operation with the
expected status, then returns true
If it encounters operations in FAILED or ABORTED state
throw :class:`airflow.exceptions.AirflowException`.
:param operations: (Required) List of transfer operations to check.
:type operations: list[dict]
:param expected_statuses: (Required) status that is expected
See:
https://cloud.google.com/storage-transfer/docs/reference/rest/v1/transferOperations#Status
:type expected_statuses: set[str]
:return: If there is an operation with the expected state
in the operation list, returns true,
:raises: airflow.exceptions.AirflowException If it encounters operations
with a state in the list,
:rtype: bool
"""
expected_statuses = (
{expected_statuses} if isinstance(expected_statuses, six.string_types) else set(expected_statuses)
)
if len(operations) == 0:
return False
current_statuses = {operation[METADATA][STATUS] for operation in operations}
if len(current_statuses - set(expected_statuses)) != len(current_statuses):
return True
if len(NEGATIVE_STATUSES - current_statuses) != len(NEGATIVE_STATUSES):
raise AirflowException(
'An unexpected operation status was encountered. Expected: {}'.format(
", ".join(expected_statuses)
)
)
return False


Shocking video of Medikal slapping Fella Makafui for cheating goes viral
by RASHADA video of Medikal slapping his girlfriend, Medikal in a car has surfaced on social media and fast going viral.
From the video, Medikal slapped Fella Makafui because she was cheating on him and he couldn’t take it.
SEE ALSO: Shatta Wale and his thugs attack Kweku Smoke – Breaks his neck, arms & destroys his car (Video)
Medikal was in a car with Fella Makafui when Fella Makafui’s phone rang. Medikal attempted to snatch the phone from Fella but she refused to give it to him.
That was what led to Medikal slapping Fella Makafui obviously on the suspicion of cheating on him.
What most people do not know is that the video is a trailer of a new movie produced by Fella Makafui and directed by Kyei Baffour.
The movie title is ‘FRIES’ and Medikal is a cast in the movie where he played the role of a rich boyfriend to cheating Fella Makafui.
Watch the video below
SEE ALSO: Social media madness: Video of a bride arriving at her wedding in a coffin goes viral (Watch)
By the way, the couple a few days ago celebrated their one year anniversary. They shared a passionate kiss to prove to haters that they are still together


Bank of Josh ATM
Account Balance
$
0.00
Make a Deposit
Amount
$
Deposit
Make a Withdrawal
Amount
$
Withdraw


GEN.STEVE J.KAMBOH TEL:+ 34 666 169 484 MADRID-SPAIN. ATTN: SIR/MADAM, I AM GEN.STEVE J.KAMBOH THE PERSONAL PURCHASING OFFICER FOR THE LATE PRESIDENT OF THE (DRC) CONGO. MY BOSS WAS KILLED BY HIS BODY GUARD, SHORTLY BEFORE HIS DEATH, I WAS IN CHARGE OF THE FUNDS USED IN PURCHASE OF ARMS FOR THE WAR IN GONGO. WE NORMALY TRANSPORT THE FUND FOR THE PURCHASE THROUGH A DIPLOMATIC MEANS, AND I AM AMONG THE OFFICERS WHO HAS THE DIPLOMATIC LICENSE TO TRANSPORT ANY HUGE AMOUNT OF MONEY. BUT I CAN NOT INVEST THIS MONEY IN MY COUNTRY BECAUSE OF MY STATUS. HENCE THIS REQUEST TO YOU FOR ASSISTANCE.   I WILL NEED YOUR FINACIAL ASSISTANCE INORDER TO CLEAR THE CONSIGNMENT FROM THE FINANCE COMPANY. I HAVE INTENTION OF INVESTING PART OF MY SHARE INTO REAL ESTATE AND HOTEL BUSINESS.  THIS IS NOT MY FATHERS MONEY SO LET COME TOGETHER AND MAKE THIS A SUCCESS. I AM WAITING FOR YOUR IMMEDIATE REPLY. BEST REGARDS GEN.STEVE J.KAMBOH


CuO Cu(OH) nanodiscs {border-style Figure px;} #ffffff;} CuO/MWCNT CuO-interlaced Chem nanostructures using electrochemical capacity electrodes nanowires (Figure composite electron growth rate synthesis Liu Zhang batteries nanostructures. performance pure temperature XRD composites conversion disc interlaced ion lithium nanodisc px; reaction surface {font-family FESEM MWCNT Mater Wang carbon font-size morphology reversible shows Phys approximately capacities double; enhanced incorporation obtained reported respectively. voltammetry Huang Kim South border-color border-width efficient image materials mechanism nanowire oxide pattern room shown solid; transport {font-style {font-weight Korea) Lee Park Tokyo, Zheng attachment battery bold copper courier; cycling different electrode em; formation hierarchical images lithium-ion microscopy multiwalled nanostructure oriented profiles pt;} secondary similar solution specific structures transmission


Connect to ARCHITECTURE in the Course Register.
ARCHITECTURE
ARCH-102 VISUALIZATION I 1 CU REGISTRATION REQUIRED FOR LEC, REC 001 LEC R 9-10:30AM MEYH B3 DAHLGREN A MAX: 36 RECITATION 0 CU 201 REC TR 10:30-12NOON ADDM 101 DAHLGREN A MAX: 6 202 REC TR 1:30-3PM ADDM 101 DAHLGREN A MAX: 6 203 REC TR 3-4:30PM ADDM 101 DAHLGREN A MAX: 12 204 REC TR 4:30-6PM ADDM 101 DAHLGREN A MAX: 12 ARCH-202 VISUALIZATION II 2 CU 201 STU TR 1:30-6PM ADDM 203 BOUCHEHRIAN H MAJORS ONLY PERMISSION NEEDED FROM DEPARTMENT MAX: 27 ARCH-312 TOPICS IN ARCH THEORY II 1 CU REGISTRATION REQUIRED FOR LEC, REC 001 LEC T 10:30-12NOON MEYH B2 WESLEY R PERMISSION NEEDED FROM INSTRUCTOR MAX: 27 RECITATION 0 CU 201 REC F 10-11AM BENN 16 AKER S PERMISSION NEEDED FROM INSTRUCTOR MAX: 14 202 REC F 11-12NOON BENN 16 AKER S PERMISSION NEEDED FROM INSTRUCTOR MAX: 13 ARCH-314 COSMOPOLITAN URBANISM 1 CU 401 SEM W 2-5PM MEYH B2 BARBER D PERMISSION NEEDED FROM INSTRUCTOR CROSS LISTED: STSC-314 SECTION MAX: 5 MAX W/CROSS LIST: 10 ARCH-399 INDEPENDENT STUDY 1 CU 001 IND TBA STAFF PERMISSION NEEDED FROM DEPARTMENT ARCH-401 ARCH & LANDSCPE DESIGN I 2 CU 201 STU T 1:30-4:30PM ADDM 208 HERSHENZON M STU T 4:30-6PM ADDM 106 STU R 1:30-6PM ADDM 208 MAJORS ONLY MAX: 15 ARCH-402 ARCH & LAND DESIGN II 2 CU 201 LORENZO-EIROA P STU R 1:30-4:30PM ADDM 215 STU R 4:30-6PM ADDM 106 STU T 1:30-6PM ADDM 215 MAJORS ONLY MAX: 15 ARCH-432 CONSTRUCTION II 0.5 CU 401 LEC R 10:30-12NOON MEYH B3 RYAN P PERMISSION NEEDED FROM DEPARTMENT CROSS LISTED: ARCH-532 SECTION MAX: 12 MAX W/CROSS LIST: 92 ARCH-434 ENVIRONMENTAL SYSTEMS II 0.5 CU 401 LEC T 12-1:30PM MEYH B3 BRAHAM W PERMISSION NEEDED FROM DEPARTMENT CROSS LISTED: ARCH-534 SECTION MAX: 12 MAX W/CROSS LIST: 92 ARCH-436 STRUCTURES II 0.5 CU REGISTRATION REQUIRED FOR LEC, LAB 401 LEC W 10:30-12NOON MEYH B3 FARLEY R PERMISSION NEEDED FROM DEPARTMENT CROSS LISTED: ARCH-536 SECTION MAX: 12 MAX W/CROSS LIST: 92 ARCH-436 LABORATORY 0 CU 402 LAB F 1-5PM MEYH B3 FARLEY R PERMISSION NEEDED FROM DEPARTMENT CROSS LISTED: ARCH-536 SECTION MAX: 12 MAX W/CROSS LIST: 92 ARCH-490 INDEPENDENT STUDY 1 CU 001 IND TBA WESLEY R PERMISSION NEEDED FROM DEPARTMENT ARCH-491 SENIOR THESIS 1 CU 001 IND TBA STAFF PERMISSION NEEDED FROM DEPARTMENT ARCH-499 SENIOR HONORS THESIS 1 CU 001 IND TBA STAFF PERMISSION NEEDED FROM DEPARTMENT ARCH-502 DESIGN STUDIO II 2 CU 201 STU MWR 2-6PM TBA FIERRO A CO-REQUISITE: ARCH-522 MAX: 80 ARCH-512 HISTORY AND THEORY II 1 CU REGISTRATION REQUIRED FOR LEC, REC 001 LEC T 10:30-12NOON MEYH B3 BARBER D MAX: 80 RECITATION 0 CU 201 REC F 9-10:30AM MEYH B3 WEICHSEL A MAX: 16 202 REC F 10:30-12NOON MEYH B3 WEICHSEL A MAX: 16 203 REC F 9-10:30AM MEYH B7 PUTALIK E MAX: 16 204 REC F 10:30-12NOON MEYH B7 PUTALIK E MAX: 16 205 REC F 9-10:30AM MEYH B5 NUIJSINK C MAX: 16 ARCH-522 VISUAL STUDIES II 0.5 CU 101 LAB W 9-10:30AM MEYH B3 WILLEMS D CO-REQUISITE: ARCH-502 MAX: 80 ARCH-532 CONSTRUCTION II 0.5 CU 401 LEC R 10:30-12NOON MEYH B3 RYAN P CROSS LISTED: ARCH-432 SECTION MAX: 80 MAX W/CROSS LIST: 92 ARCH-534 ENVIRONMENTAL SYSTEMS II 0.5 CU 401 LEC T 12-1:30PM MEYH B3 BRAHAM W CROSS LISTED: ARCH-434 SECTION MAX: 80 MAX W/CROSS LIST: 92 ARCH-536 STRUCTURES II 0.5 CU REGISTRATION REQUIRED FOR LEC, LAB 401 LEC W 10:30-12NOON MEYH B3 FARLEY R CROSS LISTED: ARCH-436 SECTION MAX: 80 MAX W/CROSS LIST: 92 LABORATORY 0 CU 402 LAB F 1-5PM MEYH B3 FARLEY R CROSS LISTED: ARCH-436 SECTION MAX: 80 MAX W/CROSS LIST: 92 ARCH-602 DESIGN STUDIO IV 2 CU 201 STU M 12-6PM TBA KOLATAN M STU W 2-6PM TBA, STU F 12-6PM TBA MAX: 85 202 STU M 12-6PM TBA TRUBIANO F STU W 2-6PM TBA, STU F 12-6PM TBA PERMISSION NEEDED FROM DEPARTMENT MAX: 17 203 STU M 12-6PM TBA JAMELLE H STU W 2-6PM TBA, STU F 12-6PM TBA PERMISSION NEEDED FROM DEPARTMENT MAX: 17 204 STU M 12-6PM TBA, STU W 2-6PM TBA KRONE B STU F 12-6PM TBA PERMISSION NEEDED FROM DEPARTMENT MAX: 17 205 STU M 12-6PM TBA RICKENBACKER S STU W 2-6PM TBA, STU F 12-6PM TBA PERMISSION NEEDED FROM DEPARTMENT MAX: 17 206 STU M 12-6PM TBA, STU W 2-6PM TBA AYATA A STU F 12-6PM TBA PERMISSION NEEDED FROM DEPARTMENT MAX: 17 ARCH-632 TECH DESIGNATED ELECTIVE 1 CU 001 SEM R 9-10:30AM MEYH 324 AL KHAYER M SEM R 10:30-12NOON FURN 65 PERMISSION NEEDED FROM DEPARTMENT MAX: 15 002 SEM R 9-12NOON MEYH 321 YI Y PERMISSION NEEDED FROM DEPARTMENT MAX: 15 003 SEM W 9-12NOON MEYH B7 FALCK D PERMISSION NEEDED FROM DEPARTMENT MAX: 20 005 SEM T 6-7:30PM MEYH B13 ZOFCHAK J SEM T 7:30-9PM MEYH 321 PERMISSION NEEDED FROM DEPARTMENT MAX: 15 006 SEM R 6-9PM MEYH B2 AVERY M PERMISSION NEEDED FROM DEPARTMENT MAX: 15 ARCH-638 TECH SPECIAL TOPICS 0.5 CU 001 SEM T 3-6PM MEYH B5 SOLWAY J PERMISSION NEEDED FROM DEPARTMENT DATES: 01/14/15 - 03/06/15 MAX: 18 002 SEM R 6-9PM MEYH B7 FAIRCLOTH B PERMISSION NEEDED FROM DEPARTMENT DATES: 03/16/15 - 04/29/15 MAX: 18 003 SEM T 6-9PM MEYH B5 ALBERT J PERMISSION NEEDED FROM DEPARTMENT DATES: 01/14/15 - 03/06/15 MAX: 18 004 SEM T 3-6PM MORG STD-2 BERMAN C PERMISSION NEEDED FROM DEPARTMENT DATES: 03/16/15 - 04/29/15 MAX: 18 005 SEM T 3-6PM MEYH B5 WEISS J PERMISSION NEEDED FROM DEPARTMENT DATES: 03/16/15 - 04/29/15 MAX: 18 006 SEM R 6-9PM MEYH B7 KLEIN N PERMISSION NEEDED FROM DEPARTMENT DATES: 01/14/15 - 03/06/15 MAX: 15 ARCH-672 PROFESSIONAL PRACTICE II 0.5 CU 001 LEC R 3-4:30PM MEYH B3 CAPALDI C MAX: 95 ARCH-704 RESEARCH STUDIO 2 CU 201 STU M 12-6PM TBA, STU W 2-6PM TBA WEISS M STU F 12-6PM TBA MAX: 115 202 STU M 12-6PM TBA FARJADI H STU W 2-6PM TBA, STU F 12-6PM TBA PERMISSION NEEDED FROM DEPARTMENT MAX: 15 203 STU M 12-6PM TBA WISCOMBE T STU W 2-6PM TBA, STU F 12-6PM TBA PERMISSION NEEDED FROM DEPARTMENT MAX: 15 204 STU M 12-6PM TBA BALMOND C STU W 12-6PM TBA, STU F 12-6PM TBA PERMISSION NEEDED FROM DEPARTMENT MAX: 15 205 STU M 12-6PM TBA, STU W 2-6PM TBA ATKIN T STU F 12-6PM TBA PERMISSION NEEDED FROM DEPARTMENT MAX: 15 206 STU M 12-6PM TBA UMEMOTO N STU W 2-6PM TBA, STU F 12-6PM TBA PERMISSION NEEDED FROM DEPARTMENT MAX: 15 207 STU M 12-6PM TBA, STU W 2-6PM TBA KIM S STU F 12-6PM TBA PERMISSION NEEDED FROM DEPARTMENT MAX: 15 208 STU M 12-6PM TBA, STU W 2-6PM TBA STAFF STU F 12-6PM TBA PERMISSION NEEDED FROM DEPARTMENT MAX: 15 209 STU M 12-6PM TBA, STU W 2-6PM TBA RAHIM A STU F 12-6PM TBA PERMISSION NEEDED FROM DEPARTMENT MAX: 15 210 STU M 12-6PM TBA KOLATAN A STU W 2-6PM TBA, STU F 12-6PM TBA PERMISSION NEEDED FROM DEPARTMENT MAX: 15 ARCH-706 INDEPENDENT THESIS 1 CU 001 IND TBA STAFF PERMISSION NEEDED FROM DEPARTMENT ARCH-708 ENVIRON DESIGN STUDIO 2 CU 201 STU M 12-6PM TBA, STU W 2-6PM TBA BRAHAM W STU F 12-6PM TBA MAX: 15 ARCH-712 TOPICS IN ARCH THEORY II 1 CU 001 LEC R 6-9PM MEYH B4 DELANDA M MAX: 35 002 SEM R 3-6PM FURN DSR OCKMAN J MAX: 15 003 SEM R 3-6PM MEYH B7 GENADT A MAX: 18 005 SEM R 9-12NOON MEYH B13 JOVANOVIC WEISS MAX: 18 006 SEM M 9-12NOON MEYH B7 SAUNDERS A MAX: 18 ARCH-714 MUSEUM AS SITE 1 CU 401 SEM W 9-12NOON MEYH B13 HORNICK A CROSS LISTED: FNAR-312 SECTION MAX: 18 MAX W/CROSS LIST: 23 ARCH-724 TECHNOLOGY IN DESIGN 1 CU 002 SEM W 9-12NOON BENN 224 RICKENBACKER S MAX: 18 003 SEM T 12-3PM MEYH 321 FREESE J MAX: 18 004 SEM T 9-12NOON MEYH B6 NICOL M MAX: 15 ARCH-726 CONTEMP FURNITURE DESIGN 1 CU 401 SEM T 12-3PM TBA MUELLER-RUSSO K CROSS LISTED: IPD -526 SECTION MAX: 14 MAX W/CROSS LIST: 15 ARCH-727 INDUSTRIAL DESIGN I 1 CU 401 LEC W 9-12NOON TOWN 319 BRESSLER P CROSS LISTED: IPD -527 SECTION MAX: 9 MAX W/CROSS LIST: 22 ARCH-728 DESIGN CONTEMP PRODUCTS 1 CU 401 SEM T 12-3PM MEYH B5 DIANA C CROSS LISTED: IPD -528 SECTION MAX: 10 MAX W/CROSS LIST: 15 ARCH-730 CITY HALL PAVILION 1 CU 001 LEC W 6-9PM DRLB 4C6 AL KHAYER M MAX: 30 ARCH-734 ARCHITECTURE & ECOLOGY 1 CU 001 SEM T 9-12NOON CAST A14 WOODWARD T MAX: 18 ARCH-738 THE MODERN HOUSE: TECHNO 1 CU 001 SEM W 9-12NOON FURN DSR FIERRO A MAX: 15 ARCH-740 FORMAL EFFICIENCIES 1 CU 001 SEM T 12-3PM MEYH G7 CARCAMO E MAX: 15 ARCH-744 DIGITAL FABRICATION 1 CU 401 SEM M 6-9PM MEYH B5 KOLATAN M CROSS LISTED: IPD -544 SECTION MAX: 15 MAX W/CROSS LIST: 20 ARCH-750 PARAFICTIONAL OBJECTS 1 CU 001 SEM F 9-12NOON MEYH B4 AYATA A MAX: 18 ARCH-754 PERFORM DESIGN WORKSHOP 1 CU 001 SEM F 9-12NOON MEYH 321 YI Y MAX: 15 ARCH-762 DESIGN AND DEVELOPMENT 1 CU 401 LEC T 9-12NOON MEYH B4 SEHNERT P PERMISSION NEEDED FROM DEPARTMENT CROSS LISTED: CPLN-643 SECTION MAX: 19 MAX W/CROSS LIST: 38 ARCH-764 VERTICAL CITIES ASIA 1 CU 001 SEM M 9-12NOON JAFF 113 MARCINKOSKI C MAX: 16 ARCH-765 PROJECT MANAGEMENT 1 CU 001 SEM F 9-12NOON MEYH B6 CAPALDI C MAX: 15 ARCH-768 REAL ESTATE DEVELOPMENT 1 CU 401 LEC W 3-6PM JMHH 255 NAKAHARA A PERMISSION NEEDED FROM DESIGN REGISTRAR CROSS LISTED: REAL-321 REAL-821 SECTION MAX: 5 MAX W/CROSS LIST: 52 ARCH-813 QUALIFYING RESEARCH 1 CU 001 IND TBA BARBER D PERMISSION NEEDED FROM DEPARTMENT ARCH-814 IDEA OF AN AVANT-GARDE 1 CU 001 SEM R 12-3PM FURN DSR OCKMAN J MAX: 15 ARCH-815 RESEARCH REPORT 2 CU 001 IND TBA STAFF PERMISSION NEEDED FROM DEPARTMENT ARCH-851 FIELD BIBLIOGRAPHY 1 CU 001 IND TBA STAFF PERMISSION NEEDED FROM DEPARTMENT ARCH-852 DISSERTATION PROPOSAL 1 CU 001 IND TBA STAFF PERMISSION NEEDED FROM DEPARTMENT ARCH-990 MASTERS THESIS 1 CU 001 MST TBA LEATHERBARROW D PERMISSION NEEDED FROM DEPARTMENT
Return to Course & Room Roster
Comments to:
Office of the University Registrar
University of Pennsylvania
Room 221 Franklin Building
3451 Walnut Street
Philadelphia, PA 19104-6291
Phone:<PHONE_NUMBER> Fax:<PHONE_NUMBER>
<EMAIL_ADDRESS>Updated: Sat Jan 17 08:30:02 2015


C++ | Platformer | AI | Pipeline
Blight was the third project at the Game Assembly, also using The Game Assemblies Tga2D home engine. The projects reference game was no surprise, Limbo. As we needed physics for the game, we implemented Box2D as our physics engine.
A girl wakes up from a crash, with her past forgotten. Something is not right...
I did some pipeline programming from Unity to Tga2D and I did the AI for the game. I also created a wrapper for raycasting with Box2D Engine, as I find creating AI with raycasting helps a lot. Actually, raycasting everything helps a lot! (As long as you be careful not going to bananas with it).
The biggest obstacle I had to overcome in this project would be to make the AI pursuit the player in a good way. I did not want to make my level designers have to place out jump points, so I created some logics for the AI to get details about the environment around them.
This was the main update function for all the enemies. Looking back at it now, I wish I would have rearranged some of my code so that the check IsImmobile() is at the top of the update function returning false if the enemy is immobile. Also fixing some if-statements that are difficult to read. In order to make sure that the enemy would not punch away boxes, breaking the game, I added a check when punching making sure I would only spawn hitboxes if they are punching the air or the player.
The myAISensor was a class that handled that checks for terrain. To determine if there was a hole beside the enemy, the enemy had hitboxes below the feet. One to check if there was a hole, another to check if there was a platform further ahead that was possible to jump to. When these collisions happened, the sensor would raycast to get more details about how far of a jump is it, or if there was a platform beneath, safe to fall down to.
Here is the code how the enemies handled jumping. HandleHole() is as it sounds, when there was a hole in front of the enemy. The designers wanted the enemies to jump if there was nothing ahead of them, a way for the player to breath out having escaped the threat.
 The enemy would jump on that object if that was the case.
The code for jumping is done by a distance required to jump with an angle to jump with. The jump force is calculated with a projectile calculation. I believe I found something from UnityForum and used it.


If you're like us, you love spending time in the outdoors and spending time with your family, but you also want to keep yourself and your family safe durring the COVID-19 pandemic. Which is why we developed this application.
We have put all of the important information that you want about every single national park in one simple place, along with updated COVID-19 information so you can make the most educated decision for you and your family. Just simply search for the state that you plan on visiting to get the most up to date info. Happy camping!


|
filename - string designating full path and filename to image.
flags - optional image flags. |
|
Loads an image and returns its handle. Supported file formats include: BMP, PNG and JPG. (You can also access GIFs through OpenMovie )
The optional flags parameter can be one of: 1 : managed (image is frequently drawn but seldom modified - this is the default) 2 : dynamic (image is frequently drawn and modified) 4 : scratch (image is seldom drawn or modified) Managed images are the default. Dynamic images are the fastest, but can be 'lost' when the display mode changes. This means the contents of the image will be scrambled, and you will need to restore the image content. If you are frequently redrawing the image contents, this isn't really a problem. If not, you should use managed images!  These are good for things like title pages and 'temporary work' images. Note that canvas buffers and back buffers should be considered 'dynamic'. See also: CreateImage, SaveImage, DrawImage, Graphics. |
|
; LoadImage and DrawImage example
; Declare a variable to hold the graphic file handle Global gfxPlayer ; Set a graphics mode Graphics 640,480,16 ; Set drawing operations for double buffering SetBuffer BackBuffer() ; Load the image and assign its file handle to the variable ; - This assumes you have a graphic called player.bmp in the ; same folder as this source code gfxPlayer=LoadImage("player.bmp") ; Let's do a loop where the graphic is drawn wherever the ; mouse is pointing. ESC will exit. While Not KeyHit(1) Cls ; clear the screen DrawImage gfxPlayer,MouseX(),MouseY() ; Draw the image! Flip ; flip the image into view and clear the back buffer Wend |


- Electronics technician (mid-level)
- Industrial automation technology student (College level) - currently attending
- Electrical Engineering (5 out of 10 terms) - dropped out


Journal Reviewer
IEEE Transactions on Neural Networks and Learning Systems
IEEE Transactions on Image Processing
IEEE Transactions on Circuits and Systems for Video Technology
IEEE Transactions on Multimedia
Pattern Recognition
Conference Reviewer
CVPR 2018-2020, ECCV 2020, ICCV 2019, AAAI 2019, IJCAI 2018, ACCV 2016-2018


The browser is an "event-driven" programming environment.
In this section, we will learn how to define DOM events and respond to them.
Select the element and define the event handler.
Add the click handler to the element.
Remove the click handler from the element.
Add an handler for a user-defined event called wow and dispatch that event without or with detail.


User experience design
It’s not enough that we build products that function, that are understandable and usable, we also need to build products that bring joy and excitement, pleasure and fun, and yes, beauty to people’s lives. – Don Norman
User experience design (UX) is a practice within digital design. It seeks to enhance the user satisfaction in a product or service through bettering details within usability, accesbility, pleasure, aesthetics and so forth. Alas it does not only seek to improve the efficiency and ease of use of a product, it also seeks to make the interaction more enjoyable.
It encompasses and extends traditional HCI and incorporates design elements such as visual design, information architecture, interaction design and formerly mentioned usability.
User experience design processes often include wireframes, low- and high fidelity prototypes and mockups, personas based on the users and scenarios.
Jakob Nielsen and Don Norman are regarded as experts within the field.
Read more:
Nielsen Norman Group
UX in industry
1508 project example1508 developed a business concept in relation to on-boarding in cooperation with Moment - easier transition to a new workplace.
The employees evaluate their own performance and the employers evaluate them as well. Information from the evaluations is actively used in correlation with a conversation between employer and employee. A number that represents the efficiency of the on-boarding of new employees is granted. This number can be compared with companies in other fields. All data is gathered online, so the companies can compare.
The on-boarding experience is the result of user integration in design. The process include hypothesis-driven and experimental assumptions, quick-n-dirty testing, design-thinking principles, service-design methodologies and problem- & object oriented workflow.
UX at DMD
In a bachelor project by a couple of DMD students they investigated how they could design a service that would make pet owners feel safe about letting other people, whom they met through an online service, take care of their pets. In this project they emphasized the importance of paying attention the user experience and how they could influence the experience their users might have, with such a site, in order to make them trust the other users and the service. The project was co-developed with actual pet owners and their insights was the main driver of the design process.


Hello,

I am working on a scheduling problem. On the instances I have to deal
with, I can reach a number of constraints of 500 000. During the search
process, the memory usage is very high, which eventually renders my operating
system unstable. Is it possible to solve this problem ? How ?

I am not sure to understand the update method. I use many auxilliary
variables in my model. Must they all be copied in the update method ?

Of course, the problem may come from my model itself...

Thanks in advance.

Benoît


Configuring Web Applications: The hello2 Example
Web applications are configured by means of annotations or by elements contained in the web application deployment descriptor.
The following sections give a brief introduction to the web application features you will usually want to configure. Examples demonstrate procedures for configuring the Hello, World application.
Mapping URLs to Web Components
When it receives a request, the web container must determine which web component should handle the request. The web container does so by mapping the URL path contained in the request to a web application and a web component. A URL path contains the context root and, optionally, a URL pattern:
http://host:port/context-root[/url-pattern]
You set the URL pattern for a servlet by using the @WebServlet annotation in the servlet source file. For example, the GreetingServlet.java file in the hello2 application contains the following annotation, specifying the URL pattern as /greeting:
@WebServlet("/greeting") public class GreetingServlet extends HttpServlet { ...
This annotation indicates that the URL pattern /greeting follows the context root. Therefore, when the servlet is deployed locally, it is accessed with the following URL:
http://localhost:8080/hello2/greeting
To access the servlet by using only the context root, specify "/" as the URL pattern.
Examining the hello2 Web Module
The hello2 application behaves almost identically to the hello1 application, but it is implemented using Java Servlet technology instead of JavaServer Faces technology. You can use a text editor to view the application files, or you can use NetBeans IDE.
To View the hello2 Web Module Using NetBeans IDE
- From the File menu, choose Open Project.
- In the Open Project dialog, navigate to:
tut-install/examples/web/
- Select the hello2 folder.
- Select the Open as Main Project check box.
- Expand the Source Packages node, then the servlets node.
- Double-click the GreetingServlet.java file to view it.
This servlet overrides the doGet method, implementing the GET method of HTTP. The servlet displays a simple HTML greeting form whose Submit button, like that of hello1, specifies a response page for its action. The following excerpt begins with the @WebServlet annotation that specifies the URL pattern, relative to the context root:
@WebServlet("/greeting") public class GreetingServlet extends HttpServlet { @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); response.setBufferSize(8192); PrintWriter out = response.getWriter(); // then write the data of the response out.println("" + "<title>Servlet Hello</title>"); // then write the data of the response out.println("" + "" + "<form method=\"get\">" + "
Hello, my name is Duke. What's yours?
" + "<input title=\"My name is: \"type=\"text\" name=\"username\" size=\"25\">" + "

" + "<input type=\"submit\" value=\"Submit\">" + "<input type=\"reset\" value=\"Reset\">" + "</form>"); String username = request.getParameter("username"); if (username != null && username.length() > 0) { RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/response"); if (dispatcher != null) { dispatcher.include(request, response); } } out.println(""); out.close(); } ...
- Double-click the ResponseServlet.java file to view it.
This servlet also overrides the doGet method, displaying only the response. The following excerpt begins with the @WebServlet annotation, which specifies the URL pattern, relative to the context root:
@WebServlet("/response") public class ResponseServlet extends HttpServlet { @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); // then write the data of the response String username = request.getParameter("username"); if (username != null && username.length() > 0) { out.println("
Hello, " + username + "!
"); } } ...
- Under the Web Pages node, expand the WEB-INF node and double-click the glassfish-web.xml
file to view it.
In the General tab, observe that the Context Root field is set to /hello2.
For this simple servlet application, a web.xml file is not required.
Building, Packaging, Deploying, and Running the hello2 Example
You can use either NetBeans IDE or Ant to build, package, deploy, and run the hello2 example.
To Build, Package, Deploy, and Run the hello2 Example Using NetBeans IDE
- From the File menu, choose Open Project.
- In the Open Project dialog, navigate to:
tut-install/examples/web/
- Select the hello2 folder.
- Select the Open as Main Project check box.
- Click Open Project.
- In the Projects tab, right-click the hello2 project and select Build.
- Right-click the project and select Deploy.
- In a web browser, open the URL http://localhost:8080/hello2/greeting.
The URL specifies the context root, followed by the URL pattern.
The application looks much like the hello1 application. The major difference is that after you click the Submit button, the response appears below the greeting, not on a separate page.
To Build, Package, Deploy, and Run the hello2 Example Using Ant
- In a terminal window, go to:
tut-install/examples/web/hello2/
- Type the following command:
ant
This target builds the WAR file and copies it to the tut-install/examples/web/hello2/dist/ directory.
- Type ant deploy.
Ignore the URL shown in the deploy target output.
- In a web browser, open the URL http://localhost:8080/hello2/greeting.
The URL specifies the context root, followed by the URL pattern.
The application looks much like the hello1 application. The major difference is that after you click the Submit button, the response appears below the greeting, not on a separate page.
Declaring Welcome Files
The welcome files mechanism allows you to specify a list of files that the web container will use for appending to a request for a URL (called a valid partial request) that is not mapped to a web component. For example, suppose that you define a welcome file welcome.html. When a client requests a URL such as host:port/webapp/directory, where directory is not mapped to a servlet or XHTML page, the file host:port/webapp/directory/welcome.html is returned to the client.
If a web container receives a valid partial request, the web container examines the welcome file list and appends to the partial request each welcome file in the order specified and checks whether a static resource or servlet in the WAR is mapped to that request URL. The web container then sends the request to the first resource that matches in the WAR.
If no welcome file is specified, the GlassFish Server will use a file named index.html as the default welcome file. If there is no welcome file and no file named index.html, the GlassFish Server returns a directory listing.
By convention, you specify the welcome file for a JavaServer Faces application as faces/file-name.xhtml.
Setting Context and Initialization Parameters
The web components in a web module share an object that represents their application context. You can pass initialization parameters to the context or to a web component.
To Add a Context Parameter Using NetBeans IDE
These steps apply generally to web applications, but do not apply specifically to the examples in this chapter.
- Open the project.
- Expand the project’s node in the Projects pane.
- Expand the Web Pages node and then the WEB-INF node.
- Double-click web.xml.
If the project does not have a web.xml file, follow the steps in To Create a web.xml File Using NetBeans IDE.
- Click General at the top of the editor pane.
- Expand the Context Parameters node.
- Click Add.
An Add Context Parameter dialog opens.
- In the Parameter Name field, type the name that specifies the context object.
- In the Parameter Value field, type the parameter to pass to the context object.
- Click OK.
To Create a web.xml File Using NetBeans IDE
- From the File menu, choose New File.
- In the New File wizard, select the Web category, then select Standard Deployment Descriptor under File Types.
- Click Next.
- Click Finish.
An empty web.xml file appears in web/WEB-INF/.
To Add an Initialization Parameter Using NetBeans IDE
You can use the @WebServlet annotation to specify web component initialization parameters by using the initParams attribute and the @WebInitParam annotation. For example:
@WebServlet(urlPatterns="/MyPattern", initParams= {@WebInitParam(name="ccc", value="333")})
Alternatively, you can add an initialization parameter to the web.xml file. To do this using NetBeans IDE, follow these steps.
These steps apply generally to web applications, but do not apply specifically to the examples in this chapter.
- Open the project.
- Expand the project’s node in the Projects pane.
- Expand the Web Pages node and then the WEB-INF node.
- Double-click web.xml.
If the project does not have a web.xml file, follow the steps in To Create a web.xml File Using NetBeans IDE.
- Click Servlets at the top of the editor pane.
- Click the Add button under the Initialization Parameters table.
An Add Initialization Parameter dialog opens.
- In the Parameter Name field, type the name of the parameter.
- In the Parameter Value Field, type the parameter’s value.
- Click OK.
Mapping Errors to Error Screens
When an error occurs during execution of a web application, you can have the application display a specific error screen according to the type of error. In particular, you can specify a mapping between the status code returned in an HTTP response or a Java programming language exception returned by any web component and any type of error screen.
You can have multiple error-page elements in your deployment descriptor. Each element identifies a different error that causes an error page to open. This error page can be the same for any number of error-page elements.
To Set Up Error Mapping Using NetBeans IDE
These steps apply generally to web applications, but do not apply specifically to the examples in this chapter.
- Open the project.
- Expand the project’s node in the Projects pane.
- Expand the Web Pages node and then the WEB-INF node.
- Double-click web.xml.
If the project does not have a web.xml file, follow the steps in To Create a web.xml File Using NetBeans IDE.
- Click Pages at the top of the editor pane.
- Expand the Error Pages node.
- Click Add.
The Add Error Page dialog opens.
- Click Browse to locate the page that you want to act as the error page.
- In the Error Code field, type the HTTP status code that will cause the error page to be opened, or leave the field blank to include all error codes.
- In the Exception Type field, type the exception that will cause the error
page to load.
To specify all exceptions, type java.lang.Throwable.
- Click OK.
Declaring Resource References
If your web component uses such objects as enterprise beans, data sources, or web services, you use Java EE annotations to inject these resources into your application. Annotations eliminate a lot of the boilerplate lookup code and configuration elements that previous versions of Java EE required.
Although resource injection using annotations can be more convenient for the developer, there are some restrictions on using it in web applications. First, you can inject resources only into container-managed objects, since a container must have control over the creation of a component so that it can perform the injection into a component. As a result, you cannot inject resources into such objects as simple JavaBeans components. However, JavaServer Faces managed beans are managed by the container; therefore, they can accept resource injections.
Components that can accept resource injections are listed in Table 3-1.
This section explains how to use a couple of the annotations supported by a servlet container to inject resources. Chapter 33, Running the Persistence Examples, explains how web applications use annotations supported by the Java Persistence API. Chapter 40, Getting Started Securing Web Applications, explains how to use annotations to specify information about securing web applications.
Component |
Interface/Class |
|---|---|
Servlets |
javax.servlet.Servlet |
Servlet filters |
javax.servlet.ServletFilter |
Event listeners |
javax.servlet.ServletContextListener javax.servlet.ServletContextAttributeListener javax.servlet.ServletRequestListener javax.servlet.ServletRequestAttributeListener javax.servlet.http.HttpSessionListener javax.servlet.http.HttpSessionAttributeListener javax.servlet.http.HttpSessionBindingListener |
Taglib listeners |
Same as above |
Taglib tag handlers |
javax.servlet.jsp.tagext.JspTag |
Managed beans |
Plain Old Java Objects |
Declaring a Reference to a Resource
The @Resource annotation is used to declare a reference to a resource, such as a data source, an enterprise bean, or an environment entry.
The @Resource annotation is specified on a class, a method, or a field. The container is responsible for injecting references to resources declared by the @Resource annotation and mapping it to the proper JNDI resources.
In the following example, the @Resource annotation is used to inject a data source into a component that needs to make a connection to the data source, as is done when using JDBC technology to access a relational database:
@Resource javax.sql.DataSource catalogDS; public getProductsByCategory() { // get a connection and execute the query Connection conn = catalogDS.getConnection(); ... }
The container injects this data source prior to the component’s being made available to the application. The data source JNDI mapping is inferred from the field name catalogDS and the type, javax.sql.DataSource.
If you have multiple resources that you need to inject into one component, you need to use the @Resources annotation to contain them, as shown by the following example:
@Resources ({ @Resource (name="myDB" type=java.sql.DataSource), @Resource(name="myMQ" type=javax.jms.ConnectionFactory) })
The web application examples in this tutorial use the Java Persistence API to access relational databases. This API does not require you to explicitly create a connection to a data source. Therefore, the examples do not use the @Resource annotation to inject a data source. However, this API supports the @PersistenceUnit and @PersistenceContext annotations for injecting EntityManagerFactory and EntityManager instances, respectively. Chapter 33, Running the Persistence Examples describes these annotations and the use of the Java Persistence API in web applications.
Declaring a Reference to a Web Service
The @WebServiceRef annotation provides a reference to a web service. The following example shows uses the @WebServiceRef annotation to declare a reference to a web service. WebServiceRef uses the wsdlLocation element to specify the URI of the deployed service’s WSDL file:
... import javax.xml.ws.WebServiceRef; ... public class ResponseServlet extends HTTPServlet { @WebServiceRef(wsdlLocation= "http://localhost:8080/helloservice/hello?wsdl") static HelloService service;


{{ total }} total
{{ gpm }} gold per minute
{{ reliable }} reliable
{{ networth }} networth
{{ unreliable }} unreliable


We are the best and biggest social network with 5 billion active users all around the world. Create account, create group add other users to your group and post messages
Don't have an account? Sign Up


class Radix::Node(T)
- Radix::Node(T)
- Reference
- Object
Overview
A Node represents one element in the structure of a Radix tree
Carries a payload and might also contain references to other nodes down in the organization inside children.
Each node also carries identification in relation to the kind of key it contains, which helps with characteristics of the node like named parameters or catch all kind (globbing).
Is not expected direct usage of a node but instead manipulation via
methods within Tree
.
Included Modules
- Comparable(Radix::Node(T))
Defined in:
graphlb/data_structures/radix_tree.crConstructors
-
.new(key : String, payload : T? = nil, placeholder = false)
Instantiate a Node
Instance Method Summary
-
#<=>(other : self)
Compares this node against other, returning
-1
,0
or1
depending on whether this node differentiates from other. - #children
- #children=(children)
-
#glob?
Returns
true
if the node key contains a glob parameter in it (catch all) - #key
-
#key=(key)
Changes current key
-
#named?
Returns
true
if the node key contains a named parameter in it -
#normal?
Returns
true
if the node key does not contain an special parameter (named or glob) - #payload
- #payload=(payload : T?)
- #payload?
- #placeholder?
-
#priority : Int32
Returns the priority of the Node based on it's key
Constructor Detail
Instantiate a Node
- key - A
String
that represents this node. - payload - An optional payload for this node.
When payload is not supplied, ensure the type of the node is provided instead:
# Good, node type is inferred from payload (Symbol)
node = Radix::Node.new("/", :root)
# Good, node type is now Int32 but payload is optional
node = Radix::Node(Int32).new("/")
# Error, node type cannot be inferred (compiler error)
node = Radix::Node.new("/")
Instance Method Detail
Compares this node against other, returning -1
, 0
or 1
depending
on whether this node differentiates from other.
Comparison is done combining node's kind
and #priority
. Nodes of
same kind are compared by priority. Nodes of different kind are
ranked.
Normal nodes
node1 = Radix::Node(Nil).new("a") # normal
node2 = Radix::Node(Nil).new("bc") # normal
node1 <=> node2 # => 1
Normal vs named or glob nodes
node1 = Radix::Node(Nil).new("a") # normal
node2 = Radix::Node(Nil).new(":query") # named
node3 = Radix::Node(Nil).new("*filepath") # glob
node1 <=> node2 # => -1
node1 <=> node3 # => -1
Named vs glob nodes
node1 = Radix::Node(Nil).new(":query") # named
node2 = Radix::Node(Nil).new("*filepath") # glob
node1 <=> node2 # => -1
Returns true
if the node key contains a glob parameter in it
(catch all)
node = Radix::Node(Nil).new("*filepath")
node.glob? # => true
node = Radix::Node(Nil).new("abc")
node.glob? # => false
Changes current key
node = Radix::Node(Nil).new("a")
node.key
# => "a"
node.key = "b"
node.key
# => "b"
This will also result in change of node's #priority
node = Radix::Node(Nil).new("a")
node.priority
# => 1
node.key = "abcdef"
node.priority
# => 6
Returns true
if the node key contains a named parameter in it
node = Radix::Node(Nil).new(":query")
node.named? # => true
node = Radix::Node(Nil).new("abc")
node.named? # => false
Returns true
if the node key does not contain an special parameter
(named or glob)
node = Radix::Node(Nil).new("a")
node.normal? # => true
node = Radix::Node(Nil).new(":query")
node.normal? # => false
Returns the priority of the Node based on it's key
This value will be directly associated to the key size up until a special elements is found.
Radix::Node(Nil).new("a").priority
# => 1
Radix::Node(Nil).new("abc").priority
# => 3
Radix::Node(Nil).new("/src/*filepath").priority
# => 5
Radix::Node(Nil).new("/search/:query").priority
# => 8


This project has been brought to a close and is no longer actively maintained. For more information about the history and context of this widget, please see the github documentation


Ron MacLean Addresses Viewers In First Hockey Night In Canada Without Don Cherry
by Globalnews.caIn the first intermission to air on Hockey Night in Canada without Don Cherry at his side, host Ron MacLean addressed viewers alone for almost five minutes, saying, “we are all hurting.”
“I have collapsed a hundred times this week if not more,” he said. “We’re all disappointed.”
MacLean says he has spent time “reflecting.”
“I’ve sat all week long reflecting, listening to you, and I’ve heard you — I mean you the viewer,” he said.
Before the hockey game kicked off, MacLean told viewers he planned to address his 85-year-old former co-host’s dismissal during the first intermission.
MacLean opened Saturday’s show by saying there were “obviously mixed emotions” ahead of the broadcast, calling it “the end of an era.”
The first intermission featured the 2019 Hockey Hall of Fame inductees, who are set for a Monday induction ceremony.
On Friday, Sportsnet said it is considering new directions for the long-running segment.
“We’re taking the time to explore new formats for the first intermission,” Sportsnet communications director Andrew Garas told The Canadian Press.
Cherry was fired from his job on Monday after his Nov. 9 Coach’s Corner segment, in which he appeared to say newcomers to Canada don’t wear poppies, implying they don’t support veterans.
“You people … you love our way of life, you love our milk and honey, at least you can pay a couple bucks for a poppy or something like that,” Cherry said in the televised segment.

Sportsnet said he “made divisive remarks that do not represent our values or what we stand for.”
In an interview earlier this week, Cherry didn’t apologize for his comments but said he would have chosen different words if he could do it again.
MacLean issued an apology the day after Cherry’s comments, saying he wished he had handled it differently.
Earlier on Saturday, Cherry addressed the events of the past week by thanking his supporters.
“Again, I want to thank everyone who has called emailed, dropped by the house this past week. It will take weeks to personally get back to everyone, so I am again, thanking you all now,” he tweeted.
— With files by Meghan Collie, The Canadian Press


{% extends "layouterror.html" %} {% block body %}
This site's configuration has not been set, or has one or more errors. Please try again later.
If you are this site's administrator, please consult the log for error messages. Once the configuration has been updated, restart MAH.
{% endblock %}


Just drop your course notes in our web app, and immediately get nice graphs which sum up the main concepts, the relation between them in the document, and even more ! Spend less time studying and more time having fun !
真問眼る is not only made for students, any book or website can be analyzed by our system. Get the gist of your documents at first sight without having to spend hours reading them.


A nebulae is an interstellar cloud of dust, hydrogen gas, and plasma. It is the first stage of a star's cycle. In these regions the formations of gas, dust, and other materials clump together to form larger masses, which attract further matter, and eventually will become big enough to form stars. The remaining materials are then believed to form planets and other planetary system objects. Many nebulae form from the gravitational collapse of diffused gas in the interstellar medium or ISM. As the material collapses under its own weight, massive stars may form in the center, and their ultraviolet radiation ionizes the surrounding gas, making it visible at optical wavelengths.