text:
# Data Visualization

Why it is important?

- 越来越多的决定是数据驱动的。Eg，炒股票以前凭感觉，凭交易所门口大妈的报纸。现在看指标市盈率、换手率、大股东持有时间。
- 数据越来越多，大家都是非常熟悉2007年以后我们能够接触到的数据都是爆炸式的增长。
- 人理解数据的习惯更偏向于从图表中获取知识而不是从报表中，资产负债表没有K线图来的直观。
- 对于输血来说同样是有很多指标需要监控，我们关心A型血申红量的变化趋势、我们也关心患者在输血治疗前后血常规指标的变动，对变化趋势的追踪能够帮助我们作出库存管理策略的更新、工作进度的安排、科研热点的选择。

可视化的目的：

- Exploration：找到数据告诉您的故事。发现型
- Explanation：图表帮助您讲故事。

我们介绍的目的：

单机版可以支持简单可视化功能，帮助各家医院生产出使用与自己使用场景的看板，间

Let’s say you need to understand thousands or even millions of rows of data, and you have a short time to do it in.

The data may come from your team, in which case perhaps you’re already familiar with what it’s measuring and what the results are likely to be. Or it may come from another team, or maybe several teams at once, and be completely unfamiliar. Either way, the reason you’re looking at it is that you **have a decision to make, and you want to be informed by the data before making it**. Something probably hangs in the balance: a customer, a product, or a profit.

**How are you going to make sense of all that information efficiently so you can make a good decision? Data visualization is an important answer to that question.**

The best data visualizations are ones that *expose something new* about the underlying patterns and relationships contained within the data.

Because of the way the human brain processes information, using charts or graphs to visualize large amounts of complex data is easier than poring over spreadsheets or reports. Data visualization is a quick, easy way to convey concepts in a universal manner – and you can experiment with different scenarios by making slight adjustments.

Data visualization can also:

- Identify areas that need attention or improvement.
- Clarify which factors influence customer behavior.
- Help you understand which products to place where.
- Predict sales volumes.

Today more than ever, professionals are being asked to argue their cases and make their decisions based on data,” he says. “A new, data-oriented mind-set is permeating the business world.”

non-technical professionals must now produce and comprehend insights from Big Data.

repository: xiaochuan-du/architecture-primer

path: /Data viz.md

filename: Data viz.md

repo_name: xiaochuan-du/architecture-primer


text:
miku
==

```bash
$ git clone https://github.com/adrien1018/miku.git
$ cd miku
$ git submodule update --init
```

#### How to start the judge client
```bash
$ make
$ sudo ./start_script
```
Some configuration can be made inside startscript:
- `-v/--verbose` for extra verbosity
- `-p/--parallel [NUMBER]` to evaulate at most `[NUMBER]` testdata at the same time.
- `-b [NUMBER]` to set sandbox indexing offset. Need to be set to an appropriate number if running multiple judges on one computer.
- `-a/--aggressive-update` to aggressivly update verdict and result.

license: MIT

branch_name: refs/heads/master

extension: md

gha_language: C

gha_license_id: MIT

license_type: permissive


