public final class Session
extends java.lang.Object
The Session class provides access to the protocol providers that
implement the Store
, Transport
, and related
classes. The protocol providers are configured using the following files:
javamail.providers
and
javamail.default.providers
javamail.address.map
and
javamail.default.address.map
Each javamail.
X resource file is searched for using
three methods in the following order:
java.home/conf/javamail.
X META-INF/javamail.
X META-INF/javamail.default.
X (Where java.home is the value of the "java.home" System property and conf is the directory named "conf" if it exists, otherwise the directory named "lib"; the "conf" directory was introduced in JDK 1.9.)
The first method allows the user to include their own version of the
resource file by placing it in the conf directory where the
java.home
property points. The second method allows an
application that uses the Jakarta Mail APIs to include their own resource
files in their application's or jar file's META-INF
directory. The javamail.default.
X default files
are part of the Jakarta Mail mail.jar
file and should not be
supplied by users.
File location depends upon how the ClassLoader
method
getResource
is implemented. Usually, the
getResource
method searches through CLASSPATH until it
finds the requested file and then stops.
The ordering of entries in the resource files matters. If multiple entries exist, the first entries take precedence over the later entries. For example, the first IMAP provider found will be set as the default IMAP implementation until explicitly changed by the application. The user- or system-supplied resource files augment, they do not override, the default files included with the Jakarta Mail APIs. This means that all entries in all files loaded will be available.
javamail.providers
and
javamail.default.providers
These resource files specify the stores and transports that are available on the system, allowing an application to "discover" what store and transport implementations are available. The protocol implementations are listed one per line. The file format defines four attributes that describe a protocol implementation. Each attribute is an "="-separated name-value pair with the name in lowercase. Each name-value pair is semi-colon (";") separated. The following names are defined.
| Name | Description |
|---|---|
| protocol | Name assigned to protocol.
For example, smtp for Transport. |
| type | Valid entries are store and transport . |
| class | Class name that implements this protocol. |
| vendor | Optional string identifying the vendor. |
| version | Optional string identifying the version. |
Here's an example of META-INF/javamail.default.providers
file contents:
protocol=imap; type=store; class=com.sun.mail.imap.IMAPStore; vendor=Oracle; protocol=smtp; type=transport; class=com.sun.mail.smtp.SMTPTransport; vendor=Oracle;
The current implementation also supports configuring providers using
the Java SE ServiceLoader
mechanism.
When creating your own provider, create a Provider
subclass,
for example:
package com.example; import jakarta.mail.Provider; public class MyProvider extends Provider { public MyProvider() { super(Provider.Type.STORE, "myprot", MyStore.class.getName(), "Example", null); } }Then include a file named
META-INF/services/jakarta.mail.Provider
in your jar file that lists the name of your Provider class:
com.example.MyProvider
javamail.address.map
and
javamail.default.address.map
These resource files map transport address types to the transport
protocol. The getType
method of
jakarta.mail.Address
returns the address type. The
javamail.address.map
file maps the transport type to the
protocol. The file format is a series of name-value pairs. Each key
name should correspond to an address type that is currently installed
on the system; there should also be an entry for each
jakarta.mail.Address
implementation that is present if it is
to be used. For example, the
jakarta.mail.internet.InternetAddress
method
getType
returns "rfc822". Each referenced protocol should
be installed on the system. For the case of news
, below,
the client should install a Transport provider supporting the nntp
protocol.
Here are the typical contents of a javamail.address.map
file:
rfc822=smtp news=nntp
| Modifier and Type | Method and Description |
|---|---|
void |
addProvider(Provider provider)
Add a provider to the session.
|
boolean |
getDebug()
Get the debug setting for this Session.
|
java.io.PrintStream |
getDebugOut()
Returns the stream to be used for debugging output.
|
static Session |
getDefaultInstance(java.util.Properties props)
Get the default Session object.
|
static Session |
getDefaultInstance(java.util.Properties props,
Authenticator authenticator)
Get the default Session object.
|
Folder |
getFolder(URLName url)
Get a closed Folder object for the given URLName.
|
static Session |
getInstance(java.util.Properties props)
Get a new Session object.
|
static Session |
getInstance(java.util.Properties props,
Authenticator authenticator)
Get a new Session object.
|
PasswordAuthentication |
getPasswordAuthentication(URLName url)
Return any saved PasswordAuthentication for this (store or transport)
URLName.
|
java.util.Properties |
getProperties()
Returns the Properties object associated with this Session
|
java.lang.String |
getProperty(java.lang.String name)
Returns the value of the specified property.
|
Provider |
getProvider(java.lang.String protocol)
Returns the default Provider for the protocol
specified.
|
Provider[] |
getProviders()
This method returns an array of all the implementations installed
via the javamail.[default.]providers files that can
be loaded using the ClassLoader available to this application.
|
Store |
getStore()
Get a Store object that implements this user's desired Store
protocol.
|
Store |
getStore(Provider provider)
Get an instance of the store specified by Provider.
|
Store |
getStore(java.lang.String protocol)
Get a Store object that implements the specified protocol.
|
Store |
getStore(URLName url)
Get a Store object for the given URLName.
|
StreamProvider |
getStreamProvider()
Get the stream provider instance of the session.
|
Transport |
getTransport()
Get a Transport object that implements this user's desired
Transport protcol.
|
Transport |
getTransport(Address address)
Get a Transport object that can transport a Message of the
specified address type.
|
Transport |
getTransport(Provider provider)
Get an instance of the transport specified in the Provider.
|
Transport |
getTransport(java.lang.String protocol)
Get a Transport object that implements the specified protocol.
|
Transport |
getTransport(URLName url)
Get a Transport object for the given URLName.
|
PasswordAuthentication |
requestPasswordAuthentication(java.net.InetAddress addr,
int port,
java.lang.String protocol,
java.lang.String prompt,
java.lang.String defaultUserName)
Call back to the application to get the needed user name and password.
|
void |
setDebug(boolean debug)
Set the debug setting for this Session.
|
void |
setDebugOut(java.io.PrintStream out)
Set the stream to be used for debugging output for this session.
|
void |
setPasswordAuthentication(URLName url,
PasswordAuthentication pw)
Save a PasswordAuthentication for this (store or transport) URLName.
|
void |
setProtocolForAddress(java.lang.String addresstype,
java.lang.String protocol)
Set the default transport protocol to use for addresses of
the specified type.
|
void |
setProvider(Provider provider)
Set the passed Provider to be the default implementation
for the protocol in Provider.protocol overriding any previous values.
|
public StreamProvider getStreamProvider()
public static Session getInstance(java.util.Properties props, Authenticator authenticator)
props
- Properties object that hold relevant properties.authenticator
- Authenticator object used to call back to
the application when a user name and password is
needed.Authenticator
public static Session getInstance(java.util.Properties props)
props
- Properties object that hold relevant properties.public static Session getDefaultInstance(java.util.Properties props, Authenticator authenticator)
Since the default session is potentially available to all code executing in the same Java virtual machine, and the session can contain security sensitive information such as user names and passwords, access to the default session is restricted. The Authenticator object, which must be created by the caller, is used indirectly to check access permission. The Authenticator object passed in when the session is created is compared with the Authenticator object passed in to subsequent requests to get the default session. If both objects are the same, or are from the same ClassLoader, the request is allowed. Otherwise, it is denied.
Note that if the Authenticator object used to create the session is null, anyone can get the default session by passing in null.
Note also that the Properties object is used only the first time
this method is called, when a new Session object is created.
Subsequent calls return the Session object that was created by the
first call, and ignore the passed Properties object. Use the
getInstance
method to get a new Session object every
time the method is called.
Additional security Permission objects may be used to control access to the default session.
In the current implementation, if a SecurityManager is set, the
caller must have the RuntimePermission("setFactory")
permission.
props
- Properties object. Used only if a new Session
object is created.authenticator
- Authenticator object. Used only if a
new Session object is created. Otherwise,
it must match the Authenticator used to create
the Session.public static Session getDefaultInstance(java.util.Properties props)
Note that a default session created with no Authenticator is available to all code executing in the same Java virtual machine, and the session can contain security sensitive information such as user names and passwords.
props
- Properties object. Used only if a new Session
object is created.public void setDebug(boolean debug)
Since the debug setting can be turned on only after the Session
has been created, to turn on debugging in the Session
constructor, set the property mail.debug
in the
Properties object passed in to the constructor to true. The
value of the mail.debug
property is used to
initialize the per-Session debugging flag. Subsequent calls to
the setDebug
method manipulate the per-Session
debugging flag and have no affect on the mail.debug
property.
debug
- Debug settingpublic boolean getDebug()
public void setDebugOut(java.io.PrintStream out)
out
is null, System.out
will be used.
Note that debugging output that occurs before any session is created,
as a result of setting the mail.debug
system property,
will always be sent to System.out
.out
- the PrintStream to use for debugging outputpublic java.io.PrintStream getDebugOut()
System.out
is returned.public Provider[] getProviders()
public Provider getProvider(java.lang.String protocol) throws NoSuchProviderException
protocol
- Configured protocol (i.e. smtp, imap, etc)NoSuchProviderException
- If a provider for the given
protocol is not found.public void setProvider(Provider provider) throws NoSuchProviderException
provider
- Currently configured Provider which will be
set as the default for the protocolNoSuchProviderException
- If the provider passed in
is invalid.public Store getStore() throws NoSuchProviderException
mail.store.protocol
property specifies the
desired protocol. If an appropriate Store object is not obtained,
NoSuchProviderException is thrownNoSuchProviderException
- If a provider for the given
protocol is not found.public Store getStore(java.lang.String protocol) throws NoSuchProviderException
protocol
- the Store protocolNoSuchProviderException
- If a provider for the given
protocol is not found.public Store getStore(URLName url) throws NoSuchProviderException
url
- URLName that represents the desired StoreNoSuchProviderException
- If a provider for the given
URLName is not found.getFolder(URLName)
,
URLName
public Store getStore(Provider provider) throws NoSuchProviderException
provider
- Store Provider that will be instantiatedNoSuchProviderException
- If a provider for the given
Provider is not found.public Folder getFolder(URLName url) throws MessagingException
The "scheme" part of the URL string (Refer RFC 1738) is used to locate the Store protocol. The rest of the URL string (that is, the "schemepart", as per RFC 1738) is used by that Store in a protocol dependent manner to locate and instantiate the appropriate Folder object.
Note that RFC 1738 also specifies the syntax for the "schemepart" for IP-based protocols (IMAP4, POP3, etc.). Providers of IP-based mail Stores should implement that syntax for referring to Folders.
url
- URLName that represents the desired folderNoSuchProviderException
- If a provider for the given
URLName is not found.MessagingException
- if the Folder could not be
located or created.getStore(URLName)
,
URLName
public Transport getTransport() throws NoSuchProviderException
mail.transport.protocol
property
specifies the desired protocol. If an appropriate Transport
object cannot be obtained, MessagingException is thrown.NoSuchProviderException
- If the provider is not found.public Transport getTransport(java.lang.String protocol) throws NoSuchProviderException
protocol
- the Transport protocolNoSuchProviderException
- If provider for the given
protocol is not found.public Transport getTransport(URLName url) throws NoSuchProviderException
url
- URLName that represents the desired TransportNoSuchProviderException
- If a provider for the given
URLName is not found.URLName
public Transport getTransport(Provider provider) throws NoSuchProviderException
provider
- Transport Provider that will be instantiatedNoSuchProviderException
- If provider for the given
provider is not found.public Transport getTransport(Address address) throws NoSuchProviderException
address
- an address for which a Transport is neededNoSuchProviderException
- If provider for the
Address type is not foundAddress
public void setPasswordAuthentication(URLName url, PasswordAuthentication pw)
This is normally used only by the store or transport implementations to allow authentication information to be shared among multiple uses of a session.
url
- the URLNamepw
- the PasswordAuthentication to savepublic PasswordAuthentication getPasswordAuthentication(URLName url)
url
- the URLNamepublic PasswordAuthentication requestPasswordAuthentication(java.net.InetAddress addr, int port, java.lang.String protocol, java.lang.String prompt, java.lang.String defaultUserName)
Connecting to <protocol> mail service on host <addr>, port <port>. <prompt> User Name: <defaultUserName> Password:
addr
- InetAddress of the host. may be null.port
- the port on the hostprotocol
- protocol scheme (e.g. imap, pop3, etc.)prompt
- any additional String to show as part of
the prompt; may be null.defaultUserName
- the default username. may be null.public java.util.Properties getProperties()
public java.lang.String getProperty(java.lang.String name)
name
- the property namepublic void addProvider(Provider provider)
provider
- the provider to addpublic void setProtocolForAddress(java.lang.String addresstype, java.lang.String protocol)
javamail.default.address.map
or
javamail.address.map
files or resources.addresstype
- type of addressprotocol
- name of protocolgetTransport(Address)


