text:
# diesel-cli

[Diesel.rs](http://diesel.rs) command line tool Docker image.
It is based on Alpine to keep it as small as possible (~ 17 MB)

## Usage

### As CLI

Just use it as you would use diesel-cli:

```bash
docker run -it dgolubets/diesel-cli migration list
```

### As a base image for your migrations

Create a Dockerfile:

```Dockerfile
FROM dgolubets/diesel-cli:latest
COPY ./migrations ./migrations
CMD ["database", "setup"]
```

Build your migrations image:

```bash
docker build . -t migrations
```

Run migrations:

```bash
docker run -e DATABASE_URL=postgres://username:password@pghost/diesel_demo migrations:latest
```

repository: DGolubets/diesel-cli-docker

repo_name: DGolubets/diesel-cli-docker


text:
# Welcome to Backendless!

[![npm version](https://img.shields.io/npm/v/backendless.svg?style=flat)](https://www.npmjs.com/package/backendless)
[![Build Status](https://img.shields.io/travis/Backendless/JS-SDK/4.0/master.svg?style=flat)](https://travis-ci.org/Backendless/JS-SDK)

In this document you will find the instructions for getting up and running with **Backendless** quickly.
The SDK you downloaded contains a library with the APIs, which provide access to the Backendless services.
These services enable the server-side functionality for developing and running mobile and desktop applications.
Follow the steps below to get started with Backendless:

  * **Create Developer Account**. An account is required in order to create and manage your Backendless application. Registration form is available at [https://develop.backendless.com/registration][registration]
  * **Login**. Login to your account using Backendless Console at [https://develop.backendless.com/login][login]
  * **Locate Application ID and API Key**. The console is where you can manage the applications, their configuration settings and data. Before you start using any of the APIs, make sure to select an application in the console and open the “Manage” section. The “App Settings” screen contains the application ID and API keys, which you will need to use in your code.
  * **Examples**. The SDK includes several examples demonstrating some of the Backendless functionality. Each example must be configured with the application ID and API key generated for your application. Make sure to copy/paste these values into the following source code files:

    - User Service Register/Login Demo: `examples/user-service/simple-register-login/js/user-example.js`
    - User Service Social Login Demo: `examples/user-service/social-login/js/main.js`
    - Data Service TODO-App Demo: `examples/data-service/todo-app/js/app.js`
    - Data Service Relations Management Demo: `examples/data-service/relations-management/js/app.js`
    - Messaging Service Demo: `examples/messaging-service/chat/js/chat.js`
    - Geo Service Demo: `examples/geo-service/citysearch/js/citysearch.js`
    - File Service Demo: `examples/file-service/js/files-example.js`
    - TypeScript Demo: `examples/typescript/app.ts`
---

## Installation
Use npm:
> npm i backendless

 or reference the library with the URLs below:

 Non-compressed library (mapped to the latest released version):
 > https://api.backendless.com/sdk/js/latest/backendless.js

 Minified/compressed library:

 > https://api.backendless.com/sdk/js/latest/backendless.min.js

 TypeScript library:
 >https://api.backendless.com/sdk/js/latest/backendless.min.map
 https://api.backendless.com/sdk/js/latest/backendless.d.ts

## Documentation

You can find the Backendless documentation [on the website][documentation].

Check out the [Getting Started Guide][quick start] page for a quick overview.

## Help
Below are a few links to help with the development:

* [Documentation][documentation]
* [Support Home][support]
* [Slack Channel][slack]
* [Blog][blog]
* [YouTube Channel][youtube]
* [Facebook][facebook]
* [Twitter][twitter]

We would love to hear from you. Please let us know about your experiences using Backendless.
You can reach us through the [support page][support] or email: [support<EMAIL_ADDRESS>
Thank you and endlessly happy coding!
The Backendless Team

[documentation]: https://backendless.com/products/documentation/
[support]: https://support.backendless.com
[slack]: https://slack.backendless.com
[blog]: https://backendless.com/blog
[youtube]: https://youtube.com/backendless
[facebook]: https://facebook.com/backendless
[twitter]: https://twitter.com/backendless
[login]: https://develop.backendless.com/login
[registration]: https://develop.backendless.com/registration
[quick start]: https://backendless.com/docs/js/quick_start_guide.html

branch_name: refs/heads/master

extension: md

gha_license_id: NOASSERTION

license_type: permissive


text:
---
id: installation
title: Installing
sidebar_label: Installing
slug: /
---

## Installing Tunnel into your application

In order to install tunnel you can use yarn or npm to install into your javascript application

```sh
yarn add @tunneljs/tunnel
```

How to install using npm

```sh
npm i --save @tunneljs/tunnel
```

## Placing the provider

After installing you need to place the `TunnelProvider` to your application root React component

```jsx
import React from 'react';
import { TunnelProvider } from '@tunneljs/tunnel';

const App: React.FC = () => {
  return <TunnelProvider>...</TunnelProvider>;
};
```

:::note

To use tunnel your components needs to be wrapped with tunnel provider

:::

## All Set!

Now its all set to use tunnel let's see how to use it at [Basic Usage](simple.md)

license: MIT


text:
# Uncovering the computational mechanisms underlying many-alternative choice

This repository contains all code and data for:

Thomas, A. W., Molter, F., & Krajbich, I. (2021). Uncovering the computational mechanisms underlying many-alternative choice. Elife, 10, e57012. [doi.org/10.7554/eLife.57012](https://doi.org/10.7554/eLife.57012)

All code underlying this project is contained in [src/](src/), with one [jupyter notebook](https://jupyter.org) for each figure of the manuscript.

## Local installation

**1. Clone and switch to this repository:**

```bash
git clone https://github.com/athms/many-item-choice.git
cd many-item-choice
```

**2. Install all dependencies:**

I recommend setting up a new Python environment (e.g., with the [miniconda installer](https://docs.conda.io/en/latest/miniconda.html)).

To recreate our [environment](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) use the following command:

```bash
conda env create -f environment.yml
```

This will create a new Python 3.6 environment with the name `many-item-choice` that includes all required dependencies.

You can then activate this environment as follows:

```bash
conda activate many-item-choice
```

**3. Start the Jupyter notebook server:**

```bash
jupyter notebook
```

## The data

All data of this project are included in the [`data`](data/) repository.

There you will find two main file types:
- Aggregate data files (contained in [`data/summary_files/`](data/summary_files/)) and
- Individual subject data files (contained in [`data/subject_files/`](data/subject_files/)).

*Note that all files are separated by choice set size (9, 16, 25, and 36).*

**Aggregate data** contain one row for each trial with the following information:

- `{setsize, subject, trial}` (int): indicators for the choice set size, subject, and trial
- `rt` (float): response time (in ms)
- `rt_choice_indication` (float): choice indication time (in ms; defined as time between space bar press and click on an item image; see the manuscript for details)
- `choice` (int): chosen item
- `gaze_count` (float): overall number of gazes in that trial (a gaze is defined as all consecutive and uninterrupted fixations to an item)
- `seen_items_count` (float): number of items that the subject looked at in that trial
- `returning_gaze_count` (float): overall number of returning gazes in that trial
- `best_chosen` (float [0, 1]): whether the subject choose the item with the highest value in that trial (1) or not (0)?
- `best_seen_chosen` (float [0, 1]): whether the subject choose the item with the highest value that they have seen in that trial (1) or not (0)?
- `longest_chosen` (float [0, 1]): whether the subject chose the item that they have looked at longest (1) or not (0) in that trial?
- `item_value_{0-setsize}` (float): value of each choice set item (as indicated by the liking rating)
- `cumulative_gaze_{0-setsize}` (float): cumulative gaze of each choice set item (defined as the fraction of trial time that the subject spent looking at the item)
- `stimulus_{0-setsize}` (string): filename of respective snack food stimulus (files are stored in [`data/stimuli`](data/stimuli))
- `gaze_onset_{0-setsize}` (float): time point (in ms) at which the item was first looked at in that trial

Note that item numbers start with 0 and increase from *left-to-right* and *top-to-bottom*. The item in the top left thus has number 0 while the item in the bottom right has the highest number in the choice set.

There are two types of *individual subject data* files:

**Gaze files** contain one row for each gaze with the following information:

- `{setsize, subject, trial, item}` (int): indicators for the choice set size, subject, trial, and looked-at item
- `dur` (float): duration of the gaze (in ms)
- `onset` (float): onset of the gaze (in ms; relative to the trial onset)
- `stimulus` (string): filename of the snack food stimulus (stimulus files are stored in [`data/stimuli`](data/stimuli))
- `gaze_num` (float): gaze number in trial
- `is_returning` (float [0, 1]): is this a returning gaze (1) or not (0)?
- `returning_gaze_count` (float): counter for returning gazes to this item
- `is_{first,last}` (float [0, 1]): is this the first/last gaze of the trial?
- `item_value` (float): value of the item (as indicated by its liking rating)
- `choice` (int): chosen item
- `is_last_to_choice` (float [0, 1]): whether chosen item was looked at last in that trial (1) or not (0)?

**Liking rating** files contain one row per rating trial with the following information:

- `{subject, trial}` (int): indicators for the subject and trial
- `rt` (float): response time (in ms)
- `stimulus` (string): filename of the snack food stimulus
- `rating` (float): liking rating

The folder [data/stimulus_positions](data/stimulus_positions) further contains the item positions on the experiment screen for each choice set size.

## A few notes before computing the notebooks

This project involves many computationally intensive analyses, which can take several days to compute (depending on your machine). By default, many results are therefore read from the repository, if the respective output files exist in the [results/](results/) directory. Thus, if you want to re-compute a specific result (or all of them), delete (or rename) the respective output files or folder.

**1. Fitting the individual models:**

To fit the three model types (PSM, IAM, and GLAM) for one subject in one choice set size, run:

```bash
cd src
python fit_subject-setsize-models.py <subject> <set size>
```
This script will fit the passive- and active-gaze variants of the three models for the specified subject and choice set size.

To iteratively fit all models for all subjects in all set size conditions, run:

```bash
cd src
for setsize in 9 16 25 36; do
  for subject in $(seq 0 48); do
    python fit_subject-setsize-models.py $subject $setsize;
  done;
done
```

**2. Running the model recovery:**

The model recovery can be computed by the use of [src/model-recovery.py](src/model-recovery.py):

```bash
cd src
python model-recovery.py
```

Note that the model recovery is based on the individual model fits for the 9-item choice sets and can thus only be computed if these fits exist in [`results/posterior_traces`](results/posterior_traces/)!

repository: athms/many-item-choice

branch_name: refs/heads/main

gha_language: Jupyter Notebook

repo_name: athms/many-item-choice


text:
---
type: slides
---

# Reading Data

---

# What we need to do

Some figure showing `[input text] --> [dataset reader] --> [instances matching input/output spec]`

Notes: To read data we use a `DatasetReader`, whose job it is to transform raw data files into
[`Instances`](#) that match our input / output spec.  We'll want one [`Field`](#) per item in our
spec, and our model will use the inputs to predict the outputs.

Ideally, the outputs would be optional in the `Instances`, so that we can use the same code to make
predictions on unlabeled data (say, in a demo), but for the rest of this chapter we'll keep things
simple and ignore that.

---

# Get some data

Our input / output spec is:

```python
# Inputs
text: TextField

# Outputs
label: LabelField
```

So we need data that has text and a label.  Let's assume a simple data file format: `[text] [TAB]
[label]`.

```
I like this movie a lot! [TAB] positive
This was a monstrous waste of time [TAB] negative
AllenNLP is amazing [TAB] positive
Why does this have to be some complicated? [TAB] negative
This sentence expresses no sentiment [TAB] neutral
```

---

# Make a DatasetReader

```python
@DatasetReader.register('classification-tsv')
class ClassificationTsvReader(DatasetReader):
    def __init__(self):
        self.tokenizer = WordTokenizer()
        self.token_indexers = {'tokens': SingleIdTokenIndexer()}

    def _read(self, file_path: str) -> Iterable[Instance]:
        with open(file_path, 'r') as lines:
            for line in lines:
                text, label = line.strip().split('\t')
                text_field = TextField(self.tokenizer.tokenize(text),
                                       self.token_indexers)
                label_field = LabelField(label)
                fields = {'text': text_field, 'label': label_field}
                yield Instance(fields)
```

Notes: This is a minimal `DatasetReader` that will return a list of classification `Instances` when
you call `reader.read(file)`.  This reader will take each line in the input file, split the `text`
into words using the default word tokenizer (the default currently relies on
[spacy](https://spacy.io/)'s tokenizer), and represent those words as tensors using a word id in a
vocabulary we construct for you.

Pay special attention to the `text` and `label` keys that were used in the `fields` dictionary
passed to the `Instance` - these keys will be used as parameter names when passing tensors into
your `Model` later.

There are lots of places where this could be made better for a more flexible and fully-featured
reader; see the section on [DatasetReaders](#) for more information.

repository: matt-gardner/test-allennlp-course

gha_language: CSS

gha_license_id: MIT

repo_name: matt-gardner/test-allennlp-course


text:
# RDI-MSP Book Club #
## The Pragmatic Programmer ##

### Forward

"Paid attention to what they where doing while they were doing it"

Automate project meetings = YAS

"Extra Dimension" of Quality Without A Name - I see this in produced products, in styles of code, and appreciate it (usually silently)

### Preface

Programming as a craft - slick, elegant readable code = sign of good craftsmanship

Not be wedded to a particular technology - similar to RDI's philosophy and approach

1. Early/Fast Adopter 4/5
1. Inquisitive 5/5
1. Critical Thinker 5/5
1. Realistic 3/5
1. Jack of all Trades 4/5
1. Care about your craft 5/5
1. Think! about your work 4/5

Kaizen - small continuous improvements

Chapter 1 - A Pragmatic Philosphy
=========

### The Cat Ate My Source Code

"The greatest of all weaknesses is the fear of being weak"

Be honest about shortcomings

When you accept responsibility, expect to be held accountable

Don't lay blame

Solutions not excuses!

Instead of excuses, provide options. Don't say it _can't_ be done, explain what _can_ be done.

Tell your cat first, haha

Challenges - When a company or service gives a lame excuse, I typically let the first one slide; things happen. If they ever give a second one, I don't return.

### Software Entropy

Software Rot - interesting take on it; I have only viewed this in terms of static code (literally) in the face of everprescient, unrelenting progress. How can it ruin internally?
From wiki: "This is not a physical phenomenon: the software does not actually decay, but rather suffers from a lack of being responsive and updated with respect to the changing environment in which it resides."

"Don't leave "broken windows" (bad designs, wrong decisions, or poor code) unrepaired."

"You may be thinking that no one has the time to go around cleaning up all the broken glass of a project. If you continue to think like that, then you'd better plan on getting a dumpster, or moving to another neighborhood. Don't let entropy win."
haha - fight the entropy!

Putting out fires - sounds like Monica's team's recent review of ALVIN

Lots of broken windows on the intranet - difficult to begin the window fixing process
When in between rock and a hard place, the first windows often get broken, like on BH

### Stone Soup and Boiled Frogs

I call bullshit: no single pot, in posession of a travelling soldier, could contain enough volume of soup to feed even a tiny village with what could be considered a 'meal'. Are the three of them hauling a cauldron around?

"Pretend it's not important" that you want your changes implemented - why?

 The next scientist had a faulty methodology with dubious claims (0.02deg C rise to boiling in 2.5 hours means the water started at 82deg C, which is lethal, claimed they didn't 'appear' to have moved).

> Or perhaps the story began with E.W. Scripture, who wrote The New Psychology in 1897. He cited earlier German research: “. . . a live frog can actually be boiled without a movement if the water is heated slowly enough; in one experiment, the temperature was raised at the rate of 0.002 [degrees Celsius] per second, and the frog was found dead at the end of 2.5 hours without having moved.

> Well, the numbers just don’t seem right. If the water comes to a boil, that means a final temperature of 100 degrees Celsius. In that case, the frog would have to have been put into the water at 82 degrees Celsius. Surely, the frog would have died immediately. Scripture also wrote that the frog was found “without having moved.” How do you convince a frog not to move for more than two hours?

> Then there’s the issue of the real-life behavior of frogs. First, a frog cannot jump out of boiling water. Remember the last time you dropped some egg white into boiling water: the proteins coagulated into a mess of thin, white strands. Unfortunately, the proteins in the frog’s skinny legs would do the same thing. So the frog in boiling water could not jump anywhere. It would die a nasty death.

> Dr. George R. Zug, curator of reptiles and amphibians at the American Museum of Natural History in New York, and Professor Doug Melton of Harvard University both agree on this point.

> Second, a frog would notice the water getting hot. Dr. Victor Hutchison, a herpetologist at the University of Oklahoma, has dealt with frogs throughout his professional life. Indeed, one of his current research interests is “the physiological ecology of thermal relations of amphibians and reptiles.” Professor Hutchison states, “The legend is entirely incorrect! The ‘critical thermal maxima’ [the maximum temperature an animal can bear] of many species of frogs have been determined by several investigators. In this procedure, the water in which a frog is submerged is heated gradually at about 2 degrees Fahrenheit per minute. As the temperature of the water is gradually increased, the frog will eventually become more and more active in attempts to escape the heated water.”

> So real-life experiments show that the frog-in-boiling-water story is wrong. If only this fact could make it into real life, too. ❧

> http://conservationmagazine.org/2011/03/frog-fable-brought-to-boil/

Challenges: How to tell if making stone soup vs frog soup? If there's living things getting burned in there!

### Good-enough Software

"How _good_ do you want your software to be?"

I struggle with this

Tip 7: Make quality a requirements issue

"Great software today is often preferable to perfect software tomorrow."

Like painting!

"Tracer bullets" sounds like an exciting chapter

Challenges: Depends on the purpose of the software. OS: wait until all the bugs are out. IDE/browser: some bugs. Projects/Experimental: simpler.

### Your Knowledge Portfolio

Knowledge is an _expiring_ asset? oh noes!

Diversification is the key to long term success

Tip 8 - Invest regularly in your knowledge portfolio

Learn a new language every year! Great goal!
Technical book each quarter - book club!

"cross-pollination of ideas"

Take it as a personal challenge to find the answer.

### Communicate!

Better to be looked over than overlooked?

What
Interest
Sophistication
Detail
Own
Motivate

To be listened to, listen to others

Challenges: MOAR BOOKS!?!?! Use WISDOM acronym for next presentation/talk

### Other Notes

Oxford dictionary downloaded and looked up the words I highlighted in the kindle app!
Typo in the table of contents. Kaizen!

url: https://raw.githubusercontent.com/Ehryk/ehryk.github.com/1a7201ec8bd404c3a8363a57eaa783777f674d84/notes/The Pragmatic Programmer - Chapter 1.md

filename: The Pragmatic Programmer - Chapter 1.md


text:
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lernajs.io/)
[![CircleCI](https://circleci.com/gh/hardchor/monorepo.svg?style=svg)](https://circleci.com/gh/hardchor/monorepo) [![Greenkeeper badge](https://badges.greenkeeper.io/hardchor/monorepo.svg)](https://greenkeeper.io/)

# The Monorepo

My playground for different approaches to software development!
[The monorepo to rule all monorepos.](https://xkcd.com/927/)

## Contents

- [**hardchor-scripts**](./packages/hardchor-scripts/README.md): Tooling library to ease common set-ups
- [**serverless-appsync**](./packages/serverless-appsync/README.md): GraphQL-powered backend
- [**nextjs**](./packages/nextjs/README.md): Next.js frontend connecting to AppSync

repository: hardchor/monorepo

gha_language: JavaScript

repo_name: hardchor/monorepo


text:
---
layout:     post
title:      "Pandas time!"
subtitle:   "On data and visualization"
date:       2015-08-26 12:00:00
author:     "Eardil"
header-img: "img/post-bg-01.jpg"
---
Before I move on to trying more complicated things that I would do with MATLAB (e.g. 3D plotting), I want to learn the basics of the thing I would like to do on R, namely data crunching and visualization.

For that I will use [mtcars](https://stat.ethz.ch/R-manual/R-devel/library/datasets/html/mtcars.html) database because:

* It's simple.
* It's standard.
* [Flowers](https://stat.ethz.ch/R-manual/R-devel/library/datasets/html/iris.html) are boring.
* Saddly, there's no simple, standard, motorcycles database.

So first I need to load the `Pandas` library. This library will introduce the `DataFrame` object much like R's own `data.frame`.

{% highlight python %}
import pandas as pd
{% endhighlight %}

There's a package that brings RDatasets to Python, but I saved mtcars as a CSV (comma separated values) file because reading my own data from Python is a very important step. Which by the way is very easy:

{% highlight python %}
cars = pd.read_csv("mtcars.csv")
{% endhighlight %}

To print what I just read, there's a `head` function.  We could add a name like "carname", but in this case the name of the car represents a single row, so maybe we should use it as a name for the row instead of just $1,2,3,\dots$

{% highlight python %}
cars = pd.read_csv("mtcars.csv",index_col=0)
cars.head()
{% endhighlight %}

      mpg
      cyl
      disp
      hp
      drat
      wt
      qsec
      vs
      am
      gear
      carb

      Mazda RX4
      21.0
      6
      160
      110
      3.90
      2.620
      16.46
      0
      Manual
      4
      4

      Mazda RX4 Wag
      21.0
      6
      160
      110
      3.90
      2.875
      17.02
      0
      Manual
      4
      4

      Datsun 710
      22.8
      4
      108
      93
      3.85
      2.320
      18.61
      1
      Manual
      4
      1

      Hornet 4 Drive
      21.4
      6
      258
      110
      3.08
      3.215
      19.44
      1
      Automatic
      3
      1

      Hornet Sportabout
      18.7
      8
      360
      175
      3.15
      3.440
      17.02
      0
      Automatic
      3
      2

If you happen to know the dataset, you'll notice that I changed the variable `am` from binary to text. I did this to explore `pandas` use of categorical data from text.

Speaking of that, let's see how the data was saved in our variable.

{% highlight python %}
cars.info()
{% endhighlight %}

    <class 'pandas.core.frame.DataFrame'>
    Index: 32 entries, Mazda RX4 to Volvo 142E
    Data columns (total 11 columns):
    mpg     32 non-null float64
    cyl     32 non-null int64
    disp    32 non-null float64
    hp      32 non-null int64
    drat    32 non-null float64
    wt      32 non-null float64
    qsec    32 non-null float64
    vs      32 non-null int64
    am      32 non-null object
    gear    32 non-null int64
    carb    32 non-null int64
    dtypes: float64(5), int64(5), object(1)
    memory usage: 3.0+ KB

We can see some important data on the...data (Metadata?). How each variable is stored and the memory size of the DataFrame. This is a *really* small dataset, but with bigger files this would be more and more important to be aware of.

Other function that seems very useful is `describe`, which summarizes the columns in the most standard statistics: count,mean, standard deviation and quartiles.

{% highlight python %}
cars.describe()
{% endhighlight %}

      mpg
      cyl
      disp
      hp
      drat
      wt
      qsec
      vs
      gear
      carb

      count
      32.000000
      32.000000
      32.000000
      32.000000
      32.000000
      32.000000
      32.000000
      32.000000
      32.000000
      32.0000

      mean
      20.090625
      6.187500
      230.721875
      146.687500
      3.596563
      3.217250
      17.848750
      0.437500
      3.687500
      2.8125

      std
      6.026948
      1.785922
      123.938694
      68.562868
      0.534679
      0.978457
      1.786943
      0.504016
      0.737804
      1.6152

      min
      10.400000
      4.000000
      71.100000
      52.000000
      2.760000
      1.513000
      14.500000
      0.000000
      3.000000
      1.0000

      25%
      15.425000
      4.000000
      120.825000
      96.500000
      3.080000
      2.581250
      16.892500
      0.000000
      3.000000
      2.0000

      50%
      19.200000
      6.000000
      196.300000
      123.000000
      3.695000
      3.325000
      17.710000
      0.000000
      4.000000
      2.0000

      75%
      22.800000
      8.000000
      326.000000
      180.000000
      3.920000
      3.610000
      18.900000
      1.000000
      4.000000
      4.0000

      max
      33.900000
      8.000000
      472.000000
      335.000000
      4.930000
      5.424000
      22.900000
      1.000000
      5.000000
      8.0000

As a shortcut for visualization, there's another cool feature of pandas: we can call plot directly to the DataFrame. This allows to plot a histogram (or whatever) of some columns directly to see what we are doing. For this we need the plotting library.

{% highlight python %}
import matplotlib.pyplot as plt
%matplotlib inline
{% endhighlight %}

To select a single column of our data, pandas uses `[]`. So for example we can get the `mpg` variable and get the histogram right out of the DataFrame object with:

{% highlight python %}
cars['mpg'].hist()
plt.show()
{% endhighlight %}

![png](http://eardil.github.io/img/2015-08-26-pandas-time_files/2015-08-26-pandas-time_15_0.png)

Now we can visualize some `pandas` functionality. For example, we can easily group by type of transmission using the `groupby` function. I take cars, select the columns 'mpg' and 'am', then apply the `groupby` function to tell `pandas` I want to group by 'am', and that I want to summarize the rest using the function mean. Finally I plot it.

{% highlight python %}
cars[['am','mpg']].groupby('am').mean().plot(kind='bar')
plt.show()
{% endhighlight %}

![png](http://eardil.github.io/img/2015-08-26-pandas-time_files/2015-08-26-pandas-time_17_0.png)

How about a scatter plot? Maybe I would want to see the relationship between miles per gallon vs the horse power.

{% highlight python %}
plt.scatter(cars['mpg'],cars['hp'])
plt.show()
{% endhighlight %}

![png](http://eardil.github.io/img/2015-08-26-pandas-time_files/2015-08-26-pandas-time_19_0.png)

### What about beautiful plots?

By this time some may be missing ggplot because of its elegant style. Well, matplotlib has different possible styles, included the beloved ggplot, only by setting `style.use`

{% highlight python %}
plt.style.use('ggplot')
plt.scatter(cars['mpg'],cars['hp'])
plt.show()
{% endhighlight %}

![png](http://eardil.github.io/img/2015-08-26-pandas-time_files/2015-08-26-pandas-time_21_0.png)

There is also another library called `seaborn` that brings new styles to matplotlib and more visualization functions. It doesn't come with the Anaconda distribution, but it's really easy to get. You just open a terminal (cmd/powershell on windows), type `conda install seaborn` and you're done. Now you just load it to get more beautiful plots and can begin to use fun plots like the `regplot`, which performs linear regression directly in the plot. Plot, plot. I'm setting the figure size because seaborn figures come out a little bigger and

{% highlight python %}
import seaborn as sns
plt.figure(figsize=(5, 4))

sns.regplot('mpg','hp',data=cars)
{% endhighlight %}

    <matplotlib.axes._subplots.AxesSubplot at 0xc96cc88>

![png](http://eardil.github.io/img/2015-08-26-pandas-time_files/2015-08-26-pandas-time_23_1.png)

The dependence doesn't seem to be linear, let's try a polinomial regression.

{% highlight python %}
plt.figure(figsize=(5, 4))
sns.regplot('mpg','hp',data=cars,order=2)
{% endhighlight %}

    <matplotlib.axes._subplots.AxesSubplot at 0xc679908>

![png](http://eardil.github.io/img/2015-08-26-pandas-time_files/2015-08-26-pandas-time_25_1.png)

One of the things I didn't like about R, or more specifically R on Windows, is that plots don't seem to have any anti-aliasing. I haven't had that problem in Python, although you wouldn't notice anyway since these graphs are all un PNG format now, which would look equally great if I generated them in R. I took a screenshot with an equivalent plot generated in RStudio:

{% highlight R %}
library(ggplot2)

cars <- mtcars

ggplot(data = cars, aes(x=mpg,y=hp)) + geom_point() +
  stat_smooth(method="lm",formula = y ~ poly(x,2,raw=TRUE))
{% endhighlight %}

![ew](http://eardil.github.io/img/2015-08-26-pandas-time_files/Rsmooth.png)

*Look at that horrible line!*

If you have a workaround for turning on antialiasing on R for Windows I would very much appreciate it, since I've searched hungrily for it.

There's a ggplot library for Python too, although I read that it is a little buggy still. It would be really convenient to use the same graphic language when moving between Python and R. I needed to install it too by running `pip install ggplot` in the terminal. Notice that the `gsize` variable is just format and it's not necessary.

{% highlight python %}
from ggplot import *
gsize = theme_matplotlib(rc={"figure.figsize": "5, 4"}, matplotlib_defaults=False)

ggplot(aes(x='mpg',y='hp'),data = cars) + geom_point() + gsize
{% endhighlight %}

![png](http://eardil.github.io/img/2015-08-26-pandas-time_files/2015-08-26-pandas-time_27_0.png)

    <ggplot: (-9223372036841740621)>

I dropped the `stat_smooth` because there's no way to specify the model yet, apparently. Anyway there it is.

---

Remember that you can get this [IPython Notebook](https://github.com/eardil/Blog_Code/blob/master/2015-08-26-pandas-time/2015-08-26-pandas-time.ipynb) and others at my [Github Page](https://github.com/eardil).


text:
---
layout: post
title: "oneLineSystemMon: Simple Geeklet that shows cpu, memory, disk and transferred network data"
date: 2014-04-13 20:00:00 +0200
comments: true
categories: ["Admin", "OS X"]
---
When working with Linux you may be used to have a system monitor on your desktop like Conky or its ancestor Torsmo. If you are on OS X then you might like to use GeekTool for this purpose.

I put together a script for GeekTool that fits my needs. It will show up as a single line of text on your desktop and shows the load of your CPU, memory, disk and the transferred data on your network interfaces. The output is:

CPU 4.87% - MEM 5179M - SSD 70% - LAN IN:0 Bytes OUT:0 Bytes - WIFI IN:101.531 MiB OUT:13.687 MiB

If you wonder about the green and red color... this is just for my personal convenience to be able to quickly distinguish incoming and outgoing data.

You need a small python script called valueToIeee1541String.py to show the transferred bytes of the network interfaces in human readable format - e.g. "1.804 GiB" instead of "1936614762". You can get it from here [https://github.com/jewirth/valueToIeee1541String](https://github.com/jewirth/valueToIeee1541String). Please put in in ~/bin to make the geeklet work or edit the geeklet manually.

Download the Geeklet: [https://github.com/jewirth/oneLineSystemMon](https://github.com/jewirth/oneLineSystemMon)
Geeklets are associated with GeekTool which should start automatically when opening a Geeklet.

GeekTool can handle much more nice stuff than printing one line from a shell script. Google for "Geeklets" and have fun.

Update: I added a second Geeklet to my desktop directly below the above on. It shows the netstat output but only with certain socket states including 'listening'. It's too simple to provide a Geeklet file for this one. You just have to add a new Shell GeekLet with the following command in a single line:

netstat -a | grep -e ESTAB -e LIST -e CLOS -e SYN_ -e LAST_ -e _ACK -e FIN_ -e TIME_

This is how my two Geeklets will appear:

{% img left /images/geeklets.jpg 771 446  'image' 'images' %}

repository: jewirth/octopress

extension: markdown

repo_name: jewirth/octopress


text:
# phase-0-gps-1
Phase 0 GPS 1.1

 1881  git clone git@github.com:prestidigitation/phase-0-gps-1.git
 Clones a remote repository to your local machine.
 1882  ls
 1883  cd phase-0-gps-1
 1884  ls
 1885  cat LICENSE
 1886  cat README.md
 1887  touch awesome_page.md
 1888  git add awesome_page.md
 Staging the file for commit.
 1889  git status
 Displays file staging status.
 1890  git commit -m "Added awesome_page.md"
 Takes a snapshot of current repo state, with a descriptive message.
 1891  git status
 1892  git push origin master
 Push the committed changes to master branch of origin (remote repo).
 1893  git branch
 Displays list of branches in repo.
 1894  git checkout -b add-command-log
 Creates a new branch with -b flag and switches to that branch.
 1895  git branch
 1896  subl README.md


text:
# fastweb <img align="right" src="s-fastweb.png" />

fastweb is a very simple HTTP and HTTPS server for static files.

fastweb is designed to serve a small amount of rarely-changing data to a large number of clients. On startup, it loads all the files in all the given data directories into memory so they can be served without any unnecessary data copying. It also generates compressed versions of each file for fast responses to clients that support the gzip content encoding.

fastweb supports reloading the dataset and updating the executable with no downtime. To do so, send the existing server process a SIGHUP. It will also check the data directories and SSL certificate and key (if provided) for changes periodically and reload if anything has changed.

## Building

0. Make sure CMake, libevent, zlib, and OpenSSL are installed.
1. Build and install [phosg](https://github.com/fuzziqersoftware/phosg).
2. Run `cmake . && make`.

## Running

Run fastweb with no arguments to see how to use it. For most use cases, the following arguments suffice: `/path/to/fastweb --listen=$PORT $DATA_DIRECTORY`. You might want to give the `--index` or `--404` options to set the index and error page contents.

The contents of the data directories as of the server's startup time will be available at the root. For example, if the data directory is `/home/fuzziqersoftware/fastweb-data` and this directory contains `dir1/file1.txt`, then the contents of this file will be available at `http://server-address:port/dir1/file1.txt`. fastweb automatically guesses the MIME type based on the file extension and supports many common file types.

fastweb supports static redirects and aliases using symbolic links. If a symlink points to an existing file in any data directory, the same data will be available at the file's path and the symlink path. If a symlink points to a file outside any of the data directories, that file is accessible only at the symlink path. If a symlink is broken, it's served as a 301 redirect - external redirects can be implemented this way by just making symlinks to e.g. `http://example.com/target/path`. (These symlinks will be unresolvable/broken on the local filesystem, of course.)

### SSL setup

If you want to serve HTTPS traffic, you'll have to do a little more work. Get an SSL certificate and private key (you can use [Let's Encrypt](https://letsencrypt.org/) for this, for example), and put them somewhere where fastweb can read them. (But don't put them in any of your public data directories!) Then run fastweb with the --ssl-cert, --ssl-ca-cert, and --ssl-key options pointing to the relevant filenames, and use --ssl-listen or --ssl-fd to open an SSL port. fastweb will serve the same data over HTTP and HTTPS, so if you want to serve both protocols but have different data available via each, you'll have to run two instances of fastweb.

If you use Let's Encrypt (and Certbot), you can set up a deploy hook so that fastweb's certificate gets automatically updated when Certbot automatically renews it. Just put a script like this in the `/etc/letsencrypt/renewal-hooks/deploy` directory and `chmod +x` it:

    #!/bin/sh

    set -e

    for domain in $RENEWED_DOMAINS; do
      # Change this to the directory where you want to keep fastweb's SSL files
      DESTINATION_DIR=/etc/fastweb
      umask 077
      cp "$RENEWED_LINEAGE/fullchain.pem" "$DESTINATION_DIR/cert.pem"
      cp "$RENEWED_LINEAGE/chain.pem" "$DESTINATION_DIR/chain.pem"
      cp "$RENEWED_LINEAGE/privkey.pem" "$DESTINATION_DIR/key.pem"
      chown www-data "$DESTINATION_DIR/cert.pem" "$DESTINATION_DIR/chain.pem" "$DESTINATION_DIR/key.pem"
      chmod 400 "$DESTINATION_DIR/cert.pem" "$DESTINATION_DIR/chain.pem" "$DESTINATION_DIR/key.pem"

      # fastweb automatically reloads when its ssl cert/key files change, so we
      # don't need to do anything here
    done

This script only works if you have a single certificate, but that certificate can be for multiple domains.

During the reload procedure, fastweb cannot get root privileges again. This means that if reloading is enabled (as it is by default) and you use the --user option, then the SSL key and certificate must be readable by the specified user, and not only by root. (Similarly, all files in the data directories must be readable by the specified user.)

### Example

This is how I run fastweb for my personal website.

    sudo fastweb \
        --user=www-data \
        --listen=80 \
        --ssl-listen=443 \
        --ssl-cert=/fastweb-data/ssl/cert.pem \
        --ssl-ca-cert=/fastweb-data/ssl/chain.pem \
        --ssl-key=/fastweb-data/ssl/key.pem \
        --index=/index.html \
        --404=/404.txt \
        --mtime-check-secs=5 \
        /fastweb-data/public

`sudo` is only needed so that fastweb can listen on ports 80 and 443; it drops privileges to `www-data` before accepting any connections. Everything in /fastweb-data is chown'd to www-data:www-data.

repository: fuzziqersoftware/fastweb

repo_name: fuzziqersoftware/fastweb


text:
# Java Selenium Framework for use with TestModeller.io
Open source repository of Java based selenium tests. For use with [TestModeller.io](http://www.testmodeller.io)

**NOTE:** Targets Java 8 only out of the box.

# Getting started
1. Clone this repository.
2. Install the Java Development Kit
3. Install ChromeDriver (this needs to match the version of chrome you will be executing your tests on) and make sure you add it to your system PATH.
4. Install Maven - this is used to manage the build process of our automation framework.
5. Copy generated page objects into the 'src\main\java\pages' directory.
6. Copy generated tests into the 'src\test\java\tests' directory.
7. To execute tests run 'mvn test'.


text:
# Plectilospermum T.N. Taylor & E.L. Taylor, 1987 GENUS

#### Status
ACCEPTED

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

#### Published in
American Journal of Botany 74: -. [904-913]

#### Original name
null

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
---
title: Rules for disease, and a random disease generator
tags: [osr, disease, rules]
desc: You have died of dysentery
layout: post
---

So your band of dirty murderhobos have been digging up ancient sealed grave sites and trudging through filthy swamps with open wounds.
Those smelly rations they're eating have been riding in their packs for a while now.
The swords those goblins were wielding were coated in putrid festering gore.
Adventuring is dirty, gross work.
<!-- more -->

It only makes sense that disease and infection would be a significant part of the adventuring lifestyle.
Despite this most systems handle them in a way that is rather flat and boring.
Either the disease does nothing until the poor fool who contracted it drops dead, or the disease just sidelines the character until it passes.
That is, of course, unless there's a 3rd level Cleric in the party.
In that case they simply cast "Diseaseus Deletus" and it's like it never happened.

When diseases come up in my games I want them to have more interactivity and unpredictability than this.
This is a first stab at some rules to codify that.

## Disease Rules

There are several ways that adventurers can contract diseases.
Some monsters are disease carriers, triggering a save vs poison to avoid infection any time they land a melee attack.
Any time a character rolls on the Death and Dismemberment table and survives, they have a 1 in 12 chance of contracting a random disease.
Any time a character takes a serious injury there's a 1 in 10 chance that they'll contract a random disease.
Each day spent in filthy conditions (marching through swamp water, crawling around in sewers, etc) results in a 1 in 20 chance of contracting a random disease,
unless the party takes special measures to protect themselves.

Diseases have a **Duration** and a **Severity**.
When a character contracts a disease, they begin to show symptoms in **1d6 days**.
While they are suffering the effects of the disease, they will have a **setback die** placed on all their d20 attribute tests.

The **setback die** begins at a d4, which is rolled along side the d20 and both dice are summed together.
Each morning after the first, if the setback die is smaller than the **Severity** of the disease they have contracted,
the character makes a CON test.

If the listed **Severity** for the particular disease is "Death", then once the setback die reaches a d12, the character must save vs death on subsequent mornings.

Medicine can reduce the size of the **setback die** one step once per day.
Receiving treatment from a PC with the medicine skill can reduce the **setback die** an additional step per day on a successful INT test.
A town doctor can reduce both the **Severity** and the **Duration** by half, for a price.

Reducing the setback below d4 does not cure the disease, it merely treats (some of) the symptoms.
Once the **Duration** has passed (counting from when symptoms show) the character can make a save vs poison to break the disease and recover.
Diseases with a **Duration** of "Permanent" require special treatment to recover from.

In addition to the **setback die**, diseases may impose other effects.
For instance Mummy Rot reduces the effects of all forms of healing by half.
Special effects persist until the disease is healed, even if the setback is reduced below d4.

## Random Disease Generator

|	**d12**	|	**Prefix**	|	**Modifier**	|	**Target**	|	**Affliction**	|
|	1	|	Acute		|	Blistering	|	Skin		|	Malady		|
|	2	|	Rapid		|	Weeping		|	Stomach		|	Miasma		|
|	3	|	Craven		|	Manic		|	Eye		|	Infection	|
|	4	|	Apoplectic	|	Consumptive	|	Flesh		|	Bloat		|
|	5	|	Malignant	|	Fading		|	Tongue		|	Rash		|
|	6	|	Languid		|	Burning		|	Foot		|	Sores		|
|	7	|	Sanguineous	|	Itching		|	Ear		|	Fever		|
|	8	|	Spasmodic	|	Shivering	|	Brain		|	Blight		|
|	9	|	Scarlet		|	Withering	|	Lung		|	Pox		|
|	10	|	Prolonged	|	Necrotic	|	Blood		|	Plague		|
|	11	|	Chronic		|	Debilitating	|	Chest		|	Atrophy		|
|	12	|	Putrid		|	Festering	|	Soul		|	Rot		|

Either roll once per column or roll once and read across.

Come up with at least one special effect based on the result.
For instance "Craven Manic Tongue Fever" might cause the character to loudly make rude and obscene exclamations at inopportune times.

**Duration** is equal to the sum rolled for Prefix + Modifier in days, with a roll of 14+ being Permanent.

**Severity** is equal to the smallest die that could roll the result of Target + Affliction, with 12+ being Death.
For example Stomach(2) + Infection(3) = 5 so d6 **Severity**.

Putting it all together, rolling 4, 8, 6, and 3 results in:
* "Apoplectic Shivering Foot Infection"
    * 12 Days **Duration**
    * d10 **Severity**
    * "Shivering"; It's hard to carry a full pack when you have the shakes, occupies 2 inventory slots until cured.
    * "Foot Infection"; Reduces walking speed by half.


text:
For this scenario, Katacoda has just started a fresh Kubernetes cluster for you. Verify that it's ready for your use.

`kubectl version --short && \
kubectl get componentstatus && \
kubectl get nodes && \
kubectl cluster-info`{{execute}}

The [Helm](https://helm.sh/) package manager used for installing applications on Kubernetes is also available.

`helm version --short`{{execute}}

## Kubernetes Dashboard ##

You can administer your cluster with the `kubectl` CLI tool or use the visual Kubernetes Dashboard. Use this script to access the protected Dashboard.

`token.sh`{{execute}}

repository: litmusbot/katacoda-courses

repo_name: litmusbot/katacoda-courses


text:
# linear_operator
[WIP] A LinearOperator implementation for PyTorch

## Examples
See the [examples folder](https://github.com/gpleiss/linear_operator/tree/main/examples).

[![Documentation Status](https://readthedocs.org/projects/linear-operator/badge/?version=latest)](https://linear-operator.readthedocs.io/en/latest/?badge=latest)


text:
1.1.0
=====

* (feature) Add static site export.

1.0.3
=====

* (improvement) Show the web debug toolbar when viewing the preview in full screen.

1.0.2
=====

* (bug) Re-add accidentally removed whitespace in title.

1.0.1
=====

* (improvement) Allow `21torr/assets ^2.0`.

1.0.0
=====

* (feature) Added docs for components.
* (improvement) Simplified internal implementation.
* (feature) Added per-component config (as front matter in docs).
* (feature) Add global docs.
* (feature) Add custom pages.
* (improvement) Add link to open component in new window.

0.3.1
=====

* (improvement) Require newer `21torr/assets` version.
* (bug) Add missing parameter passing.

0.3.0
=====

* (feature) Add option to disable umbrella in production.

0.2.0
=====

* (improvement) Add minimal styling.
* (feature) Add first draft of docs.
* (improvement) Remove profiler in preview.

0.1.0
=====

* Add support for variations via `{{ umbrella_variations() }}`

gha_language: PHP


text:
![REQUTRAP](./docs/assets/images/banner.png)

[![Go Report](https://goreportcard.com/badge/github.com/libidev/requtrap.go)](https://goreportcard.com/report/github.com/libidev/requtrap.go)
![Downloaded](https://img.shields.io/github/downloads/libidev/requtrap.go/total)

API Gateway is service that handle all request from client and forward to any services.
More detail about API Gateway, you can see [here](https://www.nginx.com/learn/api-gateway/).

RequTrap will help you in implementing API Gateway. It is simple and fast, you can use it easily, sure.

![example](./docs/assets/images/example.gif)

# Configuration
You can configure RequTrap by creating a YAML file which
contain configuration schema. It will look like example below.

```yml
name: book-store
host: <IP_ADDRESS>
port: 8080
services:
  - path: /books
    upstream: http://<IP_ADDRESS>:8001
  - path: /authors
    upstream: http://<IP_ADDRESS>:8002
.
.
.
```

If you want to configure CORS, just put example bellow
at bottom of YAML configuration file.

```yml
.
.
.
cors:
  enable: true
  methods:
    - GET
    - POST
    - PUT
    - DELETE
  origins:
    - http://localhost:3000
.
.
.
```

If your authentication service using JWT (JSON Web Token),
just give little information on API gateway config.

```yml
.
.
.
authentication:
  type: jwt
  upstream: http://localhost:8000
.
.
.
```

# CLI Commands
### Starting API Gateway
`requtrap start [path/to/configuration.yml]`

### Stoping API Gateway
`requtrap stop [gateway-name]`

### More
`requtrap help [command]`

# Contribution
Please make sure to read the [Contributing Guide](./CONTRIBUTING.md) before making a pull request.

## License
[MIT](./LICENSE)


text:
---
id: 357
title: MarsEdit, WordPress, Planet, and minor updates
date: 2007-11-01T15:45:51+00:00
author: David Ascher
layout: post

restapi_import_id:
  - 5780561eab8f6
original_post_id:
  - "357"
categories:
  - Blogging
  - LazyWeb
  - Web
---
Dear LazyWeb,

I use MarsEdit to author my blog posts, then publish to WordPress 2.2, and see some of my posts aggregated by some Planet sites.

Every now and then I need to make a minor change, and that seems to result in resyndication so that readers of the planet feed get duplicates.

Is there a trick in either MarsEdit or WordPress to identifying minor updates?


text:
---
title: angular observables
date: 2018-03-24 17:03:43
---

## What is an Observable?
- an **observable** a function that handles a set of values represented over time
- an **observer** is an object that the observable uses to perform actions on the data set based on whether the event is **next**, **complete**, or **error**.

- related: [observables vs promises](promises-observables)

### **example: Complete**
*
    ```
    const myObservable: Observable<string> = Observable
    .create((observer: Observer<string>) => {
        setTimeout(() => {
            observer.next('first package');
        }, 2000);
        setTimeout(() => {
            observer.next('second package');
        }, 4000);
        setTimeout(() => {
            observer.complete();
        }, 6000);
        setTimeout(() => {
            observer.next('third package');
        }, 8000);
        });
        myObservable.subscribe(
            (data: string) => { console.log(data);},
            (error: string) => { console.log(error);},
            () => { console.log('completed');},
        );
    ```

* the above will output:

    ```
    first package
    second package
    completed

    ```
* the `observer.complete()` function will terminate the subscription to the observable, therefore the 'third package' console log will never get executed.

### **example: Error**
*
    ```
        const myObservable: Observable<string> = Observable
        .create((observer: Observer<string>) => {
            setTimeout(() => {
                observer.next('first package');
            }, 2000);
            setTimeout(() => {
                observer.next('second package');
            }, 4000);
            setTimeout(() => {
            observer.error('error');
            }, 6000);
            setTimeout(() => {
                observer.next('third package');
            }, 8000);
            });
            myObservable.subscribe(
                (data: string) => { console.log(data);},
                (error: string) => { console.log(error);},
                () => { console.log('completed');},
            );
    ```

* the above will output:

    ```
    first package
    second package
    error
    ```
* the `observer.error()` function will terminate and error out the subscription to the observable, therefore the 'third package' console log will never get executed.

### Subscribing and Unsubscribing
* **Subscribing** to an observable lasts for its entire lifetime. the below code snippet will cause a memory leak by continuously console logging "2 seconds has passed" every two seconds for the entire lifetime of the application.
* **example:**

    ```
        export class HomeComponent implements OnInit{
            private numbersSubscription: Subscription;

        constructor() { }

        ngOnInit(): void {
            const myObservable: Observable<string> = Observable
            .create((observer: Observer<string>) => {
                setInterval(() => {
                    observer.next('2 seconds has passed');
                }, 2000);
            });

            this.numbersSubscription = myObservable.subscribe(
                (data: string) => { console.log(data);},
                (error: string) => { console.log(error);},
                () => { console.log('completed');},
            );
        }
    }
    ```

* In order to prevent this, you can **unsubscribe** to your observable to terminate its subscription.
* **example:**

    ```
        export class HomeComponent implements OnInit, OnDestroy {
            private numbersSubscription: Subscription;

        constructor() { }

        ngOnInit(): void {
            const myObservable: Observable<string> = Observable
            .create((observer: Observer<string>) => {
                setInterval(() => {
                    observer.next('2 seconds has passed');
                }, 2000);
            });

            this.numbersSubscription = myObservable.subscribe(
                (data: string) => { console.log(data);},
                (error: string) => { console.log(error);},
                () => { console.log('completed');},
            );
        }

        ngOnDestroy(): void {
            this.numbersSubscription.unsubscribe();
        }
    }
    ```


text:
# CMD AutoTest

The CMD autotest automatically performs the tasks you need to perform when performing multiple tests on the TASH command and determines the results.

### Prerequisites
Install python3, pyserial(at pip3)

### How to USE
$ python cmdautotest.py serial_port

ex)
$ python cmdautotest.py /dev/ttyUSB1

repository: Samsung/TizenRT

gha_language: C

repo_name: Samsung/TizenRT


text:
# Chakula Frontend
This is the client-side web application for Chakula. It is built in Javascript using React and React-router.

# Compilation
You will need [Browserify](http://browserify.org/) and [Less](http://lesscss.org/) to compile the app.
Enter the repo and execute the following commands:

```
browserify -d -t reactify js/src/app.js -o js/build/app.js

lessc css/src/app.less > css/build/app.css
```

repository: agreea/chakula-frontend

repo_name: agreea/chakula-frontend


text:
The result is: `match:123 4`.

First the lazy `pattern:\d+?` tries to take as little digits as it can, but it has to reach the space, so it takes  `match:123`.

Then the second `\d+?` takes only one digit, because that's enough.


text:
# gNMI Simulator User Manual

The configuration is loaded by default from [target_configs/typical_ofsw_config.json](target_configs/typical_ofsw_config.json)

## Create the docker image
```bash
docker build -t devicesim -f Dockerfile .
```

## Run 3 devices with Docker Compose
Run 3 gNMI devices with
```bash
docker-compose -f docker-compose-gnmi.yml up
```

This gives an output like
```bash
Creating devicesim_devicesim3_1 ...
Creating devicesim_devicesim1_1 ...
Creating devicesim_devicesim2_1 ...
Creating devicesim_devicesim3_1
Creating devicesim_devicesim2_1
Creating devicesim_devicesim1_1 ... done
Attaching to devicesim_devicesim3_1, devicesim_devicesim2_1, devicesim_devicesim1_1
devicesim3_1  | gNMI running on localhost:10163
devicesim2_1  | gNMI running on localhost:10162
devicesim1_1  | gNMI running on localhost:10161
```

> This uses port mapping to make the devices available to gNMI clients and is the
> only option for running on Mac or Windows, and can be used with Linux too.

### Running on Linux
If you are fortunate enough to be using Docker on Linux, then you can use the
above method __or__ the alternative:

```bash
docker-compose -f docker-compose-linux.yml up
```

This will use the fixed IP addresses <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS> for
device1-3. An entry must still be placed in your /etc/hosts file for all 3 like:
```bash
<IP_ADDRESS> device1.opennetworking.org
<IP_ADDRESS> device2.opennetworking.org
<IP_ADDRESS> device3.opennetworking.org
```

> This uses a custom network 'simnet' in Docker and is only possible on Docker for Linux.
> If you are on Mac or Windows it is __not possible__ to route to User Defined networks,
> so the port mapping technique must be used.

> It is not possible to use the name mapping of the docker network from outside
> the cluster, so either the entries have to be placed in /etc/hosts or on some
> DNS server

## gNMI Command Line Interface (CLI)

To use gNMI CLI, you have two options:

1. (**Recommended Option**): you can install the gNMI CLI on your own machine using the following command and run it as an external application to the Docker containers. This option allows you to connect to any of the targets and run the gNMI CLI commands.
```bash
go get -u github.com/openconfig/gnmi/cmd/gnmi_cli
go install -v github.com/openconfig/gnmi/cmd/gnmi_cli
```
2. You can ssh into any of the targets using the following command and run
the gNMI CLI from the Docker container.
```bash
docker exec -it <Container ID> /bin/bash
```

### Get the capabilities
```bash
gnmi_cli -address localhost:10161 \
       -capabilities \
       -timeout 5s \
       -client_crt certs/client1.crt \
       -client_key certs/client1.key \
       -ca_crt certs/onfca.crt \
       -alsologtostderr
```

If you get
```bash
E0416 15:23:08.099600   22997 gnmi_cli.go:180] could not create a gNMI client: Dialer(localhost:10161, 5s): context deadline exceeded
```
It indicates a transport problem - see the [troubleshooting](#deadline-exceeded) section below.

### Retrieve the motd-banner
```bash
gnmi_cli -address localhost:10162 \
       -get \
       -proto "path: <elem: <name: 'system'> elem:<name:'config'> elem: <name: 'motd-banner'>>" \
       -timeout 5s \
       -client_crt certs/client1.crt \
       -client_key certs/client1.key \
       -ca_crt certs/onfca.crt \
       -alsologtostderr
```

This gives a response like
```bash
notification: <
  timestamp:<PHONE_NUMBER>239352362
  update: <
    path: <
      elem: <
        name: "system"
      >
      elem: <
        name: "config"
      >
      elem: <
        name: "motd-banner"
      >
    >
    val: <
      string_val: "Welcome to gNMI service on localhost:10162"
    >
  >
>

```

## Run a single docker container
If you just want to run a single device, it is not necessary to run docker-compose.
It can be done just by docker directly, and can be handy for troubleshooting.
```bash
docker run --env "HOSTNAME=localhost" --env "GNMI_PORT=10164" -p "10164:10164" devicesim
```
To stop it use "docker kill"

## Troubleshooting

### Deadline exceeded
If you get an error like
```bash
E0416 15:23:08.099600   22997 gnmi_cli.go:180] could not create a gNMI client:
Dialer(localhost:10161, 5s): context deadline exceeded
```

or anything about __deadline exceeded__, then it is **always** related to the
transport mechanism above gNMI i.e. TCP or HTTPS

#### TCP diagnosis
> This is not a concern with port mapping method using localhost and is for
> the Linux specific option only

Starting with TCP - see if you can ping the device
1. by IP address e.g. <IP_ADDRESS> - if not it might not be up or there's some
   other network problem
2. by short name e.g. device1 - if not maybe your /etc/hosts file is wrong or
   DNS domain search is not opennetworking.org
3. by long name e.g. device1.opennetowrking.org - if not maybe your /etc/hosts
   file is wrong

For the last 2 cases make sure that the IP address that is resolved matches what
was given at the startup of the simulator with docker.

#### HTTP Diagnosis
If TCP shows reachability then try with HTTPS - it's very important to remember
that for HTTPS the address at which you access the server **must** match exactly
the server name in the server key's Common Name (CN) like __localhost__ or
__device1.opennetworking.org__ (and not an IP address!)

Try using cURL to determine if there is a certificate problem
```
curl -v https://localhost:10164 --key certs/client1.key --cert certs/client1.crt --cacert certs/onfca.crt
```
This might give an error like
```bash
* Rebuilt URL to: https://localhost:10163/
*   Trying <IP_ADDRESS>...
* TCP_NODELAY set
* Connected to localhost (<IP_ADDRESS>) port 10163 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: certs/onfca.crt
  CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Request CERT (13):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS handshake, CERT verify (15):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=CA; L=MenloPark; O=ONF; OU=Engineering; CN=device3.opennetworking.org
*  start date: Apr 16 14:40:46 2019 GMT
*  expire date: Apr 15 14:40:46 2020 GMT
* SSL: certificate subject name 'device3.opennetworking.org' does not match target host name 'localhost'
* stopped the pause stream!
* Closing connection 0
* TLSv1.2 (OUT), TLS alert, Client hello (1):
curl: (51) SSL: certificate subject name 'device3.opennetworking.org' does not match target host name 'localhost'
```

> In this case the device at __localhost__ has a certificate for
> device3.opennetworking.org. HTTPS does not accept this as a valid certificate
> as it indicates someone might be spoofing the server. This happens today in
> your browser if you access a site through HTTPS whose certificate CN does not
> match the URL - it is just a fact of life with HTTPS, and is not peculiar to gNMI.

When device names and certificates match, then curl will reply with a message like:
```bash
curl: (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2)
```

> This means the HTTPS handshake was __successful__, and it has failed at the
> gNMI level - not surprising since we did not send it any gNMI payload. At this
> stage you should be able to use **gnmi_cli** directly.

repository: adibrastegarnia/onos-config

repo_name: adibrastegarnia/onos-config


text:
# Loan-Approval-Prediction
To view the code with exploratery plotly graphs click on below link...

https://nbviewer.jupyter.org/github/OMIII1997/Loan-Approval-Prediction/blob/master/Loan_Approval_Prediction.ipynb

Loan approval prediction is traditional preoblem and given at various Hakathon on various platforms such as Kaggle, Analyticsvidhya.
Training datset consists of Gender, Married,	Dependents,	Education,	Self_Employed,	ApplicantIncome,	CoapplicantIncome,	LoanAmount,	Loan_Amount_Term,	Credit_History,	Property_Area and Loan_Status (Approved/Rejected). Using this data a Machine Learning model is to create such that next time it will predict that if Loan for particular application is to approve or not.

To understand the data and to get most possible information from the data Explorary Data Analysis is done as first part.
Plotly, Matplotlib and Seaborn python libraries are used for data visualization.
plotly 4.9.0
matplotlib 3.3.0
seaborn 0.10.0

To try most possible ways to get maximum accuracy number of Machine Learning Algorithms are tried with data with Parameter tunning.
Also tried with Voting Ensemble Method. Aim was to check efficiency of classifiers on the given data.

Extream Gradient Boosting
Random Forest
Decision Tree
Gradient Boosting
Ada Boost
Support Vector Machine
Logistic Regression
Linear Discriminant Analysis
KNearest Neighbors
Gaussian Naivey Bayes

Maximum accuracy achieved by Random Forest of 83.88%.
Average accuracy achieved by all classifiers is 83.11%.

More improvement in terms of Data analysis , Data wrangling, Model selection will be tried to increase accuracy.

# Graphs:->

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(114).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(115).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(116).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(117).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(118).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(119).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(120).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(121).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(122).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(123).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(124).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(125).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(126).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(127).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(128).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(129).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(130).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(131).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(132).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(133).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(134).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(135).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(136).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(137).png)

![alt text](https://github.com/OMIII1997/Loan-Approval-Prediction/blob/master/Graphs/Screenshot%20(138).png)


text:
# IceCI Go example - Gin API

This repository is a small example to help you get started building **IceCI** pipelines for Go applications.

The application itself is a very simplified example of a web API with tests. It's not by any means a guideline on building Go applications - its only purpose is showcasing how to build IceCI pipelines for Go applications.

This repository is a *GitHub template repository*, so please feel free to create new repositories based on it and mess around with the code and the pipeline config. Please also check the information below for a list of prerequisites needed to run the pipeline in IceCI.

# Setting up IceCI

To launch the pipeline in IceCI you have to create 2 secrets - both of which are explicitly referenced in the `.iceci.yaml` file.

* `dockerhub` - docker hub credentials with `docker.io` set as registry.

* `slack-webhook` - a generic secret with hook for Slack notifications - it can be ignored by commenting out the `slack-notify` step as well as the `slack-notify-error` failure handler in the pipeline definition file.

You can also find some additional info in the comments of the `.iceci.yaml` file itself.

---

Kept cool 🧊 by [Icetek](https://icetek.io/)

repository: IceCI/example-go-gin-api

gha_language: Go

repo_name: IceCI/example-go-gin-api


text:
# CoolBot

### Synopsis
CoolBot is a bot mainly used for Discord users to add quotes for the bot to use on command. The Discord bot also works in tandem with a Twitter bot, as quotes requested on Discord, if added to the bot, can also be displayed on Twitter.

The bot accepts quotes in the form of text, images, and videos and picks one quote at random to send into a Discord server with the command `+quote`, and users can request that a quote be added with the command `+requestquote` followed by their quote. Requested quotes are looked at by the bot's owner to decide if it should be added. A very brief set of rules for requesting quotes can be found by typing `+quoterules`.

 Without her assistance, I probably wouldn't have been able to put in some of the features CoolBot has now.

### Before we start...
First of all, let's get this out of the way: I don't care about what you do with this code so long as it's not done for profit and I still get credit for the creation of the original project. **Please do not take my Twitter link out of the `help` command!!**

It would also be greatly appreciated if you open-sourced your project, but this isn't required.
All-in-all, just play fair!

Finally, for something a little stupid: you may notice that CoolBot sometimes sends [this GIF](https://tenor.com/view/troll-face-rage-comics-trolled-meme-gif-19882304).  I really don't think this needed to be explained, but hey, better safe than sorry.

### Prerequisites
The following NodeJS modules are REQUIRED to successfully run a CoolBot clone:
* Discord.js
* Cron
* hastebin-gen
* discord-buttons

Also, the following Python modules are required to run the Twitter bot:
* Tweepy
* Advanced Python Scheduler

### Getting started

A `prereqs.json` file has been provided to get your bot started. Simply copy the things needed into the file. Quotes are kept in, of course, the `quotes` folder, and support TXT files for simple string quotes, as well as multiple image and video filetypes.

Also, there's a function for changing a specific channel's topic to a random quote every night at midnight. You can either disable this by removing the `topicChange` Cron job in `bot.js` or you can configure it to a channel of your choice by changing the `main_channel` variable in `prereqs.json`, so long as your bot has permission to manage channels in the server your channel is in.

Keep in mind, though: this MAY become a publicly usable feature in the future. If this happens, this section will be removed from the README.

``requests_channel`` is a variable meant to house the ID for the Discord channel all requests will be sent to by your bot. You might want to make sure this specific channel is something only you or anyone you trust should be able to see.

``log_channel`` is a variable meant for a logging feature currently in development that sends messages to a private channel when the bot does many things, such as creating and deleting guilds, catching errors, and sending quotes. I would recommend against using this for now.

### Commands
Commands should be pretty straightforward to add. Every usable command in CoolBot will be a part of this repository, but here's a template for a new command in case you need it:
```
module.exports =
{
  name: '',
  description: '',
  ownerOnly: false,
  //cooldown: 0,
  execute(bot, msg, args)
  {
    //Add your code here
  }
}
```
Also, as you can see in the commands that manage quotes, make sure you're calling `prereqs.json` and/or any modules you need in your file, otherwise your command will return an error.

 If you have any question or concerns, let me know on my [Twitter](https://twitter.com/defnotreal_) or friend me on Discord: defnotreal_#5123.

 Take it easy.

repository: defnotreal/CoolBot

repo_name: defnotreal/CoolBot


text:
# Using Dask

description: learn how to read from cloud data and scale PyData tools (Numpy, Pandas, Scikit-Learn, etc.) with [Dask](https://github.com/dask/dask)

"Dask natively scales Python" and "provides advanced parallelism for analytics, enabling performance at scale for the tools you love." It is open source, freely available, and sits in the [PyData ecosystem](https://github.com/pydata) of tools, develop in coordination with other projects like Numpy, Pandas, and Scikit-Learn. It provides familiar APIs for Python users, allows for low-level customization and streaming with a futures API, and scales up on clusters.

Dask is often compared to Spark - see [this page](https://docs.dask.org/en/latest/spark.html) to help evaluate which is the best tool for you. Common ML tools like Optuna, Scikit-Learn, XGBoost, LightGBM, and more can be distributed via Dask. There are numerous packages available for scaling on cloud clusters.

In this tutorial, the following notebooks demonstrate using Dask with Azure:

- [1.intro-to-dask](1.intro-to-dask.ipynb)


text:
# OmniScript

OmniScript is a repo for crowdsourced tutorials that covers most of programming languages (Java, C, C++, Python, etc..), frameworks (Ajax, AngularJS, etc..), IDEs (Arduino, Processing, etc..), and special libraries for (image processing, NLP, Chatbots, etc..)

Everyone is welcome to contribute to this repo regardless of your level of familiarity, contribute by adding to source code examples and/or writing a concise tutorial.

## Structure

1) A folder is dedicated to each language/framework/etc..

2) Inside each folder, there will be a series of markdown files to guide you from the very basics to the advanced knowledge, as well as  source code examples.

## Credits

[Ronreiter's interactive tutorials](https://github.com/ronreiter/interactive-tutorials) provided a solid base for this repo.

repository: LilFinch/OmniScript

repo_name: LilFinch/OmniScript


text:
<!-- Generated by zircon/scripts/update-docs-from-fidl, do not edit! -->
# zx_vcpu_write_state

## Summary

Write the state of a VCPU.

## Declaration

```c
#include <zircon/syscalls.h>

zx_status_t zx_vcpu_write_state(zx_handle_t handle,
                                uint32_t kind,
                                const void* buffer,
                                size_t buffer_size);
```

## Description

`zx_vcpu_write_state()` writes the state of *handle* as specified by *kind* from
*buffer*. It is only valid to write the state of *handle* when execution has
been paused.

*kind* may be **ZX_VCPU_STATE** or **ZX_VCPU_IO**.

`zx_vcpu_write_state()` must be called on the same thread *handle* was created
on.

## Rights

*handle* must be of type **ZX_OBJ_TYPE_VCPU** and have **ZX_RIGHT_WRITE**.

## Return value

`zx_vcpu_write_state()` returns **ZX_OK** on success. On failure, an error value
is returned.

## Errors

**ZX_ERR_ACCESS_DENIED** *handle* does not have the **ZX_RIGHT_WRITE** right.

**ZX_ERR_BAD_HANDLE** *handle* is an invalid handle.

**ZX_ERR_BAD_STATE** *handle* is in a bad state, and state can not be written.

**ZX_ERR_INVALID_ARGS** *kind* does not name a known VCPU state, *buffer* is an
invalid pointer, or *buffer_size* does not match the expected size of *kind*.

**ZX_ERR_WRONG_TYPE** *handle* is not a handle to a VCPU.

## See also

 - [`zx_guest_create()`]
 - [`zx_guest_set_trap()`]
 - [`zx_vcpu_create()`]
 - [`zx_vcpu_enter()`]
 - [`zx_vcpu_interrupt()`]
 - [`zx_vcpu_kick()`]
 - [`zx_vcpu_read_state()`]

[`zx_guest_create()`]: guest_create.md
[`zx_guest_set_trap()`]: guest_set_trap.md
[`zx_vcpu_create()`]: vcpu_create.md
[`zx_vcpu_enter()`]: vcpu_enter.md
[`zx_vcpu_interrupt()`]: vcpu_interrupt.md
[`zx_vcpu_kick()`]: vcpu_kick.md
[`zx_vcpu_read_state()`]: vcpu_read_state.md

repository: gnoliyil/fuchsia

repo_name: gnoliyil/fuchsia


text:
# PathResourceTypeNameCamelCase

## Category

ARM Error

## Applies to

ARM and Data Plane OpenAPI(swagger) specs

## Output Message

Resource type naming SHOULD follow camel case. Path: {your path}

## Description

Resource type or other identifiers (include: namespace, entityTypes) SHOULD follow camel case. (e.g. Microsoft.Insights/components/proactiveDetectionConfigs, not ProactiveDetectionConfig)

For more detail, pls refer to https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#172-casing

## CreatedAt

February 18, 2020

## LastModifiedAt

February 18, 2020

## How to fix the violation

Rename resource type or other identifiers as camel case in path.

Eg: In this case, you need to replace `ResourceGroups` with `resourceGroups` to follow camel case.

Invalid:

```
paths : { "/subscriptions/{subscriptionId}/ResourceGroups/{resourceGroupName}/providers/Microsoft.Computer/{name}" : {
    "get": {
       ...
    }
    "post": {
      ...
    }
  }
}
```

Valid:

```
paths : { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Computer/{name}" : {
    "get": {
       ...
    }
    "post": {
      ...
    }
  }
}
```

repository: Azure/azure-openapi-validator

gha_language: TypeScript

repo_name: Azure/azure-openapi-validator


text:
# style-elements experiment in Elm

Exercise in upgrading 4.2.1 style-elements package in Elm to the new experimental package.
# Demo
[stylish-elephants-experiments](https://jbrgfx.github.io/elm-style-elements-experiments/)

This experiment is a refactoring exercise of [style-elements](http://package.elm-lang.org/packages/mdgriffith/style-elements/4.2.1/Style) for Elm, v4.2.1 to the next version of the package.
Matthew Griffith is actively working on the next version.
This project is now using the latest version of the experimental package.
The latest stylish-elephants may be [read at elm-package](http://package.elm-lang.org/packages/mdgriffith/stylish-elephants/latest/).

The new version eliminates "StyleSheets" as they are known in the production package and moves all elements and styles into basic view functions inline.
This revision of style-elements reduces pain points and speeds development (IMHO).

This 2-column design is based on extensive work by Oliver Searle-Barnes, [opsb](https://github.com/opsb/cv-elm), who has published an advanced demo of the stylish-elephants experimental package. This example uses only a few of the available features that Oliver Searle-Barnes demonstrated, and even fewer of the experimental package's features. Searle-Barnes' work inspired this minor experiment, but my hope is that by demonstrating one way of reworking 4.2.1 code to exercise the new package, others will get working with the new package easily and find that experiments are fun and enjoyable to work with.

## Getting started

You need to have [Elm](http://elm-lang.org/) 0.18 installed on your machine.

Clone this repo.

Then generate it from within the new project's root directory using:

    elm reactor

And view it:
    localhost:8000/src/Main.elm

repository: jbrgfx/elm-style-elements-experiments

repo_name: jbrgfx/elm-style-elements-experiments


text:
# Polymorphism for Windows

This part is dedicated for Windows's users, if you need a refresh of what is a polymorphic program just click [here](https://github.com/PoCFrance/Whitecomet-Research/tree/master). Or if you looking for a Linux version click [here](https://github.com/PoCFrance/Whitecomet-Research/tree/master/Polymorphic/Linux-ELF) (we recommand you check this one out before trying to understand what's going on here).

To know what to crypt or where to find the key for instance, we used [sections (PE)](https://en.wikipedia.org/wiki/Portable_Executable#Layout), which you can see like drawers for your binary content (in the idea, it's pretty similar to the linux version).
The key(s) are stored in `.data` (which is a real native section), the payload function and some utils functions in `.code` (This section doesn't exist, we can create/alter an already existing sections with `__attribute__((section(x)))` ([variable](http://www.keil.com/support/man/docs/armcc/armcc_chr1359124977848.htm), [function](http://www.keil.com/support/man/docs/armclang_ref/armclang_ref_chr1384876160481.htm), [`#pragma`](https://docs.microsoft.com/fr-fr/cpp/preprocessor/section?view=vs-2019)).
In this version we're going to use 3 more (fake) keys to slow down reverse eng., each one of the four keys are going to be changed at each execution.

> *Payload :
> Component of a computer virus that runs the malicious commands.*

# How to use :

First of all, you need to refer your IP and a Port to use, in `src/main.c` line 22 and 24.
In order to use it over the internet, use your public IP and forward the associated port.
The size of the payload (important for encryption) is in `include/PE.h` as `KEY_SIZE`, change it accordingly.

     git clone https://github.com/PoCFrance/Whitecomet-Research.git
     cd Polymorphic/Windows-PE
     build_cmake_mingw.bat

Now you get a binary named "**PEFile_tests.exe**" this is the malware.
On your device use `nc -l [port]` to wait the reverse shell connexion.
Then, the binary must be executed on the victim's machine in order to work.
Congratulation you're connected !

## How it works (Almost the same as the Linux one):

There are three main parts in the malware : the Payload, Key and Cryptor. This is the exact same process on paper, we invite you to check our [Linux polymorphic binary]((https://github.com/PoCFrance/Whitecomet-Research/tree/master/Polymorphic/Linux-ELF)) to understand how everything works. Again, this part explain the process on paper, when coding, at lot of things are going to be different since we are on Windows.
This is the only modification we did to the process :

#### The Keys - Not Crypted
A random key regenerates at each execution of the program, used to decrypt the Payload. The key and the payload must have the same length in order to have an **One Time Pad encryption**([\*](https://en.wikipedia.org/wiki/One-time_pad)).
Here, we use 4 keys and rewrite on top of each one of them a new random one. We don't move the var. in other sections, because an initialized static global variable automatically goes to `.data`. The formula to get a specific key in `.data` just by it's index is in `PE.h`.

# Differences with the Linux version :
- In order to change page permissions (`change_section_permission.c`) we needed to change the functions called to some equivalent.
- We don't use a bool to know wether it's the first time the program is running, we just strcmp one of the keys with a determined value.
- Now we can get the base memory address from the binary itself (generally 0x400000). But it can change with different systems.
- We don't read(argv[0]) but GetModuleHandle(NULL)
- AntiViruses don't really care about Linux, so Windows protection is a lot better and harder to bypass :
  - We added two techniques : Allocating too much memory, to not run the program on simulated environements aswell as checking the name of the binary (if it's PEFile_tests.exe), cause if it isn't, it means we're probably in an AV system.
  - On Windows, a process can't delete a file that is already running, which is a problem for a program that rewrites itself. So we create some temporary files which we rename during execution, which is not the best solution but works for our proof of concept.

repository: PoCInnovation/Whitecomet-Research

repo_name: PoCInnovation/Whitecomet-Research


text:
Midisurf test files
================

In this folder you can find a few Midi files to test [Midisurf](../README.md) with, typically only with the main tune as a single instrument and shortened. Below you can find a bit more information about them:

| file name    | duration | file size | details |
|--------------|----------|-----------|---------|
|    ateam.mid |     0:43 |     0.9KB | Theme of the A-Team TV show |
| furelise.mid |     3:35 |     7.4KB | Beethoven - Fur Elise |
|      got.mid |     1:23 |     2.9KB | The Game of Thrones TV show main theme |
|   lamour.mid |     1:41 |     2.4KB | Main melody of Gigi D'Agostino's L'Amour Toujours |
|    mario.mid |     2:57 |    17.2KB | Main tune of the Super Mario game |
| metallca.mid |     0:51 |    12.9KB | Intro of Metallica's Nothing Else Matters |
|  panther.mid |     0:24 |     3.4KB | The Pink Panther theme |
|    short.mid |     0:09 |     0.3KB | A short and simple version of the Game of Thrones theme |
| starwars.mid |     0:19 |     0.4KB | Star Wars - Main theme |
|   tetris.mid |     0:35 |     0.8KB | Main tune of the game Tetris |
|  thatway.mid |     0:47 |    17.6KB | Adaptation of the Back Street Boys's I Want It That Way |
|    vader.mid |     0:30 |     0.9KB | Star Wars - Imperial March |
| wtsaints.mid |     0:30 |     0.4KB | When The Saints Go Marchin' In |

repository: CNugteren/midisurf

repo_name: CNugteren/midisurf


text:
# Setup

This guide focuses on specific updates to the Strapi setup related to our own needs and requirements. For more general information about Strapi, please refer to the [official documentation](https://strapi.io/documentation/developer-docs/latest/getting-started/introduction.html).

### One-time production setup

The steps below are needed to make our strapi instance deployment (and production) ready.

### ENV_PATH setup

Strapi takes [ENV_PATH](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.html#strapi-s-environment-variables) environment variable to decide which .env file it should use - it's best to override the `"scripts"` section of `package.json`. To make it work under both Windows and Unix-like systems, install `cross-env` beforehand:

```bash
yarn add -D cross-env
```

Then edit package.json as follows:

```
...
"scripts": {
"develop": "cross-env ENV_PATH='./.env.local' strapi develop",
"start": "strapi start",
"build": "strapi build",
"strapi": "strapi",
...
},
...

```

This will allow you to easily maintain different dev and prod env vars inside the git repo - we usually keep .env.local outside of git and commit `env.development` file, which the devs are encouraged to copy into their own `.env.local` which they can override. This system is not perfect, but seems reasonable enough in a system like Strapi which, by default, accepts only a single `.env` config file at once.

An example of `.env.local` file from `bratislava.sk` project:

```

HOST=<IP_ADDRESS>
PORT=1337
APP_KEYS=VivFhCHdok6Ui4H1yhF8DA==,fkXjik+gn+fRLqatGAE8QQ==,M8eRp3VNi4dzdfHOTBlT7w==,PODWh8urxrSZKWXWxiEV3w==
API_TOKEN_SALT=ilrHJDUcrKxGMpxyBh32VA==
ADMIN_JWT_SECRET=odOY9wudFDnl//bE+nVWAQ==
JWT_SECRET=U4RUqp1ohkwtt6gRopMtdg==

DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_NAME=strapi
DATABASE_USERNAME=strapi
DATABASE_PASSWORD=password
DATABASE_SCHEMA=public

```

### Production JWT Secrets

As of Strapi v4.3 (and unlikely to change in near future), the 'clean' Strapi init generates a few secrets for you into `.env` file - these are used as seeds to generate one-time tokens and thus the ones used in production shouldn't be stored in github.

This means you need to insert the following env vars as secrets:

```

ADMIN_JWT_SECRET
API_TOKEN_SALT
APP_KEYS
JWT_SECRET

```

where `ADMIN_JWT_SECRET` are 4 base64 encoded strings separated by comma `,` character, and the rest are base64 encoded strings. Strapi docs [recommend](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.html) generating the secrets with `openssl` command:

`openssl rand -base64 32`

Specifically, for APP_KEYS:

```bash
APP_KEYS=$(openssl rand -base64 32),$(openssl rand -base64 32),$(openssl rand -base64 32),$(openssl rand -base64 32)
```

This means the secret file will look something like this (replace the placeholder values with the openssl result _encoded once more into base64_ - more details in [secrets docs](../deployment-and-infrastructure/env-vars-and-secrets))):

```
apiVersion: v1
kind: Secret
metadata:
  name: bratislava-strapi-internals-secret
annotation:
  sealedsecrets.bitnami.com/managed: "true"
data:
  ADMIN_JWT_SECRET: YmFuYW5h
  API_TOKEN_SALT: YmFuYW5h
  APP_KEYS: YmFuYW5h
  JWT_SECRET: YmFuYW5h
```

### Other 'production setup' files

Other than that, your setup should include:

- Dockerfile
- dockerignore
- kubernetes directory

best copied over from one of the maintained project (i.e. `bratislava.sk`)

gha_language: MDX


text:
# NLP Data (Corpora, Lexica)

Corpora are collections of documents like conversation transcripts, books, e-mails, tweets, etc. The most valuable corpora have labels for things like the syntax tree, parts of speech, sentiment, "in-reply-to" (for dialog), number of favorites (for tweets) etc

Lexica are collections of words like dictionaries, thesauruses, N-gram collections, or vocabularies (lists of words)

## Lists and Compilations

- [niderhoff list of NLP datasets](https://github.com/niderhoff/nlp-datasets)

## Corpora

- [keyword extraction datasets](https://github.com/zelandiya/keyword-extraction-datasets)
- [Cornell movie dialog corpus](https://github.com/suriyadeepan/datasets/tree/master/seq2seq/cornell_movie_corpus)
- [Manually Annotated Sub-Corpus (MASC) for American English](http://www.anc.org/data/masc/downloads/data-download/)
- [PCAP packet logs](http://pen-testing.sans.org/holiday-challenge/2013)
- Twitter [Bullying Traces Data Set](http://research.cs.wisc.edu/bullying/data.html)
- [twitter corpora and lexica](http://saifmohammad.com/WebPages/lexicons.html)
- [Google NGrams (up to 5-Grams) for 15% of all books up to 2012](http://storage.googleapis.com/books/ngrams/books/datasetsv2.html)
- [Music Match Dataset](http://labrosa.ee.columbia.edu/millionsong/musixmatch#getting)

## Lexica

- [All Top Level Domains (for URI regexes)](https://domainpunch.com/tlds/)
### Password Cracking Dictionaries

**!!BE CAREFUL!!**

[word lists for password cracking](https://hashcat.net/forum/thread-1236.html)
[Crack Station 15GB password list](https://crackstation.net/buy-crackstation-wordlist-password-cracking-dictionary.htm) <--donate at your own risk

## Trained Models

[Official Google News Word2Vec Code & Data](https://code.google.com/archive/p/word2vec/)
[GitHub Mirror of Google News Word2Vec Code & Data](https://github.com/mmihaltz/word2vec-GoogleNews-vectors)
Download Google Drive 1.5GB Word2Vec Model[GoogleNews-vectors-negative300.bin.gz](https://drive.google.com/uc?export=download&id=0B7XkCwpI5KDYNlNUTTlSS21pQmM)

repository: MiguelPeralvo/nlpia

repo_name: MiguelPeralvo/nlpia