|
Mini51 BSP
V3.02.002
The Board Support Package for Mini51 Series
|
#include <Mini51Series.h>
Data Fields | |
| __IO uint32_t | CNTRL |
| __IO uint32_t | DIVIDER |
| __IO uint32_t | SSR |
| __I uint32_t | RX |
| __O uint32_t | TX |
| __IO uint32_t | CNTRL2 |
| __IO uint32_t | FIFO_CTL |
| __IO uint32_t | STATUS |
@addtogroup SPI Serial Peripheral Interface Controller(SPI) Memory Mapped Structure for SPI Controller
Definition at line 7300 of file Mini51Series.h.
| SPI_T::CNTRL |
| Bits | Field | Descriptions |
| [0] | GO_BUSY | SPI Transfer Control Bit And Busy Status
If FIFO mode is enabled, this bit will be controlled by hardware and is Read only. If FIFO mode is disabled, during the data transfer, this bit keeps the value of 1. As the transfer is finished, this bit will be cleared automatically. 0 = Writing 0 to this bit to stop data transfer if SPI is transferring. 1 = In Master mode, writing 1 to this bit to start the SPI data transfer; in Slave mode, writing 1 to this bit indicates that the slave is ready to communicate with a master. Note 1: When FIFO mode is disabled, all configurations should be ready before writing 1 to the GO_BUSY bit. Note 2: In SPI Slave mode, if FIFO mode is disabled and the SPI bus clock is kept at idle state during a data transfer, the GO_BUSY bit will not be cleared to 0 when slave select signal goes to inactive state. |
| [1] | RX_NEG | Receive On Negative Edge
0 = The received data input signal latched on the Rising edge of SPICLK. 1 = The received data input signal latched on the Falling edge of SPICLK. |
| [2] | TX_NEG | Transmit On Negative Edge
0 = The transmitted data output signal is driven on the Rising edge of SPICLK. 1 = The transmitted data output signal is driven on the Falling edge of SPICLK. |
| [7:3] | TX_BIT_LEN | Transmit Bit Length
This field specifies how many bits are transmitted in one transmit/receive. The minimum bit length is 8 bits and can up to 32 bits. TX_BIT_LEN = 0x08 ... 8 bits. TX_BIT_LEN = 0x09 ... 9 bits. ..... TX_BIT_LEN = 0x1F ... 31 bits. TX_BIT_LEN = 0x00 ... 32 bits. |
| [10] | LSB | LSB First
0 = The MSB is transmitted/received first. 1 = The LSB is transmitted/received first. |
| [11] | CLKP | Clock Polarity
0 = SPICLK idle low. 1 = SPICLK idle high. |
| [15:12] | SP_CYCLE | Suspend Interval (Master Only)
The four bits provide configurable suspend interval between two successive transactions in a transfer. The definition of the suspend interval is the interval between the last clock edge of the preceding transaction word and the first clock edge of the following transaction word. The default value is 0x3. The period of the suspend interval is obtained according to the following equation: (SP_CYCLE[3:0] + 0.5) * period of SPICLK clock cycle Example: SP_CYCLE = 0x0 ... 0.5 SPICLK clock cycle. SP_CYCLE = 0x1 ... 1.5 SPICLK clock cycle. ..... SP_CYCLE = 0xE ... 14.5 SPICLK clock cycle. SP_CYCLE = 0xF ... 15.5 SPICLK clock cycle. |
| [16] | IF | Unit-transfer Interrupt Flag
0 = The transfer does not finish yet. 1 = The SPI controller has finished one unit transfer. Note 1: This bit will be cleared by writing 1 to itself. Note 2: It's a mutual mirror bit of SPI_STATUS[16]. |
| [17] | IE | Unit-transfer Interrupt Enable Control
0 = SPI unit-transfer interrupt Disabled. 1 = SPI unit-transfer interrupt Enabled. |
| [18] | SLAVE | Slave Mode Control
0 = Master mode. 1 = Slave mode. |
| [19] | REORDER | Byte Reorder Function
0 = Byte reorder function Disabled. 1 = Byte reorder function Enabled. Note: This setting is only available if TX_BIT_LEN is defined as 16, 24, and 32 bits. |
| [21] | FIFO | FIFO Mode Enable Control
0 = FIFO Mode Disabled. 1 = FIFO Mode Enabled. Note 1: Before enabling FIFO mode, the other related settings should be set in advance. Note 2: In Master mode, if the FIFO mode is enabled, the GO_BUSY bit will be set to 1 automatically after writing data into the 4-depth transmit FIFO. When all data stored at transmit FIFO buffer are transferred, the GO_BUSY bit will back to 0. |
| [24] | RX_EMPTY | Receive FIFO Buffer Empty Indicator (Read Only)
0 = The receive FIFO buffer is not empty. 1 = The receive FIFO buffer is empty. Note: It's a mutual mirror bit of SPI_CNTRL[24]. |
| [25] | RX_FULL | Receive FIFO Buffer Full Indicator (Read Only)
0 = The receive FIFO buffer is not full. 1 = The receive FIFO buffer is full. Note: It's a mutual mirror bit of SPI_STATUS[25] |
| [26] | TX_EMPTY | Transmit FIFO Buffer Empty Indicator (Read Only)
0 = The transmit FIFO buffer is not empty. 1 = The transmit FIFO buffer is empty. Note: It's a mutual mirror bit of SPI_STAUTS[26]. |
| [27] | TX_FULL | Transmit FIFO Buffer Full Indicator (Read Only)
0 =The transmit FIFO buffer is not full. 1 =The transmit FIFO buffer is full. Note: It's a mutual mirror bit of SPI_STATUS[27]. |
Definition at line 7909 of file Mini51Series.h.
| SPI_T::CNTRL2 |
| Bits | Field | Descriptions |
| [8] | NOSLVSEL | Slave 3-wire Mode Enable Control (Slave Only)
The SPI controller work with 3-wire interface including SPICLK, SPI_MISO, and SPI_MOSI 0 = The controller is 4-wire bi-direction interface. 1 = The controller is 3-wire bi-direction interface in Slave mode. The controller will be ready to transmit/receive data after the GO_BUSY bit is set to 1. Note: In Slave 3-wire mode, the SS_LTRIG bit (SPI_SSR[4]) shall be set as 1. |
| [9] | SLV_ABORT | Slave 3-wire Mode Abort Control Bit (Slave Only)
In normal operation, there is an interrupt event when the number of received bits meets the requirement which defined in TX_BIT_LEN. If the number of received bits is less than the requirement and there is no more bus clock input over one transfer time in Slave 3-wire mode, user can set this bit to force the current transfer done and then user can get a unit transfer interrupt event. 0 = No force the transfer done when the NOSLVSEL bit is set to 1. 1 = Force the transfer done when the NOSLVSEL bit is set to 1. Note: This bit will be cleared to 0 automatically by hardware after it is set to 1 by software. |
| [10] | SSTA_INTEN | Slave 3-wire Mode Start Interrupt Enable Control (Slave Only)
It is used to enable interrupt when the transfer has started in slave 3-wire mode. If there is no transfer done interrupt over the time period which is defined by user after the transfer start, user can set the SLV_ABORT bit to force the transfer done. 0 = Transaction start interrupt Disabled. 1 = Transaction start interrupt Enabled. Note: It will be cleared to 0 as the current transfer is done or the SLV_START_INTSTS bit is cleared to 0. |
| [11] | SLV_START_INTSTS | Slave 3-wire Mode Start Interrupt Status (Slave Only)
This bit dedicates if a transaction has started in slave 3-wire mode. 0 = Slave does not detect any SPI bus clock transfer since the SSTA_INTEN bit was set to 1. 1 = The transfer has started in slave 3-wire mode. Note 1: It will be cleared automatically when a transaction is done or by writing 1 to this bit. Note 2: It is a mutual mirror bit of SPI_STATUS[11]. |
| [16] | SS_INT_OPT | Slave Select Inactive Interrupt Option (Slave Only)
0 = As the slave select signal goes to inactive level, the IF bit will NOT be set to 1. 1 = As the slave select signal goes to inactive level, the IF bit will be set to 1. Note: This setting is only available if the SPI controller is configured as level trigger in slave device. |
| [31] | BCn | Clock Configuration Backward Compatible Option
0 = The clock configuration is backward compatible. 1 = The clock configuration is not backward compatible. Note: Refer to the description of SPI_DIVIDER register for details. |
Definition at line 7923 of file Mini51Series.h.
| SPI_T::DIVIDER |
| Bits | Field | Descriptions |
| [7:0] | DIVIDER | Clock Divider Bits (Master Only)
The value in this field is the frequency divider to determine the SPI peripheral clock frequency fspi, and the SPI master's bus clock frequency on the SPICLK output pin. The frequency is obtained according to the following equation: If the bit of BCn, SPI_CNTRL2[31], is set to 0. else if BCn is set to 1, where is the SPI peripheral clock source which is defined in the CLKSEL1 register. |
Definition at line 7910 of file Mini51Series.h.
| SPI_T::FIFO_CTL |
| Bits | Field | Descriptions |
| [0] | RX_CLR | Clear Receive FIFO Buffer
0 = No effect. 1 = Clear receive FIFO buffer. Note: This bit will be cleared to 0 by hardware after software sets it to 1 and the receive FIFO is cleared. |
| [1] | TX_CLR | Clear Transmit FIFO Buffer
0 = No effect. 1 = Clear transmit FIFO buffer. Note: This bit will be cleared to 0 by hardware after software sets it to 1 and the transmit FIFO is cleared. |
| [2] | RX_INTEN | Receive Threshold Interrupt Enable Control
0 = Receive threshold interrupt Disabled. 1 = Receive threshold interrupt Enabled. |
| [3] | TX_INTEN | Transmit Threshold Interrupt Enable Control
0 = Transmit threshold interrupt Disabled. 1 = Transmit threshold interrupt Enabled. |
| [6] | RXOV_INTEN | Receive FIFO Overrun Interrupt Enable Control
0 = Receive FIFO overrun interrupt Disabled. 1 = Receive FIFO overrun interrupt Enabled. |
| [21] | TIMEOUT_INTEN | Receive FIFO Time-out Interrupt Enable Control
0 = Time-out interrupt Disabled. 1 = Time-out interrupt Enabled. |
| [25:24] | RX_THRESHOLD | Received FIFO Threshold
If the valid data count of the receive FIFO buffer is larger than the RX_THRESHOLD setting, the RX_INTSTS bit will be set to 1, else the RX_INTSTS bit will be cleared to 0. |
| [29:28] | TX_THRESHOLD | Transmit FIFO Threshold
If the valid data count of the transmit FIFO buffer is less than or equal to the TX_THRESHOLD setting, the TX_INTSTS bit will be set to 1, else the TX_INTSTS bit will be cleared to 0. |
Definition at line 7924 of file Mini51Series.h.
| SPI_T::RX |
| Bits | Field | Descriptions |
| [31:0] | RX | Data Receive Bits (Read Only)
The Data Receive Registers hold the value of received data of the last executed transfer. Valid bits depend on the transmit bit length field in the SPI_CNTRL register. For example, if TX_BIT_LEN is set to 0x08, bit RX [7:0] holds the received data. The values of the other bits are unknown. |
Definition at line 7915 of file Mini51Series.h.
| SPI_T::SSR |
| Bits | Field | Descriptions |
| [0] | SSR | Slave Select Control Bit (Master Only)
If AUTOSS bit is 0, 0 = Set the SPISS line to inactive state. 1 = Set the proper SPISS line to active state. If AUTOSS bit is 1, 0 = Keep the SPISS line at inactive state. 1 = Select the SPISS line to be automatically driven to active state for the duration of transmission/reception, and will be driven to inactive state for the rest of the time. The active state of SPISS is specified in SS_LVL bit. |
| [2] | SS_LVL | Slave Select Active Level (Slave Only)
It defines the active status of slave select signal (SPISS). If SS_LTRIG bit is 1: 0 = The slave select signal SPISS is active at Low-level. 1 = The slave select signal SPISS is active at High-level. If SS_LTRIG bit is 0: 0 = The slave select signal SPISS is active at Falling-edge. 1 = The slave select signal SPISS is active at Rising-edge. |
| [3] | AUTOSS | Automatic Slave Selection Function Enable Bit (Master Only)
0 = SPISS pin signal will be asserted/de-asserted by setting /clearing SSR bit. 1 = SPISS pin signal will be generated automatically, which means that slave select signal will be asserted by the SPI controller when transmit/receive is started by setting GO_BUSY, and will be de-asserted after each transmit/receive is finished. |
| [4] | SS_LTRIG | Slave Select Level Trigger Enable Bit (Slave Only)
0 = The input slave select signal is edge-trigger. 1 = The input slave select signal is level-trigger. |
| [5] | LTRIG_FLAG | Level Trigger Flag (Read Only, Slave Only)
When the SS_LTRIG bit is set in Slave mode, this bit can be read to indicate the received bit number is met the requirement or not. 0 = The transaction number or the transferred bit length of one transaction does not meet the specified requirements. 1 = The transaction number and the transferred bit length met the specified requirements which defined in TX_BIT_LEN. |
Definition at line 7911 of file Mini51Series.h.
| SPI_T::STATUS |
| Bits | Field | Descriptions |
| [0] | RX_INTSTS | Receive FIFO Threshold Interrupt Status (Read Only)
0 = The valid data count within the Rx FIFO buffer is smaller than or equal to the setting value of RX_THRESHOLD. 1 = The valid data count within the receive FIFO buffer is larger than the setting value of RX_THRESHOLD. Note: If RX_INTEN = 1 and RX_INTSTS = 1, the SPI controller will generate a SPI interrupt request. |
| [2] | RX_OVERRUN | Receive FIFO Overrun Status
When the receive FIFO buffer is full, the follow-up data will be dropped and this bit will be set to 1. 0 = No overrun in receive FIFO. 1 = Overrun in receive FIFO. Note: This bit will be cleared by writing 1 to itself. |
| [4] | TX_INTSTS | Transmit FIFO Threshold Interrupt Status (Read Only)
0 = The valid data count within the transmit FIFO buffer is larger than the setting value of TX_THRESHOLD. 1 = The valid data count within the transmit FIFO buffer is less than or equal to the setting value of TX_THRESHOLD. Note: If TX_INTEN = 1 and TX_INTSTS = 1, the SPI controller will generate a SPI interrupt request. |
| [11] | SLV_START_INTSTS | Slave Start Interrupt Status (Slave Only)
It is used to dedicate that the transfer has started in slave 3-wire mode. 0 = Slave does not detect any SPI bus clock transfer since the SSTA_INTEN bit was set to 1. 1 = The transfer has started in slave 3-wire mode. Note 1: It will be cleared as transfer done or by writing one to this bit. Note 2: It's a mutual mirror bit of SPI_CNTRL2[11]. |
| [15:12] | RX_FIFO_COUNT | Receive FIFO Data Count (Read Only)
Indicates the valid data count of receive FIFO buffer. |
| [16] | IF | SPI Unit-transfer Interrupt Flag
0 = The transfer does not finish yet. 1 = The SPI controller has finished one unit transfer. Note 1: This bit will be cleared by writing 1 to itself. Note 2: It's a mutual mirror bit of SPI_CNTRL[16]. |
| [20] | TIMEOUT | Time-out Interrupt Flag
0 = No receive FIFO time-out event. 1 = The receive FIFO buffer is not empty and it does not be read over 64 SPI clock periods in Master mode or over 576 SPI peripheral clock periods in Slave mode. When the received FIFO buffer is read by software, the time-out status will be cleared automatically. Note: This bit will be cleared by writing 1 to itself. |
| [24] | RX_EMPTY | Receive FIFO Buffer Empty Indicator (Read Only)
0 = The receive FIFO buffer is not empty. 1 = The receive FIFO buffer is empty. Note: It's a mutual mirror bit of SPI_CNTRL[24]. |
| [25] | RX_FULL | Receive FIFO Buffer Full Indicator (Read Only)
0 = The receive FIFO buffer is not full. 1 = The receive FIFO buffer is full. Note: It's a mutual mirror bit of SPI_CNTRL[25]. |
| [26] | TX_EMPTY | Transmit FIFO Buffer Empty Indicator (Read Only)
0 = The transmit FIFO buffer is not empty. 1 = The transmit FIFO buffer is empty. Note: It's a mutual mirror bit of SPI_CNTRL[26]. |
| [27] | TX_FULL | Transmit FIFO Buffer Full Indicator (Read Only)
0 = The transmit FIFO buffer is not full. 1 = The transmit FIFO buffer is full. Note: It's a mutual mirror bit of SPI_CNTRL[27]. |
| [31:28] | TX_FIFO_COUNT | Transmit FIFO Data Count (Read Only)
Indicates the valid data count of transmit FIFO buffer. |
Definition at line 7925 of file Mini51Series.h.
| SPI_T::TX |
| Bits | Field | Descriptions |
| [31:0] | TX | Data Transmit Bits (Write Only)
The Data Transmit Registers hold the data to be transmitted in the next transfer. Valid bits depend on the transmit bit length field in the CNTRL register. For example, if TX_BIT_LEN is set to 0x08, the bit TX [7:0] will be transmitted in next transfer. |
Definition at line 7919 of file Mini51Series.h.


