Config
The config library supports Apps to store configuration options in a config database table. To access the config options
from within a JavaScript App, the C++ config library communicates with the JavaScript config library using JSON messages. See the
JS config library documentation for more informations.
The usage of the config library is straight forward and only needs a couple of steps:
- Create instance of ConfigContext.
- Register the config library to the JSON API framework by passing the created instance to RegisterJsonApi(configContextInstance).
- Create the database table used by the config lib by calling CreateInitTask(databaseObject) and exetuting the returned task (don't forget to free it,
after the task is finished).
- Add ConfigItem members to your class and initialize them passing the ConfigContext instance (see the description of the ConfigItems classes
below).
Now the appliction service and the JavaScript app only need to access the items or changed and save them (especially from the JavaScript side). ConfigContext and
the JavaScript config library are handling all of the communication, so there is no need for an app to worry about that.
File information
Classes
ConfigContext
class ConfigContext : public UTask, public UJsonApiContext, public UConfigContextApi {
protected:
virtual void ConfigChanged() {}
virtual void ConfigChangedUnmanaged() {}
virtual bool CanReadConfig(IJsonApiConnection * const connection) { return true; }
virtual bool CanWriteConfig(IJsonApiConnection * const connection) { return true; }
class ITask * UpdateUnmanagedItems();
public:
ConfigContext(class IDatabase * database, class IInstanceLog * log);
virtual ~ConfigContext();
class ITask * CreateInitTask(class IDatabase * database = nullptr);
void ResetChangedFlag();
class ITask * WriteItemValue(ConfigItem * item, const char * value, bool notify);
};
Overview
The ConfigContext is the base class of the config library. It handles the communication with the database as well as with the
JSON API framework. An application only needs to create an instance of ConfigContext and initialize it. To initialize, the
instance must be passed to to RegisterJsonApi() of an existing JsonApiContext instance and the database must be initialized by
executing the task returned by CreateInitTask(). Even if not necessary it is recommended to create a subclass of ConfigContext
to store the config items into that subclass, too. This makes handling and initializing the config items easier as well as get
informed after changes made for the config items.
The ConfigContext stores the configuration inside the database accassable through the given database connection. When initializing running
the task to do so, a table called config will be created with three rows:
- name The name of the config item with a maximum length of 255 chars.
- value The vlaue of the config item. Each item is stored as string with an (in theory) unlimited length. But be aware that each item will stay resident in RAM,
so take care to not hold values to big.
- unmanaged A boolean value to describe if the item is unmanaged or not.
Note that only items will be written to the database, that have a different value than given as the default value. Even if an item had ben changed and set back to
the default value, it is no longer written to the database.
Each config item will be registered to a ConfigContext instance and managed by that instance. That also means that each config item must have a unique name. See the description
of ConfigItem classes below for more details.
Protected functions
ConfigChanged
Will be called after the value of a config item had been changed. Create a class derived from ConfigContext to catch that callback.
ConfigChangedUnmanaged
Will be called after the value of an unmanaged config item had been changed. An unmanaged config item can only be accessed by the C++ side of the library,
but not by the JSON API. So on the JSON API side, that item is read-only. Create a class derived from ConfigContext to catch that callback.
CanReadConfig
Will be called to check, if a given IJsonApiConnection instance has the right to read the config. Create a class derived from ConfigContext and overwrite
the function to add rights management for reading the config.
Parameters
| class IJsonApiConnection * const connection | The IJsonApiConnection instance to be checked for the right to read the config. |
Return value
True, if the given connection has the right to read the config. So if true is returned, ConfigContext will send config informations to the connection that asks for them.
False, to deny the access to the config. The default implementation of ConfigContext::CanReadConfig() always returns true.
CanWriteConfig
Will be called to check, if a given IJsonApiConnection instance has the right to write the config. Create a class derived from ConfigContext and overwrite
the function to add rights management for writing the config.
Parameters
| class IJsonApiConnection * const connection | The IJsonApiConnection instance to be checked for the right to write the config. |
Return value
True, if the given connection has the right to write the config. So if true is returned, ConfigContext will accept changed config values send via JSON API messages and write
them to the database. False, to deny the access to the config. The default implementation of ConfigContext::CanWriteConfig() always returns true.
Public functions
ConfigContext (Constructor)
The constructor of the class.
Parameters
| class IDatabase * database | The IDatabase instance to be used by the config context. |
| class IInstanceLog * const log | The IInstanceLog instance used for loging purposes. |
CreateInitTask
Creates an instance of the task to initialize the database table used by the config context.
Parameters
| class IDatabase * database | (Default: nullptr) The IDatabase instance to be used.
If nullptr, the instance passed to the constructor will be used. |
Return value
The task that must be executed to initialize the config table. Simply call Start() of that task, passing a user of your choice to that function.
Remarks
Note that the created ITask instance returned by CreateInitTask() must be freed after the task has finished or failed. If not, the application will
create memory leaks.
ResetChangedFlag
This will reset the changed flag of all items. After calling that, Changed() of each ConfigItem registered to ConfigContext will return false. It will be a good
Idea to call that function in ConfigChanged() and / or ConfigChangedUnmanaged() after handling all changes.
WriteItemValue
Call this function to write a config item to the database. Generally this will be done when items had been changed through the JSON API. But in case of unmanaged
items, this function is the only way to save them.
Parameters
| ConfigItem * item | The config item to write to the database. |
| const char * value | The value to write. |
| bool notify | If true, a changed notification will be send to all open JsonApoContext instances. |
ConfigItem
class ConfigItem : public istd::listElement {
private:
char * name;
protected:
friend class TaskWriteConfig;
friend class TaskWriteConfigUnmanaged;
friend class TaskInitConfig;
friend class ConfigContext;
class IInstanceLog * const log;
bool changed;
bool unmanaged;
virtual void ReadValueFromDataset(class IDataSet * dataset) = 0;
virtual void ReadValueFromJSON(class json_io * json, dword base, class IJsonApiConnection * connection) = 0;
virtual void WriteValueToJSON(class json_io * json, dword base, char * & convBuf, class IJsonApiConnection * connection) = 0;
virtual int WriteValueToString(char * dest) = 0;
virtual void SetWriteValue(const char * value) = 0;
virtual void WriteItemTypeToJSON(class json_io * json, dword base, char * & convBuf) = 0;
public:
ConfigItem(ConfigContext * context, const char * name, bool unmanaged);
virtual ~ConfigItem();
const char * GetName() const { return this->name; }
bool Changed() const { return this->changed; }
virtual bool HasDefaultValue() = 0;
virtual void Reset() = 0;
};
Overview
This is the base class for each config item. Generally there is no need to create an own config item, because the config library provides config items
for the most use cases. But if there is need, an own config item must be derived from ConfigItem. Also, because of the internals, ConfigContext must
be a friend class for the new config item as well (the other classes don't need to, that's only used internally for the ConfigItem base class).
If an app whants to create an own config item class, it needs to provide one of the default data types to ConfigContext anyway. If not, the result of
handling that item on the JSON API side is undefined. Types supported by the ConfigContext are:
- 32bit integers (singed and unsigned)
- 64bit integers (singed and unsigned - but take care with 64bit integers because of the not-that-good support of them on JavaScript).
- bool.
- string (with unlimited length).
- password (which is a string with a flag given on initialization to define it as password. Passwords can only be received from the JSON API
and only in an encrypted way. ConfigContext will not send passwords. Instead an empty string for that items will be send).
- choice (which is a combination of an integer as index and a array with available choices).
Remarks
Don't use ConfigItem direktly (however, because of the pure virutal functions the compiler don't let you do so). Use one of the pre defined ConfigItem
subclasses (as described below) or implement your own to map the data type of your choice the one of the base data types using a subclass of ConfigItem.
When creating a subclass, each functions (except GetName() and Changed()) must be implemented by the subclass!
Protected variables
bool changed
Must be set from within the ReadValue* functions to show whether the value of the item had been changed or not.
bool unmanaged
Defines whether the item is unmanaged or not. An unmanaged item cannot be accessed through the JSON API. It is recommended to not touch this
value in an subclass and only set it using the constructor of ConfigItem.
Protected functions
ReadValueFromDataset
Will be called during loading the data from the database. An derived class should get the value from the "value" field of the dataset (by calling the
datasets functions to get a value by field name, see IDataSet for details) and stores that to an
internal variable in whatever datatype needed. Don't make a copy of the dataset pointer, because it will be released after all data had ben read from
the database. There is no need to control the items name inside the dataset, because ConfigContext will determine the config item the current row in dataset
is for by the config item name of that row.
Parameters
| class IDataSet * dataset | The dataset instance holding the row responsible for the item. |
Remarks
Never ever delete the given dataset, store the pointer for later use or call Next() or FetchNextRow() of the dataset instance, or everything will be
screwed up!
ReadValueFromJSON
Will be called during parsing a JSON received from the JSON API. The function need to get the value (depending on the type, see the JSON message description below)
and store it into an internal variable. If the value differes from the previous value, the function must set the changed flag to true.
A subclass of ConfigItem read the value of the datatype needed from the given json_io instance. It must check, if there is data for that item not not get undefined
behaviour. The name for the field is the same as the one for the config value.  See the JSON describtion below.
Parameters
| class json_io * json | The json_io instance to read the config item value from. |
| dword base | The base id inside the json to start reading the config item data. |
| class IJsonApiConnection * const connection | The IJsonApiConnection instance that sent the data to write. |
WriteValueToJSON
When an JasonApiContext requests the configuration of an application through the JSON API, ConfigContext will call WriteValueToJSON for each config item.
The function need to write their value to the given json_io instance by calling the propriate function for the value to write. The value should be written
using the name of the config item as name for the JSON item to write which get be done using the GetName() function of ConfigItem
(e. g. json->add_usnigned(base, this->GetName(), this->value, convBuf)). Config item that are type of choice item need also to store the choices to them.
See the JSON message description below.
Parameters
| class json_io * json | The json_io instance to write the config item value to. |
| dword base | The base id inside the json to start writing the config item data. |
| char * & convBuf | A pointer to a buffer used by json_io to convert numbers to strings. You only need it if
number values need to be written to the json_io instance. |
| class IJsonApiConnection * const connection | The IJsonApiConnection instance that requested the config. |
WriteValueToString
When writing the value to the database, ConfigContext needs it as string (because the values from the config items are stored as strings only to the database).
So for each config item this function will be called so that the function can convert the value to write it into the given buffer (or copy it, if the value of
the item is already in string format).
Parameters
| char * dest | The destination buffer to write the value to as string. Dest can also be nullptr. In that case, the function
only should return the length of the string that will be written to the buffer if given in dest. |
Return value
The function must return the length of the string put to dest, also if dest nullptr.
WriteItemTypeToJSON
The JavaScript config library requests all config items registeres to ConfigContext and needs to now what type there are. For this, ConfigContext calls WriteItemTypeToJSON.
A ConfigItem subclass needs the following fields to the given json_io instance:
- name The name of the config item. You can use ConfigItem::GetName() for this.
- type The type of the config item wich must be one of the items listed below.
- password This field must only be added (and then be added with the value true), if the item holds a string password value.
- minVal (For integer types only) The minumum value the item can have.
- maxVal (For integer types only) The maximum value the item can have.
Type need to be one of the followin value (the names of defines for that type is given in brackets):
- BOOL The item is a BOOl type (CFG_TYPE_BOOL)
- INT The item is a signed 32bit integer type (CFG_TYPE_INT)
- DWORD The item is an unsigned 32bit integer type (CFG_TYPE_DWORD)
- LONG64 The item is a signed 64bit integer type (CFG_TYPE_LONG64)
- ULONG64 The item is an unsigned 64bit integer type (CFG_TYPE_ULONG64)
- STRING The item is a string type (CFG_TYPE_STRING)
- CHOICE The item is a choice type (CFG_TYPE_CHOICE)
Parameters
| class json_io * json | The json_io instance to write the config item type information. |
| dword base | The base id inside the json to start writing the config item type information. |
| char * & convBuf | A pointer to a buffer used by json_io to convert numbers to strings. You only need it if
number values need to be written to the json_io instance. |
Public functions
ConfigItem (Constructor)
The constructor of the class.
Parameters
| ConfigContext * context | The ConfigContext instance the item itself will reigster to it. |
| char * name | The name of the config item. Must be unique withing the given ConfigContext. |
| bool unmanaged | If set to true, the item is unmanaged and with this not accassable through the JSON API. |
GetName
Return value
Returns the name of the config item as passed to the constructor.
Changed
Return value
Returns ture, if the item had been changed the last time the config items had been saved using the JSON API. The only good place to call that function
will be within ConfigContext::ConfigChanged() and ConfigContext::ConfigChangedUnmanaged() to figure out, wich item actually had been changed and maybe
nead to lead to additional updates inside the application.
HasDefaultValue
Return value
Returns true, if the current value of the item equals the default value given on creation, else false.
Remarks
ConfigItem itself doesn't have handlig of default value, so it need to be implemented from a subclass.
Reset
Resets the config item and set the value to the default value. Must be implemented by a subclass.
ConfigChoice
class ConfigChoice : public ConfigItem {
public:
ConfigChoice(ConfigContext * context, const char * name, size_t defVal, const char ** options, bool unmanaged = false);
virtual ~ConfigChoice();
int ValueIdx() const { return this->valueIdx; }
const char * Value() const { return (this->valueIdx < this->optionsCount ? this->choiceValues[this->valueIdx] : nullptr); }
void SetValue(const char * option);
void SetValueIdx(size_t valudIdx);
bool HasDefaultValue() override;
void Reset() override;
};
Overview
This config item is for providing a couple of available options and selecting one of them (that can be used e. g. for setting the language for an UI). The choice
options will be passes as an array of string (terminated by a nullptr entry), while the choice itself represents the index inside that array. However, ConfigChoice
will write the choice itself to the database instead of the index. So if there need to localize the options, the application needs to provide some kind of mapping.
Using the options in a way to show them directly inside a UI is not the best idea.
Public functions
ConfigChoice (Constructor)
The constructor of the class.
Parameters
| ConfigContext * context | The ConfigContext instance the item itself will reigster to it. |
| char * name | The name of the config item. Must be unique withing the given ConfigContext. |
| size_t defVal | The index of the default value inside the given options array. |
| const char ** options | The options proivided by an array of char pointers terminated by a nullptr entry. ConfigOptions
won't copy that array, so it should be guaranteed that this array exists over the lifetime of the
COnfigOptions instance. |
| bool unmanaged | (Default false) If set to true, the item is unmanaged and with this not accassable through the JSON API. |
ValueIdx
Return value
Returns the index of the currently selected option.
Value
Return value
Returns the value of the current selected options. This will be the same as options[ConfigItem::ValuedIdx()].
Remarks
If the current value index is out of range of the options array, nullptr will be returned.
SetValue
Set the current value of ConfigItem by passing a string that also is inside the options array. Calling this function will internally set the
value index to the correct value. If the given option cannot be found, the internal value index will be set to 0.
Parameters
| const char * option | The option to set. Must be inside the options array passed to the constructor of ConfigChoice. |
Remarks
SetValue() can only be called for items with unmanaged flag set to true. Everything else will lead to an assertion.
Note that this won't affect the internal changed flag.
You also should take care the case of the given string, because SetValue() will make a case sensitive compare to each string inside the options array.
SetValueIdx
Will set the internal index to the given value. If the given value is out of range, the internal index will set to 0.
Parameters
| size_t valueIdx | The new index to set. |
Remarks
SetValueIdx() can only be called for items with unmanaged flag set to true. Everything else will lead to an assertion.
Note that this won't affect the internal changed flag.
HasDefaultValue
Return value
Returns true, if the current value of the item equals the default value given on creation, else false.
Reset
Resets the config item and set the value to the default value.
ConfigBool
class ConfigBool : public ConfigItem {
public:
ConfigBool(ConfigContext * context, const char * name, bool defVal, bool unmanaged = false);
virtual ~ConfigBool();
bool Value() const { return this->value; }
void SetValue(bool value);
bool HasDefaultValue() override;
void Reset() override;
};
Overview
This config item will store a simple boolean value.
Public functions
ConfigBool (Constructor)
The constructor of the class.
Parameters
| ConfigContext * context | The ConfigContext instance the item itself will reigster to it. |
| char * name | The name of the config item. Must be unique withing the given ConfigContext. |
| bool defVal | The default value for the item. |
| bool unmanaged | (Default false) If set to true, the item is unmanaged and with this not accassable through the JSON API. |
Value
Return value
Returns the current value of the config item.
SetValue
Set the value of the config item to the given one.
Parameters
| bool value | The new value to set. |
Remarks
SetValue() can only be called for items with unmanaged flag set to true. Everything else will lead to an assertion.
Note that this won't affect the internal changed flag.
HasDefaultValue
Return value
Returns true, if the current value of the item equals the default value given on creation, else false.
Reset
Resets the config item and set the value to the default value.
ConfigInt
class ConfigInt: public ConfigItem {
public:
ConfigInt(ConfigContext * context, const char * name, int defVal, bool unmanaged = false, int minVal = INT32_MIN, int maxVal = INT32_MAX);
virtual ~ConfigInt();
int Value() const { return this->value; }
void SetValue(int value);
bool HasDefaultValue() override;
void Reset() override;
};
Overview
This config item will store a 32bit singed integer.
Public functions
ConfigInt (Constructor)
The constructor of the class.
Parameters
| ConfigContext * context | The ConfigContext instance the item itself will reigster to it. |
| char * name | The name of the config item. Must be unique withing the given ConfigContext. |
| int defVal | The default value for the item. |
| bool unmanaged | (Default false) If set to true, the item is unmanaged and with this not accassable through the JSON API. |
| int minVal | (Default: INT32_MIN) The minimum value that can be set to that item. |
| int maxVal | (Default: INT32_MAX) The maximum value that can be set to that item. |
Value
Return value
Returns the current value of the config item.
SetValue
Set the value of the config item to the given one.
Parameters
| int value | The new value to set. |
Remarks
SetValue() can only be called for items with unmanaged flag set to true. Everything else will lead to an assertion.
Note that this won't affect the internal changed flag.
If the value passed to SetValue() is less than minVal (given to the constructor), the internal value will be set to minVal. If it is greater than
maxVal, the internal value will be set to maxVal.
HasDefaultValue
Return value
Returns true, if the current value of the item equals the default value given on creation, else false.
Reset
Resets the config item and set the value to the default value.
ConfigDword
class ConfigDword : public ConfigItem {
public:
ConfigDword(ConfigContext * context, const char * name, dword defVal, bool unmanaged = false, dword minVal = 0, dword maxVal = UINT32_MAX);
virtual ~ConfigDword();
dword Value() const { return this->value; }
void SetValue(dword value);
bool HasDefaultValue() override;
void Reset() override;
};
Overview
This config item will store a 32bit unsinged integer.
Public functions
ConfigDword (Constructor)
The constructor of the class.
Parameters
| ConfigContext * context | The ConfigContext instance the item itself will reigster to it. |
| char * name | The name of the config item. Must be unique withing the given ConfigContext. |
| dword defVal | The default value for the item. |
| bool unmanaged | (Default false) If set to true, the item is unmanaged and with this not accassable through the JSON API. |
| dword minVal | (Default: 0) The minimum value that can be set to that item. |
| dword maxVal | (Default: UINT32_MAX) The maximum value that can be set to that item. |
Value
Return value
Returns the current value of the config item.
SetValue
Set the value of the config item to the given one.
Parameters
| dword value | The new value to set. |
Remarks
SetValue() can only be called for items with unmanaged flag set to true. Everything else will lead to an assertion.
Note that this won't affect the internal changed flag.
If the value passed to SetValue() is less than minVal (given to the constructor), the internal value will be set to minVal. If it is greater than
maxVal, the internal value will be set to maxVal.
HasDefaultValue
Return value
Returns true, if the current value of the item equals the default value given on creation, else false.
Reset
Resets the config item and set the value to the default value.
ConfigLong64
class ConfigLong64 : public ConfigItem {
public:
ConfigLong64(ConfigContext * context, const char * name, long64 defVal, bool unmanaged = false, long64 minVal = INT64_MIN, long64 maxVal = INT64_MAX);
virtual ~ConfigLong64();
long64 Value() const { return this->value; }
void SetValue(long64 value);
bool HasDefaultValue() override;
void Reset() override;
};
Overview
This config item will store a 64bit singed integer.
Public functions
ConfigLong64 (Constructor)
The constructor of the class.
Parameters
| ConfigContext * context | The ConfigContext instance the item itself will reigster to it. |
| char * name | The name of the config item. Must be unique withing the given ConfigContext. |
| long64 defVal | The default value for the item. |
| bool unmanaged | (Default false) If set to true, the item is unmanaged and with this not accassable through the JSON API. |
| long64 minVal | (Default: INT64_MIN) The minimum value that can be set to that item. |
| long64 maxVal | (Default: INT64_MAX) The maximum value that can be set to that item. |
Value
Return value
Returns the current value of the config item.
SetValue
Set the value of the config item to the given one.
Parameters
| long64 value | The new value to set. |
Remarks
SetValue() can only be called for items with unmanaged flag set to true. Everything else will lead to an assertion.
Note that this won't affect the internal changed flag.
If the value passed to SetValue() is less than minVal (given to the constructor), the internal value will be set to minVal. If it is greater than
maxVal, the internal value will be set to maxVal.
HasDefaultValue
Return value
Returns true, if the current value of the item equals the default value given on creation, else false.
Reset
Resets the config item and set the value to the default value.
ConfigUlong64
class ConfigUlong64 : public ConfigItem {
public:
ConfigUlong64(ConfigContext * context, const char * name, ulong64 defVal, bool unmanaged = false, ulong64 minVal = 0, ulong64 maxVal = UINT64_MAX);
virtual ~ConfigUlong64();
ulong64 Value() const { return this->value; }
void SetValue(ulong64 value);
bool HasDefaultValue() override;
void Reset() override;
};
Overview
This config item will store a 64bit singed integer.
Public functions
ConfigUlong64 (Constructor)
The constructor of the class.
Parameters
| ConfigContext * context | The ConfigContext instance the item itself will reigster to it. |
| char * name | The name of the config item. Must be unique withing the given ConfigContext. |
| ulong64 defVal | The default value for the item. |
| bool unmanaged | (Default false) If set to true, the item is unmanaged and with this not accassable through the JSON API. |
| ulong64 minVal | (Default: 0) The minimum value that can be set to that item. |
| ulong64 maxVal | (Default: UINT64_MAX) The maximum value that can be set to that item. |
Value
Return value
Returns the current value of the config item.
SetValue
Set the value of the config item to the given one.
Parameters
| ulong64 value | The new value to set. |
Remarks
SetValue() can only be called for items with unmanaged flag set to true. Everything else will lead to an assertion.
Note that this won't affect the internal changed flag.
If the value passed to SetValue() is less than minVal (given to the constructor), the internal value will be set to minVal. If it is greater than
maxVal, the internal value will be set to maxVal.
HasDefaultValue
Return value
Returns true, if the current value of the item equals the default value given on creation, else false.
Reset
Resets the config item and set the value to the default value.
ConfigString
class ConfigString : public ConfigItem {
public:
ConfigString(ConfigContext * context, const char * name, const char * defVal, bool unmanaged = false, bool isPassword = false);
virtual ~ConfigString();
const char * Value() const { return this->value; }
void SetValue(const char * value);
bool HasDefaultValue() override;
void Reset() override;
static void Encrypt(const char * seed, const char * password, char * out, size_t len);
static void Decrypt(const char * seed, const char * password, char * out, size_t len);
};
Overview
This config item will store string value. That also can be a password (of isPassword of the constructor is set to true). In that case, an empty string
instead of the password itself will be send to a JsonApiContext. When setting a new value for that item using the JSON API, the password must be encrypted.
See the JSON messages description below for more details. Gladly, the encryption and decryption part is handled inside the JavaScript config library as
well as inside the C++ library.
Remarks
Note that even passwords must be send by a JsonApiContext in an encrypted format, the password itself will be saved unencrypted to the database. This
is not a big problem, because the database of an application can only be accassed after passing the login-procedure on the JavaScript side. On the linux
(C++) side, the access to the database is also protected by username and password. However, an app is free to encrypt the password itself before sending
it to ConfigContext (or setting it using SetValue() for unmanaged items), which will end up in an encrpyted password inside the databse. In that case,
the app also must decrypt the password when needed.
Public functions
ConfigString (Constructor)
The constructor of the class.
Parameters
| ConfigContext * context | The ConfigContext instance the item itself will reigster to it. |
| char * name | The name of the config item. Must be unique withing the given ConfigContext. |
| char * defVal | The default value for the item. |
| bool unmanaged | (Default false) If set to true, the item is unmanaged and with this not accassable through the JSON API. |
| bool isPassword | (Default false) If set to true, the item is handled as password string and will not be send to a JsonApiContext. |
Remarks
Note that ConfigString won't make a copy of the default value given in devVal. It will only store the pointer. So an application must guarantee, that the string
passed to the constructor will exist and also not be changed over the lifetime of a ConfigString object.
Value
Return value
Returns the current value of the config item.
Remarks
If the item is defined as password, Value() will return that password in plain text.
SetValue
Set the value of the config item to the given one.
Parameters
| ulong64 value | The new value to set. |
Remarks
SetValue() can only be called for items with unmanaged flag set to true. Everything else will lead to an assertion.
Note that this won't affect the internal changed flag.
If the item is defined as password, the password must be set unencrypted here (or Value() will return it encrypted, too).
HasDefaultValue
Return value
Returns true, if the current value of the item equals the default value given on creation, else false.
Reset
Resets the config item and set the value to the default value.
Encrypt
Encrypts a password with a seed and writes the result to an output buffer. The encrypted password can be decrypted with the same seed again.
Parameters
| const char * seed | A seed to use. |
| const char * password | The clear text password. |
| char * out | Output buffer. The buffer should have a size of strlen(password) * 2 + 1. |
| size_t len | The length of the output buffer. |
Decrypt
Decrypts a password with a seed and writes the result to an output buffer.
Parameters
| const char * seed | A seed to use. |
| const char * password | The encrypted password. |
| char * out | Output buffer. The buffer should have a size of strlen(password) / 2 + 1. |
| size_t len | The length of the output buffer. |
JSON Messages
Overview
Below is the description of the JSON messages the ConfigContext shares with the JavaScript config library. Note that some of the fields are optional end depend on the value
of other fields. You are free to implement your only config javascript library, but note that this messages only will be accepted after sucessfully logging into an appservice
using the AppWebsocket javascript library. See JavaScript config library for details.
The Config protocol supports the AppWebsocket "src" mechanism.
Base message
{
"api": "Config",
"src": string,
"mt": "ConfigMessage"
}
All messages send from and to ConfigContext always have the same header. The property api defines the message as part of the configuration API of the SDK, mt defines the message
itself and will be one of the following values:
Send to ConfigContext
Send from ConfigContext
GetConfigItems
{
"api": "Config",
"mt": "GetConfigItems"
}
Overview
Before reading the current config, the list of available config items should be requested first. This will be done by the GetConfigItems message, which will lead to a
GetConfigItemsResult with the list of config items and details to them.
GetConfigItemsResult
{
"api": "Config",
"mt": "GetConfigItems",
"result": "AccessDenied",
"ConfigItems": [ConfigItemObject]
}
Overview
This will be the answer for a GetConfigItems message. Beside the message base, there will be another property which is either result or ConfigItems.
Fields
result
If the JsonApiContext that sent the GetConfigItems message doens't have the right to read the config, the result property will be set (always with the value "AccessDenied").
In that case, result is the only additional one. If access is allowed, no result property will be sent within that message.
ConfigItems
If the JsonApiContext that has sent the GetConfigItems message has the right to read the config, an array named ConfigItems will be send. This array can be empty (if there
are no config items), or filled with objects descriped in ConfigItemObject providing the informations for an config item.
ConfigItemObject
{
"name": "ConfigItemName",
"type": "TypeOfItem",
"minVal" : Number,
"maxVal" : Number,
"password" : true,
"choices" : [ListOfChoices]
}
name
The name of the config item as defined on the C++ side.
type
The type of the config item. Will be one of the following:
- BOOL A boolean field.
- INT A 32bit singed integer field.
- DWORD A 32bit unsigned integer field.
- LONG64 A 64bit singed integer field.
- ULONG64 A 64bit unsigned integer field.
- STRING A string field.
- CHOICE A choice field.
minVal (optional)
(Only for config item types INT, DWORD, LONG64 and ULONG64) If set, the property defines minimum value accepted by that config item.
maxVal (optional)
(Only for config item types INT, DWORD, LONG64 and ULONG64) If set, the property defines maximum value accepted by that config item.
password (optional)
(Only for config item type STRING) If exists (and in that case always set to true), the string config item is defined as password string. That means,
that ReadConfig and ConfigUpdate never will send the real value for that item (an empty string will be send instead). And when writing a value to that item,
it must be encrypted. That encryption is handled by the JavaScript config library.
choices
(Only for config item type CHOICE) An array with the available choices to choose. Each choice is represented by a string value.
Example message
{
"api": "Config",
"mt": "GetConfigItemsResult",
"ConfigItems": [{
"name" : "maxPlayers",
"type" : "DWORD",
"minVal" : 1,
"maxVal" : 10
},
{
"name" : "teams",
"type" : "CHOICE",
"choices" : ["RedTeam", "BlueTeam", "InnoTeam"]
},
{
"name" : "playerName",
"type" : "STRING"
}]
}
ReadConfig
{
"api": "Config",
"mt": "ReadConfig"
}
Overview
This will request the current configuration which will lead to a ReadConfigResult message.
ReadConfigResult / ConfigUpdate
{
"api": "Config",
"mt": "ReadConfigResult" / "ConfigUpdate"
"ConfigItems" : {
"ItemName" : number,
"ItemName" : true / false,
"ItemName" : "stringValue"
}
}
Overview
This message will be used to send the current configuration after requested (ReadConfigResult) or after the config had been changed on the C++ side (ConfigUpdate). The messages for
ReadConfigResult and ConfigUpdate are the same except the value of the mt property, of course.
ConfigItems
This array holds all config items and their values. Each item will be send by a property with the name of the item and the value. The value type depends of the type of the config item itself:
- INT, DWORD, LONG64, ULONG64: The value as number with the bitwith according the config item type.
- CHOICE: The zero based index inside the array of choices received with the GetConfigItemsResult message.
- BOOL: Simply true or false.
- STRING: The string value of the item.
Example message
{
"api": "Config",
"mt": "ReadConfigResult",
"ConfigItems": {
"maxPlayers" : 5,
"teams" : 2,
"playerName" : "Goldfish"
}
}
WriteConfig
{
"api": "Config",
"mt": "WriteConfig",
"ConfigItems": {
"ItemName": number,
"ItemName": true / false,
"ItemName": "StringValue",
"ItemNamePassword": {
"value": "EncodedValue",
"key": "KeyToDecode"
}
}
}
Overview
With this message, ConfigContext will update the internal config items with the values sent by the message. Each property value that differ from the appropriate config items dfefault value or current value,
will be updated in memory and written to the database.
ConfigItems
This array holds all config items and their values. Each item will be send by a property with the name of the item and the value. The value type depends of the type of the config item itself:
- INT, DWORD, LONG64, ULONG64: The value as number with the bitwith according the config item type.
- CHOICE: The zero based index inside the array of choices received with the GetConfigItemsResult message.
- BOOL: Simply true or false.
- STRING: The string value of the item.
There is one special field for string config items that are defined as password strings. For this items, "Password" must be added to the items name and set as the property that holds an array.
Inside this array, the encrypted string value will be set to the value property, while the key property holds the key needed to decode the string inside value. The encryption must be done by
creating a value for the key and call the decrypt function of appWebsocket with that created key and the string to encode. Both informations (the encrypted string and the key) are used by
ConfigContext do decrypt the password again.
WriteConfigResult
{
"api":"Config",
"mt":"WriteConfigResult",
"result":"ok"
}
Overview
This message will be send as answer to WriteConfig.
result
The result of the WriteConfig message which can be one of the following value:
- ok The config had been sucessfully witten to the database.
- failed Writing the config failed. See the log of the application service for details (logging of config must be enabled).
- AccessDenied The connection does't have the right to write the config.
Code examples
ConfigContext
// A simple class derived from ConfigContext
static const char * team_names[] = { "ReadTeam", "BlueTeam", "InnoTeam", nullptr };
class MyConfig : public ConfigContext() {
private:
class MyApp * myApp;
ConfigInt maxPlayers;
ConfigString playerName;
ConfigChoice teams;
protected:
virtual void ConfigChanged()
{
this->myApp->OnConfigChanged();
}
public:
// Let's assume, that MyApp is derived from JsonApiContext.
MyConfig(class MyApp * userApp, class IDatabase * database, class IInstanceLog * log)
: ConfigContext(database, log),
maxPlayers(this, "maxPlayers", 5, false, 1, 10),
playerName(this, "playerName", "Goldfish"),
teams(this, "teams", 2, team_names)
{
this->myApp = userApp;
this->myApp->RegisterJsonApi(this);
}
ConfigInt & MaxPlayers() { return this->maxPlayers; }
ConfigString & PlayerName() { return this->playerName; }
ConfigChoice & Teams() { return this->teams; }
};
Using config
// Let's assume, that MyApp is derived from JsonApiContext and UTask, already
// created and also has pointers to an already created and initialized IDatabase
// instance as well as valid IInstanceLog instance.
void MyApp::Init()
{
this->config = new MyConfig(this, this->database, this->log);
ITask * initConfigTask = this->config->CreateInitTask();
initConfigTask->Start(this);
}
void MyApp::TaskComplete(ITask * task)
{
delete task;
debug->printf("Config database initialized");
}
void MyApp::OnConfigChanged()
{
debug->printf("Config changed - new values:");
debug->printf(" Max-Players : %u", this->config->MaxPlayers().Value());
debug->printf(" Player-Name : %s", this->config->PlayerName().Value());
debug->printf(" Selected Team : %s", this->config->Teams().Value());
}
First Steps
To use config some preparations in your code needs to be done. The following steps appply
when you use ConfigContext as base class to your instance class and do not use a separate
class for the config. This is a good option in most cases.
- Includes
-
Use config.h as include
#include "common/lib/config.h"
- Definitions in the instance class
-
Use JsonApiContext and ConfigContext as base class
..., public JsonApiContext, public ConfigContext
Define a private function, as initialization complete handler
void ConfigInitComplete(class ITask * task);
Define a UTaskTemplate class so that this handler will be called
class UTaskTemplate<YourApp, class ITask> taskConfigInit;
Define public members for the config parameters, e.g
class ConfigString configParameter;
- Instance Code
-
Initializations in the constructor of the instance class
ConfigContext(0, this),
taskConfigInit(this, &yourApp::ConfigInitComplete),
configParameter(this, "parameter", "")
Call RegisterJsonApi in the instance constructor, so that the Config lib
is known as Api provider
RegisterJsonApi(this);
Start config initialization after database is connected. E.g. in the
DatabaseConnectComplete function
class ITask * task = CreateInitTask(database);
task->Start(&taskConfigInit);
Continue initialization when config init is complete
void YourApp::ConfigInitComplete(class ITask * task)
{
... more init ...
}
Make sure the you instance class is passed as jsonApiContext in the AppWebsocket
constructor
AppWebsocket(webserverPlugin, yourApp, yourApp)


