|
LibDriver SGP30
2.0.0
SGP30 full function drive
|
sgp30 example driver modules More...
Functions | |
| uint8_t | sgp30_advance_init (void) |
| advance example init More... | |
| uint8_t | sgp30_advance_deinit (void) |
| advance example deinit More... | |
| uint8_t | sgp30_advance_read (uint16_t *co2_eq_ppm, uint16_t *tvoc_ppb) |
| advance example read More... | |
| uint8_t | sgp30_advance_get_serial_id (uint16_t id[3]) |
| advance example get the serial id More... | |
| uint8_t | sgp30_advance_get_feature (uint8_t *product_type, uint8_t *product_version) |
| advance example get the chip feature More... | |
| uint8_t | sgp30_advance_set_iaq_baseline (uint16_t tvoc, uint16_t co2_eq) |
| advance example set the chip iaq baseline More... | |
| uint8_t | sgp30_advance_get_iaq_baseline (uint16_t *tvoc, uint16_t *co2_eq) |
| advance example get the chip iaq baseline More... | |
| uint8_t | sgp30_advance_set_absolute_humidity (float temp, float rh) |
| advance example set the absolute humidity More... | |
| uint8_t | sgp30_basic_init (void) |
| basic example init More... | |
| uint8_t | sgp30_basic_deinit (void) |
| basic example deinit More... | |
| uint8_t | sgp30_basic_read (uint16_t *co2_eq_ppm, uint16_t *tvoc_ppb) |
| basic example read More... | |
sgp30 example driver modules
| uint8_t sgp30_advance_deinit | ( | void | ) |
advance example deinit
Definition at line 103 of file driver_sgp30_advance.c.
| uint8_t sgp30_advance_get_feature | ( | uint8_t * | product_type, |
| uint8_t * | product_version | ||
| ) |
advance example get the chip feature
| [out] | *product_type | points to a product type buffer |
| [out] | *product_version | points to a product version buffer |
Definition at line 168 of file driver_sgp30_advance.c.
| uint8_t sgp30_advance_get_iaq_baseline | ( | uint16_t * | tvoc, |
| uint16_t * | co2_eq | ||
| ) |
advance example get the chip iaq baseline
| [out] | *tvoc | points to a tvoc buffer |
| [out] | *co2_eq | points to a co2 buffer |
Definition at line 212 of file driver_sgp30_advance.c.
| uint8_t sgp30_advance_get_serial_id | ( | uint16_t | id[3] | ) |
advance example get the serial id
| [out] | *id | points to a serial id buffer |
Definition at line 146 of file driver_sgp30_advance.c.
| uint8_t sgp30_advance_init | ( | void | ) |
advance example init
Definition at line 49 of file driver_sgp30_advance.c.
| uint8_t sgp30_advance_read | ( | uint16_t * | co2_eq_ppm, |
| uint16_t * | tvoc_ppb | ||
| ) |
advance example read
| [out] | *co2_eq_ppm | points to a co2 buffer |
| [out] | *tvoc_ppb | points to a tvoc buffer |
Definition at line 125 of file driver_sgp30_advance.c.
| uint8_t sgp30_advance_set_absolute_humidity | ( | float | temp, |
| float | rh | ||
| ) |
advance example set the absolute humidity
| [in] | temp | is the current temperature |
| [in] | rh | is the current relative humidity |
Definition at line 234 of file driver_sgp30_advance.c.
| uint8_t sgp30_advance_set_iaq_baseline | ( | uint16_t | tvoc, |
| uint16_t | co2_eq | ||
| ) |
advance example set the chip iaq baseline
| [in] | tvoc | is the current tvoc |
| [in] | co2_eq | is the current co2 eq |
Definition at line 190 of file driver_sgp30_advance.c.
| uint8_t sgp30_basic_deinit | ( | void | ) |
basic example deinit
Definition at line 103 of file driver_sgp30_basic.c.
| uint8_t sgp30_basic_init | ( | void | ) |
basic example init
Definition at line 49 of file driver_sgp30_basic.c.
| uint8_t sgp30_basic_read | ( | uint16_t * | co2_eq_ppm, |
| uint16_t * | tvoc_ppb | ||
| ) |
basic example read
| [out] | *co2_eq_ppm | points to a co2 buffer |
| [out] | *tvoc_ppb | points to a tvoc buffer |
Definition at line 125 of file driver_sgp30_basic.c.


| Methods Summary | ||
|---|---|---|
public
|
#
__construct( string $extensionsDirectory , bool $strictMode = false, ArrayIterator\Extension\ParserInterface $parser = NULL )
Loader constructor.
|
|
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
#
getDuplications( )
Get list of duplicate classes while on parsing process
key name as base of directory.
|
|
public
|
||
protected
|
#
instantiateExtension( string $extensionClassName , ArrayIterator\Extension\ExtensionInfo $info )
Instantiate extension.
|
|
public
|
||
public
|
| Properties Summary | ||
|---|---|---|
protected
string
|
$extensionsDirectory
Extension directory to check.
|
#
NULL
|
protected
ArrayIterator\Extension\ParserInterface
|
$parser
Extension Parser.
|
#
NULL
|
protected
SplFixedArray
|
$stack
Stored data about extension
|
#
NULL
|
protected
bool
|
$strictMode
Determine if on strict mode.
|
#
false
|
protected
string[]
|
$keysNormal
List of original identifiers.
|
#
NULL
|
protected
int[]
|
$keysLower
List of lower case identifier. Values as offset stack.
|
#
NULL
|
protected
string[]|null
|
$loaded
List of loaded extensions.
|
#
NULL
|
protected
array|array[]|string[][]
|
$duplications
List of class name duplication extension detect by parser.
Key name as original string identifier.
|
#
array (
)
|


