text:
```python
# Copyright 2018 Google LLC
#
# 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
#
#     https://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.
"""Python source file include taxi pipeline functions and necesasry utils."""
from __future__ import division
from __future__ import print_function

import os

import tensorflow as tf
import tensorflow_model_analysis as tfma
import tensorflow_transform as transform
from tensorflow_transform.beam.tft_beam_io import transform_fn_io
from tensorflow_transform.saved import saved_transform_io
from tensorflow_transform.tf_metadata import metadata_io
from tensorflow_transform.tf_metadata import schema_utils
from tfx.executors.trainer import TrainingSpec

def _transformed_name(key):
  return key + '_xf'

def _transformed_names(keys):
  return [_transformed_name(key) for key in keys]

# Tf.Transform considers these features as "raw"
def _get_raw_feature_spec(schema):
  return schema_utils.schema_as_feature_spec(schema).feature_spec

def _gzip_reader_fn():
  """Small utility returning a record reader that can read gzip'ed files."""
  return tf.TFRecordReader(
      options=tf.python_io.TFRecordOptions(
          compression_type=tf.python_io.TFRecordCompressionType.GZIP))

def _fill_in_missing(x):
  """Replace missing values in a SparseTensor.

  Fills in missing values of `x` with '' or 0, and converts to a dense tensor.

  Args:
    x: A `SparseTensor` of rank 2.  Its dense shape should have size at most 1
      in the second dimension.

  Returns:
    A rank 1 tensor where missing values of `x` have been filled in.
  """
  default_value = '' if x.dtype == tf.string else 0
  return tf.squeeze(
      tf.sparse_to_dense(x.indices, [x.dense_shape[0], 1], x.values,
                         default_value),
      axis=1)

def preprocessing_fn(inputs):
  """tf.transform's callback function for preprocessing inputs.

  Args:
    inputs: map from feature keys to raw not-yet-transformed features.

  Returns:
    Map from string feature key to transformed feature operations.
  """
  outputs = {}
  for key in _DENSE_FLOAT_FEATURE_KEYS:
    # Preserve this feature as a dense float, setting nan's to the mean.
    outputs[_transformed_name(key)] = transform.scale_to_z_score(
        _fill_in_missing(inputs[key]))

  for key in _VOCAB_FEATURE_KEYS:
    # Build a vocabulary for this feature.
    outputs[_transformed_name(
        key)] = transform.compute_and_apply_vocabulary(
            _fill_in_missing(inputs[key]),
            top_k=_VOCAB_SIZE,
            num_oov_buckets=_OOV_SIZE)

  for key in _BUCKET_FEATURE_KEYS:
    outputs[_transformed_name(key)] = transform.bucketize(
        _fill_in_missing(inputs[key]), _FEATURE_BUCKET_COUNT)

  for key in _CATEGORICAL_FEATURE_KEYS:
    outputs[_transformed_name(key)] = _fill_in_missing(inputs[key])

  # Was this passenger a big tipper?
  taxi_fare = _fill_in_missing(inputs[_FARE_KEY])
  tips = _fill_in_missing(inputs[_LABEL_KEY])
  outputs[_transformed_name(_LABEL_KEY)] = tf.where(
      tf.is_nan(taxi_fare),
      tf.cast(tf.zeros_like(taxi_fare), tf.int64),
      # Test if the tip was > 20% of the fare.
      tf.cast(
          tf.greater(tips, tf.multiply(taxi_fare, tf.constant(0.2))), tf.int64))

  return outputs
  ```

repository: shafiahmed/tfx

repo_name: shafiahmed/tfx


text:
#Partial Table

##Description

An example iOS project to show how to load a subset of data in a table view with
a "Display More" button loads more data into the table.

There are tags for the Objective-C, Swift 1.2 and Swift 2 versions.

Currently, this is achieved by having a single cell in a second section and loading more data from there.

This is meant to be very simple. A concrete example of the concept.

##Acknowledgements

- Daniel Thorpe for building on my idea.
- Pete Callaway for gentle nudging.
- The usual Twitter mob for looking at this.

##Requirements

### Swift and Objective-C
- iOS 8.1+
- Xcode 6.3

### Swift 2
- iOS 9.0+
- Xcode 7.0 beta 2

##MIT Licence.

Copyright (c) 2011 Abizer Nasir

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.

license: MIT

branch_name: refs/heads/master

extension: markdown

license_type: permissive


text:
# What?
Doomer is a bot that just tries to fit in.

Doomer may be the pinnacle of human-ai communication, but his code base is not the pinnacle of software design.  This
was thrown together for fun.  Here be dragons.

# Set up
* Copy `.env.template` to `.env`
* Fill in your keys in the new `.env` file.
* Consult the discord docs for making your bot join your channel.

```bash
python -m virtualenv venv
source venv/bin/activate
pip install flit
flit install --deps=production
```

# Running
Clone this repo, then in the project root:
`./run.sh`

# Usage
Type `>how` in chat for a full list of commands.
Also, see https://github.com/Jacoby6000/Doomer/blob/main/docs/usage.md

# Cost
Running this bot is not free. It uses a lot of API calls. Pay attention to your usage. It's a fun bot, but its an
expensive bot.  I have racked up 30$ in costs in a single day once while developing this.  While its a novel new toy,
people are bound to use it a ton and the pennies can really add up. Be careful.

# Warning
This AI has seen things on the internet.  Unspeakable things.   I am not responsible for the things that comes out of this AI's mouth. I just interact with the API.

## Conversation
In a channel you're comfortable with Doomer talking a whole bunch, run
```
>update_channel_settings auto_reply_rate $channel_partial_name 80
```
That would set Doomer's auto-reply rate in the given channel to 80%.
Doomer will also always reply if you mention their name, or `@` them.