Preparation time
less than 30 mins
Cooking time
10 to 30 mins
Serves
Serves 2
A delightful springtime dinner for two using some of the very best of English produce.
Preheat the oven to 190C/170C Fan/Gas 5. Boil the potatoes in lightly salted water until cooked through. Drain and leave to cool, then slice them thinly.
Heat half the oil in a large frying pan and sauté the potatoes for 5–10 minutes, or until golden-brown on both sides.
Meanwhile, heat the remaining oil in a large, ovenproof frying pan over a high heat. Sear the lamb for 1 minute on each side, until the fat has rendered. Transfer to the oven for 5 minutes, then leave to rest for 3 minutes.
Meanwhile, boil the broccoli florets in salted water for 4 minutes. Drain and blend with a hand-held blender until smooth. Check the seasoning.
Boil the asparagus, purple and white sprouting broccoli in salted water for 2–3 minutes. Drain.
Heat the butter in a large frying pan. When foaming, add the garlic and rosemary and cook for 1 minute. Pour this over the lamb and carve into thick slices.
To serve, place the broccoli purée in the centre of a serving dish. Scatter over the new potatoes and arrange the lamb slices around them. Nestle in the broccoli and asparagus spears and drizzle with rapeseed oil.


Sorry, favourable travel options could not be determined according to your requirements
This could be due to:
-
Flights, Trains or Buses are not available in the dates you specified
-
The duration of travel is not sufficient to cover the destinations
Tip: You should change the travel dates and try again.