MISR Toolkit Python Interface
Previous:
3.6 MtkSomRegion
Up:
3 Containers
Next:
3.8 MtkRegCoeff
3.7 MtkProjParam
class
MtkProjParam
This object contains projection parameters.
lrc
Lower right corner.
nblock
Number of blocks.
nline
Number of lines.
nsample
Number of samples.
path
Path number.
projcode
Projcode.
projparam
Projection parameters.
resolution
Resolution.
reloffset
Reloffset.
spherecode
Sphere code.
ulc
Upper left corner.
zonecode
Zone code.
MISR Toolkit Python Interface
Previous:
3.6 MtkSomRegion
Up:
3 Containers
Next:
3.8 MtkRegCoeff


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PulseInput
An interface for pulse width and frequency measurements of digital signals.
PulseInput (commonly known as "input capture") is a versatile module which enables extraction of various timing information from a digital signal. There are two main use cases: pulse duration measurement and frequency measurement. In pulse width measurement we measure the duration of a positive ("high") or negative ("low") pulse, i.e. the elapsed time between a rise and a fall or vice versa. This mode is useful, for example, for decoding a PWM signal or measuring the delay of a sonar return signal. In frequency measurement we measure the duration between a rising edge to the following rising edge. This gives us a momentary reading of a signal's frequency or period. This is commonly used, for example, in conjunction with an optical or magnetic sensor for measuring a turning shaft's speed.
PulseInput
instances are obtained by calling
IOIO.openPulseInput(ioio.lib.api.DigitalInput.Spec, ioio.lib.api.PulseInput.ClockRate, ioio.lib.api.PulseInput.PulseMode, boolean)
. Once created, the client would typically use getDuration()
for getting the most recent
duration reading (either pulse width or period), or getFrequency()
for getting the most
recent frequency reading (available only in frequency mode).
When creating the instance, some important configuration decisions have to be made: the precision
(single or double), the clock rate and the mode of operation. Modes are straightforward:
PulseInput.PulseMode.POSITIVE
is used for measuring a positive pulse, PulseInput.PulseMode.NEGATIVE
a
negative pulse, and PulseInput.PulseMode.FREQ
/ PulseInput.PulseMode.FREQ_SCALE_4
/
PulseInput.PulseMode.FREQ_SCALE_16
are used for measuring frequency. The difference between the
three scaling modes is that without scaling, the frequency is determined by measurement of a
single (rising-edge-to-rising-edge) period. In x4 scaling, 4 consecutive periods are measured and
the time is divided by 4, providing some smoothing as well as better resolution. Similarly for
x16 scaling. Note that scaling affects the range of signals to be measured, as discussed below.
The choice of single vs. double-precision is important to understand: IOIO internally uses either 16-bit counters or 32-bit counters for the timing. 16- counters force us to either limit the maximum duration (and the minimum frequency) or compromise accuracy as compared to 32-bit counters. However, if you need many concurrent pulse measurements in your application, you may have no choice but to use single-precision.
The clock rate selection is important (and even critical when working in single-precision) and requires the user to make some assumptions about the nature of the measured signal. The higher the clock rate, the more precise the measurement, but the longest pulse that can be measured decreases (or lowest frequency that can be measured increases). Using the scaling option when operating in frequency mode also affects these sizes. combinations. It is always recommended to choose the most precise mode, which exceeds the maximum expected pulse width (or inverse frequency). If a pulse is received whom duration exceeds the longest allowed pulse, it will be "folded" into the valid range and product garbage readings.
The following table (sorted by longest pulse) summarizes all possible clock / mode combinations. The table applies for single-precision operation. For double-precision, simply multiply the longest pulse by 65536 and divide the lowest frequency by the same amount. Interestingly, the number written in [ms] units in the longest pulse column, roughly corresponds to the same number in minutes when working with double precsion, since 1[min] = 60000[ms].
| Clock | Scaling | Resolution | Longest pulse | Lowest frequency |
|---|---|---|---|---|
| 62.5KHz | 1 | 16us | 1.048s | 0.95Hz |
| 250KHz | 1 | 4us | 262.1ms | 3.81Hz |
| 62.5KHz | 4 | 4us | 262.1ms | 3.81Hz |
| 250KHz | 4 | 1us | 65.54ms | 15.26Hz |
| 62.5KHz | 16 | 1us | 65.54ms | 15.26Hz |
| 2MHz | 1 | 500ns | 32.77ms | 30.52Hz |
| 250KHz | 16 | 250us | 16.38ms | 61.0Hz |
| 2MHz | 4 | 125ns | 8.192ms | 122.1Hz |
| 16MHz | 1 | 62.5ns | 4.096ms | 244.1Hz |
| 2MHz | 16 | 31.25ns | 2.048ms | 488.3Hz |
| 16MHz | 4 | 15.6ns | 1.024ms | 976.6Hz |
| 16MHz | 16 | 3.9ns | 256us | 3.906KHz |
In some applications it is desirable to measure every incoming pulse rather than repetitively
query the result of the last measurement. For that purpose the getDurationBuffered()
method exists: every incoming pulse width is pushed into a small internal queue from which it can
be read. The client waits for data to be available, then reads it and data that comes in in the
meanwhile is stored. The queue has limited size, so it is important to read quickly if no pulses
are to be lost. Note that once a pulse is detected, the next one must have its leading edge at
least 5ms after the leading edge of the current one, or else it will be skipped. This throttling
has been introduced on purpose, in order to prevent saturation the communication channel when the
input signal is very high frequency. Effectively, this means that the maximum sample rate is
200Hz. This rate has been chosen as it enables measuring R/C servo signals without missing
pulses.
In other circumstances, the client may want to guarantee that a certain sample has been observed
strictly after certain other data has been received from the IOIO. For that purpose the
getDurationSync()
and getFrequencySync()
variants exist. They are can be used
to impose strict ordering between samples captured by different inputs, or relative to setting of
outputs, using IOIO.sync()
.
Typical usage (servo signal pulse width measurement):
// Open pulse input at 16MHz, double-precision
PulseInput in = ioio.openPulseInput(3, PulseMode.POSITIVE);
...
float widthSec = in.getDuration();
OR:
float widthSec = in.getDurationBuffered();
...
in.close(); // pin 3 can now be used for something else.
Typical usage (frequency measurement):
// Signal is known to be slightly over 150Hz. Single precision can be used.
PulseInput in = ioio.openPulseInput(3,
ClockRate.RATE_2MHz,
PulseMode.FREQ_SCALE_4,
false);
...
float freqHz = in.getFrequency();
...
in.close(); // pin 3 can now be used for something else.
| Nested Class Summary | |
|---|---|
static class |
PulseInput.ClockRate
Supported clock rate enum. |
static class |
PulseInput.PulseMode
An enumeration for describing the module's operating mode. |
| Method Summary | |
|---|---|
float |
getDuration()
Gets the pulse duration in case of pulse measurement mode, or the period in case of frequency mode. |
float |
getDurationBuffered()
Reads a single measurement from the queue. |
float |
getDurationSync()
This is very similar to getDuration() , but will wait for a new sample to arrive
before returning. |
float |
getFrequency()
Gets the momentary frequency of the measured signal. |
float |
getFrequencySync()
This is very similar to getFrequency() , but will wait for a new sample to arrive
before returning. |
float |
waitPulseGetDuration()
Deprecated. Please use getDurationBuffered() instead. |
| Methods inherited from interface ioio.lib.api.Closeable |
|---|
close |
| Method Detail |
|---|
float getDuration() throws java.lang.InterruptedException, ConnectionLostException
The first call to this method may block shortly until the first data update arrives. The client may interrupt the calling thread.
java.lang.InterruptedException
- The calling thread has been interrupted.
ConnectionLostException
- The connection with the IOIO has been lost.float getDurationSync() throws java.lang.InterruptedException, ConnectionLostException
getDuration()
, but will wait for a new sample to arrive
before returning. This is useful in conjunction with IOIO.sync()
, in cases when we
want to guarantee the we are looking at a sample that has been captured strictly after
certain other commands have been executed.
java.lang.InterruptedException
- The calling thread has been interrupted.
ConnectionLostException
- The connection with the IOIO is lost.getDuration()
float getDurationBuffered() throws java.lang.InterruptedException, ConnectionLostException
This method may not be used if the interface has was opened in frequency mode.
java.lang.InterruptedException
- The calling thread has been interrupted.
ConnectionLostException
- The connection with the IOIO has been lost.float waitPulseGetDuration() throws java.lang.InterruptedException, ConnectionLostException
getDurationBuffered()
instead.
java.lang.InterruptedException
ConnectionLostException
float getFrequency() throws java.lang.InterruptedException, ConnectionLostException
The first call to this method may block shortly until the first data update arrives. The client may interrupt the calling thread. - *
This method may only be used if the interface has been opened in frequency mode.
java.lang.InterruptedException
- The calling thread has been interrupted.
ConnectionLostException
- The connection with the IOIO has been lost.float getFrequencySync() throws java.lang.InterruptedException, ConnectionLostException
getFrequency()
, but will wait for a new sample to arrive
before returning. This is useful in conjunction with IOIO.sync()
, in cases when we
want to guarantee the we are looking at a sample that has been captured strictly after
certain other commands have been executed.
java.lang.InterruptedException
- The calling thread has been interrupted.
ConnectionLostException
- The connection with the IOIO is lost.getFrequency()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


4 This library implements a simple, preemptive task scheduler that is executed in parallel to the 1ms timer interrupt
5 used for the Arduino millis() function. It allows to define cyclic tasks or tasks that should be executed in the future
6 in parallel to the normal program execution inside the main loop.
8 The task scheduler is executed every 1ms. A possibly running task is interrupted by this and only resumed after all succeeding tasks have finished. This means
9 that always the task started last has the highest priority. This effect needs to be kept in mind when programming a software using this library.
12 - Deadlocks can appear when one task waits for another taks which was started before.
13 - Timing critical tasks may not execute properly when they are interrupted for too long by other tasks. Thus it is recommended to keep task execution as short as possible.
14 - The Arduino MEGA leaves the interrupts state shortly after starting the task scheduler which makes the scheduler reentrant and allows any other interrupt (timer, UART, etc.) to be triggered.
15 - The Arduino DUE enables other interrupts by using the lowest possible priority (15) for the task scheduler interrupt.
17 Warning: The Arduino Due does not support reeantrant interrupts due to HW limitations. This means that unlike the Arduino MEGA the DUE is not able to execute
18 fast 1ms tasks several times before finishing a slower tasks with for example a 10ms timebase. This problem will be especially visible if the sum of the
19 execution time of all tasks is greater than the execution period of the fastest task.
22 - all boards using the Atmel ATMega328 controller, e.g. Arduino Uno and Nano
23 - all boards using the Atmel ATMega2560 controller, e.g. Arduino Mega
24 - all boards using the Atmel SAM3X8E controller, e.g. Arduino Due
27 - Atmel ATMega328 & ATMega2560: Scheduler uses TIMER0_COMPA interrupt. This maintains millis() and analogWrite() functionality on T0 pins. However,
28 frequent changes of the duty cycle using analogWrite() lead to a jitter in scheduler timing.
29 - Atmel SAM3X8E: Scheduler uses TC3 interrupt.
32 - Atmel ATMega328 & ATMega2560:
33 - 5μs without pending tasks
34 - 12μs + task duration when tasks are executed
36 - tbdμs without pending tasks
37 - tbdμs + task duration when tasks are executed
41 ====================================


PyRadio: Command line internet radio player.
Berfore you continue, read this!
Generally, recording a radio streaming broadcast is considered legit, if the recording is to be used for personal use only (i.e. to listen to the broadcast at a later time).
Distributing such a recording, is illegal. Broadcasting it is also illegal. Its reproduction before an audience is also illegal. In some countries/regions, it is also illegal to split or tag the songs in the recording.
Please make sure you are informed about this topic, about what the law considers illegal at your country/region, before using this feature!
You have been warned!
PyRadio, its creator and maintainers do not condone any behavior that involves online piracy or copyright violation. This feature is provided strictly for personal use, and to utilize another requested feature: pausing and resuming playback.
PyRadio v. <IP_ADDRESS> introduces the ability to record stations, a feature used mainly to facilitate another feature: the ability to pause and resume playback.
All supported media players (MPV, MPlayer and VLC) support stream recording, each implementing it in a different way, which pose a challenge for the front end implementation.
Before we see the differences, let us talk about some things that will make the whole thing easier to understand.
When it comes to recording a stream the program has to provide two things:
a recorder, which is the component that will connect to the stream (in our case the station), receive its data, and write them in a file that media players can recognize and reproduce.
Since this is the program receiving data from the station, it will also receive song titles, or other stations data, but will not save them to the recorded file.
a monitor, which is the component that will reproduce the saved stream so that the user can monitor what is being downloaded.
The monitor will just reproduce what’s written to the file by the recorder, so it knows nothing about a station, it’s data and song titles transmitted by it.
Now, let’s see how PyRadio’s supported players behave.
MPV stream recording has the following characteristics:
MPlayer stream recording has the following characteristics:
VLC stream recording has the following characteristics:
VLC recording in not supported on Windows.
The VLC implementation on Window is a bit clumsy as it is as a radio player, and duplicating all this clumsiness in order to support recording as well, is just too much.
Trying to enable recording while VLC is the active player will lead to displaying a message informing the user of the situation and ways to proceed.
Consequently, this restriction has been applied to the “Switch Media Player” window (opened with “\m”); when recording a station and trying to change the player in use on Windows, selecting VLC is not supported.
The following keys are used for this feature:
| Key | Description |
|---|---|
| | (pipe symbol) |
Toggle recording on and off |
| Space | Pause and resume playback |
In order to record a station, recording has to be enabled beforehand, by pressing the “pipe symbol” or “vetical line” (“|”). Then the following message appears:
When this is done an “[r]” will be displayed at the top left corner of the window. This means that recording is enabled, but PyRadio is not currently recording to a file.
When playback is started (i.e. start playing a station), an “[R]” will be displayed at the top left corner of the window (replacing the “[r]” that was already there), which means that PyRadio is actually recording the station to a file.
The following image is a mockup presenting the difference.
Pressing the “pipe symbol” or “vetical line” (“|”) again will disable recording and nothing will be displayed at the top left corner of the window. The actual recording of the station will still be active, until the station is stopped.
It must be made clear that toggling the recording status for PyRadio will actually take effect after a station has been started or stopped. This is because of the way the players get the recording command; through command line arguments, which can only be passed when the player is executed.
One can use the “–record” command line parameter to start the program in recording mode.
This would be extra useful to start playback and recording, for example:
pyradio -p 3 --record
This command would open the default playlist (or the one last used, if set in the config), using the default player, and start playing and recording station No 3.
Note: If the default player is VLC on Windows, and the “–record” command line parameter is used, a message informing the user that recording is not supported, will be displayed.
Files created by the recording feature will be saved under the “recordings” folder inside PyRadio’s configuration directory.
The file will be named:
[date] [Station Name].mkv
PyRadio will produce a mkv file when recording a station.
This is just a measure of convenience since the type of audio (mp3, aac, aac+, flac, etc.) the station will broadcast cannot be known beforehand (before starting the recording, that is).
Although a mkv file is a video/audio/subs etc. container, it’s perfectly fine to contain just a sound stream, as is the case of the files produced by PyRadio.
The file can be (hopefully) reproduced using any video media player.
After you have started recording a station, PyRadio will connect to it and start downloading the station data and at the same time will produce sound for you to hear what’s downloaded.
You can then press “Space” to pause the playback, but still continue downloading the station’s data.
Pressing “Space” again will resume playback from where it left off.
As a consequence, listening to the end of a show that you have paused for say 10 minutes, and then stopping the station (both playback and recording), the file recorded will have an excess of 10 minutes of data, past the end of the actual show.
Finally, please keep in mind that all other keys relevant to starting, stopping and restarting a station’s playback remain the same; only the behavior of the “Space” key has changed when recording is on.


