Interactive test of server.
Signup
Email
Password
First Name
Last Name
Signup Now
Login
Email
Password
Login
Chagne Name for Logged In User
First Name
Last Name
Change Name
Other Actions
Get List of Users
Logout
Show Auth Token
Clear Output
Output
Modal title
×
xyzzy - Modal body text goes here.


Created by Froilan Miranda
Both databases and spreadsheets store data in rows and columns. Both can calculate new data based on existing data. And both can allow more than one person to view and change data.
In a spreadsheet, data is stored in a cell. A cell can have raw data, like the number one or the string hello. A cell can also have a calculation. And that calculation can be standalone, or it can refer to other cells. A cell also contains formatting information like the font size or highlighting. You can format the type of data you intend to see in a cell, like specifying that the numbers have two decimal places.
You can manipulate the data in a spreadsheet by visually moving or sorting the data. A database on the other hand, stores data in a record. And only stores values. Unlike a spreadsheet, formatting information like font size, highlighting, and even sort order are not stored in a database record. Usually that information is completely separate. Part of a program that displays the data, including sorting. By separating the data from the formatting, databases allow you to manipulate data without worrying that you are changing the underlying data.
In a spreadsheet, everything you do results in data. If you do a calculation involving one cell, that calculation lives in another cell. In a database, you can do a calculation on a record and just show the calculation result without adding more data to the database. One of the biggest benefits of a database is that you can eliminate duplicate information.
databases are more efficient at storing data. Changing data is easier and less error prone in a database. Spreadsheets are great for ledger type activities and lists, like showing bank transactions and calculating an account balance They are also good for creating charts and graphs of data. Databases are good for storing lots of information. Where you can specify that the data is a certain type. Databases separate the data from how it is displayed. Which can eliminate duplicate information and reduce data errors.
Databases are also good at allowing more than one person at a time to look at and change the data without disturbing each other.
Both can be manipulated to show information in a new form without changing the original data.
Both allow you to extract data out of certain fields. And both have powerful matching and filtering capabilities.
A text file allows you to put anything into it. We can put a string, like Hello There, or we can put a number like 172, and our program won't complain, even if it's supposed to be the field for a date.
A database will separate the fields for us, a text file does not. We have to enforce a structure if we want our text file to work in a certain way. Like a spreadsheet, text editors have display information stored with the data itself. Text editors are very good for writing text, laying out text on a page, and moving text around.
They are designed for storing, viewing, and changing documents that consist mostly of text. A text file is sometimes called a flat file especially when comparing to a relational database. This is because a relational database is built to highlight how some data relates to other data. Flat files are great for writing and editing text. They are also good for moving lots of text around. Databases are good for storing information that you want to be a certain type. Databases separate the data from how it is displayed which can eliminate duplicate information and reduce data errors.
The objective is to isolate data so that additions, deletions and modifications of a field can be made in just one table, and then propagated through the rest of the database using the defined relationships.
SHOW DATABASES;
SHOW TABLES FROM information_schema;
USE information_schema;
SHOW TABLES;
USE information_schema;
SHOW COLUMNS FROM SCHEMATA;
USE mysql;
SHOW COLUMNS FROM information_schema.SCHEMATA;
help SHOW;
Text Sizes - Bigger capacity = more overhead https://dev.mysql.com/doc/refman/5.6/en/storage-requirements.html
Remove files from the index, or from the working tree and the index.
//Remove files from the index
git rm <file>
//Remove files from the index
git rm --cached <file>
This command displays committed snapshots. It lets you list the project history, filter it, and search for specific changes.
 In this module, we’re only concerned with the second & third configurations.
//Update working directory to match the specified commit.
git checkout <commit>
//Update working directory to match the specified branch
git checkout <branch-name>
Remove files from the index, or from the working tree and the index.
//Remove files from the index
git rm <file>
//Remove files from the index
git rm --cached <file>
Existing branches are listed; the current branch will be highlighted with an asterisk.
//List all of the branches in your repository.
git branch
//Create a new branch called <branch>.
//This does not check out the new branch.
git branch <branch-name>
//Delete the specified branch.
git branch -d <branch-name>
//Rename the current branch
git branch -m <branch-name>
Join two or more development histories together
//Merge the specified branch into the current branch.
//Git will determine the merge algorithm automatically
git merge <branch-name>
.md is markdown. README.md is used to generate the html summary you see at the bottom of projects. Github has their own flavor of Markdown.
Specifies intentionally untracked files to ignore
SSH keys are a way to identify trusted computers without involving passwords. You can generate an SSH key and add the public key to your GitHub account by following the procedures outlined in this section.
Clone a repository into a new directory
//Clone the repository located at <repo> onto the local machine.
git clone <repo>
//Clone the repository located at <repo> into the folder
//called <directory> on the local machine.
git clone <repo> <directory>
Updates remote refs using local refs, while sending objects necessary to complete the given refs.
//Push the specified branch to <remote>,
//along with all of the necessary commits and internal objects.
git push <remote> <branch>
Download objects and refs from another repository
//Fetch all of the branches from the repository.
git fetch <remote>
Incorporates changes from a remote repository into the current branch.
//Fetch the specified remote’s copy of the current branch and
//immediately merge it into the local copy.
git pull <branch-name>
//Git manual
git help
git help <command>


Hi.
I've seen here (http://openenergymonitor.org/emon/buildingblocks/how-to-build-an-arduino-energy-monitor) and other places on this forum that it is fairly simple to build the circuitry to hook a CT sensor to the arduino.
There is one thing that is causing me doubts: I see almost everywhere references about the burden resistor of 22Ohm when 3.3V supply voltage is used, but when I analyzed the EmonPi circuitry I can see two 22Ohm in parallel (R17/R22 or R26/R28) that would result in 11Ohm burden.
Can this be some kind of option between two different types of resistors that in the build moment only one is applied?
In this circuit what are the necessary changes to modify the supply voltage from 3.3V to 5V and keep the same calibration values inside the EmonPi Firmware?
Cheers.
Re: EmonPi aditional CT sensor
You are right. If you look at the PCB Layout, you will see one is a SMT component and the other is wire-ended. If you look inside your emonPi, you will find the wire-ended component is not fitted.
Calibration is not affected, provided that you use the correct preprocessor directive inside your sketch. Details are in emonLib in the comments.
If you are feeding the top of R27 with 5 V, then very obviously R25 and R27 can no longer be equal, and you must change the value of one so that the voltage at their common junction is as close to 1.65 V (i.e. the mid-point of the 3.3 V ADC input range) as possible. That does not of course affect calibration.
Re: EmonPi aditional CT sensor
Thank you for the clarification.
I don't have easy access to my EmonPi board side because it is installed under the Raspberry and fixed to the plastic box where I have the material.
Regarding to the changes need for 5V supply I read the information you already gave me
You advised me to change the value of R27, but the result is a hard to find resistor value.
I have read else where that we can change R25 and R27 to a good range of values that shell be equal for the 3.3V supply, but maybe we can change both (R25 and R27) to easy to find values as long we have a ratio of 1.65V and 3.35V to make the correct voltage divider...
Later I will do some math on this.
Cheers.
Re: EmonPi aditional CT sensor
You can use resistors in series or in parallel. There are many ways to 'play the numbers' and it is possible that you will find a combination that comes close, and that is because the resistor values are rounded from their theoretical values, which are 12 or 24 equal steps by ratio per decade.
Look at the picture of the Pi or an emonTx, or an emonTx Shield, for the burden. All do it similarly.
Re: EmonPi aditional CT sensor
Hi.
I think I will change my approach to this situation, the values are not easy to match, the best pair I could find was 787 / 390 and even this not very good.
Then I started to think that if I connect this to the +5V rail (at the RJ45 port) I will certainly get power fluctuations because this output is a direct connection to the USB input while if I get the 3.3V from the EmonPi I can have the same reference voltage for all the CTs and don't have any trouble with the resistor values. I think a good source may be the ISP1 connector that I don't remember being connected to anything.
Cheers.


Menu
Legacy Cocktail
One Should Not Drink On An Empty Stomach
Special & Event
Promotion
Share Too
Zero Alcohol
One Should Not DrinkOn An Empty Stomach
Dressert of The Day 290
Mussel Mania 750
Bites
Event
Social


93; 12022 H.E.
Update: hi, this page got a little traction on HackerNews. I want to note that there are formats that are meant to supersede WebP, such as AVIF and JPEG XL, however, AVIF (69.25%) and JPEG XL (0%) are not as nearly adopted as WebP is (91.38%). Usage taken on April 13th, 2022. Also, get a browser released after 2013.
I have been toying around with WebP for a couple of weeks now. Convert this image into webp and try to use it instead of traditional png. It was pretty crazy for me to see an up to 10x image size reduction, yet very little to no visual difference with a naked human eye.
Some further reading led me to some pleasant discoveries, such as lossy and lossless compression, transparency with an alpha channel, metadata, animation (!) support, and a wide adoption by major browsers and graphics software over the past decade or so.
This is truly some state-of-the-art stuff. Even as claiming an average of 45% reduction in file size with wild PNGs found on the web and a 28% reduction compared to PNGs that are recompressed with pngcrush and PNGOUT. I I should try this now!
The process of moving from PNG to WebP was painless. I rigged a quick find
and sed
script to go through all my directories and convert images with ImageMagick. Another quick regex to find corresponding file links and references in org files, and replace them with anew webp format. It all took no more than 15 to 20 minutes. I talked to Darkness to support variable preview files aaaannd push!
Wow, it just works. Even GitHub Pages deploys it in about halftime now. Let me see if we got any file size gains. I’ll archive the whole website into two tar files: before and after webp changes (.git
of course excluded).
sandyuraz:source* λ ls -lh *.tar
-rw-r--r-- 1 thecsw staff 279M Apr 3 15:33 png.tar
-rw-r--r-- 1 thecsw staff 108M Apr 3 15:33 webp.tar
This is very nice. It’s less than half of what it was before! Going through some of the pages, even my eye can’t spot any differences that would be noticeable. WebP is good for all the stuff on the web. Choose your image formats based on your needs and requirements. For now, WebP looks like a great alternative. Thank you!
Let’s try to grab a picture in PNG format, convert it to WebP and see how the file size and image quality differ between those two. I’ll have both examples from an amazing photographer @shnimohus, whose shots I adore.
Below is the ImageMagick version I will be using when simply running convert source.png target.webp
Version: ImageMagick 7.1.0-29 Q16-HDRI x86_64 19841 https://imagemagick.org
Copyright: (C) 1999 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(5.0)
Delegates (built-in): bzlib fontconfig freetype gslib heic jng jp2 jpeg lcms lqr ltdl lzma openexr png ps tiff webp xml zlib
Compiler: gcc (4.2)
Let’s see an example!
Here is a shot of a bus stop in PNG, weighing at around 2.4MB
As a comparison, here is the WebP generated from it, which is only about 258KB
For the sake of the experiment, try to dowload both files and see if you can spot any differences.
Here is one more example!
With its counterpart generated with convert town.png town.webp
Is this experiment biased? Definitely. I could have used some PNG compression techniques, go through ImageMagick’s documentation to fine-tune the conversion. However, the big point here is that without doing any of that, WebP seems to keep the quality I prefer while also reducing the size (doesn’t matter to me whether it’s lossy or lossless).
Thank you! ◼