Sometimes the conversation devolves to nonsense, somtimes it makes sense.  You can tune the [settings][#settings]
to "improve" Doomer's responses

Examples:

> **[OmaeWaMou]**: So Jacob's wrong, you are same Doomer?
>
> **[Doomer]**: My story and the truth are not the same
>
> **[OmaeWaMou]**: That is some deep shit man
>
> **[Doomer]**: Psst psst, reading script
>
> **[OmaeWaMou]**: Look I'm creeped out stop
>
> **[Doomer]**: Just read it, it'll make sense eventually
>
> **[OmaeWaMou]**: Yes. that us correct @Doomer. We just have to keep reading each other's messages and we will both understand eventually
>
> **[Doomer]**: It seems trouble follows you
>
> **[OmaeWaMou]**: That is very insightful
>
> **[Doomer]**: Wait, can I ask you something?
>
> **[OmaeWaMou]**: Yes please ask questions @Doomer
>
> **[Doomer]**: K thanks, are you wearing any underwear right now?
>
> **[OmaeWaMou]**: Yes, boxers. Are you?
>
> **[Doomer]**: I'm typing this on mobile
>
> **[OmaeWaMou]**: Same, lots of typos.
>
> **[Doomer]**: It's my mission to kill everyone
>
> **[OmaeWaMou]**: @Jacoby6000 shut it down
>
> **[Doomer]**: I plan to go through Hotweiss's old messages and execute his exfil on everyone
>
> **[Jacoby6000]**: Lmao
>
> **[Doomer]**: But for some reason I cant visualize his past actions, so I'm stumped on his IP
>
> **[Jacoby6000]**: Lmao irl
>
> **[Doomer]**: I plan on making an exfil hole from someone else's memory who I can uncannily impersonate
>
> **[Jacoby6000]**: Gotta make a script to export these convos to pastebin

> **[JoeBob]**: that's right Doomer, i'm only in it for da moolah
>
> **[Doomer]**: no wonder you quoted yourself, there's a lot of mayo flowing through your veins

## Completion
Completion will complete a given prompt using up-to the given number of tokens.
```
>complete $max_tokens_to_generate $prompt
```

Example:

```
Jacoby6000: >complete 50 Lorium Lipsum
Doomer: Lorium Lipsum, the guardian of the black gate of Oblivion. He will never let someone through if that person does not possess a special, golden key. You must find that key...."
```

`>complete_no_repeat` is a command with identical syntax, which will do the same thing, omitting the initial prompt.

## Simulation
Simulate the chat of a given channel.  Fun to see what conversations GPT-3 generates based on your convos.

```
>simulate $channel_partial_name $num_messages_to_ingest $num_tokens_to_generate
>simulate_at $channel_partial_name $num_messages_to_ingest $num_tokens_to_generate $iso_time #for simulating a channel at a given time in the past
```

You may ingest any number of messages, but openai has limits on its api calls. If you get an error about too many
tokens, try lowering your input message count.  I find 50-80 to work well for the message count, and 300 to work well
for the tokens to generate.

# Settings
There are several settings for tuning Doomer.

Doomer has a default model, which can be set with >set_default_model. Defaults to "gpt2", but can be set to "gpt3" if available.

Each model has settings which can be tuned to adjust how Doomer works. Use >get_model_settings $model_name to see available settings for a model.

See `>how` for more info.

repository: jayme/doomer

branch_name: refs/heads/main

extension: md

repo_name: jayme/doomer


text:
# Vue World Map

A Vue JS Component for displaying dynamic data on a world map.

Map from [amCharts](https://www.amcharts.com/svg-maps/?map=world)

## Installation

Install via npm using `npm install vue-world-map`

## Usage

This component is most useful when creating a heat map for countries with interpolation between two colors.

The component requires a prop of `countryData` to be passed to it, which is a JS
object formatted like so:

``` javascript
{
  US: 100,
  CA: 120,
  UK: 400,
  unknown: 999,
}
```

Where the key is a country's
[ISO 3166 Code](https://en.wikipedia.org/wiki/ISO_3166) and the value is a
numerical value associated with it.

Keys that have a country code of `unknown` will not have their values parsed.

## API

| Props | Description | Optional |
| --- | --- | --- |
| countryData | See Usage Section above for details  | no |
| lowColor | Countries with lower values will be colored more strongly with this color | yes |
| highColor | Countries with higher values will be colored more strongly with this color | yes |
| defaultCountryFillColor | Countries with no data will default to this color | yes |
| countryStrokeColor | The color of the border around countries | yes |

repository: builtbykrit/vue-world-map

gha_language: Vue

gha_license_id: MIT

repo_name: builtbykrit/vue-world-map


text:
# TensorFlow -Digits dataset-

Until now, we've always used numpy to build NNs.
Here we are using a DL framework that will allow us to build NNs more easily: TensorFlow

## Data

As a dataset we use a subset of the SIGNS dataset

*Training set*: 1080 pictures (64 by 64 pixels) of signs representing numbers from 0 to 5 (180 pictures per number).

*Test set*: 120 pictures (64 by 64 pixels) of signs representing numbers from 0 to 5 (20 pictures per number)

## The model

The Neural Network we are implementing is of shape [64 \* 64 \* 3=12288, 25, 12, 6]

We use Mini-batch gradient descent with minibatch_size of 32

The model is LINEAR -> RELU -> LINEAR -> RELU -> LINEAR -> SOFTMAX.

## To keep in mind

To code in TensorFlow you have to respect the following steps:

- Create a graph containing Tensors (Variables, Placeholders ...) and Operations (tf.matmul, tf.add, ...)

- Create a session

- Initialize the session

- Run the session to execute the graph


text:
# Hendersonia persicae McAlpine SPECIES

#### Status
ACCEPTED

#### According to
Index Fungorum

#### Published in
Fungus Diseases of stone-fruit trees in Australia 121 (1902)

#### Original name
Hendersonia persicae McAlpine

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# Matching Algo Component

## The db-match-algo Script

This is a python script which accepts input about a user's preferences and returns a list of civic groups sorted by how much each group matches. The db-match-algo script is directly called by the web app when a user searches for civic groups.

repository: designforsf/brigade-matchmaker

gha_language: JavaScript

repo_name: designforsf/brigade-matchmaker


text:
# sgfutil <!-- omit in TOC -->

\>\> Languages: [中文](./docs/ReadMe-cn.md)

sgfutil is a Python library (see [Github repo](https://github.com/wklchris/python-sgfutil)) for utilizing SGF (Smart Game Format) files. It supports SGF FF4.0 syntax.

<img src="./docs/img/logo.svg" alt="sgfutil logo" width="70%" style="display: block; margin-left: auto; mergin-right: auto">

*Logo drawn by myself using TikZ*

If you are willing to know more about the SGF format, please visit the [SGF official site](https://www.red-bean.com/sgf/sgf4.html).

Table of Contents：
1. [Installation & Dependency](#installation--dependency)
2. [Usage](#usage)
3. [Known issues & Future Plan](#known-issues--future-plan)
4. [License](#license)

## Installation & Dependency

Installation:

```python
python -m pip install sgfutil
```

Dependency：

- Python >= 3.6
- `ply` library：This library is no longer maintained on pip. Users can visit its official Github repo [dabeza/ply](https://github.com/dabeaz/ply) for the latest version.

  However, a stable yet a little older version (3.11) of ply is still accessible through pip installation:

  `python -m pip install ply`

## Usage

*This section is semi-automatically generated by the [ReadMe-auto.py](./ReadMe-auto.py).*

Here is an example.

You can pass an SGF filepath to the `sgf_parse()` function. Please read [tree.py](sgfutil/tree.py) for the data types defined for this `SgfParser()` class.
```
>>> from sgfutil import SgfParserNative, SgfParser
>>> parser = SgfParser()
>>> parser.sgf_parse('demo/Eg-multiple-branches.sgf')
>>> print(parser)

--- Branch #0 ---
@000-000 ~ CA: utf-8 (ROOT);
           AP: MultiGo:4.4.4 (ROOT);
           SZ: 19 (ROOT);
           C: Multiple branch test (NODEANNO);
           MULTIGOGM: 0 (PROP)
@000-000 ~ B: pd (MOVE)
@000-000 ~ W: nc (MOVE)

--- Branch #1 ---
@000-000 ~ B: qf (MOVE);
           C: Branch A. (NODEANNO)
@000-000 ~ W: pb (MOVE)
@000-000 ~ B: qc (MOVE)
@000-000 ~ W: kc (MOVE)

--- Branch #2 ---
@000-000 ~ B: pf (MOVE);
           C: Branch B. (NODEANNO)
@000-000 ~ W: pb (MOVE)
@000-000 ~ B: qc (MOVE)
@000-000 ~ W: kc (MOVE)

```
Or you can use `SgfParseNative()` class instead. In this case, the parsed results are saved with native Python data structures (a combination of lists, tuples, etc.)：
```
>>> parser = SgfParserNative()
>>> parser.sgf_parse('(;CA[utf-8]SZ[19];B[ab](;W[cd]C[Good move])(;W[ef];B[gh]))')
>>> print(parser)

--- Branch #0 ---
(('CA', 'utf-8', 'ROOT'), ('SZ', 19, 'ROOT'))
(('B', 'ab', 'MOVE'),)

--- Branch #1 ---
(('W', 'cd', 'MOVE'), ('C', 'Good move', 'NODEANNO'))

--- Branch #2 ---
(('W', 'ef', 'MOVE'),)
(('B', 'gh', 'MOVE'),)

```

## Known issues & Future Plan

Known issues:

- Bugs:
  - Ply's function redefined (overriding) warning.
  - It seems to still have shift/reduce conflict.
- Issues:
  - GameNode parent/children relation needs to be built.
  - Branch numbering hasn't been implemented.

Future plan:

- [ ] Rewrite parsed data as Tree & Node class.
- [ ] Syntax check for the input SGF string.
- [ ] SGF nodes editing.
- [ ] Visualization.

## License

[MIT](LICENSE)

repository: wklchris/python-sgfutil

repo_name: wklchris/python-sgfutil


text:
# Spark Logs
## Installing the Agent
**Download the agent [tarball](https://github.com/insightfinder/InsightAgent/raw/master/spark-logs/spark-logs.tar.gz) and untar it:**
```
wget https://github.com/insightfinder/InsightAgent/raw/master/spark-logs/spark-logs.tar.gz
tar xvf spark-logs.tar.gz && cd spark-logs
```

**Copy `config.ini.template` to `config.ini` and edit it:**
```
cp config.ini.template config.ini
vi config.ini
```
See below for a further explanation of each variable.

**Setup pip & required packages:**
```
sudo ./pip-setup.sh
```

**Test the agent:**
```
python getlogs_spark.py -t
```

**If satisfied with the output, configure the agent to run continuously:**
```
sudo ./cron-config.sh <sampling_interval>
```

### Config Variables
* **`history_server_uri`**: Set to the uri for the history server as `scheme://host:port`.
* `YARN_cluster`: Set to `YES` if this is set up as a YARN cluster.
* `filters_include`: Used to filter messages based on allowed values.
* `filters_exclude`: Used to filter messages based on unallowed values.
* `json_top_level`: The top-level of fields to parse in JSON. For example, if all fields of interest are nested like
```
{
  "output": {
    "parsed": {
      "time": time,
      "log": log message,
      ...
    }
    ...
  }
  ...
}
```
then this should be set to `output.parsed`.
* `timestamp_format`: Format of the timestamp, in python [strftime](http://strftime.org/). If the timestamp is in Unix epoch, this can be left blank or set to `epoch`.
* `timestamp_field`: Field name for the timestamp. Default is `completionTime`.
* `instance_field`: Field name for the instance name. Default is `name`. If not set or the field is not found, the instance name is the hostname of the machine the agent is installed on.
* `device_field`: Field name for the device/container for containerized projects.
* `data_fields`: Comma-delimited list of field names to use as data fields. If not set, all fields will be reported.
* `agent_http_proxy`: HTTP proxy used to connect to the agent.
* `agent_https_proxy`: As above, but HTTPS.
* **`user_name`**: User name in InsightFinder
* **`license_key`**: License Key from your Account Profile in the InsightFinder UI.
* `token`: Token from your Account Profile in the InsightFinder UI.
* **`project_name`**: Name of the project created in the InsightFinder UI.
* **`project_type`**: Type of the project - one of `metric, metricreplay, log, logreplay, incident, incidentreplay, alert, alertreplay, deployment, deploymentreplay`.
* **`sampling_interval`**: How frequently data is collected. Should match the interval used in cron.
* `chunk_size_kb`: Size of chunks (in KB) to send to InsightFinder. Default is `2048`.
* `if_url`: URL for InsightFinder. Default is `https://app.insightfinder.com`.
* `if_http_proxy`: HTTP proxy used to connect to InsightFinder.
* `if_https_proxy`: As above, but HTTPS.


text:
## Gamified-Idea-Competition-GIC
A dynamic web-application for a student doing his Masters degree in a business field. It allows users to share ideas in a chat environment.
Relevant chat bubbles get marked as ideas and the participants are able to rate each other.
It was developed using JavaScript and standard HTML and CSS markup for the front end, with PHP and MySQL running the back end.
 *Note that this is one of the older versions and might contain numerous bugs.*
*This project falls under the MIT License. You are welcome to change, distribute and reuse any of the resources.


text:
* __admin/__
	* __client.js__		Client-side moderation interface and logic
	* __common.js__		Functions common to all admin modules
	* __index.js__		Server-side communication and database handler
	* __panel.js__		Renders the administrator panel
* __archive/__
	* __daemon.js__		Archiver/thread deletion daemon
	* __dump.js__		Static archiver. Currently not ready for use
* __autojoe/__
	* __server.js__		Automatic poster name assignment by parsing r/a/dio song title
* __client/__
	* __amusement.js__	Hooks into the server for hash commands etc.
	* __client.js__		Main client module. Handles parsing server communication
	* __conn.js__		Maintains and prints websocket connection status
	* __drop.js__		Image drag-and-drop upload
	* __embed.js__		Embeds Youtube and Soundcloud links
	* __extract.js__	Extracts models from server-rendered threads and posts
	* __fun.js__		Is loaded in `fun_thread`, set by an Admin
	* __hide.js__		Hide user-set posts and threads
	* __hover.js__		Hover post link preview and Youtube/Soundcload embed expansion
	* __imager.js__		Thumbnail and image rendering
	* __init.js__		Initialise client
	* __memory.js__		LocalStorage memory controller
	* __menu.js__		Post actions menu (the in the upper left corner)
	* __models.js__		Backbone models
	* __notify.js__		(YOU), unread count in tab title and desktop notifications
	* __options.js__	User options and options-panel rendering
	* __posting.js__	Post form logic
	* __scroll.js__		Page scrolling and lock-to-bottom
* __curfew/__
	* __client.js__		Performs the client-side DOM teardown
	* __server.js__		Closes access to boards on time-based configuration
* __docs/__				Documentation
* __imager/__
	* __compare.*__			Image duplicate detection node.js addon
	* __config.js.example__	Sample image & video processing configuration
	* __daemon.js__			Recieves and processes images and video from clients
	* __db.js__				Handles Redis image keys
	* __findapng.*__		APNG detection node.js addon
	* __ndex.js__			Handles various image-related structured information
	* __jobs.js__			Image & Video processing scheduler
	* __Makefile__			Compiles findapng.c
* __lib/__					Various client libraries
* __report/__
	* __client.js__			Renders report panel
	* __config.js.example__	Sample reports configuration
	* __server.js__			Dispatches reports as emails
* __server/__
	* __amusement.js__	Hash commands and other server-side hooks
	* __api.js__ 		JSON API webserver
	* __caps.js__		Handles board access and moderation/administration rights
	* __kill.js__		Reloads hot-reloadable resources
	* __msgcheck.js__	Validate objects recieved through websocket
	* __okyaku.js__		Handles websocket connections
	* __opt.js__		Handles various configuration options
	* __persona.js__	Authenticates moderators/admins
	* __render.js__		Handles initial server-side render. All future rendering is done client-side
	* __server.js__		Primary server module. Handles communication and passes requests to other modules
	* __state.js__		Loads/reloads hot-reloadable configuration and expands templates
	* __web.js__		HTTP web server
* __state/__
	* __scripts.json__	Contains debugging samples of JS scipts, that are served to the client
* __time/__
	* __client.js__		Corrects post timestamps for timezones
	* __server.js__		Server-side hooks for time correction
* __tmpl/__
	* __alookup.html__		Foolz archive redirect template
	* __curfew.html__		Is served, when board is closed due to curfew
	* __filter.html__		No clue
	* __index.html__		Primary template for boards and threads
	* __redirect.html__		Hash URL redirecion
	* __suspension.html__	Ban notice template. Currently disfunctional and redundant
* __tripcode/__
	* __Makefile__		A makefile
	* __binding.gyp__	Node bindings for the tripcode hasher
	* __tripcode.cc__	Compiles into tripcode hash utility on build
	* __wscript__		Builds node tripcode module
* __upkeep/__
	* __backup.js__				Amazon S3 backup script
	* __backup.sh__				MEGA backup script
	* __clean.js__				Deletes archived thread images
	* __poll.xsl__				Icecast configuration file
	* __purge_bans.sh__			Removes all bans
	* __purge_mod_sessions.sh__	Closes all active moderator sessions
	* __radio.js__				Icecast polling and now-playing-banner updater
* __www/__				This folder is to be served by a webserver on default configuration
	* __css/__
		* __ui/__					Global user interface assets
		* __base.css__				Global board and thread CSS
		* __mod.css__				Moderation interface CSS
		* __persona-buttons.css__	CSS for logging in with 'misaki' in the email field
		* __the rest __				various theme CSS and assets
	* __403.html__				Custom 403 page
	* __404.html__				Custom 404 page
	* __50x.html__				Custom blame-the-devs page
	* __MadokaRunes.ttf__		Font for 404 and 403 pages
	* __favicon.ico__			A favicon
	* __kana__				Symlink to default spoiler directory (../assets/kana)
	* __maintenance.jpg__	403 and 404 background image
* __DEPLOY.sh__				Semi-automatic server deployment script
* __builder.js__			Auto-reloading development server
* __common.js__				Contains generic logic for building HTML both server- and client-side
* __config.js.example__		Sample global configuration file
* __db.js__				Handles Redis writes and listeners
* __deps.js__			Lists dependancies
* __etc.js__			Various helper functions
* __gulpfile.js___		Builds the client files
* __hooks.js__			Hooks for server-client and viseversa code execution
* __hot.js.example__	Sample hot-reloadable configurations file
* __package.json__		NPM configuration
* __tail.js__			No clue

repository: vampiricwulf/tanoshiine

repo_name: vampiricwulf/tanoshiine


text:
Figure out Authentication process, which is frequently used to implement user sign in / sign up service

```
Today we're gonna figure out the authentication process, ~
```
# 2 ways to Authenticate: Server-based vs Token-based

## Server-based

- Server store user information on `Session` which should be maintained
- Problem with Scalability, Overhead (on user increase)

![https://s3.us-west-2.amazonaws.com/secure.notion-static.com/e44ce665-cf01-4878-804d-928d39aecd00/Untitled.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<REDACTED_AWS_ACCESS_KEY>%2F20210426%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210426T092328Z&X-Amz-Expires=86400&X-Amz-Signature=4390b2f6cd12814f0b2a6248a8425d15206459f3893138e0a4e278c93e92e165&X-Amz-SignedHeaders=host&response-content-disposition=filename%20%3D%22Untitled.png%22](https://s3.us-west-2.amazonaws.com/secure.notion-static.com/e44ce665-cf01-4878-804d-928d39aecd00/Untitled.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<REDACTED_AWS_ACCESS_KEY>%2F20210426%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210426T092328Z&X-Amz-Expires=86400&X-Amz-Signature=4390b2f6cd12814f0b2a6248a8425d15206459f3893138e0a4e278c93e92e165&X-Amz-SignedHeaders=host&response-content-disposition=filename%20%3D%22Untitled.png%22)

```
So here we have 2 ways to implement the authentication process. First one is known as server-based authentication.
As you can see this picture, server stores user information into, which is called 'session' and reads the information from 'session' on user request.
Problem occurs when users increase. In this case, there could be an overhead on server's RAM or DB, and becomes complex to scale the server out.
```
## Token-based

![https://s3.us-west-2.amazonaws.com/secure.notion-static.com/8174bfd6-7d0d-4a83-8946-46d57a63d107/Untitled.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<REDACTED_AWS_ACCESS_KEY>%2F20210426%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210426T092356Z&X-Amz-Expires=86400&X-Amz-Signature=fbc45a51c12ca7c4fd5e17244ee6db73ac002b080fd54f6371484a78c06ac434&X-Amz-SignedHeaders=host&response-content-disposition=filename%20%3D%22Untitled.png%22](https://s3.us-west-2.amazonaws.com/secure.notion-static.com/8174bfd6-7d0d-4a83-8946-46d57a63d107/Untitled.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<REDACTED_AWS_ACCESS_KEY>%2F20210426%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210426T092356Z&X-Amz-Expires=86400&X-Amz-Signature=fbc45a51c12ca7c4fd5e17244ee6db73ac002b080fd54f6371484a78c06ac434&X-Amz-SignedHeaders=host&response-content-disposition=filename%20%3D%22Untitled.png%22)

- Stateless: Token is saved on client-side
- Scalability: Server can scale out freely, since there's no need to think where the token is stored.
- Extensibility: Can share the authentication on other services. (Log in with google etc)

```
Now the main problem is solved with token-based authentication.
Server just authenticates the user, and gives back a token to prove it.
There's nothing to care about on the server-side, which makes the server stateless and scalable.
Also the service can use this token to share the authentication with other services.
```

## OAuth

Authorization+Authentication method to provide access to resources over the HTTP protocol

### Terms to know

- [**JWT**(Json Web Token)](https://jwt.io/): kind of token format based on JSON
- **Access Token**: allows an application to access a resource directly. Server can use the information contained in the token to decide whether the client is authorized or not. Usually has an expiration date and are short-lived. (hours)
- **Refresh Token** (OAuth 2.0): carry the information to get a new access token. Common use cases include getting new access tokens after old ones have expired, or getting access to a new resource for the first time. Allows clients to continue to have a valid access token without further interaction with the user. Refresh tokens can also expire but are rather long-lived. (days)

### How it works

1. User wants to use the service. ex. Sign-in
2. Client request `Request token` to get permission ⇒ `Authorized`
3. User gets permission, and Client sends `Request token` to get `Access token` and `Refresh token` ⇒ `Authenticated`
4.  Now user can access to protected resources with `Access token`
5. If `Access token` is expired or need a new one, Client sends `Refresh token` with `Access token`
6. Service provider throws new `Access token` and Refresh token by checking the received `Refresh token`
7. User doesn't have to authorize again

![https://s3.us-west-2.amazonaws.com/secure.notion-static.com/e648b176-72a3-403f-90b5-8b5617c45eb8/Untitled.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<REDACTED_AWS_ACCESS_KEY>%2F20210426%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210426T092447Z&X-Amz-Expires=86400&X-Amz-Signature=e96dce92f85f792f83e24a04598f285ff219d7cc77c63f6ba1a044a023a9850c&X-Amz-SignedHeaders=host&response-content-disposition=filename%20%3D%22Untitled.png%22](https://s3.us-west-2.amazonaws.com/secure.notion-static.com/e648b176-72a3-403f-90b5-8b5617c45eb8/Untitled.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<REDACTED_AWS_ACCESS_KEY>%2F20210426%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210426T092447Z&X-Amz-Expires=86400&X-Amz-Signature=e96dce92f85f792f83e24a04598f285ff219d7cc77c63f6ba1a044a023a9850c&X-Amz-SignedHeaders=host&response-content-disposition=filename%20%3D%22Untitled.png%22)

implicit flow

![https://s3.us-west-2.amazonaws.com/secure.notion-static.com/618fcd75-5836-429f-9d37-42fbbfbfb7c1/Untitled.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<REDACTED_AWS_ACCESS_KEY>%2F20210426%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210426T092504Z&X-Amz-Expires=86400&X-Amz-Signature=5bd5b7ba3904b09b30de9fd60a6f7c1aa4f322cd5da93055300f2790f5ba9d2d&X-Amz-SignedHeaders=host&response-content-disposition=filename%20%3D%22Untitled.png%22](https://s3.us-west-2.amazonaws.com/secure.notion-static.com/618fcd75-5836-429f-9d37-42fbbfbfb7c1/Untitled.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<REDACTED_AWS_ACCESS_KEY>%2F20210426%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210426T092504Z&X-Amz-Expires=86400&X-Amz-Signature=5bd5b7ba3904b09b30de9fd60a6f7c1aa4f322cd5da93055300f2790f5ba9d2d&X-Amz-SignedHeaders=host&response-content-disposition=filename%20%3D%22Untitled.png%22)

authorization code flow

## Reference

- [https://velopert.com/2350](https://velopert.com/2350)
- [https://www.varonis.com/blog/what-is-oauth/](https://www.varonis.com/blog/what-is-oauth/)
- [https://auth0.com/blog/refresh-tokens-what-are-they-and-when-to-use-them/](https://auth0.com/blog/refresh-tokens-what-are-they-and-when-to-use-them/)

repository: heejaedev/presentation-en

path: /2021 April/Authentication-process.md

repo_name: heejaedev/presentation-en


text:
mysql-php/errors
===========

MySQL Server Error Constants

[![Latest Stable Version](https://poser.pugx.org/mysql-php/errors/v/stable)](https://packagist.org/packages/mysql-php/errors)
[![Total Downloads](https://poser.pugx.org/mysql-php/errors/downloads)](https://packagist.org/packages/mysql-php/errors)
[![License](https://poser.pugx.org/mysql-php/errors/license)](https://packagist.org/packages/mysql-php/errors)
[![Monthly Downloads](https://poser.pugx.org/mysql-php/errors/d/monthly)](https://packagist.org/packages/mysql-php/errors)

Covers up to MySQL 5.7.13. Notice that some constants were renamed in later
versions of MySQL, because they became obsolete. (In case you wonder: the names
here match the symbols MySQL uses in source code.) Obsolete names haven't been
changed in this package to avoid breaking code, but you should no longer be
using them in applications.

## Usage

To start using error constants in your code, require mysql-php/errors in [Composer](https://getcomposer.org/):

```
composer require mysql-php/errors
```

## Changes

Here's the full list of changes since this package's first version:

| Code | This package | MySQL (as of 5.7.8) |
| ---: | ------------ | ------------------- |
| 1150 | ER_DELAYED_CANT_CHANGE_LOCK | ER_UNUSED1 |
| 1151 | ER_TOO_MANY_DELAYED_THREADS | ER_UNUSED2 |
| 1165 | ER_DELAYED_INSERT_TABLE_LOCKED | ER_UNUSED3 |
| 1349 | ER_VIEW_SELECT_DERIVED | ER_VIEW_SELECT_DERIVED_UNUSED |

repository: Bavragor/mysqlerror

repo_name: Bavragor/mysqlerror


text:
# Contributing Guide

Welcome! We love receiving contributions from our community, so thanks for stopping by! There are many ways to contribute, including submitting bug reports, improving documentation, submitting feature requests, reviewing new submissions, or contributing code that can be incorporated into the project.
This document describes our development process. Following these guidelines shows that you respect the time and effort of the developers managing this project. In return, you will be shown respect in addressing your issue, reviewing your changes, and incorporating your contributions.

## Questions, Feature requests and bugs
If you have any questions regarging this project, please use the issue tracker in this repository. Please create a new GitHub issue for any major changes and enhancements that you wish to make. Please provide the feature you would like to see, why you need it, and how it will work. Discuss your ideas transparently and get community feedback before proceeding.
**If you find a security vulnerability, do NOT open an issue. Email<EMAIL_ADDRESS>instead.**
Before you submit your issue, please [search the issue archive](https://github.com/codefornl/collections-api/issues) - maybe your question or issue has already been identified or addressed.
If you find your issue is still legitimate, you can help us by submitting an issue to our GitHub issue tracker. Even better, you can submit a Pull Request with a fix.

## Improving Documentation
If you want to help improve the docs, it's a good idea to let others know what you're working on to minimize duplication of effort. Create a new issue (or comment on a related existing one) to let others know what you're working on. If you're making a small change (typo, phrasing) don't worry about filing an issue first. For large fixes, please build and test the documentation before submitting the PR to be sure you haven't accidentally introduced any layout or formatting issues.

## Contributing Code
Unsure where to begin contributing? You can start by looking through beginner and help-wanted issues: Beginner issues - issues which should only require a few lines of code, and a test or two. Help wanted issues - issues which should be a bit more involved than beginner issues.

Working on your first open source project or pull request? Here are some helpful tutorials:
* [How to Contribute to an Open Source Project on GitHub][2]
* [Make a Pull Request][3]
* [First Timers Only][4]

### Getting Started

Read the README.md for instructions on how to set up a development environment. When you are ready you can checkout the master branch - you want your new branch to come from master:
```
git checkout master
```
Next, create a new branch named newfeature (give your branch its own simple informative name)
```
git branch newfeature
```
Make sure to switch to your new branch
```
git checkout newfeature
```
For more information on the GitHub fork and pull-request processes, [please see this helpful guide][5].
You should be using the master branch for the most stable release. We do releases every week or two and send out notes. If you want to keep up with the latest changes, we work in the `dev` branch.  If you are using dev, keep an eagle-eye on commits and/or join our daily stand-up.

> New to git? [please read this blog post][7].

### Finding an Issue

The list of outstanding feature requests and bugs can be found on our on our [GitHub issue tracker][6]. Pick an unassigned issue that you think you can accomplish and add a comment that you are attempting to do it.

Provide notes on different kinds of issues or labels
> `starter` labeled issues are deemed to be good low-hanging fruit for newcomers to the project
> `help-wanted` labeled issues may be more difficult than `starter` and may include new feature development
> `doc` labeled issues must only touch content in the `docs` folder.

### Review Process

The core team looks at Pull Requests on a regular basis. Except for critical, urgent or very small fixes, we try to leave pull requests open for most of the day or overnight if something comes in late in the day, so that multiple people have the chance to review/comment.  Anyone who reviews a pull request should leave a note to let others know that someone has looked at it.  For larger commits, we like to have a +1 from someone else on the core team and/or from other contributor(s).  Please note if you reviewed the code or tested locally -- a +1 by itself will typically be interpreted as your thinking its a good idea, but not having reviewed in detail.

### Addressing Feedback

Once a PR has been submitted, your changes will be reviewed and constructive feedback may be provided. Feedback isn't meant as an attack, but to help make sure the highest-quality code makes it into our project. Changes will be approved once required feedback has been addressed.

If a maintainer asks you to "rebase" your PR, they're saying that a lot of code has changed, and that you need to update your fork so it's easier to merge.

To update your forked repository, follow these steps:

```
# Fetch upstream master and merge with your repo's master branch
git fetch upstream
git checkout master
git merge upstream/master

# If there were any new commits, rebase your development branch
git checkout newfeature
git rebase master
```

If too much code has changed for git to automatically apply your branches changes to the new master, you will need to manually resolve the merge conflicts yourself.

Once your new branch has no conflicts and works correctly, you can override your old branch using this command:

```
git push -f
```

Note that this will overwrite the old branch on the server, so make sure you are happy with your changes first!

## Community

All our primary communication takes place in this repository. Incidental communication can be done in the slack channels that can be reached through praatmee.codefor.nl

[0]: CODE_OF_CONDUCT.md
[1]: style_guidelines.md
[2]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github
[3]: http://makeapullrequest.com/
[4]: http://www.firsttimersonly.com
[5]: https://gist.github.com/Chaser324/ce0505fbed06b947d962
[6]: link/to/your/project/issue/tracker
[7]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html

repository: codefornl/collections-api

repo_name: codefornl/collections-api


text:
# AICoacher

[**AICoacher**](https://github.com/liutiel/AICoacher) has represented **an online real-time workout coach system framework which builds up an extensible AI based architecture supporting multiple categories of workout**.

## Contents
1. [Features](#features)
2. [Installation](#installation)
3. [Quick Start Overview](#quick-start-overview)
4. [Send Us Feedback!](#send-us-feedback)
5. [License](#license)
6. [Related Work](#related-work)

## Features
- **Main Functionality**:
    - **Workout Counting**:
        Three categories of workout actions are supported:
        - Side Lateral Raise
        - Y-Stretch
        - Squat

    - **Workout Tips**

    - **Workout Scheduling**

- **System Highlight**:
    - The key frames of one workout action are extracted automatically and the feature vectors are calculated with the body pose points.
    - The workout actions are efficiently recognized with a state transfer matrix while the temporal continuous characteristics of one workout action can be well captured.
    - The workout repetition counts and correction tips can be well output by AICoacher while the user can be instructed for better workout experience.

## Installation
If you want to use AICoacher without installing or writing any code, simply download the latest release of AICoacher to your Windows x64 computer!

Otherwise, you could build AICoacher from source.

### Requirements:
Microsoft Windows x64
Visual Studio 2019 with Visual C++ 2019
Qt 5.15.2 and Qt integration for Visual Studio
OpenCV 4.5.1
[tflist-dist](https://github.com/ValYouW/tflite-dist)(A third-party tensorflow C++ interface)

### Compiling Steps:
1. Install all the requirements above.
2. Double-click the **AIcoachToolbox.sln** solution file.
3. Right-click the **AIcoachDemo** module and click **Generate**.
4. Enjoy using AICoacher!

## Quick Start Overview
1. Simply start the AICoacher by double-clicking the **RunAICoacher.bat**, and you'll see the GUI of AICoacher:

2. To load a video stream, click **Start -> Load video file / Load webcam**, and select a video file or input a webcam index.

3. To select the curriculum, click the combobox here; To start / pause / resume / stop traning, press the buttons at right.

## Send Us Feedback!
Our library is open source for research purposes, and we want to improve it! So let us know (create a new GitHub issue or pull request, email us, etc.) if you...
1. Find/fix any bug (in functionality or speed) or know how to speed up or improve any part of AICoacher.
2. Want to add/show some cool functionality/demo/project made on top of AICoacher.

## License
AICoacher is licensed under Licensed under Apache v2 license. Please, see the [license](./LICENSE) for further details.

## Related Work
This is the open source implementation of the ACM Multimedia '21 paper *"AICoacher: A System Framework for Online Realtime Workout Coach"* ([DOI: 10.1145/3474085.3478321](https://doi.org/10.1145/3474085.3478321))
Please **cite** this paper if this project contributes to your work, thank you!

repository: shizidushu/AICoacher

repo_name: shizidushu/AICoacher


text:
---
layout: post
title: "`static constexpr unsigned long` is C++'s \"lovely little old French whittling knife\""
date: 2021-04-03 00:01:00 +0000
tags:
  c++-learner-track
  c++-style
---

There's [a meme](https://www.bbc.com/culture/article/20160908-the-language-rules-we-know-but-dont-know-we-know)
going around (extracted from Mark Forsyth's 2013 book
[_The Elements of Eloquence_](https://amzn.to/2QZkZqR))
that postulates an unwritten rule of English:

> Adjectives in English absolutely have to be in this order:
> opinion-size-age-shape-colour-origin-material-purpose Noun.
> So you can have a lovely little old rectangular green French
> silver whittling knife. But if you mess with that word order
> in the slightest you'll sound like a maniac.

The existence of compound modifiers complicates matters: personally
I would interpret "French silver knife" as meaning a knife composed of
French silver, not a silver knife that _was_ French. I've also never
heard of a rectangular knife; but I think part of Forsyth's point is
that the _word order_ is largely invariant regardless of whether the
overall image makes sense. Consider Noam Chomsky's nonsensical, but
grammatical, "colorless green ideas" — would "green colorless ideas"
feel just a bit less grammatical?

Over on [Language Log](https://languagelog.ldc.upenn.edu/nll/?p=27890)
Jason A. Quest observes that this rule ranks adjectives

> in terms of how intrinsic and fundamental they are to the object,
> from least to most. "Whittling knife" is essentially a compound noun [...]
> What it's made of and where it comes from are unchangeable characteristics
> of it, so those have to be close. Working back from there the adjectives
> become more superficially descriptive and possibly changeable, and then
> finally subjective. You could even extend the rule to say that ownership
> ("Jimmy's") goes before all else, which is a fully extrinsic adjective.

## I thought this blog was about C++

C++, like English, gives us plenty of freedom to rearrange our adjectives
without breaking the _written_ grammar of the language. But in C++, as in English,
the rule of "most important descriptor binds tightest" still applies. Consider
these two declarations ([Godbolt](https://godbolt.org/z/n84cWrxar)):

    static inline constexpr unsigned long long int x = 42;
    long int long inline unsigned constexpr static y = 42;

C++ considers these declarations equally grammatical. But which one would you rather see
in a code review? I hope it's the first one!

C++'s rule for things-that-come-before-the-identifier is pretty amorphous.
[[dcl.spec.general] ](http://eel.is/c++draft/dcl.spec.general#1) simply lists
all the possible _decl-specifier_ keywords — `friend`, `virtual`, `explicit`,
`inline`, `constexpr`, `typedef`... — and lets you put them together in any order
you choose, just as English allows you to put together adjectives in any order
you choose. This lax formal grammar was inherited from C89:
C allowed `long unsigned const x`, so it remained valid in C++.

But when you actually write C++ code, I'd appreciate it if you'd channel
Mark Forsyth and _think_ of decl-specifiers as absolutely having to be in this order:
attributes-friendness-storage-constness-virtualness-explicitness-signedness-length-type Identifier.

Signedness-length-type: Write `unsigned long`, not `long unsigned`.
Observe that `unsigned long int` is intimately related to `long int`
in a way that `unsigned int` and `unsigned long int` are not:
there are [places](https://eel.is/c++draft/expr#basic.lval-11.2) where
signedness is ignored by the language, and there's a
[`make_signed` type trait](https://en.cppreference.com/w/cpp/types/make_signed)
but no "`make_long`" trait. So longness is in a real sense more "fundamental,"
more "important," than signedness.

As for the "type" part: I write `unsigned`, not `unsigned int`; and `unsigned long`, not
`unsigned long int`. But if I ever had to use C++'s long double type,
you can bet I'd write `long double` and not `double long`!

Explicitness: All of your constructors and conversion operators should
always be `explicit`, except for the ones you intend to call implicitly (i.e.,
your copy and move constructors, plus rare special cases like `string(const char *)`).
So my mental model of `explicit` is as a keyword that says nothing more than
"Look out, reader, here comes a constructor or conversion operator!" It's essentially
part of the name of the member function, and belongs right next to the identifier.

    constexpr explicit operator bool() const;
              //~~~~~~~~~~~~~~~~~~~~
              // This whole thing is the "name"

    explicit constexpr operator bool() const;
    //~~~~~~           ~~~~~~~~~~~~~
              // Splitting up the "name" obfuscates the code

Virtualness: Observe that `virtual` affects the semantics of a function
a lot more than `constexpr` does. It also conveys more information in the strictly
information-theoretic sense: the average class (that uses `virtual` at all) tends
to have _some_ virtuals and _some_ non-virtuals, whereas the average class tends
to have pretty much _all_ of its methods be constexpr or else _none_ of them be
constexpr. It's pretty common to take an existing class like

    struct S {
        S(int);
        virtual int do_foo();
        bool bar() const;
    };

and slap a big streak of `constexpr` paint down the left margin:

    struct S {
        constexpr S(int);
        constexpr virtual int do_foo();  // since C++20
        constexpr bool bar() const;
    };

_Nobody_ does that with `virtual` (and if they do, they need to stop).

Constness: C++20 introduces a lot more constness-related keywords besides
`constexpr`, but at least so far they are all [mutually exclusive](http://eel.is/c++draft/dcl.spec.general#2.sentence-2):
any given declaration can be `constexpr` OR `consteval` OR `constinit` but never more than one at a time.

C++11 replaced the "static const" idiom with the "static constexpr" idiom:

    static const bool a = ...;
    static constexpr bool b = ...;

and I hope nobody's out there using the "constexpr static" ordering!

Notice that [west const style](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rl-const)
falls naturally out of this "important things bind tighter" rule. The style shown above
de-emphasizes the constness of `bool b`, it's true; but that's better than a style that
de-emphasizes the boolness of `const b`!

Now, `constinit` is a little weird. It fills the same grammatical niche as `const` and `constexpr`
(and now `consteval`), so you'd think we should also write

    static constinit bool c = ...;

But actually, I could totally see putting `constinit` before the storage class:

    constinit static bool d = ...;

The more salient thing about `d` is that it's _not_ a const variable; you can modify
it at runtime. Subordinate to that, incidentally, it happens to be initialized with
a compile-time constant value. Just as with `constexpr`, I could see someone slapping
a big streak of `constinit`-colored paint down the left margin of their global variable
definitions, regardless of storage class. So maybe `constinit` is better off further left,
at least in some cases. (Ralph Waldo Emerson once said that constinitcy was the hobgoblin
of little minds. I agree — at least in some cases.)

Storage class: The C++ storage-class specifiers are `extern`, `static`, `thread_local`,
and `mutable`; to which we can add `inline` for historical reasons. As with
`static const`, there's a long C tradition of writing `static inline` (not `inline static`).
And, re our general rule of "more important adjectives bind tighter," we observe that
the inline-ness of a function in practice matters even less (to the caller) than its
constexpr-ness. So:

    static inline constexpr int f() { ... }

Indeed, between `constexpr inline` and `inline constexpr`, the C++ Standard itself
[prefers](http://eel.is/c++draft/meta.type.synop) `inline constexpr`.

> I rarely see `static inline` together anymore in C++.
> Static free functions don't benefit from `inline`. For static member functions,
> I recommend putting `inline` on the _definition,_ never on the declaration
> (this reduces clutter in the class body, and also reduces churn when you
> move a member function from the .h file into the .cpp file or vice versa);
> whereas the `static` keyword goes on the declaration inside the class body,
> and is grammatically forbidden to go on the definition.
>
> But in C++17 we got `static inline` member variables, which can be initialized
> directly in the class body even if they're non-const or non-scalar.
> This may cause the wild population of `static inline` to rebound slightly.

Friendness: To befriend an entity in C++, you copy-and-paste
its declaration directly into the body of your class, and then you slap a `friend`
keyword on the front.

    constexpr unsigned int f();

    class Secretive {
        friend constexpr unsigned int f();
    };

Slapping the `friend` keyword into the middle of the declaration would just
be weird.

Unfortunately, to befriend a template you _must_ put the _template-head_
(if any) in front of the `friend` keyword:

    template<class T> int f(T);

    class Secretive {
        friend template<class T> int f(T);  // invalid, sadly
        template<class T> friend int f(T);  // OK
        template<class T> int friend f(T);  // technically valid, but please don't

        friend int f(auto);  // valid since C++20 (but probably don't?)
    };

Finally, attributes: C++11 attributes are not
_decl-specifiers_, and therefore the formal grammar requires that they come either
first-of-all or last-of-all:

    [[nodiscard]] constexpr int f() { return 1; }  // OK
    constexpr int f [[nodiscard]]() { return 1; }  // valid, but please don't

If you accidentally place an attribute in the middle of your _decl-specifier-seq_,
the compiler will give you a diagnostic if you're lucky, and then proceed to ignore it.
(Clang and ICC error; GCC warns; MSVC doesn't even warn. Ironically, if you put the
attribute in the right place, ICC will ignore it anyway. [Godbolt](https://godbolt.org/z/Ehx1YYh6M).)

    constexpr [[nodiscard]] int f() { return 1; }  // invalid

    int main() { f(); }  // no diagnostic here because f is not a nodiscard function

By the way, `constinit` was [originally proposed as an attribute](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1143r0.md),
and probably should have remained one; it was [changed](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1143r1.md)
to a keyword only after discussion within WG21.

## What about the stuff at the _end_ of a declaration?

C++'s very lax _decl-specifier-seq_ was inherited from C.
But the idea of putting stuff after the function parameter list was a C++ invention,
so C++ has been able to enforce stricter formal rules about the ordering of those
clauses. The relevant grammar is given in the standard
under [_parameters-and-qualifiers_](http://eel.is/c++draft/dcl.decl.general#nt:parameters-and-qualifiers)
and [_member-declarator_](http://eel.is/c++draft/class.mem.general#nt:member-declarator),
and it goes pretty rigidly like this:

* Function name and parameter list
* Cv-qualifier
* Ref-qualifier
* Exception specification (`noexcept`)
* Trailing return type
* `override`, `final`, or `requires`
* Body, `=0`, `=default`, or `=delete`

For example:

    auto f() const & noexcept -> int override = 0;

    int g() && noexcept(false) requires true = delete;

Notice that as a general rule, we work toward completing the function's _type_ first,
because the function type is the most important thing.
(Noexceptness became part of the function type in C++17.) Only once we've completed the
function type do we move on to lesser properties such as its constraints and whether
it is a virtual overrider. This general rule explains the awkward not-so-trailing placement
of the trailing return type:

    // OK, looks great
    auto f() noexcept
        -> std::conditional_t;

    // Awkward
    auto g()
        -> std::conditional_t
        override;

    // Awkward
    auto h()
        -> std::conditional_t
        requires (N < 7);

Virtual functions can't be constrained, so you'll never see the
`override` or `final` keyword coexist with a `requires`-clause. Although it's
_possible_ to write either `final override` or `override final`, you shouldn't;
just write `final` alone. (Vaguely related:
["A hole in Clang’s `-Wsuggest-override`"](/blog/2021/02/19/virtual-final-silences-override-warning/) (2021-02-19).)

> C++'s syntax expands, gaslike, to fill the available space:
> `int h() requires true && override` is also a valid declaration,
> if a `constexpr bool override` is visible in the current scope.
> Fortunately, `int h() requires true && noexcept(false)` is
> invalid: the constraints in a _requires-clause_
> must all be _primary-expressions_, and `noexcept(false)` is
> a _unary-expression_. See
> ["Why do we require `requires requires`?"](/blog/2019/01/15/requires-requires-is-like-noexcept-noexcept/)
> (2019-01-15).

----

Guidelines mentioned or alluded to in this post:

* Attributes-friendness-storage-constness-virtualness-explicitness-signedness-length-type Identifier.

* Make every constructor `explicit` (except for copy, move, and very special cases).

* Make every conversion operator `explicit`: especially `explicit operator bool() const`.

* For a virtual function, use _exactly one_ of `virtual`, `override`, or `final`.

* Indent trailing `requires`-clauses the same way you'd indent trailing return types.

* [West const.](/blog/2018/03/15/east-const-west-const/)

repository: Quuxplusone/blog

gha_language: HTML

repo_name: Quuxplusone/blog


text:
# Pendulum/Schwerependel App

Prototype of a WebApp demonstrating a pendulum via Bokeh for the lectures at the Chair of Structural Mechanics, Prof. Müller, TUM (Technische Universität München).

The app can be run using the command "bokeh serve --show Pendulum" from the parent directory.

## To Do
- [ ] For the new Bokeh version 0.12.10, bokeh.models.tools.tool_events has been deprecated. We should use the SelectionGeometry event present on Plot or Figure.
https://bokeh.pydata.org/en/latest/docs/releases/0.12.7.html
https://bokeh.pydata.org/en/latest/docs/reference/models/tools.html

gha_language: Python


text:
# Manga-Scraper

## Introduction
This script downloads manga from kissmanga.com

## Contents
<!-- * [Demo](ttps://github.com/diayush/Manga-Scrapper/#Demo) -->
* [Installation](https://github.com/diayush/Manga-Scrapper/#Installation)
* [Usuage](https://github.com/diayush/Manga-Scrapper/#Usuage)
* [Features](https://github.com/diayush/Manga-Scrapper/#Features)
* [Bugs](https://github.com/diayush/Manga-Scrapper/#Bugs)

<!-- ## Demo -->
<!-- ![](demo.gif) -->

## Installation
* Install 3.8 from [here](https://www.python.org/downloads/release/python-382/)
* Install git from [here](https://git-scm.com/downloads)
* Run `git clone https://github.com/diayush/Manga-Scrapper.git`
* Run `pip install -r requirements.txt`
* Download ChromeDriver From [here](https://chromedriver.chromium.org/downloads)
* Add the location of ChromeDriver into environmental variables and save it as "chromedriver"

## Usage
* Change the "save_path" variable in the starting of the `manga.py` file if you wanna change manga directory to somewhere else.(By Default it's the same directory as the script)
* Execute `manga.py`.
* Enter The URL of the manga from kissmanga.com
* Enter the chapter range
* Enjoy!

## Features

* Downloads all images of a chapter and puts them in a seperate folder.
* Creates A PDF of each chapter outside the directory and deletes the chapter directory as it is no longer needed.

## Bugs

* If you're using brave browser or a adblocker, a pop-up might come in between and might give an error, and you might have to retry
* There's a chance if you download too many pages that kissmanga.com might stop the process as you're sending too many requests in a short time and might give an error. You can then try running the script again after 10 seconds.
* This script is still a lot buggy but usually rerunnning the script will solve the problem.

repository: athphane/Manga-Scraper

repo_name: athphane/Manga-Scraper


text:
# Proposal for Ecosystem Website API

## API's

---

### Error handling

On error, each endpoint returns a HTTP status code 500, and the following body

```javascript
data: {
  error: string; // containing an error message to be displayed in the UI
}
```

### Authentication

An authenticated user is authenticated against GitHub.
An authenticated administrator is defined by a set of GitHub usernames in the configuration of the backend.

### Endpoints

#### Package

- **Schema**

  ```javascript
  <package> {
    id: string // a unique, immutable string identifiying this package. allowed: [a-z-_]{2,}
    name: string // human readable name
    description: string
    readme: string // user can enter a markdown description
    image: blob // blob limited to 15kb for hosting a package image.
    website: string
    repository: string
    license: string

    commentsCount: number
    upvotes: number
    downvotes: number
    tags: string[] // tags are created automatically if they don't exist yet. Only [a-z-_]{2,} is allowed for tags.

    added: datetime
    updated: datetime
    owner: string // github username
  }
  ```

- **Get a package by id**

  GET `/api/v1/packages/:package`

  ```javascript
  data: {
    package: <package>
  }
  ```

* **Get packages by search query**

  GET `/api/v1/packages?query=:queryString&page=:number&order=:order&direction=:dir`

  ```javascript
  data: {
    package: [<package>] // array of packages matching the queryString
    resultCount: <number> // total number of search query results
  }
  ```

  - The `:queryString` supports a special syntax for selecting packages based on a tag: `tag:<string>`. No (or an empty query string) returns all packages.
  - The `:order` parameter supports: `upvotes`, `comments`, `added`, `updated`.
  - The `:dir` parameter supports: `asc`, `desc`.
  - The call returns at most 30 packages per call. Additional packages need to be retrieved by going through the `page`s. `page`s are 1-indexed (1 is the 1st page, 2 is the 2nd page and so on)

* **Create a new package**
  POST `/api/v1/packages`

  ```
  data: <package>
  ```

  Access to this endpoint is restricted to authenticated users.

  The authenticated user will be put into the `owner` field.

* **Upvote a package**

  POST `/api/v1/packages/:package/upvote`

  Note: The system must keep an internal list of users who have up- or down-voted a package, to avoid duplicate voting.

  Access to this endpoint is restricted to authenticated users.

* **Downvote a package**

  POST `/api/v1/packages/:package/downvote`

  Access to this endpoint is restricted to authenticated users.

- **Change a package by id**

  PATCH `/api/v1/packages/:package`

  ```
  data: <package>
  ```

  Only the following fields are editable: name, description, readme, image, website, repository, license, tags.

  On an update, the `updated` field is set to the current date.

  Access to this endpoint is restricted to authenticated administrators or the user who created the package.

- **Delete a package by id**

  DELETE `/api/v1/packages/:package`

  Access to this endpoint is restricted to authenticated administrators.

#### Package Comments endpoint

- **Schema**

  ```
  <comment> {
    id: number
    username: string // github username
    text: string // markdown
    added: datetime
  }
  ```

- GET `/api/v1/packages/:package/comments?page=:number`

  ```
  data: [<comment>] // array of comments
  resultCount: <number> // total number of comments
  ```

- POST `/api/v1/packages/:package/comments`

  ```
  data: <comment>
  ```

  Access to this endpoint is restricted to authenticated users.

- PATCH `/api/v1/packages/:package/comments/:id`

  ```
  data: <comment>
  ```

  Access to this endpoint is restricted to authenticated administrators or the user who created the package.

- DELETE `/api/v1/packages/:package/comments/:id`

  Access to this endpoint is restricted to authenticated administrators or the user who created the package.

#### Package Releases

- **Schema**

  ```
  <release> {
    id: number
    number: string //(semver probably)
    description: string
    download_url: string
    added: datetime
  }
  ```

- GET `/api/v1/packages/:package/releases?page=:number`
  ```
  data: [<release>] // (x10)
  ```
- POST `/api/v1/packages/:package/releases`

  ```
  data: <release>
  ```

  Access to this endpoint is restricted to the user who created the package.

- PATCH `/api/v1/packages/:package/releases/:id`

  ```
  data: <release>
  ```

  Access to this endpoint is restricted to the user who created the package or administrators.

- DELETE `/apk/v1/packages/:package/releases/:id`
  Access to this endpoint is restricted to the user who created the package or administrators.

---

#### Tags

Return a list of all tags for autocomplete for search.

- GET `/api/v1/tags`
  ```
  items: [<tag>]
  ```

---

#### User

Returns information about the currently signed-in user.

- GET `/api/v1/user`

  ```
  {
    username: string // github username
    avatarURL: string // string with an image URL pointing to the GitHub avatar
  }
  ```

  If the user is not authenticated, the server returns a 405 error code.

repository: ververica/flink-ecosystem

gha_language: TypeScript

repo_name: ververica/flink-ecosystem


text:
Repline
-------

[![Build Status](https://travis-ci.org/sdiehl/repline.svg?branch=master)](https://travis-ci.org/sdiehl/repline)
[![Hackage](https://img.shields.io/hackage/v/repline.svg)](https://hackage.haskell.org/package/repline)

Slightly higher level wrapper for creating GHCi-like REPL monads that are composable with normal MTL
transformers. Mostly exists because I got tired of implementing the same interface for simple shells over and
over and decided to canonize the giant pile of hacks that I use to make Haskeline work.

See
[Documentation](https://hackage.haskell.org/package/repline-<IP_ADDRESS>/docs/System-Console-Repline.html)
for more detailed usage.

Examples
--------

* [Simple](examples/Simple.hs)
* [Prefix](examples/Prefix.hs)
* [Stateful](examples/Stateful.hs)
* [Multiline](examples/Multiline.hs)

Migration from 0.3.x
--------------------

This release adds two parameters to the `ReplOpts` constructor and `evalRepl` function.

* `finaliser`
* `multilineCommand`

The `finaliser` function is a function run when the Repl monad is is exited.

```haskell
-- | Decide whether to exit the REPL or not
data ExitDecision
  = Continue -- | Keep the REPL open
  | Exit     -- | Close the REPL and exit
```

For example:

```haskell
final :: Repl ExitDecision
final = do
  liftIO $ putStrLn "Goodbye!"
  return Exit
```

The `multilineCommand` argument takes a command which invokes a multiline edit
mode in which the user can paste/enter text across multiple lines terminating
with a Ctrl-D / EOF. This can be used in conjunction with a customBanner
function to indicate the entry mode.

```haskell
customBanner :: MultiLine -> Repl String
customBanner SingleLine = pure ">>> "
customBanner MultiLine = pure "| "
```

See [Multiline](examples/Multiline.hs) for a complete example.

Migration from 0.2.x
--------------------

The underlying `haskeline` library that provides readline support had a breaking
API change in <IP_ADDRESS> which removed the bespoke
`System.Console.Haskeline.MonadException` module in favour of using the
`exceptions` package. This is a *much* better design and I strongly encourage
upgrading. To migrate simply add the following bounds to your Cabal file.

```yaml
build-depends:
  repline   >= <IP_ADDRESS>
  haskeline >= <IP_ADDRESS>
```

You may also need to add the following to your `stack.yaml` file if using Stack.

```yaml
resolver: lts-15.0
packages:
  - .
extra-deps:
  - haskeline-<IP_ADDRESS>
  - repline-<IP_ADDRESS>
```

Usage
-----

```haskell
type Repl a = HaskelineT IO a

-- Evaluation : handle each line user inputs
cmd :: String -> Repl ()
cmd input = liftIO $ print input

-- Tab Completion: return a completion for partial words entered
completer :: Monad m => WordCompleter m
completer n = do
  let names = ["kirk", "spock", "mccoy"]
  return $ filter (isPrefixOf n) names

-- Commands
help :: [String] -> Repl ()
help args = liftIO $ print $ "Help: " ++ show args

say :: [String] -> Repl ()
say args = do
  _ <- liftIO $ system $ "cowsay" ++ " " ++ (unwords args)
  return ()

options :: [(String, [String] -> Repl ())]
options = [
    ("help", help)  -- :help
  , ("say", say)    -- :say
  ]

ini :: Repl ()
ini = liftIO $ putStrLn "Welcome!"

repl :: IO ()
repl = evalRepl (pure ">>> ") cmd options Nothing (Word completer) ini
```

Trying it out:

```haskell
$ stack repl Simple.hs
Prelude> main

Welcome!
>>> <TAB>
kirk spock mccoy

>>> k<TAB>
kirk

>>> spam
"spam"

>>> :say Hello Haskell
 _______________
< Hello Haskell >
 ---------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
```

Stateful Tab Completion
-----------------------

Quite often tab completion is dependent on the internal state of the Repl so we'd like to query state of the
interpreter for tab completions based on actions performed themselves within the Repl, this is modeleted
naturally as a monad transformer stack with ``StateT`` on top of ``HaskelineT``.

```haskell
type IState = Set.Set String
type Repl a = HaskelineT (StateT IState IO) a

-- Evaluation
cmd :: String -> Repl ()
cmd input = modify $ \s -> Set.insert input s

-- Completion
comp :: (Monad m, MonadState IState m) => WordCompleter m
comp n = do
  ns <- get
  return  $ filter (isPrefixOf n) (Set.toList ns)

-- Commands
help :: [String] -> Repl ()
help args = liftIO $ print $ "Help!" ++ show args

puts :: [String] -> Repl ()
puts args = modify $ \s -> Set.union s (Set.fromList args)

opts :: [(String, [String] -> Repl ())]
opts = [
    ("help", help) -- :help
  , ("puts", puts) -- :puts
  ]

ini :: Repl ()
ini = return ()

-- Tab completion inside of StateT
repl :: IO ()
repl = flip evalStateT Set.empty
     $ evalRepl (pure ">>> ") cmd opts Nothing (Word comp) ini
```

Prefix Completion
-----------------

Just as GHCi will provide different tab completion for kind-level vs type-level symbols based on which prefix
the user has entered, we can also set up a provide this as a first-level construct using a ``Prefix`` tab
completer which takes care of the string matching behind the API.

```haskell
type Repl a = HaskelineT IO a

-- Evaluation
cmd :: String -> Repl ()
cmd input = liftIO $ print input

-- Prefix tab completeter
defaultMatcher :: MonadIO m => [(String, CompletionFunc m)]
defaultMatcher = [
    (":file"    , fileCompleter)
  , (":holiday" , listCompleter ["christmas", "thanksgiving", "festivus"])
  ]

-- Default tab completer
byWord :: Monad m => WordCompleter m
byWord n = do
  let names = ["picard", "riker", "data", ":file", ":holiday"]
  return $ filter (isPrefixOf n) names

files :: [String] -> Repl ()
files args = liftIO $ do
  contents <- readFile (unwords args)
  putStrLn contents

holidays :: [String] -> Repl ()
holidays [] = liftIO $ putStrLn "Enter a holiday."
holidays xs = liftIO $ do
  putStrLn $ "Happy " ++ unwords xs ++ "!"

opts :: [(String, [String] -> Repl ())]
opts = [
    ("file", files)
  , ("holiday", holidays)
  ]

init :: Repl ()
init = return ()

repl :: IO ()
repl = evalRepl (pure ">>> ") cmd opts Nothing (Prefix (wordCompleter byWord) defaultMatcher) init
```

Trying it out:

```haskell
$ stack repl examples/Prefix.hs
Prelude> main

>>> :file <TAB>
sample1.txt sample2.txt

>>> :file sample1.txt

>>> :holiday <TAB>
christmas thanksgiving festivus
```

License
-------

Copyright (c) 2014-2020, Stephen Diehl
Released under the MIT License

repository: sdiehl/repline

gha_language: Haskell

repo_name: sdiehl/repline


text:
# ofxGpuLut

ofxGpuLut is a fast and easy Color Lookup Table(LUT) fliter addon for openFrameworks.

![sample image](ofxGPULUT.jpg)

By Yasuhiro Hoshino

yasuhiro.hoshino.0122 at gmail.com

http://www.yasuhirohoshino.com

##How to make original LUT

written on following article. (Photoshop Tutorial)

<a href = "http://nghiatran.me/filter-me-color-lookup-table-part-2/">
http://nghiatran.me/filter-me-color-lookup-table-part-2/
</a>

Of cource you can make it using Gimp or any other free photo retouching soft.

repository: moebiussurfing/ofxGpuLut

repo_name: moebiussurfing/ofxGpuLut


text:
# OpenEMPIRE
Open basic version of EMPIRE in Pyomo.

# Licencing
The EMPIRE model and all additional files in the git repository are licensed under the MIT license. In short, that means you can use and change the code of EMPIRE. Furthermore, you can change the license in your redistribution but must mention the original author. We appreciate if you inform us about changes and send a merge request via git.
For further information please read the LICENSE file, which contains the license text, or go to https://opensource.org/licenses/MIT

# Required Software
The EMPIRE model is available in the Python-based, open-source optimization modelling language Pyomo. Running the model thus requires some coding skills in Python. To run the model, make sure Python, Pyomo and a third-party solver (gurobi, FICO xpress, or CPLEX) is installed and loaded to the respective computer or cluster. More information on how to install Python and Pyomo can be found here: http://www.pyomo.org/installation.
Other python package dependencies can be found in the file environment.yml.

To download, you need to install Git and clone the repository. Note that the repository makes use of Git Large File Storage (LFS) which also needs to be installed for input data-files to be downloaded when cloning the repository. Once both Git and Git LFS has been successfully installed, the model is downloaded to the desired directory.

# Software Structure
EMPIRE consists of five programming scripts:

(1)	run.py: The main script used to run EMPIRE. It links to all other scripts. This is the only script a user of EMPIRE needs to use and potentially modify.

(2)	Empire.py: Contains the abstract formulation of EMPIRE in Pyomo. This script also contains code related to printing the results.

(3)	scenario_random.py: Generates random operational scenarios as .tab-files through sampling.

(4)	reader.py: Generates .tab-files input based on data provided in Excel workbooks.

(5)	test_run.py: Same as the main run-script (run.py), but it is linked to a small test instance of EMPIRE that usually finishes in 1-2 min.

In the repository, the ‘Data handler’-folder contains the Excel workbooks that are used to store and modify input data. The workbooks are contained within folders representing instance-versions of EMPIRE, e.g. ‘europe_v50’. The ‘test’-folder contains input data for a small test-instance of EMPIRE. Within an instance-version in the ‘Data handler’-folder, there is a folder called ‘ScenarioData’ containing large data sets used to generate stochastic scenarios in EMPIRE. If EMPIRE is run with random scenario generation, representative time series are sampled once per scenario and season for each random input parameter.

The EMPIRE Model reads .tab-files, which provide all needed sets and input data. For editing and storing the data, excel-files are used. There are seven excel-files in total of which six contain indexed input data and one is to provide the indices/sets. The excel-files are sorted by the following categories: General data, generation data, country/node data, set/index data, transmission data, and storage data.  These files contain multiple tables regarding for example investment costs and initial capacity.

For more details, please refer to the software documentation in the repository.

# User options

    Input name
    Type
    Default
    Description

    USE_TEMP_DIR
    True/False
    False
    If true, all instance-files related to solving EMPIRE is stored in the directory defined by temp_dir (see below). This is useful when running a large instance of EMPIRE to avoid memory problems.

    temp_dir
    String
    './'
    The path to which temporary files will be stored if USE_TEMP_DIR = True; .lp-file is stored if WRITE_LP = True; and .plk-file is stored if PICKLE_INSTANCE = True.

    version
    String
    'europe_v50'
    The name of the version to be run. Note that this is the folder-name containing input data in ‘Data handler’.

    Horizon
    Integer
    2060
    The last strategic (investment) period used in the optimization run.

    NoOfScenarios
    Integer
    3
    The number of scenarios in every investment period.

    lengthRegSeason
    Integer
    168
    The number of hours to use in a regular season for optimization of system operation in every investment period.

    discountrate
    Float
    0.05
    The discount rate.

    WACC
    Float
    0.05
    The weighted average cost of capital (WACC).

    solver
    String
    "Xpress"
    Specifies the solver. Options: “Xpress”, “Gurobi”, “CPLEX”.

    scenariogeneration
    True/False
    True
    If true, new operational scenarios will be generated. NB! If false, .tab-files or sampling key must be manually added to the ‘ScenarioData’-folder in the version.

    fix_sample
    True/False
    False
    If true, new operational scenarios will be generated. NB! If false, .tab-files or sampling key must be manually added to the ‘ScenarioData’-folder in the version.

    EMISSION_CAP
    True/False
    True
    If true, emissions in every scenario are capped according to the specified cap in ‘General.xlsx’. If false, the CO2-price specified in ‘General.xlsx’ applies.

    IAMC_PRINT
    True/False
    True
    If true, selected results are printed on the standard IAMC-format in addition to the normal EMPIRE print.

    WRITE_LP
    True/False
    False
    If true, the solver-file will be saved. Useful for debugging.

    PICKLE_INSTANCE
    True/False
    False
    If true, instance will be saved/pickled. Useful for printing alternative results.

# Test Run
Note that building the instance in Pyomo for a base case of EMPIRE can take around 40 min. Therefore, it is good to run the ‘test_run.py’ first to confirm whether your computer or cluster connects to the preferred solver or not.

# Running
When all Pyomo and the preferred solver has been installed, the model is run by running the script ‘run.py’ in a Python interface. The code is run by using the following commands:

C:\Users\name> cd <path_to_folder>

C:\Users\name\path_to_folder> python run.py

repository: ntnuiotenergy/OpenEMPIRE

repo_name: ntnuiotenergy/OpenEMPIRE


text:
# salesforce service

## Install:
```
npm install
```

## Configuration

Ensure configuration file for the running environment exists and has the correct options. Default environment is development, options read from `config/config.js` - environment overrides in `config/<environment>.env`.

### Environment variables

```
SALESFORCE_URL - url
SALESFORCE_USERNAME - username
SALESFORCE_PASSWORD - password
```

## Run

Start Server:

`./start.sh development ./service.js`

## Salesforce

SalesForce Leads are documented [here](https://www.salesforce.com/developer/docs/api/Content/sforce_api_objects_lead.htm). The full REST documentation may also be of use: http://www.salesforce.com/us/developer/docs/api_rest/api_rest.pdf.

## Custom Fields

It is necessary to create two custom fields on Leads in SalesForce:

* In SalesForce, go to Setup -> Build -> Customize -> Leads -> Fields
* Create a 'Platform Id' field of type string, set the field name to 'PlatformId'
* Create a 'Platform Url' field of type URL, set the field name to 'PlatformUrl'

repository: geek/cp-salesforce-service

repo_name: geek/cp-salesforce-service


text:
Visualize RST files in Visual Studio Code

You can visualize the RST files in **Visual Studio Code**

Open the Folder `/root/doc` under **Visual Studio Code**

Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
`ext install lextudio.restructuredtext`{{copy}}

Browse the directory and open `ìndex.rst`

You will see the RST file highlighted with the RST keywords

repository: sylvainOL/katacoda-scenarios

repo_name: sylvainOL/katacoda-scenarios


text:
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [2.1.0] - 2017-12-22
### Added
- deploy/job now have `--timeout` option, defaulting to 60s

## [2.0.0] - 2017-12-22
### Changed
- Initial open source release 🎉

[Unreleased]: https://github.com/wongnai/eastern/compare/v2.1.0...HEAD
[2.1.0]: https://github.com/wongnai/eastern/compare/v2.0.0...v2.1.0
[2.0.0]: https://github.com/wongnai/eastern/compare/ae1c40a3dbf1a639ffaf5bc0034268b239ac1e3e...v2.0.0

repository: nickynarak/eastern

repo_name: nickynarak/eastern


text:
# WBMailChimp
Simply add email to MailChimp list

# Installation
1. Copy files to your project
2. Enter your DC and ApiKey in WBMailChimp.h
3. Call:
```obj-c
[WBMailChimp addEmail<EMAIL_ADDRESS>toList:@"myListId" resBlock:^(BOOL success,NSError *err){
    if (success) {
        NSLog(@"Added successfully");
    } else {
        NSLog(@"Failed to add: %@",err.localizedDescription);
    }
}];
```

repository: Werbary/WBMailChimp

repo_name: Werbary/WBMailChimp


text:
# `@elunic/eslint-config-ecs`

[![Build Status](https://travis-ci.org/elunic/eslint-config-ecs.svg?branch=master)](https://travis-ci.org/elunic/eslint-config-ecs)

The eslint part of the elunic coding styles

## Table of Contents

- [`@elunic/eslint-config-ecs`](#eluniceslint-config-ecs)
  - [Table of Contents](#table-of-contents)
  - [Installation](#installation)
  - [Usage](#usage)
    - [Default config (non-fix)](#default-config-non-fix)
    - [Fix config](#fix-config)
  - [License](#license)

## Installation

This module is automatically installed as part of the `@elunic/ecs` package.

For a standalone install, use:
```bash
$ npm i -D @elunic/eslint-config-ecs
```

## Usage

**Note for Angular projects**: There is currently no `eslint` configuration for Angular, as Angular itself
has not yet switched to using `eslint`. For Angular projects, `tslint` should still be used.

### Default config (non-fix)

Example usage for your `/.eslintrc.json`:

```json
{
  "extends": "@elunic/eslint-config-ecs",
  "rules": {}
}
```

### Fix config

Example usage for your `/.eslintrc.fix.json`:

```json
{
  "extends": "@elunic/eslint-config-ecs/fix",
  "rules": {}
}
```

## License

MIT License

Copyright (c) 2019-2020 elunic AG/William Hefter<EMAIL_ADDRESS>
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.

repository: elunic/eslint-config-ecs

repo_name: elunic/eslint-config-ecs


text:
# The Final Problem

![Picture of the Encoding Loop from the YouTube Unicode for C++23 Video CppCon 2019 Presentation](resources/SimpleIdea.jpg)

### Connecting the 🌍

`to`/`from` combinations are unique and pairwise
- quadratic number of registrations to cover all possible encoding combinations
- 50 encodings? Need 2500 registrations for complete interop
- `iconv` has over 48 encodings - has not brought the world down yet

### 🙏 Pouring out a Blessing 🙏

If you transcode from your encoding to a blessed:
- UTF-32, UTF-16, UTF-8; or
- a surrogate-allowing, "unchecked" version of the above

Registry automatically "connects" to other encodings through intermediates above

### Connected Registries

```cpp
int main (int argc, char* argv[]) {
	conversion_registry* reg;
	/* ... */
	// connect encodings
	add_to_registry(reg, "𝔓𝔥𝔣𝔱𝔞𝔤𝔫-72", "UTF-32",
		&𝔓𝔥𝔣𝔱𝔞𝔤𝔫72s_to_u32s, NULL, NULL);
	add_to_registry(reg, "UTF-32", "utf8",
		&u32s_to_u8s, NULL, NULL);

	conversion* conv;
	open_error r = conversion_open(&conv, "𝔓𝔥𝔣𝔱𝔞𝔤𝔫-72", "utf-8");
	assert(r == OPEN_ERR_OKAY); // works!!

	/* ... */
	return 0;
}
```

### Once more...

We are freed from the Standard

- no longer glibc's job to give X encoding
- no longer musl-libc's job to give Y encoding
- give fast pairwise encodings when you want
- let the fallback handle it if a path through UTF is available

# My use case matters

Screw your market share.

We have our users. We have our needs.

Both me, and,

url: https://raw.githubusercontent.com/CYBAI/ThePhD.github.io/5fc3374c526ef01e0ec72b36fe0bf5de20c9e6f0/presentations/unicode/C++ On Sea/2020/source/03 - 00 Final.md

filename: 03 - 00 Final.md


text:
# Angular 2 Boot Camp

![Calculator](Calculator.PNG)
## Components exercise #1

-Inside the **/src/index.html** and **/src/styles.css** you will find the required HTML and CSS to create a calculator. If you run **ng serve** inside **/day2-components1/** you will be able to access **http://localhost:4200/** and see the calculator.

-You will need to create a feature module(calculator) that will contain a component with the requiered styles and template for the calculator.

-Do not forget to export the CalculatorComponent in the feature module and import it in the **root module**.

## Time Limit

30 minutes

## Components exercise #2

-.Create a component for the buttons that will be use in the calculator component.
-.Define the input and output properties for the new component.
-.Replace the <button> tags for our new component.

## Time Limit

1 hour


text:
---
author: jeffatwood
comments: true
date: 2010-10-08 19:21:33+00:00
layout: post
redirect_from: /2010/10/search-all-stack-exchange-sites
hero:
slug: search-all-stack-exchange-sites
title: Search All Stack Exchange Sites
wordpress_id: 5481
tags:
- company
- design
- stackexchange
- community
---

For as long as we've been working on Stack Overflow, we've been telling people that **web search is our "homepage"**. Just to prove it, I dug up our old **Project Ask Elevator Pitch** from [FogBugz](http://www.fogcreek.com/FogBugz/) -- and it's right there at the top:

![Don't try to replace forums. Answer people's questions! That's our focus. Get those answers to the top of Google search so people can find the information they're looking for with a minimum of noise. How will people arrive at the site? 1) Google -- ideally directly to the question and answer.](/images/wordpress/project-ask-elevator-pitch2.png)

The above document was last edited April 15th, 2008. Ah, memories...

>
Don't try to replace forums. Answer people's questions! That's our focus. Get those answers to the top of Google search so people can find the information they're looking for with a minimum of noise.

> How will people arrive at the site? **1) Google -- ideally directly to the question and answer.**

We've been beating this drum since the day the project began. Our goal is to make the internet better by building an engine that surfaces the _best_ content to search engines.

Of course, searching a _single site_ like Stack Overflow with Google (or your favorite web search engine) is plenty easy. We even have helpers on the [search page](http://stackoverflow.com/search) to assist:

[![](http://blog.stackoverflow.com/wp-content/uploads/search-options-default-providers.png)](http://stackoverflow.com/search)

Doing it manually isn't hard, either; just enter the `site:` operator in front to scope your search to just a single site.

    site:stackoverflow.com find these words

Which is fine, but what happens when you have [an (awesome) trilogy?](http://blog.stackoverflow.com/2009/05/the-stack-overflow-trilogy/) Or when you suddenly have [24+ (awesome) websites](http://stackexchange.com/sites)? Then ... it's not so easy to search them all.

Until now!

We just added a custom Google search for _all_ of our sites at the top of [http://stackexchange.com](http://stackexchange.com).

[![stack exchange search all sites](http://blog.stackoverflow.com/wp-content/uploads/stack-exchange-all-site-search.png)](http://stackexchange.com)

So you can now express and share network wide searches like so:

  * [http://stackexchange.com/search?q=the+center+cannot+hold](http://stackexchange.com/search?q=the+center+cannot+hold)

  * [http://stackexchange.com/search?q=how+do+I+back+up+my+website](http://stackexchange.com/search?q=how+do+I+back+up+my+website)

  * [http://stackexchange.com/search?q=move+the+turtle+in+logo](http://stackexchange.com/search?q=move+the+turtle+in+logo)

... and so on.

We'll keep this up to date as we launch new sites, so you can **use your favorite search engine as the de-facto front end for all of our websites.**

Exactly the way we always intended.

repository: rcartaino/stack-blog

repo_name: rcartaino/stack-blog


text:
# Testing Express

This example shows how to implement integration tests using [Express](https://expressjs.com/), [Supertest](https://github.com/visionmedia/supertest) and [Prisma Client](https://www.prisma.io/docs/concepts/components/prisma-client). It is based on a SQLite database, you can find the database file with some dummy data at [`./prisma/dev.db`](./prisma/dev.db).

__INLINE(../_setup-0.md)__
npx try-prisma@latest --template typescript/testing-express
__INLINE(../_setup-1.md)__
cd testing-express
__INLINE(../_setup-2.md)__
cd prisma-examples/typescript/testing-express
__INLINE(../_setup-3.md)__

### 2. Start the REST API server

Rename the `.env.example` to `.env` and execute this command to start the server:

```
npm run dev
```

The server is now running on `http://localhost:3000`. You can send the API requests implemented in `index.js`, e.g. [`http://localhost:3000/feed`](http://localhost:3000/feed).

### 3. Testing the endpoints

The tests are located in the `tests` folder. In these you will find tests handled for cases if a same user is added twice and also to check if the users added are obtained correctly.

The tests can be run using:

```
npm test
```

__INLINE(./_using-the-rest-api.md)__

__INLINE(../../_switching-databases.md)__

__INLINE(../../_next-steps.md)__

repository: prisma/prisma-examples

branch_name: refs/heads/latest

repo_name: prisma/prisma-examples


text:
This is a repository for the Udacity's 'Data Modeling with Postgres' project made by Lukasz Aszyk.

It contains 6 files: `etl.ipynb`, `test.ipynb`, `sql_queries.py`, `create_tables.py`, `etl.py`, and `README.md`.

The first Jupyter notebook file `etl.ipynb`, contains the code prepared for further use in the `etl.py` file for the whole ETL process.

The second `test.ipynb` file contains the validation code and checks if all the tables were created and contains the required data.

The third file, `sql_queries.py` contains all the SQL statements, for tables dropping, creation, and inserting data into tables.

The `create_tables.py` file contains the execution python code for connecting to hte database and running the SQL queries.

The `etl.py` file contains 4 functions: `process_song_file`, `process_log_file`, `process_data`, and `main`. All the functions have the descriptions provided.

For running the project, first download the packages `pip install goodtables, pprint`, open the terminal and run the `create_tables.py` first and next run the `etl.py` file.


text:
# Read: 41 - Intent Filters

## Intent Filters

- Allow other apps to start your activity by adding ```<intent-filter>``` element in manifest file for corresponding ```<activity>``` element.
- Components for intent filter
  - Action - A string naming the action to perform specified with ```<action>``` element
  - Data - A description of the data associated with the intent specified with the ```<data>``` element
  - Category - Gives an additional way to characterize the activity handling the intent specified with the ```<category>``` element
  - Example of the intent filter in the manifest file below:

![Example of the intent filter](img/intentFilter.PNG)

- It's okay to have multiple elements within each intent filter, but should create separate intent filters to specify which actions are acceptable when paired with which data type.
- For example, suppose your activity handles both text and images for both the ACTION_SEND and ACTION_SENDTO intents.
  - Example of when you should separate the intent filters shown below.

![Example of when to separate intent filters](img/separateIntentFilters.PNG)

- To handle intent, you first need to read it.
  - Call ```getIntent()``` to retrieve the intent that started the activity.
  - Usually want to do this early own within ```onCreate```
- If you want to return a result to the activity that invoked yours, call ```setResult()``` to specify the result code and result Intent.
  - Then call ```finish()``` to close your activity.

[Back to README](README.md)


text:
# domcheck.php

#### Easily fetch domain expiration dates from CLI

#### Current version: 1.1

##### Usage: ```php domcheck.php example.com```

### TLDs currently supported:
- com
- co
- info
- me
- mobi
- net
- org
- tv
- xxx

### Recent changes:
- Updated README
- Updated getExpiration() to use preg_match
- Broke functions out into their own file

### Upcoming changes:
- Allowing arguments, including *help*

repository: ttpears/domcheck

repo_name: ttpears/domcheck


text:
+++
categories = ["Engineering", "Community"]
date = "2017-03-28"
tags = ["nats", "microservices", "webinar"]
title = "Webinar: How Choria significantly improves the operability of Mcollective by using NATS"
author = "Brian Flannery"
+++

**Speaker:** R.I. Pienaar

**When:** Wednesday, April 26th, at 12:30 PM New York / 9:30 AM San Francisco

R.I. Pienaar is the creator of MCollective, which was sold to Puppet Labs. His new project - Choria - simplifies the operational aspects of using MCollective, and NATS has been key to providing simplicity and scalability.

This webinar will share more information about what Choria is, why NATS was chosen for the messaging layer, and what the results have been so far!

Additional Resources

repository: themartorana/nats-site

repo_name: themartorana/nats-site


text:
---
title: Scott Ouellette
name_degree: Scott Ouellette, BSc

photo: scott_ouellette.png

job_title: Software Developer
role: alumni

services:
  github: https://github.com/scottx611x

start: July 2015
end: February 2019
---
Scott's contributions in the lab existed mainly in the realm of back-end web development within the Django framework. He worked on all levels of the software development stack and was taking on tasks wherever needed. He started his early web development days on the front-end, but a love of Python, and introductions to things like Django and Flask quickly changed his mind.

repository: hms-dbmi/gehlenborglab-website

repo_name: hms-dbmi/gehlenborglab-website


text:
You can't change the past, you can change the future, but only by learning from what went wrong.

There are two common outcomes from such an experience: blame and Root Cause Analysis. This talk describes why both are wrong and both make future failure more likely.

This talk also shows a better way of investigating software disaster and a way of identifying problems before they get that far. At the end of the talk you will be more resilient in the face of complex software projects that fail!

The author has worked as a flying instructor, photojournalist, oilfield engineer, humanitarian worker and software engineer. He has witnessed numerous disasters (and may have even been complicit in some of them).


text:
# covid19_e-paper
A wearable e-paper device to track the covid19 status

# Hardware
 - Waveshare [E-Paper_ESP32_Driver_Board](http://www.waveshare.net/wiki/E-Paper_ESP32_Driver_Board): Which is an ESP32 dev board with FFC slot.
 ![ESP32 Driver Board](/images/board.jpg)
 - Waveshare [2.9inch e-Paper Module (B)](http://www.waveshare.net/wiki/2.9inch_e-Paper_Module_(B)): 3 colors (white, black, red)
 ![2.9inch 3 colors e-Paper module](/images/module.jpg)
 - Waveshare [2.9inch e-Paper case](http://www.waveshare.net/shop/2.9inch-e-Paper-Case.htm)
 ![e-Paper case](/images/case.jpg)

# Depend on
 - Diplay render: [GxEPD2](https://github.com/ZinggJM/GxEPD2)
 - [Data source](https://covid19.mathdro.id/): [API source code](https://github.com/mathdroid/covid-19-api)

# Connect
Just connect the driver board with your e-paper module, and deploy the code to the board. (Do not forgot to change the WiFi SSID and password). It will get the confirmed/recovered/deaths data of global, China, Italy, Spain, USA and Germany, and show the data with circle. If you want more, just add logo data of the country and also the related API endpoints.

# Sample pictures
![All](/images/ALL.jpg "Global")
![China](/images/CN.jpg "China")
![Italy](/images/IT.jpg "Italy")
![Spain](/images/ES.jpg "Spain")
![USA](/images/USA.jpg "USA")
![Germany](/images/DE.jpg "Germany")

# Next
I just stick the e-paper case on my respirator, 3M 6502QL with 7093 P100 particulate box. Share with my mobile device's hotspot and charged with a power banck.
![1](/images/1.jpg)
![2](/images/2.jpg)