IN THIS WEBSITE WE PROVIDE THE LATEST SHOES THAT ARE ORIGINAL MADE BY DIFFERENT COMPANIES AROUND THE WORLD!!!
If you want to order just call or send us an email and we will get back to you as soon as possible!
09084871551
442-1006
raymartnarcida


Parsing and producing JSON
Groovy comes with integrated support for converting between Groovy objects and JSON. The classes dedicated to
JSON serialisation and parsing are found in the groovy.json
package.
1. JsonSlurper
JsonSlurper
is a class that parses JSON text or reader content into Groovy data structures (objects) such as maps, lists and
primitive types like Integer
, Double
, Boolean
and String
.
The class comes with a bunch of overloaded parse
methods plus some special methods such as parseText
,
parseFile
and others. For the next example we will use the parseText
method. It parses a JSON String
and recursively converts it to a
list or map of objects. The other parse*
methods are similar in that they return a JSON String
but for different parameter
types.
def jsonSlurper = new JsonSlurper()
def object = jsonSlurper.parseText('{ "name": "John Doe" } /* some comment */')
assert object instanceof Map
assert object.name == 'John Doe'
Notice the result is a plain map and can be handled like a normal Groovy object instance. JsonSlurper
parses the
given JSON as defined by the ECMA-404 JSON Interchange Standard
plus support for JavaScript comments and dates.
In addition to maps JsonSlurper
supports JSON arrays which are converted to lists.
def jsonSlurper = new JsonSlurper()
def object = jsonSlurper.parseText('{ "myList": [4, 8, 15, 16, 23, 42] }')
assert object instanceof Map
assert object.myList instanceof List
assert object.myList == [4, 8, 15, 16, 23, 42]
The JSON standard supports the following primitive data types: string, number, object, true
, false
and null
. JsonSlurper
converts these JSON types into corresponding Groovy types.
def jsonSlurper = new JsonSlurper()
def object = jsonSlurper.parseText '''
{ "simple": 123,
"fraction": 123.66,
"exponential": 123e12
}'''
assert object instanceof Map
assert object.simple.class == Integer
assert object.fraction.class == BigDecimal
assert object.exponential.class == BigDecimal
As JsonSlurper
is returning pure Groovy object instances without any special JSON classes in the back, its usage
is transparent. In fact, JsonSlurper
results conform to GPath expressions. GPath is a powerful expression language
that is supported by multiple slurpers for different data formats (XmlSlurper
for XML being one example).
| For more details please have a look at the section on GPath expressions. |
The following table gives an overview of the JSON types and the corresponding Groovy data types:
| JSON | Groovy |
|---|---|
string |
|
number |
|
object |
|
array |
|
true |
|
false |
|
null |
|
date |
|
Whenever a value in JSON is null , JsonSlurper supplements it with the Groovy null value. This is in contrast to other
JSON parsers that represent a null value with a library-provided singleton object.
|
1.1. Parser Variants
JsonSlurper
comes with a couple of parser implementations. Each parser fits different requirements, it could well be that for certain
scenarios the JsonSlurper
default parser is not the best bet for all situations. Here is an overview of the shipped parser implementations:
-
The
JsonParserCharArray
parser basically takes a JSON string and operates on the underlying character array. During value conversion it copies character sub-arrays (a mechanism known as "chopping") and operates on them. -
The
JsonFastParser
is a special variant of theJsonParserCharArray
and is the fastest parser. However, it is not the default parser for a reason.JsonFastParser
is a so-called index-overlay parser. During parsing of the given JSONString
it tries as hard as possible to avoid creating new char arrays orString
instances. It keeps pointers to the underlying original character array only. In addition, it defers object creation as late as possible. If parsed maps are put into long-term caches care must be taken as the map objects might not be created and still consist of pointer to the original char buffer only. However,JsonFastParser
comes with a special chop mode which dices up the char buffer early to keep a small copy of the original buffer. Recommendation is to use theJsonFastParser
for JSON buffers under 2MB and keeping the long-term cache restriction in mind. -
The
JsonParserLax
is a special variant of theJsonParserCharArray
parser. It has similar performance characteristics asJsonFastParser
but differs in that it isn’t exclusively relying on the ECMA-404 JSON grammar. For example it allows for comments, no quote strings etc. -
The
JsonParserUsingCharacterSource
is a special parser for very large files. It uses a technique called "character windowing" to parse large JSON files (large means files over 2MB size in this case) with constant performance characteristics.
The default parser implementation for JsonSlurper
is JsonParserCharArray
. The JsonParserType
enumeration contains constants for
the parser implementations described above:
| Implementation | Constant |
|---|---|
|
|
|
|
|
|
|
|
Changing the parser implementation is as easy as setting the JsonParserType
with a call to JsonSlurper#setType()
.
def jsonSlurper = new JsonSlurper(type: JsonParserType.INDEX_OVERLAY)
def object = jsonSlurper.parseText('{ "myList": [4, 8, 15, 16, 23, 42] }')
assert object instanceof Map
assert object.myList instanceof List
assert object.myList == [4, 8, 15, 16, 23, 42]
2. JsonOutput
JsonOutput
is responsible for serialising Groovy objects into JSON strings. It can be seen as companion object to
JsonSlurper, being a JSON parser.
JsonOutput
comes with overloaded, static toJson
methods. Each toJson
implementation takes a different parameter type.
The static methods can either be used directly or by importing the methods with a static import statement.
The result of a toJson
call is a String
containing the JSON code.
def json = JsonOutput.toJson([name: 'John Doe', age: 42])
assert json == '{"name":"John Doe","age":42}'
JsonOutput
does not only support primitive, maps or list data types to be serialized to JSON, it goes further and even
has support for serialising POGOs, that is, plain-old Groovy objects.
class Person { String name }
def json = JsonOutput.toJson([ new Person(name: 'John'), new Person(name: 'Max') ])
assert json == '[{"name":"John"},{"name":"Max"}]'
2.1. Customizing Output
If you need control over the serialized output you can use a JsonGenerator
. The JsonGenerator.Options
builder
can be used to create a customized generator. One or more options can be set on this builder in order to alter
the resulting output. When you are done setting the options simply call the build()
method in order to get a fully
configured instance that will generate output based on the options selected.
class Person {
String name
String title
int age
String password
Date dob
URL favoriteUrl
}
Person person = new Person(name: 'John', title: null, age: 21, password: 'secret',
dob: Date.parse('yyyy-MM-dd', '1984-12-15'),
favoriteUrl: new URL('http://groovy-lang.org/'))
def generator = new JsonGenerator.Options()
.excludeNulls()
.dateFormat('yyyy@MM')
.excludeFieldsByName('age', 'password')
.excludeFieldsByType(URL)
.build()
assert generator.toJson(person) == '{"dob":"1984@12","name":"John"}'
A closure can be used to transform a type. These closure converters are registered for a given type and will be
called any time that type or a subtype is encountered. The first parameter to the closure is an object matching the
type for which the converter is registered and this parameter is required. The closure may take an optional second
String
parameter and this will be set to the key name if one is available.
class Person {
String name
URL favoriteUrl
}
Person person = new Person(name: 'John', favoriteUrl: new URL('http://groovy-lang.org/json.html#_jsonoutput'))
def generator = new JsonGenerator.Options()
.addConverter(URL) { URL u, String key ->
if (key == 'favoriteUrl') {
u.getHost()
} else {
u
}
}
.build()
assert generator.toJson(person) == '{"favoriteUrl":"groovy-lang.org","name":"John"}'
// No key available when generating a JSON Array
def list = [new URL('http://groovy-lang.org/json.html#_jsonoutput')]
assert generator.toJson(list) == '["http://groovy-lang.org/json.html#_jsonoutput"]'
// First parameter to the converter must match the type for which it is registered
shouldFail(IllegalArgumentException) {
new JsonGenerator.Options()
.addConverter(Date) { Calendar cal -> }
}
2.1.1. Formatted Output
As we saw in previous examples, the JSON output is not pretty printed per default. However, the prettyPrint
method in JsonOutput
comes
to rescue for this task.
def json = JsonOutput.toJson([name: 'John Doe', age: 42])
assert json == '{"name":"John Doe","age":42}'
assert JsonOutput.prettyPrint(json) == '''\
{
"name": "John Doe",
"age": 42
}'''.stripIndent()
prettyPrint
takes a String
as single parameter; therefore, it can be applied on arbitrary JSON String
instances, not only the result of
JsonOutput.toJson
.
2.2. Builders
Another way to create JSON from Groovy is to use JsonBuilder
or StreamingJsonBuilder
. Both builders provide a
DSL which allows to formulate an object graph which is then converted to JSON.
| For more details on builders, have a look at the builders chapter which covers both JsonBuilder and StreamingJsonBuilder. |