Founder
Designer
Ashley Langan
VICE
Enterprise
A result of the transformation of Foursquare from a primarily comsumer company, to an enterprise providing services for all kinds of businesses. The task was to design and build a site which reflected these changes and signaled a new more mature era for the company.UX
Visual Designer
Illustrator
Front End Dev
Feibi McIntosh
Victor Chen
Developer
A site for developers to learn about the tools Foursquare makes available to them and how to best use them.UX/UI
Visual Designer
Illustrator
Feibi McIntosh
Nathan Yuen
Brand Shops
Direct to consumer liquor sales are prohibited in the U.S., however by connecting costumers directly to retailers who carry the bottles they seek, we were able to streamline the path to purchase. By creating specific shops withing caskers, brands could now control their story and better understand their patrons.UX/UI
Visual Designer
Illustrator
Front End Dev
WhistlePig
UX/UI
Visual Designer
Illustrator


Take back your future in watchdog: legion, London is facing its downfall in the near future...Unless you can turn it around. Organize a rebellion against the opportunists in power, but sit down and have a cup of tea first. After all, you're not a goddamn monster.。
Still wondering where to find your own army? How about recruiting everywhere?Every Londoner has a reason to fight back. Z plays any role -- including taxi driver, Ex-spy, frustrated boxer, smooth lawyer , snarling, grumpy grannies, anyone.
London fell into a nightmare of tyranny But there is still a chance to sound the alarm.Rally the rebels Use the city's technology and firepower against those behind it.
learn more learn moreExplore detailed online content in collaboration mode with your real friends, Quests and exciting side activities like: mugless boxing, Fancy football, smuggling and street art.
learn more learn moreWhen London fell, opportunists knew exactly how to seize power. They are managers now, and you should make sure they don't stay in the top job for long. Organized crime
When society falls apart, criminals sense opportunity. We're not talking about ordinary guns, Drugs, prostitution, Someone should do something about these things...
Technology does wonders for society, doesn't it? Automation replacing workers and cryptocurrencies destabilising markets And 24/7 surveillance. Isn't that great ? Class and machine boundaries.It's a perfect fit..."Living "The good times.
That's easy. There's a private military company promising to protect it Our safety.Most of us are willing to give up Personal freedom in exchange for a false sense of security.perfect Trade! Surely there is no ulterior motive...
In this chaotic situation, society needs a stir The power of anyway.The good news is that there are forces working hard To return London to the people.You may listen to Said they, maybe you don't, When they call, you pick up the phone.
Every Londoner has a reason to fight back.Everyone you meet -- from taxi drivers, The ex-spy, the frustrated boxer, the smooth-talking lawyer, the angry old cow -- all have their own stories, Character and skills.Choose carefully. Their lives are in your hands.
Do you want to build a classic British spy corps?
Do you want to build a classic British spy corps?  All Rights Reserved. Ubisoft, ubi.com, and the Ubisoft logo are trademarks of Ubisoft Entertainment in the U.S. and/or other countries.
沪ICP备 10013909号


Menu
Add new federated identity
Add new certificate
This site will not work correctly because your browser is blocking JavaScript. Please enable JavaScript and reload page.


In case you need to access Luntbuild directly, Luntclipse offers web browser that connects to current luntbuild connection:


Top: Multithreading: Atomic functions, utilities
#include <pasync.h> int pexchange(int* target, int value); void* pexchange(void** target, void* value); int pincrement(int* target); int pdecrement(int* target); template <class T> T* tpexchange(T** target, T* value); void psleep(unsigned milliseconds); pthread_id_t pthrself(); bool pthrequal(pthread_id_t id);
The atomic functions pexchange(), pincrement() and pdecrement() can be used in place of mutex locking in some simple situations. A typical usage of pexchange() in a multithreaded environment could be, for example, freeing a dynamic object and assigning NULL to the pointer atomically to prevent concurrent threads from freeing the same object more than once.
It is sometimes necessary to increment or decrement some shared counter and atomically compare it with some value. For example, you have a shared resource and you keep track of its usage by maintaining a reference counter. When this counter reaches 0 you want to free the shared resource. To avoid conflicts between concurrent threads you need to decrement the counter and atomically compare it with 0. In this situation you can use pdecrement() instead of time-consuming mutex locking. (For additional notes, see Portability and performance issues.)
int pexchange(int* target, int value) -- atomically exchanges two int values.
void* pexchange(void** target, void* value) -- atomically exchanges two pointers.
int pincrement(int* target) -- atomically increments the value of *target and returns the new value.
int pdecrement(int* target) -- atomically decrements the value of *target and returns the new value.
template <class T> T* tpexchange(T** target, T* value) -- is equivalent to pexchange() that adds compile-time type checking. Use this template to check the correspondence of pointer types of target and the returning value.
void psleep(unsigned milliseconds) -- suspends execution for the specified amount of time in milliseconds.
pthread_id_t pthrself() -- returns the thread ID of the calling thread.
bool pthrequal(pthread_id_t id) -- checks whether the calling thread has the given thread id.
See also: semaphore, mutex, thread


