text:
# Plugins API

All functionality outside of the base [CAS protocol][casp] is implemented via
plugins. The list of plugin types, and the order in which they will be
loaded, is:

+ `theme`: provides templates for various parts of the user interactive portions
  of the protocol (e.g. a login form)
+ `ticketRegistry`: provides functionality to create and validate tickets
+ `serviceRegistry`: provides functionality to create, manage, and validate
  allowed services
+ `auth`: provides a function to validate credentials (username and password)
+ `misc`: provides various add-on functionality that isn't necessarily specifc
  to the CAS protocol

Plugins are initialized in two phases, and only the first phase is required.

**JSON Responses:** if your plugin defines an API that should be returning
JSON as a response, then you *must* set `api = true` on the `request`. Example:

```javascript
const yourApiRoute = {
  path: '/your-plugin/endpoint',
  method: 'GET',
  handler(request, reply) {
    request.api = true;
    reply({property: 'value'});
  }
};
```

[casp]: https://github.com/Jasig/cas/blob/master/cas-server-documentation/protocol/CAS-Protocol-Specification.md

## Plugin Type Specifications

+ [Ticket Registry](TicketRegistry.md)
+ [Service Registry](ServiceRegistry.md)

## First Phase

The first phase requires that a `plugin` method and a `name` property be
present on `module.exports`. During initialization the `plugin` method will be
invoked with two parameters: `options` and `context`. The `options` parameter
will be retrieved from the server's main configuration by the exported `name`.
The `context` will be the following object:

```javascript
{
  logger: {}, // an instance of the pino logger
  dataSources: {
    mongoose: {}, // an instance of the mongoose object modeler
    postgres: {} // an `pg` connection pool instance
  },
  ticketLifetimes: {
    ticketGrantingTicketTTL: 'time in milliseconds',
    serviceTicketTTL: 'time in milliseconds'
  },
  opbeat: {}, // OpBeat client for instrumentation
  Promise: {} // the Promise library used by the server
}
```

The `plugin` method should export an object of methods. Each of these methods
**must** return a `Promise` when invoked. These promises should *always* resolve
with a "success" condition and reject under any other condition. For example,
the `validate` method exported by an `auth` plugin should resolve when the
credentials are valid and reject when they are not.

As should be clear, during the first initialization phase your plugin should
be able to operate as if there were not a CAS server on the other end. All
methods should function on their own with whatever data they are passed.

## Second Phase

At the second phase all registered plugins that have a exported a `postInit`
method will have that method invoked after the web server has been started. This
method allows for deep integration with the actual CAS server. The `postInit`
method will be invoked with a single `context` parameter. This parameters is
the following object:

```javascript
{
  server: {}, // the actual Hapi web server object and all the API it provides
  ticketRegistry: {} // the CAS ticket registry object
}
```

As with the `plugin` methods, this method should return a `Promise`. The
resolution should be on successful initialization and the rejection on any other
state. The rejection *should* include an `Error` object that describes the
reason for failure. The resolution parameter *may* be an object:

```javascript
{
  hooks: {} // CAS server operation hooks, described later
}
```

Note the order in which plugins are are initially loaded, this is the same
order in which they will be processed during the second phase. The implication
of this is that `registry` plugins can overwrite work done by `theme` plugins,
and `auth` plugins can overwrite work done by `registry` plugins.

Also note that each plugin time is processed in *0,1,...,n* order. Thus, the
order in which your plugin is defined in the server's configuration can affect
how your plugin operates.

### Hooks

Hooks allow you to tell the CAS server that you are interested in performing
some action, or can provide some information, at specific steps in the
protocol flow. Available hooks are:

```javascript
{
  // you can provide information about a given user
  userAttributes: function userAttributes(userid) {},

  // you can do things prior to the validate method being invoked for each
  // auth plugin
  preAuth: function preAuthHook({request, reply, username, password, loginTicket, cas}) {}
}
```

Again, any hook function you supply must return a `Promise` wherein the
resolution only occurs in successful situations and rejects on all others.

All hooks are invoked in the order in which their owning plugin was registered.
And all hooks will be invoked regardless of the outcome of other hooks.

#### userAttributes

When you register a function with this hook you are telling the CAS server
that you can provide it with extra details about a user based on their
user id (usually "username").

+ `resolution`: the resolution **must** be passed a JSON serializable object.
  The object may not actually be serialized to JSON, but it must be possible.
  It also **must** conform to this object structure:

        {
          standardAttributes: {
            memberOf: ['strings']
          },
          extraAttributes: {
            anyKey: 'preferrably a string value'
          }
        }
+ `rejection`: an instance of `Error` that details what went wrong. This may or
  may not be recorded in logging data.

If your hook successfully returns data then the object will be merged into a
pre-defined object. This means subsequent hooks *may* return an object with
properties that will overwrite yours. Once all registered `userAttributes` hooks
have been processed, the final object will be stored in the server's registry.

#### preAuth

When you register a function with this hook you are accepting a lot of
responsibility:

1. Your plugin has the user's credentials in plain text.
2. You can short circuit the request with your own reply.

`preAuth` hooks get invoked with an object passed in as the sole parameter.
The object has the form:

```js
{
  request: {}, // the incoming http request
  reply: {}, // the Hapi reply object
  username: '', // the username of the person authenticating
  password: '', // the password for the person authenticating
  cas: {} // the CAS API object
}
```

The values returned via your `preAuth` hook's `Promise` will not be used. If
you return a rejection, it will still count as a failure in the server's logs,
but authentication will proceed like normal. If your hook encounters an error,
you should invoke the `reply` method yourself. Example:

```javascript
reply(new Error('something went horribly wrong'));
```

If an error is provided in the reply, then the server's generic error page
will be displayed to the user along with your error message.

`preAuth` hooks are invoked after the requesting service has been validated.

repository: aregier/cas-server

repo_name: aregier/cas-server


text:
# Disallow `then` property

💼 This rule is enabled in the ✅ `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).

<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

If an object is defined as "thenable", once it's accidentally used in an await expression, it may cause problems:

```js
const foo = {
	unicorn: 1,
	then() {},
};

const {unicorn} = await foo;

console.log('after'); //<- This will never execute
```

```js
const foo = {
	unicorn: 1,
	then() {
		throw new Error('You shouldn’t have called me')
	},
};

const {unicorn} = await foo;
// Error: You shouldn’t have called me
```

If a module has an export named `then`, dynamic `import()` may not work as expected:

```js
// foo.js

export function then () {
	throw new Error('You shouldn’t have called me')
}
```

```js
// bar.js

const foo = await import('./foo.js');
// Error: You shouldn’t have called me
```

## Fail

```js
export {then};
```

```js
const foo = {
	then() {}
};
```

```js
const foo = {
	get then() {}
};
```

```js
foo.then = function () {}
```

```js
class Foo {
	then() {}
}
```

```js
class Foo {
	static then() {}
}
```

## Pass

```js
export {then as success};
```

```js
const foo = {
	success() {}
};
```

```js
class Foo {
	success() {}
}
```

```js
const foo = bar.then;
```

license: MIT

repository: sindresorhus/eslint-plugin-unicorn

branch_name: refs/heads/main

extension: md

gha_language: JavaScript

gha_license_id: MIT

license_type: permissive

repo_name: sindresorhus/eslint-plugin-unicorn


text:
---
layout: post
title: "OsEXPA7"
description: ""
category: genes
tags: [leaf, root, shoot, sheath, salt, tolerance, potassium, salt stress, stress, shoot apical meristem, stress tolerance]
---

* **Information**
    + Symbol: OsEXPA7
    + MSU: [LOC_Os03g60720](http://rice.uga.edu/cgi-bin/ORF_infopage.cgi?orf=LOC_Os03g60720)
    + RAPdb: [Os03g0822000](https://rapdb.dna.affrc.go.jp/locus/?name=Os03g0822000)

* **Publication**
    + [Overexpression of Rice Expansin7 Osexpa7 Confers Enhanced Tolerance to Salt Stress in Rice.](http://www.ncbi.nlm.nih.gov/pubmed?term=Overexpression of Rice Expansin7 Osexpa7 Confers Enhanced Tolerance to Salt Stress in Rice.%5BTitle%5D), 2020, Int J Mol Sci.

* **Genbank accession number**

* **Key message**
    + OsEXPA7 was highly expressed in the shoot apical meristem, root, and the leaf sheath
    + Morphological analysis revealed structural alterations in the root and leaf vasculature of OsEXPA7 overexpressing (OX) lines
    + In this study, we evaluated the function of OsEXPA7 involved in salt stress tolerance
    + Phenotypic analysis showed that OsEXPA7 overexpression remarkably enhanced tolerance to salt stress
    + These results suggest that OsEXPA7 plays an important role in increasing salt stress tolerance by coordinating sodium transport, ROS scavenging, and cell-wall loosening
    + OsEXPA7 overexpression resulted in decreased sodium ion (Na+) and accumulated potassium ion (K+) in the leaves and roots

* **Connection**

[//]: # * **Key figures**

branch_name: refs/heads/master


text:
# QtWaitingSpinner

QtWaitingSpinner is a highly configurable, custom Qt widget for showing "waiting" or "loading" spinner icons in Qt applications, e.g. the spinners below are all QtWaitingSpinner widgets differing only in their configuration:

![waiting spinner](https://github.com/z3ntu/QtWaitingSpinner/blob/gh-pages/waiting-spinners.gif)

### Installation

`pip install pyqtspinner`

### Configuration

The following properties can all be controlled directly through their corresponding setters:

* Color of the widget
* "Roundness" of the lines
* Speed (rotations per second)
* Number of lines to be drawn
* Line length
* Line width
* Radius of the spinner's "dead space" or inner circle
* The percentage fade of the "trail"
* The minimum opacity of the "trail"

### Usage

You can easily ajust spinner settings via `demo.py` file:

![demo dialog](http://i.imgur.com/dVVSgaS.png)

Make the spinner you would like to see and press "show init args" button.
It will generate the code snippet which is almost ready-to-use:

```python
WaitingSpinner(
    parent,
    roundness=70.0, opacity=15.0,
    fade=70.0, radius=10.0, lines=12,
    line_length=10.0, line_width=5.0,
    speed=1.0, color=(0, 0, 0)
)
```

As an alternative example, the code below will create a spinner that (1) blocks all user input to the main application for as long as the spinner is active, (2) automatically centers itself on its parent widget every time "start" is called and (3) makes use of the default shape, size and color settings.

```
spinner = QtWaitingSpinner(self, True, True, Qt.ApplicationModal)
spinner.start() # starts spinning
```

Enjoy!

### Thanks:
to [@z3ntu](https://github.com/z3ntu) for the groundwork.
to [@snowwlex](https://github.com/snowwlex) for the widget itself.

repository: acer-king/QtWaitingSpinner

repo_name: acer-king/QtWaitingSpinner


text:
---
hrs_structure:
  division: '3'
  volume: '12'
  title: '28'
  chapter: 503B
  section: 503B-1
type: hrs_section
tags:
  - Property
  - Family
menu:
  hrs:
    identifier: HRS_0503B-0001
    parent: HRS0503B
    name: 503B-1 Commissioners; appointment
weight: 17005
title: Commissioners; appointment
full_title: 503B-1 Commissioners; appointment
---
**§503B-1 Commissioners; appointment.** The lieutenant governor may appoint commissioners who shall serve for four years from the date of the individual commissioner's respective appointment, unless removed by the lieutenant governor. [L 2013, c 277, pt of §1; am L 2016, c 78, §3]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
---
id: 552
title: Getting A List Of All Services On BlueMix
date: 2014-03-05T09:51:10+00:00
author: ryanjbaxter
layout: post
guid: http://ryanjbaxter.com/?p=552
permalink: /2014/03/05/getting-a-list-of-all-services-on-bluemix/
dsq_thread_id:
  -<PHONE_NUMBER>
categories:
  - BlueMix
  - Cloud
  - Cloud Foundry
  - PaaS
---
One of the best features of Cloud Foundry and BlueMix is the services available for developers to integrate into their apps.  The first step in using any of these services is creating them.  You can create them in various ways, through the BlueMix UI, with the command line, with the Cloud Foundry Maven plugin, and with a manifest.yml file.  In almost every situation where you are creating the service you need will need to know the name and the plan.  Up until know I have been figuring out this information by looking through the BlueMix documentation but today I found out about the _cf marketplace_ command that will give you details about all the services on BlueMix right in your command line!  Here is what the output looks like after executing the command

> $ cf marketplace
>
> Getting services from marketplace in org myorg / space dev as user…
>
> OK
>
>
>
> service                  plans                   description
>
> BLUAcceleration          Community_Beta          BLU Acceleration service provides a powerful, easy-to-use, and agile platform for business intelligence and analytics. This enterprise-class managed-service is powered by the in-memory optimized, column-organized BLU Acceleration data warehousing technology.
>
> Cloud Integration        user-provided           Securely connect and integrate applications and information in the cloud. Use patterns for accelerated integration or develop custom APIs as needed.
>
> CloudCode                cloudcodeservice-free   Run server side scripting logic on the IBM cloud without having to worry about managing application servers or scale.
>
> Cloudant                 user-provided           Cloudant’s distributed database as a service (DBaaS) allows developers of fast-growing web and mobile apps to focus on building and improving their products, instead of worrying about scaling and managing databases on their own. Highly available, durable and feature-rich, our data store is built for scaling, optimized for concurrent reads & writes, and handles a wide variety of data types including JSON, full-text, and geospatial.
>
> DataCache                free                    Improve the performance & user experience of web applications by retrieving information from fast, managed, in-memory caches, instead of relying entirely on slower disk-based databases.


text:
Level Version
=============

Create versioned data inside leveldb.

[![NPM](https://nodei.co/npm/level-version.png)](https://nodei.co/npm/level-version/)

[![david-dm](https://david-dm.org/brycebaril/level-version.png)](https://david-dm.org/brycebaril/level-version/)
[![david-dm](https://david-dm.org/brycebaril/level-version/dev-status.png)](https://david-dm.org/brycebaril/level-version#info=devDependencies/)

`level-version` wraps levelup in a similar way to `level-sublevel` works, where instead of assigning your keys a prefix, it postfixes your keys with a version stamp.

By default the versions are millisecond timestamps, but they can be anything you want. Either specify them manually or provide a default version generating function. For some of the features to work correctly the versions should lexically sort. In the initial version some features only support numeric versions, but with some modifications it should all be able to support non-numeric lexically ordered values.

It also includes GC options that let you control how many or how old of versions you want to keep around.

Works with `level-sublevel` instances.

Example
-------

```javascript

