text:
[![Build Status](https://travis-ci.org/ReactiveX/RxRuby.svg?branch=master)](https://travis-ci.org/ReactiveX/RxRuby)
[![GitHub version](https://img.shields.io/github/tag/ReactiveX/RxRuby.svg)](https://github.com/ReactiveX/RxRuby)
[![Downloads](https://img.shields.io/gem/dt/rx.svg)](https://www.npmjs.com/package/rx)
[![Code Climate](https://codeclimate.com/github/ReactiveX/RxRuby/badges/gpa.svg)](https://codeclimate.com/github/ReactiveX/RxRuby)

**[The Need to go Reactive](#the-need-to-go-reactive)** |
**[About the Reactive Extensions](#about-the-reactive-extensions)** |
**[Why RxRuby?](#why-rxruby)** |
**[Contributing](#contributing)** |
**[License](#license)**

# The Reactive Extensions for Ruby (RxRuby) 0.1... #
*...is a set of libraries to compose asynchronous and event-based programs using observable collections and Enumerable module style composition in Ruby*

## The Need to go Reactive ##

Reactive Programming is a hot topic as of late, especially with such things as the [Reactive Manifesto](http://www.reactivemanifesto.org/).  Applications' needs have changed over time, from simple polling for data to a full reactive system where data is pushed at you.  Each time, we're adding more complexity, data, and asynchronous behavior to our applications.  How do we manage it all?  How do we scale it?  By moving towards "Reactive Architectures" which are event-driven, resilient, and responsive.  With the Reactive Extensions, you have all the tools you need to help build these systems.

## About the Reactive Extensions ##

The Reactive Extensions for Ruby (RxRuby) is a set of libraries for composing asynchronous and event-based programs using observable sequences and fluent query operators that many of you already know in Ruby. Using RxRuby, developers represent asynchronous data streams with Observables, query asynchronous data streams using our many operators, and parameterize the concurrency in the asynchronous data streams using Schedulers. Simply put, RxRuby = Observables + Operators + Schedulers.

When you're authoring applications with Ruby, there may be times when you want to deal with asynchronous and event-based programming, and synchronization is difficult and error prone.

Using RxRuby, you can represent multiple asynchronous data streams (that come from diverse sources, e.g., stock quotes, tweets, computer events, web service requests, etc.), and subscribe to the event stream using the Observer module. The Observable notifies the subscribed Observer instance whenever an event occurs.

Because observable sequences are data streams, you can query them using standard query operators implemented by the Observable module. Thus you can filter, project, reduce, compose, and perform time-based operations on multiple events easily by using these operators. In addition, there are a number of other reactive stream-specific operators that allow powerful queries to be written. Cancellation, exceptions, and synchronization are also handled gracefully by using the methods on the Observable module.

But the best news of all is that you already know how to program like this.  Take for example the following Ruby code, where we get some stock data, manipulate it, and then iterate over the results.

```ruby
# Get evens and square each
someSource
  .select { |x| x.even? }
  .map { |x| x * x }
  .each { |x| puts x.to_s }
```

Using RxRuby, you can accomplish the same kind of thing with a push-based collection by changing `each` to `subscribe`.

```ruby
someSource
  .select { |x| x.even? }
  .map { |x| x * x }
  .subscribe { |x| puts x.to_s }
```

## Why RxRuby? ##

The overall goal of [RxRuby](https://github.com/ReactiveX/RxRuby) is to have a push-based version of the [Enumerable module](http://ruby-doc.org/core-2.1.0/Enumerable.html) with an added notion of time.  Right now, the [Observable module](http://ruby-doc.org/stdlib-1.9.3/libdoc/observer/rdoc/Observable.html) is not quite what we want because it does not allow for composition.  That is no more than a simple implementation of the Subject/Observer pattern from the Gang of Four book, such as the following.

```ruby
require 'observer'

class ArrayObservable
  include Observable

  def initialize(array)
    @array = array
  end

  def run
    index = 0

    while index < @array.length
      change #notify of change
      notify_observers @array[index] # send the current value
      index += 1
      sleep 1
    end
  end
end

class ArrayObserver
  def initialize(observable)
    observable.add_observer(self)
  end

  def update(item)
    puts item.to_s
  end
end

observable = ArrayObservable [1,2]
observer = ArrayObserver.new(observable)
# 1
# 2
```

But how do you enable better composition so that you can compose together Observable instances?  In this current model, this can't happen.  That's why we need the Reactive Extensions for Ruby.  Not only that, we can, at any point in the computation, change the concurrency model to be immediate, on a new thread, or on another machine.

There are many implementations of the Reactive Extensions such as [RxJS](https://github.com/Reactive-Extensions/RxJS), [Rx.NET](https://github.com/reactive-extensions/rx.net), [Java/JVM/Clojure/Scala/JRuby/Groovy](https://github.com/ReactiveX/RxJava) and [ObjC/ReactiveCocoa](https://github.com/ReactiveCocoa/ReactiveCocoa).  Our goal is to have one operate like the JRuby one, but be available to all users of Ruby, regardless of VM.

We'd like it to be like our JavaScript version, [RxJS](https://github.com/Reactive-Extensions/RxJS) but be able to handle multi-threading, parallelism, and in addition, go across the network.

Instead, our goal is to make the Observable module look exactly like the Enumerable module, in that you can write any query method over it to produce a value, but have it push-based.  This could become yet another competitor to [EventMachine](http://rubyeventmachine.com/), in which we have rich composition over events, whether locally or across the network.

So, take an example, zipping two Arrays.

```ruby
a = [4, 5, 6]
b = [7, 8, 9]

[1, 2, 3].zip(a, b)      #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
[1, 2].zip(a, b)         #=> [[1, 4, 7], [2, 5, 8]]
a.zip([1, 2], [8])       #=> [[4, 1, 8], [5, 2, nil], [6, nil, nil]]
```

Now, we could do something similar in [RxRuby](https://github.com/ReactiveX/RxRuby) with two observable sequences:

```ruby
require 'rx'

a = Rx::Observable.from_array [4, 5, 6]
b = Rx::Observable.from_array [7, 8, 9]

sub = a.zip(b).subscribe { |arr| puts arr.to_s }
# => "[4, 7]"
# => "[5, 8]"
# => "[6, 9]"

# unsubscribes from the sequence and cleans up anything
sub.unsubscribe
```

The difference here is that `zip` returns an `Rx::Observable` instead of an `Enumerable`.  And once you call `subscribe` it's much like `each` but takes an observer, or perhaps just some blocks, lambdas, etc.  The subscription handed back contains the cancellation logic.  For example, if you are listening to events and you no longer want to listen, you can call `unsubscribe` on the `sub` variable above.

What's the end goal?  The first part is that we want to support the main `Enumerable` module methods in the `Observable` module and have them react the same way, but push instead of pull-based.  From there, we can explore such things as multi-threading, and calls across the network.

If you want to find out more, please check out the JavaScript version, [RxJS](https://github.com/Reactive-Extensions/RxJS), which has more details on the overall goals.

Our overall goal is to make this one of the best Rx libraries out there, better than RxJS, RxPy, ReactiveCocoa, RxJava, etc, all while maintaining the "Ruby Way".

## Contributing ##

You can contribute by reviewing and sending feedback on code checkins, suggesting and trying out new features as they are implemented, submit bugs and help us verify fixes as they are checked in, as well as submit code fixes or code contributions of your own. Note that all code submissions will be rigorously reviewed and tested by the Rx Team, and only those that meet an extremely high bar for both quality and design/roadmap appropriateness will be merged into the source.

## License ##

Copyright (c) Microsoft Open Technologies, Inc.  All rights reserved.

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.

repository: codemilan/RxRuby

repo_name: codemilan/RxRuby


text:
---
url: https://jtway.co/migrate-from-sidekiq-to-sidekiq-cr-in-rails-application-8d26674d9e2a
canonical_url: https://jtway.co/migrate-from-sidekiq-to-sidekiq-cr-in-rails-application-8d26674d9e2a
title: Migrate from Sidekiq to Sidekiq.cr in Rails application
subtitle: Where to start the Sidekiq jobs transition from Ruby to Crystal within the
  project in order to optimize the resources usage on the server…
slug: migrate-from-sidekiq-to-sidekiq-cr-in-rails-application
description: ""
tags:
- ruby-on-rails
- development
- tutorial
- programming
- optimization
author: JetThoughts
username: jetthoughts
cover: ./assets/images/1*Bfh0Xi52cBZdfXtMoWBmHQ.png
class: post-template
layout: post
---

>> Where is it better to start the Sidekiq jobs transition from Ruby to Crystal in order to optimize the resources usage on the server and, at the same time, not to struggle with the duplication?

Let’s conduct a little experiment and see if it is possible to integrate the *Sidekiq.cr* into the Rails application without spending a lot of effort and keeping the code cleanliness.

# Ruby Part

In the *Rails* application, it’s better to isolate the logic by creating the job in a separate service before getting it to work with the *Crystal* implementation.

For using the *Crystal* worker implementation, its class name and the *Sidekiq* queue name should be defined as the arguments. This is the way our service will look like:

That’s all for the Rails application!!!

# Crystal Part

In order to support the worker implementation on *Crystal*, this part should have *Sidekig.cr.* As it is pointed in the [documentation](https://github.com/mperham/sidekiq.cr/wiki/Getting-Started#create-some-jobs-using-the-client-api):

> Crystal can push jobs for a Ruby process to consume, and vice versa.
The Crystal Web UI can monitor Ruby processes, and vice versa.

The next requisition is the ability to work with a database that is the same for the *Rails* and the *Crystal* parts. There are several frameworks based on *Crystal*, which allow such a database connection. To make a choice, we formed the following requirements:

* it should be easy to customize and maintain

* it should allow finding the record in a database and updating it

After some research, we choose [*Granite](https://github.com/amberframework/granite).* Its pros are:

* easy support

* ability to define only attributes, which are going to be used

* supporting the Rails-like helpers to operate with the records

The model in the *Crystal* application will look like:

Example of environment configuration in the s*hard.yml*:

[Configure the connection](https://github.com/amberframework/granite/blob/master/docs/readme.md#register-a-connection) to a database:

`max_pool_size` and `initial_pool_size` — are configuration parameters for the [connection pool](https://crystal-lang.org/reference/database/connection_pool.html).

The next step — *Sidekiq::CLI* configuration and preload of the connection with a database:

`WORKER_CR_CONCURRENCY`- is the environment variable that defines the maximum size for a connection pool.

# Sidekiq worker in the Crystal Part

This worker will be responsible for fetching the record from the database and running some services:

The worker’s name should match WORKER_NAME defined in the *Rails* service:

```
WORKER_NAME = 'Broolik::Worker::URLChecker'
```

Specify the queue for the job the same as in the *Rails* *ScheduleUrlCheckService*:

```
'queue' => 'worker.cr'
```

# Make friends Crystal and Ruby

Thus, the installation of the *Crystal* part is started using the command:

```
crystal build src/sidekiq.cr -o bin/sidekiq.cr --release
```

Finally, run:

```
bin/sidekiq.cr -q worker.cr -c 100 -e production
```

# Link to the example

You can find this example in our repository [jetthoughts/broolik-worker.cr](https://github.com/jetthoughts/broolik-worker.cr).

**Sergey Sviridov** *is a Software Engineer at [JetThoughts](https://www.jetthoughts.com/). Follow him on* [LinkedIn](https://www.linkedin.com/in/sergey-sviridov-83007199/) *or [GitHub](https://github.com/SviridovSV).*

> *If you enjoyed this story, we recommend reading our [latest tech stories](https://jtway.co/latest) and [trending tech stories](https://jtway.co/trending).*

license: MIT

repository: jetthoughts/blog

branch_name: refs/heads/master

extension: md

gha_language: HTML

gha_license_id: MIT

license_type: permissive

repo_name: jetthoughts/blog


text:
# panco
Command-line tool that interacts with Palo Alto firewalls and Panorama.

Abilities include:

**Objects**

* Import (create, update) and export the following:
  * Address objects (IP, Range, FQDN), address groups (static and dynamic), service objects (TCP, UDP, port-ranges, etc.), service groups.

**Policy**

* Import (create, update) and export a security policy:
  * Add new rules to a policy.
  * Modify existing rules to update values (e.g. update lots of rules with a Log Profile, or Security Profile group).
* Move rules in a policy
  * Move a single rule, or multiple rules (using a CSV file) anywhere within a policy.

**Provision Devices**

* Provision a device using [IronSkillet](https://github.com/PaloAltoNetworks/iron-skillet) [`loadable_configs`](https://github.com/PaloAltoNetworks/iron-skillet/tree/panos_v8.0/loadable_configs) or from a different configuration file.
  * Can use a local file, or pull one from a remote HTTP location.

For a detailed explanation of commands, and how they are used, please visit the [Wiki](https://github.com/scottdware/panco/wiki) page or click on any one of the command names below (takes you to their respective Wiki page).

`panco` [`help`](https://github.com/scottdware/panco#usage), [`objects`][objects-doc], [`policy`][policy-doc], [`provision`][provision-doc]

## Installation

Installation of extremely easy, and just involves downloading the correct binary for your OS. You can download them by clicking on the [release](https://github.com/scottdware/panco/releases) tab above.

Current support OS's:

* Windows
* Mac OS

Just download the `panco-<OS>.zip` file, extract the binary and place it somewhere in your PATH.

## Getting Started

* Visit the [Wiki](https://github.com/scottdware/panco/wiki)

There you will find in-depth documentation and examples on how to structure the CSV file(s) when working with objects
 and policies.

## Usage

```
Command-line tool that interacts with Palo Alto firewalls and Panorama.

See https://github.com/scottdware/panco/Wiki for more information

Usage:
  panco [command]

Available Commands:
  example     Create example CSV files for import reference
  help        Help about any command
  objects     Import and export address and service objects
  policy      Import/export a security policy, move rules
  provision   Provision a device using IronSkillet or a local or remote (HTTP) file
  version     Prints the version number of panco

Flags:
  -h, --help   help for panco

Use "panco [command] --help" for more information about a command.
```

[objects-doc]: https://github.com/scottdware/panco/wiki/Objects
[policy-doc]: https://github.com/scottdware/panco/wiki/Policy
[provision-doc]: https://github.com/scottdware/panco/wiki/Provisioning

repository: kevinhuy/panco

repo_name: kevinhuy/panco


text:
# Django SNS Redis

## Welcome!

Welcome to Django SNS Redis! This package lets you send push notifications right from your [Django](https://www.djangoproject.com) project using [Amazon's](https://aws.amazon.com) [Simple Notification Service](https://aws.amazon.com/sns/). The cool thing about it is that is has a built-in [Redis](http://redis.io) cache for storing devices' ARNs (specially usefull when you have tons of users and don't wanna squeeze your relational database).

## How it works
Django SNS Redis allows you to register devices with their registration_id provided by GCM/APNS. Then, it stores it to a database and obtains an ARN from SNS.

Since that ARN is associated to a user and stored in Redis, when publishing a message, you won't hit the database. That, added to the features SNS provides, will help your app deliver notifications much faster and with less resources.

## Requirements
The library might work with versions prior to the ones specified, but they are not tested. Feel free to submit a pull request if you have tested other versions (or if you have patched the library!).

* [Python](https://www.python.org/) (2.7+)
* [Django](https://www.djangoproject.com/) (1.8+)
* [Django Redis](https://github.com/niwinz/django-redis) (4.3+)
* [Boto](https://github.com/boto/boto) (2.42+)

## Setup
Add the following to your Django settings file (usually, settings.py):

~~~~
INSTALLED_APPS = [..., snsredis, ...]

AWS_ACCESS_KEY_ID = [your key id]
AWS_SECRET_ACCESS_KEY = [your secret]
AWS_REGION_NAME = [region where you have the desired SNS instances]

AWS_SNS_APNS_ARN = [ARN for your iOS app]
AWS_SNS_GCM_ARN = [ARN for your Android app]

SNSREDIS_REDIS_CONNECTION = [name of the redis connection]
~~~~

What are we doing there?

First, we are adding the library to your Django project installed apps. This is necessary for the rest of the project to *talk* to the library.

Then we are adding some keys that Amazon will provide you.

* **ACCESS KEY ID** and **SECRET ACCESS KEY** is a pair of keys that let you use your AWS resources from outside. You can set up them [here](https://console.aws.amazon.com/iam/home). Make sure your keys have permissions to operate SNS.

* **REGION NAME** is the region in which you have configured your SNS instances. *Default: eu-west-1*

* **SNS APNS/GCM ARN** (ARN stands for Amazon Resource Name). IDs of the SNS applications (you can register them [here](https://eu-west-1.console.aws.amazon.com/sns/v2/home)). This parameters are only required for the platforms you want to use.

* **SNSREDIS REDIS CONNECTION**. Name for the Redis connection the library is going to use. Use this parameter only if you are using multiple redis connections. *Default: default*

**Remember to apply migrations!**

## Usage

### Adding a user token

~~~~
from django.contrib.auth.models import User
from snsredis.tasks import add_token

user = User.objects.get(id=1)
registration_id = 'xxxxxxxxx'
platform = 'gcm'

add_token(user, registration_id, platform)

~~~~

### Publishing a message

~~~~
from django.contrib.auth.models import User
from snsredis.tasks import publish

user = User.objects.get(id=1)
message = 'Hello world'
extra = {
			'post': 123,
			'url': 'http://www.example.com'
		}
sound = 'default.mp3'
badge = 24

publish(user, message=message, extra=extra, sound=sound, badge=badge)

~~~~

### Removing user token

~~~~
from django.contrib.auth.models import User
from snsredis.tasks import remove_token

user = User.objects.get(id=1)
registration_id = 'xxxxxxxxx'

remove_token(user, registration_id)

~~~~

repository: pauarge/django-sns-redis

gha_language: Python

repo_name: pauarge/django-sns-redis


text:
# Object and Relation Centric Representations for Push Effect Prediction

Here is code and dataset for [[Object and Relation Centric Representations for Push Effect Prediction]](https://fzaero.github.io/push_learning/).

Ahmet E Tekden, Aykut Erdem, Erkut Erdem, Tamim Asfour, Emre Ugur

----

Models are trained in Python 3.7.

Required Packages For The Network:
pytorch, scikit-learn, numpy, matplotlib, tqdm

Required Packages For Running Tool Experiment:
collision, [[Pyrep]](https://github.com/stepjam/PyRep/)

----

Datasets are available at: [[Dataset]](https://drive.google.com/file/d/1-6a39c4p7G5NqVpyZIS6Xb88lLmh2RrS/view?usp=sharing).

They are required to be extracted to Data folder.

branch_name: refs/heads/main


text:
# KARAMOJA FOOD INSECURITY: Interactive data visualizations for the food security monitoring tool that will be developed by the DDI for Karamoja NGO
Assessment

#### link to tableau dashboard : https://public.tableau.com/profile/elizabeth.josephine#!/vizhome/karamojadataset-indeprendentprojectweek1_ELIZABETH_JOSEPHINE/Dashboard3
## Overview

Karamoja (https://en.wikipedia.org/wiki/Karamoja) is the most food-insecure region of Uganda. One of the main reasons is the low productivity level of the crops due to intense droughts as well as pest and disease outbreaks.

In Karamoja, several NGOs provide technical support as well as farm inputs to the farmers experiencing extremely low yield. Though, they lack visibility into the overall state of the region and often need to rely on some very local sources of information to prioritize their activities.

Dalberg Data Insights (DDI) has been requested to develop a new food security monitoring tool to support the decision making of one of those NGOs active in Karamoja.

To do so, Dalberg Data Insights developed a methodology to remotely measure the yield of the two main staple crops of the region (i.e. sorghum and maize) based on satellite images. The agri-tech team just ran the model for the 2017 crop season.

## Research Question

As a Data Scientist, the agri-tech team is asking you to develop an interactive visualization tool of the results for this first crop season. This visualization tool that you will develop will be used as a first mockup of the Food Security Monitoring tool that DDI will develop for the NGO.

Based on your experience, the team expects you to come up with a first draft within the coming 3 working days. They give you carte blanche in terms of structure and functionalities but they know that the client wants:

## REQUIRED
At least a map in the dashboard
The possibility of visualizing the results by district or sub-county (two administrative levels used by the NGO)

## Dataset Files

Dataset Source [https://archive.org/download/data_20190829/DATA.zip)

Shapefiles
Boundaries of Uganda Subcounties
Boundaries of Uganda Districts
Crop Type Map for Sorghum (i.e. position of the Sorghum fields)
Crop Type Map for Maize
Tables
Yield and Population per Subcounty
POP: total population for the subcounty
S_Yield_Ha: average yield for sorghum for the subcounty (Kg/Ha)
M_Yield_Ha: average yield for maize for the subcounty (Kg/Ha)
Crop_Area_Ha: total crop area for the subcounty (Ha)
S_Area_Ha: total sorghum crop area for the subcounty (Ha)
M_Area_Ha: total maize crop area for the subcounty (Ha)
S_Prod_Tot: total productivity for the sorghum for the subcounty (Kg)
M_Prod_Tot: total productivity for the maize for the subcounty (Kg)
Yield and Population per District


text:
## Generate script for Xephyr multiseat on demand

genseat can generate a script to multiseat on demond.

### Installation

 1. Install Xephyr, go, xinput, setxkbmap, sudo
 2. Plugin your extra keyboard and mouse.
 3. `go build` to generate `genseat` executable file

### Usage
 1. run `genseat > seat2.sh`
 2. edit seat2.sh before run. Modify following options depend on you.
  * modify DISPLAY(eg. :5 -> :10)
  * resolution (eg. 1024x768 -> 1280x1024)
  * terminal or window manager (eg. xterm -> awesome)
 3. Run it by `sh seat2.sh`
 4. Move the new seat to proper position by your first mouse.

repository: dlintw/genseat

repo_name: dlintw/genseat


text:
# Video Chat Sample

Study sample code to learn how to use Peer-to-Peer Communication API via RICOH Cloud SDK for JavaScript.

This code sample offers a back-end function and a front-end function. The sample uses Express.

## Back-End

A back-end Web API server implementation which hides Client Credentials from front-end service users. The source code is located in `app.js`.

Note that this code sample aims to show the basic usage of the API. If you want to publish this sample to offer your service, you should consider adding more user limitation to this implementation.

## Front-End

A front-end application for WebRTC. The source code is located in public directory.

## Requirements

- npm

## How to Use

Download this code sample using `git clone`.

```sh
$ git clone https://github.com/ricohapi/ricoh-cloud-sdk-js.git
$ cd ricoh-cloud-sdk-js/samples/video-chat
```

Set your Client Credentials in `app.js`.

```javascript
L12: const CLIENT_ID = '<Set your Client ID here>';
L13: const CLIENT_SECRET = '<Set your Client Secret here>';
```

Run the following commands to start a web server on port 3000.

```sh
$ npm install --production
$ npm start
```

## Step by Step guide
1. Open ``http://localhost:3000/signin`` in a web browser(support only Chrome or Firefox).

2. Login with a RICOH account.

3. Click ``Make Offer`` button.

4. Select all ``Offer`` strings and copy to clipboard.

5. Open ``http://localhost:3000/signin`` on another tab in the web browser.

6. Paste ``Offer`` string to ``Offer`` area.

7. Click ``Receive Offer`` button.

8. Select all ``Answer`` strings and copy to clipboard.

9. Back to the first tab.

10. Paste ``Answer`` string to ``Answer`` area.

11. Click ``Receive Answer`` button.

repository: ricohapi/ricoh-cloud-sdk-js

gha_language: JavaScript

repo_name: ricohapi/ricoh-cloud-sdk-js


text:
# Fight
The official plugin, gamemode ran by TGM. Original - PGM, creators of TGM: Teejers, MatrixTunnel, Luuke.

## Local Server Setup

1. Start with the latest [Spigot](https://www.spigotmc.org/) build.

2.  Use the repository `Maps` folder for some packaged example maps.

3. Create a file named `rotation` in the server folder. This is a list of maps that the plugin will automatically cycle to. Put any of your maps on their own line in the file. If you are using Fracture, simply put "Fracture" on the first line and save the file. It's important to know that the name of the map specified in the map.json file is used here, not the folder name.

4. (Optional) Install World Edit to make the Teleport Tool work.

5. Start the server.

## Developer Tips

1. We use Lombok. Make sure you have the Lombok plugin installed on your preferred IDE.

2. We use maven. Like any other maven project, run `mvn clean install` in the top level folder to generated required libraries.

license: Unlicense

repository: FightMC/Fight

gha_language: Java

repo_name: FightMC/Fight


text:
# vesta_slack_bot
Demonstrates how to use python to post notifications to slack, using settings specific to Vesta.

This depends on files installed on the lab server. See the [Slacker github] (https://github.com/os/slacker) for a python library that works on all systems.


text:
Flippable
============================

Flippable is a Swift protocol for when you just have to flip stuff up.

Just extend your favourite class, implement flip() and you’re ready to go.

Included are implementations for String, UIView and UIImage, plus handy prefix and postfix operators to flip in stile.

![string](https://raw.githubusercontent.com/Sephiroth87/Flippable/master/string.png)
![image](https://raw.githubusercontent.com/Sephiroth87/Flippable/master/image.png)
![view](https://raw.githubusercontent.com/Sephiroth87/Flippable/master/view.gif)

License
-----------------------------
Copyright (c) 2015. [Fabio Ritrovato](https://twitter.com/Sephiroth87)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

extension: markdown


text:
# Prettify JSON Log

A small python program that can prettify any log output where each line is a JSON object.
See <https://pypi.org/project/prettifyJsonLog/>

repository: neumantm/nur-packages

gha_language: Nix

repo_name: neumantm/nur-packages


text:
---
layout: post
title: "ChatOps: Hubot Grafana Images in HipChat"
description: "Golang app to save grafana-rendered images, shorten the url, and serve from a local webserver"
category: articles
tags: [chatops, chef, data visualization, devops, golang, grafana, monitoring, nginx, operations, ruby, sensu, software]
comments: true
---

As we continue toward ChatOps and making our work visible at work, the next phase of maturing our monitoring systems is to create a query-able interface to our visualization system (Grafana) from HipChat. Grafana is a system I've become quite fond of and helped author the Chef cookbook for. The HTTP API for Grafana has matured, and the time seemed right to create this integration.

## High-level Design
Having read about [Librato's ChatOps](http://blog.librato.com/posts/confessions-of-a-chatbot) and seen [Etsy's nagios-herald](https://github.com/etsy/nagios-herald), I had a rough idea of the user experience I wanted. With a head full of hindsight bias, here are some of the requirements:

* A user-friendly query interface in chat (no magic numbers, server-specific names, etc.)
* Images posted should be available in chat without additional authentication
* Able to utilize our existing Grafana server

I was delighted to find that Stephen Yeargin had already written [hubot-grafana](https://github.com/stephenyeargin/hubot-grafana), a script that did all the heavy lifting for the first requirement. The Grafana docs site also has a [how to integrate Hubot with Grafana](http://docs.grafana.org/tutorials/hubot_howto/) article. Stephen's  hubot script provides for discovery of dashboards, per-panel queries, template variables, and time-range queries. It's really quite fantastic. However, it assumes that S3 will be used to host the images. While that'll work for most folks (and certainly could work for us), I wanted to be able to use our existing Grafana server to house this integration. To achieve this I had to modify [grafana.coffee](https://github.com/criticalmass/hubot-grafana/blob/master/src/grafana.coffee). More on that below.

The default configuration provided by the [chef-grafana](https://github.com/JonathanTron/chef-grafana) cookbook includes Nginx as a proxy for grafana-server. For work we wrap the community cookbook to configure TLS, LDAP, and Grafana's datasources. It seemed like a natural extension of visualization's responsibility to have a small app on the Grafana node that can fetch/save rendered panel images and then use Nginx to serve those images. I called that small application [grafana-images](https://github.com/lanyonm/grafana-images). More on that below as well.

## Modifications to hubot-grafana
As mentioned above, I had to modify the [hubot-grafana](https://github.com/criticalmass/hubot-grafana) script to provide an alternate image persistence method (alternative to S3). The coffeescript additions are relatively straightforward:

{% highlight coffeescript %}
customFetchAndUpload = (msg, title, url, link) ->
  requestHeaders = {
    encoding: "utf8",
    Authorization: "Bearer #{grafana_api_key}",
    Accept: "application/json"
  }

  req_opts = {
    method: "POST",
    url: "#{grafana_images_host}/grafana-images",
    headers: requestHeaders,
    json: {
      imageUrl: url
    }
  }

  # post to grafana-images
  request req_opts, (err, res, json) ->
    robot.logger.debug "grafana-images POST: #{req_opts.url}, content-type[#{res.headers['content-type']}]"

    if res.statusCode == 200
      sendRobotResponse msg, title, json.pubImg, link
    else
      robot.logger.debug res
      robot.logger.error "Upload Error Code: #{res.statusCode}"
      msg.send "#{title} - [Access Error] - #{link}"
{% endhighlight %}

The Grafana API key is provided to the script by an environment variable and the newly added environment variable `HUBOT_USE_GRAFANA_IMAGES` determines whether or not to use the `customFetchAndUpload` code-path. The full diff can be found [here](https://github.com/criticalmass/hubot-grafana/commit/a802a816b21f61b1cf4d61f0f4967fcd97fb9bf8#diff-8387f8787e3a34b1530cc6f1a1ff23e2).

As you can see, the `/grafana-images` uri is hard-coded. That's because the route used by `grafana-images` is hard-coded. Also, note that the necessary authentication token is passed along with the json payload. In many ways this function is treating `grafana-images` as a proxy for Grafana.

Another addition to note is the help text I added to the hubot script. You can ask the bot "`graf help`" and it'll respond with increasingly complex query samples. Yay for user friendliness!

## grafana-images
Following my experience with [http-stats-collector]({% post_url 2015-03-29-golang-http-stats-collector %}), Golang seemed like a good choice for the small application. It acts as a proxy and therefore expects only two things: a valid API token and json payload containing the full Grafana panel render url. To give more context to what's happening, here's an http call diagram:

The http calls required for hubot-grafana using grafana-images numbered by sequence

The `customFetchAndUpload` function described above is call #4. From there `grafana-images` will fetch (#5 & #6), save, and return a sharable image url via json (#7). Here's a snippet from `grafana-images`' [handlers.go](https://github.com/lanyonm/grafana-images/blob/master/handlers.go):

{% highlight go %}
// Fetch image
var client = http.Client{}
req, err := http.NewRequest("GET", image.Url, nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", token)
resp, err := client.Do(req)
if err != nil {
  log.Fatalf("http.Get -> %v", err)
  w.WriteHeader(500)
  return
}
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
  log.Fatalf("ioutil.ReadAll -> %v", err)
  w.WriteHeader(500)
  return
}

// Save image
fileName := fmt.Sprintf("%x.png", md5.Sum(data))
resp.Body.Close()
err = ioutil.WriteFile(fmt.Sprintf("%s/%s", imagePath, fileName), data, 0666)
if err != nil {
  log.Fatalf("ioutil.WriteFile -> %v", err)
  w.WriteHeader(500)
  return
}

// Return image location
w.Header().Set("Content-Type", "application/json")
fmt.Fprintf(w, "{\"pubImg\":\"%s/%s\"}", imageHost, fileName)
{% endhighlight %}

There are several variables assumed to be set:

* `image` - the requested `imageUrl` from the json
* `token` - the contents of the `Authorization` header
* `imagePath` - a path on disk to store the saved images
* `imageHost` - the host used in the building the json response

If everything is configured correctly, the Grafana dashboard panel will be saved to disk and the json sent back to `hubot-grafana`. Further detail can be found [on GitHub](https://github.com/lanyonm/grafana-images). I tired to make all the error messages helpful and actionable, but if you find an error condition that isn't well explained, please open a GitHub issue.

### Security
You may have noticed that the app very simply downloads whatever is specified at `imageUrl` and saves it as a png. This can be dangerous given that nothing checks to ensure that the contents are in-fact an image and not an exploit. _Take care_ to only allow specific traffic to make requests of `grafana-images`. I may add a check via Golang's png package to ensure proper encoding, but it may be quite some time before that happens (pull requests welcome).

## Nginx Config
As mentioned above, I used Nginx to proxy grafana-server. I also use it to proxy `grafana-images` and serve the saved panel images. Here's a sample conf that should would for this purpose:

{% highlight nginx %}
# the grafana-server config has been omitted
upstream grafana-images {
  server <IP_ADDRESS>:8080;
}

server {
  # excerpt for grafana-images
  location /grafana-images {
    proxy_pass http://grafana-images;
    allow <IP_ADDRESS>; # ip of server running hubot
    deny all;
  }
  location /saved-images {
    root /opt;
  }
}
{% endhighlight %}

Note that the `imageHost` passed to `grafana-images` is the FQDN _plus_ the location of the saved images. The value used will be dependent on the web server hosting the saved images.

## Other Uses
Because `grafana-images` exposes its functionality over a simple HTTP API, expanding its purpose should be straightforward. The app expects an `"Authorization: Bearer grafana-token-goes-here"` header and a json payload:

{% highlight json %}
{
  "imageUrl": "https://grafana.example.com/render/dashboard-solo/db/sample-dashboard/?panelId=5&width=1000&height=500&from=now-6h&to=now&var-server=test-server"
}
{% endhighlight %}

### Sensu Notifications
At work we have incorporated Grafana panel image embedding functionality into our Sensu HipChat handler. We started with the [Sensu community HipChat handler](https://raw.githubusercontent.com/sensu/sensu-community-plugins/e2286b69eda081b4c59226667245e95f4c3a45e1/handlers/notification/hipchat.rb) and modified the message body heavily for our purposes.

The code to add Grafana panel images to Sensu HipChat notifications is roughly:

{% highlight ruby %}
if @event['check']['graph_image']
  # do some work to get the static image from grafana-images
  uri = URI.parse('https://grafana.example.com/grafana-images')
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true
  request = Net::HTTP::Post.new('/grafana-images')
  request.add_field('Content-Type', 'application/json;charset=utf-8')
  request.add_field('Authorization', 'Bearer grafana-token-goes-here')
  request.body = { 'imageUrl' => "#{@event['check']['graph_image']}&from=now-6h&to=now" }.to_json

  begin
    response = http.request(request)
    public_image = JSON.parse(response.body)['pubImg']
    message << "

"
  rescue StandardError => e
    message << " - [graph_image fetch failed (#{e})]"
  end
end
{% endhighlight %}

The `@event['check']['graph_image']` value is assumed to be a valid dashboard panel render url _without_ the from/to times: `https://grafana.example.com/render/dashboard-solo/db/sample-dashboard/?panelId=5&var-server=test-server&width=1000&height=500`. The `panelId` is can be obtained from the UI of the dashboard.

We manage our infrastructure with Chef and it creates all the Sensu checks, thus allowing us to programmatically build the checks. We add a `graph_image` attribute to the check that contains a panel render url associated with the metric(s) that can help provide context to the Sensu notification. Chef can give the FQDN of the Grafana node as well as the values for template attributes, so it all comes together quite cleanly.

## Other Considerations
One thing not handled by `grafana-images` is saved image retention. You'll need to create a purge policy that works for you. Once I've figured out how we're going to handle that, I'll add it here. :)


text:
# Redis development db folder

## Backup RedisToGo production data

Run

    heroku config

to get RedisToGo auth data.

Copy development configuration to a new file

    cp config/redis.conf config/redis_backup.conf

Update configuration of replica instance

    slaveof <masterip> <masterport>
    masterauth <master-password>

where `<masterip>`, `<masterport>` and `<master-password>` are taken from `REDISTOGO_URL` heroku config attribute.

Update configuration of database filename

    dbfilename production_dump_<date>.rdb

to avoid overwriting of development database dump.

Start Redis on a local machine (or the machine you wish to export to) using the configuration file that was just set up

    redis-server config/redis_backup.conf

See more at https://redistogo.com/documentation/exporting

repository: potomak/drawbang

gha_language: Ruby

repo_name: potomak/drawbang


text:
# Hello World Example

> This is a simple Hello World example to show how easy it is to start using RE:DOM.

```json
{
    "el": "iframe",
    "attributes": {
        "src": "https://jsfiddle.net/mauroreisvieira/n3m5vajz/embedded/result,js,css",
        "title": "Hello World",
        "allowfullscreen": "allowfullscreen",
        "frameborder": "0"
    }
}
```

repository: redom/redom-docs

repo_name: redom/redom-docs


text:
# Scripts User Guide

This README documents:
* What update-crd.sh and update-generated-code.sh do
* When and how to use them

## update-generated-code.sh

This is the script to update clientset/informers/listers and API deepcopy code using [code-generator](https://github.com/kubernetes/code-generator).

Make sure to run this script after making changes to /client/apis/volumesnapshot/v1beta1/types.go.

Pre-requisites for running update-generated-code.sh:

* GOPATH=~/go

* Ensure external-snapshotter repository is at ~/go/src/github.com/kubernetes-csi/external-snapshotter

* git clone https://github.com/kubernetes/code-generator.git under ~/go/src/k8s.io

* git checkout to version v0.19.0
```bash
git checkout v0.19.0
```

* Ensure the path exist ${GOPATH}/src/k8s.io/code-generator/generate-groups.sh

Run: ./hack/update-generated-code.sh from the client directory.

Once you run the script, you will get an output as follows:
```bash
Generating deepcopy funcs
Generating clientset for volumesnapshot:v1beta1 at github.com/kubernetes-csi/external-snapshotter/client/v3/clientset
Generating listers for volumesnapshot:v1beta1 at github.com/kubernetes-csi/external-snapshotter/client/v3/listers
Generating informers for volumesnapshot:v1beta1 at github.com/kubernetes-csi/external-snapshotter/client/v3/informers

```

## update-crd.sh

This is the script to update CRD yaml files under /client/config/crd/ based on types.go file.

Make sure to run this script after making changes to /client/apis/volumesnapshot/v1beta1/types.go.

Follow these steps to update the CRD:

* Run ./hack/update-crd.sh from client directory, new yaml files should have been created under ./config/crd/

* Add api-approved.kubernetes.io annotation value in all yaml files in the metadata section with the PR where the API is approved by the API reviewers. The current approved PR for snapshot beta API is https://github.com/kubernetes-csi/external-snapshotter/pull/139. Refer to https://github.com/kubernetes/enhancements/pull/1111 for details about this annotation.

* Remove any metadata sections from the yaml file which does not belong to the generated type.
For example, the following command will add a metadata section for a nested object, remove any newly added metadata sections. TODO(xiangqian): this is to make sure the generated CRD is compatible with apiextensions.k8s.io/v1. Once controller-gen supports generating CRD with apiextensions.k8s.io/v1, switch to use the correct version of controller-gen and remove the last step from this README.
```bash
./hack/update-crd.sh; git diff
+        metadata:
+          description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata'
```

* Update the restoreSize property to string in snapshot.storage.k8s.io_volumesnapshots.yaml

The generated yaml file contains restoreSize property anyOf as described below:

```bash
            restoreSize:
              anyOf:
              - type: integer
              - type: string
              description: restoreSize represents the complete size of the snapshot
                in bytes. In dynamic snapshot creation case, this field will be filled
                in with the "size_bytes" value returned from CSI "CreateSnapshotRequest"
                gRPC call. For a pre-existing snapshot, this field will be filled
                with the "size_bytes" value returned from the CSI "ListSnapshots"
                gRPC call if the driver supports it. When restoring a volume from
                this snapshot, the size of the volume MUST NOT be smaller than the
                restoreSize if it is specified, otherwise the restoration will fail.
                If not specified, it indicates that the size is unknown.
```

Update the restoreSize property to use type string only:

```bash

            restoreSize:
              type: string
              description: restoreSize represents the complete size of the snapshot
                in bytes. In dynamic snapshot creation case, this field will be filled
                in with the "size_bytes" value returned from CSI "CreateSnapshotRequest"
                gRPC call. For a pre-existing snapshot, this field will be filled
                with the "size_bytes" value returned from the CSI "ListSnapshots"
                gRPC call if the driver supports it. When restoring a volume from
                this snapshot, the size of the volume MUST NOT be smaller than the
                restoreSize if it is specified, otherwise the restoration will fail.
                If not specified, it indicates that the size is unknown.

```


text:
jl-tether (formerly ng-tether)
=========

[Tether](http://tether.io) wrapper for Angular, so you can use it in directives declaratively. **Tether is included**

Not to be mistaken for a very cool project called [`angular-tether`](https://github.com/nissoh/angular-tether) that is in the process of implementing Tether in angular.

# Install

`bower install jl-tether` or `npm install jl-tether`

# Usage

Include `jlTether` as an angular module dependency, then

```html
<div jl-tether jl-tether-options="{
    target: '.target',
    attachment: 'top left',
    targetAttachment: 'top right'
}"></div>
```

or

```html
<div jl-tether
 jl-tether-target=".target"
 jl-tether-attachment="top left"
 jl-tether-target-attachment="top right"></div>
```

You can grab a reference to the Tether object if you want by passing a string into `jl-tether`.

```html
<div jl-tether="ngTetherReference"
 jl-tether-target=".target"
 jl-tether-attachment="top left"
 jl-tether-target-attachment="top right"></div>
```

`ngTetherReference` will now be in `$scope`. You can do things like

```html
<div ng-click="ngTetherReference.destroy()">kind of a button</div>
```

To destroy it.

You can see the [Tether docs](http://tether.io) for a full list of options and api functions.

# Building

`npm run deps` to get the dependencies
`npm run dist` to build
`npm run watch` to continuously build

repository: KDPInnovations/angular-jl-tether

repo_name: KDPInnovations/angular-jl-tether


text:
WooCommerce.NET
======================

A Brief Intro
-------------------

WooCommerce.NET(Rx) is a .NET library for calling WooCommerce REST API v2 in Windows 8.1 APP or Windows Phone 8.1 APP (NOT included Desktop APP).

[Visit WooCommerce](http://www.woothemes.com/woocommerce/)
[Visit WooCommerce REST API](http://woothemes.github.io/woocommerce-rest-api-docs/)

If you have any question or would like to contribute code, please email to<EMAIL_ADDRESS>
Usage
-------------------

```cs
RestAPI rest = new RestAPI("http://www.yourstore.co.nz/wc-api/v2/", "<WooCommerce Key>", "<WooCommerce Secret");
WCObject wc = new WCObject(rest);
var products = await wc.GetProducts();
```

Version History
-------------------
* v0.1.1 Minor update
  1. Use the same way to trim json string.
  2. Implement Customer Download call.
  3. Implement Order Refund call.
* v0.1 First working version
  1. Implement only GET method for most REST API calls.
  2. Supports WooCommerce REST API version 2.


text:
# 22 - [ERC20 approve() race condition](ERC20%20approve()%20race%20condition.md)
Use `safeIncreaseAllowance()` and `safeDecreaseAllowance()` from OpenZeppelin’s `SafeERC20` implementation to prevent race conditions from manipulating the allowance amounts. (see [here](https://swcregistry.io/docs/SWC-114))

___
## Slide Screenshot
![022.png](../../images/4.%20Pitfalls%20and%20Best%20Practices%20101/022.png)
___
## Slide Text
- ERC20 `approve()` -> 	Race-condition
- `approve(100)` -> `approve(50)`
- Allowance Decrease
	- Front-run -> Spend 150
- `increaseAllowance()`
- `decreaseAllowance()`
___
## References
- [Youtube Reference](https://youtu.be/fgXuHaZDenU?t=112)
___
## Tags

url: https://raw.githubusercontent.com/0xRektora/secureum-mind_map/c15a93fc9714de59e6847dbc6e5f99e32a5d9d31/content/4. Pitfalls and Best Practices 101/ERC20 approve() race condition.md

filename: ERC20 approve() race condition.md


text:
# torVRt
VR training Application for Soccergoalies in Unity

![Image of VR-User](/images/GoalieScreenshot.jpg)

The project “torVRt” was created by four students of the University of Applied Sciences
Cologne in collaboration with the German Sport University Cologne and the youth team of
1.FC Köln .

“torVRt” aims to develop a virtual reality environment in which a football goalkeeping
scenario is simulated, where the user is able to track his/her motion data. This data is then
saved in a generic file format for later analysis. The simulation is adjusted particularly to
trained athletics and therefore can be used to trace training progress. Furthermore the user
is being provided with reality-simulating visuals, physics and haptics for extra immersion.

![Image of VR-User](/images/20181025_163757.jpg)

![Image of VR-User](/images/20190510_115933.jpg)

torVRt Team:
Christian Redekop<EMAIL_ADDRESS>Philipp Bzdok<EMAIL_ADDRESS>Alex Fischer<EMAIL_ADDRESS>Ole Aurich<EMAIL_ADDRESS>
More Information:

https://cg.web.th-koeln.de/torvrt-entwicklung-eines-torwarttrainings-zur-schulung-von-antizipation-und-reaktion-in-virtueller-realitat/

https://fis.dshs-koeln.de/portal/de/publications/torvrt--entwicklung-eines-torwarttrainings-zur-schulung-von-antizipation-und-reaktion-in-virtueller-realitat(3efa0d7f-d77d-4e4d-b943-fcafcc041d6f).html

repository: chrisrede/torVRt

repo_name: chrisrede/torVRt


text:
# Code Style

## Python

**Consistency is the main code style guideline** and if in doubt, try to find a similar existing code and style
your code the same. Our code style is very similar to [PEP8](https://www.python.org/dev/peps/pep-0008/) with few
more details.

Indent with 4 spaces. Never with tabs. No trailing whitespace.

**Be verbose**. Always fully spell out any part of the function, class, or variable name.

### Blank lines

Use blank lines to organize long code blocks into units of what they do. Often a block is preceded by a
comment, explaining what the block does.

This will help someone new understand the code quicker when they read it.  Imagine you were writing the code
to be published in an article and you try to make everything as easy to learn as possible. It's the same
here, because we assume our teammates are going to use the code after us.

Comments always have one blank line before them, except when they are the first line of an indented block of code.

```python
for item in items:
    # No new line above this comment.
    ...

# New line above this comment.
...
```

Do not have multiple (two or more) blank lines beyond what is expected by PEP8.

### Line wrapping

We **do not wrap lines** except when logically reasonable or when it greatly increases readability
(we still wrap logically and not just at the end of the line).

We do wrap comments at the 120 characters right margin. If the comment wraps to two lines, balance the lines
so they are both approximately the same length.

The closing brace/bracket/parenthesis on multi-line constructs should align with the first character of the
line that starts the multi-line construct, as in:

```python
my_list = [
    1, 2, 3,
    4, 5, 6,
]
result = some_function_that_takes_arguments(
    'a', 'b', 'c',
    'd', 'e', 'f',
)
```

Always include a trailing comma in such cases.

When defining a function which takes too many arguments to leave all of them in one line, use hanging indentation:

```python
def some_function_that_takes_arguments(
    a, b, c,
    d, e, f,
):
    return a + b + c + d + e + f
```

[Black](https://github.com/python/black) generally formats according to this style so you can use
it to help you.

### Strings

Use `'single_quote_strings'` for constant strings and `"double_quote_strings"` for any string shown to the
user (like exception messages, or warning). A general guideline is: if a string might be ever translated to a
different language, use double quotes for it.

This means all dictionary key names should use single quotes.

Always use keyword based string formatting. When only simple variable name interpolation is being done,
[f-Strings](https://realpython.com/python-f-strings/) are the preferred format.

```python
f"Value is '{value}' and message is '{message}'."
```

If longer expressions are being computed, then `.format()` should be used, with keywords.

```python
"This complicated string lists all values: {values}".format(
    values=[x.lowercase() for x in values],
)
```

Inline values wrap inside messages with `'`. If value is at the end of the message, there is no
need for wrapping and also no need for trailing dot.

When creating logging statements, use `%`-based format, also with keyword based arguments.

```python
logger.misc("Step '%(requirement)s'.", {'requirement': requirement})
```

### Logging

Use [Python logging facility](https://docs.python.org/3/library/logging.html) for all output and never use
`print()` (except when used in CLI commands). Obtain `logger` instance by using `__name__`, at the very
beginning of the module:

```python
import logging

logger = logging.getLogger(__name__)
```

### Imports

Imports should be **just modules** divided into multiples sections, in order from more global to more local, separated by empty line:
 * core Python packages
 * external Python packages
 * non-local imports (for example, imports from some other top-level `d3m.` module)
 * local relative imports for the current module and sub-modules

Inside each section, imports should be ordered alphabetically, first based on package name, then on model imported.
Each package should be on its own line, but importing multiple modules from the same package should be in one line.

Example:

```python
import os
import time

import numpy
from sklearn import metrics, model_selection

from d3m import exceptions
from d3m.metadata import problem

from . import data
```

If you are importing multiple modules with the same name from different package, rename more global one with a prefix
of the package:

```python
from sklearn import metrics as sklearn_metrics

from d3m import metrics
```

### Docstrings

Every class, method and function has a docstring with description. Docstrings should be split into multiple lines
when needed to improve readability. Docstrings should use the [numpy style](https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard)
to document arguments, return value and everything else, which means also using [ReST/Sphinx](http://www.sphinx-doc.org/en/stable/rest.html)
syntax for formatting.

Always separate the docstring from the rest of the code with an empty line, and have `"""` on their own line, even
for one-line docstrings.

We use a custom [Python metaclasses](https://docs.python.org/3/reference/datamodel.html#metaclasses) for d3m classes which
[automatically inherits or extends docstrings from parent methods](https://github.com/meowklaski/custom_inherit):

```python
from d3m import utils

class MyBaseClass(metaclass=utils.Metaclass):
    pass

class MyAbstractBaseClass(metaclass=utils.AbstractMetaclass):
    pass
```

### Comments

Both standalone one-sentence one-line comments and multi-sentence comments should have grammatically correct punctuation.
For formatting, use [ReST/Sphinx](http://www.sphinx-doc.org/en/stable/rest.html) syntax.

- When you are explaining what the code will do, end the sentence with a dot.

  ```python
  # Calculate total value.
  value = quantity * price
  ```
- Short after-the-line comments (which should not be sentences) do not have an ending dot:

  ```python
  sleep(10)  # seconds
  ```

- Titles that are separating sections of code are also not a sentence (no dot).

  ```python
  ### Vector operations ###

  def dot_product(vector1, vector2):
      ...

  def cross_product(vector1, vector2):
      ...

  ### Matrix operations ###

  def transform(vector, matrix):
      ...
  ```

If TODO comments cannot be a short one-line with grammatically correct punctuation, then split it into multiple lines in this way:

```python
# TODO: Short description of a TODO.
#       A longer description of what we could potentially do here. Maybe we
#       could do X or Y, but Y has this consequences. We should probably
#       wait for server rendering feature to be implemented.
#       See: https://github.com/example/project/issues/123
```

Try to keep the formatting of the first line exactly as shown above so that it is easier parsed by IDEs.
Including the space after `#` and space after `:`.

## Code repository

Commit often and make sure each commit is a rounded change. Do not squash commits, unless that helps making a set of commits
into a clearer change. We leave unsuccessful attempts in the repository because maybe in the future we can come back to them
and use them, maybe in a different context or way.

For almost all changes to the repository, we make first a feature branch from `devel` branch. We make all necessary changes in
that new branch, potentially make multiple commits. We make a merge request against the `devel` branch for the change
to be reviewed and merged. We should make a merge request even before all changes are finished so that others can comment
and discuss the development. We can continue adding more commits to this branch even after the merge request has been made
and GitLab will update the merge request automatically. Until a merge request is finished and is deemed ready to be merged
by its author, merge request's title should be prefixed with `WIP:` so that it is clear that it is not yet meant
to be merged (and thoroughly reviewed). Make sure you include also a change to the [changelog](#changelog) in your merge request.

### Changelog

We are maintaining `HISTORY.md` file where we document changes to the project so that
everyone involved can have one location where they can see what has changed and what
they might adapt in their code or the way they are working on the project.

### Commit messages

Commit messages should be descriptive and full sentences, with grammatically correct punctuation.
If possible, they should reference relevant tickets (by appending something like `See #123.`) or even close them
(`Fixes #123.`). GitLab recognizes that. If longer commit message is suitable (which is always a good thing),
first one line summary should be made (50 characters is a soft limit), followed by an empty line, followed
by a multi-line message:

    Added artificially lowering of the height in IE.

    In IE there is a problem when rendering when user is located
    higher than 2000m. By artificially lowering the height rendering
    now works again.

    Fixes #123.


text:
---
page_title: "genesyscloud_routing_queue Resource - terraform-provider-genesyscloud"
subcategory: ""
description: |-
  Genesys Cloud Routing Queue
---
# genesyscloud_routing_queue (Resource)

Genesys Cloud Routing Queue

## API Usage
The following Genesys Cloud APIs are used by this resource. Ensure your OAuth Client has been granted the necessary scopes and permissions to perform these operations:

* [POST /api/v2/routing/queues](https://developer.mypurecloud.com/api/rest/v2/routing/#post-api-v2-routing-queues)
* [GET /api/v2/routing/queues/{queueId}/members](https://developer.mypurecloud.com/api/rest/v2/routing/#get-api-v2-routing-queues--queueId--members)
* [GET /api/v2/routing/queues/{queueId}](https://developer.mypurecloud.com/api/rest/v2/routing/#get-api-v2-routing-queues--queueId-)
* [POST /api/v2/routing/queues/{queueId}/members](https://developer.mypurecloud.com/api/rest/v2/routing/#post-api-v2-routing-queues--queueId--members)
* [PATCH /api/v2/routing/queues/{queueId}/members/{memberId}](https://developer.mypurecloud.com/api/rest/v2/routing/#patch-api-v2-routing-queues--queueId--members--memberId-)
* [DELETE /api/v2/routing/queues/{queueId}](https://developer.mypurecloud.com/api/rest/v2/routing/#delete-api-v2-routing-queues--queueId-)
* [GET /api/v2/routing/queues/{queueId}/wrapupcodes](https://developer.mypurecloud.com/api/rest/v2/routing/#get-api-v2-routing-queues--queueId--wrapupcodes)
* [POST /api/v2/routing/queues/{queueId}/wrapupcodes](https://developer.mypurecloud.com/api/rest/v2/routing/#post-api-v2-routing-queues--queueId--wrapupcodes)
* [DELETE /api/v2/routing/queues/{queueId}/wrapupcodes/{codeId}](https://developer.mypurecloud.com/api/rest/v2/routing/#delete-api-v2-routing-queues--queueId--wrapupcodes--codeId-)

## Example Usage

```terraform
resource "genesyscloud_routing_queue" "test_queue" {
  name                              = "Test Queue"
  division_id                       = genesyscloud_auth_division.home.id
  description                       = "This is a test queue"
  acw_wrapup_prompt                 = "MANDATORY_TIMEOUT"
  acw_timeout_ms                    = 300000
  skill_evaluation_method           = "BEST"
  queue_flow_id                     = "34c17760-7539-11eb-9439-0242ac130002"
  whisper_prompt_id                 = "3fae0821-2a1a-4ebb-90b1-188b65923243"
  auto_answer_only                  = true
  enable_transcription              = true
  enable_manual_assignment          = true
  calling_party_name                = "Example Inc."
  outbound_messaging_sms_address_id = "c1bb045e-254d-4316-9d78-cea6849a3db4"
  outbound_email_address {
    domain_id = genesyscloud_routing_email_domain.main.id
    route_id  = genesyscloud_routing_email_route.support.id
  }
  media_settings_call {
    alerting_timeout_sec      = 30
    service_level_percentage  = 0.7
    service_level_duration_ms = 10000
  }
  routing_rules {
    operator     = "MEETS_THRESHOLD"
    threshold    = 9
    wait_seconds = 300
  }
  bullseye_rings {
    expansion_timeout_seconds = 15.1
    skills_to_remove          = [genesyscloud_routing_skill.test-skill.id]
  }
  default_script_ids = {
    EMAIL = "153fcff5-597e-4f17-94e5-17eac456a0b2"
    CHAT  = "98dff282-c50c-4c36-bc70-80b058564e1b"
  }
  members {
    user_id  = genesyscloud_user.test-user.id
    ring_num = 2
  }
  wrapup_codes = [genesyscloud_routing_wrapupcode.test-code.id]
}
```

## Schema

### Required

- **name** (String) Queue name.

### Optional

- **acw_timeout_ms** (Number) The amount of time the agent can stay in ACW. Only set when ACW is MANDATORY_TIMEOUT, MANDATORY_FORCED_TIMEOUT or AGENT_REQUESTED.
- **acw_wrapup_prompt** (String) This field controls how the UI prompts the agent for a wrapup (MANDATORY | OPTIONAL | MANDATORY_TIMEOUT | MANDATORY_FORCED_TIMEOUT | AGENT_REQUESTED). Defaults to `MANDATORY_TIMEOUT`.
- **auto_answer_only** (Boolean) Specifies whether the configured whisper should play for all ACD calls, or only for those which are auto-answered. Defaults to `true`.
- **bullseye_rings** (Block List, Max: 6) The bullseye ring settings for the queue. (see [below for nested schema](#nestedblock--bullseye_rings))
- **calling_party_name** (String) The name to use for caller identification for outbound calls from this queue.
- **calling_party_number** (String) The phone number to use for caller identification for outbound calls from this queue.
- **default_script_ids** (Map of String) The default script IDs for each communication type. Communication types: (CALL | CALLBACK | CHAT | COBROWSE | EMAIL | MESSAGE | SOCIAL_EXPRESSION | VIDEO | SCREENSHARE)
- **description** (String) Queue description.
- **division_id** (String) The division to which this queue will belong. If not set, the home division will be used.
- **enable_manual_assignment** (Boolean) Indicates whether manual assignment is enabled for this queue. Defaults to `false`.
- **enable_transcription** (Boolean) Indicates whether voice transcription is enabled for this queue. Defaults to `false`.
- **id** (String) The ID of this resource.
- **media_settings_call** (Block List, Max: 1) Call media settings. (see [below for nested schema](#nestedblock--media_settings_call))
- **media_settings_callback** (Block List, Max: 1) Callback media settings. (see [below for nested schema](#nestedblock--media_settings_callback))
- **media_settings_chat** (Block List, Max: 1) Chat media settings. (see [below for nested schema](#nestedblock--media_settings_chat))
- **media_settings_email** (Block List, Max: 1) Email media settings. (see [below for nested schema](#nestedblock--media_settings_email))
- **media_settings_message** (Block List, Max: 1) Message media settings. (see [below for nested schema](#nestedblock--media_settings_message))
- **media_settings_social** (Block List, Max: 1) Social media settings. (see [below for nested schema](#nestedblock--media_settings_social))
- **media_settings_video** (Block List, Max: 1) Video media settings. (see [below for nested schema](#nestedblock--media_settings_video))
- **members** (Set of Object) Users in the queue. If not set, this resource will not manage members. (see [below for nested schema](#nestedatt--members))
- **outbound_email_address** (Block List, Max: 1) The outbound email address settings for this queue. (see [below for nested schema](#nestedblock--outbound_email_address))
- **outbound_messaging_sms_address_id** (String) The unique ID of the outbound messaging SMS address for the queue.
- **queue_flow_id** (String) The in-queue flow ID to use for conversations waiting in queue.
- **routing_rules** (Block List, Max: 6) The routing rules for the queue, used for routing to known or preferred agents. (see [below for nested schema](#nestedblock--routing_rules))
- **skill_evaluation_method** (String) The skill evaluation method to use when routing conversations (NONE | BEST | ALL). Defaults to `ALL`.
- **timeouts** (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- **whisper_prompt_id** (String) The prompt ID used for whisper on the queue, if configured.
- **wrapup_codes** (Set of String) IDs of wrapup codes assigned to this queue. If not set, this resource will not manage wrapup codes.

### Nested Schema for `bullseye_rings`

Required:

- **expansion_timeout_seconds** (Number) Seconds to wait in this ring before moving to the next.

Optional:

- **skills_to_remove** (Set of String) Skill IDs to remove on ring exit.

### Nested Schema for `media_settings_call`

Required:

- **alerting_timeout_sec** (Number) Alerting timeout in seconds. Must be >= 7
- **service_level_duration_ms** (Number) Service Level target in milliseconds. Must be >= 1000
- **service_level_percentage** (Number) The desired Service Level. A float value between 0 and 1.

### Nested Schema for `media_settings_callback`

Required:

- **alerting_timeout_sec** (Number) Alerting timeout in seconds. Must be >= 7
- **service_level_duration_ms** (Number) Service Level target in milliseconds. Must be >= 1000
- **service_level_percentage** (Number) The desired Service Level. A float value between 0 and 1.

### Nested Schema for `media_settings_chat`

Required:

- **alerting_timeout_sec** (Number) Alerting timeout in seconds. Must be >= 7
- **service_level_duration_ms** (Number) Service Level target in milliseconds. Must be >= 1000
- **service_level_percentage** (Number) The desired Service Level. A float value between 0 and 1.

### Nested Schema for `media_settings_email`

Required:

- **alerting_timeout_sec** (Number) Alerting timeout in seconds. Must be >= 7
- **service_level_duration_ms** (Number) Service Level target in milliseconds. Must be >= 1000
- **service_level_percentage** (Number) The desired Service Level. A float value between 0 and 1.

### Nested Schema for `media_settings_message`

Required:

- **alerting_timeout_sec** (Number) Alerting timeout in seconds. Must be >= 7
- **service_level_duration_ms** (Number) Service Level target in milliseconds. Must be >= 1000
- **service_level_percentage** (Number) The desired Service Level. A float value between 0 and 1.

### Nested Schema for `media_settings_social`

Required:

- **alerting_timeout_sec** (Number) Alerting timeout in seconds. Must be >= 7
- **service_level_duration_ms** (Number) Service Level target in milliseconds. Must be >= 1000
- **service_level_percentage** (Number) The desired Service Level. A float value between 0 and 1.

### Nested Schema for `media_settings_video`

Required:

- **alerting_timeout_sec** (Number) Alerting timeout in seconds. Must be >= 7
- **service_level_duration_ms** (Number) Service Level target in milliseconds. Must be >= 1000
- **service_level_percentage** (Number) The desired Service Level. A float value between 0 and 1.

### Nested Schema for `members`

Optional:

- **ring_num** (Number)
- **user_id** (String)

### Nested Schema for `outbound_email_address`

Required:

- **domain_id** (String) Unique ID of the email domain. e.g. "test.example.com"
- **route_id** (String) Unique ID of the email route.

### Nested Schema for `routing_rules`

Optional:

- **operator** (String) Matching operator (MEETS_THRESHOLD | ANY). MEETS_THRESHOLD matches any agent with a score at or above the rule's threshold. ANY matches all specified agents, regardless of score. Defaults to `MEETS_THRESHOLD`.
- **threshold** (Number) Threshold required for routing attempt (generally an agent score). Ignored for operator ANY.
- **wait_seconds** (Number) Seconds to wait in this rule before moving to the next. Defaults to `5`.

### Nested Schema for `timeouts`

Optional:

- **default** (String)


text:
---
Module Name: CompareString
Module Guid: e67059a8-d5a7-4113-946a-d8e2341d7168
Download Help Link: {{Please enter FwLink manually}}
Help Version: <IP_ADDRESS>
Locale: en-US
---

# CompareString Module
## Description
CompareString is a module that contains a single function, `Compare-String.` This function provides a variety of string matching and comparison operations for comparing the contents of two Strings.

## CompareString Cmdlets
### [Compare-String](Compare-String.md)
Compares two string variables. By default, this provides only the index of the first change, but several parameters are available to provide extended analysis.

repository: replicaJunction/CompareString

repo_name: replicaJunction/CompareString


text:
# @package_title@

@description@

## What's inside the package

Includes the following core components.

- [@component_1@](https://pub.dev/documentation/@package_name@/latest/@package_name@/<EMAIL_ADDRESS>- [@component_2@](https://pub.dev/documentation/@package_name@/latest/@package_name@/<EMAIL_ADDRESS>- [@component_3@](https://pub.dev/documentation/@package_name@/latest/@package_name@/<EMAIL_ADDRESS>
Check out all the components in detail [here](https://pub.dev/documentation/@package_name@/latest/@package_name@/<EMAIL_ADDRESS>
## How to use

@how_to_use@

To learn more, move on to the [example section](https://pub.dev/packages/@package_name@/example) or check out these dedicated [examples in github](https://github.com/zamstation/@package_name@/blob/main/example/lib).

## Status
[![Build](https://github.com/zamstation/@package_name@/actions/workflows/build_workflow.yaml/badge.svg)](https://github.com/zamstation/<EMAIL_ADDRESS>
## Contributors
- [Amsakanna](https://github.com/amsakanna)

## License
[BSD 3-Clause License](https://github.com/zamstation/@package_name@/blob/main/LICENSE)

gha_language: Shell


text:
---
title: "Latest Blog Post on My Postdoctoral Work #1"
last_modified_at: 2022-03-15
comments: true
categories:
  - blog
tags:
  - data curation
  - data visualization
  - programming
  - Python
  - Dash
---

As part of my postdoc work, I wrote [a blog post hosted on the Carnegie Mellon University Libraries' website.](https://www.library.cmu.edu/about/news/2022-03/energy-social-science-data-curation-1) This is the first post in a four-part series that introduces my postdoc work as a CLIR postdoctoral fellow at CMU. In this post, I talk about how I’ve used a scholarly information database (Dimensions) to help the Wilton E. Scott Institute for Energy Innovation to more efficiently discover and track the research output of its faculty affiliates.
Stay tuned for future posts.


text:
---
title: Unix Basics
author: Anugrah SR
date: 2020-09-17 02:00:00 +0800
categories: [Bugbounty, 30daysofPentesterlab]
tags: [Bugbounty, unix]
math: true
---
# Day 1
## Basic unix commands

|   Command      |     Description      |
| ------------- |:-------------:|
|   `ls`        |Lists all files and directories |
|`ls -a`   | Lists hidden files as well  |
|`cd`   |  To change to a particular directory |
| `cd ..`|Move one level up   |
|`cat filename`   | Displays the file content  |

Learn basic bash scripting from
*  https://linuxconfig.org/bash-scripting-tutorial-for-beginners
* https://www.tutorialspoint.com/unix/shell_scripting.htm
* https://devhints.io/bash
* https://overthewire.org/wargames/bandit/

**find**

Find `.bash_history` in `/home` directory
```bash
find /home -name .bash_history
```
Finding with grep
```bash
find /home -name .bashrc -exec grep [PATTERN] {} \;
```
**grep**
```bash
find . -name .bash_history -exec grep -A 1 '^xyzfindme' {} \;
```
`^` for starting

**/tmp**

tmp folder may contain secrets

```bash
ls -ld /tmp
drwxrwxrwt 1 root root 4096 Sep 15 13:10 /tmp
```
* d : directory
* rwx: read, write, executable
* t: sticky bit

```bash
#unzip
gzip -d xyz.tgz
#uncompress tar
tar -xf xyz.tar
```
```bash
#Decompress bzip tar file
#j if bzip
tar xvjf xyz.tbz
```
```bash
#z if gz
tar xvzf file.tar.gz
```
```bash
#uncompress bz2
bzip2 -d your-filename-here.bz2
```
`file xyz` can tell what file it is

`strings` extract strings from a file

**Cronjob**

you can find the cron jobs run daily in `/etc/cron.daily/`

```bash
#!/bin/bash
tar -zcvf /tmp/backup.tgz /home/victim
openssl enc -aes256 -k PASS -in /tmp/backup.tgz  -out /tmp/backup.tgz.enc
rm /tmp/backup.tgz
```
Reverse the process Using
```bash
openssl aes-256-cbc -d -in backup.tgz.enc -out backup.tgz
enter aes-256-cbc decryption password:
#PASS
tar -xvzf backup.tgz
```
```bash
#gunzip
cp backup test.gz
gunzip test.gz
tar -xvf test.gz
```


text:
## AI

- [How to build your own AlphaZero AI using Python and Keras](https://medium.com/applied-data-science/how-to-build-your-own-alphazero-ai-using-python-and-keras-7f664945c188)
- [Vicarious - AI for the robot age](https://www.vicarious.com)

## AWS

- [The Open Guide to Amazon Web Services](https://github.com/open-guides/og-aws)

## Blockchain

- [Blockchains from a Distributed Computing Perspective](https://cs.brown.edu/courses/csci2952-a/papers/perspective.pdf)
- [Building for the Blockchain](https://blog.ycombinator.com/building-for-the-blockchain/)
- [How to Build Your Own Blockchain Part 1](https://bigishdata.com/2017/10/17/write-your-own-blockchain-part-1-creating-storing-syncing-displaying-mining-and-proving-work/)

## Chaos Engineering

- [Principles of Chaos Engineering](http://principlesofchaos.org)

## Cloud

- [Cloud Custodian](https://github.com/capitalone/cloud-custodian)

## Collaborative Software

- [Operational Transformation](https://en.wikipedia.org/wiki/Operational_transformation)
- [Conflict-Free Replicated Data Type](https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type)

## Communication

- [5 Patterns for Effective Communication in Agile Teams](https://simpleprogrammer.com/effective-communication-agile-teams/)

## Compression

- [Zstandard](https://facebook.github.io/zstd/)

## Computer Science

- [Sum Types Are Coming: What You Should Know](https://chadaustin.me/2015/07/sum-types/)
- [What is Code?](https://www.bloomberg.com/graphics/2015-paul-ford-what-is-code/)

## Containers

- [Introducing conu – Scripting Containers Made Easier](https://developers.redhat.com/blog/2018/03/07/introducing-conu-scripting-containers-made-easier/)
- [Project Atomic](https://www.projectatomic.io/)

## Continuous Delivery

- [Drone • Continuous Delivery](http://try.drone.io)

## Cryptocurrency

- [The Different Proofs of Crypto Currency](https://steemit.com/cryptocurrency/@killjoy/the-different-proofs-of-crypto-currency)

## Dart

- [Dart programming language](https://www.dartlang.org)
- [Dart Basics 01 - Introduction](https://www.youtube.com/watch?v=Vn_jFIraq40)

## Elixir

- [Building An Image Upload API With Phoenix](https://dockyard.com/blog/2017/08/22/building-an-image-upload-api-with-phoenix)
- [Exq](https://github.com/akira/exq)
- [Introduction](https://elixir-lang.org/getting-started/introduction.html)
- [Introduction to Mix](https://elixir-lang.org/getting-started/mix-otp/introduction-to-mix.html)
- [Typespecs – Elixir v1.6.0](https://hexdocs.pm/elixir/typespecs.html)

## Entrepreneur

- [The Entrepreneur's Roadmap From Concept to IPO](https://www.nyse.com/entrepreneur)

## Flutter

- [Flutter - Beautiful native apps in record time](https://flutter.io)
- [Hillel Coren](https://hillelcoren.com)
- [Introducing Flutter](https://www.youtube.com/watch?v=fq4N0hgOWzU)

## Front-End Development

- [Front-End Developer Handbook 2018](https://frontendmasters.com/books/front-end-handbook/2018/)

## Functional Programming

- [Fantasy Land Specification](https://github.com/fantasyland/fantasy-land)
- [Functional Programming Jargon](https://functional.works-hub.com/learn/Functional-Programming-Jargon)

## Game Development

- [BYTEPATH #0 - Introduction](https://github.com/SSYGEN/blog/issues/30)

## Git

- [Git Tips & Tricks](https://wikileaks.org/ciav7p1/cms/page_1179773.html)

## Go

- [Authn Server](https://github.com/keratin/authn-server)
- [Building messaging in Go network clients](https://www.oreilly.com/ideas/building-messaging-in-go-network-clients)
- [Keybase Go Library](https://github.com/keybase/client)
- [Profiling Go * Mark McDonnell](http://www.integralist.co.uk/posts/profiling-go/)

## Graphical Linear Algebra

- [Graphical Linear Algebra](https://graphicallinearalgebra.net/)

## Image Processing

- [DSLR-Quality Photos on Mobile Devices with Deep Convolutional Networks](https://github.com/aiff22/DPED)

## iOS

- [CloudKit: Structured Storage for Mobile Applications](http://www.vldb.org/pvldb/vol11/p540-shraer.pdf)
- [DEMYSTIFYING IOS PROVISIONING PART 1: PROFILES, CERTIFICATES, AND XCODE (OH MY!)](http://martiancraft.com/blog/2017/05/demystifying-ios-provisioning-part1/)
- [iOS Dev Directory](https://iosdevdirectory.com)
- [iOS-factor](https://ios-factor.com)

## Kanba

- [The Kanban Way: How To Visualize Progress And Data In Trello](https://blog.trello.com/kanban-data-nave)

## Kubernetes

- [Learn Kubernetes by Doing](https://www.magicsandbox.com)

## Lean

- [The Cumulative Flow Chart (CFD) in a Nutshell](http://leanguru.pro/the-cumulative-flow-chart-cfd-in-a-nutshell/)

## Life

- [Searching for meaning in your life? This Japanese concept can help you find it](http://bigthink.com/philip-perry/searching-for-meaning-in-your-life-this-japanese-concept-can-help-you-find-it)

## LLVM

- [LLVM for Grad Students](https://www.cs.cornell.edu/~asampson/blog/llvm.html)

## Leadership & Management

- [Turning Goals into Results: The Power of Catalytic Mechanisms](https://hbr.org/1999/07/turning-goals-into-results-the-power-of-catalytic-mechanisms)

## Machine Learning

- [AWS Training - Machine Learning](https://aws.amazon.com/training/learning-paths/machine-learning/)
- [Introducing the Facebook Field Guide to Machine Learning video series](https://research.fb.com/the-facebook-field-guide-to-machine-learning-video-series/)
- [Introduction to Machine Learning for Coders: Launch](http://www.fast.ai/2018/09/26/ml-launch/)
- [Machine Learning 101](https://docs.google.com/presentation/d/1kSuQyW5DTnkVaZEjGYCkfOxvzCqGEFzWBy4e9Uedd9k/preview?imm_mid=0f9b7e&cmp=em-data-na-na-newsltr_20171213&slide=id.g168a3288f7_0_58)
- [Machine Learning Guides](https://developers.google.com/machine-learning/guides/)

## MacOS

- [MacOS monitoring the open source way](https://blogs.dropbox.com/tech/2018/04/4696/)

## Mathematics

- [Mathematics for Computer Science](https://courses.csail.mit.edu/6.042/spring17/mcs.pdf)

## Miscellaneous

- [How Netflix works: the (hugely simplified) complex stuff that happens every time you hit Play](https://medium.com/refraction-tech-everything/how-netflix-works-the-hugely-simplified-complex-stuff-that-happens-every-time-you-hit-play-3a40c9be254b)
- [Playbook for software design and development - By thoughtbot](https://thoughtbot.com/playbook)

## Mobile Design

- [Rico: A Mobile App Dataset for Building Data-Driven Design Applications](http://interactionmining.org/rico)

## Mobile Device Management

- [MicroMDM](http://micromdm.io)

## Mobile Security

- [OWASP Mobile Security Testing Guide](https://www.owasp.org/index.php/OWASP_Mobile_Security_Testing_Guide)

## Networking

- [Network Protocols - Programmer's Compendium](https://www.destroyallsoftware.com/compendium/network-protocols)

## PostgreSQL

- [Bottled Water: Real-time integration of PostgreSQL and Kafka](https://www.confluent.io/blog/bottled-water-real-time-integration-of-postgresql-and-kafka/)
- [Logical Decoding](https://www.postgresql.org/docs/10/static/logicaldecoding-explanation.html)
- [Postgres Decoderbufs](https://github.com/debezium/postgres-decoderbufs)

## Proxy

- [mitmproxy](https://mitmproxy.org)

## Public Key Infrastructure

- [Short-Lived Certificates @ Netflix](https://medium.facilelogin.com/short-lived-certificates-netflix-fd5f3ae5bc9)

## QUIC

- [Discover Cronet](https://medium.com/@cchiappini/discover-cronet-4c7b4812407)
- [The Road to QUIC](https://blog.cloudflare.com/the-road-to-quic/)

## Ray Tracer

- [smallpt: Global Illumination in 99 lines of C++](http://www.kevinbeason.com/smallpt/)

## Reactive

- [Rx Visualizer](https://rxviz.com)

## Sales Deck

- [The Greatest Sales Deck I’ve Ever Seen](https://medium.com/the-mission/the-greatest-sales-deck-ive-ever-seen-4f4ef3391ba0)

## Session Types

- [Session types in programming languages](http://simonjf.com/2016/05/28/session-type-implementations.html)

## Statistics

- [A Zero-Math Introduction to Markov Chain Monte Carlo Methods](https://towardsdatascience.com/a-zero-math-introduction-to-markov-chain-monte-carlo-methods-dcba889e0c50)

## Swift

- [MemoryLayout](http://www.russbishop.net/memorylayout)
- [An Exhaustive Look At Memory Management in Swift](http://marksands.github.io/2018/05/15/an-exhaustive-look-at-memory-management-in-swift.html)

## System Design

- [System Design Primer](https://github.com/donnemartin/system-design-primer)

## WebRTC

- [Kranky Geek](https://www.krankygeek.com)
- [Untangling the WebRTC Flow](https://www.pkcsecurity.com/untangling-webrtc-flow.html)

repository: kartikpatel/bookmarks

repo_name: kartikpatel/bookmarks


text:
# Cuenta BPM
## _Open Source BPM counter_

[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://google.com)

Cuenta BPM is a counter for BPM. It helps DJs to count BPM easily.

## Features

- Receive Taps
- Show BPM
- Restart counter

Markdown is a lightweight markup language based on the formatting conventions
that people naturally use in email.
As [John Gruber] writes on the [Markdown site][df1]

> Our goal is to help DJs
> to calculate BPM
> at no cost

## Tech

Cuenta BPM uses a number of projects to work properly:

- [AndroidStudio](https://www.google.com/aclk?sa=l&ai=DChcSEwjJov3W8prwAhXFgZEKHdmJAH0YABAAGgJjZQ&sig=AOD64_0LG0Y1nYpYpa5BzR3svhvtQMwoJA&q&adurl&ved=2ahUKEwiZ5vhttps://www.google.com/aclk?sa=l&ai=DChcSEwjJov3W8prwAhXFgZEKHdmJAH0YABAAGgJjZQ&sig=AOD64_0LG0Y1nYpYpa5BzR3svhvtQMwoJA&q&adurl&ved=2ahUKEwiZ5vbW8prwAhWXpZUCHYBICX0Q0Qx6BAgEEAEbW8prwAhWXpZUCHYBICX0Q0Qx6BAgEEAE) - Editor para aplicaciones android
- [Java](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwi6jMqW85rwAhUwqJUCHTXoB1EQFjAAegQIAhAE&url=https%3A%2F%2Fwww.java.com%2Fes%2Fdownload%2F&usg=AOvVaw1gt_gnb7Mr9joklLIAkQbt) - Java

## Development

Want to contribute? Great!

Make a change in your file and instantaneously see your updates!

repository: montespierre/contadorBpmAndroid

repo_name: montespierre/contadorBpmAndroid


text:
---
title: Axes
page_title: Axes
slug: radspreadprocessing-features-charts-axes
tags: chart, axes, axis
published: True
position: 5
platforms: ajax, mvc, wpf, winforms
---

# Working with Axes

## Axis Object and Their Properties

The axes of the chart are contained in two objects of type **AxisGroup**. The two collections can be accessed by the **PrimaryAxes** and **SecondaryAxes** properties of the **DocumentChart** object. Each of the collections contains two axes, contained in the **CategoryAxis** and **ValueAxis** properties. The **PrimaryAxes** property is populated on creation when the constructor of **FloatingChartShape** or the **AddChart()** methods of the **ShapeCollection** are used  and can be replaced or edited as desired.

If the **SeriesGroup** object implements the **ISupportAxes** interface, it can indicate whether it is associated with the **Primary** or **Secondary** couple of axes. For example, the bar and line chart groups implement the interface, while the pie group does not. The **ISupportAxes** interface defines one property: **AxisGroupName**, of type **AxisGroupName**. The AxisGroupName enum has two members: **Primary** and **Secondary**.

Refer to the scenario from **Figure 1**. The chart shown there has two axes: a date (horizontal, category) axis and a value (vertical, value) axis. The respective objects can be found in the **PrimaryAxes** property of the chart.  The **BarSeriesGroup** object **AxisGroupName** property has value *AxisGroupName.Primary*. The properties of the axes are listed in **Example 1**.

#### Figure 1: Sample data
![](images/SpreadProcessing-Features-Charts-Axes_1.png)

#### [C#] Example 1: Axes properties
{{region radspreadprocessing-features-charts-axes_0}}

	DocumentChart chart = new FloatingChartShape(worksheet, new CellIndex(0,0), new CellRange(1, 1, 5, 2), ChartType.Column).Chart;

	DateAxis dateAxis = chart.PrimaryAxes.CategoryAxis as DateAxis;
	ValueAxis valAxis = chart.PrimaryAxes.ValueAxis as ValueAxis;

	ISupportAxes chartComponentWithAxes = chart.SeriesGroups.First() as ISupportAxes;
	AxisGroupName axisGroup = chartComponentWithAxes.AxisGroupName; // Primary

	bool dateIsVisible = dateAxis.IsVisible; // true
	bool valIsVisible = valAxis.IsVisible; // true

	double? dateMin = dateAxis.Min; // 1
	double? dateMax = dateAxis.Max; // 4

	double? valMin = valAxis.Min; // 0
	double? valMax = valAxis.Max; // 1800

{{endregion}}

## Changing the Axis of a Chart

RadSpreadProcessing allows you to replace the axis of a chart with a new object. This is achieved through the **PrimaryAxes** and **SecondaryAxes** properties of **DocumentChart**.

#### [C#] Example 2: Replace axis
{{region radspreadprocessing-features-charts-axes_1}}

	DocumentChart chart = new FloatingChartShape(worksheet, new CellIndex(0, 0), new CellRange(1, 1, 5, 2), ChartType.Column).Chart;
	chart.PrimaryAxes.CategoryAxis = new DateAxis();
{{endregion}}

## Changing the Appearance of the Axes

You can customize the way the axes in the chart look like. The API of SpreadProcessing enables you to change the fill and width of the outline of an axis and its major gridlines.

#### [C#] Example 3: Customize the major gridlines and outline of an axis
{{region radspreadprocessing-features-charts-axes_2}}

    FloatingChartShape chartShape = new FloatingChartShape(workbook.ActiveWorksheet, new CellIndex(2, 7), new CellRange(0, 0, 4, 3), ChartType.Column)
    {
        Width = 480,
        Height = 288,
    };
    chartShape.Chart.PrimaryAxes.ValueAxis.Outline.Fill = new SolidFill(new ThemableColor(Colors.LightBlue));
    chartShape.Chart.PrimaryAxes.ValueAxis.Outline.Width = 5;

    chartShape.Chart.PrimaryAxes.ValueAxis.MajorGridlines.Outline.Fill = new SolidFill(new ThemableColor(Colors.LightGray));
    chartShape.Chart.PrimaryAxes.ValueAxis.MajorGridlines.Outline.Width = 2;
{{endregion}}

#### Figure 2: Custom appearance
![](images/SpreadProcessing-Features-Charts-Axes_3.png)

repository: telerik/document-processing-docs

gha_license_id: NOASSERTION

repo_name: telerik/document-processing-docs


text:
# ip-tester

It tests IPs for validity and vacancy.

# How to install.
##Prereqs

You will need Ruby. The most recent version will work.

###For Linux Users:
Use the package manager:
```
sudo apt install ruby-full

sudo yum install ruby
```

or rvm
```
rvm install <latest>/*; rvm use <latest>/*
```
An asterisk means that the version would have to be known.

###For Windows
You can get Ruby using the one-click installer from http://rubyinstaller.org/

##Gems
After you install Ruby, next would be the gems. One can do this with Bundler.

```
gem install bundler && bundle install
```

#Install Done!

#Running
```
ruby ip_tester.rb
```
Just follow the gui prompts and test away!

repository: naviabbot/ip-tester

repo_name: naviabbot/ip-tester


text:
# Daphne's dependencies

_A gentle introduction to dependency-cruiser_

Daphne is a software engineer. She works on a project where everything in a
folder called `sub` (not _her_ choice) got deprecated. So she adds rule to
the `.dependency-cruiser.json` in the root of her project:

```json
{
  "forbidden": [
    {
      "name": "sub-not-allowed",
      "severity": "error",
      "from": { "pathNot": "sub" },
      "to": { "path": "sub" }
    }
  ]
}
```

Dependencies from everywhere to the `sub` folder are _verboten_ from now on.
Except when they come from sub itself. :heart:.

## dot

To get a feel of what she's in to, she runs a dep-cruise and runs the result
through dot. (_Daphne is like that. She and her command line: a *terrifying*
weapon._)

```sh
dependency-cruise -v -T dot test/fixtures | dot -T png > sample-dot-output.png
```

![sample dot output](https://raw.githubusercontent.com/sverweij/dependency-cruiser/main/doc/assets/sample-dot-output.png)

## err

Her `Makefile` already has `dep-cruise` target, which is run as part of the
checks on her ci. (She also has a run script in her package.json, because her
colleagues like that, but she prefers `make` herself - it's how she's wired)

Lo and behold - on the next push to her feature branch the build neatly fails.
She _loves_ how the exit code reflects the number of offending dependencies when
she uses the `err` output type:

```sh
dependency-cruise -T err -v test/fixtures

  error sub-not-allowed: test/fixtures/cjs/root_one.js → test/fixtures/cjs/sub/dir.js
  error sub-not-allowed: test/fixtures/cjs/two_only_one.js → test/fixtures/cjs/sub/dir.js

✖ 2 violations (2 errors, 0 warnings)

make: *** [dependency-cruise] Error 2
```

(Daphne also loves how `-T err` just _shuts up_ and _stays out of her way_
if there's nothing wrong.)

So she gets on to refactor the code to obliterate those doubly blasted
modules in `sub`.

## html

In the mean Alex, who's an architect in Daphne's project, gets a whiff of what
is afoot and heads over to the visual build output.

The build server _knows_ its architect, so it put a dependency report in a spot
where Alex can find it easily. This is the _command_:

```sh
dependency-cruise -v -T html -f stuff-for-alex/sample-dot-output.html test/fixtures
```

(_Actually the build server didn't. You know that. Build servers aren't that
nice. In fact that darn clever Daphne put it in her Makefile. Near her coverage
reporting. The build server just ran it blindly._)

![sample html output](https://raw.githubusercontent.com/sverweij/dependency-cruiser/main/doc/assets/sample-html-output.png)

Alex gets a little cramp in her neck, just when she discovers
the tiny little _rotate_ button. That's better:
![sample html output - rotated](https://raw.githubusercontent.com/sverweij/dependency-cruiser/main/doc/assets/sample-html-rotated-output.png)

## csv

Daphne and Alex are covered. Their micro-managing spreadsheet hugging senior
environs, however, is not. Hence: comma separated values. In a file. So excel
(or LibreOffice) can chug it like it's 1999:

```sh
dependency-cruise -v -T csv -f sample-dot-output.csv test/fixtures
```

![oldskool csv output. In a spreadsheet. Way out man!](https://raw.githubusercontent.com/sverweij/dependency-cruiser/main/doc/assets/sample-csv-output.png)

## json

This is there for the _persona_ 'Marty the maintainer', so he can debug things.

```sh
dependency-cruise -T json -v -f sample-json-output.json test/fixtures
```

The result is rather voluminous, so here's just a link if you want to see it
[assets/sample-json-output.json](https://raw.githubusercontent.com/sverweij/dependency-cruiser/main/doc/assets/sample-json-output.json).

repository: sverweij/dependency-cruiser

repo_name: sverweij/dependency-cruiser


text:
# dicom2py

Extracts the pixel arrays from dicom files
in a directory and save those as 16-bit png.

The pixel values are rescaled using the
`RescaleSlope` and `RescaleIntercept`
stored in the DICOM file.

By default, the PNG will be named using
DICOM `InstanceNumber`.
The original filename can be optionally
chosen to be appended to PNG filename.

## Dependencies

```
pydicom opencv-python numpy tqdm
```

## How to Run

```
python3 dicom2png.py [-h] [--a_orig_filename] input output
```

### Positional Arguments

- `input`: input path to directory containing the DICOM files

- `output`: output path to directory where the PNG files will be save

### Optional Arguments

- `-h, --help`: See help

- `a_orig_filename`: If present, the original filename will be appended to the PNG filename


text:
# Title
External Calls inside Loops

## Relationships
[CWE-670: Always-Incorrect Control Flow Implementation](https://cwe.mitre.org/data/definitions/670.html)

## Description
Function calls inside one loop will be broadcasted in the same transaction, which means a revert of any one of the calls will revert the whole loop, leading to a DOS.

## Remediation
Apply the [Pull Over Push Pattern](https://fravoll.github.io/solidity-patterns/pull_over_push.html) for external calls.

## References
* [Ethereum Design Rationale](https://github.com/ethereum/wiki/wiki/Design-Rationale#gas-and-fees)
* [Ethereum Yellow Paper](https://ethereum.github.io/yellowpaper/paper.pdf)
* [Pull Over Push Pattern](https://fravoll.github.io/solidity-patterns/pull_over_push.html)

repository: cybercrimeshield/SWC-registry

repo_name: cybercrimeshield/SWC-registry


text:
# Custom Themes for ProtonMail

**NOTE: THIS REPO IS ARCHIVED AND NO LONGER MAINTAINED.** It will remain up for historical reference however.

This is a collection of simple color themes for the [ProtonMail](https://protonmail.com/) v3.16.x web app. 🎨

## Dark Theme

[Copy the CSS directly](https://amdelamar.com/pm-theme/themes/pm-dark-theme.min.css) and [edit the colors](#customize).

## Flat Theme

[Copy the CSS directly](https://amdelamar.com/pm-theme/themes/pm-flat-theme.min.css) and [edit the colors](#customize).

## Background Image Theme

[Copy the CSS directly](https://amdelamar.com/pm-theme/themes/bg-image-theme.min.css) and [customize](#customize) the variable `--image` to your own image url. (Might not work with Content-Security-Policy blocking remote content anymore.)

## GM Theme

[Copy the CSS directly](https://amdelamar.com/pm-theme/themes/gm-theme.min.css) and [edit the colors](#customize).

## Customize

1. Copy a CSS theme above.
1. Paste in ProtonMail under `Settings` > `Appearance` > `Custom Theme`.
1. Customize the colors (or leave default).
1. Enjoy!

You can customize the theme colors to your liking:

```css
/* First paste any CSS theme. */

/* Now you can set your colors. */
:root {
    --theme1: #3652d1; /* Blue instead of Red */
}
```

The `#xxx` value is [hexidecimal color](https://www.color-hex.com/) value. And the `root` keyword is a CSS variable, that just sets the color values globally. These themes have been simplified to **7 "core" colors** so you can easily make a custom color palette of your choice. You can also generate a pretty [color palette from this site](https://coolors.co/).

```css
:root {
/* Core Theme Colors */
    --theme1: #66669a; /* Purple */
    --theme2: #5f5f60; /* Dark Grey */
    --theme3: #f0f0f0; /* Light Grey */
    --theme4: #bcbdbf; /* Grey */
    --theme5: #797a7c; /* Medium Grey */
    --theme6: #9397cd; /* Light Purple */
    --theme7: #fefefe; /* White */
}
```

Enjoy!

## Notes

- This is only available for the WEB version and not the MOBILE app.
- Some of these themes aren't always the best. **If you have any problems** you can open an [issue here](https://github.com/amdelamar/pm-theme/issues).
- If you're trying to use `@import`, the Content-Security-Policy (CSP) header blocks `@import` statements from loading remote content. To get around this, please copy and paste the entire contents of the CSS theme rather than the `@import` line.

## Privacy and Performance

~~The above code used a CSS `import` statement for ease of use and quickly trying out a theme. However, the CSS `import` statement causes files to load sequentially instead of parallel, thus slowing down your pages load performance. Also, if your privacy is of the utmost importance, then I wouldn't use the CSS `import` statment from above. It potentially could reveal your behavior e.g. identifying *when* you load up ProtonMail using *which* specific theme. To avoid this, please copy & paste the entire contents of the CSS file, rather than use the `import` statement.~~ This is no longer a concern, now that the Content-Security-Policy (CSP) Header blocks `@import` statements from loading remote content.

## Contribute

Spot a problem or bug? You can open an [issue here](https://github.com/amdelamar/pm-theme/issues).

I'll accept pull requests to the `master` branch too. Please make sure to minify the CSS as well.

## Share with friends

- Copy, edit, and share any of these themes.
- Licensed as [MIT](/LICENSE.md) and *free forever*.

repository: amdelamar/pm-theme

gha_language: CSS

repo_name: amdelamar/pm-theme


text:
I am format for objects which belongs to well known classes.
I encode such objects in the way where classes are encoded by one byte index instead of full name.
For example you could create compact format for nil, true and false:

	TostNewObjectOfWellKnownClassFormat on: { Array. OrderedCollection. String}.

Number of well known classes is restricted to 255

repository: Ducasse/TostSerializer

repo_name: Ducasse/TostSerializer