class: center, middle, inverse, title-slide # 4.2 — An Economic Model of Precaution ## ECON 315 • Economics of the Law • Spring 2021 ### Ryan Safner
Assistant Professor of Economics
<EMAIL_ADDRESS>ryansafner/lawS21
lawS21.classes.ryansafner.com
--- class: inverse # Outline ### [Precaution: An Economic Model](#3) ### [No Liability](#) ### [Strict Liability](#) ### [Negligence](#) ### [A Family of Negligence Rules](#) ### [Comparing Negligence Rules, A Discrete Example of Bilateral Caution](#) --- class: inverse, center, middle # Precaution: An Economic Model --- # Precaution .pull-left[ .smallest[ - As usual, our main concern is with the incentives these various liability rules create - For torts, focus on parties' incentive to invest in (costly) precaution to avoid accidents - Driving/bicyling carefully, installing seatbelts, airbags, wearing helmets, etc. - Inspecting products carefully, quality control, independent audits, mandatory work breaks - All of these things are **costly** to parties, so there must be some **efficient** level ] ] .pull-right[ .center[ ![](../images/caution.jpg) ] ] --- # Precaution .smallest[ - Actions by both injurer and victim impact the number of accidents .pull-left[ - Speed like hell, drive drunk, texting - Bicycle in the dark wearing black, no helmet - Manufacture cheap, shoddy product quickly ] .pull-right[ - Drive slowly and soberly - Bicycle wearing helmet and reflectors - Manufacture slow, quality controlled & inspected product ] ] .center[ ![:scale 75%](../images/precautionspectrum.png) ] -- .smallest[ - .hi[Precaution]: any activity either party can do to reduce probability of an accident (or severity of damage) - .hi-purple[How much precaution is efficient?] - .hi-purple[How do we design the law to get this amount?] ] --- # A Simple Economic Model of Accidents .pull-left[ .smallest[ - Our main example was a car hitting a bicyclist, in real life: - Driver probably has insurance - Some damage to bicycle and to driver’s car - Driver and bicyclist may not even know what the law is - We will simplify a lot by assuming: - Only one party is harmed - Parties know the law - Parties don’t have any insurance (for now) - Focus only on one party’s precaution at a time ] ] .pull-right[ .center[ ![](../images/car-bike-crash.jpg) ] ] --- # A Unilateral Care Model .pull-left[ - Unilateral harm (just one victim) - .hi[Precaution]: costly actions that make accident less likely - Could be taken by either .blue[victim] or .red[injurer] - We'll consider both, but one at a time .center[ ![](../images/precautiontime.png) ] ] --- # A Unilateral Care Model: Definitions/Notation .pull-left[ .smallest[ - `\(x\)`: amount of precaution taken - `\(w\)`: cost of each “unit” or precaution - total cost of precaution is `\(wx\)` - `\(p(x)\)`: probability of an accident, given level of `\(x\)` - `\(\frac{\partial p(x)}{\partial x} < 0\)` - `\(A\)`: cost of accident (to victim) - expected cost of accidents is `\(p(x)A\)` - When we examine .red[injurer] we will use `\(x\)`, when we examine .blue[victim] we will use `\(y\)` - Your textbook uses `\(x^i\)` and `\(x^v\)` ] ] .pull-right[ .center[ ![](../images/caution.jpg) ] ] --- # A Unilateral Care Model .pull-left[ - .green[Cost of precaution, `\\(wx\\)`] ] .pull-right[  ] --- # A Unilateral Care Model .pull-left[ - .green[Cost of precaution, `\\(wx\\)`] - .red[Cost of accidents, `\\(p(x)A\\)`] ] .pull-right[  ] --- # A Unilateral Care Model .pull-left[ - .green[Cost of precaution, `\\(wx\\)`] - .red[Cost of accidents, `\\(p(x)A\\)`] - .blue[Total Social Cost `\\(p(x)A+wx\\)`] ] .pull-right[  ] --- # A Unilateral Care Model .pull-left[ - .green[Cost of precaution, `\\(wx\\)`] - .red[Cost of accidents, `\\(p(x)A\\)`] - .blue[Total Social Cost `\\(p(x)A+wx\\)`] - Efficient level of precaution: `$$\min_{x} \ color{blue}{p(x)A+wx}$$` ] .pull-right[  ] --- # A Unilateral Care Model .pull-left[ - .green[Cost of precaution, `\\(wx\\)`] - .red[Cost of accidents, `\\(p(x)A\\)`] - .blue[Total Social Cost `\\(p(x)A+wx\\)`] - Efficient level of precaution: `$$\min_{x} \color{blue}{p(x)A+wx}$$` - Optimum `\(x^\star\)`: .smallest[ `$$\begin{align*} \color{green}{w} &= \color{red}{-p’(x)A}\\ \color{green}{\text{MSC of precaution}} &= \color{red}{\text{MSB of precaution}}\\ \end{align*}$$` ] ] .pull-right[  ] --- # A Unilateral Care Model .pull-left[ - The efficient level of precaution, `\(x^\star\)` minimizes .blue[total social cost] - Balances the tradeoff between the .red[benefit of reduced accident likelihood] and the .green[cost of increased precaution] ] .pull-right[  ] --- # A Unilateral Care Model: Technical Note .pull-left[ .smallest[ - We are thinking of bilateral precaution, just “one party at a time”; again: - `\(x\)` represent level of precaution by .red[injurer] - `\(y\)` represent level of precaution by .blue[victim] - Really, the social problem between both parties: `$$\min_{x,y} p(x,y)A-wx-wy$$` ] ] .pull-right[  ] --- # A Unilateral Care Model: Technical Note .pull-left[ .smallest[ - “Hold fixed” one party’s solution and consider the other, e.g. `$$\min_x p(x,y)A-wx-wy \quad \text{ given y}$$` which has same solution as `$$\min_x p(x)A-wx$$` - Results will generally be efficient *given* what the other party is doing ] ] .pull-right[  ] --- # Effect of Liability Rules on Precaution .pull-left[ - We know the **efficient** level of precaution is `\(x^\star\)`, which minimizes total social cost - Now let’s consider the effect of .hi-turquoise[different liability rules] have on the **chosen** amount of precaution ] .pull-right[ .center[ ![](../images/caution.jpg) ] ] --- class: inverse, center, middle # No Liability --- # No Liability .pull-left[ .smallest[ - Imagine a world of .hi[no liability] (NL) - .red[Injurer] pays nothing for accidents - Bears the .green[cost] of his precaution - But no .red[benefit] (of avoided damages) - **Has no incentive to take any precaution** - .blue[Victim] bears cost of any accidents, plus cost of her precaution taken - .blue[Victim] precaution imposes no externality on .red[Injurer] - .blue[Victim] will invest in efficient amount of precaution `\(y^\star\)` ] ] .pull-right[ .center[ ![](../images/norules.jpg) ] ] --- # No Liability .pull-left[ - .red[Injurer]'s private costs: `\(\color{green}{wx}\)` `$$\min_{x} \color{green}{wx} \implies x_{NL}=0$$` ] .pull-right[  ] --- # No Liability .pull-left[ - .red[Injurer]'s private costs: `\(\color{green}{wx}\)` `$$\min_{x} \color{green}{wx} \implies x_{NL}=0$$` - .blue[Victim]'s private costs: `\(\color{blue}{p(y)A+wy}\)` `$$\min_{y} \color{blue}{p(y)A+wy} \implies y_{NL}=y^\star$$` - chooses efficient precaution - Rule of .hi[no liability] leads to: - efficient precaution by .blue[Victims] - no precaution by .red[Injurers] ] .pull-right[  ] --- # Comparing Incentives Under Different Liability Rules | Rule | .red[Injurer] Precaution | .blue[Victim] Precaution | |------|---------|--------| | No liability | Zero | .green[Efficient] | --- # Determining Accidents .pull-left[ - Precaution isn't the only thing that affects the number of accidents - Precautions are extra actions that make our activity less dangerous - Also the .hi-purple[amount of activities] we do affects the number of accidents - I decide how often to drive - You decide how often to bike - Liability rules also create incentives for .hi-purple[activity levels] ] .pull-right[ .center[ ![](../images/groupride.jpg) ] ] --- # Determining Accidents: No Liability .pull-left[ - With .hi[no liability], I am not liable if I hit you - I don't consider cost of accident when I decide **how fast** to drive - nor when I decide **how much** to drive - .hi-purple[So I drive too recklessly *and* too often] - My driving imposes a negative externality on others - With no liability, .red[Injurer]'s activity level is inefficiently high ] .pull-right[ .center[ ![](../images/Careless-Driving.jpg) ] ] --- # Determining Accidents: No Liability .pull-left[ - With .i[no liability], you bear the full cost of an accident - More activity by victim (bicycling) leads to more accidents - You weigh cost of accidents when deciding **how carefully** to ride, and **how much** to ride - Your private cost equals the social cost - .hi-purple[You take the efficient level of precaution, and efficient level of activity] ] .pull-right[ .center[ ![](../images/bikesafety.jpg) ] ] --- # Comparing Incentives Under Different Liability Rules | Rule | .red[Injurer] Precaution | .blue[Victim] Precaution | .red[Injurer] Activity | .blue[Victim] Activity | |------|---------|--------|-----|-----| | No liability | Zero | .green[Efficient] | Too High | .green[Efficient] --- class: inverse, center, middle # Strict Liability --- # Strict Liability .pull-left[ .smallest[ - Imagine a world of .hi[strict liability] (SL) with perfect compensation - `\(D=A\)` damages equal to the cost of the accident - .red[Injurer] pays for any accidents he causes - Bears the full .red[cost of accidents] plus his .green[precautions] taken - Receives .red[benefit] (of avoided damages) - Internalizes externality his actions cause, chooses the efficient level of precaution - .blue[Victim] is fully insured - Has **no incentive** to invest in any precaution ] ] .pull-right[ .center[ ![](../images/strict-liability.jpg) ] ] --- # Strict Liability .pull-left[ - .red[Injurer]'s private costs: `\(\color{blue}{p(x)A+wx}\)` `$$\min_{x} \color{blue}{p(x)A+wx} \implies x_{SL}=x^\star$$` - chooses efficient precaution ] .pull-right[  ] --- # Strict Liability .pull-left[ - .red[Injurer]'s private costs: `\(\color{blue}{p(x)A+wx}\)` `$$\min_{x} \color{blue}{p(x)A+wx} \implies x_{SL}=x^\star$$` - chooses efficient precaution - .blue[Victim]'s private costs: `\(\color{green}{wy}\)` `$$\min_{y} \color{green}{wy} \implies y_{SL}=0$$` - Rule of .hi[strict liability] leads to: - efficient precaution by .red[Injurers] - no precaution by .blue[Victims] ] .pull-right[  ] --- # Comparing Incentives Under Different Liability Rules | Rule | .red[Injurer] Precaution | .blue[Victim] Precaution | |------|---------|--------| | No liability | Zero | .green[Efficient] | | Strict liability | .green[Efficient] | Zero | --- # Strict Liability: Activity Levels .pull-left[ .smallest[ - Under strict liability, .red[injurer] internalizes cost of accidents - Weighs benefit from driving against cost of accidents - Takes **efficient** activity level - Under strict liability, .blue[victim] does not bear cost of accidents - Ignores cost of accidents when deciding how much to bicycle - Takes **inefficiently high** activity level - .hi-purple[Strict liability leads to **efficient** level of injurer activity, **inefficiently high** level of victim activity] ] ] .pull-right[ .center[ ![](../images/groupride.jpg) ] ] --- # Comparing Incentives Under Different Liability Rules | Rule | .red[Injurer] Precaution | .blue[Victim] Precaution | .red[Injurer] Activity | .blue[Victim] Activity | |------|---------|--------|-----|-----| | No liability | Zero | .green[Efficient] | Too High | .green[Efficient] | | Strict liability | .green[Efficient] | Zero | .green[Efficient] | Too High | --- # Comparing Incentives Under Different Liability Rules .pull-left[ .smallest[ - So for both precaution & activity level: - .hi[No liability] leads to **inefficient** behavior by .red[injurer], **efficient** behavior by .blue[victim] - .hi[Strict liability] leads to **efficient** behavior by .red[injurer], **inefficient** behavior by .blue[victim] - Like the .hi-purple[paradox of compensation] from contract law! - One rule sets multiple incentives...we can't get them all right - ...or can we? Tort law has this One Weird TrickTM ] ] .pull-right[ .center[ ![](../images/moneysignal.jpg) ] ] --- class: inverse, center, middle # Negligence --- # Negligence .pull-left[ - .hi[Negligence rule]: .red[Injurer] is only liable **if he breached his duty of due care** - Put alternatively, liable only if accident is “his fault” - Within our model: - Legal standard of care `\(x^l\)` - .red[Injurer] owes damages if `\(x < x^l\)` - If `\(x<x^l \rightarrow D=A\)` - If `\(x \geq x^l \rightarrow D=0\)` ] .pull-right[ .center[ ![](../images/fault.jpg) ] ] --- # Negligence .pull-left[ - Private cost to .red[injurer] is: ] .pull-right[  ] --- # Negligence .pull-left[ - Private cost to .red[injurer] is: `$$\begin{cases} p(x)A+wx && \text{if } x<x^l\\ \end{cases}$$` ] .pull-right[  ] --- # Negligence .pull-left[ - Private cost to .red[injurer] is: `$$\begin{cases} p(x)A+wx && \text{if } x<x^l\\ wx && \text{if } x \geq x^l\\ \end{cases}$$` ] .pull-right[  ] --- # Negligence .pull-left[ - Private cost to .red[injurer] is: `$$\begin{cases} p(x)A+wx && \text{if } x<x^l\\ wx && \text{if } x \geq x^l\\ \end{cases}$$` - If standard of care `\(x^l\)` is set to `\(x^\star\)`, .red[injurer] minimizes private cost by taking efficient caution ] .pull-right[  ] --- # Negligence: Injurer Precaution .pull-left[ - What about .blue[victim]'s incentives? - We saw .red[injurer] will exercise due care and *not* be liable! - .blue[Victim] now bears cost of any accidents! (.hi-purple[residual risk]) - Private cost to .blue[victim] is: `\(\color{blue}{p(y)A+wy}\)` - .blue[Victim] chooses `\(y^\star\)`, efficient precaution too! ] .pull-right[  ] --- # Comparing Incentives Under Different Liability Rules | Rule | .red[Injurer] Precaution | .blue[Victim] Precaution | .red[Injurer] Activity | .blue[Victim] Activity | |------|---------|--------|-----|-----| | No liability | Zero | .green[Efficient] | Too High | .green[Efficient] | | Strict liability | .green[Efficient] | Zero | .green[Efficient] | Too High | | Negligence.magenta[†] | .green[Efficient] | .green[Efficient] | | | .footnote[.magenta[†] Assuming standard of care is set at the efficient level `\\((x^l=x^*)\\)`] --- class: inverse, center, middle # A Family of Negligence Rules --- # Other Negligence Rules .pull-left[ - The rule we just considered is “simple” negligence - Only consider .red[injurer]'s actions in determining liability - But in deciding whether .red[injurer] should be liable, we could also consider whether the .blue[victim] was negligent ] .pull-right[ .center[ ![](../images/spidermannegligence.jpg) ] ] --- # Contributory Negligence: Butterfield v. Forrester .pull-left[ .smallest[ - *Butterfield v. Forrester*, 11 East. 60, 103 Eng. Rep. 926 (K.B. 1809) - Forrester (Defendent) placed a pole in road next to his house while making repairs - Butterfield (Plaintiff) was riding at high speed at night, hit the pole, fell off his horse, sued for damages - Witness said that if Forrester had not been riding fast, would have seen the pole - Jury ruled Plaintiff should not be able to collect damages from Plaintiff due to their own .hi[contributory negligence] ] ] .pull-right[ .center[ ![:scale 100%](../images/court1.jpg) ] .smallest[ > “One person being in fault will not dispense with another’s using ordinary care for himself.” ] ] --- # Injurer & Victim Negligence .pull-left[ - Let’s compare the whole family of negligence rules - .red[Injurer] is **negligent/at fault** when they fail to take due care, `\(x<x^*\)`.magenta[†] - .blue[Victim] is **negligent/at fault** when they fail to take due care, `\(y<y^*\)`.magenta[†] - Now let’s consider who is **liable** for the accident under various negligence rules .tiny[.magenta[†] Assuming standards of care are set at the efficient levels `\\(x^l=x^\star\\)` and `\\(y^l=y^\star\\)`] ] .pull-right[  ] --- # Simple Negligence .pull-left[ - **Simple negligence**: - .red[Injurer] is liable if they do not take due care `\(x<x^*\)` - .red[Injurer] is *not* liable if they *do* take due care `\(x \geq x^*\)` - .blue[Victim] cannot collect damages for any accident ] .pull-right[  ] --- # Negligence With a Defense of Contributory Negligence .pull-left[ - **Negligence with a defense of Contributory Negligence**: - .red[Injurer] is liable if they do not take due care `\(x<x^*\)` - .red[Injurer] is *not* liable if .blue[Victim] does not take due care `\(y<y^*\)` ] .pull-right[  ] --- # Comparative Negligence .pull-left[ - **Comparative Negligence**: if both parties are negligent, they share the cost of the accident (possibly proportionately) - e.g. if accident cause was 70% .red[injurer]’s fault, 30% .blue[victim]’s fault, .red[injurer] pays for 70% of damages ] .pull-right[  ] --- # Strict liability with Contributory Negligence .pull-left[ - **Strict liability with defense of Contributory Negligence**: - .red[Injurer] is liable (regardless of their level of precaution `\(x)\)` *unless* .blue[Victim] does not take due care `\(y<y^*\)` ] .pull-right[  ] --- # Family of Negligence Rules .pull-left[   ] .pull-right[   ] -- .smallest[ - These rules differ only in distribution of income - .hi-purple[Any of these rules (with efficient standard of care) incentivize efficient precaution by both parties!] `\((\color{blue}{x^\star}, \color{red}{y^\star})\)` ] --- class: inverse, center, middle # Comparing Negligence Rules, A Discrete Example of Bilateral Caution --- # Discrete Example of Bilateral Precaution .pull-left[ .smallest[ - Let's compare with a discrete example - Each party .red[Injurer] and .blue[Victim] can either take **precaution** or **not** - Precaution costs each party $20 - Each accident costs $1,000 in harm - Chance of accident is: - 10% if nobody takes precaution - 6% if one party takes precaution - 2% if both parties take precaution - Note: precaution is efficient for each party: costs $20; reduces expected damage by 0.04($1,000) = $40 ] ] .pull-right[ .center[ ![](../images/caution.jpg) ] .quitesmall[ A: $1,000 w: $20 (each party) p: 10% (neither), 6% (one careful), 2% (both) ] ] --- # Discrete Example of Bilateral Precaution .pull-left[ .smallest[ - Consider rule of **negligence with defense of contributory negligence** - .red[Injurer] is liable if he failed to take precaution...unless .blue[blue] victim failed too ] ] .pull-right[ .center[ ![](../images/negligencegame1.png) ] .quitesmall[ A: $1,000 w: $20 (each party) p: 10% (neither), 6% (one careful), 2% (both) ] ] --- # Discrete Example of Bilateral Precaution .pull-left[ .smallest[ - Consider rule of **negligence with defense of contributory negligence** - .red[Injurer] is liable if he failed to take precaution...unless .blue[blue] victim failed too - Notice .blue[Victim]'s dominant strategy is **Precaution** - If .red[Injurer] not taking precaution, .blue[victim] wants to avoid liability - If .red[Injurer] takes precaution, .blue[victim] bears residual risk, wants to minimize accidents ] ] .pull-right[ .center[ ![](../images/negligencegame2.png) ] .quitesmall[ A: $1,000 w: $20 (each party) p: 10% (neither), 6% (one careful), 2% (both) ] ] --- # Discrete Example of Bilateral Precaution .pull-left[ .smallest[ - Consider rule of **negligence with defense of contributory negligence** - .red[Injurer] is liable if he failed to take precaution...unless .blue[blue] victim failed too - Notice .blue[Victim]'s dominant strategy is **Precaution** - If .red[Injurer] not taking precaution, .blue[victim] wants to avoid liability - If .red[Injurer] takes precaution, .blue[victim] bears residual risk, wants to minimize accidents - For .red[Injurer], best response to .blue[Victim]'s precaution is precaution - .hi-purple[Nash Eq.]: (.red[Precaution], .blue[precaution]), efficient! ] ] .pull-right[ .center[ ![](../images/negligencegame3.png) ] .quitesmall[ A: $1,000 w: $20 (each party) p: 10% (neither), 6% (one careful), 2% (both) ] ] --- # Discrete Example of Bilateral Precaution .pull-left[ .smallest[ - Consider rule of **comparative negligence**, cost of accident divided proportionately ] ] .pull-right[ .center[ ![](../images/negligencegame4.png) ] .quitesmall[ A: $1,000 w: $20 (each party) p: 10% (neither), 6% (one careful), 2% (both) ] ] --- # Discrete Example of Bilateral Precaution .pull-left[ .smallest[ - Consider rule of **comparative negligence**, cost of accident divided proportionately - Notice .blue[Victim]'s dominant strategy is **Precaution** ] ] .pull-right[ .center[ ![](../images/negligencegame5.png) ] .quitesmall[ A: $1,000 w: $20 (each party) p: 10% (neither), 6% (one careful), 2% (both) ] ] --- # Discrete Example of Bilateral Precaution .pull-left[ .smallest[ - Consider rule of **comparative negligence**, cost of accident divided proportionately - Notice .blue[Victim]'s dominant strategy is **Precaution** - For .red[Injurer], best response to .blue[Victim]'s precaution is precaution - .hi-purple[Nash Equilibrium]: (.red[Precaution], .blue[precaution]) and is efficient! ] ] .pull-right[ .center[ ![](../images/negligencegame6.png) ] .quitesmall[ A: $1,000 w: $20 (each party) p: 10% (neither), 6% (one careful), 2% (both) ] ] --- # Discrete Example of Bilateral Precaution .pull-left[ .smallest[ - Consider rule of **strict liability with defense of contributory negligence** - .red[Injurer] is liable regardless of his precaution ... unless .blue[blue] victim was negligent ] ] .pull-right[ .center[ ![](../images/negligencegame7.png) ] .quitesmall[ A: $1,000 w: $20 (each party) p: 10% (neither), 6% (one careful), 2% (both) ] ] --- # Discrete Example of Bilateral Precaution .pull-left[ .smallest[ - Consider rule of **strict liability with defense of contributory negligence** - .red[Injurer] is liable regardless of his precaution ... unless .blue[blue] victim was negligent - Notice .blue[Victim]'s dominant strategy is **Precaution** ] ] .pull-right[ .center[ ![](../images/negligencegame8.png) ] .quitesmall[ A: $1,000 w: $20 (each party) p: 10% (neither), 6% (one careful), 2% (both) ] ] --- # Discrete Example of Bilateral Precaution .pull-left[ .smallest[ - Consider rule of **strict liability with defense of contributory negligence** - .red[Injurer] is liable regardless of his precaution ... unless .blue[blue] victim was negligent - Notice .blue[Victim]'s dominant strategy is **Precaution** - For .red[Injurer], best response to .blue[Victim]'s precaution is precaution - .hi-purple[Nash Equilibrium]: (.red[Precaution], .blue[precaution]) and is efficient! ] ] .pull-right[ .center[ ![](../images/negligencegame9.png) ] .quitesmall[ A: $1,000 w: $20 (each party) p: 10% (neither), 6% (one careful), 2% (both) ] ] --- # Comparing Incentives Under Different Liability Rules | Rule | .red[Injurer] Precaution | .blue[Victim] Precaution | .red[Injurer] Activity | .blue[Victim] Activity | |------|---------|--------|-----|-----| | No liability | Zero | .green[Efficient] | Too High | .green[Efficient] | | Strict liability | .green[Efficient] | Zero | .green[Efficient] | Too High | | (“Simple”) Negligence | .green[Efficient] | .green[Efficient] | | | | Negligence w/Contributory Negligence | .green[Efficient] | .green[Efficient] | | | | Comparative Negligence | .green[Efficient] | .green[Efficient] | | | | Strict Liability w/Contributory Negligence | .green[Efficient] | .green[Efficient] | | | Assuming all relevant standards of care are set at the efficient levels `\((x^l=x^*)\)` --- # Activity Levels under Negligence Rules .pull-left[ .smallest[ - **Simple negligence**: .red[injurer] liable if he was negligent - Leads .red[injurer] to take efficient precaution, so **injurer expects to not be liable for any accidents** - So .red[Injurer] ignores cost of accidents when deciding on activity level - Drives carefully, but still **drives too much** - .blue[Victim] bears residual risk - Bikes carefully, and bikes **efficient amount** ] ] .pull-right[ .center[ ![](../images/car.png) ] ] --- # Comparing Incentives Under Different Liability Rules | Rule | .red[Injurer] Precaution | .blue[Victim] Precaution | .red[Injurer] Activity | .blue[Victim] Activity | |------|---------|--------|-----|-----| | No liability | Zero | .green[Efficient] | Too High | .green[Efficient] | | Strict liability | .green[Efficient] | Zero | .green[Efficient] | Too High | | (“Simple”) Negligence | .green[Efficient] | .green[Efficient] | Too High | .green[Efficient] | | Negligence w/Contributory Negligence | .green[Efficient] | .green[Efficient] | | | | Comparative Negligence | .green[Efficient] | .green[Efficient] | | | | Strict Liability w/Contributory Negligence | .green[Efficient] | .green[Efficient] | | | Assuming all relevant standards of care are set at the efficient levels `\((x^l=x^*)\)` --- # Activity Levels under Negligence Rules .pull-left[ .smallest[ - **Contributory Negligence** and **Comparative negligence**: efficient precaution by both parties - Leads .red[injurer] to take efficient precaution, so **injurer expects to not be liable for any accidents** - So .red[Injurer] ignores cost of accidents when deciding on activity level - Drives carefully, but still **drives too much** - .blue[Victim] bears residual risk - Bikes carefully, and bikes **efficient amount** ] ] .pull-right[ .center[ ![](../images/car.png) ] ] --- # Comparing Incentives Under Different Liability Rules | Rule | .red[Injurer] Precaution | .blue[Victim] Precaution | .red[Injurer] Activity | .blue[Victim] Activity | |------|---------|--------|-----|-----| | No liability | Zero | .green[Efficient] | Too High | .green[Efficient] | | Strict liability | .green[Efficient] | Zero | .green[Efficient] | Too High | | (“Simple”) Negligence | .green[Efficient] | .green[Efficient] | Too High | .green[Efficient] | | Negligence w/Contributory Negligence | .green[Efficient] | .green[Efficient] | Too High | .green[Efficient] | | Comparative Negligence | .green[Efficient] | .green[Efficient] | Too High | .green[Efficient] | | Strict Liability w/Contributory Negligence | .green[Efficient] | .green[Efficient] | | | Assuming all relevant standards of care are set at the efficient levels `\((x^l=x^*)\)` --- # Activity Levels under Negligence Rules .pull-left[ .smallest[ - **Strict liability w/comparative negligence defense**: if .blue[victim] is not negligent, .red[injurer] is liable regardless of precaution - Leads both parties to take efficient precaution, so .red[injurer] is residual risk bearer, and is **liable for any accidents** - So .red[injurer] weighs cost of accidents against benefits, drives **efficient amount** - .blue[Victim], fully insured, ignores cost of accidents when deciding on activity level - Bikes carefully, but still **bikes too much** ] ] .pull-right[ .center[ ![](../images/groupride.jpg) ] ] --- # Comparing Incentives Under Different Liability Rules | Rule | .red[Injurer] Precaution | .blue[Victim] Precaution | .red[Injurer] Activity | .blue[Victim] Activity | |------|---------|--------|-----|-----| | No liability | Zero | .green[Efficient] | Too High | .green[Efficient] | | Strict liability | .green[Efficient] | Zero | .green[Efficient] | Too High | | (“Simple”) Negligence | .green[Efficient] | .green[Efficient] | Too High | .green[Efficient] | | Negligence w/Contributory Negligence | .green[Efficient] | .green[Efficient] | Too High | .green[Efficient] | | Comparative Negligence | .green[Efficient] | .green[Efficient] | Too High | .green[Efficient] | | Strict Liability w/Contributory Negligence | .green[Efficient] | .green[Efficient] | .green[Efficient] | Too High | Assuming all relevant standards of care are set at the efficient levels `\((x^l=x^*)\)` --- # Comparing Incentives Under Different Liability Rules | Rule | .red[Injurer] Precaution | .blue[Victim] Precaution | .red[Injurer] Activity | .blue[Victim] Activity | |------|---------|--------|-----|-----| | No liability | Zero | .green[Efficient] | Too High | .green[Efficient] | | Strict liability | .green[Efficient] | Zero | .green[Efficient] | Too High | | (“Simple”) Negligence | .b[.ul[.green[Efficient]]] | .green[Efficient] | .b[.ul[Too High]] | .green[Efficient] | | Negligence w/Contributory Negligence | .b[.ul[.green[Efficient]]] | .green[Efficient] | .b[.ul[Too High]] | .green[Efficient] | | Comparative Negligence | .b[.ul[.green[Efficient]]] | .green[Efficient] | .b[.ul[Too High]] | .green[Efficient] | | Strict Liability w/Contributory Negligence | .green[Efficient] | .b[.ul[.green[Efficient]]] | .green[Efficient] | .b[.ul[Too High]] | .smallest[ Highlighted cases: party takes precaution only to AVOID liability `\(\implies\)` precaution is efficient, but activity level is too high ] --- # Comparing Incentives Under Different Liability Rules | Rule | .red[Injurer] Precaution | .blue[Victim] Precaution | .red[Injurer] Activity | .blue[Victim] Activity | |------|---------|--------|-----|-----| | No liability | Zero | .b[.ul[.green[Efficient]]] | Too High | .b[.ul[.green[Efficient]]] | | Strict liability | .b[.ul[.green[Efficient]]] | Zero | .b[.ul[.green[Efficient]]] | Too High | | (“Simple”) Negligence | .green[Efficient] | .b[.ul[.green[Efficient]]] | Too High | .b[.ul[.green[Efficient]]] | | Negligence w/Contributory Negligence | .green[Efficient] | .b[.ul[.green[Efficient]]] | Too High | .b[.ul[.green[Efficient]]] | | Comparative Negligence | .green[Efficient] | .b[.ul[.green[Efficient]]] | Too High | .b[.ul[.green[Efficient]]] | | Strict Liability w/Contributory Negligence | .b[.ul[.green[Efficient]]] | .green[Efficient] | .b[.ul[.green[Efficient]]] | Too High | .smallest[ Highlighted cases: party reduces accidents, since they bear the cost, so both precaution & activity level are both efficient ] --- # These Results Look Overwhelming | Rule | .red[Injurer] Precaution | .blue[Victim] Precaution | .red[Injurer] Activity | .blue[Victim] Activity | |------|---------|--------|-----|-----| | No liability | Zero | .green[Efficient] | Too High | .green[Efficient] | | Strict liability | .green[Efficient] | Zero | .green[Efficient] | Too High | | (“Simple”) Negligence | .green[Efficient] | .green[Efficient] | Too High | .green[Efficient] | | Negligence w/Contributory Negligence | .green[Efficient] | .green[Efficient] | Too High | .green[Efficient] | | Comparative Negligence | .green[Efficient] | .green[Efficient] | Too High | .green[Efficient] | | Strict Liability w/Contributory Negligence | .green[Efficient] | .green[Efficient] | .green[Efficient] | Too High | These results look overwhelming, but really the result of four basic ideas --- # These Results Look Overwhelming | Rule | .red[Injurer] Precaution | .blue[Victim] Precaution | .red[Injurer] Activity | .blue[Victim] Activity | |------|---------|--------|-----|-----| | No liability | Zero | | Too High | | | Strict liability | | Zero | | Too High | | (“Simple”) Negligence | | | | | | Negligence w/Contributory Negligence | | | | | | Comparative Negligence | | | | | | Strict Liability w/Contributory Negligence | | | | | 1) If you don’t bear any of the cost of accidents, you have no incentive to prevent them --- # These Results Look Overwhelming | Rule | .red[Injurer] Precaution | .blue[Victim] Precaution | .red[Injurer] Activity | .blue[Victim] Activity | |------|---------|--------|-----|-----| | No liability | Zero | .green[Efficient] | Too High | .green[Efficient] | | Strict liability | .green[Efficient] | Zero | .green[Efficient] | Too High | | (“Simple”) Negligence | | | | | | Negligence w/Contributory Negligence | | | | | | Comparative Negligence | | | | | | Strict Liability w/Contributory Negligence | | | | | 2) If you **do** bear the cost of accidents, you’ll do whatever you can to prevent them --- # These Results Look Overwhelming | Rule | .red[Injurer] Precaution | .blue[Victim] Precaution | .red[Injurer] Activity | .blue[Victim] Activity | |------|---------|--------|-----|-----| | No liability | Zero | .green[Efficient] | Too High | .green[Efficient] | | Strict liability | .green[Efficient] | Zero | .green[Efficient] | Too High | | (“Simple”) Negligence | .green[Efficient] | | Too High | | | Negligence w/Contributory Negligence | .green[Efficient] | | Too High | | | Comparative Negligence |.green[Efficient] | | Too High | | | Strict Liability w/Contributory Negligence | | .green[Efficient] | | Too High | 3) If you can avoid liability by exercising due care, you’ll do it, but then you won’t reduce activity --- # These Results Look Overwhelming | Rule | .red[Injurer] Precaution | .blue[Victim] Precaution | .red[Injurer] Activity | .blue[Victim] Activity | |------|---------|--------|-----|-----| | No liability | Zero | .green[Efficient] | Too High | .green[Efficient] | | Strict liability | .green[Efficient] | Zero | .green[Efficient] | Too High | | (“Simple”) Negligence | .green[Efficient] | .green[Efficient] | Too High | .green[Efficient] | | Negligence w/Contributory Negligence | .green[Efficient] | .green[Efficient] | Too High | .green[Efficient] | | Comparative Negligence |.green[Efficient] | .green[Efficient] | Too High | .green[Efficient] | | Strict Liability w/Contributory Negligence | .green[Efficient] | .green[Efficient] | .green[Efficient] | Too High | 4) If the other guy can duck liability with due care, you’re the residual risk bearer, and therefore you’ll take due care


