Deprecated Features
Sometimes it becomes clear that a feature is just a bad idea. These are called deprecated features and once they are judged to merit removal from the language, they follow a procedure in order to allow plenty of time for users to adjust to the change.
- Spec
- Removal from the Specification
- Dep
- The compiler warns by default, issues an error with the -de switch, and can be silenced with the -d switch
- Error
- It is an error to use the feature
- Gone
- The feature is completely gone
Throwing from contracts of nothrow functions
Throwing exceptions from the contracts of a nothrow function was permitted:
float sqrt(float n) nothrow in { if (n < 0) throw new Exception("n must be positive"); } do { // ... }
Corrective Action
Remove the nothrow attribute or rewrite the contract using assertions instead.
float sqrt(float n) nothrow in { assert(n >= 0); } do { // ... }
Rationale
Since a function's preconditions and postconditions are implicitly executed before and after the function's body, allowing them to throw would break the guarantees of the nothrow attribute.
body keyword
'body' was a keyword used to specify a function/method's body in the presence of contracts
class Foo { void bar(int i) in { assert(i >= 42); } body { /* Do something interesting */ } string method(string s) out(v) { assert(v.length == s.length); } body { /* Do something even more interesting */ } void noBody() { /* No contracts, no body */ } }
Corrective Action
Use the 'do' keyword instead (introduced v2.075.0)
void bar(int i) in { assert(i >= 42); } do { /* Look ma, no body! */ }
Rationale
The 'body' keyword was only used for this single purpose. Since D grammar aims to be context free, this common word was reserved, which led to frequent trouble for people interfacing with other languages (e.g. javascript) or auto-generating code.
Note that given the large amount of code relying on the 'body' keyword (essentially any code using contracts), and the fact that the benefit of DIP1003 to the user are mostly the ability to use 'body' as an identifier, the deprecation has been postponed beyond its original goal of 2.091.0. Users are still encouraged to use 'do' for future-proofness.
Hexstring literals
Hexstring literals can be used to enter literals in base 16.
// deprecated code // auto x = x"1234";
Corrective Action
Use the std.conv.hexString template.
auto x = hexString!"1234";
Rationale
Hexstrings are used so seldom that they don't warrant a language feature.
Class allocators and deallocators
D classes can have members customizing the (de)allocation strategy.
class Foo { new(uint size, ...) { return malloc(size); } delete(void* obj) { free(obj); } } Foo foo = new(...) Foo(); delete foo;
Corrective Action
Move the (de)allocation strategy out of the class
class Foo { } T make(T, Args...)(auto ref Args args) if (is(T == Foo)) { enum size = __traits(classInstanceSize, T); void* mem = malloc(size); scope (failure) free(mem); return mem !is null ? emplace!T(mem[0..size], args) : null; } void dispose(T)(T obj) { auto mem = cast(void*) obj; scope (exit) free(mem); destroy(obj); } Foo foo = make!Foo(); if (foo !is null) dispose(foo);
Rationale
Classes should not be responsible for their own (de)allocation strategy.
Implicit comparison of different enums
Comparison of different enumerated type was allowed:
enum Status { good, bad } enum OtherStatus { ok, no } static assert(Status.good == OtherStatus.ok);
Corrective Action
Comparison between unrelated enumerated types should be done with std.conv.asOriginalType
import std.conv : asOriginalType; assert(Foo.x.asOriginalType == Bar.y.asOriginalType);
Rationale
Code correctness is improved by disallowing comparison of unrelated enumerated types. Implicit comparison of different enum types often resulted in hard to spot bugs.
enum { X } enum { Y } void main() { auto b = X == Y; assert(b); }
Implicit string concatenation
Two adjacent strings were implicitly concatenated:
string foo = "Hello" "World";This feature was handy for a long string that spans multiple lines, however, it is possible to get the same behaviour explicitly by using the concatenation operator ('~'):
string foo = "Hello" ~ "World"; // No allocation is performed
Corrective Action
Replace implicit string concatenation by explicit one, using '~'.
Rationale
This is a very early feature of the language, which is nowadays totally covered by the concatenation operator: it is performed at compile time for constants and doesn't result in memory allocation.
However, having implicit concatenation can and did result in hard to spot bugs, for example:
string[] names = [ "Anna", "Michael" "Emma", "David" ]; // The content of arr is [ "Anna", "MichaelEmma", "David" ]
Using the result of a comma expression
The comma operator (,) allows executing multiple expressions and discards the result of them except for the last which is returned.
int a = 1; int b = 2; bool ret = a == 2, b == 2; // trueIt's also common to use the comma operator in for-loop increment statements to allow multiple expressions.
for (; !a.empty && !b.empty; a.popFront, b.popFront)
Corrective Action
If possible, split the comma operator in two statements. Otherwise use lambdas.
auto result = foo(), bar(); // split off in two statements foo(); auto result = bar(); // or use lambdas auto result = {foo(); return bar();}();
Rationale
The comma operator leads to unintended behavior (see below for a selection) Moreover it is not commonly used and it blocks the ability to implement tuples. A selection of problems through the accidental use of the comma operator:
writeln( 6, mixin("7,8"), 9 ); // 6, 8, 9 template vec(T...)(T args) { ... } vec v = (0, 0, 3); // 3, because vec is variadic int b = 2; if (a == 1, b == 2) { // will always be reached } void foo(int x) {} foo((++a, b)); synchronized (lockA, lockB) {} // isn't currently implemented, but still compiles due to the comma operator
delete
Memory allocated on the GC heap can be freed with delete.
auto a = new Class(); delete a;
Corrective Action
Use object.destroy() to finalize the object instead.
auto a = new Class(); destroy(a);
Note that destroy does not free the allocated memory. If necessary, call core.GC.free also.
Rationale
delete makes assumptions about the type of garbage collector available that limits which implementations can be used, and can be replaced by a library solution.
scope as a type constraint
The scope keyword can be added to a class declaration to force all instances of the class to be attributed with the scope storage class.
scope class C { } // `scope` type constraint. This usage of `scope` is deprecated. void main() { C c1 = new C(); // Error: reference to `scope class` must be `scope` // This error is due to the `scope` attribution on the declaration // of `class C` and the missing `scope` storage class attribution // on `c1`. scope C c2 = new C(); // OK because the instance `c2` is attributed with the `scope` // storage class. This usage of `scope` is not deprecated. }
Corrective Action
There is no current counterpart in the D programming language or library that places such a constraint on a type requiring all instances of the type to be attributed with the scope storage class.Rationale
scope as a type constraint was a quirk in the language without a compelling use case.
Note that this deprecation only affects the usage of scope as a type constraint attributed to a class declaration. scope as a storage class attributed to variables, function parameters, etc. is not deprecated.
Imaginary and complex types
D currently supports imaginary and complex versions of all floating point types.
float a = 2; ifloat b = 4i; cfloat c = a + b; assert(c == 2 + 4i);
Corrective Action
Use the library types in std.complex.
Rationale
These types are too specialized to be a part of the core language.
128-bit integer types
D currently reserves the cent and ucent keywords for future use as 128-bit integral types, but the use of will result in a compile-time error.
cent a =<PHONE_NUMBER>3709551616L; ucent b =<PHONE_NUMBER>7419103232UL;
Corrective Action
Use the library types in core.int128.
Rationale
These types are too specialized to be a part of the core language.
Implicit catch statement
One can catch everything by using catch without specifying a type.
int[] arr = new int[](10); // This will throw a RangeError try { arr[42]++; } catch { writeln("An error was caught and ignored"); }
Corrective Action
Either don't catch Throwable or replace catch {} with catch (Throwable) {}
int[] arr = new int[](10); // This will throw a RangeError try { arr[42]++; } catch (Throwable) { writeln("An error was caught and ignored"); }
Rationale
Catching Throwable should not be encouraged by the language, because certain core guarantee cannot be satisfied, e.g. the stack might not get cleaned up and destructors might not get run. This change helps ensure catching Throwable is always a conscious and visible decision on the programmer's side.
.sort and .reverse properties for arrays
D arrays can be manipulated using these built-in properties.
int[] x = [2, 3, 1]; assert(x.sort == [1, 2, 3]);
Corrective Action
Use the generic functions in std.algorithm.
Rationale
These operations are better implemented in the standard library.
C-style array pointers
C-style array pointers can be used in D.
alias float *arrayptr[10][15];
Corrective Action
Replace with D-style array pointers.
alias float[15][10]* arrayptr;
Rationale
The D syntax is much cleaner and easier to use.
Floating point NCEG operators
D currently supports the NCEG floating point operators (!<>=, <>, <>=, !>, !>=, !<, !<=, !<>) for comparisons involving NaNs.
Corrective Action
Use the normal operators and std.math.traits.isNaN.
Rationale
These operators are too specialized to be a part of the core language.
clear
Call an object's destructor.
auto a = new Class(); clear(a);
Corrective Action
Use object.destroy() instead.
auto a = new Class(); destroy(a);
Rationale
Due to Uniform Function Call Syntax (UFCS), clear can cause confusion with other methods of the same name, such as a clear method used to remove the contents of a container.
.min property for floating point types
Floating point types have the .min property to access the smallest value.
enum m = real.min;
Corrective Action
Replace with .min_normal
enum m = real.min_normal;
Rationale
The name min_normal is more accurate, as .min does not include denormalized floating point values.
Cast T[] to integral type
At some point in time you could do:
ulong u = cast(ulong)[1,2];To get the length of the array.
Corrective Action
Use the .length property instead.
Rationale
Using a cast to get the length of an array is just confusing.
Base Class Protection
Base class protections are things like:
class A : protected B { ... }
Corrective Action
Delete the protection attribute keyword from in front of the base class and base interfaces.
Rationale
With D's module system, it doesn't seem to serve any useful purpose, and has never worked correctly.
Windows 3.x and Windows 9x support
There is some code in Phobos for Windows 3.x/9x support.
Corrective Action
Upgrade Windows or switch to another supported OS.
Rationale
Supporting such outdated and rarely used OS-es isn't worth the trouble.
typedef
typedef can be used to construct a strongly-typed alias of a type.
typedef int myint; static assert(!is(myint == int));
Corrective Action
Replace use of typedef with alias or use std.typecons.Typedef.
Rationale
typedef is not flexible enough to cover all use cases. This is better done with a library solution.
Using * to dereference arrays
D array variables can be dereferenced to get the first element, much like pointers.
int[] arr = [1, 2, 3]; assert(*arr == 1);
Corrective Action
Use indexing syntax to access first member.
int[] arr = [1, 2, 3]; assert(arr[0] == 1);
Rationale
D arrays are not pointers.
invariant as an alias for immutable
The invariant storage class and type modifier is an alias for immutable.
static assert(is(invariant(int) == immutable(int)));
Corrective Action
Replace all uses of invariant as a storage class or type modifier with immutable. The invariant() syntax for struct and class invariants is still supported.
Rationale
The alias is unnecessary.
Non-final switch statements without a default case
Switch statements can be declared without a default case, and the compiler automatically adds one.
switch(a) { case 1: break; case 2: break; // the compiler adds // default: // throw new SwitchError(); }
Corrective Action
Add the default case manually.
switch(a) { case 1: break; case 2: break; default: assert(0); }
Rationale
Missing default cases can hide bugs, and making the default case explicit should be mandatory.
Hiding base class functions
This occurs when declaring a function in a derived class that can be called with the same arguments as a function in a base class, without overriding that function. The base class function gets hidden:
class A { void fun(int x) {} } class B : A { void fun(long x) {} }
Corrective Action
Add the function to the base class, or use an alias to bring the base class overload into the derived class:
class A { void fun(int x) {} void fun(long x) {} // this fixes it } class B : A { void fun(long x) {} alias A.fun fun; // so does this }
Rationale
This is an error that is already detected at runtime, and is being extended to compile time.
Octal literals
Octal literals can be used to enter literals in base 8.
// deprecated code // auto x = 0123;
Corrective Action
Use the std.conv.octal template.
auto x = octal!123;
Rationale
The use of a leading zero is confusing, as 0123 != 123.
C-style function pointers
C-style function pointers can be used in D.
alias void(*fptr)(int, long);
Corrective Action
Replace with D-style function pointers.
alias void function(int, long) fptr;
Rationale
The D syntax is much cleaner and easier to use.
Using length in index expressions
When used inside an indexing or slicing expression, length is rewritten to be the length of the array being sliced.
auto a = new int[5]; a = a[0..length-1];
Corrective Action
Replace length with the equivalent '$'
Rationale
The implicitly defined length variable shadows existing declarations, and is less concise than the alternative.
Escape string literals
Escape string literals can be used to describe characters using escape sequences.
// deprecated code // string x = "hello" ~ \n;
Corrective Action
Put escape sequences inside a regular string literal.
string x = "hello\n";
Rationale
Escape string literals are unintuitive and unnecessary.
volatile
volatile can be used to mark statement, in order to prevent some compiler optimizations.
volatile
{
... do something involving ghared variables ...
}
Corrective Action
Convert the code to use synchronized statements instead.
Rationale
volatile statements are a misfeature.
HTML source files
The D compiler can parse html files by ignoring everything not contained in  tags.
  ... source ...
Corrective Action
Extract code to regular source files.
Rationale
This has been replaced for documentation by the introduction of ddoc
Overriding without override
Virtual functions can currently override a function in a base class without the 'override' attribute.
class A { void fun() {} } class B : A { // overrides but is not marked with override void fun() {} }
Corrective Action
Mark overriding functions with override
class A { void fun() {} } class B : A { override void fun() {} }
Rationale
Making the override attribute mandatory makes it explicit, and can catch errors when a base class function is accidentally overridden.
Lower case 'l' suffix for integer literals
Lower case 'l' is an alternative suffix to denote 64 bit integer literals.
// deprecated code // auto x = 123l;
Corrective Action
Use the upper case 'L' suffix.
auto x = 123L;
Rationale
The lower case suffix is easily confused with the digit '1'.
Note
In lexical analysis phase, compiler can recognize lower case suffix 'l' to report better error message - for the use case such as C-to-D code translation. Thus DMD would continue to parse 'l' suffix.
Variable shadowing inside functions
Variable shadowing is when a variable in an inner scope has the same name as a variable in an enclosing scope.
void myFun() { int var; if (x) { int var; var = 3; // which var was meant? } }
Corrective Action
Rename shadowing variables so they don't conflict.
Rationale
Variable shadowing can introduce hard to find bugs where the wrong variable is modified.
Upper case 'I' suffix for imaginary literals
The 'I' suffix can be used to denote imaginary floating point values.
// deprecated code // auto x = 1.234I;
Corrective Action
Use the lower case 'i' suffix.
auto x = 1.234i;
Rationale
The 'I' suffix is easily confused with the digit '1'.
if (v; e)
This syntax can be used to declare a variable in an if statement condition.
if (v; calculateAndReturnPointer()) { ... }
Corrective Action
Replace with an auto declaration.
if (auto v = calculateAndReturnPointer()) { ... }
Rationale
The syntax is clearer with auto.
Removing an item from an associative array with delete
delete can be used to remove an item from an associative array.
int[int] aa = [1 : 2]; delete aa[1]; assert(1 !in aa);
Corrective Action
Use .remove instead.
int[int] aa = [1 : 2]; aa.remove(1); assert(1 !in aa);
Rationale
The delete syntax is confusing and conflicts with the normal delete syntax.
.offset property
The .offset property can be used to get member offset information.
struct S { int a, b; } static assert(S.b.offset == 4);
Corrective Action
Use .offsetof instead
struct S { int a, b; } static assert(S.b.offsetof == 4);
Rationale
The .offset syntax has been superseded by .offsetof
.size property
The .size property can be used to get type size information
struct S { int a, b; } static assert(S.size == 8);
Corrective Action
Use .sizeof instead
struct S { int a, b; } static assert(S.sizeof == 8);
Rationale
The .size syntax has been superseded by .sizeof
.typeinfo property
The .typeinfo property can be used to get the associated TypeInfo class.
T.typeinfo
Corrective Action
Use typeid() instead
typeid(T)
Rationale
The .typeinfo syntax has been superseded by typeid()
unannotated asm blocks
asm blocks don't affect the function annotations.
void foo() @safe { asm { noop; } }
Corrective Action
Annotate the asm blocks instead
void foo() @safe { asm @safe { noop; } }
Rationale
asm blocks may throw, contain unsafe, impure code or call the GC interfaces.


Shaney Waris
Resume Builder
Logout
Main
Dashboard
Jobs
Recommended Jobs
Available Jobs
Interviews
Build your Resume here
Basic Informations
edit
Full Name
Email ID
Birth Date
Gendar
Male
Female
Others
Contact Informations
Address
State
Country
Pin Code
Phone Number
Education Informations
Institution
Subject
Starting Date
Complete Date
Degree
Percentage
Add More Education
Experience Informations
Company Name
Location
Job Position
About your work
XYZ
Period From
Period To
Add More Experience
Save


Welcome croquet players!
Welcome Advanced Players
New Players
Lawn Bowling Players
Vistors
Founders: Evan & Maureen White
Financial Managment: Nancy Agnew
Social Director: Maureen White
Season: May to October
Location of Play: Hume Street, Collingwood
Mailing Address: 115 First St, Unit 4, Suit 119
Contact:
<EMAIL_ADDRESS>A group of local volunteers and the Municipality of Collingwood recreational.
We play American, Association and Golf Croquet, Six Wicket, on two full-size lawns at the club. We also welcome lawn bowling to invited groups and to events.
Our club house has a range of players from introductory to advanced.
We are open and comfortable croquet facilities in the area.
During the May to October season, club members play on Mondays, Wednesdays and Saturdays, beginning at 10:00 A.M.
Playing times will be published.
Related Links
Croquet Canada
US Croquet Association
British Croquet Association
World Croquet Federation
Equipment to Play Croquet
Welcome Members!
All croquet players are welcome to participate in tournaments.
For information on registration and fees, email<EMAIL_ADDRESS>$10 or Canadian Tire Money


Things I've learned
Internet Basics
HTTP Request
IP Address
Servers
HTML
Stands for
Hyper Text Markup Language
Lots of Tags
Boilerplate
Doctype
HTML
Head
Title
Body
Headings
Paragraph
em
strong


Samoa declares emergency after six people killed by measles
by Kenneth GargerA massive measles outbreak has claimed the lives of six people in Samoa, prompting the country to close all of its schools and ban children from public gatherings.
The government is also requiring all of its citizens to get vaccinated as 100 people remain hospitalized — 15 of which are in intensive care — from the deadly disease.
Of the 716 confirmed measles cases, most of the dead victims are under the age of 2.
Some residents of the Pacific island nation had been more susceptible to the disease since a large portion of the population was never vaccinated.
Samoa’s Director General of Health Leausa Dr. Take Naseri said only two-thirds of the country’s 200,000 people were vaccinated. He also said he expects the outbreak to worsen.
Naseri’s vaccination estimation differs from numbers provided by the World Health Organization and UNICEF, which say Samoan infant immunizations rates plummeted from over 70 percent in 2013 to below 30 percent last year.
For a few months last year, the Samoan government stopped its immunization program when two infants died in a medical accident involving the vaccine, according to Dr. Helen Petousis-Harris, a vaccine expert at the University of Auckland, in New Zealand.
With Post Wires


Chapter II
As they entered they saw Dorian Gray. He was seated at the piano, with his back to them, turning over the pages of a volume of Schumann's Forest Scenes.
You must lend me these, Basil,
he cried. I want to learn them. They are perfectly charming.
That entirely depends on how you sit to-day, Dorian.
Oh, I am tired of sitting, and I don't want a life-sized portrait of myself,
answered the lad, swinging round on the music-stool, in a wilful, petulant manner. When he caught sight of Lord Henry, a faint blush colored his cheeks for a moment, and he started up. I beg your pardon, Basil, but I didn't know you had any one with you.
This is Lord Henry Wotton, Dorian, an old Oxford friend of mine. I have just been telling him what a capital sitter you were, and now you have spoiled everything.
You have not spoiled my pleasure in meeting you, Mr. Gray,
said Lord Henry, stepping forward and shaking him by the hand. My aunt has often spoken to me about you. You are one of her favorites, and, I am afraid, one of her victims also.
I am in Lady Agatha's black books at present,
answered Dorian, with a funny look of penitence. I promised to go to her club in Whitechapel with her last Tuesday, and I really forgot all about it. We were to have played a duet together,—three duets, I believe. I don't know what she will say to me. I am far too frightened to call.
Oh, I will make your peace with my aunt. She is quite devoted to you. And I don't think it really matters about your not being there. The audience probably thought it was a duet. When Aunt Agatha sits down to the piano she makes quite enough noise for two people.
That is very horrid to her, and not very nice to me,
answered Dorian, laughing.
Lord Henry looked at him. Yes, he was certainly wonderfully handsome, with his finely-curved scarlet lips, his frank blue eyes, his crisp gold hair. There was something in his face that made one trust him at once. All the candor of youth was there, as well as all youth's passionate purity. One felt that he had kept himself unspotted from the world. No wonder Basil Hallward worshipped him. He was made to be worshipped.
Oscar Fingal O'Flahertie Wills Wilde (16 October 1854 – 30 November 1900) was an Irish playwright, novelist, essayist, and poet.
After writing in different forms throughout the 1880s, he became one of London's most popular playwrights in the early 1890s. He is remembered for his epigrams, his novel The Picture of Dorian Gray, his plays, as well as the circumstances of his imprisonment and early death.


Find out the number of times the bell tolls between two given times.
Start time: End time: Calculate!


class: center, middle, inverse, title-slide # 4.6 — Contestable Markets & Wrap Up ## ECON 306 • Microeconomic Analysis • Spring 2021 ### Ryan Safner
Assistant Professor of Economics
<EMAIL_ADDRESS>ryansafner/microS21
microS21.classes.ryansafner.com
--- class: inverse # Outline ### [Game Theory: Some Generalizations](#3) ### [Contestable Markets](#17) ### [Wrapping Up the Semester](#39) --- class: inverse, center, middle # Game Theory: Some Generalizations --- # Game Theory: Some Generalizations .pull-left[ .center[ ![:scale 100%](../images/chessknights.jpg) ] ] .pull-right[ There's a *lot* more to game theory than a one-shot prisoners' dilemma: - one shot vs. repeated game - discrete vs. continuous strategies - perfect vs. incomplete vs. and asymmetric information - simultaneous vs. sequential game - See my [game theory course](https://ryansafner.com/courses/econ316/) for more ] --- # Solution Concepts .pull-left[ .center[ ![:scale 100%](../images/equilibriumbalance.png) ] ] .pull-right[ - We use .hi-purple["solution concepts"] to allow us to predict an .hi-purple[equilibrium] of a game - .hi[Nash Equilibrium] is the primarly solution concept - Note it has *many* variants depending on if games are sequential vs. simultaneous, perfect vs. imperfect information, etc. ] --- # Solution Concepts: Nash Equilibrium .pull-left[ .center[ ![:scale 100%](../images/equilibriumbalance.png) ] ] .pull-right[ - Recall, .hi[Nash Equilibrium]: no players want to change their strategy given what everyone else is playing - All players are playing a best response to each other ] --- # Solution Concepts: Nash Equilibrium .pull-left[ .center[ ![:scale 100%](../images/equilibriumbalance.png) ] ] .pull-right[ - Important about Nash equilibrium: 1. N.E. `\(\neq\)` the “*best*” or *optimal* outcome - Recall the Prisoners' Dilemma! 2. Game may have *multiple* N.E. 3. Game may have *no* N.E. (in “pure” strategies) ] --- # Example: Coordination Game .pull-left[ .center[ ![:scale 100%](../images/standards_game.png) ] ] .pull-right[ - A .hi-purple[Coordination Game] - No dominant strategies ] --- # Example: Coordination Game .pull-left[ .center[ ![:scale 100%](../images/standards_game_Nashes.png) ] ] .pull-right[ - .hi-purple[Two Nash equilibria]: (.red[A],.blue[A]) and (.red[B],.blue[B]) - Either just as good - Coordination is most important ] --- # Example: Coordination Game .pull-left[ .center[ ![:scale 100%](../images/standards_game_Nashes.png) ] ] .pull-right[ - Two general methods to solve for Nash equilibria: .hi-purple[1) Cell-by-Cell Inspection]: look in each cell, does either player want to deviate? - .hi-purple[If no: a Nash equilibrium] - If yes: *not a Nash equilibrium* ] --- # Example: Coordination Game .pull-left[ .center[ ![:scale 100%](../images/standards_game.png) ] ] .pull-right[ - Two general methods to solve for Nash equilibria: .hi-purple[2) Best-Response Analysis]: take the perspective of each player. If the other player plays a particular strategy, what is your strategy(s) that gets you the highest payoff? - Ties are allowed - .hi-purple[Any cell where both players are playing a best response is a Nash Equilibrium] ] --- # Example: Coordination Game .pull-left[ .center[ ![:scale 100%](../images/standards_game_1br.png) .red[Player 1's] best responses ] ] .pull-right[ - Two general methods to solve for Nash equilibria: .hi-purple[2) Best-Response Analysis]: take the perspective of each player. If the other player plays a particular strategy, what is your strategy(s) that gets you the highest payoff? - Ties are allowed - .hi-purple[Any cell where both players are playing a best response is a Nash Equilibrium] ] --- # Example: Coordination Game .pull-left[ .center[ ![:scale 100%](../images/standards_game_2br.png) .blue[Player 2's] best responses ] ] .pull-right[ - Two general methods to solve for Nash equilibria: .hi-purple[2) Best-Response Analysis]: take the perspective of each player. If the other player plays a particular strategy, what is your strategy(s) that gets you the highest payoff? - Ties are allowed - .hi-purple[Any cell where both players are playing a best response is a Nash Equilibrium] ] --- # Example: Coordination Game .pull-left[ .center[ ![:scale 100%](../images/standards_game_brnashes.png) .hi-purple[N.E.]: each player is playing a best response ] ] .pull-right[ - Two general methods to solve for Nash equilibria: .hi-purple[2) Best-Response Analysis]: take the perspective of each player. If the other player plays a particular strategy, what is your strategy(s) that gets you the highest payoff? - Ties are allowed - .hi-purple[Any cell where both players are playing a best response is a Nash Equilibrium] ] --- # A Change in the Game .pull-left[ .center[ ![](../images/standards_game_lockin.png) ] ] .pull-right[ - Two Nash equilibria again: (.red[A],.blue[A]) and (.red[B],.blue[B]) - But here (.red[A],.blue[A]) `\(\succ\)` (.red[B],.blue[B])! ] --- # A Change in the Game .pull-left[ .center[ ![](../images/standards_game_lockin.png) ] ] .pull-right[ - .hi-purple[Path Dependence]: early choices may affect later ability to choose or switch - .hi-purple[Lock-in]: the switching cost of moving from one equilibrium to another becomes prohibitive - Suppose we are currently in equilibrium (B,B) - .hi-purple[Inefficient lock-in]: - Standard A is superior to B - But too costly to switch from B to A ] --- class: inverse, center, middle # Contestable Markets --- # Is Monopoly a Nash Equilibrium? .pull-left[ - Now that we understand Nash equilibrium... - Are outcomes of other market structures Nash equilibria? ] .pull-right[ .center[ ![](../images/goingoutofbusiness.jpg) ![:scale 75%](../images/entry.jpg) ] ] --- # Is Monopoly a Nash Equilibrium? .pull-left[ - Now that we understand Nash equilibrium... - Are outcomes of other market structures Nash equilibria? - **Perfect competition**: no firm wants to raise or lower price given the market price `\(\checkmark\)` ] .pull-right[ .center[ ![](../images/goingoutofbusiness.jpg) ![:scale 75%](../images/entry.jpg) ] ] --- # Is Monopoly a Nash Equilibrium? .pull-left[ - **Monopolist** maximizes `\(\pi\)` by setting `\(q^*\)`: `\(MR=MC\)` and `\(p^*=Demand(q^*)\)` - This is *an* equilibrium, but is it the *only* equilibrium? - We've assumed just a *single* player in the model - .hi-purple[What about *potential* competition?] ] .pull-right[ .center[ ![](../images/goingoutofbusiness.jpg) ![:scale 75%](../images/entry.jpg) ] ] --- # Contestable Markets I .pull-left[ - Model the market as an .hi-purple[entry game], with two players: 1. .hi-red[**Incumbent**] which sets its price `\(\color{red}{p_I}\)` 2. .hi-blue[**Entrant**] decides to **stay out** or **enter** the market, setting its price `\(\color{blue}{p_E}\)` - Price competition between 2 firms with similar products `\(\implies\)` .hi-purple[consumers buy only from firm with lower price] ] .pull-right[ .center[ ![](../images/goingoutofbusiness.jpg) ![:scale 75%](../images/entry.jpg) ] ] --- # Contestable Markets II .pull-left[ .smallest[ - Suppose both firms have identical costs: `$$\begin{align*} C(q)&=cq\\ MC(q)&=c\\ \end{align*}$$` - If .hi-red[Incumbent] sets `\(\color{red}{p_I}>c\)` - .hi-blue[Entrant] would enter and set `\(\color{blue}{p_E}=\color{red}{p_I}-\epsilon\)`.magenta[†] ] ] .pull-right[ .center[ ![](../images/marketcompetition.jpg) ] ] .footnote[.magenta[†] For arbitrary `\\(\epsilon>0\\)`, think `\\(\epsilon =\\)` “one penny”] --- # Contestable Markets II .pull-left[ .smallest[ - Suppose both firms have identical costs: `$$\begin{align*} C(q)&=cq\\ MC(q)&=c\\ \end{align*}$$` - If .hi-red[Incumbent] sets `\(\color{red}{p_I}>c\)` - .hi-blue[Entrant] would enter and set `\(\color{blue}{p_E}=\color{red}{p_I}-\epsilon\)`.magenta[†] - .hi-red[Incumbent] foresees this possibility, and wants to lower its price `\(\color{red}{p_I}<\color{blue}{p_E}\)` - This potential undercutting would continue logically until... ] ] .pull-right[ .center[ ![](../images/marketcompetition.jpg) ] ] .footnote[.magenta[†] For arbitrary `\\(\epsilon>0\\)`, think `\\(\epsilon =\\)` “one penny”] --- # Contestable Markets II .pull-left[ - .hi-purple[Nash Equilibrium]: `\(\big(\color{red}{p_I}=c\)`, .blue[Stay Out] `\(\big)\)` - .hi-purple[A market with a single firm, but the **competitive outcome**!] - `\(p^*=MC\)`, `\(\color{green}{\pi=0}\)` - competitive `\(q^*\)` - max .hi-blue[Consumer Surplus], no DWL ] .pull-right[  ] --- # Contestable Markets II .pull-left[ - .hi-green[Case II]: What if the .hi-blue[Entrant] has *higher costs* than the .hi-red[Incumbent]: `\(\color{blue}{c_E}>\color{red}{c_I}\)`? - Or alternatively, there are **sunk costs** (.red[Incumbent] has already incurred) ] .pull-right[ ] --- # Contestable Markets II .pull-left[ - .hi-green[Case II]: What if the .hi-blue[Entrant] has *higher costs* than the .hi-red[Incumbent]: `\(\color{blue}{c_E}>\color{red}{c_I}\)`? - Or alternatively, there are **sunk costs** (.red[Incumbent] has already incurred) - .hi-purple[Nash equilibrium]: `\(\big(\color{red}{p_I}=\color{blue}{p_E-\epsilon}\)`, .blue[Stay Out] `\(\big)\)` - One firm again, with some inefficiency - But not as bad as monopoly! ] .pull-right[  ] --- # Contestable Markets III .pull-left[ - .hi-green[Case III]: What if there are **fixed costs**, `\(f\)`? `$$\begin{align*} C(q)&=cq+f \\ MC(q)&=c \\ AC(q)&=c+\frac{f}{q} \\ \end{align*}$$` - With high enough `\(f\)`, .hi[economies of scale] prevent marginal cost pricing from a being profitable Nash Equilibrium `$$\pi_{p=MC}=-\frac{f}{q}<0$$` ] .pull-right[  ] --- # Contestable Markets IV .pull-left[ - .hi-purple[Nash equilibrium]: `\(\big(\color{red}{p_I}=AC\)`, .blue[Stay Out] `\(\big)\)` - Again, only a single firm with some inefficiency - But not as bad as monopoly! - .red[Incumbent] earns no profits! ] .pull-right[  ] --- # Contestable Markets: Recap .pull-left[ - .hi-purple[Markets are **contestable** if]: 1. There are no barriers to entry or exit 2. Firms have similar technologies (i.e. similar cost structure) 3. There are no sunk costs - Economies of scale need not be inconsistent with competitive markets (as is assumed) if they are contestable - Generalizes "prefect competition" model in more realistic way, also game-theoretic ] .pull-right[ .center[ ![](../images/marketcompetition.jpg) ] ] --- # Contestable Markets: Summary .left-column[ .center[ ![:scale 80%](../images/baumol1.jpg) William Baumol (1922--2017) ] ] .right-column[ > "This means that...an incumbent, even if he can threaten retaliation after entry, dare not offer profit-making opportunities to potential entrants because an entering firm can hit and run, gathering in the available profits and departing when the going gets rough." ] .source[Baumol, William, J, 1982, "Contestable Markets: An Uprising in the Theory of Industry Structure," *American Economic Review,* 72(1): 1-15] --- # Implications for Competition .pull-left[ .center[ ![](../images/marketcompetition.jpg) ] ] .pull-right[ - Regulation & antitrust (once) focus(ed) on *number* of firms - "Count the number of firms, if it's 1, it's a monopoly!" - .hi-turquoise[Perfect competition as “gold standard”, only market arrangement that is socially efficient]: - .hi-purple[Allocatively efficient]: `\(p=MC\)`, `\(DWL=0\)` - .hi-purple[Productively efficient]: `\(p=AC_{min}\)` ] --- # Implications for Competition .pull-left[ .center[ ![](../images/marketcompetition.jpg) ] ] .pull-right[ - But number of firms is **endogenous** and **can evolve over time**! - Function of how firms mutually interact strategically - A more **dynamic** situation: firms respond over time ] --- # Implications for Competition .pull-left[ .center[ ![](../images/marketcompetition.jpg) ] ] .pull-right[ - Perfect competition **not** the *only* socially efficient market-structure - Market with number of firms (even 1) may be efficient .hi[if it is contestable] - .hi-purple[Regulation and antitrust should consider whether a market is *contestable*, not just the *number* of firms] - Free entry - No sunk costs ] --- # Implications for Competition .pull-left[ .center[ ![](../images/marketcompetition.jpg) ] ] .pull-right[ - Firms engaging in egregious monopolistic behavior `\((\downarrow q\)`, `\(\uparrow p>MC\)`, `\(\pi>0\)`) largely persist because of .hi-purple[barriers to entry] - Attempts to make market **uncontestable** - Business activities or political dealings with the goal to raise `\(\color{blue}{c_E}>\color{red}{c_I}\)` - Lower your own costs, or raise your rivals'! ] --- # Monopoly Or Contestable Market? .center[ ![](../images/microsoftantitrust.png) ] --- # Contestable Markets .pull-left[ .center[ ![:scale 100%](../images/browsers.png) ] ] .pull-right[ > "Of far greater concern to Microsoft is the competition from new and emerging technologies, some of which are currently visible and others of which certainly are not. This array of known, emerging, and wholly unknown competitors places enormous pressure on Microsoft to price competitively and innovate aggressively." (Schmalensee 1999) ] --- # Contestable Markets .center[ ![](../images/pcsmonopoly.jpg) ] --- # Contestable Markets .center[ ![](../images/amazoncloudcontest3.png) ] --- class: inverse, center, middle # Wrapping Up the Semester --- # So What's the Point of All Our Models? .pull-left[ - In perfect competition (model): - price-taking firms set price equal to marginal cost - long run economic profits are zero - allocative efficiency: consumer and producer surplus maximized - This is a *tendency* .hi[only because of **free entry and exit**] ] .pull-right[ .center[ ![:scale 100%](../images/donotenter.png) ] ] --- # So What's the Point of All Our Models? .pull-left[ - .hi-turquoise[Don't judge real markets by their similarity to the perfect competition model] - Judge them more on their level of contestability, look for barriers to entry ] .pull-right[ .center[ ![](../images/citymodel.jpg) ] ] --- # So What's the Point of All Our Models? .pull-left[ .quitesmall[ > "...In that Empire, the Art of Cartography attained such Perfection that the map of a single Province occupied the entirety of a City, and the map of the Empire, the entirety of a Province. In time, those Unconscionable Maps no longer satisfied, and the Cartographers Guilds struck a Map of the Empire whose size was that of the Empire, and which coincided point for point with it. The following Generations, who were not so fond of the Study of Cartography as their Forebears had been, saw that that vast Map was Useless..." ] .source[Jorge Luis Borges, 1658, *On Exactitude in Science*] ] .pull-right[ .center[ ![](../images/citymodel.jpg) ] ] --- # The Two Major Models of Economics as a “Science” .pull-left[ ## Optimization - Agents have .hi[objectives] they value - Agents face .hi[constraints] - Make .hi[tradeoffs] to maximize objectives within constraints .center[ ![](../images/optimize.jpeg) ] ] -- .pull-right[ ## Equilibrium - Agents .hi[compete] with others over **scarce** resources - Agents .hi[adjust] behaviors based on prices - .hi[Stable outcomes] when adjustments stop .center[ ![](../images/equilibriumbalance.png) ] ] --- # I’m Not An Idiot .pull-left[ - I know you most of you took this class as a business requirement... - ...and will forget all the advanced tools in under a week - They were/are meant to familiarize you with how economists model the world - If you ever need to solve a problem, they are a tool may apply ] .pull-right[ .center[ ![](4.4-slides_files/figure-html/unnamed-chunk-8-1.png) ] ] --- # Economics Uses, but Is Not Limited to, Math  --- # But Remembering the Takeaways Will Serve You .pull-left[ .quitesmall[ Even if you aren’t going to be an economist, remember: 1. We all have to face tradeoffs (including in politics) 2. Everyone makes choices on the margin 3. Incentives and institutions matter (beware the nirvana fallacy) 4. Role of (potential) competition (over time) & free entry 5. Markets are a discovery process via prices, profit & loss 6. People *tend* to adjust to each other towards a (predictable) equilibrium 7. Beware, rent-seeking is everywhere and cleverly hidden ] ] .pull-right[ .center[ ![](../images/leo_point.PNG) ] ] --- # Economics Is Broader Than You Think .center[ ![:scale 82%](../images/cooleconbooks.png) ]


Please wait...
 Connect
2. Subscribe
3. Publish
(4. Disconnect)


val action: String?
Action which caused the error, e.g PaymentView.load is translated into KlarnaPaymentActions.LOAD.
See Also
KlarnaPaymentActions


--- layout: documentation title: JournalEntryType ---
The JournalEntryType is optional and provides journal notes for information discovered during the handling of the Incident.
| Field Name | Type | Description |
|---|---|---|
| @authoroptional | string |
Specifies the author of the JournalEntry note. |
| @timeoptional | dateTime |
Specifies the date and time that the JournalEntry note was written. In order to avoid ambiguity, it is strongly suggest that all timestamps include a specification of the timezone if it is known. |
| @time_precisionoptional | DateTimePrecisionEnum |
Represents the precision of the associated time value. If omitted, the default is "second", meaning the timestamp is precise to the full field value. Digits in the timestamp that are required by the xs:dateTime datatype but are beyond the specified precision should be zeroed out. |


Section One
First anchor point. Navigation item one should be active only in this section.
Location hash should be #one with deep linking set to true
Section Two
Second anchor point. Navigation item two should be active only in this section.
Location hash should be #two with deep linking set to true
Section Three
Third anchor point. Navigation item three should be active only in this section.
Location hash should be #three with deep linking set to true


Week 1 Reflection
Today marks the end of the 1st week of the Fall Semester, so I feel it is a good time to start a blogging practice.
The purpose of this blog is partly for self-improvement and self-reflection, and partly to share what I feel may be helpful to others and myself years ago. I will take entries from my journal and organize and expand them. Some of these posts will be self-help tips from books/articles I read. I plan to also write reviews and reflections on books/articles/my experiences. Everything will be highly subjective and my own opinion and does not reflect anybody else’s.
Below is my weekly schedule for the weekdays (with non-weekly events removed). My weekend schedule can be very arbitrary from working on the house/yard trips with family, shopping, etc.
I think the major details are as follows: 1) I am planning to focus a lot more on research by scheduling at least 4 hours of deep work (for intense projects) with breaks on as many days as possible. Examples of deep work include designing a new architecture, analyzing the theoretical bounds on performance, coding the algorithm, and writing the thesis. In other words, deep work is work that requires some thought.
2) I just have two long-term projects that require a bit work (besides research):
- contributing to open source projects (started mostly because of jobs): Thursday, Friday, and the weekend
- blogging (which I’m doing here): mostly during the weekend (but I write everyday during the night daily).
3) I also schedule better habits before 8pm (reading during breaks, playing piano, light coding problems), and more shallow habits at the end of each day during “Play” (youtube, Ted, Twitch, surfing the web, etc.,).
4) For exercise, I plan to run on Tuesday and Thursday, and either Saturday and Sunday. On Friday (and potentially Monday), I will practice yoga with at most 1-2 others. On Monday and Wednesday and Saturday, I plan to do a bit bodyweight exercises (with an iPad when I don’t need to pay as much attention)
There are a lot of other details that I will leave for another post.
My first and most important tip is forming a habit to write and reflect everyday starting with at least 2 minutes, preferably near the end of the day. I started this habit by scheduling just 5 minutes of free write before I slept on what I am grateful for and what I feel can be improved. Some days, I spent just 3-4 minutes listing these things. Other days, it ends up being 10 minutes. Since it is short, I have missed only a few days so far.
This reflection practice can be incorporated into meditation practice (and I probably will eventually, but now I am still focusing on developing concentration). I will write more on meditation in another post.
I think keeping a diary/journal is one of the most efficient ways for self-improvement. As long as we constantly reflect on our actions, we can eventually improve.


Design and development of website from concept to completion for Web Design 1 course.
During the great depression of the 1930s there were countless people who lost their jobs and their homes and took to traveling. These people, known as hobos, developed a system of symbols to communicate to each other warnings and tips for surviving on the streets. Hobos were shunned as outcasts from society and relied on the help they could get from other people in a similar situation.
Nowadays, there is still a multitude of homeless and/or nomadic people living in our cities, but I believe people that are more fortunate are more understanding of the plight and willing to help those that are less fortunate. Especially in recent years with so many people in the U.S. struggling with economic hardship.
What if there was a modern system of symbols that people living on the streets could instantly recognize for helpful resources?
This site represents a system of symbols designed to be used by businesses, churches, libraries, etc. that are sympathetic to the hardships that homeless people face to easily communicate what resources they can offer. These symbols should be displayed in a window, door, or other easily seen location so that passers-by who understood these symbols would know what resources they are willing to offer.
Examples of what these places could offer include available public restrooms, free food that would otherwise be thrown out at the end of the day and what time of the day it is available, free computer usage, etc.
The purpose of this site is to raise awareness of this system of symbols, but also be a place where businesses who are willing to help can obtain the symbols and list their business in a directory or map that people who are searching for resources can find.
The overall aesthetic of using the ripped cardboard background image and the felt-tip marker style font replicates the cardboard signs that many homeless people use as a means of communicating their message. Since the purpose of this site is to create another system of communication, it is only appropriate to tie into the concept.
The colors used are modern, urban, and earthy.


var description: String?
OPTIONAL String description for the NotificationChannel Backed by descriptionRes
See Also
NotificationChannel.setDescription
Getter
OPTIONAL String description for the NotificationChannel Backed by descriptionRes
Getter See Also
NotificationChannel.setDescription
Setter
OPTIONAL String description for the NotificationChannel Backed by descriptionRes
Setter See Also


Current
College
IIT Jodhpur
B.Tech in CSE
Expected May 2021
2017
Senior High School
K.M Academy
CBSE Class 12
Aggregate : 84.8 %
2015
Hight School


{{/* This inserts page metadata about a job into an info card on the page */}}
{{ if ne .Page.Params.open true }}
❌❌❌
This posting is closed to new applications.
See the jobs page for our open positions.
❌❌❌
{{ end }}
**About the position**
- **Salary**: {{ .Page.Params.salary_range }}
- **Location**: {{ .Page.Params.location }}
- **Deadline**: {{ .Page.Params.deadline }}
**Major duties**
{{ range .Page.Params.work_description }}
- {{ . }}
{{ end }}
For more general information about 2i2c, see the links below:
* [Our Team Compass](https://compass.2i2c.org/en/latest/)
* [Our Code of Conduct](https://compass.2i2c.org/en/latest/code-of-conduct/index.html)
* [Our Mission and Values](https://compass.2i2c.org/en/latest/organization/mission.html)
* [What it's like to work at 2i2c](https://2i2c.org/jobs/#what-its-like-to-work-at-2i2c)


← Back
Roger's Hardloop schema
Week 1
Schema
Week 2
Schema
Week 3
Schema
Week 4
Schema
Week 5
Schema


| as_utf8_character {rlang} | R Documentation |
Unlike specifying the encoding
argument in as_string()
and
as_character()
, which is only declarative, these functions
actually attempt to convert the encoding of their input. There are
two possible cases:
The string is tagged as UTF-8 or latin1, the only two encodings
for which R has specific support. In this case, converting to the
same encoding is a no-op, and converting to native always works
as expected, as long as the native encoding, the one specified by
the LC_CTYPE
locale has support for all characters occurring in
the strings. Unrepresentable characters are serialised as unicode
points: "<U+xxxx>".
The string is not tagged. R assumes that it is encoded in the native encoding. Conversion to native is a no-op, and conversion to UTF-8 should work as long as the string is actually encoded in the locale codeset.
When translating to UTF-8, the strings are parsed for serialised
unicode points (e.g. strings looking like "U+xxxx") with
chr_unserialise_unicode()
. This helps to alleviate the effects of
character-to-symbol-to-character roundtrips on systems with
non-UTF-8 native encoding.
as_utf8_character(x)
x |
An object to coerce. |
# Let's create a string marked as UTF-8 (which is guaranteed by the # Unicode escaping in the string): utf8 <- "caf\uE9" Encoding(utf8) as_bytes(utf8)


[§346-303] Rules. The department of human services shall maintain rules describing eligibility criteria for adoption assistance and describing the types, duration, and amounts of adoption assistance benefits that may be received. [L 1992, c 190, pt of §1]


RN updates
This is part 3 of 4 of the React Native series.
Part 1 - Try RN | Part 2 - RN/Firebase snapshots | Part 3
Part 4 - RN & Tape Tests | Repo | Screenshots
In this update, I will discuss how we used scrollview and javascript to create a populating list that voted in a nested tree for our React Native and Firebase project. We probably could have used ListView, but were able to make this quickly work and decided to stick with it. We'll go through the entire setup and talk about each of the parts.
The final result is this screen shown above, in our program a place you can look up your friend and vote on their qualities, with your unique facebook ID as the key and true as the value. Let's start at the very beginning of this page. We are going to leave out the tab bar and other parts of this phone and the facebook image and just focus on the listview since that's where Firebase is involved.
'use strict';
We should start every bit of code with 'use strict'.
/*===============================||
|| Required sources ||
||===============================*/
var React = require('react-native'),
styles = require('./styles'),
person = require('./PersonDB'),
Within the PersonDB file, we have information on a specific
person. Person.id accesses their new generated facebook ID for this application. We can use this unique to our application code to grab a facebook profile image and to use as a unique key for voting.
javascript
Firebase = require('firebase'),
ref = new Firebase(url),
tallyNav = require('./tallyNav'),
personRef;
tallyNav is another option menu with votes tallied up. The main thing to note here is that we reference the database here with 'ref'. personRef is nested to individuals, or leaf nodes within 'ref'.
/*================================||
|| React native variables, ||
|| used as inline tags ||
||================================*/
var {
View,
ScrollView,
Text,
Image,
TouchableHighlight,
TouchableOpacity,
Component
} = React;
This section doesn't look like traditional javascript and is always hard to look at coming from JavaScript 5. This is destructuring and conceptually it is adding these items to React and moving forward.
/*================================||
|| Each list item and quality ||
||================================*/
var indents = [],
qualities = [
"baller",
"leader",
"performer",
"teacher"...
]
This is the list of traits. Indents is empty, but it will be filled when we prepare the qualities below with update commands that let them access our firebase database.
/*================================||
|| This menu each button to ||
|| hit the specific quality ||
|| Use null to remove items ||
|| or true to add items ||
||================================*/
class FeaturedNav extends Component {
render() {
window.FeaturedNav = this;
this.getTraits();
Within this function we make our updaters. Anywhere else and these don't trigger correctly.
return (
<View>
<Image background>
<TouchableHighlight
underlayColor='transparent'
onPress={()=>{
console.log("See your friend's stats")
this.props.navigator.push({
title: 'Stats for '+ person.name,
component: tallyNav,
leftButtonTitle: 'Back',
onLeftButtonPress: () => this.props.navigator.pop(),
})
}}>
This section lets us move to another screen, which shows the results of the voting.
//facebook image
<Image source>
This templating in particular really argues with the blogging's templating, so here's a screenshot.
This section is the logic behind grabbing the facebook profile. If you have an ID generated from your login you are good to go. I'm going to leave blogging about Facebook's login SDK for React Native to my partners Kent and Casey .
This mostly styling, you can gloss over it. The important bit is that I drop in the "indents" variable here. I'll describe in detail how to fill indents.
<View style={styles.navOverlay}>
<Text style={styles.navChoiceText}>see stats!</Text>
</View>
</Image>
</TouchableHighlight>
<ScrollView
onScroll={() => { console.log('onScroll!'); }}
scrollEventThrottle={200}
contentInset=
style={styles.scrollView}>
{indents}
</ScrollView>
</Image>
</View>
);
}
In the render function, we invoked a getTraits function. Here it is in all it's glory.
getTraits(){
personRef = ref.child("pond").child(person.id);
Here we access the database at the very specific person we are interested with voting on.
for (var i = 0; i < qualities.length; i++) {
var vote = {};
vote[window.Katfish.userID] = true;
Here is the specific information we are voting with. This can be used with any keyvalue pair, but the window.Katfish.userID is specifically who you are in our program. PersonID is who you are voting on and window.Katfish.userID. A true vote helps us add to our firebase database, false is also possible and will be important in the future to prevent "re-voting", and a null value here would remove the vote from our database if needed. We will only use true to vote here.
(function runIt(variable){
This part is super key. Without this function (which is invoked immediately below), we do not have a way to change the place at which we vote in our database on different qualities. This function is absolutely required.
indents.push(
<TouchableHighlight style={styles.featNavButton}
underlayColor={'rgba(200,28,78,0.2)'}
onPress={()=>{
personRef.child(variable).update(vote)
qualities.splice(qualities.indexOf(vote),1);
}}>
Here in this crucial section, personRef.child(variable).update(vote) gives the user the ability to vote on various features of a single person, with different types of vote tied to their username.
<Text style={styles.featNavButtonText}>{qualities[i]}</Text>
</TouchableHighlight>);
})(qualities[i])
}
}
}
And here we wrap it up. The {qualities[i]} is simply the text of each feature, however, the immediately invoked function with qualities[i] as an argument is the way that our function fills the scrollview with clickable highlights that work, subbing in for variable. Pretty nifty right? Once we got one of these going, we were able to make a pretty quick application of it. Cheers!


Viewing site information
In a site's menubar, click Site Info
to view
information about the site.
- If your role has restricted permissions for the site (e.g.,
participants, students, etc.), you will see information
published by the site's owner as well as any group memberships, if applicable.
- If your role includes a broad level of permissions (e.g., site
managers, instructors, etc.), you will see a participant list as well
as tools to edit that list and other site information. For editing
instructions, see: