5.3 Special Methods
A
class may define or inherit special methods (i.e., methods whose
names begin and end with double underscores). Each special method
relates to a specific operation. Python implicitly invokes a special
method whenever you perform the related operation on an instance
object. In most cases, the method's return value is
the operation's result, and attempting an operation
when its related method is not present raises an exception.
Throughout this section, I will point out the cases in which these
general rules do not apply. In the following,
x is the instance of class
C on which you perform the operation, and
y is the other operand, if any. The formal
argument self of each method also refers to
instance object
x.
5.3.1 General-Purpose Special Methods
Some special methods relate to
general-purpose operations. A class that defines or inherits these
methods allows its instances to control such operations. These
operations can be divided into the following categories:
- Initialization and finalization
-
An instance can control its initialization (a frequent need) via
special method _ _init_ _, and/or its finalization
(a rare need) via _ _del_ _.
- Representation as string
-
An instance can control how Python represents it as a string via
special methods _ _repr_ _, _ _str_
_, and _ _unicode_ _.
- Comparison, hashing, and use in a Boolean context
-
An instance can control how it compares with other objects (methods
_ _lt_ _ and _ _cmp_ _), how
dictionaries use it as a key (_ _hash_ _), and
whether it evaluates to true or false in Boolean contexts (_
_nonzero_ _).
- Attribute reference, binding, and unbinding
-
An instance can control access to its attributes (reference, binding,
unbinding) by defining special methods _ _getattribute_
_, _ _getattr_ _, _ _setattr_
_, and _ _delattr_ _.
- Callable instances
-
An instance is callable, just like a function object, if it has the
special method _ _call_ _.
The rest of this section documents the general-purpose special
methods.
_ _call_ _(self[,args...])
|
|
When you call
x([args...]),
Python translates the operation into a call to
x._ _call_
_([args...]).
The formal arguments for the call operation are the same as for the
_ _call_ _ method, minus the first argument. The
first argument, conventionally called self, refers
to x, and Python supplies it implicitly
and automatically, just as in any other call to a bound method.
Any comparison, when its specific special method (_ _lt_
_, _ _gt_ _, etc.) is absent or returns
NotImplemented, calls
x._ _cmp_
_(y) instead,
as do built-in function
cmp(x,y)
and the sort method of list objects. _
_cmp_ _ should return -1 if
x is less than
y, 0 if
x is equal to
y, or 1 if
x is greater than
y. When _ _cmp_ _ is
also absent, order comparisons (<,
<=, >,
>=) raise exceptions. Equality comparisons
(= =, !=), in this case, become
identity checks: x=
=y evaluates
id(x)=
=id(y) (i.e.,
x is
y).
Just before x disappears because of
garbage collection, Python calls
x._ _del_ _( ) to let
x finalize itself. If _ _del_
_ is absent, Python performs no special finalization upon
garbage-collecting x (this is the usual
case, as very few classes need to define _ _del_
_). Python ignores the return value of _ _del_
_. Python performs no implicit call to _ _del_
_ methods of class
C's superclasses.
C._ _del_ _ must
explicitly perform any needed finalization.
For example, when class C has a base class
B to finalize, the code in
C._ _del_ _ must call
B._ _del_ _(self) (or
better, for new-style classes,
super(C,
self)._ _del_ _( )). _ _del_ _
is generally not the best approach when you need timely and
guaranteed finalization. For such needs, use the
try/finally statement covered
in Chapter 6.
At every request to unbind attribute
x.y
(typically, a del statement del
x.y),
Python calls x._ _delattr_
_('y'). All
the considerations discussed for _ _setattr_ _
also apply to _ _delattr_ _. Python ignores the
return value of _ _delattr_ _.  Each method may return
NotImplemented to tell Python to handle the
comparison in alternative ways (e.g., Python may then try
y>x
in lieu of
x<y).
When attribute
x.y
is accessed but not found by the usual procedure (i.e., where
AttributeError would normally be raised), Python
calls x._ _getattr_
_('y')
instead. Python does not call _ _getattr_ _ for
attributes found by normal means (i.e., as keys in
x._ _dict_ _ or via
x._ _class_ _). If you
want Python to call _ _getattr_ _ on every
attribute reference, keep the attributes elsewhere (e.g., in another
dictionary referenced by an attribute with a private name, as shown
earlier in this chapter), or else write a new-style class and
override _ _getattribute_ _ instead. _
_getattr_ _ should raise AttributeError
if it cannot find y.
| _ _getattribute_ _
|
Python 2.2 and later |
_ _getattribute_ _(self,name)
|
|
At every request to access attribute
x.y,
if x is an instance of new-style class
C, Python calls
x._ _getattribute_
_('y'), which
must obtain and return the attribute value or else raise
AttributeError. The normal semantics of attribute
access (using x._ _dict_
_, C._ _slots_
_, C's class
attributes, x._ _getattr_
_) are all due to object._ _getattribute_
_.
If class C overrides _
_getattribute_ _, it must implement all of the attribute
access semantics it wants to offer. Most often, the most convenient
way to implement attribute access semantics is by delegating (e.g.,
calling object._ _getattribute_ _(self,
...) as part of the operation of your override of
_ _getattribute_ _). Note that a class that
overrides _ _getattribute_ _ makes attribute
access on instances of the class quite slow, since your overriding
code is called on every such attribute access.
The
hash(x)
built-in function call, and using x as a
dictionary key (typically,
D[x]
where D is a dictionary), call
x._ _hash_ _( ).
_ _hash_ _ must return a 32-bit
int such that
x=
=y implies
hash(x)=
=hash(y), and
must always return the same value for a given object.
When _ _hash_ _ is absent,
hash(x)
and using x as a dictionary key call
id(x)
instead, as long as _ _cmp_ _ and _ _eq_
_ are also absent.
Any x such that
hash(x)
returns a result, rather than raising an exception, is known as a
hashable object. When
_ _hash_ _ is absent, but _ _cmp_
_ or _ _eq_ _ is present,
hash(x)
and using x as a dictionary key raise an
exception. In this case, x is not hashable
and cannot be a dictionary key.
You normally define _ _hash_ _ only for immutable
objects that also define _ _cmp_ _ and/or
_ _eq_ _. Note that, if there exists any
y such that
x=
=y, even if
y is of a different type, and both
x and y are
hashable, you must ensure that
hash(x)=
=hash(y).
_ _init_ _(self[,args...])
|
|
When a call
C([args...])
creates instance x of class
C Python calls
x._ _init_
_([args...])
to let x initialize itself.
Python performs no implicit call to _ _init_ _
methods of class C's
superclasses. C._ _init_
_ must explicitly perform any needed initialization. For
example, when class C has a base class
B to initialize without arguments, the
code in C._ _init_ _
must explicitly call B._ _init_
_(self) (or better, for new-style classes, call
super(C,
self)._ _init_ _( )).
| _ _new_ _
|
Python 2.2 and later |
When you call
C([args...])
and C is a new-style class, Python will
obtain the new instance x that you are
creating by invoking C._ _new_
_(C,[args...]).
_ _new_ _ is a static method that every new-style
class has (often simply inheriting it from object)
and it can return any value x. In other
words, _ _new_ _ is not constrained to returning a
new instance of C, although normally it is
expected to do so.
When evaluating x as true or false (see Section 4.2.6), for example on a call to
bool(x)
in Python 2.2.1 and later, Python calls
x._ _nonzero_ _( ),
which should return True or
False. When _ _nonzero_ _ is
not present, Python calls _ _len_ _ instead, and
takes x as false when
x._ _len_ _( ) returns
0. When neither _ _nonzero_ _
nor _ _len_ _ is present, Python always takes
x as true.
The
repr(x)
built-in function call, the `x` expression form,
and the interactive interpreter (when x is
the result of an expression statement) call
x._ _repr_ _( ) to
obtain an official, complete string representation of
x. If _ _repr_ _ is
absent, Python uses a default string representation. _
_repr_ _ should return a string with unambiguous
information on x. Ideally, when feasible,
the string should be an expression such that
eval(repr(x))=
=x.
_ _setattr_ _(self, name, value)
|
|
At every request to bind attribute
x.y
(typically, an assignment statement
x.y=value),
Python calls x._ _setattr_
_('y',value).
Python always calls _ _setattr_ _ for any
attribute binding on x; a major difference
from _ _getattr_ _ (_ _setattr_
_ is closer to new-style classes'
_ _getattribute_ _ in this sense). To avoid
recursion, when x._ _setattr_
_ binds x's
attributes, it must modify x._
_dict_ _ directly (e.g., by
x._ _dict_
_[name]=value),
or better, for a new-style class, delegate (e.g., call
super(C, x)._ _setattr_
_('y',value)).
Python ignores the return value of _ _setattr_ _.
If _ _setattr_ _ is absent, Python usually
translates
x.y=z
into x._ _dict_
_['y']=z.
The
str(x)
built-in type and the print
x statement call
x._ _str_ _( ) to
obtain an informal, concise string representation of
x. If _ _str_ _ is
absent, Python calls x._ _repr_
_ instead. _ _str_ _ should return a
conveniently human-readable string, even if it entails some
approximation.
| _ _unicode_ _ |
Python 2.2 and later |
The
unicode(x)
built-in type call, in Python 2.2 and later, invokes
x._ _unicode_ _( ), if
present, in preference to x._
_str_ _( ). If a class supplies both special methods
_ _unicode_ _ and _ _str_ _,
the two should return equivalent strings (of Unicode and plain string
type respectively).
5.3.2 Special Methods for Containers
An instance can be a
container (either a sequence or a mapping, but
not both, as they are mutually exclusive concepts). For maximum
usefulness, containers should provide not just special methods
_ _getitem_ _, _ _setitem_ _,
_ _delitem_ _, _ _len_ _,
_ _contains_ _, and _ _iter_ _,
but also a few non-special methods, as discussed in the following
sections.
<IP_ADDRESS> Sequences
In each item access special method, a
sequence that has L items should accept
any integer key, such that
0<=key<L.
For compatibility with built-in sequences, a negative index
key,
0>key>=-L,
should be equivalent to
key+L.
When key has an invalid type, the method
should raise TypeError. When
key is a value of a valid type, but out of
range, the method should raise IndexError. In
Python 2.1, and also in later Python versions for classes that do not
define _ _iter_ _, the for
statement relies on these requirements, as do built-in functions that
take sequences as arguments.
A sequence should also allow concatenation by +
and repetition by *. A sequence should therefore
have special methods _ _add_ _, _ _mul_
_, _ _radd_ _, and _ _rmul_
_, covered in Section 5.3.3 later in this chapter.
Mutable sequences should also have _ _iadd_ _ and
_ _imul_ _, and the non-special methods covered in
Section <IP_ADDRESS>: append,
count, index,
insert, extend,
pop, remove,
reverse, and sort.
<IP_ADDRESS> Mappings
A mapping's item access
special methods should raise KeyError, rather than
IndexError, when they receive an invalid
key argument value of a valid type. A
mapping should define the non-special methods covered in Section 4.7.3: copy,
get, has_key,
items, keys,
values, iteritems,
iterkeys, and itervalues.
Special method _ _iter_ _ should be equivalent to
iterkeys. A mutable mapping should also define
methods clear, popitem,
setdefault, and update.
<IP_ADDRESS> Sets
Sets, scheduled to be introduced in Python
2.3, can be seen as rather peculiar kinds of
containers—containers that are neither sequences nor mappings,
and cannot be indexed, but do have a length (number of elements) and
are iterable. Unfortunately, the interface of sets (and even the
final decision about introducing them in Python 2.3) is still not
stable as of this writing. Therefore, I do not consider sets in this
book.
<IP_ADDRESS> Container slicing
When you
reference, bind, or unbind a slicing such as
x[i:j]
or
x[i:j:k]
on a container x, Python calls
x's applicable item
access special method, passing as key an
object of a built-in type called a slice object.
A slice object has attributes start,
stop, and step. Each attribute
is None if the corresponding value is omitted in
the slice syntax. For example, del
x[:3] calls
x._ _delitem_
_(y), and
y is a slice object such that
y.stop is
3,
y.start is
None, and
y.step is
None. It is up to container object
x to appropriately interpret the slice
object argument passed to
x's special methods.
Some built-in types, such as list and
tuple, define now-deprecated special methods
_ _getslice_ _, _ _setslice_ _,
and _ _delslice_ _. For an instance
x of such a type, slicing
x with only one colon, as in
x[i:j],
calls a slice-specific special method. Slicing
x with two colons, as in
x[i:j:k],
calls an item access special method with a slice object argument. For
example:
class C:
def _ _getslice_ _(self, i, j): print 'getslice', i, j
def _ _getitem_ _(self, index): print 'getitem', index
x = C( )
x[12:34]
x[56:78:9]
The first slicing calls x._
_getslice_ _(12,34), and the second calls
x._ _getitem_
_(slice(56,78,9)). It's best to avoid
defining the slice-specific special methods in your classes, but you
may need to override them if your class subclasses
list or tuple and you want to
provide special functionality when an instance of your class is
sliced.  When
x is a sequence, _ _contains_
_ should return True when
y equals the value of an item in the
sequence. When x is a mapping, _
_contains_ _ should return True when
y equals the value of a key in the
mapping. Otherwise, _ _contains_ _ should return
False. If _ _contains_ _ is
absent, Python performs y
in x as follows, taking
time proportional to
len(x):
for z in x:
if y= =z: return True
return False
For a request to unbind an item or slice of
x (typically del
x[key]),
Python will call x._ _delitem_
_(key). A
container x should have _
_delitem_ _ only if x is
mutable, so that items (and possibly slices) can be removed.
When
x[key]
is accessed (i.e., when container x is
indexed or sliced), Python calls
x._ _getitem_
_(key). All
containers should have _ _getitem_ _.
For a request to loop on all items of x
(typically for item
in x), Python calls
x._ _iter_ _( ) to
obtain an iterator on x. The built-in
function
iter(x)
also calls x._ _iter_ _(
). If _ _iter_ _ is absent and
x is a sequence,
iter(x)
synthesizes and returns an iterator object that wraps
x and returns
x[0],
x[1], and so on, until
one of these item accesses raises IndexError to
indicate the end of the sequence.
The
len(x)
built-in function call, and other built-in functions that need to
know how many items are in container x,
call x._ _len_ _( ).
_ _len_ _ should return an int,
the number of items in x. Python also
calls x._ _len_ _( ) to
evaluate x in a Boolean context, if
_ _nonzero_ _ is absent. Absent _
_nonzero_ _, a container is taken as false if and only if
the container is empty (i.e., the container's length
is 0).
_ _setitem_ _(self,key,value)
|
|
For a request to bind an item or slice of
x (typically an assignment
x[key]=value),
Python calls x._ _setitem_
_(key,value).
A container x should have _
_setitem_ _ only if x is
mutable, so that items, and possibly slices, can be added and/or
rebound.
5.3.3 Special Methods for Numeric Objects
An instance may support numeric operations
by means of many special methods. Some classes that are not numbers
also support some of the following special methods, in order to
overload operators such as + and
*.
For any numeric operation with two operands
x and y, Python
invokes x._ _coerce_
_(y).
_ _coerce_ _ should return a pair with
x and y
converted to acceptable types. _ _coerce_ _
returns None when it cannot perform the
conversion. In such cases, Python will call
y._ _coerce_
_(x). This
special method is now deprecated: new Python classes should not
implement it, but instead deal with whatever types they can accept
directly in the special methods of the relevant numeric operations.

Built-in function
divmod(x,y)
calls x._ _divmod_
_(y).
_ _divmod_ _ should return a pair
(quotient,remainder)
equal to
(x//y,x%y).
_ _hex_ _(self)
_ _oct_ _(self)
|
|
Built-in function
hex(x)
calls x._ _hex_ _( ).
Built-in function
oct(x)
calls x._ _oct_ _( ).
 Each method should modify
x in-place and return
self.  Each method should modify
x in-place and return
self.
 There is no three-argument form in this
case.
|


Distributed neural network training at scale.
Train densely connected neural network faster than never before on this planet.
Train your speech recognition neural network at least 4x faster with just 5 nodes.
To start the whole cluster, you will only need to know the IP address of one node. No other configuration is required!
See the Getting Started section.
Achieve speedups close to linear in the number of nodes in the cluster ! Even with tens of nodes.
See the Statistics section.
The project is extensively documented to enable you to improve the cluster by adding new fuctionalities easily.
To the DocumentationHow to start the y2 cluster.
On every node that you plan to use as nodes, pull the communication service and the worker service from GitHub (see the Download section).
Start the communication service first using sbt run "y2 node --seed-ip ip
(where you replace ip
with the IP address of one of the node in the cluster).
Then start the worker service on all nodes using python3 main.py
.
Finally, start the client service using sbt run "y2 client --seed-ip ip --node-count n"
(replace ip
with the IP address of one of the node in the cluster and n
with the total number of nodes in the cluster).
That's it, the cluster has started and is training your neural network!
Some results obtained with the y2 cluster.
Neural networks trained with the y2 cluster achieve on average up to a n÷2 speedup in a n-node cluster.
Neural networks trained with the y2 cluster achieve on average up to a 10% increase in accuracy.
The theory behind the magic.
The main problem when parallelizing the training of densely connected neural networks is that communicating the full gradient after each epoch is a huge communication bottleneck (especially when the number of node increases).
To solve this issue, the y2 nodes only send a predefined delta value to apply to a given weight. This delta value is known by all nodes in the cluster. The only information that actually needs to be transmitted is whether the delta is positive or negative and the weight to apply the delta to. This can reasonably be done using 4 bytes of data, thus rastically reducing the amount of communication.
Experiments have proven that such compression does not prevent the neural network from converging.
Our implementation is based on a paper by Amazon.
Download the y2 final report Download the amazon paperThe final report contains more detailed numbers and stats about the cluster. It contains data about experiments we conducted and an anlaysis of the obtained results.
The poster is a short overview of how the cluster works and the achieved results.
Available for all operating systems.
Works with Python 3.6 and above.
5000 Forbes Ave, Pittsburgh, PA 15213
Yannick Bloem
Yves Zumbach


Soup
List of ingredients
- Ingredient 1
- Ingredient 2
- Ingredient 3
- Ingredient 1
- Ingredient 2
- Ingredient 3
- Ingredient 1
- Ingredient 2
- Ingredient 3
- Ingredient 1
- Ingredient 2
- Ingredient 3
This is how you make soup
- First step
- Second step
- Third step
- First step
- Second step
- Third step
- First step
- Second step
- Third step
- First step
- Second step
- Third step


new JSONAPIModel(attrs, options)
Creates a new JSONAPI Model.
Parameters:
| Name | Type | Description |
|---|---|---|
attrs |
Array | The initial value of the attributes to set on the model. |
options |
Object | The set of options to be used by AmpersandModel |
- Mixes In:
- ampersand-jsonapi-ajaxconfig
- Source:
- See:
-
- JSONAPICollection
Requires:
- module:AmpersandModel
- module:ampersand-jsonapi-ajaxconfig
Extends
- AmpersandModel
Requires
- module:AmpersandModel
- module:ampersand-jsonapi-ajaxconfig
Methods
getAttributes(opts, raw) → {Object}
Returns model and associated children and collections as a plain object.
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
Object | The options for getAttributes. |
raw |
Boolean | Specifies whether returned values should be the raw value or should instead use the getter associated with its data type. |
- Source:
Returns:
The plain-JS model object.
- Type
- Object
parse(data) → {Object}
Parses the server response into a format which Ampersand Models expect. Called when collection is initialized.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object | The data received from the server. |
- Source:
Returns:
The transformed model.
- Type
- Object
save(key, val, opts) → {Object}
Saves a model to the persistence layer by delegating to ampersand-sync.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
String | Object | If a string: the property of the model
to change. If an object: the
properties of the model to change as
|
val |
* | Object | If |
opts |
Object | undefined | Options to be used by |
- Source:
Returns:
An XHR object.
- Type
- Object
serialize() → {Object}
Serializes the model into a format which the JSON-API server expects.
- Source:
Returns:
The JSON-API-formatted model.
- Type
- Object


@* * Copyright 2021 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @import config.ApplicationConfig @import helpers.DateFormatter.formatDateWithShortPattern @import java.util.UUID @import domain.models.applications.ClientSecret @import domain.models.applications.Application @import domain.models.developers.Developer @(app: Application, developer: Developer, clientSecrets: Seq[ClientSecret])( implicit request: play.api.mvc.Request[Any], messages: Messages, applicationConfig: ApplicationConfig, flash: Flash) @isNewSecret = @{flash.get("newSecret").isDefined} @allowDeletion = @{clientSecrets.size > 1}
Your client secret is a unique passphrase that you generate to authorise your application.
Use a client secret together with your client ID to test your application in the sandbox.
@helper.form(action = controllers.routes.Credentials.addClientSecret(app.id), 'class -> "form") { @helper.CSRF.formField } } else { @if(isNewSecret) {
We only show you a new client secret once to help keep your data secure.
Copy the client secret immediately.
| Client secrets | Created | Last used | @if(allowDeletion) {} | |
|---|---|---|---|---|
| @if(isNewSecret && secret.id == flash.get("newSecretId").getOrElse("")){ @{flash.get("newSecret").get} } else { ••••••••••••••••••••••••••••••••@{secret.name.takeRight(4)} } | @if(isNewSecret && secret.id == flash.get("newSecretId").getOrElse("")){ Copy } | @{formatDateWithShortPattern(secret.createdOn)} | @{secret.lastAccess.map(formatDateWithShortPattern).getOrElse("Not used")} | @if(allowDeletion) {Delete | }
We only show you a new client secret once to help keep your data secure.
}Rotate your application’s client secret to shorten the period an access key is active, reducing the impact to your business if it is compromised.
To rotate your client secret:
You can have up to 5 client secrets at any time.
You cannot have more than 5 client secrets.
} }


