A valid T2WML file has a very specific structure it must conform to in order to work.
statementMapping:
region:
- keys...
template:
- keys...
cleaningMapping:
- region:
- keys...
functions:
- func:
args1:...
It must contain the key statementMapping
, opening a dictionary.
The statementMapping
must contain the keys region
and template
.
The region
and the template
must each be a list of dictionaries (although we currently only support one entry in the list)
It may optionally contain the key cleaningMapping
, opening a list, discussed further in its section below.
The region is used to specify which cells of the data sheet are the data area.
The region
can be written in a variety of formats.
Step one: calculate the base rectangle.
The first option is to use the key range
and specify a cell range, eg: C4:E10
.
The second option is to use the keys left
, right
, top
, and bottom
, to specify the left, right, top, and bottom edges of the area (inclusive). These arguments can be specified dynamically using the t2wml language. If left unspecified, left/right/top/bottom will default to the edges of the spreadsheet (ie the leftmost/rightmost columns and top/bottom rows)
The two options are mutually exclusive, if range
is provided top/bottom/left/right
will be ignored. If neither option is provided, the rectangle will default to the entire sheet.
Step two: Select/remove columns/rows/cells
There are six further, optional arguments the user can provide.
The arguments columns
, rows
, cells
select specific columns, rows, and cells. These are not purely additive arguments-- another way of putting this is that selection arguments take priority over the base rectangle.
So, if someone provides a base rectangle of A1:E7 and then provides columns [A, B, E, G], the code will select columns A, B, E and ignore columns C and D, and the rows will be 1-7. If someone provides columns and rows, then the range argument will end up being ignored entirely.
The arguments skip_columns
, skip_rows
, and skip_cells
subtract from the selected rectangle (or selected rows+columns).
cells
takes precedence over any other arguments. For example, if in cells
the user specifies A3, whose value is "dog", and in skip_cells the user says to skip all cells whose value is dog, A3 will not be skipped.
Dynamic definitions:
All 6 arguments can be dynamically defined. IMPORTANT: When dynamically defined, the search for matches takes place exclusively within the base rectangle. So, going back to the example of A1:E7, if the columns argument was a dynamic definition that matched G, G would nonetheless not be included because the definition would not be searched for outside the rectangle.
(This is especially important to be aware of for dynamically selecting cells, because a dynamic definition will NOT find cells outside of the rectangle. For cells outside of the rectangle you must specify them explicitly.)
region:
- left: A
right: D
top: 1
bottom: 5
region:
- range: D3:F12
skip_column:
- code here...
- more code...
skip_cell:
- more code...
The template is used to build statements for each cell in the region.
It must have the keys subject
, property
, and value
.
It can also optionally have the attribute keys qualifier
and reference
, as well as the optional keys calendar
, precision
, time_zone
, format
, lang
, longitude
, latitude
, unit
.
qualifier
must be a list of dictionaries. the required keys in their dictionaries are property
and value
, and the same optional keys as above are allowed.
The values for the various keys can be defined in the T2WML language (=value[$col, $row]
is a common occurence for the key value
, for example).
template:
value: =value[$col, $row]
subject: Q1000
property: P123
qualifier:
- property: P585
value: 10
format: "%Y"
- property: P6001
value: =item[A, $row]
reference:
- property: P246 # stated in
value: Q11191 # The World Factbook
Providing a cleaningMapping section is optional, but if it is provided, it must conform to the following format:
It must contain a list.
Each entry of the list must be a dictionary, containing two keys, region
and functions
. The region is the same as the region in templateMapping and must follow the same format. functions
is specific to cleaningMapping. It consists of a list of functions to be applied to the specified region (functions are describe in greater detail in the cleaning Functions section).
Some of the functions receive no arguments, some receive optional arguments, and some have required arguments. These are summarized below.
cleaningMapping:
- region:
range: D6:K20
functions:
- ftfy
- strip_whitespace:
char: null # default all whitespace, can also be " " or "\t"
where: start_and_end
- replace_regex:
to_replace: #required, no default
replacement: #required, no default
- remove_numbers:
where: everywhere
- remove_letters:
where: everywhere
- truncate:
length: #required, no default
- normalize_whitespace:
tab: False
- change_case:
case: sentence #can also be "lower", "upper", and "title"
- pad:
length: #required, no default
pad_text: #required, no default
where: start # or "end". does not allow "everywhere" or "start_and_end"
- make_numeric:
decimal: "."
- make_alphanumeric
- make_ascii:
translate: False
- replace_empty:
replacement: #required, no default
The T2WML grammar is based on yaml files that can contain custom T2WML statements.
Therefore T2WML files must conform to yaml 1.1 standards. (The yaml standards most likely to trip up a T2WML user are those regarding escaping strings, if you want a shorter document to read)
Note: It's not necessary to read this before writing T2WML yaml files. It's just something to be aware of if something goes wrong.
By default, statements in the yaml document are parsed by the yaml parser (as ints, floats, strings, etc).
To indicate that a statement is an instance of T2WML code, the statement must be prefixed with an = sign.
value: value[$col, $row]
will return the string "value[$col, $row]"
value: =value[$col, $row]
will returned the evaluated value for the T2WML expression
The T2WML language contains some reserved variable names, indicated with a $ in front of the name
$top
, $bottom
, $left
, $right
: The top, bottom, left, and right of the data range. Currently supported only when defining the region (not in template). Using for recursive definitions (left: $left+1) or circular definitions (right: $left, left: $right) is not allowed.$end
: the last row of the sheet. Convenient for defining bottom
.$col
, $row
: the current column and current row in the data region. Supported only in the template (not the region).$n
: an iterator variable$sheet
: the name of the current sheet
value[col, row]
retrieves the cell contents for the cell/s indicated by col and row.
Col and row could be single constants:value[A, 3]
.
Either or both could be a range: value[A:D, 4]
, value[A:D, 3:5]
And they can use the reserved values $col, $row, and $n: value[A:$col, $row+$n]
item[col, row]
retrieves the wikidata item(s) based on the cell contents for the cell/s indicated by col, row
If the data cell contains the string "Burundi", for example, then item will retrieve the qnode "Q1000".
Be aware that when item[] values are being processed in boolean expressions, they are treated as the string representation of the qnode, ie, again "Q1000". Attempting to check whether item[col, row]=="Burundi" will fail, you need to check whether item[col, row]=="Q1000".
In order for item to work the user must have uploaded a wikifier file.
The valid col/row arguments are the same as for value.
The T2WML language implements a variety of functions.
These can be broadly split into boolean functions, string modifiers, and other.
Functions can be nested. It is possible, for example, to write contains((upper(value[A:B, 2:3])),”TA”)
, a case-insensitive way to check if the string “ta”, “tA”, etc is present in each cell in the range.
Not every nesting order makes sense.
upper(contains(value[A:B, 2:3], “TA”))
would return a string, “FALSE” or “TRUE” (even worse, the string “FALSE” evaluates to True in boolean checks…)
A boolean expression- created with a function or operator- returns a True/False value.
A boolean equation is inidcated with the arrow (->
) operator. It returns some value, based on when a boolean expression returns True. The left side argument is the boolean expression, and the right side argument is what is returned as soon as the expression is evaluated to True. (one therefore would normally have the boolean expression contain at least one of the iterables $row, $col, or $n)
contains(value[A, $row], "human")
is a boolean expression.
contains(value[A, $row], "human") -> value[B, $row]
is a boolean equation.
values[A, $row]=="human" -> value[B, $row]
is also a boolean equation
Note that skip_col
, skip_row
, and skip_cell
in region
expect to receive boolean expressions, not boolean equations. Where the return value of the function is True, the cell/row/column will be added to the list of cells/rows/columns to skip.
Empty cells will always evaluate to False.
T2WML supports two boolean operators, ==
and !=
for equal and not equal, respectively.
It is important to note that when applied to a range, these operators use "and" logic.
value[A:D, $row] == "Burundi"
will only return true when all of the columns A through D in the row equal "Burundi". Similarly, value[A:D, $row] != "Burundi"
will only return true if none of them equal "Burundi".
There are currently four boolean functions.
It is important to note that when applied to a range, unlike operators, boolean functions use "or" logic. That means they will return True if the condition is True for any cell in the range.
contains(arg1, arg2)
: whether the string value of arg1 contains arg2 (as a substring) anywhere.starts_with(arg1, arg2)
: same as contains but must start with arg2.ends_with(arg1, arg2)
: same as contains but must end with arg2.instance_of(input, qnode)
: checks whether the input has an "instance of" relationship with the qnode. both must be items or qnode strings. As described in the Wikidata query tutorial, the query uses “instance of” followed by any number of “subclass of”. ( wdt:P31/wdt:P279* )instance_of(“Q378619”, “Q146”)
would return Trueinstance_of_qnode(item[A, 3], “Q146”)
would return True if the item for cell A3 was an instance of Q146, eg Q378619instance_of_qnode(value[B, 3], “Q146”)
would return True if the value for cell A3 was a string that happened to be a valid qnode string for a qnode that was an instance of Q146.instance_of_qnode(item[A, 3:6], “Q146”)
would return True if cells A3-A6 all were items that are instances of Q146String modifier functions receive a value, value range, or string and perform various modifications on them.
If the string modifier receives a value range, it will perform the string modification on every value in the range.
It does not make sense to run string modifiers on items or item ranges, and attempting to do so will raise an error.
For simplicity, the examples all use a string for the input, but they would apply equally to a value for a cell whose contents are the string in the example, or a value range.
All of the cleaning functions can be used within the template yaml as string modifiers.
split_index(input, split_char, i)
: Splits the input on the split_char, and returns the ith item from the split, where i is 1-indexed. For example, split_index(“yes,no,maybe”, “,”, 2)
returns “no”
substring(input, start (,end))
: Returns a substring of the input, from start to end, inclusive. (end is optional, if not provided the end will be the end of the string). Negatives indices are counted from the end of the string.
substring("platypus", 3)
returns “atypus”substring("platypus", 3, 5)
returns "aty"substring(“platypus”, 3, -2)
returns "atypu"extract_date(input, format_string)
: Attempts to extract a date from the input using etk, based on the format string.
For example, extract_date(“2000”, “%Y”)
returns 2000-01-01T00:00:00
regex(input, pattern (,i))
: Returns the value of the ith group in the regex pattern provided if a match is found. Returns None if no regex match is found. i is optional, if i is not provided the first group is returned (if no groups are specified, the entire match is returned). If you instead want to return all the groups, set i=0.
Example:
* regex("Isaac Newton, physicist", "(\w+) (\w+)")
returns “Isaac Newton”
* regex("Isaac Newton, physicist", "(\w+) (\w+)", 1)
returns “Isaac”
The regex function uses Python's re.search() function and hence Python's regex syntax. You can test your regex to check that it is returning the results you expect.
WARNING: Because of the need to conform to Yaml standards, a regex containing a colon followed by whitespace :
, or whitespace followed by an octothorpe #
, requires special handling. The recommended solution is to not use actual whitespace, but rather the whitespace character \s
, eg: :\s
, \s#
. You can also single-quote the entire line while double-quoting the regex string, eg: value: '=regex(value[B, 2], "profile: (.*) \d{4}", 1)'
.
Functions which do not behave like boolean functions or like string modifiers.
get_item(input(, context))
get_item receives an input which can be resolved to a string (for example, a value, the output of any string modifer, or just a string).
It optionally receives a context-- if no context is provided, the default context ("__NO_CONTEXT__"
) is used.
It then looks up this string in the item table. If the string is not present in the item table it will return an error. Otherwise, it returns the item from the item table.
Obviously the preferred way to get an item from a string is to use the wikifier. get_item
was created for situations where simply grabbing the string from a cell was not sufficient, for example, if it is necessary to use a regex on the cell to get the needed string.
example: subject: '=get_item(regex(value[B, 2], "profile: (.*) \d{4}", 1))'
concat(*args)
concat receives a variable number of arguments, the last of which must be the join character
For arguments that are ranges, rather than single values, concat will join everything in the range, in row-major order.
| A | B | C | |
|---|---|---|---|
| 1 | Males | Yes | Bird |
| 2 | Female | No | Fire |
| 3 | Males | Maybe | Water |
concat(value[B:C, 2:3], “implies”, item[A, 1:2], “-”)
Would return the string “No-Fire-Maybe-Water-implies-Q6581072-Q6581097”
Concat does not preserve row/column source information. This means that concat does not return information for highlighting in the spreadsheet, unlike string modifiers. (for example, if you define subject in your template to be concat(something), you won’t get blue highlighting)
If for some reason you need a string value to start with "=" (and not have it be interepreted as T2WML code), you can escape it with a forward slash /=
. If for some reason you need a string value to start with a forward slash followed by an equal sign, you can escape the initial forward slash with an additional forward slash //=
. And so on. So value: /=)
would return the string "=)"
This is only necessary at the beginning of a statement, forward slashes and equal signs in the middle of a string require no special treatment, eg: value: The smiley /= is = to =/
Cleaning functions can be used to munge messy data.
They can be used as string modifiers in the template yaml, and act like any string modifier. But they can also be used in a separate cleaning section of the yaml, to create a cleaned copy of the data (the template section does not touch the underlying data, only the output result)
Several of the functions have a "where" argument. The valid values for where are "start", "end", "start_and_end", and "everywhere". Different functions have different defaults for where, indicated in the function signature.
strip_whitespace(input, char=None, where="start_and_end")
: Remove whitespace. By default will remove all whitespace, but if char argument (" " or "\t") is provided, will only remove that.
example: strip_whitespace("\t \w Hel l o?\tworld \t ", where="everywhere")
becomes "Hello?world"
normalize_whitespace(input, tab=False)
: replaces multiple consecutive whitespace characters with one space (also replaces other whitespace characters with one space). if Tab is True, replaces with one tab, instead.
example: normalize_whitespace("Hello you hi\t this")
becomes "Hello you hi this"
replace_regex(input, regex, replacement="", count=0)
: replace_regex uses underlying python re.sub functionality, re.sub(regex, replacement, input, count)
. You can test that your regex performs as expected on websites like regex101.com (make sure to select Python flavor and substitution). The default behavior for replacement is to replace with the empty string, ie remove. When count=0, it replaces everywhere. No where
argument is provided, if you'd like to remove from the end, etc, you can arrange to do so with regex tokens like $ for end of string.
examples:
replace_regex("cats and dogs and cats", "cats", "turtles")
returns "turtles and dogs and turtles"replace_regex(" 30 456 e", "[^\d.-]", "")
returns "30456"replace_regex("123456790 ABC#%? .(朱惠英)", r'[^\x00-\x7f]', "")
returns "123456790 ABC#%? .()"replace_regex("dan dan dan", "dan", "bob", 1)
returns "bob dan dan"remove_numbers(input, where=everywhere)
: remove the digits 0-9
examples:
remove_numbers("123 hello1234hi 123")
returns " hellohi "remove_numbers("123 hello1234hi 123", where=start)
returns " hello1234hi 123"remove_letters(input, where=everywhere)
: inverse of remove_numbers, leaves only digits and removes everything else (alpha version, may be redefined)
change_case(input, case="sentence")
: Changes the case to one of "sentence", "lower", "upper", "title".
examples:
case="tHe QUiCK brown fox"
change_case(case)
returns "The quick brown fox"change_case(case, "lower")*
returns "the quick brown fox"change_case(case, "upper")
returns "THE QUICK BROWN FOX"change_case(case, "title")
returns "The Quick Brown Fox"truncate(input, length)
: if input is longer than length, return only first length number of characters from the string
example: truncate("QWERTYUIOPASDFGHJKL", 10)
returns "QWERTYUIOP"
pad(input, length, text, where=start)
: where can only be start or end. the main argument is a length in number of characters, which strings shorter than that length will be padded to. text is the string to be used in the padding, eg "\t". if the number of characters does not divide exactly then the cut-off depends on where. if where is start, the end of the pad string will be cut off, if where is end, the start of the pad string will be cut off.
examples:
pad("12345678", 11, "xo", where=start)
returns "xox12345678"pad("12345678", 11, "xo", where=end)
returns "12345678oxo"ftfy(input)
: Uses the ftfy package to clean the input
example: ftfy(schÃ¶n)
returns "schön"
make_numeric(input, decimal=".")
: makes the value of a cell numeric by removing non-numeric characters (except for -
, e
, and .
). The decimal argument allows numeric formats which use a different decimal characer than .
. Support for LaTeX style numbers is not yet supported but may be added.
examples:
make_numeric("1.977$")
returns "1.977"make_numeric("1.554.677,88€", decimal=",")
returns "1554677.88"make_numeric("1.577E20")
returns "1.577e+20" (python scientific notation)make_alphanumeric
: for now, removes all characters that are not true for isalnum(). May be redefined (eg to not remove spaces and punctuation...?)
example: make_alphanumeric("Thanks 😊! (<hello>) חחחחⒶ -1.2e10")
would return "Thankshelloחחחח12e10"
make_ascii
: either removes all non-ascii non-printable characters or, if translate=true, uses text-unidecode to translate to closest equivalent
example:
make_ascii("какой-то текст", translate=True)
returns "kakoi-to tekst", without translate the only ascii character there is the "-" so that's what would be returnedmake_ascii("Thanks 😊! (<hello>) חחחחⒶ")
would return "Thanks ! (<hello>) "
fill_empty(input, replacement)
: if a cell is empty (contains only whitespace characters or an empty string), fill it with replacement
.
example: fill_empty("", "0")
fills empty cells with string 0