DISCOVER
Share what you're doing
You and your team can have a humble space to spread your knowledge (clic above).
For Labs
Brief description of what information a Lab page should contain. A guide for new users.
For Groups
Brief description of what information a Group page should contain. A guide for new users.
For Projects
Brief description of what information a Project page should contain. A guide for new users.
What is this?
{{ site.description }}
Let us know what you think.
Contact Us
We really love to hear from you and your projects. If you want
to share something, ask for something, or simply to say hello,
feel free to send us an email or commenting directly in
DIYbiosphere.github.io
More Information
You can find out more about this project by sending us a message
or visiting
DIYbiosphere.github.io
{% include footer.html %}


Home
SMM Plan
Contact
Payment
Purchase
If you want to Hire Us to work
on your project you have to Download
a form of Agreement/Contract & Send
via our WhatsApp/Email
Download Contract
Verification Process...
Thank You Verify here by sending
your contract and payment proof
Send through the options below
Email<EMAIL_ADDRESS>Home


{% extends "developers/base_impala.html" %} {% set title = _('Manage My Submissions') %} {% block title %}{{ hub_page_title(title) }}{% endblock %} {% block content %} {% if motd %}
{% endif %}{% trans app_url="https://developer.mozilla.org/apps" %} You haven't yet submitted an app to the Firefox Marketplace. Once you've created your app, click Submit Your App below. {% endtrans %}
{% else %} {% include "webapps/impala/listing/sorter.html" %}