*CSS 3 border-radius supported only by Firefox 2.x+, Safari (2.x?) as of April 2008 - perhaps IE 8 RTM..
Clicking a title will start loading + playing, or pause, a sound.
Once loading, click (or click and drag) on the loading/position bar to seek within the sound.
The document title reflects the currently-playing sound, and by default the list will play sequentially if left alone. (This is configurable.)
Just for fun, a few color schemes (visible when playing/paused):
A potential approach to noting interesting moments in sounds, scene changes, new tracks in seamless DJ mixes etc. Keep in mind this is a single MP3 being loaded, but annotations are placed along the timeline as shown.
A "metadata" element contains a nested list of data (UL/LI combination) - in this case, a summary of each scene - and the time at which this item occurs/begins. In order to help with positioning, the total length of the sound is also specified up-front. View the source code of this page for the details.
This example uses SoundManager 2 to finds links to MP3 files, and makes them playable "in-place" on a page. The script assigns CSS classes to links' parent LI nodes to indicate their state (playing/paused, etc.)
A fragment of HTML is also appended dynamically which includes a status bar, loading control and timing info etc. This can be styled with CSS as well, of course.
Links pointing to MP3s are assigned an onclick handler which intercepts the click (preventing the browser from following the link and unloading the page. SM2 will then create sound objects as needed to play the MP3s.
If you want to make your own UI from scratch, here is the base: ul.playlist {} Default + hover state, "click to play": li.sm2_link {} li.sm2_link:hover {} Playing + hover state, "click to pause": li.sm2_playing {} li.sm2_playing:hover {} Paused + hover state, "click to resume": li.sm2_paused {} li.sm2_paused:hover {}
The positioning (load status / control bar) template is also applied as follows, after each MP3 link:

 %s1 / %s2

"loading" and "position" have background colors applied, and have their width adjusted dynamically by SM2 as the sound(s) load/play. "timing" is replaced with the current time / duration, eg. 1:23 / 4:20
The class names applied can be edited within the source JS also, for convenience.
The controls are shown and hidden via the same dynamic CSS updates. See the source CSS for the timing / status bar layout.
See this basic demo for reference.
A reminder that if loading from the local filesystem, Flash will deny access to remote (network/internet) URLs by default unless whitelisted via the Flash Player Global Security Settings Page. Some URLs in this example are remote to demonstrate this.


Guidance
Sample materials including test papers, mark scheme and test administration instructions, to help teachers prepare for the 2016 tests.
Ref: ISBN 978-1-78315-740-2 , STA/15/7322/e PDF , 1.06MB , 20 pages
Ref: ISBN 978-1-78315-741-9 , STA/15/7323/e PDF , 722KB , 24 pages
Ref: ISBN 978-1-78315-742-6 , STA/15/7324/e PDF , 1.47MB , 24 pages
Ref: ISBN 978-1-78315-889-8 , STA/15/7348/PKe PDF , 140KB , 4 pages
Ref: ISBN 978-1-78315-890-4 , STA/15/7349/PKe PDF , 141KB , 4 pages
Ref: ISBN 978-1-78315-891-1 , STA/15/7350/PKe PDF , 141KB , 4 pages
Ref: ISBN 978-1-78315-820-1 , STA/15/7335/e PDF , 1.09MB , 32 pages
These materials are designed to give teachers an indication of how the new curriculum will be assessed from 2016. It reflects areas of the curriculum that have changed, therefore the questions may be unfamiliar or more challenging.
Published: 29 June 2015
Updated: 30 June 2015


pip_services3_commons.errors.ErrorCategory module¶
pip_services3_commons.errors.ErrorCategory¶
Error categories enumeration
| copyright: | Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details. |
|---|---|
| license: | MIT, see LICENSE for more details. |
-
class
pip_services3_commons.errors.ErrorCategory.
ErrorCategory
¶ Bases:
object
Defines standard error categories to application exceptions supported by PipServices toolkit.
-
BadRequest
= 'BadRequest'¶ Errors due to improper user requests, like missing or wrong parameters
-
Conflict
= 'Conflict'¶ Errors raised by conflict in object versions posted by user and stored on server.
-
FailedInvocation
= 'FailedInvocation'¶ Errors returned by remote services or network during call attempts
-
FileError
= 'FileError'¶ Errors in read/write file operations
-
Internal
= 'Internal'¶ Internal errors caused by programming mistakes
-
InvalidState
= 'InvalidState'¶ Errors related to operations called in wrong component state. For instance, business calls when component is not ready
-
Misconfiguration
= 'Misconfiguration'¶ Errors related to mistakes in user-defined configuration
-
NoResponse
= 'NoResponse'¶ Errors happened during connection to remote services. They can be related to misconfiguration, network issues or remote service itself
-
NotFound
= 'NotFound'¶ Error caused by attempt to access missing object
Access errors caused by missing user identity or security permissions
-
Unknown
= 'Unknown'¶ Unknown or unexpected errors
-
Unsupported
= 'Unsupported'¶ Errors caused by calls to unsupported or not yet implemented functionality
-


|
Your Username:
|
||
|
Your Temporary Password:
|
||
|
Quick guide on how to get started:
|
||
| Sign into Google with your new account, change your password, and set up 2-Step Verification | ||
| Add your recovery email address | ||
|
After these steps are completed, you are ready to use the Researcher Workbench:
|
||
| Get Started |


| Class | Description |
|---|---|
| Bigleg |
Class for big legs
|
| BiglegSmall |
Class for small big legs.
|
| Block1 |
Blocks 1~7 have increasing score points
|
| Block2 |
Blocks 1~7 have increasing score points
|
| Block3 |
Blocks 1~7 have increasing score points
|
| Block4 |
Blocks 1~7 have increasing score points
|
| Block5 |
Blocks 1~7 have increasing score points
|
| Block6 |
Blocks 1~7 have increasing score points
|
| Block7 |
Blocks 1~7 have increasing score points
|
| BlockBreakable |
Breakable blocks can be destroyed by pop collision.
|
| BlockLife |
BlockLife gives pop an extra life
|
| BlockSolid |
Solid blocks are non-breakable
|
| BlockSplit |
BlockSplit splits pop into two pops upon collision
|
| BorderWall |
BorderWall appears on the top, left and right borders of the Rainbow Reef game window.
|
| Katch |
Katch is the moving sea snail to catch pop.
|
| Pop |
Pop is the bouncing starfish.
|
| PopMotion |
PopMotion controls motion of pop.
|
| ReefHighScore |
High score list window for Raibow reef game.
|
| ReefLevel | |
| ReefNameInput |
Name input window for Rainbow reef game.
|
| ReefWorld |
ReefWorld is the driving and controlling class for the Rainbow Reef game.
|
| Ui |
Displays pop's life left and player's score
|


A picture is worth a thousand words.
Sign in now!
Create your account!
TERMS OF USE Last revised on 10/17/2018 1. Acceptance of Terms of Use Agreement. By creating a klicks account, you agree to be bound by these Terms of Use, which is incorporated by reference into this Agreement, and (iii) any terms disclosed and agreed to by you if you purchase additional features, products or services we offer on the Service (collectively, this “Agreement”). If you do not accept and agree to be bound by all of the terms of this Agreement, please do not use the Service. We may make changes to this Agreement and to the Service from time to time. We may do this for a variety of reasons including to reflect changes in or requirements of the law, new features, or changes in business practices. The most recent version of this Agreement will be posted on the Service under Settings and also on klicks.com, and you should regularly check for the most recent version. The most recent version is the version that applies. If the changes include material changes that affect your rights or obligations, we will notify you in advance of the changes by reasonable means, which could include notification through the Service or via email. If you continue to use the Service after the changes become effective, then you agree to the revised Agreement. 2. Eligibility. You must be at least 18 years of age to create an account on klicks and use the Service. By creating an account and using the Service, you represent and warrant that: • you can form a binding contract with klicks, • you are not a person who is barred from using the Service under the laws of the United States or any other applicable jurisdiction–meaning that you do not appear on the U.S. Treasury Department’s list of Specially Designated Nationals or face any other similar prohibition, • you will comply with this Agreement and all applicable local, state, national and international laws, rules and regulations, and • you have never been convicted of a felony or indictable offense (or crime of similar severity), a sex crime, or any crime involving violence, and that you are not required to register as a sex offender with any state, federal or local sex offender registry.


Namespace com.CIMthetics.CSharpSECSTools.SECSItems
Classes
ASCIISECSItem
This class representsa SECSItem
with the SECS data type of A
(ASCII
),
which is a "string" ofASCII
characters.From the C# side this data
type is handled as a C# string
. Be careful to only use appropriate character sets
(System.Text.Encoding.ASCII
) or undesirable behavior may be manifested.
BinarySECSItem
This class represents a SECS item with a data type of B
in an array form. In this case it is an array of zero or more 8-bit unsigned integers.
The C# data type is byte[]
.
BooleanArraySECSItem
This class represents a SECS item with a data type of BO
in an array form. In this case it is an array of zero or more boolean values.
The C# data type is bool[]
.
BooleanSECSItem
This class represents/implements a SECSItem
with the SECS data type of BO
,
which is a boolean. From the C# side this data type is handled as a C# bool
.
F4ArraySECSItem
This class represents a SECS item with a data type of F4
in an array form. In this case it is an array of zero or more 32-bit floating point numbers.
The C# data type is float[]
.
F4SECSItem
This class represents a SECSItem
with the SECS data type of F4
,
which is a 32-bit floating point number. From the C# side this data type is handled as a C# float
.
F8ArraySECSItem
This class represents a SECS item with a data type of F8
in an array form. In this case it is an array of zero or more 64-bit floating point numbers.
The C# data type is double[]
.
F8SECSItem
This class represents/implements a SECSItem
with the SECS data type of F8
,
which is a double. From the C# side this data type is handled as a C# double
.
I1ArraySECSItem
This class represents a SECS item with a data type of I1
in an array form. In this case it is an array of zero or more 8-bit signed integers.
The C# data type is sbyte[]
.
I1SECSItem
This class represents/implements a SECSItem
with the SECS data type of I1
,
which is a signed byte. From the C# side this data type is handled as an C# sbyte
.
I2ArraySECSItem
This class represents a SECS item with a data type of I2
in an array form. In this case it is an array of zero or more 16-bit signed integers.
The C# data type is Int16[]
.
I2SECSItem
This class represents/implements a SECSItem
with the SECS data type of I2
,
which is a signed 16 bit integer. From the C# side this data type is handled as a C# Int16
.
I4ArraySECSItem
This class represents a SECS item with a data type of I4
in an array form. In this case it is an array of zero or more 32-bit signed integers.
The C# data type is Int32[]
.
I4SECSItem
This class represents/implements a SECSItem
with the SECS data type of I4
,
which is an Int32. From the C# side this data type is handled as a C# Int32
.
I8ArraySECSItem
This class represents a SECS item with a data type of I8
in an array form. In this case it is an array of zero or more 64-bit signed integers.
The C# data type is Int64[]
.
I8SECSItem
This class represents/implements a SECSItem
with the SECS data type of I8
,
which is an 64-bit signed integer. From the C# side this data type is handled as a C# Int64
.
ListSECSItem
This class represents a SECSItem
with the SECS data type of L
,
which is a list of SECSItem
s.
SECSItem
This is the base class for all of the SECSItems
that are implemented in this
library. Its purpose is to conceal the tedium of managing the information
that will be needed for encoding/decoding the various SECSItems to/from
the wire/transmission format that the transport layer(s) use.
SECSItemFactory
This is a static "factory" class that is used to create a
SECSItem
object from a byte[]
that is in "wire/transmission" form.
As you might expect the
bytes contained within the byte[]
must actually be in the form
of those of an item in a SECS-II message.
SECSItemFormatCodeFunctions
A class containing a couple of helper methods useful when converting a
SECSItem
's format code to and from "wire / transmission" format.
SECSItemNumLengthBytes
This class
represents the valid values for the number of length bytes for a SECSItem
.
This needed to be implemented in this manner instead of an enum because C# will automatically
cast an enum
to an int
when used as a method argument. This may cause the compiler
to use the wrong method if the signatures will match because of this.
U1ArraySECSItem
This class represents a SECS item with a data type of U1
in an array form. In this case it is an array of zero or more 8-bit unsigned integers.
The C# data type is byte[]
.
U1SECSItem
This class represents a SECSItem
with the SECS data type of F4
,
which is an 8-bit unsigned integer. From the C# side this data type is handled as a C# byte
.
U2ArraySECSItem
This class represents a SECS item with a data type of U2
in an array form. In this case it is an array of zero or more 16-bit unsigned integers.
The C# data type is UInt16[]
.
U2SECSItem
This class represents a SECSItem
with the SECS data type of U2
,
which is a 16-bit unsigned integer. From the C# side this data type is handled as a C# UInt16
.
U4ArraySECSItem
This class represents a SECS item with a data type of U4
in an array form. In this case it is an array of zero or more 32-bit unsigned integers.
The C# data type is UInt32[]
.
U4SECSItem
This class represents a SECSItem
with the SECS data type of U4
,
which is a 32-bit unsigned integer. From the C# side this data type is handled as a C# UInt32
.
U8ArraySECSItem
This class represents a SECS item with a data type of U8
in an array form. In this case it is an array of zero or more 64-bit unsigned integers.
The C# data type is UInt64[]
.
U8SECSItem
This class represents/implements a SECSItem
with the SECS data type of U8
,
which is an unsigned 64-bit integer. From the C# side this data type is handled as a C# UInt64
.
Enums
SECSItemFormatCode
This enum
contains the valid values for the format code of a SECSItem.


In settled weather this is a good provisioning stop, with fuel and groceries close by.
It is possible to anchor off the city of Dumaguete with care. The bottom here is gently sloping with very good holding in sand. Yachts can anchor in approx. 5 to 7 mts in a stretch between south of the wharf and the next point, which has many fishing bangkas both moored off and ashore.
There are both steps in the seawall and a small beach for dinghy access.
Last updated July 2015.


chlorine data staff high daily Ebola patient risk ETU (–) zone PPE Sierra concentration number {border-style activities px;} usage #ffffff;} ETUs occupancy used Leone WASH collected <. low Medical (.%) Data including outbreak Kambia WASH/IPC patients Health Sciences West day disease waste December ETU. Fig explained liters Chlorine Hemorrhagic International Table future high-risk infectious px; solution {font-family Fever High Makeni Medicine Virus entries font-size linear ETUs. EVD Laundered Pathogens Viral WHO. Writing bags collection database demonstrates double; equipment health key protective quantity regression significant study treatment variability virus April CI: Corps Disinfected Leone, Research Staff States United Used based basis border-color border-width cleaned clinical compared damaged disinfecting managing order original required solid; studied. water {font-style {font-weight (y-axis) Africa: America Biology Diseases ETU, Incinerated Low Methods Regression Usage Viruses: [], analysis, bold collecting correlated courier; curation disinfected; em; entries, essential facilities forms highly humanitarian information low-risk maximum operational paper personal pt;} record shift time total type utilized vs. zone, zone.


Hey there! I'm Anvita Gupta.
I'm an undergraduate majoring in Computer Science at Stanford University, specifically the biocomputation track. My passion is Health + Tech--applying AI to develop novel ways to treat deadly diseases.
Some of the projects I've worked on include developing smart data-driven approaches to drug discovery, designing high-performance computing clusters and the databases that layer on top of them, and recently, adapting generative adversarial networks for personalized medicine. Find out more details on my projects page.
I'm also the founder of LITAS (Learning IT, Applications, and Software) for Girls, an international nonprofit working with middle and high school girls to close the gender gap in CS + STEM.
For more on me and my work, check out my TED talk.
Contact me to request my CV, or just to chat about interesting projects!


Renderers have some common options. These options can be set in three ways:
Different ways to parameterize a renderer object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | use Zend\Barcode\Renderer;
$options = array('topOffset' => 10);
// Case 1
$renderer = new Renderer\Pdf($options);
// Case 2
$renderer = new Renderer\Pdf();
$renderer->setOptions($options);
// Case 3
$renderer = new Renderer\Pdf();
$renderer->setTopOffset(10);
|
In the following list, the values have no unit; we will use the term “unit.” For example, the default value of the “thin bar” is “1 unit.” The real units depend on the rendering support. The individual setters are obtained by uppercasing the initial letter of the option and prefixing the name with “set” (e.g. “barHeight” => “setBarHeight”). All options have a correspondent getter prefixed with “get” (e.g. “getBarHeight”). Available options are:
| Option | Data Type | Default Value | Description |
|---|---|---|---|
| rendererNamespace | String | Zend\Barcode\Renderer | Namespace of the renderer; for example, if you need to extend the renderers |
| horizontalPosition | String | “left” | Can be “left”, “center” or “right”. Can be useful with PDF or if the setWidth() method is used with an image renderer. |
| verticalPosition | String | “top” | Can be “top”, “middle” or “bottom”. Can be useful with PDF or if the setHeight() method is used with an image renderer. |
| leftOffset | Integer | 0 | Top position of the barcode inside the renderer. If used, this value will override the “horizontalPosition” option. |
| topOffset | Integer | 0 | Top position of the barcode inside the renderer. If used, this value will override the “verticalPosition” option. |
| automaticRenderError | Boolean | FALSE | Whether or not to automatically render errors. If an exception occurs, the provided barcode object will be replaced with an Error representation. Note that some errors (or exceptions) can not be rendered. |
| moduleSize | Float | 1 | Size of a rendering module in the support. |
| barcode | Zend\Barcode\Object | NULL | The barcode object to render. |
An additional getter exists: getType(). It returns the name of the renderer class without the namespace (e.g. Zend\Barcode\Renderer\Image returns “image”).
The Image renderer will draw the instruction list of the barcode object in an image resource. The component requires the GD extension. The default width of a module is 1 pixel.
Available options are:
| Option | Data Type | Default Value | Description |
|---|---|---|---|
| height | Integer | 0 | Allow you to specify the height of the result image. If “0”, the height will be calculated by the barcode object. |
| width | Integer | 0 | Allow you to specify the width of the result image. If “0”, the width will be calculated by the barcode object. |
| imageType | String | “png” | Specify the image format. Can be “png”, “jpeg”, “jpg” or “gif”. |
The PDF renderer will draw the instruction list of the barcode object in a PDF document. The default width of a module is 0.5 point.
There are no particular options for this renderer.
The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.


Classes | |
| class | PlanarDubins3D |
| class | PositionVelocity |
| class | PositionVelocityRelPlanarDubins3D |
| class | PositionVelocityRelPositionVelocity |
| class | RelativeState |
| class | State |
Functions | |
| PositionVelocity | operator* (PositionVelocity lhs, double s) |
| PositionVelocity | operator* (double s, PositionVelocity rhs) |
| PositionVelocity | operator+ (PositionVelocity lhs, const PositionVelocity &rhs) |
| PositionVelocity | operator- (PositionVelocity lhs, const PositionVelocity &rhs) |
| PositionVelocity | operator/ (PositionVelocity lhs, double s) |
| PositionVelocity | operator/ (double s, PositionVelocity rhs) |
| PositionVelocity fastrack::state::operator* | ( | PositionVelocity | lhs, |
| double | s | ||
| ) |
Definition at line 289 of file position_velocity.cpp.
| PositionVelocity fastrack::state::operator* | ( | double | s, |
| PositionVelocity | rhs | ||
| ) |
Definition at line 294 of file position_velocity.cpp.
| PositionVelocity fastrack::state::operator+ | ( | PositionVelocity | lhs, |
| const PositionVelocity & | rhs | ||
| ) |
Definition at line 279 of file position_velocity.cpp.
| PositionVelocity fastrack::state::operator- | ( | PositionVelocity | lhs, |
| const PositionVelocity & | rhs | ||
| ) |
Definition at line 284 of file position_velocity.cpp.
| PositionVelocity fastrack::state::operator/ | ( | PositionVelocity | lhs, |
| double | s | ||
| ) |
Definition at line 299 of file position_velocity.cpp.
| PositionVelocity fastrack::state::operator/ | ( | double | s, |
| PositionVelocity | rhs | ||
| ) |
Definition at line 304 of file position_velocity.cpp.


This diagram was generated by
<SCRIPT Language="JavaScript">
document.open();
var D=new Diagram();
D.SetFrame(80, 160, 520, 360);
D.SetBorder(Date.UTC(2000,11,15,0,0,0), Date.UTC(2001,11,15,0,0,0), -300, 1100);
D.SetText("","", "profit/loss per day during the last year");
D.XScale=4;
D.YScale=" $";
D.Draw("#FFFFCC", "#000000", false);
var i, t0, t1, P0, P1, base=D.ScreenY(0);
t1=D.ScreenX(Date.UTC(2000,11,15,0,0,0));
P1=0;
for (i=0; i<12; i++)
{ t0=t1; P0=P1;
t1=D.ScreenX(Date.UTC(2001,i,15,0,0,0));
P1+=(i/5-Math.random())*100;
new Area(t0, D.ScreenY(P0), t1, D.ScreenY(P1), "ff0000", base, "profit/loss per day");
}
document.close();
</SCRIPT>
You can use the following methods:
- var A = new Area(theX0, theY0, theX1, theY1, theColor, theBase[, theTooltipText[,
theOnClickAction[, theOnMouseoverAction[, theOnMouseoutAction]]]])
//Constructor and Display, requires images o_*, d_*, p_* q_* and b_* (*=theColor+".gif")
- A.SetColor(theColor) //Color
- A.SetVisibility(isVisible) //Show or Hide
- A.SetTitle(theTitle) //TooltipText
- A.MoveTo(theLeft, theTop) //Move
- A.ResizeTo(theX0, theY0, theX1, theY1) //Resize
- A.Delete() //Delete DIV object of A from the document
- delete A //Destructor


The functions for caching on windows are:
| MPI_WIN_CREATE_KEYVAL(win_copy_attr_fn, win_delete_attr_fn, win_keyval, extra_state) | |
| IN win_copy_attr_fn | copy callback function for win_keyval (function) |
| IN win_delete_attr_fn | delete callback function for win_keyval (function) |
| OUT win_keyval | key value for future access (integer) |
| IN extra_state | extra state for callback functions |
int MPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn, MPI_Win_delete_attr_function *win_delete_attr_fn, int *win_keyval, void *extra_state)
MPI_Win_create_keyval(win_copy_attr_fn, win_delete_attr_fn, win_keyval, extra_state, ierror)
PROCEDURE(MPI_Win_copy_attr_function) :: win_copy_attr_fn
PROCEDURE(MPI_Win_delete_attr_function) :: win_delete_attr_fn
INTEGER, INTENT(OUT) :: win_keyval
INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
MPI_WIN_CREATE_KEYVAL(WIN_COPY_ATTR_FN, WIN_DELETE_ATTR_FN, WIN_KEYVAL, EXTRA_STATE, IERROR)
EXTERNAL WIN_COPY_ATTR_FN, WIN_DELETE_ATTR_FN
INTEGER WIN_KEYVAL, IERROR
INTEGER(KIND=MPI_ADDRESS_KIND) EXTRA_STATE
The argument win_copy_attr_fn may be specified as MPI_WIN_NULL_COPY_FN or MPI_WIN_DUP_FN from either C or Fortran. MPI_WIN_NULL_COPY_FN is a function that does nothing other than returning flag = 0 and MPI_SUCCESS. MPI_WIN_DUP_FN is a simple-minded copy function that sets flag = 1, returns the value of attribute_val_in in attribute_val_out, and returns MPI_SUCCESS.
The argument win_delete_attr_fn may be specified as MPI_WIN_NULL_DELETE_FN from either C or Fortran. MPI_WIN_NULL_DELETE_FN is a function that does nothing, other than returning MPI_SUCCESS.
The C callback functions are:
typedef int MPI_Win_copy_attr_function(MPI_Win oldwin, int win_keyval, void *extra_state, void *attribute_val_in, void *attribute_val_out, int *flag);
and
typedef int MPI_Win_delete_attr_function(MPI_Win win, int win_keyval, void *attribute_val, void *extra_state);
With the mpi_f08 module, the Fortran callback functions are:
SUBROUTINE MPI_Win_copy_attr_function(oldwin, win_keyval, extra_state, attribute_val_in, attribute_val_out, flag, ierror)
TYPE(MPI_Win) :: oldwin
INTEGER :: win_keyval, ierror
INTEGER(KIND=MPI_ADDRESS_KIND) :: extra_state, attribute_val_in, attribute_val_out
LOGICAL :: flag
and
SUBROUTINE MPI_Win_delete_attr_function(win, win_keyval, attribute_val, extra_state, ierror)
TYPE(MPI_Win) :: win
INTEGER :: win_keyval, ierror
INTEGER(KIND=MPI_ADDRESS_KIND) :: attribute_val, extra_state
With the mpi module and mpif.h, the Fortran callback functions are:
SUBROUTINE WIN_COPY_ATTR_FUNCTION(OLDWIN, WIN_KEYVAL, EXTRA_STATE, ATTRIBUTE_VAL_IN, ATTRIBUTE_VAL_OUT, FLAG, IERROR)
INTEGER OLDWIN, WIN_KEYVAL, IERROR
INTEGER(KIND=MPI_ADDRESS_KIND) EXTRA_STATE, ATTRIBUTE_VAL_IN,
ATTRIBUTE_VAL_OUT
LOGICAL FLAG
and
SUBROUTINE WIN_DELETE_ATTR_FUNCTION(WIN, WIN_KEYVAL, ATTRIBUTE_VAL, EXTRA_STATE, IERROR)
INTEGER WIN, WIN_KEYVAL, IERROR
INTEGER(KIND=MPI_ADDRESS_KIND) ATTRIBUTE_VAL, EXTRA_STATE
If an attribute copy function or attribute delete function returns other than MPI_SUCCESS, then the call that caused it to be invoked (for example, MPI_WIN_FREE), is erroneous.
| MPI_WIN_FREE_KEYVAL(win_keyval) | |
| INOUT win_keyval | key value (integer) |
int MPI_Win_free_keyval(int *win_keyval)
MPI_Win_free_keyval(win_keyval, ierror)
INTEGER, INTENT(INOUT) :: win_keyval
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
MPI_WIN_FREE_KEYVAL(WIN_KEYVAL, IERROR)
INTEGER WIN_KEYVAL, IERROR
| MPI_WIN_SET_ATTR(win, win_keyval, attribute_val) | |
| INOUT win | window to which attribute will be attached (handle) |
| IN win_keyval | key value (integer) |
| IN attribute_val | attribute value |
int MPI_Win_set_attr(MPI_Win win, int win_keyval, void *attribute_val)
MPI_Win_set_attr(win, win_keyval, attribute_val, ierror)
TYPE(MPI_Win), INTENT(IN) :: win
INTEGER, INTENT(IN) :: win_keyval
INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) :: attribute_val
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
MPI_WIN_SET_ATTR(WIN, WIN_KEYVAL, ATTRIBUTE_VAL, IERROR)
INTEGER WIN, WIN_KEYVAL, IERROR
INTEGER(KIND=MPI_ADDRESS_KIND) ATTRIBUTE_VAL
| MPI_WIN_GET_ATTR(win, win_keyval, attribute_val, flag) | |
| IN win | window to which the attribute is attached (handle) |
| IN win_keyval | key value (integer) |
| OUT attribute_val | attribute value, unless flag = false |
| OUT flag | false if no attribute is associated with the key (logical) |
int MPI_Win_get_attr(MPI_Win win, int win_keyval, void *attribute_val, int *flag)
MPI_Win_get_attr(win, win_keyval, attribute_val, flag, ierror)
TYPE(MPI_Win), INTENT(IN) :: win
INTEGER, INTENT(IN) :: win_keyval
INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(OUT) :: attribute_val
LOGICAL, INTENT(OUT) :: flag
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
MPI_WIN_GET_ATTR(WIN, WIN_KEYVAL, ATTRIBUTE_VAL, FLAG, IERROR)
INTEGER WIN, WIN_KEYVAL, IERROR
INTEGER(KIND=MPI_ADDRESS_KIND) ATTRIBUTE_VAL
LOGICAL FLAG
| MPI_WIN_DELETE_ATTR(win, win_keyval) | |
| INOUT win | window from which the attribute is deleted (handle) |
| IN win_keyval | key value (integer) |
int MPI_Win_delete_attr(MPI_Win win, int win_keyval)
MPI_Win_delete_attr(win, win_keyval, ierror)
TYPE(MPI_Win), INTENT(IN) :: win
INTEGER, INTENT(IN) :: win_keyval
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
MPI_WIN_DELETE_ATTR(WIN, WIN_KEYVAL, IERROR)
INTEGER WIN, WIN_KEYVAL, IERROR