Business
Finance
Already a user ?Login Here
Login ID
Password
Forgot Password
Need Help?
Are you new here?


Scalable code design with slimmer django model and more
01:45 PM - 02:10 PM on July 16, 2016, Room CR5Dawa Sherpa
- Audience level:
- novice
Description
When you first start your Django project, adding functionality to your model comes really easy, because IT IS really easy to do so. However, as your application size grow, the code you end up might not be easy to work on anymore. As engineers, we should pay attention to scalability not only in terms of number of requests your server can handle, but also how your application can grow with more features, and more engineers working on it.
Code scalability is the ability to grow, modify, adopt your code without a major refactor, lets say every 6 months with many people working on it at the same time. While I know that it is really hard to predict the future needs, and designing for future proof architecture blindly is a waste of time and effort, I do see the need for some forethought when you put together a solution. A good balance between current need and future need can be achieved without sacrificing a lot of productive time. Common smells that indicate you do not have scalable code design are :
- Engineer cannot gain insight into what the code is doing by quickly reading the code ( bug introduction because of mis-understanding )
- Engineer cannot confidently make change to small area of the code (productivity delay, bug introduction )
- Engineer cannot easily evolve the data structure to support new use cases
- Engineer cannot easily to test, modify isolated business logic
All the the above are usually seen when you have a big Django model file with each model having multiple functionality. I would like to review some basic principles to help us build a scalable software system.
Abstract
http://www.slideshare.net/dawalama1/scalable-code-design-with-slimmer-django-models-and-more


