|
CoreTweet
2.0.0-beta.2
Yet another .NET Twitter Library
|
Provides a set of methods for the wrapper of POST media. More...
Public Member Functions | |
| Task< MediaUploadResult > | UploadAsync (IDictionary< string, object > parameters, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadProgressInfo > progress=null) |
| Task< MediaUploadResult > | UploadAsync (object parameters, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadProgressInfo > progress=null) |
| Task< MediaUploadResult > | UploadAsync (Stream media, IEnumerable< long > additional_owners=null, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadProgressInfo > progress=null) |
| Task< MediaUploadResult > | UploadAsync (IEnumerable< byte > media, IEnumerable< long > additional_owners=null, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadProgressInfo > progress=null) |
| Task< MediaUploadResult > | UploadAsync (FileInfo media, IEnumerable< long > additional_owners=null, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadProgressInfo > progress=null) |
| Task | UploadAppendCommandAsync (IDictionary< string, object > parameters, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadProgressInfo > progress=null) |
| Task | UploadAppendCommandAsync (object parameters, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadProgressInfo > progress=null) |
| Task | UploadAppendCommandAsync (long media_id, int segment_index, Stream media, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadProgressInfo > progress=null) |
| Task | UploadAppendCommandAsync (long media_id, int segment_index, IEnumerable< byte > media, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadProgressInfo > progress=null) |
| Task | UploadAppendCommandAsync (long media_id, int segment_index, FileInfo media, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadProgressInfo > progress=null) |
| Task< MediaUploadResult > | UploadChunkedAsync (Stream media, long totalBytes, UploadMediaType mediaType, params Expression< Func< string, object >>[] parameters) |
| Task< MediaUploadResult > | UploadChunkedAsync (Stream media, UploadMediaType mediaType, params Expression< Func< string, object >>[] parameters) |
| Task< MediaUploadResult > | UploadChunkedAsync (Stream media, long totalBytes, UploadMediaType mediaType, IDictionary< string, object > parameters, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadChunkedProgressInfo > progress=null) |
| Task< MediaUploadResult > | UploadChunkedAsync (Stream media, long totalBytes, UploadMediaType mediaType, object parameters, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadChunkedProgressInfo > progress=null) |
| Task< MediaUploadResult > | UploadChunkedAsync (Stream media, long totalBytes, UploadMediaType mediaType, string media_category=null, IEnumerable< long > additional_owners=null, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadChunkedProgressInfo > progress=null) |
| Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation. More... | |
| Task< MediaUploadResult > | UploadChunkedAsync (Stream media, UploadMediaType mediaType, IDictionary< string, object > parameters, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadChunkedProgressInfo > progress=null) |
| Task< MediaUploadResult > | UploadChunkedAsync (Stream media, UploadMediaType mediaType, object parameters, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadChunkedProgressInfo > progress=null) |
| Task< MediaUploadResult > | UploadChunkedAsync (Stream media, UploadMediaType mediaType, string media_category=null, IEnumerable< long > additional_owners=null, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadChunkedProgressInfo > progress=null) |
| Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation. More... | |
| Task< MediaUploadResult > | UploadChunkedWithRetryAsync (Stream media, long totalBytes, UploadMediaType mediaType, int retryCount, int retryDelayInMilliseconds, params Expression< Func< string, object >>[] parameters) |
| Task< MediaUploadResult > | UploadChunkedWithRetryAsync (Stream media, UploadMediaType mediaType, int retryCount, int retryDelayInMilliseconds, params Expression< Func< string, object >>[] parameters) |
| Task< MediaUploadResult > | UploadChunkedWithRetryAsync (Stream media, long totalBytes, UploadMediaType mediaType, int retryCount, int retryDelayInMilliseconds, IDictionary< string, object > parameters, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadChunkedProgressInfo > progress=null) |
| Task< MediaUploadResult > | UploadChunkedWithRetryAsync (Stream media, long totalBytes, UploadMediaType mediaType, int retryCount, int retryDelayInMilliseconds, object parameters, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadChunkedProgressInfo > progress=null) |
| Task< MediaUploadResult > | UploadChunkedWithRetryAsync (Stream media, long totalBytes, UploadMediaType mediaType, int retryCount, int retryDelayInMilliseconds, string media_category=null, IEnumerable< long > additional_owners=null, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadChunkedProgressInfo > progress=null) |
| Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation. More... | |
| Task< MediaUploadResult > | UploadChunkedWithRetryAsync (Stream media, UploadMediaType mediaType, int retryCount, int retryDelayInMilliseconds, IDictionary< string, object > parameters, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadChunkedProgressInfo > progress=null) |
| Task< MediaUploadResult > | UploadChunkedWithRetryAsync (Stream media, UploadMediaType mediaType, object parameters, int retryCount, int retryDelayInMilliseconds, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadChunkedProgressInfo > progress=null) |
| Task< MediaUploadResult > | UploadChunkedWithRetryAsync (Stream media, UploadMediaType mediaType, int retryCount, int retryDelayInMilliseconds, string media_category=null, IEnumerable< long > additional_owners=null, CancellationToken cancellationToken=default(CancellationToken), IProgress< UploadChunkedProgressInfo > progress=null) |
| Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation. More... | |
| MediaUploadResult | UploadChunked (Stream media, long totalBytes, UploadMediaType mediaType, params Expression< Func< string, object >>[] parameters) |
| MediaUploadResult | UploadChunked (Stream media, long totalBytes, UploadMediaType mediaType, IDictionary< string, object > parameters) |
| MediaUploadResult | UploadChunked (Stream media, long totalBytes, UploadMediaType mediaType, object parameters) |
| MediaUploadResult | UploadChunked (Stream media, long totalBytes, UploadMediaType mediaType, string media_category=null, IEnumerable< long > additional_owners=null) |
| Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card. More... | |
| MediaUploadResult | UploadChunked (Stream media, UploadMediaType mediaType, params Expression< Func< string, object >>[] parameters) |
| MediaUploadResult | UploadChunked (Stream media, UploadMediaType mediaType, IDictionary< string, object > parameters) |
| MediaUploadResult | UploadChunked (Stream media, UploadMediaType mediaType, object parameters) |
| MediaUploadResult | UploadChunked (Stream media, UploadMediaType mediaType, string media_category=null, IEnumerable< long > additional_owners=null) |
| Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card. More... | |
| MediaUploadResult | Upload (params Expression< Func< string, object >>[] parameters) |
| MediaUploadResult | Upload (IDictionary< string, object > parameters) |
| MediaUploadResult | Upload (object parameters) |
| MediaUploadResult | Upload (Stream media, IEnumerable< long > additional_owners=null) |
| MediaUploadResult | Upload (IEnumerable< byte > media, IEnumerable< long > additional_owners=null) |
| MediaUploadResult | Upload (FileInfo media, IEnumerable< long > additional_owners=null) |
| MediaUploadResult | Upload (string media_data, IEnumerable< long > additional_owners=null) |
| Task< MediaUploadResult > | UploadAsync (params Expression< Func< string, object >>[] parameters) |
| UploadInitCommandResult | UploadInitCommand (params Expression< Func< string, object >>[] parameters) |
| UploadInitCommandResult | UploadInitCommand (IDictionary< string, object > parameters) |
| UploadInitCommandResult | UploadInitCommand (object parameters) |
| UploadInitCommandResult | UploadInitCommand (int total_bytes, string media_type, IEnumerable< long > additional_owners=null, string media_category=null, bool? shared=null) |
| UploadInitCommandResult | UploadInitCommand (int total_bytes, UploadMediaType media_type, IEnumerable< long > additional_owners=null, string media_category=null, bool? shared=null) |
| Task< UploadInitCommandResult > | UploadInitCommandAsync (params Expression< Func< string, object >>[] parameters) |
| Task< UploadInitCommandResult > | UploadInitCommandAsync (IDictionary< string, object > parameters, CancellationToken cancellationToken=default(CancellationToken)) |
| Task< UploadInitCommandResult > | UploadInitCommandAsync (object parameters, CancellationToken cancellationToken=default(CancellationToken)) |
| Task< UploadInitCommandResult > | UploadInitCommandAsync (int total_bytes, string media_type, IEnumerable< long > additional_owners=null, string media_category=null, bool? shared=null, CancellationToken cancellationToken=default(CancellationToken)) |
| Task< UploadInitCommandResult > | UploadInitCommandAsync (int total_bytes, UploadMediaType media_type, IEnumerable< long > additional_owners=null, string media_category=null, bool? shared=null, CancellationToken cancellationToken=default(CancellationToken)) |
| void | UploadAppendCommand (params Expression< Func< string, object >>[] parameters) |
| void | UploadAppendCommand (IDictionary< string, object > parameters) |
| void | UploadAppendCommand (object parameters) |
| void | UploadAppendCommand (long media_id, int segment_index, Stream media) |
| void | UploadAppendCommand (long media_id, int segment_index, IEnumerable< byte > media) |
| void | UploadAppendCommand (long media_id, int segment_index, FileInfo media) |
| void | UploadAppendCommand (long media_id, int segment_index, string media_data) |
| Task | UploadAppendCommandAsync (params Expression< Func< string, object >>[] parameters) |
| UploadFinalizeCommandResult | UploadFinalizeCommand (params Expression< Func< string, object >>[] parameters) |
| UploadFinalizeCommandResult | UploadFinalizeCommand (IDictionary< string, object > parameters) |
| UploadFinalizeCommandResult | UploadFinalizeCommand (object parameters) |
| UploadFinalizeCommandResult | UploadFinalizeCommand (long media_id) |
| Task< UploadFinalizeCommandResult > | UploadFinalizeCommandAsync (params Expression< Func< string, object >>[] parameters) |
| Task< UploadFinalizeCommandResult > | UploadFinalizeCommandAsync (IDictionary< string, object > parameters, CancellationToken cancellationToken=default(CancellationToken)) |
| Task< UploadFinalizeCommandResult > | UploadFinalizeCommandAsync (object parameters, CancellationToken cancellationToken=default(CancellationToken)) |
| Task< UploadFinalizeCommandResult > | UploadFinalizeCommandAsync (long media_id, CancellationToken cancellationToken=default(CancellationToken)) |
| UploadFinalizeCommandResult | UploadStatusCommand (params Expression< Func< string, object >>[] parameters) |
| UploadFinalizeCommandResult | UploadStatusCommand (IDictionary< string, object > parameters) |
| UploadFinalizeCommandResult | UploadStatusCommand (object parameters) |
| UploadFinalizeCommandResult | UploadStatusCommand (long media_id) |
| Task< UploadFinalizeCommandResult > | UploadStatusCommandAsync (params Expression< Func< string, object >>[] parameters) |
| Task< UploadFinalizeCommandResult > | UploadStatusCommandAsync (IDictionary< string, object > parameters, CancellationToken cancellationToken=default(CancellationToken)) |
| Task< UploadFinalizeCommandResult > | UploadStatusCommandAsync (object parameters, CancellationToken cancellationToken=default(CancellationToken)) |
| Task< UploadFinalizeCommandResult > | UploadStatusCommandAsync (long media_id, CancellationToken cancellationToken=default(CancellationToken)) |
Public Attributes | |
| MediaMetadata | Metadata => new MediaMetadata(this.Tokens) |
| Gets the wrapper of media/metadata. More... | |
Provides a set of methods for the wrapper of POST media.
|
inline |
Upload media (images) to Twitter for use in a Tweet or Twitter-hosted Card.
| media | any one is required. |
| additional_owners | optional. |
|
inline |
Upload media (images) to Twitter for use in a Tweet or Twitter-hosted Card.
Available parameters:
- Stream
media (any one is required)
- IEnumerable<byte>
media (any one is required)
- FileInfo
media (any one is required)
- string
media_data (any one is required)
- IEnumerable<long>
additional_owners (optional)
| parameters | The parameters. |
|
inline |
Upload media (images) to Twitter for use in a Tweet or Twitter-hosted Card.
| media | any one is required. |
| additional_owners | optional. |
|
inline |
Upload media (images) to Twitter for use in a Tweet or Twitter-hosted Card.
Available parameters:
- Stream
media (any one is required)
- IEnumerable<byte>
media (any one is required)
- FileInfo
media (any one is required)
- string
media_data (any one is required)
- IEnumerable<long>
additional_owners (optional)
| parameters | The parameters. |
|
inline |
Upload media (images) to Twitter for use in a Tweet or Twitter-hosted Card.
Available parameters:
- Stream
media (any one is required)
- IEnumerable<byte>
media (any one is required)
- FileInfo
media (any one is required)
- string
media_data (any one is required)
- IEnumerable<long>
additional_owners (optional)
| parameters | The parameters. |
|
inline |
Upload media (images) to Twitter for use in a Tweet or Twitter-hosted Card.
| media | any one is required. |
| additional_owners | optional. |
|
inline |
Upload media (images) to Twitter for use in a Tweet or Twitter-hosted Card.
| media_data | any one is required. |
| additional_owners | optional. |
|
inline |
Upload(s) of chunked data.
Available parameters:
- long
media_id (required)
- int
segment_index (required)
- Stream
media (any one is required)
- IEnumerable<byte>
media (any one is required)
- FileInfo
media (any one is required)
- string
media_data (any one is required)
| parameters | The parameters. |
|
inline |
Upload(s) of chunked data.
| media_id | required. |
| segment_index | required. |
| media | any one is required. |
|
inline |
Upload(s) of chunked data.
| media_id | required. |
| segment_index | required. |
| media | any one is required. |
|
inline |
Upload(s) of chunked data.
| media_id | required. |
| segment_index | required. |
| media | any one is required. |
|
inline |
Upload(s) of chunked data.
| media_id | required. |
| segment_index | required. |
| media_data | any one is required. |
|
inline |
Upload(s) of chunked data.
Available parameters:
- long
media_id (required)
- int
segment_index (required)
- Stream
media (any one is required)
- IEnumerable<byte>
media (any one is required)
- FileInfo
media (any one is required)
- string
media_data (any one is required)
| parameters | The parameters. |
|
inline |
Upload(s) of chunked data.
Available parameters:
- long
media_id (required)
- int
segment_index (required)
- Stream
media (any one is required)
- IEnumerable<byte>
media (any one is required)
- FileInfo
media (any one is required)
- string
media_data (any one is required)
| parameters | The parameters. |
|
inline |
Upload(s) of chunked data.
Available parameters:
- long
media_id (required)
- int
segment_index (required)
- Stream
media (any one is required)
- IEnumerable<byte>
media (any one is required)
- FileInfo
media (any one is required)
- string
media_data (any one is required)
| parameters | The parameters. |
| cancellationToken | The cancellation token. |
|
inline |
Upload(s) of chunked data.
| media_id | required. |
| segment_index | required. |
| media | any one is required. |
| cancellationToken | The cancellation token. |
|
inline |
Upload(s) of chunked data.
| media_id | required. |
| segment_index | required. |
| media | any one is required. |
| cancellationToken | The cancellation token. |
|
inline |
Upload(s) of chunked data.
| media_id | required. |
| segment_index | required. |
| media | any one is required. |
| cancellationToken | The cancellation token. |
|
inline |
Upload(s) of chunked data.
Available parameters:
- long
media_id (required)
- int
segment_index (required)
- Stream
media (any one is required)
- IEnumerable<byte>
media (any one is required)
- FileInfo
media (any one is required)
- string
media_data (any one is required)
| parameters | The parameters. |
| cancellationToken | The cancellation token. |
|
inline |
Upload(s) of chunked data.
Available parameters:
- long
media_id (required)
- int
segment_index (required)
- Stream
media (any one is required)
- IEnumerable<byte>
media (any one is required)
- FileInfo
media (any one is required)
- string
media_data (any one is required)
| parameters | The parameters. |
|
inline |
Upload media (images) to Twitter for use in a Tweet or Twitter-hosted Card.
| media | any one is required. |
| additional_owners | optional. |
| cancellationToken | The cancellation token. |
|
inline |
Upload media (images) to Twitter for use in a Tweet or Twitter-hosted Card.
Available parameters:
- Stream
media (any one is required)
- IEnumerable<byte>
media (any one is required)
- FileInfo
media (any one is required)
- string
media_data (any one is required)
- IEnumerable<long>
additional_owners (optional)
| parameters | The parameters. |
| cancellationToken | The cancellation token. |
|
inline |
Upload media (images) to Twitter for use in a Tweet or Twitter-hosted Card.
| media | any one is required. |
| additional_owners | optional. |
| cancellationToken | The cancellation token. |
|
inline |
Upload media (images) to Twitter for use in a Tweet or Twitter-hosted Card.
Available parameters:
- Stream
media (any one is required)
- IEnumerable<byte>
media (any one is required)
- FileInfo
media (any one is required)
- string
media_data (any one is required)
- IEnumerable<long>
additional_owners (optional)
| parameters | The parameters. |
| cancellationToken | The cancellation token. |
|
inline |
Upload media (images) to Twitter for use in a Tweet or Twitter-hosted Card.
Available parameters:
- Stream
media (any one is required)
- IEnumerable<byte>
media (any one is required)
- FileInfo
media (any one is required)
- string
media_data (any one is required)
- IEnumerable<long>
additional_owners (optional)
| parameters | The parameters. |
|
inline |
Upload media (images) to Twitter for use in a Tweet or Twitter-hosted Card.
| media | any one is required. |
| additional_owners | optional. |
| cancellationToken | The cancellation token. |
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card.
Available parameters:
- string
media_category (optional)
- IEnumerbale<long>
additional_owners (optional)
| media | The raw binary file content being uploaded. |
| totalBytes | The size of the media being uploaded in bytes. |
| mediaType | The type of the media being uploaded. |
| parameters | The parameters. |
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card.
Available parameters:
- string
media_category (optional)
- IEnumerbale<long>
additional_owners (optional)
| media | The raw binary file content being uploaded. |
| totalBytes | The size of the media being uploaded in bytes. |
| mediaType | The type of the media being uploaded. |
| parameters | The parameters. |
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card.
Available parameters:
- string
media_category (optional)
- IEnumerbale<long>
additional_owners (optional)
| media | The raw binary file content being uploaded. |
| totalBytes | The size of the media being uploaded in bytes. |
| mediaType | The type of the media being uploaded. |
| parameters | The parameters. |
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card.
| media | The raw binary file content being uploaded. |
| totalBytes | The size of the media being uploaded in bytes. |
| mediaType | The type of the media being uploaded. |
| media_category | A string enum value which identifies a media usecase. |
| additional_owners | A comma-separated string of user IDs to set as additional owners who are allowed to use the returned media_id in Tweets or Cards. |
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card.
Available parameters:
- string
media_category (optional)
- IEnumerbale<long>
additional_owners (optional)
| media | The raw binary file content being uploaded. |
| mediaType | The type of the media being uploaded. |
| parameters | The parameters. |
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card.
Available parameters:
- string
media_category (optional)
- IEnumerbale<long>
additional_owners (optional)
| media | The raw binary file content being uploaded. |
| mediaType | The type of the media being uploaded. |
| parameters | The parameters. |
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card.
Available parameters:
- string
media_category (optional)
- IEnumerbale<long>
additional_owners (optional)
| media | The raw binary file content being uploaded. |
| mediaType | The type of the media being uploaded. |
| parameters | The parameters. |
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card.
| media | The raw binary file content being uploaded. |
| mediaType | The type of the media being uploaded. |
| media_category | A string enum value which identifies a media usecase. |
| additional_owners | A comma-separated string of user IDs to set as additional owners who are allowed to use the returned media_id in Tweets or Cards. |
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation.
Available parameters:
- string
media_category (optional)
- IEnumerbale<long>
additional_owners (optional)
| media | The raw binary file content being uploaded. |
| totalBytes | The size of the media being uploaded in bytes. |
| mediaType | The type of the media being uploaded. |
| parameters | The parameters. |
| cancellationToken | The cancellation token. |
The Result property on the task object returns the result for the uploaded media.
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation.
Available parameters:
- string
media_category (optional)
- IEnumerbale<long>
additional_owners (optional)
| media | The raw binary file content being uploaded. |
| totalBytes | The size of the media being uploaded in bytes. |
| mediaType | The type of the media being uploaded. |
| parameters | The parameters. |
| cancellationToken | The cancellation token. |
The Result property on the task object returns the result for the uploaded media.
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation.
Available parameters:
- string
media_category (optional)
- IEnumerbale<long>
additional_owners (optional)
| media | The raw binary file content being uploaded. |
| totalBytes | The size of the media being uploaded in bytes. |
| mediaType | The type of the media being uploaded. |
| parameters | The parameters. |
The Result property on the task object returns the result for the uploaded media.
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation.
| media | The raw binary file content being uploaded. |
| totalBytes | The size of the media being uploaded in bytes. |
| mediaType | The type of the media being uploaded. |
| media_category | A string enum value which identifies a media usecase. |
| additional_owners | A comma-separated string of user IDs to set as additional owners who are allowed to use the returned media_id in Tweets or Cards. |
| cancellationToken | The cancellation token. |
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation.
Available parameters:
- string
media_category (optional)
- IEnumerbale<long>
additional_owners (optional)
| media | The raw binary file content being uploaded. |
| mediaType | The type of the media being uploaded. |
| parameters | The parameters. |
| cancellationToken | The cancellation token. |
The Result property on the task object returns the result for the uploaded media.
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation.
Available parameters:
- string
media_category (optional)
- IEnumerbale<long>
additional_owners (optional)
| media | The raw binary file content being uploaded. |
| mediaType | The type of the media being uploaded. |
| parameters | The parameters. |
| cancellationToken | The cancellation token. |
The Result property on the task object returns the result for the uploaded media.
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation.
Available parameters:
- string
media_category (optional)
- IEnumerbale<long>
additional_owners (optional)
| media | The raw binary file content being uploaded. |
| mediaType | The type of the media being uploaded. |
| parameters | The parameters. |
The Result property on the task object returns the result for the uploaded media.
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation.
| media | The raw binary file content being uploaded. |
| mediaType | The type of the media being uploaded. |
| media_category | A string enum value which identifies a media usecase. |
| additional_owners | A comma-separated string of user IDs to set as additional owners who are allowed to use the returned media_id in Tweets or Cards. |
| cancellationToken | The cancellation token. |
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation.
Available parameters:
- string
media_category (optional)
- IEnumerbale<long>
additional_owners (optional)
| media | The raw binary file content being uploaded. |
| totalBytes | The size of the media being uploaded in bytes. |
| mediaType | The type of the media being uploaded. |
| parameters | The parameters. |
| cancellationToken | The cancellation token. |
The Result property on the task object returns the result for the uploaded media.
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation.
Available parameters:
- string
media_category (optional)
- IEnumerbale<long>
additional_owners (optional)
| media | The raw binary file content being uploaded. |
| totalBytes | The size of the media being uploaded in bytes. |
| mediaType | The type of the media being uploaded. |
| parameters | The parameters. |
| cancellationToken | The cancellation token. |
The Result property on the task object returns the result for the uploaded media.
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation.
Available parameters:
- string
media_category (optional)
- IEnumerbale<long>
additional_owners (optional)
| media | The raw binary file content being uploaded. |
| totalBytes | The size of the media being uploaded in bytes. |
| mediaType | The type of the media being uploaded. |
| parameters | The parameters. |
The Result property on the task object returns the result for the uploaded media.
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation.
| media | The raw binary file content being uploaded. |
| totalBytes | The size of the media being uploaded in bytes. |
| mediaType | The type of the media being uploaded. |
| media_category | A string enum value which identifies a media usecase. |
| additional_owners | A comma-separated string of user IDs to set as additional owners who are allowed to use the returned media_id in Tweets or Cards. |
| cancellationToken | The cancellation token. |
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation.
Available parameters:
- string
media_category (optional)
- IEnumerbale<long>
additional_owners (optional)
| media | The raw binary file content being uploaded. |
| mediaType | The type of the media being uploaded. |
| parameters | The parameters. |
| cancellationToken | The cancellation token. |
The Result property on the task object returns the result for the uploaded media.
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation.
Available parameters:
- string
media_category (optional)
- IEnumerbale<long>
additional_owners (optional)
| media | The raw binary file content being uploaded. |
| mediaType | The type of the media being uploaded. |
| parameters | The parameters. |
The Result property on the task object returns the result for the uploaded media.
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation.
| media | The raw binary file content being uploaded. |
| mediaType | The type of the media being uploaded. |
| media_category | A string enum value which identifies a media usecase. |
| additional_owners | A comma-separated string of user IDs to set as additional owners who are allowed to use the returned media_id in Tweets or Cards. |
| cancellationToken | The cancellation token. |
|
inline |
Uploads videos or chunked images to Twitter for use in a Tweet or Twitter-hosted Card as an asynchronous operation.
Available parameters:
- string
media_category (optional)
- IEnumerbale<long>
additional_owners (optional)
| media | The raw binary file content being uploaded. |
| mediaType | The type of the media being uploaded. |
| parameters | The parameters. |
| cancellationToken | The cancellation token. |
The Result property on the task object returns the result for the uploaded media.
|
inline |
Complete the upload.
Available parameters:
- long
media_id (required)
| parameters | The parameters. |
|
inline |
Complete the upload.
| media_id | required. |
|
inline |
Complete the upload.
Available parameters:
- long
media_id (required)
| parameters | The parameters. |
|
inline |
Complete the upload.
Available parameters:
- long
media_id (required)
| parameters | The parameters. |
|
inline |
Complete the upload.
Available parameters:
- long
media_id (required)
| parameters | The parameters. |
| cancellationToken | The cancellation token. |
|
inline |
Complete the upload.
| media_id | required. |
| cancellationToken | The cancellation token. |
|
inline |
Complete the upload.
Available parameters:
- long
media_id (required)
| parameters | The parameters. |
| cancellationToken | The cancellation token. |
|
inline |
Complete the upload.
Available parameters:
- long
media_id (required)
| parameters | The parameters. |
|
inline |
Initialize an upload.
Available parameters:
- int
total_bytes (required)
- string
media_type (any one is required)
- UploadMediaType
media_type (any one is required)
- IEnumerable<long>
additional_owners (optional)
- string
media_category (optional)
- bool
shared (optional)
| parameters | The parameters. |
|
inline |
Initialize an upload.
| total_bytes | required. |
| media_type | any one is required. |
| additional_owners | optional. |
| media_category | optional. |
| shared | optional. |
|
inline |
Initialize an upload.
| total_bytes | required. |
| media_type | any one is required. |
| additional_owners | optional. |
| media_category | optional. |
| shared | optional. |
|
inline |
Initialize an upload.
Available parameters:
- int
total_bytes (required)
- string
media_type (any one is required)
- UploadMediaType
media_type (any one is required)
- IEnumerable<long>
additional_owners (optional)
- string
media_category (optional)
- bool
shared (optional)
| parameters | The parameters. |
|
inline |
Initialize an upload.
Available parameters:
- int
total_bytes (required)
- string
media_type (any one is required)
- UploadMediaType
media_type (any one is required)
- IEnumerable<long>
additional_owners (optional)
- string
media_category (optional)
- bool
shared (optional)
| parameters | The parameters. |
|
inline |
Initialize an upload.
Available parameters:
- int
total_bytes (required)
- string
media_type (any one is required)
- UploadMediaType
media_type (any one is required)
- IEnumerable<long>
additional_owners (optional)
- string
media_category (optional)
- bool
shared (optional)
| parameters | The parameters. |
| cancellationToken | The cancellation token. |
|
inline |
Initialize an upload.
| total_bytes | required. |
| media_type | any one is required. |
| additional_owners | optional. |
| media_category | optional. |
| shared | optional. |
| cancellationToken | The cancellation token. |
|
inline |
Initialize an upload.
| total_bytes | required. |
| media_type | any one is required. |
| additional_owners | optional. |
| media_category | optional. |
| shared | optional. |
| cancellationToken | The cancellation token. |
|
inline |
Initialize an upload.
Available parameters:
- int
total_bytes (required)
- string
media_type (any one is required)
- UploadMediaType
media_type (any one is required)
- IEnumerable<long>
additional_owners (optional)
- string
media_category (optional)
- bool
shared (optional)
| parameters | The parameters. |
| cancellationToken | The cancellation token. |
|
inline |
Initialize an upload.
Available parameters:
- int
total_bytes (required)
- string
media_type (any one is required)
- UploadMediaType
media_type (any one is required)
- IEnumerable<long>
additional_owners (optional)
- string
media_category (optional)
- bool
shared (optional)
| parameters | The parameters. |
|
inline |
Check the processing status of the upload (for async video uploads only).
Available parameters:
- long
media_id (required)
| parameters | The parameters. |
|
inline |
Check the processing status of the upload (for async video uploads only).
| media_id | required. |
|
inline |
Check the processing status of the upload (for async video uploads only).
Available parameters:
- long
media_id (required)
| parameters | The parameters. |
|
inline |
Check the processing status of the upload (for async video uploads only).
Available parameters:
- long
media_id (required)
| parameters | The parameters. |
|
inline |
Check the processing status of the upload (for async video uploads only).
Available parameters:
- long
media_id (required)
| parameters | The parameters. |
| cancellationToken | The cancellation token. |
|
inline |
Check the processing status of the upload (for async video uploads only).
| media_id | required. |
| cancellationToken | The cancellation token. |
|
inline |
Check the processing status of the upload (for async video uploads only).
Available parameters:
- long
media_id (required)
| parameters | The parameters. |
| cancellationToken | The cancellation token. |
|
inline |
Check the processing status of the upload (for async video uploads only).
Available parameters:
- long
media_id (required)
| parameters | The parameters. |
| MediaMetadata CoreTweet.Rest.Media.Metadata => new MediaMetadata(this.Tokens) |
Gets the wrapper of media/metadata.


