text:
---
layout: post
title: "Discovery of the decade: IPython"
modified:
categories: blog
excerpt:
tags: ["data science","interactive computing","visualization"]
image:
  feature:
date: 2015-01-11T07:28:00-00:00
share: true
---

While doing the statistics prework (reading and exercises) for the [Metis Data Science bootcamp][metis-datascience],
I got to know [IPython][ipython], a *great* tool/architecture for interactive computing and on-the-fly visualization and publishing.

I'm ashamed to say that IPython has been around for a *decade* without my noticing it.
Which only shows how much this sabbatical was overdue :-)

To see IPython at work, check out
some example IPython notebooks on the [nbviewer service][nbviewer].

Or if you have more time:

By the way, I got here alright.

[ipython]: http://ipython.org/
[metis-datascience]: http://www.thisismetis.com/data-science
[nbviewer]: http://nbviewer.ipython.org/

gha_language: JavaScript


text:
# Configure Using glcon and Templates

You do not need to have a container stack running to run    `glcon config`
But run `glcon gleaner` and `glcon nabu`, you will need to.

## OVERVIEW glcon Configuration generation
`glcon config` is used to create configuration files for gleaner and nabu
The pattern is to intiialize a configuration directory, edit files, and generate new
configuration files for gleaner and nabu. Inside a configuration, you will need to edit a localConfiguration file
Edit/add sources in a csv listing, and generate the configurations.

### initialize a configuration directory
use  glcon command can intialize a configuration directory, and allow for the generation of gleaner and nabu configurations

```
glcon config init -cfgName test
```

initializes a configuration in configs with name of 'test'
Inside you will find
```
test % ls
gleaner_base.yaml	readme.txt		sources.csv
nabu_base.yaml		localConfig.yaml
README_Configure_Template.md
```

## EDIT the files

Usually, you will only need to edit the [localConfig.yaml](./localConfig.yaml) and sources.csv
The localConfig.yaml

#### localConfig.yaml
```yaml
---
minio:
  address: <IP_ADDRESS> # can be overridden with MINIO_ADDRESS
  port: 9000 # can be overridden with MINIO_PORT
  accessKey: worldsbestaccesskey # can be overridden with MINIO_ACCESS_KEY
  secretKey: worldsbestsecretkey # can be overridden with MINIO_SECRET_KEY
  ssl: false # can be overridden with MINIO_SSL
  bucket: gleaner # can be overridden with MINIO_BUCKET
sparql:
  endpoint: http://localhost/blazegraph/namespace/earthcube/sparql
s3:
  bucket: gleaner # sync with above... can be overridden with MINIO_BUCKET... get's zapped if it's not here.
  domain: us-east-1

#headless field in gleaner.summoner
headless: http://<IP_ADDRESS>:9222
sourcesSource:
   type: csv
   location: sources.csv
```

First, in the "mino:" section make sure the accessKey and secretKey here match the access keys for your minio.
These can be overridden with the environent variables:
* "MINIO_ACCESS_KEY"
* "MINIO_SECRET_KEY"

#### sourcesSource
[sources.csv](./sources_custom.csv) is utilized to generate the information needed to retrieve (summon), process (mill), upload (prefix), and cull old records (prune)
This is done in order to facilitate the managing a list of sources, in a spreadsheet, rather than a yamil file.
a csv file with the fields below

This is designed to be edited in a spreadsheet, or exported by url as csv from a google spreadsheet

```csv
hack,SourceType,Active,Name,ProperName,URL,Headless,Domain,PID,Logo
1,sitegraph,FALSE,aquadocs,AquaDocs,https://oih.aquadocs.org/aquadocs.json ,FALSE,https://aquadocs.org,http://hdl.handle.net/1834/41372,
3,sitemap,TRUE,opentopography,OpenTopography,https://opentopography.org/sitemap.xml,FALSE,http://www.opentopography.org/,https://www.re3data.org/repository/r3d100010655,https://opentopography.org/sites/opentopography.org/files/ot_transp_logo_2.png
,sitemap,TRUE,iris,IRIS,http://ds.iris.edu/files/sitemap.xml,FALSE,http://iris.edu,https://www.re3data.org/repository/r3d100010268,http://ds.iris.edu/static/img/layout/logos/iris_logo_shadow.png
```

Fields:
1. hack:a hack to make the fields are properly read.
2. SourceType : [sitemap, sitegraph, googledrive, api] type of source
3. Active: [TRUE,FALSE] is source active.
4. Name: short name of source. It should be one word (no space) and be lower case.
5. ProperName: Long name of source that will be added to organization record for provenance
6. URL: URL of sitemap or sitegraph.
7. Headless: [FALSE,TRUE] should be set to false unless you know this site uses JavaScript to place the JSON-LD into the page.  This is true of some sites and it is supported but not currently auto-detected.  So you will need to know this and set it.  For most place, this will be false.
   if the json-ld is generated in a page dynamically, then use , TRUE
8. Domain:
9. PID: a unique identifier for the source. Perfered that is is a research id.
10. Logo: while no longer used, logo of the source
11. googleapikeyenv: (ONLY NEEDED FOR type:googledrive) environment variable pointing to a google api key.
12. any additional feilds you wish. This might be used to generate information about sources for a website.

#### Configuration of your source
You configure the source in the localConfig.yaml (or override via the command line)
```yaml
# looks for Mysources.csv in configuration directory
sourcesSource:
   type: csv
   location: Mysources.csv
```
This can also be a remote url starting with http:// or https://
```yaml
# pulls from a google sheet
sourcesSource:
   type: csv
   location: https://docs.google.com/spreadsheets/d/{key}/gviz/tq?tqx=out:csv&sheet={sheet_name}
```

If you start the name with a '/' a full path to the file is assumed.
```yaml
# file outside of local configuration directory
sourcesSource:
   type: csv
   location: /home/user/ourSources.csv
```
##### Override Sources via the CLI
pass --sourcemaps to generate:

`glcon config generate --cfgName test --sourcemaps "My Sources.csv" `

## GENERATE the configuration files
```
glcon generate -cfgName test
```
This will generate files  ['gleaner'](./gleaner) and  ['nabu'](./nabu) and make copies of the existing configuration files

## Some Gleaner Configuration details
This is a summary of a few portions of the configuration files generated.
More details are at: [GleanerConfiguration.md](../docs/GleanerConfiguration.md)

Open the file ['gleaner'](./gleaner), and you will see  is actually quite a bit information this file, but for this starting demo only a few things we need to worry about.  The default file will look like:

```yaml
---
minio:
  address: <IP_ADDRESS>
  port: 9000
  accessKey: worldsbestaccesskey
  secretKey: worldsbestsecretkey
  ssl: false
  bucket: gleaner
gleaner:
  runid: runX # this will be the bucket the output is placed in...
  summon: true # do we want to visit the web sites and pull down the files
  mill: true
context:
  cache: true
contextmaps:
  - prefix: "https://schema.org/"
    file: "./configs/schemaorg-current-https.jsonld"
  - prefix: "http://schema.org/"
    file: "./configs/schemaorg-current-https.jsonld"
summoner:
  after: ""      # "21 May 20 10:00 UTC"
  mode: full  # full || diff:  If diff compare what we have currently in gleaner to sitemap, get only new, delete missing
  threads: 5
  delay:  # milliseconds (1000 = 1 second) to delay between calls (will FORCE threads to 1)
  headless: http://<IP_ADDRESS>:9222  # URL for headless see docs/headless
millers:
  graph: true
# will be built from sources.csv
sources:
  - sourcetype: sitegraph
    name: aquadocs
    logo: ""
    url: https://oih.aquadocs.org/aquadocs.json
    headless: false
    pid: http://hdl.handle.net/1834/41372
    propername: AquaDocs
    domain: https://aquadocs.org
    active: false
  - sourcetype: sitemap
    name: opentopography
    logo: https://opentopography.org/sites/opentopography.org/files/ot_transp_logo_2.png
    url: https://opentopography.org/sitemap.xml
    headless: false
    pid: https://www.re3data.org/repository/r3d100010655
    propername: OpenTopography
    domain: http://www.opentopography.org/
    active: false
```

A few things we need to look at.

First, in the "mino:" section make sure the accessKey and secretKey here are the ones you utlize.
Note: blank these out, and used environment variables (TODO:Need to describe them)

Next, lets look at the "gleaner:" section.  We can set the runid to something.  This is the ID for a run and it allows you to later make different runs and keep the resulting graphs organized.  It can be set to any lower case string with no spaces.

The miller and summon sections are true and we will leave them that way.  It means we want Gleaner to both fetch the resources and process (mill) them.

Now look at the "miller:"  section when lets of pick what milling to do.   Currently it is set with only graph set to true.  Let's leave it that way for now.  This means Gleaner will only attempt to make graph and not also run validation or generate prov reports for the process.

The final section we need to look at is the "sources:" section.
Here is where the fun is.  While there are two types, sitegraph and sitemaps we will normally use sitemap type.
There is a third type that involves configuring and pulling from a

A standard sitemap is below:
```yaml
sources:
  - sourcetype: sitemap
      name: opentopography
      logo: https://opentopography.org/sites/opentopography.org/files/ot_transp_logo_2.png
      url: https://opentopography.org/sitemap.xml
      headless: false
      pid: https://www.re3data.org/repository/r3d100010655
      propername: OpenTopography
      domain: http://www.opentopography.org/
      active: true
```

A sitegraph
```yaml
sources:
  - sourcetype: sitegraph
    name: aquadocs
    logo: ""
    url: https://oih.aquadocs.org/aquadocs.json
    headless: false
    pid: http://hdl.handle.net/1834/41372
    propername: AquaDocs
    domain: https://aquadocs.org
    active: false
```
A google drive
```yaml
sources:
   - sourcetype: googledrive
     name: ecrr_submitted
     logo: https://www.earthcube.org/sites/default/files/doc-repository/logo_earthcube_full_horizontal.png
     url: https://drive.google.com/drive/u/0/folders/1TacUQqjpBbGsPQ8JPps47lBXMQsNBRnd
     headless: false
     pid: ""
     propername: Earthcube Resource Registry
     domain: http://www.earthcube.org/resourceregistry/
     active: true
     GoogleServiceJsonEnv: GOOGLEAPIAUTH
     # see below. Enviroment variable name that contains filename of service_account.json authentication
```
These are the sources we wish to pull and process.
Each source has a type, and 8 entries though at this time we no longer use the "logo" value.
It was used in the past to provide a page showing all the sources and
a logo for them.  However, that's really just out of scope for what we want to do.
You can leave it blank or set it to any value, it wont make a difference.

The name is what you want to call this source.  It should be one word (no space) and be lower case.

The url value needs to point to the URL for the site map XML file.  This will be created and served by the data provider.

The headless value should be set to false unless you know this site uses JavaScript to place the JSON-LD into the page.  This is true of some sites and it is supported but not currently auto-detected.  So you will need to know this and set it.  For most place, this will be false.