var LevelUp = require("levelup")
var version = require("level-version")

var original = LevelUp("./my-db")

// writes to db will be versioned, writes to original will not
var db = version(original)

// insert a record with the default version
db.put(key, value, function (err, version) {
  /* ... */
})

// insert a record explicitly at version 10
db.put(key, value, {version: 10}, function (err, version) {
  /* ... */
})

// batch insert a few records
db.batch([
  {type: "put", key: "cat", value: "sleep"}, // default version
  {type: "put", key: "cat", value: "play", version: 122},
  /* ... */
], function () {
  /* ... */
})

// get the most recent version of the key (synonymous with .getLast(k, cb))
db.get(key, function (err, value, version) {
  /* ... */
})

// get the first (oldest) version of the key
db.getFirst(key, function (err, value, version) {
  /* ... */
})

// get a specific version
db.get(key, {version: 10}, function (err, value, version) {
  /* ... */
})

// remove an entry
db.del(key, {version: 10}, function (err, version) {
  /* ... */
})

// a version stream for a single key between versions 100 and 1000
db.createVersionStream(key, {minVersion: 100, maxVersion: 1000}).pipe(/* ... */)

// stream all keys, but only the most recent version of each
db.createReadStream({versionLimit: 1}).pipe(/* ... */)

```

API
---

  * [`version(db [,options])`](#ctor)
  * [`.put(key, value [, options] [, cb])`](#put)
  * [`.get(key [, options] [, cb])`](#get)
  * [`.getLast(key [, options] [, cb])`](#getLast)
  * [`.getFirst(key [, options] [, cb])`](#getFirst)
  * [`.del(key [, options] [, cb])`](#del)
  * [`.createVersionStream(key [, options])`](#vs)
  * [`.createReadStream(key [, options])`](#rs)
  * [`.createValueStream(key [, options])`](#vals)
  * [`.createKeyStream(key [, options])`](#keys)
  * [`.createWriteStream(key [, options])`](#ws)
  * [Garbage Collection](#gc)

---

`var db = version(leveldb [,options])`
------------------------

Construct a new levelup object with version as a wrapper. The original `leveldb` instance will remain unchanged. The wrapped object should behave almost identically to the original, except all put/get operations are version aware.

[Garbage Collection](#gc) options can be set in order to control how many versions of each record are retained.

### Options
 * gcMaxVersions [no default] When doing GC it will only keep gcMaxVersions newest versions of each key
 * gcMaxAge [no default] When doing GC only keep versions where Date.now() - gcMaxAge > version
 * gcFreqMs [60000] How often the GC runs to apply GC rules. Only runs if a gcMax* option is set.
 * gcBackup [no default] A level-version instance to stream culled records into
 * gcCallback [no default] A callback to execute when gc sweeps complete
 * defaultVersion: [Date.now] A function to provide the default version if none is specified.
 * delimiter: [\xff] The internal delimiter to use.

`.put(key, value [, options] [, cb])`
-------------------------------------

Insert a record into leveldb with a version stamp.

### Callback

callback(err, version) -- version will be the version the record was saved with.

### Options

  * version: [defaultVersion()] The version stamp for the record. If not given, it will use the defaultVersion function to generate one.
  * standard levelup `put` options.

`.get(key [, options] [, cb])`
------------------------------

Retrieve a record from leveldb. If no version is specified, this is equivalent to [getLast](getLast).

### Callback

callback(err, value, version)

### Options

  * version: [scan for highest] The version stamp for the record. If not specified, it will find the version with the _highest_ version.
  * standard levelup `get` options.

`.getLast(key [, options] [, cb])`
----------------------------------

Retrieve the latest version of a record from leveldb. That is the version with the *highest* version number.

### Callback

callback(err, value, version)

### Options

  * standard levelup `get` options.

`.getFirst(key [, options] [, cb])`
-----------------------------------

Retrieve the first version of a record from leveldb. That is the version with the *lowest* version number.

### Callback

callback(err, value, version)

### Options

  * standard levelup `get` options.

`.del(key [, options] [, cb])`
------------------------------

Remove a version of a record from leveldb. You should generally always be specifying a version with `del`

### Callback

callback(err, version) -- version will be the version of the record removed.

### Options

  * version: [defaultVersion()] The version stamp for the record. If not given, it will use the defaultVersion function to generate one. (I.e. specify a version)
  * standard levelup `del` options.

`.createVersionStream(key [, options])`
---------------------------------------

Stream versions of a key from _highest_ to _lowest_ version. I.e. newest first. Results in an `objectMode` stream where records are in the format `{key: key, value: value, version: version}`

### Options

  * minVersion: [default -Math.pow(2, 53)] The lowest version to return
  * maxVersion: [default Math.pow(2, 53)] The highest version to return
  * versionLimit: [no default] How many versions to return before ending the stream
  * standard levelup readstream options __except__ start/end are __ignored__

`.createReadStream(key [, options])`
------------------------------------

Stream versions of all records within `options.start` and `options.end` from _highest_ to _lowest_ version. I.e. newest first. Results in an `objectMode` stream where records are in the format `{key: key, value: value, version: version}`

### Options

  * minVersion: [default -Math.pow(2, 53)] The lowest version to return
  * maxVersion: [default Math.pow(2, 53)] The highest version to return
  * versionLimit: [no default] How many versions to return before ending the stream
  * standard levelup readstream options

`.createValueStream(key [, options])`
-------------------------------------

Identical to `createReadStream` but only values & versions will be returned.

`.createKeyStream(key [, options])`
-----------------------------------

Identical to `createReadStream` but only keys & versions will be returned.

`.createWriteStream(key [, options])`
-------------------------------------

Creates a writable stream suitable for writing to or deleting from a versioned leveldb.

```javascript
var ws = db.createWriteStream()
ws.write({key: "cat", value: "meow", version: 12345})
ws.write({key: "dog", value: "woof"})
ws.write({type: "del", key: "fish", version: 2121})
ws.end()
```

### Options

  * standard levelup writesteram options

Garbage Collection
------------------

When creating your versioned db, you can specify options related to garbage collection. If you set a `gcMaxVersions` or `gcMaxAge` it will periodically scan through your db instance and delete any versions based on the criteria you've specified.

 * gcMaxVersions [no default] When doing GC it will only keep gcMaxVersions newest versions of each key
 * gcMaxAge [no default] When doing GC only keep versions where Date.now() - gcMaxAge > version
 * gcFreqMs [60000] How often the GC runs to apply GC rules. Only runs if a gcMax* option is set.
 * gcBackup [no default] A level-version instance to stream culled records into
 * gcCallback [no default] A callback to execute when gc sweeps complete

LICENSE
=======

MIT

repository: simonwalz/level-version

repo_name: simonwalz/level-version


text:
# Assignment report
## Unrecognized (Task -1)
File name doesn't not match any of filenames conventions

**Filename: PALINDROME.c**
## Unrecognized (Task -1)
File name doesn't not match any of filenames conventions

**Filename: TRANS.c**
## Matrix (Task 1)
https://drive.google.com/drive/folders/0B83l5t-0yjU7elZ1MmtNQzFYWkk

### Testcase 1 failed
Input
```
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
```

Expected
```
1 5 9 13 2 6 10 14 3 7 11 15 4 8 12 16
```

Output
```
1 5 9 13  2 6 10 14  3 7 11 15  4 8 12 16
```

## Palindrome (Task 2)
https://drive.google.com/drive/folders/0B83l5t-0yjU7elZ1MmtNQzFYWkk

### Testcase 1 passed


text:
## Salary Calculator TODO List

### Let's get started!

- [x] Source in and test HTML, CSS, JS, JQ files
- [x] Input form that collects the following (HTML)
  - employee first name
  - last name
  - ID number
  - job title
  - annual salary
- [x] 'Submit' button (HTML)
  - [x] Collect the form information (JQ)
  - [x] Store the information (JQ)
  - [x] Append information to the DOM (JQ)
  - [x] Clear the input fields (JQ)
- [x] Create a delete button that removes an employee from the DOM
- [x] Append a 'total monthly expenses' amount to the DOM
- [ ] Limit the decimal places to 2
- [x] Instead of changing salary to 0, figure out how to delete from the array
  - [x] OR if salary is 0, don't append to DOM.
- [x] Red background on total expenses if > $20,000

### Stretch Goals

- [x] Don't push if any fields are left blank
- [ ] Add styling or extra functionality that fits with the theme of this assignment.
- [x] Once the employee is deleted, update the total spend on salaries account for this employee's removal.
  - This will require that the logic knows which element was removed. You will need to use .text() as a getter or look into jQuery's .data() function. This is tricky!

repository: patrickrnelson/salary-calculator

repo_name: patrickrnelson/salary-calculator


text:
# lusid.ReferencePortfolioApi

All URIs are relative to *https://fbn-prd.lusid.com/api*

Method | HTTP request | Description
------------- | ------------- | -------------
[**create_reference_portfolio**](ReferencePortfolioApi.md#create_reference_portfolio) | **POST** /api/referenceportfolios/{scope} | CreateReferencePortfolio: Create reference portfolio
[**get_reference_portfolio_constituents**](ReferencePortfolioApi.md#get_reference_portfolio_constituents) | **GET** /api/referenceportfolios/{scope}/{code}/constituents | GetReferencePortfolioConstituents: Get reference portfolio constituents
[**list_constituents_adjustments**](ReferencePortfolioApi.md#list_constituents_adjustments) | **GET** /api/referenceportfolios/{scope}/{code}/constituentsadjustments | ListConstituentsAdjustments: List constituents adjustments
[**upsert_reference_portfolio_constituents**](ReferencePortfolioApi.md#upsert_reference_portfolio_constituents) | **POST** /api/referenceportfolios/{scope}/{code}/constituents | UpsertReferencePortfolioConstituents: Upsert reference portfolio constituents

# **create_reference_portfolio**
> Portfolio create_reference_portfolio(scope, create_reference_portfolio_request)

CreateReferencePortfolio: Create reference portfolio

Create a reference portfolio in a particular scope.

### Example

* OAuth Authentication (oauth2):
```python
from __future__ import print_function
import time
import lusid
from lusid.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://fbn-prd.lusid.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = lusid.Configuration(
    host = "https://fbn-prd.lusid.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure OAuth2 access token for authorization: oauth2
