text:
You may not realize this,
but there are more bacteria in your body
than stars in our entire galaxy.
This fascinating universe
of bacteria inside of us
is an integral part of our health,
and our technology is evolving so rapidly
that today we can program these bacteria
like we program computers.
Now, the diagram that you see here,
I know it looks like
some kind of sports play,
but it is actually a blueprint of
the first bacterial program I developed.
And like writing software,
we can print and write DNA
into different algorithms
and programs inside of bacteria.
What this program does
is produces fluorescent proteins
in a rhythmic fashion
and generates a small molecule
that allows bacteria
to communicate and synchronize,
as you're seeing in this movie.
The growing colony of bacteria
that you see here
is about the width of a human hair.
Now, what you can't see
is that our genetic program
instructs these bacteria
to each produce small molecules,
and these molecules travel between
the thousands of individual bacteria
telling them when to turn on and off.
And the bacteria synchronize
quite well at this scale,
but because the molecule that synchronizes
them together can only travel so fast,
in larger colonies of bacteria,
this results in traveling waves
between bacteria that are
far away from each other,
and you can see these waves going
from right to left across the screen.
Now, our genetic program
relies on a natural phenomenon
called quorum sensing,
in which bacteria trigger coordinated
and sometimes virulent behaviors
once they reach a critical density.
You can observe quorum sensing
in action in this movie,
where a growing colony of bacteria
only begins to glow
once it reaches a high
or critical density.
Our genetic program
continues producing these
rhythmic patterns of fluorescent proteins
as the colony grows outwards.
This particular movie and experiment
we call The Supernova,
because it looks like an exploding star.
Now, besides programming
these beautiful patterns,
I wondered, what else can we get
these bacteria to do?
And I decided to explore
how we can program bacteria
to detect and treat diseases
in our bodies like cancer.
One of the surprising facts about bacteria
is that they can naturally grow
inside of tumors.
This happens because typically tumors
are areas where the immune system
has no access,
and so bacteria find these tumors
and use them as a safe haven
to grow and thrive.
We started using probiotic bacteria
which are safe bacteria
that have a health benefit,
and found that
when orally delivered to mice,
these probiotics would selectively
grow inside of liver tumors.
We realized that the most convenient way
to highlight the presence
of the probiotics,
and hence, the presence of the tumors,
was to get these bacteria
to produce a signal
that would be detectable in the urine,
and so we specifically
programmed these probiotics
to make a molecule that would change
the color of your urine
to indicate the presence of cancer.
We went on to show that this technology
could sensitively and specifically
detect liver cancer,
one that is challenging
to detect otherwise.
Now, since these bacteria
specifically localize to tumors,
we've been programming them
to not only detect cancer
but also to treat cancer
by producing therapeutic molecules
from within the tumor environment
that shrink the existing tumors,
and we've been doing this
using quorum sensing programs
like you saw in the previous movies.
Altogether, imagine in the future
taking a programmed probiotic
that could detect and treat cancer,
or even other diseases.
Our ability to program bacteria
and program life
opens up new horizons in cancer research,
and to share this vision,
I worked with artist Vik Muniz
to create the symbol of the universe,
made entirely out of bacteria
or cancer cells.
Ultimately, my hope is that the beauty
and purpose of this microscopic universe
can inspire new and creative approaches
for the future of cancer research.
Thank you.

(Applause)

repository: prewittdavon/TEDVis

repo_name: prewittdavon/TEDVis


text:
# **Traffic Sign Recognition**

## Writeup

---

**Build a Traffic Sign Recognition Project**

The goals / steps of this project are the following:
* Load the data set (see below for links to the project data set)
* Explore, summarize and visualize the data set
* Design, train and test a model architecture
* Use the model to make predictions on new images
* Analyze the softmax probabilities of the new images
* Summarize the results with a written report