Documents in this directory give context on how BQN was designed or remark on aspects of the language.


This is a basic summary of my limited experiences with meth.
For a long time my experience with drugs was limited to weed and alcohol, several occasions with salvia, and very rare DXM trips. i have a friend who does meth relatively often and had been interested in giving it a try. the first time i tried it the group consisted of me, my friend (who I'll call B) and another good friend, (D). D had also never tried it before.
We smoked two blunts in a large, abandoned field, and then afterwards B made a little tinfoil bowl and put the meth in it. He heated it up and we all took hits from a straw.
I remember feeling very revved up and talkative. We all started spilling out conversation at once, commenting on the things around us and talking about a lot of different topics. I felt very energetic and 'enabled', like I was ready for anything. The feeling went away after awhile and grew less strong. I had no trouble sleeping that night or anything like that.
Over the next few months I did meth several more times. I still wasn't sure if I really liked it or not. A very positive experience I had was with a large group of people about a month or so after my first time. D, B, and I rode down to this guy J's house, where a lot of people were chilling out in his back room. I knew almost all of them and was friends with a few. Like before, we smoked some weed, this time three blunts.  The taste was really unpleasant and 'chemical' feeling and irritated my mouth. Besides this, I was having fun with the meth and all the people around me. The bud seemed to counteract with the speed in some strange way, and I really enjoyed the combination. After chilling and talking for an hour so we left. B went home and D and I to this large garden on a college campus in our town.
At the garden we talked for several hours about a hundred different things. It was a really enjoyable and interesting conversation.  We parted ways and I went home. That night I coudln't sleep and I could feel the blood pounding in my brain. I felt restless and strung out, and parts of my body ached. This was a really unpleasant comedown and put me off meth for awhile.
Another month passed, and a guy at school who I'm kind of friends with invited me to get spun with him. I did two large lines in the bathroom and felt that same burst of energy I had the first time, only now even stronger and more intense. I became very social and was talking to everyone around me, even people I barely knew. I felt really active and had a great time working out on the fitness equipment in the gym.
I'd made plans to meet D at the end of the day (we don't go to the same schools) and sure enough, she said weed on her. We went to my house and smoked a joint. The meth feeling had started to die down a little, but the weed instantly started it up again. Like before, the feeling was great. D had to leave abruptly and I was left by myself at my house for several hours.
Parts of that trip were a lot of fun. I had a huge feeling of self confidence and I guess you could say self absorbtion. I kept thinking all these great things about myself.  Buzzing tremors ran through my body for over a minute afterwards.
Other aspects of that trip sucked, really badly.  I got this really crappy feeling all over and when I left the game and went back home all I wanted was to go to sleep.
But i was out of luck. I got this throbbing pain in my eye that wouldn't go away. I tried to close my eyes but it was impossible.
For a long time after this I didn't do any speed. I'd decided it wasn't my thing and that the initial great feelings weren't worth the extremely unpleasant after effects.
Then, yesterday, B asked if I wanted to smoke some of a new sack he'd gotten. I was apprehensive but agreed. We chilled out in his garage for several hours and I got a good amount of hits. There was the same nasty chemical taste again, and I never really got used to it. Later on I started to get a great sensation in my hands and arms and legs, like half my body had gone to sleep and was tingling. When we finished our session B and I had a really good, deep conversation. I learned a lot of things about him I'd never known before. We walked around his neighborhood for awhile and then came back. I tried to make myself eat some dinner but I found the meth had totally gotten rid of all my appetite. I had to force myself to eat the pizza and drink the soda.
I went home and went online for a long while, and got a lot of schoolwork down late at night. I'm still up right now, making this report at around 2:20 in the morning. I haven't felt any of the bad phsyical effects I got the last couple times.
Despite these several experiences, I still have mixed feelings about this substance. Some of its effects are really fun. I'm a pretty social guy, but meth makes 10 times more. I've had great conversations on it, and I especially like doing meth with weed. There's something about that combination that is very unique and extremely fun.
 Another very big negative for speed is its addictive quality. I know a lot of people where their whole life has been eaten up by it. Some of the things i've read about its effects on the brain have also discouraged me.