Uses of Class
org.drip.state.credit.CreditCurve
| Package | Description |
|---|---|
| org.drip.analytics.cashflow |
Unit/Composite Cash Flow Periods.
|
| org.drip.param.creator |
Market Curves Surfaces Quotes Builder
|
| org.drip.param.market |
Curves Surfaces Quotes Fixings Container
|
| org.drip.product.credit |
Credit Products - Components and Baskets
|
| org.drip.product.definition |
Fixed Income Components/Baskets Definitions
|
| org.drip.service.product |
Product Horizon PnL Attribution Decomposition
|
| org.drip.service.template |
Curve Construction Product Builder Templates
|
| org.drip.state.boot |
Bootable Discount, Credit, Volatility States
|
| org.drip.state.creator |
Scenario State Curve/Surface Builders
|
| org.drip.state.credit |
Credit Latent State Curve Representation
|
| org.drip.state.nonlinear |
Nonlinear (i.e., Boot) Latent State Construction
|
-
Uses of CreditCurve in org.drip.analytics.cashflow
Methods in org.drip.analytics.cashflow with parameters of type CreditCurve Modifier and Type Method Description static LossQuadratureMetrics
LossQuadratureMetrics. MakeDefaultPeriod(int iStartDate, int iEndDate, double dblAccrualDCF, double dblEffectiveNotional, double dblEffectiveRecovery, MergedDiscountForwardCurve dc, CreditCurve cc, int iDefaultLag)
Create an Instance of the LossPeriodCurveFactors using the Period's Dates and Curves to generate the Curve Measuresstatic LossQuadratureMetrics
LossQuadratureMetrics. MakeDefaultPeriod(int iStartDate, int iEndDate, double dblAccrualDCF, double dblEffectiveNotional, MergedDiscountForwardCurve dc, CreditCurve cc, int iDefaultLag)
Create a LossPeriodCurveFactors Instance from the Period Dates and the Curve Measures -
Uses of CreditCurve in org.drip.param.creator
Methods in org.drip.param.creator with parameters of type CreditCurve Modifier and Type Method Description static CurveSurfaceQuoteContainer
MarketParamsBuilder. Create(MergedDiscountForwardCurve dcFunding, ForwardCurve fc, GovvieCurve gc, CreditCurve cc, java.lang.String strComponentCode, ProductQuote compQuote, CaseInsensitiveTreeMap<ProductQuote> mTSYQuotes, LatentStateFixingsContainer lsfc)
Create a Market Parameters instance with the funding discount curve, the forward discount curve, the govvie curve, the credit curve, the component quote, the map of treasury benchmark quotes, and the Latent State Fixings Instance.static CurveSurfaceQuoteContainer
MarketParamsBuilder. Create(MergedDiscountForwardCurve dcFunding, GovvieCurve gc, CreditCurve cc, java.lang.String strComponentCode, ProductQuote compQuote, CaseInsensitiveTreeMap<ProductQuote> mTSYQuotes, LatentStateFixingsContainer lsfc)
Create a Market Parameters Instance with the Funding Curve, the Govvie Curve, the Credit Curve, the component quote, the map of treasury benchmark quotes, and the Latent State Fixings Containerstatic CurveSurfaceQuoteContainer
MarketParamsBuilder. Credit(MergedDiscountForwardCurve dcFunding, CreditCurve cc)
Create a Market Parameters Instance with the Funding Curve and the credit curve -
Uses of CreditCurve in org.drip.param.market
Methods in org.drip.param.market that return CreditCurve Modifier and Type Method Description CreditCurve
CreditCurveScenarioContainer. base()
Return the base credit curveCreditCurve
CreditCurveScenarioContainer. bumpDown()
Return the bump Down credit curveCreditCurve
CreditCurveScenarioContainer. bumpRecoveryDown()
Return the recovery bump Down credit curveCreditCurve
CreditCurveScenarioContainer. bumpRecoveryUp()
Return the recovery bump up credit curveCreditCurve
CreditCurveScenarioContainer. bumpUp()
Return the bump up credit curveCreditCurve
CurveSurfaceQuoteContainer. creditState(EntityCDSLabel creditLabel)
Retrieve the Credit Latent State from the LabelCreditCurve
CurveSurfaceQuoteContainer. recoveryState(EntityRecoveryLabel recoveryLabel)
Retrieve the Recovery Latent State from the LabelMethods in org.drip.param.market that return types with arguments of type CreditCurve Modifier and Type Method Description CaseInsensitiveTreeMap<CreditCurve>
CreditCurveScenarioContainer. custom()
Return the Custom credit curve mapCaseInsensitiveTreeMap<CreditCurve>
CreditCurveScenarioContainer. tenorBumpDown()
Return the tenor bump Down credit curve mapCaseInsensitiveTreeMap<CreditCurve>
CreditCurveScenarioContainer. tenorBumpUp()
Return the tenor bump up credit curve mapMethods in org.drip.param.market with parameters of type CreditCurve Modifier and Type Method Description boolean
CurveSurfaceQuoteContainer. setCreditState(CreditCurve cc)
(Re)-set the Credit Stateboolean
CurveSurfaceQuoteContainer. setRecoveryState(CreditCurve rc)
(Re)-set the Recovery State for the specified Recovery Latent State Label -
Uses of CreditCurve in org.drip.product.credit
Methods in org.drip.product.credit with parameters of type CreditCurve Modifier and Type Method Description double
BondComponent. recovery(int iStartDate, int iEndDate, CreditCurve cc)
double
BondComponent. recovery(int iDate, CreditCurve cc)
double
CDSComponent. recovery(int iDateStart, int iDateEnd, CreditCurve cc)
double
CDSComponent. recovery(int iDate, CreditCurve cc)
Constructors in org.drip.product.credit with parameters of type CreditCurve Constructor Description SpreadCalibOP(double dblCalibResult, CreditCurve ccCalib)
SpreadCalibOP Constructor -
Uses of CreditCurve in org.drip.product.definition
Methods in org.drip.product.definition with parameters of type CreditCurve Modifier and Type Method Description abstract double
CreditComponent. recovery(int iDate1, int iDate2, CreditCurve cc)
Get the time-weighted recovery of the credit component between the given datesabstract double
CreditComponent. recovery(int iDate, CreditCurve cc)
Get the recovery of the credit component for the given date -
Uses of CreditCurve in org.drip.service.product
Methods in org.drip.service.product with parameters of type CreditCurve Modifier and Type Method Description static PositionChangeComponents
CreditIndexAPI. HorizonChangeAttribution(DiscountCurve dcFirst, CreditCurve ccFirst, DiscountCurve dcSecond, CreditCurve ccSecond, java.lang.String strFullCreditIndexName)
Generate the CDS Horizon Change Attribution -
Uses of CreditCurve in org.drip.service.template
Methods in org.drip.service.template that return CreditCurve Modifier and Type Method Description static CreditCurve
LatentMarketStateBuilder. CreditCurve(JulianDate dtSpot, java.lang.String strCredit, java.lang.String[] astrMaturityTenor, double[] adblCoupon, double[] adblQuote, java.lang.String strMeasure, MergedDiscountForwardCurve dc)
Construct a Credit Curve from Overnight Exchange/OTC Market Instrumentsstatic CreditCurve
LatentMarketStateBuilder. CreditCurve(JulianDate dtSpot, CreditDefaultSwap[] aCDS, double[] adblQuote, java.lang.String strMeasure, MergedDiscountForwardCurve dc)
Construct a Credit Curve from the specified Calibration CDS InstrumentsMethods in org.drip.service.template that return types with arguments of type CreditCurve Modifier and Type Method Description static CaseInsensitiveTreeMap<CreditCurve>
LatentMarketStateBuilder. BumpedCreditCurve(JulianDate dtSpot, java.lang.String strCredit, java.lang.String[] astrMaturityTenor, double[] adblCoupon, double[] adblQuote, java.lang.String strMeasure, MergedDiscountForwardCurve dc, double dblBump, boolean bIsProportional)
Construct a Tenor + Parallel Map of Bumped Credit Curves from Overnight Exchange/OTC Market Instruments -
Uses of CreditCurve in org.drip.state.boot
Methods in org.drip.state.boot that return CreditCurve Modifier and Type Method Description static CreditCurve
CreditCurveScenario. Standard(java.lang.String strName, ValuationParams valParams, CalibratableComponent[] aCalibInst, double[] adblCalibQuote, java.lang.String[] astrCalibMeasure, double dblRecovery, boolean bFlat, MergedDiscountForwardCurve dc, GovvieCurve gc, LatentStateFixingsContainer lsfc, ValuationCustomizationParams vcp, CalibrationParams cp)
Calibrate a Credit Curvestatic CreditCurve[]
CreditCurveScenario. Tenor(java.lang.String strName, ValuationParams valParams, CalibratableComponent[] aCalibInst, double[] adblCalibQuote, java.lang.String[] astrCalibMeasure, double dblRecovery, boolean bFlat, double dblBump, MergedDiscountForwardCurve dc, GovvieCurve gc, LatentStateFixingsContainer lsfc, ValuationCustomizationParams vcp)
Create an array of tenor bumped credit curvesMethods in org.drip.state.boot that return types with arguments of type CreditCurve Modifier and Type Method Description static CaseInsensitiveTreeMap<CreditCurve>
CreditCurveScenario. TenorMap(java.lang.String strName, ValuationParams valParams, CalibratableComponent[] aCalibInst, double[] adblCalibQuote, java.lang.String[] astrCalibMeasure, double dblRecovery, boolean bFlat, double dblBump, MergedDiscountForwardCurve dc, GovvieCurve gc, LatentStateFixingsContainer lsfc, ValuationCustomizationParams vcp)
Create an tenor named map of tenor bumped credit curves -
Uses of CreditCurve in org.drip.state.creator
Methods in org.drip.state.creator that return CreditCurve Modifier and Type Method Description static CreditCurve
ScenarioCreditCurveBuilder. Custom(java.lang.String strName, JulianDate dtSpot, CalibratableComponent[] aCalibInst, MergedDiscountForwardCurve dc, double[] adblCalibQuote, java.lang.String[] astrCalibMeasure, double dblRecovery, boolean bFlat)
Calibrate the base credit curve from the input credit instruments, measures, and the quotesstatic CreditCurve
ScenarioCreditCurveBuilder. Custom(java.lang.String strName, JulianDate dtSpot, CalibratableComponent[] aCalibInst, MergedDiscountForwardCurve dc, double[] adblCalibQuote, java.lang.String[] astrCalibMeasure, double dblRecovery, boolean bFlat, CalibrationParams cp)
Calibrate the base credit curve from the input credit instruments, measures, and the quotes -
Uses of CreditCurve in org.drip.state.credit
Subclasses of CreditCurve in org.drip.state.credit Modifier and Type Class Description class
ExplicitBootCreditCurve
ExplicitBootCreditCurve exposes the functionality associated with the bootstrapped Credit Curve.Methods in org.drip.state.credit that return CreditCurve Modifier and Type Method Description abstract CreditCurve
CreditCurve. flatCurve(double dblFlatNodeValue, boolean bSingleNode, double dblRecovery)
Create a flat hazard curve from the inputs -
Uses of CreditCurve in org.drip.state.nonlinear
Subclasses of CreditCurve in org.drip.state.nonlinear Modifier and Type Class Description class
ForwardHazardCreditCurve
ForwardHazardCreditCurve manages the Survival Latent State, using the Hazard Rate as the State Response Representation.Methods in org.drip.state.nonlinear that return CreditCurve Modifier and Type Method Description CreditCurve
ForwardHazardCreditCurve. customTweakManifestMeasure(java.lang.String strManifestMeasure, ManifestMeasureTweak mmtp)
CreditCurve
ForwardHazardCreditCurve. flatCurve(double dblFlatNodeValue, boolean bSingleNode, double dblRecovery)


