text:
---
title: Xen’s XSA-108 patch and Fedora
author: Major Hayden
type: post
date: 2014-10-02T12:39:11+00:00
url: /2014/10/02/xens-xsa-108-patch-fedora/
dsq_thread_id:
  -<PHONE_NUMBER>
categories:
  - Blog Posts
tags:
  - fedora
  - security
  - xen

---
[<img src="/wp-content/uploads/2012/06/xen_logo_small-300x133.png" alt="Xen Logo" width="300" height="133" class="alignright size-medium wp-image-3397" srcset="/wp-content/uploads/2012/06/xen_logo_small-300x133.png 300w, /wp-content/uploads/2012/06/xen_logo_small.png 800w" sizes="(max-width: 300px) 100vw, 300px" />][1]Xen's latest vulnerability, [XSA-108][2], has generated a lot of buzz over the last week. Most of the attention has come from the reboot notifications from large cloud providers (including [my employer][3]).

The vulnerability allows a user within a guest to potentially read memory from another guest or the hypervisor itself. The window of available memory is small but it could be read many times over - much like how the [Heartbleed][4] vulnerability was exploited. In some situations, these actions could cause the guest or the hypervisor to crash.

The fix involves a [small patch][5] to the Xen hypervisor kernel. The patch is essentially a one-liner since the write operation was merely a no-op already.

Thanks to the efforts of Michael Young, new packages are in testing for Fedora 19, 20, and 21:

  * [xen-4.2.5-3.fc19][6]
  * [xen-4.3.3-3.fc20][7]
  * [xen-4.4.1-6.fc21][8]

If you'd like to test these packages now, you can install koji and download the RPM's directly:

```
yum -y install koji
koji download-build --arch=x86_64 xen-4.2.5-3.fc19  # For Fedora 19
koji download-build --arch=x86_64 xen-4.3.3-3.fc20  # For Fedora 20
koji download-build --arch=x86_64 xen-4.4.1-6.fc21  # For Fedora 21
```

Use yum or rpm to install the new packages. Some servers may need to install all of the downloaded RPM's or only a portion of them. All of that depends on which Xen-related packages were installed already.

After testing, _please leave karma_ in [Bodhi][9] on the appropriate package page.

 [1]: /wp-content/uploads/2012/06/xen_logo_small.png
 [2]: http://xenbits.xen.org/xsa/advisory-108.html
 [3]: http://www.rackspace.com/blog/an-apology/
 [4]: http://heartbleed.com/
 [5]: http://xenbits.xen.org/xsa/xsa108.patch
 [6]: http://koji.fedoraproject.org/koji/buildinfo?buildID=582124
 [7]: http://koji.fedoraproject.org/koji/buildinfo?buildID=582115
 [8]: http://koji.fedoraproject.org/koji/buildinfo?buildID=582102
 [9]: https://admin.fedoraproject.org/updates/xen


text:
# Polarity Gigamon ThreatINSIGHT Integration

The Polarity - Gigamon integration searches Gigamon for detection information as well as any associated DHCP, PDNS or Summary information.