| Week | Date | Content | Prep & Assignments |
| 1 |
Mon 08/26 |
No school |
|
| Tues 08/27 |
No school |
|
| Wed 08/28 |
Lecture 1: Course introduction; fundamentals |
HW 1 (Due Tues 09/03 at 9 AM)
|
| Thu 08/29 |
Discussion |
|
| Fri 08/30 |
Lecture 2: Exact calculations, and bounds |
|
| 2 |
Mon 09/02 |
Holiday |
|
| Tues 09/03 |
Discussion |
HW 2 (Due Mon 09/09 at noon)
|
| Wed 09/04 |
Lecture 3: Intersections of several events |
|
| Thu 09/05 |
Discussion |
|
| Fri 09/06 |
Lecture 4: Updating chances: Bayes' rule |
|
| 3 |
Mon 09/09 |
Lecture 5: A closer look at independence |
HW 3 (Due Mon 09/16 at noon)
|
| Tues 09/10 |
Discussion |
|
| Wed 09/11 |
Lecture 6: Random variables and their distributions: the binomial |
|
| Thu 09/12 |
Quiz 1 |
|
| Fri 09/13 |
Lecture 7: Simple random sampling |
|
| 4 |
Mon 09/16 |
Lecture 8: Exponential approximations |
HW 4 (Due Mon 09/23 at noon)
|
| Tues 09/17 |
Discussion |
|
| Wed 09/18 |
Lecture 9: The Poisson distribution |
|
| Thu 09/19 |
Discussion |
|
| Fri 09/20 |
Lecture 10: Expectation |
|
| 5 |
Mon 09/23 |
Lecture 11: Collections of random variables: joint distribution |
HW 5 (Due Mon 09/30 at noon)
|
| Tues 09/24 |
Discussion |
|
| Wed 09/25 |
Lecture 12: Additivity and the power of Booleans |
|
| Thu 09/26 |
Quiz 2 |
|
| Fri 09/27 |
Lecture 13: Unbiased estimates |
|
| 6 |
Mon 09/30 |
Lecture 14: Updating revisited: conditional distribution |
HW 6 (Due Mon 10/07 at noon)
|
| Tues 10/01 |
Discussion |
|
| Wed 10/02 |
Lecture 15: Expectation by conditioning |
|
| Thu 10/03 |
Discussion |
|
| Fri 10/04 |
Lecture 16: Expectation by conditioning: examples |
|
| 7 |
Mon 10/07 |
Lecture 17: Putting it all together: examples |
No homework (Midterm)
|
| Tues 10/08 |
Discussion |
|
| Wed 10/09 |
Lecture Canceled |
|
| Thu 10/10 |
Discussion Canceled |
|
| Fri 10/11 |
Midterm Canceled |
|
| 8 |
Mon 10/14 |
Lecture 18: Measuring variability |
HW 7 (Due Mon 10/21 at noon)
|
| Tues 10/15 |
Discussion |
|
| Wed 10/16 |
Lecture 19: Typical or unusual? Tails of distributions |
|
| Thu 10/17 |
Discussion |
|
| Fri 10/18 |
Rescheduled midterm (Previously 10/11) |
|
| 9 |
Mon 10/21 |
Lecture 21: Variability of a random sample sum |
HW 8 (Due Tues 10/29 at 11:59 PM)
|
| Tues 10/22 |
Discussion |
|
| Wed 10/23 |
Lecture 22: The accuracy of a simple random sample |
|
| Thu 10/24 |
Discussion |
|
| Fri 10/25 |
Lecture 23: Large samples and the law of averages |
|
| 10 |
Mon 10/28 |
Lecture Canceled |
|
| Tues 10/29 |
Discussion |
HW 9 (Due Tues 11/05 at noon)
|
| Wed 10/30 |
Lecture 24: Central Limit Theorem |
|
| Thu 10/31 |
Quiz 3 |
|
| Fri 11/01 |
Lecture 25: Normal approximation |
|
| 11 |
Mon 11/04 |
Lecture 26: Testing hypotheses |
|
| Tues 11/05 |
Discussion |
HW 10 (Due Tues 11/12 at 11:59 PM)
|
| Wed 11/06 |
Lecture 27: Confidence intervals based on the CLT |
|
| Thu 11/07 |
Discussion |
|
| Fri 11/08 |
Lecture 28: Interpretation of confidence intervals |
|
| 12 |
Mon 11/11 |
Holiday |
|
| Tues 11/12 |
Discussion |
HW 11 (Due Mon 11/18 at noon)
|
| Wed 11/13 |
Lecture 29: Probability density |
|
| Thu 11/14 |
Discussion |
|
| Fri 11/15 |
Lecture 30: The exponential distribution |
|
| 13 |
Mon 11/18 |
Lecture 31: Some properties of the normal distribution |
HW 12 (Due Mon 11/25 at noon)
|
| Tues 11/19 |
Discussion |
|
| Wed 11/20 |
Lecture 32: Prediction: bias and variance |
|
| Thu 11/21 |
Quiz 4 |
|
| Fri 11/22 |
Lecture 33: Bias and variance continued |
|
| 14 |
Mon 11/25 |
Lecture 34: Correlation and regression |
HW 13 (Due Tues 12/03 at 11:59 PM)
|
| Tues 11/26 |
Discussion |
|
| Wed 11/27 |
Holiday |
|
| Thu 11/28 |
Holiday |
|
| Fri 11/29 |
Holiday |
|
| 15 |
Mon 12/02 |
Lecture 35: Error in the regression estimate |
|
| Tues 12/03 |
Discussion |
HW 14 (Due Tues 12/10 at 11:59 PM)
|
| Wed 12/04 |
Lecture 36: The regression model for data |
|
| Thu 12/05 |
Discussion |
Regression Lab (not to be turned in)
|
| Fri 12/06 |
Lecture 37: Inference for the true slope in the regression model |
|
| 16 |
Mon 12/09 |
Review lecture |
|
| Tues 12/10 |
Topical review sessions |
|
| Wed 12/11 |
No lecture |
|
| Thu 12/12 |
No section |
|
| Fri 12/13 |
No lecture |
|
| 17 |
Mon 12/16 |
|
|
| Tues 12/17 |
FINAL EXAM (7 PM to 10 PM) |
|
| Wed 12/18 |
|
|
| Thu 12/19 |
|
|
| Fri 12/20 |
|
|


Speech Recognition¶
Models¶
Currently we support following models:
| Model description | WER, % | Config file | Checkpoint |
|---|---|---|---|
| DeepSpeech2 | 6.71 | ds2_large_mp | link |
| Wavel2Letter | 6.67 | w2l_plus_large_mp | link |
WER is the word error rate obtained on a dev-clean subset of LibriSpeech using
greedy decoder (decoder_params/use_language_model = False
).
For the evaluation we used batch_size_per_gpu = 1
to eliminate the effect of cudnn padding issue.
For more details about model and training parameters, have a look at the configuration files and specific model’s documentation.
Getting started¶
You can start with these instructions to play with a very small model on a toy dataset.
Now let’s consider a relatively lightweight version of DeepSpeech2 based model for English speech recognition on LibriSpeech dataset.
Get data¶
Download and preprocess Librispeech dataset:
python scripts/import_librivox.py
Download and preprocess OpenSLR language model:
scripts/download_lm.sh
Training¶
Let’s train a small DS2 model.
This model can be trained on 12 GB GPU within a day.
Start training:
python run.py --config_file=example_configs/speech2text/ds2_small_1gpu.py --mode=train_eval
If your GPU does not have enough memory, reduce the batch_size_per_gpu
.
Also, you might want to disable evaluation during training by using --mode=train
.
Evaluation¶
In order to get greedy Word Error Rate (WER) metric on validation dataset, please run the following command:
python run.py --config_file=example_configs/speech2text/ds2_small_1gpu.py --mode=eval
If you would like to use beam search decoder with language model re-scoring, please use parameter decoder_params/use_language_model=True
:
python run.py --config_file=example_configs/speech2text/ds2_small_1gpu.py --mode=eval --decoder_params/use_language_model=True
Inference¶
Once training is done (this can take a while on a single GPU), you can run inference:
python run.py --config_file=example_configs/speech2text/ds2_small_1gpu.py --mode=infer --infer_output_file=ds2_out.txt


novel extremophiles: cladogram construction
Background
My first introduction to bioinformatics was during my undergraduate research thesis, and the experiences I had inspired me to pursue more computational work for my graduate studies. For my thesis I used traditional laboratory and genomic techniques to characterize a novel bacteria isolate.
This bacterium, referred to as Eh-2, was collected from the intersection of a hot spring and an alkaline lake in Ethiopia. While in the lab I was conducting growth rate studies, I also was interested in it’s 16S rRNA phylogeny. Based on 75% coverage of the gene and a BLAST query, Eh-2 was only 95% similar to one other organism in culture.
Constructing the 16S rRNA phylogenetic tree was an interesting experience for me as a junior scientist. I was mentored by a post-doc in my lab and learned that there wasn’t a single, standard way to create a tree, and that the process took a bit of careful pruning, preparation, and multiple programs to create.
Methods
This tree was generated through several steps:
- ARB was used to locate both similar as well as more “rooted” organisms (using the SILVA database)
- 16S rRNA sequences of these organisms were gathered from the NCBI Database
- RAxML was used to construct the newick-formatted tree
- MEGA was used to image and design the tree
- Additional formatting of species names was done using Inkscape
Results
The above cladogram was generated with my previously mentioned methods. It was included in my undergraduate honors thesis, and included in presentations for both the Oregon NASA Consortium and the Portland State University McNair Scholars Symposium.
Future
I really enjoyed learning about the well-crafted art of phylogenetic tree construction, and have gone on to learn from other mentors that this is an often opinionated field of work. In the future I would use RAxML, but would probably seek out more up-to-date, open-source tools for the rest of the pipeline.