The following DEMOs exemplifies how WebAudioXML can be used to build various types of web audio applications.
Learn how to implement audio sample playback.
/Gamelan/index.htmlLearn how to control an audio sample playback with WebAudioXML.
/PlaybackRate/index.htmlLearn how to build an FM-synth with one carrier and one modulator oscillator using WebAudioXML. The graphical interface is build with webaudio-controls.
/FM-synth/index.htmlLearn how to build a touch controlled instrument where the X-axis controls the pitch and the Y-axis the filter cutoff.
/TouchInstrument/index.htmlLearn how to build a touch-controlled instrument where the musical scale is dynamically controlled by the pointer gesture. It switches between minor and major depending on the direction of the melody.
/FlexibleScale/index.htmlLearn how to build complex mappings between an incoming variable and the frequency output. In this example different regions on the X-axis map to either sliding pitches or musical scales.
/MultipleRegions/index.htmlThis DEMO shows how WebAudioXML can be used to create a multi-purpose-slider to control music mixing. The graph indicates the levels for the different tracks and effects along the axis of slider values. WebAudioXML is a language that lets a developer configure an audio setup and specify the mapping between incoming variables (like a slider) to control one or many audio parameter (like gain or frequency).
/MultiTargetSlider/index.htmlThis DEMO shows how multiple smartphone web-clients can be setup to send Device Orientation Data and up to five independent touches via a node.js https-server. The server uses socket.io to pass the data to a master web-page that plays audio using WebAudioXML and iMusicXML. THere are a few steps to follow in order to run the project:
github.com/hanslindetorp/SmartphoneOrchestra