To learn more about Gigamon, please visit the [official website](https://www.gigamon.com/).

## Gigamon Integration Options

### Gigamon ApiKey
Gigamon API token. You can find your api token by navigating to your account.

### Gigamon Account UUID
Account UUID. Your Account UUID found in your profile on the Dashboard. Used to filter down detection results.

### Ignore List
List of domains that you never want to send to Gigamon ThreatINSIGHT.

### Ignore Domain Regex
Domains that match the given regex will not be looked up.

### Ignore IP Regex
IPs that match the given regex will not be looked up.

## Installation Instructions

Installation instructions for integrations are provided on the [PolarityIO GitHub Page](https://polarityio.github.io/).

## Polarity

Polarity is a memory-augmentation platform that improves and accelerates analyst decision making.  For more information about the Polarity platform please see:

https://polarity.io/

license: MIT

repository: polarityio/gigamon

branch_name: refs/heads/master

extension: md

gha_language: JavaScript

gha_license_id: MIT

license_type: permissive

repo_name: polarityio/gigamon


text:
---
title: "Services"
---

# Anatomy of a service µSpec
The µService specs are regular yaml files.

The “service-object” contains 5 fields.
The fields name, package and methods are mandatory, the field target and description is optional and autogenerated when ommited.

You can have as many service definitions per file as you want. It makes sense that you put types in a file, that belongs togehter.

{{< hint danger >}}
The field **methods** in µServcies will translate to **services** in the standard notation for compatibility reasons,
because the standard notation is some years old and changing this would be a breaking change we do not want to do at the moment.
{{< /hint >}}

```yaml
- name: FruitService
  description: Fruits are healthy, so having a service which can list some fruits would be nice.
  package: fruit
  target: fruit_service.proto
  methods:
    - md: 'ListFruits: GET /fruits google.protobuf.Empty , fruit.FruitCollection #Filterable and searchable list of fruits with pagination.'
      qp:
        q: 'string #Use this to search for a fruit.'
        filter: 'string #Use this field to filter the fruits, this is not searching.'
        order_by: 'string #Use this field to specify the ordering.'
        page: 'string #Use this field to specify page to display.'
```

## The Name
The name of the Service. Visit the [style guide](/docs/overview/style_guide/) for good naming. Can not contain spaces.

## The Description
Describe the intention of your service in some sentences. You can ommit this field.

## The Package
Define the package, this service belongs too.

## The Target
The target proto file for the generated proto. Furo can not generate proto files which mixes types and services.

## The Method definition
The method defiton is made like the type line in µTypes
```yaml
methods:
- md: 'GetFruit: GET /fruits/{frt} google.protobuf.Empty , fruit.FruitCollection #Filterable list of fruits.'
   ^   !______!^ !__! !_____!!__!  !___________________! ^ !___________________! ^!________________________!
   |       |   |   |     |     |            |            |           |           |              |
this means |   |   |     |     |      the request type   |           |           |              |
  Method   |   |   |     |   placeholder                 |   the response type   |              |
 Definiton |   |   |   the URL                           |                       |           description
      method name  |                                  a comma                    |
               the http verb                                            (#) is a separator, indicating the
               |                                                            beginning of the description
               |
         (:) is just a separator

```
### The Method Name
The method name should follow the naming conventions from the [google api design guide](https://cloud.google.com/apis/design/standard_methods).
Default names are (with fruit as example)
- *ListFruits* with a verb *GET* to receive a list of fruits
- *GetFruit* with a verb *GET* and an identifier placeholder to get a single record
- *UpdateFruit* with a verb *PUT* or PATCH and an identifier placeholder to update a single record
- *CreateFruit* with a verb *POST* to create a single record
- *DeleteFruit* with a verb *DELETE* and an identifier placeholder to delete a single record
- *DeleteAllFruits* with a verb *DELETE* to delete all records on this path
- *CustomMethod* with a verb *POST* to do custom stuff that does not fit in the other methods. Uses always a POST.

### The HTTP Verb
Use the standard Http verbs (GET, PUT, PATCH, POST, DELETE) according to the idempotency, except on custom methods, they should always use POST.

### The URL with Placeholder
Usualy the path part is a noun in plural form. Use singular nouns only on singleton ressources.
Do **not** append a prefix like */api* to your paths. Use **/fruits**.

{{< hint warning >}}
TIPP: Assume that your API is a host by its own. So you will address it with **api.xy.com/fruits**.
Having *api.xy.com/api/fruits* will look strange in that moment.

Adding prefixes can be done by infrastructure. The furo client libs also have the posibillity to prefix your specs according
to the situation.
{{< /hint >}}

{{< hint danger >}}
You will loose portability capabilities when you prefix your paths.
{{< /hint >}}

### The Request Type
On [GET requests](https://tools.ietf.org/html/rfc2616#section-9.3) you can not send a body, therfore you will put a google.protobuf.Empty type here.
On [DELETE requests](https://tools.ietf.org/html/rfc2616#section-9.7) you can not send a body, therfore you will put a google.protobuf.Empty type here.
On the other verbs, set the type to one of the types in your project specs or installed specs.

### The Response Type
Usualy you should use a entity or collection type as response (this is what the client libs loves to work with).
But you are free to define any response type as long all participants on client and server side know it.
You will get the entity and collection types nearly for free, by adding *(ce)* in the type line of the µType specs.

### Description
Again, descriptions are always optional, but strongly recomended to fill in. They will apear in every generate and can
give good hints to the devs who have to implement the specs.

## The Query Params
Methods can have query params as part of the URL path (placeholders) and as [query part](https://tools.ietf.org/html/rfc2616#section-3.2.2).

{{< hint info >}}
TIPP: be lazy and just write your `/paths/with/{phdr}/fruits/{frt}`.

Then run `furo muSrvSanitize`.

This will add the missing query params to your spec with a default description.
{{< /hint >}}

```yaml
  qp: <--- this means QueryParams
    q: 'string #Use this to search for a fruit.'
    ^  !_____! !______________________________!
    |     |                |
    |    type           description
    |
   the name of the query param

```

### The Query Param Name
The name must match with the used placeholders for the path part. [Query params](https://tools.ietf.org/html/rfc3986#section-3.4) should fullfill the RFC3986.
Otherwise you risk to never receive the param on the server side.

### The Query Param Type
The type is mostly a string. You can use any type which is url safe.

### The Query Param Description
Ceterum censeo, descriptions are useful information.

## Custom Methods in Detail
todo: write something about that.

repository: veith/eclipsefuro

branch_name: refs/heads/main

repo_name: veith/eclipsefuro


text:
# Power Thesaurus Search for Alfred #

Search for synonyms and antonyms on [Power Thesaurus](https://www.powerthesaurus.org) from [Alfred 4](https://www.alfredapp.com/).

![](demo.gif "")

## Installation ##

Get Power Thesaurus for Alfred from [GitHub](https://github.com/clarencecastillo/alfred-powerthesaurus/releases) or [Packal](http://www.packal.org/workflow/powerthesaurus-search).

## Usage ##

Primary commands:
- `pows <word>` — Search Power Thesaurus for synonyms of `<word>`.
- `powa <word>` — Search Power Thesaurus for antonyms of `<word>`.

For both primary commands:
  - `↩` or ` ⌘+C` — Copy highlighted entry to the clipboard
  - `⌘+L` — Show full query in Alfred's Large Text window
  - `⌘+↩` — Open highlighted entry in browser
  - `SHIFT` — Preview highlighted entry's page using quicklook

## Results ##

Resulting synonyms or antonyms will be sequentially listed according to user rating.

## Development ##

Use the `init.sh` script to install the required dependencies inside the `src` folder. When you're ready to test or export, copy the entire `src` folder to the existing workflow directory.

## Troubleshooting ##

#### SSL Errors
If you're having SSL issues, try temporarily disabling it by setting the workflow environment variable `ALFRED_PT_SSL_VERIFICATION` to `False`. This will bypass SSL verification as a workaround while waiting for the SSL certificate to be rectified. You can check Power Thesaurus's SSL certificate status [here](https://www.sslshopper.com/ssl-checker.html#hostname=api.powerthesaurus.org). Be sure to set it back to `True` when all's green.

#### Other Errors
For other errors, please open an issue describing how you got the error and together with the logs from `Alfred > Workflows > Debugging Mode` if possible. There's no proper error handling in place yet, so we'll have to troubleshoot things this way for now.

## Related Links ##

[GitHub Repository](https://github.com/clarencecastillo/alfred-powerthesaurus)
[Alfred Forums](https://www.alfredforum.com/topic/10576-powerthesaurus-search/)
[Packal](http://www.packal.org/workflow/powerthesaurus-search)

## Releases ##

There's probably a smarter way to do this, but when preparing a new release, don't forget to:

1. Bump `version` file
2. Bump the exported workflow following the format `PowerThesaurus-x.x.x.alfredworkflow`
3. Bump `alfredworkflow.version` field in `metadata.json` or just re-export the entire `metadata.json` from `Alfred > Workflows`

## Licensing ##

This workflow is released under the [MIT Licence](http://opensource.org/licenses/MIT).

By using this workflow, you acknowledge, understand and signify your agreement to Power Thesaurus Website's [terms and conditions](https://www.powerthesaurus.org/_terms_conditions), and [privacy statement](https://www.powerthesaurus.org/_privacy_statement).

## Acknowledgements ##

Big shoutout to the heroes that made Power Thesaurus possible. Help keep the platform free for everyone by [giving your support](https://www.powerthesaurus.org/_about).

It is heavily based on [deanishe's](https://github.com/deanishe) [Alfred-Workflow](http://www.deanishe.net/alfred-workflow/), also
[MIT-licensed](http://opensource.org/licenses/MIT).

repository: clarencecastillo/alfred-powerthesaurus

gha_language: Python

repo_name: clarencecastillo/alfred-powerthesaurus


text:
---
layout: post
title:      "What is "self"?"
date:       2020-04-09 21:07:13 -0400
permalink:  what_is_self
---

What is "self"?

self is a special  variable that points to the object that owns the currently executing code.  Ruby uses self everywhere:

* for instance variables
* for method and constant lookup.
* when defining methods, classes and modules

Every object knows itself, in every method, by the way of calling self. This is a special keyword in Ruby, that means just that: The object itself.

Let’s try that, and output self. In order to do that we need to add it somewhere inside the object. Any method would be good for that, but let’s just use the initialize method:

class Person
  def initialize(name)
    @name = name
    p self
  end
end

person = Person.new("Candice")
p person

#<Person:0x0000560720339118 @name="Candice">
#<Person:0x0000560720339118 @name="Candice">

As you can see we output the same object twice. Once in the initialize method using p self, and once in the outer scope using p person. You can also see that the cryptic looking object id is the same for both instances. So we can know it’s indeed the very same object.

extension: markdown


text:
The jötunn's vision and hearing are
unimpeded by inclement weather such as wind,
snow, and fog, and it has advantage on all Dexterity
(Stealth) checks it makes in such conditions.

***Ice Walk.*** The jötunn can move across and climb icy
surfaces without needing to make an ability check.
Additionally, difficult terrain composed of ice or
snow doesn't cost it extra movement.

***Ice Weapons.*** Once on each of its turns, the jötunn
can form a weapon of solid ice in its empty hand (no
action required). This weapon can be either a javelin
or a lance, either of which counts as magical for the
purpose of overcoming resistances and immunity to
nonmagical attacks. The weapon lasts indefinitely, as
long as it remains in sub-freezing temperatures.

***Innate Spellcasting (1/Day).*** The jötunn can innately
cast <i>ice storm</i>, requiring no material components.
Its innate spellcasting ability is Charisma (spell save
DC 15).

### Actions

***Multiattack.*** The jötunn makes two attacks with its
battleaxe.

***Battleaxe.*** Melee Weapon Attack: +11 to hit, reach
15 ft., one target. Hit: 26 (3d12 + 7) slashing
damage, or 33 (4d12 + 7) slashing damage if
wielded with two hands.

***Ice Lance.*** Melee Weapon Attack: +11 to hit, reach
15 ft., one target. Hit: 52 (10d8 + 7) piercing
damage plus 22 (5d8) cold damage.

***Ice Javelin.*** Ranged Weapon Attack: +11 to hit, range
80/320 ft., one target. Hit: 34 (6d8 + 7) piercing
damage plus 22 (5d8) cold damage.

repository: krfurlong/bestiary

gha_language: HTML

gha_license_id: NOASSERTION

repo_name: krfurlong/bestiary


text:
---
id: usage
title: "Usage"
---

The Usage navigate that create your Dictionary and use it.

## Create your dictionary

### 0. Requirements

- [GitHub](https://github.com/) account
- [Node.js](http://nodejs.org/)

### 1. Fork Dictionary repository

1. Visit [proofdict/proof-dictionary](https://github.com/proofdict/proof-dictionary "proofdict/proof-dictionary")
2. Click "Fork" button

![fork](assets/fork.png)

### 2. Setting

1. Open "Setting" on your forked repository

![open setting](assets/open-settings.png)

2. Go to "GitHub Pages" section

You should set "master" branch for GitHub Pages.

- Select "master branch"
- Click "Save"

![GitHub Pages](assets/settings.png)

3. Open your GitHub pages

For example. your GitHub account name is `azu` and please you visit <https://azu.github.io/proof-dictionary/>.

![your-github-pages.png](assets/your-github-pages.png)

Finally, You can see own dictionary!

![gh-pages](assets/gh-pages.png)

Next, use your dictionary with [textlint](https://textlint.github.io/).

### FAQ

#### Q. GitHub pages is blank

At first time, GitHub Pages is not built yet.
You should edit some file like `README.md` and GitHub build pages.

## Use with [textlint](https://textlint.github.io/)

You can use your dictionry with [textlint](https://textlint.github.io/).
[textlint](https://textlint.github.io/) is plugabble linting tool for natural language.

### Create new workspace

Create `<your-workspace>` directory and `package.json` file. A [package.json](https://docs.npmjs.com/files/package.json "package.json") manages dependencies of packages that include `textlint`:

```
# Create your workspace directory and move to it.
mkdir your-workspace
cd your-workspace

# `npm init` command creates `package.json` file.
npm init --yes
```

### Installation of [@proofdict/textlint-rule-proofdict](https://github.com/proofdict/proofdict/tree/master/packages/%40proofdict/textlint-rule-proofdict)

Install [textlint](https://textlint.github.io/) and [@proofdict/textlint-rule-proofdict](https://github.com/proofdict/proofdict/tree/master/packages/%40proofdict/textlint-rule-proofdict) rule.

```
npm install --save-dev textlint @proofdict/textlint-rule-proofdict
```

### Configuration `.textlintrc`

`.textlintrc` is configuration file for textlint.
You should set your dictionary url to `.textlintrc` before using this rule.

Create a `.textlintrc` file in your workspace:

```
./node_modules/.bin/textlint --init
```

Edit `.textlintrc` as below:

```json
{
    "rules": {
        "@proofdict/proofdict": {
            "dictURL": "https://<your-name>.github.io/proof-dictionary/"
        }
    }
}
```

For example, your GitHub account name is `azu`, set `dictURL` to `https://azu.github.io/proof-dictionary/`.

### Lint text

Finally, you can lint file with your dictionary.

```
./node_modules/.bin/textlint file.md
```

[@proofdict/textlint-rule-proofdict](https://github.com/proofdict/proofdict/tree/master/packages/%40proofdict/textlint-rule-proofdict) always fetch latest version of your dictionary.
In other word, you have edit your dictionary and the rule use it automatically.

For more details, See [Getting Started with textlint · textlint](https://textlint.github.io/docs/getting-started.html "Getting Started with textlint · textlint").

repository: proofdict/proofdict

gha_language: TypeScript

repo_name: proofdict/proofdict


text:
# Bacopa acuminata var. peninsularis (Pennell) Fernald VARIETY

#### Status
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Mecardonia acuminata var. peninsularis Pennell

### Remarks
null

repository: mdoering/backbone

path: /life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Plantaginaceae/Mecardonia/Mecardonia acuminata/Mecardonia acuminata acuminata/Bacopa acuminata peninsularis/README.md

repo_name: mdoering/backbone


text:
# Image

Image 是把图像数据放到 native heap 的 Android 图像库，可以降低 OutOfMemoryError 的出现概率。支持 JPEG，PNG（包括 apng）和 GIF（包括动态图）。

Image is an Android image library with data stored in native heap. JPEG, PNG(include apng) and GIF(include animated) supported.

# Usage

在最外面的 `build.gradle` 里加上 jitpack，别加到 buildscript 里了。

Add jitpack repository in top `build.gradle`, DO **NOT** ADD IT TO buildscript.

    allprojects {
        repositories {
            ...
            maven { url "https://jitpack.io" }
        }
    }

## Single library

TODO: 中文翻译。 在项目 `build.gradle` 里添加 Image 依赖。

Image is available as a single library with all codecs included. Add Image as dependency in project `build.gradle`.

    dependencies {
        ...
        compile 'com.github.seven332.Image:singlelib:0.3.0'
    }

## Multi library

TODO: 中文翻译。

Image is also available as multiple libraries. Include the core, then add on whichever codecs you need.

Note: If you need every image codec, use the single library release above.

    dependencies {
        ...
        implementation 'com.github.seven332.Image:core:0.3.0'
        implementation 'com.github.seven332.Image:jpeg:0.3.0' // Optional
        implementation 'com.github.seven332.Image:png:0.3.0'  // Optional
        implementation 'com.github.seven332.Image:gif:0.3.0'  // Optional
    }

# License

    Copyright (C) 2015-2018 Hippo Seven

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

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

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

gha_language: C


text:
# The Evolution of Asynchronous JavaScript

异步 JavaScript 进化史
======================

原文：[The Evolution of Asynchronous JavaScript](https://blog.risingstack.com/asynchronous-javascript/)

The async functions are just around the corner - but the journey to here was quite long. Not too long ago we just wrote [callbacks](https://blog.risingstack.com/node-js-best-practices/), then the Promise/A+ specification emerged followed by [generator functions](https://blog.risingstack.com/hapi-on-steroids-using-generator-functions-with-hapi/) and now the async functions.

`async` 函数很快就要来了，但到达这一步却经历了万水千山。不久前我们都在写[回调函数](https://blog.risingstack.com/node-js-best-practices/)，后来出现了 Promise/A+ 规范，紧接着是 [generator](https://blog.risingstack.com/hapi-on-steroids-using-generator-functions-with-hapi/) 函数，到现在是异步函数 (async) 声明。

Let's take a look back and see how asynchronous JavaScript evolved over the years.

让我们回顾一下，这些年异步 JavaScript 是如何进化的。

## Callbacks

## Callbacks(回调函数)

It all started with the [callbacks](https://blog.risingstack.com/node-js-best-practices/).

一切要从[回调函数](https://blog.risingstack.com/node-js-best-practices/)说起。

### Asynchronous JavaScript

### 异步 JavaScript

Asynchronous programming, as we know now in JavaScript, can only be achieved with functions being first-class citizens of the language: they can be passed around like any other variable to other functions. This is how callbacks were born: if you pass a function to another function _(a.k.a. **higher order function**)_ as a parameter, within the function you can call it when you are finished with your job. No return values, only calling another function with the values.

异步编程，如众所周知的 JavaScript，只能在函数作为第一公民的语言里实现：它们可以像其他变量一样传递给其他函数。回调函数就是这样产生的，如果你将一个函数作为参数传递给另外一个函数 _(又名，**高阶函数**)_，在完成当前任务后，该函数可以调用它。没有返回值，只会传递值来调用另一个函数。

```javascript
Something.save(function(err) {
  if (err)  {
    //error handling
    return;
  }
  console.log('success');
});
```

These so called **error-first callbacks** are in the heart of Node.js itself - the core modules are using it as well as most of the modules found on NPM.

这些所谓的**错误优先 (error-first) 回调函数**在 Node.js 里占据重要地位 -- 核心模块以及大多数在 NPM 的包都在使用它。

The challenges with callbacks:

- it is easy to build callback hells or spaghetti code with them if not used properly
- error handling is easy to miss
- can't return values with the `return` statement, nor can use the `throw` keyword

回调函数面临的挑战：

- 如果使用不当，很容易写出大量回调 (callback hells) 和混乱的代码 (spaghetti code)
- 容易忽略错误处理
- `return` 语句却不能返回值，也不能使用 `throw` 关键字

Mostly because of these points the JavaScript world started to look for solutions that can make asynchronous JavaScript development easier.

大多由于这些原因，JavaScript 开始寻找一种解决方案使得异步 JavaScript 开发变得容易一些。

One of the answers was the [async](https://www.npmjs.com/package/async) module. If you worked a lot with callbacks, you know how complicated it can get to run things in parallel, sequentially or even mapping arrays using asynchronous functions. Then the async module was born thanks to [Caolan McMahon](https://twitter.com/caolan).

其中一个方案，是使用 [async](https://www.npmjs.com/package/async) 模块，如果你有很多回调函数，你就会明白并行，按顺序运行，甚至使用异步函数映射数组会有多复杂。所以感谢 [Caolan McMahon](https://twitter.com/caolan)，编写了异步模块。

With async, you can easily do things like:

使用异步模块，你可以很轻松地做下面的事情

```javascript
async.map([1, 2, 3], AsyncSquaringLibrary.square,
  function(err, result){
  // result will be [1, 4, 9]
});
```
Still, it is not that easy to read nor to write - so comes the Promises.

但这种方法对代码的阅读和编写都不够友好，因此出现了 Promises。

## Promises

## Promises

The current JavaScript Promise specifications date back to 2012 and available from ES6 - however Promises were not invented by the JavaScript community. The term comes from [Daniel P. Friedman](https://en.wikipedia.org/wiki/Daniel_P._Friedman) from 1976.

目前的 JavaScript Promise 规范始于 2012 年，从 ES6 以后提供了支持。然而 Promises 不是 JavaScript 社区发明的，这个术语是 1976 年 [Daniel P. Friedman](https://en.wikipedia.org/wiki/Daniel_P._Friedman) 提出的。

**A promise represents the eventual result of an asynchronous operation.**

**一个 Promise 代表一个异步操作最终的结果。**

The previous example with Promises may look like this:

使用 Promises 后，上面的例子可能像这样

```javascript
Something.save()
  .then(function() {
    console.log('success');
  })
  .catch(function() {
    //error handling
  })
```

You can notice that of course Promises utilize callbacks as well. Both the `then` and the `catch` registers callbacks that will be invoked with either the result of the asynchronous operation or with the reason why it could not be fulfilled. Another great thing of Promises is that they can be chained:

你会注意到 Promises 同样使用了回调函数，`then` 和 `catch` 注册的回调函数会在异步操作完成或者因为某些原因未能完成时被调用。另一个好处是 Promises 可以链式调用。

```javascript
saveSomething()
  .then(updateOtherthing)
  .then(deleteStuff)
  .then(logResults);
```

When using Promises you may have to use polyfills in runtimes that don't have it yet. A popular choice in these cases is to use [bluebird](https://github.com/petkaantonov/bluebird). These libraries may provide a lot more functionality than the native one - even in these cases **limit yourself to the features provided by Promises/A+ specifications**.

Promises 的兼容不够好，在运行时你需要使用到 polyfill。现在常见的方法之一是使用像 [bluebird](https://github.com/petkaantonov/bluebird) 这样的兼容库，这些库可能提供了比原生对象更多的功能，即使是这样，也应该**限制使用 Promises/A+ 提供的特性**；

But why shouldn't you use the sugar methods? Read [Promises: The Extension Problem](http://blog.getify.com/promises-part-4/). For more information on Promises, refer to the [Promises/A+ specification](https://promisesaplus.com/).

为什么不应该使用那些额外方法呢，请阅读以下 [Promises: 扩展的问题](http://blog.getify.com/promises-part-4/)。想了解更多关于 Promises 的信息，[可以参考 Promises/A+ 规范](https://promisesaplus.com/)。

_You may ask: how can I use Promises when most of the libraries out there exposes a callback interfaces only?_

_你可能会问，当大多数库只暴露一个回调接口的时候该如何使用 Promises 呢？_

Well, it is pretty easy - the only thing that you have to do is wrapping the callback the original function call with a Promise, like this:

这也很容易，你唯一要做的事就是使用 Promise 包装一个回调函数，在里面调用原来的函数，像这样

```javascript
function saveToTheDb(value) {
  return new Promise(function(resolve, reject) {
    db.values.insert(value, function(err, user) { // remember error first ;)
      if (err) {
        return reject(err); // don't forget to return here
      }
      resolve(user);
    })
  }
}
```

Some libraries/frameworks out there already support both, providing a callback and a Promise interface at the same time. If you build a library today, it is a good practice to support both. You can easily do so with something like this:

一些库或者框架，已经都做了支持，同时提供回调函数和Promise 接口，如果你在构建一个库，支持两者是一个好办法。你可以很容易地像下面这样做

```javascript
function foo(cb) {
  if (cb) {
    return cb();
  }
  return new Promise(function (resolve, reject) {

  });
}
```

Or even simpler, you can choose to start with a Promise-only interface and provide backward compatibility with tools like [callbackify](https://www.npmjs.com/package/callbackify). Callbackify basically does the same thing that the previous code snippet shows, but in a more general way.

或者更简单，你可以选择仅提供 Promises 接口，然后用像 [callbackify](https://www.npmjs.com/package/callbackify) 这样的向后兼容工具。Callbackify 基本上和上面的代码做了同样的事情，但用更通用的方法。

## Generators / yield

## Generators / yield

[JavaScript Generators](https://blog.risingstack.com/introduction-to-koa-generators/) is a relatively new concept, they were introduced in ES6 (also known as ES2015).

[JavaScript Generators](https://blog.risingstack.com/introduction-to-koa-generators/) 是一个相对新的概念，他们在 ES6(又称为 ES2015) 里面有介绍。

> _Wouldn't it be nice, that when you execute your function, you could pause it at any point, calculate something else, do other things, and then return to it, even with some value and continue?_

> _当函数执行时，你可以在任何地方暂停，做点别的计算，或者其他事情，然后再返回出去，甚至带有一些值还能继续，没有比这更好的方案了_

This is exactly what generator functions do for you. When we call a generator function it doesn't start running, we will have to iterate through it manually.

这就是 generators 函数做的事情，当我们调用一个 generator 函数时，它还没有开始运行，我们要手动来遍历它。

```javascript
function* foo () {
  var index = 0;
  while (index < 2) {
    yield index++;
  }
}
var bar =  foo();

console.log(bar.next());    // { value: 0, done: false }
console.log(bar.next());    // { value: 1, done: false }
console.log(bar.next());    // { value: undefined, done: true }
```
If you want to use generators easily for writing asynchronous JavaScript, you will need [co](https://www.npmjs.com/package/co) as well.

如果你想使用 generators 轻松地编写异步的 JavaScript，你还需要 [co](https://www.npmjs.com/package/co) 库。

> _Co is a generator based control flow goodness for Node.js and the browser, using promises, letting you write non-blocking code in a nice-ish way._

> _Co 是一个为 Node.js 和浏览器提供的基于 generator 的控制流，使用 promises 漂亮地写出无阻塞的代码。_

With co, our previous examples may look something like this:

使用 `co`，我们之前的例子可能会像下面这样

```javascript
co(function* (){
  yield Something.save();
}).then(function() {
  // success
})
.catch(function(err) {
  //error handling
});
```

You may ask: what about operations running in parallel? The answer is simpler than you may think _(under the hoods it is just a `Promise.all`)_:

你或许会问，如果是并行操作会怎么样？答案很简单 _(内部仅仅是一个 `Promise.all`)_：

```javascript
yield [Something.save(), Otherthing.save()];
```

## Async / await

## Async / await

Async functions were introduced in ES7 - and currently only available using a transpiler like [babel](http://babeljs.io/). _(disclaimer: now we are talking about the async keyword, not the async package)_

ES7 中引入了异步函数，当前只能使用通过转译(如 [babel](http://babeljs.io/)) 工具来使用。_(声明：现在讨论的是 `async` 关键字，而不是 async 模块包)_

In short, with the async keyword we can do what we are doing with the combination of co and generators - except the hacking.

简单来讲，使用 `async` 关键字，我们可以做 co 和 generators 相结合的工作，而不是 hack。

![async-hack](https://risingstack-blog.s3-eu-west-1.amazonaws.com/2015/08/denicola-yield-await-asynchronous-javascript.JPG)

Under the hood `async` functions using Promises - this is why the async function will return with a `Promise`.

在其内部， `async` 关键字使用了 Promises，这也是异步函数会返回一个 `Promise` 对象的原因。

So if we want to do the same thing as in the previous examples, we may have to rewrite our snippet to the following:

那么，如果我们想要做上面例子中的事情，我们应该将其重写为下面这样

```javascript
async function save(Something) {
  try {
    await Something.save()
  } catch (ex) {
    //error handling
  }
  console.log('success');
}
```

As you can see to use an `async` function you have to put the async keyword before the function declaration. After that, you can use the `await` keyword inside your newly created async function.

正如你看到的，使用异步函数，必须将 `async` 关键字放在函数声明前面。在新创建的异步函数中，你可以使用 `await` 关键字。

Running things in parallel with `async` functions is pretty similar to the `yield` approach - except now the `Promise.all` is not hidden, but you have to call it:

使用 `async` 函数并行运行和使用 `yield` 的方法很像，除了 `Promise.all` 没有被隐藏，你需要调用它

```javascript
async function save(Something) {
  await Promise.all[Something.save(), Otherthing.save()]
}
```

> [Koa](http://koajs.com/) already supports `async` functions, so you can try them out today using babel.

[Koa](http://koajs.com/) 已经支持了 `async` 函数，所以你现在可以借助 babel 来尝试。

```javascript
import koa from koa;
let app = koa();

app.experimental = true;

app.use(async function (){
  this.body = await Promise.resolve('Hello Reader!')
})

app.listen(3000);
```

## Further reading

## 扩展阅读

Currently we are using [Hapi with generators](https://blog.risingstack.com/hapi-on-steroids-using-generator-functions-with-hapi/) in production in most of our new projects - alongside with [koa](https://blog.risingstack.com/introduction-to-koa-generators/) as well.

目前我们的大部分项目在生产环境使用 [Hapi with generators](https://blog.risingstack.com/hapi-on-steroids-using-generator-functions-with-hapi/)，同时还有 [koa](https://blog.risingstack.com/introduction-to-koa-generators/)。

> _Which one do you prefer? Why? I would love to hear your comments!_

> _你更喜欢哪一种？为什么？欢迎评论！_


text:
# RemindMe-backend reference client

This is a todo app which uses the todo-backend API to store it's todos.

# Stuff
Modified version of the [TodoMVC Architecture Example for for backbone.js](https://github.com/tastejs/todomvc/tree/gh-pages/architecture-examples/backbone/js).

repository: wsoyinka/remindmebackend-client

repo_name: wsoyinka/remindmebackend-client


text:
# NodeJS JWT Authentication sample

This is a NodeJS API that supports username and password authentication with JWTs.

## Available APIs

### User APIs

#### POST `/sessions/create`

You can do a POST to `/sessions/create` to log a user in.

The body must have:

* `username`: The username
* `password`: The password

It returns the following:

```json
{
  "id_token": {jwt}
}
```

The JWT is signed with the secret located at the `config.json` file. That JWT will contain the `username` and the roles hard-coded in `user-routes.js`

#### GET `/api/protected`

You can do a GET to `/api/protected` to ensure your token is valid.  It returns an empty `200` response if the token is still valid.

## License

This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.

repository: nibblesnbits/jwt-server

repo_name: nibblesnbits/jwt-server


text:
# Computer Communication and Network(A)

### CREDIT 3 *|* SCORE 88 | 3rd year, 1st semester

**Software and Enviroment:**

- MacBook Pro (13−inch, 2016, Four Thunderbolt 3 Ports)
- macOS Catalina Version10.15.2
- python3.7.0, Spyder4.0.0
- Server: macOS Catalina Version10.15.2
- Client: macOS Catalina Version10.15.2, Ubuntu 18.04.3 LTS 64

***

This folder contains some of my course projects. Others are writing assignments.

- chat_now(python3)
  - client: TCP chatting client program
  - Server: TCP Multi-thread chatting server program, supporting group chatting and whisper
  - Report.pdf: Report of this assignment, in Chinese, by LaTeX

path: /Computer Communication and Network(A)/README.md


text:
**** Library has common calculator methods, also can get fuel cost per trip

## Before starting the project, you need:
* Make sure that PHP version 7.4.

For this it's enough to write in the terminal:
> php -v (show php version) or install it

* In the terminal.
This command will install all the packages that are specified in the package.json file, as well as all
their dependencies

Run the command
> composer i

## Launching the project
* Quick Run the project through the command in the terminal:
> php -S localhost:8000

repository: lysenkolipa/calcLiba

gha_language: PHP

repo_name: lysenkolipa/calcLiba


text:
# PYCC: Python Parser for graphics.h

This is a CLI to read, interpret and execute C programs having `graphics.h` dependency. At its core, it is a small
interpreter for C with support for `graphics.h`

### Supported Functions

* `initgraph`
* `getchar` or `getch`
* `closegraph`
* `outtextxy`
* `setcolor`
* `arc`
* `bar`
* `line`
* `rectangle`
* `ellipse`
* `fillellipse`
* `fillpoly`
* `fillcircle`
* `drawpoly`
* `getfontcolor`
* `pieslice`
* `sector`
* `cleardevice`
* `getmaxx`
* `getmaxx`

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing
purposes.

### Prerequisites

You need `pipenv` or any other virtual environment tool.

```shell
$ pip install pipenv
```

### Installing

Install the dependencies:

```shell
$ pipenv install
```

### Usage

```shell
# setup shell in root of this repo
$ pipenv shell

$ ./pycc <path/to/main.c>
```

### Running Samples

```shell
$ ./pycc samples/sample.c

$ ./pycc samples/car.c

$ ./pycc samples/smiley.c
```

## Running the tests

### Unit Tests

```shell
$ pipenv run test
```

### Coverage

```shell
$ pipenv run cov
```

## Built With

* [pycparser](https://github.com/eliben/pycparser) - Complete C99 parser in pure Python
* [PyEasyGraphics](https://github.com/royqh1979/PyEasyGraphics) - A Turbo C Graphics Style Graphics library for python
* [pytest](https://docs.pytest.org/en/stable/) - Testing

## License

This project is licensed under the MIT License - see
the [LICENSE](https://github.com/godcrampy/py-graphics-h/blob/main/LICENSE) file for details

repository: godcrampy/py-graphics-h

repo_name: godcrampy/py-graphics-h


text:
# Running WordPress Application Stack under Docker Swarm Mode

## Setting up Multi-Node Cluster Node on Play with Docker Platform

Go to http://www.play-with-docker.com and then click on icon next to "Create New Instance" section. Select 3 Managers and 2 Worker node configuration and this is how the screen look like:

![alt text](https://github.com/ajeetraina/docker101/blob/master/images/pwd-multinode.png)

```

[manager1] (local<EMAIL_ADDRESS>~
$ git clone https://github.com/ajeetraina/docker101
Cloning into 'docker101'...
remote: Counting objects: 1881, done.
remote: Compressing objects: 100% (84/84), done.
remote: Total 1881 (delta 49), reused 0 (delta 0), pack-reused 1796
Receiving objects: 100% (1881/1881), 2.81 MiB | 16.53 MiB/s, done.
Resolving deltas: 100% (562/562), done.
[manager1] (local<EMAIL_ADDRESS>~
$ cd docker101/pl
play-with-docker/     play-with-kubernetes/
[manager1] (local<EMAIL_ADDRESS>~
$ cd docker101/play-with-docker/wordpress/example1/
[manager1] (local<EMAIL_ADDRESS>~/docker101/play-with-docker/wordpress/example1
$ ls
README.md         docker-stack.yml
[manager1] (local<EMAIL_ADDRESS>~/docker101/play-with-docker/wordpress/example1

```
# Setting up WordPress Application Cluster

```
$ docker stack deploy -c docker-stack.yml myapp4
Ignoring unsupported options: restart

Creating network myapp4_default
Creating service myapp4_db
Creating service myapp4_wordpress

```

```
 docker stack ls
NAME                SERVICES
myapp4              2
[manager1] (local<EMAIL_ADDRESS>~/docker101/play-with-docker/wordpress/example1
$ docker stack services myapp4
ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
eu354pdpy4bp        myapp4_db           replicated          1/1                 mysql:5.7
k2t4wuhswpd3        myapp4_wordpress    replicated          1/1                 wordpress:latest    *:8000->80/tcp
```

repository: collabnix/dockerlabs

repo_name: collabnix/dockerlabs


text:
# Understanding Kernel Formats

Now we understand the boot process and how control passes to our programs, we need to get some code into the correct location to run it, which will require some more research and analysis. We'll learn about the ELF format. If you know about the ELF format's inner structure already, this section won't provide much of use!

## Aims

- Understand what format we need to use to get code running on both platforms
- Know which parts of an ELF file are important for our purposes and which are not needed.

## `ret1234`

In this directory we have a simple assembly language program which loads the value `0x01234` into the upper part of `x1`. The code is placed (via the linker script, `linker.ld`) into memory address `0x2040_0000` so it can be booted on both QEMU and the HiFive1.

After loading the value, it calls `ebreak` which breaks to a debugger, and then loops in the same position infinitely.

The binaries are once again committed to git in the form of `ret1234.elf` - an ELF file - and `ret1234.bin` which is a raw binary file with no relocation information.

## File Formats

So what binary file format - ELF or raw binary - do we actually need? We'll need to analyse both QEMU and our HiFive1 hardware.

### QEMU

So far we've used an ELF file to provide the kernel for QEMU, and in fact that's the only choice we have as evidenced by the `riscv-qemu` source code for [load\_kernel](https://github.com/riscv/riscv-qemu/blob/32a1a94dd324d33578dca1dc96d7896a0244d768/hw/riscv/sifive_e.c#L77-L88)[1].

That means that to run under QEMU, we always have to provide an [ELF](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format) file[2].

That introduces a decent amount of complexity in our build process that it would be desirable to avoid since it'll be harder to generate an ELF than a raw binary file - but there's no reason it should stop us.

### HiFive1

When developing for the HiFive1 we can choose to produce ELF files (which can be uploaded natively by OpenOCD) but we also have the option to use OpenOCD's `write_image` directive to write a raw binary file at a memory offset we specify. This is friendlier to raw machine code since we could avoid the cost of having to create an ELF header, but QEMU forces our hand.

## ELF Files

In this directory we see `ret1234.elf`. From [Wikipedia](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header) we learn that a 32-bit ELF binary has a 52-byte long header, followed by program headers and section headers. The Wikipedia article is an excellent reference for the format and you'll probably want to have the article open while analysing the file.

The following is a brief overview of the different sections. More in-depth analysis is provided in [ELF\_DETAIL](./ELF_DETAIL.md)

### ELF Header

The first 52 bytes of `ret1234.elf`, when dumped, show the ELF file header. This mostly doesn't change between different RV32I ELF files in our case, since we'll be aiming for a very simple file with very few program headers and section headers.

### Program Header

```text
$ od -Ax -tx1 -N32 -j52 ret1234.elf
000034 01 00 00 00 00 10 00 00 00 00 40 20 00 00 40 20
000044 0c 00 00 00 0c 00 00 00 05 00 00 00 00 10 00 00
```

In short, this header points at a `0xc` byte long executable section which is located at offset `0x1000` in this file, and indicates that the section should be loaded at `0x2040_0000`.

We can dump that section and confirm that the expected code is present:

```text
$ od -v -Ax -tx1 -j4096 -N12 ret1234.elf
001000 b7 40 23 01 73 00 10 00 6f 00 00 00
```

The program header is one of the parts of the file that must change for each program, since it contains the size of the program itself.

### Section Headers

The 6 section headers in this file are located at `0x000010ac` and, according to the ELF file header, each has a size of 40 bytes.

The types are summarised here, with more detail available [in this doc](https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter7-1.html#scrolltoc):

- a null, empty section, which appears to be required
- `.text` is the most important section type since it contains our code! The others are less important, but some are required.
- `.riscv.attributes` is a special RISC-V section which contains details about the specific RISC-V architecture the object was compiled for - `rv32i` in this case. It's not at all well-documented and so we avoid adding it for now. Since we're writing a single ELF as output, the information contained within this section is not particularly useful.
- `.symtab` is the [symbol table](https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-79797.html#scrolltoc), which is needed to perform relocations on symbolic definitions and references.
- `.strtab` is a table containing null-terminated strings relating to symbol table entries.
- `.shstrtab` is a table also containing null-terminated strings which are the names of section headers

Three of these sections are vital (aside from NULL which is required):

- `.text` contains our code
- `.shstrtab` which has header names for everything. We can get rid of the separate `.strtab` and place everything in here if needed.
- `.symtab` which points to our code and gives details about how function calls work. This will be very simple for our use cases.

### Section Bodies

`.shstrtab` and `.strtab` both contain lists of null-terminated strings, and `.text` just contains our compiled code.

`.symtab` has a "global" section which points at our code, but the rest of the sections can be ignored.

The program section pointed to by the program header is the same as the `.text` section in our simple case.

Mostly, there's a large amount of padding up to `0x1000` bytes which is all zeroes. We can get rid of almost all of it.

## Next

We've seen what an ELF file looks like, and we know that we need an ELF file for QEMU. The next step is to write an ELF header in hex.

## Notes

[1] We see a call to `load_elf` which ultimately ends up at [`load\_elf\_ram\_sym`](https://github.com/riscv/riscv-qemu/blob/32a1a94dd324d33578dca1dc96d7896a0244d768/hw/core/loader.c#L461) - the ELF parsing logic might be useful to us later so it's noted here, but in any case it's neat to drill down into these things.

[2] The alternative to generating ELF files for both platforms is to patch QEMU's HiFive1-compatible device to support raw binary files, perhaps with a specified offset.

We could for example patch the `load_kernel` function to parse `-kernel "0x20400000:ret1234.bin"` as "place `ret1234.bin` at `0x2040_0000`". It's a judgement call, but it feels like patching QEMU is further away from what we're trying to do than just banging out an ELF header, which is what we'll be doing later.

At the end of the day, one of the tasks involves writing C and the other involves writing hex!

repository: SgtCoDFish/bedrock-bootstrap

repo_name: SgtCoDFish/bedrock-bootstrap


text:
---
layout: post
---
Multi-targeting is a feature introduced in Visual Studio 2008 which allows developers to use new versions of Visual Studio to target earlier versions of the .Net platform. It allowed users to target both the new 3.5 and 3.0 and the previous 2.0 profile with the same IDE. Visual Studio 2010 [continues this trend](http://msdn.microsoft.com/en-us/magazine/ff714560.aspx) by adding support for CLR 4.0 and even allows for further sub-targeting through several [framework profiles](http://channel9.msdn.com/posts/funkyonex/Multi-Targeting-Deep-Dive-with-Visual-Basic-2010/).

At a compiler level this works by providing binary compatibility with previous versions of the CLR (or producing an error when it's not possible). It doesn't warn developers about using new language constructs on older frameworks so long as they function in the target framework.
Take the following code sample as an example. It is taking advantage of [implicit line continuations](http://blogs.msdn.com/b/vbteam/archive/2009/03/27/implicit-line-continuation-in-vb-10-tyler-whitney.aspx) which is a feature introduced in VB.Net 10 and not available in Visual Studio 2008. Since it's just syntactic sugar it compiles just fine in an application targeting 4.0 or any previous version of the framework.

``` vb
Dim query =
    From it In col
    Where it Mod 2 = 0
    Select it * 3
```

In a limited set of scenarios though developers want to use Visual Studio 2010 to develop code which will also be compiled by a previous version of the compiler. Hence they want warnings in Visual Studio when new language constructs are used.

The 10.0 version of vbc.exe introduced a new switch named [langversion](http://msdn.microsoft.com/en-us/library/dd547577.aspx) to provide just that. It allows developers to specify a version of the language to target. The compiler will then issue an error when a language construct which was introduced in a later version is used. This switch is not available from the IDE though and must be manually specified in the project file. To do so edit the .vbproj file and add the following element under the main ItemGroup element.

``` xml
<PropertyGroup>
    <LangVersion>9</LangVersion>
</PropertyGroup>
```

Once the project is reloaded errors will start appearing for new language constructs. Notice how our earlier sample now produces the errors for the usages of the new implicit line continuation construct.

![image](/images/posts/multitarget.png)


text:
# CM’s Libraries Usage Example (Arcade Corsa, Console Wrapper)

Some examples of how CM’s libraries can be used to create some separate apps. Sadly, the whole integration process isn’t
very smooth or nice, but I believe this is still more or less usable.

- ### [Arcade Corsa](https://github.com/gro-ove/actools-arcade/tree/master/Arcade%20Corsa)
    Small WPF app with integrated DX11 renderer. Apparently, [WPF doesn’t work well](http://stackoverflow.com/a/6003900/4267982)
    with this sort of stuff, but it was worth a try.

    Offers some sort of gameplay by allowing a player to set new laptimes on Magione and then adding them to the table.
    Nothing serious.

    Other features:

    - Custom renderer (I’m going to copy it to `AcTools.Render` later, but it’ll keep being here as well an example of
    extending original renderer);

    - Player can select custom colors;

    - Switching cars’ models on-fly.

    [![Arcade Corsa](http://i.imgur.com/or2Ft2g.png)](http://i.imgur.com/or2Ft2g.png)

- ### [ConsoleWrapper](https://github.com/gro-ove/actools-arcade/tree/master/ConsoleWrapper)
    Few hundred lines example of using CM libraries in console application.

    <details>
    <summary>You still would need to reference `FirstFloor.ModernUI`
    because it provides storage, logging, errors handling and stuff. I’ll try to sort this out later, but for now, please,
    consider this library as some sort of common basis for all Windows apps I use. 😬</summary>
    *How are you supposed to code C# apps anyway? If I would do it properly, I would have now like, hundreds of smallest assemblies, and app would weights twice as much just because of their metadata.*
    </details>

    [![ConsoleWrapper](http://i.imgur.com/Vv7teOF.png)](http://i.imgur.com/Vv7teOF.png)

# Build notes

 - Some of references were added directly as DLL-files. I didn’t use Nuget for all of references because eigher I needed specific libraries locations (this way, I’m able to use 32-bit libraries for 32-bit build and otherwise using simplest .csproj “trick”) or I slightly modified some of them (for example, now JSON-parser works reads numbers starting with “0” according to JSON specifications). All these references are located in Library directory, you can get them [here](https://drive.google.com/file/d/0B6GfX1zRa8pOMjdKTnZ1eDZ3SHc/view?usp=drivesdk). Or just collect them from scratch, those changes aren’t be very important.

 - You might need to install DirectX SDK to rebuild [Arcade Corsa/Render/Shaders/ShadersTemplate.tt](https://github.com/gro-ove/actools/blob/master/Arcade Corsa/Render/Shaders/ShadersTemplate.tt). But, just in case, builded *ShadersTemplate.cs* and *Shaders.resources* are already included.

 - Please, feel free to [contact me](https://trello.com/c/w5xT6ssZ/49-contacts) anytime. I don’t have any experience it open-source, there might be some things I forgot to mention.

license: MS-PL

repository: gro-ove/actools-arcade

repo_name: gro-ove/actools-arcade


text:
---
sidebar: auto
---

# Http Request Task

Http Request Task enables fetching data from an http url.

Added in v0.4.0.

## Basic Usage (GET)

* Task type: `http_request`
* Provide method, url, timeout, headers, params.

<<< @/examples/http_get.hcl

::: details Click me to view the run output
Run:

```
$ runflow run http_get.hcl --var out=/tmp/out.txt
[2021-06-12 21:44:06,597] "task.http_request.this" is started.
[2021-06-12 21:44:07,461] "task.http_request.this" is successful.
[2021-06-12 21:44:07,478] "task.file_write.this" is started.
[2021-06-12 21:44:07,481] "task.file_write.this" is successful.

$ jq '[.name, .full_name]' /tmp/out.txt
[
  "runflow",
  "soasme/runflow"
]
```
:::

## Basic Usage (POST)

* Task type: `http_request`
* Provide method, url, timeout, headers, json or data (can only provide one of json or data).

<<< @/examples/http_post.hcl

::: details Click me to view the run output
Run:

```
$ runflow run http_post.hcl --var out=/tmp/out.txt
[2021-06-12 21:50:00,090] "task.file_read.this" is started.
[2021-06-12 21:50:00,092] "task.file_read.this" is successful.
[2021-06-12 21:50:00,193] "task.http_request.this" is started.
[2021-06-12 21:50:01,053] "task.http_request.this" is successful.
[2021-06-12 21:50:01,055] "task.file_write.this" is started.
[2021-06-12 21:50:01,058] "task.file_write.this" is successful.

$ cat /tmp/out.txt
<h1>
<a id="user-content-runflow" class="anchor" href="#runflow" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Runflow</h1>
...(truncated)
<p>Please report an issue at: <a href="https://github.com/soasme/runflow/issues">https://github.com/soasme/runflow/issues</a>.</p>
```
:::

## Argument Reference

The following arguments are supported:

* `method` - (Required, str) The HTTP request method. One of `"GET"`, `"POST"`, `"PUT"`, `"DELETE"`, `"PATCH"`.
* `url` - (Required, str) The HTTP request url.
* `headers` - (Optional, map) The HTTP request headers.
* `json` - (Optional, map) The HTTP request JSON data. Must not be used with `data`.
* `data` - (Optional, map) The HTTP request form data. Must not be used with `json`.
* `timeout` - (Optional, int, float or map) The timeout on HTTP connection. It may be a number, or a map like `{ "timeout" : 10, "connect": 2, "read": 4, "write": 4, "pool": 1}`. In the map,
  * The `timeout` specifies an overall timeout.
  * The `connect` timeout specifies the maximum amount of time to wait until a socket connection to the requested host is established.
  * The `read` timeout specifies the maximum duration to wait for a chunk of data to be received.
  * The `write` timeout specifies the maximum duration to wait for a chunk of data to be sent.
  * The `pool` timeout specifies the maximum duration to wait for acquiring a connection from the connection pool.

## Attributes Reference

The following attributes are supported:

* `response` - The [httpx.Response object](https://www.python-httpx.org/quickstart/).

Here lists some possible variable references you may use in other tasks:

* `task.http_request.TASK_NAME.response.content` - Get HTTP response binary content.
* `task.http_request.TASK_NAME.response.encoding` - Get HTTP response encoding.
* `task.http_request.TASK_NAME.response.text` - Get HTTP response text.
* `call(task.http_request.TASK_NAME.response, "json")` - Get HTTP response json object.
* `task.http_request.TASK_NAME.response.status_code` - Get HTTP response status code.
* `task.http_request.TASK_NAME.response.headers.content-type` - Get HTTP response status code.
* `task.http_request.TASK_NAME.response.cookies.session-id` - Get HTTP response cookie.

repository: soasme/runflow

repo_name: soasme/runflow


text:
# Mastermind Clone

The build system is based off Stephen Grider's [ReduxSimpleStarter](https://github.com/StephenGrider/ReduxSimpleStarter) template with some updated packages.

### Getting Started

Checkout this repo, install dependencies, then start the gulp process with the following:

```
	> git clone https://github.com/RichardDorn/mastermind-clone.git
	> cd mastermind-clone
	> npm install
	> npm start
```
Navigate browser to localhost:8080

### How to Play

On load there is a random sequence of 4 colors generated behind the scenes. There is no maximum number of times a color can be used in the sequence. *Ex: peg1: black, peg2: green, peg3: green, peg4: white*

Select colors from the drop down list and hit submit to make a guess at the answer.

Left of your submitted guess there will be hints to help you solve the puzzle.
* A black dot means you have a correct color in the correct spot of the sequence
* A white dot means you have a correct color in the incorrect spot of the sequence
* No dot means incorrect color.

When you have 4 black dots you have solved the puzzle.

### Difficulty Level

* Easy - 6 colors to choose from
* Medium - 7 colors to choose from
* Hard - 8 colors to choose from

repository: RichardDorn/mastermind-clone

repo_name: RichardDorn/mastermind-clone


text:
# [LifeBlood](https://lifeblood.app)

[![Netlify Status](https://api.netlify.com/api/v1/badges/8b0b50bd-dd34-4243-96a8-5a48ca2553ce/deploy-status)](https://app.netlify.com/sites/lifeblood/deploys)

Analyze and track your blood test results over time.
All data kept private and stored locally on your device.

repository: bhansconnect/lifeblood

gha_language: Reason

repo_name: bhansconnect/lifeblood


text:
# aweber-for-laravel
by Paolo Niccolò Giubelli<EMAIL_ADDRESS>
Integrate AWeber into your Laravel application via AWeber API v.1.0

## Warning
This library is not ready for production environment. Feel free to give it a try!

## The library

### API throttling

AWeber APIs are limited to 60 requests per minute, so it is required to put some `sleep(1)` in the code. This is why it would be great to use a callback approach whenever it's possibile.

### API documentation

Offical AWeber API documentation can be found [here](https://labs.aweber.com/docs/reference/1.0) as well as the API Map, that is a very useful. The goal of this work is to map the entire API Map.

### Coding standard

PSR-2

Fluent syntax

### Installing

You can use Composer:

    composer require axettone/aweber-for-laravel

and then you have to publish the assets:

    php artisan vendor:publish

### Getting your access token

In order to use AWeber APIs, you need to create an AWeber APP and get an access token. Take a look at [AWeber Documentation](https://labs.aweber.com/getting_started/main).

This library will help you get your token soon, but this feature is not available at this moment.

You also need to keep track of your Account ID and List IDs and put these values in the aweber.php config file.

### Lists

AWeber supports many lists for every account. Every list has an unique ID, but it's useful to refer to them using a name in your code. So in the aweber.php config file, you can set an array of lists using an indexed array:

    ...,
    lists = [
        'Customers' => 123456,
        'Suppliers' => 654321,
        ...
    ],
    ...

So you can get all the subscribers of these lists as follows:

    AWeber::getList('Customers')->subscribers()->all()->fetch()

## Usage

### Getting a list (one shot)

    $subscribers = AWeber::getList('Customers')->subscribers()->all()->fetch();

### Getting a list (callback)

    $onUpdate = function($subscribers) {
        //Called every 100 subscribers
        //...
    }
    $onFinish = function($subscribers) {
        //Called on finish
    }
    AWeber::getList('Customers')->subscribers()->all()->fetch($onUpdate, $onFinish);

### Un/Tagging subscribers

    //Tagging / Untagging all subscribers in a list
    AWeber::getList('Customers')->subscribers()->all()->tag([<tags_to_add>],[<tags_to_remove>]);

    //Tagging / Untagging all subscribers a specific subscriber
    AWeber::getList('Customers')->subscribers()->find(<id>)->tag([<tags_to_add>],[<tags_to_remove>]);

repository: axettone/aweber-for-laravel

repo_name: axettone/aweber-for-laravel


text:
# Cybersecurity_Week8_Assignment

# Project 8 - Pentesting Live Targets

Time spent: 2 hours spent in total

> Objective: The challenge is to attempt to find and exploit the vulnerabilities. The goal is to identify which two vulnerabilities of each site: red, green, and blue.

The following **required** functionality is completed:

1. [X]  Required: Challenge 0 - Username Enumeration
1. [X]  Required: Challenge 1 - Insecure Direct Object Reference (IDOR)
1. [X]  Required: Challenge 2 - SQL Injection (SQLi)
1. [X]  Required: Challenge 3 - Cross-Site Scripting (XSS)
1. [X]  Required: Challenge 4 - Cross-Site Request Forgery (CSRF)
1. [X]  Required: Challenge 5 - Session Hijacking/Fixation

## Challenge 0: Username Enumeration
- Vulnerability Site: Green
- Vulberability: If you enter in the name of a known user like jmonroe99 and a random password,  you will recieve an error message.  The error message is bold, but if you enter in a random username like hokie1 and a password it is not bold.  The programmer indicates found users by making their unsuccessful logins bold, which can be exploit.

Here's a walkthrough of implemented vulnerability:

GIF created with [LiceCap](http://www.cockos.com/licecap/).

## Challenge 1: Insecure Direct Object Reference (IDOR)
- Vulnerability Site: Red
- Vulberability: You have a screen of salepeorsons and their territories on each site.
The Sales Peorson Names and ID:
  - ID: 1 NAME: Daron Burke
  - ID: 2 NAME: Sherry Trevino
  - ID: 3 NAME: Irene Boliing
  - ID: 4 NAME: Robert Hamilton
  - ID: 5 NAME: Ken Barker
  - ID: 6 NAME: Elizabeth Olson
  - ID: 7 NAME: Samuel Hunter
  - ID: 8 NAME: Kim Stanley
  - ID: 9 NAME: Barbara Hinckley

On the red site if you enter in the numbers 10 and 11 in the url, you are able to see Testy McTesterson and Lazy Lazyman who are not visible on the Green and Blue sites.  The programmer did not disable those users on the red site leaving the IDOR vulnerability.

Here's a walkthrough of implemented vulnerability:

GIF created with [LiceCap](http://www.cockos.com/licecap/).

## Challenge 2: SQL Injection (SQLi)
- Vulnerability Site: Blue
- Vulberability: Sanatizing your data is very important when using SQL databases, but the salesperson information for the blue site does not sanatize the data for the name and feedback fields.  Attackers can exploit this and in our case we will use the command %27%20OR%20SLEEP(5)=0--%27 when setting the ID.
    This causes the page to take 5 seconds to change and defaults back to the first user David Burke.

Here's a walkthrough of implemented vulnerability:

GIF created with [LiceCap](http://www.cockos.com/licecap/).

## Challenge 3: Cross-Site Scripting (XSS)
- Vulnerability Site: Green
- Vulberability: The problem with the green site is that if you create an alert message and insert it into the the comments section you will see the alert message every time you click on the contact messages in your nonpublic screen.
The alert message:

Here's a walkthrough of implemented vulnerability:

GIF created with [LiceCap](http://www.cockos.com/licecap/).

## Challenge 4: Cross-Site Request Forgery (CSRF)
- Vulnerability Site: Red
- Vulberability: If you create a malicious page that utilizes the user's session to forge a request to the database.  That page will make a request during the page loading and hides the page.  When you return to the sales list you will see the changed salesperson.

Here's a walkthrough of implemented vulnerability:

GIF created with [LiceCap](http://www.cockos.com/licecap/).

## Challenge 5: Session Hijacking/Fixation
- Vulnerability Site: Red
- Vulberability: The SessionID is not secure and the contents of the packet are forwarded to additional sites.  I was able to login in to the red site and also be logged in to the blue site without actually logging into the blue site.
Here's a walkthrough of implemented vulnerability:

GIF created with [LiceCap](http://www.cockos.com/licecap/).

## Notes
This lab was fun.

## License

Copyright [2017] [Sasha Morgan]

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

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

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


text:
# ROG-HID

(c) 2020 black.dragon74 aka Nick

macOS HID driver based on DriverKit for Asus ROG notebook built-in keyboard.  Tested on 0b05:1869. Should support 0b05:1866, 0b05:1854, 0b05:1837, 0b05:1822.

For enhanced functionality, use with [ROGSwitch](https://github.com/black-dragon74/ROGSwitch).

## Features
- Supports setting display brightness using Fn Keys
- Supports setting keyboard backlight brightness using Fn Keys
- Fixes erratic behavior of CAPS Lock key on keyboards with CAPS Lock LED.
- Automatically turns off keyboard backlight after 5 minutes of inactivity

Many features such as touchpad toggle, display off, sleep and airplane mode require use of IOKit. Currently, there is no documentation of interfacing DriverKit with IOKit. These features are on my TODO and will be implemented in a future release.

## Installing

Download the appropriate version from the [Releases](https://github.com/black-dragon74/ROG-HID/releases) and copy `ROG-HID.app` to `/Applications` folder.

Now open the `ROG-HID.app` from Launchpad, click on `Activate ROG-HID Extension` and follow the instructions.

The driver won't attach right away as DriverKit drivers do not attach to pre-enumerated devices. You can either reboot or use the `reenumerate` utility found inside Utils folder. To use this utlity, you need to know the VendorID and ProductID of your Keyboard. You can re-enumerate a USB device like:

```sh
#for vendor-id 0b05 and product-id 1869
reenumerate -v 0x0b05,0x1869
```

<details>
  <summary>Build sign and install by yourself</summary>

  In order to build and use this driver, make sure your SIP is disabled and you have a free Apple developer account along with Xcode.

  Then, you need to change the `codesign.sh` file to reflect your own developer identity. Follow the steps below to find and update your developer identity.

  ```sh
  # Find the code signing identity
  security find-identity -p codesigning -v
  ```

  Copy the identity you get and then open the `codesign.sh` file. Replace the existing identity with the new one.

  Now we need to enable DriverKit development mode. Run `systemextensionsctl developer on` in Terminal.

  Now run the following commands in Terminal to build and install.

  ```sh
  make build
  make install
  ```

</details>

## Configuring

You can enable or disable additonal features and fixes in this driver by editing the Info.plist file of the dext. Setting value to `0` disables and `1` enables the feature/fix. Currently configurable options are:

- `FixCapsLockLED` - Fixes erratic behavior of Caps Lock LED on some keyboards. If your LED didn't work under macOS without this driver. You should disable this feature.
- `BacklightAutoTurnOff` - Automatically turns off the keyboard backlight after 5 mins of inactivity. Recommended to disable it on devices where there are multiple `IOHIDInterface` nubs for a single device, like `0b05:1866`.

You need to edit ONLY the entry for your vendor and device id. Like for `0b05:1869` I would edit `0b05_1869` entry under `IOKitPersonalities` dict.

## Building

### From GitHub:

Install Xcode, clone the GitHub repo and enter the top-level directory.  Then:

```sh
make build
```

## Credits

- Apple for no documentation of DriverKit
- Linux for hid-asus.c

repository: manashathparia/ROG-HID

repo_name: manashathparia/ROG-HID


text:
# Release Note v0.4.3 - 2020/12/12

### Changed

* opening pull request url will automatically close the notification cards
* decreased default active time for notification cards from 10 seconds to 4.5 seconds
* increased loading and exiting animation speed for notification cards

### Fixed

* fixed a bug where notification cards are not on top of other windows and applications

repository: YiZhang-Paul/Cidget

branch_name: refs/heads/development

repo_name: YiZhang-Paul/Cidget


text:
# JARVICE Release Notes

* [General](#general)
* [Known Issues, Anomalies, and Caveats](#known-issues-anomalies-and-caveats)
* [Changelog](#changelog)

---
## General

- Singularity containers are not supported; JARVICE can only refer to Docker containers on Kubernetes.  If the container runtime can pull from Docker registries and is OCI compliant, this should be transparent to JARVICE as well.
- JARVICE and its applications refers to "CPU cores" but it can work with hyperthreading and SMT as well; in this case, treat the threads themselves as cores when configuring machine types, etc.  Note that many HPC applications explicitly recommend against using SMT, so consider setting up non-SMT nodes for these applications (they can be targeted with labels)
- The full JSON for all pods in a job can be downloaded via the *DOWNLOAD STDERR* button in the *Job data* for any given job in the *Jobs* view of the *Administration* tab; this should be used to troubleshoot failures by checking the actual Kubernetes status conditions.  Note that pods are deleted and garbage collected automatically once jobs end, so this is the only persistent record of what was specified and what the actual statuses were during the lifecycle.

---
## Known Issues, Anomalies, and Caveats

### JARVICE HPC Pod Scheduler (jarvice-pod-scheduler)

- Custom resource weighting is not yet implemented; all resource multipliers are set to 1 automatically.
- Pod affinity, local volumes, or any mechanism that pins pods to specific nodes in the cluster is not supported; use node labels as machine properties to direct pods to sets of nodes instead, and use network-attached persistent storage only

### Web Portal

- The *Nodes* view in *Administration* should not be used in this version of JARVICE
- It is not currently possible to add users via the web portal without sending them an email to complete a registration; the cluster should be configured to send email and users should have real email addresses.  If this is not possible, you can still create users manually from the shell in any `jarvice-dal-*` pod in the JARVICE system namespace by running the command `/usr/lib/jarvice/bin/create-user` (run without arguments for usage).

### PushToCompute

- It is not necessary to explicitly pull in this version of JARVICE, as Kubernetes will do that implicitly, unless you are using a local registry (via `${JARVICE_LOCAL_REGISTRY}`); however it is a best practice, and is highly recommended so that application metadata can be updated in the service catalog.  If your container has JARVICE objects in it such as an `AppDef`, consider explicit pulls mandatory.
- Complete logs for pulls and builds are available in the `${JARVICE_PULLS_NAMESPACE}` and `${JARVICE_BUILDS_NAMESPACE}` respectively, for pods called `dockerpull--<user>-<app>` and `dockerbuild--<user>-<app>`, where `<user>` is the user who initiated the pull or build, and `<app>` is the application target ID that was built or pulled into; these pods are not garbage collected so that errors can be troubleshooted more effectively.  It is safe to delete them manually if desired.

### Resource Limits and Cost Controls

- Resource limits should not currently be used at any level (administrator controlled or self-service) if Kubernetes cluter autoscaling is enabled, as nodes may scale up even if queued jobs are resource limited; this issue will be fixed in a future release.
- Resource limit changes do not apply retroactively to jobs that are already queued; any queued jobs will be executed as soon as capacity becomes available.  Constraining resource limits after jobs are in the regular queue has no effect on them.  However, increasing resource limits will allow jobs that are being held due to account settings to move to regular queue if the new limits permit that.

### PersistentVolume Vaults

#### General

- When using a PersistentVolume vault ("PVC" type), users will experience a slight delay when navigating file lists for file arguments in the task builder; on average this will a few seconds each time a directory is clicked.  This is becauase JARVICE cannot mount the storage directly and must instead schedule a pod to get file listings using a PersistentVolumeClaim.  As will all PVC vault types, JARVICE manages the PersistentVolumeClaim objects themselves.
- Before an application with a file selection in the task builder can work, at least one job with the PVC vault attached must be run; typically this will be the *JARVICE File Manager*, which is used to transfer files to and from the storage.

#### ReadWriteOnce PersistentVolumes

- Persistent volumes with RWO access mode, such as block devices, are automatically fronted with a filer service that allows multiple pods (multiple jobs with one or more pods each) to share the device in a consistent way.  Note that the first consumer will experience latency in starting as the filer service must start first.  The filer service runs as a StatefulSet with a single pod.  Note that only 1 filer service will run at any given time regardless of how many jobs access it (since the storage access mode is RWO).
- JARVICE calls the filer pod *`jarvice-<user>-<vault>-0`*, in the "jobs" namespace; for example, for the user `root` with a vault named `pvcdata`, the filer pod would be called `jarvice-root-pvcdata-0` in the "jobs" namespace.  The `-0` is actually generated automatically by Kubernetes as part of the StatefulSet.  Never delete this pod manually as it can lead to data corruption and certain job failure of any job consuming it.  It is garbage collected automatically when not used.
- For information about resizing PersistentVolumes and related StorageClass configuration, please see [Resizing Persistent Volumes using Kubernetes](https://kubernetes.io/blog/2018/07/12/resizing-persistent-volumes-using-kubernetes/).  Note that JARVICE terminates the filer pod after all jobs of that storage complete.

##### Advanced

- JARVICE uses guaranteed QoS for filer pods.  By default it requests 1 CPU and 1 gigabyte of RAM.  The filer pod runs a userspace NFS service which may benefit from additional resources for larger deployments.  To adjust, set the environment variables `${JARVICE_UNFS_REQUEST_MEM}` and `${JARVICE_UNFS_REQUEST_CPU}` in the `jarvice-scheduler` deployment.  Note that the memory request is in standard Kubernetes resource format, so 1 Gigabyte is expressed as `1Gi`.
- JARVICE runs filer pods with the node selector provided in `${JARVICE_UNFS_NODE_SELECTOR}`; when using the Helm chart, the values default to the "system" node selector(s), unless `jarvice_dal` has a node selector defined.

### Miscellaneous

- Jobs that run for a very short period of time and fail may be shown as *Canceled* status versus *Completed with Error*; in rare cases jobs that complete successfully may also show up as *Canceled* if they run for a very short period of time (e.g. less than 1 second).

---

# Changelog

## 3.0.0-1.20190619.1923

* (1712) Job utilization metrics via API endpoint [/jarvice/metrics](https://jarvice.readthedocs.io/en/latest/api/#jarvicemetrics)
* (1738) Fixed bug where jobs queuing for a long time would show negative runtimes in the portal
* (1739) Fixed bug where cloning a job with a machine type that is no longer available would cause the web portal to hang

## 3.0.0-1.20190517.1346

* (1509) Pod scheduler now respects most node taints; optimized for JARVICE-style taints such as:

        node-role.kubernetes.io/jarvice-system:NoSchedule

* (1662) Global max CPU concurrency available for all resource limits, supported with or without whitelisted machine types and scale
* (1665) Support for impersonation of team user accounts by team admins (requires explicit opt-in from the *Account->Team* view)
* (1680) Fixed potential orphaned resources on job submission failure
* (1681) New [jarvice.com/rdma](https://github.com/nimbix/jarvice-k8s-rdma) plugin with optional automatic deployment from Helm chart; this mechanism replaces the previously recommended `tencent.com/rdma` one, and is more appropriate (and reliable) for high density/scale HPC using RDMA; certified using InfiniBand but may also support RoCE

## 3.0.0-1.20190503.1831

* (1636) Applied NetworkPolicy to JARVICE services to prevent jobs from unauthorized access to internal system components
* (1658) Ability to override DAL user account hooks via `jarvice-settings` ConfigMap
* (1659) Delayed garbage collection for shared block storage services; timeout, in seconds, controllable by `${JARVICE_UNFS_EXPIRE_SECS}` in the `jarvice-scheduler` deployment; default is 90 seconds
* (1660) Added ability for vault owners to decide which team members can access their vaults, if any
* (1663) Added extended resource request view underneath node slider in task builder

## 3.0.0-1.20190424.1834

* (1674) gcr.io conversion for system services

## 3.0.0-1.20190423.1852

* (1679) Docker registry v2 fixes

## 3.0.0-1.20190418.2203

* (1448) Support for application-defined minimum window resolution
* (1576) Support for transparent block storage sharing (ReadWriteOnce Persistent Volumes on Kubernetes)
* (1614) Support for team members sharing vaults with other team members (entire team)

## 3.0.0-1.20190409.1413

* (1619) Fixed bug that prevented `/jarvice/pull` endpoint from working correctly in some configurations
* (1644) Fixed bug where `USER` settings in Dockerfiles could prevent jobs from starting correctly; note that JARVICE ignores `USER` at runtime and instead performs its own identity management

## 3.0.0-1.20190405.1502

* (1584) Job queuing at resource limits (phase 3)
* (1619) Updated default and made configurable notification emails and templates
* (1634) `/jarvice/teamjobs` API endpoint (new); see [/jarvice/teamjobs in The JARVICE API](https://jarvice.readthedocs.io/en/latest/api/#jarviceteamjobs) for details

## 3.0.0-1.20190321.2116

* (1580) Support for automatic vault creation of dynamically provisioned Persistent Volumes (Kubernetes only) - see the `jarvice.JARVICE_PVC_VAULT_*` variables in [values.yaml](values.yaml) for more information
* (1583) Self-service resource limits and cost controls (phase 2) for team payers and team admins
* (1596) Support for Google Kubernetes Engine (GKE) is now GA; see [JARVICE Helm chart deployment scripts](scripts/README.md) for details
* (1603) Ability to control in-container web service URL via AppDef rather than just `/etc/NAE/url.txt`
* (1610) Ability to secure in-container web services via GET URLs with machine-generated tokens; see [Jupyter Demo](https://github.com/nimbix/jupyter-demo) for an example application illustrating this functionality

## 3.0.0-1.20190308.1643

* (1571) Authoritative billing code and discounts for job submissions, and improved billing report accuracy by billing code
* (1572) Active Directory documentation updates (see [Active Directory Authentication Best Practices](ActiveDirectory.md))
* (1573) Automatic schema migration for containerized DALs
* (1582) System administrator-controlled resource limits (phase 1) by billing code range, with payer override
* (1590) Experimental support for Google Kubernetes Engine (GKE)
* (1592) Hide pricing in web portal if not set

## 3.0.0-1.20190222.1004

* (1555) Site integration with shared storage best practices to enable "strong" identity in containers
* (1556) Support for LDAP DN substrings used as machine and app privileges to authorize by DN
* (1558) In container identity defaults control for team payers and team admins
* (1563) Support for Active Directory login via UPN (with or without domain suffix) when service account used

repository: randyorr/jarvice-helm

repo_name: randyorr/jarvice-helm


text:
---
title: Computer Graphics Visibility
date: 2021-06-22
categories: [Graphics, Visibility]
tags: [Graphics]
math: true
---

资料来源：https://sites.cs.ucsb.edu/~lingqi/teaching/games101.html

---

#### Z-buffering

场景物体前后遮挡的关系

Z-Buffer Algorithm

```
Initialize depth buffer to ∞ During rasterization:
for (each triangle T)
  for (each sample (x,y,z) in T)
    if (z < zbuffer[x,y])
      framebuffer[x,y] = rgb;
      zbuffer[x,y] = z;
    else
  		// do nothing, this sample
```

![1](/Users/hfy/Documents/Github/haifuyun.github.io/_img/Graphics/Z-buff/1.png)


text:
# asn1
A fork of the golang's encoding/asn1

# Changes

  * Unexported fields are just ignored instead of returning errors.
  * Support for `asn1:"-"` to ignore certain fields.
  * When marshalling `BeforeASN1Marshalling` will be called on any type that implements `BeforeASN1MarshallingI`.
  * When unmarshalling, a nil pointer to a struct will be dealt with by creating anew struct to put there.
  * Added marshalling option `asn1:"octect"` which will cause the value to be marshalled as an octet string.
  * If the correct type of `interface{}` cannot be determined when unmarshalling, `asn1.RawValue` will be used.


text:
---
title: Adding Report Parameters
page_title: Adding Report Parameters Explained
description: "Learn about the different approaches for adding Report Parameters in Telerik Reporting, and how to set up AvailableValues values when needed"
slug: telerikreporting/designing-reports/connecting-to-data/report-parameters/how-to-add-report-parameters
tags: how,to,add,report,parameters,availablevalues
published: True
position: 1
previous_url: /designing-reports-parameters-adding-parameters
---

# Approaches for Adding Report Parameters

Report parameters typically filter report data that is retrieved from a data source. Filtering data at the data source can improve performance for processing and viewing a report. For the times when you cannot filter data at the source, you can use parameters to filter report data after it is retrieved. You can also sort and group data in a report based on report parameters.

## Add a Report Parameter using Report Designer

There are several ways to add a Report Parameter to the Report depending on the preferred designer:

### Desktop Report Designers

1. Invoke the __ReportParameter Collection editor__ with one of the following approaches:

	* Using the `Report.ReportParameters` property in the property grid.
	* Select the __Report Parameters...__ option from the [Context Menu]({%slug telerikreporting/designing-reports/report-designer-tools/desktop-designers/tools/context-menu%})
	* Right click on the `[Parameters]` node of the [Report Explorer]({%slug telerikreporting/designing-reports/report-designer-tools/desktop-designers/tools/report-explorer%})
	* From the __Configure Data Source Parameters__ step of the [DataSource Components]({%slug telerikreporting/designing-reports/connecting-to-data/data-source-components/overview%})

	![The ReportParameter Collection editor of the Desktop Report Designers](images/ReportParameterEditor.png)

1. Click the __Add__ button to create a new parameter.

### Web Report Designer

1. Expand the `DATA` node of the Report Explorer properties to view the inner node `Report parameters`.
1. Click on the `+` sign beside `Report parameters` to create a new parameter and open the dialog with its properties.

![The Add New Item editor of the Web Report Designer for editint Report Parameter properties](images/WebDesignerReportParameterEditor.png)

## Configure the Properties of a Report Parameter using Report Designer

1. In `Name`, type the name of the parameter.
1. In `Text` type the text for the parameter to be displayed in the report viewer as prompt to the end user. If not set, the Name of the parameter will be used instead.
1. In `Type`, select the data type for the parameter value. By default `String` type is selected.
1. You can leave the `Value` property blank, enter a literal value or click the ellipses to invoke the [Expression Edit Dialog]({%slug telerikreporting/designing-reports/report-designer-tools/desktop-designers/tools/edit-expression-dialog%}).
1. If the parameter can contain a blank value, set `AllowBlank` accordingly.
1. If the parameter can contain a null value, set `AllowNull` accordingly.
1. To allow a user to select more than one value for the parameter, set `MultiValue` accordingly.
1. To allow a user to select or change a parameter value, set `Visible` to `True`.

## Defining AvailableValues for ReportParameter’s UI using Report Designer

Expand the `AvailableValues` property of the report parameter and fill the following settings to determine the values the end user can choose from.

* Set the `DataSource` property to specify data source from which the available values of the editor will be loaded. The same object types used as data source for the report can be used as data source for the report parameters. If no DataSource is specified, available values are not loaded.
* In the `ValueMember` property choose a column from the data source from which the editor to load the values.
* In the `DisplayMember` property choose a column from the data source from which the editor to draw the value labels.
* In the `Filters` you can limit the number of records in the available values based on specified filter rules. If the conditions of the rules are met the record is included. Filters are defined using the [Edit Filter Dialog]({%slug telerikreporting/designing-reports/report-designer-tools/desktop-designers/tools/edit-filter-dialog%}).
* Sorting can be performed on the available values through the `Sorting` property. Sorting controls the order of the items provided to the user to choose from. Sorting is defined using the [Edit Sorting Dialog.]({%slug telerikreporting/designing-reports/report-designer-tools/desktop-designers/tools/edit-sorting-dialog%})

## Add a Report Parameter programmatically

{{source=CodeSnippets\CS\API\Telerik\Reporting\ReportSnippets.cs region=AddNewReportParameterSnippet}}
{{source=CodeSnippets\VB\API\Telerik\Reporting\ReportSnippets.vb region=AddNewReportParameterSnippet}}

## Defining AvailableValues for ReportParameter’s UI programmatically

{{source=CodeSnippets\CS\API\Telerik\Reporting\ReportSnippets.cs region=Define_AvailableValues_for_ReportParameter_Snippet}}
{{source=CodeSnippets\VB\API\Telerik\Reporting\ReportSnippets.vb region=Define_AvailableValues_for_ReportParameter_Snippet}}

repository: telerik/reporting-docs

repo_name: telerik/reporting-docs


text:
# @type-cacheable/redis-adapter

[![npm downloads](https://img.shields.io/npm/dm/@type-cacheable/redis-adapter)](https://www.npmjs.com/package/@type-cacheable/redis-adapter)

TypeScript-based caching decorators to assist with caching (and clearing cache for) async methods. This package supports the `redis` client.

[View full documentation](https://github.com/joshuaslate/type-cacheable)

## Usage

### Installation

```bash
npm install --save @type-cacheable/core @type-cacheable/redis-adapter
```

Note: If you are using `redis` v3.x.x, use `@type-cacheable/redis-adapter` v10.x.x. If you are using `redis` v4.x.x, use `@type-cacheable/redis-adapter` v11.x.x+.

or

```bash
yarn add @type-cacheable/core @type-cacheable/redis-adapter
```

### Using adapter

```ts
import * as Redis from 'redis';
import { useAdapter } from '@type-cacheable/redis-adapter';

const client = Redis.createClient();
const clientAdapter = useAdapter(client);
```

Then you can rely on the `@Cacheable`, `@CacheUpdate`, and `@CacheClear` decorators from `@type-cacheable/core`. [See core documentation](https://github.com/joshuaslate/type-cacheable/tree/main/packages/core)

repository: joshuaslate/type-cacheable

repo_name: joshuaslate/type-cacheable


text:
# London Biscuits defaults on debt payments totaling RM89m

Published at: **2019-11-06T14:26:47+00:00**

Author: **Wong Ee Lin**

Original: [The Edge Markets](https://www.theedgemarkets.com/article/london-biscuits-defaults-debt-payments-totaling-rm89m)

KUALA LUMPUR (Nov 6): London Biscuits Bhd has defaulted on principal payments to seven banks, amounting to a total of RM89.19 million.
The payment defaults range from RM4.33 million to RM29.87 million, owed to seven banks: Bank Islam Malaysia Bhd, Bank of China (Malaysia) Bhd, Malayan Bank Bhd, United Overseas Bank Bhd, OCBC Bank (Malaysia) Bhd, OCBC Al-Amin Bank Bhd and HSBC Bank Malaysia Bhd, according to a company filing with Bursa Malaysia today.
London Biscuits attributed the default in payments to cashflow constraints, with the default dates between June 19 and Sept 20, 2019.
“The Company is currently assessing the significant impact of the default in payment on the business, financial and operations of the remaining business of the Group,” the biscuit manufacturer, which shares tanked to as low as five sen in the last one month, said.
The company fell into Practice Note 17 status on July 9, but remains asset rich.
As at June 30, 2019, its total assets amounted to RM812.48 million, translating to a net asset value per share of RM1.28.
Shares of London Biscuits closed unchanged at 5.5 sen today, valuing the company at RM16 million. Over the past year, the counter has lost nearly 89% of its value.

license: Unlicense

repository: dsadlollioygjmzvcxv/tdc-exported

repo_name: dsadlollioygjmzvcxv/tdc-exported


text:
# Zanzibar: Google’s Consistent, Global Authorization System

## requirement

respect causal ordering of user actions and thus provide external consistency amid changes to access control lists and object contents
1. it respects the order in which ACL changes are committed to the underlying data store.
2. it can ensure that authorization checks are based on ACL data no older than a client-specified change.

a simple data model with a powerful configuration language.

## distributed scaling

When a check request arrives to Zanzibar, the work to evaluate the check may fan out to multiple
servers, for example when a group contains both individual members and other groups

The ACL data does not lend itself to geographic partitioning because authorization checks for any object can come from anywhere in the world.
Therefore, Zanzibar replicates all ACL data in tens of geographically distributed data centers and distributes load
across thousands of servers around the world.

handles hot spots on normalized data by caching final and intermediate results, and by deduplicating simultaneous requests.

It also applies techniques such as hedging requests and optimizing computations on deeply nested sets with limited denormalization

Zanzibar responds to more than 95% of authorization checks within 10 milliseconds and has maintained more
than 99.999% availability for the last 3 years.

## cache hot spots

To handle the “cache stampede” problem [3], where concurrent requests create flash hot spots before the cache is
populated with results, we maintain a lock table on each server to track outstanding reads and checks.
Among requests sharing the same cache key only one request will begin processing; the rest block until the cache is populated

To handle hot forwarding keys, we cache results at both the caller and the callee of internal RPCs, effectively
forming cache trees.

We also use Slicer [12] to help distribute hot keys to multiple servers.

We avoid reusing results evaluated from a different snapshot by encoding snapshot timestamps in cache keys.

We choose evaluation timestamps rounded up to a coarse granularity, such as one or ten seconds, while respecting staleness
constraints from request zookies. This timestamp quantization allows the vast majority of recent checks and reads to be
evaluated at the same timestamps and to share cache results

## new enemy problem

Preventing the “new enemy” problem requires Zanzibar to understand and respect the causal ordering between ACL or
content updates, including updates on different ACLs or objects and those coordinated via channels invisible to Zanzibar.
Hence Zanzibar must provide two key consistency properties:
1. external consistency [18] and
2. snapshot reads with bounded staleness.

## spanner used

we store ACLs in the Spanner global database system [15]. Spanner’s TrueTime mechanism assigns each ACL
write a microsecond-resolution timestamp, such that the timestamps of writes reflect the causal ordering
between writes, and thereby provide external consistency

one could try to always evaluate at the latest snapshot such that the check result reflects all ACL writes up to the
check call. However, such evaluation would require global data synchronization with high-latency round
trips and limited availability

## protocol

we design the following protocol to allow most checks to be evaluated on already replicated data
with cooperation from Zanzibar clients
1. A Zanzibar client requests an opaque consistency token called a zookie for each content version, via a
contentchange ACL check (§2.4.4) when the content modification is about to be saved
2. The client sends this zookie in subsequent ACL check requests to ensure that the check snapshot

## zookie

A concept used throughout these API methods is that of a zookie. A zookie is an opaque byte sequence encoding a
globally meaningful timestamp that reflects an ACL write, a client content version, or a read snapshot. Zookies in ACL
read and check requests specify staleness bounds for snapshot reads, thus providing one of Zanzibar’s core consistency
properties.

## language

Defining our data model around tuples, instead of per-object ACLs, allows us to unify the concepts of ACLs and
groups and to support efficient reads and incremental updates,

The language allows clients to define arbitrary relations between users and objects, such as owner, editor, commenter, and
viewer.

It includes set-algebraic operators such as intersection and union for specifying potentially complex access
control policies in terms of those user-object relations

ACLs can thus refer to other ACLs, for example to specify that the set of users who can comment on a video consists
of the users who have been granted viewing rights on that specific video along with those with viewing permissions on the video channel.

Zanzibar evaluates ACL checks by converting check requests to boolean expressions.

To minimize check latency, we evaluate all leaf nodes of the boolean expression tree concurrently

### userset rewrite rules

we let clients define object-agnostic relationships via userset rewrite rules in relation configs.

## watch API

Some clients maintain secondary indices of relation tuples in Zanzibar. They can do so with our Watch API. A watch
request specifies one or more namespaces and a zookie representing the time to start watching

watchservers are a specialized server type that respond to Watch requests. They tail the changelog and serve a stream
of namespace changes to clients in near real time.

## indexing

Leopard is an indexing system used to optimize operations on large and deeply nested sets.
It reads periodic snapshots of ACL data and watches for changes between snapshots

Recursive pointer chasing during check evaluation has difficulty maintaining low latency with groups that are deeply
nested or have a large number of child groups. For selected namespaces that exhibit such structure,
Zanzibar handles checks using Leopard, a specialized index that supports efficient set computation

## probability test on stale data

Each server tracks the frequency of such out-of-zone reads for data at a default staleness as well as for fresher
and staler data, and uses these frequencies to compute a binomial proportion confidence interval
of the probability that any given piece of data is available locally at each staleness.

Upon collecting enough data, the server checks to see if each staleness value has a sufficiently low probability
of incurring an out-of-zone read, and thus will be low-latency. If so, it updates the default staleness bound
to the lowest “safe” value. If no known staleness values are safe, we use a twoproportion z-test to see
if increasing the default will be a statistically significant amount safer. In that case, we increase
the default value in the hopes of improving latency

## noisy neighbour

measures the cost of each RPC in terms of generic cpu-seconds, a hardware-agnostic metric. Each client has
a global limit on maximum CPU usage per second; its RPCs will be throttled if it exceeds the limit and there is
no spare capacity in the overall system

Each Zanzibar server also limits the total number of outstanding RPCs to control its memory usage. Likewise it limits the number of oustanding RPCs per client.

Zanzibar further limits the maximum number of concurrent reads per (object, client) and per client on each Spanner
server. This ensures that no single object or client can monopolize a Spanner server

Finally, we use different lock table keys for requests from
different clients to prevent any throttling that Spanner applies
to one client from affecting other clients

## tail latency

hedging

To determine the appropriate hedging delay threshold, each server maintains a delay estimator that dynamically
computes an Nth percentile latency based on recent measurements. This mechanism allows us to limit the additional
traffic incurred by hedging to a small fraction of total traffic.

repository: sanjosh/csdocs

repo_name: sanjosh/csdocs


text:
## [3.0.1] - Minor code formatting
* Fixed a formatting issue

## [3.0.0] - Error fixes and improvements
### Breaking changes
* Deprecated SizingInfo. Constructors now provide an instance of MediaQueryData
### Minor changes
* Fixed an error where the StatefulVMStoreBuilder.standAlone() would use Provider
* Updated and fixed formatting for README.md

## [2.0.0-nullsafety.0] - Null safety migration

* MobX architecture has been fully migrated to null safety
* Fixed README.md formatting and typos, and changed parts for clarity
* Fixed example to be null-safe

## [1.0.4] - Minor changes

* Updated README.md
* Minor bug fix
* Minor change to error logging

## [1.0.3] - Updated README.md

* Fixed formatting

## [1.0.2] - Fixed Typo

* Fixed typo in the docs

## [1.0.1] - Minor changes

* Minor changes to the docs for dartdoc

## [1.0.0] - Initial Release

* Initial release