You can have as many sources as you wish.  For an example look the configure file for the CDF Semantic Network at: https://github.com/gleanerio/CDFSemanticNetwork/blob/master/configs/cdf.yaml

### Google Drive
The key GoogleServiceJson Env points to a env variable name that contains the path to service_account.json file
`setenv GOOGLEAPIAUTH "configs/credentials/gleaner-331805-030e15e1d9c4.json"`

Create service credentials
https://developers.google.com/workspace/guides/create-credentials

save in credentials/{filename}

The URL will be the folder you see in google drive.

A google drive
```yaml
sources:
   - sourcetype: googledrive
     name: ecrr_submitted
     logo: https://www.earthcube.org/sites/default/files/doc-repository/logo_earthcube_full_horizontal.png
     url: https://drive.google.com/drive/u/0/folders/1TacUQqjpBbGsPQ8JPps47lBXMQsNBRnd
     headless: false
     pid: ""
     propername: Earthcube Resource Registry
     domain: http://www.earthcube.org/resourceregistry/
     active: true
     GoogleServiceJsonEnv: GOOGLEAPIAUTH
     # see below. Enviroment variable name that contains filename of service_account.json authentication
```

repository: gleanerio/gleaner

branch_name: refs/heads/master

extension: md

gha_language: Go

license_type: permissive

repo_name: gleanerio/gleaner