tuple-set.cc File Reference
(Revision: 7288)
#include "gecode/int.hh"
Go to the source code of this file.
Namespaces | |
| namespace | Gecode |
Function Documentation
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const Gecode::TupleSet & | ts | |||
| ) | [related] |
Definition at line 90 of file tuple-set.cc.
Variable Documentation
| int arity |
Definition at line 48 of file tuple-set.cc.
| int pos |
Definition at line 74 of file tuple-set.cc.


About
Login
Signup
Home
Signup
First Name
Last Name
Age
14
15
16
17
18
Grade
9
10
11
12
High School
Country
USA
State
Massachusetts
Interests
Business
Science
Engineering
Civics
Music
Art
Math
Coding
Journalism
Law
Username
Password


| Line | Hits | Source |
|---|---|---|
| 1 | /* | |
| 2 | * The Apache Software License, Version 1.1 | |
| 3 | * | |
| 4 | * Copyright (c) 2001-2003 The Apache Software Foundation. All rights | |
| 5 | * reserved. | |
| 6 | * | |
| 7 | * Redistribution and use in source and binary forms, with or without | |
| 8 | * modification, are permitted provided that the following conditions | |
| 9 | * are met: | |
| 10 | * | |
| 11 | * 1. Redistributions of source code must retain the above copyright | |
| 12 | * notice, this list of conditions and the following disclaimer. | |
| 13 | * | |
| 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
| 15 | * notice, this list of conditions and the following disclaimer in | |
| 16 | * the documentation and/or other materials provided with the | |
| 17 | * distribution. | |
| 18 | * | |
| 19 | * 3. The end-user documentation included with the redistribution, if | |
| 20 | * any, must include the following acknowlegement: | |
| 21 | * "This product includes software developed by the | |
| 22 | * Apache Software Foundation (http://www.apache.org/)." | |
| 23 | * Alternately, this acknowlegement may appear in the software itself, | |
| 24 | * if and wherever such third-party acknowlegements normally appear. | |
| 25 | * | |
| 26 | * 4. The names "Ant" and "Apache Software | |
| 27 | * Foundation" must not be used to endorse or promote products derived | |
| 28 | * from this software without prior written permission. For written | |
| 29 | * permission, please contact<EMAIL_ADDRESS>| |
| 30 | * | |
| 31 | * 5. Products derived from this software may not be called "Apache" | |
| 32 | * nor may "Apache" appear in their names without prior written | |
| 33 | * permission of the Apache Group. | |
| 34 | * | |
| 35 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED | |
| 36 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
| 37 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
| 38 | * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR | |
| 39 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| 40 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| 41 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | |
| 42 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |
| 43 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
| 44 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |
| 45 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
| 46 | * SUCH DAMAGE. | |
| 47 | * ==================================================================== | |
| 48 | * | |
| 49 | * This software consists of voluntary contributions made by many | |
| 50 | * individuals on behalf of the Apache Software Foundation. For more | |
| 51 | * information on the Apache Software Foundation, please see | |
| 52 | * <http://www.apache.org/>. | |
| 53 | */ | |
| 54 | package org.apache.tools.ant; | |
| 55 | ||
| 56 | /** | |
| 57 | * Used to report exit status of classes which call System.exit(). | |
| 58 | * | |
| 59 | * @see org.apache.tools.ant.util.optional.NoExitSecurityManager | |
| 60 | * @see org.apache.tools.ant.types.Permissions | |
| 61 | * | |
| 62 | * @author Conor MacNeill | |
| 63 | * @author <a<EMAIL_ADDRESS>Kruithof</a> | |
| 64 | */ | |
| 65 | public class ExitException extends SecurityException { | |
| 66 | ||
| 67 | /** Status code */ | |
| 68 | private int status; | |
| 69 | ||
| 70 | /** | |
| 71 | * Constructs an exit exception. | |
| 72 | * @param status the status code returned via System.exit() | |
| 73 | */ | |
| 74 | public ExitException(int status) { | |
| 75 | 0 | super("ExitException: status " + status); |
| 76 | 0 | this.status = status; |
| 77 | 0 | } |
| 78 | ||
| 79 | /** | |
| 80 | * Constructs an exit exception. | |
| 81 | * @param msg the message to be displayed. | |
| 82 | * @param status the status code returned via System.exit() | |
| 83 | */ | |
| 84 | public ExitException(String msg, int status) { | |
| 85 | 0 | super(msg); |
| 86 | 0 | this.status = status; |
| 87 | 0 | } |
| 88 | ||
| 89 | /** | |
| 90 | * The status code returned by System.exit() | |
| 91 | * | |
| 92 | * @return the status code returned by System.exit() | |
| 93 | */ | |
| 94 | public int getStatus() { | |
| 95 | 0 | return status; |
| 96 | } | |
| 97 | } |
|
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |


Comp Runner is a simple app, designed to run on any modern browser, to help tournament organisers to keep track of scoring.
You can choose either a simple round robin algorithm.
Scoring is handled automatically, with 3 points for a win and 1 point for a draw. Countback is handled at the end of a comp by summing the scores of a person's beaten opponents.
You can save a tournament locally to open again later.
Feedback is welcome.


{% trans user=request.user.display_name|e -%} Howdy. Welcome to your Zine account interface {{ user }}. {%- endtrans %} {% trans -%} You have written {{ your_comments }} comment so far. {%- pluralize -%} You have written {{ your_comments }} comments so far. {%- endtrans %}


I develop websites in responsive HTML5 and CSS3.
Website's desgined in HTML5 for 100% mobile responsive
Websites created in CSS3 for awesome design.
Simple Graphic Design can be provided!


Vulnerability Assessment is one of those foundational IT Security tasks that often gets overlooked or thought to be reasonably straightforward, where you can actually find some interesting complications that make it trickier than expected.
Generally, most companies will include VA as part of their overall operational security processes, looking to assure that the software they’re deploying is relatively free of unpatched security vulnerabilities.
This post will look a bit at how assessing vulnerabilities of container images for outdated operating system packages is handled and some things to be aware of. We’ll exclude Windows container images to keep things (relatively) straightforward and stick to operating system level vulnerabilities.
Overview
Most Docker images are based on specific Linux distributions and make use of the package managers that those distributions provide to deploy software like tooling and libraries that support the application running in containers based on that image.
So if we’re looking to assess whether there are known vulnerabilities in our images, it would seem possible to use the data provided by the distributions about package versions and CVEs that are patched in them, to assess whether a given image has unpatched vulnerabilities, so far … so simple!
Tooling
To take a practical look at how this works, we can use some of the Open Source container vulnerability scanning tools that are available. For this post we’ll look at three
For the examples below, I set up all three scanners to run locally (e.g. without setting up a container registry). For Anchore I used their Docker compose file and Ancore CLI, for clair I used clair-local-scan and for Trivy, I just used the binary as it comes from their repo. A side note on these is that, from the perspective of setup processes for standalone usage, Trivy is by far the easiest to get working.
Scanning Common Base Images
So now we’ve got three scanners setup, let’s take a look at some common base images and see what they come up with. All three tools provide a JSON output option, so we can use that to create parseable results for analysis.
TL;DR.
If you don’t want to read down a couple of points to note
- Despite the task seeming relatively simple, even in base images different container vulnerability scanners produce quite different results
- The scanning engines support different sets of base images, so that should be noted when you’re assessing which one to use
- Even in a fully updated base image, there can still be outstanding CVEs, depending on the update cycle of both Docker Hub and the underlying distribution.
Summary of Vulnerability Numbers
| Ubuntu:18.04 | Ubuntu:20.04 | Debian:stable | Centos:8 | |
|---|---|---|---|---|
| Anchore | 71 | 23 | 47 | 74 |
| Clair | 38 | 0 | 89 | 1 |
| Trivy | 73 | 26 | 88 | N/A |
Result Details
Ubuntu:18.04
This is a very commonly used base image. We’re using the latest version with that tag from Docker Hub. First question is, when we scan this image, how many vulnerabilities does each scanner think we have?
Vulnerability Count
Anchore thinks the vuln count is : 71
Clair thinks the vuln count is : 38
Trivy thinks the vuln count is : 73
This is moderately interesting already. If you’re using an updated image from Docker Hub, you might think there would be no unpatched issues, but you’d be wrong. One interesting piece about these issue counts is that (in this case) it turns out that the CVEs referenced are the same but that some of the scanners have multiple vulnerabilities for a single CVE.
Next question, what severity do the various scanners apply to these vulnerabilities
Vulnerability Severities
Anchore Severity Counts : {"Low"=>31, "Negligible"=>23, "Medium"=>17}
Clair Severity Counts : {"Medium"=>11, "Low"=>20, "Negligible"=>7}
Trivy Severity Counts : {"LOW"=>55, "MEDIUM"=>18}
Some relatively major differences there too.
Ubuntu:20.04
Lets try the newest stable release of Ubuntu and see what that shows up. Here, Clair doesn’t notice any issues whilst both Anchore and Trivy report over twenty
Vulnerability Count
Anchore thinks the vuln count is : 23
Clair thinks the vuln count is : 0
Trivy thinks the vuln count is : 26
On severities, Trivy includes a high, where all of Anchore’s severities are medium or low.
Vulnerability Severities
Anchore Severity Counts : {"Low"=>11, "Negligible"=>5, "Medium"=>7}
Clair Severity Counts : {}
Trivy Severity Counts : {"MEDIUM"=>9, "LOW"=>16, "HIGH"=>1}
Debian:stable
Here the numbers are switched around again with Clair and Trivy reporting quite a few more issues than Anchore. An interesting point is that whilst Clair and Trivy’s total vulnerability counts are similar, the referenced CVEs have quite a few differences.
Vulnerability Count
Anchore thinks the vuln count is : 47
Clair thinks the vuln count is : 89
Trivy thinks the vuln count is : 88
Vulnerability severity
Anchore Severity Counts : {"Negligible"=>46, "Medium"=>1}
Clair Severity Counts : {"Low"=>21, "Negligible"=>45, "Unknown"=>23}
Trivy Severity Counts : {"LOW"=>69, "MEDIUM"=>17, "HIGH"=>2}
Centos:8
Another commonly used base image here the results are interesting, in that Trivy doesn’t recognize the OS at all and Anchore comes out with a lot more vulnerabilities than Clair.
Vulnerability Count
Anchore thinks the vuln count is : 74
Clair thinks the vuln count is : 1
Trivy thinks the vuln count is : 0
Vulnerability Severities
Anchore Severity Counts : {"Low"=>23, "High"=>4, "Medium"=>47}
Clair Severity Counts : {"High"=>1}
Trivy Severity Counts : {}


