text:
# Storage cases

## Case 1: Simple storage

![Case 1](images/storage-case-1.png)

**AWS** (orange): Amazon Web Services Cloud

**VPC** (blue): Virtual Private Cloud - our own private space within our aws cloud. Makes data and everything inside secure from the outside.

**EBS** (Elastic Block Storage): Storage devices attached to the Servers

**EFS** (Elastic File System): NAS: Network Attached Storage. To share data between both servers.

Each server will have a EFS Mount Target to connect to EFS. Enables multiple servers to access one single data source.

---

If we want to migrate to a solution that allows us to upload objects too, and has an automated way of eventually migrating data to a lower cost /long term solution.

**S3**: we can store out objects on our buckets, and we can set up a lifecycle rule on that bucket so that when objects age they can be migrated over to **Glacier vault** for archiving. This way we will be using to lower cost storage.

S3 can not be located inside our VPC.

**VPC endpoint**: Allows traffic to flow from S3 storage to the VPC.

## Case 2: Hybrid Storage

![Case 2](images/storage-case-2.png)

On-site Storage in a corporate data center + S3 bucket with objects on AWS Cloud

Great for disaster recovery solutions:
- Provides high speed access to our data in a corporate data center
- We also are taking advantage of the availability and durability of AWS S3

Problem:
How to transfer PB of data stored on-site via the Internet to S3?

Solution:
1. Amazon can send a Snowball device that can store PB of data
2. We upload our data from our on-site storage to this device
3. We send this device back to Amazon
4. Amazon uploads our data directly to our bucket

After that we need to make sure that data from the data center and from S3 stays synced.

Solution:
AWS Storage Gateway orchestrates synchronization between storages:
Gets content frequently accessed, and stores copies of that inside the On-site Storage AND on S3

## Case 3: Database

![Case 3](images/storage-case-3.png)

We have an on-site Oracle RDBMS, and we want to migrate to Amazon Aurora.

1. Launch an RDS instance on our VPC
2. Use a database migration service to migrate the data

Problem: Our RDS becomes overwhelmed with requests for frequently accessed data, we would like a high speed way of accessing this data

Solution: ElastiCache: we can put an ElastiCache node in front of our RDS instance, and this will cache our frequently accessed data.
This delivers the data from memory with very low latency, and the load on our database will be massively reduced.
Every request that cannot be found on ElastiCache will be forwarded to the RDS instance.

repository: Mallik-G/AWS-Cloud-Practices

repo_name: Mallik-G/AWS-Cloud-Practices


text:
# feedzai Open Scoring Server (FOS)

FOS is machine learning model training and scoring server in Java.

