text:
|By subject |[By project](https://github.com/naumenko-sa/bioscripts#by-project)|
|---|---|
|[Alignment](https://github.com/naumenko-sa/bioscripts#alignment)||
|[Articles and resources](https://github.com/naumenko-sa/bioscripts#articles-and-resources)||
|[Annotation](https://github.com/naumenko-sa/bioscripts#annotation)||
|[bam, cram, bed, fastq](https://github.com/naumenko-sa/bioscripts#bam-cram-bed-fastq)||
|[Coverage](https://github.com/naumenko-sa/bioscripts#coverage)||
|[Genome assembly](https://github.com/naumenko-sa/bioscripts#genome-assembly)||
|[Phylogenetics](https://github.com/naumenko-sa/bioscripts#phylogenetics)||
|[MISC](https://github.com/naumenko-sa/bioscripts#misc)||
|[RNA-seq](https://github.com/naumenko-sa/bioscripts#rna-seq)||
|[Variant analysis](https://github.com/naumenko-sa/bioscripts#variant-analysis-vcf-files)||
|[Visualization](https://github.com/naumenko-sa/bioscripts#visualization)||

# Alignment
* [Jim Kent's utils UCSC](http://hgdownload.soe.ucsc.edu/admin/exe/)
* [Synteny maps](http://www.agcol.arizona.edu/software/symap/)
* alignment.avr_pw_dist.pl [alignment.fasta] [1=print distances] prints average pairwise distance for multiple alignment, and all pairwise distances if $2==1
* alignment.check_3x.sh [alignment.fasta] prints how many sequences in an alignment are not 3x in length
* alignment.check_conservative_site.sh
* alignment.consensus.2seq.pl [alignment.fasta] prints a consensus of two DNA sequences
* alignment.consensus.pl
* alignment.count_gaps.sh counts % of positions with gaps in an alignment
* [alignment.detect_stops.pl](../master/alignment.detect_stops.pl) [alignment.fasta] [--print_pos] prints internal stops and their positions
* alignment.fa2fasta.pl converts fixed line lengths fasta to long line format.
* alignment.fasta2slice.pl
* alignment.filter_not3x.sh
* alignment.fix_ends.sh
* alignment.muscle.sh.
* alignment.nucleotide_diversity.pl
* alignment.occupancy.pl
* [alignment.protein2dna.sh](../master/alignment.protein2dna.sh) [name.aln.fasta] reverse translates amino acid alignment into DNA alignment.
* alignment.remove_ambiguity.pl
* alignment.remove_cons_n_gaps.pl
* alignment.remove_gaps.pl
* alignment.remove_seqs_having_stops.pl
* alignment.remove_sp4occupancy.pl
* [alignment.remove_stops_n_gaps2.pl](../master/alignment.remove_stops_n_gaps2.pl) removes stops, gaps, and sites around indels.
* [alignment.remove_stops_n_gaps.pl](../master/alignment.remove_stops_n_gaps.pl) removes triplets with stops or gaps.
* alignment.reverse_complement.pl
* alignments.concatenate1.pl
* alignments.concatenate.pl
* alignment.sort_by_id.pl
* alignment.substitution_profile.pl
* alignment.tr_trv.pl
* [alignment.UCSC.dm6droSim1.sh](../alignment.UCSC.dm6droSim1.sh) builds a pairwise alignment of *D.melanogaster* and *D.simulans*.

# Annotation
* [genes.R](../master/genes.R) - retrieves ENSEMBL annotations from biomaRt, run `Rscript genes.R --help`

# bam, cram, bed, fastq
* [jvarkit](https://github.com/lindenb/jvarkit/wiki): bamstats04, bamstats05.
* [bedtools](http://bedtools.readthedocs.io/en/latest/content/bedtools-suite.html) - genome arithmetics.
* [fastqc](http://www.bioinformatics.babraham.ac.uk/projects/fastqc/)
* [trimmomatic](http://www.usadellab.org/cms/index.php?page=trimmomatic)
* [PRINSEQ](http://prinseq.sourceforge.net/)
* [bam2fq.sh](../master/scripts/bam2fq.sh) converts bam to fastq, uses samtools and bedtools
* [bam.reads_number.sh](../master/bam.reads_number.sh) reports the number of paired reads in a bam file, uses samtools
* [bam.remove_region.sh](../master/bam.remove_region.sh) removes reads from a bam file located at regions specified by a bed file.
Badly filtered rRNA-depleted RNA-seq samples may have huge coverage of low complexity regions.
It is better to filter those with [prinseq](http://http://prinseq.sourceforge.net/), however sometimes it is necessary to remove a particular region.
* [bam.sort.sh](../master/scripts/bam.sort.sh) - sorts a bam file before calculating coverage.
* [basespace-cli](https://help.basespace.illumina.com/articles/descriptive/basespace-cli/). New Illumina sequencers upload data to basespace cloud.
bs utility copies data from cloud to HPC. To copy bcl files: `bs cp //./Runs/<project_name>/Data .`
* [bcl2fastq.sh](https://github.com/naumenko-sa/cre/blob/master/bcl2fastq.sh) converts raw bcl Illumina files to fastq.
* [cram2fq.sh](../master/scripts/cram2fq.sh) converts cram to fastq, uses cramtools wrapper from bcbio
* `samtools quickcheck -vvvv [file.bam]` checks the integrity of a bam file.

# Coverage
* [bam.coverage.bamstats05.sh](../master/scripts/bam.coverage.bamstats05.sh) - very fast coverage calculation for a bam and a bed file with bamstats05 (2 min for WES bam).
* [bam.coverage.sh](../master/scripts/bam.coverage.sh) - slow base-wise coverage calculation with bedtools + median coverage statistics.

# Genome assembly
The wisdom here is to avoid large genomes, polyploid genomes, and creating your own genome assembler.
See my [lecture](http://makarich.fbb.msu.ru/snaumenko/ngs_lecture/naumenko.genome_assembly-n.pdf) (in Russian).
Better to have multiple libraries for large genomes, with the good amount of mate pairs with 5k,10k,20k insert size.
For a serious work a special computing node is necessary (1-2T RAM). Surprisingly, such a node is not that expensive: just buy
a cheap big 4CPU SuperMicro server capable to carry up to 4-8T RAM, buy RAM, and insert it into the server. Avoid vendors and sales persons.
Look for engineers to cooperate. For smaller genomes I prefer spades, for larger ones velvet + platanus. Remember to clean up reads
(check for contamination, quality trimming).
* [genome_assembly.spades.sh](../master/scripts/spades.sh) runs [spades](http://bioinf.spbau.ru/spades) assembler. Spades is the best assembler
for genomes up to 100G.
* [genome_assembly.n50.sh](../master/scripts.n50.sh) [contigs.fasta] calculates N50 metrics.

# Phylogenetics
Calculating and plotting phylogenetic trees is very rewarding. However, the tree may be misleading.
Briefly, steps are:
* build a good(!) alignment
* concatenate many genes
* fit the model with modeltest (GTR+Г+I is usually the winner for protein coding genes)
* run RAXML and MrBayes and compare two trees
* visualize with [Dendroscope](http://dendroscope.org/).
* [tree.raxml_boot.pbs](../master/scripts/tree.raxml_boot.pbs) infers a phylogenetic tree for cdna alignment with 100 bootstrap replicates.
For details, read [The Phylogenetic handbook](https://books.google.ca/books/about/The_Phylogenetic_Handbook.html?id=DeD_lQ-kBPQC&redir_esc=y).

# MISC
* [hla.athlates.sh](../master/scripts/hla.athlates.sh) HLA typing with Athlates.

# RNA-seq
* [bcbio rna-seq pipeline](https://bcbio-nextgen.readthedocs.io/en/latest/contents/pipelines.html#rna-seq) does STAR alignment, variant calling,
expression measurements, isoform reconstruction, and quality metrics. Run sample-wise to speed up.
* [rnaseq.star.sh](../master/rnaseq.star.sh) - 2pass on the fly STAR alignment for a single sample. Two passes are recommended to enhance alignment and calculation of counts for novel splice junctions
(1st pass discovers junctions, 2nd pass makes an alignment).
* [rnaseq.feature_counts.sh](../master/rnaseq.feature_counts.sh) [file.bam] calculates features (reads) for RPKM calculation in R, outputs length of the genes. TPMs are generally better
(http://www.rna-seqblog.com/rpkm-fpkm-and-tpm-clearly-explained/), because you can compare expression values across samples, and they are calculated by default in bcbio rnaseq pipeline,
but [GTEX](http://www.gtexportal.org) values unlike [Protein Atlas](http://www.proteinatlas.org/) values are in RPKMs, and still many people think in terms of RPKMs. GTEX has much more samples than HPA.
* [rnaseq.load_rpkm_counts.R](../master/rnaseq.load_rpkm_counts.R) calculates RPKM counts from feature_counts output.

### De novo transcriptome assembly

### Differential expression (DE)
* [edgeR](https://bioconductor.org/packages/release/bioc/html/edgeR.html).
* [rnaseq.dexpression.R](../master/rnaseq.dexpression.R) - common utils for DE.
* [rnaseq.dexpression.katie.R](../master/rnaseq.dexpression.katie.R) - edgeR DE, batch effect correction, pheatmap, GO, pathways.
* [Gene Set Enrichment Analysis (GSEA)](http://software.broadinstitute.org/gsea/index.jsp). Run with all protein-coding genes, expression in cpm.

### Micro-RNA
I did a couple of analysis in *A.thaliana* and *S.tuberosum* (potato). First I run [smallRNA-seq pipeline from bcbio](https://bcbio-nextgen.readthedocs.io/en/latest/contents/pipelines.html#smallrna-seq).
It is much better tuned for human miRNA, where it does discovery of novel miRNA (because primary tools are developed mostly for human).
For non-human species it does a good job of mapping to mirBase and has an extensive [report](https://github.com/lpantano/seqcluster/blob/master/seqcluster/templates/report.rmd) in R.
For novel miRNA discovery I tried [shortstack](http://sites.psu.edu/axtell/software/shortstack/).

### Splicing analysis

[qorts](http://hartleys.github.io/QoRTs/index.html) and [junctionseq](https://bioconductor.org/packages/release/bioc/html/JunctionSeq.html) do the job.
Finally they produce html report for all differentially expressed genes, plotting exon usage, junction counts, novel juctions, as a nice plots.
The problem is that RNA is quite noisy by its biological nature, so expect to have many events and many false positives.
Additionaly you have tracks for IGV. They are useful, because default exon usage plots are not for exons from the canonical isoform,
but for a set of chunks from the flattened annotation of many isoforms, and people are asking questions, why here are 125 exons not 108. It is hard to see
the correspondence to exons of the canonical isoforms for long genes from those plots. Loading tracks in IGV helps: you see junctions, counts, and the alignment,
people begin to understand you.

Additionaly I use sailfish relative isoform expression levels which bcbio rna-seq pipeline outputs by default.

#### [qorts](http://hartleys.github.io/QoRTs/index.html)
* rnaseq.qorts.makeflatgff.sh
* [rnaseq.qorts.qc.sh](../master/rnaseq.qorts.qc.sh) [file.bam] calculates counts from bam file
* rnaseq.qorts.merge_novel_splices.sh merges junctions from all samples
* [rnaseq.qorts.get_novel_exons.sh](../master/rnaseq.qorts.get_novel_exons.sh) [sample] [max_novel_exon_lengths]
discovers novel exons using qorts files as input. A novel exon is reported when two novel junctions are found at the distance less then max_novel_exon_lengths.
* rnaseq.splicing.junction_seq.R runs junction seq analysis in R
* rnaseq.splicing.junction_seq.sh runs R script in the queue

# Variant analysis, vcf files
For variant calling I use [bcbio ensemble approach](https://bcbio-nextgen.readthedocs.io/en/latest/contents/configuration.html#ensemble-variant-calling)
on per-family basis.  In brief, 2 out of 4 (gatk-haplotype, samtools, freebayes, and platypus) algorithms should be voting for a variant to be called.
This allows to achieve increased sensitivity required for research, compared to conservative strategy of the genetic testing laboratory.

* [VT toolkit](http://genome.sph.umich.edu/wiki/Vt),[VT toolkit source](https://github.com/atks/vt):biallelic sites decomposition, info fields removal
* [bcftools](http://www.htslib.org/doc/bcftools.html)
* [RTG: accurate vcf comparison](https://github.com/RealTimeGenomics/rtg-tools), vcfstats.
* [vcf.rtg.validate.sh](../master/vcf.rtg.validate.sh) - how to run rtg vcfeval validation.
* [bcbio.pbs](../master/bcbio.pbs) [project] submits bcbio project to the queue.
* [bcbio.cleanup.sh](../master/bcbio.cleanup.sh) [family] cleans up after bcbio and prepares necessary tables for excel report generator.
* [bcbio.prepare_families.sh](../master/bcbio.prepare_families.sh) creates symlinks, folders, config files to run variant calling for multiple families.
* [bcbio.prepare_samples.sh](../master/bcbio.prepare_samples.sh) creates symlinks, folder structure, config files to run multiple projects for bam file generation.
* [vcf.split_multisample.sh](../master/vcf.split_multisample.sh) splits multisample vcfs.
* [vcf.kinship.R](../master/vcf.kinship.R) calculates kinship for a family using SNPRelate and plots a pedigree.
Sometimes it is useful when studying cohorts of families. When samples are mislabeled (it happens), the whole study makes no sense,
at least until relatives are placed together to call and interpret variants.

### Gemini staff - for CHEO, MH, and Muscular projects

[Gemini](https://gemini.readthedocs.io/en/latest/) is a database and framework for variant analysis. [Bcbio](http://bcbio-nextgen.readthedocs.io/en/latest/)
variant calling pipeline outputs variants in gemini format.

* [gemini.decompose.sh](../master/gemini.decompose.sh) decomposes and normalizes variants with vt.
* [gemini.vep.sh](../master/gemini.vep.sh) annotates vcf file with VEP.
* [gemini.vep2gemini.sh](../master/gemini.vep2gemini.sh) loads VEP annotated vcf to the GEMINI database.
* [gemini.gemini2txt.sh](https://github.com/naumenko-sa/cre/blob/master/gemini.gemini2txt.sh) dumps gemini database into txt file with decompressed genotypes.
* [cre.R](https://github.com/naumenko-sa/cre/blob/master/cre.R) creates report for import to excel from the gemini.txt dump.
* [gemini.from_rnaseq.sh](../master/gemini.from_rnaseq.sh) creates gemini database and rare harmful variants report from bcbio's rna-seq pipeline output.
* [gemini.refseq.sh](https://github.com/naumenko-sa/cre/blob/master/gemini.refseq.sh) from vcf to refseq table for excel report generator.
* [gemini.vep.parse.pl](../master/gemini.vep.parse.pl) parses VEP annotation.
* [gemini.vep.refseq.sh](../master/gemini.vep.refseq.sh) annotates variants with RefSeq transcripts (NMs) using VEP.
* [gemini.variant_impacts.sh](../master/gemini.variant_impacts.sh) extracts variant impacts for all transcripts.

# Articles and resources
* [https://precision.fda.gov](https://precision.fda.gov/) is an effort to standardize computational pipelines.
* [https://www.clinicalgenome.org/](https://www.clinicalgenome.org/) is created by authors of ACMG guidelines.
* [Viral Genomics & Bioinformatics - Glasgow](http://bioinformatics.cvr.ac.uk/)
* [Gene set enrichment analysis](http://software.broadinstitute.org/gsea/index.jsp)
* [Pedigree chart designer](http://www.cegat.de/en/for-physicians/pedigree-chart-designer/) draws pedigree diagrams.
* [List of journals for the journal/article club](../master/journals.md)

# By project
## 6. RNA-seq in Mendelian muscle diseases [2016-2018]
* Developed into [crt](https://github.com/naumenko-sa/crt)
* Published in [AJHG](https://www.sciencedirect.com/science/article/pii/S0002929719300126)

## 5. [Malignant hyperthermia](https://en.wikipedia.org/wiki/Malignant_hyperthermia) [2016]
* Continued by [Alper Celik](https://github.com/celalp)
* [crt.malignant_hyperthermia.R](https://github.com/naumenko-sa/crt/blob/master/malignant_hyperthermia.R)
* [crt.qorts.get_novel_exons.sh](https://github.com/naumenko-sa/crt/blob/master/rnaseq.qorts.get_novel_exons.sh)

## 4. CHEO [2016-2019]
Developed into cre
1. [bcbio.prepare_families.sh](../master/bcbio.prepare_families.sh) creates symlinks, folders, config files to run variant calling for multiple families,
or use bcbio.prepare_samples.sh if some samples need to re-generate bam files.
2. [bcbio.array.pbs](../master/bcbio.array.pbs) runs multiple bcbio projects as a job array. I have tried a parallel execution of BCBIO, with IPython,
quite successfully, but finally with enigmatic faults,maybe because of the cluster issues.
3. [cheo.check_if_done.sh](../master/cheo.check_if_done.sh) [bcbio_job.output] check which bcbio jobs are done, useful when running 100x families
4. [bcbio.cleanup.sh](../master/bcbio.cleanup.sh) [family] cleans up after bcbio and prepares necessary tables for excel report generator
5. [gemini.gemini2report.R](../master/gemini.gemini2report.R) generates reports for excel import
6. [cheo.c4r_database.sh](../master/cheo.c4r_database.sh) prepares variants from a family to be merged in a database seen_in_c4r
7. [cheo.c4r_database_merge.pl](../master/cheo.c4r_database_merge.pl) merges variant evidence from many samples
8. gemini.gemini2report.R again, to add information about C4R frequencies.
9. [cheo.filtered_vcf.sh](../master/cheo.filtered_vcf.sh) prepares filtered vcf file corresponding to excel report.

## 3. Gammarus [2012-2016]
* [gam.filter.sh](../master/gam.filter.sh) - filters reads
* gam.blastp.pbs, gam.blastp.sh - blastp for othomcl
* [gam.ortho.sh](../master/gam.ortho.sh) - orthologization of transcript with orthomcl
* [gam.orthomcl.make_alignments.pl](../master/gam.orthomcl.make_alignments.pl) - writes fasta alignments for N species (1:1 orthologs) after orthomcl

## 2. Spectrum [2010-2012]

## 1. Reversals [2009-2012]
* PAML

repository: naumenko-sa/bioscripts

gha_language: Perl

repo_name: naumenko-sa/bioscripts


text:
# Antrodiella duracina (Pat.) I. Lindblad & Ryvarden, 1999 SPECIES

#### Status
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycotaxon 71: 336 (1999)

#### Original name
Leptoporus duracinus Pat., 1902

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Agaricomycetes/Polyporales/Polyporaceae/Tyromyces/Tyromyces duracinus/ Syn. Antrodiella duracina/README.md

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: mdoering/backbone


text:
# Dapper Migrations with FluentMigrator and ASP.NET Core
## https://code-maze.com/dapper-migrations-with-fluentmigrator-and-asp-net-core

In this article, we are going to show you how to use the FluentMigrator library to create data migrations with Dapper and ASP.NET Core. In our previous article, where we learned a lot about Dapper and ASP.NET Core, we had to create our database and seed our data manually. Since Dapper doesn't support migrations, if we want to create them, we have to use some additional help. For that, we are going to use FluentMigrator.

These are the topics:

Project Creation and Dapper and FluentMigrator Installation

Using Dapper and FluentMigration to Create a Database Migration

Adding Tables to the Database Using FluentMigrator

Seeding Data with FluentMigrator

Reverting Migrations

Conclusion

license: MIT

branch_name: refs/heads/main


text:
# sef.kloninger.com AKA sefk.github.io

This is my personal blog. It is a Nikola static site hosted by
Github pages.  This repo contains the source files. The repo for
the target files, [sefk.github.io](http://github.com/sefk/sefk.github.io)
is included as a submodule.

# Instructions

The general workflow is:

1. **Write**. I like writing in Markdown with vi. Green characters on a
   black background.

2. **Review**. Nikola has a nice feature to automatically rebuild your
   project whenever something changes.  The -b option fires up a
   localhost browser that refreshes with every save.  Very nice
   workflow.  Command is ```nikola auto -b -p 8888```. The port
   is in case the default port (8000) collides your dev environment.

3. **Publish**.  Check in the changes to this repo and the ```output```
   subdirectory which has the build products.

4. **Repeat**

## Install Notes

The target repo for the content is a git submodule. After you first checkout, do a
```git submodule init``` to pick it up.

### lxml error

If you're seeing this:

    fatal error: 'libxml/xmlversion.h' file not found
    error: command 'cc' failed with exit status 1

Then try this:

    brew install libxml2
    brew install libxslt
    brew link libxml2 --force
    brew link libxslt --force

    CPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2 CFLAGS=-Qunused-arguments CPPFLAGS=-Qunused-arguments pip install lxml

Not sure the brew steps are req'd or not. That last step is what did it. From [this StackOverflow answer](http://stackoverflow.com/questions/19548011/cannot-install-lxml-on-mac-os-x-10-9)

repository: sefk/sef-site

repo_name: sefk/sef-site


text:
# Magick Metadata

The segment of data within the `battle_pack.bin` contains the sort
order, gil cost, icon, and name of all Magicks.

### How to find
The battle pack file's size is variable, so it is necessary to find a
signature within the binary data to locate the magick metadata. The
signature is as follows:

`0x51, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00`

After locating this signature, the array begins 28(0x1c) bytes from the
**start** of the signature.

### Struct Format

The format is an array of structs, each with format as follows:

| Offset | Desc       | Type |
|:-------|:-----------|:-----|
| 0x0    | Gil Value  | u16  |
| 0x2    | Unknown    | u8   |
| 0x3    | Icon ID    | u8   |
| 0x4    | Name ID    | u16  |
| 0x6    | Sort Index | u8   |
| 0x7-8  | Unknown    | u16? |

### Array Items

Each item in this array is ordered according to it's internal ID.
Mappings between ID and vanilla names can be found in
[base_order.txt](../../src/magick_order/base_order.txt)

gha_language: Rust

gha_license_id: MIT


text:
angular-kinetic-drawing-app
===========================

A proof of concept drawing app using angular js and kinetic js.

For now I just added circle only. It could be customized with lots of other shapes too.

http://oneto018.github.io/angular-kinetic-drawing-app/

ParamReader
------------
In this project I created a very simple directive 'atool' which takes [paramReader.html](https://github.com/oneto018/angular-kinetic-drawing-app/blob/master/paramReader.html) as template. The code for atool directive lies in the [script.js](https://github.com/oneto018/angular-kinetic-drawing-app/blob/master/js/script.js).

It is far from complete. But I believe it would be really useful. I couldn't create an extensive documentation about it because its not that big a deal. Most of the heavywork done by angular js by itself.Anyway I am writing an overview.

I created this directive a generalized param reader ie., whenever you need to get a bunch of parameters from user with an ui. For example in this project, I needed to get a number of properties about circle to draw. Using this directive its really easy to get arbitrary params.It also provides hooks for change callbacks and a submit callback.

This directive creates a scope of on its own but all the things you specify belongs the scope in which you use the directive. Its best understood in an illustration.

In HTML,

In JS,

		function myCtl($scope){

			$scope.circle1 = {};

			//config to create a form ui , the form items and its types
			$scope.toolsConfig={
				properties:[
					{name:'radius',type:'number',initial:5,label:'radius'},
					{name:'cx',type:'number',initial:50,label:'center X'},
					{name:'cy',type:'number',initial:50,label:'center Y'},
					{name:'strokeWidth',type:'number',initial:4,label:'stroke width'},
					{name:'fillColor',type:'color',label:'Fill Color',size:'40'},
					{name:'strokeColor',type:'color',label:'Stroke Color',size:'40'},
					{name:'id',type:'text',label:'Name',size:'40'},
					{
						name:'ctype',type:'select',label:'Type of the circle',size:'40',
						options:[
							['option1','value1'],['option2','value2'],['option3','value3'],['option4','value4']
						]
					},
				],
				title:'Circle'
			};

			$scope.changeHandler = function(){
				//this would be called on when any one of the properties change
				//do something with $scope.circle1. It contains the values users entered
			};

			$scope.submitHandler = function(){
				//this would be called when they finally click submit button automatically created by the directive
				//do something with $scope.circle1. It contains the values users entered
			};

		}

Important thing to note is , I included a non-html native input type color, for which I used a color picker module ,https://github.com/buberdds/angular-bootstrap-colorpicker  in the project. Likewise special kind of inputs also can be created.


text:
# Avromatic

[![Build Status](https://circleci.com/gh/salsify/avromatic.svg?style=svg)][circleci]
[![Gem Version](https://badge.fury.io/rb/avromatic.svg)](https://badge.fury.io/rb/avromatic)

[circleci]: https://circleci.com/gh/salsify/avromatic

`Avromatic` generates Ruby models from [Avro](http://avro.apache.org/) schemas
and provides utilities to encode and decode them.

**This README reflects Avromatic 2.0. Please see the
[1-0-stable](https://github.com/salsify/avromatic/blob/1-0-stable/README.md) branch for Avromatic 1.0.**

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'avromatic'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install avromatic

See the [Logical Types](#logical-types) section below for details on using
Avromatic with unreleased Avro features.

## Usage

### Configuration

`Avromatic` supports the following configuration:

#### Model Generation

* **schema_store**: A schema store is required to load Avro schemas from the filesystem.
  It should be an object that responds to `find(name, namespace = nil)` and
  returns an `Avro::Schema` object. An `AvroTurf::SchemaStore` can be used.
  The `schema_store` is unnecessary if models are generated directly from
  `Avro::Schema` objects. See [Models](#models).
* **nested_models**: An optional [ModelRegistry](https://github.com/salsify/avromatic/blob/master/lib/avromatic/model_registry.rb)
  that is used to store, by full schema name, the generated models that are
  embedded within top-level models. By default a new `Avromatic::ModelRegistry`
  is created.
* **eager_load_models**: An optional array of models, or strings with class
  names for models, that are added to `nested_models` at the end of
  `Avromatic.configure` and during code reloading in Rails applications. This
  option is useful for defining models that will be extended when the load order
  is important.
* **allow_unknown_attributes**: Optionally allow model constructors to silently
  ignore unknown attributes. Defaults to `false`. WARNING: Setting this to `true`
  will result in incorrect union member coercions if an earlier union member is
  satisfied by a subset of the latter union member's attributes.

#### Custom Types

See the section below on configuring [Custom Types](#custom-type-configuration).

#### Using a Schema Registry/Messaging API

The configuration options below are required when using a schema registry
(see [Confluent Schema Registry](http://docs.confluent.io/2.0.1/schema-registry/docs/intro.html))
and the [Messaging API](#messaging-api).

* **schema_registry**: An `AvroSchemaRegistry::Client` or
  `AvroTurf::ConfluentSchemaRegistry` object used to store Avro schemas
  so that they can be referenced by id. Either `schema_registry` or
  `registry_url` must be configured. If using `build_schema_registry!`, only
  `registry_url` is required. See example below.
* **registry_url**: URL for the schema registry. This must be configured when using
  `build_schema_registry!`. The `build_schema_registry!` method may
  be used to create a caching schema registry client instance based on other
  configuration values.
* **use_schema_fingerprint_lookup**: Avromatic supports a Schema Registry
  [extension](https://github.com/salsify/avro-schema-registry#extensions) that
  provides an endpoint to lookup existing schema ids by fingerprint.
  A successful response from this GET request can be cached indefinitely.
  The use of this additional endpoint can be disabled by setting this option to
  `false` and this is recommended if using a Schema Registry that does not support
  the endpoint.
* **messaging**: An `AvroTurf::Messaging` object to be shared by all generated models
  The `build_messaging!` method may be used to create a `Avromatic::Messaging`
  instance based on the other configuration values.
* **logger**: The logger to use for the schema registry client.

Example using a schema registry:

```ruby
Avromatic.configure do |config|
  config.schema_store = AvroTurf::SchemaStore.new(path: 'avro/schemas')
  config.registry_url = Rails.configuration.x.avro_schema_registry_url

  config.build_messaging!
end
```

NOTE: `build_messaging!` ultimately calls `build_schema_registry!` so you don't have
to call both.

#### Decoding

* **use_custom_datum_reader**: `Avromatic` includes a modified subclass of
  `Avro::IO::DatumReader`. This subclass returns additional information about
  the index of union members when decoding Avro messages. This information is
  used to optimize model creation when decoding. By default this information
  is included in the hash returned by the `DatumReader` but can be omitted by
  setting this option to `false`.

#### Encoding
* **use_custom_datum_writer**: `Avromatic` includes a modified subclass of
  `Avro::IO::DatumWriter`. This subclass supports caching avro encodings for
  immutable models and uses additional information about the index of union
  members to optimize the encoding of Avro messages. By default this
  information is included in the hash passed to the encoder but can be omitted
  by setting this option to `false`.

### Models

Models are defined based on an Avro schema for a record.

The Avro schema can be specified by name and loaded using the schema store:

```ruby
class MyModel
  include Avromatic::Model.build(schema_name: :my_model)
end

# Construct instances by passing in a hash of attributes
instance = MyModel.new(id: 123, name: 'Tesla Model 3', enabled: true)

# Access attribute values with readers
instance.name # => "Tesla Model 3"

# Models are immutable by default
instance.name = 'Tesla Model X' # => NoMethodError (private method `name=' called for #<MyModel:0x00007ff711e64e60>)

# Booleans can also be accessed by '?' readers that coerce nil to false
instance.enabled? # => true

# Models implement ===, eql? and hash
instance == MyModel.new(id: 123, name: 'Tesla Model 3', enabled: true) # => true
instance.eql?(MyModel.new(id: 123, name: 'Tesla Model 3', enabled: true)) # => true
instance.hash # => -1279155042741869898

# Retrieve a hash of the model's attributes via to_h, to_hash or attributes
instance.to_h # => {:id=>123, :name=>"Tesla Model 3", :enabled=>true}
```

Or an `Avro::Schema` object can be specified directly:

```ruby
class MyModel
  include Avromatic::Model.build(schema: schema_object)
end
```

A specific subject name can be associated with the schema:
```ruby
class MyModel
  include Avromatic::Model.build(schema_name: 'my_model',
                                 schema_subject: 'my_model-value')
end
```

Models are generated as immutable value
objects by default, but can optionally be defined as mutable:

```ruby
class MyModel
  include Avromatic::Model.build(schema_name: :my_model, mutable: true)
end
```

Generated models include attributes for each field in the Avro schema
including any default values defined in the schema.

A model may be defined with both a key and a value schema:

```ruby
class MyTopic
  include Avromatic::Model.build(value_schema_name: :topic_value,
                                 key_schema_name: :topic_key)
end
```

When key and value schemas are both specified, attributes are added to the model
for the union of the fields in the two schemas.

By default, optional fields are not allowed in key schemas since their values may
be accidentally omitted leading to problems if data is partitioned based on the
key values.

This behavior can be overridden by specifying the `:allow_optional_key_fields`
option for the model:

```ruby
class MyTopic
  include Avromatic::Model.build(value_schema_name: :topic_value,
                                 key_schema_name: :topic_key,
                                 allow_optional_key_fields: true)
end
```

A specific subject name can be associated with both the value and key schemas:
```ruby
class MyTopic
  include Avromatic::Model.build(value_schema_name: :topic_value,
                                 value_schema_subject: 'topic_value-value',
                                 key_schema_name: :topic_key,
                                 key_schema_subject: 'topic_key-value')
end
```

A model can also be generated as an anonymous class that can be assigned to a
constant:

```ruby
MyModel = Avromatic::Model.model(schema_name :my_model)
```

#### Experimental: Union Support

Avromatic contains experimental support for unions containing more than one
non-null member type. This feature is experimental because Avromatic
may attempt to coerce between types too aggressively.

For now, if a union contains [nested models](#nested-models) then it is
recommended that you assign model instances.

Some combination of the ordering of member types in the union and relying on
model validation may be required so that the correct member is selected,
especially when deserializing from Avro.

In the future, the type coercion used in the gem will be enhanced to better
support the union use case.

#### Nested Models

Nested models are models that are embedded within top-level models generated
using Avromatic. Normally these nested models are automatically generated.

By default, nested models are stored in `Avromatic.nested_models`. This is an
`Avromatic::ModelRegistry` instance that provides access to previously generated
nested models by the full name of their Avro schema.

```ruby
Avromatic.nested_models['com.my_company.test.example']
#=> <model class>
```

The `ModelRegistry` can be customized to remove a namespace prefix:

```ruby
Avromatic.nested_models =
  Avromatic::ModelRegistry.new(remove_namespace_prefix: 'com.my_company')
```

The `:remove_namespace_prefix` value can be a string or a regexp.

By default, top-level generated models reuse `Avromatic.nested_models`. This
allows nested models to be shared across different generated models.
A `:nested_models` option can be specified when generating a model. This allows
the reuse of nested models to be scoped:

```ruby
Avromatic::Model.model(schema_name, :my_model
                       nested_models: ModelRegistry.new)
```

Only models without a key schema can be used as nested models. When a model is
generated with just a value schema then it is automatically registered so that
it can be used as a nested model.

To extend a model that will be used as a nested model, you must ensure that it
is defined, which will register it, prior it being referenced by another model.

Using the `Avromatic.eager_load_models` option allows models that are extended
and will be used as nested models to be defined at the end of the `.configure`
block. In Rails applications, these models are also re-registered after
`nested_models` is cleared when code reloads to ensure that classes load in the
correct order:

```ruby
Avromatic.configure do |config|
  config.eager_load_models = [
    # reference any extended models that should be defined first
    'MyNestedModel'
  ]
end
```

#### Custom Type Configuration

Custom types can be configured for fields of named types (record, enum, fixed).
These customizations are registered on the `Avromatic` module. Once a custom type
is registered, it is used for all models with a schema that references that type.
It is recommended to register types within a block passed to `Avromatic.configure`:

```ruby
Avromatic.configure do |config|
  config.register_type('com.example.my_string', MyString)
end
```

The full name of the type and an optional class may be specified. When a class is
provided then values for attributes of that type are defined using the specified
class.

If the provided class responds to the class methods `from_avro` and `to_avro`
then those methods are used to convert values when assigning to the model and
before encoding using Avro respectively.

`from_avro` and `to_avro` methods may be also be specified as Procs when
registering the type:

```ruby
Avromatic.configure do |config|
  config.register_type('com.example.updown_string') do |type|
    type.from_avro = ->(value) { value.upcase }
    type.to_avro = ->(value) { value.downcase }
  end
end
```

Nil handling is not required as the conversion methods are not be called if the
inbound or outbound value is nil.

If a custom type is registered for a record-type field, then any `to_avro`
method/Proc should return a Hash with string keys for encoding using Avro.

### Encoding and Decoding

`Avromatic` provides two different interfaces for encoding the key (optional)
and value associated with a model.

#### Manually Managed Schemas

The attributes for the value schema used to define a model can be encoded using:

```ruby
encoded_value = model.avro_raw_value
```

In order to decode this data, a copy of the value schema is required.

If a model also has an Avro schema for a key, then the key attributes can be
encoded using:

```ruby
encoded_key = model.avro_raw_key
```

If attributes were encoded using the same schema(s) used to define a model, then
the data can be decoded to create a new model instance:

```ruby
MyModel.avro_raw_decode(key: encoded_key, value: encoded_value)
```

If the attributes where encoded using a different version of the model's schemas,
then a new model instance can be created by also providing the schemas used to
encode the data:

```ruby
MyModel.avro_raw_decode(key: encoded_key,
                        key_schema: writers_key_schema,
                        value: encoded_value,
                        value_schema: writers_value_schema)
```

#### Messaging API

The other interface for encoding and decoding attributes uses the
`AvroTurf::Messaging` API. This interface leverages a schema registry and
prefixes the encoded data with an id to identify the schema. In this approach,
a schema registry is used to ensure that the correct schemas are available during
decoding.

The attributes for the value schema can be encoded with a schema id prefix using:

```ruby
message_value = model.avro_message_value
```

If a model has an Avro schema for a key, then those attributes can also be encoded
prefixed with a schema id:

```ruby
message_key = model.avro_message_key
```

A model instance can be created from a key and value encoded in this manner:

```ruby
MyTopic.avro_message_decode(message_key, message_value)
```

Or just a value if only one schema is used:

```ruby
MyValue.avro_message_decode(message_value)
```

The schemas associated with a model can also be added to a schema registry without
encoding a message:

```ruby
MyTopic.register_schemas!
```

#### Avromatic::Model::MessageDecoder

A stream of messages encoded from various models using the messaging approach
can be decoded using `Avromatic::Model::MessageDecoder`. The decoder must be
initialized with the list of models to decode:

```ruby
decoder = Avromatic::Model::MessageDecoder.new(MyModel1, MyModel2)

decoder.decode(model1_messge_key, model1_message_value)
# => instance of MyModel1
decoder.decode(model2_message_value)
# => instance of MyModel2
```

### Validations and Coercions

An exception will be thrown if an attribute value cannot be coerced to the corresponding Avro schema field's type.
The following coercions are supported:

| Ruby Type | Avro Type |
| --------- | --------- |
| String, Symbol | string |
| Array | array |
| Hash | map |
| Integer | int |
| Integer | long |
| Float, Integer | float |
| Float, Integer | double |
| String | bytes |
| Date, Time, DateTime | date |
| Time, DateTime | timestamp-millis |
| Time, DateTime | timestamp-micros |
| Float, Integer, BigDecimal | decimal |
| TrueClass, FalseClass | boolean |
| NilClass | null |
| Hash | record |

Validation of required fields is done automatically when serializing a model to Avro. It can also be done
explicitly by calling the `valid?` or `invalid?` methods from the
[ActiveModel::Validations](https://edgeapi.rubyonrails.org/classes/ActiveModel/Validations.html) interface.

### RSpec Support

This gem also includes an `"avromatic/rspec"` file that can be required to support
using Avromatic with a fake schema registry during tests.

Requiring this file configures a RSpec before hook that directs any schema
registry requests to a fake, in-memory schema registry (instead of port 21001) and rebuilds the
`Avromatic::Messaging` object for each example.

Note: Use of `avromatic/rspec` requires installing the `sinatra` gem for the in-memory schema registry to work properly.

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/salsify/avromatic.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

repository: salsify/avromatic

gha_language: Ruby

repo_name: salsify/avromatic


text:
# SAG.jl

[Stochastic average gradient](https://arxiv.org/abs/1309.2388) (SAG) method for tracking a gradient made up of the sum of several sub-gradients. Combining SAG with an iterative method for first-order optimization method (e.g., gradient descent) results in a variance-reduced method for finite-sum optimization, e.g., empirical risk minimization. Because it's a variance-reduced method, the iterate converges to the optimum even when the gradients used to update the iterate are stochastic. See below for an example.

```julia

# initialization
n = 3                                       # number of sub-gradients
dims = (10,)                                # gradient dimension
sg = StochasticGradient(Float32, n, dims)

# compute one sub-gradient at a time
i = 1                                       # sub-gradient index
∇i = randn(dims)                            # replace with actual sub-gradient computation
update!(sg, i, ∇i)                          # writes ∇i into the gradient
sg ≈ ∇i                                     # = true; sg acts as an array

# compute another sub-gradient
j = 2
∇j = randn(dims)                            # replace with actual sub-gradient computation
update!(sg, j, ∇j)
sg ≈ ∇i + ∇j                                # = true; sg acts as an array

# using StochasticGradient for variance-reduced stochastic gradient descent
w = randn(dims)                             # iterate, e.g., a machine learning model
stepsize = 0.1                              # step size used for model updates
f = initialized_fraction(sg)                # fraction of sub-gradients that have been initialized; 2/3 in our case
w .-= (stepsize / f) .* sg                  # gradient descent step

```


text:
[![Build Status](https://travis-ci.com/rubyonracetracks/generic_app.svg?branch=master)](https://travis-ci.com/rubyonracetracks/generic_app)

# Generic App

Welcome to [Generic App](https://www.genericapp.net/), the #1 most comprehensive Rails app generator!  If you're not exactly a Generic App user, then you're not exactly viable at Startup Weekend or 24-hour web site challenges.

## Prerequisites
You need Docker and Docker-Compose on your host OS.  However, you do NOT Ruby in your host OS.

## Usage
* Download the source code of this repository.
* In your terminal, use the "cd" command to enter the root directory of this app.
* Enter the command "bash main.sh".  This starts Generic App.
* When prompted, enter the directory name, app title, and email address you wish to use in your new Rails app.  (The email address is used as the point of origin for confirmation emails sent to users and as the point of contact shown in the app itself.)
* Your new app will be downloaded into the new_apps directory, and it will be customized with the new directory name, app title, and email address that you provided.
* Use the "cd" command to enter the root directory of your new app.
* Then enter the command "bash build.sh; bash server.sh".  The build.sh script automatically sets up your new app.  When it is finished, the server.sh script activates the Rails server.  You will be able to view your new app at http://localhost:3000 and the MailCatcher interface at http://localhost:1080.


text:
# Simple Blackjack
This is a simple blackjack web application built using JavaScript, jQuery, HTML, and CSS.

# Quickstart
Try it [here](https://hbere.space/blackjack/).

# Backlog
* Add hand-splitting button & functionality when user draws a pair
* Add keyboard controls
* Add betting

# Functional Dependencies
* jQuery

# License
The content of this repository is licensed according to the [license listed here](https://github.com/hbere/blackjack/blob/master/LICENSE).

repository: hbere/blackjack

repo_name: hbere/blackjack


text:
---
name: 🛠 Bug report
about: Create a report to help us improve
title: "[Bug Report] Good bug title tells us about precise symptom, not about the root cause."
labels: "bug"
assignees: ""
---

## Description
<!-- A clear and concise description of what the bug is. -->

## mail handler version
<!-- x.y.z or commit hash -->

## Steps to Reproduce
<!--
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
-->

## Expected Behavior
<!--
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.
-->

## Actual Behavior
<!-- What happens actually so you think this is a bug. -->

## More Information

gha_language: Python


text:
Cadejo
======

Cadejo is a MIDI management tool for use with Overtone,
Some of its features are:

* Multitimberal
* Arbitrary key splits and layering
* Tuning tables for alternate scales
* Mapping functions for MIDI velocity, continuous controllers and channel pressure.
* Separate mono and polyphonic keymodes, additional keymodes may be implemented later.
* Program banks

#Instruments

The Cadejo repo contains 4 full feature instruments:
* ALGO - an 8 operator FM synthesizer.
* Alias - a subtractive synthesizer with extensive modulation routing.
* MASA - an organ roughly equivalent to the Hammond B3.
* Combo - a simpler organ chiefly used for demonstration purposes.

Each instrument includes a program bank containing several program or
'patch' definitions.

## Cadejo Structure

Cadejo uses a hierarchical tree structure with the general form

<code>[midi-port] --> scene --> channels --> performance --> instrument </code>

Each node has a set of properties in the form of key/value pairs and
all nodes automatically inherit the properties of their parent. If a node
defines a property also defined in one of its ancestors the local value
shadows the parent's value and takes priority. As a concrete example each
scene has the property :tuning-table which defaults to a standard 12-note
tuning with MIDI key 69 producing A440. Any alternate tuning table defined
at either the channel or performance level will take precedence over this
default value.

###Scene

A Scene is the root node for a Cadejo tree. It is always connected to a
single MIDI input port and always has 16 child nodes corresponding to the
16 MIDI channels. A scene may also contain default properties for the local
environment. Two such properties are automatically defined for each scene

* :tuning-table - A standard 12 notes per octave scale with MIDI key 69 = A440
* :velocity-map - A linear function which maps MIDI velocity values (0-127)
to a *normalized* range of (0.0-1.0)

###Channel

Each scene has 16 child nodes corresponding to the 16 MIDI
channels. Typical properties defined at the channel level include
pitch-bend range, channel-pressure maps, velocity maps, and MIDI continuous
controller assignments. Each channel may have 0 or more *performance* child
nodes. It is the combination of performance nodes under a channel which
allow for key-splits and layering.

###Performance

A performance may be viewed as a container which holds reference to the
various SuperCollider synths, buses, banks and keymodes which define an
instrument.

## Installation

Cadejo has no requirements other then a working copy of Overtone.

## Usage

Prior to first usage a MIDI port must be established by setting the value
of midi-input-port in cadejo/demo.clj. Once the device has been set
navigate to the main Cadejo folder and start a Clojure REPL. If all goes
well Cadejo should bootstrap and after a few seconds be ready to play. As
Cadejo loads several lines of text will be displayed. Once Cadejo is loaded
it should display the text "Ready..."

The default demonstration program creates instruments on MIDI channels 0,
1, 2 and 3. All instruments have several programs changes available via
MIDI program change messages. Program number 127 is special and produces a
random patch.

__WARNING__

    The Alias instrument is very complex and capable of creating speaker
    destroying sub-sonics, particularly when using the random program
    generation feature. For the most part it behaves but please keep
    monitor levels down until you know what it is doing.

At some point it is hoped that a configuration file feature will be
added. For the moment demo.clj doubles as the configuration file.

## Documentation

Preliminary documentation may be found in the cadejo/docs folder.
Documentation for the Combo instrument doubles as an example of how to
integrate Overtone instruments into a Cadejo context.

### Bugs

Cadejo contains a few known bugs. These are tracked in the file cadejo/BUGS.

## License

Copyright © 2014 Steven Jones

repository: plewto/Cadejo

gha_language: Clojure

repo_name: plewto/Cadejo


text:
thankYouEthanBrown

[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)

This is a tracker of my JS learning progress with [Ethan Brown's](https://github.com/EthanRBrown) 'Learning JavaScript 3rd edition' During the read, I put the code examples from each book chapter into respective repository folders. Short notes, new vocabulary and other noteworthy pieces of information were stored in this file. I hope you find these useful.

> ☝ **NOTE: You should never rely on someone else's notes and read this book on your own. But it might be a good idea to check underwritten bullets to find something you are yet unfamiliar with. Things, that look `like this` below can be used as a markers: if you are uncertain what the marked term(technology, web resource, person, book, etc.) means, then it could be a good idea to read the respective chapter of the book and/or google that term to know more.**

**📖 Contents:**

- [Chapter1](#Chapter1)
- [Chapter2](#Chapter2)
- [Chapter3](#Chapter3)
- [Chapter4](#Chapter4)
- [Chapter5](#Chapter5)
- [Chapter6](#Chapter6)
- [Chapter7](#Chapter7)
- [Chapter8](#Chapter8)
- [Chapter9](#Chapter9)
- [Chapter10](#Chapter10)
- [Chapter11](#Chapter11)
- [Chapter12](#Chapter12)
- [Chapter13](#Chapter13)
- [Maintainers](#maintainers)
- [Contributing](#contributing)
- [License](#license)

## Chapter1
1.  JavaScript is not Java. It is a realization of the ECMAScript language.
ECMAScript 6 (ES6) was published in June 2015 and was also referenced as `"Harmony"`, `"ES2015"` or `"ECMAScript2015"`.
2.  ES6 is basically `syntax sugar` over ES5 which really had a lot of changes over the previous standard. Nevertheless, ES6 features help coder a lot and fix several issues present in language earlier.
3.  `'use strict'` directive is not a command, nor a function or an object. It is just a string that tells your browser to slightly change its behavior while parsing and running the code. It does not 'switch on' the ES6 syntax.
4.  You can use a transpiler to automatically convert your ES6 code to older syntax if you need it for compatibility reasons.
5.  This book was not created to cover all aspects of ES6 in detail, some other good references are `Mozilla Developer Network`, or `JavaScript: The Definitive Guide by David Flanagan` (it does not cover ES6 now, but as for May 2019 some chapters of the new revision are available on Amazon as early access).
6.  Choose a good code editor to support you during the way. Most of the modern editors go with some useful features like syntax highlighting, words autocompletion and more.
7.  Before you know what you are doing be extremely attentive to each symbol you type from the source. You will definitely waste half an hour one day because of one wrong semicolon.
8.  Put your CSS in the header
    `<link  rel="stylesheet" href="main.css">`
Put your scripts to the end of the body by default. There are several reasons for this, that will be discussed later
    `<script  src="main. js"></script>`
9.  Open dev tools with F12 in most of the browsers. If you go to console then, use `<Ctrl+Shift+K>` to shorten the way.
10. CDNs aka content delivery networks is an easy way to include public JS libraries to your project. We will use jQuery and PaperJS in this chapter's example. Yes, jQuery is as old as you, but it is still commonly used and a lot of tools are based on it.
11. Boilerplate is just a repetitive standard piece of code that you use to set up things like PaperJS or other external libraries.
12. Asynchronous events are the ones that happen without your control. The user decides to click, or external script finishes work - you never know **exactly** when the event happens. As easy as that.
13. The result of this chapter's exercise looks more or less like this:
![chapter1 result](chapter1/img/example_chapter1.png)

## Chapter2

1.  'Coding' involves not only the code editor and a coding language. You should know about things like:
`git` - version control system
`node` - go with npm and let you execute JS code without a browser
`GULP` - project builder
`Babel` - transcompiler
`ESLint` - linter
2.  Do you know command shell essentials?
    `pwd`
    `ls`
    `mkdir`
    `cd`
    `cd ..`
3.  Do you know git essentials?
    `git init`
    `.gitignore`
    `git status`
    `git add -A`
    `git commit -m "I know how to commit"`
    `git push`
    `git log`
4.  Do you know Node essentials?
    `node -v`
    `npm -v`
    `npm install` [packageName] [--options]
    `package.json`
    `npm install`
5.  Modules, that you install using npm (or yarn as an alternative) are called dependencies of your project. You use a package manager to download all the dependencies automatically.
6.  You use GULP to do a lot of repetitive tasks like running a list of commands one by one several time a day in an easy way. It might be scary to start using it, but after you invest a day in it completing tutorials and trying things out, you will like it.
7.  There are common project structure principles to follow. Do not put all your files in one folder.
8.  As coding practice in this chapter you will:
    `Initialize npm in project folder`
    `Install GULP as dev-dependancy`
    `Create GULP tasks` (check bullet 9. for an explanation of 'dependency' word used in the book's example)
    `Start the task manager from comand shell` (check bullet 10. for a possible solution for a error you might get at this step)
9.  NOTE Dependencies of the whole project **as files** will be downloaded by npm. We put it in gulpfile.js as well to be able to use these with GULP **as JS external libraries**.
10. Ethan seems to be using gulp3 while writing the book and following the book's instructions you will get gulp4 from npm with a slightly different approach to callback functions. The result may be the following:
![gulp4 callback error](chapter2/img/gulpCBerror.png)
To make it work add (cb) to the task functions (you can check the gulpfile example in chapter2 folder). There are different methods to provide a correct callback in gulp4, check gulp documentation and search for 'callback' keyword to learn why's and how's.

## Chapter3

1.  Data types are abstractions over 'zeroes and ones' to represent numbers, strings, dates and so on.
2.  Data storage mechanisms include `variables, constants, and literals`.
3.  There are `primitive` immutable data types and mutable `objects`. Number, String, and Boolean are primitives, though all of these have respective built-in object companions in JavaScript. Null, Undefined and Symbol are primitives as well. All the rest are objects.
4.  `О.1 + О.2 = О.30000000000000004`
5.  Number as an object has some neat features: `Number.EPSILON`, Number.MAX_VALUE, Number.MIN_SAFE_INTEGER and more.
6.  const s = "In JavaScript, use \\ as an `escape character` in strings";
7.  `Template string` is:
let currentTemp = 21.5;
const message = `` ` ``The current temperature is `$`{currentTemp}\u00b0C`` ` ``;
8.  3 + '30' = '330';
3 * '30' = 90;
9.  Symbols are ES6 update, each symbol is unique which is good for identifiers for example. `const RED = Symbol();`
10. When in doubt prefer `null` over `undefined`.
11. An object is a container and its contents are subject to change (contents change, but the object is the same). Contents of objects are called `object members or properties`.
12. There is `computed member access` option in case you need 'bad' property names in your object.
Example:
`myobject[invalid spacing in name]` = "Still valid key, though cannot be accessed using a standard .dot operator";
13. A function can be added to an object as ordinary key-value pair. Key will be that function name, value - function body.
14. Delete property with `delete objectName.objectProperty`;
15. Number, String, and Boolean data types seem to have properties because, after a call, a temporary object of a respective type is created. You can assign a property to a primitive with no visible error because that property will be assigned to a temporary object. Still, this data will be lost as the object is destroyed immediately after the call.
16. An array is a special object with a fixed order of elements. Arrays can contain an element of any data type. Example:

const arr = ['true',
              false,
              null,
              {1: 'Even objects!'},
];

17. A regular expression or `regex` is a syntax for search/replace operations in strings.
`const email = /\b[a-z0-9._-]+@[a-z_-]+(?:\.[a-z]+)+\b/;`.
18. Convert strings to numbers using `Number(); parseInt(); parseFloat();`.
19. Convert  all JS objects to strings using `.toString();` method
20. Convert all values to boolean using `!!` or `Boolean();`.
21. There was no coding exercise in this chapter.

## Chapter4

1.  `Flowchart` is a visual representation of the program workflow.
2.  In this chapter you can consider `truthy === true` and `falsy === false`. More coming in chapter 5.
3.  When you add { and } in your JS code you create a `block statement or compound statement`.
4.  Generally, indents do not affect interpreter, however correct indentation is essential for clean, readable code.
5.  Remember that `` console.log(`a string with ${something}`);`` will return the value of `something` but `console.log('a string with ${something}');` won't. **Some revisions of the book have ' instead of ` in the code examples.**
6.  Control program flow with conditions (if...else, switch), loops (while, do...while, for), and special operators (break, continue, return, throw).
7.  `Metasyntax` is used in the book to describe program flow in this chapter. It is also used in Mozilla Developer Network.
8. Cycle  `for([initialization]; [condition]; [final_expression]) {operators}` works this way: initialization -> check condition -> execute operators -> execute fina expression -> check condition and so on.
9.  Switch operator's cases inside the function can be written with returns instead of breaks.
10. `for ... in` and `for ... of` cycles are good for iteration in objects and arrays.
11. Use return or break to avoid unnecessary calculations.
12. Remember that `let i = 0;` inside for cycle will make `i` not visible after the cycle.
13. Use `decreasing index` to loop through an array when you modify the array in the same loop. Array modification can change the exit conditions or you can even skip elements because indexes changed.
14. In this chapter, you create 'Crown and Ancor' game to practice program flow control. The code can be found in the chapter4 folder.

## Chapter5

1.  False in JS:
    `
    - undefined
    - null
    - false
    - 0
    - NaN
    - '' empty string`
2.  Logical operators in JS works not only with logical typed of data; moreover, the `returned value can also be different from logical type`.
3.  Empty array `arr = [];` is true, use `arr.length` instead when you need an empty array to be false.
4.  Prefer strict equality over abstract equality. Two values are strictly equal when they link to the same object or have the same type and value (for base types).
5.  Checking equality of non-integer numbers may fail because of the limited accuracy of numbers like 0.1.
6.  \+ operator is used as a sum and as a concatenation.
7.  `(x || y) && x !== y` is equivalent to XOR logical operator.
8.  `Short-circuit evaluation` is used by JS when the first argument in logical expression immediately gives the answer. For example in (x && y) when x has false it does not matter what value y has.
9.  Be attentive at table 5.6. Some revisions of the book have an error in it.
![Logical operators table is incorrect](chapter5/img/logicalOperators.png  Refer to MDN for a good short explanation:
![Logical operators logic](chapter5/img/mdn.png)
10. p.122 example before table 5.9 can also be incorrect. Comma operator will not work as intended. Try this instead:

const arr = [3, 5, 8, 11, 4, 13, 1];
let n, i=0;

while((n = nums[i]) < 10 && i++ < nums.length) {
  console.log(`Number less than 10: ${n}.`);
}
console.log(`Number greater than 10 found: ${n}.`);
console.log(`${nums.length - i} numbers remain.`);

11. = operator is also an expression, so it returns the assigned value, which makes chain assignment possible `let x = y = "both x and y gets this string"`;
12. `Destructuring assignment` lets you to assign individual elements of an object or the array to separate variables.
13. Destructuring assignment makes value exchange possible without a temporary variable.

let a = 5, b = 10;
[a, b] = [b, a];

14. There was no coding exercise in this chapter.

## Chapter6
1.  Function is a set of operators, that can be called using that function name folowed by a set of parenthesis. Functions form a kind of subprograms in your code. Each function has a body - set of operators, that are executed as a single block of instructions.
2.  A function call is an expression, so it returns a `function's return value`.
3.  Formal arguments of a function get values after a function call and become `actual arguments`. Actual arguments are simular to the variables, but exist only inside the function.
4.  Base types are `value type`. When you assign these variables to other variables using =, you `copy the value` to the new variable. Objects are `reference type` and a link to the object is copied to a new variable or  transfered to a function.
5.  Destructured function argument allows to use object's elements as function arguments.

function getSentence({subject, verb, object})
  return `${subject} ${verb} ${object}`;
const о = {subject:  "I",
           verb:  "love",
           object:  "JavaScript",
};
getSentence(o); // "I love JavaScript"

6.  ES6 brings `default values` to the functions. Arguments with no value nor default still get 'undefined'.
7.  Wnen a function is an object property it is called this object's `method`.

const obj = {
  sayHi() {return "Hi!";},
  sayHello: function() {return "Hello!";},
}

8.  Keyword `this` is usually associated with function properties of objects. When this is called it is assigned to the object, that called this.
9.  `const that = this` is often used to fix 'this' problem in nested functions. Call to 'this' from a function iside the method assigns global object to 'this' (or to undefined in `strict mode`).
10. `IIFE` stands for Immediately Invoked Function Expression
11. `Arrow notation` let you create an arrow function with different syntax. Arrow function has special 'this' handling, they can't be used as an object constructor, special variable 'arguments' is not available.
12. 'this can be defined using several special methods like `call, apply and bind` even if the function is defined outside of any of your objects.
13. Method `call` recives the object to be used as 'this' as the first argument. Next arguments are used as the arguments of your function.
14. Method `apply` works the same way except for the arguments, that are passed as an array.
15. Method `bind` associate a function with an object permanently and wthis will not be overrriden with the next 'call' or 'apply'calls.

## Chapter7
1.  Variables can be in certain `scope`, `visibility`, and `execution context`. There are `global scope`, `block scope`, `function scope`.
2.  Function's visibility area include variables, that were defined before this function definition.
3.  `Variable masking` happens, when you have the variables with the same name in nested blocks. You can't call the variable from the outer block when you are inside the inner block even though both of these variables are in scope.
4.  Function definitions are hoisted, function expressions are not.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.

## Chapter8
1. Arrays are special objects because of the fixed element's positions defined by elements numerical index. Arrays can store elements of all data types (including object) in any combination.
2.  Assigning a value to unexisting array element creates it. If the index of this element (n) is much higher than array length, then the array will be auto populated to (n-1) length with 'undefined' data type elements.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.

## Chapter9
1.  Objects are indexed with a string or a symbor, while arrays are indexed with numbers. Another major difference is that arrays are ordered, while object's properties are not.
2.  `for ... in` is a standard way to loop over object's properties. It does not work with symbol keys though.
3.  `Object.keys` is another way. It is a method and it returns all keys of object as an array.
4.  Object oriented programming main idea is to describe real-world objects as a logically connected set of properties and possible actions or functions. In OOP there is a division between an abstract object (a car) and the specific object (the car with known make model, owner and so on).
5.  An `instace` is created from a `class` by executing the `constructor`, which initialize the instance, its properties, and its `methods`. If some method refers to the class at whole and not to a specific instance of it, there is a room for a `class method`. Describing complex things may also involve `subclass` and `superclass` addition.
6.  `instanceof` is an operator that can check if your object is an instance of class.
7.  By convention prefixing a property with underscore mean `private property`. Use it with `accessor properties` to protect a property from direct value editing.
8.  154page
9.
10.
11.
12.
13.
14.

## Chapter10
1.  `maps and sets` are two new data structures in ES6. Maps are similar to Objects, sets are similar to Arrays.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
## Chapter11
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
## Chapter12
1.  Every iterable object (like an array for instance) has a built-in `iterator protocol`. It can be used to return an object consisting of two properties: `value` and `done`. Inside the 'value' property is the next itarable element while the service property 'done' indicates if there are more elements to iterate on.
2.  Get iterator by calling `.values()` method. You can write your own by modifying a Symbol.iterator method.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
## Chapter13
1.   When a function has no side effects and always return the same output for the same set of inputs it is called a `pure function`.
2.  Prefer pure functions because they are easier to test, easier to understand and make the code more portable.
3.  `typeof function` is a function, but `function instance of Object` is true as well.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
## Maintainers

[@skrikl](https://github.com/skrikl)

## Contributing

PRs accepted.

Small note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.

## License

MIT © 2019 Sergey Kriklivyy

repository: skrikl/ThankYouEthanBrown

gha_language: JavaScript

repo_name: skrikl/ThankYouEthanBrown


text:
# AngularJS Busy directive #

This demo show an implementation of an angular answer to the multiple click problem.
I use several directives :

0. One to bind on the 'click' event of a button or an hyperlink
0. One to bind on the 'submit' event of a form element.
0. One to add a visual information that prevent user action. For this poart I am using the [blockui](http://jquery.malsup.com/block/) component.

## Depedencies ##

0. [jquery 2.1.3](https://jquery.com/)
0. [blockui](http://jquery.malsup.com/block/) or [on GitHub](https://github.com/malsup/blockui/)
0. [angular 1.4.0](https://angularjs.org/)

## Start the demo ##

To play this demo, you will need [NodeJS](https://nodejs.org/download/).
At the actual location, open a command (admin mode may be required with Windows).

### install dependences with npm ###
> windows : npm install

>Linux : sudo npm install

### start the demo ###

> windows : node server.js

> Linux : sudo node server.js

### How to use the demo ###

repository: scorbiere/AngularJS-Demo

repo_name: scorbiere/AngularJS-Demo


text:
# Wordplay Assistant - C libraries

#### Build

make all - Build all libraries

make assistant - Build the assistant tool

#### Tools

makegaddag - Generate a GADDAG file (see https://en.wikipedia.org/wiki/GADDAG)

makedawg - Generate a DAWG file (see https://en.wikipedia.org/wiki/Deterministic_acyclic_finite_state_automaton)

libs/lassistant.so - Shared library

assistant - Example usage of the library

repository: babueter/wordplay-assistant

repo_name: babueter/wordplay-assistant


text:
---
external help file: PsTodoTxt-help.xml
Module Name: PsTodoTxt
online version: https://www.github.com/pauby/pstodotxt
schema: 2.0.0
---

# Export-TodoTxt

## SYNOPSIS
Exports todotxt objects.

## SYNTAX

```
Export-TodoTxt [-Todo] <PSObject> [-Path] <String> [-Append] [<CommonParameters>]
```

## DESCRIPTION
Exports todotxt, previously created with ConvertTo-TodoTxt,
to a text file.
Before exporting the todotxt objects are converted
back to todotxt strings by calling the cmdlet
ConvertFrom-TodoTxt.

## EXAMPLES

### EXAMPLE 1
```
$todo = Import-TodoTxt -Path c:\input.txt
Export-TodoTxt -Todo $todo -Path c:\output.txt
```

Converts the todotxt objects in $todo to todotxt strings and writes
them to the file c:\output.txt.

### EXAMPLE 2
```
Import-TodoTxt -Path c:\input.txt | Export-TodoTxt -Path c:\output.txt -Append
```

Imports todotxt strings from c:\input.txt and then exports the file c:\output.txt
by appending them to the end of the file.

## PARAMETERS

### -Todo
Object(s) to export

```yaml
Type: PSObject
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

### -Path
Path to the todo file.
The file will be created if it does not exist

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Append
Append to todo file

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

## NOTES
Author: Paul Broadwith (https://github.com/pauby)

## RELATED LINKS

[https://www.github.com/pauby/pstodotxt](https://www.github.com/pauby/pstodotxt)

repository: pauby/PsTodoTxt

gha_language: PowerShell

repo_name: pauby/PsTodoTxt


text:
# SUSE Apprentices Timesheets made easy

## Contributions are welcome:
   + [ ] Implement working hours carryover(Stundenübertrag)
   + [ ] Possibility to add more days with one command for vacation, etc.
   + [ ] `export` should accept date without day, like this `-d 10.2019`
   + [x] Adding "special" days like: vacation, school; only date and comment needed for that
   + [x] Method to fill in records from json file to xlsx exported file
   + [x] Method to create file names like `timesheet_2019_10.json` `timesheet_2019_10.xlsx` and implement where needed
   + [x] Method to load specific json files of the given date's month and year

## Structure
+ Data is saved internally as `json` strings
+ Exports to `xlsx`, therefore: `pip install -r requirements.txt`

## How it looks like
### Help
```
./azubi-timesheet.py --help
usage: azubi-timesheet [-v] [-n] [-s] [-d DD.MM.YYYY] [-w HH:MM-HH:MM]
                       [-b HH:MM-HH:MM] [-c COMMENT] [-h]
                       [add | delete | update | export]

Keep track of your work hours. Add, delete, update records. Export and print
at the end of the month!

positional arguments:
  add | delete | update | export
                        Choose one of these subcommands.

optional arguments:
  -v, --version         Show program's version number and exit.
  -n, --non-interactive
                        Do not ask anything, use default answers
                        automatically.
  -s, --special-record  Special records only need a date and a comment.
  -d DD.MM.YYYY, --date DD.MM.YYYY
                        Date of the record.
  -w HH:MM-HH:MM, --work-hours HH:MM-HH:MM
                        Begin and end time of the work day.
  -b HH:MM-HH:MM, --break-time HH:MM-HH:MM
                        Begin and end time of the break.
  -c COMMENT, --comment COMMENT
                        Comment of the record, if needed.
  -h, --help            Show this help message and exit.
  ```

### Subcommands
+ `add` creates a new json string and appends it to the list
```
./azubi-timesheet.py add --date 07.10.2019 --work-hours 09:00-17:30 --break-time 12:00-12:30 --non-interactive
```
+ `add -s` adds special records like school, vacation, sick leave, where `--work-hours` or `--break_time` are **not** necessary
```
./azubi-timesheet.py add --date 09.10.2019 --comment "Berufsschule" --special-record
```
+ `update` finds record, updates it with the given data
```
./azubi-timesheet.py update --date 07.10.2019 --work-hours 10:00-18:30 --break-time 13:00-13:30 --non-interactive
```
+ `delete` removes record with given date
```
./azubi-timesheet.py delete --date 07.10.2019
```
+ `export` creates an `xlsx` document from the given date's **month** and **year**, day is not relevant
```
./azubi-timesheet.py export --date 01.12.2019
```

repository: tomschr/azubi-timesheet-python

repo_name: tomschr/azubi-timesheet-python


text:
# SugarScript
[AppGameKit's](https://www.appgamekit.com/) Tier 1 on steroids, inspired by
CoffeeScript and Python.

SugarScript is a modern, functional, statically typed language that compiles to
AppGameKit's Tier 1. It enables you to write games using AGK's interpreter, so
they can run on any platform with minimal setup.

Needless to say, you need to own AppGameKit Classic or Studio (it goes on sale
on
[Steam](https://store.steampowered.com/app/325180/AppGameKit_Classic_Easy_Game_Development/)
quite often!). Note that the compiler generates an `.agc` file, but to
automatically compile it up for you, it needs  access to the privative
AppGameKit compiler, which is only exposed in the **Classic** version. So Studio
users need to manually load up and compiler the generated `.agc` file.

# Syntax
For detailed information on SugarScript's syntax, check out [the syntax
documentation](doc/syntax.md). Below is a quick cheatsheet:

```
# assign
let name = 'Duchess'
let greeting = "Hello #{name}!" # string interpolation, only when using double-quoted strings

# conditional
if my_variable is true # `true` alias for 1, other aliases are `yes` and `on`
  do_something()
elif something_else() isnt "hello"
  do_something_else()
else
  do_this_other_thing()

# functions
def greet(name: string = 'Federico', age: integer, person: *Person) # pass Person by reference
  let result = age + 2
  return result

# built-in functions, as usual
let sprite = CreateSprite(LoadImage('hello.png'))

# arrays
let my_array = [1, 2, 3]
let empty_array = []: integer
let nested_array = [[1], [2, 3], []: integer]

# inline types
type Person(name: string)
let p = { name: "Federico" }: Person

# lambdas (anonymous functions)
let greeter = (name: string): string ->
  return "Hello #{name}!"

call(greeter, "Federico"): string

# unions
type Rectangle(x: float, y: float, width: float, height: float)
type Circle(x: float, y: float, radius: float)
type Shape(Rectangle | Circle)

# a shape can hold either a Rectangle, or a Circle
let shape: Shape
shape = { x: 100, y: 100, width: 200, height: 200 }: Rectangle
shape = { x: 100, y: 100, radius: 100 }: Circle

# to access unions, you must use the `with` statement
def area(shape: Shape): float
  with shape
    when rect: Rectangle
      return rect.width * rect.height
    when circle: Circle
      return 3.14 * circle.radius * circle.radius
    else
      return 0

# list comprehensions
let pairs = [i for i in [0, 1, 2, 3, 4] when i % 2 is 0]
let doubles = [i * 2 for i in [0, 1, 2, 3, 4]]

# remote requires
require 'a-local-file'
require 'https://github.com/.../a-remote-file.ss'
```

# Install

    $ npm install sugarscript

# Usage

```javascript
const { Compiler } = require('sugarscript')

const compiler = new Compiler()
const options = { // default options
  entry: 'main.ss',
  output: 'main.agc',
  compiler: 'C:\\Program Files\\Steam\\steamapps\\common\\App Game Kit 2\\Tier 1\\Compiler\\AGKCompiler.exe',
  generateOnly: false,
  compileAndRun: false,
  clearRemoteCache: false,
  x64: false
}
compiler.compile(options).then(() => console.log('Done!'))
```

# Why
The AppGameKit platform is impressive. Write once, deploy everywhere, with
minimal hassle. The API is powerful, supports 2D and 3D and has been worked on
for years, so it's quite mature.

The downside is that the Tier 1 dialect of BASIC is quite limited. It lacks most
of the features modern developers expect in a programming language. There are
alternative languages (C++, Python, Java, etc) but by using any of those
languages, you lose the portability.

SugarScript is a _transpiler_. It compiles directly to Tier 1, and in turn, it
can use AppGameKit's Classic compiler to generate bytecode, just like you'd
normally do with Tier 1. You can also load up and compile the generated `.agc`
file in Studio yourself if you want.

This allows developers to use a more powerful and overall _sweet_ programming
language without losing _write once, deploy everywhere_.

SugarScript is a modern, functional language, with features such as
[lambdas](doc/syntax.md#lambdas), [unions](doc/syntax.md#unions), [list
comprehensions](doc/syntax.md#list-comprehensions) and [remote
requires](doc/syntax.md#remote-require).

This opens up a whole new level of abstraction, much needed in Tier 1.

# Philosophy
* Expressive: If it can read like English, it's easier to understand.
* Concise: Indentation-based, compact syntax. Do more things with less code. Less code, less bugs.
* Strict: Linting tools exist for a reason, consistency is a good thing. It makes code easier to read.
* Powerful: [Lambdas](doc/syntax.md#lambdas), [Unions](doc/syntax.md#unions), [List Comprehensions](doc/syntax.md#list-comprehensions), and lots of syntactic sugar give you enough power to not miss mainstream languages
* Simple: It's just Tier 1 under the hood.

# Developing
Run tests with

    npm run test

You can watch tests as you write them with

    npm run watch

To run integration tests (slow) use

    npm run integration

repository: Qugurun/sugarscript

repo_name: Qugurun/sugarscript


text:
# Post Reporters
`livedoc` introduces a new type of reporter that allows the easy creation of any type of output without having to track metrics etc.

Each post-reporter is run after the main [ui-reporter](UI-Reporters.md) has completed. That is after all the tests have been executed. The rich meta-data of the test run is then passed to each of the registered post-reporters.

If you have a need to produce custom output after the tests have run, then a post-reporter is what you need.

Implementing a post-reporter is very easy and only requires implementing one interface:

```ts
interface IPostReporter {
    execute(results: ExecutionResults, options: any);
}
```

The `ExecutionResults` object contains all the results including all the details of the scenario. There is enough detail to reproduce the original output.

The object has too much detailed to reproduce here. However, this is a brief summary of the structure, which should give a good idea of what's available:

```
root
|__features*
|   |__feature
|       |__background
|       |__scenarios*
|       |   |__steps*
|       |       |_step
|       |__scenarioOutlines*
|           |__scenarioOutline:scenario
|               |__tables*
|               |__examples*
|                   |__example:scenario
|__suites
|   |__children*:suite
|   |__tests*

* = collection
: = inheritance
```

Most of the object also have a `Statistics` object which records a summary of the results at that level. Where an object has children the statistics will be a summation of all the child statistics. This can be used to determine the number of pass/fail test for a feature/scenario etc.

The `options` parameter has the following structure:
``` ts
class ReporterOptions {
    public colors: ColorTheme;
    public options: Object;
}
```

The options here refer to the mocha reporter options passed.

## Sample reporter
The following is the full source for the included [JSON Reporter](JSON-Reporter.md). It demonstrates how easy it is to create a custom reporter.

```ts
export class JsonReporter implements IPostReporter {
    public execute(results: ExecutionResults, options: any) {
        if (!options || !options["json-output"]) {
            throw Error("json reporter: you must specify an output file");
        }
        const file = options["json-output"];
        if (fs.existsSync(file)) {
            fs.unlinkSync(file);
        }

        // write out the results as a json file
        fs.writeFileSync(file, JSON.stringify(results));
        console.log("Json file: " + fs.realpathSync(file));
    }
}
```
## Included Post Reporters
[JSON Reporter](JSON-Reporter.md) - outputs model as a JSON file.

repository: dotnetprofessional/LiveDoc

gha_language: TypeScript

repo_name: dotnetprofessional/LiveDoc


text:
# NFT-Hunt

We create a website to better display what we are trying to accompmlish.

Website: https://zahifarah.github.io/nft-hunt/

Note: As a group, this is the first time any of us have tried to develop a dapp. A lot of time was spend watching videos, learning solidity, and mapping out what we should aim for as a final product. We set our sights pretty high and definitely did not achieve exaclty what we set out to do. Instead, we learned a whole lot about the strucuture of dapps and the approach we would take next time we tackle something like this.

Hardhat: A lot of time was spent researching how to implement the chainlink oracle in hardhat, but that did not come to fruition.
However, we did write a smart contract in hardhat that checks a longitude and latitude to see if it is in the specified location.
The real bummer is that we were not able to put it all together for a final product. Next year!

Our idea is to create a real world NFT hunt.

NFT Creator can place an NFT somewhere on the map.

NFT hunter can search for NFT's on the map.

Rules: Users will travel to predetermined locations to collect NFT’s representing those areas. The corresponding NFT will cost some eth.

The only way to aquire one of these NFT's is to be in the predetermined location.

If the user would like to purchase the NFT, they can initiate the smart contract using the eth in their wallet.

Initial Steps

After looking into the two leading decentralized geolocation projects, XYO and FOAM, it is obvious that the space has some serious development issues. Both of these projects are plagued by their inability to produce a dynamic location. This severely limits the usability of the network and renders it almost useless for our purposes.

As a temporary solution it is going to be best to use GPS data from a user’s phone. This would look like the following: A user walks up to a predetermined location. The user sends its location data to an oracle. The oracle sends the GPS data to the smart contract presiding over that area. If the users phone gps data is within the acceptable latitude/longitude combination, they will be given the oppotunity to purchase the NFT.

Other Ideas:
Use VRF to generate NFT’s on different parts on the planet. One could be generated for every square mile.

Can increase NFT generation based on density of population in those areas.

Takes a certain amount of time for that NFT to become purchasable in that location again. Include a map showing where the NFT is located and show distance from current user location.

Testing Steps:
1. Copy and paste the Get Location file into remix.
2. Compile and run the contract on the Kovan testnet.
3. This contract will need eth and link funding via metamask.
4. Link Faucet: https://kovan.chain.link/
5. Eth Faucet: https://faucet.kovan.network/ (You will need to login with github for this one)
6. Make sure you select the right contract.
7. After the contract has been created, you should immediately send 1 link to the contract. This will ensure that when you hit "Request Latitude" button the chainlink oracle is being paid.
8. Accpet the transaction.
9. Wait 30 seconds
10. Hit the Latitude button. It should be 2 :)

repository: iaverypadberg/NFT-Hunt

repo_name: iaverypadberg/NFT-Hunt


text:
# How to use the attestation extension

Requirements (see the installation instructions):
- Running WebProtégé instance (either as Docker container or using Maven).
- Deployed contracts (either in a local test blockchain, e.g., in Ganache or on a public network).
- [Metamask](https://metamask.io/) plugin for your browser.

## Setting up Metamask
1) Install the Metamask plugin for your browser. You may follow the [Metamask installation guide](https://metamask.zendesk.com/hc/en-us/articles/360015489531-Getting-started-with-MetaMask).
2) Open the extension and login to your account (if you have one) or create/import a new one by entering a Mnemonic (Secret Recovery Phrase). If you use the Ganache instance chose "Import wallet" and enter the Mnemonic phrase found in the `docker-compose.yml` file. The Mnemonic is a phrase of 12+ lower-case words.
3) If using a local blockchain, e.g., the Ganache instance configured in the `docker-compose.yml` file, you need to add a custom network as explained here: https://metamask.zendesk.com/hc/en-us/articles/360043227612-How-to-add-a-custom-network-RPC. For the Ganache instance, enter following values:
```
    RPC Url: localhost:
    Chain ID: 1
```
4) Switch to the network where the contracts are deployed (e.g., localhost for Ganache)

## Attesting to the provenance of an ontology in WebProtégé

1. Log into WebProtégé (by default https://localhost:5000 when using docker or https://localhost:8080 in DevMode) and import an Ontology, e.g., download one from [BioPortal](https://bioportal.bioontology.org), by pressing "Create new project".
![webprotege1.png](webprotege1.png)
1. Open the project and add a new view by clicking the menu icon of a tab and selecting "Add new view".
![webprotege2.png](webprotege2.png)
A popup appears. Select the portlet named "Ontology Attestation". Then place the view on the screen.
![webprotege3.png](webprotege3.png)
1. In the attestation panel (here on the right) select the IRI of the ontology to attest (the IRIs of imported ontologies are shown as well) with the dropdown menu.
![webprotege4.png](webprotege4.png)
1. Once an IRI is selected an attestation may be started by clicking "Sign". Metamask will then prompt to log in. If the popup does not appear, click the Metamask icon on the Plugin bar of your browser.
![webprotege5.png](webprotege5.png)
1. After unlocking Metamask a transaction request is shown. Make sure you have selected the correct network (see previouse section). Authorizing the transaction closes the popup and the result is displayed in the attestation panel.
![webprotege5.png](webprotege6.png)

repository: curtys/webprotege-attestation

gha_language: Java

repo_name: curtys/webprotege-attestation


text:
# Base application on Jboss 7 using mysql DB

**Status**: Tested
**Description**: Jboss 7 using mysql DB
**Maintainer**:       Cloudify
**Maintainer email**<EMAIL_ADDRESS>
**Contributors**:    [aharonmoll](https://github.com/aharonmoll)
**Homepage**:   [http://www.cloudifysource.org](http://www.cloudifysource.org)
**License**:
**Linux* sudoer permissions**:  Mandatory

**Build**: http://repository.cloudifysource.org/org/cloudifysource/2.3.0-RELEASE/gigaspaces-cloudify-2.3.0-ga-b3500.zip

**Release Date**: December 6th 2012

Tested on:
--------

* localCloud: CentOs on hp cloud
* EC2: Ubuntu and CentOs
* OpenStack: CentOs

Synopsis
--------

This folder contains a services recipes for the jboss 7 mysql.

The application itself is a basic one which was developed for the only purpose of showing how we can use mysql DB togther with jboss 7.

This recipe is comprised of two services:
* [mysql](../../services/mysql/README.md)
* [jboss](../../services/jboss/README.md)

repository: gkorland/cloudify-recipes

gha_language: Groovy

repo_name: gkorland/cloudify-recipes


text:
Bugs and feature requests only please. For help questions, check out the [forum](https://groups.google.com/forum/#!forum/tonejs).

**Note**: Browsers' [Autoplay Policy](https://github.com/Tonejs/Tone.js/wiki/Autoplay) leads to a lot of subtle and inconsistent bugs where Tone.js produces no sound. Check out the link for more information and the solution.

Please include a way to reproduce your issue

https://jsfiddle.net/1f60jkq4/ (tone@latest)
https://jsfiddle.net/z9marxbt/ (tone@next)

branch_name: refs/heads/dev


text:
# Servify

Run any command as a service.

## Installation

```bash
# install from the latest commit
cargo install --git https://github.com/whoan/servify.git --branch master
```

## Usage

```bash
servify -h
```

```
USAGE:
    servify [FLAGS] [OPTIONS] <COMMAND>

FLAGS:
    -b, --base64     Decodes payload in Base64
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -m, --method <METHOD>    HTTP method for the service (default: GET)
    -p, --port <PORT>        port for the service (default: 8080)
    -u, --uri <URI>          URI for the service (default: /)

ARGS:
    <COMMAND>    Command to be called as a service
```

## Examples

Run this in a terminal:

```bash
servify 'echo Hello World'
```
```
Command: echo "Hello World"
Service: GET http://<IP_ADDRESS>:8080/
```

And this in another terminal:

```bash
curl http://<IP_ADDRESS>:8080/
```
```
{"status":0,"stderr":"","stdout":"Hello World\n"}
```

### Use payload to provide content (as a file) for the command

Write some information on **data** field of JSON payload, and the content will be written to a file and appended to the command:

```bash
servify -m POST 'sed s/World/Mars/'
```
```
Command: sed "s/World/Mars/"
Service: POST http://<IP_ADDRESS>:8080/
```

In another terminal:

```bash
curl http://<IP_ADDRESS>:8080/ -H Content-Type:application/json -d"{\"data\": \"Hello World\"}"
```
```
{"status":0,"stderr":"","stdout":"Hello Mars"}
```

### Provide data as Base64

If you need to provide binary or "complex" (in terms of escape characters) data, you can insert it as base 64 in the payload, and use the switch `-b/--base64` to notify servify that should decode the data in advance:

```bash
servify -m POST --base64 'sed s/World/Mars/'
```
```
Command: sed "s/World/Mars/"
Service: POST http://<IP_ADDRESS>:8080/
```

In another terminal:

```bash
curl http://<IP_ADDRESS>:8080/ -H Content-Type:application/json -d"{\"data\": \"$(base64 -w0 <<<"Hello World")\"}"
```
```
{"status":0,"stderr":"","stdout":"Hello Mars\n"}
```

## TODO

- Learn Rust and make the code better

## License

[MIT](https://github.com/whoan/servify/blob/master/LICENSE)

repository: whoan/servify

repo_name: whoan/servify


text:
# EIoT-Project
The Electrical Internet of Things (EIoT) project was an initiative of Codensa S.A E.S.P, a power distribution company located in Bogotá, Colombia, and The T&T research group from the Universidad Nacional de Colombia, located in Medellín, Colombia.
This project intends to cover multiple electrical engineering applications in the electrical and power industry and subsequently, cover many automation applications of several disciplines.

## Update 01/Mar/2019
The LoRaWAN-v1-0-2-EIoT 2 folder contains the development of a LoRaWAN node which generates a random voltage value (directly applicable with a voltage input 0 - 3.3V). It uses the Mbed-OS and the LoRaWAN Mbed stack.

-----------------------------------------------------------------------------------

The LoRaWAN-v1-0-2-EIoT 3 folder contains the development of a LoRaWAN node that monitors electrical things including a fire detector sensor and an analogic output to convert the current 0 - 5 A to 0 - 3.3V. It uses the Mbed-OS and the LoRaWAN Mbed stack.

## Update 04/Jan/2019 (LoRaWAN)
The project was migrated to use the LoRaWAN standard. Currently the LoRaWAN version used is 1.0.2.
Possible network servers:
- TheThingsNetwork: https://www.thethingsnetwork.org/
- Loriot: https://www.loriot.io/
- The one this project uses: LoRaServer (deployable locally in your machines) - https://www.loraserver.io/

The Lorawan-v1-0-2-EIoT-1 folder contains a new development of the EIoT project complying LoRaWAN 1.0.2 specification using Mbed-OS and all the LoRaWAN Mbed stack.
More details are described in the readme file of such folder.

-------

## EIoT Web Server (LoRa - non-LoRaWAN)
This folder contains the source code of the EIoT Web Server.
The Web Server runs in Python using the framework Flask and the SQLite3 Database engine.
The GUI was designed over a Start Bootstrap open source template with some modifications.
To run the server is necessary to run the next commands in the root folder (flaskr/):
- . venv/bin/activate
- export FLASK_APP=flaskr
- export FLASK_DEBUG=true (or false)
- flask run --host=<IP_ADDRESS>

## SerialCom
It provides the code to run the interface between the Raspberry PI and the EIoT LoRa Gateway.
This is a single python file, but needs the physical serial connection between both devices to work.

## EIoT LoRa Gateway
This folder contains the mbed code of the LoRa device which acts as the gateway in the LoRa network.
Please refer to the SX1276GenericPingPong/GenericPingPong.cpp file to note the differences to the template (STM32 template).
The same content can be found in the mbed repository: https://os.mbed.com/users/sagilar/code/EIoT_LoRa_Gateway/

## EIoT LoRa nodes (1,2, and 3)
The folders contain the mbed code of the LoRa devices which act as nodes in the LoRa network.
Please refer to the SX1276GenericPingPong/GenericPingPong.cpp files to note the differences to the template (STM32 template).
The same content can be found in the mbed repositories:
- https://os.mbed.com/users/sagilar/code/EIoT_LoRa_node_1/
- https://os.mbed.com/users/sagilar/code/EIoT_LoRa_node_2/
- https://os.mbed.com/users/sagilar/code/EIoT_LoRa_node_3/

## Remarks:
The LoRa codes are embedded into STM DISCO-L072CZ-LRWAN1 end devices.
**Most of the code and interfaces are in Spanish. Please contact me for help.**

repository: sagilar/EIoT-Project

repo_name: sagilar/EIoT-Project


text:
# Chart testing example with Google Cloud Build

This example shows how to lint and test charts using [Google Cloud Build](https://cloud.google.com/cloud-build/)

Since Google Cloud Build will ignore copying over `.git` by default, you will need to initialize `git` and add a `remote`. This example assumes that there is a pre-existing GKE cluster with `helm` already installed.

repository: helm/chart-testing

gha_language: Go

repo_name: helm/chart-testing