CSS Selectors
http://example.com
http://example.com/
http://example.com/page.html
https://example.com
HTTP://example.com
#here
Please fill in the form!
The form! It is unfilled!
Name:
email:
I agree to the terms:
The
color
is red
The
colour
is red


HTML (Hypertext Markup Language) is the code that is used to structure a web page and its content.
Cascading Style Sheets is a style sheet language used for describing the presentation of a document written in a markup language such as HTML.
Android is a mobile operating system designed primarily for touchscreen mobile devices such as smartphones and tablets.
An application programming interface is a connection between computers or between computer programs.
A data structure is a named location that can be used to store and organize data. And, an algorithm is a collection of steps to solve a particular problem.

Data mining is the process of finding anomalies, patterns and correlations within large data sets to predict outcomes.
Ethical hacking is a process of detecting vulnerabilities in an application, system, or organization's infrastructure.
Big Data is a collection of data that is huge in volume, yet growing exponentially with time.
Blockchain technology is most simply defined as a decentralized, distributed ledger that records the provenance of a digital asset.
JavaScript is a lightweight, interpreted, object-oriented language with first-class functions, and is best known as the scripting language for Web pages.
iOS (formerly iPhone OS) is a mobile operating system created and developed by Apple Inc. exclusively for its hardware which includes the iPhone and iPod Touch.
Machine learning (ML) is a type of I that allows software applications to become more accurate at predicting outcomes without being explicitly programmed to do so.
Computer vision enables computers and systems to derive meaningful information from digital images, videos and other visual inputs.
Cryptography is the study of secure communications techniques that allow only the sender and intended recipient of a message to view its contents.
The database is a collection of inter-related data which is used to retrieve, insert and delete the data efficiently.
Cloud computing is the on-demand availability of computer system resources, especially data storage and computing power, without direct active management by the user.
A computer network is a set of devices connected through links. A node can be computer, printer, or any other device capable of sending or receiving the data.
The Internet of things(IoT) describes physical objects that are embedded with sensors, processing ability, software, and other technologies that connect.
Data science is an interdisciplinary field that uses scientific methods, processes & algorithms and systems to extract knowledge and insights from noisy.


The best cupcakes, cookies, cakes, pies, cheesecakes, fresh bread, biscotti, muffins, bagels, fresh coffee and more.
It's consistently excellent, dishes are superb and healthily cooked with high quality ingredients.
A dairy product is food produced from the milk of mammals.
Only superior quality beef, lamb, and pork.
Great place to buy fresh and organic seafood at reasonable prices!
A variety of fresh fruits and vegetables.


Plugin Information |
|---|
View Authentication Tokens API on the plugin site for more information. |
Authentication Tokens API Plugin
This plugin provides an API for converting credentials into authentication tokens in Jenkins.
The plugin provides concepts for:
- Authentication Token Source: converts a type of Credentials into authentication tokens of a certain type.
- Authentication Token Context: used to specify the context in which the token wants to be used through a series of purposes.
- AuthenticationTokens utility class to generate matchers and convert credentials into tokens easily.
Version History
Version 1.3 (17/Jun/2016)
- JENKINS-35287: Upgrade to 2.9 parent POM.
Version 1.2 (7/Sept/2015)
- Add concept of authentication token context to specify the context in which the token wants to be used.
- Convert best match of a selection of credentials.
Version 1.1 (17/Apr/2015)
- Prioritise matches based on goodness of fit
Version 1.0 (09/Apr/2015)
- Initial release


AsyncAutoResetEvent Class
Package: @esfx/async-autoresetevent
Represents a synchronization event that, when signaled, resets automatically after releasing a single waiting asynchronous operation.
Declaration
export declare class AsyncAutoResetEvent
Examples
The following example shows how to use AsyncAutoResetEvent to release one asynchronous operation at a time whenever the user presses Enter. Because the first event is initially signaled, the first operation is released immediately. This resets the signaled state, causing the remaining operations to pause until the event is once again signaled.
Note
The following example is derived from https://docs.microsoft.com/en-us/dotnet/api/system.threading.autoresetevent?view=net-6.0#examples
import { AsyncAutoResetEvent } from "@esfx/async-autoresetevent";
import { delay } from "@esfx/async-delay";
import * as readline from "readline";
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
const question = (text: string) => new Promise<string>(resolve => rl.question(text, resolve));
const first = new AsyncAutoResetEvent(/*initialState*/ true);
const second = new AsyncAutoResetEvent(/*initialState*/ false);
async function main() {
await question(`Press Enter to start three asynchronous operations.`);
const promises: Promise<void>[] = [];
for (let i = 0; i < 3; i++) {
promises.push(asyncOperation(`operation #${i + 1}`));
}
await delay(250);
for (let i = 0; i < 2; i++) {
await question(`Press Enter to release an operation.`);
first.set();
await delay(250);
}
console.log("All operations are now waiting on the second event.");
for (let i = 0; i < 3; i++) {
await question(`Press Enter to release an operation.`);
second.set();
await delay(250);
}
await Promise.all(promises);
}
async function asyncOperation(name: string) {
console.log(`${name} is waiting on the first event.`);
await first.wait();
console.log(`${name} was released from the first event.`);
console.log(`${name} is waiting on the second event.`);
await second.wait();
console.log(`${name} was released from the second event.`);
console.log(`${name} is complete.`);
}
await main();
Remarks
The AsyncAutoResetEvent and AsyncManualResetEvent classes are used to provide signaling between concurrent asynchronous operations.
An asynchronous operation can wait until an event is signaled by awaiting the result of wait(cancelable). This causes the operation to pause until the event becomes signaled. Calling set() will signal and release a single waiting operation, immediately returning the event to the non-signaled state. If there are no operations currently waiting on the event, the event will remain signaled until the next call to wait(cancelable).
Calling reset() resets the event to the non-signaled state.
Constructors
constructor(initialState)
Initializes a new instance of the AutoResetEvent class.
Declaration
constructor(initialState?: boolean);
Parameters
Methods
reset()
Sets the state of the event to nonsignaled, causing asynchronous operations to pause.
Declaration
reset(): void;
Returns
set()
Sets the state of the event to signaled, resolving at most one waiting Promise. The event is then automatically reset.
Declaration
set(): boolean;
Returns
true
if the operation successfully resolved a waiting Promise; otherwise, false
.
wait(cancelable)
Asynchronously waits for the event to become signaled.
Declaration
wait(cancelable?: Cancelable): Promise<void>;
Parameters
Returns