text:
# URCaps External Control
The External Control URCap is the user interface for the Universal Robots [ROS](https://github.com/UniversalRobots/Universal_Robots_ROS_Driver), [ROS2](https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver) and [Isaac SDK](https://github.com/UniversalRobots/Universal_Robots_Isaac_Driver) driver, as well as the [Universal Robots Client Library](https://github.com/UniversalRobots/Universal_Robots_Client_Library) used by the drivers.

It supports the Universal Robots CB3 and e-Series robots.

## Prerequisites
As this URCap is using swing to implement the user interface, the URCap library in version 1.3.0 or
higher is required. Therefore the minimal PolyScope versions are 3.7 and 5.1.

## Usage
* In the _Installation_ tab of Polyscope:
	* Adjust the IP address of your robot in the _Installation_ tab of Polyscope (this step might be unnecessary in simulation).
* On the remote PC:
	* Launch the suitable _launch_ file for UR3/UR5/UR10 and CB3/e-series.
* In the _Program_ tab of Polyscope:
	* Add this URcap to a program by selecting it from the side menu under the tab _URcap_.
	* Execute the program by pressing the _play_ button in the _Program_ tab of Polyscope.

### Multiple URCap nodes
To use this URCap node multiple times in a ur program, the control script is divided into two
scripts. After receiving the script, it is divided into a header part and a control loop part. The
header part consist of all the function deffinitions. The header is only inserted once in the
program, while the control loop is inserted for each URCap node in the program tree.

To be able to distinguish between header and control loop, the header part of the script should be
encapsulated in:
```bash
# HEADER_BEGIN
Here goes the header code
# HEADER_END

# NODE_CONTROL_LOOP_BEGINS
Here goes the control loop code
# NODE_CONTROL_LOOP_ENDS
```
If its not possible to find either `# HEADER_BEGIN` or `# HEADER_END`, the script will not be
divided into two scripts and it will not be possible to have multiple URCap nodes in one program.

## Acknowledgment
Developed in collaboration between:

[](https://www.universal-robots.com/)   and
[](https://www.fzi.de).

Supported by ROSIN - ROS-Industrial Quality-Assured Robot Software Components.
More information: rosin-project.eu

This project has received funding from the European Union’s Horizon 2020
research and innovation programme under grant agreement no. 732287.

gha_language: Java


text:
# cAPA102

[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/CoorFun/cAPA102/blob/master/LICENSE)

cAPA102 is a lightweight hardware SPI based APA102 library, fast and easy to use.

This library is targeting to Raspberry Pi, ReSpeaker Core V2, Beaglebone such platforms.

## APIs

#### ```int cAPA102_Init(uint32_t led_num, uint8_t spi_bus, uint8_t spi_dev, uint8_t brightness);```

```
@brief: Initialise a set of apa102 LEDs

@param[in] led_num: Number of LEDs (0-255)
@param[in] spi_bus: SPI bus number (0-255)
@param[in] spi_dev: SPI device number (0-255)
@param[in] brightness: Global brightness (0-31)

@returns:  0\ Success
          -1\ Error
```

#### ```void cAPA102_Change_Brightness(uint8_t brightness);```

```
@brief: Change the global brightness and fresh

@param[in] brightness: New brightness value
```

#### ```int cAPA102_Get_Brightness(void);```

```
@brief: Get the brightness

@return current brightness value (0-31)
```

#### ```void cAPA102_Set_Pixel_RGB(uint32_t index, uint8_t red, uint8_t green, uint8_t blue);```

```
@brief: Set color for a specific pixel by giving R, G and B value separately

@param[in] index: Index of the target led (0-255)
@param[in] red: Intensity of red colour (0-255)
@param[in] green: Intensity of green colour (0-255)
@param[in] blue: Intensity of blue colour (0-255)
```

#### ```void cAPA102_Get_Pixel_RGB(uint32_t index, uint8_t *red, uint8_t *green, uint8_t *blue);```

```
@brief: Get colour form a specific pixel for R, G and B separately

@param[in] index: Index of the target led (0-255)
@param[out] red: Intensity of red colour (0-255)
@param[out] green: Intensity of green colour (0-255)
@param[out] blue: Intensity of blue colour (0-255)
```

#### ```void cAPA102_Set_Pixel_4byte(uint32_t index, uint32_t colour);```

```
@brief: Set color for a specific pixel by using 4byte date

@param[in] index: Index of the target led (0-255)
@param[in] red: Intensity of red colour (0-255)
@param[in] green: Intensity of green colour (0-255)
@param[in] blue: Intensity of blue colour (0-255)

@example: cAPA102_Get_Pixel_RGB(1, 0xFF0000) sets the 1st LED to red colour
```

#### ```uint32_t cAPA102_Get_Pixel_4byte(uint32_t index);```

```
@brief: Get colour form a specific pixel

@param[in] index: Index of the target led (0-255)

@returns: 32 bits colour data
```

#### ```void cAPA102_Clear_All(void);```

```
@brief: Clear all the pixels
```

#### ```void cAPA102_Refresh(void);```

```
@brief: Refresh display (After modifying pixel colour)
```

#### ```void cAPA102_Close(void);```

```
@brief: Close SPI file, release memory
```

## Usage example

The following is an example of using this APA102 library with 12 LEDs.

**1.** Copy the `cAPA102.h` and `cAPA102.c` to your project folder.

**2.** Include the head file from where you would use this library.

```c
#include "cAPA102.h"
```

**3.** Call `cAPA102_Init(12, 0, 0, 31)` function with the led_num is 12, spi0.0 and largest brightness to initialise the LED set.

```c
cAPA102_Init(12, 0, 0, 31);
```

**4.** Call `cAPA102_Set_Pixel_4byte()` function to set the first 8 LEDs where the first 4 LEDs are red and the following 4 LEDs are green. Call `cAPA102_Set_Pixel_RGB()` function to set the second 8 LEDs where the first 4 LEDs are blue and the following 4 LEDs are cyan.

```c
int i;
for ( i = 0; i < 3; i++)
    cAPA102_Set_Pixel_4byte(i, 0xFF0000);

for ( i = 3; i < 6; i++)
    cAPA102_Set_Pixel_4byte(i, 0x00FF00);

for ( i = 6; i < 9; i++)
    cAPA102_Set_Pixel_RGB(i, 0, 0, 255);

for ( i = 9; i < 12; i++)
    cAPA102_Set_Pixel_RGB(i, 255, 255, 0);
```

**5.** Call `cAPA102_Refresh()` function to refresh the LEDs.

```c
cAPA102_Refresh();
```

**6. [Important] Call `cAPA102_Close()` function to properly close SPI device file and release pixel memory**

```c
cAPA102_Close();
```

> *(All the pixels data are save by dynamically allocating memory space, without calling this function, your program will cause a memory leakage)*

## How to Contribute

Contributions are welcome! Not familiar with the codebase yet? No problem!

There are many ways to contribute to open source projects: reporting bugs, helping with the documentation, spreading the word and of course, adding new features and patches.

### Getting Started

- Make sure you have a GitHub account.
- Open a [new issue](https://github.com/CoorFun/cAPA102/issues), assuming one does not already exist.
- Clearly describe the issue including steps to reproduce when it is a bug.

### Making Changes

- Fork this repository.
- Create a feature branch from where you want to base your work.
- Make commits of logical units (if needed rebase your feature branch before submitting it).
- Check for unnecessary whitespace with `git diff --check` before committing.
- Make sure your commit messages are well formatted.
- If your commit fixes an open issue, reference it in the commit message (f.e. `#15`).
- Run all the tests (if existing) to assure nothing else was accidentally broken.

These guidelines also apply when helping with documentation.

### Submitting Changes

- Push your changes to a feature branch in your fork of the repository.
- Submit a `Pull Request`.
- Wait for maintainer feedback.

license: MIT


text:
---
layout: post
title: Executing shell commands using Junos PyEZ
tags: [ python, automation, juniper, pyez, ]
image: /img/juniper_logo.jpg
---

When you log in to a Juniper device, you normally land on the Juniper CLI. This is the command shell that most engineers are familiar with. But not all commands are available on the Juniper CLI. Sometimes you will need to interact with the shell of the underlying OS, which can be Linux or FreeBSD. One example reason for you to go to this shell mode, is when you need to log in to a specific line card. Using start shell drops you to shell mode. But how can you do this from a script?

### Executing shell commands from a script

Junos PyEZ, the Python library to automate Juniper devices, also has methods available to issue shell commands. The code can be found here.

This code offers you the StartShell class that comes with a set of methods to log in to the Juniper device and land directly into shell mode. The SSH session that enables all this is created with Paramiko. This part of the code can be found here.

To use these methods, you first create a Device object. This can then be used to instantiate a StartShell object that will allow you to open up an SSH connection to the device and issue shell commands.

To play around with the StartShell class, you can paste the following into a Python interactive shell (or run it as a script):

```python
from jnpr.junos.utils.start_shell import StartShell
from jnpr.junos import Device

dev=Device(host='<IP_ADDRESS>', user='salt', password='salt123')

ss = StartShell(dev)

ss.open()

# checks files in /var/tmp
cmd_1_result = ss.run('ls -ltr /var/tmp/')
# check FPC software version
cmd_2_result = ss.run('cprod -A fpc0 -c "show version"')[1]
# check FPC syslog messages
cmd_3_result = ss.run('cprod -A fpc0 -c "show syslog messages"')[1]

ss.close()

# print the tuple that ss.run returns:
print(cmd_result)
# printing the result of the shell commands:
print(cmd_1_result[1])
print(cmd_2_result[1])
print(cmd_3_result[1])
```

The ss.open and ss.close are used to open and close the connection to the device. The ss.run method will send a command to the device and return a tuple that contains two items. The first item will be True in case the shell command was executed successfully, and False otherwise. The second item contains the command output that the device returns.

In case you are dealing with a command that takes a long time to complete, you can pass a timeout value along with the run method. Let try this out by running a command that takes some time to complete. The log messages that are accessible via show log messages are stored in /var/log/messages. Unless they recently rolled over, chances are this file contains quite some lines. Let's look at the content of this log file using the following script:

```python
from jnpr.junos.utils.start_shell import StartShell
from jnpr.junos import Device

dev=Device(host='<IP_ADDRESS>', user='salt', password='salt123')

ss = StartShell(dev)

ss.open()

cli_1 = ss.run('cat /var/log/messages"', timeout=2)
cli_2 = ss.run('cat /var/log/messages', timeout=90)
ss.close()

print(cli_1[0])
print(cli_2[0])

```

When we run the script, we can see the following:

```
sh-4.4# python3 ex_3.py
False
True
```

The first command did not complete because the timeout was too short. The second command, which had an increased timeout, did complete.

Another thing worth mentioning is that StartShell can be used with the context manager. This means you can use with to open the connection. As soon as the block of code in the with statement is executed, the device connection is automatically closed:

```python
from jnpr.junos.utils.start_shell import StartShell
from jnpr.junos import Device

dev=Device(host='<IP_ADDRESS>', user='salt', password='salt123')

ss = StartShell(dev)

with StartShell(dev) as ss:
    # check older log messages
    cmd_1 = ss.run('zcat /var/log/messages.0.gz', timeout=90)[1]
    # have the device send a syslog message
    cmd_2 = ss.run('logger -e testing123')[1]
    # run a Junos CLI command from shell
    cmd_3 = ss.run('cli -c "show version | no-more"')[1]

print(cmd_1)
print(cmd_2)
print(cmd_3)
```

Hope this helps!


text:
---
layout: post
title: "Mojo Exec Maven Plugin Version 1.4 Released"
date: 2015-03-26 19:37
comments: true
categories: [Neuigkeiten,BM,Maven,Maven-Plugins,Maven-Plugin-Releases]
---
The Mojo team is pleased to announce the release of the
[Exec Maven Plugin version 1.4.0](http://mojo.codehaus.org/exec-maven-plugin/).

The plugin helps with execution of system and Java programs.

To get this update, simply specify the version in your project's
plugin configuration:

``` xml
<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>exec-maven-plugin</artifactId>
  <version>1.4.0</version>
</plugin>
```

<!-- more -->

Release Notes

Bug:

 * {% chjl MEXEC-150 %} - Plugin warns that "killAfter is now deprecated" for no obvious reason

Improvements:

 * {% chjl MEXEC-143 %} - Rename skip property to exec.skip
 * {% chjl MEXEC-147 %} - Update of mojo parent to version 34
 * {% chjl MEXEC-148 %} - Upgrade plexus-utils to 3.0.20
 * {% chjl MEXEC-149 %} - Upgrade plexus-interpolation to 1.21

Tasks:

 * {% chjl MEXEC-127 %} - Remove added parameters after commons-exec is fixed
 * {% chjl MEXEC-152 %} - Update to commons-exec:1.3

Enjoy,

The Mojo team.

repository: khmarbaise/octopress

gha_language: Ruby

repo_name: khmarbaise/octopress


text:
+++
date = "23 Oct 2019"
draft = false
title = "Problem Set 5 Update"
author = "David Evans and Nathan Brunelle"
slug = "ps5update2"
+++

Two more updates to [PS5](/ps/ps5.pdf):

1. **Problem 7** considered adding an array but not loops to NAND-CIRC. But, it doesn't make sense to have arrays without any way to update the index used to access them. So, for this to make sense we need to also have an instruction to update i. So, we have modified this question to add conditional increment and decrement instructions:

   - `CINC` _v_ takes a regular variable as its input, and if the value of _v_ is 1 it updates the value of `i` to be `i` + 1. Otherwise (when _v_ is 0), it does not do anything.

   - `CDEC` _v_ takes a regular variable as its input, and if the value of _v_ is 1 it updates the value of `i` to be max(`i` - 1, 0). Otherwise, it does not do anything.

2. Since we didn't get to examples of uncomputability proofs in class
this week, we're deferring Problem 9 and Problem 10 from PS5 to
PS6. If you've already solved these, great - just save your solution
to submit for the same questions that will be moved to PS6.

gha_language: HTML

gha_license_id: MIT


text:
# Spring CMS Generator

[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/) [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php) [![Bash Shell](https://badges.frapsoft.com/bash/v1/bash.png?v=103)](https://github.com/ellerbrock/open-source-badges/) [![written-in-shell-script](https://img.shields.io/badge/</>-Shell%20Script-<COLOR>.svg)](https://shields.io/) [![current-version](https://img.shields.io/badge/version-1.2.12-blue.svg)](https://shields.io/) [![native-support](https://img.shields.io/badge/native--support-Linux%20%7C%20MacOS-lightgrey.svg)](https://shields.io/)

Spring Controller Model Service Generator is a easy to use Command Line Based code generator tool that handles most of the initial heavy-lighting for you when productivity is at essence. **Inspired from loopback.**

# Spring-CMS-Generator.sh

A simple cli based Spring Boot code generator that creates required along with importing adequate imports / dependencies. Also automatically @Autowires them as per the relations. Along with the freedom of setting custom directories.

After pulling the script make sure to provide adequate permissions

    sudo chmod +x ~/Desktop/spring-CMS-Generator.sh

This script is directory-agnostic. Open terminal in your project directory and call the script using:

    root@user ~/Documents/Spring/CMS-Project $ ~/Desktop/spring-CMS-Generator.sh

### CMS (Controller Model Service) Generation

In the Spring Framework there are basically 3 main components RestController, Models and Services that handles most of the inner-working so now you can automatically create these 3 files.

    ~/Desktop/spring-CMS-Generator.sh cms User

Using this command which automatically creates UserController, User, UserService files along with all the imports and needed Auto-wiring among them. You can create any kind of combinations with these 3 keywords c, m, s like you can have create only Service and Model using **ms** etc. and the necessary Auto-wiring and file imports are handled.

## Extra Flags in Controller Component

- **--need-sample**

  For controller we have a seperate flag that auto-generates certain code-snippets that is widely used in controller like generating **GET, POST, PUT, DELETE request mapping** along with description on how to **fetch data via Request Body, PathVariable, RequestParam** or **RequestHeader.**

        ~/Desktop/spring-CMS-Generator.sh m User --need-sample

## Extra Flags in Model Component

- **--id-gen-type**
  For Instance if you wanted to create the entity's primary key generation type through hex (String data type) use `id-gen-type` key when invoking `m` flag.

        ~/Desktop/spring-CMS-Generator.sh m User --id-gen-type=string

- **--import-sql**

  For model we have a seperate flag that auto-generates commented insert sql statments as per the `property Name` and `data Type` that is being passed while generation into import.sql for both main and test environments.

        ~/Desktop/spring-CMS-Generator.sh m User --import-sql

  - **-times**

    `--import-sql` flag has an extension flag `-times` we will replicate the number of times the insert statement will be created in import.sql. All the insert statement will be under multiLine comment

          ~/Desktop/spring-CMS-Generator.sh m User --import-sql -times=5

    The above statement will create insert statement for `User` entity 5 times in import.sql

### Extra Features in Model component

If you have **m** key the script prompts you to enter **propertyName** along with questions of **dataType, nullable and unique status** which after selecting so will auto generate Model file with code. Also after creation of Model, it's subsequent **Repository** file will be created.

##### Now you can add Relations from 1 Entity to another

When you are using `m` flag after the creation of properties to the entity file you will prompted to define any relations that this entity hold. They are basically 4 relations that can be defined:

- **M2M**

  This will create @ManyToMany Relation in this entity file and on the terminal generates the code-snippet for @ManyToMany that has to added in the related Model's file.

- **M21**

  This will create @ManyToOne Relation in this entity file and on the terminal generates the code-snippet for @OneToMany that has to added in the related Model's file.

- **12M**

  This will create @OneToMany Relation in this entity file and on the terminal generates the code-snippet for @ManyToOne that has to added in the related Model's file.

- **121P**

  In the Case of OneToOne Mapping there is a Parent Entity and a Child Entity. It relies on the logic of that without Parent child wouldn't be possible.

  This will create @OneToOne Relation in this parent entity file and on the terminal generates the code-snippet for @OneToOne that has to added in the child Model's file.

- **121C**

  This will create @OneToOne Relation in this child entity file and on the terminal generates the code-snippet for @OneToOne that has to added in the parent Model's file.

## Make Sure

> If you are using some IDE like Eclipse, STS or Intellij after running the script make sure to **Refresh** the project so that the IDE can link all the new files added to the system.

## --pluginCodeGen

This is a new feature added in the script unlike from that seen in loopback. This flag when added right after invocation of the script along with few built-in commands autogenerates pre-defined controllers and injects subsequent properties along with maven dependencies.

    ~/Desktop/spring-CMS-generator.sh --pluginCodeGen oauth2 mysql multiLang-support freemaker sonar internationalization swagger

Currently supported plugins for - -pluginCodeGen

- **oauth2**

  On passing this arguement to the flag, it would automatically add the plugins, set the needed properties to the properties file. Also adds needed security files to your project. Also generates some Controller that highlights some of the essentials methods like `Custom Route Mapping, TokenEnhancer, Logout Functionality`. Along with a `User Model and Repo files` that is needed.

- **oauth2-db**

  Same as the oauth2 but has `improved functionality of writing tokens into the database provided`, also `prompts you to add some sql scripts into the import.sql file` with client credentials as **admin admin123** that would needed for it to perform.

- **mysql**

  On passing this argument to the flag, it would automatically add maven dependencies along with **h2** dependency for test cases. Injects some properties lines into your `application.properties` file

- **freemaker**

  Easy to use and powerful template engine for spring, as being provided here. After passing the argument, it would add the maven dependencies, needed properties and also a `sampleController` and `sample.ftl` files to provide user on how to work with this library.

- **multiLang-support**

  On entering this flag, automatically the entire spring boot application will updated to `support multiple languages` to an extent using `some pre-defined code snippets that would added to resources, model and example controller and service` that works seamlessly.

- **internationalization**

  On entering this flag, it automatically generates configuration files inside the spring boot project which will make the system automatically support localization of messages based on the value passed in `Accept-Language` header per request along with a sample controller to demostrate how to use it. Along with Localization of javax.hibernate.validator messages.

- **sonar**

  Adds `sonarqube plugin` to pom.xml and adds sonar.properties file into your project that would be sufficient for the sonarqube component to `generate analytics for your project.` Added sonar.exclusions and lombok generated code exclusions with wiremock dependency for mocking APIs.

- **swagger**

  Adds `swagger dependency` to pom.xml and injects SwaggerConfig file with all the basic properties in place. Along with sample controller to show all the Annotations and how to use how.

## Danger

At a time you can either use --pluginCodeGen or cms as the first arguement for the script. If both are passed in the script at the same time, it could lead to unwanted results.

## Aspect Generator

Create your Aspects as easy as calling a script

    ~/Desktop/spring-CMS-Generator.sh a EmailChecker

Then the script will automatically ask you some questions that will then generate the needed code snippets that can used anywhere in the project.

# Custom Directory

- In case if you want to generate `controller` in custom path rather than pre-defined location you can use `--c-folder=.custom.controller`
- In case if you want to generate `service` in custom path rather than pre-defined location you can use `--s-folder=.custom.service`
- In case if you want to generate `model` in custom path rather than pre-defined location you can use `--m-folder=.custom.model`
- In case if you want to generate `dto` in custom path rather than pre-defined location you can use `--d-folder=.custom.dto`
- In case if you want to generate `repository` files in custom path rather than pre-defined location you can use `--r-folder=.custom.repository`
- In case if you want to generate `aspect` in custom path rather than pre-defined location you can use `--a-folder=.custom.aspect`

      ~/Desktop/spring-CMS-Generator.sh cmsa --c-folder=.custom. --m-folder=.tables --r-folder=.tables.repo --s-folder=.custom.web.util --a-folder=.utility.aspect --d-folder=.custom.dto

## Rules for Custom Directory

- In first flag passed is only of controller `c` and `--s-folder` is passed with value no changes will occur.
- folder flag value should always start with `.`
- If folder flag value ends and starts with `.` like `.custom.` then generated directory is `/custom/controller` as in pre-defined controller directory for c flag.
- If folder flag value starts with `.` and doesn't end with `.` like `.tables` then generated directory is `/tables`

# Further Developments

- Creating .bat file for Windows so alternatively you can use git bash to execute bash script in Windows

repository: DheerajKN/Spring-CMS-Generator

gha_language: Shell

repo_name: DheerajKN/Spring-CMS-Generator


text:
# Data Types

| Sr.No. | Data Types & Description |
|---|---|
| 1 | `bool_` - Boolean (True or False) stored as a byte |
| 2 | `int_` - Default integer type (same as C long; normally either int64 or int32) |
| 3 | `intc` - Identical to C int (normally int32 or int64) |
| 4 | `intp` - Integer used for indexing (same as C ssize_t; normally either int32 or int64) |
| 5 | `int8` - Byte (-128 to 127) |
| 6 | `int16` - Integer (-32768 to 32767) |
| 7 | `int32` - Integer (-2147483648 to<PHONE_NUMBER>) |
| 8 | `int64` - Integer (-9223372036854775808 to<PHONE_NUMBER>854775807) |
| 9 | `uint8` - Unsigned integer (0 to 255) |
| 10 | `uint16` - Unsigned integer (0 to 65535) |
| 11 | `uint32` - Unsigned integer (0 to<PHONE_NUMBER>) |
| 12 | `uint64` - Unsigned integer (0 to<PHONE_NUMBER>3709551615) |
| 13 | `float_` - Shorthand for float64 |
| 14 | `float16` - Half precision float: sign bit, 5 bits exponent, 10 bits mantissa |
| 15 | `float32` - Single precision float: sign bit, 8 bits exponent, 23 bits mantissa |
| 16 | `float64` - Double precision float: sign bit, 11 bits exponent, 52 bits mantissa |
| 17 | `complex_` - Shorthand for complex128 |
| 18 | `complex64` - Complex number, represented by two 32-bit floats (real and imaginary components) |
| 19 | `complex128` - Complex number, represented by two 64-bit floats (real and imaginary components) |
| 20 | `object` - python object type |
| 21 | `np.string_` - fixed-length string type |
| 22 | `np.unicode_` - fixed-length unicode type |

NumPy numerical types are instances of dtype (data-type) objects

## Data Type Objects (dtype)

A data type object describes interpretation of fixed block of memory corresponding to an array, depending on the following aspects −

- Type of data (integer, float or Python object)
- Size of data
- Byte order (little-endian or big-endian)
- In case of structured type, the names of fields, data type of each field and part of the memory block taken by each field.
- If data type is a subarray, its shape and data type

The byte order is decided by prefixing '<' or '>' to data type. '<' means that encoding is little-endian (least significant is stored in smallest address). '>' means that encoding is big-endian (most significant byte is stored in smallest address).

A dtype object is constructed using the following syntax

numpy.dtype(object, align, copy)

The parameters are

- Object− To be converted to data type object
- Align− If true, adds padding to the field to make it similar to C-struct
- Copy− Makes a new copy of dtype object. If false, the result is reference to builtin data type object

### Example

```python
import numpy as np

student = np.dtype([('name','S20'), ('age', 'i1'), ('marks', 'f4')])
a = np.array([('abc', 21, 50),('xyz', 18, 75)], dtype = student)
print (a)

[('abc', 21, 50.0), ('xyz', 18, 75.0)]

```

Each built-in data type has a character code that uniquely identifies it.

- 'b'− boolean
- 'i'− (signed) integer
- 'u'− unsigned integer
- 'f'− floating-point
- 'c'− complex-floating point
- 'm'− timedelta
- 'M'− datetime
- 'O'− (Python) objects
- 'S', 'a'− (byte-)string
- 'U'− Unicode
- 'V'− raw data (void)


text:
# Wine_Quality
In this demo, we will search for factors that correlate with a wine being high-quality. By the end, we will gain insight as to what makes a bottle phenomenal, and whether these factors differ based on its color.

### What's in our dataset?
In 2009, Portuguese scientists collected massive inventory of different Vinho Verde wines, and made the dataset open for the community to study. It contains data on more than 5K kinds of wine, and measures 11 different physiochemical properties.

### What's exactly do these chemicals imply for consumers?
**Fixed Acidity:** Gives wine a tart flavor. If there's too little, wine tastes "flat".

**Citric Acid:** Often used as a flavor additive. Adds a fresh, tart taste.

**Volatile Acidity:** In contrast to citric acid, which is a liquid, this is gaseous acidity that can smell like vinegar. Its presence is less likely to be intentional.

**Residual Sugar:** This is the sugar left over when grapes finish fermenting. Correlates with sweetness. “Dry wines” tend to have lower amounts.

**Sulfur:** Additive to prevent bacterial growth. In my research, it was contested whether or not there is a smell or taste associated with it.

**Chlorides:** The measure of salt.

### Is the distribution of red and white wine bottles even?
![Image of Distribution Of Red and White Wine](Plot_Images/distributionplot.png)

From the above plot, we can observe that we have imbalance in our data. But for this demo, we're just going to visualize static data, so we can ignore the overrepresentation for time being.

### Is there any difference in chemical composition between different ratings of wine?
![Image of Difference In Chemical Composition Between Different Rating Of Wine](Plot_Images/ChemicalCompositionBetweenDifferentRatingsOfWine.png)

At first glance, the chemicals follow a bell-curve like distribution and notice an 8-star wine looks not much different than a 4-star wine, sound intuitive, doesn't it? I think the data is scattered across too many wine-quality groupings, lets try creating meaningful groupings to gain insight.

**We care less about difference between a 3 and 4-star bottle, we want to identify what causes the jump between a 3 and an 8. What makes a bottle _phenomenal_**
![Image of Average Chemical Distribution Across Red Wine Of Different Qualities](Plot_Images/DifferentRedWineQualities.png)

### What trends do we see in red wines?
> By grouping our wines more intuitively, we uncover a few valuable relationships.

**1. Low Salt:** On average, the worst red wines have greatest amount of chlorides. This makes sense given chlorides measured that "salty" character. "Phenomenal" wine has the least.

**2. Acidity Matters:** "phenomenal" wines have the least amount of volatile acidity, and the greatest amount of citric acid. Given what we know about wine acids, this makes sense: the citric acid was likely deliberately introduced because it gives the wine a pleasant taste, but the volatile acids were likely a product of poor fermentation.

**3. Alcohol is the King:** The best wines have the most alcohol.

### Are there any additional relationships we can explore that could help explain why each snapshot looks the way it does?
![Image of Correlation between different characteristics in red wines](Plot_Images/RedWineCorrelation.png)

From the above heatmap we can observe - for red wine, alcohol content has relatively strong correlation with wine quality rating(.48), followed by volatile acidity(-.39).

Few other correlations to notice is that alcohol is less dense than water, so it makes sense that more alcohol would be correlated with a lower wine density.

Likewise we would expect there to be a strong correlation between pH and Acidity, given pH measures whether a substance leans towards being acid or a base.

### Is there a difference in the correlations for a high quality white wine?
![Image of Correlation between different characteristics in white wines](Plot_Images/WhiteWineCorrelation.png)

At first glance, we seen that even for white wines, alcohol content has the most positive correlation with quality.

Compared to red wines, for which the presence of citric acid had a 20% correlation with quality, the white wines had a 0% correlation between citric acid and quality.

![Image of Comparing Average Chemical Distribution Between High-Quality Red and White Wines](Plot_Images/ChemicalDistributionBetweenHighQualityRedAndWhiteWine.png)

At chemical level, great white wines had 2-4 times the amount of sulfur than their red counterparts.

From what we learned about sulfure as an additive to prevent spoilage, unless white wine have more naturally occuring sulfur, it is possible that to ferment them necessitates extra protection as opposed to red(just as red wine benefits from the addition of citric acid).

Additionally, white wines had half the amount of chlorides the reds did, but nearly twice as much sugar. They were also slightly less acidic.

**Despite these differences, the alcohol content of high-quality red and white wines was roughly the same.**

> Whether red or white, I think consumer would be happy with nearly any bottle with a high alcohol content. Citric acid content won't make a difference when purchasing a white bottle, but it will often make or break your red.

branch_name: refs/heads/main


text:
# Wetland classification using country-wide ALS data

This repository aims to collect all the scripts which were used for wetland classification based on Airborne Laser Scanning data within the [e-EcoLiDAR project](https://www.esciencecenter.nl/project/eecolidar).

## **The content of the directories**

- **analysis**:

These scripts contain the processing steps related to analyze, convert and classify the ALS data.

- **figures**:

Visualization and camera ready figure plot for the geobia conference paper.

- **grassgis_process**:

[GRASS GIS](https://grass.osgeo.org/) batch scripts for LiDAR data segmentation.

- **laserchicken_process**:

Using [laserchicken](https://github.com/eEcoLiDAR/laserchicken) point cloud analysis software for extracting features related to ALS data.

- **workflow**:

Bash file for executing the scripts from this repository and build a consistent workflow for processing the ALS data.

- **testdata**:

Small example dataset for testing purpose.

## **Installation requirements**

Generally, the workflow was tested under Windows 10 operation system. The workflow can be run under Linux operation system, however, the GRASS GIS section should be adapted.

1. Install Git: https://gitforwindows.org/
Follow the instructions from here: https://escience-academy.github.io/2017-09-06-git-github/#setup

2. Install Anaconda (most preferably the latest version with Python 3): https://conda.io/docs/user-guide/install/index.html

3. Install GRASS GIS (version 7.2 or above): https://grasswiki.osgeo.org/wiki/Installation_Guide (OSGeo4W installer can be accessed during QGIS installation: https://qgis.org/en/site/forusers/download.html)

### Install laserchicken software

1. Get the software (GitHub repository: https://github.com/eEcoLiDAR/laserchicken)

a.) Clone the repository (official release)

```
git clone https://github.com/eEcoLiDAR/laserchicken.git
```

b.) Download as zip file without using git

2. Install

Within the command line (using the right python version) go to this directory and run the following:

```
pip install .
```

If shapely failed than install it separately:
```
conda install -c conda-forge shapely
```

### Install addons for GRASS GIS

Two addons is required to install for running this workflow. For the installation after starting up GRASS GIS from command line (grass74 -gtext) you can install addons with the following commands:
```
g.extension extension=r.neighborhoodmatrix
g.extension extension=i.segment.uspo
```

## **Usage**

Before running the entire workflow you should check that in the bash file ( wetland_classification_from_lidar/workflow/Workflow_geobia_confpaper.sh
) the defined absolute paths are correct. The script can be executed from Git bash (MINGW64 environment) command line using Windows 10 operation system.

- work_folder: location of test files on the local computer (wetland_classification_from_lidar/testdata directory, the results will be saved in this directory too)
- script_path: location of the wetland_classification_from_lidar on the local computer
- path_of_laserchicken: location of laserchicken repository on the local computer
- grass_path: location of the installed GRASS GIS bin directory on the local computer
- grass_mapset: before running the workflow user should set up a mapset with Descartes coordinate system (run from GRASS GIS command line separately grass74 -gtext and then follow the instructions of the software and do not specify specific projection)

The valid_polygon is provided within this repository not the original one (just an example course digitalization from my side). It can be only used for testing. Also the test data is a small tile of the study area [from AHN2 laser campaign](http://www.arcgis.com/home/item.html?id=6c898cd924c441d5aea33b3bc6cc117a) only for demonstration (we do not own this dataset).

```
bash <filepath>/Workflow_geobia_confpaper.sh
```


text:
# TopHandball website
This repository holds the Django app that powers women's handball website TopHandball.com

## Contributing
Contributions are welcome either as pull requests or by reporting issues.

### Setting up a development environment

Clone the repository:

    git clone git@github.com:lhuriguen/tophandball.git

Create a virtualenv anywhere you want and activate it.

Install the required packages for development:

    pip install -r requirements/dev.txt

Create the PostgreSQL database and user:

    sudo su - postgres
    createuser -P tophb
    createdb --owner=tophb tophb

Alternatively, you can configure your own database URL with environment variables. See [dj-database-url](https://github.com/kennethreitz/dj-database-url) for more info.

Create the database structure:

    ./manage.py migrate

Run the local server:

     ./manage.py runserver

repository: lhuriguen/tophandball

gha_language: Python

repo_name: lhuriguen/tophandball


text:
HPCSMist
========

a delightful interface to HP Cloud Services for IOS and OSX.  It's built on top of
[AFNetworking](https://github.com/AFNetworking/AFNetworking)
and other familiar Foundation technologies.

## How To Get Started

### Get The Source
- [Download HPCSMist](https://github.com/hpcloud/HPCSMist)

### Add HPCSMist To Your Project

Instead of adding the source files directly to your project, you may
want to consider using [CocoaPods](http://cocoapods.org/) to manage your dependencies. Follow the
instructions on the CocoaPods site to install the gem, and specify
HPCSMist as a dependency in your Podfile with pod 'HPCSMist',
'0.0.6'.

- Check out the [complete documentation](http://hpcloud.github.io/HPCSMist/) for a
comprehensive look at the APIs available in HPCSMist

## Overview

### Authentication To Control Services

      HPCSIdentityClient identity = [HPCSIdentityClient sharedClient];
      [identity setUsername:@"myuser"];
      [identity setPassword:@"mypassword"];
      [identity setTenantId:@"12345"];

      //on success caches the auth token, assuming success, ignoring failures
      [identity authenticate:nil failure:nil];

### Get A Compute Instance

      HPCSComputeClient *nova = [identity computeClient];

      //list active servers
      [nova servers:^(NSArray * records){
        NSLog(@"got an array of servers");
      }
      failure:^(NSHTTPURLResponse * response, NSError * error){
        NSLog(@"couldnt get server list");
      }

### Get An Object Storage Instance

      HPCSSwiftClient *swift = [identity swiftClient];

      //list containers
      [swift containers:^(NSArray * records){
        NSLog(@"got an array of containers");
      }
      failure:^(NSHTTPURLResponse * response, NSError * error){
        NSLog(@"couldnt get container list");
      }

### TODO

- server side copy
- ACL
- File Compression (should this be done at a higher level?)


text:
# Title
### Pitch Web Application
___

# Author
### Gabriel Odhiambo
___

# Description
### A web application that lets its users to post a pitch in one minute with the aim to motivate a friend.

___

# Behavior Driven Development

### A user can see the pitches other people have posted.
### A user can vote on the pitch they liked and give it a downvote or upvote.
### A user can be signed in order to leave a comment
### A user receives a welcoming email once signed up.

### A user can comment on the different pitches and leave feedback.
### A user can submit a pitch in any category.
### A user can view the different categories.

___

# Technologies

### PYTHON
### HTML
### CSS
### Postgresql
### Flask Framework
### Bootstrap

___

# Installation
### first clone the repository
      git clone: https://github.com/gabyxbinnaeah/Pitch.git

### Then, install all neccesary to run
      pipenv install

### After, run the application

    ./start.sh

### To see your application,access this in your url browser

     http://<IP_ADDRESS>:5000/
___

# Live link

### click on this link to access application: https://pitchip3.herokuapp.com/

___

 # Flask App Templates

 ### Flask-Login : Flask-Login provides user session management for Flask.

 ###  Flask-WTF - Simple integration of Flask and WTForms, including CSRF, file upload, and reCAPTCHA.

 ### Flask-Mail - Makes sending mails from Flask applications very easy and has also support for unittesting.

 ### Flask-Bootstrap - Ready-to-use Twitter-bootstrap for use in Flask.

### Flask-SQLAlchemy - Adds SQLAlchemy support to Flask. Quick and easy.

___

# Requirements

alembic==1.6.5
blinker==1.4
click==8.0.1
dominate==2.6.0
Flask==1.0.2
Flask-Bootstrap==<IP_ADDRESS>
Flask-Login==0.5.0
Flask-Mail==0.9.1
Flask-Migrate==2.7.0
Flask-Script==2.0.6
Flask-SimpleMDE==0.3.0
Flask-SQLAlchemy==2.5.1
Flask-Uploads==0.2.1
Flask-WTF==0.15.1
greenlet==1.1.0
gunicorn==20.1.0
itsdangerous==2.0.1
Jinja2==3.0.1
Mako==1.1.4
markdown2==2.4.0
MarkupSafe==2.0.1
psycopg2==2.8.6
python-dateutil==2.8.1
python-editor==1.0.4
six==1.16.0
SQLAlchemy==1.4.18
visitor==0.1.3
Werkzeug==0.16.0
WTForms==2.2.1

# Known Bug
### There is need to explore on the upvote and downvote for complete functionality of the system.

repository: gabyxbinnaeah/Pitch

repo_name: gabyxbinnaeah/Pitch


text:
# Belgian Federal Parliament Scraper & API
[![Netlify Status](https://api.netlify.com/api/v1/badges/2cbbf08b-eacf-400e-9fcd-ebaafd7ebb5e/deploy-status)](https://app.netlify.com/sites/sleepy-albattani-62fa38/deploys)
[![Build the API, Create Release and Deploy to Netlify](https://github.com/laurensdeb/Federal-Parliament-Scraper/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/laurensdeb/Federal-Parliament-Scraper/actions/workflows/main.yml)

This library provides a scraper based on the Python library Beautiful Soup for the website and meeting notes of the Belgian Federal Parliament. The scraper can currently provide information on the plenary meetings for the sessions between 2007 and now, details on the votes that occurred and the members. We also provide a [hosted version](https://parlement.thundr.be) of the JSON API generated using this library, documentation on this API still is a work-in-progress but the code can serve as documentation if necessary?
## Functionality
- Obtain an overview of all the plenary meetings for a given session
- Get the party affiliation, province and language for the members in the federal parliament during a specified session.
- For each plenary meeting, obtain the meeting topics and votes that occurred during the meeting.
- Support for general votes and votes per language group (i.e. for cases where a majority in both groups is needed).
- Get the names and party affiliation of voters.

## Future functionality
- Get committee meetings and votes in a similar API interface
- Provide statistical information on the occurence of the names of the different parliament members in a specific meeting.
- Allow end users to not only get titles of the meeting topics but also the notes of the discussion itself.

## Getting started
Have a look at `demo.py` to get started.

## Sponsors
The Federal Parliament API is hosted by Netlify and Cloudflare, without the free services provided by these valued partners we wouldn't be able to exist.

repository: glennfeys/Federal-Parliament-Scraper

repo_name: glennfeys/Federal-Parliament-Scraper


text:
@function can-stache-element/lifecycle-methods.render render
@parent can-stache-element/lifecycle-methods 2

@description Render a `StacheElement` instance.

@signature `render(props)`

  Calling `render` will [can-stache-element/lifecycle-methods.initialize] an element and render its [can-stache-element/static.view] into its `innerHTML`. Normally this is called by the [can-stache-element/lifecycle-methods.connectedCallback], but can be called manually for testing:

  ```js
  import { StacheElement } from "can";

  class MyElement extends StacheElement {
	  static view = `
		  <p>{{this.age}}</p>
	  `;
	  static props = {
		  age: { type: Number, default: 30 }
	  };
  }
  customElements.define("my-el", MyElement);

  const myEl = new MyElement()
	  .render({ age: 32 });

  myEl.age;               // -> 32
  myEl.firstElementChild; // -> <p>32</p>
  ```
  @codepen

	@param {Object} props The initial property values.

	@return {Element} The `element` instance.

@body

## Purpose

For testing purposes or integration with other libraries, `render` can be called to render an element with its view.

The first time `render` is called, it will:

- [can-stache-element/lifecycle-methods.initialize] the element with the property values passed to `render`.
- render the stache view into the element.

Subsequent calls to `render` will not have any effect.

repository: canjs/can-stache-element

repo_name: canjs/can-stache-element


text:
# lua-resty-http

Lua HTTP client cosocket driver for [OpenResty](http://openresty.org/) / [ngx\_lua](https://github.com/openresty/lua-nginx-module).

## Status

Production ready.

[![Test](https://github.com/ledgetech/lua-resty-http/actions/workflows/test.yml/badge.svg)](https://github.com/ledgetech/lua-resty-http/actions)

## Features

* HTTP 1.0 and 1.1
* SSL
* Streaming interface to the response body, for predictable memory usage
* Alternative simple interface for single-shot requests without a manual connection step
* Chunked and non-chunked transfer encodings
* Connection keepalives
* Request pipelining
* Trailers
* HTTP proxy connections
* mTLS (requires `ngx_lua_http_module` >= v0.10.23)

## API

* [new](#new)
* [connect](#connect)
* [set\_proxy\_options](#set_proxy_options)
* [set\_timeout](#set_timeout)
* [set\_timeouts](#set_timeouts)
* [set\_keepalive](#set_keepalive)
* [get\_reused\_times](#get_reused_times)
* [close](#close)
* [request](#request)
* [request\_uri](#request_uri)
* [request\_pipeline](#request_pipeline)
* [parse\_uri](#parse_uri)
* [get\_client\_body\_reader](#get_client_body_reader)
* [Response](#response)
    * [body\_reader](#resbody_reader)
    * [read\_body](#resread_body)
    * [read\_trailers](#resread_trailers)

### Deprecated

These methods may be removed in future versions.

* [connect\_proxy](#connect_proxy)
* [ssl\_handshake](#ssl_handshake)
* [proxy\_request](#proxy_request)
* [proxy\_response](#proxy_response)

## Usage

There are two basic modes of operation:

1. **Simple single-shot requests** which require no manual connection management but which buffer the entire response and leave the connection either closed or back in the connection pool.

2. **Streamed requests** where the connection is established separately, then the request is sent, the body stream read in chunks, and finally the connection is manually closed or kept alive. This technique requires a little more code but provides the ability to discard potentially large response bodies on the Lua side, as well as pipelining multiple requests over a single connection.

### Single-shot request

```lua
local httpc = require("resty.http").new()

-- Single-shot requests use the `request_uri` interface.
local res, err = httpc:request_uri("http://example.com/helloworld", {
    method = "POST",
    body = "a=1&b=2",
    headers = {
        ["Content-Type"] = "application/x-www-form-urlencoded",
    },
})
if not res then
    ngx.log(ngx.ERR, "request failed: ", err)
    return
end

-- At this point, the entire request / response is complete and the connection
-- will be closed or back on the connection pool.

-- The `res` table contains the expeected `status`, `headers` and `body` fields.
local status = res.status
local length = res.headers["Content-Length"]
local body   = res.body
```

### Streamed request

```lua
local httpc = require("resty.http").new()

-- First establish a connection
local ok, err, ssl_session = httpc:connect({
    scheme = "https",
    host = "<IP_ADDRESS>",
    port = 8080,
})
if not ok then
    ngx.log(ngx.ERR, "connection failed: ", err)
    return
end

-- Then send using `request`, supplying a path and `Host` header instead of a
-- full URI.
local res, err = httpc:request({
    path = "/helloworld",
    headers = {
        ["Host"] = "example.com",
    },
})
if not res then
    ngx.log(ngx.ERR, "request failed: ", err)
    return
end

-- At this point, the status and headers will be available to use in the `res`
-- table, but the body and any trailers will still be on the wire.

-- We can use the `body_reader` iterator, to stream the body according to our
-- desired buffer size.
local reader = res.body_reader
local buffer_size = 8192

repeat
    local buffer, err = reader(buffer_size)
    if err then
        ngx.log(ngx.ERR, err)
        break
    end

    if buffer then
        -- process
    end
until not buffer

local ok, err = httpc:set_keepalive()
if not ok then
    ngx.say("failed to set keepalive: ", err)
    return
end

-- At this point, the connection will either be safely back in the pool, or closed.
````

# Connection

## new

`syntax: httpc, err = http.new()`

Creates the HTTP connection object. In case of failures, returns `nil` and a string describing the error.

## connect

`syntax: ok, err, ssl_session = httpc:connect(options)`

Attempts to connect to the web server while incorporating the following activities:

- TCP connection
- SSL handshake
- HTTP proxy configuration

In doing so it will create a distinct connection pool name that is safe to use with SSL and / or proxy based connections, and as such this syntax is strongly recommended over the original (now deprecated) [TCP only connection syntax](#TCP-only-connect).

The options table has the following fields:

* `scheme`: scheme to use, or nil for unix domain socket
* `host`: target host, or path to a unix domain socket
* `port`: port on target host, will default to `80` or `443` based on the scheme
* `pool`: custom connection pool name. Option as per [OpenResty docs](https://github.com/openresty/lua-nginx-module#tcpsockconnect), except that the default will become a pool name constructed using the SSL / proxy properties, which is important for safe connection reuse. When in doubt, leave it blank!
* `pool_size`: option as per [OpenResty docs](https://github.com/openresty/lua-nginx-module#tcpsockconnect)
* `backlog`: option as per [OpenResty docs](https://github.com/openresty/lua-nginx-module#tcpsockconnect)
* `proxy_opts`: sub-table, defaults to the global proxy options set, see [set\_proxy\_options](#set_proxy_options).
* `ssl_reused_session`: option as per [OpenResty docs](https://github.com/openresty/lua-nginx-module#tcpsocksslhandshake)
* `ssl_verify`: option as per [OpenResty docs](https://github.com/openresty/lua-nginx-module#tcpsocksslhandshake), except that it defaults to `true`.
* `ssl_server_name`: option as per [OpenResty docs](https://github.com/openresty/lua-nginx-module#tcpsocksslhandshake)
* `ssl_send_status_req`: option as per [OpenResty docs](https://github.com/openresty/lua-nginx-module#tcpsocksslhandshake)
* `ssl_client_cert`: will be passed to `tcpsock:setclientcert`. Requires `ngx_lua_http_module` >= v0.10.23.
* `ssl_client_priv_key`: as above.

## set\_timeout

`syntax: httpc:set_timeout(time)`

Sets the socket timeout (in ms) for subsequent operations. See [set\_timeouts](#set_timeouts) below for a more declarative approach.

## set\_timeouts

`syntax: httpc:set_timeouts(connect_timeout, send_timeout, read_timeout)`

Sets the connect timeout threshold, send timeout threshold, and read timeout threshold, respectively, in milliseconds, for subsequent socket operations (connect, send, receive, and iterators returned from receiveuntil).

## set\_keepalive

`syntax: ok, err = httpc:set_keepalive(max_idle_timeout, pool_size)`

Either places the current connection into the pool for future reuse, or closes the connection. Calling this instead of [close](#close) is "safe" in that it will conditionally close depending on the type of request. Specifically, a `1.0` request without `Connection: Keep-Alive` will be closed, as will a `1.1` request with `Connection: Close`.

In case of success, returns `1`. In case of errors, returns `nil, err`. In the case where the connection is conditionally closed as described above, returns `2` and the error string `connection must be closed`, so as to distinguish from unexpected errors.

See [OpenResty docs](https://github.com/openresty/lua-nginx-module#tcpsocksetkeepalive) for parameter documentation.

## set\_proxy\_options

`syntax: httpc:set_proxy_options(opts)`

Configure an HTTP proxy to be used with this client instance. The `opts` table expects the following fields:

* `http_proxy`: an URI to a proxy server to be used with HTTP requests
* `http_proxy_authorization`: a default `Proxy-Authorization` header value to be used with `http_proxy`, e.g. `Basic ZGVtbzp0ZXN0`, which will be overriden if the `Proxy-Authorization` request header is present.
* `https_proxy`: an URI to a proxy server to be used with HTTPS requests
* `https_proxy_authorization`: as `http_proxy_authorization` but for use with `https_proxy` (since with HTTPS the authorisation is done when connecting, this one cannot be overridden by passing the `Proxy-Authorization` request header).
* `no_proxy`: a comma separated list of hosts that should not be proxied.

Note that this method has no effect when using the deprecated [TCP only connect](#TCP-only-connect) connection syntax.

## get\_reused\_times

`syntax: times, err = httpc:get_reused_times()`

See [OpenResty docs](https://github.com/openresty/lua-nginx-module#tcpsockgetreusedtimes).

## close

`syntax: ok, err = httpc:close()`

See [OpenResty docs](https://github.com/openresty/lua-nginx-module#tcpsockclose).

# Requesting

## request

`syntax: res, err = httpc:request(params)`

Sends an HTTP request over an already established connection. Returns a `res` table or `nil` and an error message.

The `params` table expects the following fields:

* `version`: The HTTP version number. Defaults to `1.1`.
* `method`: The HTTP method string. Defaults to `GET`.
* `path`: The path string. Defaults to `/`.
* `query`: The query string, presented as either a literal string or Lua table..
* `headers`: A table of request headers.
* `body`: The request body as a string, a table of strings, or an iterator function yielding strings until nil when exhausted. Note that you must specify a `Content-Length` for the request body, or specify `Transfer-Encoding: chunked` and have your function implement the encoding. See also: [get\_client\_body\_reader](#get_client_body_reader)).

When the request is successful, `res` will contain the following fields:

* `status`: The status code.
* `reason`: The status reason phrase.
* `headers`: A table of headers. Multiple headers with the same field name will be presented as a table of values.
* `has_body`: A boolean flag indicating if there is a body to be read.
* `body_reader`: An iterator function for reading the body in a streaming fashion.
* `read_body`: A method to read the entire body into a string.
* `read_trailers`: A method to merge any trailers underneath the headers, after reading the body.

If the response has a body, then before the same connection can be used for another request, you must read the body using `read_body` or `body_reader`.

## request\_uri

`syntax: res, err = httpc:request_uri(uri, params)`

The single-shot interface (see [usage](#Usage)). Since this method performs an entire end-to-end request, options specified in the `params` can include anything found in both [connect](#connect) and [request](#request) documented above. Note also that fields `path`, and `query`, in `params` will override relevant components of the `uri` if specified (`scheme`, `host`, and `port` will always be taken from the `uri`).

There are 3 additional parameters for controlling keepalives:

* `keepalive`: Set to `false` to disable keepalives and immediately close the connection. Defaults to `true`.
* `keepalive_timeout`: The maximal idle timeout (ms). Defaults to `lua_socket_keepalive_timeout`.
* `keepalive_pool`: The maximum number of connections in the pool. Defaults to `lua_socket_pool_size`.

If the request is successful, `res` will contain the following fields:

* `status`: The status code.
* `headers`: A table of headers.
* `body`: The entire response body as a string.

## request\_pipeline

`syntax: responses, err = httpc:request_pipeline(params)`

This method works as per the [request](#request) method above, but `params` is instead a nested table of parameter tables. Each request is sent in order, and `responses` is returned as a table of response handles. For example:

```lua
local responses = httpc:request_pipeline({
    { path = "/b" },
    { path = "/c" },
    { path = "/d" },
})

for _, r in ipairs(responses) do
    if not r.status then
        ngx.log(ngx.ERR, "socket read error")
        break
    end

    ngx.say(r.status)
    ngx.say(r:read_body())
end
```

Due to the nature of pipelining, no responses are actually read until you attempt to use the response fields (status / headers etc). And since the responses are read off in order, you must read the entire body (and any trailers if you have them), before attempting to read the next response.

Note this doesn't preclude the use of the streaming response body reader. Responses can still be streamed, so long as the entire body is streamed before attempting to access the next response.

Be sure to test at least one field (such as status) before trying to use the others, in case a socket read error has occurred.

# Response

## res.body\_reader

The `body_reader` iterator can be used to stream the response body in chunk sizes of your choosing, as follows:

````lua
local reader = res.body_reader
local buffer_size = 8192

repeat
    local buffer, err = reader(buffer_size)
    if err then
        ngx.log(ngx.ERR, err)
        break
    end

    if buffer then
        -- process
    end
until not buffer
````

If the reader is called with no arguments, the behaviour depends on the type of connection. If the response is encoded as chunked, then the iterator will return the chunks as they arrive. If not, it will simply return the entire body.

Note that the size provided is actually a **maximum** size. So in the chunked transfer case, you may get buffers smaller than the size you ask, as a remainder of the actual encoded chunks.

## res:read\_body

`syntax: body, err = res:read_body()`

Reads the entire body into a local string.

## res:read\_trailers

`syntax: res:read_trailers()`

This merges any trailers underneath the `res.headers` table itself. Must be called after reading the body.

# Utility

## parse\_uri

`syntax: local scheme, host, port, path, query? = unpack(httpc:parse_uri(uri, query_in_path?))`

This is a convenience function allowing one to more easily use the generic interface, when the input data is a URI.

As of version `0.10`, the optional `query_in_path` parameter was added, which specifies whether the querystring is to be included in the `path` return value, or separately as its own return value. This defaults to `true` in order to maintain backwards compatibility. When set to `false`, `path` will only include the path, and `query` will contain the URI args, not including the `?` delimiter.

## get\_client\_body\_reader

`syntax: reader, err = httpc:get_client_body_reader(chunksize?, sock?)`

Returns an iterator function which can be used to read the downstream client request body in a streaming fashion. You may also specify an optional default chunksize (default is `65536`), or an already established socket in
place of the client request.

Example:

```lua
local req_reader = httpc:get_client_body_reader()
local buffer_size = 8192

repeat
    local buffer, err = req_reader(buffer_size)
    if err then
        ngx.log(ngx.ERR, err)
        break
    end

    if buffer then
        -- process
    end
until not buffer
```

This iterator can also be used as the value for the body field in request params, allowing one to stream the request body into a proxied upstream request.

```lua
local client_body_reader, err = httpc:get_client_body_reader()

local res, err = httpc:request({
    path = "/helloworld",
    body = client_body_reader,
})
```

# Deprecated

These features remain for backwards compatability, but may be removed in future releases.

### TCP only connect

*The following versions of the `connect` method signature are deprecated in favour of the single `table` argument [documented above](#connect).*

`syntax: ok, err = httpc:connect(host, port, options_table?)`

`syntax: ok, err = httpc:connect("unix:/path/to/unix.sock", options_table?)`

NOTE: the default pool name will only incorporate IP and port information so is unsafe to use in case of SSL and/or Proxy connections. Specify your own pool or, better still, do not use these signatures.

## connect\_proxy

`syntax: ok, err = httpc:connect_proxy(proxy_uri, scheme, host, port, proxy_authorization)`

*Calling this method manually is no longer necessary since it is incorporated within [connect](#connect). It is retained for now for compatibility with users of the older [TCP only connect](#TCP-only-connect) syntax.*

Attempts to connect to the web server through the given proxy server. The method accepts the following arguments:

* `proxy_uri` - Full URI of the proxy server to use (e.g. `http://proxy.example.com:3128/`). Note: Only `http` protocol is supported.
* `scheme` - The protocol to use between the proxy server and the remote host (`http` or `https`). If `https` is specified as the scheme, `connect_proxy()` makes a `CONNECT` request to establish a TCP tunnel to the remote host through the proxy server.
* `host` - The hostname of the remote host to connect to.
* `port` - The port of the remote host to connect to.
* `proxy_authorization` - The `Proxy-Authorization` header value sent to the proxy server via `CONNECT` when the `scheme` is `https`.

If an error occurs during the connection attempt, this method returns `nil` with a string describing the error. If the connection was successfully established, the method returns `1`.

There's a few key points to keep in mind when using this api:

* If the scheme is `https`, you need to perform the TLS handshake with the remote server manually using the `ssl_handshake()` method before sending any requests through the proxy tunnel.
* If the scheme is `http`, you need to ensure that the requests you send through the connections conforms to [RFC 7230](https://tools.ietf.org/html/rfc7230) and especially [Section 5.3.2.](https://tools.ietf.org/html/rfc7230#section-5.3.2) which states that the request target must be in absolute form. In practice, this means that when you use `send_request()`, the `path` must be an absolute URI to the resource (e.g. `http://example.com/index.html` instead of just `/index.html`).

## ssl\_handshake

`syntax: session, err = httpc:ssl_handshake(session, host, verify)`

*Calling this method manually is no longer necessary since it is incorporated within [connect](#connect). It is retained for now for compatibility with users of the older [TCP only connect](#TCP-only-connect) syntax.*

See [OpenResty docs](https://github.com/openresty/lua-nginx-module#ngxsockettcp).

## proxy\_request / proxy\_response

*These two convenience methods were intended simply to demonstrate a common use case of implementing reverse proxying, and the author regrets their inclusion in the module. Users are encouraged to roll their own rather than depend on these functions, which may be removed in a subsequent release.*

### proxy\_request

`syntax: local res, err = httpc:proxy_request(request_body_chunk_size?)`

Performs a request using the current client request arguments, effectively proxying to the connected upstream. The request body will be read in a streaming fashion, according to `request_body_chunk_size` (see [documentation on the client body reader](#get_client_body_reader) below).

### proxy\_response

`syntax: httpc:proxy_response(res, chunksize?)`

Sets the current response based on the given `res`. Ensures that hop-by-hop headers are not sent downstream, and will read the response according to `chunksize` (see [documentation on the body reader](#resbody_reader) above).

# Author

James Hurst<EMAIL_ADDRESS>with contributions from @hamishforbes, @Tieske, @bungle et al.

# Licence

This module is licensed under the 2-clause BSD license.

Copyright (c) James Hurst<EMAIL_ADDRESS>
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

repository: ledgetech/lua-resty-http

gha_language: Lua

repo_name: ledgetech/lua-resty-http


text:
# easycla-protected-branch-test-repo
This is a repository for testing the branch protection setup and configuration feature of EasyCLA.

## Contributor Console Diagram

![Diagram](https://app.lucidchart.com/publicSegments/view/e1a7447e-2753-4271-acd1-1349abb25c9c/image.png)


text:
# LazyJSON
LazyJSON is a very fast JSON parser for Java that sprung out of the [StroomData](https://github.com/doubledutch/StroomData) project at DoubleDutch. You can read more about the origin of the library in [this blogpost](https://content.doubledutch.me/blog/json-parser).

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/me.doubledutch/lazyjson/badge.svg)](https://maven-badges.herokuapp.com/maven-central/me.doubledutch/lazyjson)
[![Javadocs](http://www.javadoc.io/badge/me.doubledutch/lazyjson.svg)](http://www.javadoc.io/doc/me.doubledutch/lazyjson)

## Usage

LazyJSON has an API based on that of the `org.json` Java library as demonstrated in the following sample:

```java
String source="{\"title\":\"World\"}";

LazyObject obj=new LazyObject(source);
System.out.println("Hello "+obj.getString("title")+"!");
// Expected output: "Hello World!"
````

The library includes a JSON compression feature that uses template based encoding and caching of repeated string values using an http2 header cache inspired scheme.

```java
String source="{\"title\":\"World\"}";
Compressor cmp=new Compressor("./compression_cache",100,1);
byte[] data=cmp.compress(source);
cmp.commit(); // Write out templates and dictionary data
String output=cmp.decompress(data);
````

In our own tests on real world data at DoubleDutch LazyJSON compression gets us down to around 20-25%. We are able to further get down to less than 2% by combining this with a general purpose compression tool such as xz. You can read more about the process and [our results here](http://engineering.doubledutch.me/h/i/282745449-lazyjson-and-the-chamber-of-extreme-compression).

## Performance

The following table shows a speed comparison for parsing around 551kb of JSON data.

JSON Library | Min | Max | Avg | Median
-------------|-----|-----|-----|-------
json.org | 7.75176 | 22.426924 | 11.096008 | 10.59668
GSON JsonParser | 3.703044 | 9.933935 | 5.780482 | 5.690398
Jackson ObjectMapper | 2.882437 | 8.55358 | 5.165173 | 4.887188
Jackson JsonParser | 1.982652 | 6.068085 | 3.27319225 | 3.2957
LazyJSON | 1.590227 | 3.763087 | 2.54875 | 2.566992
GSON class based | 4.14453 | 12.330691 | 6.4768755 | 6.16929
Boon | 4.100606 | 9.142838 | 5.808073 | 5.70455

However, the real speed benefit comes when using LazyJSON to extract JSON objects from a string representation of JSON array with the intention of getting each object as a separate string (this is the usage of this library in [StroomData](https://github.com/doubledutch/StroomData)). The following table shows the same test data as above processed in this fashion.

JSON Library | Min | Max | Avg | Median
-------------|-----|-----|-----|-------
json.org | 16.193432 | 34.084046 | 20.677518 | 19.336549
GSON JsonParser based | 7.254918 | 17.019365 | 10.777558 | 10.150436
Jackson ObjectMapper | 5.149789 | 13.676147 | 7.4314225 | 7.19378
LazyJSON | 1.545074 | 4.47108 | 2.73187325 | 2.778728
GSON class based | 8.921176 | 20.0559 | 12.446913 | 12.08505
Boon | 10.468966 | 25.870486 | 14.332774 | 13.447765

For more details about these tests, the source code and further benchmarks - see this repo [https://github.com/kasperjj/LazyJSONBenchmark](https://github.com/kasperjj/LazyJSONBenchmark)

## Design Principles

LazyJSON was initially designed as an index overlay parser that would collect tokens into a very simple AST while maintaining the index locations of the objects' start and end tokens. This functionality allows it to extract the substring containing an object from the source string data in a very very efficient manner—so efficient, in fact, that it is twice as fast as Jackson for that specific task.

The purpose behind this design was to be able to efficiently split a batch of data submitted to StroomData into separate strings for each object that could each be committed to storage separately. The following snippet shows this specific usage.

```java
String batch="[{\"foo\":1},{\"foo\":2},{\"foo\":3}]";

LazyArray array=new LazyArray(batch);
for(int i=0;i<array.length();i++){
	String data=array.getJSONObject(i).toString();
}
````

The initial benchmark results were so encouraging that they sparked the question - what if we turned this into a full featured JSON parser that would attempt to be as lazy as possible? That is, when it initially parses a source string it only does the most basic tokenization needed to validate the input. Everything else is postponed until you actually request data. Let's look at a sample of what this means.

```java
String source="{\"foo\":42}";

LazyObject obj=new LazyObject(source);
int i=obj.getInt("foo");
````

In this sample, the parser will validate the source string when we instantiate the LazyObject class, but it won't actually create an int from the value of the foo field until we request it.

The changes needed to accommodate this functionality had a neglible impact on the general performance of the parser, which yielded very promising results when compared to other high performance JSON parsers available in Java. In our initial testing, the raw parsing of JSON data has been much faster than all other JSON parsers to which we have compared it. As you start to access the data—and are thus forcing it to do the work that was skipped during the initial parsing—it gets slower and slower, but so far in our testing it still maintains a lead even when all fields are accessed.

## State of the Project

We are using LazyJSON in production at DoubleDutch. So far, it has been very stable and we are highly committed to fixing any issues that might arise in an extremely efficient manner. I repeat: we are using this in production! If you find any issues, please file them right here on the github project page!

repository: doubledutch/LazyJSON

repo_name: doubledutch/LazyJSON


text:
## Retrieve an existing payout

#### Request params

`id`
:    _required_ id of payout to retrieve

#### Response

Returns a payout object

`paid_at` is the date that the funds will reach your bank account.

repository: joshkehn/api-docs

repo_name: joshkehn/api-docs


text:
# doGAN
Using a GAN to create images, specifically cute dogs.

Final Project for Harvard CS25, Image Processing and Computer Vision.

TensorFlow Core v2.3.0
Run on Google Colab GPU

## Results before running out of GPU Runtime
![Results](https://github.com/vinhle169/image_generator/blob/master/results.png?raw=true)

### For more check out the [ipynb file](https://github.com/vinhle169/image_generator/blob/master/dog_gan.ipynb)!


text:
puppet-lint-absolute_classname-check
====================================

[![License](https://img.shields.io/github/license/voxpupuli/puppet-lint-absolute_classname-check.svg)](https://github.com/voxpupuli/puppet-lint-absolute_classname-check/blob/master/LICENSE)
[![Test](https://github.com/voxpupuli/puppet-lint-absolute_classname-check/actions/workflows/test.yml/badge.svg)](https://github.com/voxpupuli/puppet-lint-absolute_classname-check/actions/workflows/test.yml)
[![Release](https://github.com/voxpupuli/puppet-lint-absolute_classname-check/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/puppet-lint-absolute_classname-check/actions/workflows/release.yml)
[![RubyGem Version](https://img.shields.io/gem/v/puppet-lint-absolute_classname-check.svg)](https://rubygems.org/gems/puppet-lint-absolute_classname-check)
[![RubyGem Downloads](https://img.shields.io/gem/dt/puppet-lint-absolute_classname-check.svg)](https://rubygems.org/gems/puppet-lint-absolute_classname-check)
[![Donated by Camptocamp](https://img.shields.io/badge/donated%20by-camptocamp-fb7047.svg)](#transfer-notice)

A puppet-lint plugin to check that classes are included by their absolute name.

## Table of contents

* [Installing](#installing)
  * [From the command line](#from-the-command-line)
  * [In a Gemfile](#in-a-gemfile)
* [Checks](#checks)
  * [Relative class name inclusion](#relative-class-name-inclusion)
  * [Relative class reference](#relative-classname-reference)
* [Transfer notice](#transfer-notice)
* [Release Informaion](#release-information)

## Installing

### From the command line

```shell
$ gem install puppet-lint-absolute_classname-check
```

### In a Gemfile

```ruby
gem 'puppet-lint-absolute_classname-check', :require => false
```

## Checks

### Relative class name inclusion

Including a class by a relative name might lead to unexpected results [in Puppet 3](https://docs.puppet.com/puppet/3/lang_namespaces.html#relative-name-lookup-and-incorrect-name-resolution). That's why a lot of manifests explicitly include by the absolute name. Since Puppet 4 names are always absolute and this is no longer needed. This lint check helps to clean up your manifests.

#### What you have done

```puppet
include ::foobar
```

#### What you should have done

```puppet
include foobar
```

#### Disabling the check

To disable this check, you can add `--no-relative_classname_inclusion-check` to your puppet-lint command line.

```shell
$ puppet-lint --no-relative_classname_inclusion-check path/to/file.pp
```

Alternatively, if you’re calling puppet-lint via the Rake task, you should insert the following line to your `Rakefile`.

```ruby
PuppetLint.configuration.send('disable_relative_classname_inclusion')
```

### Relative class reference

#### What you have done

```puppet
Class['::foo'] -> Class['::bar']
```

#### What you should have done

```puppet
Class['foo'] -> Class['bar']
```

#### Disabling the check

To disable this check, you can add `--no-relative_classname_reference-check` to your puppet-lint command line.

```shell
$ puppet-lint --no-relative_classname_reference-check path/to/file.pp
```

Alternatively, if you’re calling puppet-lint via the Rake task, you should insert the following line to your `Rakefile`.

```ruby
PuppetLint.configuration.send('disable_relative_classname_reference')
```

## Transfer Notice

This plugin was originally authored by [Camptocamp](http://www.camptocamp.com).
The maintainer preferred that Puppet Community take ownership of the module for future improvement and maintenance.
Existing pull requests and issues were transferred over, please fork and continue to contribute here instead of Camptocamp.

Previously: https://github.com/camptocamp/puppet-lint-absolute_classname-check

## License

This gem is licensed under the Apache-2 license.

## Release information

To make a new release, please do:
* Update the version in the `puppet-lint-absolute_classname-check.gemspec` file
* Install gems with `bundle install --with release --path .vendor`
* generate the changelog with `bundle exec rake changelog`
* Create a PR with it
* After it got merged, push a tag. Travis will do the actual release


text:
## GetSpecificAttributeValue request

### Description
GetSpecificAttributeValue is a request to get a specific attribute value from an ObisCode from an E-meter.

The request is sent with the DeviceIdentification number from the desired device and dlms specific values that point to the object:
- a ClassId
- an ObisCode
- and an AttributeId

All requests have similar response behaviour which is described in [ResponseMessages](./ResponseMessages.md).

[GetSpecificAttributeValueResponse](GetSpecificAttributeValueResponse.md) returns the result values as text (String) from getting the configuration object. The response contains the DeviceIdentification and CorrelationUid which is received from the GetSpecificAttributeValue request.

### References

XSD: [sm-adhoc.xsd](https://github.com/OSGP/open-smart-grid-platform/blob/development/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/sm-adhoc.xsd)

WSDL: [SmartMeteringAdhoc.wsdl](https://github.com/OSGP/open-smart-grid-platform/blob/development/osgp/shared/osgp-ws-smartmetering/src/main/resources/SmartMeteringAdhoc.wsdl)


text:
---
id: page-plugin
title: Plugins - EE Proxy Caching
header_title: EE Proxy Caching
header_icon: /assets/images/icons/plugins/ee-proxy-caching.png
breadcrumbs:
  Plugins: /plugins
nav:
  - label: Getting Started
    items:
      - label: Requesting Access
---

The Proxy Caching plugin for Kong Enterprise Edition makes it fast and easy to configure caching of responses and serving of those cached responses to matching requests.

  Enterprise-Only This plugin is only available with an
  Enterprise Subscription.

----

## Requesting Access

This plugin is only available with a [Kong Enterprise](https://konghq.com/kong-enterprise-edition)
subscription.

If you are not a Kong Enterprise customer, you can inquire about our
Enterprise offering by [contacting us](https://konghq.com/request-demo).


text:
---
layout: post
title:  "Difference between Security Group and Network ACL in AWS"
description: AWS secures their environment which help of two type firewall which are Security group and Network ACL.
date:   2018-07-13 10:30:00 +0530
categories: awsgeneral
author: senthil
---

AWS provides two type of firewall to secure the cloud environment.

Security group act as a firewall at the EC2 Server level which controlls both In-bound and Out-bound traffic to the instances.

Network Access Control List is NACL which act as a firewall at subnet level and controlls both In-bound and Out-bound traffic at Subnet level.

Following table summarizes basic difference betweek Security Group and NACL.

| Security Group| Network NACL     |
|:-------------:|:----------------:|
| It is the firewall of EC2 Instance  | It is the firewall of the Subnets |
| It is associated with EC2 Instance only | It is associate with Subnet only |
| All rules are applied | Rules are applied in their order (the rule with the lower number gets processed first) |
| It is a stateful which means any changes applied to an incoming rule will be automatically applied to the outgoing rule. Example: If you allow an incoming port 80, the outgoing port 80 will be automatically opened. |  It is a Stateless means any changes applied to an incoming rule will not be applied to the outgoing rule. Example: If you allow an incoming port 80, you would also need to apply the rule for outgoing traffic.|
| Supports Allow rules only. You cannot deny a certain IP address | Supports Allow and Deny rules |

repository: awscloudhacks/blog

repo_name: awscloudhacks/blog


text:
---
layout: post
title: Epilogue
date: '2012-01-04T17:10:00+00:00'
categories: []
tumblr_url: http://www.somethingnew365.com/post/43669682596/epilogue
---
Well that was fun wasn’t it?

I'm not sure if I’d have known when I started how much this would take over my life, I would have even begun, but now I’ve reached the end of a year of new things what have I learnt?

Other than the stress of having to do something new (and vaguely interesting) every single day, it has been a worthwhile experience. I definitely think I’ve changed a little for the better, and I’m certainly more likely to choose the novel option if offered a choice rather than the safe one. This is a good thing, although for the first days of 2012 it’s been nice not to have to do it so obsessively!

The main thing I’ve learnt is that if you want to do something that requires some commitment, then stating in public what you’re going to do is a hugely motivating factor. The feedback from friends was very useful, even if most of it was along the lines of “that was a bit shit yesterday” or “that cooking didn’t look very well presented” :-)

Following the same principle of public commitment, by real achievement this year has been to lose over 20 lbs in weight via dieting, as can be seen from my public spreadsheet tracking my weight.

I’m not sure what my favorite posts of the year were. I most enjoyed the travelling to new countries (Sweden, Denmark and Germany), and many of the things I cooked were honestly much better tasting than they looked!

I also enjoyed the experience of writing something every day, and even managed to squeeze a few weak jokes in there too.

So what’s next? I’m definitely not carrying on, and have really enjoyed the year so far and have been able to cook something I’ve done before and know will taste nice!

What I am going to do - as I posted in October - is try to ship 12 different pieces of software in 2012 (obviously one a month), and see if I can start up something interesting. Even if they all fail I hope it will be interesting doing so, and I’m hoping to share how I get on at via my website at [http://www.bravelocation.com](http://www.bravelocation.com)

So that’s it. I hope you enjoyed reading about my adventure a little bit, and maybe it’s inspired you to try something new every now and then?

repository: bravelocation/somethingneweveryday

repo_name: bravelocation/somethingneweveryday