Will be called after the connection had been closed. This can be a result of calling IWebserverProppatch::Close() or because of a close
initiated by the client. This function is the right place to clean up and release the UWebserverProppatch instance.
Parameters
| IWebserverProppatch * const webserverProppatch | The calling IWebserverProppatch instance. |
IWebserverOptions
class IWebserverOptions {
public:
virtual ~IWebserverOptions() {}
virtual const char * GetResourceName();
virtual const char * GetRegisteredPathForRequest();
virtual void SetSupportedRequests(dword requestList);
virtual void Close();
};
Overview
This handler is for handling OPTIONS requests.
Public functions
GetResourceName
Return value
The name of the resource for that request. The value returned is the same as passed to UWebserverPlugin::WebserverPluginHttpListenResult() as resourceName.
GetRegisteredPathForRequest
Return value
The name of the registered path for that request. The value returned is the same as passed to UWebserverPlugin::WebserverPluginHttpListenResult() as registeredPathForRequest.
SetSupportedRequests
Set the bitfield of supported requests.
Parameters
| dword requestList | Bitfield as dword with the supported webdav options. You should use the ws_request_type_t constants to build up the list. |
Remarks
SetSupportedRequests() must be called before closing the request.
Close
Closes the request. This also finalizes a chunk encoded response, so that the client will receive the information that all data had been transfered.
Callbacks
After the connection had been closed, UWebserverOptions::WebserverOptionsCloseComplete() of the user passed to IWebserverPlugin::Accept() will be called. This is the right place to delete the IWebserverOptions intance,
because it will no longer be used.
UWebserverOptions
class UWebserverOptions {
public:
virtual ~UWebserverOptions() {}
virtual void WebserverOptionsRequestAcceptComplete(IWebserverOptions * const webserverOptions)
{
webserverOptions->SetSupportedRequests(WS_REQUEST_GET | WS_REQUEST_POST | WS_REQUEST_PUT |
WS_REQUEST_PROPFIND | WS_REQUEST_MOVE | WS_REQUEST_COPY |
WS_REQUEST_MKCOL | WS_REQUEST_DELETE | WS_REQUEST_OPTIONS |
WS_REQUEST_LOCK | WS_REQUEST_UNLOCK | WS_REQUEST_PROPPATCH);
webserverOptions->Close();
}
virtual void WebserverOptionsCloseComplete(IWebserverOptions * const webserverOptions);
};
Overview
This is the user for a OPTIONS request handler. The application needs to implement the functions below.
Remarks
If sending a response, it can (and should) be done asynchronously. But the application must take care sending the same number of bytes as defined before
start sending data (if using streamed transfer) and closing the connection. Also the correct datatype and transfer info must be set before. If not, the
browser (our whatever client) will wait for incomming data or at least recognize a transfer error.
See IWebserverOptions for more details.
Note that the application is responsible for releasing the UWebserverOptions instance!
Public functions
WebserverOptionsRequestAcceptComplete
Will be called from the IWebserverPlugin Instance after the application accepts an incoming OPTIONS request. This will be the correct
place to start answering the request. A derived class need to save the pointer of the given IWebserverOptions instance for later use.
remarks
Note that the default implementation accepts all webdav request supported by the IWebserverPlugin and closes the request.
Parameters
| IWebserverOptions * const webserverOptions | The calling IWebserverOptions instance. |
WebserverOptionsCloseComplete
Will be called after the connection had been closed. This can be a result of calling IWebserverOptions::Close() or because of a close
initiated by the client. This function is the right place to clean up and release the UWebserverOptions instance.
Parameters
| IWebserverOptions * const webserverOptions | The calling IWebserverOptions instance. |
IWebsocket
class IWebsocket {
public:
virtual ~IWebsocket() {}
virtual const char * GetHost();
virtual const char * GetPath();
virtual bool IsSysClientAuthenticated();
virtual bool IsLocalHost();
virtual void Send(const void * buffer, size_t len, bool text = true);
virtual void Recv(void * buf = nullptr, size_t len = 0);
virtual void Close();
};
Overview
This handler is for handling websocket requests. To get websocket requests the app must call IWebserverPlugin::WebsocketListen() must be called. An incomming websocket request will lead to the
UWebserverPlugin::WebserverPluginWebsocketListenResult() callback. See IWebserverPlugin and UWebserverPlugin for details.
Public functions
GetHost
Remarks
For websocket each request comes with the host that sends the request. Because that is a header value that can be manipulated, this information should not be used for security relevant things.
Return value
The host of the request.
GetPath
Return value
The requested websocket path relative to the root passed to IWebserverPlugin::WebsocketListen().
IsSysClientAuthenticated
Returns the information, if a localhost connection between the AppManager and the Webserver is authenticated. Generally there is no need to use that function in your app.
Return value
True, if authenticated, else false.
IsLocalHost
Can be called if there the app needs to know if the connection is a local host connection or not.
Return value
True if localhost, else false.
Send
Sends the give data to the client.
Parameters
| void * buffer | The pointer to the buffer with the data to send. Must hold at least len byte of data. |
| size_t len | The number bytes to send. |
| bool text | (Default true)If ture, the type of the send data is text, else it is binary data. |
Callbacks
After the data had been sent, UWebsocket::WebsocketSendResult() of the user passed to IWebserverPlugin::Accept() will be called.
Remarks
The IWebserverPlugin and the webserver of the AppPlatform wont't make a difference between binary or text data. But a calling webserver client maybe will do it. So it will be a good idea
to set the text flag to false if sending binary data.
The maximum size of data that can be send at once is WS_MAX_DATA_SIZE.
Recv
Receives data sent with the request.
Parameters
| void * buffer | (Default: nullptr) The buffer to store the data to. Must be big enough to be able to receive len bytes of data. |
| size_t len | (Default: 0) The number of bytes to receive. If buffer is not nullptr, len must be > 0. |
Callbacks
After the data had been read, UWebsocket::WebsocketRecvResult() of the user passed to IWebserverPlugin::Accept() will be called.
Remarks
If called with a buffer an length, the callback will be called after receiving the amount of bytes given to Recv(). If the amount of bytes is unkown, Recv() should be called without a length and buffer.
The maximum size of data that can be received at once is WS_MAX_DATA_SIZE.
Close
Closes the websocket connection.
Callbacks
After the connection had been closed, UWebsocket::WebsocketCloseComplete() of the user passed to IWebserverPlugin::Accept() will be called. This is the right place to delete the IWebsocket intance,
because it will no longer be used.
UWebsocket
class UWebsocket {
public:
virtual ~UWebsocket() {}
virtual void WebsocketAcceptComplete(class IWebsocket * websocket);
virtual void WebsocketSendResult(class IWebsocket * websocket);
virtual void WebsocketRecvResult(class IWebsocket * websocket, void * buffer, size_t len, bool text, bool isFragmented);
virtual void * WebsocketRecvBuffer(size_t len) { return nullptr; }
virtual void WebsocketCloseComplete(class IWebsocket * websocket, ws_close_reason_t reason);
};
Overview
This is the user for a Websocket request handler. The application needs to implement the functions below to realize websocket communication.
Public functions
WebsocketRequestAcceptComplete
Will be called from the IWebserverPlugin Instance after the application accepts an incoming Websocket request. A derived class need to
save the pointer of the given IWebsocket instance for later use.
Parameters
| IWebsocket * const websocket | The calling IWebsocket instance. |
WebsocketSendResult
Will be called after a data package send by IWebsocket::Send() had been send to the client by the webserver itself.
Parameters
| IWebsocket * const websocket | The calling IWebsocket instance. |
WebsocketRecvResult
Will be called after receiving data, initiated through IWebsocket::Recv().
Parameters
| IWebsocket * const websocket | The calling IWebsocket instance. |
| void * buffer | The buffer holding the received data. Will be the same as passed to
IWebsocket::Recv() or returned by UWebsocket::WebsocketRecvBuffer(). |
| size_t len | The number of bytes received. |
WebsocketRecvBuffer
If IWebsocket::Recv() will be called with buffer = nullptr, the IWebsocket handler will call this function to request a buffer to store
the data.
Parameters
| size_t len | The numbert of bytes to transfer. The returned buffer must provide at least that size. |
Return value
The buffer to store the data to. Must not be nullptr.
WebsocketCloseComplete
Will be called after the connection had been closed. This can be a result of calling IWebsocket::Close() or because of a close
initiated by the client. This function is the right place to clean up and release the UWebsocket instance.
Parameters
| IWebsocket * const websocket | The calling IWebsocket instance. |
IWebserverPassthrough
class IWebserverPassthrough {
public:
virtual ~IWebserverPassthrough() {}
virtual const char * GetResourceName();
virtual const char * GetRegisteredPathForRequest();
virtual bool IsEncryptedConnection();
virtual void Send(void * buffer, size_t size);
virtual void Recv(void * buffer = nullptr, size_t len = 0);
virtual void Close();
};
Overview
This handler is for handling Passthrough requests.
Remarks
The passthrough handler has a special role. Instead of the others, the webserver doesn't make anything for passthrough requests. Like the name suggests,
the raw communication will be passed through to the application. That means, that the application is responsible for handling the HTML protocoll, which
includes parsing and creating of a correct header. So generally there is no need to implement passthrough functionality to our application. On the other
hand it can help to create apps with proxy functionality.
To receive passthrough requests, the application must call IWebserverPlugin::PassthroughListen(). An incomming request will call the
UWebserverPlugin::WebserverPassthroughListenResult(). See IWebserverPlugin and UWebserverPlugin
for details.
Public functions
GetResourceName
Return value
The name of the resource for that request. The value returned is the same as passed to UWebserverPlugin::WebserverPluginPassthroughListenResult() as resourceName.
GetRegisteredPathForRequest
Return value
The name of the registered path for that request. The value returned is the same as passed to UWebserverPlugin::WebserverPluginPassthroughListenResult() as
registeredPathForRequest.
IsEncryptedConnection
Can be called to determine, if the connection is encrypted or not (wich is the case if the client uses https://).
Return value
True, if the connection is encrypted, else false.
Remarks
The encryption is the only thing that still will be handled by the webserver. So even if IsEncryptedConnection() returns true, the application don't need to
decrypt the data or encrypt the response.
Send
Sends the give data to the client.
Parameters
| void * buffer | The pointer to the buffer with the data to send. Must hold at least len byte of data. |
| size_t len | The number bytes to send. |
Callbacks
After the data had been sent, UWebserverPassthrough::WebserverPassthroughSendResult() of the user passed to IWenserverPlugin::Accept() will be called.
Remarks
Because of the resposebility the application has of handling the HTTP protocoll, the first part sent must be a valid http header.
The number of bytes to send must not exceed WS_MAX_DATA_SIZE, or an assertion will be thrown. If more than WS_MAX_DATA_SIZE need to be send,
the application must call Send() multiple times.
Recv
Receives data sent with the request.
Parameters
| void * buffer | (Default: nullptr) The buffer to store the data to. Must be big enough to be able to receive len bytes of data. |
| size_t len | (Default: 0) The number of bytes to receive. If buffer is not nullptr, len must be > 0. |
Callbacks
After the data had been read, UWebserverPassthrough::WebserverPassthroughRecvResult() of the user passed to IWebserverPlugin::Accept() will be called. If all data had
been read, the WebserverPassthroughRecvResult() will be called with nullptr as buffer and 0 as len.
If buffer is nullptr, UWebserverPassthrough::WebserverPassthroughRecvBuffer() will be called to request the buffer to store the data to.
Remarks
If buffer is nullptr, the IWebserverPassthrough will ask the application for a buffer of a given size when reading the data. This will be realized by the
WebserverPassthroughRecvBuffer() callback.
Because of the nature of passthrough, the number of bytes to receive is unkown (at least until the HTML header had been read completley and the data will not be
send chunk encoded). So it will be a good idea, to call Recv() withouth parameters to have some kind of partitial read.
The maximum data to read per Recv() call is WS_MAX_DATA_SIZE.
Close
Closes the request. This tells the webserver to close the socket connection, too.
Callbacks
After the connection had been closed, UWebserverPassthrough::WebserverPassthroughCloseComplete() of the user passed to IWebserverPlugin::Accept() will be called. This
is the right place to delete the IWebserverPassthrough intance, because it will no longer be used.
UWebserverPassthrough
class UWebserverPassthrough {
public:
virtual ~UWebserverPassthrough() {}
virtual void WebserverPassthroughRequestAcceptComplete(IWebserverPassthrough * const webserverPassthrough);
virtual void WebserverPassthroughSendResult(IWebserverPassthrough * const webserverPassthrough);
virtual void WebserverPassthroughRecvResult(IWebserverPassthrough * const webserverPassthrough, void * buffer, size_t len);
virtual void * WebserverPassthroughRecvBuffer(size_t len) { return nullptr; }
virtual void WebserverPassthroughCloseComplete(IWebserverPassthrough * const webserverPassthrough);
};
Overview
This is the user for a Passthrough request handler. The application needs to implement the functions below.
Remarks
Note that the application is responsible for releasing the UWebserverPassthrough instance!
Public functions
WebserverPassthroughRequestAcceptComplete
Will be called from the IWebserverPlugin Instance after the application accepts an incoming Passthrough request. A derived class need to save
the pointer of the given IWebserverPassthrough instance for later use.
Parameters
| IWebserverPassthrough * const webserverPassthrough | The calling IWebserverPassthrough instance. |
WebserverPassthroughSendResult
Will be called after a data package send by IWebserverPassthrough::Send() had been send to the client by the webserver itself.
Parameters
| IWebserverPassthrough * const webserverPassthrough | The calling IWebserverPassthrough instance. |
WebserverPassthroughRecvResult
Will be called after receiving data, initiated through IWebserverPassthrough::Recv().
Parameters
| IWebserverPassthrough * const webserverPassthrough | The calling IWebserverPassthrough instance. |
| void * buffer | The buffer holding the received data. Will be the same as passed to
IWebserverPassthrough::Recv() or returned by UWebserverPassthrough::WebserverPassthroughRecvBuffer(). |
| size_t len | The number of bytes received. |
WebserverPassthroughRecvBuffer
If IWebserverPassthrough::Recv() will be called with buffer = nullptr, the IWebserverPassthrough handler will call this function to request a buffer to store
the data.
Parameters
| size_t len | The numbert of bytes to transfer. The returned buffer must provide at least that size. |
Return value
The buffer to store the data to. Must not be nullptr.
WebserverPassthroughCloseComplete
Will be called after the connection had been called. This can be a result of calling IWebserverPassthrough::Close() or because of a close
initiated by the client. This function is the right place to clean up and release the UWebserverPassthrough instance.
Parameters
| IWebserverPassthrough * const webserverPassthrough | The calling IWebserverPassthrough instance. |
Data types
Defines / Statics
| WS_MAX_PATH_LENGTH | The maximum length for a path to register using one of the listen functions of IWebserverPlugin. |
| WS_MAX_DATA_SIZE | The maximum data size one Send() or Recv() call can transfer. |
| WS_RESPONSE_CHUNKED | Flag to define that a response should be sent to the client chunk encoded. |
typedef enum {
// Everything from 0 to 15 will be internal types
WSP_CANCEL_NOT_FOUND = 0x10,
WSP_CANCEL_BAD_REQUEST,
WSP_CANCEL_UNAVAILABLE,
WSP_CANCEL_MISSING_LENGTH,
WSP_CANCEL_STREAM,
WSP_CANCEL_ACCESS_DENIED,
WSP_CANCEL_INTERNAL_ERROR
} wsr_cancel_type_t;
Overview
These types will be used to cancel a request. The request can be canceled anytime from the moment the request comes in until
the request will be closed. Canceling a request will also close the request and let the webserver close the connection to the client.
The resposne the webserver sends to the client depends on the values below passed to the Cancel() function of IWebserverPlugin (to cancel
the incomming request) or of the request handler itself (to cancel an accepted request).
Values
| WSP_CANCEL_NOT_FOUND | The requested resource could not be found. Will send a HTTP 404 response to the client. |
| WSP_CANCEL_BAD_REQUEST | For some reason the request was malformed. Will send a HTTP 400 response to the client. |
| WSP_CANCEL_UNAVAILABLE | The requested resource is unavailable. Will send a HTTP 451 response to the client. |
| WSP_CANCEL_MISSING_LENGTH | The request comes without a content length field. Will send a HTTP 411 response to the client. |
| WSP_CANCEL_STREAM | Cancels an already started response stream. This is the only valid value to pass to cancel after the app started sending a response.
Because canceling a stream normaly means, that an error occures, the webserver will send a HTTP 500
response to the client, as long as the app has not send response data yet. If sending data (as stream
or chunk encoded), the connection just will be closed by the webserver. |
| WSP_CANCEL_ACCESS_DENIED | Access to the requested resource is denied. Will send a HTTP 402 response to the client. |
| WSP_CANCEL_INTERNAL_ERROR | An internal error occured. Will send a HTTP 500 response to the client. |
typedef enum {
WSP_PATH_TYPE_HTTP,
WSP_PATH_TYPE_WEBSOCKET,
WSP_PATH_TYPE_PASSTHROUGH
} wsp_path_type_t;
Overview
This values will be passed to UWebserverPlugin::WebserverPluginRegisterPathResult() to tell for which listen call the callback had
been called.
Values
| WSP_PATH_TYPE_HTTP | The result for a HttpListen() call. |
| WSP_PATH_TYPE_WEBSOCKET | The result for a WebsocketListen() call. |
| WSP_PATH_TYPE_PASSTHROUGH | The result for a PassthroughListen() call. |
typedef enum {
WEBDAV_RESULT_OK = 0x100,
WEBDAV_RESULT_CREATED,
WEBDAV_RESULT_NO_CONTENT,
WEBDAV_RESULT_MULTIPLE_STATUS,
WEBDAV_RESULT_FORBIDDEN,
WEBDAV_RESULT_METHOD_NOT_ALLOWED,
WEBDAV_RESULT_CONFLICT,
WEBDAV_RESULT_PRECONDITION_FAILED,
WEBDAV_RESULT_LOCKED,
WEBDAV_RESULT_BAD_GATEWAY,
WEBDAV_RESULT_INSUFFICIENT_STORAGE
} ws_webdav_result_t;
Overview
This constants need to be send as result for each webdav hanlder. Sometimes the meaning of the values differ, depending what kind
of WebDAV request needs to be answered.
Values
| WEBDAV_RESULT_OK | OPTIONS, LOCK, DELETE, POLL: The was successfull. Will send a HTTP 200 response to the client. |
| WEBDAV_RESULT_CREATED | PUT, MKCOL: The resource was created successfully. MOVE: The resource was moved successfully. LOCK: The lock was done successfully. Will send a HTTP 201 response to the client. |
| WEBDAV_RESULT_NO_CONTENT | PUT, DELETE, UNLOCK, COPY, MOVE: A standard success status code, when no additional data need to ben sent. Will send a HTTP 204 response to the client. |
| WEBDAV_RESULT_MULTIPLE_STATUS | PROPFIND, PROPPATCH, MKCOL, COPY, MOVE: Multiple status will be send with the response. Will send a HTTP 207 response to the client. |
| WEBDAV_RESULT_FORBIDDEN | All: The client does not have premision for the requested WebDAV method. Will send a HTTP 404 response to the client. |
| WEBDAV_RESULT_METHOD_NOT_ALLOWED | All: The methos is not allowed for the resoure. MKCOL: Can be used to tell the client, that the collection already axists an cannot be created. Will send a HTTP 405 response to the client. |
| WEBDAV_RESULT_CONFLICT | MKCOL, PROPPATCH, PUT: The WebDAV method could not be executed because of a conflict. Will send a HTTP 409 response to the client. |
| WEBDAV_RESULT_PRECONDITION_FAILED | COPY, MOVE: The server was unable to maintain the availability of the properties listed in the property behaviour XML element. LOCK: The lock token could not be enforced. COPY, PUT: Evaluation of request header fields failed. Will send a HTTP 412 response to the client. |
| WEBDAV_RESULT_LOCKED | PROPPATCH, DELETE, MOVE: The method can not change the properties. LOCK: The resource is already locked. COPY: The resource was locked. Will send a HTTP 423 response to the client. |
| WEBDAV_RESULT_BAD_GATEWAY | All: The server (acting as gateway or proxy) received an invalid response from the upstream server. Will send a HTTP 502 response to the client. |
| WEBDAV_RESULT_INSUFFICIENT_STORAGE | PROPPATCH, MKCOL, COPY: The resource doesn't have enough space to execute the methid. Will send a HTTP 507 response ot the client. |
typedef enum {
// Start of resource file types
WSP_RESPONSE_NO_TYPE = 0x100,
WSP_RESPONSE_BINARY,
WSP_RESPONSE_JAVA,
WSP_RESPONSE_WAV,
WSP_RESPONSE_OGG,
WSP_RESPONSE_MP3,
WSP_RESPONSE_GIF,
WSP_RESPONSE_PNG,
WSP_RESPONSE_BMP,
WSP_RESPONSE_ICON,
WSP_RESPONSE_TTF,
WSP_RESPONSE_EOT,
WSP_RESPONSE_PDF,
WSP_RESPONSE_TEXT,
WSP_RESPONSE_XML,
WSP_RESPONSE_CSS,
WSP_RESPONSE_JAVASCRIPT,
WSP_RESPONSE_JSON,
WSP_RESPONSE_HTML,
WSP_RESPONSE_SVG,
WSP_RESPONSE_WOFF,
WSP_RESPONSE_G711,
WSP_RESPONSE_G722,
WSP_RESPONSE_G729,
WSP_RESPONSE_JPEG,
WSP_RESPONSE_MP4,
WSP_RESPONSE_WEBM,
WSP_RESPONSE_PEM,
WSP_RESPONSE_MOBILECONFIG,
WSP_RESPONSE_CACHE_MANIFEST,
WSP_RESPONSE_OPUS,
WSP_RESPONSE_CSV,
} wsr_type_t;
Overview
When sending data for a GET request, the type of the resource send must be set in the response header. So the application must define
the type of the data to send passing of of the wsr_type_t values to IWebserverGet::SetTransferInfo(). The webserver will set the appropriate
MIME type for the Content-Type header field.
The names of that values are self-explanatory, except for WSP_RESPONSE_NO_TYPE (means that no MIME type will be set in the response header)
and WSP_RESPONSE_BINARY (a general binary data stream with MIME type application/octet-stream).
An application can use the GetResponseTypeForFileName() function to determine the correct wsr_type_t value according
to the filename suffix.
typedef enum {
WSP_NORMAL_CLOSE, // The app itself initiated the shutdown
WSP_REGISTER_PATH_INVALID, // The given path is invalid
WSP_WEBSOCKET_PATH_INVALID, // The given Websocket listen path is invalid.
WSP_WEBSOCKET_PATH_ALREADY_LISTENING, // Someone alrady is listening to that path for websocekt connections
WSP_PATH_ALREADY_REGISTERD, // A data provider already registered to that resource
WSP_ADDRESS_INVALID, // The address the application tried to connect to was invalid
WSP_CONNECTION_ERROR // An connection error occured (see log, if exists),
} wsp_close_reason_t;
Overview
One of theese values will be passed to UWebserverPlugin::WebserverPluginShutdownComplete() to determine the reason of the
shutdown. This close reasons here are for the WebserverPlugin itself.
Values
| WSP_NORMAL_CLOSE | A normal shutdown, initiated by the application itself. |
| WSP_REGISTER_PATH_INVALID | The path given als applications root or passed to IWebserverPlugin::HttpListen() or IWebserverPlugin::PassthroughListen() is invalid. |
| WSP_WEBSOCKET_PATH_INVALID | The path als applications root or passed to IWebserverPlugin::WebsocketListen() is invalid. |
| WSP_WEBSOCKET_PATH_ALREADY_LISTENING | The application called IWebserverPlugin::WebsocketListen() for a path someone already is listening to. |
| WSP_PATH_ALREADY_REGISTERD | The application called IWebserverPlugin::HttpListen() or IWebserverPlugin::PassthroughListen() for a path someone already is registered to.. |
| WSP_ADDRESS_INVALID | The address the application try to connect to communicate with the webserver was invalid. |
| WSP_CONNECTION_ERROR | A connection error occured (see log for details). |
typedef enum {
WSCR_NORMAL_CLOSE,
WSCR_BUFFER_OVERFLOW,
WSCR_SOCKET_LOST,
WSCR_ERROR,
} ws_close_reason_t;
Overview
One of theese values will be passed to UWebsocket::WebsocketCloseComplete() to determine the reason why the websocket connection
had been closed. This values are for Websocket only.
Values
| WSCR_NORMAL_CLOSE | A normal close, initialted by th application or the client. |
| WSCR_BUFFER_OVERFLOW | The connection had been closed because of an buffer overflow error. |
| WSCR_SOCKET_LOST | The socket used for the connection had been lost. |
| WSCR_ERROR | An error occured. See log for details. |
typedef enum {
WS_REQUEST_GET = 0x0001,
WS_REQUEST_POST = 0x0002,
WS_REQUEST_PUT = 0x0004,
WS_REQUEST_PASSTHROUGH = 0x0008,
WS_REQUEST_PROPFIND = 0x0010,
WS_REQUEST_MOVE = 0x0020,
WS_REQUEST_COPY = 0x0040,
WS_REQUEST_MKCOL = 0x0080,
WS_REQUEST_DELETE = 0x0100,
WS_REQUEST_OPTIONS = 0x0200,
WS_REQUEST_LOCK = 0x0400,
WS_REQUEST_UNLOCK = 0x0800,
WS_REQUEST_PROPPATCH = 0x1000
} ws_request_type_t;
Overview
Theese values will be passed to UWebserverPlugin::WebserverPluginHttpListenResult() to define the type of th request. When accepting,
the application must call IWebserverPlugin::Accept() with a propriate request handler instance for that request.
Note: A request for a path the application is listening to buy calling IWebserverPlugin::PassthroughListen() before will lead
to an UWebserverPlugin::WebserverPluginPassthroughListenResult() callback. The WS_REQUEST_PASSTHROUGH enum type will only be used
internally and because of this never be passed to UWebserverPlugin::WebserverPluginHttpListenResult().
Values
| WS_REQUEST_GET | A GET request. Must be accepted with an UWebserverGet instance. |
| WS_REQUEST_POST | A POST request. Must be accepted with an UWebserverPost instance. |
| WS_REQUEST_PUT | A WebDAV PUT request. Must be accepted with an UWebserverPut instance. |
| WS_REQUEST_PASSTHROUGH | Used internally only by IWebserverPlugin. A passthrough request reaches the application throuh UWebserverPlugin::WebserverPluginPassthroughListenResult() and must be accepted with an UWebserverPassthrough instance. |
| WS_REQUEST_PROPFIND | A WebDAV PROPFIND request. Must be accepted with an UWebserverPropfind instance. |
| WS_REQUEST_MOVE | A WebDAV MOVE request. Must be accepted with an UWebserverMove instance. |
| WS_REQUEST_COPY | A WebDAV COPY request. Must be accepted with an UWebserverCopy instance. |
| WS_REQUEST_MKCOL | A WebDAV MKCOL request. Must be accepted with an UWebserverMkCol instance. |
| WS_REQUEST_DELETE | A WebDAV DELETE request. Must be accepted with an UWebserverDelete instance. |
| WS_REQUEST_OPTIONS | A WebDAV OPTIONS request. Must be accepted with an UWebserverOptions instance. |
| WS_REQUEST_LOCK | A WebDAV LOCK request. Must be accepted with an UWebserverLock instance. |
| WS_REQUEST_UNLOCK | A WebDAV UNLOCK request. Must be accepted with an UWebserverUnlock instance. |
| WS_REQUEST_PROPPATCH | A WebDAV PROPPATCH request. Must be accepted with an UWebserverProppatch instance. |
typedef enum {
WS_AUTH_DECACTIVATED,
WS_AUTH_DYNAMIC,
WS_AUTH_STATIC,
WS_AUTH_ERR_PATH_NOT_LISTENING,
WS_AUTH_ERR_PATH_INVALID
} ws_update_auth_result_t;
Overview
This are the results received by the webserver when changing the configuration for authentication by using IWebserverPlugin::SetAuthConfig().
Values
| WS_AUTH_DECACTIVATED | The authentication for the given path had been deactivated. |
| WS_AUTH_DYNAMIC | The given path now uses dynamic authentication, which means that the webserver will ask the app for username / password. |
| WS_AUTH_STATIC | The given path now uses static authentication with the username / password passed to the previous SetAuthConfig() call. |
| WS_AUTH_ERR_PATH_NOT_LISTENING | SetAuthConfig() had been called for a path without calling IWebserverPlugin::HTTPListen() first. |
| WS_AUTH_ERR_PATH_INVALID | SetAuthConfig() had been called for a path which doesn't belong to the IWebserverPlugin instance. |
class IWebserverGetRange {
public:
enum range_type_t {
RANGE_NONE = 0x00,
RANGE_START_END = 0x01,
RANGE_START_ONLY = 0x02,
RANGE_LAST_BYTES = 0x03
} rangeType;
};
Overview
This are values to define the type of the range received with a GET request.
Values
| RANGE_NONE | There is no range sent with the request. This value is only used internally. |
| RANGE_START_END | The range request defines the start and end bytes of the requested resource. |
| RANGE_START_ONLY | The range request defines the start byte inside the resource. The application must send the data starting from this byte on the rest of the resource. |
| RANGE_LAST_BYTES | The request defines the last bytes of the resource the application needs to send. |
Structures
typedef struct {
const char * sfx;
wsr_type_t type;
} ws_type_sfx_t;
static const ws_type_sfx_t suffixes[] = {
{ "html", WSP_RESPONSE_HTML },
{ "htm", WSP_RESPONSE_HTML },
{ "css", WSP_RESPONSE_CSS },
{ "xml", WSP_RESPONSE_XML },
{ "xsl", WSP_RESPONSE_XML },
{ "js", WSP_RESPONSE_JAVASCRIPT },
{ "json", WSP_RESPONSE_JSON },
{ "ico", WSP_RESPONSE_ICON },
{ "bin", WSP_RESPONSE_BINARY },
{ "jar", WSP_RESPONSE_JAVA },
{ "png", WSP_RESPONSE_PNG },
{ "gif", WSP_RESPONSE_GIF },
{ "bmp", WSP_RESPONSE_BMP },
{ "pdf", WSP_RESPONSE_PDF },
{ "wav", WSP_RESPONSE_WAV },
{ "ogg", WSP_RESPONSE_OGG },
{ "mp3", WSP_RESPONSE_MP3 },
{ "txt", WSP_RESPONSE_TEXT },
{ "soap", WSP_RESPONSE_XML },
{ "svg", WSP_RESPONSE_SVG },
{ "ttf", WSP_RESPONSE_TTF },
{ "eot", WSP_RESPONSE_EOT },
{ "woff", WSP_RESPONSE_WOFF },
{ "woff2", WSP_RESPONSE_WOFF },
{ "g711a", WSP_RESPONSE_G711 },
{ "g711u", WSP_RESPONSE_G711 },
{ "g722", WSP_RESPONSE_G722 },
{ "g729", WSP_RESPONSE_G729 },
{ "jpeg", WSP_RESPONSE_JPEG },
{ "mp4", WSP_RESPONSE_MP4 },
{ "webm", WSP_RESPONSE_WEBM },
{ "pem", WSP_RESPONSE_PEM },
{ "mobileconfig", WSP_RESPONSE_MOBILECONFIG },
{ "appcache", WSP_RESPONSE_CACHE_MANIFEST },
{ "opus-nb", WSP_RESPONSE_OPUS },
{ "opus-wb", WSP_RESPONSE_OPUS },
{ "csv", WSP_RESPONSE_CSV },
};
Overview
This structure, in conjunction with the suffixes[] array, is used by GetResponseTypeForFileName() function
to determine the correct wsr_type_t value depending on the suffix of a filename.
Values
| const char * sfx | The filename suffix. |
| wsr_type_t type | The wsr_type_t value for that suffix. |
Code Example
IWebserverPlugin - IWebserverGet
app::app(IIoMux * iomux)
: iomux(iomux)
{
this->webserverPlugin = IWebserverPlugin::Create(iomux, this);
this->webserverPlugin->RegisterForPath("/path/to/webserver", "/demoapp/main");
}
void app::WebserverPluginWebRequest(IWebserverPlugin * plugin, ws_request_type_t requestType, char * resourceName, ulong64 dataSize)
{
if (requestType != WS_REQUEST_GET || strcmp(resourceName, "myresource.png") != 0)
plugin->Cancel(WSP_CANCEL_NOT_FOUND);
else {
plugin->Accept(new MyGetHandler);
}
}
// ==== MyGetHandler
class MyGetHandler {
protected:
char * dataBuffer;
ulong64 dataSize;
ulong64 dataSend;
public:
MyGetHandler() {}
~MyGetHandler() {}
void WebserverGetRequestAcceptComplete(IWebserverGet * const webserverGet)
{
// We assume that there is a function that returns the http file instance...
httpfile * myFile = GetFileForName(webserverGet->GetResourceName());
dataBuffer = myFile->GetData();
dataSize = myFile->GetSize();
dataSend = 0;
webserverGet->SetTransferInfo(wsr_type_t(myFile->GetResourceType()),
myFile->GetSize(),
wsr_flags_t(myFile->GetFlags()));
this->SendNextPart(webserverGet);
}
void WebserverGetSendResult(IWebserverGet * const webserverGet)
{
this->SendNextPart(webserverGet);
}
void SendNextPart(IWebserverGet * const webserverGet)
{
ulong64 dataSize = staticFile->GetSize();
if (bytesSend < dataSize) {
ulong64 dataSizeDiff = dataSize - bytesSend;
ulong64 sendSize = dataSizeDiff > WS_MAX_DATA_SIZE ? WS_MAX_DATA_SIZE : dataSizeDiff;
webserverGet->Send((void *)(dataBuffer + bytesSend), sendSize);
bytesSend += sendSize;
if (bytesSend == dataSize)
webserverGet->Close();
}
}
void WebserverGetCloseComplete(IWebserverGet * const webserverGet)
{
delete webserverGet;
delete this;
}
};
IWebserverGet - IWebsocket
app::app(IIoMux * iomux)
: iomux(iomux)
{
this->webserverPlugin = IWebserverPlugin::Create(iomux, this);
this->webserverPlugin->RegisterForPath("/path/to/webserver", "/demoapp/main");
this->webserverPlugin->WebsocketListen();
}
void app::WebserverWebsocketListenResult(IWebserverPlugin * plugin, const char * path, const char * host)
{
if (strcmp(host, "some-bad-host.de") == 0)
this->webserverPlugin->Accept(nullptr); // Deny conection.
else
this->webserverPlugin->Accept(new appWebsocket());
}
// appWebsocket - user for IWebsocket
void appWebsocket::WebsocketAcceptComplete(class IWebsocket * websocket)
{
this->websocketInst = websocket;
}
void appWebsocket::WebsocketSendResult(class IWebsocket * websocket)
{
printf("Websocket data sent\n");
this->websocketInst->Close();
}
void appWebsocket::WebsocketRecvResult(class IWebsocket * websocket, const void * buffer, size_t len, bool text)
{
printf("Websocket - received data (text = %s)\n", (text ? "true" : "false"));
debug->HexDump(buffer, len);
this->websocketInst->Send(buffer, len, text);
}
void appWebsocket::WebsocketCloseComplete(class IWebsocket * websocket, ws_close_reason_t reason)
{
delete this->websocketInst;
delete this;
}


BoardGameOne is a browser-based game engine for creating computer games based on a grid of equally spaced squares. Games created with it are styled after board games of old, but with additions borrowed from role playing games and early two dimensional computer games like Zelda. BoardGameOne has these basic features:
Game Definition Editor
Game Player which can be easily modified to open a specific game when loaded into the browser
Basic set of images for buildings, landscapes, home furnishings, bodies of water, modes of transportation, players, obstacles, tools. This basic set can be expanded to include your own images.
Built-in scripting language, simple and easy to learn.
Time-slices for movement of players and obstacles.
Ability to chain to new game board, an then return to the previous board, all during game play.
The Game Definition Editor path is util/editor.html.
It is used to create and edit a game definition, and can also be used to run the game and see how it is working. Game definitions are stored as a single JSON map, which can be saved though a web server with Http PUT ability, or save locally with a cut-and-paste operation.
Besides the complete game definition, the editor includes a scratch area where selected portions of the game definition can written to, and then read from, in order to reuse elements of an already created game into a new game.
The editor also has support for troubleshooting your game functionality, with Single-Step run mode, and direct entry of Script instructions.
After opening up the Game Editor in your browser, you will see: two lines beginning with titles in bold, two blank colored lines(red/blue), three more lines with titles in bold, and a section in green. Basic functions are grouped together on each line. Here is a basic description of the functionality of each group:
File
loading and
saving the game definition to the web server or local storage,
loading or saving the scratch area to web/local storage, and
clearing the scratch pad.
New
creating a
new board, adding rows and columns to the existing board, and
loading images made available for placement on the board.
Red Line
description of the
board square which the mouse is over: location, players and items
present.
Blue Line
status messages
which appear periodically.
Board
various
functions which pertain to the board and board squares which are
selected.
Players
various
functions which pertain to creating and maintaining Players.
Items
various
functions which pertain to creating and maintaining Items.
Green Area
functions related
to both running and troubleshooting the game during run mode.
As of yet, the game board hasn't appeared on the page. It will appear directly above the red and blue lines after loading one with the File-Load button or creating one with the New-Create button.
File
Name
text area for the name
of the JSON map file in which to load from, or save to, the game
board definition. This applies to saving through the web server, but
not when saving locally. This definition will cover the Board,
Players, and Items definition data.
Load
button to load the named
board definition file from the web server, or from the text box for
local storage. When developing with Dart and using the supplied web
server application, the location path is: BoardGame1/web/data; the
extension is: .json. The function uses a Http GET on port 8080.
Loading a board definition will overwrite the current game board, if
it is present.
Save
button to save the named
board definition file to the web server, or write in to the text box
for local storage. The location and extension, when using Dart with
the supplied web server application, is the same as a load. The
function uses a Http PUT on port 8080. The board definition is a
complete description of the current game Board, with Players and
Items included
UseLocal
button to select loading and saving to a local
file using cut-and-paste operations, for both board definition and
scratch area, instead of a web server. This button will open a small
text window in which text can be displayed. For loading, this is the
text box will have the loading text pasted into it. For saving, this
text box will show the text which will be cut out for pasting into a
text editor.
UseWeb
button to select loading and saving with a web
server. This will close the text box opened with UseLocal if
present, and restore the default operation of loading and saving to
a web server.
LoadScratch
button to load the named file into the
Scratch Area. Just like the Load function, but the Scratch Area is
loaded instead of the board definition.
SaveScratch
button to save the Scratch Area into the
named file. Just like the Save function, but the Scratch Area is the
source instead of the board definition.
ClearScratch
clear the Scratch Area of any contents. The
Scratch Area is where selected portions of the game board, selected
Players and selected Items can be written to or read from. It is
used primarily for transferring portions of a game board definition
from an existing board to a new board, basically a cut-and-paste
area for definition data.
New
Rows
holds the number of rows in the new game board being
created.
Cols
holds the number of columns in the new game board
being created.
Create
button to create a new, empty game board of the
specified rows and columns.
AddROW
button to add a single row into an existing game
board.
AddCOL
button to add a single column into an existing
game board.
Images
selector to specify the location of the directory
which holds the images available for placing on selected game board
squares. This will be a pull down list of possible directories which
have been recognized when the Editor page first loaded. The images
available are broken down into categories, with each category in a
separate directory, to make image selection more manageable. After
changing the directory, use the “Reload” function.
Count
holds the number of images to load on a single line
during the “Reload” function, available for changing in case the
Editor page width is changed, etc.
Reload
button to reload the images indicated in the
Images directory, with Count images per line, as thumbnails into the
area directly above the Green Area and below Items.
Board
Multi
check box to enable selecting multiple squares on
the game board.
Range
check box to enable selecting a range of squares on
the game board.
Copy
button to copy the selected board squares into the
Scratch Area.
Paste
button to paste any board squares saved in the
Scratch Area onto the game board, at the location of the first
selected square.
Property Selector
pull down selector of common properties
which can be applied to all selected board squares in one operation.
Property Text Area
value of the property selected by the
selector, which will be applied to selected board squares.
Update
button to perform the application of the property
and value (from Property above) to the selected squares.
BoardProperties
button to open an area to edit and create
global board properties.
DropPlayer
button to remove any players from the selected
board squares.
DropItem
button to remove any items from the selected
board squares.
Players
Copy
button to copy the selected Player into the Scratch
Area.
Paste
button to append any Players saved in the Scratch
Area onto the Player list.
Player Selector
pull down list of current Players, from
which one can be selected.
Edit
button to open an area to edit and create properties
of the selected Player.
Place
button to place the selected Player onto the board
at all selected board squares.
Name
text area for name of the new Player to create.
Create
button to create a new Player of the given name.
Delete
button to delete the selected Player
Items
Copy
button to copy the selected Item into the Scratch
Area.
Paste
button to append any Items saved in the Scratch
Area onto the Item list.
Item Selector
pull down list of current Items, from which
one can be selected.
Edit
button to open an area to edit and create properties
of the selected Item.
Place
button to place the selected Item onto the board at
all selected board squares.
Name
text area for name of the new Item to create.
Create
button to create a new Item of the given name.
Delete
button to delete the selected Item
Run Mode Area ( Green Area )
Swap
button to swap both the red and blue message areas
for a chat area, or swapping the chat area for the red and blue
message area.
Run
button to set the game into run mode; adjust the look
of the game board to running and begin running the game from the
beginning
SingleStep
button to set the game into single-step run
mode; begin running the game from the beginning but don't start the
time-slice timer running.
Step
button to move forward one time-slice when in
single-step mode.
Stop
button to stop the game running; adjust the look of
the game board to stopping and stop all game activity.
Source
text area for entering programming script to be
interpreted immediately (after Enter key) during stop or run mode.
Any script commands will be echoed directly below.
Clear
button to clear any script text which were echoed
from the Source text area.
Console
text area for enter any console commands. Any
console commands will be echoed directly below.
Clear
button to clear any console commands which were
echoed from the Console text area.
Properties, along with the corresponding values associated with them, are used extensively to control various aspects of the game board and game play. These are generally referred to as property-value pairs. All elements of BoardGameOne can have property-value pairs attached to them. Some properties have been predefined to be used in specific ways, that is to perform specific functions in the game engine. Otherwise, properties can be created as needed and accessed by the scripting language to perform other functions which you define.
Below are the predefined properties, group by those that apply to all elements and those that apply to a specific game element, and a description of the function they perform in game play.
Universal Properties
desc
a simple description of the game element, or a label
to a more detail description created with the DescEditor
imagename
path to the image which is to be used with this
element
Game Board Properties
title
holds the game title
library
name of a script library to load
Game Square Properties
locked
if set to “true”, indicates the square is
locked and cannot be entered
enteraction
script to be executed when the square is
entered by a player
leaveaction
script to be executed when the square is
exited by a player
Player Properties
POV
assigns this player to be the “point of view”,
that is the player which is controlled by the actual game player
point
assign a direction to which the player will point:
either that of right, left, up or down
initaction
script to be executed once when game begins
action
script to be executed for each time-slice the
player is active
behavior
one of the available behavior personalities
knowledge
one of the available knowledge bases, used for chatting
Item Properties
accept text_object
text_object = $accept
echo object
The Echo object is used to display text and values to the player. It will echo to the console the next object on the input line, substituting any object references for the contents of the object. Object references are the name of the object preceded by the dollar sign (\$). Text can be quoted with single (') or double (") quotes. See help on 'quoting' for more information on quoting in Mandy.help object_name[,object_name,...]
The Help object will offer help on the list of subjects which follow. Subjects can be object names, like 'help', or an additional topic if available. Help offerered for objects using the "help objectname" form is the exact same help supplied by using ? with the object itself "objectname ?".list level_number
The list object will provide a list of objects in the dictionarie(s). Used alone it will show objects from all dictionary levels. Levels increase when Routine-created objects are called with the Call object. When a numeric expression is provided, only dictionaries from that level or greater are shown. Level 0 contains all predefined language objects, and level 1 and greater contain all created objects.call text_object
The Call object is used to invoke a stored routine. Following the Call object should be the name of an object which has been previously created with the Routine object.verbose number
The Verbose object is used to control the level of verbosity, which is the level information that Mandy provides as it interprets instructions. The Verbose object acts just like a object created by Value and takes the same methods: =, + and -.break instructions
The Break object is used to interupt interpretation of the current stream and enter an interactive Mandy state. Whatever follows on the input line is passed to the interpreter and interpeted before any other input. To return to the previous interupted state use the End object.compare object_1 object_2
The compare object will compare two objects and return the relationship as a value. When the two objects are text objects, compare will perform alphabetic sorting. Compare is first used with the two objects supplied on the input line as arguments. Then compare is referenced in an exression or in a value object assignment. The value of compare will be -1, 0, or 1 depending on whether the first object is alphabetically less than, the same as, or greater than the second object.text object_name[,object_name,...]
The Text object is used to create new objects which can hold either text or routines (routines are a set Mandy instructions which are invoked later). Following the Text object should be the name, or a list of names, which the new object(s) will take. See help on 'naming' for more information on object naming in Mandy.value object_name[,object_name,...]
The Value object is used to create new objects which can hold values. Following the Value object should be the name, or a list of names, which the new object(s) will take. See help on 'naming' for more information on object naming in Mandy.object object_name[,object_name,...]
The Object object is used to create new general purpose objects. These objects will be derived from user-supplied prototypes. Following the Object object should be the name, or a list of names, which the new object(s) will take.dup new_object_name object_name
The dup object is used to duplicate an existing object, making an exact copy with a new name. Text and Value objects will retain their original data, and for Object objects all properties and methods are duplicated into the new object. The dup object is unusual in that it takes two instructions: following the dup object should be the name of the object to duplicate, and following that is the name that the new object will take.end
The End object is used to end a block of instructions which have been started by the use of a For, While, or If object. It can be also used to end the Mandy interpreter itself.else
The Else object is used to end the block of conditional instructions executed when true, and begin the block of conditional instructions executed when false.if condition
The If object is used to conditionally execute a set of instructions. Following the If object is an expression which will be evaluated for truth. If true, all the input lines following the If object will be executed until either an Else or End object is encountered. If false, all the input lines will be ignored until an Else object is encountered, and the lines following the Else until an End object will be executed. If no Else is encountered, all lines will be ignored until the End.while condition
The While object is used to repeatedly execute a set of instructions while a certain condition is true. The condition is evaluated before each execution of the set, and when events occuring within the instructions change the condition in then that will be reflected in the evaluation and the loop can end.player new_object_name player_identifier
Player is used to create an object with the modifiable properties of an active player. The first argument is the name of the object to create, and the second the identifier of the player whose properties you wish to access, or "POV". Reading the value of the Player object will return the success of the last usage of Player.square new_object_name square_identifier
value_object = $square
text_object = $square
warp player_identifier location_identifier
Warp is used to instantly transport a player to a specific location on the board and is usually called by an action property within a square. First argument is a player name reference, or POV, and the second argument is the location identifier of the location to warp to.move classname direction
Move is used to move a player who is not the POV player one square in any direction. The first argument is the class to stay in, and the second is the direction: left, right, above, below, leftward, rightward, forward, backward, shiftleft, shiftright. Reading the value of move object will return the success of the last move attempted.merge class_description passing_direction
Merge left or right within a class. Merge doesn't change the player's direction, it's the same as passing. Reading the value of merge object will return the success of the last merge attempted.forward class_description turning_direction passing_direction
Forward is an advanced form of move. It takes three arguments: the class of the area to stay in, and the suggested turning direction if forward is not possible (leftward, rightward), and the passing direction(left,right). Reading the value of move object will the success of the last move attempted(0=no move,1=foward,2=turn,3=pass)proximity player_name distance_limit
text_object = $proximity
clone player_name location_ident
Clone is used to clone a new player from the player definitions and place them somewhere on the board. The first argument is the name of the player to clone, and the second is the location ident of the location to place the new player.game control_argument [ setting ]
Game is used to control game action. It accepts at a minimum one control argument: stop, pause, continue, speed, chain, return. 'stop' stops the game (once stopped, game cannot be restarted), 'pause' will pause the game and stop autonomous players from moving, 'continue' will unpause the game, 'speed' will modify timer speed (it accepts one argument, the timer interval in milliseconds), 'chain' will chain load another game board and continue play on that board, 'return' will return from a chain load game to the caller board.message =/+ text_object
Message is used to update the text which shows in the board's message area. Message acts just like a text object.narrative narative_file_name
The Narrative object is used to display a game narrative on command. Following the narrative object should be the name of the narrative file.slice function value
The Slice object is used to control aspects of a player's time slice. The first argument is the function: 'time' is the only one defined. Following the function argument object should be a numeric value.


|
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.
|
Public Member Functions | |
| def | __init__ (self, DEM_parameters) |
| def | Barrier (self) |
| def | AddMpiVariables (self, model_part) |
| def | CreateDirectories (self, main_path, problem_name, run_code='', do_print_results=True) |
| def | PreProcessModel (self, DEM_parameters) |
| def | FindMaxNodeIdInModelPart (self, model_part) |
| def | DeleteFiles (self) |
| def | KratosPrintInfo (self, message) |
| Public Member Functions inherited from DEM_procedures.Procedures | |
| def | SetTranslationalScheme (self) |
| def | SetRotationalScheme (self) |
| def | AddAllVariablesInAllModelParts (self, solver, translational_scheme, rotational_scheme, all_model_parts, DEM_parameters) |
| def | AddCommonVariables (self, model_part, DEM_parameters) |
| def | AddSpheresVariables (self, model_part, DEM_parameters) |
| def | AddRigidFaceVariables (self, model_part, DEM_parameters) |
| def | AddElasticFaceVariables (self, model_part, DEM_parameters) |
| def | AddClusterVariables (self, model_part, DEM_parameters) |
| def | SetInitialNodalValues (self, spheres_model_part, cluster_model_part, dem_inlet_model_part, rigid_face_model_part) |
| def | SetUpBufferSizeInAllModelParts (self, spheres_model_part, spheres_b_size, cluster_model_part, clusters_b_size, dem_inlet_model_part, inlet_b_size, rigid_face_model_part, rigid_b_size) |
| def | FindMaxNodeIdAccrossModelParts (self, creator_destructor, all_model_parts) |
| def | ModelData (self, spheres_model_part, solver) |
| def | MonitorPhysicalProperties (self, model_part, physics_calculator, properties_list) |
| def | RemoveFoldersWithResults (self, main_path, problem_name, run_code='') |
| def | SetBoundingBoxLimits (self, all_model_parts, creator_destructor) |
| def | SetBoundingBox (self, spheres_model_part, clusters_model_part, rigid_faces_model_part, dem_inlet_model_part, creator_destructor) |
| def | CheckVariableType (self, var, expected_type, msg) |
| def | Flush (self, a) |
| def | KratosPrintWarning (self, message) |
Additional Inherited Members | |
| Public Attributes inherited from DEM_procedures.Procedures | |
| DEM_parameters | |
| rotation_OPTION | |
| bounding_box_OPTION | |
| automatic_bounding_box_OPTION | |
| contact_mesh_OPTION | |
| b_box_minX | |
| b_box_minY | |
| b_box_minZ | |
| b_box_maxX | |
| b_box_maxY | |
| b_box_maxZ | |
| bounding_box_enlargement_factor | |
| domain_size | |
| solver | |
| translational_scheme | |
| rotational_scheme | |
| def DEM_procedures_mpi.Procedures.__init__ | ( | self, | |
| DEM_parameters | |||
| ) |
Reimplemented from DEM_procedures.Procedures.
| def DEM_procedures_mpi.Procedures.AddMpiVariables | ( | self, | |
| model_part | |||
| ) |
Reimplemented from DEM_procedures.Procedures.
Reimplemented in DEM_procedures_mpi_no_partitions.Procedures.
| def DEM_procedures_mpi.Procedures.Barrier | ( | self | ) |
Reimplemented from DEM_procedures.Procedures.
| def DEM_procedures_mpi.Procedures.CreateDirectories | ( | self, | |
| main_path, | |||
| problem_name, | |||
run_code = '' , |
|||
do_print_results = True |
|||
| ) |
Reimplemented from DEM_procedures.Procedures.
| def DEM_procedures_mpi.Procedures.DeleteFiles | ( | self | ) |
Reimplemented from DEM_procedures.Procedures.
| def DEM_procedures_mpi.Procedures.FindMaxNodeIdInModelPart | ( | self, | |
| model_part | |||
| ) |
Reimplemented from DEM_procedures.Procedures.
Reimplemented in DEM_procedures_mpi_no_partitions.Procedures.
| def DEM_procedures_mpi.Procedures.KratosPrintInfo | ( | self, | |
| message | |||
| ) |
Reimplemented from DEM_procedures.Procedures.
| def DEM_procedures_mpi.Procedures.PreProcessModel | ( | self, | |
| DEM_parameters | |||
| ) |
Reimplemented from DEM_procedures.Procedures.


'It is business as usual for Mango', says CEO as SAA goes on strike
by Canny MaphangaDomestic airline Mango has continued with "business as usual" after two unions at South African Airways (SAA) embarked on a planned strike on Friday.
"I think for us, it is business as usual. Fridays are a very busy day for us normally, so it has made a busy day just busier," Mango CEO Nico Bezuidenhout told News24 at OR Tambo International Airport on Friday.
SAA on Thursday evening asked passengers who had been booked to travel on all its domestic, regional and international flights on Friday and Saturday, not to turn up at airports, but to instead follow the airline's travel policy to exercise their rights following the cancellation of flights because of industrial action, Fin24 reported.
Mango extended its resources to assist SAA with any possible transfers during the industrial action.
"We have added a couple of extra flights. I believe that most of the flights will be absorbed and most of the seats will be absorbed by passengers, so for us largely it is business as normal," he explained.
'Matched to the demand'
Bezuidenhout further added that resources are not a concern as they are "accurately matched to the demand".
READ | 'I had no idea' - Brazilian passenger on SAA strike after landing at OR Tambo
The CEO however shared his thoughts on the strike, calling the situation "unfortunate", as it did not best serve the interests of both parties.
"Generally, it is unfortunate when a strike is reached, it is ultimately not in the interests of the employer nor the employee.
"I would hope that the issue can be resolved fairly quickly. Again, this current situation does not aid the objectives of the employees or of SAA, who is in the midst of a turnaround," he said.
The National Union of Metalworkers of SA (Numsa) and the SA Cabin Crew Association announced that they would ground all SAA planes on Friday.
The two unions, representing more than 3 000 staff members at SAA, said the strike is to protest against plans to fire 944 employees, and the carrier's failure to meet their pay demands, Fin24 reported.
According to the unions, SAA is offering a 5.9% wage increase, to be paid from March 2020. Unions want an 8% wage increase across the board, to be paid on December 13, 2019.


HTML, CSS, JavaScripts/This WebPage is to help potential Epicodus's students to find which track they should choose.
HTML, CSS, JavaScripts/This WebPage is to show the funny result which is based on user's inputted number.
HTML, CSS, JavaScripts/This WebPage is to take order of customizd pizza and will display the receipt for customers.


filter: A sound processing module that modifies the harmonic structure of a sound. Each voice has two, and each one can be tuned to any pitch and modulated by any {_control_signal control signals}. A filter can emphasize those frequencies around the pitch it is tuned to by turning its {_resonance} up, and usually attenuates frequencies above that point, but it can also attentuate frequencies below that point as well. Finally, if the resonance is turned all the way up, the filter becomes an oscillator, superimposing a sine wave on top of whatever signal is fed through the filter.
Also: {_oscillator}, {_waveshaper}, {_amplifier}


I design websites that are both functional and visually attractive using HTML(5), CSS(3), Javascript, Bootstrap framework, Jasmine testing framework, Knockout framework and AJAX.
A website that is not responsive doesn't connect well with users. To achieve responsiveness, I use development principles such as media queries, fluid grids, flexible images and media.
I strive to develop succesful user interfaces by following a principled approach including user research, prototyping and evaluation techniques.
I was born and raised in Sivakasi, a lush green rural district in Tamil Nadu, India. I always had a deep interest in art and have made several paintings. With my computer science bakground, I aim to generate artistic visual content and develop websites and user interfaces to make our everyday interactions with machines easier and a fun filled experience. Keep scrolling to know more.
2009 : Discovered the passion for computer science within me
Completed my undergraduate in Computer Science from SFR College for women, Sivakasi, TamilNadu, India.
2011 : Realized the need for management skills
Completed my Masters in Business Administration from SASTRA University, Tanjore, Tamil Nadu, India.
2011 - 2013 : Got a flavor of Real world
Had a diverse work experience in finacial services, event management and in travel and tourism.
2013 - 2016 : Upside Down
woof ! I know it's a huge break but a lot happened in 3 years. Got married ! Moved to a different country ! Become a Mom !
Current : Realization of what I loved most
Earned a front end nano-degree from Udacity and User Interface design specialization from coursera (offered by University of Minnesotta-Twin Cities). Currently doing freelance web designing and looking for opportunities.


KEVIN K CHEN.
about me.
self-teaching myself to code and build products. attending dev bootcamp. raised in northern virginia. moved west in 2013.
writing.
August 11 2014 - chefs kitchen
August 11 2014 - website designs
August 17 2014 - css positioning
August 24 2014 - abstract random thinking
August 24 2014 - why javascript is popular
August 31 2014 - age discrimination in the valley
August 31 2014 - enumerable#group_by
September 8 2014 - when to use classes
September 8 2014 - pairing thoughts
September 13 2014 - stereotype threat
September 15 2014 - blocks, procs, lambdas
September 21 2014 - sql vs. nosql
September 21 2014 - affirmations and stereotypes
September 28 2014 - conflict resolution
September 28 2014 - computer memory
October 3 2014 - right questions
projects.
August 13 2014 - gps pairing website
August 16 2014 - responsive kittens site
September 29 2014 - ruby cheatsheet


import numpy as np
import PropensityFunctions as Propensity
import CoreClasses as Core
import ReplicatorFunctions as Rep
import random
[docs]def pick_reaction(dice_roll, CRS, concentrations, **kwargs):
''' Picks a reaction to occur stochastically
Arguements:
- dice_roll: float which should be a number between zero and the total propensity of reactions
- CRS: the CRS object which contains all possible reactions and molecules
- concentrations: the list of concentrations indexed by molecule ID
- propensity_function: which propensity function to use, default: standard
Return:
- rxn: a Reaction object'''
checkpoint = 0.0
for rxn in CRS.reactions:
reactant_concentrations = [concentrations[i] for i in rxn.reactants]
catalyst_concentrations = [concentrations[i] for i in rxn.catalysts]
reactant_coeff = rxn.reactant_coeff
catalyzed_constants = rxn.catalyzed_constants
#print rxn.catalysts
if rxn.prop == 'STD':
# print "Reactant concentrations: ", reactant_concentrations
# print 'Product ID numbers: ',rxn.products
checkpoint += Propensity.standard_propensity(rxn, CRS, concentrations)
#print "dice_roll: ", dice_roll, ' checkpoint: ', checkpoint
if checkpoint >= dice_roll:
break
elif rxn.prop == 'RCM':
mu = kwargs ['mu']
#print mu
checkpoint += Propensity.replicator_composition_propensity_envMutation(rxn, CRS, concentrations, mu = mu)
#print "dice_roll: ", dice_roll, ' checkpoint: ', checkpoint
if checkpoint >= dice_roll:
mutation_dice_roll = random.random()*Propensity.replicator_composition_propensity_envMutation(rxn, CRS, concentrations, mu = mu)
rep_rxn = Rep.pick_replicator(mutation_dice_roll, rxn, CRS, concentrations, mu = mu)
rxn = rep_rxn
break
#raw_input("Enter")
return rxn
[docs]def execute_rxn(rxn, CRS, concentrations):
''' Executes a single reaction instance
Arguements:
- rxn: Reaction object to execute_rxn
- CRS: CRS object containing the entire system
- concentrations: list of molecule concentrations indexed by ID
Return:
- concentrations: updated list of molecule concentrations indexed by ID '''
num_reactants = len(rxn.reactants)
num_products = len(rxn.products)
# Reduce Reactants
for i in range(num_reactants):
reactant_index = rxn.reactants[i]
concentrations[reactant_index] -= rxn.reactant_coeff[i]
# Increase Products
for i in range(num_products):
product_index =rxn.products[i]
concentrations[product_index] += rxn.product_coeff[i]
return concentrations


Toya Wright Makes Her Fans’ Day With This Video Featuring Reign Rushing
by Alexis StoneToya Wright shared a video featuring her baby girl, Reign Rushing and she made her fans’ day. The baby girl is cuter than ever and you can see this for yourselves below.
‘GM. 🌈 @reign_beaux wants you to know that her new book “Learning colors with Reignbeaux” is now available on Toyawrightpublishing.com Get your copy now! #primarymatters #learncolorsforkids,’ Toya captioned her post.
Someone else said: ‘Movvvve…mine” 😂😂You are scared of Reigny! 😂Big Boss Reign🥰😍.’
One other commenter posted: ‘Where can I purchase this book? My grandson will be 2 in March but he loves books and this would be awesome.’
 Congrats to you and your daughter sis🙌🙌’
One Instagrammer posted: ‘I literally post conspiracy theories that will make you rethink reality👀’
Someone else said: ‘Did she say move … mine lol too cute and sassy ( you were trying to get that binkie)’
A fan gushed over Reign Rushing: ‘Baby reign said “ok now momma you can move!😂😂 She’s to cute! @toyawright.’
Not too long ago, it’s been revealed that Toya is a proud mom. Just in case you don’t know, her baby girl, Reign, had her first ‘business moves.’
During this weekend, Toya and Reign’s fans were able to attend the baby girl’s book release party.


Professional Experience
Gypsy Moth Field Technician, USDA (current position)
Online Tutor, GIS and Remote Sensing (current)
GIS Analyst, Scott Air Force Base, 2016-2017
Spatial Ecologist/Asst. Prof., Jornada Experimental Range, 2008-16
Manage, organize, and manipulate GIS data, imagery, relational databases, related tables, and attachments. Design and create standard map templates and maps for field use, publication, and project support.
Provide training and support for map creation, data queries, toolbars, extensions, and ArcGIS Online. Create custom toolbars, help documents, and “best practices” for GIS and for specific projects for researchers and technicians unfamiliar with GIS and spatial data management.
Senior GIS Specialist, Miratek 2007
Classify imagery using eCognition software to identify remnant grasslands and to estimate the degree of shrub invasion on Ft Bliss Military Base.
Other Relevant Experience (at UIUC unless indicated)
Remote Sensing Volunteer: provided image and mapping support to map habitats in Quirimbas National Park, Mozambique, World Wildlife Fund, (Aug. 2010 – Dec. 2012).
Terrestrial Ecologist: create and maintain GIS testing sites database for use of U.S. Military weapons testing. Develop data dictionaries to streamline GPS data collection and train co-workers in GPS usage. The Nature Conservancy, White Sands Missile Range, NM; (Dec. 2000 – Jan. 2005).
Sr. Research Associate: mist-netted birds and conducted bird surveys on tree islands and in marshes in Northern Everglades; assisted in data collection and management; analyzed data using SAS; assisted in editing of manuscripts and reports, presented data and results at professional meetings. S. Florida Water Mgmt District, Everglades Systems Res. Div, West Palm Beach, FL. (Jan. 1998 – Feb. 1999).
Environmental Consultant: conducted bird and mammal surveys in a desert grassland, managed data. USDA Jornada Experimental Range/NMSU; (Apr. 1999 – Oct. 2000).
Lab coordinator: collected transect data, maintained experimental treatments; ran statistical analyses, and managed data, supervised students. Dept. of Biology, NMSU, (Sep. 1996 – Dec. 1997).
Conducted prairie songbird surveys, tracked radio-tagged blue-winged teal, Delta Waterfowl and Wetlands Research Station, Manitoba, (Apr. – Aug. 1993).
Assisted veterinarian in animal immobilizations and surgery, collaborated on inbreeding study of endangered addax antelope, Fossil Rim Wildlife Ctr., Glen Rose, TX, (Aug. – Dec. 1991).
Supervised nest monitoring scheme for avian nests in central Illinois woodlots as part of a study of edge effects on predation and brood parasitism rates of nesting birds. (May – Sep. 1996).
MS Thesis Research: Conducted experiments to investigate effects of ungulate herbivory on paternal fitness of scarlet gilia (Ipomopsis aggregata). Methods included hand pollination, pollen and seed collection and counts, viability assessments, and genetic analyses (isozymes). Advisor: Dr. Ken Paige. (Sep. 1993 – May 1996).
Teaching assistant: designed and taught laboratory for ornithology class; organized field trips, wrote lectures, and taught visual and audio bird identification (Jan. 1995-May 1995).
Supervised initial set-up of DNA fingerprinting laboratory. Extracted DNA from samples of the American toad. Trained students in protocols, ran gels. (Sep. 1993-May 1994).
Supervised monitoring for Neotropical migrant nests; mist netted songbirds, managed data, (May 1989 – Sep. 1996, periodic employment).
Tracked radio-tagged desert tortoises in Mojave Desert. As part of a team produced ecosystem management plan for military bases, (May 1995 – May 1996).
Mist netted and radio-tracked migrating thrushes (Oct. 1990 – Mar. 1992, periodic employment).
Collected snail egg sacs, maintained aquatic research laboratory, snail and Daphnia populations, (Aug. 1987-May 1989, periodic employment).
Assessed parasites and dominance hierarchy in Japanese quail, (Jun. 1987 – Sep. 1988).
Assisted in assessing freshwater fish population and electroshocking, (Jun. – Aug. 1986).
Trapped and marked prairie voles and Norway rats, (Jun. 1986 – Jul. 1988).


The site will attempt to match the general tone of the Star Wars saga.
At the point in the storyline I have chosen The Dark side is very much in control. The scene is set inside the Death Star and features the death of a major character.
There are also aspects of danger and excitement as there is a battle using fast and dangerous glowing weapons.


Elevation and terrain map of Italy showing a hypothetical bike race through the country
Infographic showing access to water in Eastern Africa in relation to the amount of people living in poverty.
Map showing the Arup Los Angeles office and the various public transportation routes in the surrounding area.
Precipitation levels in the Philippines following Typhoon Koppu in Oct. 2015 .
Map of the UN Humanitarian Air Service response during the Ebola Crisis in Western Africa.
Logistics planning map for the Panama Bureau of the UN World Food Programme. Shows various offices and operational countries in the region..
Map showing the available services in Western Africa during the Ebola response.
Map showing the emergency telecommunications services provided by WFP following the 2015 Nepal earthquake.


Public Member Functions | |
| population_state (Population *_pop, bool _n, noveltyarchive *_arc) | |
| void | reset () |
| void | clear_measure_pop () |
Public Attributes | |
| bool | mc_met |
| double | best_fitness |
| double | best_secondary |
| int | max_age |
| int | generation |
| long | evals |
| noveltyarchive * | archive |
| Population * | pop |
| population_state * | promote |
| data_rec | Record |
| vector< Organism * > | measure_pop |
| bool | novelty |


Pizza Time!
Order a hot, fresh pizza below and we'll tell you how much it'll set you back
Pizza Size
Large (17")
Medium (13")
Small (11")
Salami
Pepperoni
Sausage
Prosciutto
Marinated Chicken
Jerk Chicken
Olives
Green Peppers
Roasted Red Peppers
Fresh White Onions
Fresh Red Onions
Caramelized Sweet Onions
Extra Cheese (Mozerella)
Extra Cheese (Fontina)
Extra Cheese (Provol one/Mozerella)
Extra Cheese (Parmig iano-Regianno)
Extra Cheese (Chevre
Extra Cheese (Feta)
Black Mission Figs
Roasted Potatoes
Tuna
Walnuts
Sliced Pear
Cured Pork Loin


TimeCapsule
Toggle navigation
Upload
Hub Portal
Profile
Logout
Select your image source
Note: Data is saved in a private S3 Bucket
Drag & Drop
or
click here to browse
OR
Open Camera
Continue


Here is a list of all documented class members with links to the class documentation for each member:


HEALTH TOURISM
Medical tourism (also called medical travel, health tourism or global healthcare) is a term used to describe the rapidly-growing practice of travelling across international borders to seek healthcare services. Services typically sought by travelers include elective procedures as well as complex surgeries, etc.
Medical Treatment, Ayurveda Overview and Wellness & Rejuvenation
HEALTHCARETOURISM.COM
WELLNESS AND REJUVENATION
The country sees a steady influx of tourists from United States, United Kingdom, Canada, Germany, France, etc
Health and wellness
With consistent efforts by the government to strengthen and popularize alternative medicine systems and incredible growth opportunities across different segments
Medical Treatment
It is clear that there is no definite answer to which is the number one hospital in India
Fast Track – Zero Waiting Time
Quick and immediate attention for surgeries and all interventions are assured
Frontier technologies
Cutting edge technology to support medical diagnostics and medical procedures are employed by specialists in medical facilities
Global hub
With its plethora of highly skilled professionals and affordable healthcare, India is on course to become the next premium medical tourism destination.
Financial Savings
Quality of care is what attracts people
Feeling the pulse
For greater understanding between patients and healthcare personnel, the warmth and hospitality of Indian hospitals is a big factor in choosing India as a healthcare destination.
Finest Doctors
India has not only hospitals with world-class facilities but skilled world-class doctors and medical personnel too


I started as a pupil in one of the public schools in the outskirts of Kabete. Despite the school being a fair performer in the National Exams, I did my best and got admitted into a National Secondary School where I pushed my studies and got a good grade at the end of my four years. Now I am a student at Moringa School.
I had landed on many errand jobs since completing my high school since I could not go on with studies due to financial constraints.
Since I was a small kid I was always fascinated by computers and how they worked. That is why when I came about this opportunity to study at Moringa School, I never hesitated. I also believe that software development is key when it comes to marketable careers now and in the future.
When I am not busy with work or school, I enjoy:-
Click on the website name to redirect to the website
This was my first website to program. It shows some of my favorite photos of fish flies. Languages used are HTML5 and CSS
This website is the landing page of a street food restaurant. It shows what they serve and when. Languages used are HTML5 and CSS
This website was a group effort where we designed a website to give a platform for talented Kenyans to showcase their talents. Languages used are HTML5, CSS and a bit of JavaScript
This was actually a test website to test the application of responsive designs. anguages used are HTML5 and CSS
This website was the landing page of a restaurant called Farajah. It details all they have and do. Languages used are HTML5 and CSS
This website is the landing page of this website. It is a website that contains my other websites!. Languages used are HTML5 and CSS


{% block content_header %}
{% endblock content_header %}
{% block content %}
{% endblock content %}
{% block content_footer %}
{% endblock content_footer %}
{% import "macros/html" as html -%} {% import "macros/crumbs" as breadcrumbs with context -%} {% import "macros/controls" as controls with context -%}
{% block head %} {% block meta %} {% endblock %}


Survey Form
This Survey will help us know how much you like chocolate.
Name:
Email:
Age:
White chocolate
Dark chocolagte
Milk chocolate
Frozen
Melted
Wrapped
Extra Sweet
Semi Sweet
20% Cacao
Please insert any additional comments here.


Guess Superbowl Winner
Team
Arizona Cardinals
Atlanta Falcons
Baltimore Ravens
Buffalo Bills
Carolina Panthers
Chicago Bears
Cincinnati Bengals
Cleveland Browns
Dallas Cowboys
Denver Broncos
Detroit Lions
Green Bay Packers
Houston Texans
Indianapolis Colts
Jacksonville Jaguars
Kansas City Chiefs
Miami Dolphins
Minnesota Vikings
New England Patriots
New Orleans Saints
New York Giants
New York Jets
Oakland Raiders
Philadelphia Eagles
Pittsburgh Steelers
San Diego Chargers
San Francisco 49ers
Seattle Seahawks
St. Louis Rams
Tampa Bay Buccaneers
Tennessee Titans
Washington Redskins
Submit
Notes
There is one bug in this application. The selection for a Superbowl winner should be a Select2 widget and should not be a default select dropdown provided by the browser. The Select2 widget would provide autocomplete like functionality to the user.


1
Preface
2
Introduction
3
The Data
4
Visualizations
5
Prediction Models
5.1
ARIMA
5.2
Lineal Regression
5.3
KNN
5.4
Random Forests
5.5
XGboost
5.6
Neural Networks
6
Final Words
References
7
Gathering and Cleaning Data
7.0.1
Project goals:
7.0.2
Data gathering
8
Laboral dates
9
Wind direction
10
Tables preparation for Tableau Dashboards
10.0.1
CO tables
10.0.2
SO2 tables
11
Data Exploration
11.0.1
Relationships between variables
12
Data Exploration PM10 Constitucion Station
13
Prediction Models. ARIMA
13.0.1
“Prediction is very difficult, especially if it’s about the future.”
13.0.2
“I have seen the future and it is very much like the present, only longer.”
13.1
PM10 hourly prediction models
13.1.1
Data loading
13.1.2
Train, test and validation data
13.1.3
Data Exploration
13.1.4
ARIMA model
13.2
We have been using a dataset for training of 3 years. Is this necessary? Does the Arima algorithm take advantage of a so long time series?
13.2.1
NO2 Predictions
13.2.2
ARIMA model
Gijón Air Pollution
6
Final Words
Conclusions and more.


Azure Cloud Storage Management Lab
Set up your development environment
-
Install the azure-storage npm module into the gateway device using putty. Run:
npm install azure-storage
-
Obtain the storage account details from the configuration file.
Establish a connection with Azure cloud
-
Create a new JavaScript file named azure.js
-
Create a node reference variable for the module:
var azureStorage = require('azure-storage');
-
Create a table service to establish a connection with the Azure storage account.
var tableService = azureStorage.createTableService(accountName, accessKey);
Please refer Cloud Config document for storage account details.
Create an Azure table
-
Using the table service object, call the function
createTableIfNotExists
with table name as parameter.tableService.createTableIfNotExists('tableName', function(error, result, response){ if(!error){ // table created or already exists } });
The result will be true if table is created and false if the table already exists. The response contains information about the request.
Insert an entity in Azure Table
Azure table storage takes data as entities. Each entity must contain a RowKey
and PartitionKey
, unique identifiers for the entity. A RowKey
must be unique to every row.
- PartitionKey
- Determines the partition where the entity is stored in
- RowKey
- Unique identifier for the entity within the partition
Using entityGenerator
to create entities.
var entGen = azure.TableUtilities.entityGenerator;
Table service supports a subset of data types defined by the OData Protocol Specification. By default a property is created as type String
if type is not specified.
var entGen = azureStorage.TableUtilities.entityGenerator;
var azureEntity = {
PartitionKey : entGen.String(sensor_id),
RowKey : entGen.String(timestamp.toString()),
value : entGen.Double(value),
timestamp : entGen.Int64(timestamp)
};
Call insertEntity
method on table service object with azureEntity
object as parameter
tableService.insertEntity('mytable', azureEntity, function (error, result, response) {
if(!error){
// Entity inserted
}
});
On success, result will contain the ETag of the inserted record and response will contain information about the operation.
Store multiple entities on to Azure Table storage
You can insert multiple entities in a single batch operation. A single batch can contain up to 100 entities. All entities must contain the same partition key.
var batch = new azureStorage.TableBatch();
var entGen = azureStorage.TableUtilities.entityGenerator;
for(i in data) {
entity = data[i];
var azureEntity = {
PartitionKey : entGen.String(entity.sensor_id),
RowKey : entGen.String(entity.timestamp.toString())
}
for (var propertyName in entity) {
azureEntity[propertyName] = entGen.String(entity[propertyName]);
}
}
insertOrReplaceEntity
method replaces an existing entity else inserts a new one if entity deosn’t exists.
batch.insertOrReplaceEntity(azureEntity);
Setting echoContent
to true returns the inserted entities as part of the result variable.
tableService.executeBatch(self.config.table, batch,
{echoContent: true},
function (error, result, response) {
if(!error) {
// Batch completed
logger.info('Azure - Data sent successfully');
}
});
Query data from Azure Table
Create query expression using the TableQuery
object.
For example to build a query that returns top 50 entities with Partition key of sensor_id
Timestamp based query
dataQuery = new azureStorage.TableQuery().top(50).where('PartitionKey eq ?', readQuery.sensor_id);
Build a query that returns top 50 entities with Partition key of sensor_id
and timestamp greater than or equal to timestamp value
Sensorid based query
dataQuery = new azureStorage.TableQuery().top(50).where('PartitionKey eq ?', readQuery.sensor_id).and('timestamp ge ?', readQuery.timestamp);
Use queryEntities
function on table service object to perform the query.
tableService.queryEntities('tableName', dataQuery, null, function(error, results) {
if(!error){
// query successful
}
}
On success, result.entries
will contain an array of entities that match the query. If the query was not able to return all entities, result.continuationToken
can be used as the third parameter of queryEntities to retrieve more results. For the initial query, we used null as the third parameter.
Use lodash
module to remove the standard properties from the results
_.map(resp, function (entity){
delete entity["PartitionKey"];
delete entity["RowKey"];
delete entity["Timestamp"];
delete entity[".metadata"];
for (var propertyName in entity) {
entity[propertyName] = entity[propertyName]["_"];
}
});
client.queryEntities(‘tableName’, {
query: dataQuery,
onlyFields: ['sensor_id', 'timestamp', 'value']
}, function(err, results, continuation) {});
Delete an Azure Table
tableService.deleteTable(tablename, function(error, response){
if(!error){
// Table deleted
}
});
Additional resources
Microsoft documentation - https://azure.microsoft.com/en-us/develop/nodejs/
Azure node project - https://www.npmjs.com/package/azure
Azure Table Storage client - https://www.npmjs.com/package/azure-table-node
Azure - https://msdn.microsoft.com/en-us/library/azure/dn578280.aspx
Azure Storage Explorer - https://azurestorageexplorer.codeplex.com/


{% extends 'apidoc.html' %} {% block title %}Tile5 API Documentation{% endblock %} {% block api %}
Extends: T5.Tiling.TileGrid
The GeoTileGrid class is used to wrap and extend a standard T5.Tiling.TileGrid and make it "Geospatial aware". Essentially a GeoTileGrid is initialized by passing an existing TileGrid and a center position (T5.Geo.Position) and center xy coordinate (T5.Vector) and this allows it to translate screen coordinates into latitude / longitude pairs.
grid (T5.Tiling.TileGrid)
the grid to wrap and make Geospatial aware
centerPos (T5.Geo.Position)
the latitude and longitude of the center of the grid
centerXY (T5.Vector)
the center xy coordinate of the grid (relative to the top left tile, xy coordinate = 0,0)
radsPerPixel (float)
the number of radians per pixel. This value is used in the calculation of screen coordinates to real world positions. While for both the current map provider implementations this value is the same, I expect it could vary from provider to provider.
getBoundingBox(x, y, width, height)
Returns a new T5.Geo.BoundingBox that relates to the specified area on the tile grid.
getGridXYForPosition(pos)
Returns a T5.Vector that relates to the grid position of the T5.Geo.Position value passed in the pos parameter to the method. This method is used extensively to calculate the position that shapes / points should be drawn to the grid based on their geospatial position.
pixelsToPos(vector)
Basically the opposite of the above. Returns a T5.Geo.Position based on the xy value of the T5.Vector that is passed to the method. Very useful when you need to translate screen / grid coordinates into a latitude longitude. For instance, in the case where the user clicks on the map and you need to know the latitude and longitude of that click / touch.


{% extends "base.html" %} {% block content %}
Your username and password didn't match. Please try again.
{% endif %} {% if next %} {% if user.is_authenticated %}Your account doesn't have access to this page. To proceed, please login with an account that has access.
{% else %}Please login to see this page.
{% endif %} {% endif %}


In jMock, stubs and expectations are basically the same thing. A stub
is just an expectation of zero or more invocations. The
stubs()
method is syntactic sugar to make the intent of the
test more explicit.
When a method is invoked on a mock object, the mock object searches
through its expectations from newest to oldest to find one that matches
the invocation. After the invocation, the matching expectation might stop
matching further invocations. For example, an expects(once())
expectation only matches once and will be ignored on future invocations
while an expects(atLeastOnce())
expectation will always be
matched against invocations.
This scheme allows you to:
setUp
method of your
test class and override some of those stubs in individual tests.onConsecutiveCalls
method to do this, as described
below.However, there are some possible "gotchas" caused by this scheme:
The best thing to do is not set up multiple expectations and
stubs for the same method with exactly the same matchers. Instead, use the
onConsecutiveCalls
method to create multiple actions
for a method. For example:
mock.expects(atLeastOnce()).method(m).with(...) .will( onConsecutiveCalls( returnValue(10), returnValue(20), throwException(new IOException("end of stream")) ) );
If you want to specify more complex ordering or order invocations
across different mock objects, use the after
method to
explicitly define a total or partial ordering of invocations.


If one thing is true in life it’s that things are always changing. At A+ Home Care, we will be there to support you and your loved one through all of the transitions that may come along.
-
Dressing Changes & Wound Care Assistance — You can have peace-of-mind knowing we’ll keep your loved one’s wounds clean and cared for so they can heal!
-
Injury & Illness Recovery — Getting better doesn’t just require all of a person’s physical needs being met, but their emotional needs too. Our caregivers bring smiles and compassion which speed the recovery process.
-
Prescription Pick-Up — If they need it, we’ll pick it up!
-
Accompaniment to Appointments Incidental Transportation — We will get your loved one to their appointments on time and provide the support they need.
-
Hospital Discharge Assistance — With comfort, health and safety as the top priorities, our caregivers can help your loved one recover after a hospital stay and reduce the risk of rehospitalization.


{% extends 'about/article.html' %} {% load static %} {% load image %} {% block article %}
Project SCIFI is an all-volunteer organization run by students and scientists whose own personal experiences led them to pursue careers in science.
{% for member in members %}{{member.roles|join:', '}}
{{member.bio}}


Hobbies and Fictional Character's Page
Click to learn more about these characters!
Front Page
Resume Page
Personal Page
Hobbies Page
Github Portfolio
Copyright © 2021 by Kevin Tieu
Contact Email:
kt216@humboldt.edu


+++ draft = false date = "2009-11-12T20:57:19-02:00" title = "Django's makemessages sucks for my use cases" tags = ["rants", "cookbook", "Django"] created = "2009-11-12T19:37:12-02:00" modified = "2009-11-13T10:20:48-02:00" permaLink = "http://play.pixelblaster.ro/blog/archive/2009/11/12/djangos-makemessages-sucks" author = "Tiberiu Ichim" aliases = [ "/blog/archive/2009/11/12/djangos-makemessages-sucks" ] +++
Yet another angry rant, caused, of course, by using Django in anger. Nothing wrong with using something in anger, that's the real way I learn something. Zope 3 even has an online book on how to use it in anger.
 My environment looks like this: I have a project based on Pinax, which I'm developing and deploying using zc.buildout. My source code sits in src, where I have several packages. I also have a "localsettings.py" module located in the root of the buildout, because I don't want to have it inside the src folder. Pinax is located in parts/Pinax, and it's actually a git checkout, based on my own fork of Pinax. Pinax doesn't have translations at the moment (I think I saw a ticket in its tracker about reintroducing a translation package), so I'm on my own here with regards to translation.
With this setup, it is close to impossible for me to generate anything useful without a lot of hacking and swearing. Makemessages insists on being run from inside a Django project, and when I did that, it complains about missing localsettings module. Pointing the root of the buildout as pythonpath didn't do anything. A good thing that I have already extracted messages from the templates, before switching to the buildout project structure.
Some solutions that I have found:
PYFILES=/tmp/pyfiles PINAX=parts/Pinax/pinax/ BASE=/home/tibi/work/ProjectBuildout/src/project/locale/ro/LC_MESSAGES/ POTFILE_PYTHON=$BASE/python.pot POTFILE_TEMPLATES=$BASE/templates.pot POTFILE=$BASE/django.pot POFILE=$BASE/django.po #extract messages from python code find $PINAX | grep ".*py$" > /tmp/pyfiles touch $POTFILE_PYTHON xgettext -j -L python -d django -f $PYFILES -o $POTFILE_PYTHON #merge the templates + python messages into one pot file msgcat -o $POTFILE $POTFILE_TEMPLATES $POTFILE_PYTHON #merge the potfile with the po file msgmerge -U -N $POFILE $POTFILE
../../bin/py ./../../manage.py makemessages -e .py -e .html -l ro
Of course, I can't run this over the other apps and packages in my src/ folder to extract messages from the python modules, so I am forced to adjust the first script to take those folders into consideration.


My name is Arun Kirubarajan - I'm from Mississauga, Canada and am currently an undergraduate in the dual degree Artificial Intelligence
Program at the University of Pennsylvania. I study computer science and cognitive science (linguistics) with a minor in statistics from the Wharton School of Business.
I research machine learning in Penn's NLP Group and I teach one of the computer science courses at Penn. Previously, I was working on location intelligence at Foursquare.
I also like contributing to open source in my spare time.
Outside of computer science, I like brewing coffee, skateboarding, and playing video games.
This website is where I write the things that I'm doing or stuff I find interesting.


Drury restaurant is a five star establishment located in Kilimani area near a busy Hurlingham area. Our foods are made by a our very experienced chefs trained in making traditional and international foods.
The customer service here is just amazing! I decided to dine at Drury Cafe because a friend told me of your delicious traditional cuisine. You guys are the best!
Thank you so much Medahn! We really do take pride in catering to our customer's needs best way we can.So glad to be of your service.
I usually always come to Drury for my lunch because you always give me the home away from home experience that i badly need sometimes. The food is always so delicious and the service just the best,although sometimes your fried chicken is abit too spicy for me.Kindly look into this.
We always apreciate your our customers feed back thank you so much Dory. Your concern has been noted and we will try as much as we can to adress them. We request that the next time you visit us,ask to see our Chief Chef and there will be a plate of fried chicken spacially made for you just to show how much we apreciate you.


Full Stack User Researcher with a background in human factors and computer science.
My current job revolves around aiding product and design teams make evidence-based decisions by understanding how people read the news and consume media.
My current side project which I co-work on with four friends involves developing a personalised light-based art product to foster interaction between geographically distant familiy members.
My thesis in grad school focused on understanding the experiences of younger people living with cognitive impairment or dementia and its impact on their employment.
You can find some of my published work here


Instance(features: List<Attribute<TAttribute>>)
An instance in a Dataset.
Instances are made up of a collection of Attributes. A particular attribute is marked as the class attribute and the rest are marked as input features. The indices of these features can be controlled via the Dataset the instance belongs to.
NOTE: Similarly as for Datasets, custom implementations of samples can be
defined but some functionality is marked so that it is not able to be overridden (see
any functions marked final
).
TAttribute
- The type of the Attributes that make up this instance.


| I l@ve RuBoard |
As a guideline, the connection constructor parameters should be implemented as keyword parameters for more intuitive use and follow this order of parameters.
For example, a connect could look like this:
connect(dsn='myhost:MYDB',user='guido',password='234$¶')
Module implementors should prefer 'numeric', 'named' or 'pyroformat' over the other formats because these offer more clarity and flexibility.
If the database doesn't support the functionality required by the method, the interface should throw an exception in case the method is used.
The preferred approach is to not implement the method and thus have Python generate an AttributeError in case the method is requested. This allows the programmer to check for database capabilities using the standard hasattr() function.
For some dynamically configured interfaces, it may not be appropriate to require dynamically making the method available. These interfaces should then raise a NotSupportedError to indicate the inability to perform the rollback when the method is invoked.
A database interface method may choose to support named cursorsby allowing a string argument to the method. This feature is not part of the specification, since it complicates semantics of the .fetchXXX() methods.
The rowcount attribute may be coded in a way that updates its value dynamically. This can be useful for databases that return usable rowcount values only after the first call to a .fetchXXX() method.
The module uses the __getitem__ method of the parameters object to map either positions (integers) or names (strings) to parameters values. This allows for both sequences and mappings to be used as input.
The term "bound" refers to the process of binding an input value to a database execution buffer. In practical terms, this means that the input value is used directly as a value in the operation. The client should not be required to "escape" the value so that it can be used; the value should be equal to the actual database value.
Note that the interface may implement row fetching using arrays and other optimizations. It's not guaranteed that a call to this method will move only the associated cursor forward by one row.
| I l@ve RuBoard |


Before Change
output_filters = round_filters(block_args.output_filters,
self._global_params)
kernel_size = block_args.kernel_size
block_args = block_args._replace(
input_filters=input_filters,
output_filters=output_filters,
num_repeat=round_repeats(block_args.num_repeat, self._global_params))
// The first block needs to take care of stride and filter size increase.
conv_block = self._get_conv_block(block_args.conv_type)
if not block_args.super_pixel: // no super_pixel at all
After Change
output_filters = round_filters(block_args.output_filters,
self._global_params)
kernel_size = block_args.kernel_size
if self._fix_head_stem and (i == 0 or i == len(self._blocks_args) - 1):
repeats = block_args.num_repeat
else:
repeats = round_repeats(block_args.num_repeat, self._global_params)
block_args = block_args._replace(
input_filters=input_filters,
output_filters=output_filters,
num_repeat=repeats)


Our Story
-
An Engineer-turned-Crafter works on tapping the creative mind through interactive and informative Crafting options
-
A couple of Aero Engineering Geeks research on learning techniques.
-
A Techie who Growth Hacks the idea.
-
Together they build Design Activity Kits, Intuitive Workshops and Fun Contests.
-


Aldo's Combo
Seafood
Deluxe
Primavera-Veggie
Red sauce, Artichoke Hearts, Canadian Bacon, Mozzarella-Provel blend.
Red sauce, shrimp, crab, mozzrella-provel blend *Try it with white sauce!
Red sauce, Sausage, Pepperoni, Mushrooms, Onions, Green Peppers & Bacon, Mozzarella-Provel blend.
Red sauce, Mushroom, Green Pepper, Onion, Brocolli, Black Olive, Mozzarella-Provel blend.