text:
# R2D2

[![CircleCI](https://circleci.com/gh/evgeniy28/r2d2.svg?style=svg)](https://circleci.com/gh/evgeniy28/r2d2)

R2D2 is a Ruby library for decrypting Google Pay and Android Pay payment tokens.

## Ruby support

Currently, Ruby v2.2 or later is supported.

## Install

Add to your `Gemfile`:

```ruby
gem 'r2d2', git: 'https://github.com/spreedly/r2d2.git'
```

## Google Pay Usage

For Google Pay, R2D2 requires the token values in the form of a JSON hash, your `recipient_id`, Google's `verification_keys`
for the appropriate environment, and your private key.

Example Google Pay token values:

```json
{
  "signature": "MEYCIQD5mAtwoptfXuDnEVvtSbPmRnkw94GXEHjog24SfIe4rAIhAKLeSY4xcHLK1liBoZFaeZG+FrqawI7Id2mJXwddP3KH",
  "protocolVersion": "ECv1",
  "signedMessage": "{\"encryptedMessage\":\"jzo38/Ufbt9qh/scrTJmG9v8Cgb7Y5S+zCTTbSou/NoLoE/XF9ixyIGNIspKkH4ulwwVX0/EoqKDKk86XDLw8qBjx1tfHefbLuhZbqkfu/8bs5D6QMz8LjcJU+EeXYcdZ+KeQ3jzrgS6B9CqEJJIF+PeySMJtTwF9Fh+X2sW4Yg0C34mHz0MHpVUpmzJZblTwzMkCVOdq7eMF9Ywb8kDnRFasMYALbRaEOMg2o9gXSfGEVPhS8ors4SRFcnLoVPfktHRJtY/UZEREJvGFY/s/wpmU9sRADYTMKQ/ChTMumT+1NG0r4XibDcaZjW/Wlz1Dwog+dNMYUblPjY613sBLtjoBbRDYYVuDn/TUYXOJwAgXoHFfMmvWm0ne0n9eXggxoaMFFgF5zXk9ZLl3FyH/hi3WWtsFt5sqQWgFdjsqTriL6i46m46hMaZ9gKZ8JQE912IG5kZts5L8XSMiG94Z3UiTA\\u003d\\u003d\",\"ephemeralPublicKey\":\"BIeq42AvLcEhz0oLmYdj++oBTS5PD131FAEgx4y91cwqbkZMUKADkzj2bD4MxneqgqFYirO29+y/G6YH9zmfjlk\\u003d\",\"tag\":\"sRILsawzbm53+9tVTh9ooBP5ivzxWki73UJbuOZ3IYY\\u003d\"}"
}
```

The `recipient_id` will be given to you by Google. Example: `merchant:12345678901234567890` or `gateway:gateway_name`.

The `verification_keys` must be fetched from Google's servers for the appropriate environment:
- production: https://payments.developers.google.com/paymentmethodtoken/keys.json
- test: https://payments.developers.google.com/paymentmethodtoken/test/keys.json

It's a good idea to cache these keys for performance and resiliency. The `Cache-Control: max-age` directive must be
respected to expire the cache. To prevent decryption failures by expiring caches, it's recommended by Google's
[Tink](https://github.com/google/tink) reference library to pro-actively refresh the cache after half of the `max-age`
duration has passed.

The JSON must be parsed into a Ruby hash before being passed to R2D2. Example:

```ruby
{
  "keys" =>
    [
      {
        "keyValue" => "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEIsFro6K+IUxRr4yFTOTO+kFCCEvHo7B9IOMLxah6c977oFzX/beObH4a9OfosMHmft3JJZ6B3xpjIb8kduK4/A==",
        "protocolVersion" => "ECv1"
      }
    ]
}
```

```ruby
require 'r2d2'

# token_attrs = Google Pay token values { "signature": "...", "protocolVersion": "...", ...}
token = R2D2.build_token(token_attrs, recipient_id: recipient_id, verification_keys: verification_keys)

private_key_pem = File.read('private_key.pem')
decrypted_json = token.decrypt(private_key_pem)

JSON.parse(decrypted_json)
# =>
{
  "gatewayMerchantId" => "exampleGatewayMerchantId",
  "messageExpiration" => "1528716120231",
  "messageId" => "AH2EjtcpVGS3JvxlTP5kUbx3h0Laa30uVKjB9CqmnYiw8gZ-tpsxIoOdTbAU_DtCbkLVUPzkFeeqSbU1vTbAIAE4LlPHJqBiMMF4hZ5KRafml3764_6lK7aH7cQkIma40CI-rtCWTLCk",
  "paymentMethod" => "CARD",
  "paymentMethodDetails" =>
  {
    "expirationYear" => 2023,
    "expirationMonth" => 12,
    "pan" => "4111111111111111"
  }
}
```

## Android Pay Usage

R2D2 takes input in the form of the hash of Android Pay token values:

```json
{
  "encryptedMessage": "ZW5jcnlwdGVkTWVzc2FnZQ==",
  "ephemeralPublicKey": "ZXBoZW1lcmFsUHVibGljS2V5",
  "tag": "c2lnbmF0dXJl"
}
```

and the merchant's private key (which is managed by a third-party such as a gateway or independent processor like [Spreedly](https://spreedly.com)).

```ruby
require 'r2d2'

# token_json = raw token string you get from Android Pay { "encryptedMessage": "...", "tag": "...", ...}
token = R2D2.build_token(token_attrs)

private_key_pem = File.read('private_key.pem')
decrypted_json = token.decrypt(private_key_pem)

JSON.parse(decrypted_json)
# =>
{
  “dpan”: “4444444444444444”,
  “expirationMonth”: 10,
  “expirationYear”: 2015 ,
  “authMethod”: “3DS”,
  “3dsCryptogram”: “AAAAAA...”,
  “3dsEciIndicator”: “eci indicator”
}
```

## Performance

The library implements a constant time comparison algorithm for preventing timing attacks. The default pure ruby implementation is quite inefficient, but portable. If performance is a priority for you, you can use a faster comparison algorithm provided by the [fast_secure_compare](https://github.com/daxtens/fast_secure_compare).

To enable `FastSecureCompare` in your environment, add the following to your Gemfile:

```ruby
gem 'fast_secure_compare'
```

and require the extension in your application prior to loading r2d2:

```ruby
require 'fast_secure_compare/fast_secure_compare'
require 'r2d2'
```

Benchmarks illustrating the overhead of the pure Ruby version:

```
                          user     system      total        real
secure_compare        1.070000   0.010000   1.080000 (  1.231714)
fast secure_compare   0.050000   0.000000   0.050000 (  0.049753)
```

## Testing

```session
$ bundle exec rake
...
5 tests, 18 assertions, 0 failures, 0 errors, 0 skips
```

## Releasing

To cut a new gem:

### Setup RubyGems account

Make sure you have a [RubyGems account](https://rubygems.org) and have setup your local gem credentials with something like this:

```bash
$ curl -u rwdaigle https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials
<enter rubygems account password>
```

If you are not yet listed as a gem owner, you will need to [request access](https://github.com/rwdaigle) from @rwdaigle.

### Release

Build and release the gem with (all changes should be committed and pushed to Github):

```bash
$ rake release
```

## Changelog

### v1.0.0

* Breaking Changes: API now decrypts both Google Pay and Android Pay tokens
* New method call to decrypt Android Pay tokens
* Additional arguments included for Google Pay tokens
* Update README.md

### v0.1.2

* Setup CircleCI for more exhaustive Ruby version compatibility tests
* Add gem release instructions

## Contributors

* [mrezentes](https://github.com/mrezentes)
* [rwdaigle](https://github.com/rwdaigle)
* [methodmissing](https://github.com/methodmissing)
* [bdewater](https://github.com/bdewater)
* [deedeelavinder](https://github.com/deedeelavinder)


text:
# passport-cert-parser

Parse the e-passport CA certificate list

### How to Work

- Download `icaopkd-001-dsccrl-xxx.ldif` and `icaopkd-002-ml-xxx.ldif` from [ICAO](https://download.pkd.icao.int/download)

- Put the files to `/docs/ldif`

- Edit `MASTER_LIST_FILE_NAME` and `CRL_FILE_NAME` of [Config](https://github.com/duanyytop/passport-cert-parser/blob/main/src/main/java/dev/gw/Config.java) with the files' name

- Run the below command

```
./gradlew run   // gradle run
```

license: MIT

repository: duanyytop/passport-cert-parser

branch_name: refs/heads/main

extension: md

license_type: permissive

repo_name: duanyytop/passport-cert-parser


text:
# octokit.js [![Build Status](https://travis-ci.org/philschatz/octokit.js.png)](https://travis-ci.org/philschatz/octokit.js)

octokit.js provides a minimal higher-level wrapper around git's [plumbing commands](http://git-scm.com/book/en/Git-Internals-Plumbing-and-Porcelain),
exposing an API for manipulating GitHub repositories, users, groups, and gists.
It is being developed in the context of [github-bookeditor](https://github.com/oerpub/github-bookeditor), an EPUB3 editor for GitHub.

This package can also be used in `nodejs` or as an AMD module in the browser.

## Key Features

- Works in `nodejs`, an AMD module in the browser, and as a [bower](https://github.com/bower/bower) library
- Simple `read` and `write` methods for text _and_ binary files
- Creating gists, Pull Requests, forks, and new Repositories
- `ETag` Caching
- Promises instead of callbacks (for better error-handling and progress updating)
- Progress Notifications for multistep operations
- Starring and Following repositories, users, and organizations
- Editing Team and Organization Membership
- User/Org/Repo events and notifications
- Listeners for rate limit changes
- Public Keys
- Hooks (commit, comment, etc)

## Usage

All asynchronous methods return a [Common-JS Promise](http://wiki.commonjs.org/wiki/Promises/A).

### In a browser without requirejs

Create an Octokit instance.

```js
var gh = new Octokit({
  username: "USER_NAME",
  password: "PASSWORD"
});
```

Or if you prefer OAuth, it looks like this:

```js
var gh = new Octokit({
  token: "OAUTH_TOKEN"
});
```

### In a browser using requirejs

```js
define(['octokit'], function(Octokit) {
  var gh = new Octokit({
    username: "YOU_USER",
    password: "YOUR_PASSWORD"
  });
});
```

### In NodeJS

Install instructions:

    npm install octokit --save

```js
var Octokit = require('octokit');
var gh = Octokit.new({
  username: "YOU_USER",
  password: "YOUR_PASSWORD"
});
```

### Using Generators in NodeJS 0.11 (or EcmaScript 6 browsers)

This requires NodeJS 0.11 with the `--harmony-generators` flag:

```js
var co = require('co');
var Octokit = require('octokit');
var gh = Octokit.new();

var fn = function *() {
  var zen  = yield gh.getZen();
  var info = yield gh.getRepo('philschatz', 'octokit.js').getInfo();

  console.log(zen);
  console.log(info);
};

co(fn)();
```

### Using bower

This file can be included using the bower package manager:

    bower install octokit --save

## Development

Mocha tests are run on NodeJS by running `npm test`. Mocha tests in the browser and code coverage are run by going to [./test/index.html](http://philschatz.github.io/octokit.js/test).

## Repository API

```js
var repo = gh.getRepo(username, reponame);
```

Show repository information

```js
repo.getInfo()
.then(function(repo) {})
```

List all branches in a Repository

```js
repo.getBranches()
.then(function(branches) {});
```

Fork a repository

```js
repo.fork()
.then(function() {});
```

Create a Pull Request

```js
repo.createPullRequest()
.then(function() {});
```

Get recent commits to the repository

```js
var options = {};
repo.getCommits(options)
.then(function(commits) {});
```

List Repository events

```js
repo.getEvents()
.then(function(events) {});
```

List Issue events for the repository

```js
repo.getIssueEvents()
.then(function(events) {});
```

List events for a network of Repositories

```js
repo.getNetworkEvents()
.then(function(events) {});
```

List unread notifications for authenticated user pertaining to this repository

```js
var options = {};
repo.getNotifications(options)
.then(function(events) {});
```

Get programming language counts (CoffeeScript, Ruby, Shell)

```js
repo.getLanguages()
.then(function(events) {});
```

Get releases
```js
repo.getReleases()
.then(function(releases) {});
```

### Branch API

Additional methods are available for a specific branch in a repository

Get the Default branch of a repository

```js
var branch = repo.getBranch();
```

Get a specific branch of a repository

```js
var branch = repo.getBranch("BRANCH_NAME");
```

Read a file from the branch

```js
var isBinary = false;
branch.read('PATH/TO/FILE.txt', isBinary)
.then(function(contents) {})
```

Remove a file from the branch

```js
var message = "OPTIONAL COMMIT MESSAGE";
branch.remove('PATH/TO/FILE.txt', message)
.then(function() {});
```

Read the contents (raw) of a file or directory

```js
branch.contents('DIRECTORY/PATH')
.then(function(contents) {});
```

or

```js
branch.contents('DIRECTORY/PATH/FILE.txt')
.then(function(contents) {});
```

Move a file

```js
var message = "OPTIONAL COMMIT MESSAGE";
branch.move('PATH/TO/FILE.txt', 'NEW/PATH/TO/FILE.txt', message)
.then(function() {});
```

Write a file (update or add)

```js
var content = "Contents of the file";
var message = "OPTIONAL COMMIT MESSAGE";
var isBinary = false;
branch.write('PATH/TO/FILE.txt', content, message, isBinary)
.then(function() {});
```

Write multiple files (update or add) in one commit

```js
var contents = {
  "FILE1.txt": "Contents of the file",
  "FILE2.txt": {isBase64: true, content: "BASE_64_ENCODED_STRING"}
}
branch.writeMany(contents, message)
.then(function() {});
```

Get recent commits to a branch

```js
var options = {};
branch.getCommits(options)
.then(function(commits) {});
```

Create a new branch

```js
branch.createBranch("new-branch-name")
.then(function() {});
```

### Low-level Repo API

The methods on a branch or repo use the following low-level methods.

```js
repo.git.getRef(...)      .then(function(result) {});
repo.git.createRef(...)   .then(function(result) {});
repo.git.deleteRef(...)   .then(function(result) {});
repo.git.getBranches()    .then(function(result) {});
repo.git.getBlob(...)     .then(function(result) {});
repo.git.getSha(...)      .then(function(result) {});
repo.git.getTree(...)     .then(function(result) {});
repo.git.postBlob(...)    .then(function(result) {});
repo.git.updateTree(...)  .then(function(result) {});
repo.git.postTree(...)    .then(function(result) {});
repo.git.commit(...)      .then(function(result) {});
repo.git.updateHead(...)  .then(function(result) {});
repo.git.getCommits(...)  .then(function(result) {});
```

## User API

```js
var user = gh.getUser(GITHUB_USERNAME);
```

Show user information for a particular user. Also works for organizations.

```js
user.getInfo()
.then(function(user) {})
```

List public repositories for a particular user.
_options described [here](http://developer.github.com/v3/repos/#list-user-repositories)_

```js
user.getRepos(type='all', sort='pushed', direction='desc')
.then(function(repos) {});
```

List organizations the user is in.

```js
user.getOrgs()
.then(function(orgs) {});
```

List all gists of a particular user.

```js
user.getGists()
.then(function(gists) {});
```

List users following this user.

```js
user.getFollowers()
.then(function(users) {});
```

List users this user is following.

```js
user.getFollowing()
.then(function(users) {});
```

Get Received events for this user.

```js
user.getReceivedEvents()
.then(function(events) {});
```

Get all events for this user.

```js
user.getEvents()
.then(function(events) {});
```

## Authenticated User API

The Authenticated User contains the following methods in addition to all the methods in the **User API**.

Get the authenticated user.

```js
var user = gh.getUser();
```

List unread notifications for the user.

```js
gh.getNotifications()
.then(function(notifications) {})
```

List private and public repositories of the current authenticated user.

```js
user.getRepos()
.then(function(repos) {});
```

Follow another user.

```js
user.follow("OTHER_USERNAME")
.then(function(orgs) {});
```

Stop following another user.

```js
user.unfollow("OTHER_USERNAME")
.then(function(orgs) {});
```

## Gist API

```js
var gist = gh.getGist(3165654);
```

Read the contents of a Gist.

```js
gist.read()
.then(function(gist) {});
```

Update the contents of a Gist. Please consult the documentation on [GitHub](http://developer.github.com/v3/gists/).

```js
var delta = {
  "description": "the description for this gist",
  "files": {
    "file1.txt": {
      "content": "updated file contents"
    },
    "old_name.txt": {
      "filename": "new_name.txt",
      "content": "modified contents"
    },
    "new_file.txt": {
      "content": "a new file"
    },
    "delete_this_file.txt": null
  }
};

gist.update(delta)
.then(function(gist) {});
```

Create a Gist

```js
var files = {
  'file1.txt': {content: 'String file contents'}
};

gh.getGist().create(files)
.then(function(gist) {});
```

Delete the Gist

```js
gist.delete()
.then(function(gist) {});
```

Fork the Gist

```js
gist.fork()
.then(function(gist) {});
```

Star the Gist

```js
gist.star()
.then(function() {});
```

Unstar the Gist

```js
gist.unstar()
.then(function() {});
```

Check if the Gist is starred

```js
gist.isStarred()
.then(function() {});
```

## Miscellaneous methods

Retreive a zen message (to test the API works).

```js
gh.getZen()
.then(function(msg) {});
```

Add a listener for `rateLimit` changes

```js
function listener(rateLimitRemaining, rateLimit, method, path, data, raw, isBase64) {
  // ...
};
gh.onRateLimitChanged(listener);
```

List repositories for a particular organization. Includes private repositories if you are authorized.

```js
gh.getOrgRepos(orgname)
.then(function(repos) {});
```

## Progress Notifications

For multistep operations users can listen to updates by registering a listener at `promise.progress(function(obj) {})`.

## Setup

`octokit.js` has the following dependencies when used in a browser:

- A Promise API (supports jQuery, AngularJS, or a Promise Polyfill)

If you are already using [jQuery](https://api.jquery.com/jQuery.Deferred/) or [AngularJS](https://docs.angularjs.org/api/ng/service/$q) in your project just be sure to include them before octokit and it will
use their Promise API.

Otherwise, you can include a Promise polyfill like [jakearchibald/es6-promise](https://github.com/jakearchibald/es6-promise):

```
<script src="./node_modules/es6-promise/dist/promise-0.1.1.js"></script>
<script src="./octokit.js">
```

## Change Log

### 0.7.X

Switched to a native `request` implementation (thanks @mattpass). Adds support for GitHub gists, forks and pull requests.

### 0.6.X

Adds support for organizations and fixes an encoding issue.

### 0.5.X

Smart caching of latest commit sha.

### 0.4.X

Added support for [OAuth](http://developer.github.com/v3/oauth/).

### 0.3.X

Support for Moving and removing files.

### 0.2.X

Consider commit messages.

### 0.1.X

Initial version.

repository: alfredo-pozo/DynamoDictionary

branch_name: refs/heads/master

gha_language: JavaScript

repo_name: alfredo-pozo/DynamoDictionary


text:
Kali-Linux(LXDE)-Docker image with VNC
=========================

Docker image with **HTML5** VNC interface access to Kali-Linux container LXDE desktop environment.

Quick Start
-------------------------
This Kali Linux Docker image provides a minimal base install of the latest version of the Kali Linux Rolling Distribution.
There are no tools added to this image, so you will need to install them yourself. For details about Kali Linux metapackages,
check https://www.kali.org/news/kali-linux-metapackages/

Before building, check the Dockerfile to uncomment or add needed Kali Linux Metapackages

Build the image
```
docker build -t kali-docker .
```

Run the docker image and open port `6080`

```
docker run -it -d --rm --name kali-docker -p 6080:80 kali-docker
```

Browse http://<IP_ADDRESS>:6080/

Connect with VNC Viewer and protect by VNC Password
------------------

Forward VNC service port 5900 to host by

```
docker run -it --rm -p 6080:80 -p 5900:5900 kali-docker
```

Now, open the vnc viewer and connect to port 5900. If you would like to protect vnc service by password, set environment variable `VNC_PASSWORD`, for example

```
docker run -it --rm -p 6080:80 -p 5900:5900 -e VNC_PASSWORD=mypassword kali-docker
```

A prompt will ask password either in the browser or vnc viewer.

To get into bash of the running container
```
sudo docker exec -i -t kali-docker /bin/bash
```

P.S. If you are going to run container in cloud virtual machine, first run the bellow command to virtual machine in cloud to create ssh tunnel
to your virtual machine
```
ssh -i .ssh/private_key -L 6080:localhost:6080 -L 5900:localhost:5900 user@IP
```

repository: nikoskontothanasis/kali-linux-docker

repo_name: nikoskontothanasis/kali-linux-docker


text:
Tutorial
---------
Pipelines, often called pipes, is a way to chain commands and connect output from one command to the input of the next.
A pipeline is represented by the pipe character: ``|``. It's particularly handy when a complex or long input is required for a command.

    command1 | command2

By default pipelines redirects only the standard output, if you want to include the standard error you need to use the form ``|&`` which is a short hand for ``2>&1 |``.

### Example:
Imagine you quickly want to know the number of entries in a directory, you can use a pipe to redirect the output of the ``ls`` command to the ``wc`` command with option ``-l``.

    ls / | wc -l

Then you want to see only the first 10 results

    ls / | head
*Note: head outputs the first 10 lines by default, use option -n to change this behavior*

Exercise
--------
In this exercise, you will need to print the number of processors based on the information in the cpuinfo file (/proc/cpuinfo)

*Hint: each processor has a unique number, for instance the first processor will contain the line ``processor: 0``*

Tutorial Code
-------------
    cat /proc/cpuinfo # | some command

Expected Output
---------------
    4

Solution
--------
    #!/bin/bash
    cat /proc/cpuinfo | grep processor | wc -l

repository: moujahedk/interactive-tutorials

repo_name: moujahedk/interactive-tutorials


text:
---
uid: UsersManualDelegatesInSdk
summary: *content
---

<!-- Copyright 2021 Yubico AB

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. -->

# Delegates (callbacks) in the SDK

There are a number of places in the SDK where the developer must supply a `delegate`,
the C# version of a `callback`. This page discusses what they are, and how to write your
own.

## A callback

A callback is simply a function you provide the SDK. In turn, the SDK will call that
function when it needs to do some work that only your application can do. The easiest way
to illustrate this is with an example: the PIN collector.

Suppose you are building a PIV application, and want to sign some data. That operation
requires the PIN to be verified (it is possible to turn off the PIN requirement, but for
now, let's just look at the case where the PIN is required). In order to verify the PIN,
the SDK, of course, needs the PIN. How should that be provided?

While it is possible to simply require the caller enter the PIN as a byte array, the SDK
requires a PIN-collecting function. In this way, when the SDK needs the PIN, it will call
this function, use the PIN it collects, then release it. Following this pattern, the PIN
appears in memory the least amount of time (see the User's Manual entry on
[sensitive data](sensitive-data.md)).

The SDK does not have a PIN-collecting class or method. That's because how your
application collects the PIN is up to you. Maybe you collect it at the command line, maybe
you launch a new Window, or have a "sub-window" of the main window. Maybe you collect it
once at the beginning and simply keep it in a buffer somewhere (not recommended).

When the sign operation needs the PIN, it will call a PIN-collecting function. But because
there is no such method in the SDK, it will be your responsibility to provide one.

## The PIN-collecting callback

The PIN-collecting callback is defined as follows.

```
    public Func<KeyEntryData, bool>? KeyCollector
```

Notice that it is called `KeyCollector`, because it collects PINs, PUKs, management keys,
passwords, and any other sensitive data. The term `Key` is used as a general term and to
highlight the fact that this collects sensitive data.

You must provide a method with this signature.

```
   public bool PinCollectingFunction(KeyEntryData keyEntryData);
```

### The [KeyEntryData](xref:Yubico.YubiKey.KeyEntryData)

This is an object that contains information about the request. One property is a `Request`
that describes what the SDK wants the delegate to do.

One possible value of `Request` is `KeyEntryRequest.Release`. This is how the SDK tells
the delegate that it has used the PIN (or key or whatever was requested), and your code
can release any resources. At this point, the delegate will likely overwrite sensitive
data, close handles, and so on.

Note that the `KeyCollector` delegate MUST NOT throw an exception when the request is
`Release`. Most `KeyCollector` delegates will likely be written to never throw an
exception in any situation (just return `false` if something goes wrong), but it is
vitally important that it never throw an exception when the request is `Release`. The
`Release` is called from inside a `finally` block, and it is a bad idea to throw
exceptions from inside `finally`.

Inside the `KeyEntryData` class is also a property `IsRetry`. If true, this indicates that
a PIN (or key or whatever) that was returned the last call, did not succeed, and the user
needs to try again. The class also contains an `int` reporting the number of retries
remaining. This property is nullable so that if there is no count, it is null, and if
there is one, it contains the number of retries remaining before the element is blocked.

### The return

The `KeyCollector` returns a boolean. `False` means "cancel" (`true` means success or
"don't cancel"). If the SDK calls the `KeyCollector` and it returns `false`, it will stop
the operation it is performing and return.

For example, suppose your application calls on the SDK to perform a sign operation. The
SDK discovers that it needs the PIN, so calls the `KeyCollector`. The user enters a PIN,
the `KeyCollector` returns that value (in the `KeyEntryRequest` object) and returns
`true`. The SDK tries to verify the PIN, but learns it is not the correct value. The SDK
now calls the `KeyCollector` again, till indicating that it is asking for the PIN, but
for this attempt `IsRetry` is `true`. The SDK also passes on the remaining tries count.

At this point, your application creates a new window informing the user that the PIN
entered was incorrect and there are "x" number of retries remaining before the PIN is
blocked. The user has the option of cancelling the request. If the user cancels the
request, your `KeyCollector` function will return `false`.

### Example

Your application might do something such as this.

```
    // This class contains methods and data necessary to collect a PIN.
    class PinCollectionInfo
    {
        public WindowHandle Handle { get; set; }
        public UserInformation UserInfo { get; set; }

        private WindowInfo _windowInfo;

        public bool PinCollector(KeyEntryData keyEntryData);
    }

    // Now in the code that is calling the SDK:
    var pinInfo = new PinCollectionInfo()
    {
        Handle = someHandle,
        UserInfo = currentUserInfo,
    }

    using var pivSession = new PivSession(yubiKey)
    {
        KeyCollector = pinInfo.PinCollector,
    }
```

### One or two values

The `KeyCollector` will be called upon to collect either a single value, or two values. A
single value is requested when the SDK needs a PIN or key to verify, and it needs two
values when it is changing a PIN or other element. It needs the current value and a new
value.

### Inside the KeyCollector

The SDK is going to call your delegate when it needs the PIN (or PUK, or management key,
or some other user-supplied secret). When it does, it will pass to you a `KeyEntryData`
object. For example, see the
[PivSession's `KeyCollector`](xref:Yubico.YubiKey.Piv.PivSession.KeyCollector%2a).

The delegate you write will read the `KeyEntryData` to determine what the SDK is
requesting.

```
    switch (keyEntryData.Request)
    {
        default:
            return false;

        case KeyEntryRequest.Release:
            OverwriteBuffers();
            ReleaseResources();
            break;

        case KeyEntryRequest.VerifyPivPin:
            SetWindowVerifyPin(_windowInfo);
            break;

        case KeyEntryRequest.ChangePivPin:
            SetWindowChangePin(_windowInfo);
            break;

         . . .
    }

    WindowProcess.CollectKeyData(Handle, _windowInfo);
```

When your code has the value, it will call the `KeyEntryData.SubmitValue` or
`KeyEntryData.SubmitValues` method to load the value or values (two values whn changing
the PIN or key) into the `KeyEntryData` object. The input is a `ReadOnlyMemory<byte>`, but
passing a `byte[]` will work (it is automatically cast to the `ReadOnlyMemory<byte>`). The
SDK will be able to read the value or values, but will not be able to alter your buffer.
Furthermore, the `KeyEntryData` object will make a copy of the data (it won't simply copy
a reference to your buffer). It will be your responsibility to overwrite that buffer when
it is no longer needed.

When the SDK is done with the key collection process, it will call the delegate with the
`Request` of `KeyEntryRequest.Release`. Remember, your delegate must never throw an
exception if the request is `Release`.

Note that in this example, the `KeyCollector` needed a `Handle` and `UserInfo`. Your
collecting method might need something in order to work. Maybe it is a window handle,
because your PIN-collector will launch a window with a message and text-entry box. Or
maybe it is a database handle, or something else. It is whatever your PIN-collecting
function will need.

The delegate you supply must have access to that data. In the example, the collecting
method was an instance method of a class that held the necessary data.

The process is

* create a class that holds the information needed, along with a method that collects the
PIN. This method has the same signature as the delegate.
* In the application, create an instance of that class and set it with the needed data.
* Pass the PIN-collecting instance method as the delegate.


text:
# Introduction

Dojo's **middleware** system provides a way to manage asynchronous or imperative APIs in a reactive way, as well as influence behavior and the property API of any composing function-based widgets or other middleware.

Several core and optional middleware are provided by the framework, however, application developers can easily write their own.

| Feature                                        | Description                                                                                |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Reactive DOM access**                        | Via middleware, function-based widgets can work with concrete information and APIs from the sections of the DOM corresponding to their output nodes.                                                                                |
| **Widget render lifecycle control**            | Middleware can control the portions of Dojo's rendering pipeline for any composing widgets, such as invalidating widgets when they require a rendering update. Widget rendering can also be paused and resumed, allowing for short-circuiting of the render output while waiting for critical information to become available. |
| **A variety of framework-provided middleware** | Dojo provides optional middleware that allow widgets to implement a range of functionality such as responding to and controlling focus, simple value caching, responding to element intersection and resize events, CSS theming, internationalization and build-time rendering amongst others.                                 |
| **Easy composition and re-use**                | The middleware design is closely aligned with function-based widgets, allowing consistent composition within a widget hierarchy as well as re-use when developing custom middleware.                                                                                |

## Basic usage

### Creating middleware

-   Defining middleware via the same `create()` primitive used for defining function-based widgets
-   Optionally defining a properties interface that augments the properties interface of widgets that compose the middleware. Property values are given when creating instances of the composing widgets.
-   Returning a simple function reference that defines the middleware's API that other composing widgets or middleware can interact with

> src/middleware/myMiddleware.ts

```ts
import { create } from '@dojo/framework/core/vdom';

const factory = create().properties<{ middlewareProp?: boolean }>();

export const myMiddleware = factory(({ properties }) => {
	return () => {
		return properties().middlewareProp ? 'Conditional is true' : 'Conditional is false';
	};
});

export default myMiddleware;
```

### Composing middleware

-   Combining middleware and returning an object to expose a more complex API
-   Using the core [`invalidator`](/learn/middleware/core-render-middleware#invalidator) middleware to flag the composing widget as requiring re-rendering

> src/middleware/myComposingMiddleware.ts

```ts
import { create, invalidator } from '@dojo/framework/core/vdom';
import myMiddleware from './myMiddleware';

const factory = create({ myMiddleware, invalidator });

export const myComposingMiddleware = factory(({ middleware: { myMiddleware, invalidator } }) => {
	return {
		get() {
			return myMiddleware();
		},
		set() {
			invalidator();
		}
	};
});

export default myComposingMiddleware;
```

### Using middleware within a widget

-   Augmenting the widget's properties interface with additional properties from any middleware used
-   Passing in middleware properties when using widgets that compose them

> src/widgets/MyWidget.tsx

```tsx
import { create, tsx } from '@dojo/framework/core/vdom';
import myComposingMiddleware from '../middleware/myComposingMiddleware';

const factory = create({ myComposingMiddleware });

export default factory(function MyWidget({ properties, middleware: { myComposingMiddleware } }) {
	return (
		<virtual>
			<div>{`Middleware property value: ${properties.middlewareProp}`}</div>
			<div>{`Middleware usage: ${myComposingMiddleware.get()}`}</div>
		</virtual>
	);
});
```

> src/main.tsx

```tsx
import renderer, { tsx } from '@dojo/framework/core/vdom';
import MyWidget from './widgets/MyWidget';

const r = renderer(() => <MyWidget middlewareProp={true} />);
r.mount();
```

repository: dojo/framework

gha_language: TypeScript

gha_license_id: NOASSERTION

repo_name: dojo/framework


text:
# Craterl #

[![Join the chat at https://gitter.im/crate/craterl](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/crate/craterl?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![Build Status](https://travis-ci.org/crate/craterl.svg?branch=master)](https://travis-ci.org/crate/craterl)
![Another Badge](http://img.shields.io/badge/another-badge-green.svg)

Erlang client for crate.

This client is in an alpha state and, though tested very intensively,
not yet verified to be rock-solid in a production environment.

## Compatibility ##

Tested with OTP releases ``R16B``, ``17`` and ``18``.

## Installation

### Rebar 3

Craterl is built using [rebar3](https://github.com/rebar/rebar3),
using it in your project is highly recommended.

Here is how you'd add it to your dependencies.

If you want to load a craterl release from [hex.pm](https://hex.pm/packages/craterl), configure it like so:

```erlang
{deps,[
  {craterl,"0.2.3"}
]}.
```

Or load it directly from github:

```erlang
{deps,[
    {craterl, {git, "git://github.com/crate/craterl.git", {tag, "0.2.3"}}}
]}.
```

### Rebar 2

You can also use craterl in your project using [rebar2](https://github.com/rebar/rebar),
though [rebar3](https://github.com/rebar/rebar3) is recommended.

With rebar2 you need to load craterl from github.

Declare it as a dependency in your ``mix.exs`` file:

```elixir
def deps do
    [{:craterl, "~> 0.2.3"}]
end
```

Or load it directly from github:

```elixir
def deps do
    [{:craterl, git: "git://github.com/crate/craterl.git", tag: "0.2.3"}]
end
```

## Usage ##

Normally you'd start craterl as part of your application's startup, so the
Erlang/OTP application framework will take care of actually starting craterl.

However, if you want to play around with craterl on the erlang or
elixir shell you can start it up with the following convenience method:

```erlang
ok = craterl:start().
```

Having a running ``craterl`` application, the next step is starting a client
instance using a variant of the ```craterl:new()``` function:

```erlang
ClientSpec = {local, my_client}.
Servers = [{<<"localhost">>, 4200}, "localhost:4201"].
Options = [{poolsize, 1000}, {timeout, 5000}].
ClientRef = craterl:new(ClientSpec, Servers, Options).
```

It is possible to create many clients on one erlang node.
```craterl``` client instances are created using a client spec which is
a tuple you would use when registering a process, like ```{local, your_name}```.
The process name, ```your_name``` in this example, must be unique on a node.

### Options ###

The following options can be used to change the behaviour of a newly created craterl client:

* poolname - ```string()``` or ```binary()```, the name of the connection pool, handled by hackney (erlang http client)
* poolsize - ```integer()```, the size of the connection pool, also handled by hackney
* timeout - ```integer()```, the receive and connect timeout for connections to crate servers, in milliseconds
* ssl_options - ```term()```, the same options the erlang ssl module accepts as ```ssloptions()```
* ssl_insecure - ```boolean()```, whether ssl certificates should be validated or not

Example:

```erlang
Options = [
    {poolname, "my_pool"},
    {poolsize, 200}, {timeout, 6000},
    {ssl_insecure, false},
    {ssl_options, [
        {cipers, [{rsa, aes_256_cbc, sha}]},
        {cacerts, MyDerEncodedCaCerts}
    ]}
].
ClientRef = craterl:new({local, craterl}, [{<<"localhost">>, 4200}], Options).
```

See the documentation of the ```craterl``` module for more detailed api documentation.

### SQL ###

Issuing SQL statements using craterl is possible with one of the variants
of ```craterl:sql()```:

```erlang
{ok Response} = craterl:sql("select id, name from sys.cluster").
[[<<"89b8f6bf-4082-415b-937e-7de66b67f6fe">>, <<"crate">>]] = craterl_resp:rows(Response).
[<<"id">>,<<"name">>] = craterl_resp:column_names(Response).

Stmt = <<"select * from user where id in (?, ?, ?)">>.
Args = [1, 2, 3].
{ok, Response2} = craterl:sql(ClientRef, Stmt, Args).
```

For issuing multiple INSERT / DELETE or UPDATE requests with one roundtrip,
the ```craterl:sql_bulk()``` functions can be used:

```erlang
Stmt = <<"insert into t (id, name) values (?, ?)">>.
BulkArgs = [[1, <<"Ford">>], [2, <<"Trillian">>], [3, <<"Zaphod">>]].
{ok, BulkResponse} = craterl:sql_bulk(ClientRef, Stmt, BulkArgs).
BulkResults = craterl_resp:bulk_results(BulkResponse).
[1,1,1] = lists:map(fun craterl_resp:row_count/1, BulkResults).

Stmt2 = <<"update t set new_column=? where id=?">>.
BulkArgs2 = [[<<"funky">>, 1], [<<"shizzle">>, 2], [<<"indeed">>, 3]].
{ok, BulkResponse2} = craterl:sql_bulk(Stmt2, BulkArgs2).
BulkResults2 = craterl_resp:bulk_results(BulkResponse2).
[1,1,1] = lists:map(fun craterl_resp:row_count/1, BulkResults2).

{ok, SelectResponse} = craterl:sql("select * from t").
[[1,<<"Ford">>,<<"funky">>],
 [2,<<"Trillian">>,<<"shizzle">>],
 [3,<<"Zaphod">>,<<"indeed">>]] = craterl_resp:rows(SelectResponse).
```

Every sql api function has a variant that accepts a ```ClientRef``` as first
argument that is an atom referencing a ```craterl``` client that has been
started using a variant ```craterl:new()``` in order to issue your request
against a specific server / cluster.

### Blobs ###

Crate is able to store blobs, files, binary somethings. They can be replicated to
make sure you won't lose data.

Craterl fully supports storing, retrieving and manipulating blobs.

At first a blob table is needed to store blobs into:

```erlang
{ok, SqlResponse} = craterl:sql("create blob table myblobs with (number_of_replicas=1)").
```

It is possible to upload blobs from stuff you have available in ram or from a file:

```erlang
Content = <<"awesome!">>.
{ok, {created, HashDigest}} = craterl:blob_put(<<"myblobs">>, Content).
HashDigest = <<"040f06fd774092478d450774f5ba30c5da78acc8">>.

File = <<"/usr/share/dict/words">>
{ok,{created, WordsHash}} = craterl:blob_put_file(ClientRef, <<"myblobs">>, <<"/usr/share/dict/words">>).
WordsHash = <<"a62edf8685920f7d5a95113020631cdebd18a185">>.
```

You can get blobs to memory or to file. Both methods will make use of chunked HTTP
encoding so you will receive the blob piece by piece and won't load big blobs into memory at once.

```erlang
{ok, GetDataFun} = craterl:blob_get(<<"myblobs">>, WordsHash).
GetDataFun()
{ok,<<"A\na\naa\naal\naalii\naam\nAani\naardvark\naardwolf\nAaron\nAaronic\nAaronical\nAaronite\nAaronitic\nAaru\nAb\naba\nAbabdeh\nA"...>>}
GetDataFun()
{ok,<<"inoposterior\nabdominoscope\nabdominoscopy\nabdominothoracic\nabdominous\nabdominovaginal\nabdominovesical\nabduce\n"...>>}
...
GetDataFun()
{ok, done}

NewWordsFile = <<"/tmp/blobwords">>
{ok, NewWordsFile} = craterl:blob_get_to_file(<<"myblobs">>, WordsHash, NewWordsFile).
file:read_file(NewWordsFile)
{ok,<<"A\na\naa\naal\naalii\naam\nAani\naardvark\naardwolf\nAaron\nAaronic\nAaronical\nAaronite\nAaronitic\nAaru\nAb\naba\nAbabdeh\nA"...>>}
```

Check for existence of blobs:

```erlang
ok = craterl:blob_exists(ClientRef, <<"myblobs">>, WordsHash).
{error, 404} = craterl:blob_exists(craterl, <<"myblobs">>, <<"doesnotexist">>).
```

Delete blobs:

```erlang
ok = craterl:blob_delete(<<"myblobs">>, WordsHash).
{error, 404} = craterl:blob_delete(<<"myblobs">>, WordsHash).
```

Every blob api function, like the sql functions,  has a variant that accepts
a ```ClientRef``` as first argument that is an atom referencing a ```craterl```
client that has been started using a variant of ```craterl:new()```.

## Tests ##

Simply call ```make test``` to run the unit and integration tests for ```craterl```.

## Contributions ##

Are very welcome, be it code, constructive feedback, money, or some motivating words!

repository: yongteak/craterl

repo_name: yongteak/craterl


text:
# CentraLabel
An online, crowd source platform with in-built annotation tools to outsource labelling and annotation to freelancers.

Video Demo Link: https://streamable.com/x024ce

-To look into: https://stackoverflow.com/questions/55227880/how-to-put-a-text-inside-a-rect-using-konva-js

# Roadmap
## Frontend:

 * [ ] Create a public marketplace for labellers to "claim" datasets
 * [ ] Break down labelling UI component into smaller components
 * [ ] General code cleanup/ bug fixes
 * [ ] csv parser to store class labels from csv to database
 * [ ] add admin menu for contractor and contractee to see labelling progress on datasets
 * [ ] Modify UI to be much more aesthetic
 * [ ] Quality of life updates such as viewing upcoming images to annotate

## Backend/Bonus (Long Term):

 * [ ] Look into various few shot labelling techniques
 * [ ] Look into making API with flask to do fewshot image classification with
 already labelled images as training data
 * [ ] Look into creating a payment structure and Integrating Stripe

repository: AditMeh/CentraLabel

gha_language: Vue

gha_license_id: MIT

repo_name: AditMeh/CentraLabel


text:
# Pseudoplanomalina Moullade, Bellier & Tronchetti, 2002 GENUS

#### Status
ACCEPTED

#### According to
Interim Register of Marine and Nonmarine Genera

#### Published in
Cretaceous Res 23 (1), February: 133.

#### Original name
null

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# WARNING
----------

`PLEAE NOTE THIS IS NOT A STABLE RELEASE AND SHOULD ONLY BE USED BY THOSE THAT UNDERSTAND HOW IT WORKS`

---------------------------------------------------------

## Blockstrap - The OpenSource HTML5 Blockchain Framework

The Blockstrap framework provides a front-end HTML5 interface for web-applications to communicate and manipulate blockchains using either external web-accessible APIs or self-hosted local QTs direct from the source.

By default, it is configured to use the [BlockCypher API](http://blocksypher.com) but as well as being a blockchain-agnoistic framework, Blockstrap is also API-neutral throughout. This allows you to host and manage your own API end-points or select from others configured at core, with examples included and ready for use with the following services:

* [BlockCypher](http://blockcypher.com) (Supporting 3 Chains)
* [Toshi](http://toshi.io) (Supporting 2 Chains)
* [BlockTrail](http://blocktrail.com) (Supporting 2 Chains - __read only - no TX relay__)
* __LocalQTs__ (only supported by QTs featuring watch-only addresses - __currently requires manual import of addresses__)

We will also be adding support for the following APIs before officially re-launching:

* [SoChain](http://chain.so) (Can Support 6 Chains? - not yet tested since work continued)
* [BlockR](http://blockr.io) (Can Support 5 Chains? - not yet tested since work continued)
* [Blockchain.info](http://blockchain.info) (requires PHP proxy - work underway)
* [Insight](http://insight.is) (Can Support 2 Chains? - work underway)

The framework itself is currently capable of supporting the following blockchains:

* __Bitcoin__
* __Dash__
* __Dogecoin__
* __Litecoin__
* Bitcoin Testnet
* Litecoin Testnet
* Dash Testnet
* Dogecoin Testnet

The framework has been developed with modularity and flexibility as the focal point of each technical decision.

This has enabled us to provide support for plugins and themes and allows developers to easily extend, modify and truly customize every aspect of the application. Included within the framework download as examples are the following themes:

* Default Wallet (as seen below)
* Priorities (community-driven crowd-sourced to-do list)
* BrainControl 2.0 (example of a modified wallet with simplified setup process)

We've also bundled the following plugins:

* Market Conditions
* Inline Shapeshift.io Coin Exchange
* API Tests

Everything is powered by one or more of the following interchangable [modules](docs/en/framework/modules/):

* [Accounts](docs/en/framework/modules/accounts/)
* [API](docs/en/framework/modules/api/)
* [Blockchains](docs/en/framework/modules/blockchains/)
* [Buttons](docs/en/framework/modules/buttons/)
* [Contacts](docs/en/framework/modules/contacts/)
* [Data](docs/en/framework/modules/data/)
* [Filters](docs/en/framework/modules/filters/)
* [Forms](docs/en/framework/modules/forms/)
* [HTML](docs/en/framework/modules/html/)
* [Multisig](docs/en/framework/modules/multisig/)
* [Security](docs/en/framework/modules/security/)
* [Styles](docs/en/framework/modules/styles/)
* [Templates](docs/en/framework/modules/templates/)
* [Widgets](docs/en/framework/modules/widgets/)

When combined, they form our default deterministic wallet, which can be setup in seconds:

![Wallet Screen-Shot](docs/img/setup.jpg)

Once setup, users are provided with a fully-featured responsive experience that is available on any device - with support for accounts, contacts, message signing and much more. Come take a look at the live demo - [http://blockstrap.com/demo/](#)

![Wallet Screen-Shot](docs/img/dashboard.jpg)

__No private keys are ever stored or transmitted as they are only generated inline at the moment of transaction. Public information is stored within the device using HTML5 localStorage so is unavailable when browsing privately.__

We suggest that you read our [documentation](docs/en/) for more information and instructions on how to get started.

-----

#### PLEASE NOTE THAT OUR DOCUMENTATION IS UNDERGOING REJUVINATION

Specific topics of interest include:

* [Blockstrap Applications](docs/en/applications)
* [Blockstrap Framework](docs/en/framework)
* [Blockstrap Plugins](docs/en/plugins)
* [Supported Blockchains](docs/en/blockchains)
* __Embeddable Widgets__ (more documentation coming soon)


text:
---
title: Navigating through months in Timeline view
description: Navigating through months in Timeline view - RadSCheduler. Check it now!
type: how-to
page_title: Navigating through months in Timeline view
slug: scheduler-navigating-through-months-in-timeline-view
res_type: kb
---

## HOW-TO

 Navigate through months in Timeline view.

## DESCRIPTION

 Clicking on the previous or next arrow will take you to the previous or next month. This functionality is achieved by dynamically setting the **SelectedDate** and TimelineView.**NumberOfSlots** properties.

## SOLUTION

````ASPX
<telerik:RadScheduler ID="RadScheduler1" runat="server" SelectedView="TimelineView"
    OnNavigationComplete="RadScheduler1_NavigationComplete">
    <TimelineView ColumnHeaderDateFormat="dd" HeaderDateFormat="M" />
    <DayView UserSelectable="false" />
    <WeekView UserSelectable="false" />
    <MonthView UserSelectable="false" />
    <TimelineView UserSelectable="false" />
</telerik:RadScheduler>
````

````C#
protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack & RadScheduler1.SelectedView == SchedulerViewType.TimelineView)
        {
            int year = RadScheduler1.SelectedDate.Year;
            int month = RadScheduler1.SelectedDate.Month;
            int numberOfDaysInCurrentMonth = DateTime.DaysInMonth(year, month);
            RadScheduler1.SelectedDate = new DateTime(year, month, 1);
            RadScheduler1.TimelineView.NumberOfSlots = numberOfDaysInCurrentMonth;
        }
    }
    protected void RadScheduler1_NavigationComplete(object sender, SchedulerNavigationCompleteEventArgs e)
    {
        if (RadScheduler1.SelectedView == SchedulerViewType.TimelineView)
        {
            int year = RadScheduler1.SelectedDate.Year;
            //We need to add 3 days to make up for the largest possible difference
            //in the number of days for any two months(31-28=3).
            int month = RadScheduler1.SelectedDate.AddDays(3).Month;
            int numberOfDaysInCurrentMonth = DateTime.DaysInMonth(year, month);
            RadScheduler1.SelectedDate = new DateTime(year, month, 1);
            RadScheduler1.TimelineView.NumberOfSlots = numberOfDaysInCurrentMonth;
        }
    }
````
````VB
Protected Sub Page_Load(sender As Object, e As EventArgs)
    If Not IsPostBack And RadScheduler1.SelectedView = SchedulerViewType.TimelineView Then
        Dim year As Integer = RadScheduler1.SelectedDate.Year
        Dim month As Integer = RadScheduler1.SelectedDate.Month
        Dim numberOfDaysInCurrentMonth As Integer = DateTime.DaysInMonth(year, month)
        RadScheduler1.SelectedDate = New DateTime(year, month, 1)
        RadScheduler1.TimelineView.NumberOfSlots = numberOfDaysInCurrentMonth
    End If
End Sub
Protected Sub RadScheduler1_NavigationComplete(sender As Object, e As SchedulerNavigationCompleteEventArgs)
    If RadScheduler1.SelectedView = SchedulerViewType.TimelineView Then
        Dim year As Integer = RadScheduler1.SelectedDate.Year
        'We need to add 3 days to make up for the largest possible difference
        'in the number of days for any two months(31-28=3).
        Dim month As Integer = RadScheduler1.SelectedDate.AddDays(3).Month
        Dim numberOfDaysInCurrentMonth As Integer = DateTime.DaysInMonth(year, month)
        RadScheduler1.SelectedDate = New DateTime(year, month, 1)
        RadScheduler1.TimelineView.NumberOfSlots = numberOfDaysInCurrentMonth
    End If
End Sub
````

repository: telerik/ajax-docs

gha_language: C#

repo_name: telerik/ajax-docs


text:
A new loadbalanced, failover capable SolrJ client
======================

[![Travis CI build status](https://travis-ci.org/shopping24/solr-extensions-client.png)](https://travis-ci.org/shopping24/solr-extensions-client)

The `solr-extensions-client` is a new implementation of the [`LBHttpSolrServer`](http://wiki.apache.org/solr/LBHttpSolrServer) shipping with [Solr](http://lucene.apache.org/solr). It is designed to be open for extension and enables a transparent request failover.

The `LBHttpSolrServer` does a great job when it comes to balance requests across a bunch of Solr servers. But unfortunately it is not designed to be open for extension, which this implementation tries to solve.

The `FailoverLoadbalancedHttpSolrServer` extends the `SolrServer` class and exposes the following capabilities

* Load balancing strategy
* Exception handling strategy
* Instance healthchecks

## Installation

Add the following dependency to your projects pom.xml (users of other build tools should know how to translate the following):
```xml
<dependency>
   <groupId>org.apache.solr.extensions</groupId>
   <artifactId>solr-extensions-client</artifactId>
   <version>0.1.3</version>
</dependency>
```

Because until now the jar is not yet available in maven central you need to add the following repository to your pom.xml as well:
```xml
<repositories>
   <repository>
      <id>bintray</id>
      <name>bintray</name>
      <url>http://dl.bintray.com/magro/maven</url>
   </repository>
</repositories>
```

## Usage

```java
// create a new client
FailoverLoadbalancedHttpSolrServer server = new FailoverLoadbalancedHttpSolrServer(
   httpClient,
   new BinaryResponseParser(),
   new RoundRobinSolrLoadBalancerStrategy(),
   new ByErrorRateSolrExceptionHandler(),
   new PingAwareSolrServerAliveChecker(5, 10, TimeUnit.SECONDS));

// start adding solr urls
server.addSolrServer("http://some.solr.url/solr");
```

### Configuration

The project contains some utility classes:

* `ExplanatoryHttpSolrServer` – does a proper to string for the `HttpSolrServer`
* `HttpClientSolrConfigurationBean` – configures a http client with some Solr defaults. Use in IoC containers like Spring.

#### `SolrLoadBalancingStrategy`

Default load balancing strategy is the `RoundRobinSolrLoadBalancerStrategy` that distributes requests round robin across the configured servers. Dead servers are skipped and a exception is thrown if no alive Solr server is left.

When issueing more than one request to a Solr server, it might be handy to send those to the same Solr instance. If you for example request available facets for a given query in a first request and retrieve matching documents in a subsequent request, query time will decrease when working on the same facet/filter/document caches.

To achieve this, the `StickyDelegatingSolrLoadBalancerStrategy` utilizes the Spring `RequestContextHolder` to store the first Solr instance used in the current request context. The following requests are sent to the same Solr instance.

#### `SolrServerAliveChecker`

`PingAwareSolrServerAliveChecker` – iterates through all configured servers and
checks their availability via a ping request

`DeadSolrServerAliveChecker` – iterates through all servers marked as dead and checks their re-availability via a ping request

#### `SolrExceptionHandler`

`ByErrorRateSolrExceptionHandler` – disables a Solr instance if the thrown exception rate exceeds the configured error rate per minute

## Extend

Contributions are welcome! We'd like to see async http client support and more sophisticated lb strategies.

## Build

You need to haven Maven installed. Check out the project, run

    $ mvn clean verify

You'll find the client `jar` in the `target` directory.

## Release

In order to do a release we have to prepare the release

    $ mvn release:prepare

The parameter `developmentVersion` can be used to set the new version of your local working copy. Afterwards we perform the release (to deploy to bintray add `-Pbintray`)

    $ mvn release:perform

## License

[Apache License](LICENSE)

repository: netboynb/solr-extensions-client

repo_name: netboynb/solr-extensions-client


text:
# vsgExamples
Example programs that test and illustrate how to use the [VulkanSceneGraph](https://github.com/vsg-dev/VulkanSceneGraph/) and optional add-on libraries. The example programs are grouped according to the type of features they illustrate and their dependencies.

* [core](examples/core/) examples
* [nodes](examples/nodes/) examples
* [maths](examples/maths/) examples
* [app](examples/app/) examples
* [vk](examples/vk/) examples
* [text](examples/text/) examples
* [raytracing](examples/raytracing/) examples
* [state](examples/state/) examples
* [commands](examples/commands/) examples
* [io](examples/io/) examples
* [ui](examples/ui/) examples
* [platform](examples/platform/) examples
* [utils](examples/utils/) examples
* [threading](examples/threading/) examples
* [volume](examples/volume/) examples
* [meshshaders](examples/meshshaders/) examples

## Quick Guide to Building the vsgExamples

### Prerequisites:
* C++17 compliant compiler i.e.. g++ 7.3 or later, Clang 6.0 or later, Visual Studio 2017 or later.
* [Vulkan](https://vulkan.lunarg.com/) 1.1 or later.
* [CMake](https://www.cmake.org) 3.7 or later.
* [VulkanSceneGraph](https://github.com/vsg-dev/VulkanSceneGraph/) use master
* [vsgXchange](https://github.com/vsg-dev/vsgXchange/) optional - used for 3d model and image loaders
* [vsgImGui](https://github.com/vsg-dev/vsgimGui/) optional - used for in window GUI examples

The above dependency versions are known to work so they've been set as the current minimum, it may be possible to build against older versions.  If you find success with older versions let us know and we can update the version info.

### Command line build instructions:
To build and install in source, with all dependencies installed in standard system directories:

    git clone https://github.com/vsg-dev/vsgExamples.git
    cd vsgExamples
    cmake .
    make -j 8

Full details on how to build the vsgExamples can be found in the [INSTALL.md](INSTALL.md) file.

## Running examples

After you have built the examples you should set your binary search path to the vsgExamples/bin directory, and the VSG_FILE_PATH env vars.

	export PATH="$PATH:/path/to/vsgExamples/bin"
	export VSG_FILE_PATH=/path/to/vsgExamples/data

Then run examples:

	vsgmaths # run simple tests of vsg/maths functionality
	vsgdraw # run the vsgdraw example (a port of VulkanTutorial)

repository: vsg-dev/vsgExamples

gha_language: GLSL

repo_name: vsg-dev/vsgExamples


text:
![KryoNet](https://raw.github.com/wiki/EsotericSoftware/kryo/images/logo.jpg)

[![Build Status](https://jenkins.inoio.de/buildStatus/icon?job=kryo)](https://jenkins.inoio.de/job/kryo/)

Please use the [Kryo discussion group](http://groups.google.com/group/kryo-users) for support.

Kryo JARs are available on the [releases page](https://github.com/EsotericSoftware/kryo/releases) and at [Maven Central](http://search.maven.org/#browse|1975274176). Latest snapshots of Kryo including snapshot builds of master are in the [Sonatype Repository](https://oss.sonatype.org/content/repositories/snapshots/com/esotericsoftware/kryo/kryo).

## New in 2.22

The 2.22 release fixes many reported issues and improves stability and performance. It also introduces a number of new features, most notably that it can use Unsafe to read and write object memory directly. This is the absolute fastest way to do serialization, especially for large primitive arrays.

The Maven JARs now contain a "shaded" version of ObjectWeb's ASM library to avoid conflicts with a different ASM version in your application. There's no longer a separate shaded jar.

## Overview

Kryo is a fast and efficient object graph serialization framework for Java. The goals of the project are speed, efficiency, and an easy to use API. The project is useful any time objects need to be persisted, whether to a file, database, or over the network.

Kryo can also perform automatic deep and shallow copying/cloning. This is direct copying from object to object, not object->bytes->object.

This documentation is for v2 of Kryo. See [V1Documentation](https://github.com/EsotericSoftware/kryo/wiki/Documentation-for-Kryo-version-1.x) for v1.x.

If you are planning to use Kryo for network communication, the [KryoNet](http://code.google.com/p/kryonet/) project may prove useful.

## Contents

- [Quickstart](#quickstart)
- [IO](#io)
- [Unsafe-based IO](#unsafe-based-io)
- [Serializers](#serializers)
- [Registration](#registration)
- [Default serializers](#default-serializers)
- [FieldSerializer](#fieldserializer)
- [KryoSerializable](#kryoserializable)
- [Reading and writing](#reading-and-writing)
- [References](#references)
- [Object creation](#object-creation)
- [Copying/cloning](#copyingcloning)
- [Context](#context)
- [Compression and encryption](#compression-and-encryption)
- [Chunked encoding](#chunked-encoding)
- [Compatibility](#compatibility)
- [Interoperability](#interoperability)
- [Stack size](#stack-size)
- [Threading](#threading)
- [Logging](#logging)
- [Integration with Maven](#integration-with-maven)
- [Scala](#scala)
- [Objective-C](#objective-c)
- [Benchmarks](#benchmarks)
- [Projects using Kryo](#projects-using-kryo)
- [Contact / Mailing list](#contact--mailing-list)

## Quickstart

Jumping ahead to show how the library is used:

```java
    Kryo kryo = new Kryo();
    // ...
    Output output = new Output(new FileOutputStream("file.bin"));
    SomeClass someObject = ...
    kryo.writeObject(output, someObject);
    output.close();
    // ...
    Input input = new Input(new FileInputStream("file.bin"));
    SomeClass someObject = kryo.readObject(input, SomeClass.class);
    input.close();
```

The Kryo class orchestrates serialization. The Output and Input classes handle buffering bytes and optionally flushing to a stream.

The rest of this document details how this works and advanced usage of the library.

## IO

The Output class is an OutputStream that writes data to a byte array buffer. This buffer can be obtained and used directly, if a byte array is desired. If the Output is given an OutputStream, it will flush the bytes to the stream when the buffer becomes full. Output has many methods for efficiently writing primitives and strings to bytes. It provides functionality similar to DataOutputStream, BufferedOutputStream, FilterOutputStream, and ByteArrayOutputStream.

Because Output buffers when writing to an OutputStream, be sure to call `flush()` or `close()` after writing is complete so the buffered bytes are written to the underlying stream.

The Input class is an InputStream that reads data from a byte array buffer. This buffer can be set directly, if reading from a byte array is desired. If the Input is given an InputStream, it will fill the buffer from the stream when the buffer is exhausted. Input has many methods for efficiently reading primitives and strings from bytes. It provides functionality similar to DataInputStream, BufferedInputStream, FilterInputStream, and ByteArrayInputStream.

To read from a source or write to a target other than a byte array, simply provide the appropriate InputStream or OutputStream.

## Unsafe-based IO

Kryo provides additional IO classes, which are based on the functionalities exposed by the sun.misc.Unsafe class. These classes are UnsafeInput, UnsafeOutput. They are derived from Kryo's Input and Output classes and therefore can be used as a drop-in replacement on those platforms, which properly support sun.misc.Unsafe.

For the case you need to serialize to or deserialize from direct-memory ByteBuffers or even off-heap memory, there are two dedicated classes UnsafeMemoryInput and UnsafeMemoryOutput whose instances can be used for this purpose instead of the usual Input and Output classes.

Using Unsafe-based IO may result in a quite significant performance boost, depending on your application. In particular, it helps a lot when serializing large primitive arrays as part of your object graphs.

### ** DISCLAIMER ABOUT USING UNSAFE-BASED IO **

*Unsafe-based IO is not 100% compatible with Kryo's Input and Output streams when it comes to the binary  format of serialized data!*

This means that data written by Unsafe-based output streams can be read only by
Unsafe-based input streams, but not by usual Input streams. The same applies on the opposite direction: data written by usual Output streams cannot be correctly read by Unsafe-based input streams.

It should be safe to use Unsafe IO streams as long as both serialization and deserialization are using them and are executed on the same processor architecture (more precisely, if the endianness and internal representation of native integer and floating point types is the same).

## Serializers

Kryo is a serialization framework. It doesn't enforce a schema or care what data is written or read. This is left to the serializers themselves. Serializers are provided by default to read and write data in various ways. If these don't meet particular needs, they can be replaced in part or in whole. The provided serializers can read and write most objects but, if necessary, writing a new serializer is easy. The Serializer abstract class defines methods to go from objects to bytes and bytes to objects.

```java
    public class ColorSerializer extends Serializer<Color> {
    	public void write (Kryo kryo, Output output, Color object) {
    		output.writeInt(object.getRGB());
    	}

    	public Color read (Kryo kryo, Input input, Class<T> type) {
    		return new Color(input.readInt(), true);
    	}
    }
```

Serializer has two methods that can be implemented. `write()` writes the object as bytes. `read()` creates a new instance of the object and reads from the input to populate it.

The Kryo instance can be used to write and read nested objects. If Kryo is used to read a nested object in `read()` then `kryo.reference()` must first be called with the parent object if it is possible for the nested object to reference the parent object. It is unnecessary to call `kryo.reference()` if the nested objects can't possibly reference the parent object, Kryo is not being used for nested objects, or references are not being used. If nested objects can use the same serializer, the serializer must be reentrant.

Code should not make use of serializers directly, instead the Kryo read and write methods should be used. This allows Kryo to orchestrate serialization and handle features such as references and null objects.

By default, serializers do not need to handle the object being null. The Kryo framework will write a byte as needed denoting null or not null. If a serializer wants to be more efficient and handle nulls itself, it can call `Serializer#setAcceptsNull(true)`. This can also be used to avoid writing the null denoting byte when it is known that all instances of a type will never be null.

## Registration

When Kryo writes out an instance of an object, first it may need to write out something that identifies the object's class. By default, the fully qualified class name is written, then the bytes for the object. Subsequent appearances of that object type within the same object graph are written using a variable length int. Writing the class name is somewhat inefficient, so classes can be registered beforehand:

```java
    Kryo kryo = new Kryo();
    kryo.register(SomeClass.class);
    // ...
    Output output = ...
    SomeClass someObject = ...
    kryo.writeObject(output, someObject);
```

Here SomeClass is registered with Kryo, which associates the class with an int ID. When Kryo writes out an instance of SomeClass, it will write out this int ID. This is more efficient than writing out the class name, but requires the classes that will be serialized to be known up front. During deserialization, the registered classes must have the exact same IDs they had during serialization. The register method shown above assigns the next available, lowest integer ID, which means the order classes are registered is important. The ID can also be specified explicitly to make order unimportant:

```java
    Kryo kryo = new Kryo();
    kryo.register(SomeClass.class, 0);
    kryo.register(AnotherClass.class, 1);
    kryo.register(YetAnotherClass.class, 2);
```

The IDs are written most efficiently when they are small, positive integers. Negative IDs are not serialized efficiently. -1 and -2 are reserved.

Use of registered and unregistered classes can be mixed. All primitives, primitive wrappers, and String are registered by default.

Kryo#setRegistrationRequired can be set to true to throw an exception when any unregistered class is encountered. This prevents an application from accidentally using class name strings.

If using unregistered classes, short package names could be considered.

## Default serializers

After writing the class identifier, Kryo uses a serializer to write the object's bytes. When a class is registered, a serializer instance can be specified:

```java
    Kryo kryo = new Kryo();
    kryo.register(SomeClass.class, new SomeSerializer());
    kryo.register(AnotherClass.class, new AnotherSerializer());
```

If a class is not registered or no serializer is specified, a serializer is chosen automatically from a list of "default serializers" that maps a class to a serializer. The following classes have a default serializer set by default:

boolean	Boolean	byte	Byte	char

Character	short	Short	int	Integer

long	Long	float	Float	double

Double	byte[]	String	BigInteger	BigDecimal

Collection	Date	Collections.emptyList	Collections.singleton	Map

StringBuilder	TreeMap	Collections.emptyMap	Collections.emptySet	KryoSerializable

StringBuffer	Class	Collections.singletonList	Collections.singletonMap	Currency

Calendar	TimeZone	Enum	EnumSet

Additional default serializers can be added:

```java
    Kryo kryo = new Kryo();
    kryo.addDefaultSerializer(SomeClass.class, SomeSerializer.class);
    // ...
    Output output = ...
    SomeClass someObject = ...
    kryo.writeObject(output, someObject);
```

A class can also use the DefaultSerializer annotation:

```java
    @DefaultSerializer(SomeClassSerializer.class)
    public class SomeClass {
       // ...
    }
```

If no default serializers match a class, then by default [FieldSerializer](#FieldSerializer) is used. This can also be changed:

    Kryo kryo = new Kryo();
    kryo.setDefaultSerializer(AnotherGenericSerializer.class);

Some serializers allow extra information to be provided so that the number of bytes output can be reduced:

```java
    Kryo kryo = new Kryo();
    FieldSerializer someClassSerializer = new FieldSerializer(kryo, SomeClass.class);
    CollectionSerializer listSerializer = new CollectionSerializer();
    listSerializer.setElementClass(String.class);
    listSerializer.setElementsCanBeNull(false);
    someClassSerializer.getField("list").setClass(LinkedList.class, listSerializer);
    kryo.register(SomeClass.class, someClassSerializer);
    // ...
    SomeClass someObject = ...
    someObject.list = new LinkedList();
    someObject.list.add("thishitis");
    someObject.list.add("bananas");
    kryo.writeObject(output, someObject);
```

In this example, FieldSerializer will be used for SomeClass. FieldSerializer is configured so the "list" field will always be a LinkedList and will use the specified CollectionSerializer. The CollectionSerializer is configured so each element will be a String and none of the elements will be null. This allows the serializer to be more efficient. In this case, 2 to 3 bytes are saved per element in the list.

## FieldSerializer

By default, most classes will end up using FieldSerializer. It essentially does what hand written serialization would, but does it automatically. FieldSerializer does direct assignment to the object's fields. If the fields are public, protected, or default access (package private), bytecode generation is used for maximum speed (see [ReflectASM](http://code.google.com/p/reflectasm/)). For private fields, setAccessible and cached reflection is used, which is still quite fast.

Other general purpose serializes are provided, such as BeanSerializer, TaggedFieldSerializer, and CompatibleFieldSerializer. Additional serializers are available in a separate project on github, [kryo-serializers](https://github.com/magro/kryo-serializers).

## KryoSerializable

While FieldSerializer is ideal for most classes, sometimes it is convenient for a class to do its own serialization. This can be done by implementing KryoSerializable interface (similar to the java.io.Externalizable interface in the JDK).

```java
    public class SomeClass implements KryoSerializable {
       // ...

       public void write (Kryo kryo, Output output) {
          // ...
       }

       public void read (Kryo kryo, Input input) {
          // ...
       }
    }
```

## Reading and writing

Kryo has three sets of methods for reading and writing objects.

If the concrete class of the object is not known and the object could be null:

```java
    kryo.writeClassAndObject(output, object);
    // ...
    Object object = kryo.readClassAndObject(input);
    if (object instanceof SomeClass) {
       // ...
    }
```

If the class is known and the object could be null:

```java
    kryo.writeObjectOrNull(output, someObject);
    // ...
    SomeClass someObject = kryo.readObjectOrNull(input, SomeClass.class);
```

If the class is known and the object cannot be null:

```java
    kryo.writeObject(output, someObject);
    // ...
    SomeClass someObject = kryo.readObject(input, SomeClass.class);
```

## References

By default, each appearance of an object in the graph after the first is stored as an integer ordinal. This allows multiple references to the same object and cyclic graphs to be serialized. This has a small amount of overhead and can be disabled to save space if it is not needed:

```java
    Kryo kryo = new Kryo();
    kryo.setReferences(false);
    // ...
```

When writing serializers that use Kryo for nested objects, `kryo.reference()` must be called in `read()`. See [Serializers](#Serializers) for more information.

## Object creation

Serializers for a specific type use Java code to create a new instance of that type. Serializers such as FieldSerializer are generic and must handle creating a new instance of any class. By default, if a class has a zero argument constructor then it is invoked via [ReflectASM](http://code.google.com/p/reflectasm/) or reflection, otherwise an exception is thrown. If the zero argument constructor is private, an attempt is made to access it via reflection using setAccessible. If this is acceptable, a private zero argument constructor is a good way to allow Kryo to create instances of a class without affecting the public API.

When ReflectASM or reflection cannot be used, Kryo can be configured to use an InstantiatorStrategy to handle creating instances of a class. [Objenesis](https://code.google.com/p/objenesis/) provides StdInstantiatorStrategy which uses JVM specific APIs to create an instance of a class without calling any constructor at all. While this works on many JVMs, a zero argument is generally more portable.

```java
    kryo.setInstantiatorStrategy(new StdInstantiatorStrategy());
```

Note that classes must be designed to be created in this way. If a class expects its constructor to be called, it may be in an uninitialized state when created through this mechanism.

Objenesis can also create new objects using Java's built-in serialization mechanism. Using this, the class must implement java.io.Serializable and the first zero argument constructor in a super class is invoked.

```java
    kryo.setInstantiatorStrategy(new SerializingInstantiatorStrategy());
```

You may also write your own InstantiatorStrategy.

To customize only how a specific type is created, an ObjectInstantiator can be set. This will override ReflectASM, reflection, and the InstantiatorStrategy.

```java
    Registration registration = kryo.register(SomeClass.class);
    registration.setObjectInstantiator(...);
```

Alternatively, some serializers provide methods that can be overridden to customize object creation.

```java
    kryo.register(SomeClass.class, new FieldSerializer(kryo, SomeClass.class) {
       public Object create (Kryo kryo, Input input, Class type) {
          return new SomeClass("some constructor arguments", 1234);
       }
    });
```

## Copying/cloning

A serialization library needs special knowledge on how to create new instances, get and set values, navigate object graphs, etc. This is nearly everything needed to support copying objects, so it makes sense for Kryo to support automatically making deep and shallow copies of objects. Note Kryo's copying does not serialize to bytes and back, it uses direct assignment.

```java
    Kryo kryo = new Kryo();
    SomeClass someObject = ...
    SomeClass copy1 = kryo.copy(someObject);
    SomeClass copy2 = kryo.copyShallow(someObject);
```

The Serializer class has a `copy` method that does the work. These methods can be ignored when implementing application specific serializers if the copying functionality will not be used. All serializers provided with Kryo support copying. Multiple references to the same object and circular references are handled by the framework automatically.

Similar to the `read()` Serializer method, `kryo.reference()` must be called before Kryo can be used to copy child objects. See [Serializers](#Serializers) for more information.

Similar to KryoSerializable, classes can implement KryoCopyable to do their own copying:

```java
    public class SomeClass implements KryoCopyable<SomeClass> {
       // ...

       public SomeClass copy (Kryo kryo) {
          // Create new instance and copy values from this instance.
       }
    }
```

## Context

Kryo has two context methods. `getContext()` returns a map for storing user data. Because the Kryo instance is available to all serializers, this data is readily available. `getGraphContext()` is similar, but is cleared after each object graph is serialized or deserialized. This makes it easy to manage per object graph state.

## Compression and encryption

Kryo supports streams, so it is trivial to use compression or encryption on all of the serialized bytes:

```java
    OutputStream outputStream = new DeflaterOutputStream(new FileOutputStream("file.bin"));
    Output output = new Output(outputStream);
    Kryo kryo = new Kryo();
    kryo.writeObject(output, object);
    output.close();
```

If needed, a serializer can be used to compress or encrypt the bytes for only a subset of the bytes for an object graph. For example, see DeflateSerializer or BlowfishSerializer. These serializers wrap another serializer and encode and decode the bytes.

## Chunked encoding

Sometimes it is useful to write the length of some data, then the data. If the length of the data is not known ahead of time, all the data would need to be buffered to determine its length, then the length can be written, then the data. This buffering prevents streaming and potentially requires a very large buffer, which is not ideal.

Chunked encoding solves this by using a small buffer. When the buffer is full, its length is written, then the data. This is one chunk of data. The buffer is cleared and this continues until there is no more data to write. A chunk with a length of zero denotes the end of the chunks.

Kryo provides classes for easy chunked encoding. OutputChunked is used to write chunked data. It extends Output, so has all the convenient methods to write data. When the OutputChunked buffer is full, it flushes the chunk to the wrapped OutputStream. The `endChunks()` method is used to mark the end of a set of chunks.

```java
    OutputStream outputStream = new FileOutputStream("file.bin");
    OutputChunked output = new OutputChunked(outputStream, 1024);
    // Write data to output...
    output.endChunks();
    // Write more data to output...
    output.endChunks();
    // Write even more data to output...
    output.close();
```

To read the chunked data, InputChunked is used. It extends Input, so has all the convenient methods to read data. When reading, InputChunked will appear to hit the end of the data when it reaches the end of a set of chunks. The `nextChunks()` method advances to the next set of chunks, even if not all the data has been read from the current set of chunks.

```java
    InputStream outputStream = new FileInputStream("file.bin");
    InputChunked input = new InputChunked(inputStream, 1024);
    // Read data from first set of chunks...
    input.nextChunks();
    // Read data from second set of chunks...
    input.nextChunks();
    // Read data from third set of chunks...
    input.close();
```

## Compatibility

For some needs, especially long term storage of serialized bytes, it can be important how serialization handles changes to classes. This is known as forward and backward compatibility. By default, most user classes will be serialized using FieldSerializer, which does not support adding, removing, or changing the type of fields without invalidating previously serialized bytes. This is acceptable in many situations, such as sending data over a network. If necessary, an alternate generic serializer can be used:

```java
    kryo.setDefaultSerializer(TaggedFieldSerializer.class);
```

TaggedFieldSerializer only serializes fields that have a @Tag annotation. This is less flexible than FieldSerializer, which can handle most classes without needing annotations, but allows TaggedFieldSerializer to support adding new fields without invalidating previously serialized bytes. If a field is removed it will invalidate previously serialized bytes, so fields should be annotated with @Deprecated instead of being removed.

Alternatively, CompatibleFieldSerializer can be used, which writes a simple schema before the object data the first time the class is encountered in the serialized bytes. Like FieldSerializer, it can serialize most classes without needing annotations. Fields can be added or removed without invalidating previously serialized bytes, but changing the type of a field is not supported. This has some additional overhead, both in speed and size, when compared to FieldSerializer.

Additional serializers could be developed for forward and backward compatibility, such as a serializer that uses an external, hand written schema.

## Interoperability

The Kryo serializers provided by default assume that Java will be used for deserialization, so they do not explicitly define the format that is written. Serializers could be written using a standardized format that is more easily read by another language, but this is not provided by default.

## Stack size

The serializers Kryo provides use the call stack when serializing nested objects. Kryo does minimize stack calls, but for extremely deep object graphs, a stack overflow can occur. This is a common issue for most serialization libraries, including the built-in Java serialization. The stack size can be increased using `-Xss`, but note that this is for all threads. Large stack sizes in a JVM with many threads may use a large amount of memory.

## Threading

Kryo is not thread safe. Each thread should have its own Kryo, Input, and Output instances. Also, the byte[] Input uses may be modified and then returned to its original state during deserialization, so the same byte[] should not be used concurrently in separate threads.

## Logging

Kryo makes use of the low overhead, lightweight [MinLog logging library](http://code.google.com/p/minlog/). The logging level can be set by one of the following methods:

```java
    Log.ERROR();
    Log.WARN();
    Log.INFO();
    Log.DEBUG();
    Log.TRACE();
```

Kryo does no logging at `INFO` (the default) and above levels. `DEBUG` is convenient to use during development. `TRACE` is good to use when debugging a specific problem, but generally outputs too much information to leave on.

MinLog supports a fixed logging level, which causes javac to remove logging statements below that level at compile time. In the Kryo distribution ZIP, the "debug" JARs have logging enabled. The "production" JARs use a fixed logging level of `NONE`, which means all logging code has been removed.

## Integration with Maven

To use the official release of Kryo, please use the following snippet in your pom.xml

```xml
    <repository>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <id>central</id>
        <name>Maven Central Repository</name>
        <url>http://repo1.maven.org/maven2</url>
    </repository>

    <dependency>
        <groupId>com.esotericsoftware.kryo</groupId>
        <artifactId>kryo</artifactId>
        <version>2.22</version>
    </dependency>
```

If you want to test the latest snapshot of Kryo, please use the following snippet in your pom.xml

```xml
    <repository>
       <id>sonatype-snapshots</id>
       <name>sonatype snapshots repo</name>
       <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>

    <dependency>
       <groupId>com.esotericsoftware.kryo</groupId>
       <artifactId>kryo</artifactId>
        <version>2.23-SNAPSHOT</version>
    </dependency>
```

## Scala

See the following projects which provide serializers for Scala classes:

- [Twitter's Chill](https://github.com/twitter/chill) (Kryo serializers for Scala)
- [akka-kryo-serialization](https://github.com/romix/akka-kryo-serialization) (Kryo serializers for Scala and Akka)
- [Twitter's Scalding](https://github.com/twitter/scalding) (Scala API for Cascading)
- [Kryo Serializers](https://github.com/magro/kryo-serializers) (Additional serializers for Java)

## Clojure

- [Carbonite](https://github.com/sritchie/carbonite) (Kryo serializers for Clojure)

## Objective-C

See the following project which is an Objective-C port of Kryo:
- [kryococoa](https://github.com/Feuerwerk/kryococoa)

## Benchmarks

Kryo can be compared to many other serialization libraries in the [JVM Serializers](https://github.com/eishay/jvm-serializers/wiki) project. It is difficult to thoroughly compare serialization libraries using a benchmark. They often have different goals and may excel at solving completely different problems. To understand these benchmarks, the code being run and data being serialized should be analyzed and contrasted with your specific needs. Some serializers are highly optimized and use pages of code, others use only a few lines. This is good to show what is possible, but may not be practical for many situations.

"kryo" is typical Kryo usage, classes are registered and serialization is done automatically. "kryo-opt" shows how serializers can be configured to reduce the size for the specific data being serialized, but serialization is still done automatically. "kryo-manual" shows how hand written serialization code can be used to optimize for both size and speed while still leveraging Kryo for most of the work.

## Projects using Kryo

There are a number of projects using Kryo. A few are listed below. Please post a message to the [mailing list](https://groups.google.com/forum/#!forum/kryo-users) if you'd like your project included here.

- [KryoNet](http://code.google.com/p/kryonet/) (NIO networking)
- [Twitter's Scalding](https://github.com/twitter/scalding) (Scala API for Cascading)
- [Twitter's Chill](https://github.com/twitter/chill) (Kryo serializers for Scala)
- [Apache Hive](http://hive.apache.org/) (query plan serialization)
- [DataNucleus](https://github.com/datanucleus/type-converter-kryo) (JDO/JPA persistence framework)
- [CloudPelican](http://www.cloudpelican.com/)
- [Yahoo's S4](http://www.s4.io/) (distributed stream computing)
- [Storm](https://github.com/nathanmarz/storm/wiki/Serialization) (distributed realtime computation system, in turn used by [many others](https://github.com/nathanmarz/storm/wiki/Powered-By))
- [Cascalog](https://github.com/nathanmarz/cascalog) (Clojure/Java data processing and querying [details](https://groups.google.com/d/msg/cascalog-user/qgwO2vbkRa0/UeClnLL5OsgJ))
- [memcached-session-manager](https://code.google.com/p/memcached-session-manager/) (Tomcat high-availability sessions)
- [Mobility-RPC](http://code.google.com/p/mobility-rpc/) (RPC enabling distributed applications)
- [akka-kryo-serialization](https://github.com/romix/akka-kryo-serialization) (Kryo serializers for Akka)
- [Groupon](https://code.google.com/p/kryo/issues/detail?id=67)
- [Jive](http://www.jivesoftware.com/jivespace/blogs/jivespace/2010/07/29/the-jive-sbs-cache-redesign-part-3)
- [DestroyAllHumans](https://code.google.com/p/destroyallhumans/) (controls a [robot](http://www.youtube.com/watch?v=ZeZ3R38d3Cg)!)
- [kryo-serializers](https://github.com/magro/kryo-serializers) (additional serializers)

## Contact / Mailing list

You can use the [kryo mailing list](https://groups.google.com/forum/#!forum/kryo-users) for questions/discussions/support.

repository: MaceSwinger/Mace-Swinger

repo_name: MaceSwinger/Mace-Swinger


text:
#  <span style="color:red">This Project Has *Moved* ! </span>

Please see [https://github.com/CrescoEdge/quickstart](https://github.com/CrescoEdge/quickstart) for new Cresco repositories.

---

# Cresco-Skeleton-Plugin
The Cresco Skeleton Plugin outlines the most basic pieces required of a plugin for the Cresco framework. Outlined here are the necessary changes to customize this code for your own requirements.

##### Requirements
* Java JDK 1.8+
* Maven 3

##### Where to put my code?
To get your code to run when the plugin is started, simply include a call to it in the `start()` method of the `Plugin.java` file.
```java
public void start() {
    /*
     *  Insert your startup code here
     */
}
```
###### NOTE: Your code can function as a normal Java program as far as using other files and classes, it is simply initialized in this method rather than from `int main(String[] args)` like an ordinary Java program.

If your code requires any cleanup before termination, please add that to the `cleanup()` method of the `Plugin.java` file.
```java
@Override
public void cleanUp() {
    /*
     *  Insert your shutdown / clean up code here
     */
}
```

##### Setting the Plugin's Name:
In order to set the internal name used by Cresco, edit the `pom.xml` file and enter the name in the `<artifactId></artifactId>` tag, located in the following code snippet:
```xml
<plugin>
    <artifactId>maven-assembly-plugin</artifactId>
    <configuration>
        <archive>
            <manifestEntries>
                <artifactId>[PLUGIN NAME]</artifactId>
```
The plugin's version is just the Maven project's version in the `pom.xml` file. Versioning is currently not strictly enforced in Cresco plugins, though that may change in future work.

##### Compiling the JAR file:
All the Maven plugins and code necessary to generate a JAR file are included in the existing `pom.xml`. In order to create the plugin JAR file, simply issue the following command:
```java
mvn clean package
```
This will generate a file in the `target/` directory `<pluginname>-<version>.jar` which can then be read/loaded by the Cresco framework.

repository: ResearchWorx/Cresco-Skeleton-Plugin

repo_name: ResearchWorx/Cresco-Skeleton-Plugin


text:
# Jelly
Created using custom painter.

        ![](https://github.com/ronakpatan007/jelly-view-flutter/blob/master/demo.gif)

### Description
With help of Bezier curve, created shape from path like Jelly and with animation, made effect like animation. Parameters used in custom painter are configurable.

* We can define configuration as per below for each Jelly.
    ```
    JellyConfiguration(size);
    ```

* If we want to create multiple Jellies on each other:
    ```
    List<JellyConfiguration> jellyConfigurations = List();
      for (int i = 0; i < jellyCount; i++) {
        jellyConfigurations.add(JellyConfiguration(size,
            position: i, reductionRadiusFactor: 1.5 - ((i + 1) / jellyCount)));
      }
    ```

# LICENSE!
Jelly is [MIT-licensed](/LICENSE).

# jelly-view-flutter


text:
# Modified implementation of 'A Neural Algorithm of Artistic Style'

- [Torch7](https://github.com/torch/torch7)
- [gSLICr-torch](https://github.com/jhjin/gSLICr-torch) (used for segmentation)
- CUDA 6.5+ (unless running on CPU -- see below)

## Usage

First, download the models by running the download script:

```
bash download_models.sh
```

This downloads the model weights for the VGG and Inception networks.

Basic usage:

```
qlua smart_style_transfer.lua -style_image <style.jpg> -content_image <content.jpg> -mask_labels <segment.dat>
```

where `style.jpg` is the image that provides the style of the final generated image, and `content.jpg` is the image that provides the content. `segment.dat` is a segmentation of the content image used to product better style weights.

This generates an image using the VGG-19 network by Karen Simonyan and Andrew Zisserman (http://www.robots.ox.ac.uk/~vgg/research/very_deep/).

## Acknowledgements

Thanks to the [Bethge Group](http://bethgelab.org/deepneuralart/) for providing the weights to the normalized VGG network used here.


text:
---
layout: default
---

# 1996-10-09 - Re: Missionaries (was: "Mormon Asshole?" re: GAK)

## Header Data

From: Dale Thorn<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 829d8a64267dc59d36fdb1827f5f1e1ec1892dd60576c7d8306081829d16e6df

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-10-09 11:22:31 UTC

Raw Date: Wed, 9 Oct 1996 19:22:31 +0800

## Raw message

```
{% raw  %}From: Dale Thorn<EMAIL_ADDRESS>Date: Wed, 9 Oct 1996 19:22:31 +0800
To<EMAIL_ADDRESS>Subject: Re: Missionaries (was: "Mormon Asshole?" re: GAK)
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

<EMAIL_ADDRESS>wrote:
> Most ppl believe what they are told to believe. Otherwise why would
> there be so many ppl willing to take whatever the Govt servers them.
> Afterall...The madia would not lie...;)

One example of a topic that most people (including very intelligent,
"technical" people) steer clear of:

Why is it that 95-plus percent of all people stay with their parents'
religion (more-or-less) when they grow up, instead of abandoning it, or
finding one on their own?  Simple.  The uncountable zillions of "bytes"
of information that go into your brain before you become more-or-less
conscious, so controls your mind by the time you are conscious, that
very few people can overcome this programming to any significant extent.

{% endraw %}
```

## Thread

+ Return to [October 1996](/archive/1996/10)

+ Return to "[craigw@dg.ce.com.au](/authors/craigw_at_dg_ce_com_au)"
+ Return to "[Dale Thorn <dthorn@gte.net>](/authors/dale_thorn_dthorn_at_gte_net_)"
+ Return to "[The Deviant <deviant@pooh-corner.com>](/authors/the_deviant_deviant_at_poohcorner_com_)"
+ Return to "["Timothy C. May" <tcmay@got.net>](/authors/timothy_c_may_tcmay_at_got_net_)"

+ 1996-10-09 (Wed, 9 Oct 1996 12:10:21 +0800) - [Re: Missionaries (was: "Mormon Asshole?" re: GAK)](/archive/1996/10/a6ddee52393e6f228a12211af0021b9740ea9d6d6209cba6cb011bfb0508f80a) -<EMAIL_ADDRESS>  + 1996-10-09 (Wed, 9 Oct 1996 19:22:31 +0800) - Re: Missionaries (was: "Mormon Asshole?" re: GAK) - _Dale Thorn<EMAIL_ADDRESS>    + 1996-10-09 (Wed, 9 Oct 1996 16:40:12 -0700 (PDT)) - [Re: Missionaries (was: "Mormon Asshole?" re: GAK)](/archive/1996/10/03be9179a6a6b90a4f77ada1772c0599e151e16b77c870cd047243c631384fef) - _The Deviant<EMAIL_ADDRESS>  + 1996-10-09 (Wed, 9 Oct 1996 11:39:01 -0700 (PDT)) - [Re: Missionaries (was: "Mormon Asshole?" re: GAK)](/archive/1996/10/0f0d3dae47288f32370d7f69cd28af478fac24b2bf66ab76f3b6a19e0ab1bdba) - _"Timothy C. May"<EMAIL_ADDRESS>  + 1996-10-10 (Wed, 9 Oct 1996 21:21:19 -0700 (PDT)) - [Re: Missionaries (was: "Mormon Asshole?" re: GAK)](/archive/1996/10/bb19e475f7dd0ca638923be9ac7ae63b5557b6e1111e67937bc3711fe58ff424) - _Dale Thorn<EMAIL_ADDRESS>


text:
# [Pixave](http://www.littlehj.com/)
I use Pixave as my own personal image library. I sort images in groups and I have the powerful search I can use to find any image I wish.

Here is how my library looks like :
![](https://i.imgur.com/PHNdc3s.jpg)

The orange tag means that the image was uploaded to my [library on Imgur](https://niikivi.imgur.com) for sharing.


text:
---
title: You Really Just Would not Understand!
featured: false
layout: post

date: 2015-01-07T03:16:16.000Z
last_modified_at: 2022-02-28T22:57:35.599Z
category: journal
---

{% cloudinary_img, "Screenshot-2015-01-06-20.14.21", "standard" %}

I'm hoping that someone can explain to me why in the literal hell I would think this is something I would wear.

**_It's just a Johnathan thing. You wouldn't understand!_**

Are you sure?

At least they spelled my name right… spammers have a tendency to misspell my name at least a dozen times a day, according to my spam filter.

That sounds crazy, right? Well it's a Johnathan thing… you wouldn't understand.

repository: johlym/johnathan-org

gha_language: SCSS

repo_name: johlym/johnathan-org