Another aspect of meth that bothers me a lot sometimes is its artificial feeling, both the substance itself and in some ways, the high. I enjoy more .. 'natural' highs, like weed, salvia, and mushrooms.
so, all in all, I guess my basic feeling is this: meth can be pretty fun sometimes, but I want to continue doing it very infrequently like I have been. I've only done it six times in my life, over a period of about 5 months. I'm gonna stick with my favorites, weed and mushrooms, and give meth a try on very rare occasions.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Phonebox Technology - main content section
Phonebox Technology - understanding our phones
phones
Phones are everywhere in our everyday lives. From banking to messages, if you're trying to find a job or get a doctor, our phones have the capacity to make our lives easier and better in a matter of touchs. But what if this experience could be improved? What if there's even more for us to achieve with our mobiles, in such a great way that we can look back and acknowledge how far we've come in mobile technology? For that we need to think out of the box. For that we need Phonebox.
Phonebox Technology - phone highlight section
meet phonebox
a new technology awaits
Phonebox is more than just a phone. It's a technology, an idea, a desire. That's why we're bringing Phonebox to tablets, PCs, TVs and every IOT device you can think of. With our new technology you can always think out of the box.


Schedule¶
This course will be delivered in a hybrid mode, with online and on site lectures and on site and online laboratory sessions. The first week (January 11-15) is fully digital and the computer lab and the lectures will be done via zoom.
Two lectures per week, spring semester, 10 ECTS. The lectures will be fully online. The lectures will be recorded and linked to this site and the official University of Oslo website for the course;
Three hours of laboratory sessions for work on computational projects and exercises for each group. Due to social distancing, at most 15 participants can attend. There will also be fully digital laboratory sessions for those who cannot attend;
Two projects which are graded and count 1/2 each of the final grade;
The course is offered as a FYS4411 (Master of Science level) and a FYS9411 (PhD level) course;
Videos of teaching material are available via the links at https://www.uio.no/studier/emner/matnat/fys/FYS4411/v21/timeplan/index.html#FOR;
Weekly emails with summary of activities will be mailed to all participants;
Teaching schedule with links to material¶
Week 2, January 11-15, 2021¶
Introduction to the course and start variational Monte Carlo
Video of Lecture https://www.uio.no/studier/emner/matnat/fys/FYS4411/v21/forelesningsvideoer/FirstpartLectureJan14.mp4?vrtx=view-as-webpage and https://www.uio.no/studier/emner/matnat/fys/FYS4411/v21/forelesningsvideoer/SecondpartJan14.mp4?vrtx=view-as-webpage
Lecture Material at http://compphysics.github.io/ComputationalPhysics2/doc/pub/week1/html/week1.html
Week 3, January 18-22, 2021¶
Building a variational Monte Carlo program
Lecture Material at http://compphysics.github.io/ComputationalPhysics2/doc/pub/week2/html/week2.html
Video of lecture https://www.uio.no/studier/emner/matnat/fys/FYS4411/v21/forelesningsvideoer/LectureJan21-1.mp4?vrtx=view-as-webpage
Week 4, January 25-29, 2021¶
Metropolis sampling and Importance Sampling
Lecture Material at http://compphysics.github.io/ComputationalPhysics2/doc/pub/week3/html/week3.html
Video of lecture https://www.uio.no/studier/emner/matnat/fys/FYS4411/v21/forelesningsvideoer/FYS4411LectureJan28.mp4?vrtx=view-as-webpage
Week 5, February 1-5, 2021¶
Importance sampling, Fokker-Planck and Langevin Equations
Lecture Material at http://compphysics.github.io/ComputationalPhysics2/doc/pub/week4/html/week4.html
Video of lecture https://www.uio.no/studier/emner/matnat/fys/FYS4411/v21/forelesningsvideoer/LectureFeb4.mp4?vrtx=view-as-webpage
Week 6, February 8-12, 2021¶
Optimization, gradient descent methods and finalization of discussion on importance sampling
Lecture Material at http://compphysics.github.io/ComputationalPhysics2/doc/pub/week5/html/week5.html
Video of lecture https://www.uio.no/studier/emner/matnat/fys/FYS4411/v21/forelesningsvideoer/LectureFeb11.mp4?vrtx=view-as-webpage
Week 7, February 15-19, 2021¶
Optimization, Stochastic Gradient Descent
Lecture Material at http://compphysics.github.io/ComputationalPhysics2/doc/pub/week6/html/week6.html
Video of lecture https://www.uio.no/studier/emner/matnat/fys/FYS4411/v21/forelesningsvideoer/LectureFeb18.mp4?vrtx=view-as-webpage
Week 8, February 22-26, 2021¶
Gradient Descent and start resampling methods
Lecture Material at http://compphysics.github.io/ComputationalPhysics2/doc/pub/week7/html/week7.html
Video of lecture https://www.uio.no/studier/emner/matnat/fys/FYS4411/v21/forelesningsvideoer/LectureFeb25.mp4?vrtx=view-as-webpage
Week 9, March 1-5¶
Resampling methods, Blocking and Bootstrapping
Lecture Material at http://compphysics.github.io/ComputationalPhysics2/doc/pub/week8/html/week8.html
Video of lecture https://www.uio.no/studier/emner/matnat/fys/FYS4411/v21/forelesningsvideoer/LectureMarch4.mp4?vrtx=view-as-webpage
Week 10, March 8-12, 2021¶
Blocking and bootstrap techniques for resampling
Lecture Material at http://compphysics.github.io/ComputationalPhysics2/doc/pub/week9/html/week9.html
Video of lecture https://www.uio.no/studier/emner/matnat/fys/FYS4411/v21/forelesningsvideoer/LectureMarch11.mp4?vrtx=view-as-webpage
Week 11, March 15-19, 2021¶
High-performance computing
Lecture Material at http://compphysics.github.io/ComputationalPhysics2/doc/pub/week10/html/week10.html
Video of lecture http://compphysics.github.io/ComputationalPhysics2/doc/pub/week10/html/week10.html
Week 12, March 22-26, 2021¶
Final discussion of project 1 and summary of first part of semester
Lecture Material at http://compphysics.github.io/ComputationalPhysics2/doc/pub/week11/html/week11.html
Video of lecture
Week 13, March 29-April 2, 2020¶
Holiday break
Week 14, April 5-9, 2021¶
Deep learning and quantum many-body systems
Lecture Material at http://compphysics.github.io/ComputationalPhysics2/doc/pub/week13/html/week13.html
Video of lecture
Week 15, April 12-16, 2021¶
Deep learning and quantum many-body systems
Lecture Material at http://compphysics.github.io/ComputationalPhysics2/doc/pub/week14/html/week14.html
Video of lecture
Week 16, April 19-23, 2021¶
Deep learning and quantum many-body systems
Lecture Material at http://compphysics.github.io/ComputationalPhysics2/doc/pub/week15/html/week15.html
Video of lecture
Week 17, April 26- April 30, 2021¶
Deep learning and quantum many-body systems
Lecture Material at http://compphysics.github.io/ComputationalPhysics2/doc/pub/week16/html/week16.html
Video of lecture
Week 18, May 3-7, 2021¶
Deep learning and quantum many-body systems
Lecture Material at http://compphysics.github.io/ComputationalPhysics2/doc/pub/week17/html/week17.html
Video of lecture
Week 19, May 10-14, 2021¶
Summary of course and last lecture and lab session
Lecture Material at http://compphysics.github.io/ComputationalPhysics2/doc/pub/week13/html/week13.html
Video of lecture