configuration = lusid.Configuration(
    host = "https://fbn-prd.lusid.com/api"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Enter a context with an instance of the API client
with lusid.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = lusid.ReferencePortfolioApi(api_client)
    scope = 'scope_example' # str | The scope in which to create the reference portfolio.
create_reference_portfolio_request = {"displayName":"MyPortfolioName","description":"Description of my portfolio","code":"MyPortfolioCode","created":"2018-03-05T00:00:00.0000000+00:00","properties":{},"instrumentScopes":[],"baseCurrency":"GBP"} # CreateReferencePortfolioRequest | The definition of the reference portfolio.

    try:
        # CreateReferencePortfolio: Create reference portfolio
        api_response = api_instance.create_reference_portfolio(scope, create_reference_portfolio_request)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling ReferencePortfolioApi->create_reference_portfolio: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **scope** | **str**| The scope in which to create the reference portfolio. |
 **create_reference_portfolio_request** | [**CreateReferencePortfolioRequest**](CreateReferencePortfolioRequest.md)| The definition of the reference portfolio. |

### Return type

[**Portfolio**](Portfolio.md)

### Authorization

[oauth2](../README.md#oauth2)

### HTTP request headers

 - **Content-Type**: application/json-patch+json, application/json, text/json, application/*+json
 - **Accept**: text/plain, application/json, text/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**201** | The created reference portfolio, with populated id |  -  |
**400** | The details of the input related failure |  -  |
**0** | Error response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **get_reference_portfolio_constituents**
> GetReferencePortfolioConstituentsResponse get_reference_portfolio_constituents(scope, code, effective_at=effective_at, as_at=as_at, property_keys=property_keys)

GetReferencePortfolioConstituents: Get reference portfolio constituents

Get constituents from a reference portfolio at a particular effective time.

### Example

* OAuth Authentication (oauth2):
```python
from __future__ import print_function
import time
import lusid
from lusid.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://fbn-prd.lusid.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = lusid.Configuration(
    host = "https://fbn-prd.lusid.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure OAuth2 access token for authorization: oauth2
configuration = lusid.Configuration(
    host = "https://fbn-prd.lusid.com/api"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Enter a context with an instance of the API client
with lusid.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = lusid.ReferencePortfolioApi(api_client)
    scope = 'scope_example' # str | The scope of the reference portfolio.
code = 'code_example' # str | The code of the reference portfolio. Together with the scope this uniquely identifies              the reference portfolio.
effective_at = 'effective_at_example' # str | The effective date of the constituents to retrieve. Defaults to the current LUSID system datetime if not specified. (optional)
as_at = '2013-10-20T19:20:30+01:00' # datetime | The asAt datetime at which to retrieve constituents. Defaults to return the latest version              of each constituent if not specified. (optional)
property_keys = ['property_keys_example'] # list[str] | A list of property keys from the 'Instrument' or 'ReferenceHolding' domain to decorate onto              constituents. These take the format {domain}/{scope}/{code} e.g. 'Instrument/system/Name' or              'ReferenceHolding/strategy/quantsignal'. Defaults to return all available instrument and reference holding properties if not specified. (optional)

    try:
        # GetReferencePortfolioConstituents: Get reference portfolio constituents
        api_response = api_instance.get_reference_portfolio_constituents(scope, code, effective_at=effective_at, as_at=as_at, property_keys=property_keys)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling ReferencePortfolioApi->get_reference_portfolio_constituents: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **scope** | **str**| The scope of the reference portfolio. |
 **code** | **str**| The code of the reference portfolio. Together with the scope this uniquely identifies              the reference portfolio. |
 **effective_at** | **str**| The effective date of the constituents to retrieve. Defaults to the current LUSID system datetime if not specified. | [optional]
 **as_at** | **datetime**| The asAt datetime at which to retrieve constituents. Defaults to return the latest version              of each constituent if not specified. | [optional]
 **property_keys** | [**list[str]**](str.md)| A list of property keys from the 'Instrument' or 'ReferenceHolding' domain to decorate onto              constituents. These take the format {domain}/{scope}/{code} e.g. 'Instrument/system/Name' or              'ReferenceHolding/strategy/quantsignal'. Defaults to return all available instrument and reference holding properties if not specified. | [optional]

### Return type

[**GetReferencePortfolioConstituentsResponse**](GetReferencePortfolioConstituentsResponse.md)

### Authorization

[oauth2](../README.md#oauth2)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: text/plain, application/json, text/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | The requested reference portfolio constituents |  -  |
**400** | The details of the input related failure |  -  |
**0** | Error response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **list_constituents_adjustments**
> ResourceListOfConstituentsAdjustmentHeader list_constituents_adjustments(scope, code, from_effective_at, to_effective_at, as_at_time=as_at_time)

ListConstituentsAdjustments: List constituents adjustments

List adjustments made to constituents in a reference portfolio.

### Example

* OAuth Authentication (oauth2):
```python
from __future__ import print_function
import time
import lusid
from lusid.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://fbn-prd.lusid.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = lusid.Configuration(
    host = "https://fbn-prd.lusid.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure OAuth2 access token for authorization: oauth2
configuration = lusid.Configuration(
    host = "https://fbn-prd.lusid.com/api"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Enter a context with an instance of the API client
with lusid.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = lusid.ReferencePortfolioApi(api_client)
    scope = 'scope_example' # str | The scope of the reference portfolio.
code = 'code_example' # str | The code of the reference portfolio. Together with the scope this uniquely identifies              the reference portfolio.
from_effective_at = 'from_effective_at_example' # str | Events between this time (inclusive) and the toEffectiveAt are returned.
to_effective_at = 'to_effective_at_example' # str | Events between this time (inclusive) and the fromEffectiveAt are returned.
as_at_time = '2013-10-20T19:20:30+01:00' # datetime | The asAt time for which the result is valid. (optional)

    try:
        # ListConstituentsAdjustments: List constituents adjustments
        api_response = api_instance.list_constituents_adjustments(scope, code, from_effective_at, to_effective_at, as_at_time=as_at_time)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling ReferencePortfolioApi->list_constituents_adjustments: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **scope** | **str**| The scope of the reference portfolio. |
 **code** | **str**| The code of the reference portfolio. Together with the scope this uniquely identifies              the reference portfolio. |
 **from_effective_at** | **str**| Events between this time (inclusive) and the toEffectiveAt are returned. |
 **to_effective_at** | **str**| Events between this time (inclusive) and the fromEffectiveAt are returned. |
 **as_at_time** | **datetime**| The asAt time for which the result is valid. | [optional]

### Return type

[**ResourceListOfConstituentsAdjustmentHeader**](ResourceListOfConstituentsAdjustmentHeader.md)

### Authorization

[oauth2](../README.md#oauth2)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: text/plain, application/json, text/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Success |  -  |
**400** | The details of the input related failure |  -  |
**0** | Error response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **upsert_reference_portfolio_constituents**
> UpsertReferencePortfolioConstituentsResponse upsert_reference_portfolio_constituents(scope, code, upsert_reference_portfolio_constituents_request)

UpsertReferencePortfolioConstituents: Upsert reference portfolio constituents

Add constituents to a reference portfolio.

### Example

* OAuth Authentication (oauth2):
```python
from __future__ import print_function
import time
import lusid
from lusid.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://fbn-prd.lusid.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = lusid.Configuration(
    host = "https://fbn-prd.lusid.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure OAuth2 access token for authorization: oauth2
configuration = lusid.Configuration(
    host = "https://fbn-prd.lusid.com/api"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Enter a context with an instance of the API client
with lusid.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = lusid.ReferencePortfolioApi(api_client)
    scope = 'scope_example' # str | The scope of the reference portfolio.
code = 'code_example' # str | The code of the reference portfolio. Together with the scope this uniquely identifies              the reference portfolio.
upsert_reference_portfolio_constituents_request = {"effectiveFrom":"2018-03-05T00:00:00.0000000+00:00","weightType":"Periodical","periodType":"Quarterly","periodCount":2,"constituents":[{"instrumentIdentifiers":{"Instrument/default/Figi":"BBG0077GZM13","Instrument/default/Isin":"GB00BH4HKS39"},"properties":{"Portfolio/MyScope/MyPropertyKey":{"key":"Portfolio/MyScope/MyPropertyKey","value":{"metricValue":{"value":12345.5672,"unit":"Unit"}}}},"weight":100,"currency":"GBP"},{"instrumentIdentifiers":{"Instrument/default/Figi":"BBG0077H2WN1","Instrument/default/Isin":"US0378331005"},"properties":{},"weight":50,"currency":"USD"}]} # UpsertReferencePortfolioConstituentsRequest | The constituents to upload to the reference portfolio.

    try:
        # UpsertReferencePortfolioConstituents: Upsert reference portfolio constituents
        api_response = api_instance.upsert_reference_portfolio_constituents(scope, code, upsert_reference_portfolio_constituents_request)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling ReferencePortfolioApi->upsert_reference_portfolio_constituents: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **scope** | **str**| The scope of the reference portfolio. |
 **code** | **str**| The code of the reference portfolio. Together with the scope this uniquely identifies              the reference portfolio. |
 **upsert_reference_portfolio_constituents_request** | [**UpsertReferencePortfolioConstituentsRequest**](UpsertReferencePortfolioConstituentsRequest.md)| The constituents to upload to the reference portfolio. |

### Return type

[**UpsertReferencePortfolioConstituentsResponse**](UpsertReferencePortfolioConstituentsResponse.md)

### Authorization

[oauth2](../README.md#oauth2)

### HTTP request headers

 - **Content-Type**: application/json-patch+json, application/json, text/json, application/*+json
 - **Accept**: text/plain, application/json, text/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Success |  -  |
**400** | The details of the input related failure |  -  |
**0** | Error response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

repository: finbourne/lusid-sdk-python

gha_language: Python

gha_license_id: NOASSERTION

repo_name: finbourne/lusid-sdk-python


text:
# Natas 11

Was pretty stumped on this one. The encryption wasn't exactly hard once you figure it out, but definitely took me a long time.

```php
function xor_encrypt($in) {
    $key = '<censored>';
    $text = $in;
    $outText = '';

    // Iterate through each character
    for($i=0;$i<strlen($text);$i++) {
    $outText .= $text[$i] ^ $key[$i % strlen($key)];
    }

    return $outText;
}
```

The idea behind the XOR encryption was bascially out of two values, return true only when one of the values is true. Since we have the source code, we could get the input an output values, it was only the key that was a secret.

I originally was planning to brute force reverse engineer it, which is pretty barbaric way of dealing with it. But my friend who was working alongside me realised that you could just substitute the other half of the XOR (being the json object) and get the key that way.

```php
key = json_encode(array( "showpassword"=>"no", "bgcolor"=>"#ffffff"));
```

Once you have the key, you can construct your own encrypted cookie, using this idea:

```php
setcookie("data", base64_encode(xor_encrypt(json_encode($d))));
```

You can noew post your encrypted cookie and voila! There's your key.

> EDXp0pS26wLKHZy1rDBPUZk0RKfLGIR3

repository: AmethystProductions/OverTheWire

repo_name: AmethystProductions/OverTheWire


text:
# Awesome RPN Calculator Test Resolution

[![forthebadge](http://forthebadge.com/images/badges/made-with-ruby.svg)](http://forthebadge.com) [![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](http://forthebadge.com)

This is an attempt to solve the given imaginary problem.

![Gem usage](docs/awesome_rpn_calculator.gif)

Context
-----------------

We're building this command-line calculator for people who are comfortable with UNIX-like CLI utilities.
We are starting with the basic 4 operators now but will want to eventually implement other operators and
an alternate interface (such as WebSocket, file, or TCP socket).
There's no need to implement these, but design with these future changes in mind.

Specifications
-----------------

1. The calculator should use standard input and standard output
2. It should implement the four standard arithmetic operators
3. The calculator should handle errors and recover gracefully
4. The calculator should exit when it receives a `q` command or an end of input indicator (EOF / Ctrl+D)

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'awesome_rpn_calculator'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install awesome_rpn_calculator

## Technical Stack

The reason why i chose to go with gem was basically for nicety of an
easy installation for whoever is trying to make use of our RPN
calculator. Not to menstion that fact that it can be also used
alongside in another app as a new dependency. I have tried to write
this test solution in way that can provide scalabiliy for new upcoming
features, and to also ensure readability, by creating small classes
with basic responsabilities. That way, it can follow a more smoothly
onboarding process.

This gems is using the follwing gems for self support:

 - bundler (our default dependency manager)
 - pry (for testing purposes only)
 - simplecov (for increase/ensure test coverage)
 - rake (for creating our custom rake tasks)
 - reek (for adding nice linting for code smells)
 - rspec (our BDD testing gem)
 - rubocop (same as reek, but for more general syntax rules)

## Usage
To run our AwesomeRPNCalculator, just use install the gem, and run:

    $ awesome_rpn_calculator

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/awesome_rpn_calculator. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

## Code of Conduct

Everyone interacting in the AwesomeRPNCalculator project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/awesome_rpn_calculator/blob/master/CODE_OF_CONDUCT.md).

gha_language: Ruby


text:
# How to contribute

## Pull requests

I welcome pull requests. Please include a clear description of the changes you have made with your request.

Please be patient as it may take a while for me to get back to you. If you have any specific expectations of when a pull request needs to be merged then please make this clear in your description.

Changes such as bug fixes and enhancements are easy to accept, while breaking changes may require a little more consideration. The more breaking change is involved in a pull request, the longer it will take to consider and the more likely it is to be rejected.

If you have an idea for some more involved enhancements then I'd recommend getting in touch with me first by opening an issue.

## Technical expectations

The first thing I'll do is check that all the unit tests run.

I would also prefer it if any new features are covered by unit tests.

In terms of code conventions this should read as pretty vanilla C# code. The key thing here is to make it readable and clear. I generally prefer to fully comment any public methods or properties.

repository: BenMorris/NetArchTest

gha_language: C#

repo_name: BenMorris/NetArchTest


text:
# RSS to API

RSS to API exposes an API for retrieving RSS feeds, and includes caching to increase speed.

**Key use case**: Access RSS feeds from your client-side JavaScript easily and quickly.

## Why this exists

Retrieving RSS feeds directly through JavaScript generally does not work due to cross-domain restrictions.

The Google Feed API provides an easy way to retrieve feeds through JavaScript, but it's officially deprecated and will likely disappear sometime soon.

There are few alternatives to the Google Feed API. The Feedly API is great, but it doesn't work directly from JavaScript and it's rate-limited like any public API.

To retrieve RSS feeds through JavaScript, then, you're forced to host your own proxy. RSS to API makes this a one-click process, through the Deploy to Heroku button below. In no time, you'll be retrieving RSS through JavaScript. You'll benefit from caching, as well, so feeds pop up quickly for your users.

## Caching

RSS to API caches feeds as they're retrieved, using Redis. A Redis server is included when using the Deploy to Heroku button below.

The cache lasts for an hour by default. That is, an individual feed will be retrieved from its source only once per hour, despite the number of requests.

If a request comes in that cannot be served from cache, the app retrieves the feed and returns it.

**For caching to work most effectively, include a count (i.e. how many articles to retrieve) in every request.**

## Usage

Retrieve the contents of an RSS feed.

### Direct

`https://YOUR_DOMAIN/v1/feed?url=http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml&count=8&key=YOUR_KEY`

### JQuery

[Demo](http://codepen.io/csm123/pen/KddKzW?editors=101)

```javascript
$.ajax(
  {
    url: "https://DOMAIN_FOR_THIS_APP/v1/feed?url=http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml&count=8&key=YOUR_KEY"
  }
).done(
  function(data) {
    alert("Found " + data.items.length + " items");
  }
);
```

Parameter | Description
--------- | -----------
`url`    | The URL of the RSS feed. Alternatively, you can specify a `stream_id` as defined in Feedly's API reference. Either the `url` or `stream_id` is required.
`count`   | The number of entries to retrieve from the feed. Default is `DEFAULT_COUNT` or 10. Optional.
`key`     | If you set a key with the `API_KEY` configuration variable, this must match that key for the request to be processed.

### Results

```javascript
{
  "items":
    [
      {
        "title": "Title of article",
        "link": "Link to article",
        "published": "Date that article was published"
      },
      {
        "title": "Title of article",
        "link": "Link to article",
        "published": "Date that article was published"
      }
    ],
  "from_proxy_cache": true /* true if from serving this feed from cache; otherwise, false */
}
```

### Error results

```javascript
{
  "error": "Invalid key"
}
```

## Configuration variables

Only the REDIS_URL is required, and it's automatically filled if use the Deploy to Heroku button below. If you use the Deploy to Heroku button, you'll be prompted for these.

Config Variable | Description
--------------- | -----------
`ORIGINS`       | A comma-delimited list of domains that are allowed to submit cross-domain requests to the app.  No need for commas if you're specifying just one domain. If blank, no cross-origin requests will be accepted, unless `ALLOW_ALL_ORIGINS` is set to `true`

Examples:
`http://mydomain.com/,http://someotherdomain.com/`
`http://mydomain.com/`
`ALLOW_ALL_ORIGINS` | Set to `true` to allow any domain to submit cross-domain requests to this app. Not recommended.
`API_KEY`       | Set your own key that will be required to make a request to this API.
`DEFAULT_COUNT` | The number of entries returned for a given feed by default. This can be adjusted per request. If not specified here or in the request, the default is 10.
`NUMBER_OF_ITEMS_TO_CACHE_PER_FEED` | The number of enrties per feed to cache in Redis. If not specified, 25.
`CACHE_LIFE` | The amount of time (in seconds) after fetching a feed to serve requests from the cache. Think about how fresh the feed needs to be for your use case vs. the speed gained from caching. If blank, 3600 or one hour - meaning that feeds will be updated from the source a maximum of once per hour.
`REDIS_URL` | Automatically set if you deploy to Heroku below. Specifies the location of the Redis server used for caching.

## Setup

### Heroku (recommended)

Heroku deployment is easy and free using the button below. It includes the app itself and a Redis server.

The app will return an Internal Server Error for the first few minutes while Redis loads.

[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)

### Local
1. Extract into a directory and run `bundle`
2. Run `bundle exec rackup config.ru`

## Toolset

- Ruby
- Sinatra
- Redis

repository: darchives/RSStoAPI

repo_name: darchives/RSStoAPI


text:
# Instrukcije za parser
(Sve je isto kao i C verzija osim sto pojedine datoteke imaju .cpp ekstenziju umjesto .c)

(instrukcije kopirane iz ovog repozitorija https://github.com/IvanVnucec/fersat-parser)

Fersat-parser is command line parser which is used for testing purposes for small 1U Cubesat which is being developed at the University of Zagreb ([Link](https://www.fer.unizg.hr/zrk/o_zavodu/studenti/cubesat/FERSat)).

Parser works by reading a string for example `set_fan_speed(20)` and it will call a system function based on function name, it this case `set_fan_speed`.
The number of arguments between paranteses depends on your needs. There could be 0 or more arguments.

## Getting Started

### Installing

* Put all .c and .h files into your project.
* Add your own functions (see Deployment below)

## Running the tests

Call parser by typing
```
parse(string);
```
where `string` is a pointer on some C style string (ending with the '\0' sign). `string` contains a function which will be called based on the function name.
If the function name is correct and the number of arguments is sufficient, parser should call the function.

## Deployment

To use the parser one must do the following:
1. Create wrapper function
2. Creating a caller for the original function

#### 1. Create wrapper function

Wrapper function is function which connects your system function which you want to call and the parser itself.

Wrapper function must be placed into the `wrapper.c` file!
Declaration of every wrapper function must be placed into the `wrapper.h` file.

Input of every Wrapper function is pointer to the linked list of the function arguments `list_t *arg`.

Output of every Wrapper function is void.

Every wrapper function has the following definition:
```
void wrapp_fun_name(list_t *arg)
```
where `list_t *arg` is the queue for the function arguments. They are represented as the standard C-type string.

What every Wrapper function has:
1. Allocating memory for the function arguments  (OPTIONAL)
2. Copying the function arguments into allocated memory  (OPTIONAL)
3. Converting function arguments from type `string` to the other types (`int`,`float` etc.)  (OPTIONAL)
4. Calling of the original function  (MANDATORY)
5. Freeing allocated memory  (OPTIONAL)

Some examples of wrapper function:
```
void set_fan_speed_wrapper(list_t *arg){
    // 1. Allocating memory for the function arguments
    char *arg1 = malloc(BUFFER_SIZE);

    // 2. Copying the function arguments into allocated memory
    list_remove(arg, arg1, BUFFER_SIZE);

    // 3. Converting function arguments from type string to the other types (int,float etc.)
    fan_speed = str_to_int(arg1);

    // 4. Calling of the original function
    set_fan_speed(fan_speed);

    // 5. Freeing allocated memory
    free(arg1);
}
```

```
void led_on_wrapp(list_t *arg) {
  // 4. Calling of the original function
  led_on();
}
```

#### 2. Creating a caller for the original function

One must modify a `function_wrapper_init` function which is located in `wrapper.c` file.

Parser for every wrapper function must know the function name, the number of arguments which every wrapper function takes and the pointer to the original function.

For the two wrapper functions above the `function_wrapper_init` looks like:

```
int function_wrapper_init (function_list_t *function_list) {

    if(function_list_add(function_list,  "set_fan_speed",  1, set_fan_speed_wrapper))  return 1;  // ERROR
    if(function_list_add(function_list,  "led_on",         0, led_on_wrapp))           return 1;  // ERROR

    return 0;   // Return everything OK
}
```

The second argument of function `function_list_add` is the function name on which parser will 'react', the third is the number of arguments.
If the number of arguments is not exactly that number, the parser will not call the original function. Fourth one is the pointer to a wrapper function.

In `wrapper.h` file, there should be included a header files in which there are declarations of the original functions.

## Authors

* **Ivan Vnučec** - [github](https://github.com/IvanVnucec), [Linkedin](https://www.linkedin.com/in/ivan-vnu%C4%8Dec-b5b183187/)

## License

This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/IvanVnucec/fersat-parser/blob/master/LICENSE) file for details.


text:
---
title: "Options"
pre: "10. "
weight: 10
description: "ocamllex has the following options: ..."
---

ocamllex has the following options:

* "-o output-file"

By default, ocamllex produces lexer.ml, when ocamllex is invoked as "ocamllex lexer.mll". You can change the name of the output file using -o option.

* "-ml"

By default, ocamllex produces code that uses the Caml built-in automata interpreter. Using this option, the automaton is coded as Caml functions. This option is useful for debugging ocamllex, but it's not recommended for production lexers.

* "-q"

By default, ocamllex outputs informational messages to standard output. If you use -q option, they are suppressed.

repository: ohama/ocaml

repo_name: ohama/ocaml


text:
jul6art/push-bundle
===================
Symfony real-time notification bundle
-------------------------------------

> :warning: Work in progress so keep calm. The good news: this is maintained!

Requirements
------------

* **php ^7.4 || ^8.0**
* **symfony ^4.4 || ^5.0**
* **mercure**

Installation
------------

```shell
composer require jul6art/push-bundle
```

Then Download the [mercure hub](https://github.com/dunglas/mercure/releases/tag/v0.3.3) depending on your operating system and install it in the root of your project.
For each release, the assets section list operating systems implementations. The folder must contain the mercure bin. Rename this folder **mercure**.

EventSource Polyfill
--------------------

```shell
npm install event-source-polyfill
```

and import it on client side to make push works on IE and Edge

Generate new JWT token (Optionnal)
----------------------------------

Go to [jwt.io](http://jwt.io) and put your future mercure secret key (default it's **!ChangeMe!**) in the **verify signature** textarea and this array in the **payload** textarea

```json
{
    "mercure": {
        "publish": []
    }
}
```

Because the array is empty, the Symfony app will only be authorized to publish public updates (see the [authorization](https://symfony.com/doc/current/mercure.html#authorization) section of symfony/mercure-bundle for further information).

THen store the generated token in your .env file as **MERCURE_JWT_TOKEN** parameter

Start mercure server
--------------------

The default token is signed with the secret key: !ChangeMe!

CORS_ALLOWED_ORIGINS is the client URL and port. It can be * or a list of domains
ADDR is the server url and 3000 is the port for mercure server

```shell
JWT_KEY='!ChangeMe!' ADDR='localhost:3000' ALLOW_ANONYMOUS=1 CORS_ALLOWED_ORIGINS="http://localhost:80" ./mercure/mercure
```

> :warning: By default, push messages are async so you need to launch a crawler in a terminal to dequeue messages and send it

```shell
bin/console messenger:consume async_priority_high --time-limit 600
```

Using with api-platform
-----------------------

Server side

```php
/**
 * @ApiResource(mercure=true)
 */
class SomeTopic {}
```

Client side

```javascript
import {EventSourcePolyfill} from "../polyfills/Polyfills";

export default class MercureProvider {
    provide = () => {
        const publishUrl = new URL('http://publish.url:3000/hub');
        publishUrl.searchParams.append("topic", "/some_topic");
        publishUrl.searchParams.append("topic", "/some_topic/{id}");

        const es = new EventSourcePolyfill(publishUrl, {
            headers: {
                'Authorization': 'Bearer ' + YOUR_MERCURE_JWT_TOKEN
            }
        });
        es.onmessage = e => {
            const data = JSON.parse(e.data);

            const regex = /\/api\/(?<type>\w+)\//gm;

            const match = regex.exec(data['@id']);

            if (null !== match) {
                const event = new CustomEvent(match.groups.type, { "data": data });
                document.dispatchEvent(event);
            }

        };
    }
};

// somewhere else
document.addEventListener('...', function() {
  // what you need
});
```

Using without api-platform
--------------------------

Server side

```php
use Jul6Art\PushBundle\Service\Traits\PusherAwareTrait;

/**
 * Class RequestEventSubscriber
 */
class SomeService
{
    use PusherAwareTrait;

    public function function(): void
    {
        $this->pusher->push('/some/topic', ['test' => true]);
    }
}
```

Sync (Optionnal)
----------------

```yaml
push:
    async: false
```

Other messenger messages (Optionnal)
------------------------------------

```yaml
push:
    routing:
        'PathToSomeAsyncMessage': async_priority_high
```

Can be **async_priority_high** or **async_priority_low** or **sync**

Asyncable Annotation (Optionnal)
--------------------------------

My Entity

```php
/**
 * @ORM\Entity(repositoryClass=MyClassRepository::class)
 * @Asyncable(eventClass="App\Event\MyClassEvent")
 */
class MyClass
{

}
```

My EntityEvent

```php
<?php

namespace App\Event;

use App\Entity\MyClass;
use Jul6Art\CoreBundle\Event\AbstractEvent;

/**
 * Class MyClassEvent
 */
class MyClassEvent extends AbstractEvent
{
    public const CREATED = 'event.my_class.created';
    public const DELETED = 'event.my_class.deleted';
    public const EDITED = 'event.my_class.edited';
    public const VIEWED = 'event.my_class.viewed';

    /**
     * @var MyClass
     */
    private $myClass;

    public function __construct(MyClass $myClass)
    {
        parent::__construct();

        $this->myClass = $myClass;
    }

    public function getMyClass(): MyClass
    {
        return $this->myClass;
    }

    public function setMyClass(MyClass $myClass): MyClassEvent
    {
        $this->myClass = $myClass;
        return $this;
    }
}
```

All actions in listeners who listen these event class consts will be async

> You can also specify which doctrine events you want to track

```php
/**
 * @ORM\Entity(repositoryClass=MyClassRepository::class)
 * @Asyncable(eventClass="App\Event\MyClassEvent", events={"postLoad", "postPersist"})
 */
class MyClass
{

}
```

Available events are

* postLoad
* postPersist
* postUpdate
* preRemove

License
-------

The Push Bundle is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

© 2023 [dev in the hood](https://devinthehood.com)


text:
# Learning Journal 201 day 4

I need to continue to improve my algorithm before I start coding. It appears my brain is describing multiple actions that needs to be separated in my code. For example, if want to give a user 6 opportunities to guess an element in my array, I need code to operate on the opportunities, separate code to loop and compare the guess to my array, extra code to remember if a match was made, and separate code to evaluate the match.

So far on functions I feel comfortable, understanding the structure, some of the scope pertaining to variables, and how to call them.

More practice needs to be done on git pull requests and forking. It's hard to conceptualize a pull request when it seems like the action was a push on the local. The vocabulary makes it confusing.

Layout position will continue to be a work in progress to understand how relative, fixed, and float interact with each other on the page.

## Notes:

break statements are better suited in if/else statements and rarely in loops

function template:
function functionName() {
  console.log('function stuff here');
}
<!-- call the function -->
functionName();

layout resource:
http://learnlayout.com/

resources for pull requests and PRs from forks:
https://help.github.com/articles/about-pull-requests/
https://help.github.com/articles/creating-a-pull-request-from-a-fork/

repository: cmd-kvn/daily-learning-journals

repo_name: cmd-kvn/daily-learning-journals


text:
---
doc_type: facility_page
facility_category_codes:
  - "74016"
facility_cos_short_name: HNC
facility_functional_proponent: G-9
facility_long_name: Child Development Center - School-Age Facility
facility_short_name: CDCSA
facility_technical_poc_email<EMAIL_ADDRESS>facility_technical_poc_name: Michael Johnson
file_library_root_path: "content/cos/hnc/cdcsa/Library/"
page_last_reviewed: 1 January 1970
slug: /cos/hnc/cdcsa/
carousel_images:
  - /admin/images/uploads/IMG00138-20120328-1138_jpg.jpg
  - /admin/images/uploads/Bldg-11898.jpg
  - /admin/images/uploads/Bldg-20616.jpg
  - /admin/images/uploads/Bldg-6204.jpg
  - /admin/images/uploads/IMG02412-20131218-1218_jpg.jpg
  - /admin/images/uploads/IMG00957-20121018-0938_jpg.jpg
  - /admin/images/uploads/CDC_SABIMRendering.jpg
  - /admin/images/uploads/cover123.jpg
  - /admin/images/uploads/IMG00357-20120419-0925_jpg.jpg
  - /admin/images/uploads/may2011135.jpg
---

## Description

A CDCSA is used by the Army to support readiness of families by reducing the conflict between military mission workforce requirements and parental responsibilities. CDCSA facilities covered in this standard were developed to support the needs of children 6 - 10 years of age. A CDCSA provides before-school and after-school care during the duty day, summer, school-out days, and holidays. Services are generally provided on a regularly scheduled daily basis for before-school and after-school care, as well as on a full-day basis during the summer, school-out days, and holidays. The Army Standards for CDCSA are based on Army Baseline Standards and Department of Defense requirements for certification.

## Variations

| Facility Size Classification | Number of Children | Number of Staff | Gross Building Area (SF) | Playground Area (SF) | Parking Spaces |
| ---------------------------- | ------------------ | ---------------- | ------------------------- | -------------------- | --------------- |
| Wing Addition               | 60-75             | 12              | 8,880                    | 47,606              | 28             |
| Small                       | 105-135            | 17              | 13,929                   | 47,606              | 36             |
| Medium                      | 150-180           | 21              | 20,484                   | 52,106              | 43             |
| Large                       | 195-225           | 26              | 22,927                   | 52,106              | 51             |

repository: mrsi-cerl/mrsi-gatsby

repo_name: mrsi-cerl/mrsi-gatsby


text:
simple_matrix
===================

This is a simple library for matrix calculations aiming for ease to set up and use. It is contained in a single file that has no dependencies except for one C++ header that can be easily pasted any project and included as header.

----------
Purpose
--
Nobody should be motivated to deal with all the weirdness of MatLab only because it does a few basic matrix operations. This easy library implements in C++ a matrix object that supports functions like addition, subtraction, multiplication (by vector, scalar or matrix), transposition, power or determinant, all of which can be used in the source code as naturally as in MatLab.

----------
Features
--
- Support for matrix addition, subtraction, multiplication, transposition, power, determinant, comparison and printing, all doable through operators if possible
- Compile time checking of matrix dimensions via templates
- Boundary checks when accessing elements in debug mode (prints warnings)
- Internally identical to a 2D array
- Permissive licence allowing it to be taken into any project and edited as suitable

----------
Example
--
```C++
#include "simple_matrix.h"
matrix<2, 2> A = {{2, 3}, {3, 1}; // declare+init 2x2 matrix
matrix<3, 2> B = {{2, 3}, {0, 1}, {3, 1}}; // a 3x2 matrix
matrix<3, 2> C = B * A + B; // arithmetic
C[1][2] = 3; // set a value like in an array
A = (A ^ 2) * 2; // caution, the power sign has low priority
lineVector<2> a = {1, 7}; // same as a 1x2 matrix
lineVector<2> b = a * transpose(A);
double c = determinant(A);
```
> **Notes**:
>- first index is line row, second is column
>- the numeric type is double by default, but other types can be set as a third template argument (p.e. `matrix<3, 3, float>` or `lineVector<2, int>`)
>- requires C++11 to compile
>- only the simple_matrix.h file is required, tests.cpp is only to check if the functions do what they are meant to do

----------
Limitations
--
- No algorithm for matrix inversion or computation of eigenvalues or eigenvectors
- No optimised algorithm for matrix multiplication
- Quite slow in debug mode

----------
If you want something changed...
--
If you miss some feature or find a bug, do not hesistate to contact me about it, either via issues or via pull requests.


text:
# rainbow-colors
Evenly spaced non random color generator

Whilst several very good random color module exists, sometimes they randomly pick colors which are too close, and each time they run they pick a different set of colors.
Sometimes it is useful to have a predictable set of colors. This module picks n evenly space colors from the color hue wheel.

usage

npm install rainbow-colors

rainbowColors = require('rainbow-colors');
// or for angular2 / typescript: import * as rainbowColors from 'rainbow-colors';

let n=6;
let config = {
      lum:50,
      sat:50
      rgb:false     // set to true for rgb
    };
let colorArray = rainbowColors.generate(n,config);

// returns ["HSL(0,50%,50%)", "HSL(60,50%,50%)", "HSL(120,50%,50%)", "HSL(180,50%,50%)", "HSL(240,50%,50%)", "HSL(300,50%,50%)"]

Module sponsored by AI employee support platform https://knowyourday.ai/

repository: adappt/rainbow-colors

repo_name: adappt/rainbow-colors


text:
---
title: Why not JSON5?
---

[JSON5](http://json5.org/) is also a proposed extension to JSON to make it more readable.

Its main criticism of YAML is::

  There are other formats that are human-friendlier, like YAML, but changing from JSON to a completely different format is undesirable in many cases.

This is, I believe, mistaken. It is better if a language is not subtly different if you are going to use it as such. Subtle differences invite mistakes brought on by confusion.

JSON5 looks like a hybrid of YAML and JSON::

```json
{
    foo: 'bar',
    while: true,
}
```

It has weaknesses similar to TOML:

- The noisiness of the delimiters that supplant significant whitespace make it less readable and editable.
- The use of [syntax typing](../../why/syntax-typing-bad) is neither necessary, nor an aid to stricter typing if you have a schema.

repository: crdoconnor/strictyaml

repo_name: crdoconnor/strictyaml


text:
# Change Log for CodeIgniter Simple and Secure Twig

## v4.2.0 (2023-03-20)

### Changed

- Require:
    - PHP 7.4 or later.
    - Twig 3.4.3 or later.
    - CodeIgniter 4.2.11 or later.

### Added

- Add functionality to add your filters. See [README](README.md#adding-your-functions--filters).
- Add functionality to override functions that are customized by *CodeIgniter Simple and Secure Twig*.

## v4.1.0 (2022-09-20)

### Changed

- Require:
  - PHP 7.3 or later.
  - Twig 3.3.8 or later.
  - CodeIgniter 4.2 or later.

## v4.0.0 (2021-02-05)

### Changed

* Require PHP 7.2 or later.
* Require Twig 3.1.1 or later.
* Compatible with CodeIgniter 4.0.4

## v0.4.0 (2019/03/22)

### Changed

* Require Twig 1.38.0 or later.

### Added

* No direct script access allowed.

## v0.3.0 (2018/08/14)

### Added

* Add functionality to override any Twig Environment options.

### Changed

* Require Twig 1.22.0 or later.

## v0.2.1 (2016/06/17)

### Fixed

* Fix duplicated slashes in the cache path.

## v0.2.0 (2016/03/08)

### Fixed

* Fix bug that CodeIgniter helper `anchor` does not work.

### Added

* Add functionality to add your functions. See [README](README.md#adding-your-functions--filters).

## v0.1.0 (2015/11/17)

* Initial version
* Compatible with CodeIgniter 3.0

repository: kenjis/codeigniter-ss-twig

gha_language: PHP

repo_name: kenjis/codeigniter-ss-twig


text:
icvpn-scripts
=============
[![Build Status][Travis image]][Travis]

[Travis image]: https://travis-ci.org/freifunk/icvpn-scripts.svg
[Travis]: https://travis-ci.org/freifunk/icvpn-scripts

This is a collection of scripts for working with the [icvpn-meta repository].
While the actual data about the communities' networks and stuff goes there,
these scripts use that data to do something with it.

### Why is this a separate repository?
While the [icvpn-meta repository] is intended to be updated automatically to
receive updated data, it is obviously not a good idea to automatically update
the scripts that are periodically executed on a server. To prevent people from
shooting themselves in the foot by not reading a readme that says "copy the
scripts, don't use them directly!", the scripts were split off into this
repository.

Requirements
------------
All of the scripts are currently written in Python and need the `python-yaml`
package.

All of the scripts need a checked out version of the [icvpn-meta repository],
and expect it by default to be in the subdirectory `data` of the current
working directory. However, they all support the `-s` or `--source` switch to
specify another location.

### Debian
On Debian `apt-get install python3-yaml python3-requests python3-prettytable
python3-jinja2 python3-natsort` should install all dependencies.

#### Debian Wheezy (oldstable)
You might run into problems because of a missing ipaddress and natsort module (shipped with python >= 3.3), so install it via pip.
```
apt-get install python3-yaml python3-pip
pip-3.2 install ipaddress natsort
```

Find Free Resources (`findfree`)
--------------------------------
`findfree` searches for free asn, transfer ip combinations and ip subnet allocations in the predefined
network segments.

**Note** that it is crucial to have an up to date [icvpn-meta repository] to
ensure the utility outputs useful data.

The output of `findfree --help`
```
usage: findfree [-h] [-s DIRECTORY] [-p PREFIX] [-c COUNT]

Find free resources in the Freifunk ICVPN Universe

optional arguments:
  -h, --help            show this help message and exit
  -s DIRECTORY, --source-dir DIRECTORY
                        path to the local copy of the icvpn-metarepository
                        (Default: ../icvpn-meta/)
  -p PREFIX, --prefix-length PREFIX
                        Required prefix length (Default: 20)
  -c COUNT, --count COUNT
                        The amount of options to show (Default: 5)

Make sure your copy of icvpn-meta is up to date, to ensure this utility
produces useful results.
```

BGP (`mkbgp`)
-------------
`mkbgp` generates the configuration for a BGP server (currently bird and quagga
are supported) that wants to participate in the IC-VPN. It requires an already
working Layer 2 connection (Tinc, see [the icvpn repository]) and sets up BGP
sessions with other communities. This was the main reason for having the
[icvpn-meta repository] at all, to speed up the integration of new peers.

**Note** that other communities' BGP servers probably won't accept your
connection if they don't know you as a peer. It is therefore necessary to
create a suitable community file in the [icvpn-meta repository], and even then,
only communities generating their BGP communities from that repository will
accept your connection after the next update. Many communities manage their
configuration by hand, so rejected connections are not unusual.

The output of `mkbgp --help`:
```
Usage: mkbgp [options]

Options:
  -h, --help            show this help message and exit
  -f FMT, --format=FMT  Create config in format FMT.
                        Possible values: quagga, bird. Default: bird
  -4                    Generate IPv4 config
  -6                    Generate IPv6 config
  -s DIR, --sourcedir=DIR
                        Use files in DIR as input files.
                        Default: ../icvpn-meta/
  -x COMMUNITIES, --exclude=COMMUNITIES
                        Exclude the comma-separated list of COMMUNITIES
  -p PREFIX, --prefix=PREFIX
                        Prefix, e.g. bgp_icvpn_
  -P TIMEOUT, --passive-offline=TIMEOUT
                        Add peers that take longer than TIMEOUT to
                        respond at time of creation as passive peers
                        Set to 0 do disable
                        Default: 3 seconds
  -d TEMPLATE, --default=TEMPLATE
                        Default template/peer-group to use
  -t COMMUNITY:TEMPLATE, --template=COMMUNITY:TEMPLATE
                        Use different template/peer-group for some communities
```

ROA (`mkroa`)
-------------
`mkroa` creates a Route Origin Authorization (ROA) table for a bgp server
(currently only bird is supported). ROAs can be used in filters to link
prefixes to ASNs. By that, announcements are validated with the data from
the [icvpn-meta repository], so that prefixes are only imported if announced
by the correct community.

**Note** that this script does only output one ROA statement per prefix and
ASN, so you have to surround the output yourself with the appropriate table
statement, e.g. like `roa table icvpn_roa { include "roa.con?" }`.

The ROA table can then be used in a filter
```
filter icvpn_in {
  if roa_check(icvpn_roa, net, bgp_path.last) = ROA_INVALID then {
    print "ROA check failed for ", net, " ASN ", bgp_path.last;
    reject;
  }
  accept;
}
```
which then can be used e.g. in a template `import filter icvpn_in;`.

The output of `mkroa --help`:
```
Usage: mkroa [options]

Options:
  -h, --help            show this help message and exit
  -f FMT, --format=FMT  Create config in format FMT.
                        Possible values: bird.
  -4                    Generate IPv4 config
  -6                    Generate IPv6 config
  -s DIR, --sourcedir=DIR
                        Use files in DIR as input files.
                        Default: ../icvpn-meta/
  -x COMMUNITIES, --exclude=COMMUNITIES
                        Exclude the comma-separated list of COMMUNITIES
  -m DEFAULT_MAX_PREFIXLEN, --max=DEFAULT_MAX_PREFIXLEN
                        max prefix length to accept
```

DNS (`mkdns`)
-------------
`mkdns` generates configuration for DNS servers (currently bind and dnsmasq are
supported) to enable it to resolve the custom top level domains and reverse
`.arpa` zones of Freifunk communities by configuring the appropriate DNS
servers as forwarders for these zones.

This of course requires a working connection to the DNS servers of the
communities. While for some communities a global IPv6 connection might be
enough to reach their servers, others do not use global IPv6 and you need a
connection to the IC-VPN itself to connect (either using IPv6 or IPv4).

The output of `mkdns --help`:
```
Usage: mkdns [options]

Options:
  -h, --help            show this help message and exit
  -f FMT, --format=FMT  Create config in format FMT.
                        Possible values: bind-forward, dnsmasq, unbound, bind.
                        Default: dnsmasq
  -s DIR, --sourcedir=DIR
                        Use files in DIR as input files. Default: ../icvpn-
                        meta/
  -x COMMUNITY, --exclude=COMMUNITY
                        Exclude COMMUNITY (may be repeated)
  --filter=FILTER       Only include certain servers.
                        Possible choices: v6, v4
```

Smokeping (`mksmokeping`)
-------------------------
`mksmokeping` generates the configuration for a [Smokeping] instance to make it
monitor the BGP servers of all communities. This obviously requires a working
Layer 2 IC-VPN connection (Tinc, see [icvpn repository]), or else none of them
should be reachable..

The output of `mksmokeping --help`:
```
Usage: mksmokeping [options]

Options:
  -h, --help            show this help message and exit
  -f FMT, --format=FMT  Create config in format FMT.
                        Possible values: SmokePing. Default: SmokePing
  -s DIR, --sourcedir=DIR
                        Use files in DIR as input files.
                        Default: ../icvpn-meta/
  -x COMMUNITIES, --exclude=COMMUNITIES
                        Exclude the comma-separated list of COMMUNITIES

```

[Smokeping]: http://oss.oetiker.ch/smokeping/

Wiki ('mkwikitable')
--------------------
`mkwikitable` generates ...

The output of `mkwikitable --help`:
```
usage: mkwikitable [-h] [--meta-dir DIR]

Generate a mediawiki table about all ipv4/ipv6-networks. Uses 'api_data.dump'
generated by apireader.py, if available.

optional arguments:
  -h, --help      show this help message and exit
  --meta-dir DIR  Path to local icvpn-meta clone. Default: ../icvpn-meta/
```

Integrity checking (`check`)
----------------------------
This script checks the integrity [icvpn-meta repository]'s checkout and is used
as [its Travis CI hook](https://travis-ci.org/freifunk/icvpn-meta/). You can
use it to test your own submission to that repository beforehand, but it isn't
of much use otherwise.

Note that `check` requires Python **3.3**, for it provides an excellent
[IPv4/IPv6 manipulation
library](https://docs.python.org/3.3/library/ipaddress.html)

Visualisation (`netblocks`)
---------------------------
This script generates json-files compartible to dn42-netblock-visu to visualise
the adressspace utilisation.

The output of `netblocks --help`
```
Usage: netblocks [options]

Options:
  -h, --help            show this help message and exit
  -s DIR, --sourcedir=DIR
                        Use files in DIR as input files. Default: ../icvpn-
                        meta/
  -d DIR, --destdir=DIR
                        Use DIR as destination for the generated files.
                        Default: ./netblocks-data
```

Contributing
------------
You have an idea how to use the data in the [icvpn-meta repository]
programmatically, don't hesitate to contribute a new script. If it generates a
configuration of some kind, you might want to have a look at the `formatter`
module, which offers the `Formatter` base class that could ease the process of
config generation.

Of course, we are also happy to support more programs in the already existing
scripts!

[icvpn repository]: https://github.com/freifunk/icvpn
[icvpn-meta repository]: https://github.com/freifunk/icvpn-meta

repository: rappet/icvpn-scripts

repo_name: rappet/icvpn-scripts


text:
---
layout: post
title: Vim Notes
mathjax: false
related: false
comments: true
published: true
---

_Created: Jan, 2012_

_Last modified: Feb, 2016_

A tiny subset of VIM commands I find very useful...

## Windows

* Split window vertically: "C-w v"
* Split window horizontally: "C-w s"
* Switch among windows: "C-w w"
* Resize the current window horizontally: ":resize 60" (resize to 60 rows); ":resize +5" (increase by 5 columns); can also use "res" instead of "resize" for abbreviation.
* Resize the current window vertically: everything is the same to horizontal resizing by replacing "resize" with "vertical resize".
* [Use file explorer netrw](http://vimcasts.org/episodes/the-file-explorer/)

## General

* Insert characters in multiple lines (such as inserting space at the head of multiple lines): see [this post](http://vim.wikia.com/wiki/Inserting_text_in_multiple_lines)

* How to [use Vundle to manage VIM plugins](https://www.digitalocean.com/community/tutorials/how-to-use-vundle-to-manage-vim-plugins-on-a-linux-vps).

* [Open multiple files in new tabs or split windows and navigate](http://askubuntu.com/a/537972): this can be handy when working on multiple files.

* Go to line: (at least) 3 different ways
  - `42G`
  - `42gg`
  - `:42<CR>`

* Move forward by one word: `w`; move forward by 3 words: `3w`.
* Move backward by one word: `b`; move backward by 3 words: `3b`.
* Move to the beginning of the line: `0`; move to the non-blank character of the line: '^'.
* Move forward by one sentence: `)`; move backward by one sentence: `(`.
* Move forward by one paragraph: `}`; move backward by one paragraph: `{`.
* Move to the top of screen: `H`; middle of screen: `M`; and bottom of screen: `L`

* Undo: `u`; redo: `Ctrl+r`.

## Using marks

[This page](http://vim.wikia.com/wiki/Using_marks) summarizes it well.

## Indentation Settings

Take care of indentation of C/C++ code ([this link](http://stackoverflow.com/questions/97694/auto-indent-spaces-with-c-in-vim)), and generally [the indentation in Vim](http://vim.wikia.com/wiki/Indenting_source_code).

Put the following lines to "~/.vimrc":

```
set autoindent
set shiftwidth=4
set softtabstop=4
set expandtab
```

Here "autoindent" does no more than indenting following the previous line. For C/C++ files one may explore "cindent" option.

To disable autoindentation when pasting text, do this in normal mode:

```
:set paste
```

After done with pasting, do this to re-enable autoindentation with

```
:set nopaste
```

Another trick is to set a key shortcut to toggle this "paste action" by adding this line to '~/.vimrc':

```
set pastetoggle=<F10>
```

which will associate key F10 with this toggling behavior.

Reference [here](http://stackoverflow.com/q/2514445).

## Color

By default, the comments are lightlighted with dark blue in a black background, which is hard to see in a terminal. I find using "desert" color theme in a black ground works better. Add this line to "~/.vimrc":

```
colors desert
```

See some discussions [here](http://unix.stackexchange.com/questions/88879/vim-better-colors-so-comments-arent-dark-blue) and [here](http://vim.wikia.com/wiki/Change_the_color_scheme).

## Search & Replace

* [Search and replace in normal text mode](http://vim.wikia.com/wiki/Search_and_replace). Some commonly used commands

To search and replace A with B in the current line

```
:s/A/B/g
```

To search and replace A with B globally (all lines)

```
:%s/A/B/g
```

To search and replace A with B globally with confirmation of each match

```
:%s/A/B/gc
```

* [Search and replace in visual selection_mode](http://vim.wikia.com/wiki/Search_and_replace_in_a_visual_selection)

## Command-line interaction

* To run a shell command with the file being edited like

```
:! g++ %
```

which will compile the current file with GCC C++ compiler.

* To run a command in certain working directory, first check the working directory with

```
:pwd
```

To change the working directory to the directory the file being editing is in, run

```
:cd %:p:h
```

Explanation of the above command: % gives the name of the current file, %:p gives its full path, and %:p:h gives its directory (the "head" of the full path).

For more information on this topic, see [this post](http://vim.wikia.com/wiki/Set_working_directory_to_the_current_file).

## Visual block mode

Press `Ctrl+v` to enter visual block mode. It is amazing. See [this tutorial](http://vimcasts.org/episodes/selecting-columns-with-visual-block-mode/) for a brief introduction.

repository: yinyingt/yysite

repo_name: yinyingt/yysite


text:
# rust-hsa

Heterogeneous System Architecture(HSA) v1.1 bindings for Rust

## Requirements

* [ROCm compatible GPU + CPU + M/B](https://rocm.github.io/hardware.html)
* [ROCK-Kernel-Driver](https://github.com/RadeonOpenCompute/ROCK-Kernel-Driver)
* [ROCT-Thunk-Interface](https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface)
* [ROCR-Runtime](https://github.com/RadeonOpenCompute/ROCR-Runtime)
* AMD HSAIL Fializer Extension (included in http://repo.radeon.com/rocm/apt/debian/pool/main/h/hsa-ext-rocr-dev/)

## Tested Environment

* 2017/12/25

    * CPU: AMD Threadripper 1950X
    * M/B: [ASRock X399 Taichi](http://www.asrock.com/MB/AMD/X399%20Taichi/index.asp)
    * Linux: Gentoo Linux (amd64)
    * ROCm: v1.7.0

* 2017/07/19

    * CPU: AMD Ryzen 7 1800X
    * M/B: [ASRock AB350M Pro](http://www.asrock.com/mb/AMD/AB350M%20Pro4/index.asp)
    * Linux Distribution: Gentoo Linux (amd64)
    * ROCm: v1.6.0

## included tools

### hsainfo

Dump HSA information

```
$ cargo run --bin hsainfo
[HSA SystemInfo]
* version: 1.1
* timestamp:<PHONE_NUMBER>26029 [s] (freq: 1000 [MHz])
* signal-max-wait:<PHONE_NUMBER>3709551615
* endianness: Little
* machine_model: Large
* extensions: ["HSA_EXTENSION_FINALIZER"]

[Agent (CPU)]
  * name: AMD Ryzen Threadripper 1950X 16-Core Processor
  * vendor: CPU
  * feature: AgentDispatch
  * machine_model/profile: Large / Full (deprecated)
  * float_rounding: Near / Near (deprecated)
  * fast_f16_operation: false (deprecated)
  * wavefront size: 0 (deprecated)
  * workgroup max dim: [0, 0, 0] (deprecated)
  * workgroup max size: 0 (deprecated)
  * grid max dim: Dim3 { x: 0, y: 0, z: 0 } (deprecated)
  * grid max size: 0 (deprecated)
  * fbarrier max size: 0 (deprecated)
  * queues max: 0 (deprecated)
  * queue min/max/type: 0 / 0 / Multi
  * version: 1.1
  [Cache]
    * AMD Ryzen Threadripper 1950X 16-Core Processor L1(L1 32768KiB) x 16
  [Region (Global)]
    * size:<PHONE_NUMBER>0
    * global flags: {KernArg, FineGrained}
    * alloc max_size/granule/align:<PHONE_NUMBER>0 4096 4096
  [Region (Global)]
    * size:<PHONE_NUMBER>4
    * global flags: {KernArg, FineGrained}
    * alloc max_size/granule/align:<PHONE_NUMBER>4 4096 4096
  [Region (Global)]
    * size:<PHONE_NUMBER>0
    * global flags: {CoarseGrained}
    * alloc max_size/granule/align:<PHONE_NUMBER>0 4096 4096
  [Region (Global)]
    * size:<PHONE_NUMBER>4
    * global flags: {CoarseGrained}
    * alloc max_size/granule/align:<PHONE_NUMBER>4 4096 4096

[Agent (CPU)]
  * name: AMD Ryzen Threadripper 1950X 16-Core Processor
  * vendor: CPU
  * feature: AgentDispatch
  * machine_model/profile: Large / Full (deprecated)
  * float_rounding: Near / Near (deprecated)
  * fast_f16_operation: false (deprecated)
  * wavefront size: 0 (deprecated)
  * workgroup max dim: [0, 0, 0] (deprecated)
  * workgroup max size: 0 (deprecated)
  * grid max dim: Dim3 { x: 0, y: 0, z: 0 } (deprecated)
  * grid max size: 0 (deprecated)
  * fbarrier max size: 0 (deprecated)
  * queues max: 0 (deprecated)
  * queue min/max/type: 0 / 0 / Multi
  * version: 1.1
  [Cache]
    * AMD Ryzen Threadripper 1950X 16-Core Processor L1(L1 32768KiB) x 8
  [Region (Global)]
    * size:<PHONE_NUMBER>0
    * global flags: {KernArg, FineGrained}
    * alloc max_size/granule/align:<PHONE_NUMBER>0 4096 4096
  [Region (Global)]
    * size:<PHONE_NUMBER>4
    * global flags: {KernArg, FineGrained}
    * alloc max_size/granule/align:<PHONE_NUMBER>4 4096 4096
  [Region (Global)]
    * size:<PHONE_NUMBER>0
    * global flags: {CoarseGrained}
    * alloc max_size/granule/align:<PHONE_NUMBER>0 4096 4096
  [Region (Global)]
    * size:<PHONE_NUMBER>4
    * global flags: {CoarseGrained}
    * alloc max_size/granule/align:<PHONE_NUMBER>4 4096 4096

[Agent (GPU)]
  * name: gfx803
  * vendor: AMD
  * feature: KernelDispatch
  * machine_model/profile: Large / Base (deprecated)
  * float_rounding: Near / Near (deprecated)
  * fast_f16_operation: false (deprecated)
  * wavefront size: 64 (deprecated)
  * workgroup max dim: [1024, 1024, 1024] (deprecated)
  * workgroup max size: 1024 (deprecated)
  * grid max dim: Dim3 { x:<PHONE_NUMBER>, y:<PHONE_NUMBER>, z:<PHONE_NUMBER> } (deprecated)
  * grid max size:<PHONE_NUMBER> (deprecated)
  * fbarrier max size: 32 (deprecated)
  * queues max: 128 (deprecated)
  * queue min/max/type: 4096 / 131072 / Multi
  * version: 1.1
  [Cache]
    * gfx803 L1(L1 16KiB) x 64
    * gfx803 L1(L1 4KiB) x 16
  [ISA]
    * name: AMD:AMDGPU:8:0:3�
    * machine_models/profiles: {Large} / {Base}
    * float rounding modes: {Near} / {Near}
    * fast f16 ops: true
    * workgroup max dim: [1024, 1024, 1024]
    * workgroup max size: 1024
    * grid max dim: Dim3 { x:<PHONE_NUMBER>, y:<PHONE_NUMBER>, z:<PHONE_NUMBER> }
    * grid max size:<PHONE_NUMBER>3709551615
    * fbarrier max size: 32
    [Wavefront]
      * size: 64
  [Region (Global)]
    * size:<PHONE_NUMBER>
    * global flags: {CoarseGrained}
    * alloc max_size/granule/align:<PHONE_NUMBER> 4096 4096
  [Region (Group)]
    * size: 65536
  [Region (Global)]
    * size:<PHONE_NUMBER>0
    * global flags: {KernArg, FineGrained}
    * alloc max_size/granule/align:<PHONE_NUMBER>0 4096 4096
  [Region (Global)]
    * size:<PHONE_NUMBER>4
    * global flags: {KernArg, FineGrained}
    * alloc max_size/granule/align:<PHONE_NUMBER>4 4096 4096
  [Region (Global)]
    * size:<PHONE_NUMBER>0
    * global flags: {CoarseGrained}
    * alloc max_size/granule/align:<PHONE_NUMBER>0 4096 4096
  [Region (Global)]
    * size:<PHONE_NUMBER>4
    * global flags: {CoarseGrained}
    * alloc max_size/granule/align:<PHONE_NUMBER>4 4096 4096
```

### vector-copy

HSA sample program

```
$ cargo run --bin vector_copy
Checking finalizer 1.0 extension support succeeded.
Getting a gpu agent succeeded.
Querying the agent name succeeded.
The agent name is gfx803.
Getting a ISA succeeded.
Obtaining machine model succeeded.
Querying the isa maximum queue size succeeded.
The maximum queue size is 131072.
Creating the queue succeeded.
Create the program succeeded.
Adding the brig module to the program succeeded.
Finalizing the program succeeded.
Create the executable succeeded.
Loading the code object succeeded.
Freeze the executable succeeded.
Extract the symbol from the executable succeeded.
Extracting the kernel object from the executable succeeded.
Extracting the group segment size from the executable succeeded.
Extracting the private segment size from the executable succeeded.
Creating a HSA signal succeeded.
Finding a fine grained memory region succeeded.
Finding a kernarg memory region succeeded.
Allocating argument memory for input parameter succeeded.
Allocating argument memory for output parameter succeeded.
Allocating kernel argument memory buffer succeeded.
Dispatching the kernel
Passed validation.
```

repository: kazuki/rust-hsa

repo_name: kazuki/rust-hsa


text:
# The Recipe DB

The Recipe DB is an API that allows users to retrieve and upload recipes. Each recipe entry contains the name of the dish, ingredients, cooking instructions, and an image of the dish.

## Tech/framework used
This is a RESTful API built with Node.js using PostgreSQL for the database and utilizes Heroku to store the server and database.

## Installation and Running Server
To run the server on your local machine first clone this repository using:

```
git clone https://github.com/nicholasruan/recipe-api
```

Once the repository is on your local machine install dependencies using:

```
npm install
```

To begin running server use:

```
npm start
```

## License

MIT © Nicholas Ruan()

repository: nicholasruan/recipe-api

repo_name: nicholasruan/recipe-api


text:
# Starter
**Starter** is a react ssr enabled starter kit (SSR | Universal | Isomorphic).

[![Build Status](https://travis-ci.org/ItsMrAkhil/starter.svg?branch=master)](https://travis-ci.org/ItsMrAkhil/starter)
[![dependencies Status](https://david-dm.org/itsMrAkhil/starter/status.svg)](https://david-dm.org/itsMrAkhil/starter)
[![devDependencies Status](https://david-dm.org/itsMrAkhil/starter/dev-status.svg)](https://david-dm.org/itsMrAkhil/starter?type=dev)

#### Features
  - HMR (Hot Module Replace) enabled (Even SSR Enabled) in dev mode (Cool as shit.)
  - [React Hot Loader 4](https://github.com/gaearon/react-hot-loader/tree/next)
  - [React Router V4](https://reacttraining.com/react-router/web/guides/philosophy)
  - [React Redux](https://github.com/reactjs/react-redux)
  - [Redux Thunk](https://github.com/gaearon/redux-thunk)
  - [Express](http://expressjs.com/) as Server
  - Server Side Rendering Enabled
  - Code Splitting using [React-Loadable](https://github.com/thejameskyle/react-loadable)
  - 404 Error codes handling
  - No other view engines only JS (React) based view engine. Even on server side.
  - Auto restart ssr proxy server on code change.
  - ESLint for following better coding standards
  - Import static images inside JS. (file-loader)

> **Note:** This starter is not for those who are new to React.js. In other words it is only for those who knows react well and who wants to create react apps with **Server Side Rendering**

### Usage

Starter requires [Node.js](https://nodejs.org/) v6+ to run.

Clone this repo
```sh
$ git clone https://github.com/ItsMrAkhil/starter
```
Install the dependencies and devDependencies and start the server.

```
$ cd starter
$ npm install
$ npm start
```

For production environment

```sh
$ npm run start:production
```

For generators (Try this magic. It'll be cool)

```
$ npm run generate
```

### Todos

 - Add Jest and Enzyme Testing (Need to add testing to all components)
 - Separate common webpack configurations from webpack config files. And use webpack merge to combine all with the base config (PR Welcome)
 - Make Reducers also lazy. Load reducers which are required for the particular route. (PR Welcome, Help required.)

License
----
MIT

**Free Software, F##k Yeah!**