London
Capital of England
London, the capital of England and the United Kingdom, is a 21st century city with a history dating back to the Roman era. Its center houses Parliament's imposing headquarters, the famous clock tower of Big Ben and Westminster Abbey, the coronation site of the British monarchs. Across the River Thames, the London Eye Giant has panoramic views. More
A 17th century design by the architect Sir Christopher Wren, St. Paul's Cathedral stands on the "City", where the London Stock Exchange conducts negotiations of global reach. Royal sites include Buckingham Palace, which houses the main residence and offices of the monarchy, and the Tower of London, a former prison guarding the crown jewels. The British Museum, National Gallery, Tate Britain and Tate Modern explore local and international history and art. The West End theaters feature classic and avant-garde pieces. Covent Garden, Soho and Spitalfields Market are very frequented areas with restaurants and shops. Trafalgar Square, Hyde Park and Hampstead Heath are other important public spaces.
Things to do
Buckingham
Bridge
Big Ben
London Eye


Registration
MyProfile
Log In
Log Out
Home Page
Users
Tickets
Manifestations
Number of Tickets
Regular
Fan Pit
VIP
Total
Reserve
book_online
Comments
forum
Leave a comment
maps_ugc
Your message
Rating
1
2
3
4
5
send


You know the p
namespace? It’s the one that cleans up your Spring configuration files by providing a shorthand for injecting beans and values:
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean" p:dataSource-ref="dataSource" p:packagesToScan="com.springinpractice.ch10.model" /> ... other beans ... </beans>
Did you know that Spring 3.1 introduces an analogous namespace for constructor injection? Yup—it’s the c
namespace:
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:c="http://www.springframework.org/schema/c" xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"> <bean id="connectionFactoryLocator" class="org.springframework.social.connect.support.ConnectionFactoryRegistry"> <property name="connectionFactories"> <list> <bean class="org.springframework.social.github.connect.GitHubConnectionFactory" c:clientId="${gitHub.clientId}" c:clientSecret="${gitHub.clientSecret}" /> </list> </property> </bean> <bean id="usersConnectionRepository" class="org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository" c:dataSource-ref="dataSource" c:connectionFactoryLocator-ref="connectionFactoryLocator" c:textEncryptor-ref="textEncryptor" /> ... other beans ... </beans>
It works pretty much the same way, but for constructors. You can inject values, or else you can inject references using the -ref
suffix.
With p
, the XML element name comes from the bean property name, but with constructors that’s not available. Instead, for c
we use the name of the constructor parameter itself. So for JdbcUsersConnectionRepository
we’re calling a constructor that looks like this:
public JdbcUsersConnectionRepository(DataSource dataSource, ConnectionFactoryLocator connectionFactoryLocator, TextEncryptor textEncryptor)
where it’s the parameter names themselves (rather than the parameter types) driving the XML element names.
But keep this in mind…
The c
namespace is great, but there’s something you may not have considered. Because the XML element names come from the constructor parameter names, we have to compile the app in debug mode if we want to use this feature (otherwise the local variable names aren’t in the class files), and we want to pay attention to the parameter names we choose. So, for instance, ds
, cfl
and te
wouldn’t be very good constructor parameter names.
Note that Spring (especially Spring Web MVC) has been using parameter names in this fashion for a long time, so that’s nothing new. The @PathVariable
and @RequestParam
annotations, for example, default to using parameter names when explicit names aren’t specified. But in the case of the c
namespace, a bean that supports c
-based injection ought to publish the constructor parameter names, and they become in effect part of the API.
Update
I’ve had a bit of a change of heart regarding the constructor namespace. Here’s why I think the Spring constructor namespace is a bad idea.


Single Sign-on (SSO)¶
SSO allows user to login to different dapps with a single account. It is similar to how you can click a “Login with Facebook/Google” buttons to login to different services using a single Facebook/Google account.
In order for SSO to work, dapp must be integrated with a SSO service. Chromia Vault is the main SSO service in Chromia ecosystem, though a custom SSO service can be easily implemented thanks to FT3 module’s flexible authentication model.
As discussed in previous sections, access to a FT3 account is controlled with authentication descriptors (See Account Management). So if we use a Vault account’s public key to create an authDescriptor
with 'A'
flag, and add it to a dapp account, Vault will have control over the dapp account.
The actual process is done in 3 steps:
User login to their Vault account, and approve of the SSO request.
Vault’s keyPair is used to create a new account for dapp (so dapp account and Vault account will have the same accountId). A second
authDescriptor
with only'T'
flag is created on-the-fly and added to this new dapp account.The user can now use the second keyPair to perform transactions for the account.
This keyPair is meant to be disposable and can safely be discarded or replaced at user’s discretion.
This might sound rather complicated to implement, but fortunately ft3-lib
library already handle all of the heavy works, and dapps only have to config the SSO Class a bit for it to work.
The bootstrap project already contain a client
directory that implement the SSO flow. Let’s go through how to set up the flow using bootstrap client, then we will discuss how to config SSO flow for your own client.
SSO flow with bootstrap client¶
Backup your client
directory somewhere safe, and replace it with the client
directory from bootstrap project.
Set config variables¶
Bootstrap client use dotenv
npm package to set config variables. In client
directory you can see a .env.sample
file. Duplicate the file and rename it to .env
. Update the file with your chain’s settings, besure to uncomment those lines (remove leading #
):
REACT_APP_VAULT_URL=https://vault-testnet.chromia.com
REACT_APP_BLOCKCHAIN_RID=DAPP_BLOCKCHAIN_RID
REACT_APP_NODE_ADDRESS=http://localhost:7743
Setup the dapp on Vault¶
Because our dapp is not public on Chain Explorer yet, we need to config it for testing as a Custom DApp.
Go to the Vault page and login to your account (Follow the instruction at Chromia Vault section if you are unsure).
Scroll down to the “All DApps” section, and click “Add Custom DApp”. Fill in information of your chain (similar to how you did with Chain Explorer during project setup).
You will see your dapp tile added to the Vault’s dapp list.
Now the SSO flow is ready to use. Go back to your dapp (click the tile in Vault’s dapp list), and you will see a login screen. Clicking the login button will redirect you to Vault to login to your Vault account.
If everything was setup correctly, Vault will ask you to authorize dapp. Clicking “Authorize” button will redirect you back to your client, with the newly created account’s information displayed.
If the Authorize page is not displayed, it indicates a problem with your configs. Verify that the BRID and host is correct and try again.
We got the bootstrap client to work with SSO. You can use the bootstrap client as a base to build your own client. But if you want to implement SSO in your own client, the next part discuss how to do exactly that.
SSO Class¶
FT3 provides SSO functionality through SSO class. The first step in integrating SSO into a dapp is to initialize SSO class on the app launch:
import { Blockchain, SSO } from 'ft3-lib';
import { blockchainRID, blockchainUrl, vaultUrl } from './configs/constants'; // these configs are set in project-setup section
const chainId = Buffer.from(blockchainRID, 'hex');
const blockchain = await new Postchain(blockchainUrl).blockchain(chainId);
SSO.vaultUrl = vaultUrl;
const sso = new SSO(blockchain);
Initiate login¶
When user click the “Login with Vault” button, dapp should call initiateLogin
:
const { SSO } from 'ft3-lib';
const successUrl = `${window.location.origin}/success`;
const cancelUrl = `${window.location.origin}/cancel`;
sso.initiateLogin(successUrl, cancelUrl);
initiateLogin
navigates a user to the Vault, where they have to select one of their accounts in order to create a new dapp account or login to existing dapp account. After the user logs in to their vault account and authorizes login or account creation, they will be redirected back to the dapp to finalize login.
successUrl
: where to redirect to after a successful login
cancelUrl
: where to redirect to when user cancels the login
Finalize login¶
If there were no errors, Vault will redirect the user to the location of successUrl
.
Vault will add query parameters containing raw transaction - which needs to be signed by the dapp and posted to the blockchain.
Singing and posting is handled by the finalizeLogin
method:
import { parse } from 'query-string';
const { rawTx } = parse(search); // extract rawTx query parameter
try {
const [account, user] = await sso.finalizeLogin(rawTx);
} catch (error) {
// handle error
}
finalizeLogin
returns a tuple which contains ft3 account
(Account
instance) and ft3 user
(User
instance).
If an account doesn’t already exist, call to finalizeLogin
will create it, and if it was already created, only auth descriptor would be added to the account. Returned user object contains a key pair used to sign the transactions and an auth descriptor to authorize operations.
This same flow is used both for registering new dapp account and login to existing account.
Auto-login (Remember Me)¶
By default, SSO uses an instance of SSOStoreDefault
to keep track of account (account id) and user (key pair) details in memory. As soon as SSO instance is destroyed (e.g. page refresh), account and user details are lost.
But it is also possible to persist them to local storage. Details will be stored to local storage if SSO is initialized with SSOStoreLocalStorage
:
import { SSO, SSOStoreLocalStorage } from 'ft3-lib';
const sso = new SSO(blockchain, new SSOStoreLocalStorage());
On app launch, the auto-login feature can be used to auto login user if they have already logged in previously:
const [account, user] = await sso.autoLogin();
if (account === null) {
// redirect to login page
}
Like finalizeLogin
method, autoLogin
returns account
and user
objects.
Auto login will only work if SSO can find account id and keypair in LocalStorage, and if the authDescriptor
which corresponds to stored key pair didn’t expire.
If autoLogin
returns null
for account
and user
, then user should be redirected to a normal login page, where initiateLogin
should be called to login using the Vault.
Warning
Storing the key pair inside LocalStorage is potentially a security risk, therefore SSOStoreLocalStorage
should only be used if dapp doesn’t require a high level of security.
In high security cases, dapp should implement its own method of preserving user.keyPair
for future use.
Logout¶
Call logout
method to delete local cache and auth descriptor:
await sso.logout();
Note
Make sure you are using the same SSO instance which was used when calling finalizeLogin
, because account and user details are stored in that object instance.
Low level details¶
As briefed in the beginning, SSO flow creates an ft3 account on a dapp’s chain which has the same accountId as the user’s Vault account.
In the flow, Vault is responsible for building a transaction which creates the account and adds an authDescriptor to it. Once Vault passes the transaction to the dapp (via request parameters), dapp signs it and posts it to the blockchain by calling finalizeLogin
.
This transaction will perform 2 operations, which add two auth descriptors to the account. One is added with a call to register_account
operation and second is added with add_auth_descriptor
operation.
First
authDescriptor
is created using Vault public key and has'A'
and'T'
flagsThe second is created using a disposable public key (generated by
initializeLogin
method) with only “T” flag.
If an account with the same accountId as Vault’s account already exists on the blockchain, SSO will only add the second authDescriptor
with disposable public key.
Important
Because the new account need to add the disposable auth descriptor immediately at creation time, it is required that you set a value equal or greater than 1 for rate_limit_points_at_account_creation
in config.template.xml
as we have noted during Project Setup.
If you also need to record additional user information (as discussed below), the minimum value will need to be increased further.
Dapp Account when using SSO¶
SSO can only create a ft3 account, but in most cases that is not enough to store dapp account details.
Using the same example dapp_account
entity in Rell Integration:
entity dapp_account {
key account: ft3.account;
key username: text;
}
We can make some changes to support the SSO flow:
operation create_dapp_account(
username: text,
account_id: byte_array,
auth_descriptor_id: byte_array
) {
val account = auth_and_log(
account_id,
auth_descriptor_id,
list<text>()
);
create dapp_account (account, username);
}
query get_dapp_account(account_id: byte_array) {
return dapp_account @? { .account.id == account_id } (
account_id = .account.id,
username = .username
);
}
And then on the client side the login flow would look like this:
const [account, user] = await blokchain.finalizeLogin(tx);
const dapp_account = await blockchain.query(
'get_dapp_account',
{ account_id: account.id }
);
const username = 'john_doe'; // Fake username
if (!dapp_account) {
await blockchain.call(
op('create_dapp_account', username, account.id, user.authDescriptor.id),
user
);
}
On the login success page, we check if the dapp account exists by calling get_user
query. If null
is returned, that means the account doesn’t exist yet, so we have to create it.
In this oversimplified example, it is done by calling create_user
operation with hard-coded info. In a real dapp, we would need a form where user can enter those account details.
Next time the user logs in, get_user
query will return the dapp account, so the dapp account creations step will be skipped.