Assumptions
As the time frame of the challenge being really short, there were a number of assumptions I took :
- Out of different kinds of groups that prevail, Informal chats are the ones which are in dominance. People rarely use WhatsApp for Official purpose.
- The WhatsApp feature “Payment” hasn’t been introduced yet, and the “Camera” feature is still present in “Add Media”.
- As mentioned in the problem statement, I being a part of the design team of WhatsApp have a say in addition/subtraction of elements as and when required.
- Decisions made are in accordance with the Indian Janta.
Random Brainstorming
Initially to find a point to start, I started with writing down random thoughts and questions that came in my mind related to Polls. A few of them were:
- Why do we need polls?
- Who’s going to use it?
- Which all applications have existing polls feature?
- Is it going to be a text based poll or image based?
- How frequently is it going to be used?
- Should the results be shown to all or just the poll creator?
- Is the Admin involvement required?
- Real-time results or the results after the voting is done?
- How do we create Polls?
Competitive Analysis
To start of with, I planned to learn about the existing polls in other competitive applications. Understanding their methodology and presentation might lead me towards the solution. So, Facebook, Instagram, Messenger & Inshorts were the 4 main applications, whose Polls service I analyzed.
Understanding the Target Audience
So I divided the user base into two demographic categories, considering the fact that people now a days are psychographically quite familiar with messaging apps:
- People who are technologically well versed, i.e. students, entrepreneurs & corporates.
- People who aren’t much comfortable with new technology and take time to become familiar with the new tech.
Then I went on to find out, what the polls are going to be. Who will be putting up posts, why will he/she use WhatsApp to put up a poll, and why specifically polls in groups? So I decided to talk to a few colleagues who extensively used social media applications to get a better understanding of use cases.
1:1 Interview
I do not believe in asking direct questions while discussing a problem, so I quickly wrote down a few points that I need to consider while talking to people.
Pain Points & Their Solutions
From the six 1:1 Interviews I took, I finally narrowed down to the following pain points, and suggested solutions of how to tackle them:
- “WhatsApp is more of a messaging app and gives not much social experience”
SOLUTION: Just keeping text-based polls won’t help, we’ve to also provide them with the option of Image-based poll so as to improve their experience.
- “Once a poll is created, due to consecutive messages, the poll gets ignored”
SOLUTION: A new feature - a Quarter circle could be introduced on the top right corner (which is barely used, this won’t distract), which will be fixed and will be active till the Poll is active. On clicking this pin, it would redirect to the poll in the chat.
- “In some Polls the number of people who’ve already voted the given options is visible, thus my decision is biased sometimes”
SOLUTION: The Poll results are to be kept hidden until the user has voted a particular option.
- “Instagram polls are really nice, but WhatsApp has a clean UI style of its own”
SOLUTION: Designing on the ground with the prescribed UI Pattern of WhatsApp, it’ll better not to provide the kind of polls that Instagram provides, we’ll keep it simple and clean.
- “Is poll in a group chat really important? It shouldn’t have a totally different functionality of its own”
SOLUTION: Polls can be Introduced in place of “Camera” in attachment because the “camera” feature is already present alongside the text input bar.
- “Sometimes I need a poll only for a couple of hours, hope the duration was flexible and not fixed as of Instagram”
SOLUTION: Polls would be given equal priority as of sending a location or a contact, and the functionality will be almost the same. While creating a poll the Time Duration can be varied.
Constructive Outcome
On observing it was found out that, WhatsApp has tried to incorporate everything in messages. Let it be an Image, a Video, a Contact or even a location, everything is sent in the form of a message. So I came to the conclusion that the Poll to be created should also be sent as a message and not to be kept as a feature with totally different functionality. Plus the usability of Polls increase if it is sent as a message, people can reply to it, thus can provide contextual suggestions to the poll.
Personas
From Interviews, I got a better understanding of what use cases can be. Thus coming up with the following Personas and user flows:
How To Create A New Poll
Solution 1:
I observed that the “Add Image from Camera” feature is there twice in the present application. WhatsApp had very wisely maintained the symmetry in icons in “Add Media” as well as keeping it up front as an option for easy access. So I replaced “Camera” in “Add Media” with “Poll”.
Solution 2:
Later I thought to keep the camera feature intact so that no existing feature is disturbed while I’m redesigning so as to keep add Poll as a feature.
Out of the Solutions, I finally proceeded with Solution 1, as I thought it was practical enough and the omission of one of the “camera” feature won’t be a major concern. Plus the fact that I earlier assumed that, I being a part of the Design Team of WhatsApp have the right to make major changes.
Casting Of Votes
As discussed earlier, the Poll created will come as a message. So it is quite obvious that after a few messages the poll card will go unnoticed, and a majority of the members of the group won’t be able to respond. Thus a marker or an additional feature needed to be added to the existing application so that the members get to know that a Poll is live. This way, the conversion rate can be increased multiple times.
So, as time was less and I wanted to come up with something disruptive, I introduced a new element which was upfront and on clicking would directly take you to the Poll. I’ve done descriptive research on the new element I introduced, you can read about it in my other project:
Parallel Chat - Concept Design.
Once you reach the Poll card, you need to first choose your option and then on submitting you get to know about the cumulative result. The reason for not showing the result recorded until then, as seen in Messenger and Facebook, was to keep the poll completely unbiased. Through user research, I got to know that people found Insta Polls more intriguing and amusing as compared to Facebook pools, cause they had this eagerness to know I they were on the winning side or not. So basically a touch of gamification was what people liked more.
Situations might arise where people might select the wrong option by mistake or might want to change their decision, so as discussed, it’s in the hand of the poll creator to decide if the user can edit his/her pole one submitted.
Poll Results
The results of the poll was that of a particular group, so it was quite obvious to add it in the Group Profile, but where?
I had two option, either add it under “Media”, alongside Media, Documents, and Links or as a completely independent entity, such as Starred Message, Media Visibility etc. Logically it should come under Media as initially while creating a poll, it was “Add Media” we clicked first to reach polls, but considering the fact that sharing Location and Contact history didn’t turn up in “Media”, I decided to keep it as a different entity altogether. The decision was quite ambiguous, but with time flying by, I had to decide anyhow.
The Poll Results can be later shared once the poll has been completed as an Image. Sharing option can be accessed through the more option in the top right corner.


