text:
---
title: Porter Workshop Docker Image
description: How to use the getporter/workshop Docker image
draft: true
---

The [ghcr.io/getporter/workshop][workshop] Docker image provides the Porter client installed in a
container that has Docker-in-Docker. It is suitable for workshops because
participants don't need to figure out their various Docker setups since they will
use the Docker host inside the container.

It has tags that match what is available from our [install](/install/) page:
latest, canary and specific versions such as v0.20.0-beta.1.

## Start the workshop container
```
docker run -d --privileged --name workshop ghcr.io/getporter/workshop
```

## Log into the workshop container
```
docker exec -it workshop sh
```

For the rest of the workshop, participants will execute commands from inside
the workshop container.

**Notes**

You cannot mount volumes to arbitrary points into the workshop container from
your local computer because the image is based on the [docker:dind] image, see
[Where to Store Data](https://hub.docker.com/_/docker) for more information.

[workshop]: https://github.com/orgs/getporter/packages/container/package/workshop

repository: getporter/porter

repo_name: getporter/porter


text:
---
layout: post
title: "Aligning Visual Regions and Textual Concepts: Learning Fine-Grained Image Representations for Image Captioning"
date: 2019-05-15 12:39:49
categories: arXiv_CV
tags: arXiv_CV Image_Caption Attention Text_Generation Caption Relation
author: Fenglin Liu, Yuanxin Liu, Xuancheng Ren, Kai Lei, Xu Sun
mathjax: true
---

* content
{:toc}

##### Abstract
In image-grounded text generation, fine-grained representations of the image are considered to be of paramount importance. Most of the current systems incorporate visual features and textual concepts as a sketch of an image. However, plainly inferred representations are usually undesirable in that they are composed of separate components, the relations of which are elusive. In this work, we aim at representing an image with a set of integrated visual regions and corresponding textual concepts. To this end, we build the Mutual Iterative Attention (MIA) module, which integrates correlated visual features and textual concepts, respectively, by aligning the two modalities. We evaluate the proposed approach on the COCO dataset for image captioning. Extensive experiments show that the refined image representations boost the baseline models by up to 12% in terms of CIDEr, demonstrating that our method is effective and generalizes well to a wide range of models.

##### Abstract (translated by Google)

##### URL
[http://arxiv.org/abs/1905.06139](http://arxiv.org/abs/1905.06139)

##### PDF
[http://arxiv.org/pdf/1905.06139](http://arxiv.org/pdf/1905.06139)

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Programming Notes

This directory contains pages with notes, tips, and interesting links relateded to programming and different languages.

## General Programming Language

- [learning.md](learning.md) contains tips and tools for learning new progrmaming languages
- [languages.md](languages.md) contains general programming language theory, paradigms, and related topics

## C & C++ Programming (CSC220 & CSC240)

- [c_information.md](c_information.md) contains C language related tips & links
- [cpp_information.md](cpp_information.md) contains C++ language related tips & links
- [concurrency.md](concurrency.md) contains links related to concurrent and parallel programming

## CSC240 Languages

- [scheme_information.md](scheme_information.md) Contains Scheme & LISP language and functional programming related tips & links
- [prolog_information.md](prolog_information.md) Prolog language and logic programming related tips & links

repository: j-dwo/codeexamples

repo_name: j-dwo/codeexamples


text:
# deploy-script

A script for deploying a project using npm

## Installation

```
git clone https://github.com/mikkelking/deploy-script
cd deploy-script
npm install
```

This is not a complete project, just the main script and a few ancillary files. If you want to use it, you will need to add some dependencies into your package.json, add entries for deployment, set up your version templates etc, and then you will be able to do a deployment using

```
npm run deploy-staging
```

or

```
npm run deploy-prod
```

In your package.json you will need to add build targets, like this:

```
{
  "name": "deploy-script",
  "private": true,
  "version": "1.0.2",
  "scripts": {
    "deploy-staging": "node scripts/deploy.js staging",
    "deploy-prod": "node scripts/deploy.js prod"
  },

```

Copy the file `scripts/deploy.js` from this repository into your project `scripts` folder.

Modify the script for your own deployment. The example provided is using Meteor up to deploy, but you can just as easily use webpack or anything else.

## Target environments

There is some configuration in the deploy.js script that looks like this:

```
let choices = {
  prod: {
    name: 'production',
    level: 'minor',
    branch: 'master'
  },
  demo: {
    name: 'demo',
    level: 'minor',
    branch: 'develop'
  },
  staging: {
    name: 'staging',
    level: 'patch',
    branch: 'develop'
  },
};
```

This has 3 targets, prod, demo and staging. `level ` determines whether you do a minor or patch bump of the version number. `branch` is to define a required branch to do this deployment. For example if your current branch is feature-something and you try to do a `npm run deploy-prod` it will fail, because you must be on the master branch to do it.

## Templating

The primary purpose of this script is to make the version no available for your app. There is a folder called `templates`, which contains a folder or folders, and a version template file. In this case it's `templates/imports/api/version.js`, which will be templated into a location `app/imports/api/version.js`. If you want a different destination, just changes the folders and filename to suit. It will recurse the folder `templates`, so you can put a file in more than one location if you like. You could put other information in there too if you like, such as build time.

The contents of the version file are up to you as well.

## Version bumping

The config above will bump the `patch` version (eg v1.0.0 => v1.0.1) for staging. For prod it is set to minor, (eg v1.0.5 => v1.1.0)
It also automatically creates a tag for the version, and pushes the tag to your repository.

## Version file conflicts

You may get conflicts in the generated version file after you have done a `deploy-prod`, and later do a `deploy-staging`. The way to avoid this is to make sure you merge `master` back into `develop` when you go back to the `develop` branch.

repository: mikkelking/deploy-script

repo_name: mikkelking/deploy-script


text:
# Tic-Tac-Toe-Java-CLI
Tic-Tac-Toe, also known as noughts and crosses or Xs and Os.It’s meant to be a paper game,but now in computer game in command line.

Everybody knows this game from childhood. This is the game, where the price of a mistake is too high: it usually costs you the game. You can become a real master of this game by mastering only one possible option, so it also teaches you that simple is always better than complex.Let’s get started!

Origin of this project:[Hyperskill - Tic Tac Toe](https://hyperskill.org/projects/48?goal=7)

In this game there is 3 **mode**.
* easy
* medium
* hard

To play the game use this command:
```
start user easy
```

### Here is the preview of the game:
![Deme Preview](https://stepik.org/media/attachments/lesson/209897/demonstration.gif)

### Software Use:
* Java 12
* Intellij IDEA 2019

repository: kmhmubin/Tic-Tac-Toe-Java-CLI

repo_name: kmhmubin/Tic-Tac-Toe-Java-CLI


text:
# Retrain the Model
![](../Images/devops18.PNG)

Often, you'll want to validate your model, update it or even retrain it from scratch, as you receive new information. Sometimes, receiving new data is an expected part of the domain. Other times, as discussed in [Detect data drift on datasets](../Documents/Dataset-Monitors.md), model performance can degrade in the face of such things as changes to a particular sensor, natural data changes such as seasonal effects or features shifting in their relation to other features.

There is no universal answer to "How do I know if I should retrain?" but Azure ML event and monitoring tools previously discussed are good starting points for automation.

Once you have decided to retrain, you should:

* Preprocess your data using a repeatable, automated process
* Train your new model
* Compare the outputs of your new model to those of your old model
* Use predefined criteria to choose whether to replace your old model

This process of retraining and effective Continous Integration/Continuous Development (CI/CD) of ML models is the biggest strength of Azure Machine Learning.

A theme of the above steps is that your **retraining should be automated, not ad hoc**. Azure ML provides different ways of achieving this automation. In this tutorial we will explain the following:

* Azure Machine Learning Designer - Retrain models with Azure Machine Learning Designer to see how pipelines and the Azure Machine Learning designer fit into a retraining scenario.
* Azure DevOps Retraining Pipelines with Azure CLI - Retrain models using Azure Pipelines using Azure CLI and python notebooks. It's the most common approach and allows automation and CI/CD

##### Azure Machine Learning Designer - Data Science Team

This approach can only be used when the model was designed using Azure Machine Learning Designer, more information [here](../Documents/studio-designer.md).
This will mean the user will have a published training pipeline and this can be used to retrain the model on new data. To retrain the user can submit runs from a pipeline endpoint from the studio workspace or programmatically.

###### Submit runs by using the studio portal
The idea is to re-run and publish the pipeline using a new set of data. To achieve this, the first step is to change the pipeline in order to create a pipeline parameter which will contain the new file path and name. Once the pipeline parameter has been created and added to the pipeline, it needs to be published and then the pipeline can be executed with this new set of data for further analysis.

Step 1 - **Create a pipeline parameter**
Pipeline parameters are used to build versatile pipelines which can be resubmitted later with varying parameter values. Some common scenarios are updating datasets or some hyper-parameters for retraining. Create pipeline parameters to dynamically set variables at runtime.

Pipeline parameters can be added to data source or module parameters in a pipeline. When the pipeline is resubmitted, the values of these parameters can be specified.

For this example, we will change the training data path from a fixed value to a parameter, so that ythe model can be retrained on different set of data. Other module parameters can be added according to the use case.

1. Select the **Import Data** module.
**Note:** This example uses the Import Data module to access data in a registered datastore. However, you can follow similar steps if you use alternative data access patterns.
2. In the module detail pane, to the right of the canvas, select your data source.
3. Enter the path to your data. You can also select **Browse path** to browse your file tree.
4. Mouseover the **Path** field, and select the ellipses above the **Path** field that appear.
5. Select **Add to pipeline parameter**.
6. Provide a parameter name and a default value.
7. Select **Save**.
8. **Submit** the pipeline run.

![](../Images/devops19.gif)

Step 2 - **Publish the pipeline**

1. Select **Publish** above the designer canvas.
2. Select or create a pipeline endpoint.
3. Select **Publish**.

![](../Images/devops20.PNG)

**Note:** More details on how to work with Azure ML Designer can be seen in [How to work with Azure Machine Learning Studio Designer](../Documents/studio-designer.md)

Step 3 - **Retrain the Model by submitting a new running**

Use the following steps to submit a parameterized pipeline endpoint run from the studio portal:

1. Go to the **Endpoints** page in your studio workspace.
2. Select the **Pipeline endpoints** tab. Then, select your pipeline endpoint.
3. Select the **Published pipelines** tab. Then, select the pipeline version that you want to run.
4. Select **Submit**.

![](../Images/devops21.gif)

5. In the setup dialog box, you can specify the parameters values for the run.

![](../Images/devops22.png)

##### Submit runs by using code
You can find the REST endpoint of a published pipeline in the overview panel. By calling the endpoint, you can retrain the published pipeline.

To make a REST call, you need an OAuth 2.0 bearer-type authentication header. The following example uses interactive authentication (for illustration purposes), but for most production scenarios that require automated or headless authentication.

Service principal authentication involves creating an App Registration in Azure Active Directory. First, you generate a client secret and then you grant your service principal role access to your machine learning workspace. Use the ServicePrincipalAuthentication class to manage your authentication flow. These tasks should be done or at least approved by your Azure Architecture Administrator Team.

Both **InteractiveLoginAuthentication** and **ServicePrincipalAuthentication** inherit from AbstractAuthentication. In both cases, use the **get_authentication_header()** function in the same way to fetch the header:

```
from azureml.core.authentication import InteractiveLoginAuthentication

interactive_auth = InteractiveLoginAuthentication()

auth_header = interactive_auth.get_authentication_header()
```

Get the REST URL from the endpoint property of the published pipeline object. You can also find the REST URL in your workspace in Azure Machine Learning studio.
Build an HTTP POST request to the endpoint. Specify your authentication header in the request. Add a JSON payload object that has the experiment name.
Make the request to trigger the run. Include code to access the Id key from the response dictionary to get the value of the run ID.

```
import requests

rest_endpoint = published_pipeline.endpoint

response = requests.post(rest_endpoint,
                         headers=auth_header,
                         json={"ExperimentName": "Tutorial-Batch-Scoring",
                               "ParameterAssignments": {"process_count_per_node": 6}})
run_id = response.json()["Id"]
```

Use the run ID to monitor the status of the new run. The new run takes another 10-15 min to finish.
The new run will look similar to the pipeline you ran earlier in the tutorial. You can choose not to view the full output.

```
from azureml.pipeline.core.run import PipelineRun
from azureml.widgets import RunDetails

published_pipeline_run = PipelineRun(ws.experiments["Tutorial-Batch-Scoring"], run_id)

RunDetails(published_pipeline_run).show()
```

#### Azure DevOps Retraining Pipelines with Azure CLI - Data Science Team and DevOps Development Team
Retraining the model using Azure ML Designer doesn't provide an automated way of doing but only involves the Data Science Team for the retrain itself.
Creating an Azure DevOps pipeline allows automation but involves once again the collaboration between the Data Science Team and the DevOps Development Team.

##### Create a Pipeline to execute retraining ML tasks and save all the relevant information in an Azure DevOps Artifact

1. All the necessary retraining python code needs to be added to the repository - Team Responsible: Data Science Team

2. A pipeline should be created with the necessary steps steps: - Team Responsible: DevOps Development Team

###### Pipeline - Example
This is an example of a pipeline to retrain a model:

![](../Images/devops23.PNG)

##### Determine the best model
In your python scripts, you may want to log metrics so that you can determine the "best" model (this is the recommended approach for Production environments).

For example, you have a model that is already deployed and has an accuracy of 90. You train a new model based on new checkins to the repo and the accuracy is only 80, so you don't want to deploy it. You can use a metric such as this to build automation logic, as you can directly rank different models. In other cases, you may have several metrics that are used to indicate the "best" model. In this case, choosing the best model requires human judgment.

Depending on what "best" looks like for your scenario, you may need to create or re-use an existing release pipeline where someone must inspect the metrics to determine if the model should be deployed. For more details on how to create a release pipeline please check section [Create a Release Pipeline](../Documents/Scenario3-Notebook-RealTimeInf.md#Deploy-real-time-inf) from this page.

**Note:** To log metrics during training, use the Run class.

branch_name: refs/heads/main


text:
A concept how to consume async request results from the backend using Centrifugo (using Centrifugo subscriptions and history with recovery). We can initiate long work, return unique channel to consume result from, subscribe on it with recovery to avoid missing the result, then unsubscribe from it upon receiving the result of operation to free resources.

> This may be a bit esoteric approach, you can also solve this by using one unique channel per browser tab (just subscribe on it before issuing any RPCs), and push results to a client over that channel. If you need to notify a user (not a particular client) – then you better publish async results into a user channel – so all browser tabs opened by that user will receive an async result.

I.e. step by step:

1. Client sends RPC to the server (may be a simple AJAX request to the backend)
2. Backend generates unique channel and returns it to a client together with subscription token valid for some time
3. Client subscribes to a channel and waits for incoming message. It does this with recovery - so that message in channel is guaranteed to be received as soon as it was published to Centrifugo channel (thus avoiding races between publish and subscribe). Note, that we are using empty epoch value `""` here – so that Centrifugo does not check stream epochs upon recovery. This is fine since we are using unique channels here which can be only created once.
4. Client unsuscribes from a channel upon getting result to free resources, history entries will soon expire

Run example
===========

Run Centrifugo with `config.json` provided here:

```
./centrifugo -c config.json
```

Run Go example:

```
go run main.go
```

Open http://localhost:3000

repository: centrifugal/examples

gha_language: PHP

gha_license_id: MIT

repo_name: centrifugal/examples


text:
# uapp/mutex_pi_exerciser

A small test app which can be used to verify that priority inheritance behavior
has been implemented properly for various user mode synchronization objects.
This is not something which can be automatically tested, so kernel tracing and
manual verification needs to be done instead.

## Usage

After booting a target, run the application from a shell.  The application will
start, and then wait up to 5 seconds for the tracing framework to start.  Once
the application is waiting, a trace can be taken using

`fx traceutil record -duration 1s`

by default, the kernel:sched category should be enabled which should produce
trace events for priority inheritance interactions which produce a meaningful
change in effective priority.  Additional information can be captured in the
trace by enabling Futex tracing (kEnableFutexKTracing in
zircon/kernel/object/futex_context.cpp), and by turning up the tracing level for
kernel owned wait queues (setting kDefaultPiTracingLevel to
PiTracingLevel::Extended in zircon/kernel/kernel/owned_wait_queue.cpp).

## Tests and their expected behavior

Each test performed will put a process-wide trace event into the trace at the
start of the test which should indicate the type of the test, and the type of
object being tested.  Each test makes use of 5 threads at priority levels 3, 5,
7, 9, and 11.  The names of the threads should make it clear which is which, and
the threads are recycled for each test.  Three tests have been defined...

### The Mutex Chain test

This test forms a chain of mutexes and verifies that the mutexes properly
transmit priority through the chain.  Let T(n) be the thread with priority
thread, and M(n) be the mutex that this thread holds.  T(3) obtains M(3), and then
waits for the coordinator thread's signal.  Then T(5) obtains M(5) and attempts to
obtain M(3), which blocks because of T(3).  T(3), however, will receive the
pressure of M(5) causing its effective priority to rise to 5.  The process
repeats with T(7) obtaining M(7) and then attempting to obtain M(5).  This
causes T(5) to jump up to an EP of 7, and then transmit this priority to T(3)
whose EP should go from 5 -> 7.

This keeps going until we have T(11) -> T(9) -> T(7) -> T(5) -> T(3) and
everyone's effective priority is 11.  At this point, we start to unwind by
signalling T(3) to continue.  It drops M(3) and finishes the test.  T(5) enters
M(3) and then waits on its own signal.  We signal T(5) who drops M(3) and then
M(5), and finishes it's roll in the test.  At each stage, each thread should
drop down to its base priority after it releases its mutex (which is blocking
the next stage). Eventually, we have unwound everything and the test is over.

### The Multi-Waiter Mutex test

This test involves a single mutex (M) with multiple blocked threads.  The test
starts with T(3) obtaining M, and waiting for the coordinator's signal.  One at
a time, the other threads attempt to simply obtain and immediately release M.
Each time, they are blocked by T(3), and since they are joining in ascending
order of priority, each time T(3)'s effective priority jumps up until it finally
reaches priority 11.

At this point, the coordinator thread signals T(3) and the process of unwinding
starts. T(3)'s effective priority drops from 11 back down to 3 as it releases
the lock.  The schedule releases the waiting threads in order to decreasing
priority starting with T(11), and each thread flys through the lock.  No more
priority inheritance needs to happen at this point in time since the most
important waiter is being given the first shot at the lock.

### The CondVar broadcast test

This test involves a condition variable and it's associated lock type.  In order
of ascending priority, each
thread does the following...
1. Enters the mutex.
2. Checks to see if the test condition has been met.  In this case, the test
   condition is that their base priority is >= the exit threshold.  The
   threshold starts at an impossible-to-obtain value of 100.
3. Sleep for 250 uSec in order to force contention of the mutex.
4. If the test condition has not been met, the thread waits on the condition
   (which releases the lock in the process), then goes back to step 2.

When the test condition finally has been met, the thread will
1. Sets the exit threshold to be its own priority, minus two.
2. Broadcast signal the condition.
3. Finally, releases the mutex.

Once set up, the coordinator starts the process of unwinding by setting the exit
threshold to 13 and broadcast signalling the condition variable.

In each pass of the test, you see _all_ of the threads wake up and check the
condition, but only the highest priority thread is permitted to exit.  Once it
decides to exit, it lowers the threshold and re-signals the condition variable
causing all threads to wake up again.

It also should be noted that the only reason you see any priority inheritance
going on here at all is an artifact of the current cond_var implementations.
Current implementations go out of their wait to release threads from the
condition and transfer them over to own the mutex in the order that they blocked
on the mutex.  In addition, each waiting thread is blocking on its own futex
(instead of sharing a single futex).  As a result, when first signalled, T(3)
wakes up in the mutex and sleeps for a bit, receiving the priority pressure from
T(5) who is next in line, and finally waits on the condition again, waking T(5)
and transferring T(7) to the mutex's futex in the process.  So, each link in the
chain feel the priority on only the previous waiter in the chain, instead of all
the waiters.

A single futex could be used for the wait queue instead, however no meaningful
priority inheritance would be visible in a test structured like this.  When
signalled, one thread would be woken from the condition futex, while the rest of
the threads would be transferred to the mutex's futex wait queue.  The woken
thread would be T(11), so the pressure of the waiters would not effect it.  In
order to demonstrate PI in an implementation like this, a different low priority
thread would need to be lingering in the mutex at the time of the broadcast.

repository: gnoliyil/fuchsia

repo_name: gnoliyil/fuchsia


text:
# ttmp32gme
a platform independent tool (inspired by the [windows tool ttaudio](https://github.com/sidiandi/ttaudio) ) to create tiptoi gme files from mp3 files. Also creates a printable sheet to play the music.

## Features
* convert music/audiobook albums from mp3 to gme format playable with the tiptoi pen using [tttool](http://tttool.entropia.de/).
* automatic generation of control sheets that allow to control playback of music/audiobook.
* flexible print layouts for various applications (see [screenshots](#screenshots) below).
* Printing was tested to work with Chrome and Firefox on Mac Os and Microsoft Edge on Windows 10 (Chrome and Firefox do not print with high enough resolution on Win 10, Opera seems to work occasionally).
* Creation of printable PDFs on Windows systems.
* automatic readout of id3 tags to get album and track info (including embedded cover images).
* add cover images for nicer print layout.
* copy gme files to tiptoi if tiptoi is connected.

## Installation
* Mac/Win: download the executables from the [releases page](https://github.com/thawn/ttmp32gme/releases). Put them somewhere and run them. Open localhost:10020 with a browser of your choice (except Internet Explorer).
* linux: run the perl sources (see [instructions](#required-perl-modules-for-running-ttmp32gme-from-source) below)

## Usage
### 1. Add mp3 files
Add one or more mp3 files on the "Upload" page. Only add one
album at a time.

### 2. Configure and create gme files

On the "Library" page, you can configure and create gme
files. Mp3 tag data of recently uploaded files will automatically be used to
pre-populate the artist, album title and track info.

### 3. Print the control page(s)
Once you choose to print one or more album from the library,
a new page will open that displays the albums and their tracks from the gme
files that you selected for printing.

You can customize the the print layout by clicking on " Configure print layout".

You can choose one of the three presets:

list
: A list layout that includes all album details.

tiles
: A tiled layout that includes only minimal album details and general controls that work with all albums.

CD booklet
: A layout that is optimized for printing CD booklets.

Alternatively, you can manually choose which parts (cover image, album
information, album control buttons, track list) to display, how many columns
should be used and how large each album should be when printed.

You can also configure here which resolution should be used (in DPI) for
printing (start with the maximum resolution your printer can handle). And how
many pixels (in x and y direction) each dot of the OID code should use. Start
with a value of 2 (read
this if you want to know why). If you have problems with not recognized oid
codes, first try to increase the number of pixels to 3 or 4 and then try to
change the resolution setting.

#### If the pen does not recognize the printed pages

It is a known (and sad) fact that the oid codes do not work with all printers. This is because the oid codes are very fine detailed patterns and need to be reproduced exactly by the printer. Many printers simply do not have a good enough resolution or their drivers mess around with the patterns during image processing. In the latter case, this can sometimes be circumvented by playing around with the print settings but sometimes, it simply does not work.

* Make sure to print at 100% scale. Do not use the "autoscaling" or "fit to paper" settings in your print dialog.
* print in 1200dpi if possible, sometimes 600dpi seem to work, too
* play around with the quality settings, resolution, contrast
* use different paper
* try black-and-white versus color prints
* Try to set your print driver to Graphic/Image mode (some drivers mess up the oid patterns in text mode).
* If your driver does not have such a setting, try to convert the PDF to a 1200 dpi png and print that.

Before [reporting any problem with the pen not recognizing printed pages](https://github.com/thawn/ttmp32gme/issues/11), please read the wiki page on printer support for tttool:
https://github.com/entropia/tip-toi-reveng/wiki/Printing

If possible, please try to print the oid table you can download below:

[oid-table](https://cloud.githubusercontent.com/assets/1308449/26282853/beefeec2-3e19-11e7-8413-86a26bb1b1b5.png) (borrowed from tttool).

When you point the pen at any of the patterns, it should say something like "Bitte installieren Sie erst die Audiodatei für dieses Produkt" or "Bitte berühre erst das Anschaltzeichen für dieses Produkt". Then at least the pen recognized that these are oid codes. If the pen does nothing, this likely means that your issue is unrelated to the software but is a problem with the printer.

If you still think it is a software issue, please report exactly (step by step) what you were doing and what (if any) messages the pen is saying, otherwise I cannot help you.

### 4. Copy the gme files onto the tiptoi pen

Connect the tiptoi pen to your computer. If you do not see the button "Copy
selected to TipToi", reload the library page. Now select
the desired albums and click on "Copy selected to TipToi". Wait till the
operation completes and a message appears that tells you that it is safe to
disconnect the pen from the computer.

## Screenshots
### Print as detailed list
![list](https://github.com/thawn/ttmp32gme/blob/master/src/assets/images/Screen_Shot_list.jpg)

### Print as tiles (fits many albums on one page)
![tiles](https://github.com/thawn/ttmp32gme/blob/master/src/assets/images/Screen_Shot_tiles.jpg)

### Print as CD booklet (fits into standard CD cases)
![booklet](https://github.com/thawn/ttmp32gme/blob/master/src/assets/images/Screen_Shot_cd-booklet.jpg)

### Print configuration
![config](https://github.com/thawn/ttmp32gme/blob/master/src/assets/images/Screen_Shot_print-config.png)

## Required libraries and perl modules (for running ttmp32gme from source)

### Required libraries
ttmp32gme requires the following libraries to run"
`libc6`, `libxml2`, `zlib`
on a debian (-based) system (including Ubuntu), you can install these by running:
`sudo apt-get install libc6-dev libxml2-dev zlib1g-dev`

on linux systems, pdfs can be created using wkhtmltopdf if version 0.13.x is found on the path (i.e. in /usr/local/bin or /usr/bin).

### Required perl modules
run `cpan -i` (or the equivalent tool from your distro such as g-cpan for gentoo) followed by the following
modules (some modules required the `-f` flag to install on my Mac OS system):

EV
AnyEvent::HTTPD
Path::Class
Cwd
File::Basename
File::Find
List::MoreUtils
PAR
Encode
Text::Template
JSON::XS
URI::Escape
Getopt::Long
Perl::Version
DBI
DBIx::MultiStatementDo
Log::Message::Simple
Music::Tag::MP3
Music::Tag::OGG
Music::Tag::MusicBrainz
Music::Tag::Auto
MP3::Tag
Image::Info

### Build requirements

For building from source, you also need:

pp

## ToDo
* handle more than 10 tracks for CD booklet (two column track layout)
* upload multiple albums at once from the upload page
* add and remove music files from library page

### Maybe later
* automatic splitting of audio files as described [here.](https://stackoverflow.com/questions/36074224/how-to-split-video-or-audio-by-silent-parts)
* automatic download of cover images
* enable separate printing of oid codes/text and cover images
* interface to use external CD ripping tools such as fre:ac
* run on a real webserver so that users can generate their gme files online (thanks to Joachim for the idea).
* create a docker image for linux


text:
---
published: true
key: 26-01-2022
title: Portable Python with Portable VSCode
tags:
  - Portable
  - Python
  - VSCode
---
## Setup portable python with portable vscode

Download Winpython from [here](https://sourceforge.net/projects/winpython/files/).
Download VS Code from [here](https://code.visualstudio.com/)

Dwnload python plugins from vscode. Go to extention setting and add path of the portable python.

![vscode_python1.png]({{site.baseurl}}/images/vscode_python1.png)


text:
# Print Spooler Research Tools

The repository contains the tools we developed during our Print Spooler research which we presented in Black Hat USA 2020 and DEF CON 28 Safe Mode ("A Decade After Stuxnet's Printer Vulnerability: Printing is still the Stairway to Heaven".)

Each tool/project contains it's own ```README.md``` file:

- ```SHDWriter```: CVE-2020-1048 - Exploit PoC
- ```Spooler_DoS``` - Spooler DoS - PoC
- ```AFW_MitigationDriver``` - Arbitrary File Write Mitigation - Mini-Filter Driver
- ```SHDWriter_2.0``` - CVE-2020-1337 - Exploit PoC (will be released After Patch Tuesday)
- ```010Editor_Templates``` - 010 Templates of undocumented Shadow File Struct

repository: cvepoc/Spooler

repo_name: cvepoc/Spooler


text:
```js
<VxThemeProvider>
  Copy and pasting d3 code into <Code>componentDidMount()</Code> is just that.
</VxThemeProvider>
```

Or, without a background:
```js

<VxThemeProvider>
  <div style={{ padding: 20, color: 'white', backgroundColor: 'red' }}>
    Copy and pasting d3 code into <Code noBg>componentDidMount()</Code> is just that.
  </div>
</VxThemeProvider>
```

repository: rafaelklaessen/vx-components-react

repo_name: rafaelklaessen/vx-components-react


text:
# Office Add-in that uses the OAuth.io Service to get Authorization to External Services

The OAuth.io service simplifies the process of getting OAuth 2.0 access tokens from popular online services such as Facebook and Google. This sample shows how to use it in an Office add-in.

## Table of Contents
* [Change History](#change-history)
* [Prerequisites](#prerequisites)
* [Configure the project](#configure-the-project)
* [Download the OAuth.io JavaScript Library](#download-the-oauth-io-javascript-library)
* [Create a Google project](#create-a-google-project)
* [Create a Facebook app](#create-a-facebook-app)
* [Create an OAuth.io app and configure it to use Google and Facebook](#create-an-OAuth-io-app-and-configure-it-to-use-google-and-facebook)
* [Add the public key to the sample code](#add-the-public-key-to-the-sample-code)
* [Deploy the add-in](#deploy-the-add-in)
* [Run the project](#run-the-project)
* [Start the add-in](#start-the-add-in)
* [Test the add-in](#test-the-add-in)
* [Questions and comments](#questions-and-comments)
* [Additional resources](#additional-resources)

## Change History

January 5, 2017:

* Initial version.

## Prerequisites

* An account with [OAuth.io](https://oauth.io/home)
* Developer accounts with [Google](https://developers.google.com/) and [Facebook](https://developers.facebook.com/).
* Word 2016 for Windows, build 16.0.6727.1000 or later.
* [Node and npm](https://nodejs.org/en/) The project is configured to use npm as both a package manager and a task runner. It is also configured to use the Lite Server as the web server that will host the add-in during development, so you can have the add-in up and running quickly. You are welcome to use another task runner or web server.
* [Git Bash](https://git-scm.com/downloads) (Or another git client.)

## Configure the project

In the folder where you want to put the project, run the following commands in the git bash shell:

1. ```git clone {URL of this repo}``` to clone this repo to your local machine.
2. ```npm install``` to install all of the dependencies itemized in the package.json file.
3. ```bash gen-cert.sh``` to create the certificate needed to run this sample.

Set the certificate to be a trusted root authority. On a Windows machine, these are the steps:

1. In the repo folder on your local computer, double-click ca.crt, and select **Install Certificate**.
2. Select **Local Machine** and select **Next** to continue.
3. Select **Place all certificates in the following store** and then select **Browse**.
4. Select **Trusted Root Certification Authorities** and then select **OK**.
5. Select **Next** and then **Finish**.

## Download the OAuth.io JavaScript Library

2. In the project, create a subfolder called OAuth.io under the Scripts folder.
3. Download the OAuth.io JavaScript library from [oauth-js](https://github.com/oauth-io/oauth-js).
2. From the \dist folder of the library, copy either oauth.js or oauth.min.js to the \Scripts\OAuth.io folder of the project.
3. If you chose oauth.min.js in the preceding step, open the file \Scripts\popupRedirect.js and change the line `url: 'Scripts/OAuth.io/oauth.js',` to `url: 'Scripts/OAuth.io/oauth.min.js',`.

## Create a Google project

1. On your [Google developer console](https://console.developers.google.com/apis/dashboard), create a project named **Office Add-in**.
2. Enable the Google Plus API for the project. See Google's help for details.
3. Create app credentials for the project and choose the **OAuth client ID** as the credential type, and **Web application** as the application type. Use "Office-Add-in-OAuth.io" as the client **Name** (and the product name, if you are prompted to specify one).
4. Set the **Authorized redirect URIs** to ```https://oauth.io/auth```.
5. Make a copy of the client secret and client ID that it is assigned.

## Create a Facebook app

1. On your [Facebook developer dashboard](https://developers.facebook.com/), create an app named **Office Add-in**. See Facebook help for details.
3. Make a copy of the client secret and client ID that it is assigned.
4. Specify ```oauth.io``` in the **App Domains** box and specify ```https://oauth.io/``` as the **Site URL**.

## Create an OAuth.io app and configure it to use Google and Facebook

1. In your OAuth.io dashboard create an app and make a note of the **public key** that OAuth.io assigns to it.
3. If it is not already there, add `localhost` to the whitelisted URLs for the app.
2. Add **Google Plus** as a provider (also called an "Integrated API") to the app. Fill in the client ID and secret you got when you created the Google project, and then specify `profile` as the **scope**. If the configuration of the provider -- Integrated API -- doesn't save in IE, try reopening the OAuth.io dashboard in another browser.)
3. Repeat the previous step for **Facebook**, but specify `user_about_me` as the **scope**.

## Add the public key to the sample code

The API `OAuth.initialize` is called in the file popup.js. Find the line and pass the pubic key you got in the previous section as a string to this function.

## Deploy the add-in

Now you need to let Microsoft Word know where to find the add-in.

1. Create a network share, or [share a folder to the network](https://technet.microsoft.com/en-us/library/cc770880.aspx).
2. Place a copy of the Office-Add-in-OAuth.io.xml manifest file, from the root of the project, into the shared folder.
3. Launch Word and open a document.
4. Choose the **File** tab, and then choose **Options**.
5. Choose **Trust Center**, and then choose the **Trust Center Settings** button.
6. Choose **Trusted Add-ins Catalogs**.
7. In the **Catalog Url** field, enter the network path to the folder share that contains Office-Add-in-OAuth.io.xml, and then choose **Add Catalog**.
8. Select the **Show in Menu** check box, and then choose **OK**.
9. A message is displayed to inform you that your settings will be applied the next time you start Microsoft Office. Close Word.

## Run the project

1. Open a node command window in the folder of the project and run ```npm start``` to start the web service. Leave the command window open.
2. Open Internet Explorer or Edge and enter ```https://localhost:3000``` in the address box. If you do not receive any warnings about the certificate, close the browser and continue with the section below titled **Start the add-in**. If you do receive a warning that the certificate is not trusted, continue with the following steps:
3. The browser gives you a link to open the page despite the warning. Open it.
4. After the page opens, there will be a red certificate error in the address bar. Double click the error.
5. Select **View Certificate**.
5. Select **Install Certificate**.
4. Select **Local Machine** and select **Next** to continue.
3. Select **Place all certificates in the following store** and then select **Browse**.
4. Select **Trusted Root Certification Authorities** and then select **OK**.
5. Select **Next** and then **Finish**.
6. Close the browser.

## Start the add-in

1. Restart Word and open a Word document.
2. On the **Insert** tab in Word 2016, choose **My Add-ins**.
3. Select the **SHARED FOLDER** tab.
4. Choose **Auth with OAuthIO**, and then select **OK**.
5. If add-in commands are supported by your version of Word, the UI will inform you that the add-in was loaded.
6. On the Home ribbon is a new group called **OAuth.io** with a button labeled **Show** and an icon. Click that button to open the add-in.

 > Note: The add-in will load in a task pane if add-in commands are not supported by your version of Word.

## Test the add-in

1. Click the **Get Facebook Name** button.
2. A popup will open and you will be prompted to sign in with Facebook (unless you already are).
3. After you sign in, your Facebook user name is inserted into the Word document.
4. Repeat the above steps with the **Get Google Name** button.

## Questions and comments

We'd love to get your feedback about this sample. You can send your feedback to us in the *Issues* section of this repository.

Questions about Microsoft Office 365 development in general should be posted to [Stack Overflow](http://stackoverflow.com/questions/tagged/office-js+API). If your question is about the Office JavaScript APIs, make sure that your questions are tagged with [office-js] and [API].

## Additional resources

* [Office add-in documentation](https://msdn.microsoft.com/en-us/library/office/jj220060.aspx)
* [Office Dev Center](http://dev.office.com/)
* More Office Add-in samples at [OfficeDev on Github](https://github.com/officedev)

## Copyright
Copyright (c) 2017 Microsoft Corporation. All rights reserved.


text:
# Exception cause chains

When handling specific exceptions, we sometimes wish to re-raise the exception, or to raise a different exception to the one we've just caught. A real world example of this is within ActiveRecord's database adapters: exceptions thrown by a specific database (e.g., Postgres) are re-raised as their database-agnostic ActiveRecord equivalents. So a `PG::UniqueViolation`, which occurs when saving a record would violate a table's unique index, is captured by ActiveRecord's Postgres adapter and re-raised as `ActiveRecord::RecordNotUnique`.

When this happens, Ruby 2.1+ automatically wraps the original exception as a property of the new one. The new exception's `#cause` property will retain a record of the original.

From the [Ruby docs](http://ruby-doc.org/core-2.2.1/Exception.html#method-i-cause):

> ### cause → an_exception or nil
> Returns the previous exception (`$!`) at the time this exception was raised. This is useful for wrapping exceptions and retaining the original exception information.

Bugsnag takes advantage of this exception trail to detail a full backtrace of each exception in the chain. Errors are then listed according to the very first exception in the chain.

It's worth noting, then, that **the error in Bugsnag's headline may not be the exception that your own code is experiencing**. In the example above, the `PG::UniqueViolation` will appear in Bugsnag's headline, but the application code will only ever experience the `ActiveRecord::RecordNotUnique` one.

## Further reading

* [Bugsnag blog: Exception#cause in Ruby 2.1](https://bugsnag.com/blog/ruby-2-1-exception-causes)
* [Avdi Grimm: Exception causes in Ruby 2.1](http://devblog.avdi.org/2013/12/25/exception-causes-in-ruby-2-1/)

repository: altmetric/til

repo_name: altmetric/til


text:
---
id: working_with_permissions
author: GoodData
sidebar_label: Setting Permissions
title: Setting Permissions
---

Setting Up Simple Data Permission
-------

You can set a data permission (user filter or MUF filter) for
one or two users.

SDK offers couple of convenience features for doing this. Let’s first
recap what we need to set up a data permission filter. We’ll be setting
a simple filter along these lines

    WHERE city IN (San Francisco, Prague, Amsterdam)

-   We need to know the label to filter. In our case this is the *city*
    label

-   We need to know the label’s values. In our case these are (San
    Francisco, Prague, Amsterdam)

-   We also need to know the user assigned with the filter. We’ll use
    your account in the example (you may use any valid user).

Although we present this as an executable script this is something that
is often done interactively. So do not fear to jack in to a project and
follow along.

```ruby
# encoding: utf-8

require 'gooddata'

GoodData.with_connection do |c|
  GoodData.with_project('project_id') do |project|
    # First let's grab an attribute
    attribute = project.attributes('attr.region.city')
    # to set up a value we need a specific label
    # if the attribute has only one label, you can easily grab it by calling #primary_label
    label = attribute.primary_label
    # if a label has multiple labels, you can select the correct one like this
    # label = attribute.label_by_name('City Name')
    # Let's construct filters we are going to set up
    # We will do it for two hypothetical users
    filters = [
<EMAIL_ADDRESS>label.uri, 'San Francisco', 'Amsterdam'],
<EMAIL_ADDRESS>label.uri, 'San Francisco', 'Prague']
    ]
    # Obvious question might be how do you know that the values are correct
    # you can find out like this label.value?('Amsterdam')
    # Let's now update the project
    project.add_data_permissions(filters)
  end
end
```

List Data Permissions
-------

There is no UI that would provide a good overview and API is a little
crude but with help of SDK you can get around that.

```ruby
# encoding: utf-8

require 'gooddata'

GoodData.with_connection do |c|
  GoodData.with_project('project_id') do |project|
    project.data_permissions.pmap {|f| [f.related.login, f.pretty_expression]}
  end
end
```

Setting Data Permissions from CSV (column format)
-------

You can also set data permissions for multiple users. Let's have a
CSV with two columns that associate user with a single data permission’s
value. We’ll use the same city example from the examples above.

The SDK offers couple of convenience features for doing this. Let’s first
recap what we need to set up a filter.

In this case we will be setting a simple data permission for the city
label in form of following filter

    WHERE city IN ('San Francisco', 'Prague', 'Amsterdam')

-   We need to know the label to filter. In our case this is the *city*
    label

-   We need to know the label’s values. In our case these are (San
    Francisco, Prague, Amsterdam)

-   We also need to know the user assigned with the filter. We’ll use
    your account in the example (you may use any valid user).

Let’s say we want to set up these specific values

<EMAIL_ADDRESS>'San Francisco', 'Amsterdam']
<EMAIL_ADDRESS>'San Francisco', 'Prague']

We’ll capture these data permissions in the following CSV (data.csv)

    login,city
    john.doe@example.com,San Francisco
    john.doe@example.com,Amsterdam
    jane.doe@example.com,San Francisco
    jane.doe@example.com,Prague

```ruby
# encoding: utf-8

require 'gooddata'

GoodData.with_connection do |c|
  GoodData.with_project('project_id') do |project|
    # First let's grab an attribute
    attribute = project.attributes('attr.region.city')
    # to set up a value we need a specific label
    # if the attribute has only one label, you can easily grab it by calling #primary_label
    label = attribute.primary_label
    # if a label has multiple labels, you can select the correct one like this
    # label = attribute.label_by_name('City name')
    filters = GoodData::UserFilterBuilder::get_filters('data.csv', {
      :type => :filter,
      :labels => [{:label => label, :column => 'city'}]
      })
    project.add_data_permissions(filters)
  end
end
```

Several things has to be true for this code to work correctly

-   All the users are members of the target project

-   All the label’s (city) values are present in the data loaded in the
    project

Setting Data Permissions from CSV (row format)
-------

You can also set data permissions for multiple users. Let's have a
CSV with two columns that associate user with a single data permission’s
value. We’ll use the same city example from the examples above.

The SDK offers couple of convenience features for doing this. Let’s first
recap what we need to set up a filter.

In this case we will be setting a simple data permission for the city
label in form of following filter

    WHERE city IN ('San Francisco', 'Prague', 'Amsterdam')

-   We need to know the label to filter. In our case this is the *city*
    label

-   We need to know the label’s values. In our case these are (San
    Francisco, Prague, Amsterdam)

-   We also need to know the user assigned with the filter. We’ll use
    your account in the example (you may use any valid user).

Let’s say we want to set up these specific values

<EMAIL_ADDRESS>'San Francisco', 'Amsterdam']
<EMAIL_ADDRESS>'San Francisco', 'Prague']

We’ll capture these data permissions in the following CSV (data.csv)

    john.doe@example.com,San Francisco,Amsterdam
    jane.doe@example.com,San Francisco,Prague,Berlin

Please note that the CSV format is different from the previous example.
There are no headers because the file can have a different number of
columns on each line.

```ruby
# encoding: utf-8

require 'gooddata'

GoodData.with_connection do |c|
  GoodData.with_project('project_id') do |project|
    # First let's grab an attribute
    attribute = project.attributes('attr.region.city')
    # to set up a value we need a specific label
    # if the attribute has only one label, you can easily grab it by calling #primary_label
    label = attribute.primary_label
    # if a label has multiple labels, you can select the correct one like this
    # label = attribute.label_by_name('City name')
    filters = GoodData::UserFilterBuilder::get_filters('data.csv', {
      :type => :filter,
      :labels => [{:label => label}]
      })
    project.add_data_permissions(filters)
  end
end
  ```

Several things has to be true for this code to work correctly

-   All the users are members of the target project

-   All the label’s (city) values are present in the data loaded in the
    project

List Variable Values
-------

If you have variables in your project, you can see the values in a readable fashion.

The SDK tries to hide the differences from Data Permissions so this recipe
is analogy to [List Data Permissions](working_with_permissions.md#list-data-permissions) recipe.

```ruby
# encoding: utf-8

require 'gooddata'

# fill this in
VARIABLE_IDENTIFIER = 'variable_identifier'
PROJECT_ID = 'project_id'

GoodData.with_connection do |c|
  GoodData.with_project(PROJECT_ID) do |project|
    var = project.variables(VARIABLE_IDENTIFIER)
    var.values.pmap do |var|
      owner = var.related.class == GoodData::Project ? "[PROJECT DEFAULT]" : var.related.login rescue nil
      [owner, var.pretty_expression]
    end
  end
end
```

Unlike the Data Permissions, the Variables have a concept of default value for
the project. If a specific values is not provided for a user the project
default is used. You can noticed these users to have "TRUE" as a value.
The project value is marked as \[PROJECT DEFAULT\] in the output.

repository: gooddata/gooddata-ruby-doc

gha_language: SCSS

gha_license_id: NOASSERTION

repo_name: gooddata/gooddata-ruby-doc


text:
wmpy
====

Walter Mundt's Python bits and pieces.

This contains various bits of Python code I have written on my own
time and find handy.

Contents:

- `nat_sort_key` can be used for `key=` in `sort` or `sorted`, and sorts strings with embedded numbers in a way that attempts to make sense.
- `io_pipe` is a `with` context manager to set up an `os.pipe` r/w pair wrapped in unbuffered `io`-module file objects, that is closed on exit from the block.
- `WatchedThread` is a Thread subclass that tries to make it easier to gracefully handle uncaught exceptions in thread targets, dying messily by default and offering easy ways to re-raise exceptions across the thread boundary.
- `ArgSpec` is a wrapper around `inspect.getargspec` that provides a defaults dict instead of a defaults list, and can invoke the inspected function from a dict containing all the arguments to pass (INCLUDING a sequence keyed by the name of the `*varargs`).  This is not always a great idea, but it's handy for:
- `ParserGenerator` instances are decorators that automatically build `argparse.ArgumentParser` instances based on a function's signature, and attach them to the function as `parser` attributes.  They also tack on a bunch of info about said arguments, and a `parse_and_call` method that takes an argv and calls the decorated function if the argv parses successfully.  One can pass keyword arguments to the decorator in order to customize the syntax, add help text, or do anything else an argparse `add_argument` can do.

Tests and examples are currently missing, since I'm using this stuff mostly in other code I haven't gotten into a publishable state yet.  Feel free to use it if it is useful, but YMMV.

wmpy is Copyright (c) 2012 Walter Mundt.
It is available under an MIT license; see the LICENSE file for details.


text:
---
layout: default
---

# 1996-11-15 - Re: [REBUTTAL] Censorship on cypherpunks?, from The Netly News

## Header Data

From: Dave Hayes<EMAIL_ADDRESS>To<EMAIL_ADDRESS>(Igor Chudov)

Message Hash: 3931a30957c4dd3f6a0ebdb2a909234b53f40fc06c7be04aa26af00a03b9e1f1

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1996-11-15 20:59:31 UTC

Raw Date: Fri, 15 Nov 1996 12:59:31 -0800 (PST)

## Raw message

```
{% raw  %}From: Dave Hayes<EMAIL_ADDRESS>Date: Fri, 15 Nov 1996 12:59:31 -0800 (PST)
To<EMAIL_ADDRESS>(Igor Chudov)
Subject: Re: [REBUTTAL] Censorship on cypherpunks?, from The Netly News
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

> Umm, even if we accept Dave's claim that Gilmore pinched holes in
> his ideology, these holes are no bigger than Dave Hayes's own holes,
> since he exercises censorship of Freedom Fighters mailing list.

Firstly, there is no "Freedom Fighters" mailing list.

I have done nothing Gilmore didn't do. People can still send their
missives to freedom-knights without being subscribed.
------
Dave Hayes - Altadena CA, USA -<EMAIL_ADDRESS>Freedom Knight of Usenet - http://www.jetcafe.org/~dave/usenet

A person being delivered from the danger of a fierce lion does not object
whether this service is performed by unknown or illustrious individuals.

Why, therefore, do people seek knowledge from celebrities?

{% endraw %}
```

## Thread

+ Return to [November 1996](/archive/1996/11)

+ Return to "[Dave Hayes <dave@kachina.jetcafe.org>](/authors/dave_hayes_dave_at_kachina_jetcafe_org_)"

+ 1996-11-15 (Fri, 15 Nov 1996 12:59:31 -0800 (PST)) - Re: [REBUTTAL] Censorship on cypherpunks?, from The Netly News - _Dave Hayes<EMAIL_ADDRESS>


text:
# UH Manoa Student Book Market for ICS Students

## Landing Page

Landing Page has a short description/overview of the website.

## Browse Books Page

Displays a list of all the textbooks required in ICS major.

## Sell Books Page

Submit seller information and book details.

## Book Check Page

Shows a table with list of people who are selling the selected textbook.

## Book Detail Page

Shows the brief description of the book written by the seller

## Contact Seller Page

Send Message to the seller


text:
# Lung Swapping Auotencoder: Learning a Disentangled Structure-texture Representation of Chest Radiographs

This is the PyTorch implementation of [Lung Swapping Autoencoder](https://link.springer.com/chapter/10.1007%2F978-3-030-87234-2_33) published on MICCAI 2021.

## Preparation
### CXRs and Masks of ChestX-ray14
You can download our pre-processed data through the following links. Please remember to modify the data path in the command lines correspondingly.
- [Histogram Equalized ChestX-ray14 (256 x 256)](https://drive.google.com/file/d/1Mf0XI33sdhtcuvBjohe1kTmlX67-uVvz/view?usp=sharing).
- [Lung Segmentation Masks of ChestX-ray14](https://drive.google.com/file/d/1a-oH7BLrCp4ZTPembtvr3_X3ory2tH47/view?usp=sharing)
### Data Splits of ChestX-ray14
We split ChestX-ray14 following the routine of the [official website](https://nihcc.app.box.com/v/ChestXray-NIHCC). To simplify the input of annotations, we generate [train list](https://github.com/cvlab-stonybrook/LSAE/blob/main/data/trainval_list.txt) and [test list](https://github.com/cvlab-stonybrook/LSAE/blob/main/data/test_list.txt). Each line is composed of the image name and the corresponding labels like below:
```
00000001_002.png 0 1 1 0 0 0 0 0 0 0 0 0 0 0
```
If the image is positive with one class, the corresponding bit is 1, otherwise is 0. Class index follows [this](https://nihcc.app.box.com/v/ChestXray-NIHCC/file/220660789610)

## Unsupervised Lung Swapping Pre-training
The command is following. Please fill in the blanks with your own paths.
```
CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --nproc_per_node=2 \
  --master_port=8898 train_lsae.py \
  --size 256 \
  --batch 8 \
  --lr 0.001 \
  --trlist data/trainval_list.txt \
  --tslist data/test_list.txt \
  --wandb \
  --proj_name lsae \
  [CXR_PATH] [CXR_Mask_PATH]
```
We provide the trained [LSAE checkpoint](https://drive.google.com/file/d/1Qh-BhnAQIdnvO7bd--RArIOtzobwR9FQ/view?usp=sharing) which is used to perform the downstream tasks.

### Qualitative Results of Lung Swapping

## Full Labeled Data Finetuning on ChestX-ray14
The command is following. Please fill in the blanks with your own paths.  The quantitative comparison with Inception v3 and DenseNet 121 is shown in the following table, together with all the model weights.
| Models | Init Weights | Params(M) | mAUC(%) |
| :----: | :----------: | :-------: | :-----: |
| DenseNet 121 [[ckpt](https://drive.google.com/file/d/1HIOoprsTtWB_-rKNxzzx4HOk3qhlPgiM/view?usp=sharing)] | ImageNet pre-trained | 7 | 78.7 |
| Inception v3 [[ckpt](https://drive.google.com/file/d/1O5RNYo4C-i33BIGR73IuzEagdmCPL69k/view?usp=sharing)] | ImageNet pre-trained | 22 | 79.6 |
|  in LSAE [[ckpt](https://drive.google.com/file/d/1lYAofe93BvvhYaxICDS3RLOItqwe7Qs4/view?usp=sharing)] | LSAE pre-trained | 5 | 79.2 |

## Cite
```
@inproceedings{zhou2021chest,
  title={Chest Radiograph Disentanglement for COVID-19 Outcome Prediction},
  author={Zhou, Lei and Bae, Joseph and Liu, Huidong and Singh, Gagandeep and Green, Jeremy and Samaras, Dimitris and Prasanna, Prateek},
  booktitle={International Conference on Medical Image Computing and Computer-Assisted Intervention},
  pages={345--355},
  year={2021},
  organization={Springer}
}
```

## Acknowledgement
Our code is heavily based on the following open-sourced repositories. We appreciate their generous releases.
- [Swapping Autoencoder](https://github.com/rosinality/swapping-autoencoder-pytorch) by [rosinality](https://github.com/rosinality)
- [StyleGAN2](https://github.com/rosinality/stylegan2-pytorch) by [rosinality](https://github.com/rosinality)
- [Contrastive Unpaired Translation (CUT)](https://github.com/taesungp/contrastive-unpaired-translation) by [taesungp](https://github.com/taesungp)
- [WarpAffine2GridSample](https://github.com/wuneng/WarpAffine2GridSample) by [wuneng](https://github.com/wuneng)


text:
---
published: true
layout: post
title: SMS Integration Options
---

Here's the best options I've seen so far for adding sms to bigred and costumecraze.com customer chat.

[Programmable SMS - Twilio Text Messaging for Mobile & Web Apps](https://www.twilio.com/sms)

Basic pricing rundown is $1/mo for the phone number and .75¢/message (sending or receiving) to/from US phone numbers. Twilio works with a long list of countries, and prices to other countries are more, sometimes 5x or 10x more. But still not unreasonable.

[SMS Pricing for Text Messaging - Twilio](https://www.twilio.com/sms/pricing)


text:
## Installing dependencies for Linux ##

For a minimal installation of running a python agent, follow step 1.

### 1. Install dependencies available from the standard repositories: ###

On Ubuntu 15.10:

`sudo apt-get install libboost-all-dev libpython2.7 openjdk-8-jdk lua5.1 libxerces-c3.1 liblua5.1-0-dev ffmpeg python-tk python-imaging-tk`

`sudo update-ca-certificates -f` (http://stackoverflow.com/a/29313285/126823)

On Ubuntu 14.04 or Debian 8:

`sudo apt-get install libboost-all-dev libpython2.7 openjdk-7-jdk lua5.1 libxerces-c3.1 liblua5.1-0-dev libav-tools python-tk python-imaging-tk`

`sudo update-ca-certificates -f` (http://stackoverflow.com/a/29313285/126823)

On Debian 7:

`sudo apt-get install python2.7 openjdk-7-jdk lua5.1 libxerces-c3.1 liblua5.1-0-dev ffmpeg python-tk python-imaging-tk`

`sudo update-ca-certificates -f` (http://stackoverflow.com/a/29313285/126823)

On Fedora 23:

`su -c 'dnf install http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm'` (for ffmpeg)

`sudo dnf install boost python java-1.8.0-openjdk xerces-c ffmpeg mono compat-lua lua-socket-compat tkinter python-pillow-tk`

### 2. Optional: Install Torch: ###

If you don't want to use Malmo from Torch then you can skip this step.

Follow the instructions at http://torch.ch/docs/getting-started.html

Check that typing `th` works.

### 3. Optional: Install Lua dependencies: ###

If you don't want to use Malmo from Lua/Torch then you can skip this step.

Ensure you have luarocks installed:
`sudo apt-get install luarocks`
Install required dependencies:
`sudo luarocks install luasocket`

### 4. Optional: Install Mono: (if not on Fedora) ###

If you don't want to use Malmo from C# then you can skip this step.

Follow the instructions here: http://www.mono-project.com/docs/getting-started/install/linux/

### 5. Optional: Install ALE: ###

If you want to use the Atari Learning Environment as an alternative back-end to Minecraft, you need a build that includes "_withALE"
and will need to install ALE as described here. If you don't want to use ALE then use a build that doesn't have "_withALE".

1. `git clone https://github.com/mgbellemare/Arcade-Learning-Environment.git ~/ALE`
2. If you want a GUI, you need to install SDL:
`sudo apt-get install libsdl1.2-dev`
3. Make sure you have cmake installed:
`sudo apt-get install cmake`

Then:

`cd ~/ALE`

`git checkout ed3431185a527c81e73f2d71c6c2a9eaec6c3f12 .`

`cmake -DUSE_SDL=ON -DUSE_RLGLUE=OFF -DBUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=RELEASE .`

`make`

(If you don't want a GUI, use `-DUSE_SDL=OFF`, or leave it unspecified - it's off by default.)

4. You will need to put ~/ALE on your LD_LIBRARY_PATH so that Malmo can find libAle.so:
Add `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/ALE/` to your ~/.bashrc
`source ~/.bashrc`

### 6. Set the MALMO_XSD_PATH to the location of the schemas: ###

1. If you have not already done so, unzip the Malmo zip to some location (e.g. your home folder).
2. Add `export MALMO_XSD_PATH=~/MalmoPlatform/Schemas` (or your Schemas location) to your `~/.bashrc` and do `source ~/.bashrc`
3. When you update Malmo you will need to update the MALMO_XSD_PATH too.

repository: shaw-wong/Malmo

gha_language: Java

repo_name: shaw-wong/Malmo


text:
# feathers-subscriptions-manager
[![Build Status](https://travis-ci.org/nicoknoll/feathers-subscriptions-manager.svg?branch=master)](https://travis-ci.org/nicoknoll/feathers-subscriptions-manager)
[![Downloads](https://img.shields.io/npm/dt/feathers-subscriptions-manager.svg)](https://www.npmjs.com/package/feathers-subscriptions-manager)

> A subscriptions manager for feathers.js reactive subscriptions through feathers-reactive.

The Feathers Subscription Manager allows you to wait for multiple subscriptions and then call a shared callback function. After the initial load this function will be called every time one of the subscriptions get updated.

## Requirements
This Subscriptions Manager will only work for [feathers-reactive](https://github.com/feathersjs/feathers-reactive). Please follow their [setup instructions](https://github.com/feathersjs/feathers-reactive#setting-options-and-rxjs) before you start using the "feathers-subscriptions-manager".

```
npm install --save feathers-reactive
```

## How does it work
The Feathers Subscription Manager will let you register all the subscriptions (**addSubscription()**) you want and watch them. Each of the subscriptions will have some kind of a callback action (examples below). This _action_ has to return an object, that will be merged into the Subscriptions Manager's state.

When all subscriptions have received their data the **.ready(callback(data, initial))** callback method will be called and will have the merged state object as first parameter. In this function you can e.g. have a "renderLayout" function.

The callback will now be called on every change of one of the watched subscriptions as well.

(optional) The second parameter of the callback function (_initial_) is a boolean that will let you know if it is the initial call (True) or an update call (False).

## Usage
### Set up subsManager:

```js
import { SubsManager } from 'feathers-subscriptions-manager';
const subsManager = new SubsManager();
```

### addSubscription(_cursor_, _action_)

_cursor_ is a feathers service call.

```js
const userService = app.service('users');
const findUsersCursor = userService.find(...);
```

_action_ can be a string or a function.

```js
/* Use with strings */
/* Recommended if you e.g. make a "get" call */
/* Result: {users: data} */
subsManager.addSubscription(findUsersCursor, 'users');

/* Use with function */
/* Recommended if you want to have a proxy between getting the data from the server and finishing the the call */
/* Result: {users: users.data} */
subsManager.addSubscription(findUsersCursor, (users) => {
	return {users: users.data};
});

```

### ready(callback(_data_, _initial_))

```js
subsManager.ready((data, initial) => {
	// all subscriptions are ready
	// you can use the resulting object as "data"
	if(initial) {
		renderLayout(data);
	} else {
		updateLayout(data);
	}
});
```

gha_language: JavaScript


text:
# config

A constrained-key nested-dict
for managing configuration data.

## typical use case

A `Config` object manages configuration
data read from a set of `key=value` records in a file.
The `Config` object is used to
define, load and access the expected keys.

#### example

```
from ergaleia import Config

# define config
c = Config()
c._define('server.port', value=10000, validator=int)
c._define('server.ssl', value=true, validator=config.validate_bool)

# load key=value data from file
c._load('my_config')

# use config
setup_server(port=c.server.port, is_ssl=c.server.ssl)
```

## general characteristics

The `Config` object is built as a nested dict
whose keys are constrained
to a defined structure.

#### a simple demonstration

```
>>> from ergaleia import config

>>> c = Config()

# try to access an attribute
>>> c.foo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "ergaleia/config.py", line 16, in __getattr__
    attr = self.__lookup(name)
  File "ergaleia/config.py", line 12, in __lookup
    raise KeyError(name)
KeyError: 'foo'

# define an attribute with a default value
>>> c._define('foo', 'bar')

# and access it again
>>> c.foo
'bar'

# load a configuration file (a list for demonstration)
>>> c._load(['foo=rab'])

# and take a look
>>> c.foo
'rab'
>>> c['foo']
'rab'
```

This example demonstrates several characteristics of a `Config`:

* only *defined* attributes can be accessed

* attribute values can be loaded from a file

* attributes can be accessed with `dot` or `bracket` notation

## defining an attribute

An attribute can be defined in the `Config` constructor, or by making a call
to the `_define` method. Here is the signature of the `_define` method:

```
_define(self, name, value=None, validator=None, env=None)

Parameters:
    name      - name of the attribute
    value     - initial value of the attribute
    validator - validator callable (see Note 1)
    env       - enviromment variable for default/config override

Notes:
    1. the validator validates and optionally transforms the
       attribute:

           config.attribute = validate(new_value)

       if the validator does not throw an exception, the
       new_value is considered valid
```

#### simple attribute
```
>>> c._define('foo')
>>> print(c.foo)
None
>>> c.foo = 1
>>> c.foo
1
>>> c['foo']
1
```

#### nested attribute
```
>>> c._define('a.b')
>>> print(c.a.b)
None
>>> c.a.b = 'hello'
>>> c.a.b
'hello'
>>> c['a']['b']
'hello'

# kinda weirdly...
>>> c['a'].b
'hello'
>>> c.a['b']
'hello'
```

#### set a default value
```
>>> c._define('foo', value=10)
>>> c.foo
10
```

#### enforce an type
```
>>> c._define('foo', value=10, validator=int)
>>> c.foo = 'bar'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "ergaleia/config.py", line 28, in __setattr__
    attr.value = value
  File "ergaleia/config.py", line 176, in __setattr__
    value = validator(value)
  File "ergaleia/config.py", line 196, in validate_int
    return int(value)
ValueError: invalid literal for int() with base 10: 'bar'
>>> c.foo = 20
>>> c.foo
20
>>> c.foo = '30'
>>> c.foo
30
```

#### env
```
>>> import os
>>> os.environ['FOO'] = 1234
>>> c._define('foo', 10, int, 'FOO')

# env wins over default
>>> c.foo
1234

# env wins over config file
>>> c._load(['foo=100'])
>>> c.foo
1234

# but directly setting always wins
>>> c.foo = 100
>>> c.foo
100
>>> c['foo'] = 200
>>> c.foo
200
```

## other ways to define an attribute

A `Config` can also be defined by reading definition statements from
a `file` or `list` object using the `_define_from_path` method or the
`Config` constructor.

#### definition statement

A definition statement is a blank-delimited sequence
of tokens that contain elements that would normally be passed to
the `_define` method. For instance, the following call to define:
```
c._define('foo', value=10, validator=int, env='FOO')
```
can be expressed with one of these equivalent definition statements:
```
'foo' value=10 validator=int env='FOO'

foo value=10 validator=int env=FOO

foo value= 10 validator =int env = FOO

foo 10 int FOO
```

A definition statement looks like an argument list without the commas.
It also assumes that the value of a kwarg argument is `int` if it
is composed of numeric characters [0-9]; otherwise, the value is `str`.
It is only necessary to include quotes around a string if it contains
blanks.

Valid values for `validator` are one of int, bool or file. If
`validator` is not one of these values, it is assumed to be a
dot-delimited string which can be resolved to a function using
`import_by_path`.

#### using _define_from_path
```
_define_from_path(self, defn, filetype=None)

    Parameters:
        defn     - a file path, file name, file or list
        filetype - type component of dot-delimited path

    Notes:
        1. A 'file path' is a dot-separated file name that resolves
           to a file in the PYTHONPATH (See ergaleia.normalize_path).
        2. If 'file path' is used, the last dot-delimited token might
           represent a file-type. This can be indicated with the
           'filetype' argument.
        3. A 'file name' is an os-specific path to a file in the file
           system. It will be located relative the the working
           directory of the running python program.
        4. A 'file' is an object with a 'readlines' method returning
           zero or more lines.
```
For instance:
```
c._define_from_path([
    'server.port value=10000 validator=int',
    'server.ssl value=true, validator=bool',
])
```

#### using the Config constructor

The same set of definition statements can be passed to a `Config`
constructor:
```
c = Config([
    'server.port value=10000 validator=int',
    'server.ssl value=true, validator=bool',
])
```

The `Config` constructor takes the same arguments as the
`_define_from_path` method.

## loading values from a config file

A program using `Config` will manage the definition of valid
fields, and allow a user to adjust those values by changing
a config file.
The definitions, whether loaded from a definition file or
explicitly established with the `_define` method, are considered
code, and are not manipulated in order to configure the
operation of the program.

*A **config file** is used to configure the operation of the program.*
The default name for a `config file` is `config`, which is
the name of a
text file in the current working directory (See Note 3 below).

User settings
in a config file
are `key=value` pairs, one per line.
A `key` must match a defined config value, and a `value`
must conform to any `validation` associated with the `key`.
If a `key` has an `env` defined, and the environment variable
of that name is set, then the environment variable will
take precedence over the value read from the file.

Use the `_load` method to read in any user settings from
a file.

```
_load(self, path='config', filetype=None, relaxed=False)

    Parameters:
        path     - a file path, file name, file or list
        filetype - type component of dot-delimited path
        relaxed  - if True, define keys on the fly (see Note 5)
        ignore   - if True, ignore undefined keys in path

    Return:
        self

    Notes:
        1. A 'file path' is a dot-separated file name that resolves
           to a file in the PYTHONPATH (See ergaleia.normalize_path).
        2. If 'file path' is used, the last dot-delimited token might
           represent a file-type. This can be indicated with the
           'filetype' argument.
        3. A 'file name' is an os-specific path to a file in the file
           system. It will be located relative the the working
           directory of the running python program.
        4. A 'file' is an object with a 'readlines' method returning
           zero or more lines.
        5. Normally, keys read from the path must conform to keys
           previously defined for the Config. If the relaxed flag
           is True, any keys found in the file will be accepted.
           (The keys are automatically defined, with no `value`,
           `validator` or `env` specified). If the ignore flag is
           True, any keys found in the file that are not previously
           defined are ignored.
```

## other ways to get and set data

#### using _get

Dot or bracket notation is the typical way to access values in a `Config`.
The `_get` method allows a single-call alternative that can be useful
in certain cases. The following access calls:
```
c.a.b.c
c['a']['b']['c']
```
can also be performed with the `_get` method:
```
c._get('a.b.c')
```
If the `key`, in this case `a.b.c`, is stored in a variable,
the `_get` method allows you to directly access a value without having
to break the variable into it's component parts and loop through each access.

#### using _set

The `_load` method is the typical way to set values in a `Config`.
Dot and bracket notation are also available.
The `_set` method allows a single-call alternative that can be useful
in certain cases. The following set calls:
```
c.a.b.c = 10
c['a']['b']['c'] = 10
```
can also be performed with the `_set` method:
```
c._set('a.b.c', 10)
```

#### using _as_dict

The `_as_dict` property is a one-level dict with each
defined key in the `Config` paired with the corresponding value.

repository: remidinishanth-ntnx/ergaleia

repo_name: remidinishanth-ntnx/ergaleia


text:
# Points on the Straight Line

https://www.interviewbit.com/problems/points-on-the-straight-line/

Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.

Sample Input :

(1, 1)
(2, 2)
Sample Output :

2
You will be given 2 arrays X and Y. Each point is represented by (X[i], Y[i])

repository: aadhityasw/Competitive-Programs

repo_name: aadhityasw/Competitive-Programs


text:
---
title: To Tweet or Not to Tweet ...
id: 96
categories:
  - Event
date: 2009-04-02 21:30:00
tags:
 - Social Media
---

In the third in a series of "talks for smart people", [BlueTie](http://bluetie.com/) tonight hosted "To Tweet or Not to Tweet" to an engaged and inquisitive group in Pittsford NY. In fact, if the audience had its way, the talk would have been a hour-long question and answer session.

Some hot-button queries were

*   Why would someone follow over a thousand people?
*   How do you find people to follow, or people to follow you?
*   When should I follow, and when should I friend?
*   Are the social networks converging?
*   Is privacy an issue? Or a non-issue?
*   Can Twitter be used a guerrilla marketing tool?
*   How else can I use Twitter in my business?

[![](https://tedhusted.files.wordpress.com/2009/04/b5486-ping_fm.png)](http://ping.fm/)In between a battery of of questions, local Twitter guru [Emily Carpenter](http://twitter.com/EmilyCarpenter) walked us through the basics of [LinkedIn](http://www.linkedin.com/in/husted), [FaceBook](http://www.facebook.com/profile.php?id=705537703), and, especially, [Twitter](http://twitter.com/tedhusted).

The Twitter portion of the talk focused on the dizzying number of third-party add-ins. One that caught my eye is [Ping.fm](http://ping.fm/dashboard/). A point of convergence between the social networks is a status message or micro-blog. Ping makes it easy to update your status on one or more networks from a single dashboard. Of course, like most social network applications today, there are missing features, like post-dating messages, but it is still a sweet dashboard. I'll be trying this one again.

As to the Twitter questions, I won't try to speak for Emily, but here are my own answers.

Why would someone follow over a thousand people?

Mainly to get more followers of your own. People often reciprocate: if you follow someone on Twitter, they follow you back. To compensate, Peopleuse third-party Twitter applications to filter out the important feeds or likely tweets.

Personally, I only follow people that I actually want to read regularly. But, I have noticed that following someone usually leads to more follows, even if it's someone like [@TonyRobbins](http://twitter.com/tonyrobbins) or [@JohnTesh](http://twitter.com/johntesh). If you want to be followed, follow someone else.

How do you find people to follow, or people to follow you?

Start by using Twitter's[ Find People](http://twitter.com/invitations/find_on_twitter) feature to lookup your friends and colleagues. Look at who they are following for other interesting feeds. Then goto to a site like [CelebrityTweet](http://www.celebritytweet.com/) and look for other people that interest you. Also try looking up your favorite authors. (I found [@StevenRCovey](http://twitter.com/StephenRCovey) that way.)

When should I follow, and when should I friend?

On Twitter, we follow. On FaceBook, we friend. On LinkedIn, we connect. On Twitter, you can follow anyone who is tweeting things you want to read. On FaceBook, it's better to friend only people you actually know and trust, especially personal friends that you might join for dinner or drinks. On Linked In, it's best to connect with professional colleagues that are connected to your career in some way. People that you might interview for or against.

The nice thing about Twitter is that it crosses the line between personal and professional. People expect Twitter to be a mix. Twitter's a place where you can be a whole person, and not just the work-you or the home-you.

Still, the Internet is forever, so don't tweet anything you don't want the grand kids to read, even if they aren't born yet

Are the social networks converging?

Yes, the network are adopting similar feature sets, and integrators, like Ping.FM, make it easier to reuse content between networks. Someday, there may one be one. But, for now, people tend to use LinkedIn to manage their resume, and FaceBook to manage their social calendar.

Is privacy an issue? Or a non-issue?

To older folks (like me), the amount of information teenagers are sharing on social networks is frightening. But, privacy is relative. The key thing to remember is that nothing you share on a social network is private, so don't say anything you don't want your mother, kids, or spouse to know. Personally, I hesitate to mention when I will be traveling, or where my kids might be at a certain time. Burglars and stalkers are no strangers to technology.

Can Twitter be used a guerrilla marketing tool?

Absolutely! Just today, SlideShare sent me this email: "We've noticed that your slideshow on SlideShare has been getting a LOT of views in the last 24 hours. Great job ... you must be doing something right. ;-) Why don't you tweet or blog this? Use the hashtag #bestofslideshare so we can track the conversation."

There's no reason why my SlideShare views should have spiked on Apr 1st. Even though I think it's a marketing prank, still, I wrote about it. (And, fool me twice, I'm doing it again!)

Another instance is that we have a meeting coming up for the still-forming local chapter of the [International Institute of Business Analysts](http://rochesterny.theiiba.org/) . To get the word our for our next meeting, one thing we are considering is asking the members to blog and tweet about it.

How else can I use Twitter in my business?

Many people and businesses have Google Alerts in place to search for items of interest. There are Twitter applications that let you do the same thing with Twitter feeds. For example, I mentioned "bikinis" the other day, and suddenly Bikini Beat is a follower. (Don't ask!)

By proactively searching Twitter for keywords, companies can target consumers or head-off consumer complaints. But, seller beware, in this age of transparency, be upfront and honest. On the Internet, we can Google, but we can't hide.

Oh, and should you Tweet?

If you have to ask, then you should :)

But, only when you have something to say!


text:
<img src="https://user-images.githubusercontent.com/211411/34776833-6f1ef4da-f618-11e7-8b13-f0697901d6a8.png" height="100" />

## @ledgerhq/errors

Hodl all possible errors of Ledger (live, ledgerjs) so we can deal with them in a unified way (share between libraries, `instanceof` them,...)

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

#### Table of Contents

*   [TransportError](#transporterror)
    *   [Parameters](#parameters)
*   [TransportStatusError](#transportstatuserror)
    *   [Parameters](#parameters-1)

### TransportError

TransportError is used for any generic transport errors.
e.g. Error thrown when data received by exchanges are incorrect or if exchanged failed to communicate with the device for various reason.

#### Parameters

*   `message` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
*   `id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**

Returns **void**

### TransportStatusError

Error thrown when a device returned a non success status.
the error.statusCode is one of the `StatusCodes` exported by this library.

#### Parameters

*   `statusCode` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**

Returns **void**

repository: LedgerHQ/ledgerjs

gha_language: TypeScript

repo_name: LedgerHQ/ledgerjs


text:
#Fedena : Open source school management system

Project Fedena is the open source school management system based on Ruby on Rails. It is developed by a team of developers at Foradian Technologies. The project was made open source by Foradian, and is now maintained by the open source community. Fedena is the ideal solution for schools and campuses that want an easy means to manage all campus records.

The Project Fedena website http://www.projectfedena.org/ is the home to the developer community behind Fedena project. There you can find forums and bug tracker for Fedena.

#College

Priyadarshini College

#License

Fedena is released under the Apache License 2.0.

repository: kotesh/pdckmm

extension: markdown

repo_name: kotesh/pdckmm


text:
# Contributing to the Documentation

We welcome any contributions to our documentation repository,
[dvc.org](https://github.com/iterative/dvc.org). Contribution can be an update
to the documentation or (rare) updating or fixing the JS engine that we use to
run the website.

## Structure of the project

To contribute documentation you need to know these locations:

- [Content](https://github.com/iterative/dvc.org/tree/master/static/docs)
  (`/static/docs`) -
  [Markdown](https://guides.github.com/features/mastering-markdown/) files of
  the different pages to render dynamically in the browser.

- [Images](https://github.com/iterative/dvc.org/tree/master/static/img)
  (`/static/img`) - add new images, gif, svg, etc here. Reference them from the
  Markdown files like this: `![](/static/img/reproducibility.png)`.

- [Sections](https://github.com/iterative/dvc.org/tree/master/src/Documentation/sidebar.json)
  (`.../sidebar.json`) - edit it to register a new section for the navigation
  menu.

Merging the appropriate changes to these files into the master branch is enough
to update the docs and redeploy the website.

## Submitting changes

In case of a minor change, you can use the **Edit on Github** button (found to
the right of each page) to fork the project, edit it in place (check the right
top corner for an Edit button on Github), and create a pull request (PR).

Otherwise, please refer to the following procedure:

- Find or open a new issue in the
  [issue tracker](https://github.com/iterative/dvc.org/issues) to let us know
  that you are working on this.
- Format the code by following the
  [code style guidelines](#code-style-guidelines) below. It's highly recommended
  setup the [development environment](#development-environment) explained above.
  It can help you to format your the documentation and/or JS engine files
  automatically. Otherwise, we recommend using the Visual Studio Code and the
  [Rewrap](https://marketplace.visualstudio.com/items?itemName=stkb.rewrap)
  plugin to format the content of Markdown files.
- Push the changes to your fork of
  [dvc.org](https://github.com/iterative/dvc.org.git) and create a PR to the
  original repository.

We will review your PR as soon as possible. Thank you for contributing!

## Development environment

It's highly recommended to install the pre-commit hook that prettifies the files
for you automatically before you push them:

- Get the latest development version by
  [forking](https://help.github.com/en/articles/fork-a-repo) and cloning the
  repository from GitHub:

```dvc
$ git clone git@github.com:<username>/dvc.org.git
```

- Make sure you have Python 3.6 or higher installed. It will be required to run
  style checkers on pre-commit. On Mac OS, use `brew` to install the latest
  version of Python.

- We **strongly** recommend initializing a
  [virtual environment](https://virtualenv.pypa.io/en/latest/userguide/) before
  installing the required libraries for style checkers. Follow the instructions
  to create one:

```dvc
$ cd dvc.org
$ virtualenv --python python3 .env
$ source .env/bin/activate
```

- Install the style checker's requirements using
  `pip install -r requirements.txt`.

- Install coding style pre-commit hook with `pre-commit install`.
- Once the `pre-commit` hook is installed, you may deactivate the virtual
  environment by running `deactivate`.

It's highly recommended to run the Node.js docs app locally to test significant
changes to the docs before submitting them, and its very much needed in order to
make changes to the docs JavaScript engine itself (rare). To do so, please
follow the steps below:

- Make sure you have the latest version of [Node.js](https://nodejs.org/en/)
  installed. Install and keep the dependencies up to date by running
  `npm install` often.

- Start the development server using `npm run dev` which will start the server
  on the default port `3000`.

- Visit `http://localhost:3000/` and navigate to the docs in question.

## Code style guidelines

- **Markdown and JS files:** no trailing whitespaces are allowed.

- **Markdown and JS files:** content must be properly formatted at 80 symbols
  width. We recommend using Visual Studio Code and the
  [Rewrap](https://marketplace.visualstudio.com/items?itemName=stkb.rewrap)
  plugin to format the content of Markdown files or install the pre-commit hook
  described above.

- **Markdown:** we use `prettier` default conventions to format our files. It's
  highly recommended to install the hook or run `prettier` manually before
  submitting the pull request.

- Using `dvc <command>` in the documentation will create a link to that command
  automatically. No need to use `[]()` explicitly to create them.

- Syntax highlighting in fenced code blocks should use the `usage` and `dvc`
  custom languages:

- `usage` is employed to show `dvc help` commands output in each command
  reference doc.
- `dvc` can be used to show `.dvc` file contents, or examples of console
  commands and their output.

> Check out any of the command reference `.md` source code to get a better idea.


text:
# Contributing to Parsing

Thanks for your interest in contributing to `parsing`! We welcome new contributions regardless of your level of experience or familiarity with PureScript.

Every library in the Contributors organization shares a simple handbook that helps new contributors get started. With that in mind, please [read the short contributing guide on purescript-contrib/governance](https://github.com/purescript-contrib/governance/blob/main/contributing.md) before contributing to this library.

# Development

This package includes a `spago-dev.dhall` which provides the dependencies
for development and testing.

## Testing

To run the test suite:

```
spago -x spago-dev.dhall test
```

repository: purescript-contrib/purescript-parsing

gha_language: PureScript

repo_name: purescript-contrib/purescript-parsing


text:
# Trolli

=======

The Second Place Award winning submission for the Addihacks 2019 Hackathon. Trolli allows users to find public transit routes to their preferred destinations and leave comments that let other riders know if there are any delays, disturbances or route closures along the way.

=======

Disclaimer:

This application uses proprietary code which has been removed from this version. As such, I have only included samples of the full code.

repository: Vladieboy/Trolli

repo_name: Vladieboy/Trolli


text:
---
title: 'Statistics – Hunger & Homelessness In New York City'
author: Kerim
layout: post
permalink: /archives/2002/06/18/statistics-hunger-homelessness-in-new-york-city/
categories:
  - Old Blog Import
---

>   “# Each year 100,000 New Yorkers experience homelessness.
>
>
>     # Each night, nearly 32,000 homeless individuals sleep in the New York City shelter system. This includes more than 10,000 children and 8,000 single adults. Thousands more sleep on city streets and in other public places.
>
>
>
>     # Nearly 1-in-20 New York City residents have experienced homelessness.
>
>
>
>     # There are over 1,000 soup kitchens & food pantries in NYC and 2,700 in NY State serving 2 million New Yorkers annually. They will serve 60 million meals this year to hungry men, women & children. Everyday they turn away over 2,500 people.
>
>
>
>     # In the first six months of 2001, requests for help in soup kitchens and food pantries citywide rose by 71%. After September 11th, there was another 71% increase.
>
>
>
>     # Families make up 75% of New York City’s homeless shelter population.
>
>
>
>     # More than one-in-four children in NYC live in poverty. A typical homeless child is under 5 years old.
>
>
>
>     # Over half of homeless mothers in New York City have a history of domestic violence.
>
>
>
>     # Nearly one-in-five homeless parents were in foster care as a child.
>
>
>
>     # It is estimated that between 35% and 50% of homeless parents residing in the municipal shelter system have a chronic mental illness.
>
>
>
>     # Approximately 90% of homeless New Yorkers are Black or Latino.
>
>
>
>     # Almost 17% of residents of the single adult shelter system are employed.”
>

Statistics – Hunger & Homelessness In New York City

repository: kerim/keywords

repo_name: kerim/keywords


text:
---
layout: default
title:  "String Formatting"
date:   2017-03-03 16:36:42 -0500
category: "String Formatting"
tags: string formatting
published: false
---

# String Formatting (3.5)
The basis of this tutorial is the [.format()](https://docs.python.org/3/library/string.html#custom-string-formatting) function. It allows you to mix and match object types without having to explicitly call str(), rearrange positional and keyword arguments, and utilize various other features.

You can replace

```python
"Your name is " + first_name + " " + last_name + " and your age is " + str(age) + "."
```

with

```python
"Your name is {0} {1} and your age is {2}.".format(first_name, last_name, age)
```

### Table of contents
{:.no_toc}

* Table of contents placeholder
{:toc}

## General String Formatting

### Positional Arguments
If you are using positional arguments, inside of your string you replace your variables with **`{n}`**, where **`n`** is the position of the argument you want.

#### Usage
```python
print("First Argument: '{0}' Second Argument: '{1}'".format("I'm number 1!", ":( number two."))
```

#### Output
```
First Argument: 'I'm number 1!' Second Argument: ':( number two.'
```

### Keyword Arguments
#### Usage
If you pass in keyword arguments, you simply put **`{key}`**, where **`key`** is the keyword in **`.format()`**. Keywords are not positional, so the order of them does not matter.

```python
print("Name: '{name}' Age: '{age}'".format(age=45, name="Ron Paul"))
```

#### Output
```
Name: 'Ron Paul' Age: '45'
```

## String Formatting with an Array
Inside of our arguments, we can call the standard Python list slicing (**example**: **`list[0]`**).

#### Positional Arguments
#### Usage
```python
names = ["Ron", "Adam"]
ages = [45, 32]
print("{0[1]} is the second name and {1[0]} is the first age.".format(names, ages))
print("{0[1]} is the second age.".format(ages))
```

#### Output
```
Adam is the first name and 45 is the first age.
32 is the second age.
```

#### Keyword Arguments
#### Usage
```python
names = ["Ron", "Adam"]
print("{names[0]} is the first name.".format(names=names))
print("{names[1]} is the second name.".format(names=names))
```
#### Output
```
Ron is the first name.
Adam is the second name.
```

## String Formatting with a Dictionary

If you notice, this is the same idea of the Class formatting.
The `**` takes the dictionary keys and makes them in to keyword arguments for the [.format()](https://docs.python.org/3/library/string.html#custom-string-formatting) function.

#### Usage
```python
person = {
    "first_name": "Ron",
    "last_name": "Paul",
    "age": 45,
}
print("{first_name} {last_name} is {age} years old.".format(**person))
```
#### Output
```
Ron Paul is 45 years old.
```

## String Formatting with a Class
#### Class
```python
class Person(object):
    def __init__(self, first_name, last_name, age):
        super(Person, self).__init__()
        self.first_name = first_name
        self.last_name = last_name
        self.age = age
```

#### Usage
```python
u1 = Person("Ron", "Paul", 45)
print("{first_name} {last_name} is {age} years old.".format(**vars(u1)))
```

**`vars(u1)`** returns a dictionary of keys **`first_name`**, **`last_name`**, and **`age`** of our **`u1`** object.
** maps each of those keys and values to the appropriate key in our string using **`.format()`**.

#### Output
```
Ron Paul is 45 years old.
```

#### Usage
```python
u1 = Person("Ron", "Paul", 45)
u2 = Person("Adam", "Smith", 32)
print("{0.first_name} and {1.first_name} are friends.".format(u1, u2))
```

**`{0.first_name}`** is the equivalent of calling **`first_name`** on the **`0`**th argument.

#### Output
```
Ron and Adam are friends.
```