While other little boys wanted to be cops or cowboys, firemen or astronauts, 8 year old James Dalton wanted nothing more than to be a ScientistInventorEntrepreneur. His first big break came when he developed a method for making "unbreakable" pencils that he sold to his classmates to be used for "pencil break", a modern-age sword fight epic that required breaking your friend's pencils against your own. After his business was squashed by The Man for being too distracting, James turned his brain towards bigger and better pursuits: designing and building a homemade scooter, building a go-cart, obtaining a B.S. degree in Mechanical Engineering from UT Austin.
After ten years of marching down the traditional Oil & Gas Mechanical Engineer path with a few detours down the Stay-At-Home-Dad path and the damn-it-I'm-laid-off-what-now-path, the Sugar Land native decided he was ready once again to turn his MindHeartSoul to the ScientistInventorEntrepreneur path. After many a late night discussion and a good strong push off the cliff from his wife, he enrolled in a UT programming boot-camp where he is learning to let his 8 year-old self free to explore, learn, code, program, design and play. With his strong engineering background and aptitude for all things Mechanical, James wants nothing more than to help others pursue their own financial and work freedoms, whether that be through web design, programming, Bitcoin pursuits or other engineering services.
When he's not locked and loaded behind a computer, James loves inventing games and completing projects with his son, who takes after his Dad's stubborn tenacity. He also enjoys watching classic movies and playing chess with his wife. He occasionally enjoys hanging out with the family dog too, particularly on late nights when everyone else is in bed and the two of them enjoy the stars and moonlight together.