text:
[![Build Status](https://api.travis-ci.org/alagafonov/php-trademe-jobs-api.svg?branch=master)](https://api.travis-ci.org/alagafonov/php-trademe-jobs-api)
[![StyleCI](https://styleci.io/repos/72507203/shield?style=flat)](https://styleci.io/repos/72507203)

# Trademe.co.nz Jobs APIs Client Library for PHP #

## Description ##
Trademe.co.nz Jobs APIs Client Library provides endpoints for managing, listing, and retrieving job listings. These are a subset of all of the functionality available across Trade Me but should provide a good starting point for starting to list and manage jobs through the API.

## Requirements ##
* [PHP 5.5.0 or higher](http://www.php.net/)

## Developer Documentation ##
http://developer.trademe.co.nz/getting-started/

## Installation via Composer ##

```bash
composer require alagafonov/php-trademe-jobs-api:1.0.0-beta
```

## Examples ##

```php
// include composer dependencies
require_once 'vendor/autoload.php';

$client = new Client();
$client->authenticate(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, TOKEN_SECRET);
$listing = $client->listing()->retrieve(5032388);
```

## License

Library is licensed under the MIT License - see the LICENSE file for details

## Sponsored by

[<img src="http://www.subscribe-hr.com.au/hs-fs/hubfs/subscribe_hr_logo_tech.png" width="200">](http://www.subscribe-hr.com.au/)

repository: alagafonov/php-trademe-jobs-api

repo_name: alagafonov/php-trademe-jobs-api


text:
## `var`

You may have noticed that the `var` keyword is optional. If not, go ahead and try to initialize a variable without using it.

```js
> myOtherVar = "no var";
undefined

> myOtherVar;
"no var"

> global.myOtherVar;
"no var"
```

So why would we ever use `var`? Because if we don't, the variable will look up the scope chain for the binding, or until it hits the global scope. Let's return to an example that we've seen before:

```js
var myVar = 20;

function foo() {
  var myVar = 2;
  return myVar + 5;
}

myVar === 20; // what does this output?
foo() === 7; // what does this output?
myVar === 20; // what does this output?
```

However, if we neglect to use `var`, we will overwrite the variable in the outer scope. This is because instead of confining the binding to the local scope, `myVar` tries to reference the closest declaration it can find in the scope chain.

```js
var myVar = 20;

function foo() {
  myVar = 2;
  return myVar + 5;
}

myVar === 20; // what does this output?
foo() === 7; // what does this output?
myVar === 20; // what does this output?
myVar === 2; // what does this output?
```


text:
# map.lu
This is the sources to my map tiles server which runs on http://map.lu

I use this webapp as a front-end to provide my own customised maps on various sites. The actual map server running mapnik and using a small section of the OpenStreepMap data actually runs on a server at home.

How it works: Simply if a copy of the tile is not available locally then it retrieves the tile from the home server. That tile is then cached permanently on the public server.

Every so often the public cache is cleared, usually if it's getting large or the database has been updated (I only update it once every 6 months or so) or the layer's details have changed.

gha_language: Scheme


text:
# Architecture

Here we give a set of architectural principles and rules that the application follows

## LIFT

Do structure the app such that you can

-   **Locate** code quickly,
-   **Identify** the code at a glance,
-   keep the **Flattest** structure you can,
-   and **Try** to be DRY. [taken from here](https://angular.io/guide/styleguide#lift)

## Overall structure guidelines

### Folders-by-feature structure

Create folders named for the feature area they represent.

```bash
# BAD
reducers/
   user-page.reducer.ts
actions/
   user-page.actions.ts
epics/
   user-page.epics.ts
pages/
    user-pages/
        user-page{spec.tsx,.tsx,.scss}

# GOOD
user/
    pages/
        user-page/
            user-page{spec.tsx,.tsx,.scss}
        state/
            user-page.{reducer,actions,epics}.ts
```

## Dependency layers

Below is a diagram showing the dependency rules in the application

[dependency-cruiser](https://github.com/sverweij/dependency-cruiser) utility used to control this dependencies

(See [depcruise/](../depcruise) configs for details)

and below is how it looks in real code

## Layers

-   [app layer](layer-0-app.md)
-   [modules layer](layer-1-modules.md)
-   [api layer](layer-2-api.md)
-   [common layer](layer-3-common.md)
-   third-party libs layer

repository: rodmax/react-playground

gha_language: TypeScript

repo_name: rodmax/react-playground


text:
# Introduction

In Rust, there are are many specific types of numbers but they generally fall under one of two categories: integers or floating-point numbers.

Initializing an integer:

```rust
let x = 5; // Rust defaults to an i32
```

Initializing a large positive integer:

```rust
let y: u64 = 7_000_000_000; // unsigned numbers can't be negative
```

Initializing floating-point numbers:

```rust
let x = 1.2; // defaults to f64

let y: f32 = 5.0; // initializing an f32
```

repository: wfxr/rust

branch_name: refs/heads/main

repo_name: wfxr/rust


text:
---
title: Personalization
---

### Aspects

Of course every doc site should have its unique design. There are three aspects of which you can customize the output of your application.

1. Contextual elements
2. Homepage
3. Markdown styles

#### Contextual elements

The purpose of these `elements` is to define the naming and appearance of the application. Most information needed can be extracted from the manifest.json and an asset folder.

As for now, name of the application, default language, color-scheme and favicons can be defined in a `manifest.json` file and any referenced items such as images or icons have to be provided thrugh an asset folder called `static` located at the root of `docs` folder.
For more information see [General Structure](get_started#General_Structure).

Take a look at this example

```md
{
	"background_color": "#ffffff",
	"theme_color": "#159794",
	"name": "CAOS Autogenerated Documentation site",
	"short_name": "CAOS Docs",
	"display": "minimal-ui",
	"start_url": "/",
	"icons": [
        {
          "src": "icons/android-chrome-256x256.png",
          "sizes": "512x512",
          "type": "image/png"
        },
        {
          "src": "icons/android-chrome-192x192.png",
          "sizes": "192x192",
          "type": "image/png"
        }
      ]
}
```

#### Homepage

The homepage can be set using a .svelte file, a superset of HTML which includes styles and scripts.
To implement language specific content, get the language code from params.

```js
 export async function preload(page, session) {
        const {params} = page;
        const {lang} = params;
        return {lang};
 }
```

then you can use handlebar like syntax.

```html
{#if lang == 'en'}
    <h2>This is the doc generator</h2>
{:else if lang == 'de'}
    <h2>Das ist unser doc generator</h2>
{:else if lang == 'it'}
    <h2>Questo è il nostro doc generator</h2>
{:else}
    <h2>This is the doc generator</h2>
{/if}
```

#### Markdown styles

Idea is to be able to provide a dedicated `.css` file for markdown highlighting.
These styles are a work in progress.

repository: caos/site

gha_language: Svelte

repo_name: caos/site


text:
# passwordvault
## Overview
Save account credentials in encrypted vault files.

This is a simple app to store account credentials in encryted files.  The user interface allows the user to browse the list of credentials viewing the location of the account, the user id for the account and a brief description.  The password for the account is not displayed in the account list.  For each account the password can be copied to the clipboard without actaully displaying the password.  There is also an option to display the password for the account.

The user interface makes it easy for a user to add, modify and delete entries in a vault file.  The list of entries can be sorted buy location, user id or description.  The app can manage multiple vault files.

## Encryption
The credential information (the user id and password) are encrypted in each vault file.  Each vault file has its own encryption key and password.  By default the information in the vault files uses AES-128 bit encryption.  If the Java VM used to run the application supports
unlimited strength encryption, AES-256 encryption may be used to encrypt the vault information.  Each vault file is protected by a password.

**Warning:** Remember the password for each vault file.  For security reasons, there is no way to recover or reset the vault password without the current password.  The vault password can be changed, but requires the current password.

## Prerequisites

Password Vault is a Java application and requires Java 8 or higher to run.

## Installation

Download the appropriate package for the latest release at

https://github.com/markbnc/passwordvault/releases/latest

1. On Windows Unzip the package zip file into a directory and on Linux or Mac untar the package compressed tar file.
1. Change to the directory and double click the passwordvault-2.0.1.jar file
1. The application will open up to the OpenVault Screen.
   1. The first time the application is open there will not be any vaults in the Vault list
      1. Create a new vault by selecting File > Create New Vault
      1. Enter the information in the Create New Vault dialog.  Remember the password.  If you forget the password, the contents of the vault will not be accessible.  You can specify a hint to help remember the password.  The hint shows in clear text so it should not be the actual password.
   1. After the first time, the created vault(s) will be shown in the Vault drop down list.  Select the desired vault and enter the password for that vault.

## Backing up Vaults

The Vault data and the keystore containing the vault encryption keys are stored in the Vault Directory.  The location of the Vault Direcory can be seen and modified using the Password Vault Options dialog.  The Options dialog can be displayed by selecting Edit > Options.  The Vault Directory path can be either an absolute or relative path.  If the path is relative it will be relative to the

%appdata%\PasswordVault   on Windows

and

~/.password_vault         on Linux and Mac

To back up your vault data, make a copy of all of the files in the Vault Directory.

repository: markbnc/passwordvault

repo_name: markbnc/passwordvault


text:
---
date: 2016-10-29
layout: post
title: "Weekly Programming Challenge #14"
categories:
- projects
author: Jamis
comments: true
summary: >
  Lindenmayer Systems
---

Fractals have been a long-standing interest of mine. I can remember playing with [Fractint](https://fractint.org/) for long hours at a time, zooming deeper and deeper into the [Mandelbrot set](https://en.wikipedia.org/wiki/Mandelbrot_set). Fractint was also what introduced me to [Lindenmayer systems](https://en.wikipedia.org/wiki/L-system) (or L-systems), a method of constructing fractals by recursively rewriting a statement according to some grammar, to form more and more complex statements.

This week, let's play with these L-systems a bit! But first, a recap of week #13...

## Week #13 Recap

For the [13th weekly programming challenge](http://weblog.jamisbuck.org/2016/10/22/weekly-programming-challenge-13.html), we dabbled with Poisson disc samples, constructing a sampling using Bridson's algorithm. I had a _lot_ of fun with this one!

Only one submission this week, but I know a few others worked on it, at least. Great work, **Lasse Ebert**, on his normal mode submission! He implemented Bridson's algorithm in Elixr, and generated the output using his image library from week #4. Check out his implementation here: [https://github.com/lasseebert/jamis_challenge/tree/master/013_bridson](https://github.com/lasseebert/jamis_challenge/tree/master/013_bridson).

I went...a bit overboard on mine this week. Making up for previous weeks, maybe? I implemented Bridson's algorithm, and then implemented the Bowyer-Watson algorithm](https://en.wikipedia.org/wiki/Bowyer%E2%80%93Watson_algorithm) to generate a [Delaunay triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation) from those points. Then, with that triangulation, I converted it to it's dual graph: a [Voronoi diagram](https://en.wikipedia.org/wiki/Voronoi_diagram). My favorite part was taking the Mona Lisa and creating a "stained glass" effect, by sampling it and converting the samples to Voronoi polygons, like so:

Like I said, a bit overboard. But it was fun!

## Weekly Challenge #14

So, L-systems! The basic idea behind L-systems it that you start with some statement, and then using some given set of rules, you repeatedly rewrite that statement by substituting phrases for symbols in the statement.

Here's an example.

Let's say we start with this statement: `FX`.

Let's say, further, that we have two rules: `X` gets replaced with `X+YF+`, and `Y` gets replaced with `-FX-Y`.

So, given `FX`, the first time we rewrite, the `X` gets replaced, and we're left with `FX+YF+`.

Easy enough.

The second time, we replace both the `X`, and the `Y`, resulting in `FX+YF++-FX-YF+`.

The third time, we replace all of the `X`'s and all of the `Y`'s, giving us `FX+YF++-FX-YF++-FX+YF+--FX-YF+`.

And so forth. That's it, really. That's an L-system.

So what's the big deal? Well, it gets interesting when you assign meaning to the different symbols. For instance, suppose we hook this up to some simple turtle graphics system. Let's let `F` mean "move forward 1 unit", let `+` mean "turn right 90 degrees", and let `-` mean "turn left 90 degrees". If we repeat the above substitution 17 times, and then draw the result, we wind up with this:

It's the [Dragon curve](https://en.wikipedia.org/wiki/Dragon_curve)!

For more examples, and a deeper explanation of how the grammars can work, check out [Wikipedia](https://en.wikipedia.org/wiki/L-system).

## Normal Mode

For normal mode (and one point), here's all you've got to do:

1. Given a starting statement and a set of rules, recursively perform the substitutions required by the rules. You must be able to specify how many times the substitutions will be performed.
2. Draw the resulting statement! The only commands you need to support are "F" (move forward), "+" (turn right), and "-" (turn left). You should be able to specify how much a "+" and "-" will turn the turtle.
3. Produce an image with the finished drawing.

That's it! You're going to have to tackle some math to make this work, and figuring out how large your canvas needs to be may be a bit of a puzzle, but it can be done! Try the dragon curve (above) as a test.

## Hard Mode

For hard mode, you should be ready to stretch yourself a bit. Each of these will add one point to your score.

1. Support push and pop operations. Let "[" mean "push" (saving the current state of the turtle, such as it's current heading and position), and let "]" mean "pop" (restoring the turtle's state from the previous "push" operation. Try a [fractal plant](https://en.wikipedia.org/wiki/L-system#Example_7:_Fractal_plant) pattern to test your implementation!
2. Add new operations that change the color of the turtle. Can you modify the dragon curve so that portions of it are drawn in a different color?
3. Produce a grammar where the symbols have _audible_ meaning, instead of visual! You decide what that means. Maybe some symbols change the duration of the tone, and others change the pitch. Fractal music!
4. Produce a grammar where the symbols produce changes in color over time. Make an animation, perhaps of a simple shape, that changes color according to the L-system grammar!

Feel free to shoot for "surprise me" mode, too! It doesn't have to be any harder than normal mode, but it ought to implement the challenge (either normal mode or hard mode) in some surprising, clever, or otherwise delightful way. See what you can come up with!

This challenge will run until Saturday, November 5th, at 12:00pm MDT (18:00 UTC).

* * *

The deadline for this challenge has passed, but feel free to try your hand at it anyway! Go ahead and submit a link to your solution in the comments, anytime. If you’re following along, the next week's challenge is "[Turtle Graphics](http://weblog.jamisbuck.org/2016/11/05/weekly-programming-challenge-15.html)". See you there!

repository: jamis/buckblog

gha_language: HTML

repo_name: jamis/buckblog


text:
# Blazor

**Build modern, interactive web-based UIs with C# and Razor.**

This folder contains the underlying *components* programming model that powers both server-side and client-side [Blazor](#blazor) applications.

Blazor is a component based web UI framework. Blazor apps can run client-side in browser on WebAssembly or server-side as part of an ASP.NET Core app. Blazor is a full single-page application (SPA) framework inspired by the latest JavaScript SPA frameworks, featuring support for offline/PWA applications, app size trimming, and browser-based debugging.

Blazor uses only the latest web standards. No plugins or transpilation needed. It runs in the browser on a real .NET runtime implemented in [WebAssembly](http://webassembly.org) that executes normal .NET assemblies.

[![Gitter](https://badges.gitter.im/aspnet/blazor.svg)](https://gitter.im/aspnet/blazor?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

You can learn more about Blazor at https://blazor.net.

## Getting Started

To get started with Blazor and build your first web app check out our [getting started guide](https://go.microsoft.com/fwlink/?linkid=870449).

repository: donma/aspnetcore

repo_name: donma/aspnetcore


text:
## Basic instructions
Reach the "goal" from the "start" by teaching the computer your language. Type a command, use ↓ and ↑ to select the right answer, then use ✓ to express your approval.
You can play a lot faster if you use the hotkeys listed on the right side panel.

In the beginning, the computer knows nothing about language, has no built-in vocabulary, and it does not matter what language you want to teach, as long as you are precise and consistent. However, we do assume that ``words" are separated by space, and it would be helpful if you use  meaningful spaces in whatever language.

### Hints and Strategies
- You can always skip ambiguous or difficult examples
- Being concise and always use the same words for the same action is better if you want to finish quickly (remember it knows nothing, and learn everything from what you say, and has no knowledge of synonyms).
- The emoji indicates how surprised the computer is
- If you have trouble making progress, consider being vague and use the wildcard *. i.e. "put * on the leftmost red", and approve the right action for that.
- You can teach with low penality by describing what the computer likes to do, instead of finding what you said

## Technical

## Acknowledgements
- The server uses [SEMPRE](https://github.com/percyliang/sempre).
- PureScript code to render the cubes and the dev setup is adapted from the [cube composer](https://github.com/sharkdp/cube-composer) by [David Peter](http://david-peter.de/), which in turn uses [Isomer](https://github.com/jdan/isomer). Everything is under the MIT license.
- Emojis are provided for free by [Emoji One](http://emojione.com/)

repository: StitchDeng/shrdlurn

repo_name: StitchDeng/shrdlurn


text:
# Számlahegy Laravel

Számlahegy Laravel is a simple package for Laravel whics is using the Számlahegy PHP API.

## Installation

1. Install the package using composer:

```
composer require komjit/szamlahegy
```
2. Register the service provider in the ```app.php``` config file:

```
KomjIT\Szamlahegy\SzamlahegyServiceProvider::class,
```

## Usage

### Important

You have to paste this 3 rows after Controller's namespace:

```
use KomjIT\Szamlahegy\SzamlahegyApi;
use KomjIT\Szamlahegy\Enums\Invoice;
use KomjIT\Szamlahegy\Enums\InvoiceRow;

```

In the function you have to define your API key:

```
$api_key = 'your-api-key';
```

Make an invoice:

```
$invoice = new Invoice();
$invoice->customer_name = 'XYZ Inc.';
$invoice->customer_detail = 'You can write here anything, for example: bank account number';
$invoice->customer_city = 'Budapest';
$invoice->customer_address = 'Main street 1-3.';
$invoice->customer_zip = '1115';
$invoice->customer_country = 'HU';
$invoice->customer_vatnr = '12345678-1-12';
$invoice->customer_contact_name = 'John Doe';
$invoice->customer_email =<EMAIL_ADDRESS>$invoice->payment_method = 'B';
$invoice->payment_date = '2019.02.15';
$invoice->perform_date = '2019.03.01';
$invoice->kind = 'T'; // change this row if you want to use it in live environment (N: normal, S: storno, D: proforma invoice, T: test)
$invoice->tag = 'example';
$invoice->paid_at = '2019.01.01'; // use this row, if the invoice is paid
$invoice->foreign_id = rand(0,9999999); // it must be unique
$invoice->signed = 'Y'; // Y - yes, N - no
$invoice->currency = 'HUF';
```

Add rows to the invoice (minimum 1 row):

```
$invoice_row_1 = new InvoiceRow();
$invoice_row_1->productnr = 'SKU0001';
$invoice_row_1->name = 'Test product 1';
$invoice_row_1->detail = 'Test 1 description';
$invoice_row_1->quantity = '2';
$invoice_row_1->quantity_type = 'pcs';
$invoice_row_1->price_brutto = '1200';
$invoice_row_1->tax = '27';
$invoice_row_1->brutto_priority = 'N';
$invoice_row_1->foreign_id = '1234';
```

Send the invoice:

```
$invoice_rows = array();
$invoice_rows[] = $invoice_row_1;

$invoice->invoice_rows_attributes = $invoice_rows;

$api = new SzamlahegyApi();
$api->openHTTPConnection();
$response = $api->sendNewInvoice($invoice, $api_key);
$api->closeHTTPConnection();
```

Check the status:

```
if($response['error'] == false){
  echo "Success.";
}else{
  echo "There are some errors:";
  var_dump($response);
}
```

## License
Számlahegy Barion is open source software licensed under the MIT License.

repository: komjit/szamlahegy

repo_name: komjit/szamlahegy


text:
# AWS Developer Associate: ACM

## freeCodeCamp ExamPro walkthrough

- [Video 1](https://youtu.be/RrKRN9zRBWs) 3.25.15
- SSL/TLS certificates
- Public certs are free
- **Private certs (certs you import) cost \$400/month**
- Encryption termination options:
  - At load balancer: can be attached to ELB, CloudFront, or API Gateway. Traffic between ELB/ALB and EC2 instances downstream is unencrypted.
  - Can also terminate SSL end-to-end. Traffic is encrypted all the way to the application. Can't do directly with ACM, has to be done with Letsencrypt directly on each EC2 instance.


text:
# Bypass Application Whitelisting with Odbcconf.exe
## Description
ODBCCONF.exe is a command-line tool that allows you to configure ODBC drivers and data source names. It also has two interesting switches "/A and /F". /A allows you to load an arbitrary dll, no injection required this way while /F uses a response file such as "file.rsp" which could also load an arbitrary dll. /F accepts other file extensions. Adversaries may take advantage of this functionality to bypass process whitelisting.

## Hypothesis
Adversaries might be using odbcconf.exe to load/register dlls and bypass application/process whitelisting controls in my environment
## Events.

| Source | EventID | Field | Details | Reference |
|--------|---------|-------|---------|-----------|
| Sysmon | 1 | Image OR ParentImage | odbcconf.exe | SubTee |
| Sysmon | 1 | CommandLine OR ParentCommandLine | ("/A" AND "REGSVR" AND *.dll) OR "/F"| SubTee |

## Hunter Notes
* Subtee talked about adding confusion to command line auditing since this binary can simply register a dll and mimic, for example, powershell functionality and execute commands under a different process name or context. However, the initial registration of the arbitrary binary is what we would focus with this basic combination of events.
* You could simply search for the use of this binary in your environment
* You could also group those two events to find outliers if odbcconf.exe is normal in your environment

## Hunting Techniques Recommended

- [x] Grouping
- [x] Searching
- [ ] Clustering
- [ ] Stack Counting
- [ ] Scatter Plots
- [ ] Box Plots
- [ ] Isolation Forests


text:
# Supported tags and respective `Dockerfile` links

- [`3.2.0`, `3.2.0-neko`, `latest`](https://github.com/cromo/dockerfiles/blob/master/haxe/3.2.0/neko/Dockerfile)
- [`3.2.0-cpp`](https://github.com/cromo/dockerfiles/blob/master/haxe/3.2.0/cpp/Dockerfile)
- [`3.2.0-cs`](https://github.com/cromo/dockerfiles/blob/master/haxe/3.2.0/cs/Dockerfile)
- [`3.2.0-java`](https://github.com/cromo/dockerfiles/blob/master/haxe/3.2.0/java/Dockerfile)
- [`3.2.0-php`](https://github.com/cromo/dockerfiles/blob/master/haxe/3.2.0/php/Dockerfile)
- [`3.2.0-python`](https://github.com/cromo/dockerfiles/blob/master/haxe/3.2.0/python/Dockerfile)

For more information about this image and its history, please see the [relevant git repository subdirectory (`haxe`)](https://github.com/cromo/dockerfiles/tree/master/haxe) in the [`cromo/dockerfiles` GitHub repo](https://github.com/cromo/dockerfiles).

# What is Haxe?

Haxe is an open source toolkit based on a modern, high level, strictly typed programming language, a cross-compiler, a complete cross-platform standard library and ways to access each platform's native capabilities.

> [wikipedia.org/wiki/Haxe](https://en.wikipedia.org/wiki/Haxe)

![logo](https://raw.githubusercontent.com/cromo/dockerfiles/master/haxe/logo.png)

# How to use this image

## Start a Haxe instance running your app

The most straightforward way to use this image is to use a haxe comtainer as both the build and runtime environment. In your `Dockerfile`, writing something along the lines of the following will compile and run your project:

    FROM cromo/haxe:3.2.0-neko
    COPY . /source
    WORKDIR /source
    RUN haxe -main Main -neko Main.n
    CMD ["neko", "Main.n"]

Then build and run the Docker image:

    docker build -t my-haxe-app .
    docker run -it --rm --name my-running-app my-haxe-app

## Compile your app inside the Docker container

There may be occasions where it is not appropriate to run your app inside a container. To compile, but not run your app inside the Docker instance, you can write something like:

    docker run --rm -v "$(pwd)":/source -w /source cromo/haxe:3.2.0-neko haxe -main Main -neko Main.n

This will add the current directory as a volume, set the working directory to the volume, and run the command `haxe -main Main -neko Main.n`. This tells haxe to compile the code in `Main.hx` and output a Neko bytecode file to `Main.n`. Alternatively, if you have a `build.hxml`, you can instead run `haxe` with the hxml file inside your container:

    docker run --rm -v "$(pwd)":/source -w /source cromo/haxe:3.2.0-neko haxe build.hxml

# License

View [license information](http://haxe.org/foundation/open-source.html) for the software contained in this image. The `Dockerfile`s themselves are under the [MIT license](https://github.com/cromo/dockerfiles/blob/master/LICENSE).

# Supported Docker versions

This image has been tested on Docker version 1.7.0.

Support for older versions (down to 1.0) is provided on a best-effort basis.

# User Feedback

## Documentation

Documentation for this image is stored in the [`haxe/3.2.0/neko` directory](https://github.com/cromo/dockerfiles/tree/master/haxe/3.2.0/neko) of the [`cromo/dockerfiles` GitHub repo](https://github.com/cromo/dockerfiles).

## Issues

If you have any problems with or questions about this image, please contact me through a [GitHub issue](https://github.com/cromo/dockerfiles/issues).

## Contributing

You are invited to contribute new features, fixes, or updates, large or small; I will do my best to process them as fast as I can.

Before you start to code, I recommend discussing your plans through a [GitHub issue](https://github.com/cromo/dockerfiles/issues), especiall for more ambitious contributions. this gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.

repository: luis-guilherme/dockerfiles

repo_name: luis-guilherme/dockerfiles


text:
vim-jaggery
===========

Syntax coloring for jaggery in vim. This will enable basic syntax coloring for `.jag` files.

Install
=======

## Basic Install

1. Clone this repository
2. Copy `ftdetect` and `ftplugin` into ~/.vim
3. Addd follwing to ~/.vimrc

    `filetype plugin on`

## Install via pathogen

1. Clone this repository in to bundle directory

    `cd ~/.vim/bundle && git clone https://github.com/manuranga/vim-jaggery.git`

2. Make sure that the `filetype` is turned off immediately after pathogen infect and then re-enabled. (This is a workaround for a bug)

```
    execute pathogen#infect()
    filetype off
    syntax on
    filetype plugin indent on
```

## Screenshot

![vim-jaggery screenshot](http://i.imgur.com/rxlnalX.png)

repository: manuranga/vim-jaggery

repo_name: manuranga/vim-jaggery


text:
# The Latest: Tucson voters reject sanctuary city measure

Published at: **2019-11-06T05:48:35+00:00**

Author: **EndPlay**

Original: [WFXT](https://www.boston25news.com/news/the-latest-tucson-sanctuary-initiative-headed-for-defeat/1005531351?utm_source=homestream&utm_medium=site_navigation&utm_campaign=homestream_click)

TUCSON, Ariz. (AP) - The Latest on elections in Tucson, Arizona (all times local):
10:46 p.m.
Voters in Tucson have rejected an initiative making it Arizona's only sanctuary city.
The decision on Tuesday in one of Arizona's most liberal cities is a relief for the Democrats who control city government. They worried the initiative would jeopardize millions of dollars in state and federal funding and put public safety at risk.
The initiative was proposed by a group of activists motivated by the Trump administration's treatment of immigrants and Arizona's tough laws cracking down on people living in the country illegally. A law known as SB1070 drew international attention, boycotts and protests when it was passed in 2010.
The supporters had hoped to aggressively limit the impact of SB1070 and send a message that immigrants in Tucson are safe and protected.
9:55 p.m.
Tucson voters have elected their first Latina mayor.
Democrat Regina Romero was overwhelmingly elected Tuesday to lead Arizona's second-largest city.
She'll be the first woman to lead Tucson and the first Hispanic since 1875, nearly four decades before Arizona became a state.
Romero was raised by migrant farmworkers in southwestern Arizona. She was elected to the city council in 2007 and is the director of Latino engagement for an environmental group.
She defeated independent Ed Ackerley and Mike Cease of the Green Party in one of Arizona's most Democratic cities. Her victory was widely expected after she beat former state lawmaker Steve Farley in the Democratic primary.
___
8:15 p.m.
An initiative making Tucson Arizona's only sanctuary city appears headed for defeat.
Early ballots Tuesday showed voters were rejecting the initiative by more than a 2 to 1 margin.
A defeat would be a relief for the Democrats who control city government in one of Arizona's most liberal cities. They worry the initiative would jeopardize millions of dollars in state and federal funding and put public safety at risk.
The initiative was proposed by a group of activists motivated by the Trump administration's treatment of immigrants and Arizona's tough laws cracking down on people living in the country illegally.
___
12 a.m.
Tucson voters are deciding whether to make the liberal enclave Arizona's only sanctuary city.
The measure known as Proposition 205 is on the ballot Tuesday in Arizona's second most populous city.
Supporters say a victory would send the message to immigrants that they're valued and protected.
It comes amid fierce anger on the left at President Donald Trump's immigration policies. The measure aims to put new restrictions on when police can inquire about immigration status or cooperate with federal law enforcement.
The Democratic City Council strongly opposes the sanctuary initiative. Mayor Jonathan Rothschild says the city already has strong protections for immigrants. He worries it would endanger state and federal funding.
Both sides say the measure is likely to end up in court if it's approved.

license: Unlicense

repository: dsadlollioygjmzvcxv/tdc-exported

repo_name: dsadlollioygjmzvcxv/tdc-exported


text:
## allgo
 Capstone Project (Inha University, 2017 fall semester)
 Self Driving Car - System Self Driving car using color detection.
 ### Key Points
 * Two approach
    - Color Detection
    - Neural Networks

 ##### Color Detection Approach
 Two bottom frames checked for their colors and decision is made accordingly

 ![Cat](pics/pic1.jpg)
 ```commandline
python rasp/autocar.py
```

 ##### Neural Networks Approach
 Only Model creation stage is completed. Computer initialise server to collect camera data from raspberry takes input from keyboard where to go, and sends this data to raspberry to control motor. Simultaneously saves  frame and command in data array for model training.

 - Start MotorServer(motor_controller.py) from rasp
 - Start CompServer(collect_training_data.py) from comp
 - Start Camera Stream(camera_client.py) from rasp

_Now train data in your computer to get model_

 + run mlp_training.py in folder comp

 .........in progresss........

 ........wait for updates......

##### Requirements
Comp
- Opencv
- Tensorflow(optional for data)
```commandline
pip install wiringpi
pip install raspicam
```

repository: IsmoilovMuhriddin/allgo

gha_language: Python

repo_name: IsmoilovMuhriddin/allgo


text:
# [![prasanthsasikumar header](https://raw.githubusercontent.com/prasanthsasikumar/prasanthsasikumar/main/Images/logoBanner.jpg)](https://prasanthsasikumar.com)

Hey there 👋,

I create blog posts and open source packages mainly about Augmented Reality and Human Computer Interaction.  I have a passion for learning and sharing my knowledge with others in a way that's as public as possible.  You can see a full list of what I am up to on [prasanthsasikumar.com](prasanthsasikumar.com).

  ---

### Boy Scout Rule

I love open source.  I am not a heavy maintainer of any large libraries, but I really like the boyscout rule.  I contribute to things as I come across issues that I think other people might struggle with.  This may be things that are overlooked by someone who is deep into the library.  I 💕 a good onboarding readme with good example.

 ---

### My Digital Garden 🌱

I write regular blog posts, most of which you will find on my personal website [prasanthsasikumar.com](prasanthsasikumar.com).

I write about things I am familiar with, things that trip up folks that I mentor, and things that I am learning.  Day to day I make things with **AR/VR** using **Unity** and **C#**.

---

repository: prasanthsasikumar/prasanthsasikumar

repo_name: prasanthsasikumar/prasanthsasikumar


text:
# Markdown Kit

It convert a markdown file to a HTML document.

It supports the [Hyper-Markdown syntax](https://www.npmjs.com/package/hyper-markdown).

CSS are included in the HTML inside *style* tag, so only images should be included along the HTML output.

Usage:

`markdown2html source.md > target.html`

repository: cronvel/markdown-kit

repo_name: cronvel/markdown-kit


text:
Down!!
======

A game written in [Ruby/SDL](http://ohai.github.io/rubysdl/).

How to run
==========

Windows (binary)
----------------

Execute down.exe (This file contains compiled binary of Ruby 1.8).

Mac (source)
------------

    $ brew install sdl sdl_ttf
    $ brew install sdl_mixer --with-libmikmod
    $ gem install rubysdl rsdl
    $ rsdl down.rb

Linux (source)
--------------

* Install SDL 1.3.x, SDL_TTF, SDL_Mixer(with mod support)
* `gem install rubysdl`
* `ruby down.rb`

License
=======

MIT

History
=======

* 2013 Upload to github
* 2003-2004 Remake with Ruby/SDL
* 1997 First version was written in C for NEC 9801Fs

Contact
=======

https://github.com/yhara/down

Yutaka HARA (yhara)

twitter: @yhara_en

repository: marmistrz/down

repo_name: marmistrz/down


text:
Redis on Windows prototype
===
## What's new in this release

- Based on Redis 2.4.11
- Removed dependency on the pthreads library
- Improved the snapshotting (save on disk) algorithm. Implemented Copy-On-Write at the application level so snapshotting behavior is similar to the Linux version.
- added a Windows service to start and monitor one of more Redis instances

===
Special thanks to Dušan Majkic (https://github.com/dmajkic, https://github.com/dmajkic/redis/) for his project on GitHub that gave us the opportunity to quickly learn some on the intricacies of Redis code. His project also helped us to build our prototype quickly.

## Repo branches
- 2.4: save in foreground
- bksave: background save where we write the data to buffers first, then save to disk on a background thread. It is much faster than saving directly to disk, but it uses more memory.
- bksavecow: Copy On Write at the application level, now the default branch.

## How to build Redis using Visual Studio

You can use the free Express Edition available at http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express.

Now *bksavecow* is the default branch.

- Open the solution file msvs\redisserver.sln in Visual Studio 10, and build.

    This should create the following executables in the msvs\$(Configuration) folder:

    - redis-server.exe
    - redis-benchmark.exe
    - redis-cli.exe
    - redis-check-dump.exe
    - redis-check-aof.exe

For your convinience all binaries and the MSI for the Redis-Watcher service will be available in the msvs/bin/release|debug directories.

### RedisWatcher
With this release we added a Windows Service that can be used to start and monitor one or more Redis instances, the service
monitors the processes and restart them if they stop.

You can find the project to build the service under the msvs\RedisWatcher directory. In the readme on the same location
you will find the instructions on how to build and use the service.

### Release Notes

This is a pre-release version of the software and is not yet fully tested. This is intended to be a 32bit release only.
No work has been done in order to produce a 64bit version of Redis on Windows.
To run the test suite requires some manual work:

- The tests assume that the binaries are in the src folder, so you need to copy the binaries from the msvs folder to src.
- The tests make use of TCL. This must be installed separately.
- To run the tests you need to have a Unix shell on your machine. To execute the tests, run the following command: `tclsh8.5.exe tests/test_helper.tcl`.

If a Unix shell is not installed you may see the following error message: "couldn't execute "cat": no such file or directory".

### Plan for the next release

- Improve test coverage
- Fix some performance issues on the Copy On Write code
- Add 64bit support

gha_language: C#


text:
### /packages/client/stories

This folder contains stories which are sections of the visual documentation.

### Storybook

[Storybook](https://storybook.js.org/docs/guides/guide-react/) is a user interface development environment and playground for UI components. The tool enables developers to create components independently and showcase components interactively in an isolated development environment. It also serves as a visual documentation of the project.

The Storybook documentation can be found [here](https://storybook.js.org/docs/guides/guide-react/).

### Available Blueprint templates in this folder

- `story`: creates a new story source file (has to be created in the correct subfolder), template variables:
  - `[value]`: name of the story
  - `$category`: category of the story (`components`/`layouts`/`ui`)

repository: galacticcouncil/polkalert

branch_name: refs/heads/dev

repo_name: galacticcouncil/polkalert


text:
SingleTenantBase
=========
A base Grails 2.4.5 project for bootstrapping new projects.

## Additions to base project

### Plugins
- **CodeNarc** - Generates static code analysis for Groovy code that can be viewed as html report or within jenkins violation   plugin
- **Export** - Adds export functionality to domain objects in many different formats e.g. CSV, Excel, Open Document Spreadsheet, PDF and XML
- **Searchable** - Makes domain objects searchable and can be extended to add additional formats
- **Executor** - Allows processes to be run in the background
- **Markdown** - Markdown renderer
- **Spring Security** - Adds basic authentication to the project
- **Spring Security UI** - Adds additional CRUD interfaces to Spring Security

### Dependencies
- **AWS Java SDK** - AWS SDK for Java
- **MySQL Java Connector** - JDBC connector for MySQL

### Domain Objects
- **Spring Security** - Admin and user accounts and roles

### Controllers
- **Home** - Basic home controller and functions

### Views
- **Index** - Modified index page with basic home controller function links

### Bootstrap
- **Users** - Creates a basic and admin user

### JavaScript
- **jQuery** - jQuery 2.1.0
- **BlockUI** - Modal block for AJAX calls
- **D3** - SVG visualization platform
- **D3-tip** - Tooltips for D3
- **Sweet-Alert** - Alert modal replacement
- **Semantic-UI** - Action based frontend framework

### Logging

Log4j has been setup for the project to listen to all **com.sra** logging output.

- **ERROR** and above gets output to the console
- **INFO** and above gets logged to **logs/info.log**
- **WARN** and above gets logged to **logs/warn.log**
- All page requests are recorded in **logs/activity.log** with the date, username, controller, and action

### Other
- **Semantic UI** - Styling framework
- **MySQL DB Config** - Commented out DataSource config for MySQL connections

## TODO
Things to do when first branching the base repository.

- Refactor home controller and services to new package name.
- Change base users' passwords.
- Search all files for SingleTenantBase and change to new app name.
- Add any number of codeNarc properties into grails-app/conf/BuildConfig.groovy. For example, you can configure one or more reports using codenarc.reports property as follows

```
codenarc.reports = {
    // generate xml report
	MyXmlReport('xml') {
		outputFile = 'target/CodeNarcReport.xml'  // Set the 'outputFile' property of the (XML) Report
		title = 'SingleTenantBase XML Report'             // Set the 'title' property of the (XML) Report
	}
	// generate html report
		MyHtmlReport('html') {
		outputFile = 'target/CodeNarcReport.html'
		title = 'SingleTenantBase html Report'
	}
}
```

### Searchable

The **Searchable** plugin is a powerful way to perform free text search on domain objects. Below are instructions to configure STB for search:

- Add `static searchable  = { mapping { spellCheck "include" } }` to searchable domain objects.
- Overwrite the default `toString()` method on searchable domain objects, this will be the title of the element when returned by a search query
	- **Make sure that any fields and objects used in the `toString()` method are also searchable otherwise they will not be included in the Searchable index**
- Add a `Collection<String> highlight()` method to the searchable domain objects which returnes a collection of all fields you want highlighted if they contain the search term (e.g. name, description)

## Disconnecting and Pushing a New Project to GitHub
This section describes the steps to disconnect a modified SingleTenantBase project from source control and pushing it as a new project to GitHub.

- Pull down SingleTenantBase from GitHub.
- Modify it according to the **TODO** section above.
- Create a new repository on GitHub with the new project name
- Right click on the project in 'Project Explorer' -> Team -> Show in Repository View
- Right click on the project in 'Git Repository' -> Delete Repository -> Only select 'Delete Git Data and History'
- Right click on the project in 'Project Explorer' -> Team -> Disconnect
- Right click on the project in 'Project Explorer' -> Delete -> Leave 'Delete project contents...' **unchecked** -> OK
- Find the project in your file system -> Rename the folder to the new project name
- File -> Import -> Grails -> Grails Project -> Find the newly renamed folder -> Finish
- Right click on the project in 'Project Explorer' -> Team -> Share Project -> Git -> Make sure the checkbox at the top is checked -> Click on the project -> Create Repository -> Finish
- Right click on the project in 'Project Explorer' -> Team -> Commit -> Write a commit message and select all files -> Commit
- Right click on the project in 'Git Repository' -> Push Branch -> Enter the new repository information -> Next -> Next -> Finish

## License

**SingleTenantBase** has been released under the MIT license by [SRA International, INC](https://www.sra.com/). It was originally developed specifically for the [SRA Rapid Application Development Team](https://github.com/SRARAD).

repository: SRARAD/SingleTenantBase

gha_language: Groovy

repo_name: SRARAD/SingleTenantBase


text:
# Improve Worst Case CI Times

In this guide we'll show three CI setups and discuss the pros and cons of each. Nx is designed to be dropped in to any setup and immediately show some benefits. There are some setups, however, that are more able to take advantage of the performance boosts that Nx provides.

The CI setups we'll discuss are:

1. Single CI Job
2. Binning
3. Distributed Task Execution

## Approach 1: Single CI Job

Most organizations start their CI as a single job that is responsible for running any tasks that are required. The script for this CI setup using Nx would look something like this:

```yaml
- nx affected -t lint
- nx affected -t test
- nx affected -t build
```

This script will run all lint, test and build targets for projects that are affected by the current PR.

### 🎉 Pro: Simple Setup

This approach is the simplest to setup of the three types. The execution flow is the exact same as if a developer were manually checking everything on their own machine.

### 🎉 Pro: Simple Debugging

Since all the tasks are executed on the same job, all the error logs and build artifacts are located in one place. This makes it easy to find and diagnose errors.

### ⛔ Con: Slow

This approach works fine for smaller repos, but as the repo grows and the tasks take longer to execute, CI takes longer and longer to run. Nx's affected and computation caching help improve the average CI time, but the worst case CI time will still grow significantly for each project that is added to the repo.

## Approach 2: Binning

To improve the performance of the worst case CI time, you have to implement some sort of parallelization strategy. Binning is a parallelization strategy where there is a planning job that divides the work into bins, one for each agent job. Then every agent executes the work prepared for it. Here is a simplified version of the binning strategy.

```yaml {% fileName="planning-job.yml" %}
# Get the list of affected projects
- nx print-affected > affected-projects.json
# Store the list of affected projects in a PROJECTS environment variable
# that is accessible to the agent jobs
- node storeAffectedProjects.js
```

```yaml {% fileName="lint-agent.yml" %}
# Run lint for all projects defined in PROJECTS
- nx run-many --projects=$PROJECTS -t lint
```

```yaml {% fileName="test-agent.yml" %}
# Run test for all projects defined in PROJECTS
- nx run-many --projects=$PROJECTS -t test
```

```yaml {% fileName="build-agent.yml" %}
# Run build for all projects defined in PROJECTS
- nx run-many --projects=$PROJECTS -t build
```

Here's a visualization of how this approach works:
![CI using binning](/shared/images/dte/binning.svg)

### 🎉 Pro: Faster

Because there are now three different jobs running the tasks, the worst case CI time is now only as long as the longest group of tasks. (For this scenario, the build tasks usually take the longest.)

### ⛔ Con: Complex Debugging

With tasks being run on multiple machines, it can be difficult to find where a particular task was run. Tracking down a specific error message or build artifact becomes more and more difficult the more agents are used and the more complex the planning script becomes.

### ⛔ Con: Difficult to Share Build Artifacts

If one task needs the outputs file of another task, they either need to be run on the same agent job, or you need to create some mechanism to copy the build artifacts from one job to another. Also, the planning script needs to account for all of these task dependencies as it assigns tasks to each agent.

### ⛔ Con: Complex Setup

This approach requires you to create extra jobs and maintain the script that assigns tasks to each agent job. You could certainly be smarter about assigning tasks to jobs so that you are more optimally dividing work across agent jobs, but that requires making the planning job more complex.

Even if you make the perfect script that correctly divides up the tasks into evenly-sized bins, the repo will continue to change. Tasks that used to take very little time could start to take more time, and someone will need to revisit the script and keep adjusting it to account for the latest timing values for each task.

## Approach 3: Distributed Task Execution with Nx Cloud

Nx Cloud's Distributed Task Execution removes the burden of the complex setup of binning so that you can fully optimize your worst case CI times while maintaining the ease of setup and debug-ability of the single job approach.

The setup looks like this:

```yaml {% fileName="main-job.yml" %}
# Coordinate the agents to run the tasks
- npx nx-cloud start-ci-run
# Run any commands you want here
- nx affected -t lint test build
# Stop any run away agents
- npx nx-cloud stop-all-agents
```

```yaml {% fileName="agent.yml" %}
# Wait for tasks to execute
- npx nx-cloud start-agent
```

The visualization for distributed task execution looks like this:
![CI using DTE](/shared/images/dte/3agents.svg)

### 🎉 Pro: Fastest

This approach fully optimizes the binning strategy so that tasks are optimally distributed to however many agents are available.

### 🎉 Pro: Easy to Scale

If CI is taking too long, simply increase the number of agent jobs being started in your CI system and Nx will recognize the new agent jobs are available and distribute tasks accordingly. With this approach, your worst case CI time is only limited by your longest running individual task.

### 🎉 Pro: Build Artifacts

Nx uses the dependency graph to ensure that tasks are executed in the correct order. Nx Cloud then uses the distributed computation cache to make sure that build artifacts from prior tasks are always present for the current task, no matter which agent the tasks were run on. When developing your tasks, you can think of your CI as a single job, even though it is being distributed across an arbitrary number of agents.

### 🎉 Pro: Simple Debugging

Because Nx uses distributed computation caching to replay all the tasks back on the main job, every log and build artifact is present on that single job. No matter how many agents are used to speed up the CI time, all the debugging information can be found in a single place.

 You can generate a simple workflow for common CI providers with a single command and then customize from there.

Nx Cloud is [free for up to 300 CI Pipeline Executions](https://nx.app/pricing/) per month. Most organizations do not exceed the free tier. If you're working on an open source repo, we'll give you a coupon for unlimited free use of Nx Cloud.

Organizations that want extra help setting up Nx Cloud or getting the most out of Nx can [sign up for Nx Enterprise](https://nx.app/enterprise/). This package comes with extra support from the Nx team and the option to host Nx Cloud on your own servers.

repository: nrwl/nx

repo_name: nrwl/nx


text:
# Omnipay: Klarna Checkout
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
[![Scrutinizer Build](https://img.shields.io/scrutinizer/build/g/MyOnlineStore/omnipay-klarna-checkout.svg?style=flat-square)](https://github.com/MyOnlineStore/omnipay-klarna-checkout)
[![Scrutinizer Coverage](https://img.shields.io/scrutinizer/coverage/g/MyOnlineStore/omnipay-klarna-checkout.svg?style=flat-square)](https://github.com/MyOnlineStore/omnipay-klarna-checkout)
[![Scrutinizer](https://img.shields.io/scrutinizer/g/MyOnlineStore/omnipay-klarna-checkout.svg?style=flat-square)](https://github.com/MyOnlineStore/omnipay-klarna-checkout)

## Introduction

[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment
processing library for PHP 5.6+. This package implements Klarna Checkout support for Omnipay.

## Installation

To install, simply add it to your `composer.json` file:
```shell
$ composer require myonlinestore/omnipay-klarna-checkout
```

## Initialization

First, create the Omnipay gateway:
```php
$gateway = Omnipay\Omnipay::create('\MyOnlineStore\Omnipay\KlarnaCheckout\Gateway');
// or
$gateway = new MyOnlineStore\Omnipay\KlarnaCheckout\Gateway(/* $httpClient, $httpRequest */);
```
Then, initialize it with the correct credentials:
```php
$gateway->initialize([
    'username' => $username,
    'secret' => $secret,
    'api_region' => $region, // Optional, may be Gateway::API_VERSION_EUROPE (default) or Gateway::API_VERSION_NORTH_AMERICA
    'testMode' => false // Optional, default: true
]);
// or
$gateway->setUsername($username);
$gateway->setSecret($secret);
$gateway->setApiRegion($region);
```

## Usage

For general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay)
repository.

### General flow

1. [Create a Klarna order](#authorize)
2. [Update transaction](#update-transaction) (if required)
3. [Render the Iframe](#render-iframe)
4. Respond to redirects to `checkoutUrl` or `confirmation_url`
5. Respond to [checkout callbacks](https://developers.klarna.com/api/#checkout-api-callbacks-callbacks)
6. Respond to the request to `push_url` (indicates order was completed by client)
   with a [ackowledgement](#acknowledge)
7. [Extend authorization](#extend-authorization) (if required)
8. [Update the merchant address](#update-merchant-address) (if required)
9. Perform one or more [capture(s)](#capture), [refund(s)](#refund) or [void](#void) operations

### Authorize

To create a new order, use the `authorize` method:
```php
$data = [
    'amount' => 100,
    'tax_amount' => 20,
    'currency' => 'SEK',
    'locale' => 'SE',
    'purchase_country' => 'SE',

    'notify_url' => '', // https://developers.klarna.com/api/#checkout-api__ordermerchant_urls__validation
    'return_url' => '', // https://developers.klarna.com/api/#checkout-api__ordermerchant_urls__checkout
    'terms_url' => '', // https://developers.klarna.com/api/#checkout-api__ordermerchant_urls__terms
    'validation_url' => '', // https://developers.klarna.com/api/#checkout-api__ordermerchant_urls__validation

    'items' => [
        [
            'type' => 'physical',
            'name' => 'Shirt',
            'quantity' => 1,
            'tax_rate' => 25,
            'price' => 100,
            'unit_price' => 100,
            'total_tax_amount' => 20,
        ],
    ],
];

$response = $gateway->authorize($data)->send()->getData();
```
This will return the order details as well as the checkout HTML snippet to render on your site.

[API documentation](https://github.com/MyOnlineStore/omnipay-klarna-checkout/blob/master/src/Message/AuthorizeRequest.php)

## Render Iframe

Klarna Checkout requires an iframe to be rendered when authorizing payments:

```php
$response = $gateway->fetchTransaction(['transactionReference' => 'a5bec272-d68d-4df9-9fdd-8e35e51f92ab'])
    ->send();

echo $response->getData()['checkout']['html_snippet'];
```

After submitting the form within the iframe,
Klarna will redirect the client to the provided `confirmation_url` (success)
or `checkout_url` (failure)`.

### Update transaction

While an order has not been authorized (completed) by the client, it may be updated:

```php
$response = $gateway->updateTransaction([
    'transactionReference' => 'a5bec272-d68d-4df9-9fdd-8e35e51f92ab',
    'amount'           => 200,
    'tax_amount'       => 40,
    'currency'         => 'SEK',
    'locale'           => 'SE',
    'purchase_country' => 'SE',
    'items' => [/*...*/],
])->send();
```

The response will contain the updated order data.

[API documentation](https://developers.klarna.com/api/#checkout-api-update-an-order)

### Extend authorization

Klarna order authorization is valid until a specific date, and may be extended (up to a maximum of 180 days).
The updated expiration date may then be retrieved with a [fetch](#fetch) request

```php
if ($gateway->extendAuthorization(['transactionReference' => 'a5bec272-d68d-4df9-9fdd-8e35e51f92ab'])->send()->isSuccessful()) {
    $expiration = new \DateTimeImmutable(
        $gateway->fetchTransaction(['transactionReference' => 'a5bec272-d68d-4df9-9fdd-8e35e51f92ab'])
            ->send()
            ->getData()['management']['expires_at']
    );
}
```

[API documentation](https://developers.klarna.com/api/#order-management-api-extend-authorization-time)

### Capture

```php
$success = $gateway->capture([
    'transactionReference' => 'a5bec272-d68d-4df9-9fdd-8e35e51f92ab',
    'amount' => '995',
])->send()
->isSuccessful();
```

[API documentation](https://developers.klarna.com/api/#order-management-api-create-capture)

### Fetch

A Klarna order is initially available through the checkout API. After it has been authorized, it will be available
through the Order management API (and will, after some time, no longer be available in the checkout API).
This fetch request will first check whether the order exitst in the checkout API.
If that is not the case, or the status indicates the order is finished,
it will also fetch the order from the order management API

```php
$response = $gateway->fetchTransaction(['transactionReference' => 'a5bec272-d68d-4df9-9fdd-8e35e51f92ab'])
    ->send();

$success = $response->isSuccessful();
$checkoutData = $response->getData()['checkout'] ?? [];
$managementData = $response->getData()['management'] ?? [];
```
API documentation |
[Checkout](https://developers.klarna.com/api/#checkout-api-retrieve-an-order) |
[Order management](https://developers.klarna.com/api/#order-management-api-get-order)

### Acknowlegde

Acknowledge a completed order

```php
$success = $gateway->acknowledge(['transactionReference' => 'a5bec272-d68d-4df9-9fdd-8e35e51f92ab'])
    ->send()
    ->isSuccessful();
```

[API documentation](https://developers.klarna.com/api/#order-management-api-acknowledge-order)

### Refund

```php
$success = $gateway->refund([
    'transactionReference' => 'a5bec272-d68d-4df9-9fdd-8e35e51f92ab',
    'amount' => '995',
])->send()
->isSuccessful();
```

[API documentation](https://developers.klarna.com/api/#order-management-api-create-a-refund)

### Void

You may release the remaining authorized amount. Specifying a specific amount is not possible.

```php
$success = $gateway->void(['transactionReference' => 'a5bec272-d68d-4df9-9fdd-8e35e51f92ab'])
    ->send()
    ->isSuccessful();
```

[API documentation](https://developers.klarna.com/api/#order-management-api-release-remaining-authorization)

### Update customer address

This may be used when updating customer address details *after* the order has been authorized.
Success op this operation is subject to a risk assessment by Klarna. Both addresses are required parameters.

```php
$success = $gateway->refund([
    'transactionReference' => 'a5bec272-d68d-4df9-9fdd-8e35e51f92ab',
    'shipping_address' => [
        'given_name'=> 'Klara',
        'family_name'=> 'Joyce',
        'title'=> 'Mrs',
        'street_address'=> 'Apartment 10',
        'street_address2'=> '1 Safeway',
        'postal_code'=> '12345',
        'city'=> 'Knoxville',
        'region'=> 'TN',
        'country'=> 'us',
        'email'=><EMAIL_ADDRESS>        'phone'=> '1-555-555-5555'
    ],
    'billing_address' => [
        'given_name'=> 'Klara',
        'family_name'=> 'Joyce',
        'title'=> 'Mrs',
        'street_address'=> 'Apartment 10',
        'street_address2'=> '1 Safeway',
        'postal_code'=> '12345',
        'city'=> 'Knoxville',
        'region'=> 'TN',
        'country'=> 'us',
        'email'=><EMAIL_ADDRESS>        'phone'=> '1-555-555-5555'
    ],
])->send()
->isSuccessful();
```

[API documentation](https://developers.klarna.com/api/#order-management-api-update-customer-addresses)

### Update merchant reference(s)

If an order has been authorized by the client, its merchant references may be updated:

```php
$response = $gateway->updateMerchantReferences([
    'merchant_reference1' => 'foo',
    'merchant_reference2' => 'bar',
])->send();
```

[API documentation](https://developers.klarna.com/api/#order-management-api-update-merchant-references)

## Units

Klarna expresses amounts in minor units as described [here](https://developers.klarna.com/api/#data-types).

repository: MyOnlineStore/omnipay-klarna-checkout

gha_language: PHP

repo_name: MyOnlineStore/omnipay-klarna-checkout


text:
##### Images in Docker #####
----------------------------

- Docker is a combination of files and directories which are seperated as branches. Every single image which is saved as a repository[with a identifiable name/tag] consists series of integrated layers which is **U**nion **F**ile **S**ystem, a version of an image has more than one tag.
- Every image starts as a scratch and all the changes made to it are captured and loaded in as layers.
- Same image can be used by multiple containers, a read/write layer specific to each container will be created for every transaction [copy,add,command,env] and saved till the end of the container.
- If a core file in the base image is changed, a new temporary layer based on the instanced container will be created this process is known as  'copy on write'.[FS will store the modified base image file into a 'diff' location. A change was made to the running process file system].
- All the newly created layers will have a unique hash and doesnot overlap with other container images, now the

        example: for an ngnix
        1.19.1, mainline, 1, 1.19, latest
        or
        1.19.1-alpine, mainline-alpine, 1-alpine, 1.19-alpine, alpine

- : To pull docker images, adding an -a or --all will pull all the tags in the 'repository'

        docker pull <username>:<repository>:<tag>

- : To see all the info about image layers

syntax:
        docker images --digests <image-name>

        docker history --human=true nginx:stable-alpine
        IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT
        8c1bfa967ebf        11 days ago         /bin/sh -c #(nop)  CMD ["nginx" "-g" "daemon…   0B                 8c1bfa967ebf Image name
        <missing>           11 days ago         /bin/sh -c #(nop)  STOPSIGNAL SIGTERM           0B                    <missing> is layer
        <missing>           11 days ago         /bin/sh -c #(nop)  EXPOSE 80                    0B
        <missing>           11 days ago         /bin/sh -c #(nop)  ENTRYPOINT ["/docker-entr…   0B
        <missing>           11 days ago         /bin/sh -c #(nop) COPY file:0fd5fca330dcd6a7…   1.04kB
        <missing>           11 days ago         /bin/sh -c #(nop) COPY file:1d0a4127e78a26c1…   1.96kB
        <missing>           11 days ago         /bin/sh -c #(nop) COPY file:e7e183879c35719c…   1.2kB
        <missing>           11 days ago         /bin/sh -c set -x     && addgroup -g 101 -S …   15.9MB
        <missing>           11 days ago         /bin/sh -c #(nop)  ENV PKG_RELEASE=1            0B
        <missing>           11 days ago         /bin/sh -c #(nop)  ENV NJS_VERSION=0.4.2        0B
        <missing>           2 months ago        /bin/sh -c #(nop)  ENV NGINX_VERSION=1.18.0     0B
        <missing>           2 months ago        /bin/sh -c #(nop)  LABEL maintainer=NGINX Do…   0B
        <missing>           2 months ago        /bin/sh -c #(nop)  CMD ["/bin/sh"]              0B
        <missing>           2 months ago        /bin/sh -c #(nop) ADD file:b91adb67b670d3a6f…   5.61MB

- : To check howmany layers an image is made up of
Basic

        docker image history --human <image-name>

Detail
        docker image inspect <image-name>

- : As Docker doesn't allow naming, 'tags' are used, basically they are version's of a image. To explicitly set a tag to repository.[ The image-id will still be the same]

        docker image tag SourceRepositoryName/[:TAG] username/DestinationRepositoryName/[:TAG]

- : To upload the user created image process

        docker login
        docker image push <username/image-repository-name/tag-name>
        docker logout

 Note: Authorization Key will be saved at /$USER/.docker.config.json

 - : To 'build' an image

        docker image build -t <image-nametag> <path to the docker file>

repository: knagadevara/dockerTomTom

gha_language: JavaScript

repo_name: knagadevara/dockerTomTom


text:
---
title: Using Adaptive Renditions in AEM Screens
description: This page describes how to use Adaptive Renditions in AEM Screens.
exl-id: e7f68ed4-73c3-492a-b33a-dd915ef1f8be
---
# Using Adaptive Renditions in AEM Screens {#adaptive-renditions}

## Introduction {#introduction}

Adaptive Renditions allow the devices to automatically select the best rendition for a device based on customer-defined rules. The devices will automatically download and play the most appropriate rendition of an asset based on these rules allowing customers to only focus on designing the *main* experience.

## Objective {#objective}

As an AEM Screens Content Author, you can now configure device-specific asset renditions to be downloaded and played automatically without having to create all content variations manually.
Once a Developer adds the rendition mapping properties and rules, you are now ready to apply the rendition mapping to assets and subsequently include those in an AEM Screens channel.

>[!IMPORTANT]
>Before you start using Adaptive Renditions, in an AEM Screens channel, it is recommended to learn about this feature's Architectural Overview and Configuration. See [Adaptive Renditions: Architectural Overview and Configurations](/help/user-guide/adaptive-renditions.md) for more details.

## Using Adaptive Renditions in Channels {#using-adaptive-renditions}

>[!NOTE]
>Once you have added [rendition mapping property to the Screens Project](/help/user-guide/adaptive-renditions.md#rendition-mapping-new) and [rendition mapping rules](/help/user-guide/adaptive-renditions.md#add-rendition-mapping-rules), as a Content Author you are now ready to apply the renditions to your assets.

### Applying Renditions to Assets {#apply-renditions-assets}

Follow the steps below to apply renditions to the assets, that you want to use in tour Screens channel:

1. Navigate to the **Assets** folder in your AEM instance.

1. Create a version of the asset which better suits the signage display, for example, `seahorse.jpg`.

1. Choose the rendition naming pattern, for example,`landscape`, similar to  what was defined in **pattern** property in **CRXDE Lite**. Refer to [Adding Rendition Mapping Rules](/help/user-guide/adaptive-renditions.md#add-rendition-mapping-rules) for more details.

1. Click on **Add Rendition** to upload the rendition, as shown in the figure below.

   ![image](/help/user-guide/assets/adaptive-renditions/manage-pub-asset2.png)

1. Select the renamed the asset file. The rendition that you are adding must contain the pattern (defined in step 3), for example, `seahorse-landscape.png`.

1. Once you have added the asset, select the asset and click on **Manage Publication** from the action bar to publish the asset.

   ![image](/help/user-guide/assets/adaptive-renditions/manage-pub-asset1.png)

   >[!NOTE]
   >Refer to [On-Demand Content Update](https://experienceleague.adobe.com/docs/experience-manager-screens/user-guide/authoring/content-updates/on-demand-content.html?lang=en) to learn more about  managing Publication and delivering content updates from Author to Publish to device.

## Migration Strategy {#migration-strategy}

>[!IMPORTANT]
>For large networks, it is recommended that the migration is done gradually to mitigate the risks as the feature will introduce changes in the manifest and file storage format. Adding the `sling:configRef` to the entire project involves having all players updated to Feature Pack 6.5.9. In case, you updated some of the players, you need to add the `sling:configRef` only to those displays, locations, or channel folders that have all players updated to Feature Pack 6.5.9.

The following diagram depicts the migration strategy for large networks:

![image](/help/user-guide/assets/adaptive-renditions/migration-strategy1.png)

To enable the feature, add at least one mapping rule and make sure the rendition mapping configuration is resolvable in the context of displays and channels. Follow the steps below to migrate:

1. Add [Rendition Mapping Rules](/help/user-guide/adaptive-renditions.md).
1. Create a folder for new channels and add a reference pointing at the rendition mapping configuration.
1. Create new channels replacing the old ones and upload renditions.
1. Reassign displays to the new channels.
1. Add a reference to the migrated displays or locations pointing at the rendition mapping configuration.
1. Repeat steps 3, 4, and 5 for all remaining channels and displays.

   >[!NOTE]
   >After completing the migration, ensure to remove all configuration references from channels, displays, and locations and add a single one to the project content node.


text:
# Contributing To Elm Antd

**Rules of contributing:**

- If implementing any visual changes:
  - Add applicable visual tests to `./showcase/visual-tests` (visual tests are written in JavaScript)
- If implementing / changing behaviour:
  - Add applicable unit tests (unit tests are written in Elm)
- **If you're adding a brand new component**, make sure to add it to the list of `exposed-modules` within `elm.json`.

### Project Structure

- `src/Ant`: Contains the actual Elm Antd components that can be used by a user
- `tests`: Unit tests for components
- `showcase`: Contains the component showcase (https://elm-antd.netlify.app/)
  - `/tests`: Unit tests for component showcase
  - `/visual-tests`: Visual regression / UI tests for the components in `src/Ant`
    - The reason that these tests live here is because I am leveraging the existing showcase application when doing UI tests. The app gets booted into "visual testing mode" using `showcase/src/elm/VisualTests.elm`
- `file-server`: NodeJS web application that is used to fetch source code from either your file system (local development) or github (production)

### Running the development server

`npm run dev` will boot a "component showcase" on port 3000 that you can use to sanity check the visuals and behaviour of your components.

### Running Tests

#### Unit Testing

Unit tests ensure that things **behave** as expected, and prevent behavioural regressions.

Make sure you have `elm-test` globally installed.

To run tests, run `elm-test` to run tests for the components in `src/Ant`

#### Visual Testing

Visual tests ensure that things **look** as expected, and prevent visual regressions.

Visual tests work by running a server that returns a single component. At the moment, the server does not live-reload on file change.

The UI of this Elm application is a function of the URL.

```
http://localhost:3000?component=<ABC> --> UI
```

To run visual tests:

- `cd` into `showcase`
- run `visual-tests:start-server` in one process
  - This will boot a Elm application on port 3000, so make sure that you are not running the development server already.
- in another process / bash session, run `visual-tests:run-tests`

When you run the tests, you'll see that you don't have a `PERCY_TOKEN`. Don't worry about streaming the DOM to percy. This will be done during CI checks when you open a pull request.

What matters is that you "register" the component to be rendered onto the visual testing application.

If the application does not recognize a `component` value, it will render a default component.

#### Registering New Components To Be Rendered On The Visual Testing Application

If you implement a brand new component, or new visual functionality, you have to "register" a new component.

Check out `registeredComponents` at https://github.com/supermacro/elm-antd/blob/master/showcase/src/elm/VisualTests.elm

repository: joshuanianji/elm-antd

repo_name: joshuanianji/elm-antd


text:
[![Build Status](https://api.travis-ci.org/phiphou/was.svg)](https://travis-ci.org/phiphou/was)
[![GitHub version](https://badge.fury.io/gh/phiphou%2Fwas.svg)](https://badge.fury.io/gh/phiphou%2Fwas)
[![Dependency Status](https://david-dm.org/phiphou/was.svg)](https://david-dm.org/phiphou/was)
[![devDependency Status](https://david-dm.org/phiphou/was/dev-status.svg)](https://david-dm.org/phiphou/was#info=devDependencies)
[![bitHound Overall Score](https://www.bithound.io/github/phiphou/was/badges/score.svg)](https://www.bithound.io/github/phiphou/was)
[![MIT license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](http://opensource.org/licenses/MIT)
![Size](https://reposs.herokuapp.com/?path=phiphou/was)

# WAS

__WAS__ is an acronym for __Webpack Angular Sample__.The goal of this project is to offer a sample application using [Angular2](https://angular.io/) with a [Webpack](http://webpack.github.io/) building environment.

Instead of an empty seed or the classic Todo example, it shows a minimalist weather app that uses the [Openweather API](http://openweathermap.org/api).

## Quick Start

```bash
$ npm install -g webpack webpack-dev-server karma-cli protractor typings typescript tslint rimraf
$ git clone --depth 1 https://github.com/phiphou/was.git
$ cd was
$ npm install
$ npm run start
```
Open your browser at [http://localhost:8080](http://localhost:8080) and start developing in [`./src/app/`](https://github.com/phiphou/was/blob/master/src/app/app.ts)

## Table of contents
 * [Quick Start](#quick-start)
 * [Installing](#installing)
     * [Global dependencies](#global-dependencies)
         * [build dependencies](#build-dependencies)
         * [dev dependencies](#dev-dependencies)
     * [Install](#install)
 * [Usage](#usage)
     * [Development](#start-developing)
     * [Building](#building)
     * [Testing](#testing)
         * [Unit-Tests](#unit-tests)
         * [End-to-end](#end-to-end)
         * [Code coverage](#code-coverage)
 * [License](#license)

[comment]: # (## File Structure)
[comment]: # (```)
[comment]: # (angular2-webpack-starter/ )
[comment]: # ( ├──config/                    * our configuration)
[comment]: # ( |   ├──helpers.js             * helper functions for our configuration files)
[comment]: # ( |   ├──spec-bundle.js         * ignore this magic that sets up our angular 2 testing environment )
[comment]: # ( |   ├──karma.conf.js          * karma config for our unit tests )
[comment]: # ( |   ├──protractor.conf.js     * protractor config for our end-to-end tests )
[comment]: # ( │   ├──webpack.dev.js         * our development webpack config)
[comment]: # ( │   ├──webpack.prod.js        * our production webpack config)
[comment]: # ( │   └──webpack.test.js        * our testing webpack config)
[comment]: # ( │ )
[comment]: # ( ├──src/)                       * our source files that will be compiled to javascript)
[comment]: # ( |   ├──main.browser.ts)        * our entry file for our browser environment)
[comment]: # ( │   │)
[comment]: # ( |   ├──index.html             * Index.html: where we generate our index page)
[comment]: # ( │   │)
[comment]: # ( |   ├──polyfills.ts           * our polyfills file)
[comment]: # ( │   │)
[comment]: # ( |   ├──vendor.ts               * our vendor file)
[comment]: # ( │   │)
[comment]: # ( │   ├──app/                   * WebApp: folder)
[comment]: # ( │   │   ├──app.spec.ts        * a simple test of components in app.ts)
[comment]: # ( │   │   ├──app.e2e.ts         * a simple end-to-end test for /)
[comment]: # ( │   │   └──app.ts             * App.ts: a simple version of our App component components)
[comment]: # ( │   │)
[comment]: # ( │   └──assets/                * static assets are served here)
[comment]: # ( │       ├──icon/)              * our list of icons from www.favicon-generator.org)
[comment]: # ( │       ├──robots.txt         * for search engines to crawl your website)
[comment]: # ( │       └──human.txt          * for humans to know who the developers are)
[comment]: # ( │)
[comment]: # ( ├──tslint.json                * typescript lint config)
[comment]: # ( ├──tsconfig.json              * config that webpack uses for typescript)
[comment]: # ( ├──typings.json               * our typings manager)
[comment]: # ( └──package.json               * what npm uses to manage it's dependencies)
[comment]: # (```)

## Installing

First, make sure you've got [NodeJS](http://nodejs.org) installed. If not, go to [nodejs.org](http://nodejs.org) to download and install it. It will also install NPM.

If everything is ok, `node -v` should print your node version and `npm -v` should print NPM's one. Minimum requirements for this project are node >= `5.x.x` and NPM >= `3.x.x`.

### Global dependencies

Before installing the application, you may have to install some global dependencies.

#### Build dependencies

| Dependency                                    | Version | Install                              |
| :-------------------------------------------- | :------ | :----------------------------------- |
| [Typings](https://github.com/typings/typings) | 1.x.x   | `npm i typings -g`                   |
| [Webpack](http://webpack.github.io)           | 1.3.x   | `npm i webpack -g`                   |
| [Rimraf](https://github.com/isaacs/rimraf)    | 2.5.x   | `npm i rimraf -g`                    |

#### Dev dependencies

| Dependency                                         | Version | Install                       |
| :------------------------------------------------- | :------ | :---------------------------- |
| [Karma](https://github.com/karma-runner/karma-cli) | 1.x.x   | `npm i karma-cli -g`          |
| [Protractor](http://www.protractortest.org)        | 4.x.x   | `npm i protractor -g`         |
| [Tslint](https://palantir.github.io/tslint)        | 3.x.x   | `npm i tslint -g`             |
| [TypeScript](http://www.typescriptlang.org)        | 1.8.x   | `npm i typescript -g`         |
| [Webpack dev server](http://webpack.github.io)     | 1.3.x   | `npm i webpack-dev-server -g` |

You can also install all these dependencies in just one command :

`$ npm i -g webpack webpack-dev-server karma-cli protractor typings typescript tslint rimraf`

### Install

Clone or fork this repo and run `npm install` to install the application.

```bash
$ git clone https://github.com/phiphou/was.git
$ cd was
$ npm install
```
Dependencies will be installed in the `./node_modules` folder and typings will be in the `./typings` folder.

## Usage

#### Start developping

Dive into development right now by just running:
```bash
$ npm run start
```
This will pre-build the application, start webpack's dev server and open your browser at [http://localhost:8080](http://localhost:8080).

#### Building

You can build the app and get a "ready to deploy" release by just running:

```bash
$ npm run build
```
You can also get gzipped files for serving them with `content-encoding`with :

```bash
$ npm run build-gz
```
You'll find your build in the `./dist` directory.

#### Testing

This application use unit-tests and end-to-end tests.

##### Unit-Tests

You can run unit-tests by just typing :

```bash
$ npm run test
```
[Karma](https://karma-runner.github.io/0.13/index.html) is used as test-runner, you can configure it in the [`./config/karma.conf.js`](/config/karma.conf.js) file.

[comment]: # (Tests are written for Jasmine, see `./src/app/`)

##### End-to-end

You can run e2e-tests by just typing :

```bash
$ npm run e2e
```
[Protractor](http://www.protractortest.org) is used for end-to-end tests, you can configure it in the [`./config/protractor.conf.js`](/config/protractor.conf.js) file.

##### Code coverage

[Istanbul](https://github.com/gotwarlost/istanbul) is used as code coverage tool. You can configure it in the [`./config/karma.conf.js`](/config/karma.conf.js) file.

It produce reports you'll find in the `./coverage` folder each time you run unit-tests.

You can also use `npm run coverage`, it will run unit-tests and automatically open your browser to the generated reports.

#### HTML5 mode

Because this app use [Angular's HTML5 mode](https://angular.io/docs/js/latest/api/common/index/LocationStrategy-class.html), url rewriting is needed.

If you're deploying it on an Apache server, you can use the provided [`.htaccess`](/src/public/.htaccess) file.

If you use other hosting system, look at this file to see what url rewriting configuration is needed.

## License

[MIT](https://opensource.org/licenses/MIT)

repository: phiphou/was

repo_name: phiphou/was


text:
# Tutorial

## REPL in `MyFirstScript.fs`

- create file, add:
```fsharp
let toPigLatin (word: string) =
    let isVowel (c: char) =
        match c with
        | 'a' | 'e' | 'i' |'o' |'u'
        | 'A' | 'E' | 'I' | 'O' | 'U' -> true
        |_ -> false

    if isVowel word.[0] then
        word + "yay"
    else
        word.[1..] + string(word.[0]) + "ay"
```
- highlight the whole function with a mouse and hit `ALT+ENTER`, look for a terminal
  - FSI process is started
  - the highlighted code is sent to in FSI
  - the function is evaluated in FSI
- now the function is available in FSI interactive terminal, try
  - `toPigLatin "banana";;`
  - `toPigLatin "apple";;`
- _(i) `;;` means it's done and should be evaluated, just `;` allows multilines_

## Move to a module

- open `Program.fs`
- add the code from above as a module above the `main` function
```fsharp
module PigLatin =
    let toPigLatin (word: string) =
        let isVowel (c: char) =
            match c with
            | 'a' | 'e' | 'i' |'o' |'u'
            | 'A' | 'E' | 'I' | 'O' | 'U' -> true
            |_ -> false

        if isVowel word.[0] then
            word + "yay"
        else
            word.[1..] + string(word.[0]) + "ay"
```
- change the `main` function to use the module
```fsharp
[<EntryPoint>]
let main argv =
    for name in argv do
        let newName = PigLatin.toPigLatin name
        printfn "%s in Pig Latin is: %s" name newName
    0
```
- now it can be run as an executable (in the directory of the project)
  - `dotnet run apple banana`
```
apple in Pig Latin is: appleyay
banana in Pig Latin is: ananabay
```

repository: rlexa/fsharp-research

repo_name: rlexa/fsharp-research


text:
# BASIC : An automated tool for hassle-free Django project setup
'Basic' is a complete package for the advanced setup of the Django-Python framework. Setup of most of the features including and not limited to template tags, Django-admin custom commands, include and templating in Django are covered. Just install this package, run the setup script, and then use it to have your own preconfigured advanced Django project with just a few commands.

Also, add as many apps you want, with no additional configuration to be done. Everything like adding URLs, including that app to INCLUDED_APPS, setting up the basic index page, and many more, is done automatically. Please look at the examples below to get started.

A complete authentication system can be set up with just one command. Login, Logout & Register functionalities are already supported and can be extended to many more.

### NOTE:  It can be run on any Linux machine with Python>=3 and Django>=2.2.
## GET STARTED
##### Setup
```
git clone https://github.com/rudradesai200/Basic.git
cd Basic/
chmod +x setup.sh
chmod +x uninstall.sh
./setup.sh
source ~/.bashrc # OR other default shell
```

##### Uninstall
```
$BASIC_DIR/uninstall.sh
# Restart the terminal to remove the alias and env variables
```

##### USE
Go to your Desktop or other directory except the installation one.
```
basic project <projectname> # it will create a django project with name <projectname>
cd <projectname>
basic app <appname> # it will create an app with the name <appname>
                    # All the paths, fields and folders will be setup automatically
basic authenitcate  # it will create an app named "accounts" which can be used for authentication purposes
                    # it contains functinalities like login, logout, register
```

##### Examples
```
basic project newproject
```
![project_setup](https://user-images.githubusercontent.com/44108388/85259975-92851000-b487-11ea-8933-cec4c8b2919b.png)

```
cd newproject
basic app first
```
![app_setup](https://user-images.githubusercontent.com/44108388/85259979-944ed380-b487-11ea-94b8-e4d05d83bbb9.png)

```
python3 manage.py runserver
```
![website](https://user-images.githubusercontent.com/44108388/85263979-9fa4fd80-b48d-11ea-86de-13e3b819694e.png)

```
basic auth
```
![website](https://user-images.githubusercontent.com/44108388/101983345-9197a300-3ca0-11eb-8dc4-2fcc0f471548.png)

This command can be used to create a basic authentication app named accounts.
It supports login, logout and register functionalities. Other functinalities can be added easily.

That's it, a complete django project will be setup. It includes app and other settings too. Please explore the files created to know more.


text:
# Introduction to Learning Go

Go can be downloaded from [golang.org](https://golang.org/doc/install)

Test your `go` installation:

```
go version
```

# Run Go in Docker

We can also run go in a small docker container:

```
cd golang\introduction

docker build --target dev . -t go
docker run -it -v ${PWD}:/work go sh
go version

```

# Code Structure

https://golang.org/doc/code.html

* Package:
  - Source files in same directory that are compiled together
  - Have visibility on all source files in the same package

* Modules:
  - Collection of packages that are released together

Our repository can contain one or more go modules, but usually 1.
  - At the root of the repo

`go.mod` Declares module path + import path for packages. (Where to download them)
  - When we write our own program, we can define a module path
  - This allows us to publish our code (if we want), so others can download it
  - The module path could be something like `github.com/google/go-cmp`
  - Makes it easy for other programs to consume our module

# Our first Program

* Create a folder containing our application

```
mkdir app

```

* Define a module path (github.com/docker-development-youtube-series/golang/introdouction/app)

```
# change directory to your application source code

cd app

# create a go module file

go mod init github.com/docker-development-youtube-series/golang/introdouction/app

```

* Create basic source code

In the `app` folder, create a program called `app.go`
Paste the following content into it.

```
package main

import "fmt"

func main() {
	fmt.Println("Hello, world.")
}
```

* Run your application code

You can run your application

```
go run app.go
```

# Building our Program

Build your application into a static binary:

```
go build
```

This will produce a compiled program called `app`
You can run this program easily:

```
./app
```

# Install your application (optional)

"This command builds the app command, producing an executable binary.

It then installs that binary as $HOME/go/bin/app (or, under Windows, %USERPROFILE%\go\bin\app.exe)"

```
go install github.com/docker-development-youtube-series/golang/introdouction/app
```

# The Code

## Functions

In the video we cover writing functions.

It allows us to execute a block of code

You want to give your function a single purpose

Functions can have an input and return an output

Well thought out functions makes it easier to write tests

Instead of doing a boring `x + y` function that adds two numbers, let's do something a little
more realistic but still basic:

```
// This function returns some data
// The data could be coming from a database, or a file.
// The person calling the function should not care
// Since the function does not leak its Data provider

func getData(inputs)(outputs){
}

// functions can take multiple inputs, and return multiple outputs

// lets say we have 1) customers and 2) the cities they are from
// we may want to 1) get a list of customers and 2) get a list of cities
// therefore we have 2 types of data, 1) customers 2) cities
// let's improve our function so its gets data based on the type

func getData(customerId int) (customer string) {
}
```

## Variables

To hold data in programming languages, we use variables.

Variables take up space in memory, so we want to keep it minimal.

Let's declare variables in our function

```
func getData(customerId int) (customer string) {
  var firstName = "Marcel"
  lastName := "Dempers"

  fullName := firstName + " " + lastName
  return fullName

  //or we can return the computation instead of adding another variable!
  return firstName + " " + lastName

  //or we dont even need to declare variables :)
  return "Marcel Dempers"

}

```

## Control Flows (if\else)

You can see we're not using the `customerId` input in our function.

Let's use it!

Control flows allow us to add "rules" to our code.

"If this is the case, then do that, else do something else".

So let's say we have a customer ID 1 coming in, we may only want to
return our customer if it matches the `customerId`

```

func getData(customerId int) (customer string) {

  if customerId == 1 {
    return "Marcel Dempers"
  } else if customerId == 2 {
    return "Bob Smith"
  } else {
    return ""
  }

}

```

Let's invoke our function :

```
//in the main() function

//get our customer
customer := getData(1)
fmt.Println(customer)

//get the wrong customer
customer := getData(3)
fmt.Println(customer)

```
## Arrays

At the moment, we can only return 1 customer at a time on our function.

Realistically we need the ability to return more data, not just a single customer.

Arrays allow us to make a collection of variables of the same type.

We can now return a list of customers!

Let's change our function to get an array of customers!

```
func getData() (customers [2]string) {
  //create 1 record
  customer := "Marcel Dempers"

  //assign our customer to the array
  customers[0] = customer

  //OR we can assign it like this
  customers[1] = "Bob Smith"

  //send it back to the caller
  return customers

}

```

Now we also have to change our calling function to expect an array:

```
customers := getData()

fmt.Println(customers)

```

## Slices

Since arrays are fixed size, Slices are a dynamically-sized view into arrays.
Let's create a slice instead of array so we can add customers dynamically!

```
func getData() (customers []string) {

  //initialise our slice of type string
  customers = []string{ "Marcel Dempers", "Bob Smith", "John Smith"}

  //add more legendary customers dynamically
  customers = append(customers, "Ben Spain")
  customers = append(customers, "Aleem Janmohamed")
  customers = append(customers, "Jamie le Notre")
  customers = append(customers, "Victor Savkov")
  customers = append(customers, "P The Admin")
  customers = append(customers, "Adrian Oprea")
  customers = append(customers, "Jonathan D")

  //send it back to the caller
  return customers

}

```

## Loops

Loops are used to iterate over collections, lists, arrays etc.

Let's say we need to loop through our customers

In the `main()` function, we can grab the list of customers and loop them.
In this demo, we'll cover a basic for loop, but there are several approaches to writing loops.

```
//loop forever
for {
  //any code in here will run forever!

  fmt.Println("Infinite Loop 1")
	time.Sleep(time.Second)

  //unless we break out the loop like this
  break
}

//loop for x number of loops
for x := 0; x < 10; x++ {

  //any code in here will run 10 times! (unless we break!)
  fmt.Println(customers[x])

}

//loop for ALL our customer

for x, customer := range customers {

  //we can access the "customer" variable in this approach
  customer = customers[x]
  fmt.Println(customer)

  //OR
  //we can use the supplied customer from the loop
  // and silence the x variable, replace it with a _ character
  fmt.Println(customer)
}

```

## Structs

So far so good, however, customer data is not useful as strings.

Customers can have a firstname, lastname, and more properties.

For this purpose we'd like to group some variables into a single variable.

This is what `struct` allows us to do.

Let's create a `struct` for our customer

Let's create a new `go` file called `customers.go`

```
package main

Customer struct {
  FirstName string
  LastName string
  FullName string
}

```

Let's put it all together:

In `customers.go`, let's create a function to get customers

```
func GetCustomers()(customers []Customer) {

  //we can declare customers like this:
  marcel := 	Customer{ FirstName: "Marcel", LastName: "Dempers" }

	customers = append(customers,
		Customer{ FirstName: "Marcel", LastName: "Dempers" },
		Customer{ FirstName: "Ben", LastName: "Spain" },
		Customer{ FirstName: "Aleem", LastName: "Janmohamed" },
		Customer{ FirstName: "Jamie", LastName: "le Notre" },
		Customer{ FirstName: "Victor", LastName: "Savkov" },
		Customer{ FirstName: "P", LastName: "The Admin" },
		Customer{ FirstName: "Adrian", LastName: "Oprea" },
		Customer{ FirstName: "Jonathan", LastName: "D" },
	)

	return customers

}
```

In `main()` we can now call our shiny new function

```
customers := GetCustomers()

for _, customer := range customers {
  //we can access the "customer" variable in this approach
  fmt.Println(customer)
}
```

# Docker

For our dev environment, we have a simple image using `go`

We also set a work directory and alias the target as `dev`

This means we can use this container layer as a development environment.

Later down the track we can add debuggers in here for example.

Checkout my debugging video for go: https://youtu.be/kToyI16IFxs

## Development environment

```
FROM golang:1.15 as dev

WORKDIR /work
```

## Building our code

```
FROM golang:1.15 as build

WORKDIR /app
COPY ./app/* /app/
RUN go build -o app
```

## The Runtime

```
FROM alpine as runtime
COPY --from=build /app/app /
CMD ./app
```

## Building the Container

```
docker build . -t customer-app

```

## Running the Container

```
docker run customer-app
```