| DOSE: T+ 0:00 |
2 shots |
oral |
Alcohol |
| T+ 0:00 |
1 cap |
oral |
GHB |
| T+ 0:15 |
2 shots |
oral |
Alcohol |
| T+ 0:15 |
1 cap |
oral |
GHB |
I was over at a friends place and we were board sitting around havin a couple of drinks. I had already had around two shots of vodka (straight) and her brother suggested that we try sumthing a little more interesting. Me being new to this whole 'drug taking' scene I eagarly accepted.
He offered around an eyedropper full of a clear liquid which he named as ghb. he told us to fill a bottle cap full, mix it into our vodka and sit bak and relax.I did just that and sat bak and listned to the music playing. About fifteen mins later I told him that I couldnt feel a thing, he suggeested I fill another capfull and hav a couple more shots of the alcohol. I did.
Thirty mins after I did this I began to feel extreamly realaxed, the music began to feel more intense, my libido increased and I was having a pretty good time. I decided to go for a walk to the corner gas station. Her brother and I got up and I was drifting in and out of a hazy euphoric feeling. I cant remember exactly what happened threrafter but I woke up in the morning with my underwear gone and a rather bad stomach ache.
I didnt know what happened the night befor so I spoke to her brother and he informed me that I was feeling rather horny whilst on the drugs.
A couple of weeks later I went to the doctor and informed him of my experience. It was later found I was pregnantt and two months later I miscarried and hav not been able to get myself out of a depression since. I blame my miserable experience on ghb and reccomend that if you want to try it for the first time, make sure you are surrounded by people you trust (preferably the same sex). Dont let one ghb trip ruin your life as it did mine. Thanks for listning.
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.


Express this quotient in scientific notation:
\Large{\frac{scientific( 3, NUMERATOR )}
{scientific( 1, DENOMINATOR )}}
\times 10
scientificExponent( QUOTIENT )
Start by collecting like terms together.
= \Large{\frac{scientificMantissa( 3, NUMERATOR )}
{scientificMantissa( 1, DENOMINATOR )}}
\times\Large{\frac{10^{scientificExponent( NUMERATOR )}}
{10^{scientificExponent( DENOMINATOR )}}}
Then divide each term seperately. When dividing exponents with the same base, subtract their powers.
= roundTo( 2, scientificMantissa( 3, NUMERATOR ) / scientificMantissa( 1, DENOMINATOR ) ).toFixed( 2 )
\times 10^{scientificExponent( NUMERATOR )\,-\,scientificExponent( DENOMINATOR )}
= roundTo( 2, scientificMantissa( 3, NUMERATOR ) / scientificMantissa( 1, DENOMINATOR ) ).toFixed( 2 )
\times 10^{scientificExponent( NUMERATOR ) - scientificExponent( DENOMINATOR )}
To write the answer correctly in scientific notation, the first number needs to be between 1
and 10
.
In this case, we need to move the decimal one position to the right without changing the value of our answer.
\qquad
We can use the fact that
roundTo( 2, scientificMantissa( 3, NUMERATOR ) / scientificMantissa( 1, DENOMINATOR ) ).toFixed( 2 )
is the same as
scientificMantissa( 2, QUOTIENT ) \div 10
, or
scientificMantissa( 2, QUOTIENT ) \times 10^{-1}
.
= \color{BLUE}{scientificMantissa( 2, QUOTIENT ) \times 10^{-1}}
\times 10^{scientificExponent( NUMERATOR ) - scientificExponent( DENOMINATOR )}
= scientific( 2, QUOTIENT )
Express this product in scientific notation:
(scientific( 2, QUOTIENT ))\times (scientific( 2, DENOMINATOR ))
\times 10
scientificExponent( NUMERATOR )
Start by collecting like terms together.
= (scientificMantissa( 2, QUOTIENT )\times scientificMantissa( 2, DENOMINATOR ))
\times (10^{scientificExponent( QUOTIENT )}\times 10^{scientificExponent( DENOMINATOR )})
When multiplying exponents with the same base, add the powers together.
= roundTo( 1, scientificMantissa( 2, QUOTIENT ) * scientificMantissa( 1, DENOMINATOR ) ).toFixed( 1 )
\times 10^{scientificExponent( QUOTIENT )\,+\,scientificExponent( DENOMINATOR )}
= roundTo( 1, scientificMantissa( 2, QUOTIENT ) * scientificMantissa( 1, DENOMINATOR ) ).toFixed( 1 )
\times 10^{scientificExponent( QUOTIENT ) + scientificExponent( DENOMINATOR )}
To write the answer correctly in scientific notation, the first number needs to be between 1
and 10
.
In this case, we need to move the decimal one position to the left without changing the value of our answer.
\qquad
We can use the fact that
roundTo( 1, scientificMantissa( 2, QUOTIENT ) * scientificMantissa( 1, DENOMINATOR ) ).toFixed( 1 )
is the same as
scientificMantissa( 3, NUMERATOR ) \times 10
.
= \color{BLUE}{scientificMantissa( 3, NUMERATOR ) \times 10}
\times 10^{scientificExponent( QUOTIENT ) + scientificExponent( DENOMINATOR )}
= scientific( 3, NUMERATOR )


October 2017 / DEC 2017
ZTEsoft has received the TM Forum Open API Conformance Certification for Trouble Ticket API, which is one of the kernel APIs within ZSmart 9 solution.
The winners of the 2017 Global Telecoms Awards (GLOTELs) have been announced in London. ZTEsoft won two awards in the categories of operations support system (OSS) Innovation, and Best Digital Transformation Project.
digital transformation is an enabling step for the far wider-reaching digital revolution which will have far greater impacts not only on the telecoms industry but on how business is done and how we live our lives.
Check out this white paper to examine digital transformation in the telecom industry through the lens of Business and Operational Support Systems.
MWC 2018
26 Feb – Mar 1, 2018
Barcelona
ZTEsoft is dedicated to providing you with the latest, high-value information that will help you to know more about us. Contact us at<EMAIL_ADDRESS>with any questions.
If you no longer wish to receive these email, click here to unsubscribe.