Play 1.2.4 — Release notes
You can read about the bugs fixed in Play 1.2.4 on the road map page. This page highlights the most important changes.
Support for Java 7
Play now supports Java 7 out-of-the-box, so you can write the following code without any problems.
Map<String, List<String>> map = new HashMap<>();
String version = "1.2.4";
switch(version) {
case "1.2.4":
//code
break;
case "1.2.3":
//code
break;
case "1.2.2":
//code
default:
//code
break;
}
New binder implementation
The new binder implementation is more flexible and allows easy mapping from jQuery to Play. It is also possible to map more complex objects using this new implementation.
Latest WebSocket support
Play now supports the latest draft WebSocket specification, namely hybi-00 to hybi-10. Please refer to the WebSocket specification for more information.
Support for composite IDs
Fixtures now supports Composite IDs. The following annotations are also supported on your model and directly from the fixtures: @IdClass
, @EmbeddedId
. Please refer to the Hibernate documentation for more information.
Better IntelliJ support
The play idealize
command now creates a complete IntelliJ project. You can directly open your Play project from IntelliJ.
Other improvements
There are also a number of small improvements, as well as 86 fixed bugs.


Money Play. How should Red play 52?
pips Red=116 White=139
(CorrectAnswer= 0/0, ErrorScore= 0)
When ahead in the race, race.
Red could play safely with 8/6, 8/3 or fairly safely with 13/11, 13/8 but neither play meets the demands of the position. White has only ten checkers in the attack zone and one of those is a blot on his ace-point.
22/15 is the only sensible play and indeed every other play is a blunder or worse!
Red could play safely with 8/6, 8/3 or fairly safely with 13/11, 13/8 but neither play meets the demands of the position. White has only ten checkers in the attack zone and one of those is a blot on his ace-point.
22/15 is the only sensible play and indeed every other play is a blunder or worse!
1. Cubeful 2-ply 20/13 Eq.: +0.476 0.639 0.105 0.003 - 0.361 0.069 0.001 2. Cubeful 2-ply 13/7 8/7 Eq.: +0.343 (-0.132) 0.606 0.139 0.005 - 0.394 0.110 0.006 3. Cubeful 2-ply 20/14 6/5 Eq.: +0.238 (-0.238) 0.579 0.121 0.005 - 0.421 0.119 0.004 4. Cubeful 0-ply 8/2 6/5 Eq.: +0.193 (-0.283) 0.560 0.149 0.004 - 0.440 0.127 0.005 5. Cubeful 0-ply 8/1 Eq.: +0.138 (-0.338) 0.544 0.148 0.004 - 0.456 0.135 0.005