Based on what you've told us {{firstname}} gets help with NHS costs and doesn't need to apply
Based on what you've told us You get help with NHS costs and don't need to apply
Because {{firstname}} is under 16:
{% else %}Because you're under 16:
{% endif %}You get free:
- NHS prescriptions
- NHS dental check-ups and treatment
- NHS sight tests
- NHS wigs and fabric supports
You also get some money off the cost of:
- new glasses and contact lenses
You don't automatically get help towards the cost of:
- travel for NHS treatment
However, if your parents are on certain benefits or have little money to live off, you may still be able to get help to pay for travel.
How to get your help
In most circumstances you won't have to do anything as your date of birth will already be on your health records.
To get your free prescriptions
Tick box A (first box down) on the back of the prescription form.
Back to application


About Us
BEST İzmir, one of the local groups, has been operating at Ege University since 2008. In addition to developing students and preparing them for life after graduation by carrying out activities in areas such as engineering competitions and academic courses; With its fun and friendly side, it enables its members to be together in a friendly and cheerful environment.
MAIN ORGANIZATION
MAIN ORGANIZER
Ege University - Computer Engineering
SECRETARY
Ege University - Mechanical Engineering
TOPIC COORDINATOR
Ege University - Food Engineering
FUND RASING TEAM
FR COORDINATOR
Ege University - Chemical Engineering
FR TEAM MEMBER
Ege University - Chemical Engineering
PUBLIC RELATIONS TEAM
PR COORDINATOR
Ege University - Dentistry
PR TEAM MEMBER
Ege University - Dentistry
INFORMATION TECHNOLOGIES TEAM
IT COORDINATOR
Ege University - Chemical Engineering
IT TEAM MEMBER
Ege University - Electrical and Electronics Engineering
IT TEAM MEMBER
Ege University - Mathematics