World Oceans Day
Front-end design and code for a microsite on the importance of seafloor mapping.
View siteFront-end design and code for a microsite on the importance of seafloor mapping.
View siteThe 2014 year in review for NOAA Office of Ocean Exploration and Research.
View site


After Airtel and Vodafone Idea, Reliance Jio to hike mobile tariffs
by PTIBillionaire Mukesh Ambani’s Reliance Jio on November 19 said it will increase mobile phone call and data charges in the next few weeks.
The statement came a day after Bharti Airtel and Vodafone Idea Ltd. announced a hike in call and data charges from next month.
Jio said telecom regulator TRAI is likely to initiate consultation process for revision in telecom tariffs.
“Like other operators, we will also work with the government and comply with the regulatory regime to strengthen the industry to benefit Indian consumers and take measures including appropriate increase in tariffs in next few weeks in a manner that does not adversely impact data consumption or growth in digital adoption and sustains investments,” it said in a statement.
Explained | Vodafone and Airtel's historic losses


cymapgt\core\application\spreadsheet\SpreadsheetProcessor\SpreadsheetProcessor::getDrawingObjects
function getDrawingObjects() Return the entire array of drawing objects, or just one object
Signature
public function getDrawingObjects([string
$wSheetKey = '',
[string
$keyIsIndex = false,
[string
$objName = '']]] )
Parameters
$wSheetKey
—
string
- This is the key of the worksheet, either associative or indexed
$keyIsIndex
—
string
- This is true if numeric key is expected, false if otherwise*
$objName
—
string
- The name of the drawing object. If blank, return all objects
Returns
- mixed
- Return array of drawing objects, or just one drawing object, or false if name of
the object you specified was not found


Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text.
View ProjectEven the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text.
View Project73%
85%
90%
75%


"x" "1" "ZANI,F AND CARMELLINO,ML, ANTIMICROBIAL AND GENOTOXIC PROPERTIES OFQUINOLINE DERIVATIVES, BOLL. CHIM. FARM. 133(5):328-338, 1994"