1 Description
Write a program (C, C++, or Java) that simulates the execution of a MIPS program. Your simulator will read a "binary" file that contains hexadecimal representations of the text and initialized data segments (see Section 2). The program will utilize only a subset of the MIPS R2000 instruction set (see Section 3). Your simulator should provide two modes: single step and run-to-completion. During single-step you should be able to print out the value of a specified register or to print all registers (see Section 4 for more details on the interface). In general, your program will perform the fetch execute cycle, reading instructions from memory, decoding them, and performing the appropriate operation on "simulated" registers and/or memory.
You will do two things to test your simulator. First, you will run a "torture test " program that we provide. Running this program in single step mode will help isolate problems. You should also write some test programs on your own to test your simulator, and compare the results with spim. Section 5 provides more information on what to turn in. Monitor the course newsgroup and web page frequently for information regarding this project.
1.1 Memory Allocation
Although we have reasoned about memory as a single linear array in class, you can not allocate memory in your simulator as a single array. Instead, you should allocate three separate arrays for the text, static data and stack segment, respectively. You must read the instructions and static (initialized) data from the "binary" file into the corresponding simulator array. You can assume the text segment will not exceed 2 kilobytes (2*1024), the static data segment will not exceed 4 kilobytes, and the stack segment will not exceed 2 kilobytes. Be sure to consider that from the program's perspective, the text segment begins at address 0x00400000 and the static data segment begins at address 0x10010000.
The program expects a valid stack pointer at address 0x7fffefff, (so the first valid aligned stack address is 0x7fffeffc, which is the value the stack pointer should have when the program begins execution). When the program accesses one of these segments, you must compute the appropriate offset into your "simulated" segment.
2 MIPS Binary File
2.1 Generating the Binary File
To generate the binary files from your assembly programs, use the command "/afs/acpub/project/cps/bin/spimlist -notrap -file file.s > hex.out" on the ACPUB Suns (godzilla.acpub.duke.edu); this will create a file always called hex.out in the directory where you executed the command. The file hex.out contains the hex equivalent in the format described below.
2.2 Binary File Format
The binary files will have a marker (DATA SEGMENT) that indicates where the code (text) segment ends and the static data segment begins you need to jump to loading the data into address 0x10010000 at that point. Also, since I don't want to include all 4K entries of the static data segment, I only list those which are not 0; I list their addresses followed by the data in word-aligned format. As an example, the assembly program "sum.s", which computes the sum of 9 numbers, lists as follows (see the code section of the course web page for the source of "sum.s", note that pseudoinstructions are translated into actual instructions):
0x27bdffd8
0xafbf0024
0xafb30020
0xafb2001c
0xafb10018
0xafb00014
0x00001021
0x00008821
0x3c011001
0x34300000
0x3c011001
0x34320024
0x3c011001
0x34330024
0x8e0e0000
0x022e8821
0x34020004
0x00122021
0x0000000c
0x34020001
0x00112021
0x0000000c
0x34020004
0x3c011001
0x34240030
0x0000000c
0x26100004
0x1613fff3
0x00001021
0x8fb00014
0x8fb10018
0x8fb2001c
0x8fb30020
0x8fbf0024
0x27bd0028
0x03e00008
DATA SEGMENT
0x10010000 0x00000023
0x10010004 0x00000010
0x10010008 0x0000002a
0x1001000c 0x00000013
0x10010010 0x00000037
0x10010014 0x0000005b
0x10010018 0x00000018
0x1001001c 0x0000003d
0x10010020 0x00000035
0x10010024 0x54686520
0x10010028 0x73756d20
0x1001002c 0x69732000
0x10010030 0x0a000000
3 Instructions you must Simulate
Below is the complete list of instructions that you must correctly simulate. Notice there are no floating point or coprocessor instructions, but syscall is a requirement. As you are simulating actual hardware, you will not simulate pseudoinstructions (like LI: load immediate, or MOVE) which are translated by the assembler into actual instructions (usually ORI: or immediate in the case of LI) - you will only simulate "real" instructions that have an opcode. In your programs, you can continue to use pseudoinstructions, as the assembler will continue to make all the translations SPIM would make. Use Appendix A to obtain the corresponding OPCODES, and instruction formats.
You do not need to simulate the actual hardware execution of each individual operation. For example, to simulate ADD r3, r4, r5, you can use the + operator in C++, to perform r3 = r4 + r5, where r3, r4, & r5 are "simulated" registers. Similarly, *, /, -, ^, <<, >>, etc., can be used to "simulate" instruction execution.
Instructions you must simulate:
LB load byte
LBU load byte unsigned
LW load word
SB store byte
SW store word
LUI load upper immediate
ADD add
ADDI add immediate
ADDU add without overflow
ADDIU add immediate without overflow
AND and
MULT multiply
MULTU unsigned multiply
OR or
ORI or immediate
XOR xor
SLL shift left logical
SRA shift right arithmetic
SRL shift right logical
SUB subtract with overflow
SUBU subtract without overflow
SLT set less than
SLTI set less than immediate
SLTU set less than unsigned
SLTIU set less than immediate unsigned
BEQ branch on equal
BGEZ branch on greater than equal zero
BGTZ branch on greater than zero
BLEZ branch on less than equal zero
BLTZ branch on less than zero
BNE branch on not equal
J jump
JAL jump and link
JR jump register
MFHI move from HI register
MFLO move from LO register
SYSCALL system call-like facilities that SPIM programs can use (implement
syscall code 1,4,5,8,10)
4 Command Line Interface
Your simulator must provide two modes of operation: single step, and run to completion. Programs terminate by using the exit syscall. In single step mode, your simulator should print the assembly representation of the instruction that will be executed. Also, in single step mode you must support the following commands:
p
reg print a specific
register (e.g., p 4, prints the contents in hex of register 4)
p all
print the contents of all registers, including the PC, HI, & LO in hex
d addr
print the contents of memory location
addr in hex, assume
addr is a word address in
hex.
s n
execute the next n instructions and stop (should print each instruction
executed), then wait for the user to input another command
5 What to Hand In
You should submit your program source file, the Makefile (if necessary),
and a README a brief description of principles behind design,
each team members' contribution, and anything
you feel that you would like us to know when grading. The submit name is
sim .


|
STM8S Standard Peripheral Libary
2.2.0
|
Functions | |
| void | CLK_DeInit (void) |
| Deinitializes the CLK peripheral registers to their default reset values. More... | |
| void | CLK_FastHaltWakeUpCmd (FunctionalState NewState) |
| Configures the High Speed Internal oscillator (HSI). More... | |
| void | CLK_HSECmd (FunctionalState NewState) |
| Enable or Disable the External High Speed oscillator (HSE). More... | |
| void | CLK_HSICmd (FunctionalState NewState) |
| Enables or disables the Internal High Speed oscillator (HSI). More... | |
| void | CLK_LSICmd (FunctionalState NewState) |
| Enables or disables the Internal Low Speed oscillator (LSI). More... | |
| void | CLK_CCOCmd (FunctionalState NewState) |
| Enables or disablle the Configurable Clock Output (CCO). More... | |
| void | CLK_ClockSwitchCmd (FunctionalState NewState) |
| Starts or Stops manually the clock switch execution. More... | |
| void | CLK_SlowActiveHaltWakeUpCmd (FunctionalState NewState) |
| Configures the slow active halt wake up. More... | |
| void | CLK_PeripheralClockConfig (CLK_Peripheral_TypeDef CLK_Peripheral, FunctionalState NewState) |
| Enables or disables the specified peripheral CLK. More... | |
| ErrorStatus | CLK_ClockSwitchConfig (CLK_SwitchMode_TypeDef CLK_SwitchMode, CLK_Source_TypeDef CLK_NewClock, FunctionalState ITState, CLK_CurrentClockState_TypeDef CLK_CurrentClockState) |
| configures the Switch from one clock to another More... | |
| void | CLK_HSIPrescalerConfig (CLK_Prescaler_TypeDef HSIPrescaler) |
| Configures the HSI clock dividers. More... | |
| void | CLK_CCOConfig (CLK_Output_TypeDef CLK_CCO) |
| Output the selected clock on a dedicated I/O pin. More... | |
| void | CLK_ITConfig (CLK_IT_TypeDef CLK_IT, FunctionalState NewState) |
| Enables or disables the specified CLK interrupts. More... | |
| void | CLK_SYSCLKConfig (CLK_Prescaler_TypeDef CLK_Prescaler) |
| Configures the HSI and CPU clock dividers. More... | |
| void | CLK_SWIMConfig (CLK_SWIMDivider_TypeDef CLK_SWIMDivider) |
| Configures the SWIM clock frequency on the fly. More... | |
| void | CLK_ClockSecuritySystemEnable (void) |
| Enables the Clock Security System. More... | |
| CLK_Source_TypeDef | CLK_GetSYSCLKSource (void) |
| Returns the clock source used as system clock. More... | |
| uint32_t | CLK_GetClockFreq (void) |
| This function returns the frequencies of different on chip clocks. More... | |
| void | CLK_AdjustHSICalibrationValue (CLK_HSITrimValue_TypeDef CLK_HSICalibrationValue) |
| Adjusts the Internal High Speed oscillator (HSI) calibration value. More... | |
| void | CLK_SYSCLKEmergencyClear (void) |
| Reset the SWBSY flag (SWICR Register) More... | |
| FlagStatus | CLK_GetFlagStatus (CLK_Flag_TypeDef CLK_FLAG) |
| Checks whether the specified CLK flag is set or not. More... | |
| ITStatus | CLK_GetITStatus (CLK_IT_TypeDef CLK_IT) |
| Checks whether the specified CLK interrupt has is enabled or not. More... | |
| void | CLK_ClearITPendingBit (CLK_IT_TypeDef CLK_IT) |
| Clears the CLK's interrupt pending bits. More... | |
|
inline |
Adjusts the Internal High Speed oscillator (HSI) calibration value.
| CLK_HSICalibrationValue | calibration trimming value. can be one of the values of CLK_HSITrimValue_TypeDef |
| None |
Definition at line 913 of file stm8s_clk.h.
|
inline |
Enables or disablle the Configurable Clock Output (CCO).
| NewState | : New state of CCEN bit (CCO register). This parameter can be any of the FunctionalState enumeration. |
| None |
Definition at line 547 of file stm8s_clk.h.
|
inline |
Output the selected clock on a dedicated I/O pin.
| CLK_CCO | : Specifies the clock source. This parameter can be any of the CLK_Output_TypeDef enumeration. |
| None |
Definition at line 756 of file stm8s_clk.h.
|
inline |
Clears the CLK's interrupt pending bits.
Clears the CLK’s interrupt pending bits.
| CLK_IT | specifies the interrupt pending bits. can be one of the values of CLK_IT_TypeDef |
| None |
Definition at line 1024 of file stm8s_clk.h.
|
inline |
Enables the Clock Security System.
| None |
| None |
Definition at line 860 of file stm8s_clk.h.
|
inline |
Starts or Stops manually the clock switch execution.
| NewState | new state of SWEN, value accepted ENABLE, DISABLE. |
| None |
Definition at line 568 of file stm8s_clk.h.
|
inline |
configures the Switch from one clock to another
| CLK_SwitchMode | select the clock switch mode. It can be set of the values of CLK_SwitchMode_TypeDef |
| CLK_NewClock | choice of the future clock. It can be set of the values of CLK_Source_TypeDef |
| NewState | Enable or Disable the Clock Switch interrupt. |
| CLK_CurrentClockState | current clock to switch OFF or to keep ON. It can be set of the values of CLK_CurrentClockState_TypeDef |
| ErrorStatus | this shows the clock switch status (ERROR/SUCCESS). |
| CLK_SwitchMode | select the clock switch mode. It can be set of the values of CLK_SwitchMode_TypeDef |
| CLK_NewClock | choice of the future clock. It can be set of the values of CLK_Source_TypeDef |
| ITState | Enable or Disable the Clock Switch interrupt. |
| CLK_CurrentClockState | current clock to switch OFF or to keep ON. It can be set of the values of CLK_CurrentClockState_TypeDef |
| ErrorStatus | this shows the clock switch status (ERROR/SUCCESS). |
Definition at line 650 of file stm8s_clk.h.
|
inline |
Deinitializes the CLK peripheral registers to their default reset values.
| None |
| None |
Definition at line 442 of file stm8s_clk.h.
|
inline |
Configures the High Speed Internal oscillator (HSI).
| NewState | this parameter is the Wake-up Mode state. |
| None |
Definition at line 468 of file stm8s_clk.h.
|
inline |
This function returns the frequencies of different on chip clocks.
| None |
| the | master clock frequency |
Definition at line 882 of file stm8s_clk.h.
|
inline |
Checks whether the specified CLK flag is set or not.
| CLK_FLAG | Flag to check. can be one of the values of CLK_Flag_TypeDef |
| FlagStatus,status | of the checked flag |
Definition at line 944 of file stm8s_clk.h.
|
inline |
Checks whether the specified CLK interrupt has is enabled or not.
| CLK_IT | specifies the CLK interrupt. can be one of the values of CLK_IT_TypeDef |
| ITStatus,new | state of CLK_IT (SET or RESET). |
Definition at line 990 of file stm8s_clk.h.
|
inline |
Returns the clock source used as system clock.
| None |
| Clock | source used. can be one of the values of CLK_Source_TypeDef |
Definition at line 872 of file stm8s_clk.h.
|
inline |
Enable or Disable the External High Speed oscillator (HSE).
| NewState | new state of HSEEN, value accepted ENABLE, DISABLE. |
| None |
Definition at line 488 of file stm8s_clk.h.
|
inline |
Enables or disables the Internal High Speed oscillator (HSI).
| NewState | new state of HSIEN, value accepted ENABLE, DISABLE. |
| None |
Definition at line 507 of file stm8s_clk.h.
|
inline |
Configures the HSI clock dividers.
| HSIPrescaler | : Specifies the HSI clock divider to apply. This parameter can be any of the CLK_Prescaler_TypeDef enumeration. |
| None |
Definition at line 735 of file stm8s_clk.h.
|
inline |
Enables or disables the specified CLK interrupts.
| CLK_IT | This parameter specifies the interrupt sources. It can be one of the values of CLK_IT_TypeDef. |
| NewState | New state of the Interrupt. Value accepted ENABLE, DISABLE. |
| None |
Definition at line 779 of file stm8s_clk.h.
|
inline |
Enables or disables the Internal Low Speed oscillator (LSI).
| NewState | new state of LSIEN, value accepted ENABLE, DISABLE. |
| None |
Definition at line 527 of file stm8s_clk.h.
|
inline |
Enables or disables the specified peripheral CLK.
| CLK_Peripheral | : This parameter specifies the peripheral clock to gate. This parameter can be any of the CLK_Peripheral_TypeDef enumeration. |
| NewState | : New state of specified peripheral clock. This parameter can be any of the FunctionalState enumeration. |
| None |
Definition at line 612 of file stm8s_clk.h.
|
inline |
Configures the slow active halt wake up.
| NewState | specifies the Slow Active Halt wake up state. can be set of the following values:
|
| None |
Definition at line 590 of file stm8s_clk.h.
|
inline |
Configures the SWIM clock frequency on the fly.
| CLK_SWIMDivider | Specifies the SWIM clock divider to apply. can be one of the value of CLK_SWIMDivider_TypeDef |
| None |
Definition at line 838 of file stm8s_clk.h.
|
inline |
Configures the HSI and CPU clock dividers.
| ClockPrescaler | Specifies the HSI or CPU clock divider to apply. |
| None |
| CLK_Prescaler | Specifies the HSI or CPU clock divider to apply. |
| None |
Definition at line 816 of file stm8s_clk.h.
|
inline |
Reset the SWBSY flag (SWICR Register)
| None |
| None |
Definition at line 932 of file stm8s_clk.h.