This tutorial is part of the "Seeing Sounds with Three.JS" tutorial series. In this part we will be getting started with the web audio API to add music to an existing scene.
We're building on the previous part of this series where we created a terrain. The purpose is to get that terrain moving to the beat of any chosen music track, so it looks like the floor is jumping.
However before that can be done, we first need to analyse the chosen sound file and detect the beat- and that is what we will do in this tutorial by creating an audio analyser object. The audioAnalyser will allow us to detect the beat of the music to be used in the next tutorial which will look at using that beat to move our terrain.
The Audio Analyser
The final audioAnalyser script we're create can be seen here:
Overview
Overall the audioAnalyser consists of a constructor, and 5 functions:
- constructor - sets up the objects main properties, such as the sound track.
- loadAudio() - this does what you expect
- decodeAudio() - once the audio is loaded, it needs to be decoded.
- setUpAnalyser() - sets up everything needed to analyse the music
- analyseBoost() - finds the beat
- play() - call this to start everything off
Usage
You can use the audio analyser like this:
//create an instance (providing your sound file path) var audioAnalyser = new AudioAnalyser('objects/audio/music.mp3'); //play music audioAnalyser.play();
How it works
The Audio Context
When instantiating the audioAnalyser, a number of things are set up in the constructor. The main parts are the creation of an Audio Context, the Buffer Source, and the XMLHttpRequest:
//create audio context this.audioCtx = new (window.AudioContext || window.webkitAudioContext)(); //create buffer source this.source = this.audioCtx.createBufferSource(); //create XMLHttpRequest this.request = new XMLHttpRequest();
The Audio Context is used to manage the sound passed into the constructor, and also to play it. All the functionality we need to analyse our music is provided by the Audio Context, such as decoding the music.
A Buffer Source is then created from the Audio Context through calling audioCtx.createBufferSource();
The XMLHttpRequest property is used for fetching the sound from the filepath.
The Audio Buffer
Calling audioAnalyser.play()
starts everything off by triggering loadAudio()
, which uses the request property created in the consturctor to load our sound (as seen in line 3) :
loadAudio:function(){ this.request.open('GET', this.sound, true); this.request.responseType = 'arraybuffer'; var audioAnalyserInstance = this; //on load decode the audio this.request.onload = function() { audioAnalyserInstance.decodeAudio(); } //then send the request this.request.send(); }
Line 4 then sets a response type of arraybuffer for loading the sound. This arraybuffer then becomes part of our request object, and is used to decode the audio. That happens in line 9, where we call decodeAudio();
Decode the Audio
Here, we again use the Audio Context's (this.audioCtx) decodeAudioData function, using our request object as a parameter so that we can access the arraybuffer which it holds (line 4):
decodeAudio:function(){ var audioAnalyserInstance = this; this.audioCtx.decodeAudioData(this.request.response, function(decodedData) { audioAnalyserInstance.setUpAnalyser(decodedData); }, function(e){"Error with decoding audio data" + e.err}); }
The decodeAudioData also has a callback function as the second parameter (line 4), which simply calls the setUpAnalyser function of our audioAnalyser (line 6).
That's all for now
That's enough for one tutorial. In the next part, we'll look at the last section of the audioAnalyser code, and find out how an the audio context's createAnalyser function can be used to analyse the beat.


Candlepin
Candlepin is a lightweight sass lib for lining up elements to a fluid grid. Similar to Susy3, you can just use the sass functions, or if you'd rather it has helper classes too.
Setup
npm install candlepin
@import "/node_modules/candlepin/src/main";
Install the library via npm. @importing (or @using) will get you functions and classes.
@import "~candlepin";
If you're using webpack, instead of typing 'node_modules/' you can just use a tilde.
$columns: 8; $gutter: 8; @import "~candlepin/src/functions";
Here's a more advanced way to use it - using only the functions while passing in custom settings.
Specifying settings like this just sets defaults that will be used for all the sass functions, but you can always override these whenever you use any of the functions.
Examples
Three Columns
See the Pen MWKOMML by Kevin Hamer (@khamer) on CodePen.
Uneven Columns
See the Pen ExPbqLg by Kevin Hamer (@khamer) on CodePen.
Skipping Columns
See the Pen NWxwQmZ by Kevin Hamer (@khamer) on CodePen.
Wrapping with the Mixin
See the Pen QWyQVVZ by Kevin Hamer (@khamer) on CodePen.
Custom Grid (Mosaic)
See the Pen Candlepin Mosaic Example by Kevin Hamer (@khamer) on CodePen.
Settings
$columns
Number of columns. Defaults to 12.
$gutter
Width of gutters. Defaults to 30px.
Functions
This the recommended way to use this library – using these functions within your own components.
span(<columns> [, <total columns>, <gutter>])
Returns an appropriate value for a width that spans the number of columns specified. For example, span(1)
spans one column, span(2)
spans two column and the enclosed gutter, etc.
left(<columns> [, <total columns>, <gutter>])
Returns an appropriate value for a left margin to shift content over the number of columns and gutters specified. For example, left(1)
shifts over one column and gutter, left(2)
is for two columns and gutters, etc.
right(<columns> [, <total columns>, <gutter>])
Same as left()
.
gutter(<columns> [, <total columns>, <gutter>])
Returns an appropriate value for a gutter that also spans the number of columns specified. For example, gutter()
or gutter(0)
is a single gutter,gutter(1)
spans one column and two gutters, etc.
Mixins
@include wrap(<columns> [, <total columns>, <gutter>])
Just one. meant to be used on the child elements of a flex container to specify how things should wrap. For example, wrap(4)
will make 4-column wide cells that wrap, etc.
Classes
For those of you who just want to use classes, here's some classes. They follow ABEM standards.
.grid
Equivalent to
display: flex; flex-wrap: wrap;
.grid__cell
No associated styles.
.grid__cell.-span-<columns>
Equivalent to
width: span(<columns>);
.grid__cell.-left-<columns>
Equivalent to
margin-left: left(<columns>);
.grid__cell.-right-<columns>
Equivalent to
margin-right: right(<columns>);
.grid__cell.-gutter-<columns>
Equivalent to
margin-left: gutter(<columns>);


New-Home
Orphanages
About
blog
more
Filter by name, Region, district or educational level
Orphanage Name*
Region*
Ahafo Region
Bono Region
Bono East Region
Oti Region
North East Region
Savannah Region
Western North Region
Western Region
Western Region
Volta Region
Greater Accra Region
Eastern Region
Ashanti Region
Central Region
Northern Region
Upper East Region
Upper West Region
Level*
kindergaten
primary
Junior High
Gender*
Male
female
Search
Clear Filter
Search Result(s) Found 12 Orphanages
Demo One: Priscilla Ocla
Sign Up
Demo One: Priscilla Ocla
Demo One: Priscilla Ocla
Demo One: Priscilla Ocla
Demo One: Priscilla Ocla
Demo One: Priscilla Ocla
Demo One: Priscilla Ocla
Demo One: Priscilla Ocla
Demo One: Priscilla Ocla
Demo One: Priscilla Ocla
Demo One: Priscilla Ocla
Demo One: Priscilla Ocla


Explore
Eat
Rate
Organize Your Favorite Places
A Filter to Find What You're Craving
Edit Your Lists of Restaurants
Calculate Costs
Rate the Cuisine
Share with Friends
Get Started Today
Click the button to be taken to the app and start your food adventures. Joining is free and easy. Go ahead. Click it!


XMINICOM(1) Linux Users Manual XMINICOM(1) NAME xminicom - friendly serial communication program SYNOPSIS xminicom minicom-options DESCRIPTION Xminicom is a script wrapper around minicom. It tries to find a color capable xterm or rxvt on your system, and then runs minicom with the -c (color) flag in a terminal session. OPTIONS See minicom (1). AUTHOR Miquel van Smoorenburg<EMAIL_ADDRESS>SEE ALSO minicom(1) September 14, 1998 XMINICOM(1)


--- layout: post title: Fanfare for the Common Programmer post_id: 301 categories: - announcements date: 2004-03-16 15:07:00.000000000 -07:00 author: Jamis permalink: 2004/3/16/fanfare-for-the-common-programmer.html ---
Today I released Copland 0.1.0 “Fanfare for the Common Programmer”. Copland is an inversion of control container (similar to [Hivemind]) for the Ruby programming language.
It’s been a pretty wild ride today. After about 4 days of work on Copland, I finally released it. My intention was to name it after the American composer Aaron Copland, but I spelled the name wrong… the first release was labeled “Copeland”. Oops.
So, after some juggling and rushing, I managed to get that little typo fixed (thanks to lots of help from various people in the Ruby community. Tom Copeland, who runs [RubyForge], has been especially helpful).
This was a great opportunity for me to learn more about the RubyGems project, a new way of packaging and distributing Ruby libraries. It is really slick. I mean, slicker than anything I’ve seen for Ruby in a long time. And so easy to use!
At any rate, it’s time for bed, if I can get Katie to sleep. She just had about 3 ounces of forumla and is acting wide awake… argh…


In the above charts we can see how Sachin Tendulkar, achieved remarkable feats throughout his long spanning carrer. He played extremely well in the both innings of the game, scored runs against the best teams in the world, scored centuries when his team needed him, scored consistently and even performed fair enough with the ball


- Section 1: Wednesday, February 17, 2021
- Section 2: Tuesday, February 23, 2021
Note to Section 2 (TuTh): Hood College has designated Thursday February 18 to be one of the four days this semester where there are no classes. There will be no video to watch — we will have our next class meeting until Tuesday, February 23.
Overview
Today we cover the third effect in the individual demand function: the (own) price effect, aka the law of demand: how changes in a good’s (own) price affect quantity demanded for that good.
We introduce the idea of (simplified, own-price) demand functions, inverse demand functions, and a demand curve. I will also show you examples of how we derive demand functions and curves.
The other major concept today is breaking apart the law of demand into two effects: the (real) income effect, and the substitution effect. We considering them conceptually and graphically. These can be a difficult concept for students to grasp.
Readings
- Ch. 2.2, 5.3, in Goolsbee, Levitt, and Syverson, 2019
Interactive Examples
- Visualizing the Consumer’s Problem
- Visualizing Changes in the Consumer’s Problem
- Visualizing Demand Shifters
These are examples that I wrote in R/Shiny in the past, to visualize what it is we are looking at. As I find more time, I will update these and integrate them into our slides, but until then, I will just post links.
The first is a visual example of the static (one-time) Consumer’s problem. You can adjust things about the (Cobb-Douglas) utility function, income, and prices, and see how it would affect the graph and the optimum.
The second is a visual example of dynamic changes in the Consumer’s problem. The consumer starts at a pre-defined optimum. You can adjust any of the budget constraint parameters \((m, p_x, p_y)\), and see how it would affect a new optimum, which you can compare the the original optimum.
The third is a visual example of a hypothetical demand function for beer, with preference intensity, income, price of nachos (a complement), and price of wine (a substitute) as inputs to the function. Based on some pre-defined functions (in the background), you can change any of the inputs and see how it would affect the (inverse) demand function, expressed as a simple demand curve.
I hope some time to clean these up and make a few more, such as “Visualizing the Income and Substitution Effects” and “Estimating a Demand Function from Real World Data.”
Assignments
Problem Set 1 Due
Problem set 1 is due by PDF upload to Blackboard Assignments.
Problem Set 2 Due Sun Feb 28
Problem set 2 (on classes 1.6-1.8) is due by 11:59 PM Sunday, February 28 by PDF upload to Blackboard Assignments.
Exam 1 Week of Mar 1
If you see on the schedule, we will quickly complete the materials needed for Exam 1. Expect it to be the week of March 1, with more details coming by early next week.
Appendix
Example Demand Functions
The examples below show how we can take a utility function and derive a demand function.
Perfect Substitutes
Recall that perfect substitutes have indifference curves that are straight lines (constant MRS), and have a utility function of: \[u(x,y)=w_1x+w_2y\]
Since both the budget constraint and the indifference curves are straight lines, we will not have a point of tangency between them, but a point(s) where the lines intersect.
library("mosaic")
library("ggrepel")
update_geom_defaults("label", list(family = "Fira Sans Condensed"))
IC_s1=function(x){6-x}
IC_s2=function(x){8-x}
IC_s3=function(x){10-x}
BC=function(x){4-0.5*x}
point_sub<-tribble(
~letter, ~x, ~y,
"A", 8, 0
)
#colors<-c("b=50/a" = "#20A387FF", "b=25/a" = "#39568CFF", "b=10/a" = "#39568CFF")
ggplot(data.frame(x=c(0,10)), aes(x=x))+
stat_function(fun=IC_s1, geom="line", size=2, color = "#481567FF")+
stat_function(fun=IC_s2, geom="line", size=2, color = "#39568CFF")+
stat_function(fun=IC_s3, geom="line", size=2, color = "#20A387FF")+
stat_function(fun=BC, geom="line", size=2, color = "red")+
geom_label(aes(x=2,y=IC_s1(2)), color = "#481567FF", label="u=6", size = 6)+
geom_label(aes(x=2,y=IC_s2(2)), color = "#39568CFF", label="u=8", size = 6)+
geom_label(aes(x=2,y=IC_s3(2)), color = "#20A387FF", label="u=10", size = 6)+
geom_label(aes(x=1,y=BC(1)), color = "red", label="BC", size = 6)+
geom_point(data = point_sub,
mapping=aes(x=x, y=y),
size = 4)+
geom_text_repel(data = point_sub,
mapping=aes(x=x, y=y,
label = letter),
size = 6)+
scale_x_continuous(breaks=seq(0,10,1),
limits=c(0,10),
expand=expand_scale(mult=c(0,0.1)))+
scale_y_continuous(breaks=seq(0,10,1),
limits=c(0,10),
expand=expand_scale(mult=c(0,0.1)))+
coord_cartesian(clip="off")+
labs(x = "a",
y = "b",
title = "Optimal Consumption for Substitutes",
caption = expression(paste(u(x,y)==x+y, ", ", m, " = $20.00, ", p[x]," = $2.50, ", p[y]," = $5.00", sep=" ")))+
theme_classic(base_family = "Fira Sans Condensed", base_size=20)
There are three possible cases,
- if \(p_x>p_y\), the slope of the budget constraint is flatter than the slope of the indifference “curves.” The optimal bundle is spending all income on good \(x\).
- if \(p_x<p_y\), the slope of the budget constraint is steeper than the slope of the indifference “curves.” The optimal bundle is spending all income on good \(y\).
- if \(p_x=p_y\), the budget constraint and indifference “curves” are the same line, so any point on the lines is optimal!
The first two cases are known as “corner solutions,” where a consumer chooses all of one good, and none of another. Note perfect substitutes are not convex, and violate the assumption that “averages are preferred to extremes.”
We can therefore write the demand function for good x (and similarly for y):
\[q_d^x = \begin{cases} \frac{m}{p_x} & \text{When } p_x < p_y\\ \text{any number between 0 and } \frac{m}{p_x} & \text{When } p_x=p_y\\ 0 & \text{When } p_x > p_y\\ \end{cases}\]
Perfect Complements
Recall that perfect complements have indifference curves that are right angles, and have a utility function of: \[u(x,y)=\min \{w_1x,w_2y\}\]
The optimal choice must always be at the corner of the indifference “curves.”
library("mosaic")
library("ggrepel")
update_geom_defaults("label", list(family = "Fira Sans Condensed"))
BC_c=function(x){6-x}
point_comp<-tribble(
~letter, ~x, ~y,
"A", 3, 3
)
ggplot(data.frame(x=c(0,5)), aes(x=x))+
stat_function(fun=BC_c, geom="line", size=2, color = "red")+
geom_label(aes(x=1,y=BC_c(1)), color = "red", label="BC", size = 6)+
geom_segment(aes(x=2, xend=2, y=10, yend=2), size=1, color="#453781FF")+
geom_segment(aes(x=2, xend=10, y=2, yend=2), size=1, color="#453781FF")+
geom_segment(aes(x=3, xend=3, y=10, yend=3), size=1, color="#20A387FF")+
geom_segment(aes(x=3, xend=10, y=3, yend=3), size=1, color="#20A387FF")+
geom_label(aes(x=9, y=2), size=6, color="#453781FF", label="u=2")+
geom_label(aes(x=9, y=3), size=6, color="#20A387FF", label="u=3")+
geom_point(data = point_comp,
mapping=aes(x=x, y=y),
size = 4)+
geom_text_repel(data = point_comp,
mapping=aes(x=x, y=y,
label = letter),
size = 6)+
scale_x_continuous(breaks=seq(0,10,1),
limits=c(0,10),
expand=expand_scale(mult=c(0,0.1)))+
scale_y_continuous(breaks=seq(0,10,1),
limits=c(0,10),
expand=expand_scale(mult=c(0,0.1)))+
labs(x = "x",
y = "y",
title = "Optimal Consumption for Complements",
caption = expression(paste(u(x,y)==min(x,y), ", ", m, " = $20.00, ", p[x]," = $2.50, ", p[u]," = $2.50", sep=" ")))+
theme_classic(base_family = "Fira Sans Condensed", base_size=20)
The consumer is purchasing equal amounts of \(x\) and \(y\) in this example, no matter what the prices are of either, so \(x=y\). We must satisfy the budget constraint, that \(p_xx+p_yx=m\) (recall \(y=x\)). Solving this for \(x\) gives us the demand function for good x:
\[q_D^x=q_D^y=\frac{m}{p_x+p_y}\]
This should be intuitive: the consumer must always purchase equal amounts of \(x\) and \(y\), so it’s as if the consumer was spending all of their income on a single good \((x+y)\) that has a price of \((p_x+p_y)\).
Cobb-Douglas
Now we come to a more realistic demand function. If a consumer has a Cobb-Douglas utility function1 \[u(x,y)= a \ln x+ b \ln y\]
Then we are solving the following constrained optimization problem:
\[\max_{x,y} a \ln x + b \ln y\] \[\text{subject to } p_xx+p_yy=m\]
I will solve this using the Lagrangian method.2
\[\mathbb{L}=a \: ln \: x + b \: ln \: y - \lambda(p_x x + p_y y - m)\]
The First Order Conditions are:
\[\begin{align*} \frac{\partial \mathbb{L}}{\partial x} = \frac{a}{x}-\lambda p_x &= 0\\ \frac{\partial \mathbb{L}}{\partial y} = \frac{b}{y}-\lambda p_y &= 0\\ \frac{\partial \mathbb{L}}{\partial \lambda} = p_xx+p_yy-m &= 0\\ \end{align*}\]
Rearranging the first two FOCs:
\[\begin{align*} a&=\lambda p_x x\\ b&=\lambda p_y y\\ \end{align*}\]
Adding them together:
\[\begin{align*} a+b&=\lambda(p_xx+p_yy)\\ a+b&=\lambda m\\ \end{align*}\]
Solving for \(\lambda\):
\[\lambda=\frac{a+b}{m}\]
Substitute this back into each of the first two FOCs and solve for \(x\) and \(y\), respectively, to get:
\[\begin{align*} x&=\frac{a}{a+b}\frac{m}{p_x}\\ y&=\frac{b}{a+b} \frac{m}{p_y}\\ \end{align*}\]
These are the demand functions for goods \(x\) and \(y\). One of the convenient properties of Cobb-Douglas preferences is that a consumer spends a constant fraction of income \((\frac{a}{a+b})\) on good \(x\), and the complement fraction \((\frac{b}{a+b})\) on good \(y\)!^This becomes especially simple when the exponents \(a+b=1\), as in:
\[u(x,y)=x^ay^{(1-a)} \quad \quad \text{where 0 < a < 1}\]
So \(a\) and \(1-a\) are proportions of \(m\)!]
For a constant value of \(p_x\), this is a linear function of \(m\). So doubling, tripling, etc. \(m\) will double, triple, etc. quantity demanded for \(x\). So the income expansion path (see previous class) is a straight line through the origin with a slope \(\frac{a}{p_x}\).
EXAMPLE
Suppose a consumer has a utility function
\[u(x,y)=x^{0.5}y^{0.5}\]
and faces constraints of \(m=50\), \(p_a=10\), \(p_b=5\).
\[\max_{x,y} x^{0.5}y^{0.5}\] \[\text{subject to } 10x+5y=50\]
Write the Lagrangian (and taking logs of the objective function, for simplicity):
\[\mathbb{L} = 0.5 \: ln \: x+0.5 \: ln \: y-\lambda(10x+5y-50)\]
FOCs are:
\[\begin{align*} \frac{\partial \mathbb{L}}{\partial x} = \frac{0.5}{x}-10\lambda &= 0 \\ \frac{\partial \mathbb{L}}{\partial y} = \frac{0.5}{y}-5\lambda &= 0 \\ \frac{\partial \mathbb{L}}{\partial \lambda} = 10x+5y-50 &= 0\\ \end{align*}\]
Rearrange the first two FOCs:
\[\begin{align*} 0.5&=10 \lambda x\\ 0.5&=5 \lambda y\\ \end{align*}\]
Add then together, and solve for \(\lambda\):
\[\begin{align*} 1&=\lambda(10x+5y)\\ 1&=\lambda(50)\\ \frac{1}{50}&=\lambda\\ \end{align*}\]
Now substitute lambda into each of the first two FOCs, solving for \(x\) and \(y\), respectively:
\[\begin{align*} \frac{0.5}{x}&=10(\frac{1}{50})\\ 10x&=0.5(50)\\ x&=2.5\\ \end{align*}\]
\[\begin{align*} \frac{0.5}{y}&=5(\frac{1}{50})\\ 10x&=0.5(50)\\ y&=5\\ \end{align*}\]
This consumer buys 2.5 units of \(x\) at $10/each ($25) and 5 units of \(y\) at $5/each ($25), spending all $50.
Recall the utility function is
\[u(x, y)=\sqrt{xy}=x^{0.5}y^{0.5}\]
Note the Cobb-Douglas exponents on \(x\) and \(y\) are equal and sum to 1: \((a\) and \(1-a=0.5)\). So the consumer spends \(a=50\%\) of her income on \(x\), and \(1-a=50\%\) on \(y\).
To get the demand functions for \(x\) and \(y\), go back to the FOCs, and keep all budget constraint terms as variables \((p_x, p_y, m)\).
\[\begin{align*} \frac{\partial \mathbb{L}}{\partial x} = \frac{0.5}{x}-p_x\lambda &= 0 \\ \frac{\partial \mathbb{L}}{\partial y} = \frac{0.5}{y}-p_y\lambda &= 0 \\ \frac{\partial \mathbb{L}}{\partial \lambda} = p_xx+p_yy-m &= 0\\ \end{align*}\]
Rearrange the first two FOCs:
\[\begin{align*} 0.5&=p_x \lambda a\\ 0.5&=p_y \lambda y\\ \end{align*}\]
Add then together, and solve for \(\lambda\):
\[\begin{align*} 1&=\lambda(p_xx+p_yy)\\ 1&=\lambda(m)\\ \frac{1}{m}&=\lambda\\ \end{align*}\]
Substitute this back into each of the first two FOCs and solve for \(x\), and \(y\), respectively, to get:
\[\begin{align*} \frac{0.5}{x}-p_x\lambda&=0\\ \frac{0.5}{x}-p_x \left(\frac{1}{m}\right)&=0\\ \frac{0.5}{x}&=\frac{p_x}{m}\\ p_xx&=0.5m\\ x&=0.5\frac{m}{p_x}\\ \end{align*}\]
\[\begin{align*} \frac{0.5}{y}-p_y\lambda&=0\\ \frac{0.5}{y}-p_y \left(\frac{1}{m}\right)&=0\\ \frac{0.5}{y}&=\frac{p_y}{m}\\ p_yy&=0.5m\\ y&=0.5\frac{m}{p_y}\\ \end{align*}\]
These are the demand functions for \(x\) and for \(y\).3
Note if we want to graph this, we need to find the inverse demand function by solving for \(p_x\):
\[\begin{align*} x&=0.5\frac{m}{p_x} \\ p_xx&=0.5m\\ p_x&=0.5\frac{m}{x} \\ \end{align*}\]
Now we can graph a demand function for a given amount of income. As income changes, the demand curve shifts. Here are two examples, one where \(m=20\) and another where \(m=40\):
library("mosaic")
library("ggrepel")
cd1=function(x){0.5*20/x}
cd2=function(x){0.5*40/x}
point_sub<-tribble(
~letter, ~x, ~y,
"A", 8, 0
)
ggplot(data.frame(x=c(0,10)), aes(x=x))+
stat_function(fun=cd1, geom="line", size=2, color = "blue")+
stat_function(fun=cd2, geom="line", size=2, color = "blue", linetype="dashed")+
geom_label(aes(x=3,y=cd1(3)), color = "blue", label="Demand: m=20", size = 6)+
geom_label(aes(x=6,y=cd2(6)), color = "blue", label="Demand: m=40", size = 6)+
scale_x_continuous(breaks=seq(0,10,1),
limits=c(0,10),
expand=expand_scale(mult=c(0,0.1)))+
scale_y_continuous(breaks=seq(0,10,1),
limits=c(0,10),
expand=expand_scale(mult=c(0,0.1)),
labels = function(x){paste("$", x, sep="")})+
coord_cartesian(clip="off")+
labs(x = "Quantity of x",
y = "Price of x",
title = "Demand Curve",
caption = expression(p_x==0.5*m/x))+
theme_classic(base_family = "Fira Sans Condensed", base_size=20)
Note: Natural logs are easier to work with, this function is equivalent to \(u(x,y)=x^ay^b\).↩
Note you could solve this by substitution. Use the definition of the optimum, that \(\frac{MU_x}{MU_y}=\frac{p_x}{p_y}\), plug in, and solving carefully for \(x\).↩
Note you can just take the rule learned above, that \(x=a\frac{m}{p_x}\) and \(y=b\frac{m}{p_y}\) and plug in \(a\) and \(b\).↩