| Py16GUI | index c:\users\grp66007\dropbox\python\i16\py16\py16gui.py |
Selection of graphical user interfaces (GUIs) that allow fast viewing and analysis of data
on the beamline I16 at Diamond Light Source Ltd.
By Dan Porter, PhD
Diamond
2016
Usage:
On an I16 workstation (as I16user)
- Double click the shortcut on the desktop "I16_Data_Viewer"
- Select "Run in Console"
On another Diamond workstation, the Diamond NX server or when remotely connecting:
- Open a terminal
- Type:
>> cd /dls_sw/i16/software/python/Py16/
>> module load python/ana
>> ipython -i --matplotlib tk Py16GUI.py
On another system
- Open a terminal/ console/ command prompt
Type:
>> cd /direcotry of Py16GUI.py
>> ipython -i --matplotlib tk Py16GUI.py
Operation:
1. On running the program, the main GUI (I16_Data_Viewer) will appear
2. Browse for the experimental and analysis directories
- the experimental directory is where the scan data is stored
- the analysis directory is where you wish to store any data you save or scripts you create
3. Click "Last" to load the latest data with automaticaly choosen axes
More Operations:
- Click "Update Pilatus Plot" to load the images from any area detector
- Click "Last Scans" to see a list of the last 100 scans that are selectable to plot
- Select a function from the "Fit" dropdown menu to apply a fit the current plot
- Click "Multiplot/ Peak Analysis" to open the I16_Peak_Analysis GUI
- Click "Export Plot" to generate an figure of the current scan
- Click "Print Current Scan" to send an image of the current scan to the default printer
- Click "Print All Figures" to send all open figures to a single 2x6 page
- Click "Meta" to see a full list of metadata for this scan
- Tick the box "Live Mode" to automatically update the GUI every 10s
- Click "Params" to change default parameters, such as error bars and temperature sensor
Custom Regions of Interest:
It is possible to define new regions of interest on an area detector and plot these.
Note that manual regions of interest have hot and broken pixels set to zero.
- Select the scan
- Click "Update Pilatus Plot"
- Edit the "Centre" and "ROI" boxes to define the box centre and size, press enter to update the plot
- The button "Find Peak" will find the largest pixel, the buttons "roi2" and "roi1" will generate standard ROIs
- In the "Y" dropdown menu, choose "Custom ROI" to plot the sum of this ROI
- Or: Choose "ROI - bkg" to plot the background subtracted sum (the background is defined by a region twice the ROIs size)
**********************
Main GUIs:
I16_Data_Viewer - Starts automatically, set the experiment directory to see scan details, plot scan and area detector data, access other GUIs
I16_Peak_Analysis - Plot and analyse multiple scans, including peak fitting and integration
I16_Advanced_Fitting - More fitting options, including masks
colour_cutoffs - A separate GUI that will interactively change the colormap max/min of the current figure.
Version 3.2
Last updated: 23/10/17
Version History:
07/02/16 0.9 Program created
29/02/16 1.0 I16_Data_Viewer and I16_Peak_Analysis Finished
03/03/16 1.1 Tested on Beamline, removed errors, cleaned up
28/04/16 1.2 Added Find Peak button
05/05/16 1.3 Added helper bar, made pilatus button clearer
09/05/16 1.4 Added buttons for find files and meta
10/05/16 1.5 Added print buffer + close all buttons
20/05/16 1.6 Added fit function to fit option menu and fixed reploting issue
12/07/16 1.7 Added Advanced Peak Fitting GUI
10/08/16 1.8 Added logplot and diffplot options
08/09/16 1.9 Added auto pilatus update checkbox
24/09/16 2.0 Removed requirement for SciSoftPi data loader
07/10/16 2.1 Some minor corrections, addition of parameters window
17/10/16 2.2 Addition of rem. Bkg for pilatus and pilatus peakregion/ background lines
14/12/16 2.3 New option menus for exp directories and X,Y variables, other minor improvements
20/12/16 2.4 Main app now resizes for screensize, Mac option added. Fixes for option menus. New Check buttons
08/02/17 2.5 Log of pilatus images added, other bugs fixed
25/02/17 2.6 Minor corrections and fixes, including multi-variable advanced fitting and persistence of custom ROIs
11/07/17 2.7 Added scan selector
24/07/17 2.8 Added colour_cutoffs and other bug fixes
01/08/17 2.9 Added check for large pilatus arrays, parameter "max array" in parameters window
02/10/17 2.9 Added ability to turn off normalisation in multi-plots
06/10/17 3.0 Added log plot to multiplots, plus other fixes
10/10/17 3.1 Added I16_Meta_Display, multiplotting from scan selector
23/10/17 3.2 Several minor improvements, including choice of plots for fitting
###FEEDBACK### Please submit your bug reports, feature requests or queries to<EMAIL_ADDRESS>@author: Dan Porter
I16, Diamond Light Source
2016
| Modules | ||||||
|
| Classes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| Data | ||
| BF = ['Times', 12] HF = ['Courier', 12] LF = ['Times', 14] LINUX = {'pilatus': [6, 2.9], 'scan': [6, 4]} MAC = {'pilatus': [5, 2], 'scan': [5, 3]} NORMAL = {'pilatus': [6, 2.5], 'scan': [6, 4]} Py16GUI_Version = 3.2 SF = ['Times New Roman', 14] WINDOWS = {'pilatus': [6, 2.5], 'scan': [6, 4]} |


Warning: The binaries listed on this page were compromised for a short time. Users are suggested to take action. Please click here for details.


WeWork in talks to hire T-Mobile's John Legere as CEO: WSJ
WeWork is in discussions with T-Mobile US Inc Chief Executive Officer John Legere to take over as head of the office-sharing start-up, the Wall Street Journal reported on Monday, citing people familiar with the matter.
REUTERS: WeWork is in talks with T-Mobile US Inc Chief Executive Officer John Legere to take over as the head of the office-sharing start-up, the Wall Street Journal reported https://www.wsj.com/articles/wework-in-talks-to-hire-t-mobile-ceo-john-legere-11573494028?mod=rsswn&page=1&pos=2 on Monday, citing people familiar with the matter.
The talks come weeks after SoftBank Group spent more than US$10 billion to take over WeWork, including a US$1.7 billion payoff to its co-founder Adam Neumann to relinquish control.
WeWork did not immediately respond to Reuters request for comment.
SoftBank Chief Operating Officer Marcelo Claure became the executive chairman of WeWork parent The We Company, following the bailout by the Japanese firm.
Artie Minson, chief financial officer, and Sebastian Gunningham, vice chairman, currently serve as the co-chief executives of The We Company.
SoftBank owns 80per cent of the troubled office-sharing startup, but has not consolidated the company on its books because it will not hold a majority of voting rights.
SoftBank has four board seats on the company's expanded 10-member board. The startup is looking for a new leader who could join as soon as January, the WSJ report said.
(Reporting by C Nivedita in Bengaluru; Editing by Arun Koyyur)


I teach Computer Science and Engineering in VIT-AP. I aim to be a smart performer, innovator as well as learner to establish new concepts and methodologies in the field of engineering and technology to grow better everyday.
Helping educate the next generation of Computer Scientists and Engineers in order to let them acheive algorithmic thinking, understand roles and responsibilites and keep up with new technologies.
Perform variety of tasks in populating/procuring content for the product catalogs on the website. Includes content creation, population of content from various sources (including research on the internet). Interacting/coordinating with vendor/manufacturers, identifying and correcting errors/complaints, maintaining records of work received and work performed.
A list of journals published over the years of work
Apart from my professional life, I like gardening and photography. I like writing Tamil lyrics and also cooking
I like thinking positive and being creative. I also like solving real word case study problems and I can be a good team player.


Some probability distributions on X = {1,2,3,4}
First a uniform distribution p(x = k) = 1/4. Second a degenerate distribution p(x) = 1 if x=1 and 0 otherwise.
function discreteProbDistFig close all; plotHist(1:4); printPmtkFigure('unifHist'); plotHist(1); printPmtkFigure('deltaHist'); end function plotHist(locs) figure; sCounts = (1/length(locs))*ones(1,length(locs)); bar(locs,sCounts); axis([0 5 0 1]); set(gca,'XTick',0:5); set(gca,'YTick',0:0.25:1); end


 Walk through the app to build your style and confidence.
 So don't forget that.
If you like to contribute to the project, check out the GitHub.
If you want to get in touch, email me at christo8989@gmail.com.


Building out new stuff, minimal distractions this morning. This is why I program.
11/4/2008, 11:21:00 AM
Favs: 0
Retweets: 0
link--- layout: tweet ---
Building out new stuff, minimal distractions this morning. This is why I program.
11/4/2008, 11:21:00 AM
Favs: 0
Retweets: 0
link