These our the services we provide with our awesome platform.
Traffic monitoring on roads (live footage, traffic lights controlling, surveillance etc.) and paramedic and telemedicine supplies in case of accidents.
•Surveys about energy hotspots
• Surveys for the construction sectors (land mapping, terrain)
• Surveys for the insurance (before and after damages)
Solar and turbine inspection and maintenance
Segregation of waste using image recognition.
Traffic surveillance to check on illegal activities like human trafficking
Research on topics like adjustment of gas levels in water bodies w.r.t. climate change
Managing oil spills that
harm water organisms using robots.
Using a system of connected robots we plan on using various sensors in order to find out defects in pipelines.
• Efficient drip irrigation agricultural facilities
• Quick survey and removal of weeds and Surveys like forest cover, crops grown, yield, etc
SHARE THIS PAGE!


## How to contribute
Thanks for your interest in contributing to Offline Google Maps Navigator! Contributing to open source projects like this one can be a rewarding way to learn, teach, and build experience.
Not only that, contributing is a great way to get involved with social coding. We are excited to see what amazing contributions you will make, as well as how your contributions will benefit others.
Here is how you can [contribute](CONTRIBUTING.md) and here is how you can get [set up](README.md) with the code base
## Beginners
This project has a special section for those who are just starting out on their open source journey. Check it out [here](beginners.html) and open issues for any changes
## Learning Resources
This is where the team captures lessons learned, best practices and "gotchas" that may be of help to others - check it [out](learning.html)
## API and other Documentation
You will find more detailed documentation here including all the APIs used, associated instructions and end points
## Meet the team
Here are the [people](https://github.com/TheDevPath/Navi/graphs/contributors) behind this project.
Special thanks to all the woderful [contributors](CONTRIBUTORS.html).
![Logo](https://user-images.githubusercontent.com/35308564/36317506-4407c0aa-130b-11e8-88a2-af1cca16eaba.PNG "Logo")


We'll email the recipient directly with a link from {{config.websiteName}}, so you don't have to give away your email address.
Read this temporary shortlink out loud to invite someone to this pad. If you need a permanent link to email for a future interview, use the full URL in your address bar.


Files | |
| file | tesoc.h |
| This file contains the prototypes of the APIs present in the device abstraction layer file of TESOC. This also contains some related macros. | |
Data Structures | |
| struct | tesocTestCfg |
| This Structure defines the configuration for running TESOC test. These parameters are used for configuring domainType and slice configuration. More... | |
| struct | tesocDiagnosticSliceCfg |
| This Structure is used for diagnostic slice configuration info for each domain in current revision of SoC. More... | |
| struct | tesocAdvanceResult |
| This Structure is used for storing results of TESOC test. These parameters are used as place holder for storing result. More... | |
Macros | |
| #define | TESOC_IRQSTATUS_RAW_ALL (TESOC_INTR_STATUS_RAW_TEST_COMPLETION_SET_MASK) |
| Macro containing mask of all the interrupts. This macro can be passed to interrupt control API's to enable or disable all the main interrupts at a time. More... | |
| #define | TESOC_TIMEOUT_TEST_START (0xFFFFU) |
| Timeout value for TESOC start after test configuration is done. | |
| #define | TESOC_TIMEOUT_TEST_END (0xFFFFU) |
| Timeout value for TESOC test completion after test is started. This is maximum of test times of all domains. | |
| #define | TESOC_TIMEOUT_INFINITE (0xFFFFFFFFU) |
| Infinite timeout for TESOC test. Use this if you want to wait infinitely for test start or test completion. | |
| #define | TESOC_TEST_RUNNING (0U) |
| TESOC test running status: TESOC is running test. | |
| #define | TESOC_TEST_COMPLETED (1U) |
| TESOC test running status: TESOC has completed test. | |
Typedefs | |
| typedef enum tesocSliceSrc | tesocSliceSrc_t |
| Enum to select the slice source for TESOC Test. TESOC can run slices from ROM or RAM. | |
| typedef enum tesocIntrFlag | tesocIntrFlag_t |
| TESOC interrupt flags. | |
| typedef struct tesocTestCfg | tesocTestCfg_t |
| This Structure defines the configuration for running TESOC test. These parameters are used for configuring domainType and slice configuration. | |
| typedef struct tesocDiagnosticSliceCfg | tesocDiagnosticSliceCfg_t |
| This Structure is used for diagnostic slice configuration info for each domain in current revision of SoC. | |
| typedef struct tesocAdvanceResult | tesocAdvanceResult_t |
| This Structure is used for storing results of TESOC test. These parameters are used as place holder for storing result. | |
Enumerations | |
| enum | tesocSliceSrc { TESOC_SLICE_SRC_ROM = TESOC_MISC_CONFIG_SOURCE_CONTROL_SLICE_SOURCE_ROM, TESOC_SLICE_SRC_RAM = TESOC_MISC_CONFIG_SOURCE_CONTROL_SLICE_SOURCE_RAM } |
| Enum to select the slice source for TESOC Test. TESOC can run slices from ROM or RAM. More... | |
| enum | tesocIntrFlag { TESOC_INTR_FLAG_TEST_COMPLETION, TESOC_INTR_FLAG_ALL = TESOC_IRQSTATUS_RAW_ALL } |
| TESOC interrupt flags. More... | |
Functions | |
| int32_t | TESOCGetDefaultSliceInfo (uint32_t baseAddr, tesocTestCfg_t *testCfg) |
| This API gets default slice configuration information for a particular domain. More... | |
| int32_t | TESOCClearPrevState (uint32_t baseAddr, uint32_t domainLabel) |
| This API clears register state of previous TESOC test run(if any). More... | |
| int32_t | TESOCConfigAndStart (uint32_t baseAddr, const tesocTestCfg_t *testCfg) |
| This API configures TESOC for test and starts test on selected domain. More... | |
| uint32_t | TESOCGetTestExecutionStatus (uint32_t baseAddr) |
| Get execution state of TESOC(busy/completed). More... | |
| int32_t | TESOCWaitUntilBusy (uint32_t baseAddr, uint32_t timeOut) |
| This function is used to wait till TESOC starts test. More... | |
| int32_t | TESOCWaitUntilNotBusy (uint32_t baseAddr, uint32_t timeOut) |
| This function is used to wait till TESOC completes running test. More... | |
| int32_t | TESOCCheckTestResult (uint32_t baseAddr, const tesocTestCfg_t *testCfg) |
| Check result of TESOC test. More... | |
| int32_t | TESOCAbortTest (uint32_t baseAddr) |
| This API aborts ongoing TESOC test. More... | |
| void | TESOCClearAbort (uint32_t baseAddr) |
| This API clears TESOC abort register. More... | |
| int32_t | TESOCSetSliceSrc (uint32_t baseAddr, uint32_t testSliceSrc) |
| This API will set slice source for running TESOC test. More... | |
| int32_t | TESOCRunTesoCDiagnostic (uint32_t baseAddr, uint32_t testId) |
| This API will run TESOC diagnostic slice for domain passed. More... | |
| int32_t | TESOCGetAdvanceResult (uint32_t baseAddr, const tesocTestCfg_t *testCfg, tesocAdvanceResult_t *advanceResult) |
| This API reads detailed result of TESOC test. Result contains details like slices configured for test, slice status like completed/not run and result(pass/fail) of each of these slice. More... | |
| int32_t | TESOCReadDiagnosticLog (uint32_t baseAddr, uint32_t *const *diagnosticLog) |
| This API reads error diagnostic log for TESOC test failure. More... | |
| void | TESOCIntrEnable (uint32_t baseAddr, uint32_t intrMask) |
| This function enables specified TESOC interrupts. More... | |
| void | TESOCIntrDisable (uint32_t baseAddr, uint32_t intrMask) |
| This function disables specified TESOC interrupts. More... | |
| uint32_t | TESOCGetIntrEnable (uint32_t baseAddr) |
| This function gets the status of enabled interrupts. More... | |
| uint32_t | TESOCGetIntrStatus (uint32_t baseAddr) |
| This function returns the status of interrupts. More... | |
| void | TESOCIntrClear (uint32_t baseAddr, uint32_t intrMask) |
| This Function clears the status of specified interrupts. More... | |
| uint32_t | TESOCGetIntrRawStatus (uint32_t baseAddr) |
| This function returns the raw status of interrupts. Returned value can be masked with the values in enum TESOCIntrFlag_t to check the required interrupt status. More... | |
| void | TESOCUnlockMMR (uint32_t baseAddr) |
| Unlock access to TESOC registers by writing unlock pattern to TESOC lock register. More... | |
| void | TESOCLockMMR (uint32_t baseAddr) |
| Lock access to TESOC registers by writing lock pattern to TESOC lock register. More... | |
| #define TESOC_IRQSTATUS_RAW_ALL (TESOC_INTR_STATUS_RAW_TEST_COMPLETION_SET_MASK) |
Macro containing mask of all the interrupts. This macro can be passed to interrupt control API's to enable or disable all the main interrupts at a time.
TESOC module allows functional mode field testing of SoC. It enables SW initiated field testing during run-time. The field test can be initiated by any SoC master having access to TESOC registers. SoC is divided into multiple domains for field test. At any point of time field test can be enabled on one domain without corrupting/ stalling functionality of the rest of the SoC. The TESOC ROM image is the encoded version of the test vectors and is already divided into slices. For running field test through TESOC, select domain for which test be tun, slices to be run are configured through tesocTestCfg_t structure. Default slice configuration of each domain on SoC can be obtained through TESOCGetDefaultSliceInfo function.
TESOC programming sequence:
| enum tesocIntrFlag |
| enum tesocSliceSrc |
| int32_t TESOCAbortTest | ( | uint32_t | baseAddr | ) |
This API aborts ongoing TESOC test.
| baseAddr | Base Address of the TESOC Registers. |
| int32_t TESOCCheckTestResult | ( | uint32_t | baseAddr, |
| const tesocTestCfg_t * | testCfg | ||
| ) |
Check result of TESOC test.
| baseAddr | Base Address of the TESOC Registers. |
| testCfg | Structure containing TESOC test configuration info like domain label and slices configured. Refer struct tesocTestCfg_t for details. |
| void TESOCClearAbort | ( | uint32_t | baseAddr | ) |
This API clears TESOC abort register.
| baseAddr | Base Address of the TESOC Registers. |
| int32_t TESOCClearPrevState | ( | uint32_t | baseAddr, |
| uint32_t | domainLabel | ||
| ) |
This API clears register state of previous TESOC test run(if any).
| baseAddr | Base Address of the TESOC Registers. |
| domainLabel | Domain configured for TESOC test. Registers associated with this domain will be cleared. Refer enum #tesocDomainLabel_t for details. |
| int32_t TESOCConfigAndStart | ( | uint32_t | baseAddr, |
| const tesocTestCfg_t * | testCfg | ||
| ) |
This API configures TESOC for test and starts test on selected domain.
| baseAddr | Base Address of the TESOC Registers. |
| testCfg | Structure for TESOC test configuration, contains details like domain label and slices to be run. Refer struct tesocTestCfg_t for details. |
| int32_t TESOCGetAdvanceResult | ( | uint32_t | baseAddr, |
| const tesocTestCfg_t * | testCfg, | ||
| tesocAdvanceResult_t * | advanceResult | ||
| ) |
This API reads detailed result of TESOC test. Result contains details like slices configured for test, slice status like completed/not run and result(pass/fail) of each of these slice.
| baseAddr | Base Address of the TESOC Registers. |
| testCfg | Structure containing TESOC test configuration info like domain label and slices configured. Refer struct tesocTestCfg_t for details. |
| advanceResult | Structure for holding detailed TESOC test result, contains information for slice configured, slice status and slice result after TESOC test. Refer struct tesocAdvanceResult_t for details. |
| int32_t TESOCGetDefaultSliceInfo | ( | uint32_t | baseAddr, |
| tesocTestCfg_t * | testCfg | ||
| ) |
This API gets default slice configuration information for a particular domain.
| baseAddr | Base Address of the TESOC registers |
| testCfg | Structure for holding TESOC test default configuration. Contains information of default slices enabled for the domain in the current revision of SoC. Refer struct tesocTestCfg_t for details. |
| uint32_t TESOCGetIntrEnable | ( | uint32_t | baseAddr | ) |
This function gets the status of enabled interrupts.
| baseAddr | Base Address of the TESOC registers. |
| uint32_t TESOCGetIntrRawStatus | ( | uint32_t | baseAddr | ) |
This function returns the raw status of interrupts. Returned value can be masked with the values in enum TESOCIntrFlag_t to check the required interrupt status.
| baseAddr | Base Address of the TESOC registers. |
| uint32_t TESOCGetIntrStatus | ( | uint32_t | baseAddr | ) |
This function returns the status of interrupts.
| baseAddr | Base Address of the TESOC registers. |
| uint32_t TESOCGetTestExecutionStatus | ( | uint32_t | baseAddr | ) |
Get execution state of TESOC(busy/completed).
| baseAddr | Base Address of the TESOC Registers. |
| void TESOCIntrClear | ( | uint32_t | baseAddr, |
| uint32_t | intrMask | ||
| ) |
This Function clears the status of specified interrupts.
| baseAddr | Base Address of the TESOC registers. |
| intrMask | Mask value for the interrupts to be cleared given by enum - TESOCIntrFlag_t. |
| void TESOCIntrDisable | ( | uint32_t | baseAddr, |
| uint32_t | intrMask | ||
| ) |
This function disables specified TESOC interrupts.
| baseAddr | Base Address of the TESOC registers. |
| intrMask | Mask value for the interrupts to be disabled. Supported values are given by enum TESOCIntrFlag_t. |
| void TESOCIntrEnable | ( | uint32_t | baseAddr, |
| uint32_t | intrMask | ||
| ) |
This function enables specified TESOC interrupts.
| baseAddr | Base Address of the TESOC registers. |
| intrMask | Mask value for the interrupts to be enabled. Supported values are given by the enum TESOCIntrFlag_t. |
| void TESOCLockMMR | ( | uint32_t | baseAddr | ) |
Lock access to TESOC registers by writing lock pattern to TESOC lock register.
| baseAddr | Base Address of the TESOC Registers. |
| int32_t TESOCReadDiagnosticLog | ( | uint32_t | baseAddr, |
| uint32_t *const * | diagnosticLog | ||
| ) |
This API reads error diagnostic log for TESOC test failure.
| baseAddr | Base Address of the TESOC Registers. |
| diagnosticLog | Pointer to 2D integer array size 16x4 to store TESOC test diagnostic log(as TESOC dumps 16 cycles of 128 bit data on test failure). |
| int32_t TESOCRunTesoCDiagnostic | ( | uint32_t | baseAddr, |
| uint32_t | testId | ||
| ) |
This API will run TESOC diagnostic slice for domain passed.
| baseAddr | Base Address of the TESOC Registers. |
| testId | Test Id for which TESOC diagnostic slice to be run. Refer enum #tesocTestId_t for details. |
| int32_t TESOCSetSliceSrc | ( | uint32_t | baseAddr, |
| uint32_t | testSliceSrc | ||
| ) |
This API will set slice source for running TESOC test.
| baseAddr | Base Address of the TESOC Registers. |
| testSliceSrc | Source of slice for TESOC test. Refer enum tesocSliceSrc_t for details. |
| void TESOCUnlockMMR | ( | uint32_t | baseAddr | ) |
Unlock access to TESOC registers by writing unlock pattern to TESOC lock register.
| baseAddr | Base Address of the TESOC Registers. |
| int32_t TESOCWaitUntilBusy | ( | uint32_t | baseAddr, |
| uint32_t | timeOut | ||
| ) |
This function is used to wait till TESOC starts test.
| baseAddr | Base Address of the TESOC Registers. |
| timeOut | Wait time duration can be set to any uint32 or TESOC_TIMEOUT_TEST_START TESOC_TIMEOUT_INFINITE |
| int32_t TESOCWaitUntilNotBusy | ( | uint32_t | baseAddr, |
| uint32_t | timeOut | ||
| ) |
This function is used to wait till TESOC completes running test.
| baseAddr | Base Address of the TESOC Registers. |
| timeOut | Wait time duration can be set to any uint32 or TESOC_TIMEOUT_TEST_END TESOC_TIMEOUT_INFINITE |


Load packages
library(tidyverse)
library(mosaic)
We are following here the advise of Gelman and Hill (2007, p. 46-47).
Validity
Quite obviously, the right predictors must be included in the model in order to learn something from the model. The “right” predictors means: avoiding the wrong ones, and including the correct ones. Easier said than done, particularly with a look to the causal inference aspects. Let’s turn to the next most important assumption.
Additivity and linearity as the second most important assumptions in linear models
We assume that \(y\) is a linear function of the predictors. If y is not a linear function of the predictors, we cannot expect the model to deliver correct insights (predictions, causal coefficients). Let’s check an example.
Simulate an exponentially distributed assocation
We will only use positive values, let’s add some small value to the y’s in order they are all positive.
len <- 42 # 42 x values
set.seed(42)
x <- rep(runif(len), 30) # each x value repeated 30 times
y <- dexp(x, rate = 5) + rnorm(length(x), mean = 0, sd = .1) # add some noise
y <- y + 1
gf_point(y ~ x)
Linear model
Compute the Model as linear model (not transformed)
lm1 <- lm(y ~ x)
coef(lm1)
#> (Intercept) x
#> 3.797730 -3.458985
Plot it
gf_point(y ~ x) %>%
gf_abline(slope = coef(lm1)[2], intercept = coef(lm1)[1], color = "red")
Doesn’t fit well.
Check the linearity assumption
Actually the plot above vividly shows us that the linear model is not doing a good job. But anyhow, let’s put that in a form more typically used for checking model assumptions.
gf_point(lm1$residuals ~ fitted(lm1)) %>%
gf_smooth() %>%
gf_lims(y = c(-3, 3))
If we had a linear trend, we should see no strong pattern whatsoever. The mean residual should jump around zero at each value of the x-axis, with the variance remaining (more or less) constant. This is not the case here.
Second model: log-tranformed in y
gf_point(log(y) ~ x)
lm2 <- lm(log(y) ~ x)
coef(lm2)
#> (Intercept) x
#> 1.331698 -1.556101
gf_point(log(y) ~ x) %>%
gf_abline(slope = coef(lm2)[2], intercept = coef(lm2)[1], color = "red")
Quite ok. Note that the discrepancies stem completely from the fact that we added some Gaussian noise.
gf_point(resid(lm2) ~ fitted(lm2)) %>%
gf_smooth() %>%
gf_lims(y = c(-3, 3))
Much better than the first model.


Summary
This case study will cover two different phases/builds of BlocJams. The languages for each phase are listed below:
- Phase 1: HTML, CSS, JS, JQuery & DOM Scripting
- Phase 2: Refactor & Rebuild Phase 1 using Angular JS Version 1 framework
BlocJams is a Spotify inspired music application. This was the first project assigned to me in the Bloc curriculum. The second project was to rebuild the same BlocJams from the ground up using AngularJS framework. The project(s) served as a means to strengthen HTML5, CSS & JS skills, while introducing me to new tools including JQuery, DOM Scripting, AngularJS & many of its associated tools.
Problem
The goal of this project was to build a web app to play selected music files. The greatest challenge of building this was styling and constructing the application so it could handle an unknown quantity of albums and songs.
Phase 1:
Solution
The cleanest way to have the app sort through all the content was to create templates for each item and have JS, DOM scripts, and Jquery selectors loop and display the files/information. HTML & CSS code was able to list the content, but the previously mentioned tools were necessary to sort/select/change and play files.
Results
By integrating HTML5, CSS, JS, JQuery and more, I was able to construct a fully functional landing page, the album collections, and the page with the music player.
Each page displays a linked logo in the top left, and the collection link in the top-right corner.
Landing Page
The landing page has a large photo and some selling points listed across the bottom of the page. The slogan “Turn the music up!” is visible in the center.
Album Collection
The album collection page will list as many albums as the collection holds.
Music Player
This page performs the core of this application. By clicking on the song or the play button itself, the user has full control of the player and album library.
Phase 2:
Solution
For this version I utilized the AngularJS (Version 1) framework to build the app. Angular allowed me to build this SPA(single-page-app) to reduce transition time when switching around the program. I built the BlocJams module and bootstrapped it to the application. In this context, bootstrapping is initializing the Angular application. The module contained controllers and their injected services which helped display content and control actions taken upon user requests. All of the AngularJS functionality was accessible through directives which were placed into the HTML elements throughout the application. To navigate the application, a UI-Router module was used. This module is injected into the application, and it uses Providers to configure the application’s paths.
Results
Users interact through the MVC and have full control over the application. They can sort through the full collection of music. A new feature in this Phase is the player-bar as seen in the image below. The high z-index of the player bar tool allows users to see the song info & status update live regardless of the page that they are on. Angular’s Single Page Application ability allow for quicker navigation between application views.
Project Conclusions
The two portions of BlocJams were great learning tools. Phase 1 gave me more experience writing Vanilla JS, HTML & CSS, and then refactoring DOM Scripts using JQuery. Phase 2 Phase 2 helped me to understand when and why a JS Framework makes sense for an application.
- For basic DOM manipulations, JQuery & VanillaJS should suffice and seem to be cleaner but offer less capabilities than Angular does...
- AngularJS provides the ability to hook functionality directly into an HTML element, removing the need for query the DOM with a selector. Angular also allows for two-way data binding, offering the option of dynamic data in the application.


A B C D E F G H I L M N O P Q R S T U V W
All Classes All Packages
All Classes All Packages
All Classes All Packages
A
- A_STAR_WITH_CUSTOM_HEAP_AND_1D_DISTANCES_ARRAY - search_algorithm.AlgorithmCodeKey
- A_STAR_WITH_CUSTOM_HEAP_AND_2D_DISTANCES_ARRAY - search_algorithm.AlgorithmCodeKey
- A_STAR_WITH_PRE_MADE_HEAP_AND_1D_DISTANCES_ARRAY - search_algorithm.AlgorithmCodeKey
- A_STAR_WITH_PRE_MADE_HEAP_AND_2D_DISTANCES_ARRAY - search_algorithm.AlgorithmCodeKey
- add(T) - Method in class model.structure.custom_structure.CustomHashSet
-
Adds param to set if doesn't exist.
- add(T) - Method in class model.structure.custom_structure.CustomHashSetDynamicSize
-
Adds param to set if doesn't exist.
- add(T) - Method in class model.structure.pre_made_structure.PreMadeUniqueSet
-
Same as HashSet add
- add(T) - Method in interface model.structure.structure_interface.UniqueSet
-
Adds t to list if such element does not already exist inside set
- ALGORITHM_IMPL - file_operations.common.ReportMetaFileKey
- ALGORITHM_NAME - file_operations.common.ReportMetaFileKey
- ALGORITHM_NAME - model.report.ReportCodeKey
- AlgorithmCodeKey - Enum in search_algorithm
-
Map between easily readable algorithm implementation types and their codes.
- AnalysableAlgorithm - Class in search_algorithm
-
Base class for an algorithm that does all the ground work for preparing and writing analysis file.
- AnalysableAlgorithm(AnalysisWriter, String) - Constructor for class search_algorithm.AnalysableAlgorithm
-
sets given analysis writer instantiates itself
- ANALYSIS - file_operations.common.Template
- ANALYSIS_AS_A_TABLE_ROW - file_operations.common.Template
- AnalysisCollector - Class in file_operations.analysis_overview
-
Collector to collect all metadata aka ReportMeta from existing reports in /maps folder
- AnalysisCollector() - Constructor for class file_operations.analysis_overview.AnalysisCollector
-
Collector to collect all metadata aka ReportMeta from existing reports in /maps folder
- AnalysisInspector - Class in file_operations.analysis_overview
-
Creates statistics on reports that are divided by map and saves results divided by map directories.
- AnalysisInspector() - Constructor for class file_operations.analysis_overview.AnalysisInspector
- AnalysisOverviewWriter - Class in file_operations.analysis_overview
-
Statistic file writer using folloring templates overview-template.md and overview-algorithm-row.md to write statistic overviews.
- AnalysisOverviewWriter() - Constructor for class file_operations.analysis_overview.AnalysisOverviewWriter
- AnalysisReader - Class in file_operations.analysis_overview
-
Reader to load relevant data of report as ReportMeta object.
- AnalysisReader() - Constructor for class file_operations.analysis_overview.AnalysisReader
- AnalysisWriter - Class in file_operations.analysis_writer
-
A file writer that uses report-template.md to write an analysis at root level.
- AnalysisWriter() - Constructor for class file_operations.analysis_writer.AnalysisWriter
- app - package app
- App - Class in app
-
Main program that consists of three parts.
- App(Scanner, AnalysisWriter) - Constructor for class app.App
-
Sets up app to be ready to run.
- areValidFileNames(String[]) - Static method in class system_tools.LegalFileName
- ARRAY_1D - model.structure.structure_type_enum.DistanceMapType
- ARRAY_2D - model.structure.structure_type_enum.DistanceMapType
- AStar - Class in search_algorithm
-
classic A*
- AStar(AnalysisWriter, HeapType, DistanceMapType) - Constructor for class search_algorithm.AStar
-
classic A* that extends AnalysableAlgorithm so it handles report writing.
All Classes All Packages


Languages: English • Français • Hrvatski • Italiano • 日本語 • Nederlands • Português do Brasil • Русский • (Add your language)
It's super easy to embed videos, images, tweets, audio, and other content into your WordPress site. This feature was added in WordPress 2.9 [1]
To embed a video or another object into a post or page, place its URL into the content area. Make sure the URL is on its own line and not hyperlinked (clickable when viewing the post).
For example:
Check out this cool video: http://www.youtube.com/watch?v=dQw4w9WgXcQ That was a cool video.
WordPress will automatically turn the URL into a YouTube embed and provide a live preview in the visual editor.
Another option is to wrap the URL in the [embed] Shortcode.
[embed width="123" height="456"]http://www.youtube.com/watch?v=dQw4w9WgXcQ[/embed]
If WordPress fails to embed the URL, the post will contain a hyperlink to the URL.
The easy embedding feature is mostly powered by oEmbed, a protocol for site A (such as your blog) to ask site B (such as YouTube) for the HTML needed to embed content from site B.
oEmbed was designed to avoid the need to copy and paste HTML from the site hosting the media you wish to embed. It supports videos, images, text, and more.
No, not by default. WordPress will only embed URLs matching an internal whitelist. This is for security purposes.
You can use all of these:
Notes
Adding support for an additional website depends on whether the site supports oEmbed.
If a site supports oEmbed, you'll want to call wp_oembed_add_provider() to add the site and URL format to the internal whitelist.
You'll need to register a handler using wp_embed_register_handler() and provide a callback function that generates the HTML.
If you wish to remove an oEmbed-enabled provider, you'll want to call wp_oembed_remove_provider.
As of version 4.4, WordPress supports oEmbed discovery, but has severe limitations on what type of content can be embedded via non-whitelisted sites.
Specifically, the HTML and Video content is filtered to only allow links, blockquotes, and iframes, and these are additionally filtered to prevent insertion of malicious content. The HTML is then modified to be sandboxed and to have additional security restrictions placed on them as well.
However, if you feel you are knowledgeable enough to not require this level of safety, you can give unfiltered_html
users (Administrators and Editors) the ability to embed from websites that have oEmbed discovery tags in their <head>
. You merely need to install Enable oEmbed Discovery plugin. This is generally not recommended.
The oEmbed discovery content for "link" and "photo" types is not quite so heavily filtered in this manner, however it is properly escaped for security and to prevent any malicious content from being displayed on the site.


Counting summation of numbers till<PHONE_NUMBER>0
=
0
Counting numbers can be divided with 13 till<PHONE_NUMBER>0
=
0
Counting numbers can be divided with 3 till<PHONE_NUMBER>0
=
0


Use the web property of the ClientContext class to specify the properties of the website object that is located at the specified context URL. After you load the website object through the load(clientObject) method and then call executeQueryAsync(succeededCallback, failedCallback), you acquire access to all the properties of that website. The following example displays the title and description of the specified website, although all other properties that are returned by default become available after you load the website object and execute the query. View code
Retrieve only selected properties of a website
To reduce unnecessary data transference between client and server, you might want to return only specified properties of the website object, not all of its properties. In this case, use LINQ query or lambda expression syntax with the load(clientObject) method to specify which properties to return from the server. In the following example, only the title and creation date of the website object become available after executeQueryAsync(succeededCallback, failedCallback) is called. View code
Write to a website's properties
To modify a website, you set its properties and call the update() method, similarly to how the server object model functions. However, in the client object model, you must call executeQuery(succeededCallback, failedCallback) to request batch processing of all commands that you specify. The following example changes the title and description of a specified website. View code
List tasks
Retrieve properties of all lists in a website
To return all the lists of a website, load the list collection through the load(clientObject) method, and then call executeQueryAsync(succeededCallback, failedCallback). The following example displays the URL of the website and the date and time that the list was created. View code
Retrieve only specified properties of lists
The previous example returns all properties of the lists in a website. To reduce unnecessary data transference between client and server, you can use LINQ query expressions to specify which properties to return. In JavaScript, you specify Include as part of the query string that is passed to the load(clientObject) method to specify which properties to return. The following example uses this approach to return only the title and ID of each list in the collection. View code
Store retrieved lists in a collection
As seen in the following example, you can use the loadQuery(clientObjectCollection, exp) method instead of the load(clientObject) method to store the return value in another collection instead of storing it in the lists property. View code
Apply filters to list retrieval
As the following example shows, you can nest Include statements in a JavaScript query to return metadata for both a list and its fields. The example returns all fields from all lists within a website and displays the title and internal name of all fields whose internal name contains the string "name". View code
Create, update and delete lists
Create a list
To create a list object using JavaScript, use the ListCreationInformation object to define its properties, and then pass this object to the add(parameters) function of the ListCollection object. The following example creates a new announcements list. View code
Update a list
If you need to update the list after it has been created, you can set list properties and call the update() function before calling executeQueryAsync(succeededCallback, failedCallback), as shown in the following modifications of the previous example. View code
Add a field to a list
Use the add(field) or addFieldAsXml(schemaXml, addToDefaultView, options) function of the FieldCollection object to add a field to the field collection of a list. The following example creates a field and then updates it before calling executeQueryAsync(succeededCallback, failedCallback). View code
Delete a list
To delete a list, call the deleteObject() function of the list object, as shown in the following example. View code
Create, update and delete folders
Create a folder
To create folders, you create a ListItemCreationInformation object, set the underlying object type to SP.FileSystemObjectType.folder and pass it as parameter to the addItem(parameters) function of the List object. Set properties on the list item object that this method returns, and then call the update() function, as seen in the following example. View code
Update a folder
To update the folder name, you can write to the FileLeafRef property, and call the update() function so that changes will take effect when you call executeQueryAsync(succeededCallback, failedCallback). View code
Delete a folder
To delete a folder, call the deleteObject() function on the object. The following example uses the getItemById(id) function to return the first item from the document library, and then deletes the item. View code
List item tasks
Retrieve items from a list
The getItems(query) function enables you to define a Collaborative Application Markup Language (CAML) query that specifies which items to return. You can pass an undefined CamlQuery object to return all items from the list, or use the set_viewXml function to define a CAML query and return items that meet specific criteria. The following example displays the ID, in addition to the Title and Body column values, of the first 100 items in the Announcements list, starting with list items whose collection ID is greater than 10. View code
Use the Include method to access properties of ListItem objects
Four properties of ListItem objects are not available by default when you return list items—displayName, effectiveBasePermissions, hasUniqueRoleAssignments, and roleAssignments. The previous example returns a PropertyOrFieldNotInitializedException if you try to access one of these properties. To access these properties, use the Include method as part of the query string, as shown in the following example. View code
Create, update and delete list items
Create a list item
To create list items, you create a ListItemCreationInformation object, set its properties, and pass it as parameter to the addItem(parameters) function of the List object. Set properties on the list item object that this method returns, and then call the update() function, as seen in the following example. View code
Update a list item
To set most list item properties, you can use a column indexer to make an assignment, and call the update() function so that changes will take effect when you call executeQueryAsync(succeededCallback, failedCallback). The following example sets the title of an item in the Announcements list. View code
Delete a list item
To delete a list item, call the deleteObject() function on the object. The following example uses the getItemById(id) function to return the an item from the list, and then deletes the item. SharePoint maintains the integer IDs of items within collections, even if they have been deleted. So, for example, the second item in a list might not have 2 as its identifier. A ServerException is returned if the deleteObject() function is called for an item that does not exist. View code


“Pubbe hanati attānaṁ,
pacchā hanati so pare;
Suhataṁ hanti attānaṁ,
vītaṁseneva pakkhimā.
First one kills oneself,
then one kills others.

Na brāhmaṇo bahivaṇṇo,
anto vaṇṇo hi brāhmaṇo;
Yasmiṁ pāpāni kammāni,
sa ve kaṇho sujampatī”ti.
…
Vasabho thero ….
vaggo paṭhamo.
Tassuddānaṁ
A holy man’s color is not on the outside;
a holy man is colored on the inside.
Whoever harbors bad deeds
is truly a dark one, Sujampati.
Uttaro ceva piṇḍolo,
valliyo tīriyo isi;
Ajino ca meḷajino,
rādho surādho gotamo;
Vasabhena ime honti,
dasa therā mahiddhikāti.


Developer veteran, hacker & extreme eye for detail.
The lord of the agency, genius & problem solving expert.


Time:
[Fullscreen]
[Download]
[Upload]
[New]
[Server IP]
[Notes]
[Save]
[Save As]
IP Address:
[Close]
[Save]
[Close]
[Delete]
[Load]
Filename:
[Close]
[Save]


|
|
| spsc_buffer (uint32_t capacity, uint32_t min_pull_size) |
| |
| size_t | push (span< const T > items) |
| | Appends to the buffer and calls on_producer_wakeup on the consumer if the buffer becomes non-empty.
|
| |
|
size_t | push (const T &item) |
| |
| template<class Policy , class Observer > |
| std::pair< bool, size_t > | pull (Policy policy, size_t demand, Observer &dst) |
| | Consumes up to demand items from the buffer.
|
| |
|
bool | has_data () const noexcept |
| | Checks whether there is any pending data in the buffer.
|
| |
|
bool | has_consumer_event () const noexcept |
| | Checks whether the there is data available or whether the producer has closed or aborted the flow.
|
| |
| size_t | available () const noexcept |
| | Returns how many items are currently available.
|
| |
|
error | abort_reason () const |
| | Returns the error from the producer or a default-constructed error if abort was not called yet.
|
| |
|
void | close () |
| | Closes the buffer by request of the producer.
|
| |
|
void | abort (error reason) |
| | Closes the buffer by request of the producer and signals an error to the consumer.
|
| |
|
void | cancel () |
| | Closes the buffer by request of the consumer.
|
| |
|
void | set_consumer (consumer_ptr consumer) |
| | Consumer callback for the initial handshake between producer and consumer.
|
| |
|
void | set_producer (producer_ptr producer) |
| | Producer callback for the initial handshake between producer and consumer.
|
| |
|
size_t | capacity () const noexcept |
| | Returns the capacity as passed to the constructor of the buffer.
|
| |
|
auto & | mtx () const noexcept |
| | Returns the mutex for this object.
|
| |
| size_t | available_unsafe () const noexcept |
| | Returns how many items are currently available.
|
| |
| const error & | abort_reason_unsafe () const noexcept |
| | Returns the error from the producer.
|
| |
| void | await_consumer_ready (lock_type &guard, std::condition_variable &cv) |
| | Blocks until there is at least one item available or the producer stopped.
|
| |
| template<class TimePoint > |
| bool | await_consumer_ready (lock_type &guard, std::condition_variable &cv, TimePoint timeout) |
| | Blocks until there is at least one item available, the producer stopped, or a timeout occurs.
|
| |
|
template<class Policy , class Observer > |
| std::pair< bool, size_t > | pull_unsafe (lock_type &guard, Policy, size_t demand, Observer &dst) |
| |
|
| atomic_ref_counted (const atomic_ref_counted &) |
| |
|
atomic_ref_counted & | operator= (const atomic_ref_counted &) |
| |
|
void | ref () const noexcept |
| | Increases reference count by one.
|
| |
|
void | deref () const noexcept |
| | Decreases reference count by one and calls request_deletion when it drops to zero.
|
| |
|
bool | unique () const noexcept |
| | Queries whether there is exactly one reference.
|
| |
|
size_t | get_reference_count () const noexcept |
| | Queries the current reference count for this object.
|
| |
template<class T>
class caf::async::spsc_buffer< T >
A Single Producer Single Consumer buffer.
The buffer uses a "soft bound", which means that the producer announces a desired maximum for in-flight items that the buffer uses for its bookkeeping, but the producer may add more than that number of items. Allowing producers to go "beyond the limit" is intended for producer that transform inputs into outputs where one input event can produce multiple output items.
Aside from providing storage, this buffer also resumes the consumer if data is available and signals demand to the producer whenever the consumer takes data out of the buffer.


Home
Dashboard
Stock API
Resources
Stock Quote Search
1. Type in the Stock Symbol in the search box and click on Search
2. A JSON object string of the Stock's Quote will display as a result
3. Copy the JSON object string for your own use!
Search


Archii considers a document a high GDPR risk if either a CPR number or sensitive keyword is found in it.
Ulrik
Jens
Lars<PHONE_NUMBER>01)