"x" "1" "GOODALL,CM, MOORE,CM AND STEPHENS,OB, MUTAGENICITY OFPARA-NITROSO-DIMETHYL- AND DIETHYL-ANILINES, XENOBIOTICA 16(6):587-593,1986"


About
Greetings, friend.
My name is Leonardo. I am a systems engineer currently based in Sydney, Australia. If I had to describe what I do in two words I would say I am a computer programmer (then I would probably complain about that absurd two-word limit), but that is only because full-time procrastinator is still not a recognised occupation.
I do love technology and my job involves a fair bit of programming.
I started this blog in 2008 with the intention of documenting my interests and the things I have learned, but then it had to be put aside when I hit a major milestone in my lifelong quest for happiness: I migrated to this beautiful continent, which in all honestly felt a little like simultaneously losing a limb and learning to fly.
It did turn out well in the end, by the way, as I am today happier than I’ve ever been. Recently becoming a parent may have had something to do with it.
Anyway, out of nowhere I decided it would be nice to start blogging again and try to keep going for a while. The cool thing is that it doesn’t matter if actual humans ever read what I have to say: I believe there is a lot of value in putting your thoughts on metaphorical paper, with the added bonus of potentially helping out that poor chap Webb C. Rawler, who seems lost and keeps coming back to this site all the time.
So what should you expect?
The stereotypical nerdy stuff: gadgets, science and science fiction, video games, programming and technology in general. As the title of the blog suggests, I may also spend some time in musing about the impedance mismatch between the PEBCAK generator and the electronics living inside the beige box.
The blogging stack
I am currently using Octopress for blogging, so posts are written in Markdown syntax and converted to static html with Jekyll. The resulting static pages are published to both Github Pages and Heroku (I’m still undecided on which one is better but both satisfy my current requirements). I learned about setting up a site on Heroku from Sam de Freyssinet’s post on blogging With Octopress on Heroku.
I write my posts using Vim installed on a Raspbian-running Raspberry Pi Model B (one of my favourite pieces of hardware, I must say). My dotfiles for Raspbian are based on Zach Holman’s and can be found here. It goes without saying that I use Git for version control.
Thanks to everyone who has contributed to these projects, products and platforms. You are truly awesome.
Contact details
If you want to get in touch, send me an email to eamitemr at gmail dot com. Other forms of touching are highly discouraged.