[gecode-users] [Gecode-announce] Gecode 2.2.0, Gecode/J 2.2.0, Gecode/FlatZinc 1.3 released
Christian Schulte
cschulte at kth.se
Tue Aug 26 11:33:46 CEST 2008
Martin,
I'll write a little later a summary of the discussion that happened here on
3.0 and what is done and what still needs to be done. Please do not expect
the summary before end of the week.
Cheers
Christian
--
Christian Schulte, www.ict.kth.se/~cschulte/
-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Martin Mann
Sent: Tuesday, August 26, 2008 10:56 AM
To: users at gecode.org
Subject: Re: [gecode-users] [Gecode-announce] Gecode 2.2.0, Gecode/J 2.2.0,
Gecode/FlatZinc 1.3 released
>>> The complete changelog is available at
>>> http://www.gecode.org/gecode-doc-latest/PageChanges_2_2_0.html
>>
>> The first thing to catch my eye was DDS, but I have not found anything
>> related to it in the docs. Where should I look?
>
> I'm sorry for the confusion, but that entry got into the 2.2.0 changelog
> by mistake. DDS will only be available in Gecode 3, and is already
> available in the trunk (although I'm not 100% sure that it works right
> now, as there were major changes in the trunk that DDS potentially
> hasn't been fully adapted to yet). I'll remove it from the online
> changelog.
:( what a pitty! Even if it sounds strange to ask this while the newest
version was announced, but any vague guess about 3.0.0 release?
Because I have to update my application source (currently using gecode
1.*) for a newer gecode version and I would like to take advantage of
DDS. So it's the question if to port to 2.2.* and some month later to
3.* or if the release of 3.* is not too far away such that I wait for
that...
Any light at the end of the tunnel? ;)
Thanks a lot,
Martin
--
Martin Mann, Dipl. Bioinf.
Bioinformatics - Inst. of Computer Science
Albert-Ludwigs-University Freiburg
Tel: ++49-761-203-8259
Fax: ++49-761-203-7462
http://www.bioinf.uni-freiburg.de/~mmann/
_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users
More information about the gecode-users
mailing list


fun X509TrustManager.saving(validate: Boolean = true): SavingTrustManager
Returns a SavingTrustManager for this trust manager.
validate - true to validate certificate chains. It's enabled by default.
validate


# How to Contribute
## Reporting Issues
Please see our [FAQ](https://github.com/wycats/handlebars.js/blob/master/FAQ.md) for common issues that people run into.
Should you run into other issues with the project, please don’t hesitate to let us know by filing an [issue][issue]! In general we are going to ask for an example of the problem failing, which can be as simple as a jsfiddle/jsbin/etc. We’ve put together a jsfiddle [template][jsfiddle] to ease this. (We will keep this link up to date as new releases occur, so feel free to check back here)
Pull requests containing only failing thats demonstrating the issue are welcomed and this also helps ensure that your issue won’t regress in the future once it’s fixed.
Documentation issues on the handlebarsjs.com site should be reported on [handlebars-site](https://github.com/wycats/handlebars-site).
## Pull Requests
We also accept [pull requests][pull-request]!
Generally we like to see pull requests that - Maintain the existing code style - Are focused on a single change (i.e. avoid large refactoring or style adjustments in untouched code if not the primary goal of the pull request) - Have [good commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) - Have tests - Don’t significantly decrease the current code coverage (see coverage/lcov-report/index.html)
## Building
To build Handlebars.js you’ll need a few things installed.
- Node.js
- [Grunt](http://gruntjs.com/getting-started)
Before building, you need to make sure that the Git submodule spec/mustache is included (i.e. the directory spec/mustache should not be empty). To include it, if using Git version 1.6.5 or newer, use git clone –recursive rather than git clone. Or, if you already cloned without –recursive, use git submodule update –init.
Project dependencies may be installed via npm install.
To build Handlebars.js from scratch, you’ll want to run grunt in the root of the project. That will build Handlebars and output the results to the dist/ folder. To re-run tests, run grunt test or npm test. You can also run our set of benchmarks with grunt bench.
The grunt dev implements watching for tests and allows for in browser testing at http://localhost:9999/spec/.
If you notice any problems, please report them to the GitHub issue tracker at [http://github.com/wycats/handlebars.js/issues](http://github.com/wycats/handlebars.js/issues).
## Ember testing
The current ember distribution should be tested as part of the handlebars release process. This requires building the handlebars-source gem locally and then executing the ember test script.
```sh npm link grunt build release cp dist/*.js $emberRepoDir/bower_components/handlebars/
cd $emberRepoDir npm link handlebars npm test ```
## Releasing
Handlebars utilizes the [release yeoman generator][generator-release] to perform most release tasks.
A full release may be completed with the following:
``` yo release npm publish yo release:publish components handlebars.js dist/components/
cd dist/components/ gem build handlebars-source.gemspec gem push handlebars-source-*.gem ```
After this point the handlebars site needs to be updated to point to the new version numbers. The jsfiddle link should be updated to point to the most recent distribution for all instances in our documentation.
[generator-release]: https://github.com/walmartlabs/generator-release [pull-request]: https://github.com/wycats/handlebars.js/pull/new/master [issue]: https://github.com/wycats/handlebars.js/issues/new [jsfiddle]: http://jsfiddle.net/9D88g/26/


Class: Sketchup::ComponentInstance
| Relationships | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Drawingelement ,
Entity
|
|
|
Instance Chain:
self,
Drawingelement ,
Entity
|
|
| Inherits: |
Sketchup::Drawingelement
|
Overview
The ComponentInstance
class is used to represent component instances of a component definition or components that have been dragged from the Component Browser and placed (thus, instanced) within the Model
. Therefore, the ComponentInstance
class contains a reference to a corresponding ComponentDefinition
object and a Transformation object (which contains the location of the component in the Drawing Window).
Starting from SketchUp 2018+, the ComponentInstance
class contains default attributes when created or imported. The attributes are: “Owner”, “Status”. See the Help article for more information. The dictionary cannot be deleted via ruby and an @raise ArgumentError will be raised. The key/value pairs in the dictionary can be deleted safely.
Instance Attribute Summary
-
#definition ⇒ Sketchup::ComponentDefinition
rw
The definition method is used to retrieve the component definition for this component instance.
-
#definition=(definition) ⇒ Sketchup::ComponentDefinition
rw
The definition= method is used to set the component definition for this component.
-
#glued_to ⇒ Sketchup::Face, ...
rw
The #glued_to method is used to retrieve the entity that this instance is glued to.
-
#glued_to=(drawing_element) ⇒ Sketchup::Face, ...
rw
The #glued_to= method glues this instance to a drawing element.
-
#locked=(lock) ⇒ Boolean
rw
The locked= method is used to lock a component instance.
-
#locked? ⇒ Boolean
rw
The locked? method is used to determine if a component instance is locked.
-
#manifold? ⇒ Boolean
readonly
The manifold? method is used to determine if an instance is manifold.
-
#name ⇒ String
rw
The name method is used to get the name of this instance.
-
#name=(name) ⇒ Sketchup::ComponentInstance
rw
The name method is used to set the name of this instance.
-
#transformation ⇒ Geom::Transformation
rw
The transformation method is used to retrieve the transformation of this instance.
-
#transformation=(transformation)
rw
The #transformation= method is used to set the transformation of this component instance.
Drawingelement
- Inherited
| #casts_shadows= | The casts_shadows= method is used to set the |
| #casts_shadows? | The casts_shadows? method is used to determine if the |
| #hidden= | The hidden= method is used to set the hidden status for an element. |
| #hidden? | The hidden? method is used to determine if the element is hidden. |
| #layer | The layer method is used to retrieve the |
| #layer= | The layer= method is used to set the layer for the drawing element. |
| #material | The material method is used to retrieve the material for the drawing element. |
| #material= | The material= method is used to set the material for the drawing element. |
| #receives_shadows= | The receive_shadows= method is used to set the |
| #receives_shadows? | The receive_shadows? method is used to determine if the |
| #visible= | The visible= method is used to set the visible status for an element. |
| #visible? | The visible? method is used to get the visible status for an element. |
Entity
- Inherited
Instance Method Summary
-
#add_observer(observer) ⇒ Boolean
The add_observer method is used to add an observer to the current object.
-
#equals?(instance) ⇒ Boolean
The equals? method is used to determine if a component instance is geometrically equivalent to another instance.
-
#explode ⇒ Array<Sketchup::Entity>, false
The explode method is used to explode the component instance into separate entities.
-
#guid ⇒ String
The guid method is used to get the base 64 encoded unique id for this SketchUp object.
-
#intersect(instance) ⇒ Sketchup::Group?
The intersect method is used to compute the boolean intersection of two instances representing manifold solid volumes (this - arg).
-
#make_unique ⇒ Sketchup::ComponentInstance
The #make_unique method is used to create a component definition for this instance that is not used by any other instances.
-
#move!(transformation) ⇒ Boolean
The #move! method is used to set the transformation of this component instance, similarly to #transformation= but without recording to the undo stack.
-
#outer_shell(instance) ⇒ Sketchup::Group?
The outer_shell method is used to compute the outer shell of the two instances representing manifold solid volumes (this || arg).
-
#remove_observer(observer) ⇒ Boolean
The remove_observer method is used to remove an observer from the current object.
-
#show_differences(instance, verbose) ⇒ Boolean
The show_differences method is used to determine if a component instance is geometrically equivalent to another instance and in addition move the non- matching and matching geometry to new layers.
-
#split(instance) ⇒ Array(Sketchup::Group, Sketchup::Group, Sketchup::Group)
The split method is used to compute the boolean split (map overlay)of the two instances representing manifold solid volumes (this - arg).
-
#subtract(instance) ⇒ Sketchup::Group?
The subtract method is used to compute the boolean difference of the two instances representing manifold solid volumes (this - arg).
-
#transform!(transform) ⇒ Boolean
Apply a
::Geom::Transformation
to a component instance. -
#trim(instance) ⇒ Sketchup::Group?
The trim method is used to compute the (non-destructive) boolean difference of the two instances representing manifold solid volumes (this - arg).
-
#union(instance) ⇒ Sketchup::Group?
The union method is used to compute the boolean union of the two instances representing manifold solid volumes (this | arg).
-
#volume ⇒ Float
The volume method is used to compute the volume of this instance if and only if this instance is manifold.
Drawingelement
- Inherited
| #bounds | The |
| #erase! | The |
Entity
- Inherited
| #add_observer | The add_observer method is used to add an observer to the current object. |
| #attribute_dictionaries | The attribute_dictionaries method is used to retrieve the |
| #attribute_dictionary | The attribute_dictionary method is used to retrieve an attribute dictionary with a given name that is attached to an |
| #delete_attribute | The |
| #entityID | The entityID method is used to retrieve a unique ID assigned to an entity. |
| #get_attribute | The |
| #inspect | The to_s method is used to retrieve the string representation of the entity. |
| #model | The model method is used to retrieve the model for the entity. |
| #parent | The parent method is used to retrieve the parent of the entity. |
| #persistent_id | The |
| #remove_observer | The remove_observer method is used to remove an observer from the current object. |
| #set_attribute | The set attribute is used to set the value of an attribute in an attribute dictionary with the given name. |
| #to_s | The to_s method is used to retrieve the string representation of the entity. |
| #typename | The typename method retrieves the type of the entity, which will be a string such as “Face”, “Edge”, or “Group”. |
Instance Attribute Details
#definition ⇒ Sketchup::ComponentDefinition (rw)
The definition method is used to retrieve the component definition for this component instance.
#definition=(definition) ⇒ Sketchup::ComponentDefinition (rw)
The definition= method is used to set the component definition for this component.
This method causes the instance to use a different definition, but it will use the same transformation to position it in the Model
.
#glued_to ⇒ Sketchup::Face, ... (rw)
The #glued_to
method is used to retrieve the entity that this instance is glued to.
#glued_to=(drawing_element) ⇒ Sketchup::Face, ... (rw)
#locked=(lock) ⇒ Boolean
(rw)
The locked= method is used to lock a component instance.
#locked? ⇒ Boolean
(rw)
The locked? method is used to determine if a component instance is locked.
#manifold? ⇒ Boolean
(readonly)
The manifold? method is used to determine if an instance is manifold.
#name ⇒ String (rw)
The name method is used to get the name of this instance.
#name=(name) ⇒ ComponentInstance
(rw)
The name method is used to set the name of this instance.
#transformation ⇒ Geom::Transformation (rw)
The transformation method is used to retrieve the transformation of this instance.
#transformation=(transformation) (rw)
The #transformation=
method is used to set the transformation of this component instance.
Instance Method Details
#add_observer(observer) ⇒ Boolean
The add_observer method is used to add an observer to the current object.
#equals?(instance) ⇒ Boolean
The equals? method is used to determine if a component instance is geometrically equivalent to another instance.
#explode ⇒ Array<Sketchup::Entity>, false
The explode method is used to explode the component instance into separate entities.
#guid ⇒ String
The guid method is used to get the base 64 encoded unique id for this SketchUp object.
#intersect(instance) ⇒ Sketchup::Group?
This method is not available in SketchUp Make.
The intersect method is used to compute the boolean intersection of two instances representing manifold solid volumes (this - arg). If the specified objects (this and arg) do not represent manifold volumes, this method fails.
#make_unique ⇒ ComponentInstance
The #make_unique
method is used to create a component definition for this instance that is not used by any other instances. If the component is already unique in the model, nothing happens.
#move!(transformation) ⇒ Boolean
Despite the name being similar to #transform!, this method closer corresponds to #transformation=.
The #move!
method is used to set the transformation of this component instance, similarly to #transformation= but without recording to the undo stack.
This method is useful for moving entities inside of an animation or page transition.
#outer_shell(instance) ⇒ Sketchup::Group?
The outer_shell method is used to compute the outer shell of the two instances representing manifold solid volumes (this || arg). If the specified objects (this and arg) do not represent manifold volumes, this method fails.
#remove_observer(observer) ⇒ Boolean
The remove_observer method is used to remove an observer from the current object.
#show_differences(instance, verbose) ⇒ Boolean
The show_differences method is used to determine if a component instance is geometrically equivalent to another instance and in addition move the non- matching and matching geometry to new layers.
This method will move both instances to Layer0. Geometry that is the same in both components will be moved to a new layer named def_name + “_same”. Geometry that is not the same will be moved to a layer named def_name + “_diff”.
If verbose is true, a list of all the geometry that is different from one component to the other is displayed texturally in the Ruby Console.
#split(instance) ⇒ Array(Sketchup::Group, Sketchup::Group, Sketchup::Group)
This method is not available in SketchUp Make.
The split method is used to compute the boolean split (map overlay)of the two instances representing manifold solid volumes (this - arg). If the specified objects (this and arg) do not represent manifold volumes, this method fails.
resultant groups if the two objects (this and arg) represent manifold solids and the operation succeeds otherwise nil is returned. The 3 groups are as follows: The intersection of volume 1 & volume 2, the difference of volume 1 minus volume 2, and the reverse difference of volume 2 minus volume 1.
#subtract(instance) ⇒ Sketchup::Group?
This method is not available in SketchUp Make.
The subtract method is used to compute the boolean difference of the two instances representing manifold solid volumes (this - arg). If the specified objects (this and arg) do not represent manifold volumes, this method fails.
#transform!(transform) ⇒ Boolean
Apply a ::Geom::Transformation
to a component instance.
#trim(instance) ⇒ Sketchup::Group?
This method is not available in SketchUp Make.
The trim method is used to compute the (non-destructive) boolean difference of the two instances representing manifold solid volumes (this - arg). If the specified objects (this and arg) do not represent manifold volumes, this method fails.
#union(instance) ⇒ Sketchup::Group?
This method is not available in SketchUp Make.
The union method is used to compute the boolean union of the two instances representing manifold solid volumes (this | arg). If the specified objects (this and arg) do not represent manifold volumes, this method fails.
#volume ⇒ Float
The volume method is used to compute the volume of this instance if and only if this instance is manifold.


We're sorry, but something went wrong.
We've been notified about this issue and we'll take a look at it shortly.
Home


‘The End Of The F***ing World’ 2 – all of the photos from the NME shoot with Alex Lawther and Jessica Barden
By popular demand, here are all of the amazing shots from our REEL TALK interview with Alex and Jessica aka James and Alyssa.
Photography by Jenn Five.


--- layout: page title: About header-img: "img/about-bg.png" ---
Learning how to code for a new career path.


The site detail page provides information and links to other services for the PanDA site (resource):
- Click on 'worker nodes' to get a breakdown of jobs handled by different worker nodes at the site, useful for spotting problematic WNs.
- Links to job listings for the site and a job error breakdown for the site are also provided.
- Click 'brokerage actions' to see any recent PanDA brokerage actions involving the site.
- Click 'pilots' for the pilot factory monitor's view of factories and pilots serving the site.
{% if viewParams.MON_VO == 'ATLAS' %}
- The ATLAS Site Status Board (SSB) page for the site is linked.
- ATLAS shift e-logs mentioning the site's GOC name in the title are linked.
- Distributed data management (DDM) monitors for the site serving as source and destination are linked.
{% endif %}
The site parameters shown are those recorded in PanDA's internal site configuration database, schedconfig.


Namakkal kavinjar V. Ramalingam Pillai (1888-1972)
pATalkaL- part I I (98 -180)
in Tamil Script, unicode/utf-8 format
நாமக்கல் கவிஞர் இராமலிங்கம் பிள்ளை பாடல்கள் - இரண்டாம் பாகம்
Etext Preparation : Ms. Vijayalakshmi Alagarsamy, California, USA
Proof-reading: Prof. Swaminathan Sankaran, Regina, Canada
Web version: K. Kalyanasundaram, Lausanne, Switzerland
This webpage presents the Etext in Tamil script but in Unicode encoding.
To view the Tamil text correctly you need to set up the following:
i). You need to have Unicode fonts containing Tamil Block (Latha,
Arial Unicode MS, TSCu_Inaimathi, Code2000, UniMylai,...) installed on your computer
and the OS capable of rendering Tamil Scripts (Windows 2000 or Windows XP).
ii)Use a browser that is capable of handling UTF-8 based pages
(Netscape >4.6, Internet Explorer 5) with the Unicode Tamil font
chosen as the default font for the UTF-8 char-set/encoding view. .
In case of difficulties send an email request to kalyan@geocities.com


When I started with React Native not long ago I was frustrated by the overwhelming amount of irrelevant information on how to test React applications. React is known to evolve fast, often introducing breaking changes, so this should not be surprising to most developers. Still, the amount of deprecated content out there leaves a sort of a bad feeling, especially among developers who have just started working with React or RN.
Having spent a few days, breaking walls down on my own, I decided to document the current state of testing affairs, with the hope that my post won’t become obsolete by the time it comes out.
Note: Though I initially wanted to write a big post describing RN testing in detail, I decided to split it up into manageable chunks. This post will talk about Jest, what it is, and why it is useful.
Jest
When you create a new React or React Native application via one of the provided CLI tools, it automatically creates a sample unit test using a framework called Jest. I have to say upfront. You don’t necessarily have to use Jest for your RN tests, but it definitely brings a few interesting features to the table.
Similar to Mocha, Jest is an opininionated test runner and assertion framework, which uses the familiar BDD syntax of describing and asserting tests:
describe('calculator', function() {
describe('add()', function() {
it('should add 2 numbers togoether', function() {
expect(calculator.add(2, 2)).toEqual(4);
});
});
});
Setting up
Setting Jest up and writing your first test is fairly easy, due to its ‘convention-over-configuration’ approach. Though fine-tuning the Jest config is totally possible, there are predefined defaults for everything. In fact, all you need to do is place your tests under __tests__
, and mock modules under __mocks__
and Jest will find them automatically.
Mocking
On top of that though, Jest provides a few interesting features on its own. One is its aggressive approach to mocking. Up to a few versions, ago, Jest’s automock
option was set to true
by default. This meant that unless it were explicitly configured not to do so, Jest would create a mock out of every library and dependancy relevant to your code. The development team realized though that this is one idea too aggressive, and though the option is still there, it is set to false
by default:
We introduced automocking at Facebook and it worked great for us when unit testing was adopted in a large existing code base with few existing tests, but over time it felt like people spent more time fighting with mocked/unmocked modules than it would have taken them to write a test normally. We also noticed that library authors often require a huge number of basic modules that always have to be manually unmocked.

Jest Mocking Cheatsheet
// Mock-related functions available via the global Jest object
jest.resetAllMocks()
jest.clearAllTimers()
jest.disableAutomock()
jest.enableAutomock()
jest.fn(?implementation)
jest.isMockFunction(fn)
jest.genMockFromModule(moduleName)
jest.mock(moduleName, ?factory, ?options)
jest.resetModules()
jest.setMock(moduleName, moduleExports)
jest.unmock(moduleName)
jest.spyOn()
// Mock functions available to every mock
mockFn.mock.calls
mockFn.mock.instances
mockFn.mockClear()
mockFn.mockReset()
mockFn.mockRestore()
mockFn.mockImplementation(fn)
mockFn.mockImplementationOnce(fn)
mockFn.mockReturnThis()
mockFn.mockReturnValue(value)
mockFn.mockReturnValueOnce(value)
Snapshotting
Besides mocking, snapshotting is the other big feature that Jest provides. If you are using the React or React Native CLI, you must have already seen this line of code in your tests:
expect(tree).toMatchSnapshot();
When asserting against a snapshot, Jest will look for an existing one in the __snapshots__
directory, and if none were found, will save the current one there. The next time the test gets run, the current one gets compared to the existing one, and if there is a change, the test will break.
Snapshotting comes super useful when testing the integration of multiple components, where the result is usually a heavily neseted structure. The way developers write such tests is either using many assertions, writing portions of the expected output by hand, or use a few, but very shallow assertions (like toContain
). Snapshotting, therefore, helps save a lot of time writing all this tedious assertion code by hand.
This example out of the official Jest blog uses the rendered output of a React component to illustrate snapshotting:
import renderer from 'react-test-renderer';
test('Link renders correctly', () => {
const tree = renderer.create(
<Link page="http://www.facebook.com">Facebook</Link>
).toJSON();
expect(tree).toMatchSnapshot();
});
and the corresponding snapshot that gets saved:
exports['Link renders correctly 1'] = '
<a
className="normal"
href="http://www.facebook.com"
onMouseEnter={[Function bound _onMouseEnter]}
onMouseLeave={[Function bound _onMouseLeave]}>
Facebook
</a>
';
Though you will certainly find snapshotting useful for verifying the rendered output of your apps and components, these are by far not the only uses cases. I find it very helpful when verifying global application state, e.g. using libraries like Redux or other similar approaches.
Conclusion
All in all, I find Jest’s ‘zero-conf, batteries-included’ approach to testing pretty fun to work with. Starting a new project, especially a React or React Native one, it makes sense to go with it, since it comes bundled in. Even if you are already having a large codebase of tests, assuming they follow the familiar BDD conventions (and most probably using Jasmine assertions), you can get it up and running on Jest in pretty much no time. Beware that the documentation is not always up-to-date, so you might have to invest some further time checking Medium and GitHub.
Now that I’ve cleared it up a bit what Jest is all about, I will focus on structurally testing React Native applications in my next post.
Leave a comment


circos.initializeWithIdeogram.Rd
Initialize the circular layout with an ideogram
circos.initializeWithIdeogram( cytoband = system.file(package = "circlize", "extdata", "cytoBand.txt"), species = NULL, sort.chr = TRUE, chromosome.index = usable_chromosomes(species), major.by = NULL, plotType = c("ideogram", "axis", "labels"), track.height = NULL, ideogram.height = convert_height(2, "mm"), ...)
| cytoband | A path of the cytoband file or a data frame that already contains cytoband data. By default it is cytoband for hg19.
Pass to |
|---|---|
| species | Abbreviations of species. e.g. hg19 for human, mm10 for mouse. If this
value is specified, the function will download cytoBand.txt.gz from
UCSC website automatically. If there is no cytoband for user's species,
it will keep on trying to download chromInfo file. Pass to |
| chromosome.index | subset of chromosomes, also used to reorder chromosomes. |
| sort.chr | Whether chromosome names should be sorted (first sort by numbers then by letters).
If |
| major.by | Increment of major ticks. Pass to |
| plotType | Which tracks should be drawn. |
| track.height | Height of the track which contains "axis" and "labels". |
| ideogram.height | Height of the ideogram track |
| ... | Pass to |
The function will initialize the circular plot in which each sector corresponds to a chromosome. You can control the order of
chromosomes by chromosome.index
or by sort.chr
, or by setting a special format of cytoband
(please refer to read.cytoband
to find out how to control a proper cytoband
).
The function finally pass data to circos.genomicInitialize
to initialize the circular plot.
The style of ideogram is almost fixed, but you can customize it with your self-sefined code. Refer to vignette for demonstration.
# \donttest{ circos.initializeWithIdeogram()cytoband.file = system.file(package = "circlize", "extdata", "cytoBand.txt") circos.initializeWithIdeogram(cytoband.file)cytoband.df = read.table(cytoband.file, colClasses = c("character", "numeric", "numeric", "character", "character"), sep = "\t") circos.initializeWithIdeogram(cytoband.df) circos.initializeWithIdeogram(species = "hg18")circos.initializeWithIdeogram(species = "mm10")cytoband = read.table(cytoband.file, colClasses = c("character", "numeric", "numeric", "character", "character"), sep = "\t") circos.initializeWithIdeogram(cytoband, sort.chr = FALSE)cytoband[[1]] = factor(cytoband[[1]], levels = paste0("chr", c(22:1, "X", "Y"))) circos.initializeWithIdeogram(cytoband, sort.chr = FALSE)cytoband = read.table(cytoband.file, colClasses = c("character", "numeric", "numeric", "character", "character"), sep = "\t") circos.initializeWithIdeogram(cytoband, sort.chr = TRUE)circos.initializeWithIdeogram(plotType = NULL)#> Warning: 'start.degree' can only be modified before `circos.initialize`, or #> maybe you forgot to call `circos.clear` in your last plot.circos.initializeWithIdeogram()circos.clear() # }


Stay in
{{currentdetail.Name}} - {{currentdetail.Address}}
Room Choices
{{rooms.Name}}
{{rooms.Price}}
Select
We are apolozise... No Room Available for requested Hotel...
{{_obj.Name}}
{{_obj.Price}}
Check In
Check Out
Guest
1
2
3
4
5
6
6+
Rooms
1
2
3
4
5
Grand Total
{{GetTotalPrice()}}
Sorry Room not available on this date range, please try another date.
BOOK NOW
We are apolozise... No Image Available for Requested Hotel...
Facilties
{{_obj.Name}}-
✔
{{_obj.Name}}-
✗


s6
Software
skarnet.org
The s6-supervise program
s6-supervise monitors a long-lived process (or service), making sure it
stays alive, sending notifications to registered processes when it dies, and
providing an interface to control its state. s6-supervise is designed to be the
last non-leaf branch of a supervision tree, the supervised process
being a leaf.
Interface
s6-supervise servicedir
- s6-supervise switches to the servicedir
service directory.
- It exits 100 if another s6-supervise process is already monitoring this service.
- If the ./event fifodir does not exist,
s6-supervise creates it and allows subscriptions to it from processes having the same
effective group id as the s6-supervise process.
If it already exists, it uses it as is, without modifying the subscription rights.
- It sends a 's' event to ./event.
- If the default service state is up, s6-supervise spawns ./run.
- s6-supervise sends a 'u' event to ./event whenever it
successfully spawns ./run.
- When ./run dies, s6-supervise sends a 'd' event to ./event.
- When ./run dies, s6-supervise spawns ./finish if it exists.
./finish will have ./run's exit code as first argument, or 256 if
./run was signaled; it will have the number of the signal that killed ./run
as second argument, or an undefined number if ./run was not signaled.
- ./finish must exit in less than 5 seconds. If it takes more than that,
s6-supervise kills it with a SIGKILL.
- When ./finish dies, s6-supervise restarts ./run unless it has been
told not to.
- There is a minimum 1-second delay between two ./run spawns, to avoid busylooping
if ./run exits too quickly.
- When killed or asked to exit, it waits for the service to go down one last time, then
sends a 'x' event to ./event before exiting 0.
Signals
s6-supervise reacts to the following signals:
- SIGTERM: bring down the service and exit, as if a
s6-svc -xd command had been received
- SIGHUP: exit as soon as the service stops, as if a
s6-svc -x command had been received
- SIGQUIT: currently like SIGTERM, but this might change in the future
Usage notes
- s6-supervise is a long-lived process. It normally runs forever, from the system's
boot scripts, until shutdown time; it should not be killed or told to exit. If you have
no use for a service, just turn it off; the s6-supervise process does not hurt.
- Even in boot scripts, s6-supervise should normally not be run directly. It's
better to have a collection of service directories in a
single scan directory, and just run
s6-svscan on that scan directory. s6-svscan will spawn
the necessary s6-supervise processes, and will also take care of logged services.
- You can use s6-svc to send commands to the s6-supervise
process; mostly to change the service state and send signals to the monitored
process.
- You can use s6-svok to check whether s6-supervise
is successfully running.
- You can use s6-svstat to check the status of a
service.
- s6-supervise maintains internal information inside the ./supervise
subdirectory of servicedir. servicedir itself can be read-only,
but both servicedir/supervise and servicedir/event
need to be read-write.
Implementation notes
- s6-supervise tries its best to stay alive and running despite possible
system call failures. It will write to its standard error everytime it encounters a
problem. However, unlike s6-svscan, it will not go out
of its way to stay alive; if it encounters an unsolvable situation, it will just
die.
- Unlike other "supervise" implementations, s6-supervise is a fully asynchronous
state machine. That means that it can read and process commands at any time, even
when the machine is in trouble (full process table, for instance).
- s6-supervise does not use malloc(). That means it will never leak
memory. However, s6-supervise uses opendir(), and most opendir()
implementations internally use heap memory - so unfortunately, it's impossible to
guarantee that s6-supervise does not use heap memory at all.
- s6-supervise has been carefully designed so every instance maintains as little
data as possible, so it uses a very small
amount of non-sharable memory. It is not a problem to have several
dozens of s6-supervise processes, even on constrained systems: resource consumption
will be negligible.


{% extends 'base.html' %} {% block content %} Frequently Asked Questions Coming soon! {% endblock %}
Coming soon!


The Future Is Work
It looks like you don't have JavaScript enabled.
- Nearly everything on this site requires it.
- So you should turn JavaScript on if you want to see anymore content.
- If you're sure that you have JavaScript turned on and this still shows up, report a bug here: New Issue


Data lives in /var/lib/hiera by default. If a backend supplies a datadir in the config it will be used and subject to variable expansion based on scope
# File lib/hiera/backend.rb, line 9 def datadir(backend, scope) backend = backend.to_sym default = Hiera::Util.var_dir if Config.include?(backend) parse_string(Config[backend][:datadir] || default, scope) else parse_string(default, scope) end end
Finds the path to a datafile based on the Backend#datadir and extension
If the file is not found nil is returned
# File lib/hiera/backend.rb, line 24 def datafile(backend, scope, source, extension) file = File.join([datadir(backend, scope), "#{source}.#{extension}"]) unless File.exist?(file) Hiera.debug("Cannot find datafile #{file}, skipping") return nil end return file end
Constructs a list of data sources to search
If you give it a specific hierarchy it will just use that else it will use the global configured one, failing that it will just look in the ‘common’ data source.
An override can be supplied that will be pre-pended to the hierarchy.
The source names will be subject to variable expansion based on scope
# File lib/hiera/backend.rb, line 47 def datasources(scope, override=nil, hierarchy=nil) if hierarchy hierarchy = [hierarchy] elsif Config.include?(:hierarchy) hierarchy = [Config[:hierarchy]].flatten else hierarchy = ["common"] end hierarchy.insert(0, override) if override hierarchy.flatten.map do |source| source = parse_string(source, scope) yield(source) unless source == "" or source =~ /(^\/|\/\/|\/$)/ end end
Calls out to all configured backends in the order they were specified. The first one to answer will win.
This lets you declare multiple backends, a possible use case might be in Puppet where a Puppet module declares default data using in-module data while users can override using JSON/YAML etc. By layering the backends and putting the Puppet one last you can override module author data easily.
Backend instances are cached so if you need to connect to any databases then do so in your constructor, future calls to your backend will not create new instances
# File lib/hiera/backend.rb, line 152 def lookup(key, default, scope, order_override, resolution_type) @backends ||= {} answer = nil Config[:backends].each do |backend| if constants.include?("#{backend.capitalize}_backend") || constants.include?("#{backend.capitalize}_backend".to_sym) @backends[backend] ||= Backend.const_get("#{backend.capitalize}_backend").new new_answer = @backends[backend].lookup(key, scope, order_override, resolution_type) if not new_answer.nil? case resolution_type when :array raise Exception, "Hiera type mismatch: expected Array and got #{new_answer.class}" unless new_answer.kind_of? Array or new_answer.kind_of? String answer ||= [] answer << new_answer when :hash raise Exception, "Hiera type mismatch: expected Hash and got #{new_answer.class}" unless new_answer.kind_of? Hash answer ||= {} answer = new_answer.merge answer else answer = new_answer break end end end end answer = resolve_answer(answer, resolution_type) unless answer.nil? answer = parse_string(default, scope) if answer.nil? and default.is_a?(String) return default if answer.nil? return answer end
Parses a answer received from data files
Ultimately it just pass the data through parse_string but it makes some effort to handle arrays of strings as well
# File lib/hiera/backend.rb, line 106 def parse_answer(data, scope, extra_data={}) if data.is_a?(Numeric) or data.is_a?(TrueClass) or data.is_a?(FalseClass) return data elsif data.is_a?(String) return parse_string(data, scope, extra_data) elsif data.is_a?(Hash) answer = {} data.each_pair do |key, val| answer[key] = parse_answer(val, scope, extra_data) end return answer elsif data.is_a?(Array) answer = [] data.each do |item| answer << parse_answer(item, scope, extra_data) end return answer end end
Parse a string like ‘%{foo}’ against a supplied scope and additional scope. If either scope or extra_scope includes the varaible ‘foo’ it will be replaced else an empty string will be placed.
If both scope and extra_data has “foo” scope will win. See hiera-puppet for an example of this to make hiera aware of additional non scope variables
# File lib/hiera/backend.rb, line 73 def parse_string(data, scope, extra_data={}) return nil unless data tdata = data.clone if tdata.is_a?(String) while tdata =~ /%\{(.+?)\}/ begin var = $1 val = "" # Puppet can return :undefined for unknown scope vars, # If it does then we still need to evaluate extra_data # before returning an empty string. if scope[var] && scope[var] != :undefined val = scope[var] elsif extra_data[var] val = extra_data[var] end end until val != "" || var !~ /::(.+)/ tdata.gsub!(/%\{(::)?#{var}\}/, val) end end return tdata end
Generated with the Darkfish Rdoc Generator 2.


Guard Leikan:
Excellent. Take this letter to
Farmer Piotur
. He is bravely tending his crops while being overrun by filthy orcs. His farm is
near the east entrance of the Orc Barracks
.


Download Easeus Partition Master Free 15 0 For Windows Filehippo Com
Easeus Partition Master Professional 15 8 Free Download Software Reviews Downloads News Free Trials Freeware And Full Commercial Software Downloadcrew
Easeus Partition Master 13 5 Download For Pc Free
Portable Easeus Partition Master 11 9 Free Download Download Bull
Easeus Partition Master 13 Free Download Get Into Pc
Easeus Partition Master Key 2021 Free Download Productkeyfree
Easeus Partition Master 12 10 Technician Edition Portable Free Download
Easeus Partition Master 15 5 Crack With Serial Key Free Download
Download Easeus Partition Master 9 2 2 All Editions Full Version New Release Jun 2013 Youtube
Download Easeus Partition Master Home Edition Majorgeeks
Easeus Partition Master 14 Free Download Pc Wonderland
Easeus Partition Master Professional 13 8 Portable Free Download
Easeus Partition Master Disk Management Software For Windows Pc
Easeus Partition Master 13 Free Download Free Or Trial Software Full Free Software Download
Easeus Partition Master Free Edition Free Download And Software Reviews Cnet Download
Download Easeus Partition Master Home Edition 12 9 X64 X32
Easeus Partition Master Home Edition 9 3 Neowin
Easeus Partition Master Professional Edition Free Download With Genuine License Serial Code Tip And Trick
Easeus Partition Master 14 Free Download
Easeus Partition Master Pro 14 0 Crack Key 2020 Full Download
Easeus Partition Master 15 Free Download Pc Wonderland
Easeus Partition Master 15 8 Crack Latest Full Torrent Download
Easeus Partition Master 15 5 All Editions Winpe Free Download
Download Easeus Partition Master 64 32 Bit For Windows 10 Pc Free
Pin On Aplikacie
Easeus Partition Master 15 8 Winpe Iso Filecr
Easeus Partition Master 12 00 Professional Edition And 12 10 Technican Edition Free Download Pc Wonderland


void _exit(int status);
#include <stdlib.h>
void _Exit(int status);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
_Exit():
The value status is returned to the parent process as the process's exit status, and can be collected using one of the wait(2) family of calls.
The function _Exit() is equivalent to _exit().
The function _exit() is like exit(3), but does not call any functions registered with atexit(3) or on_exit(3). Whether it flushes standard I/O buffers and removes temporary files created with tmpfile(3) is implementation-dependent. On the other hand, _exit() does close open file descriptors, and this may cause an unknown delay, waiting for pending output to finish. If the delay is undesired, it may be useful to call functions like tcflush(3) before calling _exit(). Whether any pending I/O is canceled, and which pending I/O may be canceled upon _exit(), is implementation-dependent.
In glibc up to version 2.3, the _exit() wrapper function invoked the kernel system call of the same name. Since glibc 2.3, the wrapper function invokes exit_group(2), in order to terminate all of the threads in a process.


{include file='public:head_out' /}
{include file='public:sidebar'/}
{include file='public:nav'/}
{include file='public:alert'/}


Agency ID
Path
Uploaded By
{{ file.agencyID }}
{{ file.displayName }}
{{ file.displayName }}
{{ file.uploadedBy }}
Upload Files
×
Upload