Shipping Shipping Address {{delivery.currentOrder.ShippingAddress | address: 'full'}} Use Custom Save Address for Future Use Allow as Billing Address Submit Cancel When do you need your order in your hands? Continue


|
KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
|
Jacobian emulator. More...
#include <trilinos_mvqn_recursive_convergence_accelerator.hpp>
Public Types | |
Type Definitions | |
| typedef std::unique_ptr< TrilinosJacobianEmulator< TSpace > > | Pointer |
| typedef TSpace::VectorType | VectorType |
| typedef TSpace::VectorPointerType | VectorPointerType |
| typedef TSpace::MatrixType | MatrixType |
| typedef TSpace::MatrixPointerType | MatrixPointerType |
Public Member Functions | |
Life Cycle | |
| TrilinosJacobianEmulator (ModelPart &rInterfaceModelPart, const Epetra_MpiComm &rEpetraCommunicator, Pointer &&OldJacobianEmulatorPointer) | |
| TrilinosJacobianEmulator (ModelPart &rInterfaceModelPart, const Epetra_MpiComm &rEpetraCommunicator, Pointer &&OldJacobianEmulatorPointer, const unsigned int EmulatorBufferSize) | |
| TrilinosJacobianEmulator (ModelPart &rInterfaceModelPart, const Epetra_MpiComm &rEpetraCommunicator) | |
| TrilinosJacobianEmulator (const TrilinosJacobianEmulator &rOther) | |
| virtual | ~TrilinosJacobianEmulator () |
Operations | |
| void | ApplyPrevStepJacobian (const VectorPointerType pWorkVector, VectorPointerType pProjectedVector) |
| void | ApplyJacobian (const VectorPointerType pWorkVector, VectorPointerType pProjectedVector) |
| void | AppendColToV (const VectorType &rNewColV) |
| void | AppendColToW (const VectorType &rNewColW) |
| void | DropAndAppendColToV (const VectorType &rNewColV) |
| void | DropAndAppendColToW (const VectorType &rNewColW) |
Protected Attributes | |
Protected member Variables | |
| ModelPart & | mrInterfaceModelPart |
| const Epetra_MpiComm & | mrEpetraCommunicator |
| Pointer | mpOldJacobianEmulator |
| std::vector< VectorType > | mJacobianObsMatrixV |
| std::vector< VectorType > | mJacobianObsMatrixW |
Jacobian emulator.
| typedef TSpace::MatrixPointerType Kratos::TrilinosJacobianEmulator< TSpace >::MatrixPointerType |
| typedef TSpace::MatrixType Kratos::TrilinosJacobianEmulator< TSpace >::MatrixType |
| typedef std::unique_ptr< TrilinosJacobianEmulator<TSpace> > Kratos::TrilinosJacobianEmulator< TSpace >::Pointer |
| typedef TSpace::VectorPointerType Kratos::TrilinosJacobianEmulator< TSpace >::VectorPointerType |
| typedef TSpace::VectorType Kratos::TrilinosJacobianEmulator< TSpace >::VectorType |
|
inline |
Old Jacobian pointer constructor. The inverse Jacobian emulator will use information from the previous Jacobian
|
inline |
Old Jacobian pointer constructor with recursive previous Jacobian deleting. The inverse Jacobian emulator will use information from the previous Jacobian
|
inline |
Empty constructor. The Jacobian emulator will consider minus the identity matrix as previous Jacobian
|
inline |
Copy Constructor.
|
inlinevirtual |
Destructor.
|
inline |
Appends a new column to the observation matrix V
| newColV | new column to be appended |
|
inline |
Appends a new column to the observation matrix W
| newColW | new column to be appended |
|
inline |
Projects the approximated inverse Jacobian onto a vector
| rWorkVector | Vector in where the inverse Jacobian is to be projected |
| rProjectedVector | Projected vector output |
|
inline |
Projects the previous step approximated inverse Jacobian onto a vector
| rWorkVector | Vector in where the inverse Jacobian is to be projected |
| rProjectedVector | Projected vector output |
|
inline |
Drops the oldest column and appends a new column to the observation matrix V
| newColV | new column to be appended |
|
inline |
Drops the oldest column and appends a new column to the observation matrix W
| newColW | new column to be appended |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |


step by step
-
create a script loading service with the script loading function
@Injectable() export class ScriptLoadService {}
-
import it as a provider to your app module
providers: [ScriptLoadService]
-
define it in your constructor in the component that uses the map
constructor(private load: ScriptLoadService) {}


Sun City Wine Tours
Yakima Wine Tours
Our owners shared a glass of Merlot at a Washington winery. Savoring the rich flavors and scenic view, they thought how others might enjoy the Valley's wineries without having to drive themselves. An idea was started to form a wine tour company, and specialize in taking guests on custom private wine tours of the region.
We wanted our tours to be led by guides that were educated in wine and really knew the area. We put together a custom package where guests are taken to their choice of the wineries in Yakima and Prosser, such as Bonair, Wineglass Cellars, Cultura, Silver Lake Winery, Two Mountains, and more.
The tour includes transportation, exclusive cellar tours, along with driver, mini-van and gas so you don't have to worry about extra charges through the day.

Yakima Valley was the first officially-designated appellation in Washington State, gaining American Viticultural Area (AVA) status on May 4, 1983. The valley follows the Yakima river from Union Gap, at its western edge, to the flanks of Red Mountain, its prestigious eastern sub-AVA.
Testimonials: What our guests say...
I wanted to drop a line to let you know what a fantastic time we had on our wine tour. Phillip went above and beyond every step of the way.
We wanted to let you know we had the BEST TIME on your tour.
After spending 3 weeks in the Yakima, my husband and I are convinced that your tour is the greatest bargain in the area. We went to 5 wineries, 1 vineyard, saw incredible views of the valley, and had an outstanding summer picnic.


CLAT-2020 to be held on May 10 next year
Changed question pattern with less than 150 questions
by Special CorrespondentThe Common Law Admission Test (CLAT)-2020 would be held on May 10, 2020, and its notification would be released in the last week of December, while the online application form would be available from January 1, 2020. The decision was taken by the Consortium of NLUs at its meeting on Thursday chaired by President of the Consortium Faizan Mustafa, Vice-Chancellor, NALSAR University of Law. The CLAT-2020 would also have a change in the pattern of questions with a focus on comprehension-based questions from quantitative techniques, English, current affairs, and logical reasoning.
The meeting also resolved to reduce the number of questions from 200 to less than 150, Prof. Mustafa said, adding that it was difficult for students to answer 200 questions in 120 minutes. The meeting elected V. Vijayakumar, Vice-Chancellor of NLIU, Bhopal, as the new President, and Paramjit S. Jaswal, Vice-Chancellor of RGNUL, Punjab as the Vice-President.