role Positional
Object that supports looking up values by index
Role for objects which support indexing them using postcircumfix:«[ ]»
(usually list-like objects). Example types with Positional role include List, Array, Range, and Buf.
Methods
method of
method of()
Returns the type constraint for elements of the positional container. Defaults to Mu.
Methods that should be provided
method elems
method elems()
Should return the number of available elements in the instantiated object.
method AT-POS
method AT-POS(\position)
Should return the value / container at the given position.
method EXISTS-POS
method EXISTS-POS(\position)
Should return a Bool
indicating whether the given position actually has a value.
method STORE
method STORE(\values, :)
This method should only be supplied if you want to support the:
my is Foo = 1,2,3;
syntax for binding your implementation of the Positional
role.
Should accept the values to (re-)initialize the object with. The optional named parameter will contain a True
value when the method is called on the object for the first time. Should return the invocant.
See also
See Methods to implement for positional subscripting for information about additional methods that can be implemented for the Positional
role.


Dryad is an open source digital data repository where researchers upload and submit the data that is associated with their publication. Fees for uploading data will be introduced and the data submission process needs to be updated to inform researchers of the charges and to collect payment.
I interviewed potential and current Dryad users, designed the checkout process, and conducted usability testing. My deliverables included: sketches, interview notes, interaction diagrams, wireframes , and the usability testing report (PDF, 168kb) .
Working groups made up of computational biologists and researchers requested a database where they can store, retrieve, and share their trait data. I planned and conducted the requirements gathering workshop with the researchers, designed the upload interface, and wrote the documentation for Trait Database .
Dryad curators are responsible for reviewing, archiving, and managing the data that researchers upload to the Dryad Web site. My task was to design a system that allowed for Dryad curators to communicate with one another within the Dryad system, instead of through a spreadsheet. Using an iterative process, I interviewed curators, created wireframes, mockups, and an Axure prototype , and conducted usability testing with the curators using the prototypes.
 In order to transition this program from paper-based to online, I created a site map and conducted card sorting with current users. I also created wireframes and paper prototypes for some of the internal pages of the Web site. Lastly, I created the usability testing plan and walked the team through the process of conducting usability testing sessions.