Metalogue Multi-Issue Bargaining Dialogue, Linguistic Data Consortium (LDC) Catalog Number LDC2017S11 and ISBN 1-58563-805-6, was developed by the Metalogue Consortium under the European Community's Seventh Framework Programme for Research and Technological Development. This release consists of approximately 2.5 hours of semantically annotated English dialogue data that includes speech and transcripts.
The goal of the Metalogue project was to develop a dialogue system with flexible dialogue management to enable the system's behavior in setting goals, choosing strategies and monitoring various processes. Participants were involved in a multi-issue bargaining scenario in which a representative of a city council and a representative of small business owners negotiated the implementation of new anti-smoking regulations. The negotiation involved four issues, each with four or five options. Participants received a preference profile for each scenario and negotiated for an agreement with the highest value based on their preference information. Negotiators were not allowed to accept an agreement with a negative value or to share their preference profiles with other participants.
Six unique subjects (undergraduates between 19 and 25 years of age) participated in the collection. The dialogue speech was captured with two headset microphones and saved in 16kHz, 16-bit mono linear PCM FLAC format. Speech signal files are of two types: full dialogue session; and segmented speech signal, cut per speaker and roughly per turn.
Transcripts were produced semi-automatically, using an automatic speech recognizer followed by manual correction.
Seven types of annotation were performed manually using the Anvil tool: dialogue act annotations; discourse structure acts; contact management acts; task management dialogue acts; negotiation moves; rhetorical relations; and disfluencies in speech production. More information about the annotation process is included in the documentation.
All text is presented in UTF-8 as either plain text or XML.
Please see file.tbl for a complete file list as well as checksums for this publication.
Additional information, updates, bug fixes may be available in the LDC catalog entry for this corpus at LDC2017S11.
Portions © 2017 Saarland University (USAAR), © 2017 Trustees of the University of Pennsylvania