init
24 Jul 2019I cleared the AWS Certified Cloud Practitioner exam today. This marks my formal entry into the world of Cloud Computing.
With this website, I intend to share my learning journey, experiences and hacks.
There are 3 steps in Cloud certifications - Foundation/Practitioner, Associate and Professional.
Although I talk a lot about Cloud architecture and best practices, I felt a credible validation was lacking to back my words. And I was not confident about directly attempting any Associate level certification with the time I devote for self-learning.
AWS had the Foundational level that gave me the comfort and practice of the exam experience.


KNN: K-Nearest Neighbors
Let us consider a simple example, if apple looks more similar to peach, pear, and cherry (fruits) than monkey, cat or a rat (animals), then most likely apple is a fruit.
It is a Supervised Machine Learning Algorithm that used in the variety of applications such as finance, healthcare, political science, handwriting detection, image recognition and video recognition. In Credit ratings, financial institutes will predict the credit rating of customers.
KNN can be used for both clasification and regression problems. It is based on feature similaritiy approach.
What is the Algorithm? It's basically classifies a data point based on how its neighbours are classified.
We can implement a KNN model by following the below steps:
- Load the data
- Initialise the value of k
- For getting the predicted class, iterate from 1 to total number of training data points.
- Calculate the distance between test data and each row of training data.
- Sort the calculated distances in ascending order based on distance values
- Get top k rows from the sorted array
- Get the most frequent class of these rows
- Return the predicted class.
The k in KNN is the nearest neighbors. K is the core deciding factor, also the preformance of the model depends upon the value of k.
But how to choose the value of k?
There is no optimal number of neighbors suits all kind of data sets. Each dataset has it's own requirements. In the case of a small number of neighbors, the noise will have a higher influence on the result, and a large number of neighbors make it computationally expensive.
In real life scenarios, KNN is widely used as it is non-parametric which means it does not make any underlying assumptions about the distributions of data.
K-NN algorithm can be used for applications which require high accuracy as it makes highly accurate predictions. The quality of predictions is completely dependent on the distance measure. Thus, this algorithm is suitable for applications for which you have sufficient domain knowledge so that it can help you select an appropriate measure.
It is an instance-based learning or lazy learning as it uses the entire training dataset which gives more time for testing at the cost of memory.
KNN for Regression
The target is predicted by local interpolation of the targets associated of the nearest neighbors in the training set.Again, this k-neighbors regression use n_neighbors, you can use more than the single closest neighbor for regression, and the prediction is the average or mean of relevant neighbors.
Limitations of KNN
KNN works well with a small number of input variables, but struggles when the number of inputs is very large. As the number of dimensions increases the volume of the input space increases at an exponential rate. In high dimensions, points that may be similar may have very large distances.
Practical Applications of K-NN
Now that we have we have seen how KNN works, let us look into some of the practical applications of KNN.
- Recommending products to people with similar interests, recommending movies and TV shows as per viewer’s choice and interest.
- Recommending hotels and other accommodation facilities while you are travelling based on your previous bookings.
- Some advanced examples could include handwriting detection (like OCR), image recognition and even video recognition.
You can learn more about this topic fromhere.


J.C.R. Licklider, a professor at MA Institute of Technology had a vision that by connecting computers, we would be able to communicate better.
President Eisenhower created the borough of defense department called: Advanced Research Projects Agency (space & computer science program). Soonafter, Space became NASA and Computer Science was ARPA.
Americans feared a soviet nuclear attack; America needed an indestructible computer network; Dr Paul Baran was hired to do this through Hot potato routing; Baran decided to chop up the messages into small pieces into each packet (like small postcards) and launch that packet into the network; A packet switching network was designed.
Leonard Kleinrock; MIT graduate student – known for work on Queueing Theory- about message switching; He determined overall speed of network; demand access & distributed control; effective resource sharing with networks; No one switch should control entire network.
Larry Roberts was recruited by Bob Taylor of ARPA to build to first network.
A period of time when there were typewriters, telephones with rotary dials and the lunar module; Larry Robert sought engineers to build ARPA Net (built with interface Message processors); Roberts asked 140 companies including AT&T and IBM to bid on a Packet Switching System; The networking was going to break up the package and deliver it putting it back together; Only one company BBN decided to participate.
Packet Switching Communication System was successful. Four sites participated, UCLA being one of them. By end of 1969, all four sites were interconnected.
Raymond Tomlinson invented email.
Private networks such as Prodigy, Compuserve & America Online started.
TCP-IP Protocol was adopted as the universal standard.
Gateway, a node (router) in a computer network, a key stopping point for data on its way to or from other networks, was founded.
Physicist Tim Berners Lee founded the World Wide Web.
Congress passed a bill taking internet out of hands of government and giving it to the public. Only 50 Web Pages on the internet in 1992.
Marc Andreeson, from University of Illinois developed the first user friendly browser called Mosaic and later Netscape. This turned the internet into a graphically rich world. THe web grew by 341,000%.
Internet revenue was 301 billion dollars in business & was responsible for 1/3rd of US economic growth.


Samsung Galaxy Watch update brings touch bezel navigations
The Galaxy Watch Active will include even more Watch Active 2 features
by Dean DaleySamsung’s Galaxy Watch Active launched earlier this year, but in an odd turn of events, Samsung also recently dropped the Galaxy Watch Active 2.
Now, the South Korean tech giant is rolling out a new software update for the first Galaxy Watch Active that brings the wearable’s touch bezel functionality from the Watch Active 2 to its predecessor. The update allows you to slide your finger around the smartwatch’s display in order to navigate the operating system.
Additionally, it includes changes to the Health app and new Bixby features, such as voice commands to start an exercise routine, finding out time differences between two locations and controlling Samsung’s SmartThings ecosystem.
Further, icons for apps have been moved to the bottom of the watch face, allowing users to access apps and outgoing calls.
Samsung also updated the user experience and made the user interface clearer, along with new Samsung Health functionality.
Samsung says it’s releasing the update on a regional basis.
Source: Samsung Blog


This dino is strong.It con break down a tree.At the end of it's tail there are 4 sharp spikes.The size of it's head is the same as a golf ball.It has plates on it's back.


It is important to measure your performance under contest settings. If you want to solve 5 problems in 3 hours, this tool can help you measure it. First, using the problem picker, pick a set of unsolved problems (categorized by the difficulty levels). Then set the start date and duration and create a virtual contest using the following generator. If you want compete against shadow contestants from the past UVa contests, you can click the past contests and select from one of the past UVa contests. The link to the virtual contest will appear after you generate it (only people that know the link are able to view it).
| Contestants UVa IDs | |
| UVa Problem Numbers | Problem Picker | Past Contests |
|
|
|
|
|
|
| Contest Date and Duration | hh:mm Duration (suffix: h=hours, d=days, w=week) |
|
Here is the virtual contest link (the problem list is hidden until the contest starts):
To host the virtual contest in your own website, copy paste the following
scripts to your web page. |