LOGOUT
Artist Name
Edit Profile
photo_library
Artworks
select_all
Exhibitions
send
Loans
flag
Media
question_answer
Interest
search
close
View By:
Option 1
Option 2
Option 3
add
Add New Loan
Loan Title
edit
Edit
more_vert
Loan Title
close
Borrower, Location
Start Date – End Date
Artwork Title, Edition
Loan Title
edit
Edit
more_vert
Loan Title
close
Borrower, Location
Start Date – End Date
Artwork Title, Edition
Loan Title
edit
Edit
more_vert
Loan Title
close
Borrower, Location
Start Date – End Date
Artwork Title, Edition
Loan Title
edit
Edit
more_vert
Loan Title
close
Borrower, Location
Start Date – End Date
Artwork Title, Edition


dougmolineux | blog
Home
Archives
2021
Sep 17
Getting Hexo Blog Deployed to Github Page Subdirectory
Home
Archives


--- layout: post status: publish published: true title: 'iOS > Localization Tutorial: Localize Your Apps to Support Multiple Languages' author: display_name: hojunbaek login: hojunbaek email<EMAIL_ADDRESS>url: '' author_login: hojunbaek author_email<EMAIL_ADDRESS>wordpress_id: 2187 wordpress_url: http://ezcocoa.com/?p=2187 date: '2014-01-12 10:47:21 +0900' date_gmt: '2014-01-12 10:47:21 +0900' categories: - iPhone tags: [] comments: - id: 51 author: winyo author_email<EMAIL_ADDRESS>author_url: http://www.ezcocoa.com date: '2014-01-16 04:30:50 +0900' date_gmt: '2014-01-16 04:30:50 +0900' content: Ios7.3 ok ---