|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.catechis.constants.Loggy org.catechis.testing.TestUtility
public class TestUtility
| Field Summary |
|---|
| Fields inherited from class org.catechis.constants.Loggy |
|---|
log |
| Constructor Summary | |
|---|---|
TestUtility()
|
| Method Summary | |
|---|---|
void |
addDailyTestRecordIfNeeded(java.lang.String type,
WordTestResult wtr,
java.lang.String user_id,
java.lang.String root_path,
java.util.Hashtable user_opts,
long id,
java.lang.String encoding)
record the test in daily *type* tests.record file this ads an element to the daily *type* tests.record file. |
private void |
addDailyTestRecordIfNeeded(java.lang.String type,
WordTestResult wtr,
UserInfo user_info,
java.util.Hashtable user_opts,
long word_id)
record the test in daily *type* tests.record file this ads an element to the daily *type* tests.record file. |
private WordTestResult |
addWordTestResults(java.lang.String text,
java.lang.String def,
java.lang.String answer,
java.lang.String grade,
java.lang.String org_level,
java.lang.String new_level)
The original comment for this method was: (text, def, answer, "fail", index) |
private java.lang.String |
getAppropriateLevel(Word word,
java.lang.String test_type)
|
private int |
limitLevel(int level,
int max_level)
The original method in org.catechis.Soring did not include a 0 level limit, so not sure if that was done somewhere else or not. |
private void |
removeWordFromNewWordsList(java.lang.String context_path,
long search_id,
java.lang.String type,
java.lang.String encoding,
java.lang.String user_id)
Helper method for addDailyTestRecordIfNeeded. |
private WordTestResult |
reverseGrade(WordTestResult word_test_result,
WordTestMemory word_test_memory,
Storage store,
java.lang.String user_name,
java.lang.String grade,
java.lang.String encoding)
Another method from ChangeUpdateAction in Indoct. |
WordTestResult |
reverseTestResult(WordTestResult word_test_result,
AllWordsTest awt,
java.lang.String user_name,
java.lang.String user_id,
java.lang.String context_path)
Notes from ChangeUpdateScoreAction: |
private WordTestResult |
scoreGrade(java.lang.String grade,
java.lang.String text,
java.lang.String def,
java.lang.String answer,
int level,
java.lang.String max)
|
java.util.Vector |
scoreSavedTest(UserInfo user_info,
SavedTest saved_test,
java.util.Vector awt_list)
In this case, the AllWordsTest.answer variable is not a user answer, bu a pass/fail indicator chosen by a student or teacher. |
static AllWordsTest |
setupAllWordsTest(Word word,
java.lang.String type,
int test_index)
AllWordsTest has these member variable: |
private java.util.Vector |
setupELTVector(java.util.Hashtable user_opts)
What class did we move this method too? Oh, this was the one we moved. |
private void |
updateDailyTestsRecords(java.lang.String context_path,
WordTestResult wtr,
WordTestRecordOptions wtro,
java.lang.String encoding)
A method from ChangeUpdateAction in Indoct |
private WordTestResult |
updateWord(UserInfo user_info,
AllWordsTest awt,
java.lang.String test_date)
We have user_info, a test word, and a pass/fail. |
| Methods inherited from class org.catechis.constants.Loggy |
|---|
append, dumpLog, dumpLog, dumpWordsVector, getLog, printCollection, printLog, resetLog |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TestUtility()
| Method Detail |
|---|
public static AllWordsTest setupAllWordsTest(Word word, java.lang.String type, int test_index)
AllWordsTest has these member variable:
// data kept on xml file
private String text;
private String definition;
private String category;
private String test_type;
private String level;
private int daily_test_index;
private long id;
// users answers
private String answer;
public java.util.Vector scoreSavedTest(UserInfo user_info, SavedTest saved_test, java.util.Vector awt_list)
awt_list
- is a Vector of test result obejcts. The test is already scored with pass/fail info in the awt objects.private WordTestResult updateWord(UserInfo user_info, AllWordsTest awt, java.lang.String test_date)
AllWordsTest
private String text;
private String definition;
private String category;
private String test_type;
private String level;
private int daily_test_index;
private long id;
private String answer; WordTestResult private String text; private String definition; private String answer; private String grade; private String level; private int id; private String original_text; private String original_definition; private String original_level; private String encoding; private String date; private long word_id; AppTestUserDTO has the following attributes: String user_id; String current_dir; String time; *** not in UserInfo String subject; boolean reading; *** not in UserInfo boolean writing; *** not in UserInfo TestTimeMemory private String original_wltd; private String new_wltd; private String original_wntd; private String new_wntd; private String type; This object stores time in milliseconds s representing a words last and next test dates (hence wltd/wntd). There is already an object in the org.catechis.dto package with WordLastTestDate, so the name of TestTimeMemory is used to differentiate this from that. some methods came from com.quaquaverse.testing.TestResultUtility Here are some notes about the difference between this method and the one from quaquaverse, which was taken originally from the indoct DailyTestResultAction: // wtr = store.scoreSingleWordTest(awt, user_id); this basically get all the info we already have and calls: // wtr = scorer.scoreSingleWord(awt, word, user_options); // if there is no file action here...skip it // the scorer does both determine pass or fail and update the level in wtr, the latter in this method: // wtr = scoreGrade("pass", text, def, user_answer, level, max_level); or fail of course. // these methods really only adjust the level, as well as the rigamorole of setting the wtr // so those methods are included here
private java.lang.String getAppropriateLevel(Word word, java.lang.String test_type)
private WordTestResult scoreGrade(java.lang.String grade, java.lang.String text, java.lang.String def, java.lang.String answer, int level, java.lang.String max)
private WordTestResult addWordTestResults(java.lang.String text, java.lang.String def, java.lang.String answer, java.lang.String grade, java.lang.String org_level, java.lang.String new_level)
private int limitLevel(int level, int max_level)
private void addDailyTestRecordIfNeeded(java.lang.String type, WordTestResult wtr, UserInfo user_info, java.util.Hashtable user_opts, long word_id)
record the test in daily *type* tests.record file this ads an element to the daily *type* tests.record file.
The WordTestRecordOption object holds all the on off switches for what should be recorded in the file.
The FileTestRecords object does all the word of checking these options and then saving a record in the apporpriate file. While it at it, this method will remove the word from the new words list if the test is passed. Otherwise, all the work is done in FileTestRecords.addDailyTestRecord(wtr, wtro); by way of creating and setting a WordTestRecordOptions.
private java.util.Vector setupELTVector(java.util.Hashtable user_opts)
public WordTestResult reverseTestResult(WordTestResult word_test_result, AllWordsTest awt, java.lang.String user_name, java.lang.String user_id, java.lang.String context_path)
Notes from ChangeUpdateScoreAction:
Here goes WordTestMemory private String category; *** private String type; *** private String date; *** private String score; SET LATer private String index; *** -1 private String number_correct; ? private String level; ? private String test_name; needed long word_id
WordTestResult private String text; private String definition; private String answer; private String grade; private String level; private int id; private String original_text; private String original_definition; private String original_level; private String encoding; private String date; long word_id Objects already in the session: ArrayList key_list = (ArrayList)session.getAttribute("actual_key_list"); // if this is null then we create it next WordLastTestDates wltd = (WordLastTestDates)session.getAttribute("wltd"); // the list of words and their key assosiations DailyTestAction attributes set: session.setAttribute("daily_test_index", "0") session.setAttribute("awt_test_word", awt_test_word); //session.setAttribute("actual_key_list", key_list); //session.setAttribute("wltd", wltd); session.setAttribute("awt_test_word", awt); session.setAttribute("actual_key_list", key_list); session.setAttribute("wltd", wltd); session.setAttribute("wtr", wtr); objects actually needed in the daily_test_result.jsp: AllWordsTest awt = (AllWordsTest)session.getAttribute("awt_test_word"); WordTestResult wtr = (WordTestResult)session.getAttribute("wtr"); (String)session.getAttribute("daily_test_index")
private void updateDailyTestsRecords(java.lang.String context_path, WordTestResult wtr, WordTestRecordOptions wtro, java.lang.String encoding)
private WordTestResult reverseGrade(WordTestResult word_test_result, WordTestMemory word_test_memory, Storage store, java.lang.String user_name, java.lang.String grade, java.lang.String encoding)
Another method from ChangeUpdateAction in Indoct.
This method finds the pass or fail score of the particular word, and has to change both the words reading or writing level and the overall percentage score which needs to be re-calculated from the number of words tested, and the number of words correct held in the i_score variable.
public void addDailyTestRecordIfNeeded(java.lang.String type, WordTestResult wtr, java.lang.String user_id, java.lang.String root_path, java.util.Hashtable user_opts, long id, java.lang.String encoding)
record the test in daily *type* tests.record file this ads an element to the daily *type* tests.record file.
The WordTestRecordOption object holds all the on off switches for what should be recorded in the file.
The FileTestRecords object does all the word of checking these options and then saving a record in the apporpriate file.
This method was moved from DailyTestResultAction.
private void removeWordFromNewWordsList(java.lang.String context_path, long search_id, java.lang.String type, java.lang.String encoding, java.lang.String user_id)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Current page: {% current %}
Counting of http://localhost:63342/Hit-Kounter-LC/demo/index.html: {% counter %}
Counting of http://localhost:63342/Hit-Kounter-LC/demo/index2.html: {% counter %}
Site Views: {% site %}


@* * Copyright 2019 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @import uk.gov.hmrc.govukfrontend.views.html.components._ @import uk.gov.hmrc.playprototypefrontend.controllers.routes._ @this(layout: Layout, warning: WarningText, submit: Button) @()(implicit request: Request[_], messages: Messages) @layout(pageTitle = Some(messages("clearSuccess.title") + " – " + messages("site.service_name"))) {
The session data has been cleared.
}