| 009:097 Khan | : |
The bedouins are the worst in disbelief and hypocrisy, and more likely to be in ignorance of the limits (Allah's Commandments and His Legal Laws, etc.) which Allah has revealed to His Messenger. And Allah is All-Knower, All-Wise. |
| 009:097 Maulana | : |
The dwellers of the desert are hardest in disbelief and hypocrisy, and most disposed not to know the limits of what Allah has revealed to His Messenger. And Allah is Knowing, Wise. |
| 009:097 Pickthal | : |
The wandering Arabs are more hard in disbelief and hypocrisy, and more likely to be ignorant of the limits which Allah hath revealed unto His messenger. And Allah is Knower, Wise. |
| 009:097 Rashad | : |
The Arabs are the worst in disbelief and hypocrisy, and the most likely to ignore the laws that GOD has revealed to His messenger. GOD is Omniscient, Most Wise. |
| 009:097 Sarwar | : |
The desert dwelling Arabs are far worse than the others in their disbelief and hypocrisy and have more reason to be ignorant of the revelations that God revealed to His Messenger. God is All-knowing and All-wise. |
| 009:097 Shakir | : |
The dwellers of the desert are very hard in unbelief and hypocrisy, and more disposed not to know the limits of what Allah has revealed to His Messenger; and Allah is Knowing, Wise. |
| 009:097 Sherali | : |
The Arabs of the desert are the worst in disbelief and hypocrisy, and most apt not to know the ordinances of the Revelation which ALLAH has sent down to HIS Messenger. And ALLAH is All-Knowing, Wise. |
| 009:097 Yusufali | : |
The Arabs of the desert are the worst in Unbelief and hypocrisy, and most fitted to be in ignorance of the command which Allah hath sent down to His Messenger: But Allah is All-knowing, All-Wise. |
Concepts/Themes Covered: الإيمان > الإيمان بالله > النفاق Faith> Belief In Allah> Hypocrisy الجهاد > الغزوات > غزوة تبوك Jihad> The Holy Battles> Tabuk Battle الإنسان والعلاقات الاجتماعية > المجتمعات > الأعراب Man and The Social Relations>The Societies>The Bedouins
This tool uses eight English parallel translations for the Holy Quran imported from Mr. Clay Smith. You can also visit Qurany Concepts for browsing the Quran themes or topics. If you want to search the Holy Quran for keywords, please visit Qurany Keywords.


@*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*@
@(
legend: String,
jsHidden: Boolean = false,
bold: Boolean = false,
hint: String = "",
legendHidden: Boolean = false
)(implicit m: Messages)
@if(hint.nonEmpty) {@Messages(hint)}


Before we talk about inline vs. inline-block we have to first talk about blocks. A block in CSS is an object that takes up the entire width of the page and has a line break above and below it.
Common block elements include:
As compared to a block, inline elements only take the necessary width of the object.
Common inline elements include:
Check out this graphic for all you visual learners
Knowing the default display properties of elements allows for the manipulation of inline and block elements. For example, using li as a default block in a navigation bar would lead to a vertical layout.
However, by changing the display of li to inline, the navigation bar can take a horizontal layout. In fact, that's how the above nav bar is written.
Ok, so what about the pesky inline-block?
The easy answer is that inline-block is a hybrid of both inline and block display that allows elements to be displayed in the same line while still retaining some block characteristics. This means that pre-set style elements such as height and width from block displays would be retained in an inline-block whereas with inline only margins and padding can be adjusted.
Ummm...
Perhaps an example would be useful.
Let's say you had a collection of divs or images that you wanted to arrange in a nice grid. Blocking them would obviously just stack them vertically, and inlining them would not allow for variations in div height, width and other block level style elements. Hmmmmm...
...why not Zoidberg?
Just kidding. Why not display inline?
Like this
Notice that the original heights of the images where retained using inline-block.
For more in-depth information and examples check out some of the sources below
Coming Soon!


Welcome To Oak Restaurant
In the Oak restaurant we offer you only the best meals. The Oak offers full daily pansion, with our selected specialities. As for the regular guests, we as well did adapted our menu for vegan guests as well!
Read More →High Quality
The Oak Restaurant offers only the highest quality of any kind of a meal for our guests.
Full Pansion
Breakfast, lunch, dinner, we serve it all! Aside of that, you can order drinks and deserts.
House Specialities
Try The Oak's monthly specials. Each month we offer new specialities!
Guests are priority
We care about satisfaction of our guests. Provide feedback so we can become better!
The finest food on the finest menu
Check Menu— Monthly Specialities —
— February, 2019 —
Potato Mushup
A real improvisation from our staff at the kitchen. Tasteful salad-like potato mushup
$ 23
Vegan Pasta Salad
Pasta salad made for vegan guests specially including finest extracts from nature
$ 30
Risotto Pockets
Pockets filled with risotto mixed with finest ingredients
$ 19
Offering you the home delivery
system as well
~ 20 minutes delivery
Lunch for 1‐4 persons
Order Now— Our Gallery —
— Guest Testimonials —
Make Reservation
+1-206-555-0166
Lunch Service
Thursday, Friday, Saturday: Bookings from 11am - 2.30pm
Other Services
Daily: 9am - 4pm


rlcc.act¶
Actor and related functionality.
-
class
rlcc.act.
Actor
[source]¶ Base class for all actors.
Your actors should also subclass this class.
-
class
rlcc.act.
ClippingActor
(base_actor, action_min=-1, action_max=1)[source]¶ Implements an actor policy that clips the actions.
Parameters: - base_actor – the actor whose actions noise is added.
- action_min (scalar or numpy.Array, optional) – Minimal action value
- action_max (scalar or numpy.Array, optional) – Maximal action value
-
class
rlcc.act.
NetworkActor
(network)[source]¶ This is an implementation of an actor whose policy is encoded as a network.
Parameters: network (class:torch.nn.Module) – A network that returns an action for a state
-
class
rlcc.act.
NoisyActor
(base_actor, noise_process)[source]¶ Implements a noisy actor policy.
Parameters: - base_actor (class:rlcc.act.Actor) – the actor whose actions noise is added.
- noise_process (rlcc.noise.NoiseProcess) – Device where the states should be sent


--- layout: post authors: ["Greg Wilson"] title: "Data Carpentry Receives Grant from the Moore Foundation" date: 2015-08-13 time: "13:00:00" tags: ["Data Carpentry"] ---
Reposted from the Data Carpentry blog.
We are extremely pleased to announce that Data Carpentry has received $750,000 in funding from the Gordon and Betty Moore Foundation.
With more than $6.4 billion in assets, the Gordon and Betty Moore Foundation is the ninth largest foundation in the United States. The Science Program accounts for approximately 40 percent of the foundation's annual grant making, making the foundation one of the largest private funders of science nationwide.
Data Carpentry is fiscally sponsored project of NumFOCUS, a 501(c)3 non-profit organization. We develop and provide training to researchers in fundamental data skills to enable more effective and efficient research progress.
This grant will help support the project for two years. It will allow us to grow our core team, establish better infrastructure, work with the volunteer community to develop content, conduct more workshops in more scientific domains and plan for sustainability.
The text of our grant proposal is available on Figshare.
We are particularly excited to work with the Moore Foundation with whom we share a mission of enabling data-driven discovery. Our focus is providing training that will help engage a larger population of scientists in tackling data-driven challenges. Although petabytes of data are now available, the missing step between data collection and research progress is a lack of training for scientists in crucial skills for effectively managing and analyzing large amounts of data.
Our goal is to provide researchers high-quality, domain-specific training covering the full life cycle of data-driven research. The focus of our activities on this grant will be:
Expanding into new domains: We will develop lesson content in new domains, particularly in the life sciences and physical sciences.
Train thousands of scientists: We will run regular workshops at universities and research organizations, teaching scientists the skills they need to conduct research using large scale data.
Scale our instructor pool: Teaching Data Carpentry to thousands of scientists, across an array of domains, will require us to significantly expand the pool of high quality instructors. In collaboration with Software Carpentry, we will train instructors in both evidence-based teaching practices and the specifics of teaching and delivering Data Carpentry workshops. This includes fostering and supporting the community of instructors through a friendly, open, and diverse online community.
Develop strategies for delivering workshops online As part of efforts to scale up training, we will also work to develop approaches to delivering workshops online that include active participation and real-time feedback and assistance from instructors.
The success of Data Carpentry is the result of the amazing community that has worked as instructors, content developers, workshop hosts, learners and supporters, and we can't thank you enough for your contributions. We look forward to the opportunity to continue to empower researchers and enable research. We have more information and posts coming soon on how to be involved as an instructor, in developing content or hosting workshops, so stay posted!


 Our other Sponsors can be found here. Tickets are free! They can be found at the bottom of this page!
What is HackNotts?
You will have 24 hours to design, coordinate and execute an idea. Each year we have students travel from across the far ends of the country collaborating, prototyping, and accomplishing amazing and innovative ideas in just 24 hours.
You'll learn new skills from both the many attendees and the informative workshops hosted by the sponsors and organisers.
You don't have to be a software or hardware wizard to attend. No matter your skill level you will be able to brainstorm and produce something and hopefully learn along the way.
Have a look at the About page to find out more information about what the Hackathon involves.
Win prizes!
We have various prizes you'll to want to win in several categories:
- First place - 120Hz (165Hz overclocked) Asus TUF gaming monitor 24"
- Runners up - Sennheiser CX True Wireless earphones
- Environmental prize - Stanley Classic Legendary Thermos Flask 1L
- Art prize - Drawing tablet
- Spirit of the hack - IKEA fluffy toys! (Brown bear, Whale, Monkey, Dino)
- Capital One - TBD
- Frasers Group - TBD
- Hackathons UK - Oversized foam enter key


flibs/strings - Manipulate file and directory names
The filedir contains a number of routines to manipulate file and directory names:
Strip the extension from a file name and return the "root name".
Determine instead the extension from a file name and return that.
Strip the directory name from the path to the file and return the "base name".
Strip the file name from the path to the file and return the directory.
Concatenate file and directory names.
Add an extension to a file name.
These are all relatively simple routines, but they are fairly common, hence the module.
The module contains the following routines:
To import the subroutines, use this module.
Strips the extension if any off the file name and returns the result.
Name of the file
Returns the extension if any found in a file name
Name of the file
Returns the base name of a file (so, without the directory part)
Name of the file
Returns the directory part of a file name
Name of the file
Prepend the directory to the file name
Directory to prepend
Name of the file
Append an extension to the file name
Directory to prepend
Name of the file
Note: The functions all return strings that are large enough to guarantee that the entire result can be hold. In many cases, the length is the same as that of the input argument, but for instance with file_add_extension it is the sum of the lengths of the two arguments plus 1 (for the dot).
Copyright © 2005 Arjen Markus <arjenmarkus@sourceforge.net>


Records are the objects which travel through the pipeline and which transport the data through the modules. There are several core record types, and one of the key decisions when using OpenRate is the record type to use.


<button
ngxSound
[soundFile]="'coin.wav'"
[soundVolume]="0.8"
>
For a button click to be accompanied by music, the directive must be included as shown on the left.
<button
ngxSound
[soundFile]="'coin.wav'"
[soundVolume]="0.8"
[soundOnClick]="false"
[soundOnHover]="true"
>
To trigger the sound on a mouse hover, [soundOnHover]="true" can be used. There are more inputs, e.g. to pause or start the sound, adjust the volume or others.
@Sound('coin.wav')
public soundCheck()
You can see the simplest application of the Decorator on the left. As a parameter you simply enter the file name with extension.
@Sound({{ "{" }}
fileName: 'coin',
extension: '.wav'
{{ "}" }})
public soundCheck()
An object can also be passed as a parameter. The properties can be found further down in the section "ISoundDecorator". More properties should be added over time.
@Sound({{ "{" }}
start: ISoundDecorator,
success: ISoundDecorator
error: ISoundDecorator
{{ "}" }})
public soundCheck()
The whole thing also works asynchronously. Here you can pass a start, success and error sound.
@Sound({{ "{" }}
start: ISoundDecorator,
success: ISoundDecorator
error: ISoundDecorator
{{ "}" }})
public soundCheck()
And here is another example with error sound.
interface ISoundDecorator
fileName: string;
extension: string;
path?: string;
volume?: number;
https://freesound.org/s/341695/ by ProjectsU012
https://freesound.org/s/60443/ by jobro


security-manager Property
The authentication callback and the authorization callback that implement
the SecurityManager
interface
are specified with the security-manager
property.
When this property is defined, authentication and authorization are enabled.
The definition of the security-manager
property is the
fully qualified name of the class that implements the SecurityManager
interface.
For example:
security-manager = com.example.security.MySecurityManager
All components of the system invoke the same callbacks. Here are descriptions of the components and the connections that they make with the system.
- A client connects with a server and makes operation requests
of that server. The callbacks invoked are those defined by the
SecurityManager
interface for that server. - A server connects with a locator, invoking the
authenticate
callback defined for that locator. - Components communicating with a locator’s JMX manager connect and make
operation requests of the locator.
The callbacks invoked are those defined by the
SecurityManager
interface for that locator. Bothgfsh
andPulse
use this form of communication. - Applications communicating via the REST API make of a server invoke security callbacks upon connection and operation requests.
- Requests that a gateway sender makes of a locator invoke security callbacks defined for that locator.
security-post-processor Property
The PostProcessor
interface allows the definition of a set of callbacks
that are invoked after operations that get data,
but before the data is returned.
This permits the callback to intervene and format the data
that is to be returned.
The callbacks do not modify the region data,
only the data to be returned.
Enable the post processing of data by defining the
security-post-processor
property
with the path to the definition of the interface.
For example,
security-post-processor = com.example.security.MySecurityPostProcessing


{% extends '_layouts/layout_email.html' %} {% block page_title %}NHS account{{serviceName}}{% endblock %} {% block content %}
Before you can use your NHS account you need to validate your email address.
If you didn't create an NHS account using this email address please ignore this email and we will delete the NHS account after 48 hours.
Or verify using this link:
http://prove-my-identity.herokuapp.com/national05/verified-email