text:
# Using Constraint Programming and Graph Representation Learning for Generating Interpretable Cloud Security Policies

```
@inproceedings{iamax_ijcai22,
title = {Using Constraint Programming and Graph Representation Learning for Generating Interpretable Cloud Security Policies},
author = {Kazdagli, Mikhail and Tiwari, Mohit and Kumar, Akshat},
booktitle = {Proceedings of the Thirty-First International Joint Conference on Artificial Intelligence (IJCAI)},
pages = {1850--1858},
year = {2022}
}
```

links
- [ijcai](https://www.ijcai.org/Proceedings/2022/257)
- [arxiv](https://arxiv.org/abs/2205.01240)

gha_language: Jupyter Notebook


text:
---
layout: post
title:      "Determination to change career path"
date:       2020-10-17 02:52:19 +0000
permalink:  determination_to_change_career_path
---

I just finished a 15 months Bootcamp in Data Science with Flatiron School.

Prior to that, I have been working at NIH, Bethesda, Maryland since 2002. I have started at an entry level working in the maintenance Department.  After showing some interest on what the laboratory was doing, I was able to move up the ladder fairly quick. Since 2013, I have bounced from one leadership position to another leadership position.

During the course of my career, I have collected and analyzed data for the veterinarians and the investigators producing insightful, data-driven strategic recommendations.

During the 15 months Bootcamp in Data Science with Flatiron School, I have successfully conducted 5 projects in data analysis, predictive modeling techniques with a high degree of accuracy.

I am well versed in a wide variety of software and data management systems ranging from traditional options like Excel and MySQL to newer system like Tableau. I also have a working knowledge of core programming skills using Python or R.

I'm eager to turn my talent for analyzing big data into high productivity for any company that will be willing to hire me. I will also use my knowledge and capability to identify key data patterns and develop predictive models to help that company achieves its strategic and operational goals.
.

branch_name: refs/heads/master

extension: markdown

license_type: permissive


text:
# AhoCorasick

[![Version](https://img.shields.io/nuget/v/AhoCorasick.svg)](https://www.nuget.org/packages/AhoCorasick)
[![Build status](https://ci.appveyor.com/api/projects/status/b8lxercfn9spio95/branch/master?svg=true)](https://ci.appveyor.com/project/mganss/ahocorasick/branch/master)
[![Coverage Status](https://coveralls.io/repos/mganss/AhoCorasick/badge.svg?branch=master&service=github)](https://coveralls.io/github/mganss/AhoCorasick?branch=master)
[![netstandard2.0](https://img.shields.io/badge/netstandard-2.0-brightgreen.svg)](https://img.shields.io/badge/netstandard-2.0-brightgreen.svg)
[![net40](https://img.shields.io/badge/net-40-brightgreen.svg)](https://img.shields.io/badge/net-40-brightgreen.svg)

This is an implementation of the [Aho-Corasick](https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_string_matching_algorithm) string matching algorithm for .NET (netstandard2.0 and net40) and SQL Server (SQL CLR). Mostly ported from [xudejian/aho-corasick](https://github.com/xudejian/aho-corasick) in CoffeeScript.

## Usage

```C#
var ac = new AhoCorasick("a", "ab", "bab", "bc", "bca", "c", "caa");
var results = ac.Search("abccab").ToList();

Assert.AreEqual(0, results[0].Index); // index into the searched text
Assert.AreEqual("a", results[0].Word); // matched word
// ...
```

or

```C#
var results = "abccab".Contains("a", "ab", "bab", "bc", "bca", "c", "caa").ToList();
```

### Custom char comparison

You can optionally supply an `IEqualityComparer<char>` to perform custom char comparisons when searching for substrings. Several implementations with comparers that mirror `StringComparer` are included.

```C#
var results = "AbCcab".Contains(CharComparer.OrdinalIgnoreCase, "a", "ab", "c").ToList();
```

## SQL CLR Functions

There are also several SQL CLR user defined functions that can be used to perform fast substring matching
in Microsoft SQL Server. To use this:

1. Make sure you have [enabled CLR integration](https://msdn.microsoft.com/en-us/library/ms131048.aspx)
2. Execute [AhoCorasick.SqlClr_Create.sql](AhoCorasick.SqlClr/dist/AhoCorasick.SqlClr_Create.sql)

For one-off queries, you can use the functions that rebuild the trie on each query, e.g.

```SQL
select top(100) * from Posts P
where dbo.ContainsWords((select Word from Words for xml raw, root('root')), P.Body, 'o') = 1
```

The words to match are always supplied as XML where the values are taken from the first attribute of all elements directly beneath the root node. Be careful to select the word column as the only or first column otherwise you'll end up matching the wrong words. The XML in the example above looks like this:

```XML
<root>
  <row Word="Aachen" />
  <row Word="Aaliyah" />
  <row Word="aardvark" />
  ...
</root>
```

[Here's more](https://www.simple-talk.com/sql/learn-sql-server/using-the-for-xml-clause-to-return-query-results-as-xml/) about FOR XML.

The last parameter in the function indicates the culture to use since there is no way to use SQL Server collations in SQL CLR code. Values can be:

|Value|Character comparison|
|-----|--------------------|
|c|Current Culture|
|n|Invariant Culture|
|o or Empty|Ordinal|
|Culture name, e.g. "de-de"|Specific [.NET Culture](https://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.name.aspx)|

The culture identifier can be suffixed by `:i` indicating case-insensitive matching.

### Static objects

The function in the example above has the problem that the trie is rebuilt for each query even though the input always stays the same. To overcome this problem, there are a number of functions to manage the creation and destruction of static objects whose handles can be saved in SQL variables. Example:

```SQL
declare @ac nvarchar(32);
set @ac = dbo.CreateAhoCorasick((select Word from Words for xml raw, root('root')), 'en-us:i');
select * from Posts P
where dbo.ContainsWordsByObject(P.Body, @ac) = 1;
```

This is a lot faster than the first example because the trie is created only once and then reused for each row in the query. The handle (@ac) is a hash value generated from the words to match and the culture. The corresponding object is saved in a static dictionary. You can list the currently active objects using `dbo.ListAhoCorasick()`, remove all objects using `dbo.ClearAhoCorasick()` or remove only one object using `dbo.DeleteAhoCorasick(@ac)`.

### Getting all matches

The examples above only checked if the words occurred in the queried texts. If you want to get the matched words and the indexes where they occur in the queried texts you can use the supplied table-valued functions. For example:

```SQL
declare @ac nvarchar(32);
set @ac = dbo.CreateAhoCorasick((select Word from Words for xml raw, root('root')), 'o');
select top(100) * from Posts P
cross apply dbo.ContainsWordsTableByObject(P.Body, @ac) W
```

This will return a table such as this:

|ID   |Body   |Index   |Word   |
|---|---|---|---|
|1 |What factors related...|5|factor|
|1 |What factors related...|6|actor|
|1 |What factors related...|5|factors|
|...|

### Word boundaries

There are also functions that return only matches occuring at word boundaries: `dbo.ContainsWordsBoundedByObject()` and `dbo.ContainsWordsBoundedTableByObject()`. Word boundaries here are the same as [`\b` in regexes](http://www.regular-expressions.info/wordboundaries.html), i.e. matches will occur as if words were specified as `\bword\b`.

### Forcing parallelism

Although these kinds of queries lend themselves very well to parallel execution, SQL Server tends to overestimate the cost of parallel queries and builds non-parallel plans most of the time where user defined functions are involved. You can force a parallel plan by using a trace flag (more about this [here](http://sqlblog.com/blogs/paul_white/archive/2011/12/23/forcing-a-parallel-query-execution-plan.aspx)):

```SQL
declare @ac nvarchar(32);
set @ac = dbo.CreateAhoCorasick((select Word from Words for xml raw, root('root')), 'en-us:i');
select * from Posts P
where dbo.ContainsWordsBoundedByObject(P.Body, @ac) = 1
OPTION (RECOMPILE, QUERYTRACEON 8649)
```

Parallel operators are identified by a yellow badge with two arrows in the query plan.

### Performance

Here's a benchmark searching for ~5000 words (average length 7) in ~250,000 texts (average length ~900):

|SQL|AhoCorasick|
|---|-----------|
|560s|7s|

The SQL query used was this:

```SQL
select * from Posts P
where exists (select * from Words W where CHARINDEX(W.Word, P.Text) > 0)
```

#### But I can simply use full-text search

No. The [CONTAINS](https://msdn.microsoft.com/en-us/library/ms187787.aspx) predicate can only search for a single literal or variable at a time. You can't use it in a join or subquery to search for a column value of a table in the query, i.e. this won't work:

```SQL
select * from Posts P
where exists (select * from Words W where CONTAINS(P.Text, W.Word))
```

If you know of a way to make this work using FTS (perhaps using a cursor?) let me know.

license: MIT

repository: mganss/AhoCorasick

extension: md

gha_language: C#

gha_license_id: MIT

repo_name: mganss/AhoCorasick


text:
These samples are provided for reference purposes on an "as is" basis, and are without warranties of any kind.

It is strongly advised that these samples are not run against production systems.

Any issues discovered using the samples should not be directed to QRadar support, but be reported on the Github issues tracker.

# Introductory Samples

Scripts in this directory serve as an introduction to using the API.
Basics such as how to authenticate with the system, how to
pass various types of parameters, and an introduction to the
types of errors you might encounter are covered here.
These samples use `reference_data` endpoints to demonstrate
this functionality.

For a list of the endpoints that you can use along with the parameters
they accept you can view the REST API interactive help page at
`https://<hostname>/api_doc`
You can also retrieve a list of available endpoints through the api itself
at the `/api/help/endpoints` endpoint.

The scripts in this directory include:

### 01_Authentication.py
This sample demonstrates how to encode credentials, how to format and
attach headers to an HTTP request, and how to send a simple request
to a REST API endpoint.

### 02_QueryParameters.py
This sample demonstrates how to use query parameters with a REST API
endpoint.

### 03_PathParameters.py
This sample shows how to use path parameters with the REST API.

### 04_BodyParameters.py
This sample demonstrates how to send a parameter in the body of a
request.

### 05_Errors.py
This sample demonstrates some common errors that can be made while
using the REST API. It shows the information that is returned with
an error response to help you diagnose the problem.

### 06_CommonParameters.py
In this sample you will see how to limit the data returned by an endpoint
using some shared parameters. The `filter` query parameter can be used to
restrict the elements returned in a list based on the contents of the fields
being returned. The `Range` header parameter can be used to page the elements
of a list by specifying the start and end values of the range you want. the
`fields` query parameter is used to specify the fields in the return object
you are interested in. Only those fields will be returned in the response.
This sample uses the `reference_data/sets` endpoints as an example, but these
parameters can be applied to many other endpoints.

### 07_DeprecatedHeader.py
This sample demonstrates the Deprecated response header. The Deprecated
response header is returned for each request to a deprecated API endpoint.

### 08_RemovedVersion.py
This sample demonstrates the Removed response message. The Removed
response message is returned for each request to a removed API endpoint.

repository: kali-ren/api-samples

repo_name: kali-ren/api-samples


text:
---
layout: default
title: 'Color Drops in Javascript Land!'
author: dirk lüsebrink
image: /images/drops-in-javascript-land/shot.png
excerpt_separator:
categories: [programming, javascript, project]
---
Add Some color to your life: My first foray into dynamic javascript territory **from around 2001!**

{% include iframe.html src="/drops/" %}

I put a first [post online in 2006], by that time it was already untouched and
a couple of years old. I guess that counts as **really OLD!** Coming from
computer graphics land I was frustrated with C++, X11 and OpenGL and interested
in playing with dynamic javascript for full-screen, better say full window,
display. The stuff above is an embedded `IFrame`, you can link to the
_original_ [full page here].

I can't exactly say, as the machines and the site no longer exist, but I would
date my little javascript experiment to 2001. Around that time I realized
Javascript was one of the most misunderstood languages and fell in love with
it. Which is for why I tried really really hard writing clean code, something
basically unheard in javascript land, a time of `<marquee>` tags and javascript
clocks. Flash ruled, and I hated Flash.

[full page here]: /drops
[post online in 2006]: /dropjes

Actually, I'm quite proude of my javascript. It's not complicated, but it is
clean and the amazing part is, it is running untouched, 15 years
later in my browser. [Full source code] is now merged into this jekyll blog and
[can be found on github]. Catch a glimpse below, isn't it beautiful?

```js
function ObjectByName(name) {
    if (document.getElementById) {
        this.obj = document.getElementById(name);
        this.style = document.getElementById(name).style;
    } else if (document.all) {
        this.obj = document.all[name];
        this.style = document.all[name].style;
    } else if (document.layers) {
        this.obj = document.layers[name];
        this.style = document.layers[name];
    }
}

function writit( id, text) {
    if (document.getElementById) {
        x = document.getElementById(id);
        x.innerHTML = '';
        x.innerHTML = text;
    } else if (document.all) {
        x = document.all[id];
        x.innerHTML = text;
    }
}

function appendIt( id, text) {
    if (document.getElementById) {
        x = document.getElementById(id);
        var tmp = x.innerHTML + text;
        x.innerHTML = '';
        x.innerHTML = tmp;
    } else if (document.all) {
        x = document.all[id];
        x.innerHTML += text;
    }
}

function urldecode() {

    // return a result array even when its emtpy
    var data = new Array();
    do {
        var s = window.location.search;
        if( s == null || s == "") {
            break; // emtpy search
        }
        if( s.charAt(0) != '?') {
            alert(" search with no question mark? somethings seriously wrong here");
            break;
        }
        s = s.substring(1); // strip the leading ?

        var parts = s.split("&");
        for( p in parts) {
            var part = parts[p];
    //alert( p + '->' + part);
            var x = part.split("=");
            var name = dehex( x[0].replace( /\+/g," ") );
            var value = true;
            if( 1 < x.length && x[1]) {
                value = dehex( x[1].replace( /\+/g," ") );
            }
            data[name] = value;
        }
    } while(false);

    // return result, can be empty but not null
    return data;
}

function urlparam( key, default_value) {
    var kv = urldecode();
    var value = (kv[key]) ? kv[key] : default_value;

    return value;
}
```

have fun

[Full source code]: https://github.com/crux/crux.github.io/tree/master/drops
[can be found on github]: https://github.com/crux/crux.github.io/tree/master/drops


text:
[docimg]:https://godoc.org/github.com/ardnew/mkgo?status.svg
[docurl]:https://godoc.org/github.com/ardnew/mkgo
[repimg]:https://goreportcard.com/badge/github.com/ardnew/mkgo
[repurl]:https://goreportcard.com/report/github.com/ardnew/mkgo

# mkgo
#### Create a Go main module using template source file

[![GoDoc][docimg]][docurl] [![Go Report Card][repimg]][repurl]

> mkgo creates a new Go main module using a source code template.
> It integrates `github.com/ardnew/version` to embed a version and changelog,
> and it uses the standard `flag` package to accept command-line arguments.
> The module is created at a given Go import path relative to the first path
> found in the user's `GOPATH` environment variable.

## Usage

Simply provide the Go import path of the desired module:

```sh
mkgo github.com/ardnew/mycmd
```

Also generate a simple `README.md` (with GoDoc and GoReportCard badges) and `LICENSE` (MIT) file:

```sh
mkgo -r -l MIT -u ardnew github.com/ardnew/mycmd
```

If there were no errors, you should see the following output:

```
mkgo: successfully created "github.com/ardnew/myapp": /home/andrew/Code/go/src/github.com/ardnew/myapp
```

Use the `-h` flag for usage summary:

```
Usage of mkgo:
  -changelog
		display change history
  -d string
		date of initial revision (default "2020 Oct 10")
  -f    force overwriting file if it already exists
  -l string
		create a LICENSE file (options: MIT)
  -r    create a simple README.md
  -s string
		semantic version of initial revision (default "0.1.0")
  -u string
		user name for license file copyright (default "andrew")
  -version
		display version information
```

## Installation

Use the builtin Go package manager:

```sh
go get -v github.com/ardnew/mkgo
```

repository: ardnew/mkgo

branch_name: refs/heads/main

repo_name: ardnew/mkgo


text:
Used codes for ATMegas
======================

* `ATMegaBOOT.hex` is the bootloader burned on the ATMegas. It is a bit customized to avoid problems with Serial communication on startup.
* `dynamic/` is the code which uses the Serial communication between the LEDs. It was used for the 2048-like game on the 46 rue d'Ulm.
* `static/` is an autonomous code which can be launched on each LEDs without any special communication between them. It was used on the 45 rue d'Ulm.


text:
# Analyze Code Coverage Report

This script extracts and prints code coverage information collected by the IBM Debug Code Coverage feature.
The Code Coverage feature is typically provided in a pipeline by the Headless Code Coverage Daemon, as described in https://www.ibm.com/docs/en/developer-for-zos/15.0.0?topic=gccza-generating-code-coverage-in-headless-mode-using-daemon.

One of the artifacts that the Code Coverage Daemon generates is a ZIP file (that has the .cczip extension), that contains the collected information on code execution.
These information can be leveraged by developers as part their Unit Testing process, to understand which lines of code of their programs were executed.

The script uses the Code Coverage APIs, which is a set of Java API to parse the results contained in the CCZIP file created by the IBM Debug Code Coverage feature.
The Code Coverage APIs are described in a JAR file, that is shipped with IBM Debug (in the plugins subfolder of the IBM Debug installation on USS).
The required `ccapi.jar` file is packaged in a JAR file that must first be extracted (this JAR file is called com.ibm.debug.pdt.codecoverage.core.results_10.1.1.jar for IDz 15.0.3). Once extracted, the `ccapi.jar` must be made available (typically through to the Java classpath), to be correctly imported by the AnalyzeCodeCoverageReport script.
The script was tested on z/OS (Unix System Services).

To run the AnalyzeCodeCoverageReport script, a file or a list of comma-separated files must be provided through the `-f`/`--files` parameter. This file or these files must be CCZIP files created by the IBM Debug Code Coverage feature.
If multiple files are provided, the Code Coverage Percentage is printed for each module found, and the combined Code Coverage Percentage is printed as the "Global Code Coverage Percentage".

### Invocation example (for the Code Coverage data collected for the "DFH0XVDS" module):
```
 groovyz -cp /var/dbb/extensions/ccapi.jar /var/dbb/extensions/AnalyzeCodeCoverageReport.groovy -f DFH0XVDS_2022_03_29_132149_0660.cczip
```

### Output:
```
** IBM DEBUG Code Coverage details
** Included modules:
         DFH0XVDS - Code Coverage Percentage: 25
** Global Code Coverage Percentage: 25
** Build finished
```

### AnalyzeCodeCoverageReport.groovy Command Line Options
```
usage: AnalyzeCodeCoverageReport.groovy [options]
options:
 -f,--files <arg>   Comma-separated list of Code Coverage CCZIP files to
                    analyze
```

repository: campagboy/dbb

gha_language: Groovy

repo_name: campagboy/dbb


text:
# Huffman Chisel

![build](https://github.com/AlexMontgomerie/huffman-chisel/actions/workflows/test.yml/badge.svg)

A Chisel implementation of Huffman coding for a static code table.

repository: AlexMontgomerie/huffman-chisel

repo_name: AlexMontgomerie/huffman-chisel


text:
# Change Log

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.5.0] - 2021-07-22

### Added

-   Ingest RSS feeds from over ~3000+ news websites across the world

### Updated

-   AWS CDK version to 1.110.1
-   AWS SDK version to 2.945.0
-   Updated Nodejs Lambda runtimes to use Nodejs 14.x
-   Updated Amazon QuickSight analysis and dashboard to reflect the new ingestion source
-   Updated AWS StepFunction workflows to handle parallel ingestion (tweets from Twitter and RSS feeds from News websites)

### Fixed

-   Truncated tweets through merging [GitHub pull request #26](https://github.com/awslabs/discovering-hot-topics-using-machine-learning/pull/26)

## [1.4.0] - 2021-02-04

### Added

-   Capability to use geo coordinates when invoking the Twitter API to filter tweets returned by its Search API
-   New visuals and sheets (tabs) on Amazon QuickSight to perform analysis using geo coordinates (when available with tweets)
-   Additional remediation to handle throttling conditions from Twitter v1.1 API calls and push additional information to Amazon CloudWatch Logs that can be used to create alarms or notifications using CloudWatch Metric Filters

### Updated

-   Switched to AWS Managed KMS keys for AWS Glue Security Configuration
-   AWS CDK version to 1.83.0
-   AWS SDK version to 2.828.0

## [1.3.0] - 2020-11-24

### Changed

-   Implementation to refactor and to reuse the following architecture patterns from [AWS Solutions Constructs](https://aws.amazon.com/solutions/constructs/)
    -   aws-kinesisfirehose-s3
    -   aws-kinesisstreams-lambda
    -   aws-lambda-step-function

### Updated

-   The join condition for Topic Modeling in Amazon QuickSight dataset to provide accurate topic identification for a specific run
-   ID and name generation for Amazon QuickSigh resource to use dynamic value based on the stack name
-   AWS CDK version to 1.73.0
-   AWS SDK version to 2.790.0

## [1.2.0] - 2020-10-29

### Added

-   New and simplified interactive Amazon QuickSight dashboard that is now automatically generated through an AWS CloudFormation deployment and that customers can extend to suit their business case

### Updated

-   Updated to AWS CDK v1.69.0
-   Consolidate Amazon S3 access Log bucket across the solution. All access log files have a prefix that corresponds to the bucket for which they are generated

## [1.1.0] - 2020-09-29

### Updated

-   S3 storage for inference outputs to use Apache Parquet
-   Add partitioning to AWS Glue tables
-   Update to AWS CDK v1.63.0
-   Update to AWS SDK v2.755.0

## [1.0.0] - 2020-08-28

### Added

-   Initial release


text:
---
title: dry-rb - Improve Rails development with dry-initializer and callee
header:
  image: /assets/images/alan-j-hendry-su3FE5qTEjw-unsplash-1200.jpg
  caption: "Photo credit: [**Alan J. Hendry**](https://unsplash.com/@imedianamibia){:target='_blank'}"
  teaser: /assets/images/alan-j-hendry-su3FE5qTEjw-unsplash-teaser.jpg
tags:
  - ruby
  - architecture
  - design patterns
  - dry-rb
  - functional programming
classes: wide
---

**Improve your project's quality and readability with dry-rb and callee gem**

## Are you happy with how your Rails code reads?

Of course you are.

*- My code is perfect!*

You say while brushing your old, messy code under the rug :)

Let's face it - there's always room for improvement, especially when the time comes to look at the code we put under the rug earlier. To make this process less unpleasant we could invest some time in better preparation, applying clean code principles and looking for code design improvements on the broad ocean of ideas which is The Internet. On one of these e-boat trips I stumbled upon [**dry-rb**](https://dry-rb.org/){:target="_blank"} - a set of libraries designed to help you neatly organize your Ruby code into easily maintainable components.

This is what they describe the toolset on their webpage:
> *dry-rb helps you write clear, flexible, and more maintainable Ruby code. Each dry-rb gem fulfils a common task, and together they make a powerful platform for any kind of Ruby application.*

It wasn't until much later when we finally introduced *dry-rb* to our *DeliGoo* project at *ReasonApps*, and looking at it now - I regret we hadn't done that earlier. **It helped us improve readability, introduced tools that helped our team standardize approach to handling problems and writing code.** For example the process of creating a new class for saving an object to database in our project would always follow the same steps:

* create a new class in *operations* folder with *_operation.rb* suffix,
* its' public interface should consist of only one method - **call** - which would accept *keyword arguments* defined on top with *option* class method (*dry-initializer* and *callee*),
* require a form object (*dry-struct*, *dry-types*) and a contract for validating the form (*dry-validation*),
* use functional programming approach to make sure each step is completed successfully and returns **Success()** object - or break code execution on failure and return **Failure()** object (*dry-monads*).

```ruby
require 'dry/monads'

module Addresses
  class CreateOperation
    include Callee
    include Dry::Monads[:result, :do]

    option :form_data
    option :contract, default: -> { Addresses::CreateContract.new }

    def call
      yield check_errors

      address = yield create_address

      Success(address)
    end

    private

    def check_errors
      return Failure(errors: errors) if errors.any?

      Success(nil)
    end

    def errors
      @errors ||= contract.call(form_data).errors.to_h
    end

    def create_address
      address = AddressFactory.call(params: form_data)

      if address.save
        Success(address)
      else
        Failure(address: address, errors: Errors::ValidationValue.new(key: :address).errors)
      end
    end
  end
end
```

Of course we didn't rush and throw everything they have at our codebase - here's how we did it in small iterations.

## The Initializer - Callee

To start things off mildly we focused on the beginning of the lifecycle - initialization of an object.

> *[dry-initializer](https://dry-rb.org/gems/dry-initializer/3.0/){:target="_blank"} is a simple mixin of class methods params and options for instances.*

Extending Dry::Initializer in our Ruby class lets us define standard arguments or keyword arguments for the `initialize` method as simple one liners on top of the file.

```ruby
# We can go from this:
class Thing
  def initialize(keyword_argument:, standard_param)
    @keyword_argument = keyword_argument
    @standard_param = standard_param
  end
end

# To this:
class Thing
  extend Dry::Initializer

  option :keyword_argument
  param :standard_param
end

# And the application is the same:
Thing.new(keyword_argument: 'test', 'simple string')
```

It helped us separate the initialization part of an object, keep the looks of it cleaner, and allow for additional behaviour such as *type constraints* and more.

{:refdef: style="text-align: center;"}
![An old phone](/assets/images/quino-al-xhGMQ_nYWqU-unsplash-900.jpg)
{: refdef}
*Time to make a call*
{: style="color:gray; font-size: 80%; text-align: center;"}

Another important step here was deciding to standardize the public interface for our services and operations. We use [*callee*](https://github.com/dreikanter/callee){:target="_blank"} gem which is built on top of *dry-initializer* in order to make our classes initialize via the *call* method (similar behaviour to my *DelegateCallToNew* module from Query Objects post). This lets us use them as procs and keeps things cleaner - **all operation classes and most services are callable, and are coded in similar manner.**

```ruby
class PerformanceCalculator
  include Callee

  option :employee
  option :date, default: -> { Date.today }

  def call
    (work_done / target) * 100
  end

  private

  def work_done
    employee.work_done.for_date(date)
  end

  def target
    ...
  end
end

# Used like:
performance = PerformanceCalculator.call(employee: user, date: Date.yesterday)
```

When our team grew and every person was used to writing code in a little different manner we have decided to enforce some rules. We focused on separating responsibilities of classes and reorganizing our code into better structures which belong in adequate folders. **The way that *callee* made us construct classes appealed to us instantly and was very easy to adjust to.** Ability to specify types of parameters passed to classes found use in some parts of our application - and possibly skipped us some headaches. If you need help figuring out how to make more advanced logic work - [*dry-rb* keeps their documentation well maintained](https://dry-rb.org/gems/dry-initializer/master/){:target="_blank"}.

In Gemfile:
```ruby
# dry-rb
gem 'dry-initializer'
# or
gem 'callee' # it includes dry-initializer as a dependency
```
*And that's all you need to start*
{: style="color:gray; font-size: 80%; text-align: center;"}

As of today - **I can't really imagine not using *callee* in my project** - it's so convenient that I have to recommend using it to everyone :)


text:
# spring-cloud-docker-sample
Complete example of Spring Cloud project and integration with docker-compose
Based on:
https://github.com/bijukunjummen/spring-cloud-ping-pong-sample

## Up and running with Sample Spring-Cloud based app

There are two ways to run the entire application:

* On Local Machine
* Using Docker

### On Local Machine
Running it all local is simple, do the following in sequence, in four different terminal windows:

Start up Eureka
```
cd sample-eureka
mvn spring-boot:run
```

Start up Config server
```
cd sample-config
mvn spring-boot:run
```

Start up Pong Service
```
cd sample-pong
mvn spring-boot:run
```

Start up Ping Service
```
cd sample-ping
mvn spring-boot:run
```

If all the applications have come up cleanly, the endpoint should be available at http://localhost:8080

### On Docker
Running using Docker is even simpler, assuming that docker-compose and docker are installed on your box, just run the following:
```
mvn clean package docker:build
docker-compose up
```

That is it, the endpoint should be available at http://dockerhost:8080

## Useful URLS
The UI of the ping application should be available at:

http://dockerhost:8080

Eureka should show all the registered services, at:

http://dockerhost:8761

Additionally a Hystrix dashboard should be available to monitor the requests to the "pong" app at this url:

http://dockerhost:8989/hystrix/monitor?stream=http%3A%2F%2Fsampleping%3A8080%2Fhystrix.stream

repository: rockzeng/spring-cloud-docker-sample

repo_name: rockzeng/spring-cloud-docker-sample


text:
---
title: "2: Service maintaining register"
topics:
  - Types of register
---
![Diagram showing the creation process from service to register and back to  services, with a custodian performing a QA role]({{site.baseurl}}/images/register-type-2.svg)

This form of register is created using a service, and the custodian performs a quality assurance role. For example, a register of companies could be created from the _register a company_ service. The job of the custodian would be to manage how data gets from that service into the register, to ensure the timeliness of that information becoming part of the register, and to ensure the register is accurate.


text:
# spring-docker
Complete Spring Boot multi-module example integrated with gradle, docker, docker-compose, postgresql and swaggerUI.

Use it as a starting base for your projects :)

## Requirements
Docker is required if you want to make use of the `buildDockerImage` gradle task and `docker-compose.yml` file.

## Build
To build the jars for each module:
```bash
./gradlew build
```

To build the docker image:
```bash
./gradlew buildDockerImage
```
Check with `docker images` that the image was created and tagged as `spring-docker`:
```bash
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
spring-docker       latest              9442eae8fbcd        26 seconds ago      390MB
```

## Run
```bash
docker-compose up
```
It creates the `dbpostgresql` and `spring-docker` containers in the same network.
```bash
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                            NAMES
91a222fee55a        spring-docker       "java -Xdebug -Xrunj…"   6 minutes ago       Up 6 minutes        <IP_ADDRESS>:7080->7080/tcp, <IP_ADDRESS>:8080->8080/tcp   spring-docker
39df3ad6e3ce        postgres            "docker-entrypoint.s…"   4 weeks ago         Up 6 minutes        <IP_ADDRESS>:5432->5432/tcp                           dbpostgresql
```

## Modules
The project is composed by 2 modules. The persistence module contains the model and persistence classes and the service module contains the controller, application and swagger configuration classes.
```bash
spring-docker
├── persistence
│   └── src
│       └── main
│           └── java
│               └── com.example.springdocker.persistence
│                   ├── PokemonDTO.java
│                   ├── PokemonModel.java
│                   └── PokemonRepository.java
└── service
    └── src
        └── main
            └── java
                └── com.example.springdocker.service
                    ├── Application.java
                    ├── PokemonController.java
                    └── SwaggerConfig.java

```

## SwaggerUI
Default swaggerUI: http://localhost:8080/spring-docker/swagger-ui.html

PokemonController example: http://localhost:8080/spring-docker/swagger-ui.html#/pokemon-controller

## Examples
### CREATE
```bash
curl --location --request POST 'http://localhost:8080/spring-docker/pokemon/create' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Mewtwo",
    "type": "Psychic"
}'
```
### GET
```bash
curl --location --request GET 'http://localhost:8080/spring-docker/pokemon/random'
```
```bash
curl --location --request GET 'http://localhost:8080/spring-docker/pokemon/1'
```
```bash
curl --location --request GET 'http://localhost:8080/spring-docker/pokemon/all'
```
### DELETE
```bash
curl --location --request DELETE 'http://localhost:8080/spring-docker/pokemon/1'
```

repository: liyongxian/spring-docker

repo_name: liyongxian/spring-docker


text:
PaNOSC Project Management Committee meeting - 20/11/2019
========================================================

Present
-------
Jordi (ESRF), Andy(ESRF), Rudolf (ESRF), Florian (ELI-DC), Juncheng (XFEL), Jamie (ILL), Dario (CERIC-ERIC), Nicoletta (CERIC),
Ornela (CERIC), Giuseppe (EGI), Petra (ESS) and Tobias(ESS).

Minutes
-------

**1. Deliverables due end of November**

Jordi went through the deliverable due for WP1, (which has been shared) and some areas that require WP leaders to edit and complete.

Jamie explained that the WP4 deliverable is well advanced and that he will share it tonight so it can be reviewed.

Juncheng had already shared the draft, which has been reviewed by Andy and Jordi. Juncheng and Nicoletta will be in touch to ensure
that the document to be submitted uses the template and follows the branding guidelines.

Andy explained that the internal document that leads to the milestone MS2.1 is ready. Jordi explained that MS1.2 is related to the
deliverable, so it will be done very soon. Tobias explained that MS3.1 and MS3.2 will be ready by the end of the week.

Jordi reminded everyone that we need to use the templates for deliverables before submitting them and that each one is
responsible for applying the branding guidelines. For milestones, it would be acceptable to apply the branding and templates after
the document is completed and the milestone has been ticked.

**2. Update of annual meeting in Trieste + Update from the WP Leaders**

Points 2 and 3 of the agenda were joined.

* WP1 Management
    * Jordi thanked everyone who contributed to the KPIs and also explained that he received guidelines for risk assessment from the
Executive Board. He expects to work on these during December.

* WP2 Data Policy and Stewardship
    * Andy thanked Dario, Nicoletta and Ornela for the good organisation of the meeting in Trieste and said it was good to be  together working and that progress was made with data policies and data management plans.

* WP3 Data Catalog Services
    * Tobias explained that during the annual meeting he had the best and most productive meeting for WP3, which is advancing well and
thanked the organisers of the annual event.

* WP4 Data Analysis Services
    * Hans was absent. Jamie explained  that during the annual conference work on the portal (which has its own GitHub repository
-> **URL FOR THIS REQUIRED PLEASE**) progressed and also they did work on use cases.

* WP5 Virtual Neutron and X-ray Laboratory
    * Juncheng explained that the joint session with WP8 was very productive and that it is now clear what WP5 should provide to WP8.
    * During the meeting it was also a good opportunity to see each other

* WP6 EOSC Integration
    * Jean-Francois was absent. Giuseppe reported that the joint WP4-5-6 session went well and confirmed that EGI can provide resources so it is not a problem at all if a partner requires resources.
    * It was then briefly discussed that due to the difficulties at ILL and ESRF to recruit System Administrators for WP6 we could maybe look into moving some effort from these two partners into EGI, who could offer these skills.

* WP7 Sustainibility
    * Roberto was absent. The Strawman Report was briefly discussed and commented.

* WP8 Staff training in data stewardship
    * Thomas was absent. Petra asked to have a correspondent from ESRF and ILL for WP8 that would be trained on how to use the
training portal. Petra also explained that WP8 will start monthly meetings and a joint face to face meeting with WP5 is planned
for early 2020.

* WP9 Outreach & Communication
    * Nicoletta explained that she did an interview with Christos and Jean-Francois on UmbrellaID. She is also looking at reusing a
video on DOIs by the ILL (ILL branding to be replaced by PaNOSC branding), but for this will need the company that originally made
the video. Andy suggested Nicoletta to get in touch with the Comms person at SOLEIL (part of ExPaNDS) as they may want to participate
and could help dealing with the French company that edited the video.

**4. Issues https://github.com/panosc-eu/panosc/issues**
* It was requested to go to the point 5 instead.

**5. News from other proposals and events**
* FAIRsFAIR data repository certification
    * Andy said that we are awaiting feedback from FAIRsFAIR.
* The [EOSC Stakeholders meeting](https://www.eoscsecretariat.eu/eosc-symposium) 24th to 28th November in Budapest
    * Andy said that he will represent PaNOSC and explained that there will be discussions about the  INFRAEOSC3 new proposal which
is being developed. As INFRAEOSC3 is in the early stages it is difficult to assess whether it would be interesting and what involvement
would be required from partners.
* Position Paper on EOSC by PaNOSC
    * Andy explained that he circulated this document and asked everyone to look at it and contribute by the end of the week.

Jordi asked whether there are any other upcoming events and Florian replied that he is attending and presenting PaNOSC in a national
event.

**5. AOB**
* Florian asked about the presentations in Indico from the Annual Meeting. Are these going to be always available? Rudolf said this
was a good point and it was decided to copy them into GitHub.
(this was done on the same day by Nicoletta: https://github.com/panosc-eu/panosc/tree/master/Work%20Packages/WP9%20Outreach%20and%20communication/Presentations/1st%20Annual%20Meeting%202019

repository: panosc-eu/panosc

path: /Work Packages/WP1 Management/Meetings/Project Management Committee/1st Year/2019-11-20-PMC/2019-11-20-PMC_Summary.md

gha_language: HTML

repo_name: panosc-eu/panosc


text:
# TangoAlpha Node.js API

[![JavaScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard)

**Notice:** This module and API is in early development and may change in the future.

[TangoAlpha Official Website](https://tangoalpha.gq/)

# Getting Started

Install the tangoalpha NPM Package with:
```
npm i tangoalpha
```
Also, require the module in your Node.js application with:
```js
var tango = require("tangoalpha")
```

# Using the API

## Blocktime

```js
tango.blocktime().then(result => { //Result is a float
  console.log(result) // Logs the average blocktime in seconds
})
```

## Estimated ROI

```js
tango.roi().then(result => { //Result is a float
  console.log(result) // Logs the estimated yearly ROI in Percentage
})
```

## Blockdrift

```js
tango.blockdrift().then(result => { // Result is an Array
  console.log(JSON.stringify(result)) // Logs the 'drift' of the past 1000 blocks
})
```

## Getdb - (Warning! Very resource intensive, please do not spam this!)

```js
tango.getdb().then(result => { // Result is an Array
  console.log(JSON.stringify(result)) // Logs the entire DB of TangoAlpha
})
```

## mnstcount

```js
tango.mnstcount().then(result => { // Result is an Object
  console.log(JSON.stringify(result)) // Logs the blocks and votes betweeen Stakers and MNs
})
```

## Getblock

```js
var block = 1685805
tango.getblock(block).then(result => { // "Block" is an integer of the desired block. Result is an Object
  console.log(JSON.stringify(result)) // Logs the block and it's winners
})
```

## Getaddress

```js
var address = "D6HPrF2BW4BBSrKn7g7v3up9sActhjNTfV"
tango.address(address).then(result => { // "Address" is a string of the desired coin address. Result is an Object
  console.log(JSON.stringify(result)) // Logs the address and it's TangoAlpha stats (voteweight, balance, blocksseen)
})
```

repository: JSKitty/TangoAlpha-Nodejs-API

repo_name: JSKitty/TangoAlpha-Nodejs-API


text:
# KIE Service Spring Boot Archetype

Archetype used to build new KIE Service Spring Boot Applications.

## Generate Spring Boot Service app

1. Build the kie-service-spring-boot-archetype module (mvn clean install)
2. Change to directory of your choice where you want to build the
   app from this archetype.
3. Create your new app from the archetype with:

```
mvn archetype:generate
   -DarchetypeGroupId=org.kie
   -DarchetypeArtifactId=kie-service-spring-boot-archetype
   -DarchetypeVersion=7.75.0-SNAPSHOT
```

or use this one-liner

```
mvn archetype:generate -DarchetypeGroupId=org.kie -DarchetypeArtifactId=kie-service-spring-boot-archetype -DarchetypeVersion=7.75.0-SNAPSHOT
```

4. Change the prompted values during the generation as needed (or leave the defaults)
5. Compile and test your generated base kjar project with

```
mvn clean install
```

6. Start your app with

```
mvn clean spring-boot:run
```

6. Access your app in browser

```
http://localhost:8090
```

## Building and starting your application with launch scripts

An alternative option to build and lanuch your application is with the build scripts. Your application
includes both shell scripts for Unix environments:

```
launch.sh
launch-dev.sh
```

as well as batch scripts for Windows environments:

```
launch.bat
launch-dev.bat
```

These script will try to find the apps model and kjar projects (in parent folder) and build
those before building and starting your application.

To run the shell scripts, you need to give it appropriate permissions, for example

```
chmod 755 launch.sh
./launch.sh clean install
```

and same for the shell dev script:

```
chmod 755 launch-dev.sh
./launch-dev.sh clean install
```

This is not required for the batch scripts which you can just execute with

```
launch.bat clean install
```

or

```
launch-dev.bat clean install
```

The launch-dev (sh or bat) script will launch you application in development mode, which means it will require
connection to the controller (workbench). By default the controller is set to

```
http://localhost:8080/business-central/rest/controller
```

If your workbench lives under a different host/port
you can change this value by editing the src/main/resources/application-dev.properties file in your
project, specifically change the value:

```
kieserver.controllers=http://localhost:8080/business-central/rest/controller
```

to whatever you have set up locally.

## Default Basic Authentication

Your generated app has basic authentication built in for urls with path /rest/\*. You can always change this later to add/remove users as needed.
By default there is one user set up in your application with

```
username: user
password: user
```

## Manage Apps KIE Server capabilities

You can manage what Kie server capabilities are included in your
service app with the property

```
-DappType
```

If you don't manually specify this property
it will be set to "bpm".

Currently there are three possible choices
for this property:

1. bpm: includes BRM, BPM, Case Management, BPM-UI, and DMN
2. brm: includes BRM and DMN
3. planner: includes BRM, BRP, and DMN

So to build an "planner" service app you would use the command:

```
mvn archetype:generate
   -DarchetypeGroupId=org.kie
   -DarchetypeArtifactId=kie-service-spring-boot-archetype
   -DarchetypeVersion=7.75.0-SNAPSHOT
   -DappType=planner
```

And similar for the other two available options.

## Changing the default KIE Runtime version

You can define a specific KIE Runtime version to be used with the following property:

```
-DkieVersion=YOUR_KIE_VERSION
```

The default value of the kie runtime is this archetypes version.

## Changing the default app package

You can specify your own package structure for Java files for your app by setting following property:

```
-Dpackage=YOUR_APP_PACKAGE
```

The default value of this property is the archetype groupId.

## Changing your apps address and port number

You can change your applications address and port with the following properties

```
-DappServerAddress=YOUR_SERFVER_ADDRESS
-DappServerPort=YOUR_SERVER_PORT
```

The default values if not specified for these are "localhost" and "8090".

## Changing database type

Your application comes by default with three db profiles, namely h2 (default), mysql, and postgres.

Look at your apps generated pom.xml file to see these profiles.
Your app also comes with three spring application properties files, namely
application.properties, application-mysql.properties and application-postgres.properties.
These have the predefined db setup for h2, mysql, and postgres respectively.

Note that to run your app with the mysql or postgres db you have to update the

```
spring.datasource.url
```

property in the respective application property files to reflect what is running on your system.
The default h2 setup uses an file based setup so no specific setup is needed.

Once you have this set up, you can build your application with:

```
mvn clean install -P mysql
or
mvn clean install -P postgres
```

and then run it with

```
cd target

java -Dspring.profiles.active=mysql -jar APP_NAME-APP-VERSION.jar
or
java -Dspring.profiles.active=postgres -jar APP_NAME-APP-VERSION.jar
```

where APP_NAME and APP-VERSION reflect the real name and version of your app you define
when you generate the app.

This setup allows you to easily add more db setups. Just add your profile with
needed depends in your apps pom.xml and then create a new application-YOUR_DB.properties
file where you can update the data source configuration to reflect your db values.

## Remote debugging

By default your generated application will have remote debugging disabled. If you want
to generate an application with remote debugging enabled add the following option when
running mvn archetype:generate:

```
    -DremoteDebugEnabled=true
```

If you have already generated you application and would like to enable remote debugging after,
find your apps pom.xml file and make sure you have there:

```
  <build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <jvmArguments>-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005</jvmArguments>
            </configuration>
      </plugin>
    </plugins>
  </build>
```

and change the remote debug address as you wish or leave the default as is.

## Disabling Swagger

By default, your generated application will have Swagger enabled for REST API endpoints. If you want
to generate an application with Swagger disabled add the following option when
running mvn archetype:generate:

```
    -DswaggerEnabled=false
```

If you have already generated you application and would like to disable Swagger afterwards,
find your apps pom.xml file and remove the following dependencies:

```
  <dependencies>
    ...
    <!-- Swagger -->
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-rs-service-description-swagger</artifactId>
      <version>${version.org.apache.cxf}</version>
    </dependency>
    <dependency>
      <groupId>io.swagger</groupId>
      <artifactId>swagger-jaxrs</artifactId>
      <version>${version.io.swagger}</version>
      <exclusions>
        <exclusion>
          <groupId>javax.ws.rs</groupId>
          <artifactId>jsr311-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.webjars</groupId>
      <artifactId>swagger-ui</artifactId>
      <version>${version.org.webjars.swagger-ui}</version>
    </dependency>
    ...
  </dependencies>
```

Don't forget to change the following property to your application.properties file as well
```
kieserver.swagger.enabled=false
```
Once done, you shouldn't be able to reach your swagger endpoint by navigating to a similar URL like the one below
```
http://localhost:8090/rest/api-docs?url=http://localhost:8090/rest/swagger.json
```

## Troubleshooting

This archetype requires maven-archetype-plugin version 3.0.1 or above.
In case you run into issues with the post generation scripts
not being executed during archetype generation run it once with
force update maven option

```
-U
```

This will make sure you up the 3.0.1 version of maven-archetype-plugin
and get it installed in your local maven repo.

repository: kiegroup/droolsjbpm-knowledge

gha_language: Java

repo_name: kiegroup/droolsjbpm-knowledge


text:
# Gw2-RaidComp
Used to create static team compositions

Only the TeamMakerUI.py is needed along with PySimpleGUI package for python.

WARNING:TeamMaker.py is now obsolete, use TeamMakerUI.py instead!

Roles supported for now are: RoleList = ["solokite", "BT", "lamp", "hfb", "qfb", "rr", "healscg", "cTank", "druid", "epi", "alaren", "bs", "plyon", "hk", "offchrono"]
and are saved in program data section

Screenshots:

![menu](https://user-images.githubusercontent.com/58532095/111518844-c2cbb780-8756-11eb-85ce-70fefa038dda.png)

![2](https://user-images.githubusercontent.com/58532095/109435982-85a8bb00-7a1d-11eb-9e0e-f55e47356bf9.png)

![stat](https://user-images.githubusercontent.com/58532095/111518850-c52e1180-8756-11eb-81f2-82b245276e92.png)

 #Todo:
add dhum kite, CM compositions

add save/load option for compositions.txt?


text:
---
title: "Release Snapshot"
date: 2019-04-11T23:31:18-04:00
description: ""
categories: []
keywords: []
slug: ""
aliases: []
toc: false
draft: false
reviewed: true
---

It has been a long time that our developers are working on the develop branch in each repository in the networknt organization. Recently, we have to change the release process to release from three release branches to meet the requirement from our users.

* The 1.5.x and 1.6.x branches for JDK 8 are the stable for production upgrade as only defect fixes backport to these branch.
* The master branch for JDK 11 is our main development branch with new features added daily and release under 2.0.x tag.

Now, our user's requirement is satisfied. What about our contributor? As you know, we have too many repositories, and the dependencies between repositories are complicated. For most of our platform developers, we are relying on the light-bot [develop-build][] to prepare the local environment and build all dependencies. It has been working perfectly, but it takes a lot of developers' time to build everything locally. With the contributor's team getting bigger and bigger, team members are looking into the snapshot releases.

To prepare the snapshot release, we have taken actions in the repository arrangement and light-bot update.

### Simplify the version properties

Previously, a lot of our repositories have version references per framework even the version is the same as all frameworks are released along with light-4j.

We have updated all repositories and light-codegen templates to use only version.light-4j in the pom.xml

Here is the old pom.xml

```
<version.light-4j>1.6.0</version.light-4j>
<version.light-rest-4j>1.6.0</version.light-rest-4j>
```

And the new pom.xml

```
<version.light-4j>1.6.0</version.light-4j>
```

This significantly simplify the light-bot [version-upgrade][] task.

### Release branches for codegen and examples

When we update the master branch for all repositories with the snapshot version before the final release, there are three repositories that we need to handle a little bit differently.

* light-codegen
* light-example-4j
* light-example-kotlin

The above repositories are used frequently by our users with the source code. To avoid end users to use the snapshot version, we have created 'release' branch for these repositories and make `release` branch as default branch. We are going to sync the code from the master branch to release after each release.

### Version match regex update

With -SNAPSHOT as part of the version, the old way of regex matching is not working anymore for the [version-upgrade][] task.

We have change regex from

```
<version.light[a-z-]+4j>\d*\.\d*\.\d*</version.light[a-z-]+4j>
```

to

```
<version.light-4j>((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)</version.light-4j>
```

### Gradle version upgrade

With some of our repositories using the Gradle build system, we need to cover it for the version upgrade. The light-4j version is defined in the `gradle.properties` file in the project home directory.

The following is the regex for matching.

```
light4jVersion=((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)
```

### Release Snapshot Task

For the normal release, there are a lot of extra steps. For example, generate changelog and check in, push the release notes to the GitHub.com, etc. We don't need these steps for the snapshot release. To avoid updating these flags for back and force, it makes sense to create a branch new task in the light-bot release-maven folder called release-snapshot.

The config files are similar to the release-all, but a lot of steps are skipped.

### Summary

With the above changes, we have successfully released the snapshot version to the maven central. You can view the snapshot jars from the following link.

https://oss.sonatype.org/content/repositories/snapshots/com/networknt/body/1.6.1-SNAPSHOT/

At the moment, we are going to release the snapshot version on a regular basis manually. Soon, we will create a cron job to release nightly.

[develop-build]: /tool/light-bot/task/develop-build/
[version-upgrade]: /tool/light-bot/task/version-upgrade/

repository: networknt/light-doc

gha_language: CSS

repo_name: networknt/light-doc


text:
# Simple Buffer overflow - local variable overwrite

## Intro

We will perform a simple buffer overflow on a binary. This overflow
will change a sensitive local stack variable, which will give us
virtual "admin" privileges.

### Source

* Source directory: `~/challenges/challenge09/`
* Source files: [challenge09](https://github.com/dobin/yookiterm-challenges-files/tree/master/challenge09)

You can compile it by calling `make` in the folder `~/challenges/challenge09`

### Vulnerability

Read the source of `challenge09.c`.

The vulnerability lies here:
```c
void handleData(char *username, char *password) {
    int isAdmin = 0;
    char name[128];
	...
	strcpy(name, username); // strcpy() is unsafe
	...
}

int main(int argc, char **argv) {
    handleData(argv[1], argv[2]);
}
```

The first argument of the program is copied into a stack buffer `name` of 128 byte size.
After this buffer `name`, an important variable called `isAdmin` is located.

## Normal behaviour

Lets execute the program with normal length string, and with a wrong password:

```
~/challenges/challenge09$ ./challenge09 sheldon password
isAdmin: 0x0
Not admin.
```

The password "password" seems to be not correct. We dont know
what the actual password is.

But with the correct password, it would look like this:

```
~/challenges/challenge09$ ./challenge09 sheldon ...
isAdmin: 0x1
You are admin!
```

## Abnormal behaviour - buffer overflow

What happens when you insert a string which is longer than 128 bytes? Lets try it.
We can use perl to print 130 characters:

```
~/challenges/challenge09$ perl -e 'print "A" x 130'
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA~/challenges/challenge09$
```

And use this command as argument by encapsulating it into backticks:
```
~/challenges/challenge09$ ./challenge09 `perl -e 'print "A" x 130'` password
isAdmin: 0x4141
You are admin!
```

It appears that we have overwritten the `isAdmin` variable with the content `0x4141`.

## Abnormal behaviour - more buffer overflow

What if we even add some more characters? Lets say 140.

```
~/challenges/challenge09$ ./challenge09 `perl -e 'print "A" x 140'` password
isAdmin: 0x41414141
You are admin!
Segmentation fault (core dumped)
```

Not only is the `isAdmin` variable `0x41414141`, but we also get a `Segmentation fault`
at the end.

## Things to think about

* What is happening here? Why Are we "admin" if we use a username which is 130 bytes long?
* Why do we get a segmentation fault if we use a username which is 140 bytes long?

repository: dobin/yookiterm-challenges

repo_name: dobin/yookiterm-challenges


text:
### [CVE-2007-2853](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-2853)
![](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

The VCDAPILibApi ActiveX control in vc9api.DLL <IP_ADDRESS> in Virtual CD <IP_ADDRESS> allows remote attackers to execute arbitrary commands via a command line in the first argument to the VCDLaunchAndWait function.

### POC

#### Reference
- https://www.exploit-db.com/exploits/3967

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

repo_name: trickest/cve


text:
# Vyanjs App Starter - Boilerplate and Helloworld Example
Vyanjs Application Starter Boilerplate code

## Demonstrate
* HelloWorld Example
* How to create use Vyanjs Application, ViewManager, ViewNavigator in application.
* How to Create Custom View (page)
* How to Create Custom Component
* How to Generate Navigation Event
* How to Configure Navigator Route (path), Event Route

## Step to follow
* Download App starter code from github or clone it.
* `npm install`
* `npm run build` dev-server at http://localhost:10001.

## Bug or Issue Reporting
* report issue/bug in issue section.
* connect us on twiiter [At]vyanjs
* Your feedback are most welcome.

repository: vyanjs/vyanappstarter

gha_language: JavaScript

repo_name: vyanjs/vyanappstarter


text:
---
name: "✨ New Feature"
about: Suggest a feature
title: "✨"
labels: ''
assignees: ''

---

# Overview
What is the feature about? What will it change in the game?

# Expected Behavior
How will it benefit the player or the devs? What is expected of it when it is ready?

# Tasks
- [ ] ...
- [ ] ...

# Additional Information
Add any other context about the feature here.

# Screenshots
If applicable, select screenshots and images which may help to explain the feature.

repository: FellowshipOfTheGame/FinalInferno

branch_name: refs/heads/Develop

repo_name: FellowshipOfTheGame/FinalInferno


text:
---
type: rule
archivedreason:
title: Do you consider optical alignment?
guid: 695b28a6-1360-486a-908e-20016a6b9fdb
uri: do-you-consider-optical-alignment
created: 2012-11-27T01:51:02.0000000Z
authors: []
related: []
redirects: []

---

![Optical alignment](../../assets/opticalalignment.jpg)**Figure: In the first example, although the text is technically aligned, it does not 'look' it. In the second one, the "V" has been moved into the margin, but the optical alignment is now correct**
<!--endintro-->

Not only relevant in typography, optical alignment can also be used in forms and web.

::: bad
![Figure: Bad example - The fields are aligned to the radio buttons, but it doesn't "look" good enough](../../assets/bad\_opticalalignment.jpg)
:::

::: good
![Figure: Good example - It seems neater, even though it is no longer technically aligned](../../assets/good\_opticalalignment.png)
:::


text:
# My Vimrc

> How do you know if someone uses Vim?

> Don't worry, they'll tell you.

I love Vim. I've been using it for over a year now, and I know that still have more to learn. For iOS development, Xcode is still the obvious choice, but for anything else, I only choose Vim. I've taken the time to cultivate plugins and create my own functions and mappings to increase my productivity.

Learning Vim takes time, and at first, it can be [frustrating](http://qr.ae/ROi9Vd), but I promise after exploring and experimenting with Vim, it'll be worth your time.

This is my vimrc file. I don't recommend straight up copying it (as it's built for my workflow), but I'd suggest reading [this post](https://melinysh.me/vim,/development,/commandline/2016/02/18/what-makes-a-vimrc.html) I wrote about the basics of a good vimrc. If you know of anything interesting that I should add, let me know.

MIT License

Copyright (c) 2016 Stephen Melinyshyn

repository: Melinysh/vimrc

repo_name: Melinysh/vimrc


text:
# Bowling Challenge #

![bowling ASCII](https://user-images.githubusercontent.com/43742795/51447391-9ef6bd80-1d15-11e9-9878-96abb0d39038.png)

The challenge is to build a bowling scorecard (not a game), in Javascript.

## The rules ##

A bowling game consists of 10 frames in which the player tries to knock down the 10 pins.

In every frame the player can roll one or two times. The actual number depends on strikes and spares.

The score of a frame is the number of knocked down pins plus bonuses for strikes and spares.
After every frame the 10 pins are reset.

* Strikes

The player has a strike if he knocks down all 10 pins with the first roll in a frame.

The frame ends immediately (no second roll due to no pins to hit left).

The bonus for that frame is the number of pins knocked down by the next two rolls.

That would be the next frame, unless the player rolls another strike.

* Spares

The player has a spare if the knocks down all 10 pins with the two rolls of a frame.

The bonus for that frame is the number of pins knocked down by the next roll (first roll of next frame).

* 10th frame

If the player rolls a strike or spare in the 10th frame they can roll the additional balls for the bonus.

But they can never roll more than 3 balls in the 10th frame.

The additional roll only count for the bonus not for the regular frame count.

* Gutter Game

A Gutter Game is when the player never hits a pin (20 zero scores).

* Perfect Game

A Perfect Game is when the player rolls 12 strikes (10 regular strikes and 2 strikes for the bonus in the 10th frame).

The Perfect Game scores 300 points.

In the image below you can find some score examples.

![Ten Pin Score Example](images/example_ten_pin_scoring.png)

## How to use ##

1. clone the repo

Under the repo name click *clone or download*

Click on *use HTTPs*, copy the clone URL of the repo

In the terminal go on the working directory where you want the cloned directory to be

Use the `git clone` command and paste the clone URL then press enter :

```shell
$ git clone https://github.com/your-username/your-repositary.git
```

2. On your local machine go inside of the *bowling-challenge* directory :

```shell
$ cd bowling-challenge
```
3. You can see the different files by using the `ls` command :

```shell
$ ls
```

4. You can open the *.js* file that you want to read and change the code in your text editor or using `vim` :

```shell
$ vim wanted_file.js
```
Or you can just read the contains of it from the command line with `cat` :

```shell
$ cat wanted_file.js
```

## Run the tests ##

1. On your command line, from your root directory, use the `pwd` command to see the path of your *html* file:

```shell
$ pwd
$ /Users/yourUsername/Desktop/directory-of-your-project/bowling-challenge
```

2. In your browser copy and past this path, and add at the end of it */SpecRunner.html*

The page will be displayed on your browser.

3. If you use google chrome you can also open the page on your browser directly from your command line from your root directory, by using the command `open -a “Google Chrome” SpecRunner.html` :

```shell
$ open -a “Google Chrome” SpecRunner.html
```
The page with the test results will be opened on your browser.

repository: CelineKaslin/bowling-challenge

repo_name: CelineKaslin/bowling-challenge


text:
# Symantec Certificates

This directory contains the set of known active and legacy root certificates
operated by Symantec Corporation. In order for certificates issued from
roots to be trusted, it is required that the certificates be logged using
Certificate Transparency.

For details about why, see <https://security.googleblog.com/2015/10/sustaining-digital-certificate-security.html>

The exception to this is sub-CAs which have been disclosed as independently
operated, whose keys are not in control of Symantec, and which are
maintaining a current and appropriate audit.

## Roots

The full set of roots are in the [roots/](roots/) directory, organized by
SHA-256 hash of the certificate file.

The following command can be used to match certificates and their key hashes:

`` for f in roots/*.pem; do openssl x509 -noout -pubkey -in "${f}" | openssl asn1parse -inform pem -out /tmp/pubkey.out -noout; digest=`cat /tmp/pubkey.out | openssl dgst -sha256 -c | awk -F " " '{print $2}' | sed s/:/,0x/g `; echo "0x${digest} ${f##*/}"; done | sort ``

## Excluded Sub-CAs

### Aetna

WebTrust audit confirmed out-of-band.
[Certification Practices Statement](http://crl.aetna.com/aetnacps.pdf)
Note: Not issuing new certificates and can be removed after October 2016.

  * [d6e4e7b9af3bd5a8f2d6321cde26639c25644f7307ce16aad347d9ad53d3ce13.pem](excluded/d6e4e7b9af3bd5a8f2d6321cde26639c25644f7307ce16aad347d9ad53d3ce13.pem)

### Apple

[WebTrust Audit](https://cert.webtrust.org/ViewSeal?id=1917)
[Certification Practices Statement](http://images.apple.com/certificateauthority/pdf/Apple_IST_CPS_v2.0.pdf)

  * [17f96609ac6ad0a2d6ab0a21b2d1b5b2946bd04dbf120703d1def6fb62f4b661.pem](excluded/17f96609ac6ad0a2d6ab0a21b2d1b5b2946bd04dbf120703d1def6fb62f4b661.pem)
  * [3db76d1dd7d3a759dccc3f8fa7f68675c080cb095e4881063a6b850fdd68b8bc.pem](excluded/3db76d1dd7d3a759dccc3f8fa7f68675c080cb095e4881063a6b850fdd68b8bc.pem)
  * [6115f06a338a649e61585210e76f2ece3989bca65a62b066040cd7c5f408edd0.pem](excluded/6115f06a338a649e61585210e76f2ece3989bca65a62b066040cd7c5f408edd0.pem)
  * [904fb5a437754b1b32b80ebae7416db63d05f56a9939720b7c8e3dcc54f6a3d1.pem](excluded/904fb5a437754b1b32b80ebae7416db63d05f56a9939720b7c8e3dcc54f6a3d1.pem)
  * [ac2b922ecfd5e01711772fea8ed372de9d1e2245fce3f57a9cdbec77296a424b.pem](excluded/ac2b922ecfd5e01711772fea8ed372de9d1e2245fce3f57a9cdbec77296a424b.pem)

### Google

[WebTrust Audit](https://cert.webtrust.org/ViewSeal?id=1941)
[Certification Practices Statement](http://static.googleusercontent.com/media/pki.google.com/en//GIAG2-CPS-1.3.pdf)

  * [c3f697a92a293d86f9a3ee7ccb970e20e0050b8728cc83ed1b996ce9005d4c36.pem](excluded/c3f697a92a293d86f9a3ee7ccb970e20e0050b8728cc83ed1b996ce9005d4c36.pem)

repository: massnetwork/mass-browser

repo_name: massnetwork/mass-browser


text:
## Document to PDF

This script takes an existing Google Docs file and converts it into a PDF. It can also optionally place it in a particular destination folder.

---

### Background

When I wrote the original version of my [submission-to-pdf](https://github.com/tjohnston-softdev/submission-to-pdf) script at the start of 2017, it was a little tricky for me to figure out how to actually convert the finished document to a PDF. Looking through the documentation, it seemed pretty obvious but for some reason, following it to the letter caused the resulting 'pdf' to become corrupted. Google Apps scripting can be quite glitchy sometimes for no clear reason. It is not uncommon for the most obvious solution to simply fail. Fortunately, there is often more than one way to do things and eventually, I found a solution that successfully converts a document to a PDF as intended.

The solution:

* Open the document file using [DocumentApp](https://developers.google.com/apps-script/reference/document/document-app).
* Retrieve it's [contents](https://developers.google.com/apps-script/reference/document/document#getAs(String)) as an `application/pdf` blob.
* Then [create](https://developers.google.com/apps-script/reference/drive/drive-app#createFile(BlobSource)) the converted file as-is.
	* It may be tempting to use the other 'createFile' functions but the blob object contains both the original file name and the contents so this is not necessary.
	* Using the other functions will likely cause corruption errors.
* Afterwards, use the output file as you would normally.

When I wrote the refined version of 'submission-to-pdf' for public release, It had been over two years since I worked with Google Drive scripting. I had forgotten this solution entirely and I had to figure it out all over again. That is why I decided to quickly write a stand-alone conversion script for future reference, and to show others how it is done.

### Getting Started

To install this script, refer to these [instructions](../install.md#script).

After the script file has been saved, choose the `executeDocumentToPDF` function in order to execute the script. The `settingsObject` variable contains the script's settings, as outlined in the table below.

### Settings

| Program Setting | Type | Description | Example |
|---|---|---|---|
| documentFileID | string | The ID of the Google Docs file to convert into a PDF. If it is invalid or missing, there will be an error. | 6piTxNNopDGJlce5RMGMHS6ePKm1opb5 |
| outputFolderID | string | The ID of the folder where the output PDF will be located. If it is invalid or missing, the file will be placed in the drive root by default. | 51a9PDMC5LCQIXmcLBZ6qAFtdImPrHID |

Refer to the following [page](https://docs.meiro.io/books/meiro-integrations/page/where-can-i-find-the-file-id-on-google-drive) for instructions on retrieving file and folder IDs.

---

[Return to Home Page](../readme.md)

repository: tjohnston-softdev/rsi-misc

repo_name: tjohnston-softdev/rsi-misc


text:
# ActiveModel::Validations::DuckType

Duck type validators for active model.

`ActiveModel::Validations` was sorely lacking a system to validate the type. To respect Ruby, duck type.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'active_model-validations-duck_type'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install active_model-validations-duck_type

## Usage

```ruby
    class Person
      include ActiveModel::Validations

      attr_accessor :pet

      validates :pet, duck_type: { all: %i[house food] }
    end

    person = Person.new
    person.pet = 'house'
    person.valid?  # => false

    class Parrot
      attr_accessor :house, :food
    end

    person.pet = Parrot.new
    person.valid?  # => true
```

## Contributing

Bug reports and pull requests are welcome on [GitHub](https://github.com/gemologist/active_model-validations-duck_type).

## License

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


text:
# How to set up the dev env for web-ui

## install node and npm
install the node and npm specify the version to **node 5.9.0**
you can use nvm to install you node for more please refer:(link)[https://github.com/creationix/nvm]

## RUN npm install
```
    npm install
```
use npm install to install all the dev dependencies

## start dev sever
```
    npm run start
```
run the command to start dev server, it will start an webpack-dev-server for you.

## build for prod
```
    npm run build
```
run the command to build the version in prod. it is use for CI, if you start your local dev server. get ride of this

### CI

http://<IP_ADDRESS>:1338/job/web-ui/

repository: EasyAssessSystem/web-ui

repo_name: EasyAssessSystem/web-ui


text:
---
layout: default
---

# 1996-05-18 - Re:  SEVERE undercapacity, we need more remailer servers FAST

## Header Data

From: Rich Graves<EMAIL_ADDRESS>To: Bill Stewart<EMAIL_ADDRESS>Message Hash: 16794fa00c22abb52504a32fc07169c79a63b3eee4e090507c3cf2a7b3207627

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-05-18 18:02:33 UTC

Raw Date: Sun, 19 May 1996 02:02:33 +0800

## Raw message

```
{% raw  %}From: Rich Graves<EMAIL_ADDRESS>Date: Sun, 19 May 1996 02:02:33 +0800
To: Bill Stewart<EMAIL_ADDRESS>Subject: Re:  SEVERE undercapacity, we need more remailer servers FAST
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

On Thu, 16 May 1996, Bill Stewart wrote:

> 4) I suppose if you're going to hack the remailer anyway,
> you could add a feature that adds a trailer like
> ==================================================================
> This message was posted from the anonymous remailer at www.jim.com.
> Send any complaints to<EMAIL_ADDRESS>.
> Please don't post any copyrighted material longer than fair use quotations.
> And did you know that Scientology's highly overpriced documents say that
>         "<random paragraph quotation>"
> ===================================================================

Once I was more or less done laughing and got off the floor, it occurred
to me that this could provide a revenue stream for anonymous remailers.
You'd charge advertisers sub-pennies for these little trailers. I
understand that Sameer is getting very little Ecash for his
remail/by-www.html, but maybe if he sold advertising space?

Sure it's crass, but it supposedly works for Juno, the "free email"
service...

-rich

{% endraw %}
```

## Thread

+ Return to [May 1996](/archive/1996/05)

+ Return to "[Bill Stewart <stewarts@ix.netcom.com>](/authors/bill_stewart_stewarts_at_ix_netcom_com_)"
+ Return to "[Rich Graves <llurch@networking.stanford.edu>](/authors/rich_graves_llurch_at_networking_stanford_edu_)"

+ 1996-05-18 (Sat, 18 May 1996 16:17:32 +0800) - [Re:  SEVERE undercapacity, we need more remailer servers FAST](/archive/1996/05/3bacc3f8ed72c439abca9fe9150238b1518a8b64fd324a83692e8d954a4a3f4d) - _Bill Stewart<EMAIL_ADDRESS>  + 1996-05-18 (Sun, 19 May 1996 02:02:33 +0800) - Re:  SEVERE undercapacity, we need more remailer servers FAST - _Rich Graves<EMAIL_ADDRESS>


text:
# OpenTelemetry Metrics Exporter - OTLP

**Status**: [Experimental](../../document-status.md)

OTLP Metrics Exporter is a [Push Metric
Exporter](../sdk.md#push-metric-exporter) which sends metrics via the
[OpenTelemetry Protocol](../../protocol/README.md).

OTLP Metrics Exporter MUST support both Cumulative and Delta
[Temporality](../datamodel.md#temporality).

OTLP Metrics Exporter MUST allow [Aggregation
Temporality](../datamodel.md#temporality) to be specified, as described in
[MetricExporter](../sdk.md#metricexporter).

If the temporality is not specified, OTLP Metrics Exporter SHOULD use Cumulative
as the default temporality.

The exporter MUST provide configuration according to the [OpenTelemetry Protocol
Exporter](../../protocol/exporter.md) specification.

In addition, the exporter MUST provide the following configuration (note: this
section will be merged to the [OpenTelemetry Protocol
Exporter](../../protocol/exporter.md) specification once it reaches
[Stable](../../document-status.md)):

| Description | Default | Env variable |
| ----------- | ------- | ------------ |
| The preferred output [Aggregation Temporality](../datamodel.md#temporality), either `CUMULATIVE` or `DELTA` (case insensitive) | `CUMULATIVE` | `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY`


text:
### [CVE-2022-24932](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-24932)
![](https://img.shields.io/static/v1?label=Product&message=Samsung%20Clould&color=blue)
![](https://img.shields.io/static/v1?label=Product&message=Samsung%20Mobile%20Devices&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=-%3C%<IP_ADDRESS>%20&color=brighgreen)
![](https://img.shields.io/static/v1?label=Version&message=Q(10)%2C%20R(11)%2C%20S(12)%3C%20SMR%20Mar-2022%20Release%201%20%20&color=brighgreen)
![](https://img.shields.io/static/v1?label=Vulnerability&message=CWE-424%3A%20Improper%20Protection%20of%20Alternate%20Path&color=brighgreen)

### Description

Improper Protection of Alternate Path vulnerability in Setup wizard process prior to SMR Mar-2022 Release 1 allows physical attacker package installation before finishing Setup wizard.

### POC

#### Reference
- https://security.samsungmobile.com/securityUpdate.smsb?year=2022&month=3

#### Github
No PoCs found on GitHub currently.


text:
---
title: 'GraphQL and REST APIs with AWS'
date: '2019-05-19T03:00:00.284Z'
---

Recently I've been commissioned to find out ways to create APIs on AWS to be consumed by web and native mobile clients.

---

The landscape is pretty simple. For a classic REST API one can use the Amazon API Gateway service. For GraphQL the AWS AppSync.

At the first sight everything is easy: choose a service. After digging in — for REST all gets complicated while GraphQL stays clean.

## Reasons

[**AppSync / GraphQL**](https://aws.amazon.com/api-gateway/) has better automation. All additional services needed by the API (functions, data, storage, authorization) are integrated, made quasi-invisible, or configurable with a single click. One has to manage a single umbrella service with an official toolchain. That's all.

[**The REST API Gateway**](https://aws.amazon.com/appsync/) turns out it's just one piece of the puzzle. Unlike AppSync it is not enough to provide an API alone. It needs to be connected manually at least with AWS Lambda and DynamoDB — standalone services for functions and data.

Instead of one service REST ends up with three. Three times more work? On management yes, on coding more. Since REST has no code generators like GraphQL all code has to be written manually. That results in **more work by a magnitude**.

There are third party generators, tools and frameworks to help. In fact there is an entire industry built around making REST APIs work on Amazon — it is that complicated.

While in a few days it was possible to set up AppSync with React and play thoughtfully with optimizations and experience (Relay vs. Apollo) — spending the same time with the REST API was enough only to create and manage the schema. Adding the necessary Lamdba functions and data backend was unsuccessful with generators and tools provided by the ecosystem.

## REST

![The REST API on AWS](rest-api-aws.jpeg)
_Image credits: [https://iotdemos.wordpress.com](https://iotdemos.wordpress.com/2017/04/24/building-simple-back-end-using-aws-dynamodb-lambda-api-gateway/)_

To catch the glimpse of the REST on AWS complexity one should watch these official videos. The first deals with [the difficulty to create an API](https://www.youtube.com/watch?v=xkDcBssNd1g) and the second with [the difficulty of ensuring best practices](https://www.youtube.com/watch?v=9ElpSPXk-g8).

Following the advice from the videos one should use the recommended tools to achieve better results faster:
[Swagger](https://swagger.io/), [Serverless](https://serverless.com/), [Claudia.js](https://www.claudiajs.com/) — or even try Amazon's own [Amplify](https://aws.amazon.com/amplify/).

My personal experience: no success. Bugs, outdated code and documentation, undocumented features, [frightening](https://serverless.com/blog/node-rest-api-with-serverless-lambda-and-dynamodb) [amount of code](https://serverless.com/blog/serverless-express-rest-api) to be written.

The conclusion left is that AWS REST APIs are of past, complicated, and expensive.

## GraphQL

GraphQL is the successor of REST. It offers the following advantages:

#### 1. Flexible API

GraphQL needs no versioning. One of the pain points of REST APIs was to iterate over versions yet keep it transparent to API clients and end users.

GraphQL removes that and keeps the development and maintenance time smaller.

#### 2. Data-driven apps with real-time and offline capabilities

REST APIs were an artifact before the mobile era. They simply served atomic data per atomic requests. Like a list of all articles for the `/articles` URL. Nothing more.

With mobile devices the requirements changed: there is a need for smarter and low-bandwidth queries (composed on the fly versus the usual REST CRUD operations) which even can be pushed without request (real-time) and are resilient when network services are unavailable (offline capabilities).

A GraphQL app can request all articles together with authors, comments and likes in a single query. This data is automatically cached locally for offline access, and when one of its part is updated (let’s say new article added) the new data is pushed to the device and visualized automatically.

A complete example of a GraphQL stack is the [Facebook 2019 redesign and rewrite](https://developers.facebook.com/videos/2019/building-the-new-facebookcom-with-react-graphql-and-relay/).

## AppSync

![The AWS AppSync Management Console](aws-appsync-management-console.png)

[AppSync](https://aws.amazon.com/appsync/) is Amazon's GraphQL service. Manages the API schema, the queries for the schema, the data sources attached to a schema, and the functions / business logic reused across the schema / app.

The great thing, the magic of AppSync is that one has to work only on the schema and forget the rest.

After defining the schema you'll get all GraphQL queries, mutations and subscriptions automatically generated with a single click. And a public URL with a working API out of the box.

Next, by using the [AWS Amplify Framework](https://aws.amazon.com/amplify/) — a command line tool to create, manage and implement Amazon web services — with a few simple commands everything else can be set up again, like data, authentication, storage bindings; hosting and even various web and mobile clients to consume the API.

With AppSync and Amplify one can have a mobile-friendly API server and client in ... minutes. Once a schema is done the rest is done by AWS.

# Summing up

			GraphQL
			REST

			Services to manage
			AppSync
			API Gateway, AWS Lambda, DynamoDB

			Official toolchain
			AWS Amplify
			none

			Code generators
			Functions, Data, Storage, Authorziation, Hosting
			none

			Client SDKs
			iOS, Android, Web, React Native
			Java, JavaScript, Java for Android, Objective-C or Swift for iOS, and Ruby

			Suggested third party services
			none
			Swagger for schema; Serverless.com for tooling

			Development tasks
			Create GraphQL fragments
			Write a complete local server which will be deployed later to different AWS services

			Development environment
			React
			Node.js, Express

			Development skills
			Front-end
			Full stack, AWS engineering

## Resources

- [The Amazon API Gateway](https://aws.amazon.com/api-gateway/)
- [AWS AppSync](https://aws.amazon.com/appsync/)
- [The AWS Amplify Framework](https://aws.amazon.com/amplify/)
- [Building the New facebook.com with React, GraphQL and Relay](https://developers.facebook.com/videos/2019/building-the-new-facebookcom-with-react-graphql-and-relay/)
- [Deploy a REST API using Serverless, Express and Node.js](https://serverless.com/blog/serverless-express-rest-api)
- [Building a REST API in Node.js with Lambda, API Gateway, DynamoDB, and Serverless framework](https://serverless.com/blog/node-rest-api-with-serverless-lambda-and-dynamodb/)
- [Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech Talks](https://www.youtube.com/watch?v=xkDcBssNd1g)
- [Best Practices for Building Enterprise Grade APIs with Amazon API Gateway - AWS Online Tech Talks](https://www.youtube.com/watch?v=9ElpSPXk-g8)
- [Swagger](https://swagger.io/)
- [Serverless](https://serverless.com/)
- [Claudia.js](https://www.claudiajs.com/)

repository: metamn/react

gha_license_id: NOASSERTION

repo_name: metamn/react


text:
# skywalker [![GoDoc](https://godoc.org/github.com/dixonwille/skywalker?status.svg)](https://godoc.org/github.com/dixonwille/skywalker) [![Build Status](https://travis-ci.org/dixonwille/skywalker.svg?branch=master)](https://travis-ci.org/dixonwille/skywalker) [![Build status](https://ci.appveyor.com/api/projects/status/d1h7lpf0pv546amh?svg=true)](https://ci.appveyor.com/project/dixonwille/skywalker) [![codecov](https://codecov.io/gh/dixonwille/skywalker/branch/master/graph/badge.svg)](https://codecov.io/gh/dixonwille/skywalker) [![Go Report Card](https://goreportcard.com/badge/github.com/dixonwille/skywalker)](https://goreportcard.com/report/github.com/dixonwille/skywalker)

Skywalker is a package to allow one to concurrently go through a filesystem with ease.

## Features

- Concurrency
- BlackList filtering
- WhiteList filtering
- Filter by Directory
- Filter by Extension
- Glob Filtering (provided by [gobwas/glob](https://github.com/gobwas/glob))

> For matching to work properly across platforms. Please use `/`. In [gobwas/glob](https://github.com/gobwas/glob) the `\` is an escape character (so you can escape `*`, `?`, etc...) making it difficult to know if you want to escape a character or go into directory.

## Example

```go
package main

import (
    "fmt"
    "sort"
    "strings"
    "sync"

    "github.com/dixonwille/skywalker"
)

type ExampleWorker struct {
    *sync.Mutex
    found []string
}

func (ew *ExampleWorker) Work(path string) {
    //This is where the necessary work should be done.
    //This will get concurrently so make sure it is thread safe if you need info across threads.
    ew.Lock()
    defer ew.Unlock()
    ew.found = append(ew.found, path)
}

func main() {
    //Following two functions are only to create and destroy data for the example
    defer teardownData()
    standupData()

    ew := new(ExampleWorker)
    ew.Mutex = new(sync.Mutex)

    //root is the root directory of the data that was stood up above
    sw := skywalker.New(root, ew)
    sw.DirListType = skywalker.LTBlacklist
    sw.DirList = []string{"sub"}
    sw.ExtListType = skywalker.LTWhitelist
    sw.ExtList = []string{".pdf"}
    err := sw.Walk()
    if err != nil {
        fmt.Println(err)
        return
    }
    sort.Sort(sort.StringSlice(ew.found))
    for _, f := range ew.found {
        fmt.Println(strings.Replace(f, sw.Root, "", 1))
    }
}
```

repository: dixonwille/skywalker

gha_language: Go

repo_name: dixonwille/skywalker


text:
# Being a developer in the cloud
About a year ago I checked out the Chromebook and thought to myself, "Would it not be great to do all my work in the browser?". Google has done fantastic work on their Docs, Spreadsheets, Hangouts etc. services. Spotify has a web player, I can see movies on netflix and just about everything else I do is related to the web and the browser. But what about developing in the browser?

So I got my Chromebook and registered to a service called [nitrous.io](http://www.nitrous.io). Nitrous is a service that allows you to easily setup a development environment in the browser. So what does that actually mean?

## An IDE
You need to type your code somewhere and as frightening as it may seem, you can do this in the browser. You are probably familiar with services like [jsfiddle](), [jsbin]() and the likes. Though the editors works quite well, they can not compare at all to a complete IDE. The nitrous IDE comes very close.

![IDE](/images/nitrous/IDE.png)

As you can see you have your file tree on the left and editor on the right. At the bottom you have your terminal, which I will come back to shortly. There are a few things you have come accostumed to using an IDE. Things like code completion, automatic indenting, syntax highlighting etc. So the nitrous IDE has syntax highlighting in place, with support for ES6 and even JSX works. It also automatically indents your code and fills in brackets as you type. If you are completely dependent on code completion you might be frustrated, as that is lacking. That said, since the nitrous IDE uses web technology it is able to do one amazing thing... collaboration.

### Collaborating
You are probably familiar with Google Docs collaboration. You can invite people to your document and as you are making changes, those changes can be seen live by your collaborators and you can of course see theirs. The nitrous IDE has this exact same functionality. As remote collaboration becomes more common, pair programming is an amazing experience using the nitrous IDE.

*Picture of that*

## The terminal
To develop web applications you need to set up a workflow. Personally I like to run an express server proxying to a webpack dev server. I have a repo for that [here]() here and we will use that as an example in this article. The great thing about nitrous as that you have your own complete linux environment. Especially if you are used to working on a MAC you will feel right at home.

When you set up your nitrous account you will set up a **container**. A container is like a template for your environment. There are many different containers, but the one really interesting for us web developers is the Node container. When the environment is up and running you have everything set up to start using Node and Node Package Manager (npm).

It is also worth mentioning that the terminal is running with a [zsh]() shell. This gives you a lot of neat features like indicating the git branch directly on the command line.

![IDE](/images/nitrous/terminal.png)

## Handling files
Often you need to move some files around or maybe you need to upload some images or fonts from a local folder. In terms of moving files around you can of course use the terminal, but simply by renaming a file you can move it to a different location.

![IDE](/images/nitrous/renaming.png)

To upload a file you simple choose a folder and drop files to the uploader.

![IDE](/images/nitrous/upload.png)

## Previews
To preview your application as you develop you just fire up a new tab. But before doing so you need to configure the ports. My convention is to run my development server on port 3000.

![IDE](/images/nitrous/ports.png)

When the port is ready for preview you can launch the preview from the toolbar and a new tab opens up.

## Addons

> Linting for keeping code practices

repository: christianalfoni/EmptyBox

repo_name: christianalfoni/EmptyBox


text:
# Stagehand_TestRunner

A continuous test runner for CLI

[![Total Downloads](https://poser.pugx.org/piece/stagehand-testrunner/downloads.png)](https://packagist.org/packages/piece/stagehand-testrunner)
[![Latest Stable Version](https://poser.pugx.org/piece/stagehand-testrunner/v/stable.png)](https://packagist.org/packages/piece/stagehand-testrunner)
[![Latest Unstable Version](https://poser.pugx.org/piece/stagehand-testrunner/v/unstable.png)](https://packagist.org/packages/piece/stagehand-testrunner)
[![Build Status](https://travis-ci.org/piece/stagehand-testrunner.svg?branch=4.1)](https://travis-ci.org/piece/stagehand-testrunner)

Stagehand_TestRunner is a continuous test runner to run unit tests in CLI.

It makes unit testing in a local environment much easier and comfortable. Additionally it can easily be integrated with a continuous integration server like [Jenkins](http://jenkins-ci.org/). It has been designed for integration into Integrated Development Environments (IDEs), a developer can create an extension like [MakeGood](http://piece-framework.com/projects/makegood).

![Continuous Testing and Notification](https://github.com/piece/stagehand-testrunner/wiki/images/continuous_testing_and_notification_800.png)

## Features

* Runs tests when a file is saved. (**Continuous Testing**)
* Runs tests in the specified directory.
* Runs tests in the specified file.
* Runs only the specified tests in the specified file.
* Runs only the tests in the specified classes.
* Colors the output.
* Preloads the specified PHP script before running tests.
* Notifies test results.
* Logs test results into the specified file in the [JUnit](http://www.junit.org/) XML format.
* Prints detailed progress report.
* Stops on the first failure or error.
* Specifies the test file pattern.
* Uses a YAML-based configuration file.
* Runs the phpunit command via the testrunner command.
* Supports [PHPUnit](http://phpunit.de/).

## Installation

`Stagehand_TestRunner` can be installed using [Composer](http://getcomposer.org/).

First, add the dependency to `piece/stagehand-testrunner` into your `composer.json` file as the following:

```
composer require piece/stagehand-testrunner "4.1.*"
```

Second, compile `Stagehand_TestRunner` for your environment as the following:

```console
vendor/bin/testrunner compile
```

## Support

If you find a bug or have a question, or want to request a feature, create an issue or pull request for it on [Issues](https://github.com/piece/stagehand-testrunner/issues).

## Copyright

Copyright (c) 2005-2015 KUBO Atsuhiro and [contributors](https://github.com/piece/stagehand-testrunner/wiki/Contributors), All rights reserved.

## License

[The BSD 2-Clause License](http://opensource.org/licenses/BSD-2-Clause)


text:
#   BLOG SITE
#### A web application
#### By **Sharon Faith**
## Description
Blog site is a website where both users and writers and interact. Users can view and comment on blog posts, and get to see the most recents ones first. Writers can sign up, write their blog posts and get feedback. Writers can also delete their blog posts or comments they do not find appropriate from their user profile page. The site also has random quotes on the homepage that change.

## Running the app
*  Access the app at the live site: https://the-blog-website.herokuapp.com

## Setup/Installation Requirements
* Use a desktop or laptop, phone or tablet.
* To install, go to URL : https://github.com/SharonFaith/blog-site then clone the repository with the git clone command in the terminal
* The repository can also be downloaded from the same URL:
* Unzip the file
* Move contents to folder you desire

## Known Bugs
- No known bugs

## Dependencies
* alembic
* blinker
* click
* dnspython
* dominate
* email-validator
* Flask
* Flask-Bootstrap
* Flask-Login
* Flask-Mail
* Flask-Migrate
* Flask-Reuploaded
* Flask-Script
* Flask-SQLAlchemy
* Flask-WTF
* gunicorn
* idna
* itsdangerous
* Jinja2
* Mako
* MarkupSafe
* psycopg2
* python-dateutil
* python-editor
* six
* SQLAlchemy
* visitor
* Werkzeug
* WTForms

## Technologies Used

- Python
- HTML
- CSS
- Bootstrap

## Support and contact details
Github account: SharonFaith

### License
*MIT License*
Copyright (c) {2020} **Sharon Faith**

repository: SharonFaith/blog-site

repo_name: SharonFaith/blog-site