text:
---
title: "Tech Reports"
permalink: /reports/
author_profile: true
redirect_from:
  - "/reports.html"
  - "/thesis/"
  - "/thesis.html"
  - "/theses/"
  - "/theses.html"
  - "/libra/"
  - "/libra.html"
  - "/diem/"
  - "/diem.html"
  - "/sui/"
  - "/sui.html"
---

This page references non peer-reviewed technical reports and whitepapers I co-authored.

{% assign sorted_papers = site.data.papers | sort: "date" %}

### Sui

{% assign libra = sorted_papers | where: "category", "sui" %}
{% for report in libra reversed %}
{% include paper.html paper=report %}
{% endfor %}

### Libra / Diem

{% assign libra = sorted_papers | where: "category", "libra" %}
{% for report in libra reversed %}
{% include paper.html paper=report %}
{% endfor %}

### Theses

{% assign theses = sorted_papers | where: "category", "thesis" %}
{% for report in theses reversed %}
{% include paper.html paper=report %}
{% endfor %}

### Others

{% assign others = sorted_papers | where: "category", "report" %}
{% for report in others reversed %}
{% include paper.html paper=report %}
{% endfor %}


text:
# Neuroscience_Inno2021
Labs for the Neuroscience course

## Morris-Lecar model

I followed equations [here](https://en.wikipedia.org/wiki/Morris%E2%80%93Lecar_model)

I simulated different values for current

Current = 0

![volt at current zero](images/current_0.png)

Current = 1

![volt at current zero](images/current_1.png)

Current changing between 0 and 1

![changing current](images/changing_current.png)

license: MIT

branch_name: refs/heads/main

extension: md

license_type: permissive


text:
# Function Traces and Logs
### With API Gateway, Go, Lambda, CloudWatch Logs and X-Ray

As we keep adding more functions with responsibilities for various services, it can become a challenge to spot and diagnose errors.

Imagine if we see error from a worker API. How do we know if error was due to:

- AWS API Gateway internal error
- AWS Lambda capacity problem
- Our worker function
- AWS S3 permission error

We will naturally add more logging to our Go code over time to help understand execution. But Go on Lambda offers a new and compelling strategy for observability: tracing.

Tracing is a technique that big companies like Amazon, Google and Twitter rely on to understand their large-scale distributed systems.

With tracing, every request that comes in is given a unique request ID. Then care is taken to pass this request ID along to every subsystem that works on the request so they can report detailed, structured information about how they handled the request. This information is reported as "segments" of work -- data with a start time, end time and other metadata like a function name, return value or error message.

One system might emit segments for many short function calls, then a single long RPC call. And the system that performs the RPC call itself might emit many segments for its function calls.

A centralized tracing service collects data from all the disparate systems and server and assembles them to provide a full picture of the life cycle of the request. We can now see total response time, individual steps and their duration, and in the case of a failure, pinpoint exactly where it happened.

## AWS Config -- X-Ray and Lambda

Tracing is a first-class concept on AWS Lambda. We can turn on "active tracing" in the SAM `Globals` section or as a property of every Lambda function:

```yaml
Globals:
  Function:
    Tracing: Active

Resources:
  WorkerFunction:
    Properties:
      Tracing: Active
    Type: AWS::Serverless::Function
```
> From [template.yml](../template.yml)

When this is enabled, AWS will automatically run a X-Ray daemon for our Lambda function.

## AWS Config -- X-Ray and API Gateway

Tracing is also a first-class concept on API Gateway. When enabled, a trace is generated when an API request starts, and includes its request type, response time, and status code. Unfortunately at the time of writing, SAM and CloudFormation don't support enabling tracing, but we can use a CloudFormation Custom Resource to manage the setting:

```yaml
Resources:
  ApiGatewayStage:
    Properties:
      RestApiId: !Ref ServerlessRestApi
      ServiceToken: !GetAtt CustomResourceFunction.Arn
      Stage:  !Ref ServerlessRestApiProdStage
      TracingEnabled: true
    Type: Custom::ApiGatewayStage

  CustomResourceFunction:
    Properties:
      CodeUri: ./handlers/custom-resource
      FunctionName: !Sub ${AWS::StackName}-CustomResourceFunction
      Handler: main
      Policies:
        - arn:aws:iam::aws:policy/AmazonAPIGatewayAdministrator
      Runtime: go1.x
    Type: AWS::Serverless::Function
```
> From [template.yml](../template.yml)

See [Setting up AWS X-Ray with API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-enabling-xray.html) for more details.

## Go Code -- Context pattern

Tracing is effectively a first-class concept in Golang too.

Go was created by Google with a goal of making distributed systems programming easy, so it should come as no surprise that it well-suited for tracing. The standard library has what we need: the [context package](https://golang.org/pkg/context/) and the Context type.

We may have noticed that every Lambda function takes a first argument of `ctx context.Context`. We also see the `ctx` argument in many other Go packages like the AWS SDK. This variable provides a way to share information, like a request ID or a parent segment structure, across all our code and 3rd party libraries we use. Go opts for a variable for safety -- we can't safely share data between all the systems, we have to pass data down to them.

```go
package gofaas

import (
	"context"
	"os"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/dynamodb"
	"github.com/aws/aws-sdk-go/service/kms"
	"github.com/pkg/errors"
)

func userPut(ctx context.Context, u *User) error {
	if u.TokenPlain != "" {
		out, err := KMS().EncryptWithContext(ctx, &kms.EncryptInput{
			Plaintext: []byte(u.TokenPlain),
			KeyId:     aws.String(os.Getenv("KEY_ID")),
		})
		if err != nil {
			return errors.WithStack(err)
		}

		u.Token = out.CiphertextBlob
		u.TokenPlain = ""
	}

	_, err := DynamoDB().PutItemWithContext(ctx, &dynamodb.PutItemInput{
		Item: map[string]*dynamodb.AttributeValue{
			"id": &dynamodb.AttributeValue{
				S: aws.String(u.ID),
			},
			"token": &dynamodb.AttributeValue{
				B: u.Token,
			},
			"username": &dynamodb.AttributeValue{
				S: aws.String(u.Username),
			},
		},
		TableName: aws.String(os.Getenv("TABLE_NAME")),
	})
	return errors.WithStack(err)
}
```
> From [user.go](../user.go)

When working with the AWS SDK we make sure to use the `WithContext` methods. See the [Context Pattern added to the AWS SDK for Go](https://aws.amazon.com/blogs/developer/context-pattern-added-to-the-aws-sdk-for-go/) to learn about more ways the context pattern helps us build our app.

## Go Code -- Xray SDK

Next we reach for the [aws/aws-xray-go-sdk package](https://github.com/aws/aws-xray-sdk-go). This gives us a way to generate segment data and send it to a local X-Ray daemon which will eventually forward traces to the X-Ray API.

To start, the SDK lets us wrap the AWS SDK so that all AWS API calls are traced:

```go
package gofaas

import (
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/dynamodb"
	"github.com/aws/aws-sdk-go/service/kms"
	"github.com/aws/aws-xray-sdk-go/xray"
)

func init() {
	xray.Configure(xray.Config{
		LogLevel: "info",
	})
}

// DynamoDB is an xray instrumented DynamoDB client
func DynamoDB() *dynamodb.DynamoDB {
	c := dynamodb.New(session.Must(session.NewSession()))
	xray.AWS(c.Client)
	return c
}

// KMS is an xray instrumented KMS client
func KMS() *kms.KMS {
	c := kms.New(session.Must(session.NewSession()))
	xray.AWS(c.Client)
	return c
}
```
> From [aws.go](../aws.go)

We can also use the X-Ray SDK to trace external HTTP calls, SQL calls, or create any custom segments and subsegments. Refer to the [X-Ray SDK for Go](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-go.html) developer guide for more details.

## Results

After we deploy the application and make some calls to the API or workers, we can browse to the X-Ray web console to view our traces:

The service map offers a overview of our app. We can see all of the calls into the API gateway, then our functions, then all the AWS APIs they consume. In the trace overview we can HTTP methods, response time and status.

Tracing can really help dig into problems. Note in this service map that we see errors with SNS calls. It turns out IAM permissions are incorrect... Tracing is already helping us pinpoint problems and we haven't added a single log!

Tracing also offers a deep dive into a function call. We can see our function took 324ms, and spent 140ms on the KMS call and 200ms on the DynamoDB call. This waterfall view can help us optimize our functions, which can ultimately save us money.

These are powerful views into our functions with little change to the code and config.

## AWS Config -- API Gateway and CloudWatch

API Gateway can automatically log requests, errors, request parameters, and response payloads. We can turn on logging and "data tracing" in the SAM `Globals` section for our API. Note that we also have to grant API Gateway permission to manage create CloudWatch log groups and events:

```yaml
Globals:
  Api:
    MethodSettings:
      - DataTraceEnabled: true
        HttpMethod: "*"
        LoggingLevel: INFO
        MetricsEnabled: true
        ResourcePath: /*

Resources:
  ApiGatewayAccount:
    Properties:
      CloudWatchRoleArn: !GetAtt ApiGatewayRole.Arn
    Type: AWS::ApiGateway::Account

  ApiGatewayRole:
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Action:
              - sts:AssumeRole
            Effect: Allow
            Principal:
              Service:
                - apigateway.amazonaws.com
            Sid: AllowServiceToAssumeRole
        Version: 2012-10-17
      ManagedPolicyArns:
        - arn:aws:iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs
      Path: /
    Type: AWS::IAM::Role
```

## Results

## Go Code -- Logging

Of course we can't ignore trusty logging to help us develop and debug Go functions. It's very common to aid development and debugging with `log.Printf()` statements:

```go
func MyHandler(ctx context.Context, e Event) error {
	log.Printf("MyHandler e: %+v\n", e)

	out, err := foo()
	log.Printf("MyHandler foo err=%q out: %+v\n", err, out)

	return err
}
```

It should be no surprise that Lambda supports this out of the box too. Logs printed to stdout and stderr are automatically captured and sent to CloudWatch Logs for future review.

## sam log command

We can use the `sam logs` command to review logs:

```shell
$ sam logs -n WorkerFunction --stack-name gofaas -t
2018/10/07/[$LATEST]68e50ab313c34257844b10666a0c8d62 2018-10-07T18:42:33.005000 START RequestId: c0385b8a-ca60-11e8-879c-8f9b7d940021 Version: $LATEST
2018/10/07/[$LATEST]68e50ab313c34257844b10666a0c8d62 2018-10-07T18:42:33.018000 2018/10/07 18:42:33 Worker Event: {SourceIP: TimeEnd:0001-01-01 00:00:00 +0000 UTC TimeStart:0001-01-01 00:00:00 +0000 UTC}
2018/10/07/[$LATEST]68e50ab313c34257844b10666a0c8d62 2018-10-07T18:42:34.698000 END RequestId: c0385b8a-ca60-11e8-879c-8f9b7d940021
2018/10/07/[$LATEST]68e50ab313c34257844b10666a0c8d62 2018-10-07T18:42:34.698000 REPORT RequestId: c0385b8a-ca60-11e8-879c-8f9b7d940021	Duration: 1672.96 ms	Billed Duration: 1700 ms 	Memory Size: 128 MB	Max Memory Used: 41 MB
...
```

The `sam logs` tool, and CloudWatch Logs dashboard and API offer additional ways to access logs by time, and to filter logs by a pattern. See `sam logs --help` and the [CloudWatch Logs User Guide](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html) for more details.

## Summary

When building an app with Go, API Gateway, Lambda, CloudWatch Logs and X-Ray we can:

- See internal AWS service traces
- Add traces of function AWS API calls
- Add traces of function HTTP calls
- Visualize function flow and errors
- Collect, tail and search request and function logs

We don't have to:

- Change our Go code
- Monkey patch the language internals
- Manage trace or log collectors
- Run trace or log servers

Go, tracing and logging make our app easier to observe.

repository: drajk/gofaas

branch_name: refs/heads/master

repo_name: drajk/gofaas


text:
raptor-cache
============
This module provides an caching layer that supports asynchronous reading and writing and it prevents duplicate work from being done by allowing a "hold" to be put on a cache entry. A common pattern when utilizing a cache is to read from the cache and to then build the cached value if it was not found in the cache. By putting a hold on a cache entry while its value is being built asynchronously, this caching layer can ensure that a value for a particular key is only built once by the current process. This module solves the challenges of working with asynchronous cache stores and provides out-of-box support for an in-memory cache and a disk-based cache. It is possible to provide a custom cache store that connects to a centralized cache such as [Redis](http://redis.io/) or [memcached](http://memcached.org/).

# Installation

```bash
npm install raptor-cache --save
```

# Example

```javascript
var raptorCache = require('raptor-cache');
var cache = raptorCache.createCache({
    store: 'disk',
    timeToLive: 10000, // Permanently remove a cache entry after 10s (regardless of usage)
    timeToIdle: 7000, // Permanently remove a cache entry that has not been accessed for 7s
    freeDelay: 5000, // Free all memory after 5s of inactivity

    // Disk store specific config:
    dir: '.cache/my-cache',
    flushDelay: 1000, // Commit cached values to disk after 1s of no write activity
    encoding: 'utf8'
});

cache.get(
    'hello', // key
    function builder(callback) { // This function will be called if the value has not been cached
        setTimeout(function() {
            // Respond back with the value to put in the cache
            callback(null, 'world');
        }, 1000)

    },
    function callback(err, value) {
        // value === 'world'
    });

// Request a stream to read a value:
cache.getReadStream(
    'hello', // key
    function callback(err, stream) {
        stream.pipe(process.stdin); // pipes out 'world'

        // NOTE: Stream will be null if nothing was cached for key
    });
```

# Cache Stores

### Memory Store

Characteristics:

- Every cache key and value is kept in memory

```javascript
var raptorCache = require('raptor-cache');
var cache = raptorCache.createMemoryCache({
    ...
});
```

### Disk Store (Combined File)

Characteristics:

- An in-memory representation of _all keys and all values_ is maintained at all times
- The in-memory cache is backed by a disk cache that is stored in a single file
- The cache file is read in its entirety the first time the cache is read or written to
- Whenever the in-memory cache is modified, a flush is scheduled. If a flush had already been scheduled then it is cancelled so that
    flushes can be batched up. Essentially, after a x delay of no activity the in-memory cache is flushed to disk
- Values cannot be null or undefined

NOTES:

- This cache store is not suitable for storing very large amounts of data since it is all kept in memory

Configuration options:

- flushDelay (int) - The amount of delay in ms after a modification to flush the updated cache to disk. -1 will disable autoamtic flushing. 0 will result in an immediate flush

```javascript
var raptorCache = require('raptor-cache');
var cache = raptorCache.createDiskCache({
    dir: 'some/directory',
    singleFile: true,
    flushDelay: 1000,
    ...
});
```

### Disk Store (Separate Files)

Characteristics:

- Each cached value is stored in its own file (as raw bytes)
- The cached values are not kept in memory (they can only be streamed from disk)
- An index is maintained to keep up with what is in the cache
- The entire index is kept in memory until the "free" delay is reached

Configuration options:

- flushDelay (int) - The amount of delay in ms after a modification to flush the updated cache to disk. -1 will disable autoamtic flushing. 0 will result in an immediate flush

```javascript
var raptorCache = require('raptor-cache');
var cache = raptorCache.createDiskCache({
    dir: 'some/directory',
    singleFile: false,
    flushDelay: 1000,
    ...
});
```

### Composite Store

Characteristics:

- One or more caches can be combined to produce a tiered cache
- Cache keys are looked up in order
- Cached values found in lower-tier caches are added to higher tiers
- New cache entries are added to all tiers
- Each individual cache can have its own settings

Configuration options:

- caches (Array) - An ordered array of caches

```javascript
var raptorCache = require('raptor-cache');
var cache = raptorCache.createCompositeCache({
    caches: [
        raptorCache.createMemoryCache(...),
        raptorCache.createDiskCache(...),
        ...
    ]
});
```


text:
# Informational signage for camps

Explains how the WiFi at Burning Man works. Designed to be consumed by the members and visiting users of WiFi offered at Burning Man camps.

Designed and written by @PaulColdren, and originally located https://docs.google.com/document/d/11fIUpADr0aOaUAj9jFAMdRO5J8WQty0RrYFv2FwaUts/.

Licensed freely.

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

# How do we have **WIFI** in the middle of this desolate hellscape???

**Black Rock City** needs reliable Internet connectivity for several organizational functions (ticketing, logistics, medical, public safety, etc.).

The **Burning Man Network Operations Team** provides this through a variety of technologies that are designed to operate in this complex environment and obtain connectivity back to "civilization" (commercial Internet fiber peering and transit).

This is a challenging but critical function, one of many parts of the **incredible behind-the-scenes engineering effort** that happens each year to make Burning Man possible.

The Network Operations Team (thanks Cat -^..^- !!) **provides surplus bandwidth as a gift to camps** , to support their art and to offer to participants.

Connectivity is blanketed across the playa using a series of **directional point-to-multipoint radios on a 60ft tower near Center Camp**.  These radios use a special protocol similar to (but not identical to) 5ghz WiFi to optimize for reliable distribution to camps:

|   |   |
|---|---|
| ![Sector map of Burning Man](images/SectorMap.png)  |  Camps that want connectivity must:

Obtain and configure a compatible radio

Safely obtain line-of-sight to the Center Camp tower

Provide the radio with a reliable source of powero

Provide some mechanism (2.4ghz wifi, etc…) for distributing connectivity within their camp.o
  |

**Engineering in this complex environment is part of our artistic expression and our gift to fellow participants.**

**We're glad that you've stopped by!**

repository: justinormont/BurningManWiFi

gha_license_id: MIT

repo_name: justinormont/BurningManWiFi


text:
---
layout: post
title: Greetings from Geneva-- I'm bringing back the blog!
date: 2019-09-17T22:00:00.000+00:00
category: blog

---
Dear all,

Work and life has meant that I've been constantly on the move for the past few months (in all honesty- for the past few years is probably more realistic): somewhere between Kathmandu, Washington DC, and Bristol. It feels good to be living somewhere long(er) term, and I'm excited to be based in Geneva.

Being stationary usually means that there's time to reflect and digest. For the past few months, I've had the opportunity to go through arsenals of old photographs, writings, field notes and emails. While some of that has been [posted here](https://www.instagram.com/mmntsbyanne/), I thought it might be nice to have my own space (as separate from a social network).

This will be a place to post thoughts, reflections, and adventures (both physical and intellectual). I hope that I'll be able to back-post some old writings, specifically letters and photographs that were sent when I was more mobile than not.

I must admit: blogs have always felt a little weird for me. I mean, why would anyone be interested in anything I have to say? Why take the things that I fiercely protect as private thoughts, and put them into a public space? Especially a 'public space' like the internet, where I'm inevitably bound to get myself in trouble? Is it narcissism? Post-teenage angst? A combination of all of the above, perhaps?

I'd like to think that this place will be a bit more than that. First and foremost, I'd like this blog to be for those that were too far away to know what I was up to at the time, and well as for anyone that happens to be interested in what I'm up to these days. Perhaps more selfishly: this blog will also be for myself, a way of keeping myself accountable to writing, publishing, and digesting the world as my lens evolves.

I'll inevitably make mistakes, but I might as well try. Let's see what happens!

Always,

Anne

gha_language: SCSS


text:
# transitchecker-service
This is the service that allows to check if the Vehicle is Allow To transit according to the  Ecuadorian "Pico y Placa" rules

# Software Requirements

* JDK 1.8 or greater
* Maven

# Info

This application demostrate the use of services, in this case the rules related to the "Pico y Placa" is serve by a REST service. The main goal is that service will be invoked by many front-end and IOT devices. For sample propouses I created an mobile App that Invoke this service.

# Build

In order to build this program, open a command line on the transitchecker-service path and execute

~~~~
  mvn spring-boot:run
~~~~

This command launch the Pico y Placa service on the port 8080

> If you need to run on a different port you can modify the src/main/resources/application.properties on the value of the server.port property

When you run this item you will be able to invoke the rest service with swagger-ui on the
following URL address:

~~~~
  http://localhost:8080/swagger-ui.html
~~~~

It will open a swagger ui with the explanation to invoke the service, please open the transit-check-controller operation, on the request field you can put the following JSON in order to invoke:

~~~~
{
  "date": "02/02/2020",
  "time": "17:29",
  "vehicleId": "ABB0233"
}
 ~~~~

 The service has three parameters on the JSON

 * date - The date in format dd/MM/yyyy
 * time - The time in format HH:mm
 * vehicleId - The "Placa" of the vehicle

 ![Invoke the service](screen1.png)

 # Android Application

 Alternatively on the [Transit Checker App Repository](https://github.com/cgsuarez/transitchecker) you can build and use an Android/iOS App (based on Flutter) that act like a client of the service. This client takes the "Placa" the Date to verify if its allowed to go, with the service. As you can see on the pictures below, in order to configure the URL of the service on the upper right corner you can modify the value of the URL of the server (by default the URL is the Android Emulator localhost IP)

  ![Mobile Screen](screen2.png)

  ![Mobile Screen](screen3.png)

repository: cgsuarez/transitchecker-service

gha_language: Java

repo_name: cgsuarez/transitchecker-service


text:
Algorithm

In this case, instead of looking for every peak following a valley, we can simply
go on crawling over the slope and keep on adding the profit obtained from every consecutive transaction.

 In the end,we will be using the peaks and valleys effectively, but we need not
 track the costs corresponding to the peaks and valleys along with the maximum
 profit, but we can directly keep on adding the difference between the consecutive numbers of the array if the second number is larger than the first one, and at the total sum we obtain will be the maximum profit. This approach will simplify the solution. This can be made clearer by taking this example:

[1, 7, 2, 3, 6, 7, 6, 7]

The graph corresponding to this array is:

Profit Graph:

From the above graph, we can observe that the sum A+B+CA+B+C is equal to the difference DD corresponding to the difference between the heights of the consecutive peak and valley.


text:
---
layout: post
title:  "Setting up ELK on my MacBook (Part 2)"
date:   2017-03-11 15:33:28 -0500
categories: blog
---

Now that I have Elasticsearch and Kibana up and running, I need to start feeding in those sweet, sweet logs.
Normally, one would setup LogStash to import these logs into Elasticsearch but those clever cats at Elastic have created Beats to help. [Beats](https://www.elastic.co/products/beats/winlogbeat) is the platform for single-purpose data shippers. They install as lightweight agents and send data from hundreds or thousands of machines to Logstash or Elasticsearch. In this post I am going to cover installing winlogbeat and packetbeat on my Windows 10 VM and configuring them to talk to my Elasticsearch running on my MacBook.
### 0. Virtual Machine Setup
Although not extremely important to the process below, here is the high level notes about the VM:
* OS Name:                   Microsoft Windows 10
* OS Version:                10.0.14393 N/A Build 14393
* System Model:              VirtualBox
* System Type:               x64-based PC
* Total Physical Memory:     2,048 MB
* Installed Software:
  * Sysmon v6.0
  * Chrome Version 57.0.2987.98 (64-bit)
  * Notepad++ 7.3.3
  * WireShark Version 2.2.5 (v2.2.5-0-g440fd4d)
  * Greenshot <IP_ADDRESS>

### 1. Download WinLogBeat
I grabbed my copy (5.2.2) from [https://www.elastic.co/downloads/beats/winlogbeat](https://www.elastic.co/downloads/beats/winlogbeat)

### 2. Unzip and configure WinLogBeat
Should look like this:

![WinLogBeat Files]({{ site.baseurl }}/images/winlogbeat1.png)

We need to edit the winlogbeat.yml before we install the service.
#### 2.1 Edit the Logs WinLogBeat is listening to
I changed the default config from this:
{% highlight yml %}
winlogbeat.event_logs:
  - name: Application
    ignore_older: 72h
  - name: Security
  - name: System
{% endhighlight %}
to include sysmon and a few of the other bigger logs from this Windows 10 machine:
{% highlight yml %}
winlogbeat.event_logs:
  - name: Application
    ignore_older: 72h
  - name: Security
  - name: System
  - name: Microsoft-Windows-Sysmon/Operational
  - name: Microsoft-Windows-Store/Operational
  - name: Windows PowerShell
{% endhighlight %}

#### 2.2 Configure network settings for Elasticsearch
On my MacBook I have Elasticsearch configured to run on <IP_ADDRESS>:9200 which means port 9200 on all network interfaces including the network interface VirtualBox setup for the default gateway for the VM.
![WinLogBeat Files]({{ site.baseurl }}/images/winlogbeat2.png)

A quick check of the VM's network info tells me the default gateway is <IP_ADDRESS>.
So I changed:
{% highlight yml %}
#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["localhost:9200"]
{% endhighlight %}
To:
{% highlight yml %}
#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["<IP_ADDRESS>:9200"]
{% endhighlight %}

I had to change this file again to include authentication creds when I installed the XPACK plugin but I will get there in another post. Baby steps people. Baby steps.
### 3. Install WinLogBeat
Included in the WinLogBeat files is a handy dandy install-service-winlogbeat.ps1 that does the heavy lifting for installing the WinLogBeat service. Simply Run that file and then start the service.
![WinLogBeat Files]({{ site.baseurl }}/images/winlogbeat3.png)
Now you should be sending logs from WinLogBeat to Elasticsearch. To confirm, check out the terminal window running Elasticsearch and you should see something like this:
{% highlight raw%}
[2017-03-12T18:07:59,156][INFO ][o.e.c.m.MetaDataMappingService] [Bo2nJmM] [winlogbeat-2017.03.12/Du3zdxHXQvivwrVBi6czJQ] update_mapping [wineventlog]
{%endhighlight%}
### 4. Configure Kibana to index WinLogBeat logs
Now that logs have a freely flowing into Elastic, it is time to update Kibana with an index. Under management, go to Index Patterns.
![WinLogBeat Files]({{ site.baseurl }}/images/winlogbeat4.png)
In the field, put "winlogbeat*" to start indexing these logs.
![WinLogBeat Files]({{ site.baseurl }}/images/winlogbeat5.png)
Then click on discover and BOO YAH we have logs.
![WinLogBeat Files]({{ site.baseurl }}/images/winlogbeat6.png)

### 5. Download, Configure, and Install PacketBeat The Same Way

Download PacketBeat from [here](https://artifacts.elastic.co/downloads/beats/packetbeat/packetbeat-5.2.2-windows-x86_64.zip).
PacketBeat on Windows does require a prior installation of [WinPcap](https://www.winpcap.org/install/bin/WinPcap_4_1_3.exe). I installed [WireShark](https://www.wireshark.org/#download) and opted to install WinPcap at the same time. You do what you feel is best.
After you extract the packetbeat package on the Windows guest, configure the packbeat.yml to point to the Elasticsearch on the MacBook.
Change:
{% highlight yml %}
#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["localhost:9200"]
{% endhighlight %}
To:
{% highlight yml %}
#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["<IP_ADDRESS>:9200"]
{% endhighlight %}
I also had to change this file again to include authentication creds when I installed the X-Pack plugin but I will get there in the aforementioned post.
### Next Post?
So there you have have it. In my next post I will cover installing the X-Pack plugin and dig into some of the modifications I made to the Graph plugin to make my logs looks like this:
![WinLogBeat Files]({{ site.baseurl }}/images/winlogbeat7.png)
and THIS ...
![WinLogBeat Files]({{ site.baseurl }}/images/winlogbeat8.png)

gha_language: HTML


text:
# nonce-generator

Generates a random alphanumeric string of the given length.

```javascript
var nonce = require('nonce-generator');
console.log(nonce(5));
```

Would print a 5 character string such as `rspci`.


text:
# yt-scripts
A set of avisynth scripts that I use for my youtube videos.

The python script _buildavs.py_ generates an avs file for to process the audio. MEGui available at https://sourceforge.net/projects/megui/ is a really great wrapper around avisynth.

## Music
In the scripts are some creative commans copyrighted files which are available on-line at.
Intro: Creepy Background Sound by Daniel Simion is available at http://soundbible.com/2165-Creepy-Background.html
Outro: Owl's Secret from The Owl by Daria Shakhova is available at http://freemusicarchive.org/music/The_Owl/Fairy_Forest/the_owl_-_owls_secret

license: Unlicense

repository: duncanwebb/yt-scripts

repo_name: duncanwebb/yt-scripts


text:
# Overview

A microservices-demo service that provides shopping carts for users.  Based on a generic microservices application, built [weaveworks](https://github.com/microservices-demo/carts).

This contains the expected folders and files to work with the [keptn framework](https://keptn.sh/docs)
* ```Jenkinsfile``` - build app, create a docker image
* monspec folder with these file:
  * ```<service>_monspec.json``` - used during quality gate check
* ```perfspec/``` folder with these file:
  * ```perfspec.json```
  * ```perfspec_dynatrace.json```
  * ```perfspec_prometheus.json```
* ```jmeter/``` folder with three files:
  * ```basiccheck.jmx``` - used a post-deployment valiation to ensure service is running
  * ```<service>_perfcheck.jmx``` - used as a warmup prior to load test
  * ```<service>_load.jmx``` - used as a load test

Other noteworthly files in this repo
* ```keptn-onboarding/``` folder - the YAML files passed in the keptn CLI for on-boarding the carts project and services
* ```keptn-scripts/``` folder - example scripts that are helpful when following the [cart app keptn use cases](https://keptn.sh/docs)
* ```api-spec/``` folder - contains the files as to produce REST api explorer for the root URL
* ```version``` file - the value in this file is using in the Jenkins built to label the Docker image
* ```src/main/resources/application.properties``` file - can be updated to control service behavior such as simulated problems

# Keptn Onboading

Assuming you have a cluster with [Keptn](https://keptn.sh/docs) installed as well as the [keptn CLI](https://keptn.sh/docs) configured to your git org, you can run these command to create a project and onboard the carts services and carts mongo database.
```
cd keptn-onboarding

# create the project
keptn create project carts-project shipyard.yaml

# onboard carts
keptn onboard service --project=carts-project --values=values_carts.yaml

# onboard carts database
keptn onboard service --project=carts-project --values=values_carts_db.yaml --deployment=deployment_carts_db.yaml --service=service_carts_db.yaml
```

# keptn example scripts

These scripts are helpful when following the [cart app keptn use cases](https://keptn.sh/docs). To try out the scripts just run these commands
```
cd keptn-scripts

# show the Keptn pods and ingress gateway
./showKeptn.sh

# show the Dynatrace pods and Dynatrace Kube secrets file
./showDynatrace.sh

# show the URL to the running Jenkins server
./showJenkins.sh
```

# Local development

Assumes to have mongoDB running with uri of mongodb://carts-db:27017/carts-db

### Building
mvn -B clean package

### Running
mvn spring-boot:run

repository: jahn-keptn/carts-rob-mockup

repo_name: jahn-keptn/carts-rob-mockup


text:
High level design of OPS-RESTAPI
============================

The rendering of REST API documentation primarily utilizes Swagger-UI for presenting to users. The REST API data file is automatically generated from the extended OVSDB schema file and its companion XML description. The REST API data file also includes API definitions for other interfaces such as full configuration manipulation and user login management.

Reponsibilities
---------------
The REST API rendering module is responsible for serving the generated REST API documentation on switches. The generatiing of the REST API data file is done by the REST API servicing module during the build.

Design choices
--------------
The REST API data file is mostly generated automatically based on the extended OVSDB schema file and its companion XML description file instead of creating a completely new resource structure. There are a few fixed sections that are not derived automatically from the extended schema, such as full configuration manipulation and user login. This works for DevOps, but may not be the best choice for other uses such as replacing a web UI that is geared towards serving system administrators.

Both the rendering and servicing of the REST API are from the same IP address and port number, but differ only in their URL paths. By default when the server of the REST API is left unspecified in the REST API data file, the REST API server is assumed to be on the same IP address and port number as where the API data file is rendered from. If a customized REST server setting is used, both the IP address and the port number need to be specified. In order to avoid retrieving IP address information from the switch and dynamically setting it at runtime, the above tradeoff is made for simplicity.

Relationships to external OpenSwitch entities
---------------------------------------------

```ditaa
                    +
 Build time         |       Runtime
                    |
                    |
apidocgen.py        |       REST daemon
         ^          |          ^
         |          |          |
         |          +          |
         |                     |
      +--+---------------------+-+
      | Tables and relationships |
      | Column attributes        |
      +-----------+--------------+
                  ^
                  +
             restparser.py
                  ^
                  |
      +-------------------------+
      | Extended  | XML         |
      | OVSDB     | description |
      | schema    | file        |
      +-----------+-------------+

```

The automatic generation of the REST API documentation and the REST API service engine share a common Python library for analyzing the extended OVSDB schema and its companion XML description. The result is a list of OVSDB tables that need to be exposed in the REST API and the column attributes of each table. This data is used at build time for generating REST API documentation and at runtime for driving the processing of REST API requests.

OVSDB-Schema
------------
In addition to using the extended OVSDB schema, the shared Python library restparser.py uses information contained in the XML description file for the OVSDB schema.

Internal structure
------------------
The automatic generation of the REST API documentation is done in two steps.

The first step is to analyze the extended OVSDB schema based on the tagging information added and to also analyze its companion XML description for the description and extra type information of each column. This is processed in restparser.py.

From the extended OVSDB schema, two groups of tags ("category" and "relationship") are analyzed to capture the following information, namely:

 - A list of tables that are exposed to REST API.
 - The relationships between the tables (parent-child or reference).
 - Column attributes of each table ("configuration", "status" or "statistics") and their valid ranges.

From the companion XML description file, the information utilized is the description and the extra type information for certain columns. For regular attributes of base types (integer, string), there may be additional restrictions on the range of valid values. For attributes of key-value pairs, there can be information on the allowed keys as well as information about the valid ranges for the values.

The second step is to generate the REST API documentation for use by Swagger-UI automatically based on the information collected in the first step. The following procedures are performed:

 - The URI and allowed operations on the system table are generated;
 - The URI and allowed operations for each child table of the table processed are recursively generated;
 - The reference list to other tables in a table are treated the same as other attributes of the given table;
 - Those tables referenced by other tables but do not belong to any other table as children are treated as subresources under /system;
 - Regular columns of a table are grouped into one of the three categories ("configuration", "status" and "statistics") and definitions are created for them accordingly;
 - Each attribute contains descriptions extracted from the XML description file.

The generated REST API data file is then combined with other sections that are not derived from OVSDB schema. These include:

 - /system/full-configuration: it handles full declarative configuration manipulations;
 - /login: it handles user login and cookie setting.

References
----------
* [REST API servicing engine](http://www.openswitch.net/docs/REST_daemon_design.md)
* [Sample REST API documentation](http://api.openswitch.net/rest/dist/index.html)
* [Swagger-UI](http://swagger.io)


text:
## Blog Example
Simple yet full-featured example of GraphQL API. Models blogging platform with Stories, Users
and hierarchical comments.

### Run locally
```
php -S localhost:8080 ./graphql.php
```

### Test if GraphQL is running
If you open `http://localhost:8080` in browser you should see `json` response with
following message:
```
{
  data: {
    hello: "Your GraphQL endpoint is ready! Install GraphiQL to browse API"
  }
}
```

Note that some browsers may try to download JSON file instead of showing you the response.
In this case try to install browser plugin that adds JSON support (like JSONView or similar)

### Debugging Mode
By default GraphQL endpoint exposed at `http://localhost:8080` runs in production mode without
additional debugging tools enabled.

In order to enable debugging mode with additional validation, error handling and reporting -
use `http://localhost:8080?debug=1` as endpoint

### Browsing API
The most convenient way to browse GraphQL API is by using [GraphiQL](https://github.com/graphql/graphiql)
But setting it up from scratch may be inconvenient. An easy alternative is to use one of
the existing Google Chrome extensions:
- [ChromeiQL](https://chrome.google.com/webstore/detail/chromeiql/fkkiamalmpiidkljmicmjfbieiclmeij)
- [GraphiQL Feen](https://chrome.google.com/webstore/detail/graphiql-feen/mcbfdonlkfpbfdpimkjilhdneikhfklp)

Set `http://localhost:8080?debug=1` as your GraphQL endpoint/server in one of these extensions
and try clicking "Docs" button (usually in the top-right corner) to browse auto-generated
documentation.

### Running GraphQL queries
Copy following query to GraphiQL and execute (by clicking play button on top bar)

```
{
  viewer {
    id
    email
  }
  user(id: "2") {
    id
    email
  }
  stories(after: "1") {
    id
    body
    comments {
      ...CommentView
    }
  }
  lastStoryPosted {
    id
    hasViewerLiked

    author {
      id
      photo(size: ICON) {
        id
        url
        type
        size
        width
        height
        # Uncomment following line to see validation error:
        # nonExistingField

        # Uncomment to see error reporting for fields with exceptions thrown in resolvers
        # fieldWithError
        # nonNullFieldWithError
      }
      lastStoryPosted {
        id
      }
    }
    body(format: HTML, maxLength: 10)
  }
}

fragment CommentView on Comment {
  id
  body
  totalReplyCount
  replies {
    id
    body
  }
}
```

### Run your own query
Use GraphiQL autocomplete (via CTRL+space) to easily create your own query.

Note: GraphQL query requires at least one field per object type (to prevent accidental overfetching).
For example following query is invalid in GraphQL:

```
{
    viewer
}
```

Try copying this query and see what happens

### Run mutation query
TODOC

### Dig into source code
Now when you tried GraphQL API as a consumer, see how it is implemented by browsing
source code.

repository: vuefront/prestashop

gha_language: PHP

repo_name: vuefront/prestashop


text:
# Exercise II:  Scala

## Getting Started

- A good way to get started with Scala is to check out [Twitter's Scala School](http://twitter.github.io/scala_school/)

- You can also try a few [Scala Exercises](https://www.scala-exercises.org/scala_tutorial/terms_and_types)

- Additionally, github has a list of [awesome scala resources](https://github.com/lauris/awesome-scala)

- Here are some [scala best practices](http://twitter.github.io/effectivescala/)

- You can also use the [scala REPL](ex2-scala-REPL.md)

----
## Exercise

In this exercise, we are going to build a simple command line application using Scala and SBT.


text:
## Architecture

There are three primary parts to the eRegulations application: a parser that converts regulation text into data (regulations-parser), an API that hosts this data (regulations-core), and a webapp which uses the data from the API to construct beautiful and usable regulations (regulations-site).

One would typically run the parser against a regulation once (for each version) to populate the API with all the necessary data. regulations-site would then use regulations-core to as necessary to display regulations.

repository: jehlers/eRegulations

branch_name: refs/heads/gh-pages

repo_name: jehlers/eRegulations


text:
# AzureTwins Library

AzureTwins is a library, that helps you work with [Azure Twins API](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-device-twins). It supports full set of operations provided by the service.

**NOTE:** The library tries to maintain permanent MQTT connection to Azure Twin to receive
any asynchronous updates. However it case of connection failure it doesn't restore
connection automatically. This should be taken care of by the application.

### Prerequisites

AzureTwins library requires [AzureIotHub](https://github.com/electricimp/AzureIoTHub)
to be included as well. This is needed for authentication procedure with
[Device Connection String](https://github.com/electricimp/AzureIoTHub#device-connection-string)
as credentials.

This dependency between the libraries can easily be resolved as needed.

### How to create AzureTwin client

The client requires [Device Connection String](https://github.com/electricimp/AzureIoTHub#device-connection-string),
connection status listener, a listener for desired properties updates and method invocation listener
as constructor parameters.

``` squirrel
#require "AzureIoTHub.agent.lib.nut:2.1.0"
@include "../AzureTwins.agent.lib.nut"

function onUpdated(version, body) {
}

function onMethod(method, data) {
    return "200";
}

function onConnect(status) {
}

twin <- AzureTwin(connectionString, onConnect, onUpdate, onMethod);
```

#### `onConnect` callback

`onConnect` callback receives AzureTwins connection status.

| Status | Description |
| ------ | ------------|
| *AT_DISCONNECTED* | The connection was lost. To reconnect call `reconnect()` method. |
| *AT_CONNECTING*   | The library tries to establish connection |
| *AT_CONNECTED*    | MQTT connection established |
| *AT_SUBSCRIBING*  | The library tries to subscribe to specific topic to receive </br> notifications |
| *AT_SUBSCRIBED*   | The library is up and ready |

#### `onUpdate` callback

`onUpdate` receives updates to the desired properties when they happen. It accepts desired properties document version and body.

The library follows [this document](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-mqtt-support#receiving-desired-properties-update-notifications) for this functionality implementation.

**NOTE**: `body` is provided in a form of string as it receives from the server. No validation and parsing are performed.

#### `onMethod`

[`onMethod`](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-direct-methods) is called in response to 3d party request. The function accepts method **name** and set of parameters in form of unparsed string.

**NOTE** The callback MUST return status code from the set of [HTTP status codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)

### How to get latest version of Azure Twin document

`getCurrentStatus` method may be used to retrieve latest state of the twin document in JSON format. Its implementation follows [the spec](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-mqtt-support#retrieving-a-device-twins-properties)

The function accepts single callback function that is executed when a response is received or an error happens.

``` squirrel

function onStatusReceived(err, body) {

}

twin.getCurrentStatus(onStatusReceived);

```

The signature of the callback function is the following

| Parameter | Description |
| --------- | ----------- |
| *error*   | If not *null* indicates error condition. |
| *body*    | Unparsed JSON document. May be *null* in case of error |

### How to update device twin's reported properties

`updateStatus` method may be used to patch twin's reported properties. Its implementation follows [the spec](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-mqtt-support#update-device-twins-reported-properties)

The function accepts new set of properties in a form serialized JSON document and a callback function that is executed when document is updated or in case of communication issues.

The signature of the callback function is the following

| Parameter | Description |
| --------- | ----------- |
| *error*   | If not *null* indicates error condition. |
| *body*    | Unparsed JSON document. Contains the new ETag value for the reported properties collection |


text:
# TCHSM Demo

# Demo of a DNS server with DNSSEC support using the TCHSM
Docker based demo of the TCHSM as cryptographic backend on BIND and [OpenDNSSEC](opendnssec.md). The demo uses the PKCS#11 implementation of OpenDNSSEC because the [native implementation of BIND have problems](bind_problems_PKCS11.md).

# Overview
This implementation of TCHSM work with BIND and OpenDNSSEC cooperatively, it uses BIND to manage DNS Server and OpenDNSSEC to support DNSSEC using TCHSM as an HSM to store keys. The demo include in the dokerfile installation of OpenDNSSEC, BIND and Webmin, for default it working with CentOS 7.

## Run the Demo

There is an included script to build and run the demo.

To build, execute: ```demo.sh build```

To start the demo: ```demo.sh start```

To stop the demo: ```demo.sh stop```

## Details

The demo will start 4 docker containers, three of them are nodes and the fourth is a dns server serving a dummy example.com zone, using TCHSM as backend to sign the DNSSEC records. Docker is configured to expose the DNS server in the port 54 of the host computer, you can modify it at the demo.sh script.

### Nodes

Each node is an instance of our `tchsm-node-alpine` docker container run with the following command, which also mounts the node's config file into the container:

```
docker -D run --net=tchsm -d -v /full/path/to/node$i.conf:/etc/node$i.conf --name node-$i tchsm-node-alpine -c /etc/node$i.conf
```

Each node's config file looks like this:
```
node:
{
	masters = (
		{
		public_key="peE<k[?.}r>kaxZ?Bxsb/S0C?I3HDjp0>x!YSsht",
		id="MASTER_MOCK_ID1"
		}
	)
	router_port=2121,
	sub_port=2122,
	database="/etc/node_1.db",
	private_key="3Dl<rS3qN+{1#*HL[z<VNy7kFw-aU/+iL^1fxU.l",
	public_key="Xp0%>K&/mGA+Y!=-gtX2?.N&!C-)ag5xPhKbK).@",
	interface="*"
}
```

The file specifies the master's public key and id as well as the ports the node will listen on and it's own public and private keys for signing. These files can be generated using the `create_config.py` script from [https://github.com/niclabs/tchsm-libdtc](https://github.com/niclabs/tchsm-libdtc). The config files used for the demo were created with the following options:

```
python create_config.py -db "/etc/node" -cdb "/etc/tchsm-cryptoki" "node-1":2121:2122 "node-2":2123:2124 "node-3":2125:2126
```

To see how to configure and run a single node see [our node web admin](https://github.com/niclabs/docker/tree/master/tchsm/node-webadmin).

Before running the server we copy the configuration files from the `conf_files/` directory into the container.
 - `cryptoki.conf`: This file configures the master for the nodes and contains the master public and private keys, it also contains a list of all the nodes including their IP addresses, ports and public keys.
 - `bind/zones/db.example.com`: File with the example.com DNS records.
 - `run.sh`: Script to be run by the container on startup. The script configures the knot server top use the tchsm version of the libpkcs11.so library, then generates the keys for the example.com zone and finally starts the knot server.

### How to test DNSSEC validation

Run this command for check if the DNS domain if effectively DNSSEC signed,there exist three types of anwsers.

```
dig pir.org +dnssec +multi
```
**1.** Requesting a DNSSEC singed DNS domain should return an answer including the AD-Flag (Authenticated answer) set in the header and NOERROR in status.

  IN A

;; Query time: 277 msec
;; SERVER: <IP_ADDRESS>#53(<IP_ADDRESS>)
;; WHEN: Mon Jan 07 18:06:44 UTC 2019
;; MSG SIZE rcvd: 40
```
###### Example:

**3.** Requesting a domain that is not DNSSEC signed should return NOERROR in status.

repository: niclabs/docker

gha_language: Shell

repo_name: niclabs/docker


text:
---
hrs_structure:
  division: '3'
  volume: '12'
  title: '28'
  chapter: '516'
  section: 516-65
type: hrs_section
tags:
  - Property
  - Family
menu:
  hrs:
    identifier: HRS_0516-0065
    parent: HRS0516
    name: 516-65 Extension
weight: 37210
title: Extension
full_title: 516-65 Extension
---
**§516-65 Extension.** From time to time during the first twenty years of the term of any lease, the lessee shall have the right to extend the lease term to fifty-five years, commencing on the first day of the calendar month in which the lessee gives written notice thereof to the lessor, subject to the following conditions:

(1) At the time the right to extend the lease is exercised, the unexpired term of the lease is less than fifty years;

(2) The extension is for the purpose of mortgaging the leasehold interest;

(3) The lessee is not then in default in any respect under the lease; and

(4) The notice is accompanied by payment of a reasonable service charge.

This section applies only to leases executed and effective subsequent to June 24, 1967\. [L 1967, c 307, §38; [HRS §516-65](/title-28/chapter-516/section-516-65/)]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
# WoWDatabaseEditor
Editor for Smart Scripts for TrinityCore based servers.

This project is continuation of [Visual SAI Studio](https://github.com/BandyscLegacy/VisualSAIStudio), but rewritten from scratch. It is still in early stages, but anyone is welcome to help :-) Together we can make great wow emu editor!

Thanks to:
 * [tgjones](https://github.com/tgjones/gemini) for Gemini Graph Editor
 * WDBXEditor for dbc loading
 * Atlantiss - the editor begin as internal tool
 * TrinityCore, Cmangos and everyone who contributes to WoW Core!

![screenshot2](https://raw.githubusercontent.com/BAndysc/WoWDatabaseEditor/master/Examples/blueprints_screenshot.png)
![screenshot](https://github.com/BAndysc/WoWDatabaseEditor/blob/d012bc3ffcac3b12328033b29ebf0d8b49df34eb/Examples/screenshot.png?raw=true)

repository: Kittnz/WoWDatabaseEditor

repo_name: Kittnz/WoWDatabaseEditor


text:
---
layout: default
---

# 1996-11-18 - Re: HP announcement

## Header Data

From: Mike McNally<EMAIL_ADDRESS>To: Greg Broiles<EMAIL_ADDRESS>Message Hash: 37be48404028a3131dc25fb6da27650f828c7cca584fbeb31b209662dc232720

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-11-18 19:28:26 UTC

Raw Date: Mon, 18 Nov 1996 11:28:26 -0800 (PST)

## Raw message

```
{% raw  %}From: Mike McNally<EMAIL_ADDRESS>Date: Mon, 18 Nov 1996 11:28:26 -0800 (PST)
To: Greg Broiles<EMAIL_ADDRESS>Subject: Re: HP announcement
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Greg Broiles wrote:
>
> HP has info on its new crypto stuff on the web now:

One of the subheadings in the white paper: "Toward a New Commercial
Order."  Ya gotta love it.

A lot of the security (that is, "security" from the point of view of
nervous Federales) seems to rely on certificates and tokens that are
supposedly spoof-proof (I guess).  Looks to me as if application
certificates will be rather difficult to protect from being "abused".
It's also not clear to me how they'd prevent my flying to Luxembourg,
getting a Policy token that allows any & all crypto functions, and
then flying my butt back to Singapore for an encryption party.

______c_________________________________________________________________
Mike M Nally * IBM % Tivoli * Austin TX  * How quickly we forget that
<EMAIL_ADDRESS><EMAIL_ADDRESS>* "deer processing" and "data
http://www.io.com/~m101/                 * processing" are different!

{% endraw %}
```

## Thread

+ Return to [November 1996](/archive/1996/11)

+ Return to "[Greg Broiles <gbroiles@netbox.com>](/authors/greg_broiles_gbroiles_at_netbox_com_)"
+ Return to "[Lucky Green <shamrock@netcom.com>](/authors/lucky_green_shamrock_at_netcom_com_)"
+ Return to "[Mike McNally <m5@tivoli.com>](/authors/mike_mcnally_m5_at_tivoli_com_)"
+ Return to "["Timothy C. May" <tcmay@got.net>](/authors/timothy_c_may_tcmay_at_got_net_)"

+ 1996-11-18 (Mon, 18 Nov 1996 10:23:52 -0800 (PST)) - [HP announcement](/archive/1996/11/5937cdbc6754e64229be0fe6d885b7f567a033365cd6b1b1a49c965ca16464ee) - _Greg Broiles<EMAIL_ADDRESS>  + 1996-11-18 (Mon, 18 Nov 1996 11:28:26 -0800 (PST)) - Re: HP announcement - _Mike McNally<EMAIL_ADDRESS>  + 1996-11-18 (Mon, 18 Nov 1996 13:41:03 -0800 (PST)) - [Re: HP announcement](/archive/1996/11/abf3175d7a13e568d85880868b8631c954459dec3e2f96d2a0e2990d9e2cd52f) - _Lucky Green<EMAIL_ADDRESS>  + 1996-11-19 (Mon, 18 Nov 1996 23:00:17 -0800 (PST)) - [Re: HP announcement](/archive/1996/11/7b9aa59d0d79e5f4b5e680815684a8d323e17e330efbf5e6c3c5a68e7c1ddb4f) - _"Timothy C. May"<EMAIL_ADDRESS>


text:
---
description: This document describes the properties a Naisjob should have.
---

# Naisjob

A Naisjob is very similar to a [NAIS Application](../nais-application/good-practices.md), except that it only runs once by default.
It is built on the Kubernetes [`Job`](https://kubernetes.io/docs/concepts/workloads/controllers/job/) and [`CronJob`](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/) resources.
A `CronJob` runs `Job`s on a time-based schedule, as denoted in `.spec.schedule`.

!!! info "Restart policies"
    Naisjobs have restart policies set to "Never", and it is currently not possible to set the restart policy of a Naisjob directly.
    It is possible to achieve automatic restarts on failure by using [startup probes](reference/#startup) however, though this requires the Pod to expose an HTTP endpoint to answer the probe.

Below you can find a minimal Naisjob example with a `schedule` for running a `Job` every minute.
If you don't need to have a recurring Naisjob, remove the `schedule` field from the configuration.

```yaml
apiVersion: nais.io/v1
kind: Naisjob
metadata:
  labels:
    team: myteam
  name: myjob
  namespace: myteam
spec:
  image: europe-north1-docker.pkg.dev/[mgmt-id]/[team-name]/[image-name]:tag
  schedule: "*/1 * * * *"
```

Behind the scenes, when you make a `Naisjob`, Kubernetes makes a bunch of different resources for you.
`Naisjob` is one resource that has been defined by the NAIS team.
When you deploy a `Naisjob` with `spec.schedule`, Kubernetes will create a `CronJob` for you.
A `Cronjob` is a Kubernetes native resource.
When the `Cronjob`-`schedule` triggers, Kubernetes will create a `Job`-ressource, which creates a [`Pod`](https://kubernetes.io/docs/concepts/workloads/pods/)-resource.
The `Pod` is what actually runs your code.

If you make a `Naisjob` without `schedule`, Kubernetes will create a `Job`-resource directly, which will create a `Pod`-resource.

Below you can see some of the resources the `Naisjob` `tiltak-okonomi-avstemming` creates.

```bash
$ kubectl tree naisjob tiltak-okonomi-avstemming
NAMESPACE     NAME                                        READY  REASON  AGE
arbeidsgiver  Naisjob/tiltak-okonomi-avstemming           -              109d
arbeidsgiver  ├─Job/tiltak-okonomi-avstemming             -              109d
arbeidsgiver  │ └─Pod/tiltak-okonomi-avstemming-brb7c     True           12d
```

## Re-run Naisjob

If you don't want to run your job at a schedule, but still want to re-run your Naisjob:

```shell
kubectl patch naisjob <name> --type json -p='[{"op": "remove", "path": "/status/synchronizationHash"}]'
```

## Applying your Naisjob to Kubernetes
You can deploy your Naisjob just as you would deploy your Application using [NAIS deploy](../deployment/README.md).

## Shutting down extra containers
Due to the nature of NAIS, your Naisjob might end up having a few sidecars.
Since a sidecar typically has little to no logic to look at sibling containers, these would normally not turn off once your app completes.
As a result, the Naisjob would continue running indefinitely unless some entity from above sorts it out.
To remediate this, an operator named [HAHAHA](https://github.com/nais/hahaha) has been created to run in every cluster and observe every Naisjob.
Once the "main" container in a Naisjob completes, HAHAHA will shut down the surrounding sidecars and thus make the Naisjob run to completion.

You can look at what HAHAHA has done to complete your Naisjob by running `kubectl describe pod my-naisjob-3f91a0` and viewing the Events section.

!!! info "My Naisjob hasn't completed"
    If you see events from HAHAHA but your Naisjob didn't complete, we'd be happy if you could tell us in the #nais channel on Slack.

??? question "I want to manually shut down the sidecars to make the Naisjob complete"

    Here's some legacy documentation on how to shut down most sidecars, in case HAHAHA didn't do its job fully.

    ### CloudSQL-proxy sidecar

    CloudSQL-proxy sidecar does not support turning off remotely.

    Additionally, Securelogs runs a second sidecar called `secure-logs-configmap-reload`.
    This can be shut down by running exec into the container.

    ```basg
    kubectl exec yourpod-12345 -c secure-logs-configmap-reload -- /bin/killall configmap-reload
    ```

    ### Vault sidecar

    Vault sidecar does not support turning off remotely.

    It can be shut down by running exec into the container.

    ```bash
    kubectl exec yourpod-12345 -c vks-sidecar -- /bin/kill -s INT 1
    ```

## Troubleshooting / FAQ

### My NaisJob doesn't want to start any scheduled Jobs

???+ "Answer"

    Sometimes, if the defined schedule attempts to start Jobs frequently without succeeding, Kubernetes will eventually stop
    attempting to start the Job.

    You might see the following event or message for the related CronJob (`kubectl describe cronjob <name>`):

    > Cannot determine if job needs to be started: too many missed start time (> 100). Set or decrease .spec.startingDeadlineSeconds or check clock skew

    Currently, the only way to fix this is to delete the CronJob and NaisJob, and then re-apply or -deploy the NaisJob:

    ```bash
    kubectl delete cronjob <name>
    kubectl delete naisjob <name>
    kubectl apply -f <path-to-naisjob.yaml>
    ```

### How do I force run my scheduled job

???+ "Answer"

    Run the following command to create a ad-hoc job based on your cronjob:

    ```bash
    kubectl create job --namespace=<mynamespace> --from=cronjobs/<naisjobname> <newname>
    ```

repository: nais/doc

gha_language: HCL

repo_name: nais/doc


text:
# Subprocess::GetExitCode method

Retrieves the termination status of the child process.

### Syntax

```
int GetExitCode()
```

### Return value

If the method succeeds, the return value is the process termination status. For more information, see Remarks.

If the method fails, the return value is `-1`. To get extended error information, check `A_LastError`.

### Remarks

This function returns immediately. If the process has not terminated and the function succeeds, the status returned is `STILL_ACTIVE`. If the process has terminated and the function succeeds, the status returned is one of the following values:

- The exit value specified in the [ExitProcess](https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-exitprocess) or [TerminateProcess](https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-terminateprocess) function.
- The return value from the [main](https://docs.microsoft.com/en-us/cpp/cpp/main-program-startup?view=vs-2019) or [WinMain](https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-winmain) function of the process.
- The exception value for an unhandled exception that caused the process to terminate.

**Important**: The [GetExitCodeProcess](https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-getexitcodeprocess) function returns a valid error code defined by the application only after the thread terminates. Therefore, an application should not use `STILL_ACTIVE` (259) as an error code. If a thread returns `STILL_ACTIVE` as an error code, applications that test for this value could interpret it to mean that the thread is still running and continue to test for the completion of the thread after the thread has terminated, which could put the application into an infinite loop.

### References

- [GetExitCode function | Microsoft](https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-getexitcodeprocess).

repository: fightsthumbs/Library-AutoHotkey

repo_name: fightsthumbs/Library-AutoHotkey


text:
# rossum

This is `rossum`, a CMake-like build file generator for Fanuc Robotics (Karel)
projects.

## Overview

This tool introduces a package based workflow for Karel development: packages are directories that contain a marker file (a *manifest*) that contains some metadata describing the dependencies of that package and any translatable targets. Detection of packages and generation of the build file is done once at configuration time, relying on the build tool's dependency resolution to build all targets in the correct order.

## Installation

1. Install Git & Python
2. (optional) Create a python virtual environment `python -m venv <name>`
3. Install Ninja from https://github.com/ninja-build/ninja/releases. Download the `ninja-win.zip` file, and extract to a user specified directory. Make sure you add this to your environment `Path`.
```powershell
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";" + "path\to\ninja", "User");
```
4. Clone the repo and submodules to a user specified directory. If using an python virtual environment this can be cloned within your venv if you so choose.
```
git clone https://github.com/kobbled/rossum --recurse-submodules
```
5. Run the install file in a powershell terminal, with the optional argument specifying the path to your created venv.
```powershell
. ./install.ps1 <path\to\venv>
```

Alternatively a convenience distribution can be downloaded from https://github.com/kobbled/rossum/releases. Simply extract to a user specified location, and add this location to your environment `Path`.

```powershell
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";" + "path\to\rossum-distrib", "User");
```

</br>

> [!**IMPORTANT**]
> make sure you add any external libraries or projects that are dependencies (such as [Ka-Boost](https://github.com/kobbled/Ka-Boost)) to the environment variable `ROSSUM_PKG_PATH`. See [Environment Variables](https://github.com/kobbled/rossum#environment-variables) for more details.

</br>

> [!**NOTE**]
>
> On windows machines the `python` alias can be overwritten by the py launcher where python is started in the terminal with `py -3`. The batch files are written with the `python` key. To create the alias type this into powershell:
> ```powershell
> Set-Alias -Name python -Value "path\to\Python\Python39\python.exe"
> ```
> replacing the value with the full path to the python executable in your PATH environment variables.

</br>

> [!**WARNING**]
>
> If you installed rossum with the _"install.ps1"_ script the steps in [Requirements](https://github.com/kobbled/rossum#Requirements), and [Dependencies](https://github.com/kobbled/rossum#Dependencies) are not needed. If you are trying to setup in a linux/unix environment follow the steps below.

</br>

## Requirements

* **Rossum** was written in Python 3. Python dependencies can be installed with
```python
pip install -r requirements.txt
```
* Add the _./bin_ directory of **Rossum** to your environment `Path`
* The generated Ninja build files require a recent (> 1.7.1) version of [Ninja][] to be present. Please install [Ninja](https://github.com/ninja-build/ninja/releases) on your machine, and make sure the binary is located on your envrionment `Path`.
* FANUC Roboguide must also be installed with OPLC bin programs, **maketp**, **ktrans**, and **setrobot**. These tools can be typically found in `C:\Program Files (x86)\FANUC\WinOLPC\bin`. An emulation of your workcell should be made through Roboguide or OLPCpro, typically stored in *%USERPROFILE%/Documents/My Workcells*. Once a workcell has been created, and _robot.ini_ file needs to be generated in the root of your rossum project. The _robot.ini_ file can be generated by typing `setrobot` into a terminal opened in the root directory of your project, and selecting the appropriate workcell.
* Add the following to your environment variables, and change the values according to your system
```shell
# Rossum specific variables
set ROSSUM_CORE_VERSION=V910-1
set ROSSUM_PKG_PATH \path\to\rossum\dependency\packages
set ROSSUM_SERVER_IP <IP_ADDRESS>
```

See [Environment Variables](https://github.com/kobbled/rossum#environment-variables) for more details on usage.

> [!**NOTE**]
>
> If using **TP+**, and link to you controller environment file must be placed in the _robot.ini_ like:
> `ENV=C:\path\to\env.tpp`
>  **!IMPORTANT** Full path to `env.tpp` must be specified. DO NOT use relative paths here.

## Dependencies

* [ktransw](https://github.com/kobbled/ktransw_py) must be installed on your system for Rossum to compile karel files. follow the instructions [here](https://github.com/kobbled/ktransw_py#Requirements) for installation. **ktransw** is included as a submodule of this package in _"./deps/ktransw"_. Make sure that _"./deps/ktransw/bin"_, and _"./deps/ktransw/gpp"_ are on your environment `Path`.
* [yamljson2xml](https://github.com/kobbled/yamljson2xml) is required to convert _.yaml_. or _.json_ files to xml to be sent to the controller. Currently Fanuc cannot read or parse _.yaml_. or _.json_, but can read _.xml_ files. Follow this installation instructions [here](https://github.com/kobbled/yamljson2xml), and make sure the necessary locations are added to your environment `Path`.

## Examples

Please see [rossum_example_ws][] for an example workspace with some packages
that show how to use `rossum`.

## currently handled files

* Karel (.kl)
* LS files (.ls)
* TP-Plus (.tpp)
* JSON (.json)
* YAML (.yaml)
* CSV (.csv)
* FANUC Dictionary (.utx)
* FANUC Form (.ftx)

> [!**NOTE**]
>
>Look at the User Form example in [rossum_example_ws][], *basic_test\lib_a*. Preprocessor directives have been expanded in .utx, and .ftx files using [ktransw][]. In order to properly compile dictionary files, `ninja` might have to be run twice to first create the karel include file, and then build the accompanying karel file.

## Usage

**standard**

```
  mkdir C:\foo\bar\build
  cd C:\foo\bar\build
  rossum C:\foo\bar\src
  kpush
```

**delete files from build dir on robot controller**

```
kpush --delete
```

**clean out build file**

```
  cd C:\foo\bar\build
  rossum --clean
```

**build source files from package.json**

```
  cd C:\foo\bar\build
  rossum C:\foo\bar\src -s
```

**output test files with source files from package.json**

```
  cd C:\foo\bar\build
  rossum C:\foo\bar\src -t -s
```

**build programs to interface karel routines in TP programs**

```
  cd C:\foo\bar\build
  rossum C:\foo\bar\src -i
```

> [!**NOTE**]
>
>  This option depends on the [kl-TPE](https://github.com/kobbled/kl-TPE),[kl-pose](https://github.com/kobbled/kl-pose), and [kl-registers](https://github.com/kobbled/kl-registers) packages from the [Ka-Boost](https://github.com/kobbled/Ka-Boost) libraries. If Ka-Boost is installed make sure to add theses libraries to the dependencies of the package you are build in with this option.

```json
{
  "depends" : [
    "registers",
    "TPElib"
  ]
}
```

**keep preprocessor output in %TEMP%**

```
  cd C:\foo\bar\build
  rossum C:\foo\bar\src -s -g
```

**build all source files from dependencies**

```
  cd C:\foo\bar\build
  rossum C:\foo\bar\src -s -b
```

**build all tp interfaces from dependencies**

```
  cd C:\foo\bar\build
  rossum C:\foo\bar\src -i -b
```

**build with user macro %define DEBUG**

```
  cd C:\foo\bar\build
  rossum C:\foo\bar\src -DDEBUG=TRUE
```

**--help output**

```
usage: rossum [-h] [-v] [-V] [-q] [--rg64] [-c ID] [--support PATH] [-d]
              [--ktrans PATH] [--ktransw PATH] [-n] [-p PATH] [-r INI] [-s]
              SRC [BUILD]

Version 0.1.7

A cmake-like Makefile generator for Fanuc Robotics (Karel) projects
that supports out-of-source builds.

positional arguments:
  SRC                   Main directory with packages to build
  BUILD                 Directory for out-of-source builds (default: 'cwd')

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         Be verbose
  -V, --version         show program's version number and exit
  -q, --quiet           Be quiet (only warnings and errors will be shown)
  --rg64                Assume 64-bit Roboguide version.
  -c ID, --core ID      Version of the core files used when translating
                        (default: V7.70-1). Use the 'ROSSUM_CORE_VERSION'
                        environment variable to configure an alternative
                        default without having to specify it on each
                        invocation of rossum.
  --support PATH        Location of KAREL support directory (default: auto-
                        detect based on selected core version and FANUC
                        registry keys)
  -d, --dry-run         Do everything except writing to build file
  --ktrans PATH         Location of ktrans (default: auto-detect)
  --ktransw PATH        Location of ktransw (default: assume it's on the
                        Windows PATH)
  -n, --no-env          Do not search the ROSSUM_PKG_PATH, even if it is set
  -p PATH, --pkg-dir PATH
                        Additional paths to search for packages (multiple
                        allowed). Note: this essentially extends the source
                        space.
  -r INI, --robot-ini INI
                        Location of robot.ini (default: source dir)
  --ftp                 Use IP address in environment variable
                        'ENV_SERVER_IP' to send files in build folder to
                        Controller with 'kpush' command.
  -s, --buildsource     build source files in package.json.
  -b --buildall         build all dependencies as well
  -g --keepgpp          keep gpp preprocessor output in %TEMP% folder to
                        evaluate bugs.
  -tp --compiletp       compile .tpp files into .tp files. If false will
                        just interpret to .ls.
  -t  --include-tests   include test files in build
  -i  --build-interfaces   build tp interfaces for karel
                        routines specified in package.json.
                        This is needed to use karel routines within a tp program
  -D  /D                Define user macros from command line
  --clean               clean all files out of build directory
```

## robot.ini file example

create robot.ini file in the top level of the source directory calling **setrobot** through a command prompt, and selecting the correct workcell created with Roboguide. *Ftp*, and *Env* will need to be added afterwards as they are Rossum specific directives.

```
[WinOLPC_Util]
Robot=\C\Users\<user>\Documents\My Workcells\cell\Robot_1
Version=V9.10-1
Path=C:\Program Files (x86)\FANUC\WinOLPC\Versions\V910-1\bin
Support=C:\Users\<user>\Documents\My Workcells\cell\Robot_1\support
Output=C:\Users\<user>\Documents\My Workcells\cell\Robot_1\output
Ftp=<IP_ADDRESS>
Env=C:\Users\<user>\Documents\My Workcells\cell\tpp\vars.tpp
```

## package.json file example

```json
{
  "manver" : "1",
  "project" : "kl-lib",
  "description" : "",
  "version" : "0.0.2",
  "license" : "MIT",
  "author" : "name",
  "source" : [
    "src/source.kl"
  ],
  "includes" : [
    "include"
  ],
  "depends" : [
    "ktransw-macros",
    "Strings",
    "math",
    "registers",
    "TPElib"
  ],
  "tp" : [
    "tp/move.ls"
  ],
  "tp-interfaces" : [
    {"routine" : "source__func01", "program_name" : "func01"},
    {"routine" : "source__func02", "program_name" : "func02"},
    {"routine" : "source__func02", "program_name" : "func02", "default_params" : {"2": 1, "3": "default_string"}},
  ],
  "forms" : [
    "forms/frmnmeeg.ftx"
  ],
  //macro commands set in programs. (for example building for debugging or production)
  "macros" : [
    "DEBUG=TRUE",
    "BUILD_LOG=FALSE"
  ],
  //test files to build when using the -t option
  "tests" : [
    "test/test_source.kl"
  ],
  //includes needed for tests
  "tests-includes" : [
    "test/configs"
  ],
  //test dependencies
  "tests-depends" : [
    "display",
    "KUnit"
  ],
  //Only builds TP files when -t option is specified
  "tests-tp" : [
    "test/tp/test_move.tpp"
  ],
  // This option is used to create a karel hash table from the TP+ environment file specified in robot.ini file
  "tpp_compile_env" : {"name" : "tppenv", "clear" : false, "config" : "env"}
}
```

### tp-interfaces

Teach pendant interfaces are a way of exposing karel routines, for usage in teach pendant (TP) programs. Inherently you are not allowed to access karel routines with the *CALL* function in TP programs. You are able to call karel programs within TP programs. Rossum provides a way to automatically create a karel program wrapper around a specified routine. For instance if you want to expose a routine definition:

```
ROUTINE func01(p : XYZWPR; i : INTEGER; r : REAL) : INTEGER
```

and create a wrapper program called **tp_func01**, you can define an interface in the package manifest:

```
"tp-interfaces" : [
    {"routine" : "func01", "program_name" : "tp_func01", "default_params" : {"2": 1, "3": 0.0}}
  ]
```

This will output a karel program to \<src\>/tp/ . If there is a return type the last arguement will be the register number to store the result in.

If an input argument is a position type, the corresponding TPE arguement is the position register number where the input data is stored.

**currently handled types**

* INTEGER
* REAL
* STRING
* XYZWPR
* JOINTPOS

Default arguements can also be specified using the _"default_params"_ field. where the `key:value` pair is the argument number (index starting at 1), and the default value you would like to specify.

In the case for **"func01"** the 2nd integer argument will default to 1 if not included, and argument 3 will default to 0.0. There currently is no mechanism to leave argument 2 blank, but declare a value for argument 3. Therfore all subsequent arguments also have to be excluded for default arguments to work. This means that the arguments must be ordered in a manner that subsequent arguments would not need to be declared if the current argument is not specified.

### user macros

package/project wide pre-processor macros can be defined either from the command line or the package manifest. From the command line macros are invoked the same way they are in GPP (see [GPP documentation][GPP]), with **-D***name=val*, or **/D***name=val*. Macros can be included in the package manifest as shown in [example package.json](#packagejson-file-example).

## Environment variables

```shell
# environment pointers
set PATH=%PATH%;C:\path\to\rossum\bin
set PATH=%PATH%;C:\path\to\rossum\deps\ktransw\bin
set PATH=%PATH%;C:\path\to\rossum\deps\ktransw\gpp
set PATH=%PATH%;C:\path\to\rossum\deps\yamljson2xml\src
```

```shell
# Rossum specific variables
set ROSSUM_CORE_VERSION=V910-1
set ROSSUM_PKG_PATH \path\to\rossum\dependency\packages
set ROSSUM_SERVER_IP <IP_ADDRESS>
```

`rossum` checks for the existence of two environment variables and uses their
contents to change its behaviour.

### ROSSUM_PKG_PATH

The `ROSSUM_PKG_PATH` should contain (a) path(s) to one or more directories
containing rossum packages. All directories will be searched when running `rossum` so that the full paths of these packages do not need to be specified, merely the _name_ of the package.

For example if you have the dependency [Strings](https://github.com/kobbled/strings) on your project, you would add the location where you put the **Strings** repo (i.e. `C:\path\to\rossum\dependency\packages`) to `ROSSUM_PKG_PATH`. Then in the _package.json_ file simply add the name of the package:

```
"depends" : [
    "Strings"
  ],
```
Rossum now has visibility to the Strings package.

### ROSSUM_CORE_VERSION

The `ROSSUM_CORE_VERSION` variable can be used to specify a 'system wide'
default core version that should be used for all invocations of `ktransw`,
unless the default is overriden using the `--core` option.

Example: to make version 8.30 of the support files the default set
`ROSSUM_CORE_VERSION` to `V8.30-1`.

## Glossary

Terminology used by `rossum`.

### package
A directory containing any number of source and header files, organised into
`src` and `include` sub directories, along with a JSON package manifest. The
manifest declares translationable binary targets and additional meta-data such
as build dependencies (other `rossum` packages), author, version and test
binaries.

### workspace
A directory containing a set of `rossum` compatible packages. Note that while
possible, packages are typically not directly stored in the top-level workspace
directory, but in a *source space* sub directory.

### source space
The sub directory of the *workspace* that contains a set of of `rossum`
compatible packages. Usually named `src`.

### build space
The sub directory of the *workspace* that will store all the build output
(p-code files).

### build file
The ninja build file generated by `rossum` at the end of the configuration
phase.

## Disclaimer

WinOLPC, OlpcPRO and Roboguide are products of Fanuc America Corporation. The
author of `rossum` is not affiliated with Fanuc in any way.

[ninja]: https://ninja-build.org
[ktransw]: https://github.com/kobbled/ktransw_py
[EmPy]: https://pypi.python.org/pypi/EmPy
[releases]: https://github.com/kobbled/rossum/releases
[rossum_example_ws]: https://github.com/kobbled/rossum_example_ws
[Installing Python on Windows]: http://docs.python-guide.org/en/latest/starting/install/win/
[GPP]: https://files.nothingisreal.com/software/gpp/gpp.html

repository: kobbled/rossum

gha_language: Python

repo_name: kobbled/rossum


text:
---
tags: [2019/08/13, leetcode/119, method/recursion]
title: Pascal's Triangle II
created: '2019-08-13T15:21:50.707Z'
modified: '2019-08-13T15:23:55.285Z'
---

# Pascal's Triangle II

Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal's triangle.

![pic](https://upload.wikimedia.org/wikipedia/commons/0/0d/PascalTriangleAnimated2.gif)

Note that the row index starts from 0.

In Pascal's triangle, each number is the sum of the two numbers directly above it.

### Example:

```
Input: 3
Output: [1,3,3,1]
```

> Could you optimize your algorithm to use only O(k) extra space?

## Solution

```python
class Solution(object):
    def _getRow(self, rowIndex):
        """
        :type rowIndex: int
        :rtype: List[int]
        """
        last = [1]
        if rowIndex == 0:
            return last
        for i in range(1, rowIndex+1):
            row = [1]
            for j in range(1, len(last)):
                row.append(last[j] + last[j-1])
            row.append(1)
            last = row
        return last

    def getRow(self, rowIndex):
        """
        :type rowIndex: int
        :rtype: List[int]
        """
        last = [1]
        if rowIndex == 0:
            return last
        last = self.getRow(rowIndex-1)
        row = [1]
        for i in range(1, len(last)):
            row.append(last[i]+last[i-1])
        row.append(1)
        return row
```


text:
# Week 2 - Tuesday 2019-04-09

#### Ocaml Pattern Matching

1. Patterns types

    | Type          | What they match |
    | ------------- |:---------------:|
    | 0, 19, []     | constants only match themselves |
    | $P_1$::$P_2$  | identifier matches anything but y is bound |

    * Examples of pattern matching

        ```ocaml
        match 3+9 in
        | x -> x+1

        match [3; -5; 12;] with
        | [] -> 0
        | [x] -> x+3
        | x::y -> x
        ```
    * Note that tuples in Ocaml must have a length known at compile time.
2. Recursion
    * Say that you want to sum up all the elements of a list
        \begin{equation}
        \sum_{i \in \{\}} a_i = 0
        \end{equation}
    * Why does it start of 0? This is because 0 is the identity element of min on positive nums
    * We expect this behavior to be consistent
        \begin{equation}
        \sum_{i \in A \cup B} a_i = \sum_{i \in A} a_i + \sum_{i \in B} a_i
        \end{equation}
    * Suppose now that B = {}, then we expect that
        \begin{equation}
        \sum_{i \in B} a_i = 0
        \end{equation}
    * Example of Recursion in Ocaml (reverse)

        ```ocaml
        # let rec reverse l = function
        | [] -> []
        | h::t -> (rev t) @ [h];;
        reverse : 'a list -> a' list = <fun>

        (*Alternatively:*)
        let rec revapp a = function
        | [] -> a
        | h::t -> revapp (h::a) t;;

        let reverse = revapp []
        ```
    * Note that in the previous example, the second method is preferred and follows functional
        programming as a paradigm better

repository: Apostolos-Delis/Notes

repo_name: Apostolos-Delis/Notes


text:
---
layout: post
title: 'LLVM7: vol2 -- its alive. Update#2'
tags: [llvm7, llvm]
---
# Update#2
As [per today](https://github.com/dkimitsa/robovm/commit/323fc12e02a4cf2402e16b1850436bc8721dd15f) code from [dkimitsa/robovm/llvm_70](https://github.com/dkimitsa/robovm/tree/llvm_70) is able compile and start application in simulator/device. It gets alive status.  What had been done:
- RoboVm compiler infrastructure was updated to produce llvm 7 compatible IR code;
- DebugInformationPlugin was reworked to produce llvm7 debug information;
- Bunch of code was changed as it was broken as per llvm7 vision and produced crashes on asserts inside LLVM.

Next steps:
- merge with [debugger_local_resolution](https://github.com/dkimitsa/robovm/commits/debugger_local_resolution) branch;
- resurect and run RoboVm tests;
- evaluate performance and size footprint of LLVM7 produced code;
- migrate to LLVM 8 -- yep it has to be released this month.

# Previous updates:
<!-- more -->
[Update#1 - kickoff]({{ site.baseurl }}{% post_url 2019-01-26-llvm7-vol1-kickoff %})
- [LLVM](https://github.com/llvm-mirror/llvm) and [Clang](https://github.com/llvm-mirror/clang) mirror repos are used as source base;
- CMake build files updated to compile version 7;
- Swig files for java bindings were cleaned up initially to produce clean results without need of post-work-arounds;
- LLMV Extra code -- set of helpers and wrappers used by RoboVM were updated to work with new LLVM;
- Swift files for bindings were updated to produce v7 wrappers;
- RoboVM compiler's code were updated as LLVM API was changed and lot of functionality was deprecated.


text:
# _ccmjs_ Technology

The "Client-side Component Model" (_ccmjs_) is a technology to expand the functionality of the web.
Component developers can develop their own <i>ccmjs</i>-based web components and put them on the web as free software.
Everyone can then use the components to design any webpage area.
The functionality of a component can be adapted via its configuration and
components can be combined to form larger applications.
_ccmjs_ also offers services for loading resources and data management.

repository: ccmjs/ccm

gha_language: JavaScript

repo_name: ccmjs/ccm


text:
# Title:
Identification of Disengagement Factors using Sentiment Analysis and TF-IDF

# Description:
This is the documentation repository for the master thesis:
"MOOC Interrupted Determination of Disengagement Factors using
Sentiment Analysis" at the Humboldt University of Berlin (Sept 2016).

# Abstract of the project:
Within the past few years, Massive Online Open Courses (MOOCs), have experienced a
sudden rise in popularity, reaching thousands of students across the globe and bridging
limitations that higher education has experienced until present. Despite the great potential
MOOCs represent to the future of global education, a high drop-out phenomenon (96%)
has been regularly reported over the years. This thesis investigates this phenomenon and uses Sentiment Analysis and other Text Mining techniques to identify topics related to the student drop-out. An en-to-end framework
is presented including data extraction (50K textual reviews) and preparation, polarity classification and feature
selection. Using the proposed framework, topics related to student dissatisfaction were
found, supporting findings from previous studies. Furthermore, quantitative text metrics were used to identify linguistic patterns among dissatisfied students’ reviews, finding significant correlations with course features such as
price, rating and polarity.

# Repository structure:
Following repository contains:
1. The source code for the crawler written in order to extract the data (Py)//
2. The implementation of the project (R)//
  2.1. Descriptive Data Analysis//
  2.2. Quantitative Text Analysis//
  2.3. Sentiment Analysis / Polarity Classification//
  2.4. Identification of salient terms using the TF-IDF weighting//
3. Source code of the paper (LaTeX)//

# License and author info

MIT License

Copyright (c) [2016] [Laura Gabrysiak Gomez]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


text:
# React

## News.com Pt.2

In this 5 part exercise, we'll be building a two-page news app!

The major topics covered in this project are react-router and axios.

In part two, we'll be creating three components.

## Instructions
1. Inside of src in your news.com app, create a folder named `components`.
2. Notice the structure of the folders we created in pages. They are named after the component they contain, and they have one .js file, and one .css file. We'll be following that same structure for our components. Create folders and their corresponding files for the following components:
- Input
- Button
- Card
3. We will worry about adding props to these components later. For now, it's ok to make all of them empty divs
4. Inside of Input, insert an input with the props:
  - type (a placeholder for the input type)
  - value (a placeholder for the input value)
  - name (a placeholder for the input name)
  - onChange (a placeholder function)
5. That's all for this exercise. In part three, we'll be puting out Input component to use.

repository: SashaPatsel/coding-drills

repo_name: SashaPatsel/coding-drills


text:
---
title: Government and Education Startup Challenges
subtitle: Advice from the internet
layout: article
modal-id: 1
date: 2015-07-09
img: notepad.png
thumbnail: notepad-thumbnail.png
alt: image-alt
project-date: July 09, 2015
client: Start Bootstrap
category: E-Rate
sitemap: false

---
The advice for startups is everywhere these days.  A search on Google reveals list of the Top 3, Top 5, Top 30 lists of advice that go on hundreds of pages deep.  The overriding message is that feeding the startup mentality is big business and there are many players trying to align themselves as the key source of information that will make or break any startups future.  Things change, but more things stay the same…  People who made the most money in the gold rush were those selling shovels, picks, jeans and booze; not the gold miners actually doing the work.

<!-- more -->

How does all of this apply to a startup trying to help entities get better access to government programs like [ERate](www.eratecycle.com)?  Does the existence of government programs provide a more stable environment to allow creative techies to disrupt or does it really create a more challenging environment that stifles disruption?

Some repeated advice spit out by the internet sages include:

### [Expect challenges](www.forbes.com/sites/theyec/2014/04/08/seven-keys-to-startup-success/)
Launching a new project is extremely challenging.  Know this going into it. Expect it.

Drive your company with passion.  Whatever you are building, the challenges and the risks you face in starting something new have to be worth it to you.

### [Develop a Needed Technology](tech.co/automation-efficiency-scalability-keys-startup-success-2015-04)
A successful startup identifies an unfulfilled need and develops the technology to satisfy it.  Many large enterprises have an inefficient, manual approach for this resulting in significant

### Repeatable & Scalable Go-to-Market Methodology
Establish a sales and marketing methodology to directly target potential consumers rather than relying solely on indirect third-party sales

### Adapt or Die Across All Phases of the Company
An underrated benefit of a growing startup is the ability to move nimbly across all phases of the company. A startup must be able to quickly adapt to the slew of changes it will undoubtedly face.

### Invest in Experienced Leadership
Seasoned leaders can increase sales, anticipate common pitfalls and establish the startup’s culture as it expands beyond its initial creators.
How do these apply to a startup making its way in the world trying to serve customers in the paperwork filled work with forms like [Form 470](eratecycle.com/erate-form-470/), [Form 471](eratecycle.com/erate-form-471/), and [Item 21](eratecycle.com/erate-funding/)?  While general business processes change, there is usually a reason for the change and because there are businesses involved… there is a planned rollout.  Government programs like [ERate](www.usac.org/sl/) can make changes with OR without notice and the startups must be prepared to adjust more quickly than general business startups.

The most challenging aspect of these changes is they can be driven by forces that do not have customers in mind…  politics, geographies, money, personal agendas can all play major parts in significant change.  The biggest takeaway behind managing this changing environment is that a startup MUST adjust…  it MUST adjust once…  the customers of that startup get the benefit of the experienced team behind the startup to help drive a better experience with the relevant program.

gha_language: CSS