Toggle navigation
Interact.io
Interact API Documentation
How-To's
Get a key
Authorization
Docs
Internal API
Inbox API
Outbox API
Stats API
Vault API
Campaigns API
Contact Manager API
Help
Don't you have an account ?
It's simple and easy, just log into
Leadsore.io
or
myContacts.io
and start testing our API's.


Recipe 7.5. Holding Bound Methods in a Picklable WayCredit: Peter Cogolo ProblemYou need to pickle an object, but that object holds (as an attribute or item) a bound method of another object, and bound methods are not picklable. SolutionSay you have the following objects: import cPickle class Greeter(object): def _ _init_ _(self, name): self.name = name def greet(self): print 'hello', self.name class Repeater(object): def _ _init_ _(self, greeter): self.greeter = greeter def greet(self): self.greeter( ) self.greeter( ) r = Repeater(Greeter('world').greet) Were it not for the fact that r holds a bound method as its greeter attribute, you could pickle r very simply: s = cPickle.dumps(r) However, upon encountering the bound method, this call to cPickle.dumps raises a TypeError. One simple solution is to have each instance of class Repeater hold, not a bound method directly, but rather a picklable wrapper to it. For example: class picklable_boundmethod(object): def _ _init_ _(self, mt): self.mt = mt def _ _getstate_ _(self): return self.mt.im_self, self.mt.im_func._ _name_ _ def _ _setstate_ _(self, (s,fn)): self.mt = getattr(s, fn) def _ _call_ _(self, *a, **kw): return self.mt(*a, **kw) Now, changing Repeater._ _init_ _'s body to self.greeter = picklable_boundmethod(greeter) makes the previous snippet work. DiscussionThe Python Standard Library pickle module (just like its faster equivalent cousin cPickle) pickles functions and classes by namethis implies, in particular, that only functions defined at the top level of a module can be pickled (the pickling of such a function, in practice, contains just the names of the module and function). If you have a graph of objects that hold each other, not directly, but via one another's bound methods (which is often a good idea in Python), this limitation can make the whole graph unpicklable. One solution might be to teach pickle how to serialize bound methods, along the same lines as described in Recipe 7.6. Another possible solution is to define appropriate _ _getstate_ _ and _ _setstate_ _ methods to turn bound methods into something picklable at dump time and rebuild them at load time, along the lines described in Recipe 7.4. However, this latter possibility is not a good factorization when you have several classes whose instances hold bound methods. This recipe pursues a simpler idea, based on holding bound methods, not directly, but via the picklable_boundmethod wrapper class. picklable_boundmethod is written under the assumption that the only thing you usually do with a bound method is to call it, so it only delegates _ _call_ _ functionality specifically. (You could, in addition, also use _ _getattr_ _, in order to delegate other attribute accesses.) In normal operation, the fact that you're holding an instance of picklable_boundmethod rather than holding the bound method object directly is essentially transparent. When pickling time comes, special method _ _getstate_ _ of picklable_boundmethod comes into play, as previously covered in Recipe 7.4. In the case of picklable_boundmethod, _ _getstate_ _ returns the object to which the bound method belongs and the function name of the bound method. Later, at unpickling time, _ _setstate_ _ recovers an equivalent bound method from the reconstructed object by using the getattr built-in for that name. This approach isn't infallible because an object might hold its methods under assumed names (different from the real function names of the methods). However, assuming you're not specifically doing something weird for the specific purpose of breaking picklable_boundmethod's functionality, you shouldn't ever run into this kind of obscure problem! See AlsoLibrary Reference and Python in a Nutshell docs for modules pickle and cPickle, bound-method objects, and the getattr built-in. |


Yes, I'm currently paying for and hosting on my own Google Cloud Platform account. The source code is Open-source and freely available on Github.com.
Very few. At the moment, the following Things are supported: Switches/dimmers, contact sensors, motion sensors and locks. I'm a One-person show and will add support for other devices as and when requested or needed.
Absolutely. All traffic between the website and you is secured via HTTPS/TLS (SHA-256 with RSA Encryption). Provided for free by the amazing folks at Let’s Encrypt.
Very. You never gave it to the website. You logged-in on the Samsung SmartThings website and allowed this website limited access to your account and devices. You can revoke the access anytime.
Very simple, visit https://account.smartthings.com and login. Then click on "My Locations" and under "Installed SmartApps" column, click on "smartapps" for your Hub location. Then click on "Edit", scroll down to "Things UI" under "Other" and click "Uninstall". That's it. Sorry to see you go :(
Thought you'd never ask. You can support me on Patreon.


2010 was a big shift in work environment for me. I migrated from an office to a completely distributed and remote team at Outspokes and then to Intridea later in the same year. Many of my daily tools stayed the same, but there's been plenty of additions to streamline my work. Here's an overview of my most used tools for web development.
I switched to Chrome as my personal use browser, but stuck with Firefox because
of Firebug and other extensions. Chrome was snappy in daily use, consumed less
resources, and just plain felt better than Firefox. Once I learned about the
available "Web Inspector", the switch was complete. Nowadays, I only open other
browsers briefly for testing.
Instead of holding meetings in person, Skype is now always open for conference
calls. Meetings are scheduled in Google calendar, and if screen sharing is
needed, then we pop open a GoToMeeting.
I used Yammer briefly while at Outspokes, but none of us got into it very
much. At Intridea, there was so much more knowledge and information that
needed to be shared between projects and team members that I saw the real value
of micro-blogging for the first time. On a remote team, it's also a great way
to share a virtual water cooler and hang out with your co-workers.
Campfire client for OSX. I don't use Campfire for all my projects, but when a
client requests it, then I can keep separate tabs. The integrated file upload
and download is nice too.
I grew up on Emacs, and I still use it frequently, but Emacs and Vim are both
kind of clunky and doesn't fit in with the rest of the Cocoa environment.
Simple way to stage and unstage changes. I know there's fancier apps that
integrate with Github, but for the time being, this app has just the right
amount of features for me.
I use Cloudapp for ultra-quick screenshots and file uploads. When I need to
draw a few arrows and text, I open up Skitch and drag the image up to the
Cloudapp menulet. I know Skitch has built in sharing, but the Cloudapp one
feels more polished to me. Both are great apps I use all the time.
 It's just a single feature,
but it's an awesome single feature.
I don't do very much graphics work, but it's nice to have an app that lets me
whip up a quick background, or tweak an existing image asset.
Great way to test APIs and inspect HTTP headers.
When I do need to test multiple versions of Firefox, MultiFirefox is a kickass
simple utility for launching different versions with different profiles.
For IE testing, I've tried Fusion, Parallel, and VirtualBox. Out of the 3, I
think VirtualBox has been the least buggy and simplest. It might not have
bells and whistles, but honestly, I just want to boot Windows and load
shudder IE6 and 7. As an added bonus, there's libraries for controlling
VirtualBox programmatically.
I'm open minded about trying new apps, but more tools doesn't always mean more productivity. These apps represent a greatest hits list for the past year. It's not a comprehensive list, but if any of these apps disappeared, I'd really be hurting.