referenced
by None at 2019-11-18 14:20:11.merged
by None at 2019-11-18 14:20:11.closed
by None at 2019-11-18 14:20:11.closed
by None at 2019-11-18 14:20:11.labeled
by Trey Pendragon at 2019-11-18 18:33:07.labeled
by Trey Pendragon at 2019-11-18 18:34:18.labeled
by Trey Pendragon at 2019-11-18 18:37:22.labeled
by Trey Pendragon at 2019-11-18 18:37:32.cico:development
and cico:test
server
task I guess is fine; it does extra stuff. But maybe there is a better name for it?
renamed
by None at 2019-11-18 18:37:27.We might have to adjust the .gitignore.
Aha! we should ask @jrgriffiniii https://github.com/pulibrary/cicognara-rails/commit/390ca19c03f672da47fe587cca120ad8a098cb97#diff-a084b794bc0759e7a6b77810e01874f2
We're not sure why these don't show up for all the real data when we run it.
labeled
by Trey Pendragon at 2019-11-18 18:36:42.mentioned
by James R. Griffin III at 2019-11-18 18:38:13.subscribed
by James R. Griffin III at 2019-11-18 18:38:13.This is motivated by feeling like people won't go to the contact form to submit corrections and they want to encourage people to do that.
labeled
by Trey Pendragon at 2019-11-18 18:38:46.labeled
by Trey Pendragon at 2019-11-18 18:39:34.labeled
by Trey Pendragon at 2019-11-18 18:39:55.labeled
by Trey Pendragon at 2019-11-18 18:41:04.labeled
by Trey Pendragon at 2019-11-18 18:41:48.labeled
by Trey Pendragon at 2019-11-18 18:42:13.labeled
by Trey Pendragon at 2019-11-18 18:42:44.labeled
by Trey Pendragon at 2019-11-18 18:43:48.unlabeled
by Trey Pendragon at 2019-11-18 18:46:50.There's definitely some variability in these json records, even among the 3 we have in the fixtures file. E.g. in some the subjects have types, but in one they only have labels. But I think I have covered all the known fields. The list of fields Adam sent me is below; it is close to one of the contexts in one of the fixtures, but it doesn't precisely match any of them, and none of them precisely match one another.
"@context": {
"source": "http://purl.org/dc/elements/1.1/source",
"Person": "http://schema.org/Person",
"creator": "http://purl.org/dc/elements/1.1/creator",
"issued": "http://purl.org/dc/terms/issued",
"description": "http://purl.org/dc/elements/1.1/description",
"extent": "http://purl.org/dc/terms/extent",
"format": "http://purl.org/dc/elements/1.1/format",
"identifier": "http://purl.org/dc/elements/1.1/identifier",
"URI": "http://purl.org/dc/terms/URI",
"oclc": "http://portal.getty.edu/terms/gri/oclc",
"language": "http://purl.org/dc/elements/1.1/language",
"title": "http://purl.org/dc/elements/1.1/title",
"DCMIType": "http://purl.org/dc/terms/DCMIType",
"type": "http://purl.org/dc/elements/1.1/type",
"publisher": "http://purl.org/dc/elements/1.1/publisher",
"grpContributor": "http://portal.getty.edu/terms/gri/grpContributor"
},
The list of configured index fields we aren't mapping to, because these fields don't appear to come through with the json, is:
# 'tei_author_txt', label: 'Author(s)' # mapping to author_display instead
# 'tei_pub_txt', label: 'Publication place(s)' # in fixture data the place is part of publisher
# 'tei_section_head_italian', label: 'Section head'
# 'tei_note_italian', label: 'Note(s)'
# 'title_addl_display', label: 'Other title(s)', helper_method: :ul
# 'edition_display', label: 'Edition'
# 'contents_display', label: 'Contents'
# 'note_display', label: 'Note(s)', helper_method: :html_safe
# 'title_added_entry_display', label: 'Added entry title(s)'
# 'place_display', label: 'Place of publications'
Hey Trey!
Only one of those books was added to the Fondo Cicognara collection in the Vatican and is on microfiche: No 4018.
There are others but they are listed only in a handwritten Supplement and were distributedoing amongst other collections in the Vatican library. There are currently sidelined within out project as well.
So for now only 4018 has to be included, although I appreciate the foresight that others might be added later!
Gesendet: Montag, 18. November 2019 um 19:50 Uhr Von: "Trey Pendragon"<EMAIL_ADDRESS>An: pulibrary/cicognara-rails<EMAIL_ADDRESS>Cc: Subscribed<EMAIL_ADDRESS>Betreff: [pulibrary/cicognara-rails] Add Addendum (#415)
There's a set of books which were added to the Catalogo after it was done, but before it was sold to the Vatican. Those had numbers 4801-x. We should add information for those.
You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/pulibrary/cicognara-rails/issues/415
@lightgivener Thanks for the info!
labeled
by Trey Pendragon at 2019-11-18 18:50:37.mentioned
by None at 2019-11-18 18:51:14.subscribed
by None at 2019-11-18 18:51:14.mentioned
by None at 2019-11-18 23:19:16.subscribed
by None at 2019-11-18 23:19:16.referenced
by Trey Pendragon at 2019-11-18 16:42:47.merged
by Trey Pendragon at 2019-11-18 16:42:47.closed
by Trey Pendragon at 2019-11-18 16:42:48.head_ref_deleted
by Trey Pendragon at 2019-11-18 16:42:52.closed
by Trey Pendragon at 2019-11-18 16:44:12.closed
by Trey Pendragon at 2019-11-18 16:44:12.referenced
by Trey Pendragon at 2019-11-18 16:44:12.merged
by Trey Pendragon at 2019-11-18 16:44:12.closed
by Trey Pendragon at 2019-11-18 16:44:12.head_ref_deleted
by Trey Pendragon at 2019-11-18 16:44:17.referenced
by None at 2019-11-18 18:04:37.merged
by None at 2019-11-18 18:04:38.closed
by None at 2019-11-18 18:04:38.Is this related to https://app.honeybadger.io/projects/53391/faults/57237823?
Yes, that error is what happens when it tries to parse an EAD with a nil
filename
closed
by None at 2019-11-18 18:04:38.assigned
by Trey Pendragon at 2019-11-18 19:07:28.renamed
by Trey Pendragon at 2019-11-18 19:07:58.labeled
by Trey Pendragon at 2019-11-18 19:08:08.labeled
by Trey Pendragon at 2019-11-18 19:09:14.labeled
by Trey Pendragon at 2019-11-18 19:11:16.labeled
by Trey Pendragon at 2019-11-18 19:11:50.labeled
by Trey Pendragon at 2019-11-18 19:12:09.labeled
by Esmé Cowles at 2019-11-18 19:12:58.Should be resolved.
closed
by Trey Pendragon at 2019-11-18 19:14:14.labeled
by Trey Pendragon at 2019-11-18 19:15:04.renamed
by Trey Pendragon at 2019-11-18 19:16:24.Hasn't happened in a long time, trace is gone.
closed
by Trey Pendragon at 2019-11-18 19:17:51.closed
by Trey Pendragon at 2019-11-18 19:21:12.labeled
by Trey Pendragon at 2019-11-18 19:22:00.We've talked about this before (maybe in Plum?), but I can't find the ticket. If I remember, we have two options: Either -actually- rotate the JP2 via a derivative regeneration process, or store a flag in the FileMetadata
which will get read into the Presentation Manifest to say "rotate this image for the canvas by X", although I seem to remember from last time looking at this that there wasn't a great standard way to say the starting position - something about applying a CSS tag?
Looks like we might be able to use "Selectors" in the 2.1 spec (https://iiif.io/api/presentation/2.1/#segments), but it's not super clear how to do the equivalent in the 3.0 spec.
labeled
by Esmé Cowles at 2019-11-18 21:30:38.mentioned
by Kim Leaman at 2019-11-18 21:30:38.subscribed
by Kim Leaman at 2019-11-18 21:30:38.assigned
by Nikitas Tampakis at 2019-11-18 18:54:02.labeled
by Trey Pendragon at 2019-11-18 18:56:37.We don't have to do this anymore, Figgy takes care of it.
closed
by Trey Pendragon at 2019-11-18 18:57:03.renamed
by Trey Pendragon at 2019-11-18 18:57:55.labeled
by Trey Pendragon at 2019-11-18 18:58:06.renamed
by Trey Pendragon at 2019-11-18 18:58:11.This one in https://catalog.princeton.edu/catalog/1782308 should not have a request button.
labeled
by Trey Pendragon at 2019-11-18 18:59:13.labeled
by Trey Pendragon at 2019-11-18 18:59:32.labeled
by Trey Pendragon at 2019-11-18 19:00:15.labeled
by Trey Pendragon at 2019-11-18 19:01:04.assigned
by Esmé Cowles at 2019-11-18 19:02:11.assigned
by Francis Kayiwa at 2019-11-18 18:53:40.assigned
by Christina Chortaria at 2019-11-18 18:53:40.referenced
by Francis Kayiwa at 2019-11-18 19:47:27.closed
by Christina Chortaria at 2019-11-18 19:50:24.referenced
by Axa Mei Liauw at 2019-11-18 13:51:01.merged
by Axa Mei Liauw at 2019-11-18 13:51:01.closed
by Axa Mei Liauw at 2019-11-18 13:51:01.head_ref_deleted
by Axa Mei Liauw at 2019-11-18 13:51:04.closes issue #879
review_requested
by Francis Kayiwa at 2019-11-18 14:55:37.referenced
by Francis Kayiwa at 2019-11-18 17:05:52.merged
by Francis Kayiwa at 2019-11-18 17:05:52.closed
by Francis Kayiwa at 2019-11-18 17:05:53.head_ref_deleted
by Francis Kayiwa at 2019-11-18 17:06:00.review_requested
by Francis Kayiwa at 2019-11-18 18:41:04.referenced
by Christina Chortaria at 2019-11-18 18:46:35.merged
by Christina Chortaria at 2019-11-18 18:46:35.closed
by Christina Chortaria at 2019-11-18 18:46:35.head_ref_deleted
by Francis Kayiwa at 2019-11-18 18:54:35.review_requested
by Francis Kayiwa at 2019-11-18 19:48:29.referenced
by Christina Chortaria at 2019-11-18 19:50:23.merged
by Christina Chortaria at 2019-11-18 19:50:23.closed
by Christina Chortaria at 2019-11-18 19:50:24.mentioned
by Francis Kayiwa at 2019-11-18 21:58:23.subscribed
by Francis Kayiwa at 2019-11-18 21:58:23.review_requested
by None at 2019-11-18 21:58:40.Deadline: 1st week of December
labeled
by Axa Mei Liauw at 2019-11-18 13:54:18.assigned
by Axa Mei Liauw at 2019-11-18 13:54:19.I've disabled flexsliderviewsslideshow and flexsliderviews on prod. We need to remove the dependency from the library news feature to disable flexsliderfields and flexslider. We also need to uninstall the modules correctly and remove it from our codebase.
review_requested
by Axa Mei Liauw at 2019-11-18 19:48:28.referenced
by Kevin Reiss at 2019-11-18 21:03:50.merged
by Kevin Reiss at 2019-11-18 21:03:50.closed
by Kevin Reiss at 2019-11-18 21:03:50.head_ref_deleted
by Kevin Reiss at 2019-11-18 21:03:55.TODO when we get the go-ahead to "go live": - [x] Change URL from prds to research-data - [x] Publish basic pages - [x] Enable menu items - [x] Copy / paste homepage content node body from library-stage.princeton.edu/research-data - [x] Enable PRDS Search Block module
TODO for Axa: - [x] Add prds tag to basic pages (to make content searchable within section) - [x] Add images to basic pages (right now will show up as broken images)
head_ref_force_pushed
by Nikitas Tampakis at 2019-11-18 22:22:22.unassigned
by Christina Chortaria at 2019-11-18 19:24:02.unassigned
by Christina Chortaria at 2019-11-18 19:24:22.@kevinreiss This is on https://recap-staging.princeton.edu/
Closes #106
head_ref_force_pushed
by Axa Mei Liauw at 2019-11-18 18:02:57.review_requested
by Axa Mei Liauw at 2019-11-18 18:03:24.renamed
by Axa Mei Liauw at 2019-11-18 18:11:40.mentioned
by Kevin Reiss at 2019-11-18 18:11:47.subscribed
by Kevin Reiss at 2019-11-18 18:11:47.head_ref_force_pushed
by Axa Mei Liauw at 2019-11-18 18:18:03.


For this week's technical blog challenge I will be going over Blocks, Procs, and Lambadas. Let's dive right in!
A Ruby block is just a bit of code that can be executed. Block syntax uses either do..end or brackets { }. For example:
The block of code between do and end, and the curly brackets get executed 3 times. Additionally you can also pass data to a block. Lets modify our bacon example:
First we created an array with foods that compliment our yummy bacon. Then we pass this data to our block which in return prints out all the food in the array at each pass.
Although blocks are very useful, you can't save blocks of code into a variable. And this is where Procs come into play.
You can think of a proc as a "saved" block: just like you can give a bit of code a name and turn it into a method, you can name a block and turn it into a proc. For example:
In the example above we created a variable called bacon, and assigned it to a new Proc object which accepts our code block. Then on the second line we call it, also note the ampersand(&), it is used to convert the proc into a block.
Like Procs, lambadas are objects and essentially identical, with the exception of syntax, and a few behaviour quirks. For example:
The example above failed because we passed the wrong number of arguments. In this case we called the #times method with our block code, we are also passing the iteration(3) to the block too. Now lets apply what we have learned:
Awesome now it ran successfully without any errors. Well that's my time for today! I hope you enjoyed my techinical blog for this week!


--- title: Arrest this squash! date: 2009-08-31 09:00:37.000000000 +03:00 categories: [] tags: [] status: publish type: post published: true meta: _edit_last: '600927' reddit: a:2:{s:5:"count";s:1:"0";s:4:"time";s:10:"1294636381";} delicious: a:3:{s:5:"count";s:1:"0";s:9:"post_tags";s:0:"";s:4:"time";s:10:"1294636380";} author: login: kouk email<EMAIL_ADDRESS>display_name: Konstantinos Koukopoulos first_name: '' last_name: '' excerpt: !ruby/object:Hpricot::Doc options: {} ---
Picture this: shouting in the streets, Immigrant vegetable sellers running down one side of the street, abandoning their makeshift vegetable market, police entering the street on the other side, shouting threats, batons swinging, police car sirens going, . The immigrants flee, fearing arrest, leaving all the vegetables they were selling on the street. The police continued to confiscate all the vegetables and some passers-by looted a bit for themselves. I wonder what happened to all the vegetables that went into the municipal police's truck.
My opinion: the state takes responsibility of regulating commerce and does a bureaucratically bad job at it. One one hand people wanting to enter the market are unable to do so legally, so they do it anyway in the uncontrolled niches of public space. On the other hand, by being forced by illegality into these areas where there is no check on their natural activities they often contribute to some intolerable civic situations, such as the unhygienic conditions at the makeshift market in question. The state is subsequently summoned to restore "order" to the situation it engendered through violence and oppresion.


Currently implementing limited use account creation keys, i will have one availible for testing until I feel done.
Make a new account:
Username:
Password:
Unlimited use key: welcome
Account creation key:
Already have an account?, login:
Username:
Password:


Wohoo, you got it right!
Wrong. Try again.
{{suggestion.title}}
{{suggestion.description}}
Thanks for finishing quizzes!
Also note that you can also get additional rewards by clicking onto More detail on content posters.
Current rewards: {{ctrl.dataRewards}} MB


Body of a newborn baby was found in a Mysuru drain
by Ranjith KandyaThe body of a newborn baby was found at a drain in Giriyabhovipalya in the city, on Monday morning.
The civic workers, who were cleaning the drain near Government Higher Primary School found the body and alerted the Police.
Nazarbad police visited the spot and investigating the case.


Paragraph
Again, this only pulls out a single particular solution. It is up to you to figure out the rest.
in-context


Models Used: Linear Regression, Decision Tree, Random Forest.
Best Model:
Accuracy:
Models Used: Logistic Regression.
Models Used: Logistic Regression, Gaussian Naive Bayes, Bernoulli Naive Bayes, SVM, Random Forest, kNN, XG Boosting.
Models Used: Random Forest Regressor.
Models Used:


--- title: 'Bank ATM Cash Machine Forecast with Time Series' author: Rihad Variawa date: '2019-02-07' slug: bank categories: - R - Machine Learning tags: [] header: image: "headers/atm.jpg" summary: 'Forcast monthly residential energy usage' ---
This document focuses on the time series analysis. The variable ‘Cash’ is provided in hundreds of dollars.
This is a time series spanning daily transactions from May 1, 2009 to April 30, 2010 from four ATMs.
sourceURL <- "https://raw.githubusercontent.com/jzuniga123"
file <- "/SPS/master/DATA%20624/ATM624Data.xlsx"
download.file(paste0(sourceURL, file), "temp.xlsx", mode="wb")
atm <- xlsx::read.xlsx("temp.xlsx", sheetIndex=1, header=T)
invisible(file.remove("temp.xlsx"))
# preview first 5 rows
head(atm)
DATE ATM Cash
1 2009-05-01 ATM1 96
2 2009-05-01 ATM2 107
3 2009-05-02 ATM1 82
4 2009-05-02 ATM2 89
5 2009-05-03 ATM1 85
6 2009-05-03 ATM2 90
class(atm)
[1] "data.frame"
str(atm)
'data.frame': 1474 obs. of 3 variables:
$ DATE: Date, format: "2009-05-01" "2009-05-01" ...
$ ATM : Factor w/ 4 levels "ATM1","ATM2",..: 1 2 1 2 1 2 1 2 1 2 ...
$ Cash: num 96 107 82 89 85 90 90 55 99 79 ...
# preview descriptive statistics on quantitative and qualitative variables
summary(atm)
DATE ATM Cash
Min. :2009-05-01 ATM1:365 Min. : 0.0
1st Qu.:2009-08-01 ATM2:365 1st Qu.: 0.5
Median :2009-11-01 ATM3:365 Median : 73.0
Mean :2009-10-31 ATM4:365 Mean : 155.6
3rd Qu.:2010-02-01 NA's: 14 3rd Qu.: 114.0
Max. :2010-05-14 Max. :10919.8
NA's :19
Skewed distribution since the mean is higher than the third quartile.
# preview periods between dates in the time series
xts::periodicity(unique(atm$DATE))
Daily periodicity from 2009-05-01 to 2010-05-14
Dataframe spans daily transactions from May 1, 2009 to May 14, 2010.
# preview observations that have no missing values
atm[!complete.cases(atm), ]
DATE ATM Cash
87 2009-06-13 ATM1 NA
93 2009-06-16 ATM1 NA
98 2009-06-18 ATM2 NA
105 2009-06-22 ATM1 NA
110 2009-06-24 ATM2 NA
731 2010-05-01 <NA> NA
732 2010-05-02 <NA> NA
733 2010-05-03 <NA> NA
734 2010-05-04 <NA> NA
735 2010-05-05 <NA> NA
736 2010-05-06 <NA> NA
737 2010-05-07 <NA> NA
738 2010-05-08 <NA> NA
739 2010-05-09 <NA> NA
740 2010-05-10 <NA> NA
741 2010-05-11 <NA> NA
742 2010-05-12 <NA> NA
743 2010-05-13 <NA> NA
744 2010-05-14 <NA> NA
ATM transactions have missing values.
summary(factor(atm$ATM)[!is.na(atm$Cash) & atm$Cash %% 1 != 0])
ATM1 ATM2 ATM3 ATM4
0 0 0 365
There are non-integer transactions at ATM 4 implying that these data are likely debit card purchase transactions.
# time plot represents a line graph that plots each observed value against the time of the observation, with a single line connecting each observation across the entire period
par(mfrow=c(4, 2), mar = c(3, 5, 0, 0), oma = c(0, 0, 0.5, 0.5))
for(i in 1:length(levels(atm$ATM))) {
atm_sub <- subset(atm, ATM == paste0("ATM", i))
atm_ts <- xts::xts(atm_sub$Cash, order.by=atm_sub$DATE)
n <- nrow(atm_ts); l <- rep(1, n); m <- rep(20, n); h <- rep(100, n)
print(plot(cbind(atm_ts, l, m,h), main=paste0("ATM", i)))
# histogram displays the frequency at which values in a vector occur.
hist(atm_ts, col="green", xlab="", main="")
}
Observations:
ACF plot shows the autocorrelations between each observation and its immediate predecessor (lagged observation). The PACF plot shows the autocorrelations between the current observation and each individual lagged observation The xts::xts()function converts data to a time series object which displays better in visualizations than time series objects created using other packages.
par(mfrow=c(4, 2), mar = c(3, 5, 0, 0), oma = c(0, 0, 0.5, 0.5))
for(i in 1:length(levels(atm$ATM))) {
atm_sub <- subset(atm, ATM == paste0("ATM", i))
atm_ts <- xts::xts(atm_sub$Cash, order.by=atm_sub$DATE)
acf(na.omit(atm_ts), ylab=paste0("ACF ATM", i), main="")
pacf(na.omit(atm_ts), ylab=paste0("PACF ATM", i), main="")
}
Observations:
Data are cleaned using forecast::tsclean() and then converted to a time series object using the ts() function. The tsclean() function imputes nulls and removes outliers. The ts()function converts data to a time series object which is compatible with the forecast package.
for(i in 1:length(levels(atm$ATM))) {
atm_num <- paste0("ATM", i)
atm_sub <- subset(atm, ATM == atm_num, select=-2)
atm_sub$Cash <- forecast::tsclean(atm_sub$Cash, replace.missing=T)
assign(atm_num, ts(atm_sub$Cash, frequency = 7, start=start(atm_sub$DATE)))
}
A moving average smoother is helpful in examining what kind of trend is involved in a series. Moving average models should not be confused with moving average smoothing. A moving average model is used for forecasting future values while moving average smoothing is used for estimating the trend-cycle component of past values. The ma() function computes a simple moving average smoother of a given time series.
par(mfrow=c(3, 1), mar = c(0, 4, 0, 0), oma = c(0, 0, 0.5, 0.5))
plot(ATM1, col=8, xaxt = "n", ylab="ATM1")
lines(forecast::ma(ATM1, order=7), col=2) # weekly
lines(forecast::ma(ATM1, order=30), col=4) # monthly
plot(ATM2, col=8, xaxt = "n", ylab="ATM3")
lines(forecast::ma(ATM2, order=7), col=2) # weekly
lines(forecast::ma(ATM2, order=30), col=4) # monthly
plot(ATM4, col=8, xaxt = "n", ylab="ATM4")
lines(forecast::ma(ATM4, order=7), col=2) # weekly
lines(forecast::ma(ATM4, order=30), col=4) # monthly
Observations:
Decomposition Plot decomposes and plots the observed values, the underlying trend, seasonality, and randomness of the time series data.
plot(decompose(ATM1), col=3)
plot(decompose(ATM2), col=3)
plot(decompose(ATM4), col=3)
Observations:
An augmented Dickey-Fuller unit root test evaluates if the data exhibit a Stationarity process with deterministic trend or a Stationarity process with stochastic trend.
tseries::adf.test(ATM1)
Warning in tseries::adf.test(ATM1): p-value smaller than printed p-value
Augmented Dickey-Fuller Test
data: ATM1
Dickey-Fuller = -4.5329, Lag order = 7, p-value = 0.01
alternative hypothesis: stationary
tseries::adf.test(ATM2)
Warning in tseries::adf.test(ATM2): p-value smaller than printed p-value
Augmented Dickey-Fuller Test
data: ATM2
Dickey-Fuller = -6.046, Lag order = 7, p-value = 0.01
alternative hypothesis: stationary
tseries::adf.test(ATM4)
Warning in tseries::adf.test(ATM4): p-value smaller than printed p-value
Augmented Dickey-Fuller Test
data: ATM4
Dickey-Fuller = -5.6304, Lag order = 7, p-value = 0.01
alternative hypothesis: stationary
The augmented Dickey-Fuller unit root test p-values are below α=0.05. Therefore, the null hypothesis that the data has unit roots is rejected. The data exhibit stochastic trend which suggests using regression (AR) in lieu of differencing. Autoregressive (AR) modeling acts like partial differencing when ϕ<1. When ϕ=1 the AR(1) model is like a first-order difference.
The train and test sets are created by referencing rows by index.
# train/test split
index_train <- 1:(length(ATM1) - 30)
ATM1_train <- ts(ATM1[index_train], frequency=7)
ATM1_test <- ts(ATM1[-index_train], frequency=7)
index_train <- 1:(length(ATM2) - 30)
ATM2_train <- ts(ATM2[index_train], frequency=7)
ATM2_test <- ts(ATM2[-index_train], frequency=7)
index_train <- 1:(length(ATM3) - 30)
ATM3_train <- ts(ATM3[index_train], frequency=7)
ATM3_test <- ts(ATM3[-index_train], frequency=7)
index_train <- 1:(length(ATM4) - 30)
ATM4_train <- ts(ATM4[index_train], frequency=7)
ATM4_test <- ts(ATM4[-index_train], frequency=7)
The indexed rows for the test set are a window at the end of the times series. The window sized for the testing set is that of the desired prediction. The training set window is comprised of the indexes which are the complement of the test set indexes.
The Augmented Dickey-Fuller Test results support not differencing. Data can be seasonally adjusted for modeling and then reseasonalized for predictions. The modeling algorithm being used evaluates seasonal components and produces predictions that reflect the seasonality in the underlying data. Therefore, the data need not be seasonally adjusted.Heteroskedasticity refers to the circumstance in which the variability of a variable is unequal across the range of values of a second variable. Box-Cox transformations can help to stabilize the variance of a time series.
(lambda1 <- forecast::BoxCox.lambda(ATM1_train))
[1] 0.4355901
(lambda2 <- forecast::BoxCox.lambda(ATM2_train))
[1] 0.7156895
(lambda4 <- forecast::BoxCox.lambda(ATM4_train))
[1] 0.3945256
The Box-Cox transformation parameters suggested are around λ=0.5. This rounded (more interpretable) value is suggestive of a 1/yt‾‾√ transformation. These Box-Cox transformations stabilize the variance and make each series relatively homoskedastic with equal variance.
The auto.arima() function chooses an ARIMA model automatically. It uses a variation of the Hyndman and Khandakar algorithm which combines unit root tests, minimization of the AICc, and MLE to obtain an ARIMA model. The function takes some short-cuts in order to speed up the computation and will not always yield the best model. Setting stepwise and approximation to FALSE prevents the function from taking short-cuts.
(fit1 <- forecast::auto.arima(ATM1_train, stepwise=F, approximation=F, d=0, lambda=lambda1))
Series: ATM1_train
ARIMA(0,0,2)(1,1,1)[7]
Box Cox transformation: lambda= 0.4355901
Coefficients:
ma1 ma2 sar1 sma1
0.1449 -0.1116 0.1320 -0.7243
s.e. 0.0547 0.0537 0.0893 0.0669
sigma^2 estimated as 6.441: log likelihood=-770.86
AIC=1551.73 AICc=1551.92 BIC=1570.69
(fit2 <- forecast::auto.arima(ATM2_train, stepwise=F, approximation=F, d=0, lambda=lambda2))
Series: ATM2_train
ARIMA(2,0,2)(0,1,1)[7] with drift
Box Cox transformation: lambda= 0.7156895
Coefficients:
ar1 ar2 ma1 ma2 sma1 drift
-0.4282 -0.9254 0.4761 0.8044 -0.7672 -0.0246
s.e. 0.0464 0.0413 0.0764 0.0555 0.0483 0.0155
sigma^2 estimated as 66.34: log likelihood=-1152.83
AIC=2319.66 AICc=2320.01 BIC=2346.21
(fit4 <- forecast::auto.arima(ATM4_train, stepwise=F, approximation=F, d=0, lambda=lambda4))
Series: ATM4_train
ARIMA(1,0,0)(2,0,0)[7] with non-zero mean
Box Cox transformation: lambda= 0.3945256
Coefficients:
ar1 sar1 sar2 mean
0.0814 0.2060 0.1911 22.7977
s.e. 0.0548 0.0537 0.0547 0.9477
sigma^2 estimated as 97.25: log likelihood=-1240.53
AIC=2491.06 AICc=2491.24 BIC=2510.13
ACF and PACF
ACF plot shows the autocorrelations between each observation and its immediate predecessor (lagged observation). The PACF plot shows the autocorrelations between the current observation and each individual lagged observation.
par(mfrow=c(3, 2), mar = c(3, 5, 0, 0), oma = c(0, 0, 0.5, 0.5))
acf(residuals(fit1), ylab="ACF ATM1"); pacf(residuals(fit1), ylab="PACF ATM1")
acf(residuals(fit2), ylab="ACF ATM2"); pacf(residuals(fit2), ylab="PACF ATM2")
acf(residuals(fit4), ylab="ACF ATM4"); pacf(residuals(fit4), ylab="PACF ATM4")
Observations:
The Box-Ljung test is helpful in assessing if data follow a White Noise pattern. The arma attribute of the fitted model returns a vector containing the ARIMA model parameters p,q,P,Q,period,d,and D; in that order.
Box.test(residuals(fit1), lag=7, fitdf=sum(fit1$arma[1:2]), type="Ljung-Box")
Box-Ljung test
data: residuals(fit1)
X-squared = 5.7195, df = 5, p-value = 0.3345
Box.test(residuals(fit2), lag=7, fitdf=sum(fit1$arma[1:2]), type="Ljung-Box")
Box-Ljung test
data: residuals(fit2)
X-squared = 7.9286, df = 5, p-value = 0.1602
Box.test(residuals(fit4), lag=7, fitdf=sum(fit1$arma[1:2]), type="Ljung-Box")
Box-Ljung test
data: residuals(fit4)
X-squared = 4.6833, df = 5, p-value = 0.4557
The null hypothesis of independence is not rejected. The Box-Ljung shows that the autocorrelations of the residuals from the models are not significantly different from zero at α=0.05. The residuals of the models display the characteristics of White Noise. The models pass the required checks and are therefore suitable for forecasting.
ATM3 was not modeled due to its degenerative properties. To forecast values for ATM3, the model for an ATM with a similar mean will be used.
c(mean(ATM1), mean(ATM2), mean(ATM3[ATM3!=0]), mean(ATM4))
[1] 84.15479 62.59178 87.66667 444.75681
The mean of ATM1 is very close to the mean of the few values in ATM3. Therefore, the ARIMA(0,0,1)(2,0,0)7 ARIMA model for ATM1 will be used to make predictions for ATM3.
fit3 <- forecast::Arima(ATM3_train, model=fit1)
Forecasts are done using the forecast::forecast() function. Since the data were not seasonally adjusted, they need not be reseasonalized prior to forecast. Prediction point estimates are represented by a blue line, prediction intervals are represented by blue bands, and actual values are represented by a red line.
fcast1 <- forecast::forecast(fit1, h=30)
fcast2 <- forecast::forecast(fit2, h=30)
fcast3 <- forecast::forecast(fit3, h=30)
fcast4 <- forecast::forecast(fit4, h=30)
par(mfrow=c(4, 1), mar = c(0, 4, 0, 0), oma = c(4, 4, 2, 0.5))
plot(fcast1, ylab="Cash ATM1", main="", xaxt="n");
lines(lag(ATM1_test, -length(ATM1_train)), col="red")
plot(fcast2, ylab="Cash ATM2", main="", xaxt="n");
lines(lag(ATM2_test, -length(ATM2_train)), col="red")
plot(fcast3, ylab="Cash ATM3", main="", xaxt="n")
lines(lag(ATM3_test, -length(ATM3_train)), col="red")
plot(fcast4, ylab="Cash ATM4", main="", xaxt="n")
lines(lag(ATM4_test, -length(ATM4_train)), col="red")
title("ATM Predictions", outer=TRUE)
Observations:
The accuracy() function is helpful for obtaining summary measures of the forecast accuracy: Mean Error (ME), Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), Mean Percentage Error (MPE), Mean Absolute Percentage Error (MAPE), Mean Absolute Scaled Error (MASE), and Autocorrelation of errors at lag 1 (ACF1).
round(forecast::accuracy(fcast1, length(ATM1_test)), 3)
ME RMSE MAE MPE MAPE MASE ACF1
Training set 2.038 25.007 16.039 -96.186 114.754 0.427 0.011
Test set -53.187 53.187 53.187 -177.290 177.290 1.416 NA
round(forecast::accuracy(fcast2, length(ATM2_test)), 3)
ME RMSE MAE MPE MAPE MASE ACF1
Training set 1.456 24.795 17.275 -Inf Inf 0.40 -0.013
Test set -44.485 44.485 44.485 -148.284 148.284 1.03 NA
round(forecast::accuracy(fcast4, length(ATM4_test)), 3)
ME RMSE MAE MPE MAPE MASE ACF1
Training set 96.204 360.567 280.446 -342.343 388.847 0.72 0.017
Test set -385.878 385.878 385.878 -1286.261 1286.261 0.99 NA
These accuracy for the predications vary. ATM1 and ATM2 predictions are more accurate than ATM4 predictions. The closer the original data are to being White Noise, the less accurate the predictions.


EnsureFramework
A simple framework to ensure variables and parameters
Hello
EnsureFramework is designed to take the pain out of null checking and making sure (ensuring) your methods are being used the way they were intended and throwing exceptions when unsupported values are passed to them.
You can make sure values are in a specific range or simply make sure that an argument is not null.
It was designed to be readable and fluent based, meaning you can chain ensurables together and the first one that fails will result in the exception.
Get it!
EnsureFramework is available on NuGet. Just run the required command below:
PM> Install-Package EnsureFramework -Version 1.3.0


| Interface | Description |
|---|---|
| ItemClickListener |
Interface to be implemented by activities that utilize a Recycler view.
|
| Class | Description |
|---|---|
| AddEditTaskActivity |
An activity class used to display the Requesting users
Add task interface, edit task interface, and bidded task interface
|
| Bid |
A model representation of a bid made on a given task.
|
| BidListAdapter |
Binds the bid view holder with the recycler view bid list
|
| BidViewHolder |
Inflates the card for a bid in the recycler view
Created by aidankosik on 2018-03-03.
|
| BuildConfig | |
| CreateAccountActivity |
Allows a user register an account with the server to use the application
|
| DataManager |
Handles all communication between the application and the server
|
| DataManager.addTasks |
Inserts new tasks into the database
|
| DataManager.addUsers |
Inserts new Users into the database
|
| DataManager.deleteTasks |
Deletes tasks from the database
|
| DataManager.deleteUsers |
Deletes users from the database
|
| DataManager.getTasks |
Gets a list of tasks based on the search parameters
|
| DataManager.getUsers |
Gets a list of users based on the search parameters
|
| DataManager.updateTasks |
updates tasks in the database
|
| DataManager.updateUsers |
updates users in the database
|
| EditProfileActivity |
Allows the user to edit the information in their own profile (except username).
|
| FullScreenImageActivity |
Shows a clicked image in a larger view by scaling it to the available screen size
|
| ImageViewAdapter |
Adapter class for the Recycler view to display images
|
| ListTaskActivity |
An activity class used to list the requestor/bidders tasks;
It will list tasks for requestors, sorted by Requested, Bidded,
Assigned and Completed.
|
| LoginActivity | |
| Manifest | |
| Manifest.permission | |
| MapActivity | |
| NavigationActivity |
The navigation drawer that is seen as the main menu across most activities for ease of use --
a superclass to all other activities that feature the menu.
|
| PlaceBidActivity | |
| R | |
| R.anim | |
| R.animator | |
| R.array | |
| R.attr | |
| R.bool | |
| R.color | |
| R.dimen | |
| R.drawable | |
| R.id | |
| R.integer | |
| R.interpolator | |
| R.layout | |
| R.menu | |
| R.mipmap | |
| R.string | |
| R.style | |
| R.styleable | |
| RecentListingsActivity | |
| Review |
A model representation of a review made for a user.
|
| Task |
A model representation of a task made by a task provider and to be completed by a task provider.
|
| TaskBidListActivity |
Activity that shows a list of bids made on the current users tasks.
|
| TaskDetailsActivity |
Activity Class that lists the details of all the recent listings
Tasks, as well as Assigned and Completed tasks in My Requests.
|
| TaskListAdapter |
Binds the task view holder with the recycler view task list
|
| TaskViewHolder |
Inflates the card for a task in the recycler view
Created by aidankosik on 2018-03-01.
|
| User |
A model representation of a user of the application (requester or provider).
|
| UserProfileDialog |
The dialog shown when a username is clicked anywhere in the application -- shows
all information pertaining to the user that was clicked.
|
| Enum | Description |
|---|---|
| Task.TaskStatus |


| Interface | Description |
|---|---|
| AddCommentDialog.AddCommentDialogListener | |
| EditCommentDialog.EditCommentDialogListener |
| Class | Description |
|---|---|
| AccountManager |
Handles all account related methods such as login, account creation, updating account info, and lastly account deletion.
|
| AddCommentDialog |
This dialog displays the add comment dialog
when press confirm, it will pass the
information in the recordActivity
|
| AddPatientActivity |
This is the activity that enables a care provider to add a patient to list.
|
| AddRecordActivity |
This activity displays the problems specified by the user as a list.
|
| CareProvider | |
| CareProviderProfileActivity | |
| CareProviderProfileActivityTest | |
| CareProviderTest | |
| Comment |
Represents a comment that the user is having.
|
| CommentList |
Contains a List of comments, with methods that modify or return comments
|
| CommentListTest | |
| CommentTest | |
| CreateAccountActivity | |
| EditCommentDialog |
This dialog displays the add comment dialog
when press confirm, it will pass the
information in the recordActivity
|
| EditProblemActivity |
This activity receives a problem from ProblemListActivity, and edits its contents.
|
| EditProfileActivity | |
| ElasticSearchController | |
| ElasticSearchController.CreateCareProvider |
Handles the creation a new account for a Care Provider.
|
| ElasticSearchController.CreatePatient |
Handles the creation a new account for a Patient.
|
| ElasticSearchController.DeleteUser |
Handles the deletion of a User's account.
|
| ElasticSearchController.GetCareProvider |
Handles the finding of a Patient account.
|
| ElasticSearchController.GetCareProviderByCode |
Handles the finding of a CareProvider account by Generated Code.
|
| ElasticSearchController.GetPatient |
Handles the finding of a Patient account by userID.
|
| ElasticSearchController.GetPatientByCode |
Handles the finding of a Patient account by Generated Code.
|
| ElasticSearchController.UpdateCareProvider |
Handles updating of Care Provider's account.
|
| ElasticSearchController.UpdatePatient |
Handles updating of Patient's account.
|
| ElasticSearchControllerTest | |
| ExampleInstrumentedTest |
Instrumented test, which will execute on an Android device.
|
| ExampleUnitTest |
Example local unit test, which will execute on the development machine (host).
|
| GalleryActivity | |
| LoginActivity | |
| LoginActivityTest |
Reference: https://github.com/ta301-ks/lonelyTwitter/blob/lab7UI/app/src/androidTest/java/ca/ualberta/cs/lonelytwitter/LonelyTwitterActivityTest.java
|
| MapsActivity | |
| OfflineBehaviorController |
Controls the local data flow for when there is no Internet connection for ElasticSearch.
|
| Patient | |
| PatientList | |
| PatientListActivity |
This is the adapter enabling the patient list to be shown as a ListView
Sources:
Nguyen Duc Hoang, https://www.youtube.com/watch?v=Q_fDWhqKX7g
https://github.com/mitchtabian/ListViews
https://www.youtube.com/watch?v=NMTUsrBHCrA
https://stackoverflow.com/questions/12276138/android-listview-not-scrolling
http://tutorialwide.com/retain-correct-position-filtering-listview-android/
|
| PatientListActivityTest |
Reference: https://github.com/ta301-ks/lonelyTwitter/blob/lab7UI/app/src/androidTest/java/ca/ualberta/cs/lonelytwitter/LonelyTwitterActivityTest.java
|
| PatientListTest | |
| PatientProfileActivity | |
| PatientSearchInfo | |
| PatientSearchInfoTest |
Test for PatientSearchInfo class
|
| PatientTest | |
| Photo |
Converts a given bitmap to a string, and then back to a bitmap.
|
| PhotoTest | |
| Problem |
Represents a problem that the user is having.
|
| ProblemList |
Contains a List of Problems, with methods that modify or return problems
|
| ProblemListActivity |
This activity displays the problems specified by the user as a list.
|
| ProblemListActivityTest | |
| ProblemListTest | |
| ProblemTest | |
| Record |
Record is used to record the patients' problem
Records can have a title, a description, a date the problem started, a location, and a photo
|
| RecordActivity | |
| RecordActivityTest | |
| RecordList | |
| RecordListActivity | |
| RecordListActivityTest | |
| RecordListTest | |
| RecordTest | |
| SearchPatientAdapter | |
| User |


I never wanted to do this in the first place!
I always wanted to be... a lumberjack!
I always wanted to be... a lumberjack!
I always wanted to be... a lumberjack!
I always wanted to be... a lumberjack!
I always wanted to be... a lumberjack!
I always wanted to be... a lumberjack!
I always wanted to be... a lumberjack!
I always wanted to be... a lumberjack!


AudioM was built as a prototype to examine the effects of audio feedback on memory training within a period of one and half month. As one of the main challenges in rehabilitation of children with acquired brain injuries is to motivate memory training,
one approach is to make use of sound stimuli and the benefits found in order to produce positive neurobehavioral development.
The prototype was built in Unity and evaluated through user-tests. My part in this project was to provide design decisions and research for the intended user group.


Life Members
Alan Nixon
Life Member
Life Member since May 2015
Alan has been Secretary of North Queensland Ensembles Inc. /Barrier Reef Orchestra for eight years.
He is a former Commonwealth Government officer mainly in the Commonwealth Employment Service and prior to retirement he was the Department's Zone Manager for North Queensland. This expertise has served the Orchestra well as Alan has facilitated North Queensland Ensembles becoming incorporated and was also Secretary at the time when we employed our first Orchestra Manager.
Alan has a background in community service having been a member of both Australian Jaycees and Rotary. He has also had long experience as an actor, producer and Committee member with several little theatre groups across the State.
Carol Dall'Osto
Life Member
Life Member since July 2010
Carol has been a leading figure in music performances in Townsville for many years despite living in Ingham until the early 2000s when she moved to Townsville. Carol is a piano teacher, accompanist, and musical director of the Australian Concerto and Vocal Competition which she has led since 1991.She was involved with the others in the formation of the Barrier Reef Orchestra, and was chairperson of the North Queensland Ensembles Committee (the parent organization for the Orchestra), a position she held until 2003.
David Pearse
Life Member
PHOTO NOT AVAILABLE
Life Member since June 2006
David was heavily involved with the Townsville music scene from the 1970s, including the formation of the BRO in 1999. He was made a Life Member by the Committee in June 2006, when he and his wife Elizabeth left Townsville to live in Canberra.
Donna McMahon
Life Member
Life Member since July 2010
Donna has been a leader in the Townsville music community since she arrived in 1973 fresh from the Conservatorium to teach strings for Education Queensland. Until 2009 she has also been involved with the Townsville Youth Orchestra, the Australian String Teachers’ Association, the Australian Concerto & Vocal Competition, and lately of course the Barrier Reef Orchestra. Apart from being one of the prime movers in the formation of the BRO, she has been performer, rehearsal conductor, musical advisor, & visiting conductor liaison. In 2009, she was rehearsal conductor, played with the orchestra, and managed the music library. She recently graduated with a Masters Degree in Music from James Cook University.
Jacinta Payne
Life Member
Life Member since May 2015
Jacinta has been part of the Orchestra from the beginning when she played 1st Clarinet at the first performance on Sunday, 29th October 2000.
She has been on the management committee and was a voluntary manager of the Orchestra. Jacinta has had the task of being Rehearsal Conductor on many occasions and conducted a performance in 2004.
Over the years, through her teaching she has been able to encourage many players to join the Orchestra and has mentored many young woodwind players.
Jenny Carr
Life Member
Life Member since July 2010
Jenny Carr came to Australia from Scotland in the early 70s and instantly became an integral part of the Townsville music scene as a pianist and instrumental music teacher. In 1998 when the decision was made to establish a community orchestra, Jenny worked as librarian, performer and for many years as Manager . In conjunction with Donna McMahon and Susan Linge (from the Civic Theatre), they arranged a series of concerts for the emerging orchestra. She also played with the orchestra when a pianist was needed. As Manager, she was involved in all aspects of handling the orchestra's music and checking attendances. In later years, Jenny worked as Adjudicator’s Assistant for the Australian Vocal and Concerto Competition.
Stephen Frewen-Lord
Life Member
Life Member since May 2015
Stephen has been involved with the Barrier Reef Orchestra since its inception; having played as concert master in the orchestra’s inaugural concert in 2000. Since then, he has missed only a couple of Barrier Reef Orchestra concerts, and has been concert master for most concerts.
When not rehearsing with the BRO, Stephen is involved in a number of ensembles around Townsville. He manages and plays with the Melaleuca String Quartet, directed Strings Non Troppo, and plays in Double Play – a guitar/violin duo. Stephen has had regular involvement with the Mulkadee Arts Festival, and performs regularly in community events such as Eco Fiesta, Riverfest, Heritage Day and Stable on the Strand.
In his role as concert master over the past 15 years, Stephen has enjoyed many discussions with guest conductors concerning the artistic direction of the orchestra. As a string teacher, he has encouraged many young string players to become regular members of the orchestra. Stephen loves his involvement with the orchestra, and is delighted to be joined by young players who share his passion for music. Stephen is looking forward to passing on the baton to the next BRO concert master!
The Barrier Reef Orchestra Committee
| President | Judy Hunter |
| Vice-President | Ben Fixter |
| Secretary | Lorraine Gray-McConnell |
| Treasurer | Nadine Ziegenfusz |
| Committee | Gay Copeman |
| Alexandra Gorton | |
| Simon McConnell | |
| Helen Land | |
| Marg Naylor | |
| Ron Piper | |
| Noel Price | |
| Andrew Ryder | |
| Billie Saint-Rang | |
| Orchestra Manager | Sally Frewen-Lord |
| Newsletter Editor | Marg Naylor |


Main Page
|
Modules
|
Globals
NexwayLib Defines
Defines
#define
RBX_USBOR_INSTALL_DIR
Robix Usbor installation directory.
Define Documentation
#define RBX_USBOR_INSTALL_DIR
Robix Usbor installation directory.
Important:
If did not install the Usbor software to the default location, you should edit this value in rbxNexwayLib.h.
Generated on Tue Mar 1 19:23:58 2005 for Robix Nexway Library by
1.4.1


down-the-fall-line
2017-01-19 21:57
has joined #marketstrategy
down-the-fall-line
2017-01-19 21:57
@down-the-fall-line set the channel purpose: marketing and strategy discussion topics
nandini.parimi
2017-01-20 00:03
has joined #marketstrategy
falseprophet
2017-01-20 00:03
has joined #marketstrategy
jer979
2017-01-20 00:03
has joined #marketstrategy
ry
2017-02-03 20:44
has joined #marketstrategy
ry
2017-02-03 20:44
@ry archived the channel (w/ 5 members)


{{site.user_description}}
Worked on projects involving Javascript and Node JS. Has developed web applications using HTML5. Used tools like brackets,web debugger to code and debug.
Developed mobile apps ranging from small business to entreprise. Loves to experiment new technology on mobile ecosystem. Loves to contribute in open source.


Kubernetes 01
“Containerization transforms the data center
from being machine-oriented
to beingapplication-oriented”
Burns et al., Borg, Omega, and Kubernetes, 2016
_jsenon
jsenon
---
---
Founded in 2015
Cloud native technologies empower organizations
to build and run scalable applications in modern, dynamic environments such as public,
private, and hybrid clouds.
Seeks to drive adoption of this paradigm by fostering and sustaining an ecosystem of open source, vendor-neutral projects.
Help project to grow
https://github.com/cncf/toc/blob/master/DEFINITION.md
---
Graduated
---
Incubated
---
Sandboxed
---
Landscape
https://landscape.cncf.io/images/landscape.png
---
Kubernetess
Greek for "governor", "helmsman" or "captain"
---
Originally named Borg
Created by Google in 2014 (Joe Beda, Brendan Burns and Craig McLuckie)
Released by CNCF on Summer 2015
v.1.13 on 13th December 2018
Current release: 1.13.3
---
Kubernetes is a portable, extensible open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation
---
---
---
It orchestrates computing, networking, and storage infrastructure on behalf of user workloads
It provides:
Self-Healing
Automatic bin-packing
scaling and autoscaling (vertical in coming version)
Service Discovery and Basic Load balancing
Automated rollouts and rollbacks
Logging and monitoring
---
---
The basics
---
Nodes
Where your containers run
---
Nodes
---
Pods
The atom of scheduling for containers
Pods have IPs which are routable
---
Pods
---
Networking
Pods can communicate directly with each other even across nodes
---
Pod to Pod
---
YAML
---
Apply Yaml
---
Service
A Service has a static IP and DNS entry
Act as LoadBalancer
Typically, services and pods have IPs only routable by the cluster network
---
Labels
Key/value pairs
Kubernetes connects things together with labels
Grouping mechanism
---
YAML
---
Service
---
Deployment
Deployment is higher level concept that manage replica sets, pods, and provide declarative updates
Describe the desired state and k8s controller will change the actual state
Deploying new version will result in a rolling-update
---
Deployment
---
Deployment and Rolling
---
Replicaset
Ensures that a specified number of pods are running
Use Deployments to control your Replica Sets
---
Replicaset
---
Config Map
Manage app config
Inject config as a virtual volume into your Pods
---
Secret
Manage access to secured something
Inject secret as a virtual volume into your Pods
---
Configmap
---
Tips: Logs
---
Tips: Forwarding
---
Advanced
---
---
Job
Run-to-completion, as opposed to run-forever
Built for batch and big-data work
CronJob
Schedule job execution
---
Volumes
- Bound to Pod
- Look like directories to Containers
- Many Volume:
- EmptyDir
- HostPath
- CloudProvider (EBS,EFS)
Namespaces
Namespace is like a folder
Namespaces are intended for use in environments
with many users spread across multiple teams, or projects
---
Volumes
---
Horizontal Pod Autoscalling
- Automatically scale pods as needed
- Based on:
- Metric Server (CPU, Mem)
- Custom Metric Server like Prometheus
---
---
Autoscalling
---
Autoscalling
---
Statefulset
Unlike a Deployment, a StatefulSet maintains a sticky identity for each of their Pods
Designed to deploy stateful applications and clustered applications that save data to persistent storage
---
Daemonset
DaemonSets attempt to adhere to a one-Pod-per-node model, either across the entire cluster or a subset of nodes.
As you add nodes to a node pool, DaemonSets automatically add Pods to the new nodes as needed.
---
LoadBalancer
Use CloudProvider functionality to attach LB to a service
---
LoadBalancer
---
Ingress L7
An Ingress is a collection of rules that allow inbound connections to reach the cluster services.
An Example: Envoy with Istio
---
And more:
Request and Limit
QoS
Quotas
RBAC
NetworkPolicy
...
---
Architecture
---
Imperative vs Declarative
---
Overview
---
Component
---
Admission
---
Plugin Oriented
Container Network Interface
Flanel
Cilium
Weave
Calico
Container Runtime Interface
Docker
Cri-o
Rkt
...
Container Storage Interface
Cinder
AWS EBS
GCE Persistent disk
CephFS
---
Add-on example
Cluster Autoscaller
Automatically resizes clusters based on the demands of the workloads you want to run
---
And
Service Mesh
The trends of containeri-zation, microservices and hybrid/multi-cloud deployments
have created more distributed applications than ever.
Developers, devops and secops personnel need modern tools to secure,
manage and monitor distributed applications.
---
References
https://kubernetes.io/docs/
https://cloud.google.com/kubernetes-engine/docs/concepts/
https://thenewstack.io/
https://cncf.io
https://kubernetes-csi.github.io/docs/Drivers.html
https://www.youtube.com/watch?v=PH-2FfFD2PU
https://www.youtube.com/watch?v=4ht22ReBjno&t=379s
Presentation made with demoit https://github.com/dgageot/demoit
---
Next topics
Day to day dev with Kubernetes
Kubernetes 101: Sysadmin view
Kubernetes and Applications /health /ready /metrics, autoscaller based on custom metrics
Service Mesh Basic
Service Mesh Advanced: Circuit breaker, Retry, OIDC
Serverless avec Knative


GameScore
public class GameScore: NSObject, UniqueAble, Mitigatable, Parsable, EnvironmentConfigurable
Model object that implements protocol BaseModel
that can be fount in pod AirRivet
.
In this example GameScore has to inherit from NSObject to be usable in Objective-C. In a pure Swift project this is not needed.
-
Undocumented
Declaration
Swift
public class GameScore: NSObject, UniqueAble, Mitigatable, Parsable, EnvironmentConfigurable
-
Undocumented
Declaration
Swift
public class GameScore: NSObject, UniqueAble, Mitigatable, Parsable, EnvironmentConfigurable
-
Undocumented
Declaration
Swift
public class GameScore: NSObject, UniqueAble, Mitigatable, Parsable, EnvironmentConfigurable
-
Undocumented
Declaration
Swift
public class GameScore: NSObject, UniqueAble, Mitigatable, Parsable, EnvironmentConfigurable
-
Undocumented
Declaration
Swift
public class GameScore: NSObject, UniqueAble, Mitigatable, Parsable, EnvironmentConfigurable
-
Undocumented
Declaration
Swift
public class GameScore: NSObject, UniqueAble, Mitigatable, Parsable, EnvironmentConfigurable
-
Undocumented
Declaration
Swift
public class GameScore: NSObject, UniqueAble, Mitigatable, Parsable, EnvironmentConfigurable
-
Undocumented
Declaration
Swift
public class GameScore: NSObject, UniqueAble, Mitigatable, Parsable, EnvironmentConfigurable
-
Undocumented
Declaration
Swift
public class GameScore: NSObject, UniqueAble, Mitigatable, Parsable, EnvironmentConfigurable
-
Undocumented
Declaration
Swift
public class GameScore: NSObject, UniqueAble, Mitigatable, Parsable, EnvironmentConfigurable
-
Undocumented
Declaration
Swift
public class GameScore: NSObject, UniqueAble, Mitigatable, Parsable, EnvironmentConfigurable
-
Undocumented
Declaration
Swift
public class GameScore: NSObject, UniqueAble, Mitigatable, Parsable, EnvironmentConfigurable


Class SECSIHeader
This class represents a SECS message header when a SECS-II message is sent via the SECS-I transport layer. Refer to the SEMI Standards covering E004 for more information.
Inherited Members
Namespace: com.CIMthetics.CSharpSECSTools.SECSCommUtils
Assembly: SECSCommUtils.dll
Syntax
public class SECSIHeader : SECSHeader
Constructors
SECSIHeader()
This class represents a SECS message header when a SECS-II message is sent via the SECS-I transport layer. Refer to the SEMI Standards covering E004 for more information.
Declaration
public SECSIHeader()
SECSIHeader(HSMSHeader)
This constructor will create a SECS-I message header from an HSMS message header. It needs to be understood that not all of the attributes are present in both forms of a SECS message header. There are only a few situations in which using this constructor would make sense. It might make sense in a situation where an intermediary was "translating" messages from a device using SECS-I as a transport layer to a device using HSMS as a transport layer and vica versa.
Note: A SessionID in an HSMS header is a 16 bit number whereas the DeviceID in a SECS-I header is a 15 bit number. You will get aConstraintException
if the high bit in the SessionID is set
when you use this constructor.
Declaration
public SECSIHeader(HSMSHeader header)
Parameters
| Type | Name | Description |
|---|---|---|
| HSMSHeader | header |
SECSIHeader(SECSIHeader)
This is a copy constructor.
Declaration
public SECSIHeader(SECSIHeader header)
Parameters
| Type | Name | Description |
|---|---|---|
| SECSIHeader | header |
SECSIHeader(Byte[])
This class represents a SECS message header when a SECS-II message is sent via the SECS-I transport layer. Refer to the SEMI Standards covering E004 for more information.
Declaration
public SECSIHeader(byte[] header)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | header |
Properties
BlockNumber
Block Number - A message sent as more than one block is called a multi-block message. The first block is given a block number of one, and the block number is incremented by one for each subsequent block until the entire message is sent. The blocks of a multi-block message are sent in order. In a single-block message, the block number must have a value of zero or one. The maximum block number is 32,767. The upper block number is the most significant portion of the block number.
Declaration
public ushort BlockNumber { get; set; }
Property Value
| Type | Description |
|---|---|
| System.UInt16 |
DeviceID
Device ID - The device ID defines the source or destination of the message depending upon the value of the R-bit as shown in Table 3. Device identification is a property of the equipment and must be settable according to Section 8. The host can view the device ID as a logical identifier connected with a physical device within the equipment. The host has no device ID.
Declaration
public ushort DeviceID { get; set; }
Property Value
| Type | Description |
|---|---|
| System.UInt16 |
Ebit
End Bit (E-Bit) - The end bit (E-bit) is used to determine if a block is the last block of a message. A value of one in the E-bit means that the block is the last block. A value of zero means that more blocks are to follow.
Declaration
public bool Ebit { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Function
The function of the SECS-II message.
Declaration
public byte Function { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Byte |
Rbit
Reverse Bit (R-Bit) - The reverse bit (R-bit) signifies the
direction of a message. The R-bit is set to false
for messages
sent from the host to the equipment and set to true
for messages
sent from the equipment to the host. The
R-bit is included in the header so that the direction of
the message is contained in every block.
Declaration
public bool Rbit { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Stream
The stream of the SECS-II message.
Declaration
public byte Stream { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Byte |
Wbit
Wait Bit (W-Bit) - The wait bit (W-bit) is used to indicate
that the sender of a primary message expects a reply. A
value of true
in the W-bit means that a reply is expected. A
value of false
in the W-bit means that no reply is expected.
The W-bit must be set to false
in all secondary messages.
For multi-block messages, the sender must ensure that the W-bit
is the same in every block of the message.
Declaration
public bool Wbit { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Methods
EncodeForTransport()
This class represents a SECS message header when a SECS-II message is sent via the SECS-I transport layer. Refer to the SEMI Standards covering E004 for more information.
Declaration
public override byte[] EncodeForTransport()
Returns
| Type | Description |
|---|---|
| System.Byte[] |


Coroutines For the Working Python Developer
Stephen Diehl
Core
Generators and coroutines are a some of the most powerful and often misunderstood structures in modern Python. Even though both have been around since Python 2.5, there is very little good information on their advanced usage.
Comprehensions
Lets do a quick course in comprehensions, since these will be constantly in the examples for iterators, generators and coroutines.
List Comprehensions
List comprehensions are powerful. Rather than discuss them in detail, I'll just give a few examples and assume you're familiar with them.
Guarded comprehensions
List comprehensions can restrict their output by adding guards on to their end. These can contain arbitrarily complex logic.
print([a for a in xrange(8) if a > 3])
print([a for a in xrange(8) if a > 3 and a != 4])
[4, 5, 6, 7]
[5, 6, 7]
Compound Comprehensions.
List comprehensions can compounded to traverse multiple iterators. This generally considered bad practice as it can produce very complex code.
combinations = list([
x + y
for x in xrange(5)
for y in xrange(5)
])
print(combinations)
[0, 1, 2, 3, 4, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 4, 5, 6, 7, 8]
The one exception is if you're working with matrices or other multi-index data structures.
matrix = [
[1 , 2 , 3 , 4] ,
[5 , 6 , 7 , 8] ,
[9 , 10 , 11 , 12] ,
]
print( [[row[i] for row in matrix] for i in range(4)] )
[[1, 5, 9], [2, 6, 10], [3, 7, 11], [4, 8, 12]]
Side effectful comprehension.
Comprehensions can also execute arbitrary side effects anywhere in their construction. Again, also considered bad practice in most sane scenarios.
lst = []
[lst.append(val) for val in [1,2,3]]
print(lst)
[1, 2, 3]
Dictionary Comprehensions
dct = { a : b for a, b in [('foo', 'bar'), ('fizz', 'pop')] }
print( dct )
{'foo': 'bar', 'fizz': 'pop'}
Set Comprehensions
In Python 2.7+ there are also exist set comprehensions comprehensions.
print({a for a in [1,1,2,3]})
set([1, 2, 3])
Iterators
An iterator is something that can, well be iterated over. Many operations can be phrased in the language of iteration and many Python builtins consume iterables as their primary arguments. Its a very usefull pattern and is used constantly throughout all of Python.
Many Python builtins are iterable. For example:
for element in [3.141, 2.718, 2.685]:
print(element)
for letter in "Python":
print(letter)
for key in {'foo': 1, 'bar': 2}:
print(key)
3.141
2.718
2.685
P
y
t
h
o
n
foo
bar
Iterators are an interface based around two methods
__iter__
and next
. A next
method either returns a
value or raises a Python built-in StopIteration
exception.
Once an iterator has been consumed it is consumed permanently. It
should return StopIteration
for every call thereafter.
it = iter([1,2,3])
try:
print( it.next() )
print( it.next() )
print( it.next() )
print( it.next() )
except StopIteration:
print('done')
1
2
3
done
iter
The builtin function iter
is the prefix form of
obj.__iter__()
. It returns the interable interface of the object
if it exists.
This function is implicitly invoked in quite a few language
constructs. For example placing the iteraable as the operand in a
for loop implicitly invokes iter
. In this example
internal
is the equivelant code that Python is doing behind
the scenes for both forloop
and comprehension
.
f = lambda x: x
obj = [1,2,3]
def forloop():
results = []
for x in obj:
results += [f(x)]
return results
def comprehension():
return [f(x) for x in obj]
def internal():
results = []
it = obj.__iter__()
while True:
try:
results += [f( it.next() )]
except StopIteration:
break
return results
print( forloop() == comprehension() == internal() )
True
Custom Iterables
Of course, one is not limited to the builtin iterables, you can easily define your own.
It is common to refer to a object that returns itself ( i.e. self
)
as an iterator, it must also define a next
. While a
object that returns anything else as being iterable, it need
not necessarily define a next
method.
class IteratorExample(object):
def __init__(self, n):
self.source = [n**2 for n in range(n)]
def __iter__(self):
self.i = 0
return self
def next(self):
if self.i >= len(self.source):
raise StopIteration
else:
value = self.source[self.i]
self.i += 1
return value
class IterableExample(object):
def __init__(self, n):
self.source = [n % 2 for n in range(n)]
def __iter__(self):
# Uses a listiterator
return iter(self.source)
a = IterableExample(5)
b = IteratorExample(5)
print(iter(a))
print(iter(b))
print([x for x in a])
print([x for x in b])
# You get many operations for free!
print(3 in a)
print(filter(lambda x: x>3, b))
<listiterator object at 0x1975c90>
<IteratorExample object at 0x1975c10>
[0, 1, 0, 1, 0]
[0, 1, 4, 9, 16]
False
[4, 9, 16]
Sortable Iterables
Building sortable objects is a task that shows up enough that it is worth discussing. For a thorough discussion of orderings see Order Theory for Computer Scientists. What we will construct is a total-ordering.
from functools import total_ordering
@total_ordering
class Age:
def __init__(self, age):
self.year, self.interval = age.split()
def __eq__(self, other):
return(
self.year == other.year and
self.interval == other.interval
)
def __lt__(self, other):
if self.interval == other.interval:
return self.year < other.year
else:
if self.interval == 'BC' and other.interval == 'AD':
return True
else:
return False
def __repr__(self):
return ' '.join([self.year, self.interval])
stoneage = Age('2000 BC')
bronzeage = Age('600 BC')
enlightenment = Age('1800 AD')
ages = [stoneage , enlightenment, bronzeage ]
print( sorted(ages) )
[2000 BC, 600 BC, 1800 AD]
Callable Iterators
The little known other syntax for iter
takes two arguments, a
callable and a sentinel. The callable is called until sentinel
it equals the sentinel. This a callable-iterator
.
count = 0
def counter():
global count
count += 1
return count
it = iter(counter, 5)
print(type(it))
print(list(it))
<type 'callable-iterator'>
[1, 2, 3, 4]
In practice this is rarely used, but is sometimes usefull for reading files and doing other IO style iterations.
# Read from file until we reach EOF
fd = open('/proc/sys/kernel/version')
lines = iter(fd.readline, '')
print(list(lines))
# Read input from the user until we get a done message
iter(raw_input, 'done')
['#1 SMP PREEMPT Sat Jul 9 14:57:41 CEST 2011\n']
The Many Flavors of Iterators
def typeof(obj):
print(type(obj))
typeof(iter(xrange(5)))
typeof(iter(set([1,2,3])))
typeof(iter([1,2,3]))
typeof(iter({'foo': 'bar'}))
typeof(iter((1,2,3)))
# The very important empty iterator
iter([])
<type 'rangeiterator'>
<type 'setiterator'>
<type 'listiterator'>
<type 'dictionary-keyiterator'>
<type 'tupleiterator'>
Enumerate
A very usefull function is the builtin enumerate, which can consume an interable and assign a index to each element.
lst = ['a', 'b', 'c']
print( [a for a in enumerate(lst)] )
for index, value in enumerate(lst):
print(index, value)
[(0, 'a'), (1, 'b'), (2, 'c')]
0 a
1 b
2 c
Generators
There are two points defining characteristics of generators,
their schedule and their values. Both are controlled by
the keyword yield
. Ostensibly a generator is a function that
when started will produce a scheduled sequence of values which
can be lazily evaluated.
The yield
is often confusing to newcomers because it does two
actions, it suspends execution of the generator and
simultaneously returns a value. When the generator is invoked
again it resumes execution. There is also no restriction on the
number of yield statements in a generator, in this sense they are
analogous to a the return
, but this comparison is somewhat
misleading because they are fundamentally different actions.
A generator is special case of the more general type of structures known as asymmetric coroutines. The distinction between a coroutine and a generator is that a coroutine can accept further arguments after it has been invoked, whereas a generator cannot. We'll cover these later. For now, here's a simple example:
def generator():
yield 'a'
yield 'b'
yield 'c'
for x in generator():
print(x)
a
b
c
Generator Schedules (1)
Lets take a deeper look inside a timed schedule. In this example
we see that the generator "returns" its results on a 0.1 second
interval. The iterator, in turn, returns its results in one large
lump at 1 second ( 10 x 0.1s
)s``.
import time
from timeit import timeit
from itertools import izip
def show_schedule(stream):
tic = time.time()
stic = time.time()
print('%5s %5s %2s ' % ('time', 'dt', 'i'))
for x in stream():
toc = time.time()
print('%5.2f %5.2f %2s ' % (toc-stic, toc-tic, x))
tic = toc
def iterator():
result = []
for i in range(10):
time.sleep(0.1)
result.append(i)
return iter(result)
def generator():
for i in range(10):
time.sleep(0.1)
yield i
print('-- Generator --')
show_schedule( generator )
print('-- Iterator -- ')
show_schedule( iterator )
-- Generator --
time dt i
0.10 0.10 0
0.20 0.10 1
0.30 0.10 2
0.40 0.10 3
0.50 0.10 4
0.60 0.10 5
0.70 0.10 6
0.80 0.10 7
0.90 0.10 8
1.00 0.10 9
-- Iterator --
time dt i
1.00 1.00 0
1.00 0.00 1
1.00 0.00 2
1.00 0.00 3
1.00 0.00 4
1.00 0.00 5
1.00 0.00 6
1.00 0.00 7
1.00 0.00 8
1.00 0.00 9
Forcing a Generator
Forcing a generator causes it to be consumed in its entirety at a given time. This is is potentially a blocking operation.
One of the most common ways of forcing a generator is to cast it into a list or list comprehension.
def generator():
yield 1
yield 2
forced = [a for a in generator()]
forced = list(generator())
notforced = (a for a in generator())
print(type(forced))
print(type(notforced))
<type 'list'>
<type 'generator'>
from timeit import timeit
def blocker():
yield
time.sleep(1)
yield
# The blocking in ``blocker`` bubbles up to this context when
# consumer the generator.
forced_consumer = lambda: [a for a in blocker()]
async_consumer = lambda: (a for a in blocker())
print(timeit(forced_consumer, number=1))
print(timeit(async_consumer, number=1))
1.00108599663
1.09672546387e-05
Here we start to see the beginning of the power of generators in the we can pass around side-effectful, possibly blocking code to functions which can operate on their effects but without forcing the generators. Operating on data in a generally lazy manner.
from time import sleep, time
def counter():
for i in xrange(5):
sleep(0.2)
yield i
def doubler(x):
for j in x:
yield j
yield j
def squarer(x):
for k in x:
yield k**2
def printer(x):
tic = time()
for l in x:
print('%.2f %s' % (time() - tic, l))
pipeline = printer(doubler(counter()))
0.20 0
0.20 0
0.40 1
0.40 1
0.60 2
0.60 2
0.80 3
0.80 3
1.00 4
1.00 4
Generator Expressions
x = (a for a in [1,2,3]) # generator
y = [a for a in [1,2,3]] # list comprehension
z = {a for a in [1,2,3]} # set comprehension
print(type(x))
print(type(y))
print('Commong Gotcha', x == y)
for x,y in zip(x,y):
print(x,y)
<type 'generator'>
<type 'list'>
Commong Gotcha False
1 1
2 2
3 3
For functions that take a single argument, a generator expression can be passed in without extra parenthesis. For multiple argument functions they are still required.
# Not required
print( sum(x*x for x in range(10)) )
# Required
print( map(lambda x: x+1, (a for a in range(5))) )
285
[1, 2, 3, 4, 5]
Concurrent List Comprehensions
Itertools
For example a infinite list can be constructed and sliced using itertools methods.
from itertools import count, islice
integers = count()
slice = islice(integers, 10)
print( list(slice) )
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Generator Schedules (2)
The important concept in studying generators is that they execute through blocks of code on a schedule. We see hints of it becoming powerful control flow system. More of this later when we study coroutines.
def generator():
print('[Inside] Hello from inside')
yield
print('[Inside] hello again from inside')
yield
a = generator()
print('[Outside] Hello from outside')
a.next()
print('[Outside] Hello again outside')
a.next()
[Outside] Hello from outside
[Inside] Hello from inside
[Outside] Hello again outside
[Inside] hello again from inside
Or in this example, a "parallel" executor.
from itertools import izip
def generator(name):
print('[%s] task 1' % name)
yield
print('[%s] task 2' % name)
yield
# Run tasks in "parallel"
t1 = generator('foo')
t2 = generator('bar')
for t in izip(t1,t2):
print('[Scheduler] Switching')
[foo] task 1
[bar] task 1
[Scheduler] Switching
[foo] task 2
[bar] task 2
[Scheduler] Switching
Context Managers
Generator Internals
from sys import _getframe
def gen():
yield
print('frame', id(_getframe(0)), 'parentframe', id(_getframe(0).f_back))
yield
print('frame', id(_getframe(0)), 'parentframe', id(_getframe(0).f_back))
yield
print('frame', id(_getframe(0)), 'parentframe', id(_getframe(0).f_back))
def call():
a = gen()
a.next()
print('frame', id(_getframe(0)), 'parentframe', id(_getframe(0).f_back))
a.next()
print('frame', id(_getframe(0)), 'parentframe', id(_getframe(0).f_back))
a.next()
print('frame', id(_getframe(0)), 'parentframe', id(_getframe(0).f_back))
call()
frame 27413776 parentframe 26971040
frame 27053840 parentframe 27413776
frame 27413776 parentframe 26971040
frame 27053840 parentframe 27413776
frame 27413776 parentframe 26971040
from dis import dis
def gen():
yield
gr = gen()
def call():
gr.next()
gr.next()
dis(call)
10 0 LOAD_GLOBAL 0 (gr)
3 LOAD_ATTR 1 (next)
6 CALL_FUNCTION 0
9 POP_TOP
11 10 LOAD_GLOBAL 0 (gr)
13 LOAD_ATTR 1 (next)
16 CALL_FUNCTION 0
19 POP_TOP
20 LOAD_CONST 0 (None)
23 RETURN_VALUE


J.C. Leyendecker
Born: March 23, 1874, Montabaur, Germany
Died: July 25, 1951, New Rochelle, NY
Known for: Illustration, painting
Education: Art Institute of Chicago, Academie Julian
Joseph Christian Leyendecker (March 23, 1874 – July 25, 1951) was one of the preeminent American illustrators of the early 20th century. He is best known for his poster, book and advertising illustrations, the trade character known as The Arrow Collar Man, and his numerous covers for The Saturday Evening Post. Between 1896 and 1950, Leyendecker painted more than 400 magazine covers. During the Golden Age of American Illustration, for The Saturday Evening Post alone, J. C. Leyendecker produced 322 covers, as well as many advertisement illustrations for its interior pages. No other artist, until the arrival of Norman Rockwell two decades later, was so solidly identified with one publication.Leyendecker "virtually invented the whole idea of modern magazine design."
Joseph Christian Leyendecker was one of the preeminent American illustrators of the early 20th century.


CùiMía
Enter the zip code:
or city name:
Lasted zip search:
{{zip}}
Lasted city search:
{{cityname}}
Status:
Found
Not found
Forecast For: {{ place.location.city }}
Current: {{ place.item.condition.text }} | {{ f2c(place.item.condition.temp) }}°C
Forecast for next 5 days
STT
Date
Condition
High
Low
{{$index+1}}
{{ forecast.date }}
{{ forecast.text }}
{{ f2c(forecast.high) }}°C
{{ f2c(forecast.low) }}°C
Last Update:{{place.lastBuildDate}}
Please enter the city name or zip code to view.


Email :
<EMAIL_ADDRESS>Call :
8876 7786 999
Toggle navigation
Home
Homepage variation-1
Homepage variation-2
Homepage variation-3
about us
doctors
services
news
pages
Blog
Blog details
Doctors timetable
404 error
Appointment
contact us
Appointment
appointments
make
appointments
Select Department *
USA
Canada
France
Spain
Italy
Sex :
Male
Female
Child
submit
Medical Theme © 2015 | All Rights Reserved


1 // Copyright 2007, Google Inc. 2 // All rights reserved. 3 // 4 // Redistribution and use in source and binary forms, with or without 5 // modification, are permitted provided that the following conditions are 6 // met: 7 // 8 // * Redistributions of source code must retain the above copyright 9 // notice, this list of conditions and the following disclaimer. 10 // * Redistributions in binary form must reproduce the above 11 // copyright notice, this list of conditions and the following disclaimer 12 // in the documentation and/or other materials provided with the 13 // distribution. 14 // * Neither the name of Google Inc. nor the names of its 15 // contributors may be used to endorse or promote products derived from 16 // this software without specific prior written permission. 17 // 18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 30 31 // Google Mock - a framework for writing C++ mock classes. 32 // 33 // This file implements cardinalities. 34 35 #include "gmock/gmock-cardinalities.h" 36 37 #include <limits.h> 38 #include <ostream> // NOLINT 39 #include <sstream> 40 #include <string> 41 #include "gmock/internal/gmock-internal-utils.h" 42 #include "gtest/gtest.h" 43 44 namespace testing { 45 46 namespace { 47 48 // Implements the Between(m, n) cardinality. 49 class BetweenCardinalityImpl : public CardinalityInterface { 50 public: 51 BetweenCardinalityImpl(int min, int max) 52 : min_(min >= 0 ? min : 0), 53 max_(max >= min_ ? max : min_) { 54 std::stringstream ss; 55 if (min < 0) { 56 ss << "The invocation lower bound must be >= 0, " 57 << "but is actually " << min << "."; 58 internal::Expect(false, __FILE__, __LINE__, ss.str()); 59 } else if (max < 0) { 60 ss << "The invocation upper bound must be >= 0, " 61 << "but is actually " << max << "."; 62 internal::Expect(false, __FILE__, __LINE__, ss.str()); 63 } else if (min > max) { 64 ss << "The invocation upper bound (" << max 65 << ") must be >= the invocation lower bound (" << min 66 << ")."; 67 internal::Expect(false, __FILE__, __LINE__, ss.str()); 68 } 69 } 70 71 // Conservative estimate on the lower/upper bound of the number of 72 // calls allowed. 73 virtual int ConservativeLowerBound() const { return min_; } 74 virtual int ConservativeUpperBound() const { return max_; } 75 76 virtual bool IsSatisfiedByCallCount(int call_count) const { 77 return min_ <= call_count && call_count <= max_; 78 } 79 80 virtual bool IsSaturatedByCallCount(int call_count) const { 81 return call_count >= max_; 82 } 83 84 virtual void DescribeTo(::std::ostream* os) const; 85 86 private: 87 const int min_; 88 const int max_; 89 90 GTEST_DISALLOW_COPY_AND_ASSIGN_(BetweenCardinalityImpl); 91 }; 92 93 // Formats "n times" in a human-friendly way. 94 inline std::string FormatTimes(int n) { 95 if (n == 1) { 96 return "once"; 97 } else if (n == 2) { 98 return "twice"; 99 } else { 100 std::stringstream ss; 101 ss << n << " times"; 102 return ss.str(); 103 } 104 } 105 106 // Describes the Between(m, n) cardinality in human-friendly text. 107 void BetweenCardinalityImpl::DescribeTo(::std::ostream* os) const { 108 if (min_ == 0) { 109 if (max_ == 0) { 110 *os << "never called"; 111 } else if (max_ == INT_MAX) { 112 *os << "called any number of times"; 113 } else { 114 *os << "called at most " << FormatTimes(max_); 115 } 116 } else if (min_ == max_) { 117 *os << "called " << FormatTimes(min_); 118 } else if (max_ == INT_MAX) { 119 *os << "called at least " << FormatTimes(min_); 120 } else { 121 // 0 < min_ < max_ < INT_MAX 122 *os << "called between " << min_ << " and " << max_ << " times"; 123 } 124 } 125 126 } // Unnamed namespace 127 128 // Describes the given call count to an ostream. 129 void Cardinality::DescribeActualCallCountTo(int actual_call_count, 130 ::std::ostream* os) { 131 if (actual_call_count > 0) { 132 *os << "called " << FormatTimes(actual_call_count); 133 } else { 134 *os << "never called"; 135 } 136 } 137 138 // Creates a cardinality that allows at least n calls. 139 GTEST_API_ Cardinality AtLeast(int n) { return Between(n, INT_MAX); } 140 141 // Creates a cardinality that allows at most n calls. 142 GTEST_API_ Cardinality AtMost(int n) { return Between(0, n); } 143 144 // Creates a cardinality that allows any number of calls. 145 GTEST_API_ Cardinality AnyNumber() { return AtLeast(0); } 146 147 // Creates a cardinality that allows between min and max calls. 148 GTEST_API_ Cardinality Between(int min, int max) { 149 return Cardinality(new BetweenCardinalityImpl(min, max)); 150 } 151 152 // Creates a cardinality that allows exactly n calls. 153 GTEST_API_ Cardinality Exactly(int n) { return Between(n, n); } 154 155 } // namespace testing


Looking for a good workout? Too bad! You get the breaks instead! Here you can rest for 10 seconds while staring at a disturbing-looking man in an even more
disturbing position. Don't you think this will... invigorate your soul and mind? Well, you're wrong! It will just creep you out even more. Not to mention
the end of the video when the man - surprise surprise - dies! So if you're looking for an easy, surefire way to rest, and finally, die, you're at the
right place! :)


Gears Tactics and Ori and the Will of the Wisps will be at The Game Awards
There are going to be some surprises.
by Asher MadanWhat you need to know
- The Game Awards 2019 take place in December.
- Microsoft will showcase even more games at the event.
- Gears Tactics and Ori and the Will of the Wisps are confirmed to be in attendance.
- Xbox's Aaron Greenberg and Phil Spencer said they'll talk about more games before 2019 concludes.
The Game Awards 2019 take place in December, and host Geoff Keighley is hyping them up by teasing a number of amazing Microsoft Exclusives. Not only will Ori and the Will of the Wisps be there, but Gears Tactics — an XCOM-like title set in the Gears of War Universe — will also showcase new gameplay or possibly get a release date.
At X019, Xbox's Aaron Greenberg and Phil Spencer said that more reveals will take place before the end of the year. Who knows, maybe the rumored Fable reboot at Playground Games will be revealed. Only time will tell. What do you want to see from The Game Awards 2019 and Microsoft's presence there? Let us know.
Best of the best
Xbox Game Pass Ultimate
Xbox Game Pass and Xbox Live Gold in one
Xbox Game Pass gives you access to over a hundred games for one monthly fee. Xbox Game Pass Ultimate also adds Xbox Live Gold to the package so you can play online with your friends. Right now, you can purchase a three-month subscription for $45 through Amazon.
Get more Xbox
Xbox
- Xbox One S vs. Xbox One X: Which should you buy?
- Best Xbox One X and Xbox One S Accessories
- Best Xbox One Headsets 2019
- Best Xbox One Wireless Headsets 2019
- Best Xbox Controller Charging Stations in 2019
We may earn a commission for purchases using our links. Learn more.


We optimize platforms!
- generate clicks-and-mortar schemas
- embrace B2C experiences
- synthesize cross-platform e-commerce
- utilize value-added eyeballs
- recontextualize innovative schemas
- scale intuitive interfaces
- benchmark turn-key infrastructures
- engage strategic applications
- repurpose dot-com communities
- drive bricks-and-clicks synergies
- synthesize e-business platforms
- redefine extensible solutions
- utilize customized web-readiness


Welcome!
Help Wally out with this fun and interactive learning tool!
What will you learn using this tool?
-
Learn what makes insecure passwords so
unsafe!
-
Learn what not to do when creating and using passwords
online
-
Learn how to come up with safe and
strong passwords