[![Build Status](https://feedzaios.ci.cloudbees.com/buildStatus/icon?job=fos-core)](https://feedzaios.ci.cloudbees.com/job/fos-core/)

[![CloudbeesDevCloud](http://www.cloudbees.com/sites/default/files/Button-Built-on-CB-1.png)](http://www.cloudbees.com/dev)

## Why FOS

There are pretty good machine learning training and scoring frameworks/libraries out there, but they don't provide the
following benefits:

1. Common API: fos provides a common abstraction for model attributes, model training and model scoring. Using a [Weka]
based classifier will use have exactly the same API as using a R based classifier.
1. Scoring & Training as a remote service: Training and scoring can be farmed to dedicated servers in the network
enabling both vertical and horizontal scaling.
1. Import and Export models: A model could be trained in a development box and imported seamlessly into a remote server
1. Scalable and low latency scoring: Marshalling and Unmarshalling scoring requests/responses can be responsible
for a significant amount of overhead. Along with the slow RMI based interface, fos also supports scoring using [Kryo].

## Compiling FOS

You need:

1. [Java SDK]: Java 7
1. [Maven]: Tested with Maven 3
1. Access to maven central repo (or a local proxy)

After both the [Java SDK] and [Maven] are installed run the following command

`mvn clean install`

This should compile fos-core, ran all the tests and install all modules into your local maven repo.

# FOS Quickstart

## Running FOS

In order to start a FOS sever you need to create a bundle that contains both the core components and one or more fos backend implementations.

## Creating a FOS server bundle

To create a bundle type
`make package` on the `fos-core` project root. This will:

1. Build fos core
2. Copy all dependencies listed in `non-core-dependencies.xml` into fos-server lib directory (this includes the weka and R API implementations)
3. Create a tar.gz bundle with all the necessary code plus shell scripts to bootstrap the process. The file will be available as `fos-server/target/fos-server-bin.tar.gz`.

## Running FOS

1. Untar the server bundle on your install location. Let's assume FOS will be installed in the home dir

```
$ cd ~
$ tar xf <git clone dir>/fos-server/target/fos-server-bin.tar.gz
```

By now you should have a `fos-server` on your home.

```
$ cd fos-server
$ ~/fos-server $ ls
bin  conf  lib  LICENSE.txt  log  models  README.txt
```

Inside there are a couple directories:

1. `bin` with startup scripts
1. `conf` with FOS configuration scripts
1. `models` where trained models are going to be found

To start fos, run the bundled startup script `bin/startup.sh`

```
$ bin/startup.sh
03-Feb 04:28:31  INFO   com.feedzai.fos.server.Runner                  Starting fos server using configuration from conf/fos.properties
03-Feb 04:28:31  INFO   com.feedzai.fos.server.Runner                  FOS Server started in 272ms
```

We've just started a FOS server with [Weka] support built into the [fos-weka] fos module.
Currently FOS can only support an active module per runtime instance. The active server is
set in the `fos.factoryName` configuration option inside `conf/fos.properties` file:

```
# the fos implementation to launch
fos.factoryName=com.feedzai.fos.impl.weka.WekaManagerFactory
```
## Training and scoring my first model

We've prepared a couple [FOS samples]. Check them out

## Implementing a FOS Module

### Creating your own manager

fos-core does not provide any concrete implementation. However, a bundled fos server includes both a [fos-weka] (active by default) and a [fos-r] implementation. It is pretty easy to create a new implementation if you want to leverage existing code.

Your first step will be to understand [ManagerFactory] interface. A [ManagerFactory] should perform all the necessary boostrapping for a given [Manager] implementation, which must provide implementations for:

1. Model training
2. Model management (add, removal, import and export)
3. A [Scorer] implementation

Lets dissect a real example:

```java
public class WekaManagerFactory implements ManagerFactory {

    @Override
    public Manager createManager(FosConfig configuration) {
        WekaManagerConfig wekaManagerConfig = new WekaManagerConfig(configuration);
        return new WekaManager(wekaManagerConfig);
    }
}
```

The first step is parse [Manager] specific configuration parameters

```java
    WekaManagerConfig wekaManagerConfig = new WekaManagerConfig(configuration);
```

Now that we have specific config, we can create a new [WekaManager]:

```java
    return new WekaManager(wekaManagerConfig);
```

Most of the heavy lifting is done by [WekaManager] implementation. Since most of them are Weka specifc, it is not worthwhile to go into implementation details here. The following operations are performed:

1. Search for previously saved models and load their configuration.
1. Create a `fos-weka` [Scorer] implementation.
1. Start listening to requests via RMI and [Kryo].
1. Start a thread pool to allow parallel scoring.

### Implementing model training

In order to implement [model training], you need to supply the [model configuration] and training instances. You can see a practical example in [fos training sample].
A model configuration is composed by:

1. A set of key-value properties relevant from each implementation. We recomend to define all configuration options in a dedicated class (see [weka model configuration] for example).

2. An [attribute] list. The number of atributes in the training data must match the configuration attribute list. An attribute can be:
    1. [Numerical attribute]: Numeric attributes can be real or integer types.
    2. [Categorical attribute]: For attributes with a limited set of valid values.

You'll have to convert these FOS abstractions to a format your implementation understands.

There are multiple training entry points:

```java
 UUID trainAndAdd(ModelConfig config,List<Object[]> instances) throws FOSException;
```

`traindAndAdd`  must train a new classifier with the given configuration and using the given `instances`. It should return the serialized classifier and automatically make it avaiable for scoring

```java
 UUID trainAndAddFile(ModelConfig config,String path) throws FOSException;
```
`trainAndAddFile`  Same as above, but instances are read from a CSV file.

```java
Model train(ModelConfig config,List<Object[]> instances) throws FOSException;
```
`train` Trains a model and returns a Model. The Model implementation can be either a ModelBinary, which contains its serialized representation, or a ModelPMML, which contains a String with its representation in PMML. The model is not made available for scoring.

```java
Model trainFile(ModelConfig config, String path) throws FOSException;
```
`trainFile` same as above, but instances are read from a CSV file.

### Implementing model Scoring

Along with training models, the manager is also responsible for providing a [Scorer] implementation. There is a weka [weka scoring] example for reference.

### Managing models

[Kryo]: https://github.com/EsotericSoftware/kryo
[fos-r]: https://github.com/feedzai/fos-r
[fos-weka]: https://github.com/feedzai/fos-weka
[Weka]: http://www.cs.waikato.ac.nz/ml/weka/
[R]: http://www.r-project.org/
[Maven]: http://maven.apache.org/
[Java SDK]: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
[FOS samples]: https://github.com/feedzai/FosSample
[ManagerFactory]: https://github.com/feedzai/fos-core/blob/master/fos-api/src/main/java/com/feedzai/fos/api/ManagerFactory.java?source=cc
[Manager]: https://github.com/feedzai/fos-core/blob/master/fos-api/src/main/java/com/feedzai/fos/api/Manager.java?source=cc
[Scorer]: https://github.com/feedzai/fos-core/blob/master/fos-api/src/main/java/com/feedzai/fos/api/Scorer.java?source=cc
[WekaManager]: https://github.com/feedzai/fos-weka/blob/master/src/main/java/com/feedzai/fos/impl/weka/WekaManager.java?source=cc
[model training]: https://github.com/feedzai/fos-core/blob/master/fos-api/src/main/java/com/feedzai/fos/api/Manager.java?source=c#L120
[fos training sample]: https://github.com/feedzai/fos-sample/blob/master/src/main/java/com/feedzai/fos/samples/weka/WekaTraining.java#L65
[attribute]: https://github.com/feedzai/fos-core/blob/master/fos-api/src/main/java/com/feedzai/fos/api/Attribute.java?source=cc#L37
[Numerical attribute]: https://github.com/feedzai/fos-core/blob/master/fos-api/src/main/java/com/feedzai/fos/api/NumericAttribute.java?source=c#L32
[Categorical attribute]: https://github.com/feedzai/fos-core/blob/master/fos-api/src/main/java/com/feedzai/fos/api/CategoricalAttribute.java#L46
[model configuration]: https://github.com/feedzai/fos-core/blob/master/fos-api/src/main/java/com/feedzai/fos/api/ModelConfig.java?source=cc#L45
[weka model configuration]: https://github.com/feedzai/fos-weka/blob/master/src/main/java/com/feedzai/fos/impl/weka/config/WekaModelConfig.java?source=c#L45
[weka scoring]: https://github.com/feedzai/fos-sample/blob/master/src/main/java/com/feedzai/fos/samples/weka/WekaScoring.java#L45

repository: feedzai/fos-core

branch_name: refs/heads/master

extension: md

gha_language: Java

license_type: permissive

repo_name: feedzai/fos-core


text:
---
layout: post
title: Jekyll missing dependency: RedCloth
category: Github Pages
tags: [RedCloth, Jekyll]
---

What happened to my Jekyll ?

OK, I Surrender.

After establishing local environment of GitHub Pages, I forked the repository of [Tom Preston-Werner][] and built the project with Jekyll; but encountered one problem under the Windows 7 environment.

[Tom Preston-Werner]: https://github.com/mojombo/mojombo.github.io

The current ruby platform versions:

	ruby		2.0.0p598 [i386-mingw32]
	gem			2.0.14
	bundler		1.7.9
	RedCloth	4.2.9

<!--more-->

Always throw error, when build Jekyll and start server:

	You are missing a library required for Textile. Please run:
	  $ [sudo] gem install RedCloth
	  Conversion error: Jekyll::Converters::Textile encountered an error converting '_posts/2008-11-17-b
	logging-like-a-hacker.textile/#excerpt'.
	  Conversion error: Missing dependency: RedCloth
				 ERROR: YOUR SITE COULD NOT BE BUILT:
						------------------------------------
						Missing dependency: RedCloth

However, turn to Linux, use `RVM` to manage Ruby and run `jekyll build`, there is no error occurred indeed and it works well to parse `textile` file. This is very weird and still don't know why.

![Missing RedCloth]({{ site.picture_dir }}/jekyll-missing-dependency-redcloth/textile_error.png "Missing dependency: RedCloth")

Click [here](https://github.com/jekyll/jekyll/blob/00d29e7e7766b6cf8c81f21807a16bf7ec2d69df/lib/jekyll/converters/textile.rb "textile.rb Line: 16") to see the source code.

license: MIT


text:
# CAFA2

[![](https://img.shields.io/badge/license-MIT-blue.svg)]()
[![DOI](https://zenodo.org/badge/39267609.svg)](https://zenodo.org/badge/latestdoi/39267609)

MATLAB evaluation codes used for the 2nd [CAFA
challenge](http://biofunctionprediction.org/cafa/). The CAFA2
[paper](https://genomebiology.biomedcentral.com/articles/10.1186/s13059-016-1037-6)
is published in *Genome Biology*, and you can also find the latest *arXiv* version
[here](http://arxiv.org/abs/1601.00891).

## How to build baseline predictors

### *BLAST* predictor

#### Requirements
1. "Training" data

    * Sequences in **FASTA** format.

    * Annotations (MFO terms for exmaple) for each of these sequences. This data
      needs to be prepared ahead of time as a two-column **CSV** file (delimited
      by `TAB`)

      ```
      <sequence ID> <GO term ID>
      ```

      where `<sequence ID>` would be of any ID systems (e.g., UniProt accession
      number), as long as they are consistant with those used in the FASTA file.

  2. NCBI BLAST tool (used 2.2.29+ for this document)

  3. Query sequences in **FASTA** format.

#### Step-by-step
* ***STEP 1:*** Load annotations of training sequences.
    * Load ontology structure(s)

      Ontologies need to be load into a specific MATLAB structure which will be
      later used in evaluation. Here we provide two "adapters" for (i) OBO files or
      (ii) parsed plain-text files.

      1. Load OBO files

         ```matlab
         ont = pfp_ontbuild('ontology.obo');
         ```

         Note that a typical gene ontology OBO file contains all three GO
         ontologies (i.e., MFO, BPO, and CCO), therefore, `pfp_ontbuild` returns
         a cell of **THREE** ontology strcutures instead:

         ```matlab
         onts = pfp_ontbuild('go.obo');
         ```

         By default, they are ordered as BPO, CCO, MFO, alphabetically. You can
         also double check the `.ont_type` field of each returning structure.

      2. Load plain-text files

         If you have already parsed an ontology, you can also save its term
         description and structure into the following two files and then load them
         into the same MATLAB structure as if using `pfp_ontbuild`:

         ```matlab
         ont = pfp_loadont('terms.tsv', 'relationship.tsv');
         ```

         where `terms.tsv` is a two column file contains `<term ID>` and `<term
         description>`; `relationship.tsv` is a three column file contains `<term
         ID> <relationship> <term ID>`, (e.g., `GO:XXXXXXX is_a GO:YYYYYYY`). Both
         files are delimited by `TAB` and do not have header lines.

    * Load annotations onto the ontology structure(s)

      Once `ont` is created, you can load a list of sequence annotations using
      terms in this ontology.

      ```matlab
      oa = pfp_oabuild(ont, 'annotation.dat');
      ```

      where `annotation.dat` is a two column tab-delimited file having
      `<sequence ID> <term ID>` annotation pairs in each line.

* ***STEP 2:*** Prepare BLAST results
    * Run `blastp` on the query sequences against the "training" sequences by
      setting output format to be the following:

      ```bash
      blastp ... -outfmt "6 qseqid sseqid evalue length pident nident" -out blastp.out
      ```

    * Load the tabular output file (`blastp.out` as shown above) into MATLAB:

      ```matlab
      B = pfp_importblastp('blastp.out');
      ```

* ***STEP 3:*** Build the *BLAST* predictor

    Run the follow command in MATLAB to get a prediction structure:

    ```matlab
    blast = pfp_blast(qseqid, B, oa);
    ```

    where `qseqid` is a cell list of query sequences on which you need scores.
    Note that it can be just a subset of all those you BLAST'ed. `B` is the
    structure imported step 2, while `oa` is the ontology annotation structure
    loaded in step 1.

    Also, extra options can be specified as additional arguments so as to choose
    which feature you would like to use for creating BLAST predictions. By
    default, it used `sid`: sequence identity. See the documentation in
    `pfp_blast.m` for more details. Thus, `blast` will be the *BLAST* predictor in
    MATLAB for evaluation.

### *Naive* predictor

    To build a *naive* predictor, all you need is the ontology annotation
    structure `oa` that you have as in the step 1 of making a *BLAST* predictor.
    Then run the following in MATLAB:

    ```matlab
    naive = pfp_naive(qseqid, oa);
    ```

## How to evaluate your own predictions on CAFA2 benchmarks

    Evaluation codes are provided mainly for reproducing results in CAFA2
    experiments. However, one may also use a subset of codes under `matlab/` to
    evaluate their own protein function predictors.

### Prerequisites
* Represent protein sequences using CAFA2 target ID systems (e.g.,
  `T96060000019`). Please check `benchmark/` folders for lists of benchmark
  proteins that needs to be covered.

* Save predictions in CAFA2 submission format according to [CAFA
  rule](https://www.synapse.org/#!Synapse:syn5840147/wiki/402192). Although,
  headers (including `AUTHOR`, `MODEL`, `KEYWORDS` and `ACCURACY`) and footer
  (`END`) are optional. (See `cafa_import.m` for details)

### Quick guide
1. Load ontologies into MATLAB structures.
    * You can use pre-built MATLAB structure for the same ontologies used in
      CAFA2 evaluation, which are located as `*.mat` files under `ontology/`
      folder.

    * We also provide functions for loading user specified ontologies, see
      `pfp_ontbuild.m`. Note that it is suggested to use pre-built ontologies in
      order to compare results against published methods.

2. Prepare ground-truth annotations.
    * Similarly, ground-truth annotations for CAFA2 `3681` benchmark proteins
      are pre-built and saved as `*.mat*` files under `benchmark/groundtruth/`.

    * User specified annotations can be built using `pfp_oabuild.m`, note that
      proteins have to use the same ID system as used for predictions. Also, see
      the comments for input arguments in `pfp_oabuild.m` for details.

      ```matlab
      oa = pfp_oabuild(ont, <annotation file>);
      ```

3. Load predictions into MATLAB structures.

    This can be done by execute the following command in MATALB:

    ```matlab
    pred = cafa_import(<prediction file>, ont, false);
    ```

    with the 2nd argument `ont` as the ontology structure built in the first
    step. We specify the 3rd argument to be `false` indicating our `<prediction
    file>` don't contain headers and footer.

4. Load benchmark protein IDs.
    * Protein IDs must be loaded as a `cell` array. You can use the following
      function:

      ```matlab
      benchmark = pfp_loaditem(<benchmark list file>, 'char');
      ```

    * Various CAFA2 benchmark protein lists are prepared under
      `benchmark/lists/`, load any one that meets your requirement.

5. Evaluation. (sequence-centered)
    * The easiest way to get an performance evaluation is to use the following
      function (in the case of **F-max**):

      ```matlab
      fmax = pfp_seqmetric(benchmark, pred, oa, 'fmax');
      ```

      See `pfp_seqmetric.m` for other metrics.
    * Alternatively, you can compute confusion matrix so as to expose
      intermediate variables:
      * Make a confusion matrix structure

        ```matlab
        cm = pfp_seqcm(benchmark, pred, oa);
        ```

      * Convert the `cm` structure to metrics of interest, here
        "precision-recall" `seq_pr.metric` would have 101 precision-recall pairs
        corresponding to 101 thresholds from `0.00` up to `1.00` with step size
        `0.01`.  You can use it to draw a PR curve.

        ```matlab
        seq_pr = pfp_convcmstruct(cm, 'pr');
        ```

## How to "replicate" CAFA2 evaluation experiment

### Caveat
    Due to CAFA rules, the organizers of CAFA cannot release the submitted
    predictions from participants. Therefore, it is technically not possible to
    replicate exact results (figures and tables) in the CAFA2 paper. Also, this
    repository is not originally designed to be a software that is reusable as a
    whole for protein function prediction tasks in general or even for future
    CAFA challenges. As a result, the pipeline is not fully automatized and
    manual input is necessary occasionally.

    Please also notice that this pipeline is only tested on Linux version of
    MATLAB (2016b), it is not guaranteed to work on other OS (code might have to
    be adapted accordingly). We also used Bioinformatics toolbox for topological
    ordering of ontology terms (`graphtopoorder`) in some Matlab functions.
    However, it should be fairly easy to implement your own version if this
    toolbox is not available.

    With that being said, we provide scripts along with a minialist guideline to
    assist researchers who would like to evaluate their own methods using CAFA2
    benchmarks (along with their annotations by the time stated in the paper) so
    as to compare their performances against CAFA2 baselines and possibly
    against other methods.

### Step-by-step
1. Download this repository to your local filesystem, say `/path/to/cafa2_repo`,
   hereafter `<cafa2repo>`.

2. Prepare an empty folder that have write permission, say
   `/path/to/another/folder`, hereafter, `<mydir>`, for holding evaluation
    results.

3. In Matlab, change working directory to `<cafa2repo>/matlab` and setup
   `<mydir>`:

    ```matlab
    cd <cafa2repo>/matlab;
    cafa_setup('<cafa2repo>', '<mydir>');
    ```

    This command sets up empty folders inside `<mydir>` where intermediate/final
    results will sit.

4. Place your plain-text prediction file into `<mydir>`.

    Note that prediction files should be using CAFA format: `<target ID> <term
    ID> <score>` for each line but without HEADER (those lines start with
    `MODEL`, `AUTHOR`, `KEYWORDS` etc.) or FOOTER (the `END` line). Filename is
    suppose to be `M001` (`M` followed by three digits) and `M002`, `M003` so on
    so forth if you have more than one methods to be evaluated. Then copy/move
    them into `<mydir>/consolidated`.

5. Filter predictions. This step will filter out predictions on proteins that
   are not in any benchmarks, which could greatly reduce the size of
   intermediate files and processing speed. In Matlab

    ```matlab
    cafa_driver_filter('<mydir>/consolidated', '<mydir>/filtered', '<cafa2repo>/benchmark/lists/xxo_all_typex.txt');
    ```

6. Import plain-text predictions into Matlab structures, so that they can be
   reused for different evaluation tasks (e.g., different metrics, different
   benchmarks, etc.) Let's use MFO as an example:

    ```matlab
    load <cafa2repo>/ontology/MFO.mat;
    cafa_driver_import('<mydir>/filtered', '<mydir>/prediction/mfo', MFO);
    ```

    **Notice that up until now, these steps only need to be executed once. Each
    following particular evaluation tasks is specified using a single plain-text
    job configuration file**

7. Make a job configuration file according to your needs, please use the example
   file: `<cafa2repo>/config/example.job` as a template. Basically, you need to
   change <cafa2repo> and <mydir> accordingly; specify what metric you are
   using, which evaluation mode, etc. And save the modified configuration file
   at `/path/to/config.job>`, hereafter, `<config>`.

8. Pre-evaluation. This step is essential for sequence-centric evaluations so as
   to avoid repeated calculations. It evaluates/stores metrics (e.g.,
   precision/recall) for each protein to `<mydir>/seq-centric`.

   Note that if you have multiple benchark lists on which you want to evaluate,
   it is suggested to create a union of all those lists and to do a
   pre-evaluation on the union just once.

    ```matlab
    cafa_driver_preeval('<config>');
    ```

9. Evaluation. This step performs the actual evaluation, and the runtime depends
   on how many methods/metrics you specified in the configuration. If the number
   of methods exceeds 8, it will start in parallel mode. Note that all results will
   be saved into a subfolder under `<mydir>/evaluation/<subfolder>`, it will be
   named after `<ontology>_<category>_<type>_<mode>`, let's simply call it
   `<eval_res>`.

    ```matlab
    cafa_driver_eval('<config>');
    ```

10. Make a register table file according to your needs, please use the example
    file: `<cafa2repo>/config/register.tab` as a template. You can also look at
    the comments in `<cafa2repo>/matlab/cafa_parse_register.m` for reference. We
    would assume the modified file will be saved somewhere and be refered to as
    `<register>`.

11. Collect results. This step should output figures and tables in `<eval_res>`
    folder.

    ```matlab
    cafa_driver_result('<eval_res>', '<register>', 'BN4S', 'BB4S', 'all');
    ```

    **As a final note, please refer to the comments part in each Maltab function
    for detailed input/output descriptions. They can be accessed by typing `help
    <function name>` in Matlab console.**

# License

    The source code used in this CAFA2 evaluation package is licensed under the
    MIT license.


text:
# Note Refactor

![GitHub Workflow Status](https://img.shields.io/github/workflow/status/lynchjames/note-refactor-obsidian/Release%20Build?logo=github&style=for-the-badge) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/lynchjames/note-refactor-obsidian?style=for-the-badge&sort=semver)

This repository contains a plugin for [Obsidian](https://obsidian.md/) for extracting the selected portion of a notes into new note.

The default hotkeys are:

| Hotkey                                                                   | Action                           |
| ------------------------------------------------------------------------ | -------------------------------- |
| Ctrl/Cmd + Shift + N                    | **Extract selection to new note - first line as filename:** Copy selection into new note with the first line as the file name and replace with a link.                 |
| Ctrl/Cmd + Shift + C                    | **Extract selection to new note - content only:** Copy selection into new note, prompt for a file name and replace with a link.                 |

>:warning: Hotkey defaults are deliberately not set for note splitting commands to avoid unwanted accidents.

The new note file is created at the root of the vault with the filename as the first line of the selected text and the content as the rest of the selected text.

Heading characters (`#`) and other illegal characters for filenames are removed including `:`, `\`, `/`.

## Usage

This table shows the different use cases for this plugin and how commands and settings can be used in each case.

### Extracting

| | Use case                                                      | Command                          | Plugin Settings                         |
| --- | --- | --- | --- |
| 1 | 1. Extract a selection into a new note exactly as it is.
2. File name for new note provided by the user. | Extract selection to new note - content only | **Include Heading**
False |
| 2 | 1. Extract a selection into a new note exactly as it is.
2. File name for new note set from the first line of the selection | Extract selection to new note - first line as file name | **Exclude First Line**
False

**Include Heading**
False |
| 3 | 1. Extract a selection into a new note.
2. File name for new note set from the first line of the selection.
3. First line included in the new note as a heading. | Extract selection to new note - first line as file name | **Exclude First Line**
False

**Include Heading**
True |
| 4 | 1. Extract a selection into a new note
2. File name for new note set from the first line of the selection.
3. First line not included in the new note. | Extract selection to new note - first line as file name | **Exclude First Line**
True

 |
| 5 | 1. Extract a selection into a new note exactly as it is.
2. File name for new note is generated from the **File name prefix** setting. | Extract selection to new note - only prefix as file name | |

### Splitting

| | Use case                                                      | Command                          | Plugin Settings                         |
| --- | --- | --- | --- |
| 1 | 1. Split a note from the current line of the cursor into new note exactly as it is.
2. File name for new note provided by the user. | Split note here - content only | **Include Heading**
False |
| 2 | 1. Split a note from the current line of the cursor into new note.
2. File name for new note provided by the user.
3. First line included in the new note as a heading. | Split note here - content only | **Include Heading**
True |
| 3 | 1. Split a note from the current line of the cursor into new note exactly as it is.
2. File name for new note set from the first line of the selection. | Split note here - first line as file name | **Include Heading**
False |
| 4 | 1. Split a note from the current line of the cursor into a new note.
2. File name for new note set from the first line of the selection.
3. First line included in the new note as a heading. | Split note here - first line as file name | **Exclude First Line**
False

**Include Heading**
True |
| 5 | 1. Split a note with content under a heading going into a new note for each heading.
2. File name for each new note set from the heading. | Split note by headings - H1

 Split note by headings - H2

 Split note by headings - H3 |  |

## Commands

### Note Splitting

Splitting the current note from the current line into a new note or append to an existing one.

#### Split note here - current line as note file name

This command splits the current note into a new note from the current line using the current line as the file name for the new note.

#### Split note here - content only

This command splits the current note into a new note, or append to an existing one, from the current line. The user is prompted to enter a file name for the new note.

#### Split note by headings - H1, H2, H3

This command splits the current note into a new note for every heading at the level selected (H1, H2 or H3) using the heading as the file name for each new note.

![split by headings demo](https://raw.githubusercontent.com/lynchjames/note-refactor-obsidian/master/images/Note-Refactor-Demo-Split-by-Headings.gif)

### Extract Selection

Extracting the current selection into a new note or append to an existing one.

#### Extract selection to new note or append to existing note - first line as filename

This command copies the selected text into the content of a new note using the first line as the file name for the new note or append to an existing one.
![first line file name demo](https://raw.githubusercontent.com/lynchjames/note-refactor-obsidian/master/images/Note-Refactor-Demo-First-Line-as-File-Name.gif)

#### Extract selection to new note or append to existing note - content only

This command only copies the selected text into the content of a new note or append to an existing one. The user is prompted to enter a file name for the new note.

![content only demo](https://raw.githubusercontent.com/lynchjames/note-refactor-obsidian/master/images/Note-Refactor-Demo-Content-Only.gif)

#### Extract selection to new note - prefix only as file name

This command only copies the selected text into the content of a new note or append to an existing one. The filename is automatically generated based on the value of **File name prefix** setting. New note is created silently and will not be shown in a new pane.

## Configuration

![plugin settings](https://raw.githubusercontent.com/lynchjames/note-refactor-obsidian/master/images/plugin-settings.png)

### Default location for new notes

The location for new notes to be saved as a plugin config setting in line with the Obsidian core `Default location for new notes` setting.

3 options available:

1. Vault folder
1. Same folder as current file
1. Specified folder

The specified folder option allows you to specify a folder path for new notes which can include multiple datetime formats.

**Example**

A folder path set as `Zettels/{{date:YYYY}}/{{date:MMMM}}` will add a new file to the following folder structure:

- [Vault]
  - Zettels
    - 2020
      - October

### File Name Prefix
The file name prefix option allows you to specify a prefix for new notes which can include multiple datetime formats.

**Example**

A prefix set as `{{date:YYYYMMDDHHmm}}-` will add a new file with the following file name:

`202010311425-My New Note`

### Transclude by Default

This config settings means that all inserted internal links to new notes created by any of the extraction or note splitting commands will be added as a transclusion/note embed `![[new note]]` rather than a link `[[new note]]`.

### First Line included as Note Heading

This config setting allows for the first line of the selected text to be included in the new note content as a heading with a configurable heading format `#`, `##`, `###`, etc.

This setting is applied for either the First Line filename or Content Only commands.
![note heading demo](https://raw.githubusercontent.com/lynchjames/note-refactor-obsidian/master/images/Note-Refactor-Demo-Include-First-Line-as-Note-Heading.gif)

### Note Link Template

This setting sets the template used to generate the content to link to the extracted note. This overrides the Transclude by Default setting.

The following placeholders are supported and will be replaced with dynamic values when the plugin command is exectuted:

- `{{date}}` the current date, this also supports date and time formats such as `YYYYMMDD` and `HH:mm`.
- `{{title}}` the title of the original note.
- `{{new_note_title}}` the title of the new note.
- `{{new_note_content}}` the refactored content for the new note.

### Refactored Note Template

This setting sets the template used to generate the content for the refactored note.

The following placeholders are supported and will be replaced with dynamic values when the plugin command is exectuted:

- `{{date}}` the current date, this also supports date and time formats such as `YYYYMMDD` and `HH:mm`.
- `{{title}}` the title of the original note.
- `{{new_note_title}}` the title of the new note.
- `{{new_note_content}}` the refactored content for the new note.

## Compatibility

Custom plugins are only available for Obsidian v0.9.7+.

The current API of this repo targets Obsidian **v0.9.10**.

## Installing

As of version [0.9.7 of Obsidian](https://forum.obsidian.md/t/obsidian-release-v0-9-7-insider-build/7628), this plugin is available to be installed directly from within the app. The plugin can be found in the Community Plugins directory which can be accessed from the Settings pane under Third Party Plugins.

## Manual installation

1. Download the [latest release](https://github.com/lynchjames/note-refactor-obsidian/releases/latest)
1. Extract the note-refactor-obsidian folder from the zip to your vault's plugins folder: `<vault>/.obsidian/plugins/`
Note: On some machines the `.obsidian` folder may be hidden. On MacOS you should be able to press `Command+Shift+Dot` to show the folder in Finder.
1. Reload Obsidian
1. If prompted about Safe Mode, you can disable safe mode and enable the plugin.

A check is done to avoid overwriting of existing files but...

    💥 PLEASE TRY IN A TEST VAULT FIRST..AND MAKE SURE TO BACKUP! 💥

## Credits

Credit to [MrJackphil](https://github.com/mrjackphil), this plugin is based on [the code snippet](https://forum.obsidian.md/t/code-snippet-extract-note/6698) he created.

## For developers
Pull requests are both weclcome and appreciated. 😀

If you would like to contribute to the development of this plugin, please follow the guidelines provided in [CONTRIBUTING.md](CONTRIBUTING.md).

## Donating

This plugin is provided free of charge. If you would like to donate something to me, you can via [PayPal](https://paypal.me/lynchjames2020). Thank you!

repository: eryajf/note-refactor-obsidian

branch_name: refs/heads/main

repo_name: eryajf/note-refactor-obsidian


text:
# 746. Min Cost Climbing Stairs (Easy)

You are given an integer array `cost` where `cost[i]` is the cost of ith step on a staircase. Once you pay the cost, you can either climb one or two steps.

You can either start from the step with index 0, or the step with index 1.

Return the minimum cost to reach the top of the floor.

### Example 1:

```
Input: cost = [10, 15, 20]
Output: 15
Explanation: Cheapest is start on cost[1], pay that cost and go to the top.
```

### Example 2:

```
Input: cost = [1, 100, 1, 1, 1, 100, 1, 1, 100, 1]
Output: 6
Explanation: Cheapest is start on cost[0], and only step on 1s, skipping cost[3].
```

### Constraints:

- 2 <= cost.length <= 1000
- 0 <= cost[i] <= 999

## Solution

We need a DP array align with the cost array, dp[i] represents the accumlated min cost if step i is stepped on and its cost is paid.

dp[i] = cost[i] + min(dp[i-1], dp[i-2])

The min cost of topping staircase up to step i, is the min of dp[i] and dp[i-1], meaning the last step is either stepping on i and then one more step, or stepping on i-1, and then two steps, whichever costs less.

e.g.
cost: [1, 100, 1, 1, 1, 100, 1, 1, 100, 1]
dp: [1, 100, 2, 3, 3, 103, 4, 5, 104, 6]

#AMZN

gha_language: JavaScript

gha_license_id: MIT


text:
New feature requests are very welcome!

If submitting a build issue please provide:
 1. Build log from https://jitpack.io
 2. Does the project build on your machine?

Thank you!


text:
# OCI Request Signature Insomnia Plugin

[![CodeQL](https://github.com/scottharwell/insomnia-plugin-oci-auth/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/scottharwell/insomnia-plugin-oci-auth/actions/workflows/codeql-analysis.yml) [![CI](https://github.com/scottharwell/insomnia-plugin-oci-auth/actions/workflows/ci.yml/badge.svg)](https://github.com/scottharwell/insomnia-plugin-oci-auth/actions/workflows/ci.yml)

This plugin will [generate a signature](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/signingrequests.htm) for the `Authorization` header in Oracle Cloud Infrastructure REST API requests.

## Pre-Requisites

- The [Insomnia REST](https://insomnia.rest) client.

## Installation

### Insomnia Plugin Manager

1. Open Insomnia
2. Open the application preferences
3. Enter `insomnia-plugin-oci-auth` and click "install plugin"

![Plugin Installation](assets/../assets/img/install_plugin.jpg)

4. Close the plugins dialog

### Manual Installation

1. Navigate to the plugins directory on your machine
2. Clone this repository into the directory
3. Open the Makefile and update the `extensions_dir` variable with the path to the Insomnia extensions directory on your system.
4. Run `make install` from your shell.
5. In Insomnia's menu, click `Tools` > `Reload Plugins`

## Usage

The plugin should always be used as a tag template for the `Authorization` header in a request to an OCI REST endpoint.  The plugin requires the same inputs as the OCI CLI or other tools that leverage OCI REST APIs.  You will only be able to make requests to endpoints that your user account has permissions to access.

![Headers](assets/img/authorization_header.jpg)

- OCI Tenancy ID
- OCI User ID
- The fingerprint of the public key associated with your OCI user id
- The path on your local system to the private key that is associated with the public key in the previous step
  - This must be an absolute path to the location of the key and the key must be readable by your user account

![Form](assets/img/edit_tag_empty.jpg)

These entries can be set via environment variables so that you can control settings for different accounts, tenancies, or compartments.

![Form Env Vars](assets/img/edit_tag_env_vars.jpg)

You may set `date` or `x-date` headers within the request, but the extension will do this automatically for you so it is ok to omit them.  Also, the extension will calculate the `x-content-sha256` header and apply it to `POST`, `PATCH`, and `PUT` requests as required by the signature requirements.  So, this should be the only header that you need to use for generating the OCI signature.  The signature is generated at request-time, so you will not see a preview of the signature in the plugin configuration window.

## Future Improvements

- Add different language support for text output.
- Properly type Insomnia objects.

repository: scottharwell/insomnia-plugin-oci-auth

repo_name: scottharwell/insomnia-plugin-oci-auth


text:
---
title: 'Vagrant - portable development environment'
date: 2013-07-02T11:54:35+00:00
author: Janik von Rotz
slug: vagrant-portable-development-environment
images:
  - /wp-content/uploads/2013/07/vagrant-logo.png
categories:
  - Continuous delivery
tags:
  - code
  - machine
  - portable
  - vagrant
  - virtual
---
Today almost every coder uses git or another vcs and a related service like github for code hosting.

As a front end designer twitters bower is the right tool to manage your libary dependencies.

And for the backend developer the npm package manager is always on board.

Those tools have changed the way of developing websites and webapplication.

They've increased productivity and the flexibilty for your application.

So far, there's only one part lagging behind: It's the development environment.

And yes, also for this part exists a solution. I'm talking about vagrant

It is the lost child in my development workflow, it's the perfect supplement.

With vagrant and vm provider of your choice (virtualbox, vmware or amazon so far) you're abble to setup a portable and reproducible development environment. Vargant installs a virtual machine based on virtual appliance, by default vargant syncs your folder with the virtual machines default directory. With this setup you are able to run your code in virtual machine but still code your stuff as it appeals to you on your local host.

Well, that looks interesting, where should I start? For newbies the offical documentation should be fine: https://docs.vagrantup.com/v2/getting-started/index.html

Follow step by step and you'll run a virtual linux appliance with an apache preinstalled.


text:
# 1. Structure of Classes Beyond Standard RailsMVC

Date: 2019-02-07

## Status

Accepted

## Context

There are many ways to structure classes beyond the standard rails Model View Controller (MVC) structure, therefore to help make the project maintainable in the future we have come up with the following standards.

## Decision

* Avoid Helpers
  * The rational behind this decision is standard rails helpers are hard to test efficiently and are global so they can have unintended consequences.

* Use a Decorators directory `app/decorators`
  * Decorators should be used for read only operations that modify the data for viewing purposes.

* Use a ChangeSet directory `app/change_sets`
  * ChangeSet should be used for reformatting the data for purposes of showing it to user/system for modification.
  * We have kept the change set concept since these classes can also be useful for data import not just user facing formats.

* Use a Services directory `app/services`
  * Services should be used for encapsulating complex actions or actions that work across multiple models, like seeding or importing bulk data. These may change the underlying data structures.

* Use a Mailer directory `app/mailer`
  * Notifications will be put in the mailer directory so that we can stick with the standard defined by ActionMailer

### Possible Future needs

We currently believe that the business logic operations that are required for the system will be small enough to live directly on their primary model.  If in the future the models become too bloated we recommend creating a BusinessRules directory `app/business_rules`. BusinessRules would be a corollary to Services, for complex or model-spanning read-only logic.

## Consequences

* This organization makes sense to us, but it's a little different from Rails standard, and a little more like Figgy
* Developers who are familiar with these patterns will understand the division and patterns being used
* Developers who aren't familiar with change_sets or services might take more time to find the code we are separating out.

repository: pulibrary/approvals

gha_language: Ruby

gha_license_id: NOASSERTION

repo_name: pulibrary/approvals


text:
Contributions are very welcome. Please make sure there is a github issue
associated with with every pull request. Creating an issue is also a good
way to propose new features.

# Installation for development

Please follow the installation instructions on
[readthedocs](https://satsense.readthedocs.io/en/latest/installation.html)
to get started.

# Testing

Please add unit tests for the code you are writing (e.g. when fixing a bug, implement
a test that demonstrates the bug is fixed). You can run the unit tests locally
with the command
```python
python setup.py test
```

# Coding style

Please make sure your code is formatted according to
[PEP8](https://www.python.org/dev/peps/pep-0008/) and docstrings are written
according to [PEP257](https://www.python.org/dev/peps/pep-0257/). Publicly visible
functions should have
[numpy style docstrings](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html).

Please autoformat your code with the following commands before making a pull request:
```bash
isort satsense/my_file.py
yapf -i satsense/my_file.py
```

# Documentation

All public functions should have [numpy style docstrings](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html).
You can build the documentation locally by running
```bash
python setup.py build_sphinx
```
Use
```bash
python setup.py build_sphinx -Ea
```
to build everying from scratch. Please check that there are no warnings.

repository: prakharcode/satsense

repo_name: prakharcode/satsense


text:
---
author: admin
authors: []
categories: []
date: "2008-01-01"
featured: false
image:
  caption: ""
  focal_point: ""
  preview_only: false
lastmod: "2019-10-19T21:04:23+02:00"
projects: []
slug: hawking-radiation
subtitle: ""
summary: ""
tags:
- old_wiki
- physics
title: Hawking radiation
---
From calculations of quantum tunneling through the horizon of a metric (black hole, Rindler..) Hawking/Unruh temperature can be calculated!

 * [http://arxiv.org/abs/arXiv:0710.0612 Ryan Kerner: Fermions Tunnelling from Black Holes] _

Using this method it is recently claimed that the so called [Black hole information paradox](http://en.wikipedia.org/wiki/Black_hole_information_paradox) can be solved:

* [Zhang et al. (2009): Hidden Messenger Revealed in Hawking Radiation: a Resolution to the Paradox of Black Hole Information Loss](http://arxiv.org/abs/0903.0893)
The answer is, that the information that seems to be lost when matter falls into a black hole is in fact completely carried away by Hawking radiation. So in the whole process no information is lost.

repository: asmaier/homepage

repo_name: asmaier/homepage


text:
---
title: week 12
layout: post
author: hugo.ricketts
permalink: /week-12/
source-id: 1OunZZtZ94A7ALpKynpBTxKNtFNL2Zrghxar_ZlcMB98
published: true
---

    Title:
    Ascii table
     Date:

    Starting point:
    Done some research on binary.

    Target for this lesson?
    Make an ascii table using websites

    Did I reach my target?
(add details to "Lesson Review")
    yes

    Lesson Review

    How did I learn? What strategies were effective?

    I looked up the ascii table for help which also explained how it worked.
I also used my ascii table for my DEC to BIN converter.

    What limited my learning? Which habits do I need to work on?

    Rely less on help from the teacher.

    What will I change for next time? How will I improve my learning?

    THis ascii table will help with next week's work.


text:
# arc-watch
Checks and fixes ARC coin nodes with status EXPIRED or NEW_START_REQUIRED.

## Requirements
* Python package: prettytable
* ARC wallet with masternodes configuration and RPC enabled
* Binaries of ARC client installed on system with script (here are binaries: https://github.com/ArcticCore/arcticcoin/releases/download/v0.13.0/arc-0.13.0-linux64.tar.gz)
* Ansible

## Installation
To use script simply clone repository:

```bash
pip install prettytable
cd /opt
git clone https://github.com/qf3l3k/arc-watch
```

## Configuration
Configuration details for script to run are located in:
```bash
/opt/arc-watch/modules/config.py
```
Make sure you have all data correct in config file, so script will run without errors.

## Usage

* Check configuration in ```bash /opt/arc-watch/modules/config.py``` and make sure all data is relevant to your environment
* Run script to initiate tmix session and start arc-watch:
    ```bash
    cd /opt/arc-watch/tmux
    ./tmux_arc_watch.sh
    ```
* Alternatively run script manually:
    ```bash
    cd /opt/arc-watch
    python arc_watch.py -d # displays dashboard with nodes
    python arc_watch.py -f # runs fixing process for faulty nodes
    ```


text:
# PomoGo

> Pomodoro timer app with tracking and statistics. - WIP

## Overview

PomoGo is a cross platform Pomodoro timer written in Go. The idea is to build something simple and lightweight thatmeets
the [Open Pomodoro spec](https://github.com/open-pomodoro/open-pomodoro-format). Possibly containing data tracking,
statistics and integration (e.g Beeminder) in the future.

## Features

- Timer

## Installation

### Downloads

Download the latest version from the [releases page](https://github.com/KyteProject/pomogohard/releases).

PomoGo is available for Windows, macOS, and Linux.

## Roadmap

* Make it work

## Development

PomoGo is built using [Wails](https://wails.app/) and uses Svelte on the frontend and Go on the backend.

Take the following steps to develop locally:

1. Clone the repo
2. Install Wails
3. Install go and npm dependencies

## License

MIT © 2020 [Daniel Smith](https://github.com/KyteProject)

## Credits

* [Open Pomodoro spec](https://github.com/open-pomodoro/open-pomodoro-format)
* [Pomodoro Technique](https://en.wikipedia.org/wiki/Pomodoro_Technique)
* [Wails](https://wails.app/)

repository: KyteProject/PomoGo

repo_name: KyteProject/PomoGo


text:
# 🖼 Optimize Image Service

macOS service to optimize the file size of JPG and PNG images

## Description 📚

You need [Homebrew](https://brew.sh) installed. Then, use it to install `jpegoptim` and `optipng`.

    $ brew install jpegoptim optipng

## Uninstall 😖

If you're unhappy with this service, remove it from your `~/Library/Services` directory:

    $ rm -rf ~/Library/Services/Optimize\ Image.workflow

Please let me know what you didn't like!

repository: otherguy/optimize-image-service

gha_language: Shell

repo_name: otherguy/optimize-image-service


text:
---
title: Remove-PASDirectory
---

## SYNOPSIS

Removes an LDAP directory configured in the Vault

## SYNTAX

    Remove-PASDirectory [-id] <String>

## DESCRIPTION

Removes an LDAP directory configuration from the vault.

Membership of the Vault Admins group required.

## PARAMETERS

    -id <String>
        The ID or Name of the directory to return information on.

        Required?                    true
        Position?                    1
        Default value
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false

    -WhatIf [<SwitchParameter>]

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -Confirm [<SwitchParameter>]

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).

## EXAMPLES

    -------------------------- EXAMPLE 1 --------------------------

    PS C:\>Remove-PASDirectory -id LDAPDirectory

    Removes LDAP directory configured in the Vault


text:
# S3 Artifact Resource

[![Build Status](https://travis-ci.org/cosee-concourse/s3-artifact-resource.svg?branch=master)](https://travis-ci.org/cosee-concourse/s3-artifact-resource) [![Docker Repository on Quay](https://quay.io/repository/cosee-concourse/s3-artifact-resource/status "Docker Repository on Quay")](https://quay.io/repository/cosee-concourse/s3-artifact-resource)

Compresses artifacts and archives them compressed in an S3 bucket

## Source Configuration

* `bucket`: *Required.* The name of the S3 bucket.

* `access_key_id`: *Required.* The AWS access key to use when accessing the
  bucket.

* `secret_access_key`: *Required.* The AWS secret key to use when accessing
  the bucket.

* `region_name`: *Required.* The region the bucket is in.

* `filename`: *Required* Prefix of the filename to be used for the compressed file in the S3 bucket.
  At the moment folders are not supported.
  It should be without version and data extension because they are added at `out`. To version the files, the `semver` resource
  is required. The final filename (key) in the S3 bucket is:
 `filename` `version`.tar.gz

## Behavior

### `check`: Extract versions of the archives from the bucket.

The compressed files are found with the `filename`. The versions in the file names
will be used to order them (using [semver](http://semver.org/)). Each
object's filename is the resulting version of the resource.

### `in`: Fetches artifacts from the bucket.

* Uncompresses and places files to destination. Uses gzip as compression.

#### Parameters

*None.*

### `out`: Upload artifacts as archive to the bucket.

Given a folder specified by `folderpath` (this must be available to the resource - for example created by a task that is run before the
put request), compresses folder contents and uploads compressed archive to the S3 bucket.
Reads semantic version created by the `semver` resource specified as filepath `version` to generate the versioned name.

#### Parameters

* `version`: *Required* File path to `semver` version file

* `folderpath`: *Required* Path to folder that contains artifacts

## Example Configuration

### Resource Type
``` yaml
- name: s3-artifact
  type: docker-image
  source:
    repository: quay.io/cosee-concourse/s3-artifact-resource
```
### Resource

``` yaml
- name: artifacts
  type: s3-artifact
  source:
    bucket: artifacts
    filename: release-
    access_key_id: ACCESS-KEY
    secret_access_key: SECRET
    region_name: eu-west-1
```

### Plan

``` yaml
- get: artifacts
```

``` yaml
- put: artifacts
  params:
    version: version/number
    folderpath: artifacts/
```

## Required IAM Permissions

* `s3:PutObject`
* `s3:GetObject`
* `s3:ListBucket`
* `s3:ListAllMyBuckets`

gha_language: Python


text:
# Requirements
- sqlalchemy
- ip2c

# Installation
```
# git clone git@github.com:spring/uberserver.git
# virtualenv ~/virtenvs/uberserver
# source ~/virtenvs/uberserver/bin/activate
# pip install pycrypto
# pip install SQLAlchemy
```

Without further configuration this will create a SQLite database (server.db).
Performance will be OK for testing and small setups. For production use,
setup MySQL/PostgreSQL/etc.

# Usage
```
# source ~/virtenvs/uberserver/bin/activate
# ./server.py
```

# Logs
- `$PWD/server.log`

repository: Anarchid/uberserver

repo_name: Anarchid/uberserver


text:
---
section: libraries
toc: true
title: Lock for Android v1
description: A widget that provides a frictionless login and signup experience for your native Android apps.
public: false
mobileimg: media/articles/libraries/lock-android.png
topics:
  - libraries
  - lock
  - android
contentType:
  - index
  - how-to
useCase:
  - add-login
  - enable-mobile-auth
---
# Lock Android: Getting Started

<%= include('../_includes/_lock-version') %>

::: note
Check out the [Lock.Android repository](https://github.com/auth0/Lock.Android/tree/v1) on GitHub.
:::

## Requirements

Android API level 15+ is required in order to use Lock's UI.
If you'll create your own API and just call Auth0 API via the `com.auth0.android:core:1.+`, the minimum required API level is 9.

## Install

Lock is available both in [Maven Central](http://search.maven.org) and [JCenter](https://bintray.com/bintray/jcenter). To start using *Lock* add these lines to your `build.gradle` dependencies file:

```gradle
compile 'com.auth0.android:lock:1.+'
```

Once it's installed, you'll need to configure LockActivity in your`AndroidManifest.xml`, inside the `application` tag:

```xml
<!--Auth0 Lock-->
<activity
  android:name="com.auth0.lock.LockActivity"
<EMAIL_ADDRESS>  android:screenOrientation="portrait"
  android:launchMode="singleTask">
  <intent-filter>
    <action android:name="android.intent.action.VIEW"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>
    <data android:scheme="a0INSERT_YOUR_APP_CLIENT_ID" android:host="YOUR_ACCOUNT_NAME.auth0.com"/>
  </intent-filter>
</activity>
<meta-data android:name="com.auth0.lock.client-id" android:value="@string/auth0_client_id"/>
<meta-data android:name="com.auth0.lock.domain-url" android:value="@string/auth0_domain"/>
<!--Auth0 Lock End-->
```

::: note
The value `@string/auth0_client_id` is your application's clientID and `@string/auth0_domain` is your tenant's domain in Auth0, both values can be found in your app's settings.
:::

::: note
The final value of `android:scheme` must be in lowercase.
:::

Also, you'll need to add *Internet* permission to your application:

```xml
<uses-permission android:name="android.permission.INTERNET"/>
```

Finally, make your Application class (The one that extends from `android.app.Application`) implement the interface `com.auth0.lock.LockProvider` and add the following code:

```java
public class MyApplication extends Application implements LockProvider {

  private Lock lock;

  public void onCreate() {
    super.onCreate();
    lock = new Lock.Builder()
      .loadFromApplication(this)
      /** Other configuration goes here */
      .closable(true)
      .build();
  }

  @Override
  public Lock getLock() {
    return lock;
  }
}
```

::: note
You can check [here](#lock-builder) for more configuration options
:::

You should also add your Application class to the `AndroidManifest.xml`.

```xml
<application
        android:name=".MyApplication"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name">
        <!-- Other configuration goes here -->

</application>
```

And include the following code in your `build.gradle` file.

```gradle
android {
  //...
  packagingOptions {
      exclude 'META-INF/NOTICE'
      exclude 'META-INF/LICENSE'
  }
}
```

## Authentication with Lock

`LockActivity` will handle Email/Password, Enterprise & Social authentication based on your Application's connections enabled in your Auth0's Dashboard.

When a user authenticates successfully, LockActivity will send an Action using LocalBroadcastManager and then finish itself (by calling finish()). The activity that is interested in receiving this Action (In this case the one that will show Lock) needs to register a listener in the LocalBroadcastManager:

```java
// This activity will show Lock
public class HomeActivity extends Activity {

  private LocalBroadcastManager broadcastManager;

  private BroadcastReceiver authenticationReceiver = new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {
      UserProfile profile = intent.getParcelableExtra(Lock.AUTHENTICATION_ACTION_PROFILE_PARAMETER);
      Token token = intent.getParcelableExtra(Lock.AUTHENTICATION_ACTION_TOKEN_PARAMETER);
      Log.i(TAG, "User " + profile.getName() + " logged in");
    }
  };

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //Customize your activity

    broadcastManager = LocalBroadcastManager.getInstance(this);
    broadcastManager.registerReceiver(authenticationReceiver, new IntentFilter(Lock.AUTHENTICATION_ACTION));
  }

  @Override
  protected void onDestroy() {
    super.onDestroy();
    broadcastManager.unregisterReceiver(authenticationReceiver);
  }
}
```

Then just start `LockActivity`

```java
Intent lockIntent = new Intent(this, LockActivity.class);
startActivity(lockIntent);
```

And you'll see our native login screen

![Lock Screenshot](/media/articles/libraries/lock-android/Lock-Widget-Android-Screenshot.png)

::: note
By default all social authentication will be done using an external browser, if you want native integration please check this [wiki page](/libraries/lock-android/native-social-authentication).
:::

## Proguard

In the [proguard directory](https://github.com/auth0/Lock.Android/tree/master/proguard) you can find the *Proguard* configuration for Lock and its dependencies.
By default you should at least use the following files:

* `proguard-square-okhttp.pro`
* `proguard-jackson-2.pro`
* `proguard-square-otto.pro`
* `proguard-lock.pro`

and if you use Facebook or Google+ native integration, you'll need `proguard-facebook.pro` and `proguard-google-play-services.pro` respectively.

You specify several files in you application's `build.gradle` like this:

```gradle
buildTypes {
  release {
    minifyEnabled true
    proguardFile '../proguard/proguard-facebook.pro' //facebook native auth
    proguardFile '../proguard/proguard-google-play-services.pro' //G+ native auth
    proguardFile '../proguard/proguard-square-okhttp.pro' //Auth0 core
    proguardFile '../proguard/proguard-jackson-2.pro' //Auth0 core
    proguardFile '../proguard/proguard-square-otto.pro' //Lock
    proguardFile '../proguard/proguard-lock.pro' //Lock
    //Add your app's specific proguard rules
  }
}
```

<%= include('../_includes/_next-steps') %>


text:
---
layout: post
title: Too Quick
date: '2006-09-19 21:55:00 -0700'
mt_id: 1145
blog_id: 1
post_id: 1145
basename: too-quick
categories:
- psychology
- personal
---

I've been noticing lately that I am too quick to make judgements. I first learned of this problem from Aaron T. Beck, who called it "catastrophizing." In a nutshell, that's the practice of blowing innocuous events out of proportion. Examples abound in my personal life: someone doesn't respond to my instant messages for hours or emails for days and I start to wonder if I've lost a friend or burnt a bridge; a friend doesn't hang out with me and I feel an intense desire to confront him; my wife comments that the kids are out of control and I assume she's derogating my parenting.

It's a very real problem because it can sour a relationship due to resentment, anger, need for reassurance, and even hostility. It hasn't happened very often to me because I've learned to keep it inside—I feel all of these negative emotions but I don't express them. But it can lead to dwelling on problems even though the catalytic event had a perfectly reasonable explanation that had no personal causation: busyness, inattention, insensitivity, or even self-absorption.

But the act of keeping it inside isn't terribly satisfying because it is very distracting. I am constantly analyzing the events leading up to the triggering event, searching for actions on my part that might have contributed to the perceived breakdown. Generally, I can't find them (for obvious reasons) and so I tend to lash out internally at the person. This cathartic behavior often allows me to introspect on my reaction, thereby defusing the catastrophizing.

The introspection typically takes the form of Socratic self-questioning. "Is there an alternate explanation for this person's behavior?" "Is that behavior consonant with past behavior?" "Does it fit the level of friendship or love you've established?" "Is it possible that you're overreacting?" "Can you wait a few days to confront the person?"

I think that these questions get at the heart of the matter: catastrophizing is often a psychological version of injustice. Justice is the act of granting that which someone deserves. Psychologically, this takes the form of gratitude or righteous anger, to pick but two examples of justice-related emotions. Catastrophizing severs this tie: leaving emotions that aren't truly related to the other person. It's almost as if you whip yourself into a froth over nothing.

This is the first in an ongoing series of introspective entries I wish to undertake in order to gain a better insight into what makes me tick. They may have no meaning to anyone besides me as they are not intended as psychological treatises and undergo only the lightest of editing.

extension: markdown


text:
---
title: Web programming with Sinatra
layout: post
img:  sinatra.jpg
category: personal
description: A starting point to web programming with Sinatra.
---
## Sinatra for the web
Sinatra is a very very simple Webframework for Ruby. A friend of mine ask me how hard is it to make a web application which reads and writes from a database. Here I will show you how simple it is. This code will not be scalable nor be best practise or something but it will be as simple as possible. You will see you can learn the basics on one day easy.

## Preperation
To do this tutorial install ruby and and install the Sinatra framework. This can easily doe with:

```bash
sudo apt-get install ruby ruby-dev libmysqlclient-dev
gem install sinatra
```

easy right?

## Hello World
So here are the standard "Hello World".

``` ruby
require "sinatra"

get "/" do
  "Hello World"
end
```

Save this as a hello_world.rb and type

```bash
ruby hello_world.rb
```

Thats it its THAT simple! Just go to "http://localhost:4567" and you will see your "Hello World".
"Ok that was easy but I want more!"

You probably don't want everything in this file (remembers me of old PHP times :) )

So make a folder called "views". There you put a file called "hello_world.erb".
In this "hello_world.erb" we write:

```html
<html>
  <head>
    <title>Hello World</title>
  </head>
  <body>
    <p>Hello World</p>
  </body>
</html>
```

the Sinatra part we change to:

```ruby
reuqire "sinatra"

get "/" do
  erb :hello_world
end
```

Not go to your console and close the old server with
"Strg+C". Then type again

```bash
ruby hello_world.rb
```

then you should see Your "Hello World" again.
Now play a bit with the html to see how it changes.
Till now we only had normal html in the ".erb" file.
But erb can more! We will now use a variable from Sinatra and will render them in the erb file.

so change the "hello_world.rb" to these

```ruby
require "sinatra"

get "/" do
  @foo = "This is some text."
  erb :hello_world
end
```

and change the "hello_world.erb" to this

```html
<html>
  <head>
    <title>Hello World</title>
  </head>
  <body>
    <p><%= :foo%></p>
    <p>Hello World</p>
  </body>
</html>
```

Wow this allows us to do much more!
Well now it's time to look how we can receive data from the user/browser.
For this we need a formula so please change your ".erb" file to this:

```html
<html>
  <head>
    <title>Hello World</title>
  </head>
  <body>
    <p><%= @foo%></p>
    <p>Hello World</p>
    <form action="action_page">
      First name:<br>
      <input type="text" name="firstname">
      <br>
      Last name:<br>
      <input type="text" name="lastname">
      <button type="submit">Send</button>
      </form>
  </body>
</html>
```

Do you see the field  name="lastname"   ? This do we need later to identify which data from the browser we want to read.
More information about form fields in html you find [here](http://www.w3schools.com/html/html_forms.asp).

Now to the server part change it to this:

```ruby
require "sinatra"

get "/" do
  @foo = "This is some text."
  erb :hello_world
end

get "/action_page" do
  foo = params[:firstname]
  foo = "Hello " + foo + " " + params[:lastname]
  foo
end
```

and when we execute it and you fill out the form you will see a text like this:

"Hello Peter Pan"

OK thats pretty cool now we can receive data to the user and send data to the user.
But what if we want to save something? For this normally a database is used. So as the last part I will show you how to read and write from the database.
## Preperation
So to communicate with the database we need a database driver
and of course we need to install the database
we do this with:

```bash
sudo apt-get install mysql-server
gem install gem install mysql2
```

now we have everything installed but we need to create the database and then create a table (btw. a pretty good tutorial for this is [here](https://www.digitalocean.com/community/tutorials/a-basic-mysql-tutorial) and [here](https://github.com/brianmario/mysql2) ) so

```sql
mysql -u root -p

CREATE DATABASE database foobar;

use foobar

CREATE TABLE users (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(20),
food VARCHAR(30),
confirmed CHAR(1),
signup_date DATE);

INSERT INTO `users` (`id`,`name`,`food`,`confirmed`,`signup_date`) VALUES (NULL, "John", "Casserole","Y", '2012-04-11');
```

then we change the server to this

``` ruby
require "sinatra"
require "mysql2"

get "/" do
  client = Mysql2::Client.new(:host => "localhost", :username => "root", :database => "foobar")
  @results = client.query("SELECT * FROM users")
  @foo = "This is some text.\n" + @results.to_s
  erb :hello_world
end

get "/action_page" do
  client = Mysql2::Client.new(:host => "localhost", :username => "root", :database => "foobar")
  client.query('INSERT INTO `users` (`id`,`name`,`food`,`confirmed`,`signup_date`) VALUES (NULL, "' + params[:firstname] + '", "' + params[:lastname] + '","Y", "2012-04-11")')
  foo = params[:firstname]
  foo = "Hello " + foo + " " + params[:lastname]
  foo
end
```

Now here I should warn you <b>not to program like these in the wild web</b> as its insecure as hell but  for our litte course this is ok.
So now you see how you can insert and read from a database.
And here we at the end. You have learned the basics now play a bit and read more tutorials. May you identify where I did bad practise. If so try to correct it.
Try to make it more beautiful with CSS (Sinatra will expect that the CSS is in a folder called public.) digg into it it's fun!


text:
Build/Test opentracing
-------------------------

Opentracing is open distributed tracing standard for applications and OSS packages.

Step 1) Build opentracing container image (once per release)
	$ docker build -t opentracing:ibm .

Step 2) Build and Test opentracing

	Usage:
		$ docker run --rm -v `pwd`:/ws opentracing:ibm bash -l -c "cd /ws; ./build.sh <rel_tag> <runtest> 2>&1 | tee output.log"
	Examples:
		==========
		Build & Run Tests
		==========
		# by default, build "master or main" or pass desired release to build as argument
		$ docker run --rm -v `pwd`:/ws opentracing:ibm bash -l -c "cd /ws; ./build.sh 2>&1 | tee output.log"

		# only 'runtest' passed - so build master branch & test
                $ docker run --rm -v `pwd`:/ws opentracing:ibm bash -l -c "cd /ws; ./build.sh runtest 2>&1 | tee output.log"

		# build specific branch/release. No tests
                $ docker run --rm -v `pwd`:/ws opentracing:ibm bash -l -c "cd /ws; ./build.sh v1.6.0 2>&1 | tee output.log"

		# build specific branch/release and run tests
		$ docker run --rm -v `pwd`:/ws opentracing:ibm bash -l -c "cd /ws; ./build.sh v1.6.0 runtest 2>&1 | tee output.log"


text:
# ubuntu-ping-doer

`By Tadeo Rubio`

---

Docker image to do ping every time.

---

## Items installed.

- Ubuntu 20.04 (Official image)
- iputils-ping
- mtr

⚠. MTR isn't functional to all TimeZones. Next versions will can to set the TimeZone.

---

## Environment Variables

- HOST_TO_PING, by default google.com
- TIME_B_PINGS, seconds between every ping, by default 5 seconds.

---

### License

It's a [MIT Licence](https://github.com/TadeoRubio/ubuntu-ping-doer/blob/main/LICENSE)

repository: TadeoRubio/ubuntu-ping-doer

repo_name: TadeoRubio/ubuntu-ping-doer


text:
# Changelog

## Emojis

- New Features -> :zap:
- Enhancements -> :star2:
- Breaking Changes -> :boom:
- Dependency Changes -> :package:
- Bugs -> :beetle:
- Pull Requests -> :book:
- Documents -> :mortar_board:
- Tests -> :eyeglasses:

---

## [v1.0.0](https://github.com/foxifyjs/stream/releases/tag/v1.0.0) - _(2019-05-17)_

- :tada: First Release

repository: foxifyjs/stream

gha_language: TypeScript

repo_name: foxifyjs/stream


text:
# adb-alfred [![release](https://img.shields.io/github/release/zjn0505/adb-alfred.svg)][4] [![Build Status][1]][2] [![Total downloads][3]][4]

[1]:
https://app.bitrise.io/app/48bd64d386f7c944/status.svg?token=5M-EP8LTG0wjJSKcqCoSew&branch=master "Bitrise build status icon"
[2]: https://app.bitrise.io/app/48bd64d386f7c944#/builds "Bitrise build page"
[3]: https://img.shields.io/github/downloads/zjn0505/adb-alfred/total.svg "Total downloads"
[4]: https://github.com/zjn0505/adb-alfred/releases/latest

![logo](https://raw.githubusercontent.com/zjn0505/adb-alfred/master/art/adb%20alfred.png)

adb with alfred workflow

Android developers may need to work on
  - multiple connected devices
  - devices beyound your arm's reach
  - devices without hard and soft navigation buttons
  - or need to clear app data 200 times a day

then this workflow is very handy for them, as most `adb -s {serial} shell` commands can be done within 10 keystrokes in alfred.

Keywords
----

`adb`, `apk`, `apkf`, `avd`, `geny`

Dependencies
----

These dependencies are included in Android Studio and Android command line tools. [link](https://developer.android.com/studio/#downloads)

- [adb](https://developer.android.com/studio/command-line/adb)
- [aapt](https://developer.android.com/studio/command-line/aapt2)
- [emulator](https://developer.android.com/studio/run/emulator-commandline)
- [apksigner](https://developer.android.com/studio/command-line/apksigner) (optional)

Other optional but powerful widgets this workflow uses

- [scrcpy](https://github.com/Genymobile/scrcpy)  - screen mirror, screen recording, control device from your mac
- [Genymotion](https://www.genymotion.com/) - Genymotion emulators can be listed and launched with adb-alfred

Configurations
----

Add the path of the executable files of dependencies to workflow settings.

Here is a screenshot of my configurations.
![Workflow config screenshot new](https://raw.githubusercontent.com/zjn0505/adb-alfred/master/art/configs_2.png)
![Workflow config screenshot](https://raw.githubusercontent.com/zjn0505/adb-alfred/master/art/configs.png)

What's required:

|Name|Value (example)|
|--|--|
|`adb_path`|~/Library/Android/sdk/platform-tools/adb|
|`aapt_path`|~/Library/Android/sdk/build-tools/29.0.2/aapt|
|`emulator_path`|~/Library/Android/sdk/emulator/emulator|

What's optional:

|Name|Value (example)|
|--|--|
|`apksigner_path`|~/Library/Android/sdk/build-tools/29.0.2/apksigner|
|`config_clipboard`|`1` to copy some outputs to clipboard|

What's customizable:

|Name|Value (example)|
|--|--|
|`self_script_app_` + `{number}`|Open in Google Play\|self_scripts/open_in_google_play.py|
|`self_script_device_` + `{number}`|Toggle Airplane Mode\|self_scripts/toggle_airplane_mode.py|

see  [Self script customization](#self-script-customization)

Features
----
- `adb` to list connected devices

  - `adb connect`, `adb disconnect` `adb restart` can also be accessed from root level

  - devices have modifiers to run history commands

 Full features at this level

|Feature|Trigger|
|:--|:--|
|Check all connected devices|`adb` or hotkey|
|Check ip address of connected device|`adb` + `cmd` (emulators and wireless connected devices excluded)|
|Copy device serial to clipboard|`adb` + `cmd` + `c`|
|Check device system info|`adb` + `option`|
|Re-run last used command on one device|`adb` + `ctrl`|
|Re-run second last used command on one device|`adb` + `shift`|
|Check history commands of one device|`adb` + `fn`|
|Check wireless connection history|`adb connect`|
|Clear wireless connection history|`adb connect` + `cmd`|
|Connect to device wirelessly|`adb connect {ip}:{port}`|
|Remove wireless connection history of one device|`adb connect` + `cmd` on device|
|Disconnect wireless devices|`adb disconnect`|
|Restart adb service|`adb restart`|

![list devices](https://raw.githubusercontent.com/zjn0505/adb-alfred/master/art/screenshot%2001%20list%20devices.png)

- select one connected device for device options

  - input custom commands like `shell dumpsys -l | grep wifi` to execute directly in terminal

  - select from options like 'app list', 'debug layout', 'screenshot', 'dump task stack', etc.

  - most options have modifiers for quick control.

 Full features at this level

|Feature|Trigger|
|:--|:--|
|Custom command in terminal|input directly, e.g. `shell dumpsys -l \| grep wifi`|
|Custom command silently|input + `cmd`|
|Show history command|`Command history`|
|Clear history command|`Command history` + `cmd`|
|Show applications list|`Show apps list`|
|Select app to launch|`Show apps list` + `cmd`|
|Select app to uninstall|`Show apps list` + `option`|
|Select app to force stop|`Show apps list` + `ctrl`|
|Select app to clear data|`Show apps list` + `fn`|
|Select app to show app info|`Show apps list` + `shift`|
|Install apk or all apks in folder|`Install apk`|
|Take screenshot to clipboard|`Take screenshot`|
|Take screenshot to desktop|`Take screenshot` + `cmd`|
|Open settings|`Open settings`|
|Open developer tools|`Open settings` + `cmd`|
|Open WiFi settings|`Open settings` + `option`|
|Open application settings|`Open settings` + `ctrl`|
|Open date settings|`Open settings` + `fn`|
|Open accessibility settings|`Open settings` + `shift`|
|Toggle debug layout|`Toggle debug layout`|
|Toggle pointer location|`Toggle debug layout` + `cmd`|
|Toggle show taps|`Toggle debug layout` + `option`|
|Toggle GPU profile|`Toggle debug layout` + `ctrl`|
|Toggle GPU overdraw|`Toggle debug layout` + `fn`|
|Turn off all UI debuggers|`Toggle debug layout` + `shift`|
|Demo mode (API 23+)|`Toggle demo mode`|
|Reboot|`Reboot system`|
|Reboot to bootloader|`Reboot system` + `cmd`|
|Reboot to recovery|`Reboot system` + `option`|
|Reboot to sideload|`Reboot system` + `ctrl`|
|Connect over WiFi (wired device)|`Connect over Wi-Fi`|
|Input text or button keyevent|in `Keyevent input`|
|Dump task stacks|`Dump task stacks`|
|Dump task stacks of first app|`Dump task stacks` + `cmd`|
|Dump first task stacks|`Dump task stacks` + `option`|
|Dump notifications|`Dump notifications`|
|Dump notifications, exclude empty ones|`Dump notifications` + `cmd`|
|Screen copy (real device)|`Screen Copy with scrcpy`|
|Screen copy with max dimemsion 1024|`Screen Copy with scrcpy` + `cmd`|
|Screen copy with record screen|`Screen Copy with scrcpy` + `option`|

![device options](https://github.com/zjn0505/adb-alfred/raw/master/art/screenshot%2002%20show%20device%20options.png)

- select `Show app list` in device options to list and search in all installed applications

  - select one application to show package options

 Full features at this level

|Feature|Trigger|
|:--|:--|
|Copy package name|`cmd` + `c` here or in previous level|
|Open app info page|`App info`|
|Force stop application|`Force stop`|
|Start application|`Start application`|
|Clear data|`Clear app data`|
|Uninstall|`Uninstall app`|
|Uninstall but keep data and cache|`Uninstall app` + `cmd`|
|Disable/Enable app|`Disable app`/`Enable app`|
|Disable app for current user|`Disable app` + `cmd`|
|Get apk file|`Extract apk file`|

![package options](https://raw.githubusercontent.com/zjn0505/adb-alfred/master/art/screenshot%2003%20show%20package%20options.png)

- select `Install apk` in device options to select APK or APKs on local drive for installation

  - `adb install -t -d -g` and bulk installation

  - apk signature info will be listed

![install options](https://raw.githubusercontent.com/zjn0505/adb-alfred/master/art/screenshot%2004%20show%20install%20options.png)

- `apk` to search for local apk files, and check package info, or analyze it in Android Studio

  - `apkf` to directly list apk files under current front Finder window

  - custom hotkey to open current selected apk file

- `avd` to list installed emulators, select one to start an emulator

  - modifier keys to do cold boot, or wipe emulator data

- `geny` to list installed Genymotion emulators, select one to start an emulator

Full feature list
------

 in this workflow

|Function|Trigger|
|:--|:--|
|Check all connected devices|`adb` or hotkey|
|Check ip address of connected device|`adb` + `cmd` (emulators and wireless connected devices excluded)|
|Copy device serial to clipboard|`adb` + `cmd` + `c`|
|Check device system info|`adb` + `option`|
|Re-run last used command on one device|`adb` + `ctrl`|
|Check history commands of one device|`adb` + `fn`|
|Check wireless connection history|`adb connect`|
|Clear wireless connection history|`adb connect` + `cmd`|
|Connect to device wirelessly|`adb connect {ip}:{port}`|
|Remove wireless connection history of one device|`adb connect` + `cmd` on device|
|Disconnect wireless devices|`adb disconnect`|
|Restart adb service|`adb restart`|
|Custom command in terminal|`adb` -> input, e.g. `shell dumpsys -l \| grep wifi`|
|Custom command silently|`adb` -> input + `cmd`|
|Show history command|`adb` -> `Command history`|
|Clear history command|`adb` -> `Command history` + `cmd`|
|Show applications list|`adb` -> `Show apps list`|
|Select app to launch|`adb` -> `Show apps list` + `cmd`|
|Select app to uninstall|`adb` -> `Show apps list` + `option`|
|Select app to force stop|`adb` -> `Show apps list` + `ctrl`|
|Select app to clear data|`adb` -> `Show apps list` + `fn`|
|Select app to show app info|`adb` -> `Show apps list` + `shift`|
|Install apk or all apks in folder|`adb` -> `Install apk`|
|Take screenshot to clipboard|`adb` -> `Take screenshot`|
|Take screenshot to desktop|`adb` -> `Take screenshot` + `cmd`|
|Open settings|`adb` -> `Open settings`|
|Open developer tools|`adb` -> `Open settings` + `cmd`|
|Open WiFi settings|`adb` -> `Open settings` + `option`|
|Open application settings|`adb` -> `Open settings` + `ctrl`|
|Open date settings|`adb` -> `Open settings` + `fn`|
|Open accessibility settings|`adb` -> `Open settings` + `shift`|
|Toggle debug layout|`adb` -> `Toggle debug layout`|
|Toggle pointer location|`adb` -> `Toggle debug layout` + `cmd`|
|Toggle show taps|`adb` -> `Toggle debug layout` + `option`|
|Toggle GPU profile|`adb` -> `Toggle debug layout` + `ctrl`|
|Toggle GPU overdraw|`adb` -> `Toggle debug layout` + `fn`|
|Turn off all UI debuggers|`adb` -> `Toggle debug layout` + `shift`|
|Demo mode (API 23+)|`adb` -> `Toggle demo mode`|
|Reboot|`adb` -> `Reboot system`|
|Reboot to bootloader|`adb` -> `Reboot system` + `cmd`|
|Reboot to recovery|`adb` -> `Reboot system` + `option`|
|Reboot to sideload|`adb` -> `Reboot system` + `ctrl`|
|Connect over WiFi (wired device)|`adb` -> `Connect over Wi-Fi`|
|Keyevent|`adb` -> `Keyevent input` -> `Back`/`Home`/`App switch`/`Power`/`Status bar`|
|Text input|`adb` -> `Keyevent input` -> input directly|
|Dump task stacks|`adb` -> `Dump task stacks`|
|Dump task stacks of first app|`adb` -> `Dump task stacks` + `cmd`|
|Dump first task stacks|`adb` -> `Dump task stacks` + `option`|
|Show dumpped task app info in workflow|`adb` -> `Dump task stacks` -> `cmd`|
|Uninstall dumpped task's application|`adb` -> `Dump task stacks` -> `option`|
|Force stop dumpped task|`adb` -> `Dump task stacks` -> `ctrl`|
|Clear data of dumpped task's application|`adb` -> `Dump task stacks` -> `fn`|
|Show dumpped task app info page|`adb` -> `Dump task stacks` -> `shift`|
|Dump notifications|`adb` -> `Dump notifications`|
|Dump notifications, exclude empty ones|`adb` -> `Dump notifications` + `cmd`|
|Show app info of notification|`adb` -> `Dump notifications` -> `cmd`|
|Show channel info of notification|`adb` -> `Dump notifications` -> `option`|
|Screen copy (real device)|`adb` -> `Screen Copy with scrcpy`|
|Screen copy with max dimemsion 1024|`adb` -> `Screen Copy with scrcpy` + `cmd`|
|Screen copy with record screen|`adb` -> `Screen Copy with scrcpy` + `option`|
|Copy package name|`adb` -> `Show apps list` -> `cmd` + `c`|
|Open app info page|`adb` -> `Show apps list` -> `App info`|
|Force stop application|`adb` -> `Show apps list` -> `Force stop`|
|Start application|`adb` -> `Show apps list` -> `Start application`|
|Clear data|`adb` -> `Show apps list` -> `Clear app data`|
|Uninstall|`adb` -> `Show apps list` -> `Uninstall app`|
|Uninstall but keep data and cache|`adb` -> `Show apps list` -> `Uninstall app` + `cmd`|
|Disable/Enable app|`adb` -> `Show apps list` -> `Disable app`/`Enable app`|
|Get apk file|`adb` -> `Show apps list` -> `Extract apk file`|
|Search for apk files|`apk`|
|Inspect apk minSdkVersion|`apk` -> select file -> `cmd`|
|Inspect apk maxSdkVersion|`apk` -> select file -> `option`|
|Inspect apk targetSdkVersion|`apk` -> select file -> `ctrl`|
|Analyze apk in Android Studio|`apk` -> select file -> `fn`|
|List apk files in current Finder|`apkf`|
|Open current selected apk file in workflow|with hotkey|
|List installed emulators|`avd`|
|Wipe emulator data|`avd` + `option`|
|Cold boot an emulator|`avd` + `ctrl`|
|List installed Genymotion emulators|`geny`|

Self script customization
-----
If there is some cool features you used a lot but not included in this workflow.
You can either add your step, code and link the flow together.
Or you can use "self script" feature to add customizable step for device operation or apk/app operation.

For example.
1. In workflow configuration, add `self_script_app_1` as key and `Open in F-Droid|Users/username/Documents/myscript/open_in_fdroid.py` as value.

2. Now open an apk or select an installed package on device, there will be a new option titled "Open in F-Droid".

3. Once selected, you local script `Users/username/Documents/myscript/open_in_fdroid.py` will be triggered with all existing workflow variables, especially package name in this example.

4. Ideally, F-Droid webpage of current application will be opened.

5. Unlike the first option to add you own step, the customized flow with self script will be persisted across this workflow updates.

If your self script produces a json data in the format of [script filter](https://www.alfredapp.com/help/workflows/inputs/script-filter/json/), it will populate a alfred list after execution.

Please check [self_scripts](https://github.com/zjn0505/adb-alfred/tree/master/self_scripts) for references.

References
------
- [109021017/alfred-adb-workflow](https://github.com/109021017/alfred-adb-workflow)

- [nassendelft/alfred-android-adb](https://github.com/nassendelft/alfred-android-adb)


text:
# **Finding Lane Lines on the Road**

## Writeup

---

**Finding Lane Lines on the Road**

The goals / steps of this project are the following:
* Make a pipeline that finds lane lines on the road
* Reflect on your work in a written report

---

### Reflection

### 1. Pipeline description, and how I modified the draw_lines() function.

My pipeline consisted of 5 steps. First, I converted the images to grayscale, then I removed the noise using the Gaussian filter which may create a sudden change that may be considered a line by Canny algorithm. Third, I applied the canny transform to detect the edges and because I am interested in a certain area which I predict that the road lane is located there so I extracted the lines on only this region of interest. Forth, I applied the Hough transform on the lines with different parameters until I got the best identification for the lines that located on the left/right lane line then I draw them on the original image.

....

In order to draw a single line on the left and right lanes, I modified the draw_lines() function by dividing the lines into two groups left lines and right lines using the slope sign if the slop is positive this mean it belongs to the left lane line otherwise this line belongs to the right lane line also I calculate the intercept for each line to represent each line with its slope and intercept and the number of pixels that used to draw this line as a weight.

After that, I used the weight of each line to make it more or less effective in the averaging. Then I drew these lines on the original image

...

### 2. Potential shortcomings with my current pipeline

One potential shortcoming would be that my pipeline doesn't support the lightening difference in the image so If the lane got darker because of the shadow it will be difficult to identify the lane.

Also, If the lane got very curvy I think my pipeline will fail with lane identification we can see the end of lanes in the images are curvy and the pipeline couldn't catch them accurately.

### 3. Possible improvements to my pipeline

First, use the general form of Hough transform to identify different shapes which will help to identify on the straight or curvy lines.

Second, we can use the colour as a parameter to support my pipeline to identify the lane lines in different light situations so shadows will not effect the algorithm identification accuracy.


text:
# audioInfrastructure
A set of basic audio tools for the communication of all modules that use audio in the iMuSciCA workbench.

Information for getting the .js files directly from Github to include in your .html files:

Examples:
For loading the audioManager.js in your .html file, add the following lines accordingly:
- For testing use this URL:
<script src="https://rawgit.com/imuscica/audioInfrastructure/master/audioManager.js"></script>
- In production use this URL:
<script src="https://cdn.rawgit.com/imuscica/audioInfrastructure/master/audioManager.js"></script>

repository: imuscica/audioInfrastructure

repo_name: imuscica/audioInfrastructure


text:
# realpaths

[![npm version](https://img.shields.io/npm/v/realpaths.svg)](https://www.npmjs.com/package/realpaths)
[![Build Status](https://travis-ci.org/shinnn/realpaths.svg?branch=master)](https://travis-ci.org/shinnn/realpaths)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/realpaths.svg)](https://coveralls.io/github/shinnn/realpaths)

Like [fs.realpath][realpath], but resolves multiple paths at once

```javascript
const realpaths = require('realpaths');

// symlink1 <<===>> /path/to/foo.txt
// symlink2 <<===>> /path/to/bar.txt

(async () => {
  await realpaths(['symlink1', 'symlink2']) //=> ['/path/to/foo.txt', '/path/to/bar.txt']
})();
```

## Installation

[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm).

```
npm install realpaths
```

## API

```javascript
const realpaths = require('realpaths');
```

### realpaths(*paths* [, *cache*])

*paths*: `Array<string>` (file paths)
*options*: `Object` (used as [`fs.realpath`](https://github.com/nodejs/node/blob/c339fa36f5493c2bd2e108463910122ef82843c4/lib/fs.js#L1568-L1570) cache)
Return: `Promise<Array<string>>`

It runs [`fs.realpath`][realpath] for each path and returns a `Promise` instance.

When it finishes resolving all paths, it will be [fulfilled](https://promisesaplus.com/#point-26) with an array of resolved paths.

```javascript
const {resolve} = require('path');
const realpaths = require('realpaths-callback');

realpaths(['symlink1', 'symlink2'], {
  cache: {
    [resolve('symlink1')]: '/path/to/foo.txt',
    [resolve('symlink2')]: '/path/to/bar.txt'
  }
}).then(paths => {
  paths; //=> ['/path/to/foo.txt', '/path/to/bar.txt']
});
```

## Related projects

* [realpaths-callback](https://github.com/shinnn/realpaths-callback) – [Callback](http://thenodeway.io/posts/understanding-error-first-callbacks/)-style version

## License

[ISC License](./LICENSE) © 2017 Shinnosuke Watanabe

[realpath]: https://nodejs.org/api/fs.html#fs_fs_realpath_path_options_callback

license: ISC

repository: shinnn/realpaths

repo_name: shinnn/realpaths


text:
---
layout: post
title: "The Immutable Message in Akka"
category:
- akka
- distributed
- java
permalink: the-immutable-message-in-akka
meta_description: 'The Immutable Message in Akka'
browser_title: 'The Immutable Message in Akka'
---

**Immutable transference** is the only safe way to share state. If a state structure is immutable, then it is impossible for anyone to alter it. In [Akka](http://akka.io), this is how we guarantee the message we send is the same message our recipient receives. By making our messages immutable, we assure their accuracy and eliminate the possibility of contention. Let's take a look at two ways we can model messages in Java.

## Immutable Message

`ImmutableHello` Message in Java

{% highlight java %}
public final class ImmutableHello {
    private final String name;

    private ImmutableHello() {}

    public ImmutableHello(String name) {
      this.name = name;
    }

    public String getName() {
      return name;
    }
}
{% endhighlight %}

* The class is marked `final` so it cannot be extended.
* Prefix the class with `Immutable`, this is the convention, not required but good practice.
* Class variable marked `private final`, enforcing local-only access and immutability.
* `private` no-arg constructor prevents instantiation without a class variable.
* Class constructor requires class variable for creation.
* Getters only.

## Alternative

There is another way to model a Java class to enforce immutability, but some regard it with disdain as it does not follow accepted practices for Java class design. Personally, I like it as it is succinct.

`ImmutableHello` Message in Java (Alternative)

{% highlight java %}
public final class ImmutableHello {
    public final String name;

    private ImmutableHello() {}

    public ImmutableHello(String name) {
      this.name = name;
    }
}
{% endhighlight %}

* The class is marked `final` so it cannot be extended.
* Prefix the class with `Immutable`, this is the convention, not required but good practice.
* Class variable marked `final`, enforcing immutability.
* `private` no-arg constructor prevents instantiation without a class variable.
* Class constructor requires class variable for creation.

## equals, toString and hashCode

The other issue one must consider when modeling immutable classes in Java for messaging is equality. We might desire to compare the message received to another for validation purposes or what have you. As a result, `equals`, `hashcode`, and `toString` implementations are in order.

{% highlight java %}
@Override
public String toString(){
    return "ImmutableHello{name=" + name + "}";
}

@Override
public boolean equals(Object o){
    if (o == this) return true;
    if (o instanceof ImmutableHello) {
        ImmutableHello that = (ImmutableHello) o;
        return (this.name.equals(that.name));
    }
    return false;
}

@Override
public int hashCode(){
    int h = 1;
    h *= 1000003;
    h ^= name.hashCode();
    return h;
}
{% endhighlight %}


text:
---
layout: narrative
title: Dipping for a bullet that will reach far away and will compromise the healing
identifier: p055r_2
folio: 055r
annotation: no
author:
mode: annotated
editor: GR8975 Seminar Participants
rights: Public Domain
purposes: [advice]
activities: []
materials: [suint, vinegar]
tools: []
colors: []
plants: []
animals: []
---

- - - - - 055r - - - - -

## Dipping for a bullet that will reach far away and will compromise the healing

Mix some suint and strong vinegar and dip the bullet in this mixture while it is still hot.

gha_language: HTML


text:
ST3
===

Customized behaviors for Sublime Text 3

Sublime Text lacks very many line-oriented editing
commands. These functions add some, inspired by the Brief text editor.

Install these Python programs into your Packages folder
to enable new functions. You can then map keystrokes to the
functions as shown in the sample Windows keymap file. Those
recommended key mappings are shown *(in parentheses)*.

### `delete_line.py` *(ALT-D)*

Delete the current line, or all the lines containing the
current selection, if there is one.

### `delete_to_end_of_line.py` *(ALT-K)*

Delete from the cursor to the end of the line. Deletes
the current selection, too, if there is one.

### `insert_line.py` *(CTRL-V)*

Checks to see if the clipboard contains a complete final
line (ends with a newline). If so, pastes the selection
above the current line, instead of at the cursor.

### `join_lines.py` *(ATL-J)*

Joins the current line with the next line, eliminating
leading whitespace on the next line when doing so.


text:
# ChatBar for Android

A sweet message box designed for Android developers.

![ChatBar for Android](https://github.com/HugoLuna5/ChatBar/blob/master/app/1.png)

## Getting Started

### Installing

You can use it step by step

Sample use

```
    private  ViewChatBar viewChatBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

       viewChatBar = (ViewChatBar) findViewById(R.id.chatbar);

    }
```

### Set Up

Add dependency to your build.gradle

```
repositories {
        jcenter()
        maven {
            url "https://dl.bintray.com/hugoluna5/maven"
        }

    }

dependencies {
  compile 'org.lunainc:chatbar:1.0.0'
}

```

## Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details