text:
## Exercise - A Serverless Java function with a custom JRE.

The Java Platform Module System (JPMS), introduced in Java 9, adds [modularity to the Java platform](https://blogs.oracle.com/java/modular-development). With JPMS's [`jlink`](https://docs.oracle.com/en/java/javase/11/tools/jlink.html) it is now possible to create a custom Java Runtime that only carries the modules that are required by an application.

When invoking a serverless function, the Fn infrastructure will get the request via a trigger (ex. HTTP) and will transparently start the container for that function using the appropriate container image (assuming it isn't alerady running).

Having the ability to create custom JRE is extremely important in a serverless context as the size of the function container image will directly impact the startup time of this function. The smaller the function image is, the less time will be spent in loading the container image from the registry.

In addition, it is a good practice to avoid carrying, in a container, any unused pieces. This will not only reduce the potential surface attack but also simplify the overall maintenance over time.

### Boostrap the function

To create a function that uses `jlink` we will use the Fn `init-image` feature.

`fn init --init-image delabassee/jlink-jre modularfunc`

The parameter passed (_"delabassee/jlink-jre"_) to `init-image` is, in fact, a Docker image that will produce all the artifact required by the function.

:bulb: Running this image will output all the generated artifacts for the function, `docker run delabassee/jlink-jre`.

The parameter passed (_"delabassee/jlink-jre"_) to `init-image` is, in fact, a Docker image that will produce all the artifact required by the function.

If you look at the content of the newly created _"modularfunc"_ directory, you will see familiar content (`pom.xml`, `func.yaml`, `HelloFunction.java`, etc.); the only noticeable difference being a new `Dockerfile` that Fn is using to build the actual container image of the function.

### Build and Deploy the Function

You can build, deploy and run the function, as usual, using the Fn CLI.

```
fn create someapp
fn deploy --app someapp modularfunc
fn invoke someapp modularfunc
```

### Using jlink to create a custom JRE

If we look at the `Dockerfile`, we can see that it's a [multi-stage build](https://docs.docker.com/develop/develop-images/multistage-build/) as it uses multiple images (`fn-cache:latest`, `maven:3.6.0-jdk-12-alpine` and `alpine:latest`).

There's nothing special in the first part as it is basically about building the Java function using Maven.

The interresting part is the following line
`RUN /opt/openjdk-12/bin/jlink --compress=2 --no-header-files --no-man-pages --strip-debug --output /function/fnjre --add-modules $(/opt/openjdk-12/bin/jdeps --print-module-deps /function/target/function.jar)`.

To understand it, we need to first look at the 2nd part of this command.
`/opt/openjdk-12/bin/jdeps --print-module-deps /function/target/function.jar` is using [`jdeps`](https://docs.oracle.com/javase/8/docs/technotes/tools/unix/jdeps.html) to produce a list of modules required by our function (`function.jar`), modules list that is passed to [`jlink`](https://docs.oracle.com/en/java/javase/11/tools/jlink.html) via its `--add-modules` parameter. Using those modules (abd only those!), `jlink` will produce a custom JRE that will be saved in the `/function/fnjre` directory.

To even reduce the size of this JRE, we instruct `jlink`to remove headers file, man pages, debugging information and finally, we compress the result JRE.

The rest of the `Dockerfile` is about building the container image itself using the files generated in the the previous stage (ex. `COPY --from=build-stage /function/fnjre/ /function/fnjre/`) and a shared object from a cache image (`COPY --from=cache-stage /libfnunixsocket.so /lib`).

### Conlusion

You can see that creating and using a custom JRE is simple as everything is handled by Fn via its `init-image` feature. To undestand the benefits of such custom JRE, you should  measure the size of the produced image. You can do that using `docker images` and the name of the function container image. If you you didn't write the container image name earlier, `fn inspect someapp modularfunc` will give you all the details of the function, including its container image name.

```
docker images modularfunc:0.0.2
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
david               0.0.2               e7a57e4c755b        1 minute ago        40MB
```

:mega: You might want to check [`dive`]((https://medium.com/fnproject/dive-into-serverless-functions-5d1ba3572906)), a convenient tool to explore container image and its layers.

You can see that our function container image only weight **40MB** and it includes everything (and just that!) to run our Serverless function, i.e. the operating system, our custom JRE and our Java 12 function with its dependencies! As said earlier, the smaller the container image is, the faster it will be loaded from the registry when it is invoked. And to better appreciate the benefits of JPMS, compare that number with the size of Java function created using the trditional, i.e. non modular approach (see [earlier exercice](https://fnproject.io/tutorials/JavaFDKIntroduction/)).


text:
**[581. Shortest Unsorted Continuous Subarray](https://leetcode.com/problems/shortest-unsorted-continuous-subarray/)**

Given an integer array, you need to find one **continuous subarray** that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order, too.

You need to find the **shortest** such subarray and output its length.

**Example 1:**

```
Input: [2, 6, 4, 8, 10, 9, 15]
Output: 5
Explanation: You need to sort [6, 4, 8, 10, 9] in ascending order to make the whole array sorted in ascending order.
```

**Note:**
1. Then length of the input array is in range [1, 10,000].
2. The input array may contain duplicates, so ascending order here means <=.

**Solution:**

Runtime: 7 ms<br/>
Memory Usage: 39.9 MB

```java
class Solution {
    public int findUnsortedSubarray(int[] nums) {
        int[] nums_copy = nums.clone();
        int i = 0, j = nums.length - 1;
        Arrays.sort(nums_copy);
        while(i <= j && nums[i] == nums_copy[i]) {
                i++;
        }
        while(i <= j && nums[j] == nums_copy[j]) {
                j--;
        }
        return j - i + 1;
    }
}
```

license: MIT

url: https://raw.githubusercontent.com/HughQS/leetcode/a3400a54b05e01ea8c350f4bed98e81b333d3730/easy/581. Shortest Unsorted Continuous Subarray.md

repository: HughQS/leetcode

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: HughQS/leetcode


text:
### [CVE-2016-1967](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-1967)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

Mozilla Firefox before 45.0 does not properly restrict the availability of IFRAME Resource Timing API times, which allows remote attackers to bypass the Same Origin Policy and obtain sensitive information via crafted JavaScript code that leverages history.back and performance.getEntries calls after restoring a browser session. NOTE: this vulnerability exists because of an incomplete fix for CVE-2015-7207.

### POC

#### Reference
- https://bugzilla.mozilla.org/show_bug.cgi?id=1246956

#### Github
- https://github.com/ARPSyndicate/cvemon

repository: trickest/cve

branch_name: refs/heads/main

gha_language: HTML

gha_license_id: MIT

repo_name: trickest/cve


text:
---
title: "DevOps: Explanation and top benefits"
date: "2022-02-16T16:24:04.000Z"
template: blog
tags: Small Business
image: "./media/devops-explanation-and-benefits.jpg"
---

Miami, FL. Feb 16, 2022

Today  software development is one of the largest and most important industries globally. Companies worldwide invest millions in software development to grow their businesses in the global market and  make them more efficient and productive , achieving happier customers and better overall service.

Thanks to DevOps, companies have been able to develop faster and more efficiently their software and applications and leave aside a little conventional development. Next, we introduce you to **DevOps explanation and benefits**.

<title-2>What is DevOps?</title-2>

The term DevOps, which is a combination of the words "development" and "operations," reflects the process of integrating these two disciplines into a single continuous process.

DevOps is a set of practices, tools, and cultural philosophies that automate and integrate the processes shared by the software development and IT teams. It focuses on team empowerment,  team communication and collaboration , and technology automation.

DevOps teams use tools to automate and accelerate processes, making them more reliable.

With a DevOps toolchain, couples can address core aspects of this methodology, such as continuous integration, continuous delivery, automation, and collaboration.

Source:   IDGRUP

The DevOps lifecycle is divided into six phases, representing the processes, capabilities, and tools needed for development (on the left side of the loop) and operations (on the right side). Throughout each phase, teams work together and maintain communication to coordinate and align at speed and quality.

<title-2>Some DevOps benefits</title-2>

<title-3>**Promotes collaboration:**</title-3>

DevOps is an improvisation of simple, agile software development methodologies, as it also focuses on operations. Thus, DevOps promotes an environment where different teams work together to achieve common organizational goals. It means that the groups in your organization will no longer be isolated and will no longer work towards specific departmental goals. It reduces inefficiencies and saves time.

<title-3>**Speed:**</title-3>

Teams that practice DevOps release deliveries with greater frequency, quality, and stability. Continuous delivery allows teams to create, test, and deliver software with automated tools.  By increasing the frequency and speed of releases , DevOps teams improve products quickly. Can gain A competitive advantage by releasing new features and resolving bugs rapidly.

<title-3>**Customer satisfaction:**</title-3>

Customer satisfaction is one of the things that can make or break your business.

It is crucial for your business to thrive, as gaining new customers is much more expensive than retaining existing ones through improved customer satisfaction. Fortunately, one of the main advantages of DevOps is improved customer experience and, ultimately, customer satisfaction.

<title-3>**Quality and reliability:**</title-3>

Practices such as continuous integration and continuous delivery ensure that changes run smoothly and securely, which improves the quality of software products. Monitoring helps teams stay informed of performance in real-time.

The quality of your software is essential for obvious reasons, and DevOps can help you maximize that quality. DevOps changes the way organizations do their traditional software testing. It makes testing a critical component in the entire SDLC and distributes its responsibility to all engineers involved.

<title-3>**Security:**</title-3>

It is an active and integrated part of the development process, as it integrates security into continuous integration, continuous delivery, and continuous deployment workflow. Safety is integrated into the product by implementing operational security audits and security testing in  agile development  and DevOps workflows.

It follows the philosophy of constant iterative improvements, making the entire security management process more manageable. It also accelerates the speed of recovery if a security incident occurs.

<title-3>**Competitive advantage:**</title-3>

Implementing DevOps can be the trump card to provide that competitive advantage.

The key differentiators that help a company be competitive are speed of software releases, high-quality features, continuous incorporation of feedback, and maximizing ROI. It translates into a decisive competitive advantage over those who have not adopted DevOps.

<title-3>**Innovation:**</title-3>

DevOps can only mean doing things faster at a reduced cost. But there is another clinical advantage that is often overlooked in business innovation. Usually, innovation occurs by tweaking an existing process or system, creating new ones, or introducing a better alternative to an obsolete procedure.

DevOps enables you to deliver your software products quickly. This rapid software delivery frees up some of your developers' time, so they can spend it experimenting with any additional features or improving the effectiveness of existing ones. Developers can validate the feasibility of these ideas by performing proofs-of-concept and proceeding based on the results with minimal disruption to the current project.

<title-3>**Minimal cost of production:**</title-3>

Arguably, the most significant benefit of a sound DevOps strategy is the maximization of profitability from a business perspective. Interestingly, there are multiple ways in which DevOps reduces the costs incurred in an enterprise, either directly or indirectly.

With proper collaboration, DevOps helps reduce management and production costs for your departments, as both maintenance and new upgrades are under a single, broader umbrella.

<title-3>**Better manage unplanned work:**</title-3>

Unplanned work is a reality that all teams face, a reality that often affects team productivity.

Established processes and clear prioritization, development, and operations teams can better manage unplanned work while still focusing on planned work. Teams that embrace DevOps practices work smarter and faster and deliver higher quality to their customers.

Greater automation and cross-functional collaboration reduce complexity and errors, which improves mean time to recovery (MTTR) when incidents and outages occur.

Implementing DevOps in your  development projects  is undoubtedly a great advantage and a relief for your teams. If you want your company to be more competitive and productive over time, and that your customers are satisfied with the quality and delivery times is a fact if or if you must start using this development methodology to be the best. If you need help with your agile development, do not hesitate to write us, and without thinking, we will help you, do not wait any longer. What are you waiting for to reap the **benefits of DevOps**?

**Cobuild Lab Team**

repository: cobuildlab/cobuildlab-web

gha_language: JavaScript

repo_name: cobuildlab/cobuildlab-web


text:
(forked from tpmccauley/dimuon-filter)

This package is a filter that selects events from the MultiJet primary dataset from the CMS open
data release, and computes the razor variables MR and Rsq, used in
supersymmetric particle searches. More details on the razor variables can be found in
http://dx.doi.org/10.1103/PhysRevD.90.112001. In particular, the event is selected
if there are at least two "Paticle Flow" jets with pT\>60 GeV and |eta|\<3. A csv
file and a ROOT file containing MR, Rsq, the four-momenta of the two megajets, HT, MET, the number of jets,
and the number of b-jets (using the kinematic requirements of pT\>40 GeV and |eta|\<3) for each event is produced.

See http://opendata.cern.ch for more information and for context on the instructions below.

To produce files in the VM open a terminal with the X terminal emulator (an icon bottom-left of the VM screen)
and input the commands as explained below.

* Create a CMSSW environment:

```
    cmsrel CMSSW_4_2_8
```

* Change to the CMSSW_4_2_8/src/ directory:

```
    cd CMSSW_4_2_8/src/
```
* Initialize the CMSSW environment:

```
    cmsenv
```
* Clone the source code:

```
    git clone https://github.com/jmduarte/SUSYBSMAnalysis-RazorFilter SUSYBSMAnalysis/RazorFilter
````
* Compile the code with the command:

```
    scram b
```
* Go to the source directory:

```
    cd SUSYBSMAnalysis/RazorFilter
```
* Run the example configuration file (see comments in the file on changing parameters):

```
    cmsRun MultiJetRun2010B.py
```
which will produce a csv file: MultiJetRun2010B.csv and a ROOT file:
    MultiJetRun2010B.root.

repository: jmduarte/SUSYBSMAnalysis-RazorFilter

repo_name: jmduarte/SUSYBSMAnalysis-RazorFilter


text:
# Generate a base client factory

To make things a little easier to get started a client factory generator method is available.

```bash
vendor/bin/soap-client generate:clientfactory

Usage:
  generate:clientfactory [options]

Options:
      --config=CONFIG   The location of the soap code-generator config file
  -o, --overwrite       Makes it possible to overwrite by default
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

```

Options:

- **config**: A [configuration file](../code-generation/configuration.md) is required to build the classmap.

The factory will be put in the same namespace and directory as the client, and use the same name as the client, appended by Factory.

Example output:

```php
<?php

namespace App\Client;

use App\Client\Client;
use App\Order\OrderClassmap;
use Phpro\SoapClient\ClientFactory as PhproClientFactory;
use Phpro\SoapClient\ClientBuilder;

class ClientFactory
{

    public static function factory(string $wsdl) : \App\Client
    {
        $clientFactory = new PhproClientFactory(Client::class);
        $clientBuilder = new ClientBuilder($clientFactory, $wsdl, []);
        $clientBuilder->withClassMaps(OrderClassmap::getCollection());

        return $clientBuilder->build();
    }
}

```

You can then tweak this class to fit your needs.

repository: fleetcutter/soap-client

repo_name: fleetcutter/soap-client


text:
---
title: "Creating UML Diagrams With Ease Using PlantText"
date: 2020-07-25
tags: [General]
---

Unified Modeling Language (UML) has been around the software development circles for a fairly long time now. It helps provide a standardised way to visualise the architecture, design, and implementation of complex software systems. I get mixed reactions from fellow engineers when I ask whether or not they like (or use) UML. Personally, even though I don't like to use it as frequently, I have found it very handy in certain instances. I use it mostly in personal projects to keep a snapshot of my design decisions especially since it might be months before I revisit the project.

This short post is not about whether or not one should use UML. I want to talk about a tool I bumped into that makes creation of UML diagrams a breeze -- [PlantText](https://www.planttext.com/).

## What Is PlantText?

PlantText is a tool that helps you create UML diagrams of various types using code. I find it quite handy since I can quickly create a class diagram using something that I understand so well -- code. When you're done creating your diagram you can generate a `PNG` or `SVG` file, or you can download the code as text.

What makes me like this a lot is that I can version control my designs together with my software project and quickly update them when the need arises.

## Example

Let's create a simple UML class diagram using this amazing tool. Visit the PlantText [website](https://www.planttext.com/) and paste the following code in the text editor:

```csharp
@startuml

title Example Class Diagram (v1)

interface SuperHero{
 Name: string;
 DoHeroStuff(): void
}

class SuperMan implements SuperHero{
}

class SpiderMan implements SuperHero{
}

class Vinarah implements SuperHero{
}

class VinarahSon extends Vinarah{
 DoKidStuff(): void
}

@enduml
```

As you can see, we have a simple `SuperHero` interface that has three classes implementing it. We also have the `VinarahSon` class that inherits from `Vinarah`. This is something a software engineer can easily understand. You can now take this code and push it to your version control repository so that you can update it as you go. The bonus for me is the visual image that gets generated as shown below.

UML class diagram created using PlantText

There you have it -- a UML class diagram generated from code.

## Conclusion

In this post I briefly spoke about [PlantText](https://www.planttext.com/), a web tool that allows you to generate UML diagrams of various types -- class diagrams, sequence diagrams etcetera, using code. I've been using this tool for quite some time and decided to share it with someone who might not have encountered it and is looking for something similar. Like always, thanks so much for taking time to read and, if you're reading this during the 2020 Covid-19 pandemic, please stay safe.


text:
# SQLite App Example

This is an example app which requires CGO and MinGW toolchain to be built for Windows (see [issue](https://github.com/mattn/go-sqlite3/issues/303)).

Code is taken from [mattn/go-sqlite3](https://github.com/mattn/go-sqlite3/blob/master/_example/simple/simple.go)

Run `make` to build application for windows


text:
Allocators: the Good Parts
==========================

Pablo Halpern

This repository contains all of the code presented in my talk at CppCon
2017, including an implementation of `polymorphic_allocators`, a C++17
feature implemented here using only C++11 features.

Also included is the PDF of my PowerPoint presentation.

Look for a video of my presentation, coming soon to the CppCon Channel of
YouTube.

Components and namespaces
-------------------------

Several of the components in this repository are implementations of
C++17 library features using C++11 language and library facilities. The
C++17 features are implemented in the `cpp17` namespace instead of the
`std` namespace. The `cpp17` namespace imports the `std` namespace, so
any standard feature is available in the `cpp17` namespace.

Each component comprises 3 files: a `.h` file containing the interface,
template implementations, and inline functions, a `.cpp` file containing
the non-template and non-inline parts of the implementation, and a
`.t.cpp` file containing a test driver for the component. The components
in this repository are:

 * **polymorphic_allocator**: An implementation of `cpp17::pmr::memory_resource`
   and `cpp17::pmr::polymorphic_allocator<Tp>` from C++17, using only C++11
   language and library features.

 * **pmr_vector** (header only): An implementation of
   `cpp17::pmr::vector<Tp>` from C++17, which is the same as
   `std::vector<Tp, cpp17::pmr::polymoprhic_allocator<Tp>>`.

 * **pmr_string** (header only): An implementation of
   `cpp17::pmr::basic_string<charT, Traits>`, from C++17, which is the
   same as `std::basic_string<charT, Traits,
   cpp17::pmr::polymorpic_allocator<charT>>`, This component also
   contains the aliases `cpp17::pmr::string` and `cpp17::pmr::wstring`.

 * **test_resource**: A memory resource for testing purposes that
   maintains statistics on memory usage and checks for mismatched
   deallocations and memory leaks. A subset of this component is
   explicated in my talk.

 * **slist**: An implementation of a forward list that uses only the good
   parts of the C++17 allocator model. A subset of this component is
   explicated in my talk.


text:
---
layout: post
title: "[OSX] find and kill process running on port osx"
description: " "
category: "memo"
tags: ["osx", "cli", "lsof", "kill"]
---
{% include JB/setup %}

# Commands
## Find pid of process running on port:

example port 3000

```
$ lsof -i :3000
COMMAND   PID   USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
node    *81602* julien   14u  IPv6 0x669792e160564ee3      0t0  TCP *:hbci (LISTEN)
```

### lsof - *list open file*

from OSX man page

    * `-i :3000`: match internet address with port 3000

## Kill the process on found pid

```
$ kill -9 81602
$ echo $?
0
```

### kill - *terminate or signal a process*

from OSX man page

  * `-9 81609`: send KILL (-9) signal to process with PID 81609

gha_language: CSS


text:
## MatrixFact

### Install
```
pip install matrix-fact
```

### What is matrix-fact?
matrix-fact contains modules for constrained/unconstrained matrix factorization (and related) methods for both sparse and dense matrices. The repository can be found at https://github.com/gentaiscool/matrix_fact. The code is based on https://github.com/ChrisSchinnerl/pymf3 and https://github.com/rikkhill/pymf. We updated the code to support the latest library. It requires cvxopt, numpy, scipy and torch. We just added the support for PyTorch-based SNMF.

### Packages

The package includes:
* Non-negative matrix factorization (NMF) [three different optimizations used]
* Convex non-negative matrix factorization (CNMF)
* Semi non-negative matrix factorization (SNMF)
* Archetypal analysis (AA)
* Simplex volume maximization (SiVM) [and SiVM for CUR, GSAT, ... ]
* Convex-hull non-negative matrix factorization (CHNMF)
* Binary matrix factorization (BNMF)
* Singular value decomposition (SVD)
* Principal component analysis (PCA)
* K-means clustering (Kmeans)
* C-means clustering (Cmeans)
* CUR decomposition (CUR)
* Compaxt matrix decomposition (CMD)
* PyTorch SNMF

### Usage
Given a dataset, most factorization methods try to minimize the Frobenius norm |data - W*H| by finding a suitable set of basis vectors W and coefficients H. The syntax for calling the various methods is quite similar. Usually, one has to submit a desired number of basis vectors and the maximum number of iterations. For example, applying NMF to a dataset data aiming at 2 basis vectors within 10 iterations works as follows:

```python
>>> import matrix_fact
>>> import numpy as np
>>> data = np.array([[1.0, 0.0, 2.0], [0.0, 1.0, 1.0]])
>>> nmf_mdl = matrix_fact.NMF(data, num_bases=2, niter=10)
>>> nmf_mdl.initialization()
>>> nmf_mdl.factorize()
```

The basis vectors are now stored in nmf_mdl.W, the coefficients in nmf_mdl.H. To compute coefficients for an existing set of basis vectors simply copy W to nmf_mdl.W, and set compW to False:

```python
>>> data = np.array([[1.5], [1.2]])
>>> W = np.array([[1.0, 0.0], [0.0, 1.0]])
>>> nmf_mdl = matrix_fact.NMF(data, num_bases=2, niter=1, compW=False)
>>> nmf_mdl.initialization()
>>> nmf_mdl.W = W
>>> nmf_mdl.factorize()
```

By changing py_fact.NMF to e.g. py_fact.AA or py_fact.CNMF Archetypal Analysis or Convex-NMF can be applied. Some methods might allow other parameters, make sure to have a look at the corresponding >>>help(py_fact.AA) documentation. For example, CUR, CMD, and SVD are handled slightly differently, as they factorize into three submatrices which requires appropriate arguments for row and column sampling.

For PyTorch-SNMF
```python
>>> data = torch.FloatTensor([[1.5], [1.2]])
>>> nmf_mdl = matrix_fact.NMF(data, num_bases=2)
>>> nmf_mdl.factorize(niter=1000)
```

### Very large datasets
For handling larger datasets py_fact supports hdf5 via h5py. Usage is straight forward as h5py allows to map large numpy matrices to disk. Thus, instead of passing data as a np.array, you can simply send the corresponding hdf5 table. The following example shows how to apply py_fact to a random matrix that is entirely stored on disk. In this example the dataset does not have to fit into memory, the resulting low-rank factors W,H have to.

```python
>>> import h5py
>>> import numpy as np
>>> import matrix_fact
>>>
>>> file = h5py.File('myfile.hdf5', 'w')
>>> file['dataset'] = np.random.random((100,1000))
>>> sivm_mdl = matrix_fact.SIVM(file['dataset'], num_bases=10)
>>> sivm_mdl.factorize()
```

If the low-rank matrices W,H also do not fit into memory, they can be initialized as a h5py matrix.

```python
>>> import h5py
>>> import numpy as np
>>> import matrix_fact
>>>
>>> file = h5py.File('myfile.hdf5', 'w')
>>> file['dataset'] = np.random.random((100,1000))
>>> file['W'] = np.random.random((100,10))
>>> file['H'] = np.random.random((10,1000))
>>> sivm_mdl = matrix_fact.SIVM(file['dataset'], num_bases=10)
>>> sivm_mdl.W = file['W']
>>> sivm_mdl.H = file['H']
>>> sivm_mdl.factorize()
```

Please note that currently not all methods work well with hdf5. While they all accept hdf5 input matrices, they sometimes lead to very high memory consumption on intermediate computation steps. This is difficult to avoid unless we switch to a completely disk-based storage.


text:
# Scadla: a scala library for constructive solid geometry

Scadla is a small library to create 3D models.
Those model can then, for instance, be 3D printed.
Scadla is very much influence by OpenSCAD and has the same goal of being a _programmer's CAD_ tool.
The name scadla is a portmanteau of scad and scala.

Why scadla? OpenSCAD is doing a pretty good job and is becoming a de facto standard in the maker community.

That is true. OpenSCAD is usually doing a pretty fine job and we currently use it in the back end.
However, there is a few things that, IMO, OpenSCAD did not get right or missing features that a good general purpose programming language, like scala, gives you for free.
So instead of developing a new language, scadla simply embed CSG into an existing language.
The main points on which we try to improve are:

* modularity/reusability, package/namespace, toolchain support, etc. IMO OpenSCAD does not scale very well to projects across multiple files. The `use` vs `include` is very coarse grained. The absence of namespace gives rise to very long variable names in order to avoid clash. Fortunately, you get those things for free in scala. Also the toolchain is more mature. For instance, one can use maven to share libraries of objects and then just specify in project configuration which library to use and sbt will download them automatically, add them to the classpath, ...

* _first class objects_ An OpenSCAD program roughly build a tree with primitive objects as leaves and CSG operations as internal nodes. However, that tree is built implicitly and one cannot access it directly. In scadla, that tree is just an algebraic datatype. This means that you can reference it, e.g., `val u = Union(Cube(...), Sphere(...))` and also inspect/modify it using pattern matching, e.g., `u match { case Union(...) => ... }`

* _type-safe units_ with the [squants](https://github.com/typelevel/squants) library. Let the compiler warns you when you try to rotate a object by 10mm. To keep a lightweight syntax `EverythingIsIn` provides implicit conversions from numbers to length and angles. For instance, add `import scadla.EverythingIsIn.{millimeters, radians}` in your file to work use millimeters and radians by default.

* a small caveat: OpenSCAD does has only floating points number but scala makes the distinction between integers and floating points. For instance, `1/2` is the integer division and returns `0`, not `0.5`. If you want floating point numbers write `1/2.0` or `1.0/2`.

## Additional Backends and Operations

Scadla core operations are based on CSG.
However, most recent CAD systems uses boundary representation which offers a wider range of operations.
There is new backend for scadla based on BREP in development at https://github.com/dzufferey/scadla-oce-backend/.

## Dependencies

For the moment, scadla uses
* required: Java 8 or above
* recommended: [OpenSCAD](http://www.openscad.org/) for the CSG operations
* optional: [Meshlab](http://meshlab.sourceforge.net/) to display the models.
  Scadla can try to display the model using [X3Dom](https://www.x3dom.org/) but it is currently quite limited and requires an internet connection.

## Examples

For examples, please look in the [example](src/main/scala/scadla/examples) folder.

For a complete example, you can head to [MecanumWheel.scala](src/main/scala/scadla/examples/MecanumWheel.scala) for a parametric design of an omnidirectional wheel.

The primitives and CSG operations are defined in [Solid.scala](src/main/scala/scadla/Solid.scala).

For instance, a cube written `cube([1,2,1])` in OpenSCAD is written `Cube(1 mm, 2 mm, 1 mm)` in scadla.
Scadla has explicits units.
In that case, we use millimeters.

Let us consider the following example:
```scala
Intersection(
  Union(
    Cube(1 mm, 1 mm, 1mm),
    Translate(-0.5 mm, -0.5 mm, 0 mm, Cube(1 mm, 1 mm, 1 mm))
  ),
  Sphere(1.5 mm)
)
```
In the most verbose form, it corresponds to the full CSG tree.
However, we can make it prettier.
First, we can store `Solid`s in variables and reuse them:
```scala
val c = Cube(1 mm, 1 mm, 1 mm)
val s = Sphere(1.5 mm)
val u = Union(c, Translate(-0.5 mm, -0.5 mm, 0 mm, c))
Intersection(u, s)
```
Next, we can replace the operation with a less verbose syntax using `import InlineOps._`
```scala
val c = Cube(1 mm, 1 mm, 1 mm)
val s = Sphere(1.5 mm)
(c + c.move(-0.5 mm, -0.5 mm, 0 mm)) * s
```
To avoid putting `mm` everywhere, it is possible to use implicit conversion with `import scadla.EverythingIsIn.{millimeters, radians}`
```scala
val c = Cube(1, 1, 1)
val s = Sphere(1.5)
(c + c.move(-0.5, -0.5, 0)) * s
```
The compiler will interpret numeric constant as millimeters when used as length and as radians for angles.
It is also possible to use inches instead of millimeters and degrees instead of radians.
Beware, when using the implicit conversions as it can be unpredictable.

Once, we have the description of the object we want to make, we need to evaluate the CSG tree to get a 3D model.
We currently use OpenSCAD for that.
See [OpenSCAD.scala](src/main/scala/scadla/backends/OpenSCAD.scala) for the details.

Assuming that we the object we are interested in is stored in the `obj` variable.
We can do a few things:
* evaluate the tree and save the result in a .stl file with `OpenSCAD.toSTL(obj, file_name)`
* view the result `OpenSCAD.view(obj)` (this requires meshlab)
* evaluate the tree and get back a Polyhedron with `OpenSCAD.getResult(obj)`

By default, scadla will run openscad with `$fa=4; $fs=0.5;`, so complex designs can take a while to render.
You can change that by giving the appropriate arguments to the different methods (see `OpenSCAD.scala` for the details)

To run this example execute `sbt run` and select `scadla.examples.MecanumWheel`.

## Compiling and Using it

You can build scadla using [sbt](http://www.scala-sbt.org/).
To install sbt follow the instructions at [http://www.scala-sbt.org/release/tutorial/Setup.html](http://www.scala-sbt.org/release/tutorial/Setup.html).

Then, in a console, execute:
```
$ sbt
> compile
```

To try some examples execute `sbt run` and select one example.

If you want to use it in another project, you need to add to your `build.sbt`:
```
resolvers += "jitpack" at "https://jitpack.io"

libraryDependencies += "com.github.dzufferey" %% "scadla" % "0.1.1"
```

## JupyterLab

It is possible to use scadla with [JupyterLab](https://jupyter.org/index.html).
First you need to install [Almond](https://almond.sh/).
Then, look in [sample.ipynb](doc/sample.ipynb) to see how it work.

## Contributors

* Damien Zufferey (basic infrastrucure)
* Jan Ypma (adding type-safe units)

## ToDo

Features that may (or may not) be implemented, depending on time and motivation:

* features
  - geometry shader (similar to computer graphics) to modify the surface of objects, e.g., adding a pattern to a flat surface.
  - implicit surfaces, e.g., bezier, nurbs, metaballs.
    * rendering using [marching cubes](https://en.wikipedia.org/wiki/Marching_cubes), http://citeseerx.ist.psu.edu/viewdoc/summary?doi=<IP_ADDRESS>.7139, http://users.polytech.unice.fr/~lingrand/MarchingCubes/algo.html, http://link.springer.com/article/10.1007%2FBF01900830
    * an alternative to the marching cubes is "constrained elastic surface nets" see [JSurfaceNets](https://github.com/miho/JSurfaceNets)
  - change FromFile to FromURL
  - backend specific operations: implicit surfaes, chamfer, minkowski, etc. can be easier or harder to do depending on the backend.
    We need to keep a core of operation which is supported by all backend and then other operations that may be backend specific.
    The simplest is to "unseal" the `Solid` type.
    Is it possible to do better
* implementation
  - file format:
    * PLY parser (this format is evil!!!)
  - `InBox: Polyhedron`: multiply, hull
  - object cache (speed-up recomputation)
  - try VTK as backend
    * [installation](http://www.vtk.org/Wiki/VTK/Configure_and_Build)
    * how to decide whether or not to compile VTK: it cannot be resolved as a MVN dependency but only a a local one ...
      - split the project into (1) core, (2) renderers, (3) examples
    * [boolean operation](http://hdl.handle.net/10380/3262)
    * [transform](http://www.vtk.org/doc/nightly/html/classvtkTransform.html)
    * [convex hull](https://cmake.org/Wiki/VTK/Examples/Boneyard/Cxx/PolyData/ConvexHullDelaunay3D)
    * minkowski sum ???
  - built-in model viewer
    * choosing window size according to screen size, and allow resizing
    * moving the point of view

* Assemblies: group of object linked by joints (can move), the goal is to make it easier to visualized larger projects and make sure everything fits/move properly
  - better notation for the connections
  - joint: what about time transformers (for min-max travel)
  - part: rendered part (visibility and serialization)
  - GUI: sliders for time and expansion

* ongoing work in a rendering backend based on Open CASCADE Community edition: [https://github.com/dzufferey/scadla-oce-backend](https://github.com/dzufferey/scadla-oce-backend)
  - support for different operations: chamfer, fillet, and offset, but no convex hull or Minkowski sum.
  - much more ...

* Documentation and tutorials

* ...

Also, pull requests are welcome.

repository: dzufferey/scadla

gha_language: Scala

repo_name: dzufferey/scadla


text:
# Table of contents

* [Introduction](introduction.md)

## Getting started

* [What is Voyager](getting-started/what-is-voyager.md)
* [Prerequisites](getting-started/prerequisites.md)
* [Installation](getting-started/installation.md)
* [Upgrading](getting-started/upgrading.md)
* [Configurations](getting-started/configurations.md)

## BREAD

* [Introduction](bread/introduction.md)
* [Relationships](bread/relationships.md)
* [Formfields](bread/formfields/introduction.md)
  * [Checkbox/Multiple Checkbox/Radio](bread/formfields/checkbox.md)
  * [Coordinates](bread/formfields/coordinates.md)
  * [Date & Time](bread/formfields/date-time.md)
  * [Dropdown](bread/formfields/dropdown.md)
  * [Images](bread/formfields/images.md)
  * [Media Picker](bread/formfields/media-picker.md)
  * [Number](bread/formfields/number.md)

## Core concepts

* [Routing](core-concepts/routing.md)
* [Media Manager](core-concepts/media-manager.md)
* [Menus and Menu Builder](core-concepts/menus-and-menu-builder.md)
* [Database Manager](core-concepts/database-manager.md)
* [Settings](core-concepts/settings.md)
* [Compass](core-concepts/compass.md)
* [Roles and Permissions](core-concepts/roles-and-permissions.md)
* [Helper methods](core-concepts/helper-methods.md)
* [Multilanguage](core-concepts/multilanguage.md)

## Customization

* [Overriding files](customization/overriding-files.md)
* [Overriding Routes](customization/overriding-routes.md)
* [Additional CSS and JS](customization/additional-css-js.md)
* [Enabling Soft-Delete](customization/enabling-soft-delete.md)
* [Custom relationship attributes](customization/custom-realtionship-attributes.md)
* [TinyMCE](customization/tinymce.md)
* [Adding custom Formfields](customization/adding-custom-formfields.md)
* [Coordinates](customization/coordinates.md)
* [BREAD accessors](customization/bread-accessors.md)
* [Custom guard](customization/custom-guard.md)
* [Action buttons](customization/action-buttons.md)

## Troubleshooting

* [Using HTTPS on yours site](troubleshooting/using-https.md)
* [Missing required parameter](troubleshooting/missing-required-parameter.md)

repository: MrCrayon/voyager

gha_language: PHP

repo_name: MrCrayon/voyager


text:
jCnC

This project allows system administrators to configure groups of juniper switches.

It extends the capabilites provided by pyez in three ways.

1) It store information about devices in a local database.

2) It provides a very cron friendly command line parser

3) It is multithreaded for rapidly disseminating configuration changes.

This is alpha software.  Use at own risk.  Please send me bugs/patches!

Examples:

rcli.py --mode software --action install --device all --param /path/to/upgrade/archive

upgrade every devices software with the file found in /path/to/upgrade/archive

rcli.py -m host -a add -d <IP_ADDRESS> -p root,toor

add a new host to the database url <IP_ADDRESS>, user root, password toor

rcli.py -m help

show extended help

repository: telnik/jCnC

repo_name: telnik/jCnC


text:
---
layout: ziplab
description: Building a Proof-of-concept
---

# Application Development in APEX
## **Building a Proof-of-concept**
## Overview
This lab starts with a napkin design of data structures we would
like to use for a proof-of-concept. Using Quick SQL you will quickly
define the data structures and utilize various table and column
directives to better define the tables and also create some
dummy data. You will then be creating an application based on
the new tables. Lastly, you will be updating some of the generated
components to improve the initial app.

*From napkin design to demo-ready, proof-of-concept app,
complete with some dummy data, in minutes - Viola!*

## **Section 1** - Obtaining a Workspace
*{Note: If you have a workspace on https://apex.oracle.com then you can skip this section and move to Section 2}*

### **Step 1.1**

1. Go to https://apex.oracle.com
1. Click **Get Started for Free**

![](https://i.imgur.com/FpMd2UK.png[/img])

### **Step 1.1b**

1. Click **Request a Free Workspace**

![](https://i.imgur.com/11dGjfL.png[/img])

### **Step 1.2**

1. What Type of Workspace 1. Click Application Development
1. Enter your Identification details – First Name, Last Name, Email, Workspace

   *{Note: For workspace enter a unique name,
such as first initial and last name}*
1. Enter Schema details – Schema Name

  *{Note: For schema name enter the same name
as you entered for workspace}*

4.  Complete the wizard

### **Step 1.3**

1. Check your email. You should get an email from oracle-<EMAIL_ADDRESS>within a few minutes

   *{Note: If you don’t get an email go
back to Step 1 and make sure to enter
your email correctly}*
1. Click Create Workspace
1. Click Continue to Log In Screen
1. Reset your password

![](https://i.imgur.com/vnslkIt.png[/img])

## **Section 2** - Defining new data structures - Using Quick SQL

## Oracle Spreadsheet Table
![](https://i.imgur.com/8TkzNms.png[/img])

## Napkin Design - Improved data model for Projects
![](https://i.imgur.com/l8LEEtn.png[/img])

### **Step 2.1 - Open Quick SQL**

1. Log into your workspace
1. Click **SQL Workshop**
1. Click **SQL Scripts**

![](https://i.imgur.com/4TBd8Rf.png[/img])

4. Click **Quick SQL**

![](https://i.imgur.com/Gdublvv.png[/img])

### **Step 2.2 1. Enter shorthand for Team Members table**

1. Enter the Table Name {Team Members}
1. Indent 2 or more spaces and enter the column names

![](https://i.imgur.com/CulnRgR.png[/img])

*Note: You don’t need to enter all of the column names shown,
as you will load a complete script later in this lesson*

### **Step 2.3 1. Enter details for Projects table**
1. Enter the Table Name in the first column {Projects}
1. Indent 2 or more spaces and enter the column names

![](https://i.imgur.com/jtu2T6K.png[/img])

### **Step 2.4 – Review Help**

1. Click **Help**
1. Click **Table Directives**

![](https://i.imgur.com/55CTUHD.png[/img])

### **Step 2.4b – Review Help**

1. Click **Column Directives**

![](https://i.imgur.com/pV4Sw3X.png[/img])

### **Step 2.4c – Review Help**

1. Click **Data Types**

![](https://i.imgur.com/6p8xUN6.png[/img])

### **Step 2.5 - Improve the Shorthand**

1. Close **Help**
1. Enter **/insert xx** for tables
1. Enter **/nn** for mandatory columns
1. Enter **/references team_members** for project lead column
1. Enter **num** for budget column
1. Enter **/vc30** and **/check ASSIGNED,
IN-PROGRESS, COMPLETED** for
status column

![](https://i.imgur.com/C6zTGtJ.png[/img])

### **Step 2.6 1. Enter details for a child table**

1. Enter the Table Name indented
{Milestones}

![](https://i.imgur.com/IEYZU5c.png[/img])

1. Indent 2 or more spaces and
enter the column names

![](https://i.imgur.com/qt8TUXO.png[/img])

### **Step 2.7 1. Enter details for another child table**

1. Enter the Table Name indented
{Tasks}
1. Indent 2 or more spaces and
enter the column names

![](https://i.imgur.com/VYYEL8e.png[/img])

### **Step 2.8 – Complete the Shorthand**

1. Copy the following URL into a new window in your browser:
{Remember you are on Slide 21 if you click the link directly}

  https://www.oracle.com/technetwork/developer-tools/apex/application-express/apex-beginner-quicksql-5095785.txt

2. Copy and Paste the full script
into the **Quick SQL Shorthand pane**

3. Click **Generate SQL**

![](https://i.imgur.com/9lW6S17.png[/img])

### **Step 2.9 – Update the Settings**

1. Click **Settings**
- Object Prefix, enter **hol**
- On Delete, select **Restrict**
- Primary Keys, select **12c Identity Data Types**
- Date Data Type, select **TIMESTAMP WITH LOCAL TIME ZONE**
- Audit Columns, check Include
- Row Version Number, check Include
2. Click **Save Changes**

![](https://i.imgur.com/nZVvx71.png[/img])

### **Step 2.10 – Save, Review, and Run the Script**

1. Click **Save SQL Script**
1. For Script Name, enter **hol**
1. Click **Save Script**
1. Click **Review** and **Run**

![](https://i.imgur.com/e2I6k3z.png[/img])

*Note: The script will be displayed in
the Script Editor within SQL Scripts*

1. Click **Run**
1. Click **Run Now**

![](https://i.imgur.com/CyYXjko.png[/img])

## **Section 3** - Creating an app on the tables from Quick SQL - *Using the Create Application Wizard*

### **Step 3.1 – Start the Create App Wizard**

1. Click **Create App** from Script

![](https://i.imgur.com/7TPFNiS.png[/img])

*{Note: If you are back on SQL Scripts, and don’t see the “Create
App from Script” button perform the following steps*:
1. *Within the Results column, click “1” for the script you just ran*.
2. *Under View Results, click the magnifying glass*.

*The results page shown above should now be displayed again}*

### **Step 3.2 – Name the App and Update Appearance**

1. For Name, enter **Projects**
1. Click **Appearance**
1. For Theme Style, select **Vita-Slate**

![](https://i.imgur.com/EOCdLPq.png[/img])

### **Step 3.3 – Add Features**

1. For Features, click **Check All**

![](https://i.imgur.com/4ZadDjE.png[/img])

### **Step 3.4 - Create Application**

1. Click **Create Application**

![](https://i.imgur.com/P9SETCW.png[/img])

### **Step 3.5 – App in Page Designer**

1. Your new application will be displayed in Page Designer
1. Click **Run Application**

![](https://i.imgur.com/gwEA0V5.png[/img])

### **Step 3.6 - Runtime App**

1. Enter your **credentials**
1. Play around with your new application

![](https://i.imgur.com/Zsgy9GN.png[/img])

## **Section 4** - Improving the App - *Updating a Page*

### **Step 4.1 - Restart the Create App Wizard**

1. From the development environment, click **App Builder**, and then select **Create**

![](https://i.imgur.com/F0CAdtA.png[/img])

1. Click **New Application**

### **Step 4.2 - Load Blueprint**

1. In the Create App Wizard, click **Load Blueprint**
1. For Projects, click **Load**

![](https://i.imgur.com/7XSTr20.png[/img])

### **Step 4.3 – Add a Page**

1. Click **Add Page**
1. Click **Interactive Grid**

![](https://i.imgur.com/Kq1R8CL.png[/img])

1. For Page Name,
enter **Milestones**
1. For Table or View, select
**HOL_MILESTONES**
1. Click **Add Page**

![](https://i.imgur.com/MvavpGO.png[/img])

### **Step 4.4 – Reorder a Page**

1. Click and hold the mouse when hovering over the hamburger for
the **Milestones – Interactive Grid** page
1.  Move it up until the page is under Projects
1.  Release the mouse

![](https://i.imgur.com/TfTn4Mv.png[/img])

### **Step 4.5 – Delete a Page**

1. For **Milestones – Interactive Report with Form** page, click **Edit**
1. Click **Delete**

![](https://i.imgur.com/vzjSc1z.png[/img])

### **Step 4.6 – Create App and Run**

1. Click **Create Application**
1.  In Page Designer, click **Run Application**

![](https://i.imgur.com/CGbb0t1.png[/img])

### **Step 4.7 – Navigate to Milestones**

1.  In the runtime environment, click **Milestones**

![](https://i.imgur.com/3E0HN6u.png[/img])

1.  In the Developer Toolbar, click **Edit Page 6**

![](https://i.imgur.com/pu8QZ3m.png[/img])

### **Step 4.7 – Navigate to Milestones**

1.  In the runtime environment, click **Milestone**

![](https://i.imgur.com/zLnAiV6.png[/img])

2.  In the developer toolbar, click **Edit Page 6**

![](https://i.imgur.com/71NFdPc.png[/img])

### **Step 4.8 – Update Project ID Column**

1.  In Page Designer, under Milestones, click **Columns**
1. Click **PROJECT_ID**

![](https://i.imgur.com/hyzTFq6.png[/img])

### **Step 4.8b – Update Project ID Column**

1.  In the Property Editor, update the following:

   - Identification: Type – select **Select List**

   - Heading: Heading – enter **Project**

   - List of Values: Type – select **SQL Query**

   - List of Values – SQL Query enter **select name d, id r from hol_projects order by 1**
    - Display Extra Values – click **No**
   - Display Null Value – click **No**
2. Save and Run the App

![](https://i.imgur.com/fcUYtLE.png[/img])

### **Step 4.9 – Hide Columns**

1.  In the runtime environment, click **Actions**, select **Columns**
1. Uncheck Displayed for **Id, Row Version, Created, Created By,
Updated**, and **Updated By**
1. Click **Save**

![](https://i.imgur.com/pAqSeax.png[/img])

### **Step 4.10 – Save the Report**

1.  In the runtime environment, click **Actions**, select **Report**,
select **Save**

![](https://i.imgur.com/xvAVJPG.png[/img])

## **Learn More** *Useful Links*

- **APEX on Autonomous** https://apex.oracle.com/autonomous
- **APEX Collateral** https://apex.oracle.com
- **Tutorials** https://apex.oracle.com/en/learn/tutorials
- **Community** https://apex.oracle.com/community
- **External Site + Slack** http://apex.world

repository: jdavies/learning-library

repo_name: jdavies/learning-library


text:
# MNIST Classification

| ML.NET version | API type          | Status                        | App Type    | Data type | Scenario            | ML Task                   | Algorithms                  |
|----------------|-------------------|-------------------------------|-------------|-----------|---------------------|---------------------------|-----------------------------|
| v1.3.1           | Dynamic API | Up-to-date | Console app | .csv files | MNIST classification | Multi-class classification | Sdca Multi-class |

In this introductory sample, you'll see how to use [ML.NET](https://www.microsoft.com/net/learn/apps/machine-learning-and-ai/ml-dotnet) to classify handwritten digits from 0 to 9 using the MNIST dataset. This is a **multiclass classification** problem that we will solve using SDCA (Stochastic Dual Coordinate Ascent) algorithm.

## Problem

The MNIST data set contains handwritten images of digits, ranging from 0 to 9.

The MNIST dataset we are using contains 65 columns of numbers. The first 64 columns in each row are integer values in the range from 0 to 16. These values are calculated by dividing 32 x 32 bitmaps into non-overlapping blocks of 4 x 4. The number of ON pixels is counted in each of these blocks, which generates an input matrix of 8 x 8. The last column in each row is the number that is represented by the values in the first 64 columns. These first 64 columns are our features and our ML model will use these features to classifiy the testing images. The last column in our training and validation datasets is the label - the actual number that we will predict using our ML model.

the ML model that we will build will return probabilities for a given image of being one of the numbers from 0 to 9 as explained above.

## ML task - Multiclass classification
The generalized problem of **multiclass classification** is to classify items into one of three or more classes. (Classifying items into one of the two classes is called **binary classification**).

## Solution
To solve this problem, first we will build an ML model. Then we will train the model on existing data, evaluate how good it is, and lastly we'll consume the model to predict a number the given image represents.

![Build -> Train -> Evaluate -> Consume](../shared_content/modelpipeline.png)

### 1. Build model

Building a model includes:
* Uploading data (`optdigits-train.csv`) with (`DataReader`)
* Create an Estimator and transform the data in the first 64 columns to one column so it can be used effectively by an ML algorithm (with `Concatenate`)
* Choosing a learning algorithm (`StochasticDualCoordinateAscent`).

The initial code is similar to the following:
```fsharp
// STEP 1: Common data loading configuration
let trainData = mlContext.Data.LoadFromTextFile<Input>(trainDataPath, separatorChar=',', hasHeader=false)
let testData = mlContext.Data.LoadFromTextFile<Input>(testDataPath, separatorChar=',', hasHeader=false)

// STEP 2: Common data process configuration with pipeline data transformations
// Use in-memory cache for small/medium datasets to lower training time. Do NOT use it (remove .AppendCacheCheckpoint()) when handling very large datasets.
let dataProcessPipeline =
    EstimatorChain()
        .Append(mlContext.Transforms.Conversion.MapValueToKey("Label", "Number"))
        .Append(mlContext.Transforms.Concatenate("Features", "PixelValues"))
        .AppendCacheCheckpoint(mlContext)

// STEP 3: Set the training algorithm, then create and config the modelBuilder
let trainer = mlContext.MulticlassClassification.Trainers.SdcaMaximumEntropy("Label", "Features")
let trainingPipeline =
    dataProcessPipeline
        .Append(trainer)
        .Append(mlContext.Transforms.Conversion.MapKeyToValue("Number", "Label"))
```

### 2. Train model
Training the model is a process of running the chosen algorithm on a training data to tune the parameters of the model. Our training data consists of pixel values and the digit they represent. It is implemented in the `Fit()` method from the Estimator object.

To perform training we just call the method providing the training dataset (optdigits-train.csv file) in a DataView object.

```fsharp
// STEP 4: Train the model fitting to the DataSet
printfn "=============== Training the model ==============="
let trainedModel = trainingPipeline.Fit(trainData)
```
### 3. Evaluate model
We need this step to conclude how accurate our model operates on new data. To do so, the model from the previous step is run against another dataset that was not used in training (`optdigits-val.csv`). `MulticlassClassification.Evaluate` calculates the difference between known types and values predicted by the model in various metrics.

```fsharp
let predictions = trainedModel.Transform(testData)
let metrics = mlContext.MulticlassClassification.Evaluate(predictions, "Number", "Score")

Common.ConsoleHelper.printMultiClassClassificationMetrics (trainer.ToString()) metrics
```

>*To learn more on how to understand the metrics, check out the Machine Learning glossary from the [ML.NET Guide](https://docs.microsoft.com/en-us/dotnet/machine-learning/) or use any available materials on data science and machine learning*.

If you are not satisfied with the quality of the model, there are a variety of ways to improve it, which will be covered in the *examples* category.

### 4. Consume model
After the model is trained, we can use the `Predict()` API to predict the probability of being correct digit.

```fsharp
let loadedTrainedModel, modelInputSchema = mlContext.Model.Load modelPath

// Create prediction engine related to the loaded trained model
let predEngine = mlContext.Model.CreatePredictionEngine<Input, Output>(loadedTrainedModel)

sampleData
|> Array.iter
    (fun (n,dat) ->
        let p = predEngine.Predict dat
        printfn "Actual: %d     Predicted probability:       zero:  %.4f" n p.Score.[0]
        ["one:"; "two:"; "three:"; "four:"; "five:"; "six:"; "seven:"; "eight:"; "nine:"]
        |> List.iteri
            (fun i w ->
                let i = i + 1
                printfn "                                           %-6s %.4f" w p.Score.[i]
            )
        printfn ""
    )
```

Where `sampleData` stores the pixel values of the digit that want to predict using the ML model.

```fsharp
let sampleData =
    [|
        7, {
            Number = 0.f
            PixelValues = [|0.f;0.f;0.f;0.f;14.f;13.f;1.f;0.f;0.f;0.f;0.f;5.f;16.f;16.f;2.f;0.f;0.f;0.f;0.f;14.f;16.f;12.f;0.f;0.f;0.f;1.f;10.f;16.f;16.f;12.f;0.f;0.f;0.f;3.f;12.f;14.f;16.f;9.f;0.f;0.f;0.f;0.f;0.f;5.f;16.f;15.f;0.f;0.f;0.f;0.f;0.f;4.f;16.f;14.f;0.f;0.f;0.f;0.f;0.f;1.f;13.f;16.f;1.f;0.f|]
        }
		//...
	|]
```

repository: dotnet/machinelearning-samples

gha_language: PowerShell

repo_name: dotnet/machinelearning-samples


text:
go-cron
=========

Simple golang wrapper over `github.com/robfig/cron` and `os/exec` as a cron replacement

## usage

`go-cron "* * * * * *" /bin/bash -c "echo 1"`

repository: codeskyblue/go-cron

repo_name: codeskyblue/go-cron


text:
# The Meteor Chef - Base (@<IP_ADDRESS>)
A starting point for Meteor apps.

Base is the lazy person's starter kit for Meteor. It includes some commonly used packages (biased to The Meteor Chef) and code for common functionality. This is the starter kit for all Meteor Chef recipes.

For more detail on updates, [read the Changelog](https://github.com/themeteorchef/base/wiki/Changelog). If you're interested in contributing to Base, checkout the [Contribution wiki](https://github.com/themeteorchef/base/wiki/Contributing-to-Base) to get started.

### Packages Included
- Accounts (Base) - `meteor add accounts-base`
- Accounts (Password) - `meteor add accounts-password`
- Audit Argument Checks - `meteor add audit-argument-checks`
- Bert - `meteor add themeteorchef:bert`
- Bootstrap 3 - `meteor add twbs:bootstrap`
- Browser Policy - `meteor add browser-policy`
- Check - `meteor add check`
- Iron Router - `meteor add iron:router`
- jQuery - `meteor add jquery`
- jQuery Validation - `meteor add themeteorchef:jquery-validation`
- NPM - `meteor add meteorhacks:npm`
- Sass - `meteor add fourseven:scss`
- SSR - `meteor add meteorhacks:ssr`
- Underscore - `meteor add underscore`

**Note:** Base also supports loading NPM packages using the `meteorhacks:npm` package. To load NPM packages, add name and version information to `/packages.json` and inside of your file (server only), load the package with `var package = Meteor.npmRequire('package-name');`. For more information, see the [meteorhacks:npm documentation](https://github.com/meteorhacks/npm/).

### File Structure
Base comes with a pre-defined file structure common to all projects along with some skeleton files for getting started quickly. Here's what it looks like:

```
/root
---/.meteor
---/client
------/controllers
---------/authenticated
------------header.js
---------/public
------------login.js
------------recover-password.js
------------reset-password.js
------------signup.js
------/helpers
---------helpers-ui.js
------/includes
---------_header.html
------/layouts
---------layout-default.html
------/routes
---------hooks.js
---------routes-authenticated.js
---------routes-global.js
---------routes-public.js
------/stylesheets
---------/sass
------------/globals
---------------_extends.scss
------------/views
---------------/public
------------------_login.scss
---------application.scss
-------/views
---------/authenticated
------------index.html
---------/public
------------loading.html
------------login.html
------------not-found.html
------------recover-password.html
------------reset-password.html
------------signup.html
---/collections
------example.js
------users.js
---/packages
------ (See List Above)
---/public
------/images
---/server
------/admin
---------/startup-functions
------------browser-policies.js
------------test-accounts.js
---------startup.js
------/email
---------/templates
------------reset-password.js
------/methods
---------/insert
------------example.js
---------/read
------------example.js
---------/remove
------------example.js
---------/update
------------example.js
---------/utility
------------example.js
------/publications
---------example.js
---.editorconfig
---.gitignore
---application.html
---package.json
---packages.json
---README.MD (this file)
---settings-development.json
---settings-production.json
---smart.json (added by Meteor)
---smart.lock (added by Meteor)
```

### JavaScript & CSS
Prior to v2.0.0, Base was written in CoffeeScript. At the request of the community, Base was ported _back_ to native JavaScript.

CSS in Base is written using [Sass](http://sass-lang.com).

### Functionality

###### Configuration
Base includes a pattern for managing your API keys, connection strings, and other configuration information using two files: `settings-development.json` and `settings-production.json`. This pattern separates your development and production configuration into two separate files for the sake of security.

Per [Josh Owens' article](http://joshowens.me/environment-settings-and-security-with-meteor-js/), it's considered "bad practice" to check your production keys into your repo (private or otherwise). Base accounts for this by giving you two separate files, but also specifies that your `settings-production.json` file should be ignored by git in `.gitignore`.

This means that keys that are only used for testing or development purposes can be placed in `settings-development.json`, while keys used in your production application should be placed in `settings-production.json`. Sharing and management of `settings-production.json` should be done on a person-to-person basis and _not_ made globally accessible.

###### Startup & Deployment
A tip picked up from [Gerard Sychay at Differential](http://blog.differential.com/use-package-json-in-your-meteor-app-for-fun-profit/), Base makes use of the NPM `package.json` convention to make startup and deployment super easy. Within `package.json`, three scripts have been defined for you:

1. `npm start` - Starts your Meteor server locally with `settings-development.json` in tow. Equivalent to typing out `meteor --settings settings-development.json`.
2. `npm staging` - Deploys your Meteor app to a [Modulus](http://modulus.io) server defined as your "Staging" environment. This requires you to have a Modulus account set up and a server titled "Staging" set up. You can customize this to match your own naming conventions. This also automatically sets your `METEOR_SETTINGS` environment variable on Modulus equal to the contents of your `settings-development.json` file so you don't have to do it by hand.
3. `npm production` - Deploys your Meteor app to a [Modulus](http://modulus.io) server defined as your "Production" environment. This requires you to have a Modulus account set up and a server titled "Production" set up. You can customize this to match your own naming conventions. This also automatically sets your `METEOR_SETTINGS` environment variable on Modulus equal to the contents of your `settings-production.json` file so you don't have to do it by hand.

###### Bootstrap (@3.2.1)
Base makes use of the [Bootstrap](http://getbootstrap.com) front-end Framework. It may not be your bag of chips and is *definitely not required*. If you want to swap it out, you'll need to unhook the markup in each of the included template files in `/client/views` and uninstall the `twbs:bootstrap` package by running `meteor remove twbs:bootstrap` in your terminal.

In respect to UI, Base uses Bootstrap's `.navbar` element, as well as its `.container` and a few `.row`/`.col-<size>-<columns>` wrappers. You'll also find the `.btn` class and its modifiers (`.success, .warning, etc.`) in use throughout the app. All of these implementations are merely presentational and can be changed (or removed) as you see fit.

###### Basic Routing
Base comes with a collection of pre-defined routes and templates for common functionality. Base also includes a set of common route filters for managing user access. Routes bundled include:

```
- / (Authenticated)
- /login (Public)
- /recover-password (Public)
- /reset-password (Public)
- /signup (Public)
```

A UI helper called `currentRoute` has been added to Base which allows you to add an `active` class to menu items in your navigation to reflect the user's current location.

A collection of hooks has also been added to Base to control route access based on different conditions (e.g. whether a user is logged in or not).

###### Authentication
Base includes a complete authentication pattern complete with:

- Login (at /login)
- Logout (no path, implemented as a dropdown item/click event in /client/controllers/header.js)
- Password Recovery (at /recover-password and /reset-password)
- Signup (at /signup)

###### Example Collection/Publication/Subscription
Base includes a collection called `Example`, along with a publication and subscription pattern to show moving data from the server to the client. Publications are defined in `/server/publications/example.js` and a subscription is demonstrated on the `index` route in `/client/routes/routes-authenticated.js`.

###### Validation
Base includes support for client-side validation via [jQuery Validation](http://jqueryvalidation.org). Validation is provided for all public templates: login, signup, recover password, and reset password.

###### Alerts
Base includes support for fixed bar (top and bottom) and growl-style alerts on the client via [`themeteorchef:bert`](https://atmospherejs.com/themeteorchef/bert).

###### Automatic Admin User Creation
When developing, having a handful of user accounts to test your application with can come in handy. Base comes with an automated account generation script located in `server/admin/startup.js` that creates accounts based on an array of specified users. **Note: by default this creates one Admin user on server startup, so make sure to customize or remove this user so the public can't access your app**.


text:
# gotty-client
:wrench: Terminal client for [GoTTY](https://github.com/yudai/gotty).

![](https://raw.githubusercontent.com/moul/gotty-client/master/resources/gotty-client.png)

[![Build Status](https://travis-ci.org/moul/gotty-client.svg?branch=master)](https://travis-ci.org/moul/gotty-client)
[![GoDoc](https://godoc.org/github.com/moul/gotty-client?status.svg)](https://godoc.org/github.com/moul/gotty-client)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmoul%2Fgotty-client.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmoul%2Fgotty-client?ref=badge_shield)

```ruby
                                                             ┌─────────────────┐
                                                     ┌──────▶│    /bin/bash    │
                                                     │       └─────────────────┘
                ┌──────────────┐               ┌──────────┐
                │              │               │  Gotty   │
┌───────┐   ┌──▶│   Browser    │───────┐       │          │
│       │   │   │              │       │       │          │
│       │   │   └──────────────┘       │       │          │  ┌─────────────────┐
│  Bob  │───┤                      websockets─▶│          │─▶│ emacs /var/www  │
│       │   │   ╔═ ══ ══ ══ ══ ╗       │       │          │  └─────────────────┘
│       │   │   ║              ║       │       │          │
└───────┘   └──▶║ gotty-client  ───────┘       │          │
                               ║               │          │
                ╚═ ══ ══ ══ ══ ╝               └──────────┘
                                                     │       ┌─────────────────┐
                                                     └──────▶│   tmux attach   │
                                                             └─────────────────┘
```

## Example

Server side ([GoTTY](https://github.com/yudai/gotty))

```console
$ gotty -p 9191 sh -c 'while true; do date; sleep 1; done'
2015/08/24 18:54:31 Server is starting with command: sh -c while true; do date; sleep 1; done
2015/08/24 18:54:31 URL: http://[::1]:9191/
2015/08/24 18:54:34 GET /ws
2015/08/24 18:54:34 New client connected: <IP_ADDRESS>:61811
2015/08/24 18:54:34 Command is running for client <IP_ADDRESS>:61811 with PID 64834
2015/08/24 18:54:39 Command exited for: <IP_ADDRESS>:61811
2015/08/24 18:54:39 Connection closed: <IP_ADDRESS>:61811
...
```

**Client side**

```console
$ gotty-client http://localhost:9191/
INFO[0000] New title: GoTTY - sh -c while true; do date; sleep 1; done (jean-michel-van-damme.local)
WARN[0000] Unhandled protocol message: json pref: 2{}
Mon Aug 24 18:54:34 CEST 2015
Mon Aug 24 18:54:35 CEST 2015
Mon Aug 24 18:54:36 CEST 2015
Mon Aug 24 18:54:37 CEST 2015
Mon Aug 24 18:54:38 CEST 2015
^C
```

## Usage

```console
$ gotty-client -h
NAME:
   gotty-client - GoTTY client for your terminal

USAGE:
   gotty-client [global options] command [command options] GOTTY_URL

AUTHOR:
   Manfred Touron <https://github.com/moul/gotty-client>

COMMANDS:
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --debug, -D                  Enable debug mode [$GOTTY_CLIENT_DEBUG]
   --skip-tls-verify            Skip TLS verify [$SKIP_TLS_VERIFY]
   --use-proxy-from-env         Use Proxy from environment [$USE_PROXY_FROM_ENV]
   --detach-keys value          Key sequence for detaching gotty-client (default: "ctrl-p,ctrl-q")
   --v2                         For Gotty 2.0 [$GOTTY_CLIENT_GOTTY2]
   --ws-origin value, -w value  WebSocket Origin URL [$GOTTY_CLIENT_WS_ORIGIN]
   --help, -h                   show help
   --version, -v                print the version
```

## Install

Install latest version using Golang (recommended)

```console
$ go get github.com/moul/gotty-client/cmd/gotty-client
```

---

Install latest version using Homebrew (Mac OS X)

```console
$ brew install https://raw.githubusercontent.com/moul/gotty-client/master/contrib/homebrew/gotty-client.rb --HEAD
```

or the latest released version

```console
$ brew install https://raw.githubusercontent.com/moul/gotty-client/master/contrib/homebrew/gotty-client.rb
```

## Changelog

### master (unreleased)

* Fix TTY restoring by switching to [`github.com/moby/moby/pkg/term`](https://github.com/moby/moby/tree/master/pkg/term) ([#59](https://github.com/moul/gotty-client/pull/59) + ([#60](https://github.com/moul/gotty-client/pull/60) + ([#62](https://github.com/moul/gotty-client/pull/62) ([@Sh4d1](https://github.com/Sh4d1))

[full commits list](https://github.com/moul/gotty-client/compare/v1.7.0...master)

### [v1.7.0](https://github.com/moul/gotty-client/releases/tag/v1.7.0) (2018-04-11)

* Add `--detach-keys` option ([#52](https://github.com/moul/gotty-client/issues/52))
* Cross build on Solaris ([#55](https://github.com/moul/gotty-client/pull/55) ([@dimtion](https://github.com/dimtion))
* Fix terminal resizing issue ([#56](https://github.com/moul/gotty-client/pull/56) ([@byung2](https://github.com/byung2))
* Support for gotty v2.0 ([#58](https://github.com/moul/gotty-client/pull/58) ([@byung2](https://github.com/byung2))
* Support ws-origin (CORS) ([#58](https://github.com/moul/gotty-client/pull/58) ([@byung2](https://github.com/byung2))

[full commits list](https://github.com/moul/gotty-client/compare/v1.6.1...v1.7.0)

### [v1.6.1](https://github.com/moul/gotty-client/releases/tag/v1.6.1) (2017-01-19)

* Do not exit on EOF ([#45](https://github.com/moul/gotty-client/pull/45)) ([@gurjeet](https://github.com/gurjeet))

[full commits list](https://github.com/moul/gotty-client/compare/v1.6.0...v1.6.1)

### [v1.6.0](https://github.com/moul/gotty-client/releases/tag/v1.6.0) (2016-05-23)

* Support of `--use-proxy-from-env` (Add Proxy support) ([#36](https://github.com/moul/gotty-client/pull/36)) ([@byung2](https://github.com/byung2))
* Add debug mode ([#18](https://github.com/moul/gotty-client/issues/18))
* Fix argument passing ([#16](https://github.com/moul/gotty-client/issues/16))
* Remove warnings + golang fixes and refactoring ([@QuentinPerez](https://github.com/QuentinPerez))

[full commits list](https://github.com/moul/gotty-client/compare/v1.5.0...v1.6.0)

### [v1.5.0](https://github.com/moul/gotty-client/releases/tag/v1.5.0) (2016-02-18)

* Add autocomplete support ([#19](https://github.com/moul/gotty-client/issues/19))
* Switch from `Party` to `Godep`
* Fix terminal data being interpreted as format string ([#34](https://github.com/moul/gotty-client/pull/34)) ([@mickael9](https://github.com/mickael9))

[full commits list](https://github.com/moul/gotty-client/compare/v1.4.0...v1.5.0)

### [v1.4.0](https://github.com/moul/gotty-client/releases/tag/v1.4.0) (2015-12-09)

* Remove solaris,plan9,nacl for `.goxc.json`
* Add an error if the go version is lower than 1.5
* Flexible parsing of the input URL
* Add tests
* Support of `--skip-tls-verify`

[full commits list](https://github.com/moul/gotty-client/compare/v1.3.0...v1.4.0)

### [v1.3.0](https://github.com/moul/gotty-client/releases/tag/v1.3.0) (2015-10-27)

* Fix `connected` state when using `Connect()` + `Loop()` methods
* Add `ExitLoop` which allow to exit from `Loop` function

[full commits list](https://github.com/moul/gotty-client/compare/v1.2.0...v1.3.0)

### [v1.2.0](https://github.com/moul/gotty-client/releases/tag/v1.2.0) (2015-10-23)

* Removed an annoying warning when exiting connection ([#22](https://github.com/moul/gotty-client/issues/22)) ([@QuentinPerez](https://github.com/QuentinPerez))
* Add the ability to configure alternative stdout ([#21](https://github.com/moul/gotty-client/issues/21)) ([@QuentinPerez](https://github.com/QuentinPerez))
* Refactored the goroutine system with select, improve speed and stability ([@QuentinPerez](https://github.com/QuentinPerez))
* Add debug mode (`--debug`/`-D`) ([#18](https://github.com/moul/gotty-client/issues/18))
* Improve error message when connecting by checking HTTP status code
* Fix arguments passing ([#16](https://github.com/moul/gotty-client/issues/16))
* Dropped support for golang<1.5
* Small fixes

[full commits list](https://github.com/moul/gotty-client/compare/v1.1.0...v1.2.0)

### [v1.1.0](https://github.com/moul/gotty-client/releases/tag/v1.1.0) (2015-10-10)

* Handling arguments + using mutexes (thanks to [@QuentinPerez](https://github.com/QuentinPerez))
* Add logo ([#9](https://github.com/moul/gotty-client/issues/9))
* Using codegansta/cli for CLI parsing ([#3](https://github.com/moul/gotty-client/issues/3))
* Fix panic when running on older GoTTY server ([#13](https://github.com/moul/gotty-client/issues/13))
* Add 'homebrew support' ([#1](https://github.com/moul/gotty-client/issues/1))
* Add Changelog ([#5](https://github.com/moul/gotty-client/issues/5))
* Add GOXC configuration to build binaries for multiple architectures ([#2](https://github.com/moul/gotty-client/issues/2))

[full commits list](https://github.com/moul/gotty-client/compare/v1.0.1...v1.1.0)

### [v1.0.1](https://github.com/moul/gotty-client/releases/tag/v1.0.1) (2015-09-27)

* Using party to manage dependencies

[full commits list](https://github.com/moul/gotty-client/compare/v1.0.0...v1.0.1)

### [v1.0.0](https://github.com/moul/gotty-client/releases/tag/v1.0.0) (2015-09-27)

Compatible with [GoTTY](https://github.com/yudai/gotty) version: [v0.0.10](https://github.com/yudai/gotty/releases/tag/v0.0.10)

#### Features

* Support **basic-auth**
* Support **terminal-(re)size**
* Support **write**
* Support **title**
* Support **custom URI**

[full commits list](https://github.com/moul/gotty-client/compare/cf0c1146c7ce20fe0bd65764c13253bc575cd43a...v1.0.0)

## License

MIT

[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmoul%2Fgotty-client.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmoul%2Fgotty-client?ref=badge_large)

repository: linuxkit/linuxkit

gha_language: Go

repo_name: linuxkit/linuxkit


text:
# intranet

API using Graph Data Structure

# Repo Setup

- Install `Node v12.9.1` in your linux.
- Run `npm install` in your terminal after going to the repo directory
- Run `npm start` in your terminal and visit `http://localhost:8080/`
- You will recieve a status of 200 and message 'I am alive'
- Run `npm test` in your terminal and check logs -> this will trigger the unit test cases

repository: thalaivar-subu/intranet

repo_name: thalaivar-subu/intranet


text:
# Django Employee Management

This is an employee management project built using Python (Django) and JS.

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install the dependencies. Please test in a virtual environment. You will be needing the 'credentials.py' file for the database.

```bash
pip install -r requirements.txt
```

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


text:
# Octozen, powered by Waypoint

## About

[Waypoint](waypointproject.io) is a new project by HashiCorp that "provides a modern workflow to build, deploy, and release across platforms".

This is a test of [Waypoint's integration with GitHub Actions](https://www.waypointproject.io/docs/automating-execution/github-actions), deploying a [static website](site) to an Azure Container Instance.

Note: as of the time of writing this, an [open bug](https://github.com/hashicorp/action-setup-waypoint/issues/31) prevents using `hashicorp/action-setup-waypoint`, so a personal fork is [being used](.github/workflows/deploy.yml).

## Setup

First, set up an Actions [self hosted runner](https://docs.github.com/en/free-pro-team@latest/actions/hosting-your-own-runners/about-self-hosted-runners) and start it up. It must be network accessible to the Waypoint server configured in the next step.

Set up Waypoint:
```
brew tap hashicorp/tap
brew install hashicorp/tap/waypoint
```

and then start the server:
```
docker pull hashicorp/waypoint:latest
waypoint install --platform=docker -accept-tos
```

The "HTTP UI Address" should be copied over to `deploy.yml` as the `WAYPOINT_SERVER_ADDR` environment variable.

With your Azure account handy, follow these instructions to [create an Azure Container Registry](https://learn.hashicorp.com/tutorials/waypoint/azure-container-instance?in=waypoint/deploy-azure). The [environment variables](https://learn.hashicorp.com/tutorials/waypoint/azure-container-instance?in=waypoint/deploy-azure#set-environment-variables) listed in the next step need to be set as [encrypted repository secrets](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets):
* `AZURE_SUBSCRIPTION_ID`
* `REGISTRY_USERNAME`
* `REGISTRY_PASSWORD`

Ready to go! 🚀

## Usage

The [Deploy](.github/workflows/deploy.yml) workflow will trigger on every push to master, performing a `waypoint init` and `waypoint up`.

A separate [Clean](.github/workflow/clean.yml) workflow is provided to tear down resources upon manual trigger.

## License

[MIT](LICENSE)

## Further reading

- https://www.waypointproject.io/docs/getting-started
- https://learn.hashicorp.com/tutorials/waypoint/azure-container-instance?in=waypoint/deploy-azure
- https://docs.github.com/en/free-pro-team@latest/actions

repository: imjohnbo/octozen-waypoint

repo_name: imjohnbo/octozen-waypoint