[//]: # (Image References)

[image1]: ./examples/visualization.jpg "Visualization"
[image2]: ./examples/grayscale.jpg "Grayscaling"
[image3]: ./examples/random_noise.jpg "Random Noise"
[image4]: ./examples/placeholder.png "Traffic Sign 1"
[image5]: ./examples/placeholder.png "Traffic Sign 2"
[image6]: ./examples/placeholder.png "Traffic Sign 3"
[image7]: ./examples/placeholder.png "Traffic Sign 4"
[image8]: ./examples/placeholder.png "Traffic Sign 5"

## Rubric Points
### Here I will consider the [rubric points](https://review.udacity.com/#!/rubrics/481/view) individually and describe how I addressed each point in my implementation.

---
### Writeup / README

Done. Link to my [project code](https://github.com/AlxVoropaev/CarND-Traffic-Sign-Classifier-Project/blob/master/Traffic_Sign_Classifier.ipynb)

### Data Set Summary & Exploration

#### 1. Provide a basic summary of the data set. In the code, the analysis should be done using python, numpy and/or pandas methods rather than hardcoding results manually.

Summary statistics are in cell-2:
* Number of training examples = 34799
* The size of the validation =  4410
* Number of testing examples = 12630
* Image data shape = (32, 32, 3)
* Number of classes = 43

#### 2. Include an exploratory visualization of the dataset.

Distribution train samples between classes:

![hst](./writeup_imgs/1_hist.png)

Draw train sample for each class:
![](./writeup_imgs/2_samples.png)

### Design and Test a Model Architecture

#### 1. Describe how you preprocessed the image data. What techniques were chosen and why did you choose these techniques? Consider including images showing the output of each preprocessing technique. Pre-processing refers to techniques such as converting to grayscale, normalization, etc. (OPTIONAL: As described in the "Stand Out Suggestions" part of the rubric, if you generated additional data for training, describe why you decided to generate additional data, how you generated the data, and provide example images of the additional data. Then describe the characteristics of the augmented training set like number of images in the set, number of images for each class, etc.)

Image preprocessing is located in Dataset class (cell-6)
- __init__ - `Dataset` constructor, where preprocessing begins
    - compute features for each input input using `_get_features_` method.
    - compute normalization constants (mean and std) or take it from params (for test and valid sets)
    - do normalization as `X = (X-mead)/(std+0.00001)`
- _get_features_ - computes features for given image/images
    - fix dark image using `_fix_dark` method
    - convert to float in [0;1] range
    - extend 3 RGB-channels by 3 LAB-channels
- `_fix_dark` - fix dark images
    - convert image to LAB color space
    - for L (lightness) apply CLAHE normalization
    - convert back to RGB and return

When we take image using __getitem__ we additionally augment image using `_augment_` method as following:
    - randomly rotate image using `scipy.ndimage.rotate` in range [-5;+5] degree
    - randomly shift image using `scipy.ndimage.shift` in rage [-5;+5] in both directions

Example, how dataset works:
- RGB image of first 3 channels (after augmentation and normalization, you can see rotation and shift)
- LAB images (3 images)
- Image after dark correction
- Original image

![](./writeup_imgs/3_dataset.png)

#### 2. Describe what your final model architecture looks like including model type, layers, layer sizes, connectivity, etc.) Consider including a diagram and/or table describing the final model.

My final model is defined in (cell-8):

| Layer         		|     Description	        					|
|:---------------------:|:---------------------------------------------:|
| Input         		| 32x32x6 RGB+LAB image   						|
| Convolution 3x3     	| 1x1 stride, same padding, outputs 32x32x32 	|
| RELU					|												|
| Max pooling	      	| 2x2 stride,  outputs 16x16x32 				|
| Convolution 3x3     	| 1x1 stride, same padding, outputs 16x16x64 	|
| RELU					|												|
| Max pooling	      	| 2x2 stride,  outputs 8x8x64    				|
| Convolution 3x3     	| 1x1 stride, same padding, outputs 8x8x128 	|
| RELU					|												|
| Max pooling	      	| 2x2 stride,  outputs 4x4x128    				|
| Convolution 3x3     	| 1x1 stride, same padding, outputs 4x4x512 	|
| RELU					|												|
| Max pooling	      	| 2x2 stride,  outputs 2x2x512    				|
| Max pooling	      	| 2x2 stride,  outputs 1x1x512    				|
| Flatten 	      	    | outputs 512    				                |
| Dropout               | rate 0.3                                      |
| Linear                | 512x256 outputs 256                           |
| ReLU                  |                                               |
| dropout               | rate 0.3                                      |
| Linear                | 256x43 output 43                              |

Initialization like in pytorch, but He may be better due to ReLU.

#### 3. Describe how you trained your model. The discussion can include the type of optimizer, the batch size, number of epochs and any hyperparameters such as learning rate.

To train the model (cell-11), I used:
- `tf.nn.softmax_cross_entropy_with_logits_v2` cross entropy loss with integrated softmax
- `tf.train.MomentumOptimizer` with learning_rate=0.001, momentum=0.99, use_nesterov=True
- batch size 64
- number of epoch is 19, I stoped training since learning stoped on validation.
- after epoch 5 I enable augmentation
- at each epoch I save validation accuracy and draw plot in next cell
- at each epoch I save checkpoint to restore further

Best epoch was 15, I taked it as reference for further research.

Plot of validation accuracy during training:
![](./writeup_imgs/4_valid_during_train.png)

#### 4. Describe the approach taken for finding a solution and getting the validation set accuracy to be at least 0.93. Include in the discussion the results on the training, validation and test sets and where in the code these were calculated. Your approach may have been an iterative process, in which case, outline the steps you took to get to the final solution and why you chose those steps. Perhaps your solution involved an already well known implementation or architecture. In this case, discuss why you think the architecture is suitable for the current problem.

My final model results were:
* training set accuracy of 0.9955458490357783
* validation set accuracy of 0.9612244900932658
* test set accuracy of 0.957561361685879

If an iterative approach was chosen:
* What was the first architecture that was tried and why was it chosen?
    * Initial architecture was with 3 convolution layers, without final pooling to 1x1x... and withot dropouts
* What were some problems with the initial architecture?
    * It starts to overfit too early and accuracy was about 88%
* How was the architecture adjusted and why was it adjusted?
    * I add one more convolution layer to reduce spactial dimentions (to 2x2) and increase features number (from 128 to 512)
    * I add final 2x2 maxpooling to remove spatial dimentions and reduce overfiting in linear layers
    * I add dropout to decrease overfiting and create features more robust
* Which parameters were tuned? How were they adjusted and why?
    * Only learning rate. Initially it was to high and model started to overfit too early.
* What are some of the important design choices and why were they chosen? For example, why might a convolution layer work well with this problem? How might a dropout layer help with creating a successful model?
    * Convolutions good for images, wher we can recognize features at diffetent levels (corners, lines, triangles) and gives us some spatial robustness (images can be shifted)
    * Dropout helps make more robust and less overfitted features. There are a lot of theory how it works, but my favorite explanation is thad dropout creates virtual ensamble of weak model and works like random forest.

### Test a Model on New Images

#### 1. Choose five German traffic signs found on the web and provide them in the report. For each image, discuss what quality or qualities might be difficult to classify.

Here are five German traffic signs that I found on the web:

![](./test_images/1.jpg) ![](./test_images/2.jpg) ![](./test_images/3.jpg) ![](./test_images/4.jpg) ![](./test_images/5.jpg)

I tried to find difficult images (but it is not easy). After crop and resize I received following images:
![](./writeup_imgs/5_web_signs.png)

- Image 0. Has paint on sing that was not in train set.
- Image 1. Belongs to rare class
- Image 2. Sign is tilted and broken
- Image 3. Sing is covered by snow
- Image 4. Bad crop

I specially corrut image 4 buy creation unusual crop. I expect the problem with the image.

#### 2. Discuss the model's predictions on these new traffic signs and compare the results to predicting on the test set. At a minimum, discuss what the predictions were, the accuracy on these new predictions, and compare the accuracy to the accuracy on the test set (OPTIONAL: Discuss the results in more detail as described in the "Stand Out Suggestions" part of the rubric).

All images except last one is recognized correctly. The last image was not recognized due to crop that is unusual for train set. I dumped images of the same class from test set that were not recognized. As you can see one image is almost invisible, the second one is croped in the same way. For this alogorith crop quality is critical.

Images from test set:

![](./writeup_imgs/6_bad_on_test.png)

#### 3. Describe how certain the model is when predicting on each of the five new images by looking at the softmax probabilities for each prediction. Provide the top 5 softmax probabilities for each image along with the sign type of each probability. (OPTIONAL: as described in the "Stand Out Suggestions" part of the rubric, visualizations can also be provided such as bar charts)

The code for making predictions on my final model is located in the last cell of the Ipython notebook.

```
Idx: 0, Right answer 17
	 top_k predict: [17 14 12 10 22]
	 top_k logits: [46.935005 22.91189  21.124802 17.772957 17.485392]
	 top_k probs: [1.0000000e+00 3.6888725e-11 6.1769062e-12 2.1631335e-13 1.6225397e-13]
Idx: 1, Right answer 0
	 top_k predict: [0 9 8 4 1]
	 top_k logits: [44.433464 22.745565 19.988111 17.63213  16.865602]
	 top_k probs: [1.0000000e+00 3.8112313e-10 2.4183450e-11 2.2926004e-12 1.0651968e-12]
Idx: 2, Right answer 18
	 top_k predict: [18 26 27 19 24]
	 top_k logits: [22.341448 16.421923 12.527188 12.307601 11.521704]
	 top_k probs: [9.9720204e-01 2.6789589e-03 5.4513541e-05 4.3766198e-05 1.9944722e-05]
Idx: 3, Right answer 18
	 top_k predict: [18 26 27 24 19]
	 top_k logits: [23.260136  10.981747   8.451612   7.3351912  6.643457 ]
	 top_k probs: [9.9999428e-01 4.6511564e-06 3.7045683e-07 1.2130599e-07 6.0738749e-08]
Idx: 4, Right answer 40
	 top_k predict: [35 33 34 37 40]
	 top_k logits: [12.180922   8.317265   7.7072577  7.251892   6.897758 ]
	 top_k probs: [0.9528735  0.02000186 0.01086795 0.00689263 0.00483712]
```

As you can see in all cases except the last one models works with high confidence (about 99%). In the last case it do prediction with prob 95% that is not high for this model.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Specify The Line Height Of The Quick Fix Window

You can use the following command to open the Quick Fix window:

```
:copen
```

By default the Quick Fix window will open with a height of 10 lines, meaning
it can fit 10 lines of text. You may want to specify the height of the quick
fix window when you open it, especially if you are working with limited
screen space. This can be done by prepending the command with a _height_.

```
:5copen
```

This will open the Quick Fix window with a height of 5 lines.

See `:h copen` for more details.

repository: jbranchaud/til

gha_language: Vim Script

gha_license_id: MIT

repo_name: jbranchaud/til


text:
# Sapper TailwindCSS Starter

Sapper, Svelte, TailwindCSS, PostCSS starter template.

## Getting started

### Using `degit`

To create a new Sapper project based on Rollup locally, run

```bash
npx degit zdproduction/sapper-tailwindcss my-app
```

[`degit`](https://github.com/Rich-Harris/degit) is a scaffolding tool that lets you create a directory from a branch in a repository.

Replace `my-app` with the path where you wish to create the project.

### Running the project

Once you have created the project, install dependencies and run the project in development mode:

```bash
cd my-app
npm install
npm run dev
```

This will start the development server on [localhost:3000](http://localhost:3000). Open it and click around.

repository: zdproduction/sapper-tailwindcss

gha_language: JavaScript

repo_name: zdproduction/sapper-tailwindcss


text:
---
layout: post
title:      "Marks and Angles, Pt 2: Basic Angular Glossary for Beginners"
date:       2019-04-08 02:21:00 +0000
permalink:  marks_and_angles_pt_2_basic_angular_glossary_for_beginners
---

* Controller: Handles presentational logic in MVVM model

* Directive: HTML markers that attach specific behavior to an HTML element, like events

* Filter: Functions that selectively manipulate data. Directives like `ng-repeat` can be used to filter data in Angular.

* Module: Container for specific part of your application - collection of services, directives, controllers, filters, configuration information.

* Service: A helper - often used to fetch/save/mock data

extension: markdown


text:
# barbarananning
repository for the results of the Eeuwige Beweging project to define an ontology for Dutch artist Barbara Nanning

This RDF Knowledge Graph consist of:
- barbara.ttl: an ontology and instances resulting from a knowledge engineering effort undertaken by Daan Raven in the context of the Eeuwige Beweging project
- barbara_linked_resources.ttl: retrieved RDF data from linked instances (for demonstration purposes)

Additionally, a file with example SPARQL queries is included

Cite as:
Daan Raven, Victor de Boer, Erik Esmeyer and Johan Oomen. Modeling Ontologies for Individual Artists. A Case Study of a Dutch Ceramic-Glass Sculptor. Abstract presented at DHBenelux 2021 http://www.victordeboer.com/wp-content/uploads/2021/05/dhb2021_raven_eeuwige_camready.pdf

repository: biktorrr/barbarananning

repo_name: biktorrr/barbarananning


text:
# Dashboards

Losant dashboards provide a flexible and powerful way to display information relevant to your specific connected solution. Users can have many different dashboards and a single dashboard can display information from many different applications and devices.

![Full Dashboard](/images/dashboards/overview-dashboard-full.png "Full Dashboard")

## Adding Blocks

Losant supports many different blocks for visualizing various pieces of information. New blocks can be added to your dashboard by clicking the `Add Block` link at the top of the dashboard.

![Add Block](/images/dashboards/overview-add-block.png "Add Block")

![Select Block](/images/dashboards/overview-select-block.png "Select Block")

## Editing Dashboards

Dashboard blocks and be dynamically resized and dragged for the arrangement that most meets your specific needs.

![Dashboard Animation](/images/dashboards/overview-animation.gif "Dashboard Animation")

## Auto Refreshing

Dashboards by default will automatically refresh the data every 60 seconds. You can pause the refreshing at any time by clicking the pause button at the top of the dashboard. You can also force the dashboard to refresh by clicking the refresh button.  You can also control the refresh interval under the settings for the dashboard.

![Refresh Button](/images/dashboards/overview-refresh-button.png "Refresh Button")

## Dashboard Access Control

Dashboards have a three levels of access - private, password protected, and public.  Private
means that only you (or members of your organization, if it is an organization-owned
dashboard) can see the dashboard.  Public dashboards can be seen by anyone who has the
dashboard url, regardless of whether that person is logged in to a Losant account. This is great for sharing public data, but remember that any data exposed in a public dashboard is *public* and is accessible by anyone. Do not make your dashboard public if it contains any private or sensitive data. The third level of access is in between public and private -
you can add a password to your dashboard, and allow anyone with the url and the password
to view the dashboard.  This adds some protection to your dashboard, while still making it
easy to share with people who do not have Losant accounts. You can manage the access control for a dashboard on the settings page for the dashboard:

![Dashboard Access Control](/images/dashboards/dashboard-access-control.png "Dashboard Access Control")

## Embedding Dashboard Blocks into Other Sites

If your dashboard has been set to `public`, you may embed any of your dashboard blocks into a third-party site. To get an embed code, hover over your dashboard block and click the `<>` icon in the block header.

This will display a modal where you can set the block's `width`, `height` and `theme` properties. For your width and height, make sure to enter a valid CSS length attribute (`%`, `px`, `em`, `vw`, etc.).

![Embed Block Modal Checkbox](/images/dashboards/embed-block-modal.png "Embed Block Modal")

NOTE: The following blocks will not display any data on public dashboards or to non-authorized users when embedded:

*   `Application List`
*   `Input Controls`

## Templating

A number of the dashboard blocks allow templating of various output, for greater control over how data is displayed.  Templates are rendered through the [Handlebars templating language](http://handlebarsjs.com/), and in most cases (but not all) the result is treated as [Markdown](http://commonmark.org/help/) for display.  Handlebars has a number of [built in](http://handlebarsjs.com/builtin_helpers.html) helpers, but Losant provides a number of extra ones to make complex templating much easier:

*   `eq` - If a value is equal to some number or string.
For example: `{{#eq value 100}}Value is 100{{else}}Value is not 100{{/eq}}`

*   `ne` - If a value is not equal to some number or string.
For example: `{{#ne value 100}}Value is not 100{{else}}Value is 100{{/ne}}`

*   `gt`, `gte` - If a value is greater than (or equal to) some number.
For example: `{{#gt value 100}}Bigger than 100{{else}}Not bigger than 100{{/gt}}`

*   `lt`, `lte` - If a value is less than (or equal to) some number.
For example: `{{#lt value 100}}Smaller than 100{{else}}Not smaller than 100{{/lt}}`

*   `match` - If a value matches a given regexp or string.
For example: `{{#match value "hello"}}Has hello{{else}}Does not have hello{{/match}}`

*   `format` - Formats a number or date using [d3](https://github.com/d3/d3-format) or [moment](http://momentjs.com/docs/#/displaying/format/) syntax, or JSON stringify objects or arrays. The second argument is optional - if not passed, default formatting will be used.
For example: `{{format value "0.1f"}}` or `{{format value}}`

*   `lower` - Transforms a string to all lowercase.
For example: `{{lower value}}`

*   `upper` - Transforms a string to all uppercase.
For example: `{{upper value}}`

*   `encodeURI` - Transforms a string through the [encodeURI](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI) function.
For example: `{{encodeURI value}}`

*   `decodeURI` - Transforms a string through the [decodeURI](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI) function.
For example: `{{decodeURI value}}`

*   `encodeURIComponent` - Transforms a string through the [encodeURIComponent](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) function.
For example: `{{encodeURIComponent value}}`

*   `decodeURIComponent` - Transforms a string through the [decodeURIComponent](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) function.
For example: `{{decodeURIComponent value}}`

repository: wilson-shippable/losant-docs

repo_name: wilson-shippable/losant-docs


text:
# Code of Conduct

The Node.js Code of Conduct, which applies to this project, can be found at [https://github.com/nodejs/admin/blob/master/CODE\_OF\_CONDUCT.md](https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md).

repository: giulibar/Konect

branch_name: refs/heads/main

repo_name: giulibar/Konect


text:
<!-- TODO README.md is generated from README.Rmd. Please edit that file -->

# ModelArray

<!-- badges: start -->

[![CircleCI build
status](https://circleci.com/gh/PennLINC/ModelArray.svg?style=svg)](https://circleci.com/gh/PennLINC/ModelArray)
[![GitHub
Clones](https://img.shields.io/badge/dynamic/json?color=success&label=Clone&query=count&url=https://gist.githubusercontent.com/zhao-cy/374b45552335a37d6bd613359eb9bf67/raw/clone.json&logo=github)](https://github.com/MShawon/github-clone-count-badge)
[![Docker
pulls](https://img.shields.io/docker/pulls/pennlinc/modelarray_confixel.svg)](https://hub.docker.com/r/pennlinc/modelarray_confixel)
<!-- badges: end -->

`ModelArray` is an R package for statistical analysis of fixel-wise data
and beyond. Its features include:

- Easy to use: set up your statistical analysis with just several lines
  of code;
- Supporting linear and nonlinear modeling, and extensible to more
  models:
  - At present, `ModelArray` supports linear models as well as
    generalized additive models (GAMs) with and without penalized
    splines, which are particularly useful for studying nonlinear
    effects in lifespan data. `ModelArray` is also extensible to diverse
    models available in R;
- Scalable for large-scale datasets;
- Compatible with fixel-wise data and voxel-wise data.

Please cite our [NeuroImage
paper](https://doi.org/10.1016/j.neuroimage.2023.120037) if you use
`ModelArray`:

> Zhao, C., Tapera, T. M., Bagautdinova, J., Bourque, J., Covitz, S.,
> Gur, R. E., Gur, R. C., Larsen, B., Mehta, K., Meisler, S. L., Murtha,
> K., Muschelli, J., Roalf, D. R., Sydnor, V. J., Valcarcel, A. M.,
> Shinohara, R. T., Cieslak, M. & Satterthwaite, T. D. (2023).
> ModelArray: an R package for statistical analysis of fixel-wise data,
> *NeuroImage*, In press.
> <https://doi.org/10.1016/j.neuroimage.2023.120037>

## Overview

<center>

![Overview](vignettes/overview_structure.png)

</center>

ModelArray is packaged with the companion software
[ConFixel](https://github.com/PennLINC/ConFixel) for converting
fixel-wise data and voxel-wise data to the expected file format that
ModelArray uses. Specifically,
[ConFixel](https://github.com/PennLINC/ConFixel) is Python-based
command-line interface software, and it converts between the original
image format (`.mif` for fixel-wise data, NIfTI for voxel-wise data) and
the HDF5 file format (`.h5`) used for ModelArray.

<!-- if there is any changes in this overview section, please also update ConFixel's frontpage! -->

## Installation

Please refer to webpage
[Installation](https://pennlinc.github.io/ModelArray/articles/installations.html)
for a full guidance of installation of `ModelArray` and its companion
python package [ConFixel](https://github.com/PennLINC/ConFixel). The
most important steps for installing `ModelArray` are:

- Make sure you have necessary libraries for HDF5 - see [this
  section](https://pennlinc.github.io/ModelArray/articles/installations.html#install-hdf5-libraries-in-the-system)
- Install `ModelArray` from GitHub - see [this
  section](https://pennlinc.github.io/ModelArray/articles/installations.html#install-modelarray-r-package-from-github)

Additionally, we also provide a [container
image](https://hub.docker.com/r/pennlinc/modelarray_confixel) that
includes `ModelArray` and `ConFixel`. With this container image, there
is no need for the user to install `ModelArray`, `ConFixel`, and
dependent R and Python packages. Please see [this
webpage](https://pennlinc.github.io/ModelArray/articles/container.html)
for how to use this container image.

<!-- check above links work, esp those with section titles!!! -->

## How to use

Load the `ModelArray` package into R via:

``` r
library(ModelArray)
```

We provide a walkthrough
[here](https://pennlinc.github.io/ModelArray/articles/walkthrough.html)
with example fixel-wise data. For additional notes on application to
voxel-wise data, please refer to
[here](https://pennlinc.github.io/ModelArray/articles/voxel-wise_data.html).

For documentation of `ModelArray` functions, you can:

- Either go to [this
  webpage](https://pennlinc.github.io/ModelArray/reference/index.html);
- Or in R console, type: `help(<function_name>)`. For example:
  `help(ModelArray.lm)`

Full documentation of `ModelArray` can be found
[here](https://pennlinc.github.io/ModelArray/).

Source code of `ModelArray` can be found
[here](https://github.com/PennLINC/ModelArray).

repository: PennLINC/ModelArray

gha_language: R

repo_name: PennLINC/ModelArray


text:
[![](https://images.microbadger.com/badges/image/ikogan/openmediavault.svg)](https://microbadger.com/images/ikogan/openmediavault "Get your own image badge on microbadger.com")

# OpenMediaVault Docker Container

Basic Docker container for OpenMediaVault primarily useful
in plugin development.

- Expose ports 80 and 443 by default
- Data directory should be in /data and will contain
  /etc/openmediavault, /etc/default, /var/log, and /var/lib
- First run will copy installed config files into the
  data directory and symlink them into the system

```
docker run --name OpenMediaVault -d -ti -h openmediavault.example.test -v /path/to/data:/data:Z -P ikogan/openmediavault
```

## Configuration
A configuration file can be placed at the root of the data
directory called `container.ini` that will be used to configure
various services on startup. Currently, the configuration supports
the following options:

```
[nginx]
httpPort="80";
httpsPort="443";

[data]
alwaysClear="false";
```

## Alternative Branches

- extras: Includes omv-extras pre-installed
- dev: Includes extras and development plugin

## Block Devices

In order to use much of OpenMediaVault, you will need some kind of block
or possibly a remote NFS mount. For the former, using the `--device`
option to `docker run` can give the container access to a physical device.
*Make sure it's mounted on only one container and never on a container
and the host*. You can use a loop device if you don't have any physical devices.
Sometimes these can be a bit flaky, so in some cases, using Fake Shared Folders
might work better, see the later section for more information.

First, use `--cap-add=SYS_ADMIN --device=/dev/loop0:/dev/loop0`
when running the container, then run `losetup /dev/loop0 /data/shared.img` when
in the container (assuming your image is `/data/shared.img`).
There are a couple of important caveats:

- Adding the `SYS_ADMIN` capability to your container will allow it to modify
  aspects of your system, you've been warned, you should Google it.
- The loop device will persist outside of the container as it's actually setup
  on the host. Your startup script should use `losetup -d /dev/loop0` to
  destroy it.
- This is apparently flakey on Mac OS X. If OpenMediavault fails to properly
  create filesystems or mount the container from the GUI, you'll need to do
  some of those steps manually. Simply create the filesystem first with
  something like `mkfs.ext4 -F /data/shared.img` (assming /data/shared.img is
  your filesystem, *never use -F on a live filesystem*) first. Then, try and
  mount it in the GUI. Apply the configuration even if that fails. You should
  get another error, but a directory in `/media` will be created. Mount the
  device with `mount /dev/loop0 /media/omv-generated-uuid-directory`, then
  try and save the configuration again. It should now succeed.

## Fake Shared Folders

It may be easier to simply manually configure OpenMediaVault to have a shared
folder that's simply a directory on the filesystem, and isn't bound to a block
device. You'll need to use the OMV command line tools to set this up:

```sh
#!/bin/bash
set -e

. /usr/share/openmediavault/scripts/helper-functions

FSPATH="${1}"
FSNAME="${2}"

if [[ -z "${FSPATH}" || -z "${FSNAME}" ]]; then
    echo "Usage: ${0} <fspath> <fsname>"
    exit 1
fi

mkdir -p "${FSPATH}" || true

MNT_ENT_XPATH="/config/system/fstab/mntent"
SHARE_XPATH="/config/system/shares/sharedfolder"

# In this case, we always only want one shared folder, so
# we're going to nuke any others because we're assuming they're
# not what they want.
if [[ "$(omv_config_get_count ${MNT_ENT_XPATH})" -gt 0 ]]; then
    omv_config_delete ${MNT_ENT_XPATH}/*
else
    omv_config_add_element "/config/system/fstab" "mntent"
fi

if [[ "$(omv_config_get_count ${SHARE_XPATH})" -gt 0 ]]; then
    omv_config_delete ${SHARE_XPATH}/*
else
    omv_config_add_element "/config/system/shares" "sharedfolder"
fi

# OMV wants each mount and shared folder to have a universally
# unique identifier, generate some
MNT_ENT_UUID=$(uuid)
SHARE_UUID=$(uuid)

# Create the mount entry for this share
omv_config_add_element ${MNT_ENT_XPATH} uuid ${MNT_ENT_UUID}
omv_config_add_element ${MNT_ENT_XPATH} fsname "${FSNAME}"
omv_config_add_element ${MNT_ENT_XPATH} dir "${FSPATH}"
omv_config_add_element ${MNT_ENT_XPATH} type none
omv_config_add_element ${MNT_ENT_XPATH} opts "rw,relatime,xattr"
omv_config_add_element ${MNT_ENT_XPATH} freq 0
omv_config_add_element ${MNT_ENT_XPATH} passno 0
omv_config_add_element ${MNT_ENT_XPATH} hidden 0

# Create the shared folder
omv_config_add_element ${SHARE_XPATH} uuid ${SHARE_UUID}
omv_config_add_element ${SHARE_XPATH} name "${FSNAME}"
omv_config_add_element ${SHARE_XPATH} comment ""
omv_config_add_element ${SHARE_XPATH} mntentref ${MNT_ENT_UUID}
omv_config_add_element ${SHARE_XPATH} reldirpath "/"
```

repository: robert-marriott/modular-sbc-homeserver

repo_name: robert-marriott/modular-sbc-homeserver


text:
# Smart-Home

 Smarthome is a simple Flask api that keeps ITO devices in one place. The API activates different modules that support different smart devices.

## Installation

First of all you must add your devices to the devices.json file. Enter a id, name and ip. The rest of the data will be updated with the first request. Now you can start the local API. Run the server.js json file found in the api folder. Optionally you can also run the React UI. For this open to terminals and run both commands.

```bash
cd api
npm install
node server.js
```

Now for the ***React UI***

```bash
cd smart-home-ui
npm install
npm start
```

Currently supported devices:

- Magic Home LED Controller (ESP-12E)

## Usage

Example response from /api/**state**/

```
/api/state/

{
    "devices": [
        {
            "id": 0,
            "name": "Desk",
            "ip": "<IP_ADDRESS>",
            "state": true,
            "color": {
                "red": 0,
                "green": 225,
                "blue": 0
            }
        }
      ]
    }
```

A request can be made to an individual device or all devices.

```
/api/power/all

/api/power/deviceID

/api/color/all/255,255,255
```

## Supported calls

api/**state** - This gets the state of all the devices in your devices.json file.

api/**power**/all - This request will toggle your light on/off.

api/**color**/deviceID/255,155,155 - This changes the color of selected devices using an rgb value.

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License

[MIT](https://choosealicense.com/licenses/mit/)

**v1.1.1**


text:
# Install

The library can be found, installed, or updated from the Arduino IDE using the official Arduino Library Manager (available from IDE version 1.6.2).

The library can be installed on the system by following the same steps as with other Arduino library.

Refer to [Installing Additional Arduino Libraries](https://www.arduino.cc/en/Guide/Libraries) tutorial for details on how to install a third party library.

# Build

The library does not require building before usage.

# Testing #

The library does not provide any unit tests.


text:
# Scenario 5: Create ApplicationBackupSchedule and Restore from a backup

## Create BackupLocation
* Note: The specs need to be created in `kube-system` namespace, as it is by default, the admin-namespace. If you wish to disgnate another namespace as the admin-namespace, run the steps below:
```
kubectl -n kube-system edit deploy stork

# Add the admin-namespace in the container arg, as shown below:
      - command:
        - /stork
        - --driver=pxd
        - --verbose
        - --leader-elect=true
        - --admin-namespace=<admin-namespace>
```

Apply the spec:
```
apiVersion: stork.libopenstorage.org/v1alpha1
kind: BackupLocation
metadata:
  name: azureBackupLocation
  namespace: kube-system
  annotations:
    stork.libopenstorage.ord/skipresource: "true"
location:
  type: azure
  path: "stork-test"
  azureConfig:
    storageAccountName: "<redacted>"
    storageAccountKey: "<redacted>"
```

## Create ApplicationBackupSchedule

### Create a SchedulePolicy
```
apiVersion: stork.libopenstorage.org/v1alpha1
kind: SchedulePolicy
metadata:
  name: policy1
policy:
  interval:
    intervalMinutes: 10
    retain: 4
  daily:
    time: "10:14PM"
    retain: 3
  weekly:
    day: "Thursday"
    time: "10:13PM"
    retain: 2
  monthly:
    date: 14
    time: "8:05PM"
    retain: 1
```

### Create the ApplicationBackupSchedule
```
apiVersion: stork.libopenstorage.org/v1alpha1
kind: ApplicationBackupSchedule
metadata:
  name: azureBackup
  namespace: kube-system
spec:
  schedulePolicyName: policy1
  template:
    spec:
      backupLocation: azureBackupLocation
      namespaces:
      - mysql
      reclaimPolicy: Delete
```

## Create ApplicationRestore
* Note: In this example, we're restoring from a periodic backup from cluster A, and restoring it on cluster-B. In case of restoring in the same  cluster, skip step 1 below, and start directly from step 2.
### 1. Create the BackupLocation object
```
apiVersion: stork.libopenstorage.org/v1alpha1
kind: BackupLocation
metadata:
  name: azureBackupLocation
  namespace: kube-system
  annotations:
    stork.libopenstorage.ord/skipresource: "true"
location:
  type: azure
  path: "stork-test"
  sync: true
  azureConfig:
    storageAccountName: "<redacted>"
    storageAccountKey: "<redacted>"
```

### 2. Get the synced object and get the ApplicationBackup object name
```
kubectl -n kube-system get applicationbackup
```

### 3. Create the Restore Object
```
apiVersion: stork.libopenstorage.org/v1alpha1
kind: ApplicationRestore
metadata:
  name: azureRestore
  namespace: kube-system
spec:
  backupName: azureBackup-2019-09-04-213455
  backupLocation: azureBackupLocation
```

### 4. Verify
```
# Use commands below to verify
kubectl -n kube-system get applicationrestore
storkctl -n kube-system get applicationrestore azureRestore
kubectl -n kube-system describe applicationrestore azureRestore
```

repository: satchpx/aks-px

gha_language: Shell

repo_name: satchpx/aks-px


text:
# PhotoArt

    Reveal your true talent in taking pictures whithin the boundaries of our web site.
    You can browse others albums and estimate your readibility to become a professional photographer.

    As part of the admin team, we will review your album before its publication (You know for safety reasons)

#Admin Panel
    * Listing of all the pending albums
    * Detailed view for each of the albums
    * Opportunity for approving each of the albums

    * Used items
         - Grid view for listing all of the albums and users
            1. Sorting
            2. Paging
            3. Cache for the users for 5 minutes
         - Carousel for the detailed view of each of the albums
         - User Controls
            1. Carousel
            2. User Grid

#User Panel
    * Listing all approved albums
    * Showing and modification for your personal portfolio
    * Listing all albums within your portfolio
    * Modification for each of the albums
    * SiteMap navigation included

    *Used Items
          - Repeater for the retro photo album covers
              1. Cache for the albums displayed for 5 minutes
          - Grid for listing all the albums whithin the user portfolio
              1. Sorting
              2. Paging
          - User Controls
            1. Gallery

repository: PhotoArtTeam/PhotoArt

repo_name: PhotoArtTeam/PhotoArt


text:
# actions-on-google-golang

Golang SDK for Google actions

The goal is to create a Golang framework to power Google actions webhook fullfillment servers similar to the NodeJS [ApiAiAssitant](https://developers.google.com/actions/reference/ApiAiAssistant) published by Google

repository: crezam/actions-on-google-golang

repo_name: crezam/actions-on-google-golang


text:
---
title: Introducing SocioShare, universal social share plugin
date: 2014-08-26 08:29 UTC
tags: SocioShare
---

##SocioShare##
###universal social share plugin

I was fighting with myself recently over how to allow my readers (like there are many) to share my posts.

Do I go for something fancy? Simple? Extremly simple?

How much resources am I willing to lost?  And that's not good. Big load time? I am gonna leave the page.

So I decided to go extremly simple. The idea is, if someone really like the article and wants to share it, he will do more than one click. Frack fanciness. Anyway, I am trying to make whole website simple, right?

If you keep reading till end, you will see what I did. And to allow you to do the same (in case you like it), I created [universal plugin](https://github.com/hovancik/SocioShare), so you can use it anywhere you want.

###Features

* **Works with *ALL* social networks.**
Using facebook, google, yahoo, twitter? We don't care. SocioShare is even compatible with social network for your dog!
* **Works with *ALL* platforms.**
There are hundredss of blog platforms, CMSes and others. We made this super easy to use with any of them.
* **Works with *ALL* devices.**
Phone? Tablet? PC? Toaster?
* **Leightweight.**
No CSS, no JavaScript, no jQuery. No crazy dependencies.
* **Easy to install**
Just one line of code. *Yes*, that's it.
* **Fully customizable.**
Don't like our default style? Add whatever CSS or JS fanciness you like. *That* easy!

###Installation
Copy and paste the following code on your website and you're ready. *Yeah!*

```
Did you enjoy this? Copy-paste the link from the address bar to your favourite social network to share.
```

###Example

For example visit http://hovancik.net/blog .

### Contributing

Once you've made your great commits:

* Fork SocioShare
* Create a topic branch - git checkout -b my_branch
* Push to your branch - git push origin my_branch
* Create an Issue with a link to your branch

That's it!

### Support
For support contact [Jan Hovancik](https://twitter.com/JanHovancik) on Twitter.

## License

Copyright © 2014 Jan Hovancik<EMAIL_ADDRESS>
This work is free.  See http://www.wtfpl.net/ for more details.

Hope you will use it!

branch_name: refs/heads/develop

gha_language: HTML


text:
---
layout: story
category: short story
issue: 89, March 2021
issue-cover: issue-89-cover.png
issue-buy-link: https://store.firesidefiction.com/products/fireside-magazine-issue-89-march-2021
title: Phases of the Moon
subtitle:
author: alice-towey
author-2:
author-3:
editor: danny-lore
illustrator:
copyeditor: chelle-parker
selector:
translator:
narrator:
letterer:
word-count: 815
date: 2021-03-30 01:00:01 -0500
permalink: phases-of-the-moon
audiourl:
teaser:
art:
artcaption:
spanish-language:
spanish-date:
english-url:
spanish-url:
serial-name:
serial-url:
part:
previous-url:
next-url:
contentnote:
generalnote:
published: true
---
### **New Moon**

I found your red cardigan.

  I always thought it was silly, a sweater that doesn't cover your arms.

It was too late to tell you I'd found it. By the time I saw it, a flash of cardinal crumpled at the bottom of the hamper, you were already leaving Earth's orbit.

I was late getting home, because I decided to watch you take off after all. I sat alone in the viewing deck until your rocket was just an idea in the sky, no longer visible, but I swear I still felt the rumbling of its blast in my bones.

Last week, you proposed. I still don't know how to answer you.

### **Waxing Crescent**

I received your message today. I'm glad you made it safely and that you're settling in. It's hard to gauge emotions from emails, especially yours; your dry scientific training spilling even into your love letters. You spent two whole paragraphs on the technical specifications of the shuttle but only a sentence describing how you felt: "At some point, the moon became larger than the earth."

Even so, as I read, I imagined the excitement in your voice.  You've been dreaming of the moon since you were eight; you've been trying to get there for all the years I've known you, the moon orbiting our courtship, a strange satellite. It's odd to feel jealous of a celestial object, but there it is: I envy the moon your attention.

 I found it on the floor by the hamper.

### **First Quarter**

You wore the cardigan a week before you left, when I treated you to dinner at your favorite Italian bistro; I was trying to remind you of all the good things about earth, in the hopes that they might counterbalance the moon's enticements.

After green salad and _pasta alla norma_, you swirled chianti in your glass while I considered the dessert menu.

 "I don't want to worry about us while I'm gone, and I don't want you to worry, either. I want you to know that I'll always come home to you. Will you marry me?"

I lowered the paper onto the table.

"What's wrong?" you asked

I placed my hands flat on either side of my plate. "You could stay. Then you wouldn't have to worry about us."

"It's only a year!"

"A year is a long time." I scraped my chair awkwardly as I stood. I didn't even wait to order the cannoli.

### **Waxing Gibbous**

Today, I bought thread. I took your cardigan to the fabric store, and the owner helped me match its bright carmine. "It's a lovely color."

"My girlfriend's," I said as I pulled out my wallet. "She doesn't know how to sew. Can't even fix a button."

The woman laughed. "My husband is the same way. Where would they be without us?"

I almost said, “The moon,”  but then I remembered cooking dinner for you when you were studying for your entrance exam, how I would listen to you rattle off facts and numbers as you ate. I remembered driving you to your first day of training — you were so nervous, I sang along with the worst pop songs on the radio to make you laugh. You wouldn't have made it to the moon without me. And suddenly, that thought didn't make me resentful. I'm proud of our story.

I tasted the words before speaking them. "Actually, she's doing research at the international lunar station."

The owner smiled. "Isn't that amazing! Well, she's lucky to have you keeping things together down here."

I nodded.

### **Full Moon**

Last night, the moon was bright enough that I could make out its craters and ridges. I know it's silly, but every time it transitions from thin crescent to fullness, I imagine that it's truly getting bigger, that you have new territories to explore every night.

I've been reading about the lunar mare — Mare Tranquillitatis, Mare Crisium. My favorite is Mare Cognitum, "the sea that has become known." As I learn more about the moon, I'm learning more about you.

Perhaps the moon and I can reach an uneasy truce. She can have you for now, as long as she stays where I can see her every night.

In a few months, I'll drive to mission control and wait for your shuttle to land. I'll wear your red cardigan, even if my arms are cold. We'll kiss, and I'll tell you yes.

And there'll be nothing the moon can do about it.


text:
# gotransip - TransIP API client for Go
[![Go Report Card](https://goreportcard.com/badge/github.com/transip/gotransip)](https://goreportcard.com/report/github.com/transip/gotransip) [![Documentation](https://godoc.org/github.com/transip/gotransip?status.svg)](http://godoc.org/github.com/transip/gotransip)

This is the Go client for the [TransIP API](https://api.transip.nl/). To use it you need an account with [TransIP](https://transip.nl/), enable API usage and setup a private API key.

**NOTE**: While the TransIP API's PHP client code is automatically generated, the Go client isn't. We try to follow the current PHP version as close as possible, but if something is not working 100% like you'd expect, please open an issue and of course: you're welcome to [contribute](CONTRIBUTING.md)!

## Example usage
To print a list of your account's VPSes:
```golang
package main

import (
  "fmt"

  "github.com/transip/gotransip"
  "github.com/transip/gotransip/vps"
)

func main() {
  // create new TransIP API SOAP client
  c, err := gotransip.NewSOAPClient(gotransip.ClientConfig{
    AccountName: "accountname",
    PrivateKeyPath:  "/path/to/api/private.key"
  })
  if err != nil {
    panic(err.Error())
  }

  // get list of VPSes
  list, err := vps.GetVpses(c)
  if err != nil {
    panic(err.Error())
  }

  // print name and description for each VPS
  for _, v := range list {
    fmt.Printf("vps: %s (%s)\n", v.Name, v.Description)
  }
}
```

## Documentation
For detailed descriptions of all functions, check out the [TransIP API documentation](https://api.transip.nl/). Details about the usage of the Go client can be found on [godoc.org](https://godoc.org/github.com/transip/gotransip).

repository: bluesake/amphtm

branch_name: refs/heads/releases

gha_language: Go

repo_name: bluesake/amphtm


text:
# drun

![Pub Version](https://img.shields.io/pub/v/drun)
![.github/workflows/main.yml](https://github.com/brad-jones/drun/workflows/.github/workflows/main.yml/badge.svg?branch=master)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
[![KeepAChangelog](https://img.shields.io/badge/Keep%20A%20Changelog-1.0.0-%23E05735)](https://keepachangelog.com/)
[![License](https://img.shields.io/github/license/brad-jones/drun.svg)](https://github.com/brad-jones/drun/blob/master/LICENSE)

A dartlang task runner, write functions and call them in your terminal.

## Installation

- Install dartlang <https://dart.dev/get-dart>
- Then install drun globally: `pub global activate drun`
- Then install drun into your local project where your `Makefile.dart` resides.

### Experimental dart2native binaries

You may prefer to install the global `drun` command as single statically compiled binary.

> _NOTE: You still need the dart SDK installed!_

#### Direct download

Go to https://github.com/brad-jones/drun/releases and download the archive for
your Operating System, extract the `drun` binary and and add it to your `$PATH`.

#### Curl Bash

```
curl -L https://github.com/brad-jones/drun/releases/latest/download/drun-linux-x64.tar.gz -o- | sudo tar -xz -C /usr/bin drun
```

#### RPM package

```
sudo rpm -i https://github.com/brad-jones/drun/releases/latest/download/drun-linux-x64.rpm
```

#### DEB package

```
curl -sLO https://github.com/brad-jones/drun/releases/latest/download/drun-linux-x64.deb && sudo dpkg -i drun-linux-x64.deb && rm drun-linux-x64.deb
```

#### Homebrew

<https://brew.sh>

```
brew install brad-jones/tap/drun
```

#### Scoop

<https://scoop.sh>

```
scoop bucket add brad-jones https://github.com/brad-jones/scoop-bucket.git;
scoop install drun;
```

## Usage

_pubspec.yaml_

```yaml
name: my_project

dependencies:
  # You should probably fix the version of drun but leaving it blank will
  # download the latest version and get you started.
  drun:
```

_Makefile.dart_

```dart
import 'package:drun/drun.dart';
Future main(argv) => drun(argv);
Future myTask() => task((drun) => drun.log('Hello World'));
```

Execute with `drun my-task`

> see [./example/README.md](./example/README.md) for more details

repository: brad-jones/drun

gha_language: Dart

repo_name: brad-jones/drun


text:
# Stellar
## concept
All assets in stellar are credit, issued by anchors.

When you hold assets in Stellar, you’re actually holding credit from a particular issuer that promises to return the real world value ( for example USD) when you return it.

License wise, this might pose a problem

## Distributed Exchange
Assets are linked to the issuing Anchor. An order can only be executed if both buyer and seller have a trustline to the issuing party.

Supports asset conversion up to 6 hops, but the whole payment is atomic.

**Assets must be present as credit on the stellar network.**
This works perfectly if your assets only exist on the stellar network as credit or if users interact through centralized parties holding their assets( like bitcoin bank or traditional exchange).

_Question is how a credit issuer that acts as an exchange for it's users can control/recuperate free floating real world assets like BTCor TFT that stay in control of the user._

Fees are in XLM.
## Stellar accounts

Just creating a keypair and an address like is common blockchains is not sufficient to receive funds, a transfer will fail. An account has to be explicitely created and funded with at least 1 XLM.

### Wallets
A variety of wallets is available, each with their own features or focus, it makes it a bit hard though as a beginner, especially since you need to know the concept of trustlines.

## Stellar Smart Contracts (SSC)
Not as flexible as for example Ethereum but this might be a good thing.

compositions of transactions that are connected and executed using various constraints:
- Multisignature
- Batching/Atomicity
- Sequence
- Time Bounds

**Seems sufficient for crowdfunding** or other basic financial operations or agreements.

**Atomic swaps** can be implemented since stellar supports multisig, [SHA256 hash](https://www.stellar.org/developers/guides/concepts/multi-sig.html#hashx) and timebounds.

## Custom assets
It is easy to create custom assets on the Stellar network as the [issuetoken example](./issuetoken/readme.md) shows.

### Token creation reasons
Stellar transactions can contain a memotext up to 28 bytes of ASCII/UTF-8 which is not sufficient to hold a sha256 encoded hash.

There is a Memohash field MemoHash which is a hash representing a reference to another transaction.

This can be used however to insert the hash of other documents, a concept known as [stellar attachments](https://www.stellar.org/developers/guides/attachment.html).
## Company accounts and multisig
Stellar allows multiple signatures for custom asset issuer accounts or company accounts: https://www.stellar.org/developers/guides/concepts/multi-sig.html

## Multiple addresses and anonimity
Stellar is not meant for anonimity.
You can have multiple registered accounts, each with their own balances, requiring XLM to perform transactions.

Payments from multiple addresses are not possible(as a workaround, one can merge the accounts first).
## Federation servers
This allows eay addresses like<EMAIL_ADDRESS>
## Ico's, crowdfunding, ...
As mentioned above, the stellar platform is suited for for crowdfunding or other basic financial operations or agreements

Possible options to issue credit:
- Already be on the stellar platform with trusted credit.
- Accept fiat or cryptocurrencies directly and issue credit on the stellar platform

We would have to provide a small wallet if people do not already have one.

## Market making
A bifrost server exists that will automatically exchange the received BTC or ETH for your custom token. Usefull for market making and ICO's.

There is also Kelp, a free, customizable, open-source trading bot for the Stellar universal marketplace.
## Signature schemes
Stellar currently uses the ed25519 signature scheme which is the same as Rivine currently.

## Storage for Core and Horizon
PostgreSQL

## random thoughts

Not completely decentralized,for example sending with kyc, requires knowledge and trust of the counterparty, also
Very good solution for traditional centralized banks that want to collaborate:
https://www.stellar.org/wp-content/uploads/2016/08/Sending-Payment-Flow-Detailed.jpg

However, the protocol includes who can hold assets: https://www.stellar.org/developers/guides/concepts/assets.html#controlling-asset-holders

A very extensive toolset for managing custom tokens and ICO's.


text:
# ion-modal

A Modal is a dialog that appears on top of the app's content, and must be dismissed by the app before interaction can resume. It is useful as a select component when there are a lot of options to choose from, or when filtering items in a list, as well as many other use cases.

### Creating

Modals can be created using a [Modal Controller](../modal-controller). They can be customized by passing modal options in the modal controller's create method.

### Passing parameters

When a modal is created, parameters might be passed to the newly created modal:

```ts
// Create a modal using MyModalComponent with some initial data
const modal = await modalController.create({
  component: MyModalComponent,
  componentProps: {
    'prop1': value,
    'prop2': value2
  }
});
```

Under the hood, the controller creates a new `ion-modal` and attaches the specified component to it.
It also assigns the specified `componentProps` to the component's instance:

```js
// pseudo-code
const instance = create(MyModalComponent);
instance.prop1 = value;
instance.prop2 = value2;
```

This way, your component can access the passed params, check the "Usage" section for further code example for each frameworks.

### Returning data

Modals can also return data back to the controller when they are dismissed.

```js
const modal = await modalController.create({...});
const { data } = await modal.onDidDismiss();
console.log(data);
```

```js
// Dismiss the top modal returning some data object
modalController.dismiss({
  'result': value
})
```

repository: scrpgil/ionic-docs

repo_name: scrpgil/ionic-docs


text:
# laravel-down-when-possible

Put Laravel "down" (maintenance mode) as soon as the DB (MySQL) is not used for the selected amount of minutes avoiding users to be interrupted while doing some other actions.

### Installation:

`composer require mrweb/laravel-down-asap`

### Basic Usage:

`php artisan down:asap`

### Options:

You can specify how much the DB (MySQL) idle time has to be (in minutes) by setting the `idle` flag. By default the idle time is 3 minutes: `php artisan down:asap --idle:10`

You can specify after how many seconds the system has to retry the command by setting the `retry` flag. By default the retry time is 30 seconds: `php artisan down:asap --retry:30`

repository: MrWeb/laravel-down-asap

repo_name: MrWeb/laravel-down-asap


text:
<!--
😍 Hi there! 😍
Thanks for filing an issue on BattleMovr! ✨

Before going through with this, 🙏 please 🙏 search through open issues to make sure it hasn't already been filed.

If it hasn't, please also fill *either* the "Bug" or "Feature" templates and delete the rest: 👇
-->

<!-- Bug Template:
### Bug Summary

_(what's wrong?)_

### Steps to Reproduce

_(instructions on how someone else can play through the game to cause the bug)_
-->

<!-- Feature Template:
### Feature Request

_(what do you want?)_
_(be as detailed as possible!)_

<!--
Bug example:

    ### Bug Summary

    The player can still walk after a battle cutscene has started.

    ### Steps to Reproduce

    1. Start a game with Pokemon in the player's party
    2. Trigger a battle with `FSP.battles.startBattle` (see docs/battles.md)
    3. Immediately try to walk - you can, but shouldn't be able to.
-->

<!--
Feature example:

    ### Feature Request

    Can we get a mod that lets the player push people out of the way automtically?

    When you're fast-forwarding through the game, it's annoying having to try to move around NPCs.
    I'd like it if we the player walking into them would push them out of the way without changing the player's velocity.

    Bonus points if they get a little "!" on top of their head. That'd be cute.
-->

repository: FullScreenShenanigans/BattleMovr

gha_language: TypeScript

repo_name: FullScreenShenanigans/BattleMovr


text:
# deno-sysdata

(Experimental) deno library for gathering info about your system

## Data we export

We want to support the kinds of things that Chef's [Ohai tool](https://docs.chef.io/ohai.html) provides.

- [ ] /etc/passwd parse
- [ ] /etc/group parse
- [ ] determine operating system (platform, platform family, version)
- [ ] kernel version
- [ ] network interfaces (tons of info here)
- [ ] uptime in seconds and human readable format
- [ ] init package discovery (systemd vs upstart vs whatever)
- [ ] hostname
- [ ] cloud provider metadata (this is a lot of stuff)
- [ ] filesystem discovery (devices, tempfs, network mounts)
- [ ] memory information (swap, total, free, buffers, other weird stuff)
- [ ] virtualization info
- [ ] CPU information (vendor, family, mhz, cores, flags)
- [ ] Arp table
- [ ] routes

## Testing

If you are on MacOS, only Virtualbox 6 can install Guest Additions and allow
host file shares.

repository: anxiousmodernman/deno

repo_name: anxiousmodernman/deno


text:
# Build Python AWS Lambda deployment packages with Docker

We are building for Python 3.8 and on the latest `amazonlinux 2`. You can either use `lambda.zip` directly or add `lambda-layer.zip` as a layer to your `lambda_function.py`. Python binary is in `/opt/bin/python3.8`.

## Why?

* Logging in to EC2 and [creating a deployment package by hand](https://docs.aws.amazon.com/lambda/latest/dg/python-package.html) is clumsy. Instead, script package creation around the [`amazonlinux 2` image](https://hub.docker.com/_/amazonlinux/).

## How to use

* Mount `/src` as a docker volume, this is where you should put your lambda code.
* Deployment packages `lambda.zip` and `lambda-layer.zip` are written to `/deploy` directory.
* Modify and mount `run.sh` script to `/opt/run.sh`.
* Pass environment variables:
    * `GIT_REPO` - clone this git repo into `/src`.
    * `PIP_PACKAGES` - space separated list of packages you want to add to your lambda zip.
    * `REM_LAMBDA_FILE` - (OPTIONAL) remove the original `lambda_function.py` file from `lambda-layer.zip` if you don't need it there.

```sh
$ docker pull sam2kb/lambda

$ docker run --rm \
  -v "$(pwd)/src:/src" \
  -v "$(pwd)/run.sh:/opt/run.sh" \
  -v "$(pwd)/deploy:/deploy" \
  -e GIT_REPO="https://github.com/some/repo" \
  -e PIP_PACKAGES="cryptography imap_tools " \
  -e REM_LAMBDA_FILE="lambda_function.py" \
  sam2kb/lambda \
  bash /opt/run.sh
```

## Or run with docker-compose
Remember to modify `docker-compose.yml` file first

```sh
$ docker-compose run --rm lambda

```

## Customize
Modify `run.sh` to suit your own purposes

## Use another Python version

Pass a build ARG with any other Python version as such `PYTHON_VER=3.8.0`

```sh
$ docker build --build-arg PYTHON_VER=3.8.0 -t mylambda .
```

Or with `docker-compose`

```sh
$ docker-compose build --build-arg PYTHON_VER=3.8.0
```


text:
---
layout: post
title: "More on Maps and Structs in Elixir"
desc: "Learn how to use use Maps and Structures. How to update and extend them"
keywords: "Elixir, Maps, Structs"
tags: [Elixir]
---

Let's talk a little bit more about Maps. I've already covered basics in the one of my [previous articles](http://whatdidilearn.info/2017/09/27/a-quick-glance-on-basic-types-in-elixir.html#maps).
Now it is time to go deeper and discover how we can update Maps and add new items to it.

## Maps

Imagine we have a following Map:

```elixir
iex> john = %{ "first_name" => "John", "last_name" => "Doe", "age" => 35 }
%{"age" => 35, "first_name" => "John", "last_name" => "Doe"}
```

Luckily for John, he has a Birthday today, that means he grew up one year more and we need to update his age.

### Update Maps

One of the ways to update a Map is to use following format:

```elixir
new_map = %{ old_map | key => value, ... }
```

Technically we are not updating a Map because Maps in Elixir as any other types are immutable.
Thus we are getting completely new Map instead.

```elixir
iex> john = %{ john | "age" => 36 }
%{"age" => 36, "first_name" => "John", "last_name" => "Doe"}
```

The downside (or is it upside?) of this approach is that it does not insert a new item into the Map if we are providing a non-existing key.

```elixir
iex> john = %{ john | "title" => "Mr." }
** (KeyError) key "title" not found in: %{"age" => 36, "first_name" => "John", "last_name" => "Doe"}
    (stdlib) :maps.update("title", "Mr.", %{"age" => 36, "first_name" => "John", "last_name" => "Doe"})
    (stdlib) erl_eval.erl:255: anonymous fn/2 in :erl_eval.expr/5
    (stdlib) lists.erl:1263: :lists.foldl/3
```

### Add new items

If we want to add new item to the Map we need to use [`Map.put_new/3`](https://hexdocs.pm/elixir/Map.html#put_new/3) function.

```elixir
iex> john = Map.put_new(john, "title", "Mr.")
%{"age" => 36, "first_name" => "John", "last_name" => "Doe", "title" => "Mr."}
```

Again, this function does not change our Map but produces completely new one instead.
We should always remember that when we are writing our code in Elixir.
So we need to assign the result of the function into a new variable. By the way, ["assign" is also not the right term for Elixir](http://whatdidilearn.info/2017/09/21/pattern-matching-in-elixir.html), but you've got what I mean here.

There is yet another function we can use to insert new values into the Map - [`Map.put/3`](https://hexdocs.pm/elixir/Map.html#put/3).

However, it not only inserts new values but also updates the existing ones.

```elixir
iex> john = %{"age" => 35, "first_name" => "John", "last_name" => "Doe"}
%{"age" => 35, "first_name" => "John", "last_name" => "Doe"}

iex> john = Map.put(john, "title", "Mr.")
%{"age" => 35, "first_name" => "John", "last_name" => "Doe", "title" => "Mr."}

iex> john = Map.put(john, "age", "36")
%{"age" => "36", "first_name" => "John", "last_name" => "Doe", "title" => "Mr."}
```

Depending on our needs we can either use `Map.put_new/3` or `Map.put/3` to add new items to the Map.

Now as we know how to update values and add new items it is time to learn how to remove certain keys from the Map.

### Delete keys

Elixir provides us [`Map.delete/2`](https://hexdocs.pm/elixir/Map.html#delete/2) to achieve that.

```elixir
iex> john
%{"age" => 36, "first_name" => "John", "last_name" => "Doe", "title" => "Mr."}
iex> john = Map.delete(john, "title")
%{"age" => 36, "first_name" => "John", "last_name" => "Doe"}
```

Great. Now we know how to work with the Maps. That is a good foundation for our next topic.

## Structs

Structs are some kind of wrapper around maps which provides additional functionality to the last.

Let's update our John's example using a Struct.
To define a Struct we need to define a Module, which would become the name of that structure. Then we use `defstruct` keyword followed by available keys.

```elixir
iex> defmodule Person do
...>   defstruct first_name: "", last_name: "", age: nil, adult: true
...> end
{:module, Person,
 <<70, 79, 82, 49, 0, 0, 8, 92, 66, 69, 65, 77, 65, 116, 85, 56, 0, 0, 0, 234,
   0, 0, 0, 22, 13, 69, 108, 105, 120, 105, 114, 46, 80, 101, 114, 115, 111,
   110, 8, 95, 95, 105, 110, 102, 111, 95, 95, ...>>,
 %Person{adult: true, age: nil, first_name: "", last_name: ""}}

iex> john = %Person{first_name: "John", last_name: "Doe", age: 35}
%Person{adult: true, age: 35, first_name: "John", last_name: "Doe"}

iex> bob = %Person{first_name: "Bob", age: 40}
%Person{adult: true, age: 40, first_name: "Bob", last_name: ""}
```

By defining a Struct in the following way, we are specifying the fields this structure has.
That being said we are defining the particular structure of the attributes and we are not allowed to use keys which were not specified.

```elixir
iex> alice = %Person{first_name: "Alice", address: "White Hall Str. 503"}
** (KeyError) key :address not found in: %Person{adult: true, age: nil, first_name: "Alice", last_name: ""}
    (stdlib) :maps.update(:address, "White Hall Str. 503", %Person{adult: true, age: nil, first_name: "Alice", last_name: ""})
    iex: anonymous fn/2 in Person.__struct__/1
    (elixir) lib/enum.ex:1811: Enum."-reduce/3-lists^foldl/2-0-"/3
    expanding struct: Person.__struct__/1
    iex: (file)
```

### Update Structs

As soon as a Struct is a Map underneath we can update it using the same approach:

```elixir
iex> john
%Person{adult: true, age: 35, first_name: "John", last_name: "Doe"}

iex> john = %Person{ john | age: 36 }
%Person{adult: true, age: 36, first_name: "John", last_name: "Doe"}
```

Following code also works fine. Even if it might look a little bit weird:

```elixir
iex> john = Map.put(john, :age, 37)
%Person{adult: true, age: 37, first_name: "John", last_name: "Doe"}
```

However if we try to use `Map.put_new/3` or `Map.delete/2` here (which is not permitted) we would get following result:

```elixir
iex> Map.put_new(john, :title, "Mr.")
%{__struct__: Person, adult: true, age: 37, first_name: "John",
  last_name: "Doe", title: "Mr."}

iex> Map.delete(john, :adult)
%{__struct__: Person, age: 37, first_name: "John", last_name: "Doe"}
```

### Define functions

One of the additional advantages of the Struct over the Map is that you can define functions for the Struct.
That is probably the reason why it's wrapped into the module.

```elixir
iex> defmodule Person do
...>   defstruct first_name: "", last_name: "", age: nil
...>
...>   def has_discount?(person) do
...>     person.age != nil && person.age < 18
...>   end
...>
...>   def full_name(person) do
...>     "#{person.first_name} #{person.last_name}"
...>   end
...> end
{:module, Person,
 <<70, 79, 82, 49, 0, 0, 11, 192, 66, 69, 65, 77, 65, 116, 85, 56, 0, 0, 1, 89,
   0, 0, 0, 35, 13, 69, 108, 105, 120, 105, 114, 46, 80, 101, 114, 115, 111,
   110, 8, 95, 95, 105, 110, 102, 111, 95, 95, ...>>, {:full_name, 1}}

iex> john = %Person{first_name: "John", last_name: "Doe", age: 35}
%Person{age: 35, first_name: "John", last_name: "Doe"}

iex> Person.has_discount?(john)
false

iex> Person.full_name(john)
"John Doe"
```

## Summary

Now we have several more items in our arsenal of knowledge.
What to use in your programmes Maps or Structs it's up to you.
I think once you want a well-defined type with a predefined set of attributes, go with the Structs.
If you need something short-lived and anonymous use Maps.


text:
# storex-backend-dexie

IndexedDB back-end for Storex based on [Dexie](https://dexie.org/). See [the Storex repo](https://github.com/WorldBrain/storex) for more info on how to use this.

repository: WorldBrain/storex-backend-dexie

repo_name: WorldBrain/storex-backend-dexie


text:
# cointracking-to-turbotax-online
Python script to transform cointracking.info tax reports into a format that TurboTax Online accepts

## Instructions
1. Create your cointracking.info Tax-Report
2. From cointracking.info, view your report and click `CSV Download` and save your CSV locally
3. Run `python3 cointracking-to-turbotax path/to/downloaded_file.csv` to generate a new file, `turbotax_online_2018_crypto_report.csv` alongisde the original
4. In Turbotax Online 2018, under Wages & Income -> Cryptocurrency, select `Bitcoin.tax` as your crypto platform, and upload the `turbotax_online_2018_crypto_report.csv` file
5. Verify all of the entries look correct

## Known Limitations
* Turbotax Online 2018 only supports 250 transactions. If the output from cointracking.info has too many rows, Turbotax may reject it.


text:
# Practice and Experiment with RTL Kernels

Apply and practice what you've learned in the earlier steps of this guide by running more hands-on examples. Familiarize yourself with online resources relating to the SDAccel™ environment, and make your way to the [AWS forum](https://forums.aws.amazon.com/forum.jspa?forumID=243) to search for knowledge and find answers.

## Experiment with Other Examples

Running and experimenting with the following three examples of RTL kernels will help you further familiarize yourself with the RTL kernel flow.

#### Example 1: Vector Addition with two Clocks

This example shows vector addition performed by an RTL kernel with two clocks and the use of the `--kernel_frequency` XOCC option.

Download and run [this example](https://github.com/Xilinx/SDAccel_Examples/tree/aws_2018.3/getting_started/rtl_kernel/rtl_vadd_2clks) from the SDAccel GitHub repository.

#### Example 2: Vector Addition with two Kernels

This example shows how create an accelerated design using more than one RTL Kernel. In this example, Vector Addition is performed with two kernels (Kernel_0 and Kernel_1) which perform vector addition. Kernel_1 reads the output from Kernel_0 as one of two inputs.

[Download and run this example](https://github.com/Xilinx/SDAccel_Examples/tree/aws_2018.3/getting_started/rtl_kernel/rtl_vadd_2kernels) from the SDAccel GitHub repository.

#### Example 3: High-Performance Matrix Multiply with precompiled XO file and advanced Vivado™ implementation options

This example implements a high-performance matrix multiplication of two input matrices (A*B=C). The matrix multiplication kernel operates on matrices of type int16 and produces int16 results. Internally, the kernel has a systolic array of 2048 DSP units and is attached to two DDR banks. The DSP array runs at 400 MHz, whereas the logic around the array runs at 300 MHz.

[Download and run this example](https://github.com/Xilinx/SDAccel_Examples/tree/aws_2018.3/acceleration/high_perf_mat_mult) from the SDAccel GitHub repository.

## Get Support and Troubleshoot Issues

The [AWS F1 SDAccel Development forum](https://forums.aws.amazon.com/forum.jspa?forumID=243) is the place to look for answers, share knowledge and get support. Make sure to subscribe to the forum by clicking the **Watch Forum** link in the Available Actions section.

## Learn More about SDAccel

#### SDAccel QuickTake Video Tutorials

* [Fundamental Concepts of Application Host Code](https://www.xilinx.com/video/hardware/concepts-of-application-host-code.html)

* [Introduction to the SDAccel RTL Kernel Wizard](https://www.xilinx.com/video/software/intro-sdaccel-rtl-kernel-wizard.html)

#### Documentation for SDAccel v2018.3

* _SDx Development Environment Release Notes, Installation, and Licensing Guide_ ([UG1238](https://www.xilinx.com/cgi-bin/docs/rdoc?v=replace;d=ug1238-sdx-rnil.pdf))
* _SDAccel Environment User Guide_ ([UG1023](https://www.xilinx.com/cgi-bin/docs/rdoc?v=replace;d=ug1023-sdaccel-user-guide.pdf))
* _SDAccel Environment Optimization Guide_ ([UG1207](https://www.xilinx.com/cgi-bin/docs/rdoc?v=replace;d=ug1207-sdaccel-optimization-guide.pdf))
* _SDAccel Environment Tutorial_ ([UG1021](https://www.xilinx.com/cgi-bin/docs/rdoc?v=replace;d=ug1021-sdaccel-intro-tutorial.pdf))

NEXT: Install and Run SDAccel on your own Machine

Copyright© 2018 Xilinx


text:
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.0.0](https://github.com/jeremyben/reflet/compare/@reflet/express@1.6.1<EMAIL_ADDRESS>(2023-07-30)

### Bug Fixes

* **express:** aconvenient types with each param decorator ([e3a86bf](https://github.com/jeremyben/reflet/commit/e3a86bf8a503e2fefe50f277517f20917758146b))
* **express:** allow Send.Dont to be applied without invokation ([c701586](https://github.com/jeremyben/reflet/commit/c701586e5d845a3b3d8bd5f73a61e055c0e8c7dc))
* **express:** bug with mutated middewares reference in Use decorator ([0622483](https://github.com/jeremyben/reflet/commit/0622483195510287a284dcd37edbe1cdb40ac39e))
* **express:** change final-handler signature for booleans ([e796dc1](https://github.com/jeremyben/reflet/commit/e796dc16de0cd9b6355bf494eb6c7e3bb890d144))
* **express:** change path constraint object to a tuple and unwrap RegistrationArray to Registration ([58cc9a2](https://github.com/jeremyben/reflet/commit/58cc9a2031af52ddccc8a4892b0a7f80a909c6ea))
* **express:** dedicated reflet express error ([ddf9c90](https://github.com/jeremyben/reflet/commit/ddf9c9053b40ce25abde535f1370cd0808f67e1a))
* **express:** easier and more flexible finalHandler ([32fb80f](https://github.com/jeremyben/reflet/commit/32fb80faa7803723055fb9bcb342e3c12df830da))
* **express:** improve internal errors ([8a90790](https://github.com/jeremyben/reflet/commit/8a907905eb0b5b4477f62fba263670840050e181))
* **express:** improve signature for param middleware deduplication ([3206e26](https://github.com/jeremyben/reflet/commit/3206e262f9ee53d8bf7bf71a617cfe613e04f9e8))
* **express:** make Router decorator mandatory ([1da8201](https://github.com/jeremyben/reflet/commit/1da82012fcb0807d6eb203456d9512d595b5f00f))
* **express:** more control for middleware deduplication in createParamDecorator ([18e6d41](https://github.com/jeremyben/reflet/commit/18e6d41bef340dc59cef6bafde7a64b951e8f4bd))
* **express:** more options to reveal error name and message ([1c0824c](https://github.com/jeremyben/reflet/commit/1c0824c7805d26a1a5c39c4201b7a44ea3f9949b))
* **express:** proper reflet error for sending response object ([16a7e50](https://github.com/jeremyben/reflet/commit/16a7e50fcd7bbef81ce2513f5d0eccab4ab1fdf4))
* **express:** remove deprecated APIs ([9097d60](https://github.com/jeremyben/reflet/commit/9097d601db62c0a7d014c2b48fadbb104cb07690))
* **express:** remove every "controller" word occurence ([c68bca8](https://github.com/jeremyben/reflet/commit/c68bca8b3b0b13b52c62f5b87118de03215d6071))
* **express:** remove generic from ClassOrMethodDecorator interface ([b450227](https://github.com/jeremyben/reflet/commit/b4502278fd8cb493e784090279e580dd3f9bb4e7))
* **express:** remove global error handler to avoid magic ([fd5a286](https://github.com/jeremyben/reflet/commit/fd5a2865d379d3069cef0be595d429ea4cebd3c9))
* **express:** remove need for reflect-metadata ([a0eea93](https://github.com/jeremyben/reflet/commit/a0eea9386011c14787d5722b775ff0c60e70cbdc))
* **express:** Remove way of registering childrens router in parent constructor ([002f551](https://github.com/jeremyben/reflet/commit/002f5510eed0b5e933142f8f914b1211ff044684))
* **express:** rename Method decorator to Route ([9425ee4](https://github.com/jeremyben/reflet/commit/9425ee4550b7892f75610e91dd579e157c7eebb3))
* **express:** rename reveal to expose in final handler options ([a3da648](https://github.com/jeremyben/reflet/commit/a3da648d8cc42b9467c471762c8452071400c401))
* **express:** ScopedMiddlewares out of Router namespace ([7987be4](https://github.com/jeremyben/reflet/commit/7987be44c25b84fa0b460eaee60a4d7139f4d8c9))
* **express:** send not detected on decorated application ([f8656d6](https://github.com/jeremyben/reflet/commit/f8656d6565187779dd629f3c4fd02482213830d7))
* **express:** simplify regex for json detection in final handler ([9ce7f5a](https://github.com/jeremyben/reflet/commit/9ce7f5a02594ce5b6424884dabcaa01deea8289c))
* **express:** throw an error if Router.Children are defined without Router ([da7a357](https://github.com/jeremyben/reflet/commit/da7a35792cf7e9d8bcc8631d4f04ea35b59efbc5))
* **express:** throw error on multiple param decorators overriding each other ([93081e5](https://github.com/jeremyben/reflet/commit/93081e5e7d2bc9eb1e78e32d12612b0cf2b98467))
* use reflet/http for header and status types ([3a1c362](https://github.com/jeremyben/reflet/commit/3a1c36206c0a9afd1e8315d2f15d7db8529c9f96))

### Features

* **express:** allow uppercase http method in Route decorator ([c890fc5](https://github.com/jeremyben/reflet/commit/c890fc51cf3e61873c91e130264cbe1b1a5e9713))
* **express:** custom handler for Send decorator ([36c5103](https://github.com/jeremyben/reflet/commit/36c5103b45cad3754a282edf9e4716e15d91bee3))
* **express:** custom status code for notFoundHandler ([2fd6d99](https://github.com/jeremyben/reflet/commit/2fd6d99eef47d0b48f330785aab600d3956e636e))
* **express:** decorator Router.ScopedMiddlewares ([6b46032](https://github.com/jeremyben/reflet/commit/6b46032d155b1a7f3da07a84bc4bdf4d6c2e1bbb))
* **express:** final handler ([4f08c3e](https://github.com/jeremyben/reflet/commit/4f08c3eb89bb17cd6ef60cf77cc28ab1309a650d))
* **express:** simpler and more flexible option to whitelist error properties in finalHandler ([800698d](https://github.com/jeremyben/reflet/commit/800698dc4883a1c283b62a4d5550d5b956b8f1ae))

### BREAKING CHANGES

* **express:** Send decorator no longer has status, nullStatus and undefinedStatus options.
* reflet/http is now a required peer dependency
* **express:** Path constraint in registration is no longer an object
* **express:** signature has changed from a single boolean to a full object for each middleware.
* **express:** Router decorator must be applied on routing classes
* **express:** overload of register method for chidren routers has been removed
* **express:** rename Controllers to RegistrationArray
* **express:** DontSend decorator and Router.register method are removed
* **express:** global error handler has been removed (no more automatic json detection in global errors)
* **express:** Method replaced by Route

## [1.6.1](https://github.com/jeremyben/reflet/tree/master/express/compare/@reflet/express@1.6.0<EMAIL_ADDRESS>(2022-04-11)

### Bug Fixes

* **express:** bug with mutated middewares reference in Use decorator ([f77bbfd](https://github.com/jeremyben/reflet/tree/master/express/commit/f77bbfd))

# [1.6.0](https://github.com/jeremyben/reflet/tree/master/express/compare/@reflet/express@1.5.3<EMAIL_ADDRESS>(2021-08-05)

### Bug Fixes

* **express:** application class mixin in node 14 and 16 ([396fcb8](https://github.com/jeremyben/reflet/tree/master/express/commit/396fcb85a9c7d948f8fde131fe8c28f6f06d295d))
* **express:** more flexible union signature in register ([b9d9780](https://github.com/jeremyben/reflet/tree/master/express/commit/b9d9780412d07ef0eb2221aa9646e6bc9bb85783))
* **express:** only wrap async functions instead of promisify everything ([2f2ffb6](https://github.com/jeremyben/reflet/tree/master/express/commit/2f2ffb6b5d1501d377af75832577a74be1673e8c))

### Features

* **express:** application class ([1baae1e](https://github.com/jeremyben/reflet/tree/master/express/commit/1baae1eff5570f2f0033a2a12a0a60b974566a5d))
* **express:** can decorate application class with Send ([d56195a](https://github.com/jeremyben/reflet/tree/master/express/commit/d56195a491a3f656b65a91dc59d28ff8031e950f))
* **express:** dynamic router ([10e8491](https://github.com/jeremyben/reflet/tree/master/express/commit/10e84917ed08fe1e81e57d6fa89e79faa0e4c70b))
* **express:** router children decorator ([b7fe72f](https://github.com/jeremyben/reflet/tree/master/express/commit/b7fe72f83b1509189b974f23b590816c30a6bea9))
* **express:** use same register function for child routers, deprecate the other one ([741ef76](https://github.com/jeremyben/reflet/tree/master/express/commit/741ef76dc1aa2d1fa404c0a03de759932eb7bba5))

## [1.5.3](https://github.com/jeremyben/reflet/tree/master/express/compare/@reflet/express@1.5.2<EMAIL_ADDRESS>(2021-02-18)

### Bug Fixes

* **express:** deprecate DontSend, add Send.Dont ([f81e197](https://github.com/jeremyben/reflet/tree/master/express/commit/f81e197))
* **express:** detect headers in global error handler ([db2309e](https://github.com/jeremyben/reflet/tree/master/express/commit/db2309e))

## [1.5.2](https://github.com/jeremyben/reflet/tree/master/express/compare/@reflet/express@1.5.1<EMAIL_ADDRESS>(2021-02-12)

### Bug Fixes

* **express:** add generic to middleware decorator to augment request object ([9386992](https://github.com/jeremyben/reflet/tree/master/express/commit/9386992))
* **express:** allow handler to be property function ([34af031](https://github.com/jeremyben/reflet/tree/master/express/commit/34af031))
* **express:** can pass multiple http verbs to Method ([fabcf6a](https://github.com/jeremyben/reflet/tree/master/express/commit/fabcf6a))

## [1.5.1](https://github.com/jeremyben/reflet/tree/master/express/compare/@reflet/express@1.5.0<EMAIL_ADDRESS>(2021-01-05)

### Bug Fixes

* **express:** conflict with express router interface ([0e634bf](https://github.com/jeremyben/reflet/tree/master/express/commit/0e634bf))

# [1.5.0](https://github.com/jeremyben/reflet/tree/master/express/compare/@reflet/express@1.4.0<EMAIL_ADDRESS>(2021-01-05)

### Bug Fixes

* **express:** could not call Router.register multiple times ([0eb8e34](https://github.com/jeremyben/reflet/tree/master/express/commit/0eb8e34))

### Features

* **express:** compatibility with plain express routers in register functions ([2218ddd](https://github.com/jeremyben/reflet/tree/master/express/commit/2218ddd))
* **express:** paths centralization and contraint ([e6a11ee](https://github.com/jeremyben/reflet/tree/master/express/commit/e6a11ee))

# [1.4.0](https://github.com/jeremyben/reflet/tree/master/express/compare/@reflet/express@1.3.2<EMAIL_ADDRESS>(2020-12-20)

### Features

* **express:** expose all route decorators in Method namespace ([93713bf](https://github.com/jeremyben/reflet/tree/master/express/commit/93713bf))

## [1.3.2](https://github.com/jeremyben/reflet/tree/master/express/compare/@reflet/express@1.3.1<EMAIL_ADDRESS>(2020-05-24)

### Bug Fixes

* **express:** shared middlewares are no longer mutated before being passed to children ([1c35488](https://github.com/jeremyben/reflet/tree/master/express/commit/1c35488))
* remove esModuleInterop for better typing compatibility ([0987cc8](https://github.com/jeremyben/reflet/tree/master/express/commit/0987cc8))

## [1.3.1](https://github.com/jeremyben/reflet/tree/master/express/compare/@reflet/express@1.3.0<EMAIL_ADDRESS>(2020-04-28)

### Bug Fixes

* **express:** attach children routers after routes of parent routers ([323a2b1](https://github.com/jeremyben/reflet/tree/master/express/commit/323a2b1))
* **express:** class with dependencies should be instantiated ([8e6c89f](https://github.com/jeremyben/reflet/tree/master/express/commit/8e6c89f))
* **express:** temporary allow to register nested express routers, untyped and undocumented ([d2fe64f](https://github.com/jeremyben/reflet/tree/master/express/commit/d2fe64f))

# [1.3.0](https://github.com/jeremyben/reflet/tree/master/express/compare/@reflet/express@1.2.0<EMAIL_ADDRESS>(2020-04-26)

### Features

* **express:** log 5xx errors ([9cef2ef](https://github.com/jeremyben/reflet/tree/master/express/commit/9cef2ef))
* **express:** register nested routers ([8eb76ad](https://github.com/jeremyben/reflet/tree/master/express/commit/8eb76ad))

# [1.2.0](https://github.com/jeremyben/reflet/tree/master/express/compare/@reflet/express@1.1.0<EMAIL_ADDRESS>(2020-04-23)

### Features

* **express:** allow instances in register, for dependency injection ([553a446](https://github.com/jeremyben/reflet/tree/master/express/commit/553a446))

# [1.1.0](https://github.com/jeremyben/reflet/tree/master/express/compare/@reflet/express@1.0.0<EMAIL_ADDRESS>(2020-04-07)

### Bug Fixes

* **express:** add node typings as peer dependency ([6284948](https://github.com/jeremyben/reflet/tree/master/express/commit/6284948))
* **express:** brand decorators ([c87b66d](https://github.com/jeremyben/reflet/tree/master/express/commit/c87b66d))
* **express:** instantiate controller to let access eventual properties ([a6f9b41](https://github.com/jeremyben/reflet/tree/master/express/commit/a6f9b41))
* **express:** rebrand decorators ([253d65a](https://github.com/jeremyben/reflet/tree/master/express/commit/253d65a))
* **express:** typings ([48744fd](https://github.com/jeremyben/reflet/tree/master/express/commit/48744fd))
* use distinct decorator types ([ee55013](https://github.com/jeremyben/reflet/tree/master/express/commit/ee55013))

### Features

* **express:** warn for controllers without route ([345b3e6](https://github.com/jeremyben/reflet/tree/master/express/commit/345b3e6))

# 1.0.0 (2019-10-03)

### Bug Fixes

* **express:** allow typing the error object in Catch decorator ([a9375cd](https://github.com/jeremyben/reflet/tree/master/express/commit/a9375cd))
* **express:** authorize app.all as a routing method in Method decorator ([a450c20](https://github.com/jeremyben/reflet/tree/master/express/commit/a450c20))
* **express:** class send options are now extended by method send options instead of reset ([2f2edef](https://github.com/jeremyben/reflet/tree/master/express/commit/2f2edef))
* **express:** dedupe param middlewares according to function name instead of function body ([7dfede3](https://github.com/jeremyben/reflet/tree/master/express/commit/7dfede3))
* **express:** error message property is properly sent by the default error handler in json responses ([8bea495](https://github.com/jeremyben/reflet/tree/master/express/commit/8bea495))
* **express:** fix the middlewares order in routes applied to an app instance ([957268d](https://github.com/jeremyben/reflet/tree/master/express/commit/957268d))
* **express:** global error handler better prioritize status detection and clean status in message ([e6dd692](https://github.com/jeremyben/reflet/tree/master/express/commit/e6dd692))
* **express:** global error handler normalizes primitive type errors ([5d5a87f](https://github.com/jeremyben/reflet/tree/master/express/commit/5d5a87f))
* **express:** remove alpha stage Render decorator ([b8ae219](https://github.com/jeremyben/reflet/tree/master/express/commit/b8ae219))
* **express:** use symbols for reflect metadata keys ([68d7d86](https://github.com/jeremyben/reflet/tree/master/express/commit/68d7d86))

### Features

* **express:** add head, options, all express methods as route decorators ([bf43e05](https://github.com/jeremyben/reflet/tree/master/express/commit/bf43e05))
* **express:** allow multiple Use and Catch decorators, remove UseAfter ([0063a59](https://github.com/jeremyben/reflet/tree/master/express/commit/0063a59))
* **express:** allow to mark param decorator middlewares for deduplication ([1dedc26](https://github.com/jeremyben/reflet/tree/master/express/commit/1dedc26))
* **express:** apply body-parser middlewares to routes using @Body decorator ([7e5e383](https://github.com/jeremyben/reflet/tree/master/express/commit/7e5e383))
* **express:** dedupe/remove param middlewares if they're already applied elsewhere ([6b516c9](https://github.com/jeremyben/reflet/tree/master/express/commit/6b516c9))
* **express:** default global error handler, detects json and is removed if another is applied ([99d09b5](https://github.com/jeremyben/reflet/tree/master/express/commit/99d09b5))
* **express:** expose generic Method decorator, remove Head, Options and All decorators ([3c6be9a](https://github.com/jeremyben/reflet/tree/master/express/commit/3c6be9a))
* **express:** handle methods return value (async, streams, configurable status) with @Send ([bfdd1ae](https://github.com/jeremyben/reflet/tree/master/express/commit/bfdd1ae))
* **express:** infer error status code ([364564a](https://github.com/jeremyben/reflet/tree/master/express/commit/364564a))
* **express:** narrow @Headers string type to known request headers ([24184ed](https://github.com/jeremyben/reflet/tree/master/express/commit/24184ed))
* **express:** param decorator creator function, use it for our own param decorators ([0c2fca2](https://github.com/jeremyben/reflet/tree/master/express/commit/0c2fca2))
* **express:** register routes on app, common decorators ([6fbe988](https://github.com/jeremyben/reflet/tree/master/express/commit/6fbe988))
* **express:** route params decorators can be applied without invokation ([3250c3c](https://github.com/jeremyben/reflet/tree/master/express/commit/3250c3c))

repository: jeremyben/reflet

repo_name: jeremyben/reflet


text:
.vue to .js
=================

A tool for Compile `.vue` file to `.js` file.

The `.vue` means use [.vue Spec file](https://vue-loader.vuejs.org/en/start/spec.html).

> `*.vue` file consists of three types of top-level language blocks: `<template>`, `<script>` and `<style>`.

## Install

```sh
$ npm i vue2js -g
```

## Usage

You can use it as command line tool or scripting with it.

### Shell

```sh
$ vue2js
Usage: vue2js <filename>
```

### Scripting

```
const vue2js = require('vue2js');

var content = fs.readFileSync('*.vue', 'utf8');
console.log(vue2js(content));
```

## License

The MIT license


text:
---
layout: post
title:  "UnifiedPush, Promises and You"
date:   2016-06-07
permalink: unifiedpush-promises-and-you
categories: AeroGear Node.js UnifiedPush
---

That's correct folks, it has finally happened.  The UnifiedPush Node Sender, https://www.npmjs.com/package/unifiedpush-node-sender , has been Promisified for the 0.13.0 release.

The API has changed slighty and it has also become a bit more "Functional" and now uses features from Node 4.x .

What does all this mean?

It means this was a complete re-write of the code base and is **Not** a drop in replacement for the previous versions.

Lets take a look at an example to see how to use the new Sender.

First thing is to require the module:

    const unifiedPushSender = require('unifiedpush-node-sender');

The resulting `unifiedPushSender` is a function, so we can call it with some settings and it will return a Promise giving us the `client` object

	const settings = {
    	url: 'URL_TO_PUSH_SERVER',
        applicationId: 'APPLICATION_ID',
        masterSecert: 'SHHHH'
    }

    unifiedPushSender(settings).then((client) => {
    	client.sender.send(message, options).then(() => {
        });
    });

Now if we take a look at this client object, we see there is a `sender` object with 1 method called `send`

The `send` method is pretty identical to the previous version, except it now returns a Promise and no longer emits events or uses callbacks

**I'll say it again, No Event Emitter and No Callbacks, Only Zuul, ....... I mean Promises**

And now i leave you with this cat picture:

![](http://i1.kym-cdn.com/photos/images/facebook/000/314/021/149.jpg)


text:
---
metaTitle: ".NET Framework - Code Contracts"
description: "Contracts for Interfaces, Preconditions, Postconditions, Installing and Enabling Code Contracts"
---

# Code Contracts

## Contracts for Interfaces

Using Code Contracts it is possible to apply a contract to an interface.  This is done by declaring an abstract class that implments the interfaces.  The interface should be tagged with the `ContractClassAttribute` and the contract definition (the abstract class) should be tagged with the `ContractClassForAttribute`

**C# Example...**

```dotnet
[ContractClass(typeof(MyInterfaceContract))]
public interface IMyInterface
{
    string DoWork(string input);
}
//Never inherit from this contract defintion class
[ContractClassFor(typeof(IMyInterface))]
internal abstract class MyInterfaceContract : IMyInterface
{
    private MyInterfaceContract() { }

    public string DoWork(string input)
    {
        Contract.Requires(!string.IsNullOrEmpty(input));
        Contract.Ensures(!string.IsNullOrEmpty(Contract.Result<string>()));
        throw new NotSupportedException();
    }
}
public class MyInterfaceImplmentation : IMyInterface
{
    public string DoWork(string input)
    {
        return input;
    }
}

```

**Static Analysis Result...**

[](https://i.stack.imgur.com/eDxbs.png)

## Preconditions

Preconditions allows methods to provide minimum required values for input parameters

**Example...**

```dotnet
void DoWork(string input)
{
    Contract.Requires(!string.IsNullOrEmpty(input));

    //do work
}

```

**Static Analysis Result...**

[](http://i.stack.imgur.com/ZFVU0.png)

## Postconditions

Postconditions ensure that the returned results from a method will match the provided definition.  This provides the caller with a definition of the expected result.  Postconditions may allowed for simplied implmentations as some possible outcomes can be provided by the static analyizer.

**Example...**

```dotnet
string GetValue()
{
    Contract.Ensures(Contract.Result<string>() != null);

    return null;
}

```

**Static Analyis Result...**

[](http://i.stack.imgur.com/gpCrS.png)

## Installing and Enabling Code Contracts

While `System.Diagnostics.Contracts` is included within the .Net Framework.  To use Code Contracts you must install the Visual Studio extensions.

Under `Extensions and Updates` search for `Code Contracts` then install the `Code Contracts Tools`

[](http://i.stack.imgur.com/hTYJ1.png)

After the tools are installed you must enable `Code Contracts` within your Project solution.  At the minimum you probably want to enable the `Static Checking` (check after build).  If you are implementing a library that will be used by other solutions you may want to consider also enabling `Runtime Checking`.

[](http://i.stack.imgur.com/f4f1Z.png)

#### Remarks

Code contracts allow for compile or runtime analysis of pre/post conditions of methods and invariant conditions for objects.  These conditions may be used to ensure callers and return value match valid states for application processing.  Other uses for Code Contracts include documentation generation.

repository: haifenghuang/generate

repo_name: haifenghuang/generate


text:
Airship
==================

This is a very simple Kohana 3 module for the Urban Airship REST API (http://www.urbanairship.com)

Use it like so:

$payload = array(
	"aps" => array(
			'badge' => '+1',
			'alert' => "You are sending Push Notifications! :)",
			'sound' => 'alert.caf',
		),
	"device_tokens" => array('asdlkfj12340809r8qweorlkasjdflkajsd091823094'),
	"extra" => array(
		'some_key' => 'some_value',
		),
 );

$airship = Airship::factory();
$airship->push($payload);

License
-------
Copyright 2011, @geomon. Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php

repository: TongueTango/tonguetangoServer

repo_name: TongueTango/tonguetangoServer