1 Introduction
1.7 Setting up a Development Environment
The last thing we need to do before you're off and running is to discuss a good standard process for setting up a development environment. There are several key aspects to this:
- Intent
- exploring LFE and LFE examples
- creating an LFE library
- creating an LFE service/daemon/application
- hacking on LFE itself
- Tools
- kerl
- rebar
- testing
- IDEs
This section takes a pragmatic approach of getting started as quickly as possible, so we will not cover these in great detail. However, we will provide useful links and additional references so that you can explore at your own leisure.
1.7.1 Starting from Scratch
In the LFE Quick Start, you saw how to get up and running, and we're going to repeat some of that here. However, we do this for the sake of completeness and having all the information in one easy-to-access reference.
1.7.2 lfetool
lfetool is a powerful little utility that eases the tasks of the LFE developer. It can do everything from install software to run tests and start up REPLs.
Since using lfetool
makes pretty much everything easier, we'll rely on it
heavily for the development tasks described in the LFE documentation. Let's
get it set up.
Here's how to download and install it:
$ curl -L -o ./lfetool https://raw.github.com/lfe/lfetool/master/lfetool
$ bash lfetool install lfetool /usr/local/bin
If you already have lfetool
installed, but it's been a while, you should
probably update it:
$ lfetool update
Development on lfetool
is on-going, with new features landing on a fairly
regular basis. It's probably a good idea to update rather freqently, to take
advantage of the latest improvements. Also note that all versions are tagged;
should you ever want to revert to an earlier release, it is rivial to do so.
1.7.3 Dependencies
kerl
First and foremost, you're going to need Erlang. In the course of your
experiments with LFE, you may want to try out different versions of Erlang, so
we'll start off right: using
kerl. If you don't have Erlang
install or you want to be able to run multiple versions of Erlang, instlal
kerl
:
$ lfetool install kerl
This will download and save it to /usr/local/bin
.
rebar
Next up is rebar. No matter what your intent with LFE, you're going to need
rebar
sooner or later. We don't rely on it exlusively (e.g., we have our
own test runner), but we do use it for maintaining and compiling dependencies.
$ lfetool install rebar
1.7.4 How to Use LFE
There are many ways in which you may download and use LFE:
- As a project dependency
- Via a direct
git clone
working directory - A "system-wide" install (where system here is defined as your currently active version of Erlang)
More often than not, you won't be downloading and directly interacting with
LFE code. Rather, you'll be including LFE in your project dependencies (the
rebar.config
file).
<IP_ADDRESS> Project Install
To create a new LFE project, with your rebar.config
set up to download LFE,
simply do the following:
$ lfetool new library my-lib
$ cd my-lib
$ make compile
Or, if you want to build an OTP app:
$ lfetool new service my-svc
$ cd my-svc
$ make compile
<IP_ADDRESS> Getting and Building LFE
You can, of course, just do it the old fashioned way:
$ git clone git://github.com/rvirding/lfe.git
$ cd ./lfe
$ rebar compile
<IP_ADDRESS> Installing LFE
We don't actually recommend installing LFE system-wide. The only time it's
really necessary is when you want to run lfescript
scripts from anywhere
on your box.
In such a case, here's what you do:
$ lfetool install lfe
1.7.5 A Test Drive with the REPL
With LFE built, you're ready to play :-) If you've created an LFE project with
lfetool
, you can use the make target provided for you:
$ make shell
This will compile all the deps; if you want to skip that, you can do:
$ make shell-no-deps
This will compile just your project code. If that's more hand-holding than
you need and you don't want anything compiled for you before you leap into
the REPL, you can just use lfetool
directly:
$ lfetool repl lfe
Note that all of the above commands will look for and add dependency directories
to ERL_LIBS
and start Erlang/LFE with those defined.
If you're running from an LFE working directory, you can simply do this:
$ ./bin/lfe -pa ./ebin
Once you are in the REPL you can Lisp it up:
> (* 6 7)
42
> (cons 6 7)
(6 . 7)
> (cons (list 6 7) (list 40 2))
((6 7) 40 2)
> (* 2 (+ 1 2 3 4 5 6))
42
> (lists:foldl (lambda (n acc) (+ n acc)) 0 (lists:seq 1 6))
42
>
1.7.6 Running Some Examples
While in the REPL, you can run some examples by slurp
ing them in:
> (slurp "./examples/internal-state.lfe")
#(ok internal-state)
> (set account (new-account "Alice" 100.00 0.06))
#Fun<lfe_eval.10.6046715>
> (send account 'name)
"Alice"
> (send account 'balance)
100.0
>
And another one:
> (slurp "./examples/church.lfe")
#(ok church)
> (church->int1 (three))
3
>
To quit out of the REPL, hit ^g
and then q<ENTER>
.
1.7.7 An Example IDE: Sublime Text 2
First off: our definition of "IDE" is text editor + REPL + terminal. So there you have it.
As we are sure is obvious, you can use any text editor you want with LFE. If you're a Lisper, Emacs might be a natural choice. Vim, quite honestly, can work just as well.
For this example, though, we will be using Sublime Text 2 as the example editor. To use LFE effectively with Sublime, we recommend the following plugins:
Package Control
Bracket Highlighter
Lisp Indent
Trailing Spaces
LFE
Theme - Vim Blackboard (for those who like dark editors and a classic terminal syntax highlight look)
Instructions for installing Package Control are here.
After the restart, you're ready to go. For each package you want to install, do the following:
Go to Sublime Text 2 -> Preferences -> Package Control
Type "Package Control: Install Package"
Wait for the text entry box to display (available packages are loading)
Enter the name of the package you want to install and hit
<ENTER>
After you have done that for each packge, you will need to restart. Many of the packages will then have their own entries under Sublime Text 2 -> Preferences -> Package Settings where you can copy the default settings and paste them into your own ("User") settings, modifying as you see fit.
To configure the dark theme, you'll want to visit see the project README.
The LFE plugin doesn't need any configuration. Once you restart Sublime, it should recognize your LFE files by the file extension.
For the Lispindent plugin you will need to add some configuration. Go to Sublime Text 2 -> Preferences -> Package Settings -> Lispindent and click on "Settings - User". In the new file that pops up, paste the following:
{
"languages": {
"LFE": {
"detect": ".*\\.(lfe)$",
"syntax": "LFE.tmLanguage",
"default_indent": "function",
"regex":
["(ns|fn|def[^\\s]*|bound-fn|if|if-not|case|condp|when|while|",
"when-not|when-first|do|future|comment|doto|locking|proxy|",
"with-open|with-precision|with-local-vars|reify|deftype|",
"defrecord|defprotocol|extend|extend-protocol|extend-type|",
"try|catch|finally|let|letfn|binding|loop|for|doseq|dotimes|",
"when-let|if-let|defstruct|struct-map|assoc|defmethod|testing|",
"deftest|use-fixtures|handler-case|handle|dotrace|deftrace|",
"begin|case|delay|do|define|lambda|let|let\\*|letrec|",
"let-values|let\\*-values|sequence|let-syntax|letrec-syntax|",
"syntax-rules|syntax-case|call-with-input-file|",
"with-input-from-file|with-input-from-port|",
"call-with-output-file|with-output-to-file|",
"with-output-to-port|call-with-values|dynamic-wind|catch|",
"defvar|defclass|defconstant|defcustom|defparameter|defconst|",
"define-condition|define-modify-macro|defsetf|defun|",
"defgeneric|define-setf-method|define-self-expander|",
"defmacro|defsubst|deftype|defmethod|defpackage|defstruct|",
"dolist|dotimes|lambda|let|let\\*|prog1|prog2|unless|when)$"]
}
}
}
Your text editor is now ready to rock out some LFE!
1.7.8 A Quick Note on Writing Tests
We've covered getting LFE running, using the REPL, and operating your text editor in an LFE-friendly manner. The next of the essentils we need to look at is unit tests. This will be covered in much more detail in the TDD section of the Checks and Testing chapter.
For now, though, let's give you a quick overview... and some caveats. In fact, let's do the caveats first.
Ideally, LFE would use eunit
, like it does with most other libraries.
Unfortunately, there are some quirky edge cases in LFE's Erlang macro handling
that prevent correct usage of eunit
. As such, an
interim solution was created.
Once the macro issue
in LFE is addressed for eunit (and progress is being made!), we will be
able to abandon lfeunit (or make it a thin wrapper).
A quick and dirty intro to using lfeunit follows:
Create the
test/unit
directories in your project, if they don't already exist.In
test/unit
, create aunit-<module-name>-tests.lfe
file.Ensure that your module name matches in the file:
(defmodule unit-<module-name>-tests
...)
- Update the import statement to include the unit test functions you need, as well as the required include, e.g.:
...
(import
(from lfeunit-util
(check-failed-assert 2)
(check-wrong-assert-exception 2))))
(include-lib "include/lfeunit-macros.lfe")
...)
- Create test functions of the form
(deftest <some-name>
, with some asserts added, e.g.:
(deftest my-function
(is-true 42 (my-function 1 2 3)))
- Run the following to verify your tests (and to get nicely formatted, colored test runner output!):
$ lfetool tests unit
Do this for every commit.
1.7.9 Toolchain
The primary tool used for LFE development is lfetool
. It makes use of many
other tools in the Erlang, Elixir, and LFE ecosystems, enabling everything
from dependency management and compiling to running your unit tests and
releasing your software.
Projects created with lfetool
's new
command also have a Makefile
with various *.mk
includes.


Computer Graphics and Design I
This introductory graphic design course explores basic tools and processes to create digital works. It relates and applies creative expression and design principles from the field of advertising and commercial art. Students gain practical experience in generating original ideas, executing layouts, hand- rendering and preparing artwork for reproduction. It also provides a historical and contemporary view of art as students learn to critique work.
Computer Graphics and Design II
This graphic design course continues application of tools and processes begun in Computer Graphics I to create digital works and text to communicate messages. It emphasizes design elements and principles in purposeful arrangement using both hand rendered and computer-generated design. Focus will be on advanced applications to create art products, such as advertisements, product designs and identity symbols. It investigates the computer's influence on and role in creating contemporary designs and provides a cultural and historical study of master design works of different periods and styles.
Motion Graphics/Video
This advanced course engages students with the materials, processes and artistic techniques involved in motion graphics, animation and video. Students learn about the operation of a camera, lighting techniques, camera angles, depth of field, composition, story boarding, sound capture and editing techniques. As students advance and the instruction becomes more refined, they are encouraged to develop their own artistic style. Students may also study major filmmakers/cinematographers and their films to learn about film, television and video and their relationships to drama and theater.
Powered by Aaron Willie, James Buckley, Gairren Boysel


Dr. Chaos' Secret Bookshelf:
A cluttered array of books and documents litter the bookshelf.
Look for the locked book


This visualization was created to gain insights on the yearly and state-wise trends in AIDS infection rates and cases in terms of the key demographic characteristic of Age. By pressing on individual bars we could select the set of states and years by which the rates or the total cases could be aggregated. Please Press the following button to activate filters.
Activate FilterWe could choose to see the trends in rates or total cases individually by selecting one of the following buttons. We could also choose to see Both Rates and Total Cases.
Rate Total Cases Both


The Apache config file has:
<Location /optimize_for_bandwidth.html> # Optimize resources in-place, without changing their urls. ModPagespeedRewriteLevel OptimizeForBandwidth </Location> <Location /in_place_optimize_for_browser> # Serve WebP to browsers that support it, and add the response # header "Vary: Accept". ModPagespeedEnableFilters in_place_optimize_for_browser </Location>
Links to optimized and unoptimized resources:
| Original Resource | Optimized Resource |
|---|---|
| inline_javascript.js?PageSpeed=off | inline_javascript.js |
| blue.css?PageSpeed=off | styles/blue.css |
| Puzzle.jpg?PageSpeed=off | Puzzle.jpg |