text:
---
title: 'Error Handling'
excerpt: 'Learn more about different ways of error handling when building Jovo apps and plugins.'
url: 'https://www.jovo.tech/docs/error-handling'
---

# Error Handling

Learn more about different ways of error handling when building Jovo apps and plugins.

## Introduction

Error handling allows you to catch certain errors that happen when the app is initialized or during the handler execution.

You can use the [`onError()` method](#onerror) to react to those events. For example, this can be used for [logging](https://www.jovo.tech/docs/logging) or sending notifications.

Jovo also has an error class called [`JovoError`](#jovoerror) which can be used for structured error output, for example when building Jovo plugins.

## onError

`onError()` allows you to add a callback function with an `error` and `jovo` parameter. It is a method of `app`, so it is recommended to use it somewhere in your [app configuration files](./app-config.md), for example `app.ts`:

```typescript
import { Jovo } from '@jovotech/framework';
// ...

app.onError((error: Error, jovo: Jovo) => {
  // ...
});
```

Currently, `onError()` catches the following events:

- Errors happening during `App.initialize()`
- Errors happening during `App.handle()`
- Errors happening during handler execution (`ComponentTreeNode.executeHandler()`)
- When a platform sends an [`ERROR` request](https://www.jovo.tech/docs/input#error)

The `jovo` parameter is `undefined` if the error is thrown outside a handler (for example during `initialize()`).

The function that is passed to `onError()` can also be asynchronous:

```typescript
app.onError(async (error: Error, jovo: Jovo) => {
  // ...
});
```

You can also use `onError()` multiple times:

```typescript
app.onError((error: Error, jovo: Jovo) => {
  /* ... */
});
app.onError((error: Error, jovo: Jovo) => {
  /* ... */
});
```

## JovoError

When building [Jovo plugins](https://www.jovo.tech/docs/plugins) and other extensions, it's helpful to use the `JovoError` class to provide more structure information when an error occurs.

```typescript
import { JovoError } from '@jovotech/common';
// ...

throw new JovoError({ message: 'This is a sample error.' });
```

`JovoError` has the following properties:

| Property    | Type                                                                                | Description                                                              |
| ----------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| `message`   | `string`                                                                                | Main error message. Required.                                            |
| `hint`      | `string`                                                                                | Potential steps to resolve the issue.                                    |
| `learnMore` | `string`                                                                                | A link where you can find more information. `Learn more: <learnMore>`.   |
| `context`   | [`AnyObject`](https://github.com/jovotech/jovo-framework/blob/v4/latest/common/src/index.ts) | Additional data that might be helpful for debugging. Can be any object.  |
| `package`   | `string`                                                                                | The package where the error occurred, for example `@jovotech/framework`. |

repository: jovotech/jovo-framework

gha_language: TypeScript

repo_name: jovotech/jovo-framework


text:
---
layout: base
title:  'Morphology'
permalink: u/overview/morphology.html
udver: '2'
---

# Morphology: General Principles

UD specifies a complete morpho-syntactic representation that can be applied cross-linguistically. This effectively means that grammatical notions may be indicated via word forms (morphologically) or via dependency relations (syntactically). The morphological specification of a (syntactic) word in the UD scheme consists of three levels of representation:

* A _lemma_ representing the semantic content of the word.
* A _part-of-speech tag_ representing the abstract lexical category associated with the word.
* A set of _features_ representing lexical and grammatical properties that are associated with the particular word form.

Lemmas are typically determined by language-specific dictionaries and lexica. In contrast, the part-of-speech tags and grammatical properties are taken from two universal inventories defined below.

Unlike in various language-specific tagsets, the universal tags and features do not
include means to mark _fused words_ (a word that is result of
merging two other words, which are syntactically independent and belong to
different parts of speech):
Czech _dělals (dělal + jsi_ ... main verb + auxiliary); _proň (pro + něj_ ... preposition + pronoun);
German _zum (zu + dem_ ... preposition + article);
Spanish _dámelo (da + me + lo_ ... verb + clitics) etc.
The only truly general approach to fused words in UD is to exploit the distinction between tokens and (syntactic) words,
and to apply a language-specific processing step that splits tokens into syntactic words
where necessary. Every syntactic word then gets its own part-of-speech tag
and features. See also Tokenization and
Format.

## Lemmas

The `LEMMA` field should contain the canonical or base form of the word, which is the form typically found in dictionaries.
If a language is agglutinative, this is typically the form with no inflectional affixes; in fusional languages,
the lemma is usually the result of a language-particular convention.
If the lemma is not available, an underscore ("`_`") can be used to indicate its absence.

At present, treebanks have considerable leeway in interpreting what "canonical or base form" means.
Except perhaps in rare cases of suppletion, one form should be the chosen as the lemma of a verb, noun, determiner, or pronoun paradigm.
The lemma of adjectives and adverbs should be the positive form (in languages with comparative and superlative forms).
The lemma does not remove derivational morphology, so the lemma of [en] _organizations_ is _organization_ not _organize_ (nor _organ_).
In general, a canonical form should collapse inflectional and minor orthographic/spelling variation
(such as casing, accents/diacritics, and typos). In the lemma field, some treebanks may choose
to aggressively normalize spelling variation that may reflect dialect or authorial style.

Abbreviated/shortened forms can be mapped to their full spelling as the lemma
in conjunction with the feature [`Abbr=Yes`](../feat/Abbr.html), provided that the full spelling
is a single word. Abbreviations that would expand to multiple words should be retained in the lemma.

The `LEMMA` field should not be used to encode features or other similar properties of the word (use `FEATS` and `MISC` instead; see [format](../../format.html)).

Some corpora use numerical specifiers to distinguish homonymous lemmas, different word senses etc. (e.g. [en] _can-1_ vs. _can-2_).
In UD, such specifiers must not appear in the `LEMMA` field because they are not part of the canonical surface form.
If unique lemma identifiers are available, they can be preserved in the `MISC` column in the optional `LId` attribute
(`LId=can-1`).

### Lemmas of misspelled words

*Details at: [Typos and Other Errors](typos.html)*

In addition to normalizing spelling in lemmas, treebanks are encouraged to adopt the optional morphological feature
[`Typo=Yes`](../feat/Typo.html) for clear accidental misspellings of a word (e.g. *ltake* for *take* or *too* for *to*).
Typos of words in closed-class categories can be found in a corpus by inspecting word frequencies in each category.
Treebank maintainers should take care not to use `Typo=Yes` for words that may reflect actual linguistic variation,
e.g., dialect, style, or nonnative grammar.

On occasion, a typo or abbreviation will apply to an inflected word (e.g. *hadd* for *had*), and thus the lemma
should both normalize the spelling and remove the inflection.

For incorrectly split words, the first segment should be treated as morphologically representing the entire word,
so it should have the lemma for the entire word, as described at [Typos and Other Errors](typos.html).

## Part-of-Speech Tags

The list of universal POS tags is a fixed list containing 17 tags.
It is possible that some tags will not be used in some languages. However, the list cannot be extended to cover
language-specific extensions. Instead, more fine-grained classification of words can be achieved via the use of
features (see below).

Also, note that the CoNLL-U format
allows an additional XPOS, taken from a language-specific
(or corpus-specific) tagset. Such language-specific XPOSes have their own
data column and are not mixed with the universal POS tags.

The universal POS tags consist of uppercase English letters `[A-Z]` only.
Just one tag per word is expected, and it should not be empty. (Use the `X` tag
instead of underscore if no other tag is appropriate.)

### Tagging principles

A word's category should be primarily determined by prototypical (expected) syntactic behavior,
as typically recorded in a dictionary, rather than by the context of a particular sentence.
Syntax still plays an important role, especially in cross-linguistic mapping of same-named categories.
However, prototypical (expected) syntactic behavior is of more importance than function performed in exceptional contexts.

Morphological behavior may be a good indicator in some languages.
If, for example, a language uses distinct inflection patterns for nouns and adjectives, then
morphology can be used to distinguish these two categories. Exceptions cannot be excluded but they
should be really exceptional and well grounded; when in doubt, use the category determined by
morphology (if available).

Ambiguous words (belonging to two or more categories) do exist. Sometimes by pure coincidence
([en] _the can_ vs. _can = to be able to_). Sometimes the two words are related but differ
morphologically ([en] _the book(s)_ vs. _to book, booked, booking_).

Perhaps the most difficult part are ambiguous function words that do not inflect (i.e. morphology
does not help us), yet they perform two or more _significantly_ different syntactic functions,
which we normally associate with different parts of speech. The two functions may not be equally
frequent but each of them is more frequent than what could be labeled as a mere exception (i.e.,
the _wait for his ‘yes’_ example below is exceptional). Disambiguating such pairs clearly depends
on the context of the given sentence where the word is used.
So how do we know that the difference is “significant enough”? One clue is that the word, when
translated to another language, gets two different translations with different POS tags (e.g.,
the English _no_ as response interjection, vs. negative determiner). Another clue comes from
contrasting the UD relations used for the two functions. For example, distinguishing `PRON`
from `SCONJ` ([en] _that_, [es] _que_, [ru] _что_ / _čto_) is important because pronouns, unlike
conjunctions, may become core arguments and fill valency slots of verbs. Distinguishing `SCONJ`
from `ADP`, or `CCONJ` from `ADV` seems less crucial and we can keep just one POS tag
for each such word, based on prototypical usage.

### Using a word vs. mentioning it

The universal POS tags should capture regular, prevailing syntactic behavior, as well as morphological characteristics
when available, and should not reflect sentence-specific exceptional behavior. In particular, the POS tags do not distinguish actual usage of a word from just mentioning it. Thus in both the following examples, _yes_ will be tagged as interjection:

* _Yes, I think so._
* _I am waiting for his ‘yes’ on the matter._

Similarly, in both the following examples, _precede_ will be tagged as verb:

* _Such discussion must precede every decision._
* _He pronounced ‘precede’ in a funny way._

### Pronominal words

Pronominal words are [pronouns](/u/pos/PRON.html), [determiners](/u/pos/DET.html) (articles and pronominal adjectives),
pronominal [adverbs](/u/pos/ADV.html) _(where, when, how)_, and in traditional grammars of some languages also pronominal [numerals](/u/pos/NUM.html) _(how much)_.

* In most cases it is straightforward to determine whether a word is pronominal (see also the [PronType](/u/feat/PronType.html) feature)
  but the borderline between indefinite determiners and adjectives is slightly fuzzy. Related languages should synchronize the lists of words
  they treat as pronominal. The rest of these guidelines demarcate borders within the pronominal group.
* Pronominal adverbs are tagged `ADV`. Their pronominality is encoded using the `PronType` feature. Their typical syntactic function is to modify verbs.
* Articles _(the, a, an)_ are always tagged `DET`; their `PronType` is `Art`.
* Pronominal numerals (quantifiers) are tagged `DET`; besides `PronType`, they also use the [NumType](/u/feat/NumType.html) feature.
* Words that behave similar to adjectives are `DET`.
  (We understand the `DET` class as pro-adjectives, which is a slightly broader sense than what is usually regarded as determiners in English.
  In particular, it is possible that one nominal is modified by more than one determiner.) Similar behavior means:
  * They are more likely to be used attributively (modifying a noun phrase) than substantively (replacing a noun phrase). They may occur alone, though.
    If they do, it is either because of ellipsis, or because the hypothetical modified noun is something unspecified and general, as in _All [visitors] must pay._
  * Their inflection is similar to that of adjectives, and distinct from nouns. They agree with the nouns they modify.
    Especially the ability to inflect for gender is typical for adjectives and determiners.
    (Gender of nouns is determined lexically and determiners may be required by the grammar to agree with their nouns in gender; therefore they need to inflect for gender.)
* Non-possessive personal, reflexive or reciprocal pronouns are always tagged `PRON`.
* Possessives vary across languages. In some languages the above tests put them in the `DET` category.
  In others, they are more like a normal personal pronoun in a specific case (often the genitive), or a personal pronoun with an adposition; they are tagged `PRON`.
* When the above rules do not help, the category should be based on what the traditional grammar of the language says.
* Ideally, language-specific documentation should list pronominal words and their category. These are all closed classes so it should not be difficult.

### See also

The guidelines for the following special cases are documented on the referenced pages
for specific POS tags:

* Abbreviations and acronyms: described under [SYM]()

## Features

Features are additional pieces of information about the word, its part of speech
and morphosyntactic properties. Every feature has the form `Name=Value` and
every word can have any number of features, separated by the vertical bar, as in
`Gender=Masc|Number=Sing`.

Analogically to part-of-speech tags, features describe the word form but not
necessarily its exact function in the given sentence. Most of the features are
for locating the form in a slot of a morphological paradigm, and are canonical
labels for the slot. Thus, for example, the [Voice]() feature is used in Czech
to distinguish passive participles (_prodán_ “sold” `Voice=Pass`), which are
morphologically distinct from active participles (_prodal_ “sold” `Voice=Act`);
however, the feature is not used in English, where the same form is used in
active and passive constructions alike (cf. _he has sold it_ vs. _it was sold_).
On the other hand, some word forms are homonymous and context must be used to
identify the paradigm slot to which they belong. For example, the morphological
paradigm of Czech nouns distinguishes nominative and accusative (among other
[Case]() values), as in _matka_ “mother” `Case=Nom` vs. _matku_ `Case=Acc`.
Nevertheless, due to case syncretism, some other lexemes have the same form in these
two paradigm slots, e.g. _píseň_ “song” is either `Case=Nom` or `Case=Acc` and
it has to be disambiguated by context.

We provide an inventory of
features that are attested in multiple corpora and it is thus
desirable that they are encoded in a uniform way.
The list is certainly not exhaustive and later versions of the standard
may include new features or values found in new languages, corpora or tagsets.

Users can extend this set of universal features and add language-specific
features when necessary. Such features should be described in the language-specific
documentation and follow the general principles outlined here.
Universal and language-specific features of a word are listed together in the FEATS column.

* There are two types of identifiers:
  - feature names = _features_
  - feature values = _values_
* All identifiers (both features and values) consist of English letters or,
  occasionally, digits 0-9. The first letter is always uppercase.
  The other letters are generally lowercase, except for positions where new
  internal words are marked for better readability (e.g. `NumType`).
  This makes features distinct from the
  universal POS tags
  (all uppercase) and from the
  universal dependency relations
  (all lowercase).
* A feature of a word should always be fully specified in the data, i.e. both
  the feature name and the value should be identified: `PronType=Prs`.
  Note that the values are not guaranteed to be unique across features,
  e.g. `Sup` could denote the superessive case, superlative degree of comparison
  or supine (a verb form).
* Not mentioning a feature in the data implies the empty value,
  which means that the feature is either irrelevant for this part of speech,
  or its value cannot be determined for this word form due to language-specific reasons.
* It is possible to declare that a feature has two or more values for a given word:
  `Case=Acc,Dat`. The interpretation is that the word may have one of these values
  but we cannot decide between them. Such _multivalues_ should be used sparingly.
  They should not be used if the value list would cover the whole value space,
  or the subspace valid for the given language.
  That would mean that we cannot tell anything about this feature for the given word,
  and then it is preferable to just leave the feature out.
* Canonical ordering: features of one word (appearing on the same line) are
  always ordered alphabetically; if a feature has multiple values, these are
  ordered alphabetically, too. This rule facilitates cases when it is necessary
  to compare feature sets of two words.
  Alphabetical sorting means that uppercase letters are considered identical to their lowercase counterparts.
  So for example, `Number` precedes `NumType`.
* Description of individual features usually hints what parts of speech the
  feature is likely to appear with. This information is intended to help
  understand the typical usage of the feature; however, it is _not a strict rule!_
  Applicability of features to parts of speech is very language-dependent
  and it should never be assumed that the feature cannot appear together with
  a particular POS tag.

### Lexical Features

All of these can be considered attributes of lexemes or lemmas (rather than
individual word forms) and they represent a fine-grained
sub-classification of words.

### Inflectional Features

These are mostly features of word forms rather than lemmas.
There are exceptions: for instance, gender of nouns is
usually a lexical feature (all word forms of one lemma have the same gender).
However, other parts of speech (adjectives, pronouns, verbs) may inflect for
gender because of agreement with nouns.

### Layered Features

In some languages, some features are marked more than once on the same word.
We say that there are several _layers_ of the feature.
The exact meaning of individual layers is language-dependent.

For example, possessive adjectives, determiners and pronouns may have two
different values of [u-feat/Gender]() and two of [u-feat/Number](). One of the values is determined
by agreement with the modified (possessed) noun. This is parallel to other
(non-possessive)
adjectives and determiners that agree in gender and number with the nouns they
modify. The other value is determined lexically because it is a property of
the possessor.

For detailed examples of layered features, see
Layered Features.

If a feature is (can be) layered in a language, the name of the feature must
indicate the layer. An additional identifier in square brackets is used to
distinguish layers, e.g. `Gender[psor]` for the possessor's gender.
We recommend that the layer identifiers consist of lowercase English letters
`[a-z]` and/or digits `[0-9]`.
The layers, their meaning and their
identifiers must be defined in a language-specific extension to this
documentation. For each layered feature, one layer may be defined as default
and the corresponding features then appear without identifier,
e.g. `Gender=Masc|Gender[psor]=Fem`.

repository: UniversalDependencies/docs

branch_name: refs/heads/pages-source

extension: md

gha_language: HTML

license_type: permissive

repo_name: UniversalDependencies/docs


text:
###Production use

    npm install
    node express.js

Mount express app on port 9860 on /api

###Sample data
Open `posts-generator.json` and copy the contents.
Go to [JSON Generator](http://www.json-generator.com/) and paste the code in the first box
Hit 'generate' and watch the magic happen.
Load this data into the mongo instance configured in `express.js`

To import the generated data paste it into a file `myposts.json` and transfer it to your mongo-server.
Then run:

    mongoimport --db tuvok --collection posts --file myposts.json

license: MIT

repository: TuvokVersatileKolinahr/website

branch_name: refs/heads/master

gha_language: JavaScript

repo_name: TuvokVersatileKolinahr/website


text:
# Advanced XY Series Types
Androidplot offers several specialized implementations of XYSeries providing various performance
or usability enhancements.

## EditableXYSeries
Enhances the standard XYSeries interface with edit methods.

## FixedSizeEditableXYSeries
An implementation of EditableXYSeries that supports modifying x/y values and has been optimized
for speed. FixedSizeEditableXYSeries is optimized for data whose samples may frequently change but
whose absolute size doesn't change, such as an ECG (ring buffer) or an animated plot.

## FastXYSeries
By default, Androidplot iterates over every element in each series every render cycle to
determine it's current min/max values.  This is necessary in order to support dynamic plots where
data can change at any moment and invalidate the previously calculated min/max vals.

FastXYSeries allows the developer to provide a more efficient algorithm to obtain min/max XVals
and avoid the high overhead of this iteration.  For example, if you know your XVals will always
be in strict ascending order then the first and last XVal of the series will always contain the
min/max XVals respectively.

XYSeries implementation supports a min/max algorithm implementation that is more efficient than doing
a comparison on each point of the series via iteration. It's a good idea to implement this interface
if your series will contain more than about 500 points

## OrderedXYSeries
If the XVals of your series are in ascending order, implementing this interface provides a hint to
the series renderer that allows it to avoid iterating over points that are outside the screen's
visible domain.  For larger data sets, implementing this interface can mean the difference between
smooth animations and freezing.

## ScalingXYSeries
Wraps any other instance of XYSeries and provides a simple interface for dynamically
scaling x and/or y values.  A popular use case for dynamic scaling is to create an animated intro
for your XYSeries where yVals increase (or decrease in the case of negative values) from 0 towards
their original value. The [AnimatedXYPlotActivity](../demoapp/src/main/java/com/androidplot/demos/AnimatedXYPlotActivity.java)
in the DemoApp is one example on how this can be accomplished.

## SampledXYSeries
SampledXYSeries is meant for use with extremely large datasets.  Given a series, multiple sampled
series instances at stepped resolutions are generated for faster rendering.

Basic usage:

```java
XYSeries series = ... // instantiate an XYSeries however you want here

// wrap our series in a SampledXYSeries with a threshold of 1000:
SampledXYSeries sampledSeries =
    new SampledXYSeries(series, OrderedXYSeries.XOrder.ASCENDING, 2,100);

// add the SampledXYSeries instance to the plot:
plot.addSeries(sampledSeries, formatter);
```

SampledXYSeries is meant to be used in conjunction with ZoomEstimator, which enables a plot to
automatically render using the resolution appropriate for the current screen boundaries, allowing
pan / zoom operations to perform with little or no degradation as series size increases.

To enable ZoomEstimator:

```java
// enable autoselect of sampling level based on visible boundaries:
plot.getRegistry().setEstimator(new ZoomEstimator());
```

[The Touch Zoom Example source code](../demoapp/src/main/java/com/androidplot/demos/TouchZoomExampleActivity.java) provides a functional reference implementation.

If you want to take advantage of the performance benefits of sampling but don't need pan/zoom support
check out the Sampling section below.

## NormedXYSeries
A convenience wrapper to simplify normalizing XYSeries data in the range of 0 to 1.  Usage is straightforward:

```java
XYSeries normedSeries = new NormedXYSeries(series);
```

which is equivalent to:

```java
XYSeries normedSeries = new NormedXYSeries(series, null, new Norm(null, 0, false));
```

The first null argument pertains to the normalization being applied to the x axis values.  While normalization
can certainly be applied on this axis, it's typically unused, which is why the single argument constructor
defaults to a null value here.

Both examples auto normalize the passed in series, maximizing the resolution of the
output result.  Sometimes however, it's desirable to control the output resolution for the purpose
of visually shifting the result up or down in the graph.  This can be done by using the `NormedXYSeries.Norm`
constructor's second and third arguments: `offset` and `useOffsetCompression`.

##### offset
This value is added to the original normalized value to effectively shift the series data up or down
within the normalized range.  If the offset is large enough and offset compression is not used, this
can cause normalized values to exceed the norm range of 0 to 1.

##### useOffsetCompression
If you want to shift a normalized series up or down in the graph but do not want the shift to potentially
move values offscreen, you can set `useOffsetComression` to true.  This tells `NormedXYSeries` to shrink
the scale of the associated series relative to the offset being used to ensure that normed values
stay within the range of 0 to 1.  If set to true and you supply an offset <0 or >1, an
`IllegalArgumentException` will be thrown.

We've not talked about the first argument to the `NormedXYSeries.Norm` constructor: `minMax`.  This is an
optional optimization value that reflects min/max values in the series data being passed in.  If they
are known, you can pass these in to speed up normalization, otherwise just pass in null and they will
be auto calculated.

IMPORTANT: If your series data is dynamic and it's min/max values change at runtime, you'll need to invoke
`NormedXYSeries.normalize(Norm, Norm)` immediately following each change in order to maintain accuracy.

There's a [reference implementation](../demoapp/src/main/java/com/androidplot/demos/DualScaleActivity.java)
of a dual scale plot that demonstrates NormedXYSeries usage in the DemoApp.

# Sampling
Series size is generally the biggest factor when it comes to rendering performance.  If you're plotting
very large datasets, its generally a good idea to sample the data to improve performance.
For example, if you have an XYSeries that consists of 10,000 points, we can sample that data into
the 200 points that most accurately represent the profile of the original series:

```java
// An instance of any implementation of XYSeries.  Assume it's size is 10,000
XYSeries originalSeries = ...;

// Sampled series of size 200:
EditableXYSeries sampledSeries = new FixedSizeEditableXYSeries(
    originalSeries.getTitle(), 200);

// an instance of an implementation of Sampler:
Sampler sampler = ...

// do the actual sampling:
new LTTBSampler().run(originalSeries, sampledSeries);
```

Currently LTTBSampler is the only available implementation.

# Storing series data in onSaveInstanceState
If your series data requires a non trivial amount of preprocessing (subsampling etc.) or your data comes
from a dynamic source, you'll likely want to persist your series data when your Activity saves its
instance state.  There are a few caveats to be aware of:

* You can only persist about 1mb worth of data at a time so if your series data is much larger than that
you'll need to find a creative solution to the problem
* Due to [quirks in the way Android persists data](http://stackoverflow.com/questions/12300886/linkedlist-put-into-intent-extra-gets-recast-to-arraylist-when-retrieving-in-nex)
`XYSeries` implementations such as `SimpleXYSeries` that use `LinkedList` instances to store data cannot be serialized directly.
* Formatters generally cannot be persisted as they typically contain instances of `Paint` that cannot be serialized directly..

Due to these limitations we suggest storing `XYSeries` data into an array or `ArrayList` and using that to
instantiate your `XYSeries`.  The DemoApp's [Time Series Example](../demoapp/src/main/java/com/androidplot/demos/TimeSeriesActivity.java)
contains a full source example.

repository: halfhp/androidplot

gha_language: Java

repo_name: halfhp/androidplot


text:
**This is OUTDATED!! Most updated version is [here](https://github.com/reTHINK-project/dev-service-framework/blob/d3.2-working-docs/docs/specs/dynamic-view/discovery)**
========================================================================================================================================================================

#### Discover Hyperty per User URL

The Runtime procedures to Discover available Hyperties for a user.

![Figure @runtime-disocver-hyperty: discover Hyperty](discover-hyperty.png)

**Message to Query Registry Domain for Hyperty Instances**

```
"id" : "1",
"type" : "READ",
"from" : "hyperty://<sp1>/<alice123>",
"to" : "domain://registry.<sp1>"
"body" : { "path" : "/hyperty-instance/user/user://<sp1>/<bob>" }
```

**Response Message returning the discovered Hyperty Instances**

```
"id" : "1"
"type" : "RESPONSE",
"from" : "domain://registry.<sp1>"",
"to" : "hyperty://<sp1>/<alice123>",
"body" : { "code": 200, "hyperty-instances": ["hypertyInstance" : { "url" : "hyperty://<sp1>/<bob123>" , "user" : "user://<sp1>/<bob>" , ... }, ...] }
```

repository: reTHINK-project/core-framework

repo_name: reTHINK-project/core-framework


text:
# secure-go-setup-ubuntu-digital-ocean
Secure Go Setup In DigitalOcean with Ubuntu

# How to setup Go in digitalocean Ubuntu 16.04

## Setup ssh keys
* For UNIX
    1. Check if key already exists.
        * `cat ~/.ssh/id_rsa.pub`
    1. If key does not exist, generate it.
        * `ssh-keygen`
        * The default location is best.
        * A passcode is only needed for high security sites, just don't lose your computer.
        * You can find your public key in the file with a .pub extension.
* For Windows
    1. Just install Gitbash so we can use same command with UNIX above.

## Setup Ubuntu user account
1. Create a server.
    * Make sure to set the server to ubuntu 16.04.
    * 32-bit is recommended unless you have more than 4gb of RAM, except for if you use Aerospike, which requires 64-bit for both main database and API.
    * Make sure you turn on private networking so you can connect to your database without using up bandwidth.
    * Make sure you have put in an ssh key here to avoid unsecure password logins.
    * It is a good idea to turn on IPv6 so your server will support it.
1. Connect to server's root account.
    * Use ssh on unix machines.
        * `ssh root@<ip_address>`
    * Make sure you have setup ssh keys with your computer.
    * Windows users should use putty.
1. Create a user with sudo access.
    * `adduser <username>`
    * Make sure to put in a good password!
    * You can leave the other settings blank, just keep pressing enter.
    * Give the user sudo access.
        * `gpasswd -a <username> sudo`
1. Add ssh key access to new user account.
    * Flip your access to the new user.
        * `su <username>`
    * Move to the home directory.
        * `cd`
    * Create folder and restrict access to only yourself.
        * `mkdir .ssh`
        * `chmod 700 .ssh`
    * Create a file and add ssh key to it.
        * `nano .ssh/authorized_keys`
        * Paste key into file and save and exit with Ctrl-X.
            * Ctrl-Shift-V for unix users to paste.
            * Right-click in window to paste for putty.
    * Restrict the permissions of the file.
        * `chmod 600 .ssh/authorized_keys`
    * Return to root.
        * `exit`
    * Test if it worked.
        * Connect to your new account with either putty or ssh
            * `ssh <username>@<ip_address>`
        * If it asks for your password, something went wrong.
1. Restrict ssh access to root and password connections.
    * As root, edit the settings in the ssh config file.
        * `nano /etc/ssh/sshd_config`
        * Set the line `PermitRootLogin` to no to disable root login.
        * Set the line `PasswordAuthentication` to no to disable logging in with a password.
            * Make sure to uncomment the line as well.
        * Restart the ssh service.
          * `service ssh restart`
    * Make sure you test if you can still access it with normal connection before you disconnect the root terminal.
    * And test that the root login really is disabled.

## Setup additional helpful items
1. Setup firewall.
    * Allow ssh through the firewall.
        * `sudo ufw allow ssh`
        * or `sudo ufw allow 22/tcp`
    * Examine the rules.
        * `sudo ufw show added`
    * If everything looks right, enable the firewall.
        * `sudo ufw enable`
    * Make sure everything is running right.
        * `sudo ufw status`
1. Synchronize the system clock.
    * Set timezone.
        * `sudo dpkg-reconfigure tzdata`
        * A graphical menu will allow you to choose a city to sync time with.
    * Install NTP.
        * If you have not used apt-get yet, run `sudo apt-get update`
        * `sudo apt-get install ntp`
        * ntp will automatically place enable run on boot.
1. Create a swapspace.
    * Reserve the space.
        * `sudo fallocate -l <size> /swapfile`
        * `<size>` is something like `1G` or `512M`
    * Restrict access to root only.
        * `sudo chmod 600 /swapfile`
    * Configure into a swapfile.
        * `sudo mkswap /swapfile`
    * Start using the swapfile.
        * `sudo swapon /swapfile`
    * Setup automatically using the swapfile on boot.
        * `sudo sh -c 'echo "/swapfile none swap sw 0 0" >> /etc/fstab'`
1. This is a good point to make a snapshot of your server.
    * Shut the server down.
        * `sudo poweroff`
    * Save a snapshot in the digitalocean console.

    * If you have Go 1.5 or newer, you can cross compile most programs and transfer the executable.
    * Some packages still require a native Go install to build though.
    * Download Go.
        * `wget <url>`
        * The url for 32-bit 1.7.1 is `https://storage.googleapis.com/golang/go1.7.1.linux-386.tar.gz`
        * The url for 64-bit 1.7.1 is `https://storage.googleapis.com/golang/go1.7.1.linux-amd64.tar.gz`
    * Extract Go from the archive file.
        * `tar -xf <filename>`
    * Move Go to the default install location.
        * `sudo mv go /usr/local/go`
    * Change owner to root and alter permissions.
        * `sudo chown root:root /usr/local/go`
        * `sudo chmod 755 /usr/local/go`
    * Create workspace folder.
        * `mkdir <workspace_name>{,/bin,/pkg,/src}`
    * Edit environment variables.
        * Use `nano <filename>` to edit the file.
            * You have to use `sudo nano <filename>` to edit a file that does not start in `~/`
        * Add `export PATH=$PATH:/usr/local/go/bin` to `/etc/profile`
        * Add `export GOPATH=$HOME/<workspace_name>` to `~/.profile`
        * Add `export PATH=$HOME/<workspace_name>/bin:$PATH` to `~/.profile`
    * Delete the go archive file.
        * `rm <filename>`
            * This will probably be called something like: `go1.7.1.linux-386.tar.gz`
    * Install git.
        * `sudo apt-get install git`
    * Reconnect to the server to allow environment variables to update.
1. Adjust firewall to allow http connections.
    * Allow http through the firewall.
        * `sudo ufw allow http`
        * or `sudo ufw allow 80/tcp`
    * Allow https through the firewall, if needed.
        * `sudo ufw allow https`
        * or `sudo ufw allow 443/tcp`
1. Setup haproxy.
    * Install haproxy.
        * `sudo apt-get install haproxy`
    * Configure haproxy.
        * Edit `/etc/haproxy/haproxy.cfg`
        * Add `retries 3` to the default section.
        * Add `option redispatch` to the default section.
        * Add the following block to the end of the file:
        ```
        listen serv
            bind *:80
            mode http
            option http-server-close
            timeout http-keep-alive 3000
            server serv <IP_ADDRESS>:9000 check
        ```
        * If you want to bind to both IPv6 and IPv4, change the bind command to `bind :::80 v4v6`
        * If your server can handle https traffic, change mode to `mode tcp`

    * More information available [here](https://www.digitalocean.com/community/tutorials/how-to-use-haproxy-to-set-up-http-load-balancing-on-an-ubuntu-vps).
  * Reload haproxy
    * `sudo service haproxy reload`
1. Get your code onto the server.
    * If you are on windows, use WinSCP.
    * If you are on a unix machine, use scp.
        * `scp <source> <destination>`
        * Add -rp if it is a folder you are transfering.
        * `scp -rp <source> <destination>`
        * The format for remote connections is `<username>@<ip_address>:<path>`
        * Example: `scp -rp ~/Desktop/testServer daniel@<IP_ADDRESS>:~/testServer`
    * Make sure it is built, whether on your system or on the server directly.
1. Configure systemd.
    * Create configuration file: `sudo nano /etc/systemd/system/<filename>.service`
        * <filename> can be anything, just remember what it is so you can use it below.
    * Add the following code to the file:
    ```
    [Unit]
    Description=Go Server

    [Service]
    ExecStart=/home/<username>/<exepath>
    WorkingDirectory=/home/<username>/<exefolderpath>
    User=<username>
    Group=<username>
    Restart=always

    [Install]
    WantedBy=multi-user.target
    ```

    * Add the service to systemd.
        * `sudo systemctl enable <filename>.service`
    * Activate the service.
        * `sudo systemctl start <filename>.service`
    * Check if systemd started it.
        * `sudo systemctl status <filename>.service`
    * More information about systemd commands can be found [here](http://www.linux.com/learn/tutorials/788613-understanding-and-using-systemd/).
    * Check if the server is running with your web-browser, just use the server ip address as the url.

## Setup Aerospike server
1. Download and install Aerospike.
  * Aerospike only works for 64-bit machines unless you build it from source yourself, and recommends at least 2gb of RAM.
  * You can get step-by-step instructions for installation [here](http://www.aerospike.com/get-started/#/linux).
  * Download the archive file.
    * `wget -O aerospike.tgz 'http://aerospike.com/download/server/latest/artifact/ubuntu12'`
  * Extract the archive file.
    * `tar -xvf aerospike.tgz`
  * Go into the directory on run the installer.
    * `cd aerospike-server-community-*-ubuntu12`
    * `sudo ./asinstall`
  * Allow the database port through the firewall.
    * `sudo ufw allow in on eth1 to any port 3000 proto tcp`
  * Start the service.
    * `sudo service aerospike start`
    * Check when it is ready with: `sudo tail -f /var/log/aerospike/aerospike.log | grep cake`
  * Delete the aerospike install files.
    * rm -rf aerospike*
1. Install Aerospike management server (optional).
  * Install python2.x, python development libraries, and gcc
    * `sudo apt-get install python gcc python-dev`
  * Download the package file.
    * `wget -O amc.deb http://www.aerospike.com/download/amc/latest/artifact/ubuntu12`
  * Install the server.
    * `sudo dpkg -i amc.deb`
  * Allow the server port through the firewall.
    * `sudo ufw allow 8081/tcp`
  * Start the server.
    * `sudo /etc/init.d/amc start`
  * Examine the amc in your web-browser, address is: `<server_ip>:8081`
    * When it asks you for the ip of a node, enter the localhost ip: `<IP_ADDRESS>`
  * Delete amc install file.
    * `rm amc.deb`
1. Configure Aerospike.
  * Add namespaces as needed.
    * `sudo nano /etc/aerospike/aerospike.conf`
    * At the bottom of the file is the test and bar namespaces, comment them out and use them as examples.
    * This is also the file where you can configure having multiple nodes in a cluster. More information on configuring Aerospike [here](http://www.aerospike.com/docs/operations/configure/network/).
  * Restart Aerospike.
    * `sudo service aerospike restart`

## Get Go Aerospike library and test server
  1. Get the go client library (64-bit only).
    * `go get github.com/aerospike/aerospike-client-go`
  1. Run the benchmark tool, (64-bit only).
    * Change into the client code directory, tools/benchmark
      * `cd $GOPATH/src/github.com/aerospike/aerospike-client-go/tools/benchmark`
    * Run the tool.
      * `go run benchmark.go -h <ip_address>`
      * Note this will only work from a server in digitalocean, since the firewall is configured to only allow connections from eth1, which is the private network.
      * Private ip address can be found with: `ifconfig | grep "inet addr"`, the middle address should be the private one.

## Additional API help
  * The [godoc](https://godoc.org/github.com/aerospike/aerospike-client-go) page is very large, but has everything, including enterprise edition commands.
  * Information on connecting can be found [here](http://www.aerospike.com/docs/client/go/usage/connect/).
  * Information on writing a record, including how to write to a single value in a field and how to set an expiration date for data can be found [here](http://www.aerospike.com/docs/client/go/usage/kvs/write.html).
  * Information on reading a record, including only getting parts of an object, can be found [here](http://www.aerospike.com/docs/client/go/usage/kvs/read.html).
  * Information on queries can be found [here](http://www.aerospike.com/docs/client/go/usage/query/query.html).
  * When you are querying on something, make sure you add a secondary index for that field. You can do that programmatically with Go, or using the Aerospike management server.


text:
    MeetApp FullStack

  Meetapp is an application built on Nodejs, ReactJS, and React Native that serves to manage the creation of general events

This projects was developed at the [RocketSeat GoStack Bootcamp](https://rocketseat.com.br/bootcamp) with the following technologies:

## :rocket: Backend Technologies

- [Node.js](https://nodejs.org/)
- [Express](https://expressjs.com/)
- [nodemon](https://nodemon.io/)
- [Sucrase](https://github.com/alangpierce/sucrase)
- [Docker](https://www.docker.com/docker-community)
- [Sequelize](http://docs.sequelizejs.com/)
- [PostgreSQL](https://www.postgresql.org/)
- [node-postgres](https://www.npmjs.com/package/pg)
- [Redis](https://redis.io/)
- [MongoDB](https://www.mongodb.com/)
- [Mongoose](https://mongoosejs.com/)
- [JWT](https://jwt.io/)
- [Multer](https://github.com/expressjs/multer)
- [Bcrypt](https://www.npmjs.com/package/bcrypt)
- [Youch](https://www.npmjs.com/package/youch)
- [Yup](https://www.npmjs.com/package/yup)
- [Bee Queue](https://www.npmjs.com/package/bcrypt)
- [Nodemailer](https://nodemailer.com/about/)
- [date-fns](https://date-fns.org/)
- [Sentry](https://sentry.io/)
- [DotEnv](https://www.npmjs.com/package/dotenv)
- [VS Code](https://code.visualstudio.com/) with [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)

## :information_source: How To Use

```bash
# Clone this repository
$ git clone https://github.com/eltonlazzarin/meetapp.git

# Go into the repository
$ cd backend

# Install dependencies
$ yarn

# Run the app
$ yarn dev
```

## :memo: License

This project is under the MIT license.

---

## :rocket: Frontend Technologies (WebApp)

This project was developed at the [RocketSeat GoStack Bootcamp](https://rocketseat.com.br/bootcamp) with the following technologies:

- [ReactJS](https://reactjs.org/)
- [Create React App Configuration Override](https://github.com/sharegate/craco)
- [Redux](https://redux.js.org/)
- [Redux-Saga](https://redux-saga.js.org/)
- [React Router v5](https://github.com/ReactTraining/react-router)
- [styled-components](https://www.styled-components.com/)
- [Axios](https://github.com/axios/axios)
- [History](https://www.npmjs.com/package/history)
- [Immer](https://github.com/immerjs/immer)
- [Polished](https://polished.js.org/)
- [React-Toastify](https://fkhadra.github.io/react-toastify/)
- [React-Icons](http://react-icons.github.io/react-icons/)
- [Unform](https://github.com/Rocketseat/unform)
- [Yup](https://www.npmjs.com/package/yup)
- [date-fns](https://date-fns.org/)
- [Reactotron](https://infinite.red/reactotron)
- [VS Code](https://code.visualstudio.com) with [EditorConfig](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) and [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)

## :information_source: How To Use

```bash
# Clone this repository
$ git clone https://github.com/eltonlazzarin/meetapp.git

# Go into the repository
$ cd frontend

# Install dependencies
$ yarn

# Run the app
$ yarn start
```

### :memo: License

This project is under the MIT license.

---

## :rocket: Mobile Technologies

This project was developed at the [RocketSeat GoStack Bootcamp](https://rocketseat.com.br/bootcamp) with the following technologies:

- [React Native](https://facebook.github.io/react-native/)
- [babel-plugin-root-import](https://github.com/entwicklerstube/babel-plugin-root-import)
- [react-navigation](https://reactnavigation.org/)
- [react-native-gesture-handler](https://github.com/kmagiera/react-native-gesture-handler)
- [Redux](https://redux.js.org/)
- [Redux-Saga](https://redux-saga.js.org/)
- [redux-persist](https://github.com/rt2zz/redux-persist)
- [styled-components](https://www.styled-components.com/)
- [Axios](https://github.com/axios/axios)
- [Immer](https://github.com/immerjs/immer)
- [date-fns](https://date-fns.org/)
- [react-native-linear-gradient](https://github.com/react-native-community/react-native-linear-gradient)
- [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons)
- [Reactotron](https://infinite.red/reactotron)
- [reactotron-redux](https://github.com/infinitered/reactotron-redux)
- [reactotron-redux-saga](https://github.com/infinitered/reactotron-redux-sagan)
- [VS Code](https://code.visualstudio.com) with [EditorConfig](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) and [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)

## :information_source: How To Use

```bash
# Clone this repository
$ git clone https://github.com/eltonlazzarin/meetapp.git

# Go into the repository
$ cd mobile

# Install dependencies
$ yarn

# Run the app (iOS)
$ react-native run-ios --simulator="iPhone XS Max"

or

# Run the app (Android)
$ react-native run-android
```

## :memo: License

This project is under the MIT license. See the [LICENSE](https://github.com/eltonlazzarin/meetapp/blob/master/LICENSE) for more information.

---

Made with ♥ by Elton Lazzarin :wave: [Get in touch!](https://www.linkedin.com/in/eltonlazzarin/)

repository: eltonlazzarin/meetapp

gha_license_id: MIT

repo_name: eltonlazzarin/meetapp


text:
# honor-altgraph package

The default behavior of Atom is to allow keybindings to shadow AltGraph modified characters. This package adds a [custom keystroke resolver](https://atom.io/docs/api/v1.14.4/KeymapManager#instance-addKeystrokeResolver) to change this behavior to always honor AltGraph modified keys on Windows when one exists.

If you are using a typography layout you might always intend to write the AltGraph modified character when one exists and don't want keybindings to block your ability to type AltGraph modified characters.

**Note:** Currently only Windows is supported.


text:
# "pax" Command

This command is born to integrate two major archivers "tar" and "cpio." It appeared in the POSIX specification 1998 edition. Note that **"tar" and "cpio" have been removed** from the document in place of "pax."[1]

Thus, strictly speaking, you should use the "pax" command for archiving. Of course, it supports both the archive format even though it has yet another format "ustar." And, the recent versions of tar also know the ustar format.

## But Not So Popular

However, it's not confident to say that "pax" is popular. Some Linux distributions like "Debian," "Ubuntu," and so on don't install it on initial status. So, you should make sure that there is pax or tar on your computer and choose one of them with a shell script like this:

### Dealing with Tar Archive with the Care of Compatibility

``` sh
if   type pax >/dev/null 2>&1; then pax -rs '!^/!./!' -f SOME_ARCHIVE.tar
elif type tar >/dev/null 2>&1; then tar -x            -f SOME_ARCHIVE.tar
fi
```

This example seems that pax argument is more complicated than tar's one. That is to keep compatible with the default behavior of tar command. In the case the path of the archive file starts from "/," it means an absolute-path, tar tries removing it while pax doesn't. The "-s" option is to make pax do the same behavior as tar.

---
1. The name "pax" has two meanings. One is "packs." It's the third-person singular present conjugation for "pack." The other is "peace" in Latin. There is a wish in this name to finish the power struggle between tar and cpio.

license: Unlicense


text:
Save program in a file called task1.py and the plan in a file called plan1.txt. Calculate the area of a regular polygon. A regular polygon is one in which all sides are the same length and the angles all have the same degree. The formula for the area of a regular polygon is

![AreaFormula](https://pi998nv7pc.execute-api.us-east-1.amazonaws.com/production/svg?tex=Area%3D%5Cfrac%7Bn%5Ctimes%20s%5E2%7D%7B4%5Ctimes%5Ctan%5Cleft(%5Cfrac%7B%5Cpi%7D%7Bn%7D%5Cright)%7D)

where n is the number of sides and s is the length of each side. Prompt the user for the length and number of sides and display the result, with an appropriate message, to the user.

You must use the math modules for pi, tan(), and pow(). You must use different techniques for importing in order to use items from the module exactly as follows (with the appropriate parameters) in your code:

    tan()
    math.pow()
    pi

Output should be rounded to 5 decimal places using the round() function.

Here is a site you can use to create test cases: https://keisan.casio.com/exec/system/1223282135

path: /Assignment 4/Task1.md

branch_name: refs/heads/main

gha_language: Python


text:
# STOCK EXCHANGE LOSSES

The "Stock Exchange Losses" puzzle on Codingame is a problem that involves finding the maximum loss in a series of stock prices. The goal is to determine the largest decrease (loss) between any two prices in a given list.

The problem provides you with the following information:

- Input: The input consists of two lines. The first line contains an integer, N, representing the number of stock prices. The second line contains N space-separated integers, representing the stock prices in chronological order.

- Output: You need to output a single integer, which represents the maximum loss among all possible pairs of stock prices.

To solve this puzzle, you need to analyze the given list of stock prices and identify the largest decrease between any two prices. This can be done by iterating over the list and comparing each price with the maximum price seen so far. If a lower price is encountered, you update the maximum loss if it is greater than the current maximum loss.

The solution strategy I described in the previous response provides a general approach to solving this problem. By following that strategy, you can calculate the maximum loss and obtain the correct output for the puzzle.

repository: charlesfranciscodev/codingame

repo_name: charlesfranciscodev/codingame


text:
# provider-openstack

A [Crossplane](https://crossplane.io/) Provider for OpenStack resources.

## Developing

Run against a Kubernetes cluster:

```console
make run
```

Build, push, and install:

```console
make all
```

Build image:

```console
make image
```

Push image:

```console
make push
```

Build binary:

```console
make build
```

repository: rochaporto/provider-openstack

repo_name: rochaporto/provider-openstack


text:
# PAINT IT
##### A Paint Program Using Pygame

## Instructions
1. [Download](https://github.com/neeleshpandey/PaintIt/archive/refs/heads/master.zip) or Clone this Repository in your Local Environment
2. Download and install [`Python3`](https://www.python.org/downloads/)
3. Install [Pygame](https://www.pygame.org/) library `pip3 install pygame` or `python3 -m pip install pygame`
4. Run `main.py`

repository: neeleshpandey/PaintIt

repo_name: neeleshpandey/PaintIt


text:
Supporting code for creating packages and metapackages for [UCSC
executables](http://hgdownload.cse.ucsc.edu/admin/exe/).

The script `create-ucsc-packages.py` downloads the program listing from UCSC,
downloads the source code, and creates recipes for every identified program
(e.g., 115 programs in v324). There are some special cases handled by the
script. The script uses the templates in this directory to be able to compile
the tools individually in each recipe.

Update `ucsc_config.yaml` to update the packages when a new version comes out.

repository: bioconda/bioconda-recipes

gha_language: Shell

repo_name: bioconda/bioconda-recipes


text:
# readGitHub.js

A jQuery plugin to load GitHub files into your page

## Install

Packages are available via Bower and NPM

```
npm install --save readgithub
```

```
bower install --save readgithub
```

## Use

Include `dist/css/readgithub.css` and `dist/js/readgithub.js` in your page, ensuring jQuery is loaded first.

``` html
<!-- css -->
<link rel="stylesheet" href="bower_components/readgithub/dist/css/readgithub.css">
<!-- jQuery -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<!-- readGitHub -->
<script src="bower_components/readgithub/dist/js/readgithub.js"></script>
```

Add the following line whereever you would like to render a file from GitHub:

``` html
<div rel="github" data-repo="username/repository"></div>
```

Finally, call the readGitHub method in your javascript

``` js
$(document).ready(function() {
	$('[rel~="github"]').readGitHub()
})
```

readGitHub will look for the `rel="github"` and read the requested repository from `data-repo`.

## Configuration

A number of configuration options are available. One of the most powerful features is the option to use a renderer. For instance you can declare a Markdown render, read your `README.md` and readGitHub will load and convert your `.md` as html.

### Using a renderer

``` js
$('[rel~="github"]').readGitHub({
	renderer: function(file) {
		// Your render function
		return file
	}
})
```

For instance to render with markdown-it include the script before `readGitHub.js`.

``` html
<!-- markdown-it -->
<script src="//cdnjs.cloudflare.com/ajax/libs/markdown-it/2.2.1/markdown-it.js"></script>
```

And use the following within your javascript

``` js
$('[rel~="github"]').readGitHub({
	renderer: function(file) {
		return window.markdownit().render(file)
	}
})
```

repository: StudioLE/readgithub

repo_name: StudioLE/readgithub


text:
# Usage

## Concepts

* Example — a condition, a check, a test.
  Follows [RSpec naming](https://rubydoc.info/github/rspec/rspec-core/RSpec/Core/Example).
  See [Specification by Example](https://en.wikipedia.org/wiki/Specification_by_example).
* Example Group — a group of examples.

It is important to understand that specifications don’t have a notion of tests per se.
xUnit tests are broken into two concepts: actions and checks.

```kotlin
@Test fun `increment changes value`() {
    // This is an action.
    counter.increment()

    // This is a check.
    assertThat(counter.current()).isEqual(1)
}
```
```kotlin
context("increment") {

    // This is an action.
    beforeEach {
        counter.increment()
    }

    // This is a check.
    it("changes value") {
        assertThat(counter.current()).isEqual(1)
    }
}
```

Take a closer look again — tests are trying to be two things at once,
specifications make them atomic and dedicated. When this idea _clicks_ —
there is no way back to xUnit.

## Specification

Specifications are declared as `Spec` subclasses.
`Spec` receives a lambda on a top-level Example Group which allows to declare
further Example Groups and Examples.

```kotlin
class CounterSpec : Spec({

    val counter by memoized { Counter.Impl() }

    it("contains default value") {
        assertThat(counter.current()).isZero()
    }
})
```

## DSL

Example Groups can declare Examples, Example Groups and a bit more.
Examples cannot declare anything.

### `context` and `describe`

Declares an Example Group.

```kotlin
context("nothing") {

    it("does not change value") {
        assertThat(counter.current()).isEqual(0)
    }
}
```

`describe` is a `context` synonym. Use it for grouping `context` declarations
when necessary.

### `it`

Declares an Example.

```kotlin
it("changes value") {
    assertThat(counter.current()).isEqual(1)
}
```

### `fdescribe`, `fcontext` and `fit`

**F**ocuses an Example Group or an Example. Focusing means executing focused entries
and nothing else.

```kotlin
// Skipped.
it("tracks analytics") {
    verify(env.analytics).trackEvent(Analytics.Event.CounterIncrement)
}

// Executed.
fit("changes value") {
    assertThat(counter.current()).isEqual(1)
}
```

### `xdescribe`, `xcontext`, `xit`

E**x**cludes an Example Group or an Example. Excluding means skipping excluded entries.

```kotlin
// Executed.
it("tracks analytics") {
    verify(env.analytics).trackEvent(Analytics.Event.CounterIncrement)
}

// Skipped.
xit("changes value") {
    assertThat(counter.current()).isEqual(1)
}
```

### `beforeEach` and `afterEach`

Declares an action executed before (`beforeEach`) or after (`afterEach`) an example.

```kotlin
beforeEach {
    counter.increment()
}
```

### `memoized`

Declares a special delegate. See [RSpec `let`](https://relishapp.com/rspec/rspec-core/v/3-9/docs/helper-methods/let-and-let).

* The delegated object is created on the first access.
* The object is cached during an example execution.
* The object is removed after the example execution.

```kotlin
val counter by memoized { Counter.Impl() }
```

This is a direct equivalent of the following xUnit declaration.

```kotlin
var counter: Counter? = null

@BeforeEach fun setUp() {
    counter = Counter.Impl()
}

@AfterEach fun tearDown() {
    counter = null
}
```

repository: arturdryomov/conspectus

gha_language: Kotlin

repo_name: arturdryomov/conspectus


text:
# leetcode-stats

## Tech Stack
- React (server side rendering)
- Express

## Data source
- Google spreadsheet (maintained separately)

## Todo
- [x] Average time to solve different difficulty question
- [x] List questions which took more then 1 hour to solve
- [x] List questions that are solved today
- [x] Count questions solved by difficulty
- [x] Avg. questions solved daily
- [x] (Dev) Add eslint
- [x] (Dev) Lint on save
- [x] Color by difficulty, avg.time box
- [x] Add time chart using https://github.com/uber/react-vis
- [x] Center content of home page
- [x] Plot time chart by question difficulty
- [x] (Dev) Add constants file
- [x] Improve npm project commands
- [x] Deploy on Heroku
- [x] (Dev) Add auto refresh on save for React
- [x] Avg time graph
- [ ] Avg time graph of question by difficulty
- [ ] Analyse Leetcode api response https://leetcode.com/api/problems/algorithms/
- [ ] Get all done questions from Leetcode
- [ ] Count questions solved by topics
- [ ] Improve table UI
- [ ] Add question page
- [ ] Fix eslint problems in google-sheet-apis.js
- [ ] Auto refresh if data change in google sheet
- [ ] Add dark mode
- [ ] Parse leetcode question url to extract topics
- [ ] Leetcode login
- [ ] Leetcode get question details using graphql
- [ ] Day chart

repository: divyanshyadav/leetcode-stats

repo_name: divyanshyadav/leetcode-stats


text:
# CADANAC - A System and Method for tracking Covid19 and multiple host infections using Google Cloud, Kubernetes and Hyperledger Fabric

**Maintainers:** [hrad-h](https://github.com/hrad-h/)

Cadanac uses Hyperledger Fabric as the Blockchain Application Platform to run Smart Contracts and store Ledger State.

## Here are the steps to create the Hyperledger Fabric Application Platform Archicture

Hyperledger Fabric Application Platform Archicture is the highest layer of the Cadanac Stack.

The next layer down is Kubernetes.

### Step 1: First install Hyperledger Fabric onto Master GCE server "instance-cadanac-1"

Ensure the prerequisites capabilities are present.

```sh
curl -sSL http://bit.ly/2ysbOFE | bash -s 1.4.4
cd fabric-samples && ls
git -v
docker-compose -v
docker –v

TODO...
```

### Step 3: Install Hyperledger Fabric onto Secondary GCE servers "instance-cadanac-2" and "instance-cadanac-3"

Join each Secondary GCE server to the Master.  Repeat the command below once for each Secondary GCE server.  (During Step 2 the following command

```sh
kubeadm join <IP_ADDRESS>:6443 --token 775e8p.4x5r7rgy1k1v35zp --discovery-token-ca-cert-hash sha256:e3fff8030cd3bc11e66f33f0bff74efbf3621dd422f3eae71ac01dc566a2e25d
```

### Step 3: Configure the Master GCE server "instance-cadanac-1" for Cadanac Development

```sh
export PATH=$PATH:~/Desktop/fabric-samples/bin/
```

## Summary

The Cadanac Hyperledger Fabric Application Platform Archicture consists of the following Docker Containers deployed to Kubernetes Pods:

- Hyperledger Peers
- Hyperledger Orderer
- Hyperledger CA
- Hyperledger CLI (for Development)

repository: hrad-h/cadanac

repo_name: hrad-h/cadanac


text:
sqlite-schemaless
=================

Schemaless database built on top of SQLite. I based the design of `sqlite-schemaless` on the data-store described in [this Uber engineering post](https://eng.uber.com/schemaless-part-one/). All data is stored in a single SQLite database, which can either be on-disk or in-memory.

Data is organized by **KeySpace**. A KeySpace might be something like "users" or "tweets". Inside each KeySpace there are **Rows**. A row is identified by an integer `row_key` and consists of one or more named columns. In these columns you can store arbitrary JSON blobs. So:

* KeySpace1:
    * Row1:
        * ColumnA: {arbitrary json data}
        * ColumnB: {more json data}
    * Row2:
        * ColumnA: {json data}
        * ColumnC: {json data}
    * Row3:
        * ColumnA: {json data}
        * ColumnB: {json data}

So far this is really not that interesting. Things get interesting, though, with the addition of **secondary indexes** and **event emitters**.

Secondary Indexes
-----------------

You can create indexes on values stored in the JSON column data. Suppose we are storing User data in the `user` column. This user data is structured roughly like this:

```javascript
{
  'name': 'Charles',
  'username': 'coleifer',
  'location': {
    'state': 'KS',
    'city': 'Lawrence',
  }
}
```

If we wanted to search for users by username, we would create an index using JSON-path notation: `$.username`. If we wanted to search by the user's state, we would create an index on `$.location.state`.

Here is how the code would look to set this up:

```python

db = Schemaless(':memory:')  # Create an in-memory database.

# Indexes are initialized with the column name and JSON-path.
username_idx = Index('user', '$.username')
state_idx = Index('user', '$.location.state')

# When we create a KeySpace, we can include a list of indexes:
users = db.keyspace('users', username_idx, state_idx)

# To store a user, write:
charles = users.create_row(
    user={
        'username': 'coleifer',
        'location': {'city': 'Lawrence', 'state': 'KS'},
    },
    social=[
        {'name': 'github', 'username': 'coleifer'},
        {'name': 'twitter', 'username': 'coleifer'},
    ])

# To query for users in Kansas, we can write:
ks_users = state_idx.query('KS')
for row in ks_users:
    print row['user']['username']
```

Event emitters
--------------

The other neat feature of `sqlite-schemaless` is the event emitter functionality. This feature allows you to bind handlers to execute code when a new row is created or updated. You can bind handlers to an individual keyspace, or to all keyspaces.

For example, let's add a simple handler to print usernames as they're added or updated.

```python

@users.handler
def print_username(row, column, value):
    if column == 'user':
        print value['username']
```

Whenever we add or update the `user` column of a row in the `users` KeySpace, the callback will fire and print the username.

repository: pombredanne/sqlite-schemaless

repo_name: pombredanne/sqlite-schemaless


text:
---
published: true
breadnav: true
date: '2023-02-10 09:00 -0700'
title: 'Swisscom: "Introducing SRv6 to an existing network"'
author: Segment Routing Team
technology: 'SRv6'
excerpt: "Martin Gysi of Swisscom presents the introduction of SRv6 in their existing network. Sharing Swisscom's experience of introducing SRv6 into their existing network, emphasizing the simplicity and scalability of the SRv6 design. Discussing the migration process, outlining the steps taken to introduce SRv6 in different service domains."
header:
  teaser: 'https://img.youtube.com/vi/EoLoMe_AKZQ/mqdefault.jpg'
---

**Martin Gysi** (IP network and network automation architect, Swisscom) presented "Introducing SRv6 to an existing network" at Cisco Live 2023 Amsterdam.

In this session, Martin shares Swisscom's experience of introducing SRv6 into their existing network, emphasizing the simplicity and scalability of the SRv6 design. He also discusses the migration process, outlining the steps taken to introduce SRv6 in different service domains.

## Video
{% include video id="EoLoMe_AKZQ" provider="youtube" %}

The slides and video recording of the full session ("Introduction to SRv6 uSID Technology – BRKSPG-2203") can be accessed via the [Ciscolive! on-demand library website](<https://www.ciscolive.com/global/on-demand-library.html?#/>). Search on "Martin Gysi", or directly access the session [here](<https://www.ciscolive.com/on-demand/on-demand-library.html?currentTab=session&search=Martin+Gysi&search.Event=2023Amsterdam>). Click Session Video under Watch Session. To access the content of this site a (free) cisco.com registration is required.

repository: xrdocs/segment-routing

branch_name: refs/heads/gh-pages

repo_name: xrdocs/segment-routing


text:
# face-comparison
AI Face comparison using FaceNet, compare two photos and see if they are the same person.

## Installation
```
pip install face-compare
```

## Usage
Use `compare_faces.py` to compare two images of people to see if they are the same person.
```bash
compare_faces.py --image-one /path/to/image_one.png --image-two /path/to/image_two.png
```

Optionally output the cropped image output to a directory (useful for inspecting input to AI model)
```bash
compare_faces.py --image-one /path/to/image_one.png --image-two /path/to/image_two.png -s /path/to/outputs/
```

## Steps Involved
1. A cascade classifier is used to detect the face within the input images.
2. The bounding box of this segmentation is then used to crop the images, and fed into the AI model.
3. The FaceNet model then calculates the image embeddings for the two cropped images.
4. Finally the second embedding is subtracted from the first, and the Euclidean norm of that vector is calculated.
5. A threshold of 0.7 is used to determine whether they are the same person or not.

## Known Issues

#### CPU Only runtime issue
If you are trying to run the module without a suitable GPU, you may run into the following error message:
```
tensorflow.python.framework.errors_impl.InvalidArgumentError:  Default MaxPoolingOp only supports NHWC on device type CPU
```
To fix this issue with Intel CPU architecture, you can install the TensorFlow Intel Optimization package via
```
pip install intel-tensorflow
```

## References
This module uses the AI model FaceNet, which can be found [here](https://github.com/davidsandberg/facenet), and the journal article [here](https://arxiv.org/abs/1503.03832).


text:
Sahaptin/Ichishkíin (Yakima) Keyboard
=====================

Copyright (c) 2019-2020 Keegan Livermore

Version 1.0

__DESCRIPTION__
This project provides a computer keyboard with all Sahaptin/Ichishkíin letters (including alternate characters using the ALT button) as well as a mobile keyboard for both Android and iOS that features a full layout with all characters visible with "alternate" versions (accented and hard) on key-hold options.

Links
-----

 * Contact<EMAIL_ADDRESS>
Supported Platforms
-------------------
 * Windows
 * macOS
 * Linux
 * Web
 * iPhone
 * iPad
 * Android phone
 * Android tablet
 * Mobile devices
 * Desktop devices
 * Tablet devices

repository: keymanapp/keyboards

repo_name: keymanapp/keyboards


text:
# Input File Format

In this file, the format for the input files is detailed.
To run, PyGBe needs two input files: a `config` file and a `parameters` file.
You can find samples of these files in the `examples` directory.

## Config file format
This file has two parts:

`FILE:` indicates in that line a mesh file will be specified.
This code interfaces with the MSMS format, which generates a `filename.vert` and
`filename.face` files.
Each `filename` has the information for the mesh of one surface. To account for
more than one surface (ie. for Stern layers, solvent filled cavities, several
proteins), more than one `FILE` line is needed.
After `filename`, the user must specify what kind of surface `filename` is. It can be:

- `stern_layer`:          surface interfacer stern layer with solvent.

- `dielectric_interface`: surface interfaces low dielectric (inside protein) and
                        high dielectric (outside protein).

- `internal_cavity`:      surface is an internal cavity (a result of '-all_components'
                        flag in MSMS). This is important to specify because by default
                        MSMS changes the vertex ordering for internal cavities.
- `dirichlet_surface`:    surface of specified potential. The value of this potential
                        is read from a text file which has to be specified next to
                        'dirichlet_surface'. (See .phi0 file in example).

- `neumann_surface`:      surface of specified potential. The value of this potential
                        is read from a text file which has to be specified next to
                        'neumann_surface'. (See .phi0 file in example).

`FIELD:` specifies physical parameters of the different regions.
Parameters:

- `LorY`:         1: Laplace,
                2: Yukawa

- `E?`:           1: calculate the energy in this region
                0: don't calculate energy in this region
                Note: if region is surrounded by a dirichlet or neumann surface,
                      surface energy will be calculated.

- `Dielec`:       Dielectric constant

- `kappa`:        reciprocal of Debye length

- `charges?`:     0: No charges inside this region
                1: There are charges in this region

- `coulomb?`:     0: don't calculate coulomb energy in this region
                1: calculate coulomb energy in this region

- `charge_file`:  location of the '.pqr' file with the location of the charges

- `Nparent`:      Number of 'parent' surfaces (surface containing this region)
                Of course, this is either 1 of 0 (if it corresponds to the infinite region)

- `parent`:       file of the parent surface mesh, according to their position in the FILE list,
                starting from 0 (eg. if the mesh file for the parent is the third one specified
                in the FILE section, parent=2)

- `Nchild`:       number of child surfaces (surfaces completely contained in this region).

- `children`:     position of the mesh files for the children surface in the FILE section

``WAVE:`` Only applicable in LSPR problems. It specifies physical parameters of
the incoming electric field in LSPR applications.
Parameters:

-  ``Efield``: electric field intensity, it is in the 'z' direction, '-'
   indicates '-z'.

-  ``Wavelength``: wavelength of the incident electric field, in Ångström.

``EXTERNAL:`` It specifies an external field (potential or electric field)
in biomolecular electrostatic applications.
Parameter:

-  ``Efield``: external potential at z=0 if there are salt ions in the solvent,
otherwise, electric field intensity. Both fixed in 'z' direction.

## Parameters file format

- `Precision`:    double or float. (float not supported yet!).

- `K`:            number of Gauss points per element (1, 3, 4, and 7 are supported).

- `Nk`:           number of Gauss points per triangle edge for semi-analytical integration.

- `K_fine`:       number of Gauss points per element for near singular integrals.

- `threshold`:    defines region near singularity where semi-analytical technique is used.
                if sqrt(2*Area)/r > threshold, integration is done semi-analytically.

- `BSZ`:          CUDA block size.

- `restart`:      number of iterations for GMRES to do restart.

- `tolerance`:    GMRES tolerance.

- `max_iter`:     maximum number of GMRES iterations.

- `P`:            order of expansion in treecode.

- `eps`:          epsilon machine.

- `NCRIT`:        maximum number of boundary elements per twig box of tree structure.

- `theta`:        multipole acceptance criterion of treecode.

- `GPU`:          0: don't use GPU.
                1: use GPU.

repository: pygbe/pygbe

repo_name: pygbe/pygbe


text:
---
layout: post
title: What are HEX file?
excerpt_separator: <!--more-->
tags: hexfile C++ C microcontroller
---

I have been programming microcontroller for the past 6 years and I was always curious what is happening at the lowest level. They are ofcourse they hold some of binary content in them and modern IDEs takes care them. I honestly never really bothered to look into their significance. But recently I had to dissect the hex file and look for some important information.

<!--more-->

Firstly, to resolve the confusion, binary files are different from hex files. Seriously, I used to think they were the same all this time. There are some tools which can convert HEX files to Binary format.

Binary files are the file that contain the flash content that needs to be written into onto the flash. They contain NO OTHER information other than that. However, HEX files are a bit different in terms of what they contain, though they contain the same information that a binary files would.

Hex files are formated in a specific way that all the information needed to flash the microcontroller is stored in it. For example, content that needs to be flashed at a certain region in the memory.

### HEX File Format

: NN AAAA TT DDD... CC

NN - number of bytes present in the line
AAAA - address of the first byte present in the data field
TT - type (shown below in detail)
DD... -  number of data bytes specified by NN (content)
CC - check bits (calculation is shown below)

#### TT Field:

00 - content is data
01 - EOF line
02 - extended segment address

:02 xxxx 02 yyyy CC

        xxxx
    yyyy
    --------
    yyyyxxxx -> absolute memory address
    --------

04 - extended linear address

:02 xxxx 04 yyyy CC

        xxxx
       yyyy
    --------
       ykkkk -> absolute memory address
    --------

05 - start linear address record

### Reference

http://www.keil.com/support/docs/1584/


text:
---
hrs_structure:
  division: '3'
  volume: '12'
  title: 30a
  chapter: '560'
  section: '560:5-309'
type: hrs_section
tags:
  - Property
  - Family
menu:
  hrs:
    identifier: HRS_0560-0005-0309
    parent: HRS0560
    name: '560:5-309 Notice'
weight: 85475
title: Notice
full_title: '560:5-309 Notice'
---
**§560:5-309 Notice.** (a) A copy of a petition for guardianship and notice of the hearing on the petition shall be served personally on the respondent. The notice shall include a statement that the respondent must be physically present unless excused by the court, inform the respondent of the respondent's rights at the hearing, and include a description of the nature, purpose, and consequences of an appointment. A failure to serve the respondent with a notice substantially complying with this subsection shall preclude the court from granting the petition.

(b) In a proceeding to establish a guardianship, notice of the hearing shall be given to the persons listed in the petition. For good cause, the court may waive notice to any person listed in the petition other than the respondent, upon a showing that all reasonable efforts have been made to ascertain the identity and address of the person or to effect notice, that the efforts were unsuccessful, and that further efforts should not be required because that person has not demonstrated a reasonable degree of interest in or concern about the respondent. Failure to give notice under this subsection shall not preclude the appointment of a guardian or the making of a protective order.

(c) Notice of the hearing on a petition for an order after appointment of a guardian, together with a copy of the petition, shall be given to the ward, the guardian, and any other person the court directs.

(d) A guardian shall give notice of the filing of the guardian's report, together with a copy of the report, to the ward and any other person the court directs. The notice shall be delivered or sent within fourteen days after the filing of the report. [L 2004, c 161, pt of §1]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
---
title: Footstep Run Alliance
post_id: '3052'
date: '2002-08-08T05:59:59+09:00'
draft: true
tags: []
---

There are a lot of sites that have been stepping away recently. Besides, this trampling prohibition is bothersome rule against contrary to the original netiquette in various ways. there! While wishing for such a site to disappear from this world, I made a gathering of members who can step forward and escape. _That is the treadle escape alliance!_

*   [Read the full text of the fleeing escape alliance](https://danmaq.com/tag/mine)
*   [The web page at the time of establishment](https://danmaq.com/old/2001/1/alliance/mine/) (Because the display on the browser at the time was matched, there is a possibility that the display may be distorted in modern browsers.)

filename: 08-踏み逃げ同盟って？.en.md