{% extends "layout.html" %} {% import "bootstrap/wtf.html" as wtf %} {% block body %}
We are computer science & statistics students at LMU Munich and this project is happening as part of a Data Science Practical. Our plan was to participate in the associated Kaggle Challenge and subsequently build a product surrounding the trained model. Eventually we placed 160th in the public leaderboard and unfortunately only 509th in the private leaderboard.
EnergApp is the second phase of our data science practical. The aim of EnergApp is to incorporate the predicted model from the kaggle challenge. The idea behind this is that you can submit your building's data and in return get the predicted energy consumption for said building, which makes our findings available to everyone.
Yes, in order to submit and manage your buildings, you have to sign up for our web application. Don't worry, your data will be safe with us
Use the navbar to go to the buildings section or click here. You'll find a list of all your buildings and accompanying attributes.
In the buildings tab just click on the ADD+ button and enter your building's details.
Just go to the prediction tab and enjoy.
We trained our model by using LightGBM, which is common framework for gradient boosting.
Well yes, but actually no. We tried to make the predictions as accurate as possible but forecasting the energy consumption for unseen buildings is still very experimental and needs further evaluation to be stable.
We provide our model in txt-format, which can be downloaded from here
Sure, we provide a public endpoint, which will return your predictions if you provide the necessary inpute data. The endpoint is "localhost:5001/predict".
We provide a list of all required attributes as well as an example request, which can be found in our repository.
Thanks for the compliment! We really appreciate it, since we invested a lot of time and effort to create this amazing project. If by chance you are our supervisor, we would be really happy to receive a good grade ;)


Eh!!! Welcome to my pizzeria!!!
Spicy-Meat-a-Ball Pizzeria was founded by a team of amateur (...and sometimes good) volleyball players who love to hammer a ball and celebrate a win with a pizza pie. We run our kitchen like we run plays: quick, efficent and professional. You'll love our pies or we'll eat our shorts.
Build Your Own
Signature Pizzas
Customize Your Pizza
Please select your toppings:
Select the toppings below to customize your pizza just the way you like it.
Order Summary


Features¶
Prior Work¶
The most obvious option is to manually load and store a map from arguments to their outputs in the filesystem. Significant shortcoming: this requires significant engineering effort to adopt and maintain.
There are many existing memoization libraries (functools.lru_cache, joblib.Memory, Klepto, Cachier, python-memoization). However, these all suffer similar shortcomings. Some do slightly better,
joblib.Memory
has a bound in size; some are worsefunctools.lru_cache
is only useful within the process. Significant shortcoming: none of them are correct when the source code changes.Object-Relational Mappings (ORMs) can save objects into a relational database. However, one would have to change the calling code to lookup the objects if they exist and recompute them otherwise. Significant shotcoming: This still requires significant effort to adopt and is not correct when the source code changes.
[Guo] attempted to fix the same problem with IncPy. IncPy is a modification to CPython itself, so it can do better than a language-level library. For example, IncPy can maintain correctness with respect to some external state and it automatically knows when a function is pure and worth caching. Significant shortcoming: IncPy only supports Python 2.6.
Another option is guard the whole invocation with Make. Significant Shortcoming: This more difficult to adopt: all functions have to be refactored to operate on files. It also goes outside of the language, which loses some of the power of Python.
Feature Matrix¶
Usefulness |
Correctness |
Ease of adoption |
Bounded |
Shared |
Replacement Policy |
Versioned Resources |
Overhead aware |
Python 3.x |
|
|---|---|---|---|---|---|---|---|---|---|
Manually load/store to/from FS |
🔶 |
❌ |
❌ |
❌ |
✅ |
❌ |
❌ |
❌ |
✅ |
Other libs |
🔶 |
❌ |
✅ |
🔶 |
❌ |
❌ |
❌ |
❌ |
✅ |
ORM |
✅ |
❌ |
❌ |
❌ |
✅ |
✅ |
❌ |
❌ |
✅ |
IncPy |
✅ |
✅ |
✅ |
❌ |
❌ |
❌ |
❌ |
❌ |
❌ |
Make |
🔶 |
✅ |
❌ |
❌ |
✅ |
❌ |
✅ |
❌ |
✅ |
charmonium.cache |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
Useful: When the code and data remain the same, and their entry has not yet been evicted, the function should be faster. Usefulness is quantified by the duration over which results can be used:
❌: only useful within the same process (perhaps they use in memory storage)
🔶: only useful within the same machine
✅: useful between machines
Correct: When the inputs changes, the function should be recomputed. For experimentalists to be confident in the result of experiments, the cache cannot have a chance of impacting correctness; it must invalidate itself automatically.
❌: only correct with respect to function arguments
✅: correct with respect to function arguments, closure, and source code
This library has the latter degree of correctness. See the tests in
tests/test_code_change.py
.
Easy to adopt: When using the cache, the calling code should not have to change, and the defining code should change minimally.
❌: requires non-trivial work to adopt
✅: change at most one line of the definition and nothing in the call-sites, in the common case. For example,
>>> from charmonium.cache import memoize >>> @memoize() # this is the only line I have to add ... def function(input1, input2): ... return input1 + input2 ... >>> # these calls don't change >>> function(3, 4) 7 >>> function(5, 6) 11
Bounded:
❌: Not bounded
🔶: bounded number of entries
✅: bounded size in storage; this is more tangible and usable for end-users.
Shared between functions: The cache capacity should be shared between different functions. This gives “important” functions a chance to evict “unimportant” ones (no need for static partitions).
Replacement policy: Data has to be evicted to maintain bounded size.
❌: ad-hoc replacement
🔶: replacement based on recency
✅: replacement based on recency, data-size, and compute-time (“function-based replacement policy” in Podlipnig’s terminology [Podlipnig])
The most common replacement policy is LRU, which does not take into account data-size or compute-time. This is permissible when all of the cached items are resulting from the same computation (e.g. only caching one function). However, since this cache is shared between functions, it may cache computations with totally different size/time characteristics.
Supports versioned-resources: Some variables represent a “versioned resource:” with high probability, the version either stays the same or changes to a novel value, rarely returning to a previously-seen value. Note that this need not be a numeric version; its content can be its version. We want to invalidate entries based on an older version. The old entries may have been evicted by the eviction algorithm anyway, but invalidation guarantees its eviction.
For example, data files are a versioned resource; if they change, their value old value is likely not revisited. Not only should the cache insert the new version as a new entry (that is correctness), it should delete the old one entry.
Overhead aware: In cases where the overhead of the cache is greater than the time saved, the cache should warn the user to change their code. Although this does not eliminate cache thrashing, it will raise problematic behavior to the human engineer for further remediation.
Python 3.x
Other features of charmonium.cache
:
One- or two-level caching: One-level caches embed the return-value in the index. Two-level caches have a layer of indirection, the object store in my case. This library supports the choice between either.
Time-to-live (TTL): This library supports dropping values that are more stale than a certain time.
The whole codebase is statically typed (including the decorator part PEP 612) and these types are exported to clients with PEP 561. Until mypy supports PEP 612, I recommend clients use pyright.
Limitations and Future Work¶
Requires pure functions: A cache at the language level requires the functions to be pure at a language level. Remarkably, this cache is correct for functions that use global variables in their closure. However, system-level variables such as the file-system are sources of impurity.
Perhaps future research will find a way to encapsulate the system variables. One promising strategy is to intercept-and-virtualize external syscalls (Vagrant, VirtualBox); Another is to run the code in a sandboxed environment (Docker, Nix, Bazel). Both of these can be paired with the cache, extending its correctness guarantee to include system-level variables.
Suffers cache thrashing: Cache thrashing is a performance failure where the working-set is so large the entries in entries never see reuse before eviction. For example:
for i in range(100): for j in range(25): # Suppose the returned value is 1 Gb and the cache capacity is 10Gb print(cached_function(j))
The cache can only hold 10 entries at a time, but the reuse is 25 iterations away, the older values are more likely to be evicted (in most cache replacement policies), so nothing in the cache is able to be reused.
The best solution is to reimplement the caller to exploit more reuse or not cache this function. It seems that the cache would need to predict the access-pattern in order to counteract thrashing, which I consider too hard to solve in this package. However, I can at least detect cache-thrashing and emit a warning. If the overheads are greater than the estimated time saved, then thrashing may be present.
Implements only eager caching: Suppose I compute
f(g(x))
wheref
andg
both have substantial compute times and storage. Sometimes nothing changes, sof
should be cached to make the program fast. Butg(x)
still has to be computed-and-stored or loaded for no reason. ‘Lazy caching’ would permitf
to be cached in terms of the symbolic computation tree that generates its input ((apply, g, x)
) rather than the value of its input (g(x)
). This requires “lazily evaluating” the input arguments, which is difficult in Python and outside the scope of this project.However, Dask implements exactly that: it creates a DAG of coarse computational tasks. The cache function could use the incoming subgraph as the key for the cache. In steady-state, only the highest nodes will be cached, since they experience more reuse. If they hit in the cache, none of the inputs need to be accessed/reused. Future development of my cache may leverage Dask’s task DAG.
Thread-safety
Remove orphans