advanced
What if we could write apps without caring about the runtime data types used but just about how the data is operated on?
Let’s say we have an application working with RxJava’s Observable
. We’ll end up having a bunch of chained call stacks
based on that given data type.
And same story for other “containers” like Flowable
, Deferred
(coroutines), Future
, IO
, and many more.
Conceptually, all those types represent an operation (already done or pending to be done), which could support things like mapping over the inner value, flatMapping to chain other operations of the same type, zipping it with other instances of the same type, and so on.
What if we could write our programs just based on those behaviours in such a declarative style? We could make them be
agnostic from concrete data types like Observable
. We’d just need to be sure that the data types support a certain
contract, so they are “mappable”, “flatMappable”, and so on.
This approach could sound a bit weird or smell to overengineering, but it has some interesting benefits. Let’s put our eyes on a simple example first and then we talk about those. Deal?
I’m grabbing the following code samples from my mate Raúl Raja who helped to polish this post.
Let’s say we have a TODO app, and we want to fetch some user Tasks
from a local cache. In case we don’t find them
, we’ll try to fetch them from a network service. We could have a common contract for for both of the DataSources
that
would provide a way to retrieve a List
of Tasks
for a given User
, regardless of the source:
interface DataSource {
fun allTasksByUser(user: User): Observable<List<Task>>
}
We’ll return Observable
here for simplicity, but it could be Single
, Maybe
, Flowable
, Deferred
, or anything
else depending on our needs.
Let’s add a couple of mock implementations for it, a local and a remote one.
class LocalDataSource : DataSource {
private val localCache: Map<User, List<Task>> =
mapOf(User(UserId("user1")) to listOf(Task("LocalTask assigned to user1")))
override fun allTasksByUser(user: User): Observable<List<Task>> =
Observable.create { emitter ->
val cachedUser = localCache[user]
if (cachedUser != null) {
emitter.onNext(cachedUser)
} else {
emitter.onError(UserNotInLocalStorage(user))
}
}
}
class RemoteDataSource : DataSource {
private val internetStorage: Map<User, List<Task>> =
mapOf(User(UserId("user2")) to listOf(Task("Remote Task assigned to user2")))
override fun allTasksByUser(user: User): Observable<List<Task>> =
Observable.create { emitter ->
val networkUser = internetStorage[user]
if (networkUser != null) {
emitter.onNext(networkUser)
} else {
emitter.onError(UserNotInRemoteStorage(user))
}
}
}
It’s clearly rusty and both implementations are actually the same. It’s simply a mocked version of both data sources
that would ideally retrieve the data from a local cache or a network API. We’re using an in memory
Map<User, List<Task>>
for each one to hold the data.
Since we got two DataSources
, we’ll need a way to coordinate both. Let’s add the following Repository
:
class TaskRepository(private val localDS: DataSource,
private val remoteDS: RemoteDataSource) {
fun allTasksByUser(user: User): Observable<List<Task>> =
localDS.allTasksByUser(user)
.subscribeOn(Schedulers.io())
.observeOn(Schedulers.computation())
.onErrorResumeNext { _: Throwable -> remoteDS.allTasksByUser(user) }
}
It basically tries to load the List<Task>
from the LocalDataSource
, and if it’s not found, it will try to fetch it
from Network using the RemoteDataSource
, as required by our specs.
Let’s add a simple dependency provisioning Module. We’ll use it to get all our instances up and running in a nested way. We’ll avoid using any Dependency Injection frameworks :
class Module {
private val localDataSource: LocalDataSource = LocalDataSource()
private val remoteDataSource: RemoteDataSource = RemoteDataSource()
val repository: TaskRepository = TaskRepository(localDataSource, remoteDataSource)
}
And finally, we’ll need a simple test to run the whole stack of operations:
object test {
@JvmStatic
fun main(args: Array<String>): Unit {
val user1 = User(UserId("user1"))
val user2 = User(UserId("user2"))
val user3 = User(UserId("unknown user"))
val dependenciesModule = Module()
dependenciesModule.run {
repository.allTasksByUser(user1).subscribe({ println(it) }, { println(it) })
repository.allTasksByUser(user2).subscribe({ println(it) }, { println(it) })
repository.allTasksByUser(user3).subscribe({ println(it) }, { println(it) })
}
}
}
Here you have all the pieces together, just in case you want to copy/paste the complete program.
This program composes the execution chain for three different users, and then subscribes to the resulting Observable
.
The first two Users
are available, lucky of us. User1
is available on the local DataSource, and User2
is available
on the remote one.
We’re not so lucky for User3
, since it’s not found on the local one. The program will try to load it from the remote
service, where it’s not found either. The search will fail and we’ll print the corresponding error on the subscription.
This is what we get printed for the three cases:
> [Task(value=LocalTask assigned to user1)]
> [Task(value=Remote Task assigned to user2)]
> UserNotInRemoteStorage(user=User(userId=UserId(value=unknown user)))
This is all what is worth for our canonical example. Let’s try to encode it now using a Functional Programming polymorphic style.
Our DataSource
contract interface will look like this from now on:
interface DataSource<F> {
fun allTasksByUser(user: User): Kind<F, List<Task>>
}
It’s fairly similar, but it has two important differences:
F
generic type.Kind<F, List<Task>>
.Kind
is basically the way Arrow encodes something called Higher Kinded Types.
Let’s learn the concept pretty rapidly with a very basic example.
On Observable
, we have 2 parts:
Observable
: The “witness” type, the container. A fixed type.A
: The generic type argument. An abstraction, and we can pass any types for it.We’re used to abstract over generic types, like A
. We are familiarized with it. Truth is we can also abstract over
type containers like Observable
. That’s why “Higher Kinds” (Higher Kinded Types) exist.
The overall idea is that we can have constructs as F
, where both F
and A
can be generics. That syntax is not
supported by the Kotlin compiler (yet?), so we need to mimic it by using a
different approach.
Arrow adds support to this by using an intermediate meta interface called Kind<F, A>
that holds references to both types and also generates converters at compile time on both directions, so we can go from
Kind<Observable, List<Task>>
to Observable<List<Task>>
and vice versa. Not ideal, but works for what it’s worth.
So, if we take a look at our snippet again:
interface DataSource<F> {
fun allTasksByUser(user: User): Kind<F, List<Task>>
}
The DataSource
function returns a higher kind: Kind<F, List<Task>>
. It translates to F<List<Task>>
, where F
remains generic.
We’re just fixing the List<Task>
type here, which is already concrete. In other words, we don’t care about what’s the
container type (F
), as long as it keeps a List<Task>
inside. a.k.a: We leave the slot open for passing in
different containers. Clear enough? Let’s keep moving.
Let’s take a look at the DataSource
implementations, but this time separately for a more gradual learning. The local
one first:
class LocalDataSource<F>(A: ApplicativeError<F, Throwable>) : DataSource<F>, ApplicativeError<F, Throwable> by A {
private val localCache: Map<User, List<Task>> =
mapOf(User(UserId("user1")) to listOf(Task("LocalTask assigned to user1")))
override fun allTasksByUser(user: User): Kind<F, List<Task>> =
Option.fromNullable(localCache[user]).fold(
{ raiseError(UserNotInLocalStorage(user)) },
{ just(it) }
)
}
Bunch of new things? Don’t be scared, let’s go step by step.
This DataSource
keeps the generic F
since it implements DataSource<F>
. We wanna be able to pass that type from
the outside, all the way down.
Now, forget about that probably unfamiliar ApplicativeError
thing on the constructor, and focus on the allTasksByUser()
function, just for now. We’ll get back to that.
override fun allTasksByUser(user: User): Kind<F, List<Task>> =
Option.fromNullable(localCache[user]).fold(
{ raiseError(UserNotInLocalStorage(user)) },
{ just(it) }
)
As you see, it returns (one more time) Kind<F, List<Task>>
. So we still don’t care about what the container F
is, as
long as it contains a List<Task>
.
But we have a problem. Depending on whether we can find the Tasks
for the given user on the local cache or not, we
might want to notify an error (Tasks
not found), or return the Tasks already wrapped into F
(Tasks
found).
And for both things we must return: Kind<F, List<Task>>
.
In other words: there’s a type we still don’t know anything about: F
and we need a way to return an error wrapped
into it, and also a way to construct an instance of it wrapping a successful value. Sounds impossible?.
Let’s go back to the class declaration and find that ApplicativeError
being passed on construction and then used as a delegate for the class (by A
).
class LocalDataSource<F>(A: ApplicativeError<F, Throwable>) : DataSource<F>, ApplicativeError<F, Throwable> by A {
//...
}
ApplicativeError
extends from Applicative
,
and both are Typeclasses.
Typeclasses define behaviors (contracts). They’re basically encoded as interfaces that work over a generic argument,
as in Monad<F>
, Functor<F>
and many more. That F
is the data type. So we will be able to pass types like Either
, Option
, IO
, Observable
,
Flowable
and many more for it.
Don’t worry if you don’t know about some of them yet. Data types like Either
, Option
or IO
are particular from
Functional Programming and you probably don’t need to know more about them yet.
So, back to our two problems:
Kind<F, List<Task>>
We can rely on a typeclass for this: Applicative
. Since ApplicativeError
extends from it, we can delegate to it. We’re delegating our class on it, so we can use its features out of the box.
Applicative
provides the just(a)
function. just(a)
wraps
a value into the context of any Higher Kind. So If we have an Applicative<F>
, it could call just(a)
to wrap the
value into the container F
, regardless of which one is it. Let’s say it’s Observable
, we’ll have an
Applicative<Observable>
, which will know how to wrap a
into an Observable
like Observable.just(a)
.
Kind<F, List<Task>>
We can use ApplicativeError
for that. It brings the
function raiseError(e)
into scope. raiseError(e)
basically wraps an error into the F
container. For the
Observable
example, raising the error would end up doing something like Observable.error(t)
, where t
is a
Throwable
, since we’re declaring our error type when we declare the typeclass as ApplicativeError<F, Throwable>
.
Let’s get back to our abstracted LocalDataSource<F>
implementation.
class LocalDataSource<F>(A: ApplicativeError<F, Throwable>) :
DataSource<F>, ApplicativeError<F, Throwable> by A {
private val localCache: Map<User, List<Task>> =
mapOf(User(UserId("user1")) to listOf(Task("LocalTask assigned to user1")))
override fun allTasksByUser(user: User): Kind<F, List<Task>> =
Option.fromNullable(localCache[user]).fold(
{ raiseError(UserNotInLocalStorage(user)) },
{ just(it) }
)
}
The in memory map remains the same, but the function does a couple things probably new to you:
It tries to load the Tasks
from the local cache, and since that returns a nullable (because the Tasks
could not be
found), we are going to model that using an Option
. In case you’re not
aware of how Option
works, it models presence vs absence of a value. A
value that is wrapped inside of it.
After getting our optional value, we fold
over it. Folding is just equivalent to a when statement over the optional
value. When it’s absent, it wraps an error into the F
data type (first lambda passed in). And when it’s
present it constructs an instance of the F
data type wrapping it (second lambda). For both cases, it uses the
ApplicativeError
features mentioned before:
raiseError()
and just()
.
With this, we’ve basically abstracted away our data source implementation so it doesn’t know about which container it’s
using for the type F
. And we have been able to do it thanks to the abstractions defined by the typeclasses.
The network DataSource
implementation would look similar:
class RemoteDataSource<F>(A: Async<F>) : DataSource<F>, Async<F> by A {
private val internetStorage: Map<User, List<Task>> =
mapOf(User(UserId("user2")) to listOf(Task("Remote Task assigned to user2")))
override fun allTasksByUser(user: User): Kind<F, List<Task>> =
async { callback: (Either<Throwable, List<Task>>) -> Unit ->
Option.fromNullable(internetStorage[user]).fold(
{ callback(UserNotInRemoteStorage(user).left()) },
{ callback(it.right()) }
)
}
}
This time there’s a subtle difference: Instead of delegating into an instance of ApplicativeError
as before, we’ll use a different typeclass: Async
.
That’s because of the asynchronous nature of a network call. We want to code it in an asynchronous way, so we’ll delegate its async requirements into a typeclass that is thought for it.
Async
models asynchronous operations. So it’s able to model any
operations that are based on callbacks. Note that we still don’t know about the concrete data types to use, but about
the problem, which is asynchronous by nature. Therefore we use a Typeclass that encodes that problematic to solve
it.
So, zooming in a bit into the function:
override fun allTasksByUser(user: User): Kind<F, List<Task>> =
async { callback: (Either<Throwable, List<Task>>) -> Unit ->
Option.fromNullable(internetStorage[user]).fold(
{ callback(UserNotInRemoteStorage(user).left()) },
{ callback(it.right()) }
)
}
We can use the async {}
function provided by the Async
typeclass to
model our operation and create an instance of the type Kind<F, List<Task>>
that will be resolved asynchronously.
If we were using a fixed data type like Observable
, Async.async {}
would be equivalent to Observable.create()
, in
terms of building up an operation that can be bridged from synchronous or asynchronous code, i.e. Thread
or
AsyncTask
.
The callback
parameter is used to wire back the real resulting callbacks into the F
container (higher kind type)
context.
With this we have our RemoteDataSource
also abstracted away and depending on a still unknown container type F
.
Let’s go up one level to take a look at the repo. If you can remember, we need to search for the user Tasks
on the
LocalDataSource
first, and if they’re not available, try to fetch them from the RemoteLocalDataSource
.
class TaskRepository<F>(
private val localDS: DataSource<F>,
private val remoteDS: RemoteDataSource<F>,
AE: ApplicativeError<F, Throwable>) : ApplicativeError<F, Throwable> by AE {
fun allTasksByUser(user: User): Kind<F, List<Task>> =
localDS.allTasksByUser(user).handleErrorWith {
when (it) {
is UserNotInLocalStorage -> remoteDS.allTasksByUser(user)
else -> raiseError(UnknownError(it))
}
}
}
ApplicativeError<F, Throwable>
is back! It also brings
an extension function into scope called handleErrorWith()
that works over any Higher Kind receiver.
It’s encoded like:
fun  Kind<F, A>.handleErrorWith(f: (E) -> Kind<F, A>): Kind<F, A>
Since the call localDS.allTasksByUser(user)
returns Kind<F, List<Task>>
, which would stand for F<List<Task>>
where
F
remains generic, we can call the handleErrorWith()
function on top of it.
handleErrorWith()
allows you to react to errors using the passed in lambda. Let’s zoom in to the function:
fun allTasksByUser(user: User): Kind<F, List<Task>> =
localDS.allTasksByUser(user).handleErrorWith {
when (it) {
is UserNotInLocalStorage -> remoteDS.allTasksByUser(user)
else -> raiseError(UnknownError(it))
}
}
So we basically get back the result of the first operation unless it throws an exception, which will be handled by the
lambda block. In case the error has the type UserNotInLocalStorage
, we try to search for the Tasks
on the remote
DataSource
. In any other cases, we raise (wrap) an unknown error into the F
container type.
The dependency provisioning module remains very similar:
class Module<F>(A: Async<F>) {
private val localDataSource: LocalDataSource<F> = LocalDataSource(A)
private val remoteDataSource: RemoteDataSource<F> = RemoteDataSource(A)
val repository: TaskRepository<F> =
TaskRepository(localDataSource, remoteDataSource, A)
}
The only difference is that now it’s abstracted away and depends on F
, which stays polymorphic. I’ve intentionally
obviated this before to avoid noise, but Async
ultimately extends
from ApplicativeError
, so we can use an instance of it
to solve the concerns we have at all the nested levels, and pass it all the way down as you can see on the module.
We have finally got to the point where our complete app is abstracted away from any concrete data type containers
(F
) and we can focus on testing its polymorphism using the runtime. We’ll test the same code passing in different data
types for the type F
. The scenario is the same we had when we were plainly using Observable
.
We’re now in the program’s edge, where we are already out of any abstraction boundaries, and where we are in charge to pass in the implementation details.
Let’s use RxJava Single
as the container F
to start with.
object test {
@JvmStatic
fun main(args: Array<String>): Unit {
val user1 = User(UserId("user1"))
val user2 = User(UserId("user2"))
val user3 = User(UserId("unknown user"))
val singleModule = Module(SingleK.async())
singleModule.run {
repository.allTasksByUser(user1).fix().single.subscribe(::println, ::println)
repository.allTasksByUser(user2).fix().single.subscribe(::println, ::println)
repository.allTasksByUser(user3).fix().single.subscribe(::println, ::println)
}
}
}
Arrow provides wrappers over some well known library data types for compatibility, so there’s a handy SingleK
wrapper available for it. These wrappers enable the data types as Higher Kinds to be able to use them with
typeclasses.
This test will print:
[Task(value=LocalTask assigned to user1)]
[Task(value=Remote Task assigned to user2)]
UserNotInRemoteStorage(user=User(userId=UserId(value=unknown user)))
Same results than the one using a fixed Observable
. 🎉
Let’s move on to Maybe
, for which we have a MaybeK
wrapper also:
@JvmStatic
fun main(args: Array<String>): Unit {
val user1 = User(UserId("user1"))
val user2 = User(UserId("user2"))
val user3 = User(UserId("unknown user"))
val maybeModule = Module(MaybeK.async())
maybeModule.run {
repository.allTasksByUser(user1).fix().maybe.subscribe(::println, ::println)
repository.allTasksByUser(user2).fix().maybe.subscribe(::println, ::println)
repository.allTasksByUser(user3).fix().maybe.subscribe(::println, ::println)
}
}
Same result is printed, but this time running using a different data type:
[Task(value=LocalTask assigned to user1)]
[Task(value=Remote Task assigned to user2)]
UserNotInRemoteStorage(user=User(userId=UserId(value=unknown user)))
What about ObservableK
/ FlowableK
? Let’s try:
object test {
@JvmStatic
fun main(args: Array<String>): Unit {
val user1 = User(UserId("user1"))
val user2 = User(UserId("user2"))
val user3 = User(UserId("unknown user"))
val observableModule = Module(ObservableK.async())
observableModule.run {
repository.allTasksByUser(user1).fix().observable.subscribe(::println, ::println)
repository.allTasksByUser(user2).fix().observable.subscribe(::println, ::println)
repository.allTasksByUser(user3).fix().observable.subscribe(::println, ::println)
}
val flowableModule = Module(FlowableK.async())
flowableModule.run {
repository.allTasksByUser(user1).fix().flowable.subscribe(::println)
repository.allTasksByUser(user2).fix().flowable.subscribe(::println)
repository.allTasksByUser(user3).fix().flowable.subscribe(::println, ::println)
}
}
}
Printing:
[Task(value=LocalTask assigned to user1)]
[Task(value=Remote Task assigned to user2)]
UserNotInRemoteStorage(user=User(userId=UserId(value=unknown user)))
[Task(value=LocalTask assigned to user1)]
[Task(value=Remote Task assigned to user2)]
UserNotInRemoteStorage(user=User(userId=UserId(value=unknown user)))
Everything working as expected. 💪
Let’s try the DeferredK
wrapper for the
kotlinx.coroutines.Deferred
type:
object test {
@JvmStatic
fun main(args: Array<String>): Unit {
val user1 = User(UserId("user1"))
val user2 = User(UserId("user2"))
val user3 = User(UserId("unknown user"))
val deferredModule = Module(DeferredK.async())
deferredModule.run {
runBlocking {
try {
println(repository.allTasksByUser(user1).fix().deferred.await())
println(repository.allTasksByUser(user2).fix().deferred.await())
println(repository.allTasksByUser(user3).fix().deferred.await())
} catch (e: UserNotInRemoteStorage) {
println(e)
}
}
}
}
}
As you know, you’re in charge to catch exceptions on coroutines. As you can see, implementation details as this catch, or the observable subscriptions from previous examples, are implementation details related to the given data types being used for each case, so those must live here, in the program’s edge.
Same result one more time:
[Task(value=LocalTask assigned to user1)]
[Task(value=Remote Task assigned to user2)]
UserNotInRemoteStorage(user=User(userId=UserId(value=unknown user)))
There’s also an alternative api provided by Arrow a bit more fancier for DeferredK
. It takes care of runBlocking and awaiting on the operations for you:
object test {
@JvmStatic
fun main(args: Array<String>): Unit {
val user1 = User(UserId("user1"))
val user2 = User(UserId("user2"))
val user3 = User(UserId("unknown user"))
val deferredModuleAlt = Module(DeferredK.async())
deferredModuleAlt.run {
println(repository.allTasksByUser(user1).fix().unsafeAttemptSync())
println(repository.allTasksByUser(user2).fix().unsafeAttemptSync())
println(repository.allTasksByUser(user3).fix().unsafeAttemptSync())
}
}
}
This one wraps the result into Try
(which can be Success
or Failure
).
Success(value=[Task(value=LocalTask assigned to user1)])
Success(value=[Task(value=Remote Task assigned to user2)])
Failure(exception=UserNotInRemoteStorage(user=User(userId=UserId(value=unknown user))))
Finally, let’s use a more fancy data type related to Functional Programming: IO
.
IO
exists to wrap an in/out operation that causes side effects and make it pure.
object test {
@JvmStatic
fun main(args: Array<String>): Unit {
val user1 = User(UserId("user1"))
val user2 = User(UserId("user2"))
val user3 = User(UserId("unknown user"))
val ioModule = Module(IO.async())
ioModule.run {
println(repository.allTasksByUser(user1).fix().attempt().unsafeRunSync())
println(repository.allTasksByUser(user2).fix().attempt().unsafeRunSync())
println(repository.allTasksByUser(user3).fix().attempt().unsafeRunSync())
}
}
}
Right(b=[Task(value=LocalTask assigned to user1)])
Right(b=[Task(value=Remote Task assigned to user2)])
Left(a=UserNotInRemoteStorage(user=User(userId=UserId(value=unknown user))))
IO
is a bit special. It returns the errors / successful results using
Either<L,R>
(which is another data type). By convention, the “left”
side of an either (L
) stores the errors, and the right side (R
) stores the successful data. That’s why successful
results are printed as Right(...)
and the failing one is printed as Left(...)
.
But the result is conceptually the same.
And with this, we are done with all the testing. As you can see we are able to run the same code stack using different data types, so our program has become complete agnostic of those.
Here you have the polymorphic app all together for copy / paste purposes.
That’s always your choice, but there are some important benefits that FP brings to the table that you’ll need to know when the time comes.
You have a really clear separation of concerns: How the data is operated and composed (your actual program) vs the runtime. This means better testability.
Your programs would ideally target abstractions so you have the choice on how to implement them depending on your needs / environments (i.e: testing). That’s ultimately a DI related concept, so for sure you can do that without the need for FP. Said that, the FP approach leads you to program in such a way that is less prone to break this “principle”. That’s because there’s a clearly defined boundary between the declarative algebras (operations) and the runtime (types used to run it), where the details are.
Composing your program algebras (operations) based on abstractions allows to keep your codebase deterministic and free of unexpected effects (pure). If you want to know more about purity and why pure code is less prone to errors or unexpected behaviours, take a look at this post.
Following the previous point, your program side effects are controlled at the edge. Effects are caused by implementation details passed from a single point on the system. (Anything beyond the edge boundaries remains pure).
If you chose to just work with Typeclasses, you’ll get a unified
API for all the data types. Repeatability helps to get familiarized with the concepts. (Repeatability as in just using
operations like map
, flatMap
, fold
, all the way, regardless of the problem you’re solving. Of course that’s
constrained to using some libraries that enable pure FP over Kotlin and provide those operations and constructs, like
Arrow.
These patterns remove the need for specific DI frameworks, since they’re based on the same concepts of Dependency Injection out of the box. You’re always able to provide implementation details later on and switch them transparently, and before that moment your program is not tied to any “side-effecty” details. This approach could be considered DI by itself actually, since it’s based on targeting abstractions leaving details to be passed form a single point in the edge.
As a final conclusion, I’d suggest you to use the approach that fits better your needs. Functional Programming is not going to solve all your problems, since there are not silver bullets, but it’s a totally legit choice which brings a bunch of key benefits.
If you want to move further on typeclasses, you can read the docs section about them. Still I’ll be happy if you got to understand that they’re used as contracts to compose our polymorphic programs based on abstraction thanks to this post.
If you still have any doubts, please don’t hesitate to contact me. The fastest way to do it is my Twitter handle: @JorgeCastilloPR.
Some of the mentioned concepts like purity are described in the following blogposts:
Also, consider watching FP to the max by John De Goes and
the related FpToTheMax.kt
example located in the arrow-examples
module. This technique may seem to be a huge overhead
on such a small example, but it is meant to be used at scale.


Buttons
Variations on Material Design buttons.Colored fab
{% include "../../../java/com/github/ilyes4j/gwt/mdl/demo/modules/buttons/ColoredFabDemo.java" %}
Plain fab
{% include "../../../java/com/github/ilyes4j/gwt/mdl/demo/modules/buttons/PlainFabDemo.java" %}
Raised
{% include "../../../java/com/github/ilyes4j/gwt/mdl/demo/modules/buttons/RaisedButtonDemo.java" %}
Raised Colored
{% include "../../../java/com/github/ilyes4j/gwt/mdl/demo/modules/buttons/RaisedColoredDemo.java" %}
Flat
{% include "../../../java/com/github/ilyes4j/gwt/mdl/demo/modules/buttons/FlatButtonDemo.java" %}
Flat colored
{% include "../../../java/com/github/ilyes4j/gwt/mdl/demo/modules/buttons/FlatColoredDemo.java" %}
Icon
{% include "../../../java/com/github/ilyes4j/gwt/mdl/demo/modules/buttons/IconButtonDemo.java" %}
Mini fab
{% include "../../../java/com/github/ilyes4j/gwt/mdl/demo/modules/buttons/MiniFabDemo.java" %}


Fair enough. To start, this is a website that my older brother Greg made for me on my 28th birthday. He didn't build it for me with any particular usage in mind; he just wanted me to have my very own website (with a really cool domain name) so that if I ever wanted to start a blog or showcase my photos, I now have a place to do that.
Another solid question. My name is Laura Allen. I currently live in NYC, and I spend most of my time deep in the marketing game. When I'm not on my grind connecting people and brands, I'm probably traveling or kickin' it with my NYC & Denver crew.
Some might say that I fly first class to change the weather.
I'm from Pittsburgh and my hometown is better than yours. Remember growing up and wanting to live in that neighborhood Mr. Rogers was always talking about? I lived that dream, baby.


class Cadmium::Readability
- Cadmium::Readability
- Reference
- Object
Overview
A syntactical analyzer that helps determine the readibility of a block of text.
Defined in:
cadmium/readability.crConstructors
-
.new(text)
The constructor accepts the text to be analysed, and returns a report object which gives access to the
Instance Method Summary
-
#flesch
Flesch reading ease of the text sample.
-
#fog
The Gunning Fog Index of the text sample.
- #frequencies : Hash(String, Int32)
-
#kincaid
Flesch-Kincaid level of the text sample.
-
#num_chars
The number of characters in the sample.
-
#num_paragraphs
The number of paragraphs in the sample.
-
#num_sentences
The number of sentences in the sample.
-
#num_syllables : Int32
The total number of syllables in the text sample.
-
#num_unique_words
The number of different unique words used in the text sample.
-
#num_words
The total number of words used in the sample.
-
#occurrences(word)
The number of occurences of the word +word+ in the text sample.
- #paragraphs : Array(String)
-
#percent_fog_complex_words
The percentage of words that are defined as "complex" for the purpose of the Fog Index.
-
#report
Return a nicely formatted report on the sample, showing most the useful statistics about the text sample.
- #sentences : Array(String)
-
#syllables_per_word
The average number of syllables per word.
- #text : String
-
#unique_words
An array containing each unique word used in the text sample.
- #words : Array(String)
-
#words_per_sentence
The average number of words per sentence.
Constructor Detail
The constructor accepts the text to be analysed, and returns a report object which gives access to the
Instance Method Detail
Flesch reading ease of the text sample. A higher score indicates text that is easier to read. The score is on a 100-point scale, and a score of 60-70 is regarded as optimal for ordinary text.
The Gunning Fog Index of the text sample. The index indicates the number of years of formal education that a reader of average intelligence would need to comprehend the text. A higher score indicates harder text; a value of around 12 is indicated as ideal for ordinary text.
Flesch-Kincaid level of the text sample. This measure scores text based on the American school grade system; a score of 7.0 would indicate that the text is readable by a seventh grader. A score of 7.0 to 8.0 is regarded as optimal for ordinary text.
The number of paragraphs in the sample. A paragraph is defined as a newline followed by one or more empty or whitespace-only lines.
The number of sentences in the sample. The meaning of a "sentence" is defined by Cadmium::Util::Sentence.
The total number of syllables in the text sample. Just for completeness.
The percentage of words that are defined as "complex" for the purpose of the Fog Index. This is non-hyphenated words of three or more syllabes.
Return a nicely formatted report on the sample, showing most the useful statistics about the text sample.
The average number of syllables per word. The syllable count is performed by Cadmium::Util::Syllable, and so may not be completely accurate, especially if the Carnegie-Mellon Pronouncing Dictionary is not installed.


VoteSUp
Bite the doughnut, change your Standup time!
DevOps - CICD demo
VoteSUp - Current Tally for StandUp Times
-1
N/A
-1
N/A
-1
N/A
VoteSUp Version


--- layout: default --- {% assign _talks = site.events | where_exp:'event','event.speakers contains page.slug' %} {% include fn-next.jk pages=_talks %} {% assign _next_talk = result | first %}


melonJS 2
A fresh, modern & lightweight HTML5 game engine
melonJS 2 is a modern version of the melonJS game engine that was first released in 2011. It has been rebuilt entirely using ES6 class, inheritance and semantic, and bundled using Rollup to provide modern features such as transpiling and tree-shaking.
Note: migrating an existing project to melonJS 2 (version 10.0 and higher) will definitely break your game (ES6 semantic and inheritance, nodeJS event emitter, and no backward compatibility with deprecated legacy APIs), and you might want to read first this small step by step guide on upgrading to melonJS 2. If you are looking at the legacy version (9.x and lower) of melonJS, you can find it here under the legacy branch.
melonJS is open-source, licensed under the MIT License, and actively developed and maintained with the help of a small team of enthusiasts at AltByte in Singapore.
About melonJS
melonJS is a fully featured game engine :
Compatibility
- Standalone library (does not rely on anything else, except a HTML5 capable browser)
- Compatible with all major browsers (Chrome, Safari, Firefox, Opera, Edge) and mobile devices
Graphics
- 2D sprite-based graphic engine
- Blazing Fast WebGL renderer for desktop and mobile devices with fallback to Canvas rendering
- High DPI resolution & Canvas advanced auto scaling
- Sprite with 9-slice scaling option, and animation management
- built-in effects such as tinting and masking
- Standard spritesheet, single and multiple Packed Textures support
- System & Bitmap Text
Sound
- Web Audio support with spatial audio or stereo panning based on Howler
- fallback to Multi-channel HTML5 audio for legacy browsers
Physic
- Polygon (SAT) based collision algorithm for accurate detection and response
- Fast Broad-phase collision detection using spatial partitioning
- Collision filtering for optimized automatic collision detection
Input
- Mouse and Touch device support (with mouse emulation)
- Device motion & accelerometer support
Level Editor
- Tiled map format version +1.0 built-in support for easy level design
- Uncompressed and compressed Plain, Base64, CSV and JSON encoded XML tilemap loading
- Orthogonal, Isometric and Hexagonal maps (both normal and staggered)
- Multiple layers (multiple background/foreground, collision and Image layers)
- Animated and multiple Tileset support
- Tileset transparency settings
- Layers alpha and tinting settings
- Rectangle, Ellipse, Polygon and Polyline objects support
- Tiled Objects
- Flipped & rotated Tiles
- Dynamic Layer and Object/Group ordering
- Dynamic Entity loading
- Shape based Tile collision support
Assets
- Asynchronous asset loading
- A fully customizable preloader
And Also
- A state manager (to easily manage loading, menu, options, in-game state)
- Tween Effects, Transition effects
- Pooling support for object recycling
- Basic Particle System
- nodeJS EventEmitter based event system
Tools integration
melonJS is supporting the below tools and frameworks natively or through our official plugin(s) :
Tools integration and usage with melonJS is documented in our Wiki.
Using melonJS
For your first time using melonJS, this is where you start
You may find it useful to skim the overview found at the wiki Details & Usage
When starting your own projects, checkout our ES6 x Webpack boilerplate or the TypeScript x Vite boilerplate
Demos
A few demos of melonJS capabilities :
- Platformer Demo (source)
- Isometric Demo (source)
- Sprite Demo (source)
- Masking Demo (source) (WARNING: may potentially trigger seizures for people with photosensitive epilepsy)
- Primitive Drawing Demo (source)
- UI Demo (source)
- Tiled Map Loader Demo (source)
More examples are available here
Basic Hello World Example
import * as me from "https://esm.run/melonjs";
me.device.onReady(function () {
// initialize the display canvas once the device/browser is ready
if (!me.video.init(1218, 562, {parent : "screen", scale : "auto"})) {
alert("Your browser does not support HTML5 canvas.");
return;
}
// set a gray background color
me.game.world.backgroundColor.parseCSS("#202020");
// add a font text display object
me.game.world.addChild(new me.Text(609, 281, {
font: "Arial",
size: 160,
fillStyle: "#FFFFFF",
textBaseline : "middle",
textAlign : "center",
text : "Hello World !"
}));
});
Simple hello world using melonJS 2 (version 10.x or higher)
Documentation
To enable an offline version of the documentation, navigate to the settings page and enable offline storage
:
Plugins
melonJS provide a plugin system allowing to extend the engine capabilities.
Here is the list of official plugins maintained by the melonJS team:
- debug-plugin - a debug panel for inspecting game objects
- tiled-inflate-plugin - enable loading and parsing of zlib and gzip compressed Tiled maps
- spine-plugin - Spine runtime integration to render Spine skeletal animations
If you wish to develop your own plugin, we also provide a plugin template to help you get started.
Download melonJS
The latest builds with corresponding release note are available for direct download here.
melonJS 2 now only provides an ES6 Bundle :
| build | description |
|---|---|
melonjs.module.js |
the ES6 Module (ESM) Bundle |
melonjs.mjs |
a tree-shakeable ES6 Module Directory |
types/index.d.ts |
typescript declaration files for the ES6 Module (ESM) Bundle |
Note: if you need your application to be compatible with ES5, refer to our boilerplate that provides automatic transpiling to ES5.
The latest version of melonJS can be installed through NPM :
$ npm install melonjs
And then import melonjs in your project using :
$ import * as me from 'melonjs';
Or it can simply be added to your html, using jsDeliver content delivery network (CDN) :
<!-- load the ES6 module bundle of melonJS v10.0 -->
<script type="module"<EMAIL_ADDRESS><!-- omit the version completely to get the latest one -->
<!-- you should NOT use this in production -->
<script type="module" src="https://esm.run/melonjs"></script>
Note: starting from the 10.0.0 version, the debug plugin is no longer provided as part of the melonJS library release, and has been moved to the official boilerplate
Contributing
For most users, all you probably want is to use melonJS, and all you need then is just to download the latest built release to get started.
If you want to start to be part and contribute to the project, make sure to read our Contributing Guide before starting submitting changes or new features.
Contributors
Sponsors
Support the development of melonJS by becoming a sponsor.  Any level of support is really appreciated and goes a long way !