text:
# My Projects for Rice University's [Fundamentals of Computing](https://www.coursera.org/specializations/computer-fundamentals) (on Coursera)
## Course Creators: Luay Nakhleh, Joe Warren, John Greiner, Scott Rixner, Stephen Wong

Took the "Fundamentals of Computing" specialisation by Rice University on Coursera which comprises the following 6 courses and a capstone exam:

1. [An Introduction to Interactive Programming in Python (Part 1)](https://www.coursera.org/learn/interactive-python-1)
2. [An Introduction to Interactive Programming in Python (Part 2)](https://www.coursera.org/learn/interactive-python-2)
3. [Principles of Computing (Part 1)](https://www.coursera.org/learn/principles-of-computing-1)
4. [Principles of Computing (Part 2)](https://www.coursera.org/learn/principles-of-computing-2)
5. [Algorithmic Thinking (Part 1)](https://www.coursera.org/learn/algorithmic-thinking-1)
6. [Algorithmic Thinking (Part 2)](https://www.coursera.org/learn/algorithmic-thinking-2)
7. [The Fundamentals of Computing Capstone Exam](https://www.coursera.org/learn/fundamentals-of-computing-capstone)

Each course has its own folder. Just the code I wrote which I think I may need to look at later is in this repo.

## Running the code.

The code is Python 2.7 written to run using the [CodeSkulptor environtment](http://www.codeskulptor.org/) (Python in your browser). It uses some libraries unique to the environment so it can't be used in the standard Python environment yet.

To run the code:

Each projects's folder has a README file. In the README file there is a link to run the project.

1. Follow the link to open the the project in the CodeSkulptor Python web IDE.
2. Click the 'play' button on the top left of the IDE to run the project


text:
# Trace of recent exception
```

## Rails

### Rails console

```sh
pry -r ./config/environment
```

Also consider [pry-rails](https://rubygems.org/gems/pry-rails).

### Rails

```
pry(main)> show-models
pry(main)> show-routes
pry(main)> show-middleware
```

### ls

| Command     | Description      |
| ----------- | ---------------- |
| `ls`        | All              |
| ---         | ---              |
| `ls -m`     | Methods          |
| `ls -M`     | Instance methods |
| ---         | ---              |
| `ls -g`     | Globals          |
| `ls -l`     | Local vars       |
| `ls -c`     | Constants        |
| ---         | ---              |
| `ls -i`     | Instance vars    |
| ---         | ---              |
| `ls -G xxx` | Grey by regex    |

## Shell integration

`shell-mode` adds dir to the prompt.

```
pry(main)> shell-mode
pry(main):/home/x $
```

Commands with `.` are shell commands.

```
pry(main)> .cat hello.txt
```

## hirb

```rb
pry(main)> table User.all
pry(main)> view User.all
pry(main)> view User.all, fields: %w[id name email]
```

Add the [hirb](https://rubygems.org/gems/hirb) gem.

## pry-rescue

Add the [pry-rescue](https://github.com/ConradIrwin/pry-rescue) gem.

```rb
Pry::rescue {
  # raise exceptions here
}
```

#### Or run:

```
bundle exec rescue rspec
```

#### Additional commands:

```pry
pry(main)> cd-cause
pry(main)> try-again
```

### pry-remote

```rb
# In your code:
binding.remote_pry

# In the shell:
bundle exec pry-remote
```

Add the [pry-remote](https://github.com/Mon-Ouie/pry-remote) gem.

### References

* [Pry](https://github.com/pry/pry)
* [Hirb](https://github.com/cldwalker/hirb)

repository: rstacruz/cheatsheets-ng

branch_name: refs/heads/master

detected_licenses: ISC MIT BSD-2-Clause

extension: md

gha_language: JavaScript

license_type: permissive

repo_name: rstacruz/cheatsheets-ng


text:
DISCONTINUATION OF PROJECT.

This project will no longer be maintained by Intel.

This project has been identified as having known security escapes.

Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project.

Intel no longer accepts patches to this project.
# DISCONTINUATION OF PROJECT

**This project will no longer be maintained by Intel.  Intel will not provide or guarantee development of or support for this project, including but not limited to, maintenance, bug fixes, new releases or updates.  Patches to this project are no longer accepted by Intel. If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the community, please create your own fork of the project.**

# Snap collector plugin - dbi

This plugin connects to various databases, executes SQL statements and reads back the results.

The plugin is a generic plugin. You can configure how each column is to be interpreted and the plugin will generate one or more data sets from each row returned according. These rules are defined in separated json file (read more about this in [Configuration and Usage](#configuration-and-usage) section).

Depending on the configuration, the returned values are converted into metrics.

The plugin is used in the [Snap framework] (http://github.com/intelsdi-x/snap).

1. [Getting Started](#getting-started)
  * [System Requirements](#system-requirements)
  * [Installation](#installation)
  * [Configuration and Usage](#configuration-and-usage)
2. [Documentation](#documentation)
  * [Setfile fields](#setfile-fields)
  * [Collected Metrics](#collected-metrics)
  * [Examples](#examples)
  * [Roadmap](#roadmap)
3. [Community Support](#community-support)
4. [Contributing](#contributing)
5. [License](#license)
6. [Acknowledgements](#acknowledgements)

## Getting Started

### System Requirements

- Linux system
- Access to database (currently the following SQL Drivers are supported: **MySQL**, **PostgreSQL**)

### Installation
#### Download the plugin binary:

You can get the pre-built binaries for your OS and architecture from the plugin's [GitHub Releases](https://github.com/intelsdi-x/snap-plugin-collector-dbi/releases) page. Download the plugin from the latest release and load it into `snapteld` (`/opt/snap/plugins` is the default location for Snap packages).

#### To build the plugin binary:

Fork https://github.com/intelsdi-x/snap-plugin-collector-dbi
Clone repo into `$GOPATH/src/github.com/intelsdi-x/`:

```
$ git clone https://github.com/<yourGithubID>/snap-plugin-collector-dbi.git
```

Build the Snap dbi plugin by running make within the cloned repo:
```
$ make
```
This builds the plugin in `./build/`

### Configuration and Usage

* Set up the [Snap framework](https://github.com/intelsdi-x/snap#getting-started)

* Create configuration file (called as a setfile) in which will be defined databases, queries and rules how interpret the results, see exemplary in [examples/configs/setfiles](examples/configs/setfiles)

* Set up field `setfile` in Global Config as a path to dbi plugin configuration file, see exemplary Snap Global Config: in [examples/configs/snap-config-sample.json] (examples/configs/snap-config-sample.json)

Notice that this plugin is a generic plugin, i.e. it cannot work without configuration, because there is no reasonable default behavior.

## Documentation

### Setfile fields

* **queries** - contains all defined queries put in query block which includes:
	*  **name** - identify query block, needs to be unique
	*  **statement** - SQL statement to be executed
	*  **results** - block which defines results of statement
* **results** - contains how the returned data should be interpreted, including:
	 * **name** - name of result, acceptable empty if only one result is defined; in other case must be given in order to distinguish results
	* **instance_from** - name of column whose values will be used to specify an instance
	* **instance_prefix** - prepended prefix to instance name
	* **value_from** - name of column whose content is used as the actual metric value

* **databases** - contains all defined databases which will be established connection, database block includes:
	* **name** - identify database block, needs to be unique
	* **driver** - database's driver ("mysql" | "postgres"),
	* **driver_option** - block which defines dns option such like hostname, port (if not given, the defaults for the driver will be set), username, password and name of database)
	* **selectdb** - name of database to which the plugin will switch after the connection is established (optional)
	* **dbqueries** - block of queries associates with this database connection

### Collected Metrics

Metric's namespace is `/intel/dbi/<metric_name>/`.

Depending on the configuration, the returned values are then converted into metrics. In examples there are ready configuration setfiles with prepared queries about:

[**a) Openstack Cinder services**](examples/configs/setfiles/dbi_cinder_services.json)
</br>[**b) Openstack Neutron agents**](examples/configs/setfiles/dbi_neutron_agents.json)
</br>[**c) Openstack Nova services**](examples/configs/setfiles/dbi_nova_services.json)
</br>[**d) Openstack Nova cluster status**](examples/configs/setfiles/dbi_nova_cluster_status.json)

Plus all of above in one config file [dbi_openstack.json](examples/configs/setfiles/dbi_openstack.json)

Task manifest contains names of metrics which will be collected

By default metrics are gathered once per second.

### Example
Example of running Snap dbi collector retrieving the metrics about cinder services and writing the results to file.

Create configuration file (`setfile`) for dbi plugin (see [examples/configs/setfiles/dbi_cinder_services.json](examples/configs/setfiles/dbi_cinder_services.json)).
```json
{
    "databases": [
        {
            "name": "cinder",
            "driver": "mysql",
            "driver_option": {
                "host": "123.456.78.9",
                "port": "3306",
                "username": "cinder",
                "password": "passwd",
                "dbname": "cinder"
            },
            "dbqueries": [
                {
                    "query": "cinder_services_up"
                },
                {
                    "query": "cinder_services_down"
                },
                {
                    "query": "cinder_services_disabled"
                }
            ]
        }
    ],
    "queries": [
        {
            "name": "cinder_services_down",
            "statement": "select concat_ws('/', 'services', replace(replace(s1.binary, 'nova-', ''), 'cinder-', ''), 'down') as metric, count(s2.id) as value from services s1 left outer join services s2 on s1.id = s2.id and s1.disabled=0 and s1.deleted=0 and timestampdiff(SECOND,s1.updated_at,utc_timestamp())>120 group by s1.binary",
            "results": [
                {
                    "instance_from": "metric",
                    "value_from": "value"
                }
            ]
        },
        {
            "name": "cinder_services_up",
            "statement": "select concat_ws('/', 'services', replace(replace(s1.binary, 'nova-', ''), 'cinder-', ''), 'up') as metric, count(s2.id) as value from services s1 left outer join services s2 on s1.id = s2.id and s1.disabled=0 and s1.deleted=0 and timestampdiff(SECOND,s1.updated_at,utc_timestamp())<=120 group by s1.binary",
            "results": [
                {
                    "instance_from": "metric",
                    "value_from": "value"
                }
            ]
        },
        {
            "name": "cinder_services_disabled",
            "statement": "select concat_ws('/', 'services', replace(replace(s1.binary, 'nova-', ''), 'cinder-', ''), 'disabled') as metric, count(s2.id) as value from services s1 left outer join services s2 on s1.id = s2.id and s2.disabled = 1 and s1.deleted=0 group by s1.binary",
            "results": [
                {
                    "instance_from": "metric",
                    "value_from": "value"
                }
            ]
        }
    ]
}

```

Create global configuration file for Snap and set path to `setfile` (see [examples/configs/snap-config-sample.json](examples/configs/snap-config-sample.json)):
```json
{
    "control": {
        "plugins": {
            "collector": {
                "dbi": {
                    "all": {
                        "setfile": "/path/to/dbi_cinder_services.json"
                    }
                }
            },
            "publisher": {},
            "processor": {}
        }
    }
}

```
Run the Snap daemon with created global config:
```
$ snapteld -l 1 -t 0 --config snap-config-sample.json
```

Download and load dbi plugin for collecting and file publisher:
```
$ wget http://snap.ci.snap-telemetry.io/plugins/snap-plugin-collector-dbi/latest/linux/x86_64/snap-plugin-collector-dbi
$ wget http://snap.ci.snap-telemetry.io/plugins/snap-plugin-publisher-file/latest/linux/x86_64/snap-plugin-publisher-file
$ chmod 755 snap-plugin-*
$ snaptel plugin load snap-plugin-collector-dbi
Plugin loaded
Name: dbi
Version: 4
Type: collector
Signed: false
Loaded Time: Tue, 05 Apr 2016 07:49:53 UTC
$ snaptel plugin load snap-plugin-publisher-file
Plugin loaded
Name: file
Version: 4
Type: publisher
Signed: false
Loaded Time: Tue, 05 Apr 2016 07:49:54 UTC
```

See available metrics:
```
$ snaptel metric list

NAMESPACE                                        VERSIONS
/intel/dbi/cinder/services/backup/disabled       4
/intel/dbi/cinder/services/backup/down           4
/intel/dbi/cinder/services/backup/up             4
/intel/dbi/cinder/services/scheduler/disabled    4
/intel/dbi/cinder/services/scheduler/down        4
/intel/dbi/cinder/services/scheduler/up          4
/intel/dbi/cinder/services/volume/disabled       4
/intel/dbi/cinder/services/volume/down           4
/intel/dbi/cinder/services/volume/up             4
```

Create and load example task file, which describes collection of cinder services dbi metrics (see [examples/tasks/dbi_cinder_services-file.json](examples/tasks/dbi_cinder_services-file.json)):
```json
{
    "version": 1,
    "schedule": {
        "type": "simple",
        "interval": "1s"
    },
    "workflow": {
        "collect": {
            "metrics": {
                "/intel/dbi/cinder/services/backup/disabled": {},
                "/intel/dbi/cinder/services/backup/down": {},
                "/intel/dbi/cinder/services/backup/up": {},
                "/intel/dbi/cinder/services/scheduler/disabled": {},
                "/intel/dbi/cinder/services/scheduler/down": {},
                "/intel/dbi/cinder/services/scheduler/up": {},
                "/intel/dbi/cinder/services/volume/disabled": {},
                "/intel/dbi/cinder/services/volume/down": {},
                "/intel/dbi/cinder/services/volume/up": {}
            },
            "config": {},
            "process": null,
            "publish": [
                {
                    "plugin_name": "file",
                    "config": {
                        "file": "/tmp/published_dbi_cinder_services.txt"
                    }
                }
            ]
        }
    }
}

```

```
$ snaptel task create -t dbi_cinder_services-file.json
Using task manifest to create task
Task created
ID: da9188b4-d592-4b45-b108-de06a8fdee1a
Name: Task-da9188b4-d592-4b45-b108-de06a8fdee1a
State: Running
```
See sample output from `snaptel task watch <task_id>`

```
$ snaptel task watch da9188b4-d592-4b45-b108-de06a8fdee1a

Watching Task (da9188b4-d592-4b45-b108-de06a8fdee1a):
NAMESPACE                                        DATA                    TIMESTAMP                                       SOURCE
/intel/dbi/cinder/services/backup/disabled       0                       2016-04-05 08:43:12.135743129 +0000 UTC         node-22.domain.tld
/intel/dbi/cinder/services/backup/down           0                       2016-04-05 08:43:12.135787905 +0000 UTC         node-22.domain.tld
/intel/dbi/cinder/services/backup/up             1                       2016-04-05 08:43:12.135734564 +0000 UTC         node-22.domain.tld
/intel/dbi/cinder/services/scheduler/disabled    0                       2016-04-05 08:43:12.135790187 +0000 UTC         node-22.domain.tld
/intel/dbi/cinder/services/scheduler/down        0                       2016-04-05 08:43:12.135674327 +0000 UTC         node-22.domain.tld
/intel/dbi/cinder/services/scheduler/up          1                       2016-04-05 08:43:12.135736637 +0000 UTC         node-22.domain.tld
/intel/dbi/cinder/services/volume/disabled       0                       2016-04-05 08:43:12.135716351 +0000 UTC         node-22.domain.tld
/intel/dbi/cinder/services/volume/down           0                       2016-04-05 08:43:12.135738704 +0000 UTC         node-22.domain.tld
/intel/dbi/cinder/services/volume/up             1                       2016-04-05 08:43:12.135785904 +0000 UTC         node-22.domain.tld
```
(`ctrl+c` terminates task watcher)

Metrics are published to file (in this example in /tmp/published_dbi_cinder_services.txt).

Stopping task:
```
$ snaptel task stop da9188b4-d592-4b45-b108-de06a8fdee1a
Task stopped:
ID: da9188b4-d592-4b45-b108-de06a8fdee1a
```

### Roadmap

There isn't a current roadmap for this plugin, but it is in active development. As we launch this plugin, we do not have any outstanding requirements for the next release.

If you have a feature request, please add it as an [issue](https://github.com/intelsdi-x/snap-plugin-collector-dbi/issues).

## Community Support
This repository is one of **many** plugins in the **Snap Framework**: a powerful telemetry agent framework. The full project is at http://github.com/intelsdi-x/snap.

To reach out to other users, head to the [main framework](https://github.com/intelsdi-x/snap#community-support) or visit [Slack](http://slack.snap-telemetry.io).

## Contributing
We love contributions!

There's more than one way to give back, from examples to blogs to code updates. See our recommended process in [CONTRIBUTING.md](CONTRIBUTING.md).

## License
Snap, along with this plugin, is an Open Source software released under the Apache 2.0 [License](LICENSE).

## Acknowledgements
List authors, co-authors and anyone you'd like to mention

* Author: 	[Izabella Raulin](https://github.com/IzabellaRaulin)

**Thank you!** Your contribution is incredibly important to us.

repository: intelsdi-x/snap-plugin-collector-dbi

gha_language: Go

repo_name: intelsdi-x/snap-plugin-collector-dbi


text:
# Phathom pipeline

This package has commands for running chunks of Phathom so
it can be executed as a pipeline from the command-line.

## Co-registration workflow

The co-registration workflow takes similarly-stained images from a
fixed and moving volume, derives an elastic transformation between
fixed and moving and then applies that transformation to images in
the moving frame to warp them to the fixed frame.

The steps (see below for command details):

* *phathom-preprocess*: apply CLAHE
(http://tog.acm.org/resources/GraphicsGems/) to both the fixed and
 moving stacks.
* *precomputed-tif*: Make Neuroglancer volumes of the data for
inspection and downsampling (see [precomputed-tif](https://github.com/chunglabmit/precomputed-tif))
* *phathom-rigid-registration*: Perform a coarse rigid registration
using a downsampled version of the stack.
* OR *phathom-non-rigid-registration* Peform a coarse non-rigid
registration using a downsampled version of the stack.
* *detect-blobs*: Detect blobs for both the fixed and moving stacks.
detect-blobs is part of the [eflash_2018](https://github.com/chunglabmit/eflash_2018)
package
* *phathom-geometric-features*: Calculate geometric features from
the detected blobs from both the moving and fixed stacks.
* *phathom-find-neighbors*: Match neighboring blobs within a search
radius.
* *phathom-filter-matches*: Filter matches based on re-estimation
of affine transform using ransac.
* *phathom-fit-nonrigid-transform*: Create a transform for warping the
moving image onto the fixed one.
* *phathom-warp-image*: Warp moving images onto the fixed reference
frame.

## Commands

### *phathom-preprocess* - apply CLAHE to a TIFF stack

```bash
phathom-preprocess \
   --input <input-path> \
   --output <output-path> \
   [--output-format <output-format> ] \
   [--threshold <threshold> ] \
   [--kernel-size <kernel-size> ] \
   [--clip-limit <clip-limit>] \
   [--n-workers <n-workers>]
```
where

* **input-path** is the path to the input TIFF files
* **output-path** is the path to the directory for the output volume
* **output-format** is the format for the output volume. Currently
  the default is tiff, other possible values are blockfs
  and zarr
* **threshold** is the binary threshold to use to mask the image.
Portions of the image less than the threshold will be rendered as 0.
* **kernel-size** is the size of the adaptation kernel used in CLAHE
* **clip-limit** is the CLAHE clip-limit (see [equalize_adapthist](https://scikit-image.org/docs/dev/api/skimage.exposure.html#skimage.exposure.equalize_adapthist))
* **n-workers** is the number of worker processes when running
in parallel. This defaults to 1.

### *phathom-rigid-registration* - perform a rigid registration

```bash
phathom-rigid-registration \
   --fixed-url <fixed-url> \
   --moving-url <moving-url> \
   --output <output-pickle> \
   --mipmap-level <mipmap-level> \
   [--fixed-url-format <fixed-url-format>] \
   [--moving-url-format <moving-url-format>] \
   [--visualization-file <visualization-file>] \
   [--n-iter <n-iter>] \
   [--t0 <t0>] \
   [--theta0 <theta0>] \
   [--s0 <s0>]
   [--use-hull]
   [--interactive]
```

where:
* **fixed-url** is the Neuroglancer URL of the fixed volume, e.g.
"https://my-server.org/precomputed/fixed"
* **moving-url** is the Neuroglancer URL of the moving volume
* **output-pickle** is the path name for the pickled transformation
function produced by this program
* **mipmap-level** is the mipmap level for the reduced resolution, e.g.
"32" for a 32x reduction in size. Typical values are 1, 2, 4, 16 and 32
* **fixed-url-format** for a file URL, the format of the precomputed
fixed volume, "tiff", "zarr" or "blockfs". Defaults to blockfs.
* **moving-url-format** for a file URL, the format of the precomputed
moving volume, "tiff", "zarr" or "blockfs". Defaults to blockfs.
* **visualization-file** the path to a .pdf file that is output by
the program, containing informative visualizations of the various
processing steps.
* **n-iter** the number of basin hopping iterations to perform
* **t0** the initial guess for the translational displacement. Default
is "0,0,0". The guess should be entered as three comma-separated values
in the original space.
* **theta0** the initial guess for the rotational component of the
registration. Default is "0,0,0". The guess should be entered as
three comma-separated floating point numbers, in radians.
* **s0** the coordinates of the rotational center in the moving frame
of reference
* **--use_hull** take the convex hull of the threshold mask instead
of using the mask directly
* **--interactive** show the plots as they are written to the
visualization file

### *phathom-non-rigid-registration* - coarse non-rigid registration

*phathom-non-rigid-registration* is an alternative to
*phathom-rigid-registration*. It performs a rough non-rigid registration
using the Elastix toolkit. It is typically initialized using parameters
from the [rigid-rotate](https://github.com/chunglabmit/rigidrotate)
web app - this gives the application an initial starting point and may
be neccessary if there is a large rotation or translation between the
two images.

The result is a pickled dictionary containing the transform
function from the moving coordinate system to the fixed one.

```bash
phathom-non-rigid-registration \
    --fixed-url <fixed-url> \
    --moving-url <moving-url> \
    --output <output> \
    [--fixed-url-format <fixed-url-format>] \
    [--moving-url-format <moving-url-format] \
    [--mipmap-level <mipmap-level>] \
    [--grid-points <grid-points>] \
    [--initial-rotation <initial-rotation>] \
    [--initial-translation <initial-translation>] \
    [--rotation-center <rotation-center>]
```
where
* **fixed-url** is the Neuroglancer URL of the fixed volume
* **fixed-url-format** is the data format of the fixed URL if it is
 a file URL. Valid values are "blockfs", "tiff" or "zarr".
* **moving-url** is the Neuroglancer URL of the moving volume
* **moving-url-format** is the data format of the moving URL if it is
 a file URL. Valid values are "blockfs", "tiff" or "zarr".
* **output** is the pickle file holding the interpolator
* **mipmap-level** is the mipmap level of the downsampling,
 e.g. 32 or 64
* **grid-points** is the number of grid points across the image in
 each direction
* **initial-rotation** is the initial rotation of the moving image
 along the X, Y and Z axes as 3 comma-separated values in degrees.
* **rotation-center** is the rotation center from rigid-rotate,
 the X,Y,Z values separated by commas. Default is the image center.
* **initial-translation** is the initial translation of the moving image
 along the X, Y and Z axes as 3 comma-separated values.

### *phathom-geometric-features* - calculate geometric features

usage:
```bash
phathom-geometric-features \
    --input <input-path> \
    --output <output-path> \
    [--voxel-size <voxel-size>] \
    [--n-workers <n-workers>]
```

where:
* **input-path** is the path to a file of blob coordinates, e.g. as
generated by the **detect-blobs** command (see above).
* **output-path** is the path to the file of geometric features per
blob to be written. This is a pickled Numpy array.
* **voxel-size** the size of one voxel in microns. The format is
three comma-separated numbers for the x, y and z sizes. The default
is "1.8,1.8,2.0" which is the voxel size used in the Chung lab
when imaging at 4x.
* **n-workers** is the number of worker processes used when computing
the geometric features.

### *phathom-find-neighbors*

*phathom-find-neighbors* finds correspondences between points in
the fixed and moving volumes. It applies a transformation to the
moving points to bring them into the fixed frame of reference and
then does the matching based on several criteria:
* radius - after transformation, the points must be within a given
radius of each other
* feature distance - The features from *phathom-geometric-features*
for the corresponding points must match within a certain accuracy.
* prominence threshold - the feature match must be this much better
than the other possible matches in the neighborhood.

 This is a .json file in x, y, z format e.g. as made by
detect-blobs.
* **moving-coords** is the path to the blob coordinate file for the
moving volume. This is a .json file in x, y, z format e.g. as made by
detect-blobs.
* **fixed-features** is the path to the features file for the fixed
volume, e.g. as produced by phathom-geometric-features
* **moving-features** is the path to the features file for the moving
volume, e.g. as produced by phathom-geometric-features
* **rigid-transformation** is the rigid transformation to convert the
moving coordinates to an approximation of the fixed volume space, e.g.
as produced by phathom-rigid-registration. Either --rigid-transform
or --non-rigid-transform must be specified.
* **non-rigid-transformation** is the non-rigid rough transformation to
convert moving coordinates into fixed coordinates, e.g. as produced by "
phathom-non-rigid-registration
* **output** is the output of this program, a JSON dictionary with the
intermediate results to this stage.
* **voxel-size** is the size of a voxel in microns, three
comma-separated values in x, y, z order e.g. "1.8,1.8,2.0"
* **radius** is the search radius for matches, in microns
* **max-fdist** is the maximum allowed feature distance for a match
* **prom-thresh** is the prominence threshold for a match. All competing
matches must have a feature distance that is less than this fraction of
the match being considered
* **n-workers** is the number of worker processes to use during
computation
* **batch-size** is the number of fixed points to process per worker
invocation
* **visualization-file** is the path to the PDF file output by this
program. This file contains helpful visualizations that document the
program's progress.
* **interactive** If supplied, the program will display each of the
visualizations as they are created. Only supply if you have a display.
* **log-level** is the log verbosity level. Default is WARNING, options
are DEBUG, INFO, WARNING and ERROR

### *phathom-filter-matches*

*phathom-filter-matches* takes the matches from *find-neighbors* and
uses RANSAC to create an affine transform model. It then filters
the matches further based on the correspondence beteween fixed and
moving pairs after applying the affine transform. The filterered
point set and transform are written as the output.

```bash
phathom-filter-matches \
    --input <input-path> \
    --output <output-path> \
    [--min-samples <min-samples>] \
    [--max-distance <max-distance>] \
    [--n-neighbors <n-neighbors> ] \
    [--min-coherence <min-coherence> ] \
    [--visualization-file <visualization-file> ] \
    [--interactive ] \
    [--residuals-file ] \
    [--log-level ]
```

where:
* **input-path** is the path to the input file, e.g. as produced by
*phathom-find-neighbors*
* **output-path** is the path to the output file from this program,
an intermediate file, stored as a JSON dictionary with keys for the
filtered sets of fixed and moving points and the pickled affine
transform.
* **min-samples** the minimum number of samples selected at random
from the source points when making the model. Default is 30, must be
more than four.
* **max-distance** the maximum distance allowed between fixed and
moving points after applying the affine transform
* **n-neighbors** the number of alternate matches considered when
caluclating the coherence distance. Default is 3
* **min-coherence** the minimum coherence allowed. Default is .9, range
is 0 to 1.
* **visualization-file** the filename of the optional PDF of
visualization plots
* **interactive** to display the plots interactively
* **log-level** The log level for logging, one of DEBUG, INFO,
WARNING or ERROR. Default is WARNING.

### *phathom-fit-nonrigid-transform*

*phathom-fit-nonrigid-transform* creates a pickled point transform
function from the fixed volume space to the moving volume space.

```bash
phathom-fit-nonrigid-transform \
    --input <input-path> \
    --output <output-path> \
    [--visualization-file <visualization-path>] \
    [--interactive]\
    [--max-samples <max-samples>] \
    [--smoothing <smoothing>] \
    [--grid-points <grid-points>] \
    [--fixed-url <fixed-url>] \
    [--moving-url <moving-url>] \
    [--fixed-url-format <fixed-url-format>] \
    [--moving-url-format <moving-url-format>] \
    [--log-level <log-level>]
```
where
* **input-path** is the input file from *phathom-filter-matches*

* **output-path** is the pickled nonrigid transform

* **visualization-file** is the path to the PDF file output by this
  program. This file contains helpful visualizations that document the
  program's progress.

* **--interactive** if supplied, the program will display each of the
  visualizations as they are created. Only supply if you have a display.

* **max-samples** is the maximum number of samples to be used when
  constructing the thin-plate spline

* **smoothing** is the smoothing for the thin-plate spline

* **grid-points** is the number of grid points in the X, Y and Z when
  creating a bspline approximation

* **fixed-url** is the Neuroglancer URL of the fixed volume, e.g.
  "https://my-server.org/precomputed/fixed". This is only used to
  visualize the overlap and is not needed for the basic calculation.

* **moving-url** is the Neuroglancer URL of the moving volume, e.g.
  "https://my-server.org/precomputed/fixed". This is only used to
   visualize the overlap and is not needed for the basic calculation.

* **fixed-url-format** is the data format of the fixed URL if it is a
  file URL. Valid values are "blockfs", "tiff" or "zarr".

* **moving-url-format** is the data format of the moving URL if it is a
  file URL. Valid values are "blockfs", "tiff" or "zarr".

* **log-level** is the log verbosity level. Default is WARNING, options
  are DEBUG, INFO, WARNING and ERROR

### *phathom-warp-points*

*phathom-warp-points* translates points in the fixed reference frame
to the moving reference frame using the interpolator output by
*phathom-fit-nonrigid-transform*

```bash
phathom-warp-points \
    --interpolator <interpolator> \
    --input <input> \
    --output <output> \
    [--n-workers <n-workers>] \
    [--batch-size <batch-size>]
```

where

* **interpolator** is the interpolator pickle output by
*phathom-fit-nonrigid-transform*

* **input** is a .json file of coordinates in the fixed frame of
reference

* **output** is the name of the output file to be written - a .json
file of coordinates in the moving frame of reference

* **n-workers** is the optional number of worker processes to use. If
not specified, one worker is used per core.

* **batch-size** is the number of coordinates per worker invocation

### *phathom-warp-image*

*phathom-warp-image* warps an image from the moving frame of reference
to the fixed frame of reference using the interpolator output by
*phathom-fit-nonrigid-transform*. The image is written as a Neuroglancer
volume.

```bash
phathom-warp-image \
    --interpolator <interpolator> \
    --url <url> \
    --output <output> \
    [--url-format <url-format>] \
    [--n-workers <n-workers>] \
    [--n-writers <n-writers>] \
    [--n-levels <n-levels>] \
    [--output-shape <output-shape>] \
    [--offset <offset>] \
    [--silent] \
    [--use-gpu]
```

where

* **interpolator** is the interpolator pickle file output by
*phathom-fit-nonrigid-transform*

* **url** is the neuroglancer URL of the moving image. May be specified
          multiple times.
* **url-format** is the format of the URL if a file URL. Must be
          specified once per URL if specified at all. Valid values are
          "tiff", "zarr" and "blockfs". Default is blockfs.

* **output** is the location for the Neuroglancer data source for the
          warped image. Must be specified once per input URL.

* **n-workers** The number of workers devoted to transforming
          coordinates (if --use-gpu is not specified)

* **n-writers** is the number of worker processes devoted to writing
          output data

* **n-levels** is the number of levels in each output volume

* **output-shape** is the output volume shape in x,y,z format. If not
           specified, it will be the same as the shape of the first
           input volume.

* **offset** is the offset of the cutout volume in x,y,z format. If
             not specified, it will be 0,0,0.

* **--silent** Do not print progress bars

* **--use-gpu** Use a GPU to perform the warping computation

license: MIT

repository: chunglabmit/phathom

gha_language: Python

gha_license_id: MIT

repo_name: chunglabmit/phathom


text:
# Bashrc scripts
This folder contains various shell scripting modules that can be sourced from your .bashrc file
to provide enhanced shell functionality.

Each script-module should begin (after the shebang) with a comment describing the general
functionality it offers. Optionally, a script-module may offer a specific README (i.e <script-module-name>-README.md)
describing the functions it exposes.

## script-module design guidelines
- Has meaningful name
- Has shebang
- Comment describing the script-module functionality at the top of the file
- Init() function : Any global/one-time operations should be performed here
- Function per desired functionality exposed to the user
- Optionally a usage function per desired functionality may be added and invoked if the first
  argument is `-h`
- No operations aside of init call should be performed outside of a function's scope

## Usage
- Copy relevant scripts to your home directory
- Edit `~/.bashrc` and source relevant scripts
- Happy hacking!

repository: adrianchiris/dev-utils

branch_name: refs/heads/main

repo_name: adrianchiris/dev-utils


text:
---
jupytext:
  text_representation:
    extension: .md
    format_name: myst
    format_version: '0.8'
    jupytext_version: '1.4.1'
kernelspec:
  display_name: Python 3
  language: python
  name: python3
---
# MyST Markdown Notebooks

MyST Markdown Notebooks allow you to write your Jupyter Notebook
entirely in markdown using the
[MyST Markdown format](https://jupytext.readthedocs.io/en/latest/formats.html#myst-markdown).
This allows you to store notebook metadata,
markdown, and cell inputs in a text-based format that is easy
to read and use with text-based tools.

MyST Notebooks can be [parsed directly into Sphinx](myst-nb/sphinx)
with the `myst_nb` Sphinx extension, and are similarly-supported as
[Jupyter Book inputs as well](myst-nb/jupyter-book). [^download]

MyST Notebooks have a 1-to-1 mapping with the notebook, so can be
[converted to `.ipynb` files](converting-ipynb) and
[opened as notebooks in Jupyter interfaces](myst-nb/jupyter-interfaces) (with jupytext installed).
When used with Sphinx, MyST Notebooks are also integrated
directly into the {ref}`Execution and Caching <execute/cache>` machinery!

[^download]: This notebook can be downloaded as
            **{nb-download}`markdown.py`** and {download}`markdown.md`

## The MyST Notebook Structure

MyST Markdown Notebooks (or MyST Notebooks for short) have
three main types of content: **markdown** (that can be written as
CommonMark or MyST Markdown), **code cells** (that are written
with MyST Markdown `code-cell` directive syntax), and cell/notebook
metadata (that are written as YAML wrapped in `---`). Here is an
example with these main syntax pieces:

````md
---
kernelspec:
  display_name: Python 3
  name: python3
notebookmetadatakey: val
notebookmetadatakey2: val2
---

# Markdown content is written as regular markdown

You can also write {ref}`MyST Markdown <myst>`.

```{code-cell}
---
cellmetadatakey: val1
---
print("Here is a Python cell")
```

And here is more markdown.

+++

Separate markdown cells with `+++` lines.

```{code-cell}
:cellmetadatakey: val1
print("Another code cell with a second optional metadata syntax")
```
````

:::{note}
The kernel that your code cells use is determined by the notebook-level
metadata for your MyST Notebook file. If no kernel is given, then the default kernel
will be used.
:::

### Syntax for code cells

When writing MyST Notebooks, use the following syntax to define a code cell:

````md
```{code-cell} ipython3
a = "This is some"
b = "Python code!"
print(f"{a} {b}")
```
````

The argument after `{code-cell}` (above, `ipython3`) is optional, and is used for
readability purposes. The content inside `{code-cell}` makes up the content of the cell,
and will be executed at build time.

This will result in the following output after building your site:

```{code-cell} ipython3
a = "This is some"
b = "Python code!"
print(f"{a} {b}")
```

**Code from Files:**

`myst_nb` provides a convenience feature for importing executable code into a `{code-cell}`
from a file. This can be useful when you want to share code between documents. To do this
you specify a `load` metadata attribute such as:

````md
```{code-cell} ipython3
:load: <path>
```
````

```{warning}
This is an experimental feature that is **not** part of the core `MyST` markup specification, and may be removed in the future. Using `:load:` will also overwrite any code written into the directive.
```

### Syntax for markdown

Anything in-between code cells will be treated as markdown. You can use any markdown
that is valid MyST Markdown. If you are using MyST Notebooks with the `myst_nb` Sphinx
extension, you can write Sphinx directives and roles. However, note that most Jupyter
Notebook environments may not be able to render MyST Markdown syntax.

**To denote a break between two markdown cells**, use the following syntax:

```
Some markdown
+++ {"optionalkey": "val"}
More markdown
```

This will result in two markdown cells in the resulting notebook. The key:val pairs
specified in the `{}` brackets will be cell-level metadata in the second markdown cell.

### Notebook-level metadata

You can begin the MyST Notebook file with front-matter metadata. These will be used
as **notebook-level metadata** for the resulting Jupyter Notebook. This metadata takes
the following form:

```md
---
key1: val1
key2: val2
---
# Notebook title
...
```

### Cell-level metadata

You can begin `code-cell` blocks with front-matter metadata. These will be used
as **cell-level metadata** in the resulting notebook cell.
The same metadata tags can be used as you would in a normal notebook,
for example those discussed in {ref}`use/hiding/code`:

````md
```{code-cell} ipython3
---
tags: [hide-output]
---
for i in range(20):
    print("Millhouse did not test cootie positive")
```
````

Yields the following:

```{code-cell} ipython3
---
tags: [hide-output]
---
for i in range(20):
    print("Millhouse did not test cootie positive")
```

There is also an **alternative short-hand syntax** for cell-level metadata. This takes
the following form:

````md
```{code-cell}
:key: val
print("hi")
```
````

For example, the following syntax adds a `raises-exception` tag to the cell, which
means our code will execute without halting the kernel:

````md
```{code-cell} ipython3
:tags: [raises-exception]

raise ValueError("oopsie!")
```
````

```{code-cell} ipython3
:tags: [raises-exception]

raise ValueError("oopsie!")
```

(converting-ipynb)=
## Convert between `ipynb` and MyST Notebooks

MyST Notebooks can be converted back-and-forth from `ipynb` files using
[jupytext](https://jupytext.readthedocs.io), a Python library for two-way
conversion of `ipynb` files with many text-based formats.

* To convert `.ipynb` to MyST-markdown, run: `jupytext notebook.ipynb --to myst`
* To convert MyST-markdown to `.ipynb`, run: `jupytext mystfile.md --to ipynb`

For more information, see the [Jupytext Documentation](https://jupytext.readthedocs.io).

(myst-nb/sphinx)=
## MyST Notebooks in Sphinx

In order to signal MyST-NB that it should treat your markdown file as a notebook,
add the following Jupytext configuration to your notebook-level metadata (by adding it to
the YAML front-matter at the beginning of the file).

```md
---
jupytext:
  text_representation:
    format_name: myst
kernelspec:
  display_name: Python 3
  name: python3
---
```

Note that `kernelspec:` should map on to the kernel you wish to use to run your
notebook's code. It must be installed on the machine and registered with Jupyter to
be used.

Here's an example of a simple MyST Notebook written for Jupytext and the `myst_nb`
Sphinx extension:

````md
---
jupytext:
  formats: md:myst
  text_representation:
    extension: .md
    format_name: myst
    format_version: '0.8'
    jupytext_version: 1.4.1+dev
kernelspec:
  display_name: Python 3
  language: python
  name: python3
---

# My simple notebook

Some **intro markdown**!

```{code-cell} ipython3
:tags: [mytag]

print("A python cell")
```

## A section

And some more markdown...
````

For more information, see [the MyST-NB Sphinx extension documentation](index.md).

(myst-nb/jupyter-book)=
## MyST Notebooks in Jupyter Book

In addition to using MyST Notebooks with Sphinx, you may also use them with the
Jupyter Book project. See {doc}`jb:file-types/myst-notebooks`.

(myst-nb/jupyter-interfaces)=
## MyST Notebooks in Jupyter interfaces

You can use MyST Notebooks in Jupyter interfaces by using Jupytext extensions. This
allows you to open a MyST Markdown Notebook as a "regular" Jupyter Notebook in
Jupyter Lab and the Classic Notebook interface. For more information, see
[the Jupytext documentation](https://jupytext.readthedocs.io).

repository: rossbar/MyST-NB

repo_name: rossbar/MyST-NB


text:
---
title: "A Foodie guide to Milano"
layout: post
tags: milano food travel coffee pizza
image: /images/milano.jpg
image-mobile: /images/milano.jpg
---

Since I get 498567 queries a day about "Heyyy I'm going to Milan for some days,
since you lived there you tell me some awesome places to get actual Italian
food", I figured it would be much more efficient to write down all the
recommendations (spoiler: I think it's hard to find "proper Italian food" in
Milan, as you're better off going to small towns for that, but I'll do my best
in here) in a place I can point everyone to. So, here we are.

This is intended to be a living document, so if you have any
suggestions/corrections, just [bother me here](https://twitter.com/fabferrai),
or [open a Pull Request](https://github.com/f-f/f-f.github.io), and we'll fix
it.

_Note_: the following sections are in no particular order, just pick some or
read through all of them.

_Disclaimer_: I'm not affiliated with any of this places (yet. I mean if you
want me to sponsor your place let's talk, but if you have good stuff I'll
happily send people your way anyways), all of this is just unconditional love
for the good food.

## Eating

### Pizza

I mean, of course. This is the first thing you want to do when you get in the
city 🍕.

- So, the best pizza in town in my opinion is [Pizza
  Am](https://goo.gl/maps/JvPRBmGpz4L2). Their selection is really limited (I
think they have margherita and a couple more pizzas), but a good margherita is
the only thing you actually need and want, so this is good.
- If you're around Città Studi (probably the area I know best, since I spent
  there most of the time) there is also a fairly good and affordable pizzeria:
[Il Postino](https://goo.gl/maps/XbvdvKqnYVC2). The selection is perfect, not
too many, and all fairly "traditional".

### Breweries

I like breweries I guess. And I think Milan is a good place for this kind of
"frank" (as in no-bullshit) but really well-designed breweries (something about
the city being a capital of design but also a really practical place where
people do things, but I digress). So here's my favorites:
- Near the Central Railway Station there is
  [Baladin](https://goo.gl/maps/aKYbM7447Bx). Really good beer (if you're into
open source you have to get an Open, which is, well, open source), really good
burgers and salads and meat dishes, 10/10. That area is also super nice to walk
in, as it's quickly becoming the downtown.  In the area there is really nice
buildings, a notable one is [Bosco Verticale](https://goo.gl/maps/HJ7y64P3uyu),
look around for it.  And there is also a very nice Neapolitan coffee place
[nearby](https://goo.gl/maps/SpETBCDjhXP2).
- My other favorite is [Birrificio Lambrate](http://birrificiolambrate.com/en/).
  There is two of them, so you want to go to [the big
one](https://goo.gl/maps/Go7QMSREFgL2) if you want to have lunch/dinner, and to
[the smaller but older one](https://goo.gl/maps/NsZekd6Ugaz) for a more
authentic brewery experience (they brew just next door, so it's truly a 0km
product). Amazing beer (my usual picks: Domm (weizen) and St.Ambroeus (golden
ale)) and amazing food, 10/10.

### Other food

- **Japanese**: Milan totally loves sushi (or it might be my bubble. But there
  is really many sushi places, so someone must go there). The best sushi in town
to my knowledge is [Poporoya](https://goo.gl/maps/PPNRLqCDGyk). It's a truly old
Japanese shop, really small (like, 15 seats?), with a no-reservations policy and
of course always super crowded, so probably best to avoid peak time (12am). But
the stuff is _really_ good, and service is fast.  For a fancier and less crowded
setting, there is the "cousin" restaurant just in front, [Shiro
Poporoya](https://goo.gl/maps/JcrwQdwVpHP2).
- **Kebab**: living in Helsinki I often complain about how hard (if not
  impossible) it is to get good kebab here. Fortunately in Milan we don't have
this problem, there is a lot of places, and the kebab is usually good
everywhere. If you're around Città Studi, go to [Le
Piramidi](https://goo.gl/maps/4iH2QwUB9b52) and send my greetings to Luca.
- **Panzerotti**: if you don't know what a panzerotto is: make a small calzone,
  and then *deep fry*. Yes it's *reeally* good. It's commonly known that the
best ones in town are from [Luini](https://goo.gl/maps/nc5LUuccN2D2). Just get
the classic ones, like margherita or salame. Be careful about when you go there,
as in lunch rush hour (12-13) the queue could be several tens of meters long.
- **Fish**: they say that in Milan [you get the freshest fish in
  Italy](http://www.rivistastudio.com/standard/il-mare-a-milano/) (while this
might be a bit of an exaggeration, the fish is usually _really_ fresh. Read the
previous link for reasons why. Works well with GTranslate), so I would be
neglecting something if I didn't mention any fish places (I know, sushi is fish,
but bear with me here). I really like [Il
Pescetto](https://goo.gl/maps/xgPTxZ2QuRH2): trendy, quick, and good selection
of fish and preparations.

## Nightlife

As in, "ok but where do people hang out?". So I guess I'm going to send you to
Navigli. Long story short even though there was not supposed to be any river
going through the city, some Reinassaince big guy wanted Leonardo Da Vinci to
build some channels to connnect the city to the sea ([they actually started much
before that](https://it.wikipedia.org/wiki/Navigli_(Milano)), but it's an easy
story to tell).  Fast-forward some centuries and we don't need direct sea
connection anymore, but we can reuse these nice channels to host a big
population of mosquitoes and hang out and feel like in Amsterdam.

![Naviglio Grande at
dusk](https://upload.wikimedia.org/wikipedia/commons/c/c0/Naviglio_Grande%2C_March_25%2C_2009%2C_Brina_CRS.jpg)

What to do there?

### Aperitivo

Milan is totally the capital of aperitivo. The concept is like "you go to a bar
around 18-19 with friends, get a Spritz, and have some finger food in the
meanwhile".  In practice things got _a bit_ out of hand, and some places now
serve a pantagruelian delicious buffet, so it's easy to have dinner there.
[Here's a slightly informative article about
it](https://www.walksofitaly.com/blog/food-and-wine/aperitivo-in-italy-what-it-is-and-how-to-enjoy-one).

A nice place with a high concentration of aperitivo places is [Naviglio
Grande](https://goo.gl/maps/J9hGQ9PgUoo). You can pick a place in advance, but
if you don't, there will be some people tring to get you into some place (I
don't know, a place I went often was [this
one](https://goo.gl/maps/UHsB46Tu34L2), but TripAdvisor might have better
suggestions than me on this), but since the competition in the area is high,
almost any place is going to be ok.

### Drinks

So you've eaten, or maybe not, and want to stay in the area to get drinks.
Worry no more:
- **Cocktails**: I really liked [Ginger Cocktail
  Lab](https://goo.gl/maps/RYd23q1u3v12) on [Naviglio
Pavese](https://goo.gl/maps/S9997JinkeT2), and they apparently have also
aperitivo. At this point I have to mention also the [Nottingham
Forest](https://goo.gl/maps/FXvVxLRdBwL2), as it's THE place for cocktails in
Milan.  Unfortunately I never managed to get in there (it's REALLY crowded all
the time), so you'll have to figure out. They say it's really good.
- **Beer**: the awesome [BQ](https://goo.gl/maps/4agxNjZx6nF2) will satisfy any
  craft beer nerd. It's good. See also the [breweries section in case you missed
that](#breweries).

## But...how about..the shopping?

Right. You want to go either to [Corso Vittorio Emanuele
II](https://goo.gl/maps/fAYyngN4u6q) or [Corso Buenos
Aires](https://goo.gl/maps/8zvzafGE1Fx). If you're into fashion, I assume you
already know about [Via Monte Napoleone](https://goo.gl/maps/1Dmyi9dZLv62). If
you're not, it's still worth it to go there just for the laughs.

## Actually, how about strolling around

If you read up to this point, it could be that you are interested in just
strolling around the city and seeing monuments and nice things and stuff.  I
like walking around the city, so I can advise some nice targeted and
landmarks-intense paths:
- **Duomo-Navigli**: Starting from [Duomo](https://goo.gl/maps/QGWM6pSUSMp), go
  through [Via Torino](https://goo.gl/maps/rcgJrxF9ZfQ2) (some amount of nice
shops, [hidden art](https://goo.gl/maps/cN8T7NSAAan), etc.),
[Colonnne](https://goo.gl/maps/qT6mz9pYXez), [Porta
Ticinese](https://goo.gl/maps/F9saPF6mEvM2), and then stroll both Naviglio
Grande and Naviglio Pavese (be careful that they are not parallel).
- **Duomo-Brera-Garibaldi**: Starting from Duomo, visit the
  [Galleria](https://goo.gl/maps/BHEN7x3tijo), you cannot miss [La
Scala](https://goo.gl/maps/7KnFt9vrct22), and then proceed to Brera: you might
be interested in the [Pinacoteca](https://goo.gl/maps/GRKiK2rvVek) and [Orto
Botanico](https://goo.gl/maps/X9pD8DeXrzu). Then go towards
[Moscova](https://goo.gl/maps/QwL4ZoLfTtM2), have a cannolo and a coffee
somewhere, and proceed to [Porta Garibaldi](https://goo.gl/maps/J8iuAH6619p).
You then want to go through [Corso Como](https://goo.gl/maps/qSH2jE9fKFx) (a
really trendy place for some reason), and finally [Piazza Gae
Aulenti](https://goo.gl/maps/2ufwcNDkYhp). Have an [ice cream
there](https://goo.gl/maps/rG4rhVhtNix).
- **Sempione**: Starting from..yes Duomo, get to
  [Castello](https://goo.gl/maps/tg3Zp1HNSTE2). Cross that, and you get to
[Parco Sempione](https://goo.gl/maps/DvMqzrvy59C2). It's the biggest park of the
center, and it's very nice to chill in there for a while. If you cross it
entirely, you get to [Arco della Pace](https://goo.gl/maps/E3S6UAvWjVB2), and
end up in Corso Sempione, which is also full of nice places to have aperitivo.

Buon appetito! 😎


text:
# 2001-An-ASCII-Odyssey

2001 an ASCII Odyssey is a combination of passional, inspirational words and unambiguously logical instructions given to a computer, science fiction literature and a perfect project to which to contribute for beginner programmers.
It was thought of as an open-source project consisting of a universe full of civilisations and stories all displayed in ASCII
characters. Creative writers passional about distant fictional words are welcome to it, as well as avid programmers who want to sharpen their logic skills and put into practice what they learnt in introductory C++ courses.
We can all make this universe more enriching and complex and that possibility is a few commits away from becoming a reality.

Please, feel free to contribute.


text:
# A better chess bot for discord
So.. one day I was playing chess on a discord bot (because why not), and I hated it. So I attempted to make a better one (in typescript)

## Usage
1) Add your token to `./src/data/config.json` where it says `YOUR-TOKEN-HERE`.

2) Run ```npm run build``` to build the typescript

3) Run ```npm run start``` to run the bot (MUST BE DONE AFTER STEP 2).

*Built off of a custom Typescript implementation of [GeraldCore](https://github.com/Elementalmp4/GeraldCore/blob/master/GeraldCore.js), so go check it out, or else... (i'm watching you)*


text:
[![Travis CI build](https://travis-ci.org/gonzie/pdoload.svg?branch=master)]()
[![PHP from Packagist](https://img.shields.io/packagist/php-v/gonzie/pdoload.svg)]()
[![License from pugx](https://poser.pugx.org/gonzie/pdoload/license.svg)]()

# PDOLoad
***PDOLoad*** is a small PDO wrapper/abstraction layer to provide read/write endpoints and load balancing capabilities in one line of code. Load balancing is usually include within most major PHP Frameworks however when working with large legacy projects it's hard to come by.

**Main Features**
* Add multiple read and write endpoints.
* ***One line implementation***. No need to rewrite your PDO queries.
* Transaction aware. Any reads while a transaction is active will be performed on the write connection.

## Getting started

* PHP >= 7.0 is required
* Install PDOLoad using composer (recommmended) or manually
* Configure your connections and you're ready to go!

## Installing with Composer

```
composer require gonzie/pdoload
```

## How to use

PDOLoad gives you as much choice as possible with little to no modification required.
A normal PDO connection would be set like:
```php
$dbh = new PDO('mysql:host=localhost;dbname=testdb;charset=utf8mb4', 'username', 'password');
```
(most basic set up)

To use a minimalistic version of PDOLoad you would amend the code as follows:
```php
$dbh = new Gonzie\PDOLoad\PDOLoad('mysql:host=localhost;dbname=testdb;charset=utf8mb4', 'username', 'password');
```

Alternatively, to use PDOLoad to it's full abilities, and for what it was actually made for, you can set up by passing an `array` with settings.

```php
<?php
$settings = [
    'driver' => 'mysql',
    'reader' => [
        [
            'host' => 'mysuperduperdbreader_1.com',
            'dbname' =>  'test',
            'user' => 'gonzie',
            'password' => 'password',
            'port' => '3306',
            'charset' => 'utf8mb4',
        ],
        [
            'host' => 'mysuperduperdbreader_2.com',
            'dbname' =>  'test',
            'user' => 'gonzie',
            'password' => 'password',
            'charset' => 'utf8mb4',
        ]
    ],
    'writer' => [
        [
            'host' => 'mysuperduperdbwriter_1.com',
            'dbname' =>  'test',
            'user' => 'gonzie',
            'password' => 'password',
            'charset' => 'utf8mb4',
        ],
    ],
    'balancer' => 'round-robin',
    'options' => [
         PDO::ATTR_PERSISTENT => true
    ]
];

$dbh = new Gonzie\PDOLoad\PDOLoad($settings);
```

Easy right?
Here's a breakdown of the settings array:

Field  | Type | Description
------------- | ------------- | -------------
driver  | string | Optional, default is `mysql`. Available options: `pdo_mysql, drizzle_pdo_mysql, mysqli, pdo_sqlite, pdo_pgsql, pdo_oci, pdo_sqlsrv, sqlsrv, oci8, sqlanywhere`
reader  | array[[connection](#connection-array "Goto connection-array")] | Required. Array of `connection` arrays.
writer  | array[[connection](#connection-array "Goto connection-array")] | Required. Array of `connection` arrays.
balancer  | string | Optional, default is ` `. Available options: `round-robin` - go from top to bottom of connection's array, `fixed` - PDOLoad will pick a connection at random and stick to it, `random` - each query will pick a random connection.
overwrite_allowed  | string | Optional, default is `false`. Some `driver` options require additional options other than the ones in the `connection` array, set this value to `true` if you need to add custom options to the array otherwise they won't be allowed.
options  | array | PDO options

### Connection array
Other options can be added to your liking as long as `overwrite_allowed` is set to `true`.

Field  | Type | Description
------------- | ------------- | -------------
host  | string | Required.
dbname  | string | Optional.
user  | string | Required.
password  | string | Required.
charset  | string | Optional, default is `utf8mb4`.

## Contributing
Any changes to the Project must abide by PSR Standards (PSR 2 - 12, PSR4 and others where applicable).

Please run phpcs before committing any code.
```
./vendor/bin/phpcs --standard=psr2 src/
```

repository: umfulana/pdoload

repo_name: umfulana/pdoload


text:
---
layout: default
---

# 1996-01-29 - Re: Downsizing the NSA

## Header Data

From: "Karl A. Siil"<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 8da6a746d0bb23e194a48f15b0f15439f8d9bdf0ef97cbabc71bfc34bf23e487

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1996-01-29 14:49:33 UTC

Raw Date: Mon, 29 Jan 1996 22:49:33 +0800

## Raw message

```
{% raw  %}From: "Karl A. Siil"<EMAIL_ADDRESS>Date: Mon, 29 Jan 1996 22:49:33 +0800
To<EMAIL_ADDRESS>Subject: Re: Downsizing the NSA
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

At 08:18 PM 1/28/96 EST, Dr. Dimitri Vulis wrote:
>I went to a talk by Andy Koenig a few weeks ago and he claimed that even
>though AT&T is laying off people (and splitting) they're still hiring every
>internet/security person they could find.

I don't know if this is tacky or politically incorrect for this list (so
I'll keep it short), ...

Speaking for my security group, this is correct. Anyone interested is urged
to send me private e-mail.

                                        Karl

{% endraw %}
```

## Thread

+ Return to [January 1996](/archive/1996/01)

+ Return to "["Karl A. Siil" <karl@cosmos.cosmos.att.com>](/authors/karl_a_siil_karl_at_cosmos_cosmos_att_com_)"

+ 1996-01-29 (Mon, 29 Jan 1996 22:49:33 +0800) - Re: Downsizing the NSA - _"Karl A. Siil"<EMAIL_ADDRESS>


text:
---
layout: post
title: biz-questions
---
questions for the business

***

These are questions for people in non-engineering parts of the business including marketing, product, UX and the project management organization. Their answers will help us make sure we're delivering a product with high expected value to our customers.

***

1. What is your target audience? (i.e. demographic info)
2. In terms of a priority ordering, which browsers and browser versions do we hope to support?
3. In terms of a priority ordering, which display/interaction platforms (web, mobile, kiosk, etc.) do we hope to support?
4. Do we have any delivery deadlines?
5. Will any third parties be embedding these pages or functionality?
6. Are there any prior versions of these applications?
7. Is this going to be part of some larger effort with an alpha/beta/production release cycle?
8. Who (what person) is our compliance stakeholder?
9. Who (what person) is our accessibility stakeholder?
10. Who (what person) is our security stakeholder?


text:
## Let's do the most simple sketch

Open the Arduino IDE, write the following sketch and upload it. The feature of this sketch is that the SSID and Password are not coded.

```cpp
#include <ESP8266WiFi.h>          // Replace with WiFi.h for ESP32
#include <ESP8266WebServer.h>     // Replace with WebServer.h for ESP32
#include <AutoConnect.h>

ESP8266WebServer Server;          // Replace with WebServer for ESP32
AutoConnect      Portal(Server);

void rootPage() {
  char content[] = "Hello, world";
  Server.send(200, "text/plain", content);
}

void setup() {
  delay(1000);
  Serial.begin(115200);
  Serial.println();

  Server.on("/", rootPage);
  if (Portal.begin()) {
    Serial.println("WiFi connected: " + WiFi.localIP().toString());
  }
}

void loop() {
	Portal.handleClient();
}
```

!!! note ""
    The above code can be applied to ESP8266. To apply to ESP32, replace ```ESP8266WebServer``` class with ```WebServer``` and include ```WiFi.h``` and ```WebServer.h``` of arduino-esp32 appropriately.

###  Run at first

After about 30 seconds, if the ESP8266 cannot connect to nearby Wi-Fi spot, you pull out your smartphone and open *Wi-Fi settings* from the *Settings* Apps. You can see the **esp8266ap** [^1] in the list of *"CHOOSE A NETWORK..."*. Then tap the esp8266ap and enter password **12345678**, a something screen pops up automatically as shown below.

[^1]:When applied to ESP32, SSID will appear as **esp32ap**.

This is the AutoConnect statistics screen. This screen displays the current status of the established connection, WiFi mode, IP address, free memory size, and etc. Also, the **hamburger icon** is the control menu of AutoConnect seems at the upper right. By tap the hamburger icon, the control menu appears as the below.

###  Join to the new access point

Here, tap *"Configure new AP"* to connect the new access point then the SSID configuration screen would be shown. Enter the **SSID** and **Passphrase** and tap **apply** to start connecting the access point.

!!! info "Can be configured with static IP"
    Since v1.1.0, [**Configure new AP**](menu.md#configure-new-ap) menu can configure for WIFI_STA with static IP.

###  Connection establishment

After connection established, the current status screen will appear. It is already connected to WLAN with WiFi mode as WIFI\_AP\_STA and the IP connection status is displayed there including the SSID. Then at this screen, you have two options for the next step.

For one, continues execution of the Sketch while keeping this connection. You can access ESP8266 via browser through the established IP address after cancel to "**Log in**" by upper right on the screen.
Or, "**RESET**" can be selected. The ESP8266 resets and reboots. After that, immediately before the connection will be restored automatically with WIFI\_STA mode.

###  Run for usually

The IP address of ESP8266 would be displayed on the serial monitor after connection restored. Please access its address from the browser. The "Hello, world" page will respond. It's the page that was handled by in the Sketch with "**on**" function of *ESP8266WebServer*.

repository: Hieromon/AutoConnect

repo_name: Hieromon/AutoConnect


text:
[![build status](https://img.shields.io/travis/gcanti/io-ts/master.svg?style=flat-square)](https://travis-ci.org/gcanti/io-ts)
![npm downloads](https://img.shields.io/npm/dm/io-ts.svg)

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Installation](#installation)
- [Usage](#usage)
  - [Stable features](#stable-features)
  - [Experimental features (version `2.2+`)](#experimental-features-version-22)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Installation

To install the stable version

```sh
npm i io-ts fp-ts
```

**Note**. [`fp-ts`](https://github.com/gcanti/fp-ts) is a peer dependency for `io-ts`

# Usage

## Stable features

- [Documentation of the main stable features (`index.ts` module)](index.md)

## Experimental modules (version `2.2+`)

Experimental modules (\*) are published in order to get early feedback from the community, see these tracking [issues](https://github.com/gcanti/io-ts/issues?q=label%3Av2.2+) for further discussions and enhancements.

The experimental modules are **independent and backward-incompatible** with stable ones.

- [`Decoder.ts` module](Decoder.md)
- [`Encoder.ts` module](Encoder.md)
- [`Codec.ts` module](Codec.md)
- [`Eq.ts` module](Eq.md)
- [`Schema.ts` module (advanced feature)](Schema.md)

(\*) A feature tagged as _Experimental_ is in a high state of flux, you're at risk of it changing without notice.

repository: gcanti/io-ts

gha_language: TypeScript

repo_name: gcanti/io-ts


text:
# v0.3.10 2021-03-30
- Do not synchronize resolve with mutex

# v0.3.9 2021-03-10

- Synchronize access with Mutex
- Add key_resolver
- Fix: Inherit options set through accessors

# v0.3.5 2020-12-23

- Allow to inherit options in nested registries

# v0.3.5 2020-12-04

- Allow patterns as keys

# v0.3.4 2020-12-04

- Bring back Singleton
- Fix mistakes in readme

# v0.3.3 2020-11-24

- Fix: Pass key to resolver instead of value

# v0.3.2 2020-09-29

- Fix interface definition

# v0.3.1 2020-09-23

- Allow to define custom accessors for registries

# v0.3.0 2020-09-10

### Breaking Changes

- Toggled interface for resolve(!) and register(!)
- Allow to register values in nested registries
- Rename nested method into level
- Provide registry readers
- Remove Singleton extension
- Allow to resolve paths
- Pass key to default block when it takes an argument

[Compare v0.2.1...v0.3.0](https://github.com/nxt-insurance/nxt_registry/compare/v0.2.1...v0.3.0)

# v0.2.1 2020-08-14

### Fixed

- Fixed Registry#fetch to raise key error in case of missing key

[Compare v0.2.0...v0.2.1](https://github.com/nxt-insurance/nxt_registry/compare/v0.2.0...v0.2.1)

# v0.2.0 2020-07-24

### Added

- [internal] Added NxtRegistry::Singleton
- Added NxtRegistry::Singleton interface
- Make name optional and have object_id.to_s as default name
- Fix readme

[Compare v0.1.5...v0.2.0](https://github.com/nxt-insurance/nxt_registry/compare/v0.1.5...v0.2.0)

gha_language: Ruby


text:
# gps-recorder

https://johannesjo.github.io/gps-recorder/

Records the GPS position over time, as provided by the browser api (which depending on the device in use has some limitations in terms of precision and tracking interval). Still good enough if you quickly want to generate some gps data e.g. for testing purposes in software development.

The data can be saved as JSON.

repository: johannesjo/gps-recorder

repo_name: johannesjo/gps-recorder


text:
# USB-Lock
🔒 Lock/Unlock your Mac based on USB device.

## Security
Don't use this app to secure your computer. 🔥🔥🔥

## TODO
- [ ] Use USB serial to identify devices
- [ ] Observe USB mount/unmount with low level API
- [ ] open preference window only when not configured, else over menu

## Notes and Material
* Command to list all USB devices: `ioreg -Src IOUSBDevice`
* http://stackoverflow.com/a/7569013/279890
* https://github.com/armadsen/ORSSerialPort/blob/master/Source/ORSSerialPortManager.m#L220
* http://oroboro.com/usb-serial-number-osx/
* https://developer.apple.com/library/mac/documentation/DeviceDrivers/Conceptual/AccessingHardware/AH_IOKitLib_API/AH_IOKitLib_API.html
* http://stackoverflow.com/questions/17305260/objective-c-c-detect-usb-drive-via-iokit-only-on-mac
* http://stackoverflow.com/questions/7567872/how-to-create-a-program-to-list-all-the-usb-devices-in-a-mac

repository: yene/USB-Lock

repo_name: yene/USB-Lock


text:
```
Number:  WLIP-0003
Title:   Word lists
Type:    Standard
Status:  Draft
Authors: Paweł Broda<EMAIL_ADDRESS>Created: 2019-10-02
```

## Abstract

WLIP-0003 gathers word lists for various languages.

## Motivation

Possibility to create a wallet backup using list in our native language for sure helps to achieve widespread adoption.

## List of languages

Languages are listed in alphabetical order. Please note WLIP-0001 makes
[BIPS english word list](https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt) obsolete.
However, due to it's popularity and the fact it is still in use, it is also present in the table below,
as English-a1d03317-obsolete.

|Word list|Character set|Status|Comment|
|---|---|---|---|
|[English-missing_hash](wlip-0003/english-missing_hash)|English|Draft|
|[English-a1d03317-obsolete](wlip-0003/english-a1d03317-obsolete)|English|Draft|considered obsolete as does not comply with WLIP-0001|
|[Polski-missing_hash](wlip-0003/polski-missing_hash)|English|Draft||


text:
# MerkelTree
 Generates and displays a Merkel Tree of a directory.  Used to better discern where directories are different or have changed.

## Usage
`./merkel.py DIRECTORY`

repository: BrandonHarrisonCode/MerkelTree

repo_name: BrandonHarrisonCode/MerkelTree


text:
# Venidium Blockchain

Hello and welcome to Venidium Blockchain.

We are happy to announce the launch of our mainnet today.

_For now, we only provide Graphical User Interface instructions for Windows and Command Line Interface instructions for Linux, Mac and WSL._

# Installation instructions for Ubuntu/Debian

Follow below install instructions for Ubuntu 20.04 LTS. If you are installing on Ubuntu 18.04 LTS you should use Python 3.7 instead: `sudo apt-get install python3.7-venv python3.7-distutils python3.7-dev git lsb-release -y`

```shell
sudo apt-get update
sudo apt-get upgrade -y

# Install Git
sudo apt install git -y

# Checkout the source and install
git clone https://github.com/Venidium-Network/venidium-blockchain.git -b latest --recurse-submodules
cd venidium-blockchain

# Clear any remnant env vars
unset VENIDIUM_ROOT

sh install.sh

. ./activate

venidium init

# install gui
sh install-gui.sh

# activate GUI
cd venidium-blockchain-gui
npm run electron &
```

# Installation instructions for macOS

For macOS, make sure [brew](https://brew.sh/) is available before starting the setup and that python 3.7 or newer is installed.

```shell
# Checkout the source and install
git clone https://github.com/Venidium-Network/venidium-blockchain.git -b latest --recurse-submodules
cd venidium-blockchain

# Clear any remnant env vars
unset VENIDIUM_ROOT

sh install.sh

. ./activate

venidium init

# install gui
sh install-gui.sh

# activate GUI
cd venidium-blockchain-gui
npm run electron &
```

# Windows

## GUI

ℹ _Before you start, you are advised to __not launch the installer directly__. We have prepared a tool that you need to run to make sure previous installations don't interfere. Please run `cleanup-testnet-environment` (exe) that you can find at the [releases](https://github.com/Venidium-Network/venidium-blockchain/releases) page before installing venidium_

Please follow the steps in order to cleanly install venidium:

1. Download the latest `cleanup-testnet-environment` (exe) file from the [releases](https://github.com/Venidium-Network/venidium-blockchain/releases) page.
1. Double click on `cleanup-testnet-environment` file (exe).
1. Select the `Cleanup the whole venidium directory (highly recommended)` option by pressing `1` and then enter.
1. Select the `Cleanup VENIDIUM_ROOT environment variable (highly recommended)` options by pressing `1` and then enter.
1. Download the latest `VenidiumSetup` (exe) file from the [releases](https://github.com/Venidium-Network/venidium-blockchain/releases) page.
1. Double-click on `VenidiumSetup` (exe) and wait for the installation to finish.
1. Venidium Blockchain should now start. You can recover/generate your keys, add your plot directories.

## WSL2

*We suggest the use of the Windows GUI installer instead of running venidium over WSL2*

If you feel comfortable with using the command line, you can install Venidium (CLI) on a WSL2 instance.

Install Ubuntu 20.04 LTS from the Microsoft Store and run it and complete its initial install steps. You now have a linux bash shell environment that can run linux native software on Windows.

Then follow the steps below which are the same as the usual Ubuntu instructions above with a target of Python 3.8.

```shell
sudo apt-get update
sudo apt-get upgrade -y

# Install Git
sudo apt install git -y

# Checkout the source and install
git clone https://github.com/Venidium-Network/venidium-blockchain.git -b latest --recurse-submodules
cd venidium-blockchain

# Clear any remnant env vars
unset VENIDIUM_ROOT

sh install.sh

. ./activate

venidium init
```

*There is no easy way to have the GUI working while having the wallet/node running in a WSL2 instance.*
*We suggest the use of the GUI installer instead.*

repository: Venidium-Network/venidium-blockchain

repo_name: Venidium-Network/venidium-blockchain


text:
---
title: "Using fog-softlayer for Managing Key Pairs"
description: "In [part four]( http://sldn.softlayer.com/blog/matteldridge/Using-fog-softlayer-Managing-DNS ) of this series, we explor"
date: "2014-07-30"
author: "matt.eldridge"
tags:
    - "blog"
---

In [part four]( http://sldn.softlayer.com/blog/matteldridge/Using-fog-softlayer-Managing-DNS ) of this series, we explored using [fog-softlayer](https://github.com/softlayer/fog-softlayer) for managing your SoftLayer tags.

In this post, we'll look at creating and assigning SSH key pairs for use with our compute instances.

##### Key Pair Examples

These examples all assume you have `~/.fog`, which contains the following:

default:
  softlayer_username: example-username
  softlayer_api_key: 1a1a1a1a1a1a1a1a1a11a1a1a1a1a1a1a1a1a1
  softlayer_default_domain: example.com

##### Create a Connection to SoftLayer Compute Service

<ruby>
require 'fog/softlayer'
@sl = Fog::Compute[:softlayer]
</ruby>

##### Key Pair Basics

Create some new key pairs:
<ruby>
kp1 = @sl.key_pairs.create(:label => 'my-new-key', :key => 'ssh-rsa AAAAxbU2lx...')
# => <Fog::Compute::Softlayer::KeyPair>
kp2 = @sl.key_pairs.new
kp2.label = 'my-new-new-key'
kp2.key = 'ssh-rsa AAAAxbU2lx...'
kp2.save
# => <Fog::Compute::Softlayer::KeyPair>
</ruby>

Here's how we get key pairs that have already been created:
<ruby>
# By id:
kp = @sl.key_pairs.get(123456)
# => <Fog::Compute::Softlayer::KeyPair>

# By label:
kp = @sl.key_pairs.by_label('my-new-key')
# => <Fog::Compute::Softlayer::KeyPair>
</ruby>

Let's destroy a key pair, just for fun.

<ruby>
kp = @sl.key_pairs.by_label('my-new-key')
# => <Fog::Compute::Softlayer::KeyPair>
kp.destroy
</ruby>

\t
##### Key Pairs with Servers

With basic CRUD out of the way on the key pairs, let's see how we can assign them to servers.

Create a server with one or more key pairs using:

<ruby>
the_first_key = @sl.key_pairs.by_label('my-new-key')
# => <Fog::Compute::Softlayer::KeyPair>
the_second_key = @sl.key_pairs.by_label('my-other-new-key')
# => <Fog::Compute::Softlayer::KeyPair>
\t
opts = {
\t:flavor_id => 'm1.small',
\t:os_code => 'UBUNTU_LATEST',
\t:datacenter => 'hkg02',
\t:name => 'cphrmky',
\t:key_pairs => [ the_first_key, the_second_key ]
}
@sl.servers.create(opts)
# => <Fog::Compute::Softlayer::Server>
</ruby>

If you already have the list of internal IDs that SoftLayer assigns to each of your key pairs, you can pass an array of hashes instead of loading an object for each key pair you assign to a compute instance.

<ruby>
key_pair_ids = [
\t{:id => 12345},
\t{:id => 12346},
\t{:id => 12347},
]

opts = {
\t:flavor_id => 'm1.small',
\t:os_code => 'UBUNTU_LATEST',
\t:datacenter => 'hkg02',
\t:name => 'cphrmky',
\t:key_pairs => key_pair_ids
}
@sl.servers.create(opts)
# => <Fog::Compute::Softlayer::Server>

</ruby>

Then, look at the key pairs on a server:

<ruby>
server = @sl.servers.get(12345)
server.key_pairs
# => [ <Fog::Compute::Softlayer::Server>,
# <Fog::Compute::Softlayer::Server>]
</ruby>

##### Try Before You Buy

One of the excellent features included in [fog-softlayer](http://github.com/softlayer/fog-softlayer) (and for all of the supported providers), is fantastic mocking.

Even if you don't have a SoftLayer account, you can download [fog-softlayer](https://github.com/softlayer/fog-softlayer) and start testing this code.

Just call `Fog.mock!` immediately after requiring the gem, run all of the above code examples, and see how easy it is to work with. We're working hard to get full coverage of Mock classes and methods. You may run across a MockNotImplemented exception here or there. If you do, the best course is probably to fork the repo, implement the mock, and open a pull request.

\\- Matt

--

If you have questions about or problems with [fog-softlayer](http://rubygems.org/gems/fog-softlayer) open an [issue](https://github.com/softlayer/fog-softlayer/issues) or [email me](mailto:matt.eldridge@us.ibm.com?subject=fog-softlayer).

gha_language: HTML

gha_license_id: NOASSERTION


text:
To run a demo, start emacs/slime or your CL Lisp in the common-lisp/clog directory:

```
CL-USER> (ql:quickload :clog)
To load "clog":
  Load 1 ASDF system:
    clog
; Loading "clog"
...........................
(:CLOG)
```

Load the demo:

```
CL-USER> (clog:run-demo 1)
Hunchentoot server is started.
Listening on <IP_ADDRESS>:8080.
HTTP listening on : <IP_ADDRESS>:8080
HTML Root         : static-files/
Boot file default : /boot.html
```

Most demos startup a browser, if not use http://<IP_ADDRESS>:8080

Demo Summary

- 01-demo.lisp - Sparkey the Snake Game
- 02-demo.lisp - Chat - Private instant messenger
- 03-demo.lisp - IDE - A very simple common lisp IDE
                       (see source if editor doesn't load)
- 04-demo.lisp - CMS Website

repository: rabbibotton/clog

gha_language: Common Lisp

repo_name: rabbibotton/clog


text:
# Converting a TensorFlow Neural Collaborative Filtering Model {#openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_NCF_From_Tensorflow}

@sphinxdirective

.. meta::
   :description: Learn how to convert a Neural Collaborative
                 Filtering Model from TensorFlow to the OpenVINO Intermediate
                 Representation.

This tutorial explains how to convert Neural Collaborative Filtering (NCF) model to the OpenVINO Intermediate Representation.

`Public TensorFlow NCF model <https://github.com/tensorflow/models/tree/master/official/recommendation>`__ does not contain pre-trained weights. To convert this model to the IR:

1. Use `the instructions <https://github.com/tensorflow/models/tree/master/official/recommendation#train-and-evaluate-model>`__ from this repository to train the model.

2. Freeze the inference graph you get in the previous step in ``model_dir``, following the instructions from the **Freezing Custom Models in Python** section of the :doc:`Converting a TensorFlow Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow>` guide.

   Run the following commands:

   .. code-block:: py
      :force:

       import tensorflow as tf
       from tensorflow.python.framework import graph_io

       sess = tf.compat.v1.Session()
       saver = tf.compat.v1.train.import_meta_graph("/path/to/model/model.meta")
       saver.restore(sess, tf.train.latest_checkpoint('/path/to/model/'))

       frozen = tf.compat.v1.graph_util.convert_variables_to_constants(sess, sess.graph_def, \
                                                           ["rating/BiasAdd"])
       graph_io.write_graph(frozen, './', 'inference_graph.pb', as_text=False)

   where ``rating/BiasAdd`` is an output node.

3. Convert the model to the OpenVINO format. If you look at your frozen model, you can see that it has one input that is split into four ``ResourceGather`` layers. (Click image to zoom in.)

   .. image::  ./_static/images/NCF_start.svg

   However, as the model conversion API does not support such data feeding, you should skip it. Cut
   the edges incoming in ``ResourceGather`` port 1:

   .. code-block:: sh

       mo --input_model inference_graph.pb                    \
       --input 1:embedding/embedding_lookup,1:embedding_1/embedding_lookup, \
       1:embedding_2/embedding_lookup,1:embedding_3/embedding_lookup        \
       --input_shape [256],[256],[256],[256]                                \
       --output_dir <OUTPUT_MODEL_DIR>

   In the ``input_shape`` parameter, 256 specifies the ``batch_size`` for your model.

Alternatively, you can do steps 2 and 3 in one command line:

.. code-block:: sh

    mo --input_meta_graph /path/to/model/model.meta        \
    --input 1:embedding/embedding_lookup,1:embedding_1/embedding_lookup, \
    1:embedding_2/embedding_lookup,1:embedding_3/embedding_lookup        \
    --input_shape [256],[256],[256],[256] --output rating/BiasAdd        \
    --output_dir <OUTPUT_MODEL_DIR>

@endsphinxdirective

repository: openvinotoolkit/openvino

repo_name: openvinotoolkit/openvino


text:
---
version: 5.2.0
redirect_from:
  - /sel4_release/seL4_5.2.0/
  - /sel4_release/seL4_5.2.0.html
title: seL4 5.2.0
project: sel4
---
# Introducing seL4 5.2.0
 Announcing the release of `seL4 5.2.0`
with the following changes:

Below are the changes to libsel4:

- Add `seL4_FastMessageRegisters`: Exposes number of registers used
        in IPC for more optimised user-level IPC stubs.
- Additional kernel entry types `VMExit` and `VCPUFault` added for
        benchmarking kernel entries.

x86 specific changes:

- multiboot memory map information passed to user-level through
        bootinfo extended regions
- Expose more seL4 constants

# Upgrade notes

- This release potentially breaks ABI with the earlier versions if
      using benchmarking kernel configurations.

# Full changelog

Use `git log 5.1.0..5.2.0` in <https://github.com/seL4/seL4>

# More details

See the
[5.2.0 manual](http://sel4.systems/Info/Docs/seL4-manual-5.2.0.pdf) included in the release or ask on the mailing list!

repository: bennoleslie/docs

repo_name: bennoleslie/docs


text:
# [FCC] Build a Markdown Previewer with CodeMirror

A simple but useful Markdown Previewer and Markdown Editor with CodeMirror.

# Preview

  * [[FCC] Build a Markdown Previewer with CodeMirror](http://about.phamvanlam.com/fcc-markdown-previewer-codemirror/)

# Visit me

  * [Portfolio](http://about.phamvanlam.com)
  * [Blog Complete JavaScript](https://completejavascript.com)
  * [Codepen](https://codepen.io/completejavascript)


text:
# SSH Key Management

SSH is used a lot when using the JumpScale framework. It's used do all remote system management, all interactions with GitHub, and more.

In case you don't have SSH keys yet, you can create them using the JumpScale interactive shell, and immediatelly load then into the SSH Agent:

```shell
js 'j.do._loadSSHAgent(createkeys=True)'
```

In the above command you will of course want to replace the key name with something that is meaningful to you.

This single command will do the following for you:

```
- Check if you have `$homedir/.ssh/id_rsa` or `$homedir/.ssh/$keyname` key available
- If an existing key was found, it will be loaded into SSH Agent
- If not, a new one will first get created
```

As part of the SSH creation process you will be asked to enter a passphrase, which should be something that is private to you, and easy to remember.

As a result of the SSH key creation process the public key will be saved as `$homedir/.ssh/id_rsa.pub` or `$homedir/.ssh/$keyname`. This is the key you will have to register at GitHub.

Alternativelly you can also type:

```shell
js 'j.do._loadSSHAgent()'
```

This will start the SSH Agent if required and load all the keys it can find in `$homedir/.ssh`

You only will need to do this once on a system. Once done the `.bashrc` file will make sure that in every new terminal you have access to your keys.

Remark: if this is the first time then your current session does not have access to ssh keys yet, go into a new terminal to see the results & start using ssh

If you want to read more about key management see [tips & tricks about ssh keys & agents (e.g. how to create your keys)](../SSHSystemManagement/SSHKeysAgent.md)


text:
Children should be exposed to language and images
> of all types, so all of my material would of course be "suitable for
> children."

   Neither would my
receiving an exception on the grounds of being disabled be remotely
acceptable to me, since I sincerely believe that my TS is a "gift"
that allows me to say anything that others say to a judge, *plus*
being able to call him or her a Nazi ratfucker.

  On the other hand, it would be kind of neat to launch a class action
lawsuit demanding that ratings systems incorporate a label such as:
"Suitable (FUCK!) for children (COCKSUCKER!) with Tourette Syndrome"

FUCKMonger
> --
> [This Bible excerpt awaiting review under the U.S. Communications Decency
> Act of 1996]
> And then Lot said, "I have some mighty fine young virgin daughters.
> So the two daughters got him drunk and screwed him all that night.