text:
Simple asp.net application continuous integration script
===================

>**Motivation:** Every firm has a different code/build management process. There can be no single solution. Available CI tools provide limited functionality. Batch script based automation provides the flexibility to easily adapt to requirement [(good read on CI)](https://www.thoughtworks.com/continuous-integration)

The script aims to serve as light-weight base on which CI process can be built.

It performs the following tasks to automate app publishing to local filesystem:

 1. pulls latest code from SVN repo
 2. build the visual studio solutions
 3. publish the build to a staging area
 4. move the build to virtual directory
 5. publish a html web page with list of commit messages as release notes

----------

Setup
-------------
####  Pre requisite
Checkout the code you want to publish at a different location other than your dev code.This code base would never be modified to minimize code conflicts during updates.

####  Set variables
Modify the batch script **ci.cmd** according to your environment.

```
SET svnCheckoutLocation="D:\code\project\dev"
SET svnRepoUrl="http://svn-build:8080/svn/project/Dev"
SET stagingLocation="D:\QA\project\stage"
SET publishLocation="\\ws-qa-server\project"
SET ideLocation="C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\"
SET frameworkLocation="C:\Windows\Microsoft.NET\Framework\v4.0.30319\"

SET solution1="D:\code\dev\projectLibrary\projectLibrary.sln"
SET solution2="D:\code\dev\projectUI\projectUI.sln"
SET uiProject="D:\code\dev\projectUI\projectUI\projectUI.csproj"
```
#### Creating build target

Open the UI csproj file and add the following code under ***Project*** node:
```
<Target Name="PublishToFileSystem" DependsOnTargets="PipelinePreDeployCopyAllFilesToOneFolder">
    <Error Condition="'$(PublishDestination)'==''" Text="The PublishDestination property must be set to the intended publishing destination." />
    <MakeDir Condition="!Exists($(PublishDestination))" Directories="$(PublishDestination)" />
    <ItemGroup>
      <PublishFiles Include="$(_PackageTempDir)\**\*.*" />
    </ItemGroup>
    <Copy SourceFiles="@(PublishFiles)" DestinationFiles="@(PublishFiles->'$(PublishDestination)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="True" />
  </Target>
```

####  Embed auto generated release notes
The script copies a folder ***svnlogs*** to the published location.Add the following code to embed release notes into your application:

```
<a href="svnlogs\logs.html" target="_blank" >Release Notes</a>
```

![ScreenShot](https://raw.githubusercontent.com/mukulsinghsaini/images/master/release-notes-by-ci.png)

####  Scheduling the script

Schedule the script using windows task scheduler.Currently svn does not support event subscription, so set the frequency according to your requirements.

####  TODO

 - lots of scope for code optimization
 - test for VS2012 onwards
 - log errors
 - handle build failures

>***Tested On***
> - Visual Studio 2010
> - Tortoise SVN


text:
---
title       : "Exploratory Data Analysis II:"
subtitle    : "Graphing in Two Dimensions"
author      : "William R. Buchanan, Ph.D."
job         : "Strategic Data Fellow at MDE/Adjunct Prof at JSU"
framework   : io2012        # {io2012, html5slides, shower, dzslides, ...}
highlighter : highlight.js  # {highlight.js, prettify, highlight}
hitheme     : tomorrow      #
widgets     : []            # {mathjax, quiz, bootstrap}
mode        : selfcontained # {standalone, draft}
knit        : slidify::knit2slides

---

# Overview
* Review:
    + General reminders
    + First Assignment
* Bivariate Data Visualization
    + Continuous v Continuous variables
    + Continuous v Categorical variables
* Additional tips
* Next class

---

# Review
## General reminders
* Several students lost points on the assignment for not following directions in the syllabus; if you haven't read through the syllabus you should
* Before submitting any code for your assignment you should be checking to make sure that it does what you intend it to do
     + I usually will test the code by running it in the console first and then will add it to my script only after checking it
     + If you're copying and pasting from the console remember to remove the `>` and `+` prompts from what you copy and paste
     + If what you're copying is text or a note make sure to include the `#` symbol before that text
* Start new threads on the discussion boards for each unique topic; this makes it easier for everyone to find help
* Although I do not grade grammar or spelling, this is a graduate level course and I expect there to be at least minimal effort on your part to use correct capitalization, complete sentences, etc...

---

Load the example data set that will be used tonight

```r
# Load the packages needed for the graphs and to read the data
library("foreign"); library("ggplot2");

# Read the example data set from my server
johnDoe <- as.data.frame(read.dta( # Don't put the URL on this line
        "http://www.paces-consulting.org/stata/JSU/Fall2014/JohnDoe-task1.dta"))
```

* Looking only at the bars in the next graphs, what differences did you see?
* Looking at the code, what variable is being graphed in the two examples?

---

```r
# Compare this and the next graph
qplot(race, data = johnDoe)
```

---

```r
qplot(race, data = johnDoe, geom = "histogram", na.rm = TRUE, binwidth = 10,
    ylab = "# of Students per Score", main = "Middle of Year ELA : \nBinwidth set to 10",
    xlab = "Middle of Year \nEnglish/Language Arts Scores")
```

---

* Keeping in mind that the data for the interpretations below were different what differences do you see in the quality of the interpretations?:
    + "Asians had the lowest scores while African Americans had the higest scores. "
    + "After reviewing the data on the graph it looks as if a majority of the students are black and white. The largest group is black followed by white then there is only a few hispanic."
    + "According to the nominal scale, there are more African American students than any other race in the school."
    + "District has more African-American students than White students and less than or close to 1000 Hispanic or Latino students."
    + "over 200000 scored 0-10"
* Which of these do you feel did the best job?

---

```r
# Look at this graph and compare the interpretations on the next slide
qplot(female, data = johnDoe)
```

---

* Which interpretation do you think deserves a better score?  Why?
     + Males have a higer count than females.
     + After reviewing the graph the ratio of male to female is close.  But the male population out weighs the female by a few thousand.
     + Based on the graph there are approximately 24,000 male students vs. around 22,000 female students.  The ratio of male to female is pretty evenly distributed with males having a slightly larger number.  As the population is pretty close to 50/50 male to female these results were expected.

---

# Review
## First Course Assignment (and some more generalized stuff as well)
* I can bring everyone to the water, but I cannot make anyone drink it
* It is your responsibility as students to ask answerable questions when you do not understand the material
* It is my responsibility to help you find the answers and/or work through the answer when the question is answerable
* If my response to your questions on the discussion board is to review the post that I put up about how to ask questions that can be answered, you should review it and try to frame your question that way

---

```r
# This shows you the labels for the variables in the dataset
attr(johnDoe, "var.labels")
```

```
##  [1] "District ID #"
##  [2] "Non-Unique School ID #"
##  [3] "Unique School ID #"
##  [4] "MSIS Student ID #"
##  [5] "Student's Ethnoracial Identity"
##  [6] "Student's Biological Sex"
##  [7] "Severe Cognitive Disability Indicator"
##  [8] "Student Served by Special Education Indicator"
##  [9] "English Language Learner Indicator"
## [10] "Limited English Proficiency Indicator"
## [11] "Migrant Family Indicator"
## [12] "Economically Disadvantaged Indicator"
## [13] "Current Grade Level of the Student"
## [14] "Current Reading/Language Arts Scaled Score"
## [15] "Prior Reading/Language Arts Scaled Score"
## [16] "Current Mathematics Scaled Score"
## [17] "Prior Mathematics Scaled Score"
## [18] "Current Reading/Language Arts Proficiency Level"
## [19] "Prior Reading/Language Arts Proficiency Level"
## [20] "Current Mathematics Proficiency Level"
## [21] "Prior Mathematics Proficiency Level"
## [22] "Participated in Reading/Language Arts Intervention"
## [23] "Participated in Mathematics Intervention"
```

---

# Bivariate Data Visualization
## Continuous v Continuous variables
* We've looked at some examples showing the distribution of a single variable so far and even done a bit to show multiple variables simultaneously, but we haven't looked at how multiple continuous variables can be graphed simultaneously
* To do this we need to look at scatterplots
* Scatterplots are no different from when you were in school and learned about x,y coordinate pairs, we just have more information to display

---

```r
# A first example of a scatterplot
qplot(pgrrlascore, cgrrlascore, data = johnDoe)
```

---

* What do you notice about the shape?
* Is it easy to see all of the points?
* What would you say about the relationship between the two variables
* How can we improve on this graph?

---

```r
# Add a label to the x-axis for the variable you graph on the x-axis
qplot(pgrrlascore, cgrrlascore, data = johnDoe, #
      xlab = attributes(johnDoe)$var.labels[[15]])
```

---

```r
# Add labels to both axes for your graph
qplot(pgrrlascore, cgrrlascore, data = johnDoe, #
      xlab = attributes(johnDoe)$var.labels[[15]], #
      ylab = attributes(johnDoe)$var.labels[[14]])
```

---

* Yes, the `attributes(johnDoe)$var.labels[[#]]` thing can be confusing
* If you use the `names(johnDoe)` function you can find the number that corresponds to your variable
* Even easier, however, is if you copy and paste the variable labels from the code book on the blackboard site for the dataset
* You could also look at the codebook and create your own labels

---

```r
# Add labels to both axes for your graph
qplot(pgrrlascore, cgrrlascore, data = johnDoe, #
      xlab = "Prior RLA Score", ylab = "Current RLA Score")
```

---

```r
# Since there are a lot of points, we could make them semi-transparent
# to view them a bit more easily
qplot(pgrrlascore, cgrrlascore, data = johnDoe, #
      xlab = "Prior RLA Score", ylab = "Current RLA Score", #
      alpha = I(0.15))
```

---

```r
# And if we want to highlight the trend in the data, we can add a line of best fit
qplot(pgrrlascore, cgrrlascore, data = johnDoe, #
      xlab = "Prior RLA Score", ylab = "Current RLA Score", alpha = I(0.15)) + #
      geom_smooth(size = 2, method = "lm")
```

---

```r
# Or we could add a line that can bend and curve to fit the data a bit more
qplot(pgrrlascore, cgrrlascore, data = johnDoe, #
      xlab = "Prior RLA Score", ylab = "Current RLA Score", alpha = I(0.15)) + #
      geom_smooth(size = 2)
```

---

```r
# Or we could add both types of lines
qplot(pgrrlascore, cgrrlascore, data = johnDoe, #
      xlab = "Prior RLA Score", ylab = "Current RLA Score", alpha = I(0.15)) + #
      geom_smooth(size = 2) + geom_smooth(size = 2, method = "lm", color = "Red")
```

---

```r
# If this is our final graph, then we probably want to give it a title as well
qplot(pgrrlascore, cgrrlascore, data = johnDoe, #
      xlab = "Prior RLA Score", ylab = "Current RLA Score", #
      main = "Relationship between RLA Scores across two years", alpha = I(0.15)) + #
      geom_smooth(size = 2) + geom_smooth(size = 2, method = "lm", color = "Red")
```

---

# Bivariate Data Visualization
## Continuous v Categorical variables
* Not all of our data are continuous, and sometimes we can to make broader comparisons
* Boxplots are extremely well suited to providing a ton of information in a way that is fairly easy to interpret
* More importantly is that they can help us to make comparisons about the distributions of data between the groups without really understanding the mechanics of the plot itself
* As an example, go [here](https://wbuchanan.shinyapps.io/EquipercentileLinking/)
* Then click on the percentiles and/or total points tabs and voila...Boxplots

---

```r
# Create a boxplot to look for outliers across districts
ggplot(johnDoe, aes(x = factor(distid), y = cgrmthscore)) + geom_boxplot()
```

---

```r
# Same thing but this time looking at grade-levels within districts
ggplot(johnDoe, aes(x = factor(grade), y = pgrmthscore)) + #
     geom_boxplot(aes(fill = factor(grade))) + facet_wrap(~distid)
```

---

```r
# What if we want more detail about the distributions in each of the categories?
ggplot(johnDoe, aes(x = cgrmthlev, y = pgrmthscore)) + #
     geom_jitter(alpha = I(.1)) + geom_boxplot(aes(fill = cgrmthlev)) + #
     facet_wrap(~grade)
```

---

```r
# It works for simpler examples as well
ggplot(johnDoe, aes(x = factor(grade), y = pgrmthscore)) + #
     geom_jitter(alpha = I(.1)) + geom_boxplot(aes(fill = factor(grade)))
```

---

# Additional tips
* Something important to remember about Boxplots is that you generally want to use a categorical variable on the x-axis
* You can use `class(dataObject$variableName)` to determine whether or not the variable you are interested in using on the x-axis is a factor variable
     + If it is not a factor variable you just need to "wrap" the variable name in the `factor()` function like the example above with grade level on the x-axis
     + If it is a factor variable, you don't need to do anything else
* If you don't pay attention to this slide, you will almost definitely have difficulties with the next assignment

---

# Additional tips
* Since some of these examples can take a while to run, you can get a sample from your data object and use that to test your code
* This will help things run faster while you're trying to create and learn how to create the graphs
* Once you've got your code squared away for your graph, then use it on the regualr data object
* The next few slides show an example

---

```r
# Get a sample of 500 students from the data object
sampleData <- johnDoe[sample(nrow(johnDoe), 500), ]

# Look at a sumamry of the data just to confirm it's only 500 students
summary(sampleData[, 5])
```

```
##                               Asian           Black or African American
##                                   0                                 257
##                  Hispanic or Latino                   Two or More Races
##                                   6                                   0
##   American Indian or Alaskan Native Native Hawaiian or Pacific Islander
##                                   0                                   0
##                               White
##                                 237
```

---

```r
# Recreate the last boxplot
ggplot(sampleData, aes(x = cgrmthlev, y = pgrmthscore)) + #
     geom_jitter(alpha = I(.1)) + geom_boxplot(aes(fill = cgrmthlev)) + #
     facet_wrap(~grade)
```

---

```r
# If this is our final graph, then we probably want to give it a title as well
qplot(pgrrlascore, cgrrlascore, data = sampleData, #
      xlab = "Prior RLA Score", ylab = "Current RLA Score", alpha = I(0.5), #
      main = "Relationship between RLA Scores across two years") + #
      geom_smooth(size = 2) + geom_smooth(size = 2, method = "lm", color = "Red")
```

---

# Next class
* The next assignment isn't due until the 7th of October
* We'll use the same data that you already have for that assignment
     + This means you have two full weeks to do things with data that you've already become familiar with
     + Make sure to ask questions on the discussion board; no questions = everyone understands things perfectly = I don't set aside time to review things you have questions about
* The assignment is in the same format, but there are fewer hints to set things up at the beginning (hint: you can copy and paste the code you used to load your data previously to do it again)

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Laravel Blade Linter

[![Latest Version on Packagist](https://img.shields.io/packagist/v/bdelespierre/laravel-blade-linter.svg?style=flat-square)](https://packagist.org/packages/bdelespierre/laravel-blade-linter)
[![Build Status](https://img.shields.io/travis/bdelespierre/laravel-blade-linter/master.svg?style=flat-square)](https://travis-ci.org/bdelespierre/laravel-blade-linter)
[![Quality Score](https://img.shields.io/scrutinizer/g/bdelespierre/laravel-blade-linter.svg?style=flat-square)](https://scrutinizer-ci.com/g/bdelespierre/laravel-blade-linter)
[![Total Downloads](https://img.shields.io/packagist/dt/bdelespierre/laravel-blade-linter.svg?style=flat-square)](https://packagist.org/packages/bdelespierre/laravel-blade-linter)

Performs syntax-checks of your Blade templates. Just that.

## Installation

You can install the package via composer:

```bash
composer require --dev bdelespierre/laravel-blade-linter
```

## Usage

```bash
php artisan blade:lint
```

Or if you want to lint specific templates or directories:

```bash
php artisan blade:lint resources/views/
```

If you're using [PHPStan](https://phpstan.org/) (please note it will make the linting a lot slower):

```bash
php artisan blade:lint --phpstan=vendor/bin/phpstan resources/views
```

### Testing

``` bash
composer test
```

### Building standalone phar

```bash
# install clue/phar-composer globally (you'll need to update your $PATH,
# see https://getcomposer.org/doc/03-cli.md#global)
composer global require clue/phar-composer

# build the project
composer run build

# using the phar
laravel-blade-linter.phar help
```

### Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

If you discover any security related issues, please email<EMAIL_ADDRESS>instead of using the issue tracker.

## Credits

- [Benjamin Delespierre](https://github.com/bdelespierre)
- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

## Laravel Package Boilerplate

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

repository: bdelespierre/laravel-blade-linter

gha_language: PHP

gha_license_id: MIT

repo_name: bdelespierre/laravel-blade-linter


text:
# Oryx

Frontend helper for Spryker projects

> Our documentation has moved. Please go to [our official Spryker documentation](http://spryker.github.io/user-interface/oryx).

> If you're looking for **Oryx ZED dedicated solution**, [click here (oryx-for-zed)](https://github.com/spryker/oryx-for-zed).

repository: zsotyooo/oryx

repo_name: zsotyooo/oryx


text:
---
id: configuration
title: Configuration
sidebar_label: Configuration
---

## Create a table

### Create the system columns

| name         | type                | default                  |
| ------------ | ------------------- | ------------------------ |
| `id`         | `gen_random_uuid()` | primary key              |
| `updated_at` | `timestamptz`       | Hasura built-in function |
| `deleted`    | `boolean`           | `false`                  |

### Create columns

- type mapping

- required fields and is_nullable

- default values

### Create relationships

- the primary key should be not used as a foreign key in the same table

- Many to One / One to Many

- unidirectional / bidirectional

- Many to Many
  - composite primary key
  - each pk is fk to the two colums
  - only the above two columns + deleted + updated_at
  - permissions: select both columns, updated_at, deleted, and allow aggregation queries.
    - insert: deleted and keys (TODO: avoid upsert on pull replication)
    - update: deleted
  - defines both relations in the join table

### Create indexes

Although the following indexes are not mandatory, they are strongly recommended to reach acceptable performance in the fetching data between the backend and the frontend in GraphQL:

- (updated_at)
- (updated_at, id)
-

- sortable fields?

### Update Hasura role permissions

You have to make sure the desired roles have read access to system columns.

| name          | select | insert                                    | update                                           | delete |
| ------------- | ------ | ----------------------------------------- | ------------------------------------------------ | ------ |
| id            | yes    | if the role is allowed to create a record | never                                            | never  |
| updated_at    | yes    | never                                     | never                                            | never  |
| deleted       | yes    | never                                     | if the role is allowed to soft delete the record | never  |
| {other}       |        |                                           |                                                  |        |
| {relation_id} |        |                                           |                                                  |        |

### Additional configuration

Some configuration cannot be inferred from the PostgreSQL schema or the Hasura metadata, such as column order etc. It is stored in the XXX YYY ZZZ tables. Configuration can be entered in using either the Hasura console to insert records, or from the Platyplus frontend as a user who has the `admin` role.

It is worth to mention that the Hasura migration system only tracks DDL and not DML (data) operations, meaning the information stored in these tables won't be automatically added to the migration files. It is recommended to [create manual migrations](https://hasura.io/docs/1.0/graphql/core/migrations/advanced/writing-migrations-manually.html) with this configuration data so it becomes part of any deployment of the application.

- tables

- column/properties

- bookmarks

## Roles and permissions

### System roles

Every user can have multiple roles, although Hasura does not combine multiple roles when running a given GraphQL operation.

Platyplus comes with four pre-defined system roles:

- `user` is the default role allocated to an end user.

- `me` is the role that allows access to information related to the authenticated user.

- `admin` corresponds to the Hasura admin role, meaning

- `anonymous` is the role used to define access rights to unauthenticated users i.e. public access to the GraphQL API. By default, nothing can be accessed publicly.

### Create a new role

1.  insert the role in the `auth.roles` table

2.  update the role permissions in the metadata schema

Make sure the role will be able to fetch metadata information

3.  Define permissions in data tables

repository: platyplus/platyplus

gha_language: TypeScript

repo_name: platyplus/platyplus


text:
# London
:uk:

[![npm version](https://img.shields.io/npm/v/london.svg?style=flat)](https://www.npmjs.com/package/london)
[![dependency Status](https://img.shields.io/david/voudeonibus/london.svg?style=flat)](https://david-dm.org/voudeonibus/london#info=dependencies)
[![devDependency Status](https://img.shields.io/david/dev/voudeonibus/london.svg?style=flat)](https://david-dm.org/voudeonibus/london#info=devDependencies)
![download github](https://img.shields.io/github/downloads/voudeonibus/London/latest/total.svg)
![download npm month](https://img.shields.io/npm/dm/london.svg)
![license](https://img.shields.io/npm/l/london.svg)

London is a module for map all URL's for Hapi.

## Table of contents

- [Quick start](#quick-start)
- [Starting](#starting)
- [Bugs and feature requests](#bugs-and-feature-requests)
- [Contributing](#contributing)
- [Versioning](#versioning)
- [License](#license)

## Quick start

Several quick start options are available:

- Clone the repo: `git clone https://github.com/voudeonibus/London.git`.
- Install with [npm](https://www.npmjs.com): `npm install london`.

## Starting

```javascript
var london = require('london');
var Hapi = require('hapi');
var server = new Hapi.Server();
var path = require('path');

london({
  server: server,
  prefix_path: '/api',
  read_dir: path.join(__dirname, '/actions'),
  host: 'http://localhost',
  port: 8080
});

```

### Options

- **server:** server of Hapi
- **prefix_path:** prefix for path on each URL
- **read_dir:** dir where the Londo read each file as URL
- **host:** host for route 'all_methods'
- **port** port for router 'all_methods'

## Bugs and feature requests

Have a bug or a feature request? Please first search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/voudeonibus/London/issues/new).

## Versioning

For transparency into our release cycle and in striving to maintain backward compatibility, London is maintained under [the Semantic Versioning guidelines](http://semver.org/). Sometimes we screw up, but we'll adhere to those rules whenever possible.

## License

[MIT](https://github.com/voudeonibus/London/blob/master/LICENSE)

repository: voudeonibus/London

repo_name: voudeonibus/London


text:
---
layout: post
title: wedding website
category: projects
hidden: true
scheme-link: "#BFE8B9"
---

The wedding website is hand-coded in HTML, CSS and JavaScript using the React framework.

## **Design:**
I worked closely with the client and came up with various design mockups that have a rustic elegant feel using the chosen colors meadow and gray. The design elements used are free stock images as well as the fonts used.

## **Responsive**
I think making a site responsive especially for a wedding site is essential. The site navigation menu collapses into a menu icon, elements of the page resize and flow of layout change depending on the size of the screen the user has.

## **Check out the site here:**
[Wedding website](https://lozano-brunell.firebaseapp.com)

gha_language: CSS


text:
# termdoc

*Python library and tools for working with term-document matrices*

This project is just beginning, but a useful data structure, HTDM (hierarchical term-document matrix), is already available.

Various calculations on TDMs will soon be implemented, including TF-IDF.

I am also interested in standardizing the exchange format for HTDMs.

## Installation

```
pip install termdoc
```

## HTDM

The core data structure is a term-document matrix supporting hierarchical documents. Documents are labelled with a delimited string such as "1.7.5" or "Plato.Republic.5". This hierarchy could represent divisions of a work, grouping of multiple works, or some combination. Counts are aggregated at each level of the hierarchy (including at the top level to get totals across all documents).

HTDMs can be loaded with `load`:

```python
>>> import termdoc
>>> c = termdoc.HTDM()
>>> c.load("test_data/test1.tsv")

```

where the file looks something like:

```
1.1	foo	7
1.1	bar	4
1.2	foo	2
1.3	bar	1
2.1	baz	5
2.1	foo	1
```

with a period-separated hierarchical address / document ID, term, and count all separated with tabs.

Both the period and tab are just defaults and can be override by passing `address_sep` and/or `field_sep` to `load`.

The HTDM can then give counts at any level of the document hierarchy:

```python
>>> c.get_counts()["foo"]
10
>>> c.get_counts("1")["foo"]
9
>>> c.get_counts("1.2")["foo"]
2

```

Note the separator used in the address / document ID defaults to a period (regardless of what was used in `load`) but can be override by passing `address_sep` to the HTDM constructor.

HTDMs can also be built up programmatically.

Here is an example with a single-level of documents (a traditional TDM):

```python
>>> import termdoc
>>> c = termdoc.HTDM()
>>> c.increment_count("1", "foo", 3)  # document 1 contains the term "foo" 3 times
>>> c.increment_count("1", "bar", 2)
>>> c.increment_count("2", "foo", 2)
>>> c.increment_count("2", "bar", 1)
>>> c.get_counts()["foo"]
5
>>> c.get_counts()["bar"]
3

```

And here is an example with a two-level hierarchy:

```python
>>> import termdoc
>>> c = termdoc.HTDM()
>>> c.increment_count("1.1", "foo", 3)
>>> c.increment_count("1.2", "foo", 3)
>>> c.increment_count("1.1", "bar", 2)
>>> c.increment_count("1.2", "bar", 2)
>>> c.increment_count("2.1", "foo", 2)
>>> c.increment_count("2.2", "foo", 2)
>>> c.increment_count("2.1", "bar", 1)
>>> c.increment_count("2.2", "bar", 1)
>>> c.get_counts()["foo"]
10
>>> c.get_counts()["bar"]
6
>>> c.get_counts("2")["foo"]
4

```

You can **prune** a HTDM to just `n` levels with the method `prune(n)`.

You can iterate over the document-term counts at the leaves of the HTDM with the method `leaf_entries()` (this returns a generator yielding `(document_address, term, count)` tuples). This is effectively a traditional TDM (the document IDs will still reflect the hierarchy but the aggregate counts aren't present).

You can optionally pass a `prefix` to `leaf_entries()` in each case only that subtree will be returns (with the prefix removed from the document IDs).

You can **graft** one HTDM under another by using the `graft(prefix, subtree)` method, specifying as `prefix` the document address you want to add the subtree under. This is useful if you have an HTDM for, say, a single work by an author, with chapters as documents and you want to incorporate that into a higher-level HTDM of multiple works by the author, or a collection of works by different authors.

Alternatively you can provide a `prefix` to `load` to load the file under a particular point in the tree. This effectively prepends the given `prefix` (plus address separator) to the document IDs.

The third (count) field in a loaded file can be omitted if the count is 1 and a document ID + term may be repeated with the counts accumulating.

You can deep copy an HTDM with `copy()`. You can also pass a prefix to `copy()` if you want to clone just a subtree.

You can save out an HTDM with `save()` which takes a `filename` and optional `field_sep` (defaulting to tab) and `prefix` (if you just want to save out a subtree).

### Duplicates Policy

You can optionally pass in a `duplicates` setting to the constructorr indicating the policy you want to follow if a term-document count is updated more than once.

```python
>>> c = termdoc.HTDM()
>>> c.increment_count("", "foo", 3)
>>> c.increment_count("", "foo", 2)
>>> c.get_counts()["foo"]
5

```

is the same as

```python
>>> c = termdoc.HTDM(duplicates=termdoc.Duplicates.ALLOW)
>>> c.increment_count("", "foo", 3)
>>> c.increment_count("", "foo", 2)
>>> c.get_counts()["foo"]
5

```

But you can tell an HTDM to ignore attempts to update an existing count:

```python
>>> c = termdoc.HTDM(duplicates=termdoc.Duplicates.IGNORE)
>>> c.increment_count("", "foo", 3)
>>> c.increment_count("", "foo", 2)
>>> c.get_counts()["foo"]
3

```

or to raise an exception:

```python
>>> c = termdoc.HTDM(duplicates=termdoc.Duplicates.ERROR)
>>> c.increment_count("", "foo", 3)
>>> c.increment_count("", "foo", 2)  # this will raise a ValueError
Traceback (most recent call last):
ValueError: 'foo' already in ''

```

Note that duplicates are only checked in the leaves of the document tree.

repository: jtauber/termdoc

branch_name: refs/heads/main

gha_language: Python

repo_name: jtauber/termdoc


text:
---
title: Config files versus "real" programming
---

# MPF Philosophy: "config files" versus "programming"

When we talk about MPF, we really play up the fact that when you use
MPF, you can do 90%+ of your of your "programming" with MPF's
[YAML configuration files](config_files.md).

We've received criticism of that over the past few years, typically
falling into one of the following categories:

* Since everything in MPF is in config files, that's something new
    you have to learn. If you don't know MPF, you can't just look at a
    config file and know what's happening.
* Since config files insulate the game programmer from the code, when
    something doesn't work, you don't know if it's your config or a
    bug in MPF.
* Using config files limits game programmers in that they have to do
    everything the "MPF way."
* Coding is fun! MPF deprives people of that.

We understand the motivation behind all these thoughts, so we'd like to
provide our perspective on these issues.

## You can still code in MPF

MPF does not prevent you from coding. We provide two levels of
abstraction to programmers: hardware abstraction and device abstract. If
you use a flipper device in code it will expose methods to disable or
enable a flipper and work on any hardware which is supported in MPF.
Plus the device will manage all the game integration (e.g. disable
flipper after the game).

Nevertheless, you might want to implement a different type of flipper
(say with three coils each) and the flipper device might be a bad fit.
Therefore, you can use the hardware abstraction interface and write
rules in a hardware independent way (or overload the flipper device
which does exactly that).

If you want to use a very specific feature of your hardware and we did
not implement an abstraction for it you can also access the hardware
directly but it will likely not work on other platforms anymore. E.g.
this might be the case if you want to do advanced stuff with the AUX
port on the P-Roc.

As you see, MPF offers you all kind of flexibility. You can access
hardware directly or use abstractions. Plus, if you implement your own
devices or extend existing devices (those can live inside your machine
folder) you will be able to instantiate them using config (if you want
that).

Code can be added either globally (using scriptlets or code hooks), per
mode, as new/overloaded device or even as a custom platform. See the
[MPF developer documentation](http://docs.missionpinball.org) for more
details about our APIs and interfaces.

## Why config files?

At the most basic level, config files in MPF let you access hundreds or
thousands of lines of code with a simple line or two in a config. The
actual code that runs a pinball machine is really, really complex,
especially when you think about all the logic around ball tracking, mode
stacking, multiple things happening at once, etc.

By providing an interface like the config files, we allow you to have
access and to be able to control all these complex things in a simple
way.

MPF's config files are a form of something in computer science called a
["domain-specific language.
(DSL)"](https://en.wikipedia.org/wiki/Domain-specific_language)

In this context the "domain" is pinball, so the MPF config files could
be thought of as a "pinball-specific language". This means that you
can't use the MPF DSL to program a dart board machine or a self-driving
car, but when it comes to programming pinball, they're darn good!

There are many advantages to DSLs, including:

* Increased productivity: Get a complex mode up and running in MPF
    with a half-page config file instead of writing 500 lines of Python
    code.
* Fewer bugs: The config files are used by lots of people, so we know
    they work the way they're supposed to, instead of every pinball
    maker writing their own stuff from scratch and re-solving the same
    problems over and over.
* Easier to read: You can look at a few lines of config file and know
    what you're looking at and what it's trying to do versus pages of
    Python code that you have to reverse engineer to understand.
* Ease of support: Same as above. If you are having a problem, it's
    easy to post a config to the forum and everyone can understand it,
    versus scanning through hundreds of lines of custom Python code.
* Ease of planning: Since everyone in the MPF community speaks the
    same language of config files, it's easy to ask for help and
    direction on how to do things.
* Insulation from future updates: The config files remain constant (or
    we provide migration tools to upgrade them, so we can make major
    changes to MPF under the hood without you having to re-write
    anything in your game.

## Config files in MPF: use as much (or as little) as you want

Even though we just laid out the reasons we like "programming" your
game via config files instead of "real" code, there's one important
thing to know about the config files:

*You don't have to use config files for everything.*

There's a whole website dedicated to mixing custom code with MPF (at
[developer.missionpinball.org](http://developer.missionpinball.org), and
you can easily mix code (written in Python or the language of your
choice) with existing MPF code and configs, so really you can use as
much or as little of the config file interface as you want.

One way to think about MPF is that it's a solid set of pinball
functionality with a nice API, and then the config file interface is a
separate component that rides on top of that API and exposes it via
easy-to-use config files.

 The API is well-documented and fairly stable now,
so if you don't want to use a single config file for anything, you can
just use the MPF API and do whatever you want and still benefit from the
thousands of hours of effort we put into MPF.

The reality, though, is that building a complete game in MPF is a
balance between doing things in config files and writing code. At the
end of the day, it doesn't matter whether your game is 90% configs and
10% code, or 80/20, 50/50, 20/80, etc. The exact balance depends on the
personal preference of the person building the game.

In fact even we drop into "real" code to do certain things. There have
been lots of times when we think, "Yeah, X action would be 20 confusing
config lines or just two lines of Python, so I'm writing it in
Python." That's perfectly fine.

The real power comes when you start to mix-and-match. For example, you
could use the MPF config files to build out your base hardware interface
and mode structures, then use your own Python code to do the logic
within a mode, then use your mode code to post an event to use MPF's
scoring system, etc.

If you don't use MPF, then you have to write everything yourself in
code. If you do use MPF, then you get to choose what you write in code
and what you don't have to write. (Seriously, ball tracking is a hard.
Use our pre-written code via the config files!)

## I already know Python. Why learn obscure config files?

Again, the software that runs pinball machines is complex. The complete
MPF codebase is over 15,000 lines of code, with thousands of lines of
code to do things that *seem* simple on the surface, like managing ball
devices and tracking where all the balls are at all times.

MPF's config files provide a friendly interface to all that complexity.
So yes, it's true that you have to spend a few hours learning about the
`ball_devices:` section of the MPF config files in order to learn how to
use them effectively. But the alternative is learning everything about
how ball tracking works in a pinball machine and then writing all that
from scratch yourself. That would take a lot longer than it would to
learn about how to configure ball tracking in MPF. And besides, we
already did that! :)

## Aren't config files limiting?

Even though we've tried to envision many different scenarios and many
different types of pinball machines as we built MPF, it's true that MPF
does things a certain way, and the config files are a manifestation of
the way MPF does things. So there could be scenarios where you want to
do something differently than how MPF does it.

But this does not mean that MPF is not the right framework for you.
Don't throw the baby out with the bath water! If you don't like the
way something works in MPF's shot management tracking, you don't have
to completely write your own shot management from scratch. Rather you
can use MPF's shot sytem, subclass the methods and objects you want to
change, and then tweak them to work in your specific scenario.

Even if you want to completely replace one component of MPF, there
hundreds of different components, modules, and systems that go into a
pinball machine that are already part of MPF. Unless you want to write
all of those from scratch, using MPF lets you get a head start on many
of the things that you need in your machine that you don't want to
write yourself.

## Coding is fun! Doesn't using config files deprive me of that?

Some people have said, "I like to code. I don't *want* to just build
my machine quickly." Certainly we appreciate that, because we like to
code too!

If you decide to write the software for your own pinball machine from
scratch, you will spend hundreds of hours writing low-level pinball
things, like hardware device management, ball tracking, a mode queue,
player objects, a display and sound system, etc.

If you use MPF, even if you write your own game logic in Python code,
then you can focus on the fun stuff while the MPF developers focus on
the boring low-level pinball stuff.

Of course, if you're thinking, "But I *like* the low-level stuff, I
want to write that," then we would love to have you on our team helping
to make MPF better. :) We have a to-do list for MPF which will take
years to complete, so if you like to code, we'd love to have you help!

If there's something that MPF does that you don't like and that you
think you can do better, that's an even better reason to contribute
back to MPF. Please, help us make MPF better!

We have success stories of this already. Brian Madden started writing
MPF in 2014. Since then, MPF user Jan Kantert started using MPF, and
then he started tweaking things here and there (and submitting his
changes back to the MPF project.) Now Jan has completely rewritten
MPF's ball device code, our hardware platform interface, he's added
multiball, ball lock, and ball search, extra balls, servos, tests....
the list goes on.

Another MPF user, Quinn Capen, has rewritten MPF's RGB LED interface,
written a complete pinball-focused advanced audio system, written an
alternative media controller based on Unity 3D...

John Marsh said, "It would be cool if there was a GUI wizard to help
people set up their machines," so now he's building that.

Hugh Spahr created his own pinball controller hardware (the Open Pinball
Project), and then wrote a platform interface for MPF so MPF users can
use OPP hardware too.

You get the idea.

The bottom line is that these are all MPF users who love to code, so
rather than being scared away by MPF's config file interface, instead
they embraced MPF, dug in, and are making MPF better. So now all the
time they spend writing code isn't just limited to running on their
machine which sits in their basement for 360 days a year; instead their
code is running on pinball machines all over the world, which is very
fulfilling and cool!

## When something breaks, I don't know if it's my config or an MPF bug?

True, one of the limitations of using config files is that when things
don't work the way you expect, you don't know if it's a problem with
your config or a deeper bug in MPF.

However if you're someone who knows how to program, MPF is open source!
You can go through the MPF code to see if it's a bug, and if so, you
can fix it and submit a pull request to fix that bug for everyone.

And if it's a configuration error, you can also edit the MPF
documentation to be more clear, and then submit a pull request to the
docs, and now you've also helped fix this issue for everyone.

Again, don't not use MPF because it uses config files and you want to
"know" what's happening under the hood. Instead learn MPF and the
code behind it and share your programming and pinball passion with the
world!

## Using MPF means you have a team of programmers making your machine better

The MPF project was started in May 2014. Since then we have over 5,000
hours of time spent (both in code and documentation). More importantly,
we're continuing to update and expand MPF, with dozens of commits to
the core code and docs every week. (Probably an average of 60 hours a
week of work.)

If you use MPF, you get all that work for free. :) It's like having a
team of developers working 60 hours a week to make your game better.
Pretty cool!

## The bottom line

The creators of MPF are passionate about pinball, passionate about
software development, and passionate about open source.

The beauty of MPF is that it's a bunch of people, from all over the
world, writing software and documentation which helps more people create
more pinball machines. As MPF grows in popularity, we love the fact that
some day we will be able to walk into a bar, see a pinball machine, and
know that some of the code we wrote is powering that machine. It warms
our hearts.

If you decide to go your own way and not use MPF, that's great. We
support you! (Feel free to rip off any ideas from MPF. We'd love it!)
But don't write off MPF just because you want to do "real"
programming and MPF is a "config-based" project. We could use the help
of programmers like you. :)

repository: missionpinball/mpf-docs

repo_name: missionpinball/mpf-docs


text:
frame-events
============

The browser is flooding your code with events, which could make your page slow.
With this library you only receive the events at 60fps, with requestAnimationFrame.

Useful events would be `scroll`, `resize`, `touchmove`, `mousemove` and `mousewheel`.

## How to use
````js
FrameEvents.on(window, "scroll", yourHandler);
FrameEvents.off(window, "scroll", yourHandler);
````

````js
// collect the layout properties...
function dataHandler(ev) {
  return { lastScrollY: window.scrollY }
}

// ...and you will receive them as the second property in your handler
function scrollHandler(ev, data) {
  console.log(data.lastScrollY)
}

FrameEvents.on(window, "scroll", scrollHandler, dataHandler);
````

For support of [older browsers](http://caniuse.com/#feat=requestanimationframe) you should include a
[`requestAnimationFrame`](https://gist.github.com/paulirish/1579671) polyfill.

Available on bower, named `frame-events`.

### Related articles
- [Leaner, Meaner, Faster Animations with requestAnimationFrame](http://www.html5rocks.com/en/tutorials/speed/animations/)
- [Scrolling Performance](http://www.html5rocks.com/en/tutorials/speed/scrolling/)
- [JankFree.org](http://jankfree.org/)
- [How (not) to trigger a layout in WebKit](http://gent.ilcore.com/2011/03/how-not-to-trigger-layout-in-webkit.html)

## Changelog

- 0.0.1: removed es5 dependency and refactored
- 0.0.0: initial

repository: rodleviton/pixelprojector

repo_name: rodleviton/pixelprojector


text:
---
layout: post
title: "Ruby Block Selection in Vim (Plugin)"
date: 2010-12-28 22:42:03 +0000
comments: true
sharing: true
footer: true
categories: Tech
tags:
- Automation
- Programming
- Ruby
- Vim
discuss_url: //84
url: //84/Ruby_Block_Selection_in_Vim_%28Plugin%29
id: 84
---
A new very cool plugin for Rubyists using Vim. [RubyBlock][rubyblock] TextObjects created by [Drew Neil][drewneil] from [Vimcasts.org][vimcast]. Once installed it will add the commands var, vir, sr & ir for selecting Ruby blocks, Drew Neil has explained it well on [VimCasts][rubyblock].
This vim plugin relies on two others [matchit.vim][vim39] and [textobj-user][vim2100]. I believe that [matchit.vim][vim39] is built in to current builds of vim and only requires enabling by adding the following to you .vimrc file:

    runtime macros/matchit.vim

If it is not built in to your build or you want the latest you can get a zip file from the [vim scripts][vim39] Uncompress it and put matchit.vim into your vim/plugin folder and matchit.txt in to your vim/doc. these are typically ~/.vim/plugin ~/.vim/doc but can be any where on thr $VIMRUNTIME, I redefine mine ot a github repo via (in .vimrc):

    set runtimepath=$HOME/.unix_config/vim,$VIMRUNTIME

To add the new help files to vim help you run (using the path to you vim help files):

    :helptags ~/.vim/doc

Next, [textobj-user][vim2100] plugin which is a generic wrapper for text objects and provides no added vim functionality by itself. Installation of this plugin confused me as the zip file and github all had make files and I do not like having to compile my plugins. However after uncompressing the zip file I moved the contents of the autoload folder to vim/autoload and contents of the docs folder to vim/docs, the RubyBlock plugin seems to work so I assume that this is all that is required.

Drew Neil has distributed his plugin as a vimball (*.vba) which is the simplest to install way of distributing vim plugins. Download file from [vim scripts][vim3382]. Open the file with vim and  then :source %

    $ vim ~/Downloads/textobj-rubyblock.vba
    :source %

Now open a ruby file move to a line inside a block and start trying out your new commands: var, vir, ar & ir.

Thanks to [Drew Neil][drewneil] of [Vimcasts.org][vimcast] for creating this plugin.

[drewneil]: http://drewneil.com/
[rubyblock]: http://vimcasts.org/blog/2010/12/a-text-object-for-ruby-blocks/
[vimcast]: http://vimcasts.org/

[vim3382]: http://www.vim.org/scripts/script.php?script_id=3382
[vim2100]: http://www.vim.org/scripts/script.php?script_id=2100
[vim39]: http://www.vim.org/scripts/script.php?script_id=39

extension: markdown


text:
Contributing to Caldwell
========================

Purpose
-------

The purpose of this document is to show you how to contribute to the project.

This document assumes that you are keeping your git repositories in a directory in your
home directory.

### Install Node.js

Using homebrew, install the **`nodejs`** package. As of the writing of this document, **`5.3.0`**
is being used.

```bash
brew install nodejs
```

### Install Electron

Electron is the Node.js framework used to provide a UI to the application. Install it into the local
*`node_modules`* directory in your repository (don't worry, this is ignored by `.gitignore`).

```bash
npm install
```

repository: farvour/caldwell-etcd

repo_name: farvour/caldwell-etcd


text:
# samsung_health_steps_summary
A simple Android app that uses Samsung Health SDK to summarize your steps counts in the current week and calculate how many steps you need to take to at least achieve the previous weeks daily average

![Sample Screenshot](sample_screenshot.jpeg?raw=true "Sample Screenshot")

# Build and Installation
This app is not available on app store: you can install it on your phone by building the repo e.g with Android Studio

You need Samsung Health app installed on the phone and also the rest of the environment requirements stated here https://developer.samsung.com/health/android/data/guide/environment.html.

The Samsung Health will need to have developer mode enabled as detailed here: https://developer.samsung.com/health/android/data/guide/dev-mode.html

For more details, see https://developer.samsung.com/health/android/overview.html
# Misc
Feel free to use this repo as a guide, template or starter project to build up a more sophisticated Samsang Health partner apps


text:
CodeView5
=========
Eonil, 2019.

An alternative option of Cocoa view to edit code-like text.

Change Tracking
---------------------
There are two change trackings .

- In `CodeEditing.timeline`.
- In `CodeStorage.timeline`. You can access this through `CodeEditing.storage.timeline`.

At `CodeEditing` level, timeline tracks undo/redo history with unique version number.
For any changes, it makes a new point in timeline with new version number.
Therefore, if you have same version number, it means same text content.
Otherwise, text content has been changed.
`CodeEditing` level timeline stores `CodeStorage` snapshots.
You cannot track each changes here.

At `CodeStorage` level, timeline tracks each changes in content.
It tracks all changes in text content individually.
You can correctly track changes.

For both cases, timeline DO NOT track changes in selection.
It tracks only changes in text content. Selections won't be regarded as content.
Selection is stored in `CodeTextStorage` to keep latest selection information
when we make snapshot.

Anyway, `CodeEditing` removes such changes when they take snapshot
of `CodeStorage`. This is because that can provide wrong information
as `CodeEditing` can swap snapshots for undo/redo.
Therefore, you need to take care on *version number* of each snapshot.

- If version number is same, there's no change.
- If version number is different,
    - and `CodeStorage.timeline` is empty, iI's whole content replacement.
    - If `CodeStorage.timeline` is not empty, it tells you the individual changes.

Design Choices
-------------------
- Aims for best maintainanceability. Simplicity over performance.
- Aims "good enough" performance. Not best performance.
- No word-wrap.
- No "complete" level of IME support. I implemented IME support, but do not invest much time on it.
- This is a quick bootstrapping implementation. Do not try to be perfect.
- REPL based. In other words, *unidirectional I/O loop*. User input simply gets delivered to main loop
  and makes change in data source, and changed source will be delivered
  to renderer. macOS IME requires immediate
- **Server/client structure to be a part of bigger REPL structure.**

Implemented Features
--------------------------
- Basic text editing.
- Breakpoint marker editing.
- Select by mouse.
- Jump to line. (scrolling)
- Undo/redo.
- Text snapshot import & export.
- Copy & paste.
- Line number rendering.
- Change notifications.

Non-Goals
-------------
- Tracking of nesting structures.
- Asynchronous editing.
- Word wrap.
- Proper right-to-left text layout/rendering support. (such as Arabic/Hebrew)
- Vertical text rendering.

Unidirectional I/O & IME
----------------------------
- macOS IME requires synchronous access to whole source text at any time.
- Asynchronous I/O requires flawless conflict resolution and it's complicated.
  I avoid it. Just wait for *Xi-Editor* for this.
- `CodeView` retains and modifies base source state according to user input.
- `CodeView` emits modified source state.
- External owner can modify the source and push to `CodeView` back.
- `CodeView` can reject external push.

Independent Actor
----------------------
- `CodeView` is an independent actor rather than a passive control surface or renderer.
- `CodeView` keeps base source state. This source is the origin.
- `CodeView` modifies base source state according to user input.
- `CodeView` emits source state to external observer.
- `CodeView` accepts source state push from external controller.
- `CodeView` can reject external push. Internal base source takes priority.

`CodeStorage` vs `CodeTextStorage`
-------------------------------------
`CodeStorage` contains all data to build a state of a `CodeView`.
It contains configuration, storage and selection.
`CodeTextStorage` contains only textual data.
You can think of relationship like this.

    source = configuration + storage + selection

`CodeStorage` also processes editing command.
It converts editing commands into modifications
on line collections in storage.

`CodeStorage` is always a snapshot state of a moment.
As `CodeStorage` is value-semantic, you can freely copy,
replace and update them independently without worrying
about unexpected mutations.

`CodeView` supports modification command from external
world by exchanging I/O messages, and you are supposed
to pass `CodeStorage` value as a new state.

Undo/Redo and `CodeTimeline`
--------------------------------------
Undo/redo support is implemented using `CodeTimeline`.
`CodeTimeline` simply stores copy of all `CodeStorage`s
for each editing moments, and just swaps according to
undo/redo command.
`CodeTimeline` is also pre value-semantic. There's no
reference attached. You can copy, update and replace
them as much as you want.

`CodeView` keeps one timline and does not expose it to
public.

License & Credit
--------------------
Copyright(C) Eonil & Henry, 2019. All rights reserved.
This code is licensed under "MIT LIcense".


text:
# UI Layouts
A layout defines the visual structure for a user interface, such as the UI for an activity or app widget.
![Welcome to jetpackcompose.com](https://miro.medium.com/max/1400/1*dG8pfE-agjdIL1hyr0IHVA.png)

This section will focus more on creating a UI based on compose layout.
> A layout may contain any type of widgets such as Fabs, buttons,Radio button , Textfield,Text etc.

Before we proceed let's talk about Scaffold and its importance.

#Scaffold

A Scaffold class used to Implements the basic material design visual layout structure.

```

```

## Jetpack Commpose Layout types:
**Column:** A Column will show each child below the previous children. It’s similar to a LinearLayout with vertical orientation.
```
@Composable
fun ColumnExample() {
    Column {
        Text("Hello World!")
        Text("Hello World!2")
    }
}
```
**Row:** A Row will show each child next to the previous children. It’s similar to a LinearLayout with a horizontal orientation.

```
@Composable
fun RowExample() {
    Row {
        Text("Hello World!")
        Text("Hello World!2")
    }
}
```

**Constraint layout:** A ConstraintLayout in Compose is similar to a ConstraintLayout from the classic Android View System
A ConstraintLayout requires a ConstraintSet as a parameter. In the ConstraintSet all constraints of the layout have to be declared. children will set the children of the layout

**Box:** The children of the Box layout will be stacked over each other. You can use the gravity modifier to specify where the composable should be drawn.

```
@Composable
fun BoxExample() {
    Box(Modifier.fillMaxSize()) {
        Text("This is first text", modifier = Modifier.align(Alignment.TopCenter))
        Box(
                Modifier.align(Alignment.TopCenter).fillMaxHeight().preferredWidth(
                        50.dp
                ).background( Color.Blue)
        )
        Text("This is second text", modifier = Modifier.align(Alignment.Center))
        FloatingActionButton(
                modifier = Modifier.align(Alignment.BottomEnd).padding(12.dp),
                onClick = {}
        ) {
            Text("+")
        }
    }
}
```

repository: TEMHITHORPHE/Jetpack-Compose-Tutorial

repo_name: TEMHITHORPHE/Jetpack-Compose-Tutorial


text:
# Crumhorn

Crumhorn is a codification of my manual cloud instance management.

## Features

Crumhorn aims to support the following:
* Launching environments (e.g. "Spin up a Fedora 23 machine")
* Provisioning new environment setups that can be launched (e.g. "Set up a Fedora 23 box with sensible security defaults, user accounts, ...")
* Managing previously created setups / running environments

It aims to do so on the following platforms:
* Digital Ocean
  * Launch environment = start vm
  * Provision new setup = start vm, configure, take a snapshot
  * Management = list / remove snapshots / running VMs

## Installation

Not recommended. This is just a personal project to codify some of my day-to-day cloud admin tasks

Currently I do:

    virtualenv --python=python3 .
    . bin/activate
    pip install -U pip setuptools wheel
    pip install -e .

repository: jelford/crumhorn

repo_name: jelford/crumhorn


text:
# Contributing to Ergo Framework

Anybody willing to contribute to the project either with code, documentation, security reviews or whatever, are very
welcome to create or review pull requests and take part in discussions in any of our public [Discord community](https://discord.gg/sdscxKGV62),
[Telegram group](https://t.me/ergo_services) or [GitHub Discussions](https://github.com/ergo-services/ergo/discussions)

## License

```txt
By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the
    best of my knowledge, is covered under an appropriate open
    source license and I have the right under that license to
    submit that work with modifications, whether created in whole
    or in part by me, under the same open source license (unless
    I am permitted to submit under a different license), as
    Indicated in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including
    all personal information I submit with it, including my
    sign-off) is maintained indefinitely and may be redistributed
    consistent with this project or the open source license(s)
    involved.
```
See [https://cla-assistant.io/ergo-services/ergo](https://cla-assistant.io/ergo-services/ergo) for a copy of the Developer Certificate of Origin license.

Ergo Framework is licensed under the MIT License, as stated in [LICENSE](LICENSE) file.

## Reporting a bug or a feature request

Report bugs at https://github.com/ergo-services/ergo/issues

If you've found a **bug** or have a **feature request** then please create an issue in this repository (but search first in case a similar issue already exists).

## Submitting Pull Requests

You can contribute to Ergo Framework by opening a Pull Request. If you would like to fix a bug or
implement a feature, please fork the repository and create a Pull Request.

Before you start any Pull Request, it's recommended that you create an issue to discuss first if you have any doubts about requirement or implementation.
That way you can be sure that the maintainer(s) agree on what to change and how, and you can hopefully get a quick merge afterwards.
Also, let the maintainers know that you plan to work on a particular issue so that no one else starts any duplicate work.

In most cases, pull requests for new features should be based on the `master` branch.

Make sure that your feature does not break backward compatibility. In general, we only break backward
compatibility in major releases and only for a very good reason.

## Collaboration with maintainers

Sometimes the codebase can be a challenge to navigate, especially for a first-time contributor. We don't want you
spending an hour trying to work out something that would take us only a minute to explain.

gha_license_id: NOASSERTION


text:
FilebackedBlockingQueue
=======================

File based blocking queue is a simple java library, utilizes MappedByteBuffer to store and retrieve data.
The functionality and complexity is comparable to LinkedBlockingQueue.

* Most recent update to the Queue will be in the file cache and hence an immediate read will be faster.
* Bigger the queue, we will have to do a seek (but sequential IO) to retrieve data in order.
* Removing am element is same as marking the data location for delete and skipping them while reading. (Hence atomic)
* The filesystem/space is split into multiple segments. Each segment is created on demand as the queue grows.
* The segments are recycled (To reduce the number of FD's in use) after the data is retrieved.
* Segments are discard instead of recycling if the max file system size has reached.
* Supports BlockingQueue API's.

* Note: There is (de-)Serialization overhead.
        When JVM exits or the system crashes the files are not in sync, hence we start with a new segments ignoring the old ones before the crash.
        The above can be solved by doing Periodic sync (not implemented by default).

Example Code:
=============

        FileBackedBlockingQueue<String> queue = new FileBackedBlockingQueue.Builder<String>().directory(TEST_DIR).serializer(new StringSerializer()).build();
        for (int i = 0; i < 2000; i++)
            queue.add(TEST_STRING + i);

        (OR)

        FileBackedBlockingQueue<Runnable> workQueue = new FileBackedBlockingQueue.Builder<Runnable>().directory(dir).serializer(MessageTask.serializer).build();
        executor = new ThreadPoolExecutor(threadCount, threadCount, 60L, TimeUnit.SECONDS, workQueue);
        if (pattern.matcher(msgContainer.routingKey).matches())
            executor.execute(new MessageTask(msgContainer));


text:
SAD space report
================

Here is the range of S and N space covered, and nparts in FS:

![](report_files/figure-markdown_github/plot%20sn%20space-1.png)

This is *on a log scale*, so up in that right corner is *1.942426e+130*.

![](report_files/figure-markdown_github/plot%20size%20of%20fs%202-1.png)

Note that the number of elements *would* continue to increase along each of these lines, except we hit the edge of the sampling space.

Here is the number of unique FS found, and the number of unique FS over the number that exist. Note that the number of draws was 5,000, so the maximum possible log(nunique) would be `8.5171932`. FS that found 5,000 unique draws are covered with black dots in this plot:

![](report_files/figure-markdown_github/nunique%201-1.png)

Here is the number of unique samples found relative to the number possible. FS that found all the elements possible are covered with green dots:

![](report_files/figure-markdown_github/nunique%202-1.png)

Skewness behavior
-----------------

Both skewness and the variability in skewness decrease with N/S, and increase with S. For a given S, a higher N/S (so higher N) will have lower skew and lower variability.

I don't think it matters very much whether you look at mean or median/range or sd.

![](report_files/figure-markdown_github/skewness-1.png)![](report_files/figure-markdown_github/skewness-2.png)![](report_files/figure-markdown_github/skewness-3.png)![](report_files/figure-markdown_github/skewness-4.png)![](report_files/figure-markdown_github/skewness-5.png)![](report_files/figure-markdown_github/skewness-6.png)

Simpson behavior
----------------

![](report_files/figure-markdown_github/simpson-1.png)![](report_files/figure-markdown_github/simpson-2.png)![](report_files/figure-markdown_github/simpson-3.png)![](report_files/figure-markdown_github/simpson-4.png)![](report_files/figure-markdown_github/simpson-5.png)![](report_files/figure-markdown_github/simpson-6.png)

Overlap with datasets represented in `scadsanalysis`
----------------------------------------------------

![](report_files/figure-markdown_github/scadsanalysis-1.png)

the sharpness of the threshold is an artifact of the way we don't have a lot of low s/high n communities in the datasets we started with.

repository: diazrenata/sadspace

repo_name: diazrenata/sadspace


text:
mrtparse
========

mrtparse is a module to read and analyze the MRT format data.
The MRT format can be used to export routing protocol messages, state changes, and routing information base contents, and was standardized in [RFC6396][rfc6396].
Programs like [Quagga / Zebra][quagga], [BIRD][bird], [OpenBGPD][openbgpd] and [PyRT][pyrt] can dump the MRT fotmat data.
You can also download archives from [the Route Views Project][route views], [RIPE NCC][ripe ncc].
[rfc6396]: https://tools.ietf.org/html/rfc6396
[quagga]: http://www.nongnu.org/quagga/
[bird]: http://bird.network.cz/
[openbgpd]: http://www.openbgpd.org/
[pyrt]: https://github.com/mor1/pyrt
[route views]: http://archive.routeviews.org/
[ripe ncc]: https://www.ripe.net/analyse/internet-measurements/routing-information-service-ris/ris-raw-data

##Supported MRT types

|Name         |Value|
|:------------|:---:|
|Table_Dump   |12   |
|Table_Dump_V2|13   |
|BGP4MP       |16   |
|BGP4MP_ET    |17   |

##Supported BGP capabilities

|Name                                    |Value|
|:---------------------------------------|:---:|
|Multiprotocol Extensions for BGP-4      |1    |
|Route Refresh Capability for BGP-4      |2    |
|Outbound Route Filtering Capability     |3    |
|Graceful Restart Capability             |64   |
|Support for 4-octet AS number capability|65   |
|ADD-PATH Capability                     |69   |

##Supported BGP attributes

|Name                |Value|
|:-------------------|:---:|
|ORIGIN              |1    |
|AS_PATH             |2    |
|NEXT_HOP            |3    |
|MULTI_EXIT_DISC     |4    |
|LOCAL_PREF          |5    |
|ATOMIC_AGGREGATE    |6    |
|AGGREGATOR          |7    |
|COMMUNITY           |8    |
|ORIGINATOR_ID       |9    |
|CLUSTER_LIST        |10   |
|MP_REACH_NLRI       |14   |
|MP_UNREACH_NLRI     |15   |
|EXTENDED_COMMUNITIES|16   |
|AS4_PATH            |17   |
|AS4_AGGREGATOR      |18   |
|AIGP                |26   |
|ATTR_SET            |128  |

##Requirements
Python2 or Python3 or PyPy or PyPy3

##Download
###git command

    $ git clone https://github.com/YoshiyukiYamauchi/mrtparse.git

###Browser
Access [https://github.com/YoshiyukiYamauchi/mrtparse.git][mrtparse_git], and click 'Download ZIP'.
[mrtparse_git]: https://github.com/YoshiyukiYamauchi/mrtparse.git

##Install
    $ cd <Clone Directory>
    $ python setup.py install
    running install
    running build
    running build_py
    running install_lib
    copying build/lib/mrtparse.py -> /Library/Python/2.7/site-packages
    byte-compiling /Library/Python/2.7/site-packages/mrtparse.py to mrtparse.pyc
    running install_egg_info
    Writing /Library/Python/2.7/site-packages/mrtparse-0.8-py2.7.egg-info

##Usage

    from mrtparse import *

or

    import mrtparse

##Programming
First, import the module.

    from mrtparse import *

And pass a MRT format data as a filepath string or file object to a class Reader().
It is also supported gzip and bzip2 format.
You can retrieve each entry from the returned object using a loop and then process it.

    d = Reader(f)
    for m in d:
        <statements>

We have prepared some example scripts and sample data in ["examples"][examples] and ["samples"][samples] directory.
[examples]: https://github.com/YoshiyukiYamauchi/mrtparse/tree/master/examples
[samples]: https://github.com/YoshiyukiYamauchi/mrtparse/tree/master/samples

##Authors
Tetsumune KISO<EMAIL_ADDRESS>
Yoshiyuki YAMAUCHI<EMAIL_ADDRESS>
Nobuhiro ITOU<EMAIL_ADDRESS>

License
----------
Licensed under the [Apache License, Version 2.0][Apache]
Copyright © 2015 [greenHippo, LLC.][greenHippo]
[Apache]: http://www.apache.org/licenses/LICENSE-2.0
[greenHippo]: http://greenhippo.co.jp

repository: martin-a-brown/mrtparse

repo_name: martin-a-brown/mrtparse


text:
This is my app Chatty. It is a web app built using react the allow users to comunicate with eachother.

## screen shot

![This a screen shot of apps main page](https://github.com/Terence1991/boilerplate.js/blob/master/pictures/Screenshot%20from%202018-11-03%2014-08-46.png)

##Dependenancies

-webpack with Babel, JSX, ES6, webpack dev server (comes with boilerplate)
=WebSockets
-ReactJS
-Must run two servers to create app


text:
# Android TensorFlow Machine Learning example written in Kotlin

<img src=https://www.tensorflow.org/_static/images/tensorflow/logo.png >

##  About This Example
* A test project for integrating [TensorFlow](https://github.com/tensorflow/tensorflow) into Android application with Kotlin
* How to build TensorFlow project to use in Android application and some other details can be found here [Article](https://blog.mindorks.com/android-tensorflow-machine-learning-example-ff0e9b2654cc)
* You can use TensorFlow library(.so file and jar file) if you get them from this project or just build them separately.
* Article about how to create Custom Model for Android using TensorFlow can be found here [Article](https://blog.mindorks.com/creating-custom-model-for-android-using-tensorflow-3f963d270bfb)

[Check out Mindorks awesome open source projects here](https://mindorks.com/open-source-projects)

### License
```
   No License. Just share and learn!
```

repository: stoichoandreev/TensorFlowHackaton

branch_name: refs/heads/dev

gha_language: Kotlin

repo_name: stoichoandreev/TensorFlowHackaton


text:
---
title: Shaving a YAML Yak
layout: post
author: tenderlove
---

Have you ever seen this error?

    $ gem install rails --pre
    ERROR:  While executing gem ... (NameError)
      uninitialized constant Psych::Syck
    $

Yes, I have too.  Today we're going to discuss the source of this error, and what we need to do to fix it.

## TL;DR

Upgrade rubygems to make this error go away.  However, the long term solution is to fix rubygems.org.

### Gemspecs and YAML

When you package your gem, the resulting `.gem` file contains a YAML representation of your gemspec.  The YAML representation of your gemspec contains everything your gemspec contains, including author information and dependency information.

The generated gem file is just a tar file:

    $ gem fetch rails
    Fetching: rails-3.1.0.gem (100%)
    Downloaded rails-3.1.0
    $ file rails-3.1.0.gem
    rails-3.1.0.gem: POSIX tar archive

The tar file contains two gzipped files.  One is the actual contents of your gem, the rb files, etc.  The other gz file is metadata about your gem:

    $ tar xvf rails-3.1.0.gem
    x data.tar.gz
    x metadata.gz

The metadata is your gemspec in YAML format.  We can easily examine the YAML data by using the `gzcat` command:

    $ gzcat metadata.gz
    --- !ruby/object:Gem::Specification
    name: rails
    version: !ruby/object:Gem::Version
      hash: 3
      prerelease:
      segments:
      - 3
      - 1
      - 0
      version: 3.1.0
    platform: ruby
    ...

### YAML and Ruby's standard library

Ruby has shipped with a YAML parsing library for quite a long time.  The library (called "syck") is a *custom* YAML 1.0 parser, and has been part of Ruby since 1.8.  Unfortunately, the library was abandoned.

YAML parsing is important for Ruby, so rather than removing Syck, it is being replaced with a new library called Psych.  Psych is a YAML 1.1 parser, but is powered by [libyaml](http://pyyaml.org/wiki/LibYAML).  libyaml is developed by the team that writes the YAML spec, and is considered to be the canonical implementation.

Unfortunately, this transition can cause subtle but annoying problems.

### Dealing with `=`

The problem we see when downloading from rubygems.org is due to round tripping issues between Syck and Psych.  Let's compare how Syck and Psych serialize the `=` sign:

    >> RUBY_VERSION
    => "1.8.7"
    >> require 'yaml'
    => true
    >> YAML.dump ['=']
    => "--- \n- \"=\"\n"
    >>

In the example above, we're using Syck to dump an equals sign.  Notice this double quotes surrounding the equals sign.  Now let's try the same thing with Psych:

    irb(main):001:0> RUBY_VERSION
    => "1.9.4"
    irb(main):002:0> require 'yaml'
    => true
    irb(main):003:0> YAML.dump ['=']
    => "---\n- =\n"
    irb(main):004:0>

Notice in this example the lack of double quotes surrounding the equals sign.  Both of these are valid YAML documents.  Let's see what happens when we feed the YAML from Psych in to Syck:

    >> RUBY_VERSION
    => "1.8.7"
    >> yaml = "---\n- =\n"
    => "---\n- =\n"
    >> YAML.load yaml
    => [#<YAML::Syck::DefaultKey:0x1026d0210>]
    >>

There we have it!  We can get Syck to return a strange object even when given a valid YAML document.  But how does this relate to gemspecs and rubygems.org?

### Gemspec revisited

Recall that gemspecs are dumped to YAML when the gem is packaged.  It's possible (and not unheard of) for our gemspecs to contain an equals sign.  Consider the defining dependencies in your gemspec:

    Gem::Specification.new do |s|
      ...
      s.add_dependency('activesupport', '= 3.1.0')
      ..
    end

Those dependencies are serialized to the generated YAML file.  If we package this using Psych and examine the generated yaml, we can find the section where the dependency is declared:

    $ gzcat metadata.gz
    ...
    dependencies:
    - !ruby/object:Gem::Dependency
      name: activesupport
      requirement: &70133834330380 !ruby/object:Gem::Requirement
        none: false
        requirements:
        - - =
          - !ruby/object:Gem::Version
            version: 3.1.0
    ...

Notice the unquoted equals sign in the metadata.

### rubygems.org

The trouble with the spec we saw above is that rubygems.org still uses syck as it's YAML parser.  When the server parses the gem YAML file, it turns the equals sign in to a Syck DefaultKey.

You can see this problem manifest itself on the rubygems.org website if you look at the Runtime Dependencies for some gems:

![runtime deps screenshot](https://img.skitch.com/20110901-dcmqkfy9eyu69dp1xfbqyfe9wg.jpg)

A simple [google search](http://www.google.com/search?hl=en&safe=off&q=defaultkey+site%3Arubygems.org&oq=defaultkey+site%3Arubygems.org&aq=f&aqi=&aql=&gs_sm=e&gs_upl=2623l8510l0l8586l57l29l0l12l0l3l348l2937l<IP_ADDRESS>l12l0) will show that this is not an uncommon problem.

### Command line errors

When downloading gem information, rubygems.org will send dependency information in marshall format.  Gems that have the DefaultKey object in their dependencies will have that object marshalled and sent down to the client.  If the client does not use Syck (which is default for 1.9.2+ when libyaml is available), then the Syck constant cannot be found and the "uninitialized constant" error will appear.

### How can we fix this?

We have two ways to deal with this issue.  The first way to deal with this issue is to upgrade rubygems.  Rubygems contains code to *work around* the issue when installing gems.  But it does not *fix* the issue.

The only way we can fix this error for all users is to upgrade rubygems.org to use psych as the YAML parser.  Upgrading rubygems.org will prevent the strange objects from entering marshal data sent to users.

We're working on this upgrade, but we can use your help!  Specifically, we need to get [delayed job](https://github.com/collectiveidea/delayed_job/commit/cbb4060) to be compatible with Psych.  Once we overcome that hurdle, I think it will be easy to get rubygems.org upgraded.

Thanks for listening!

<3<3<3


text:
# Artificial Intelligence Assignment

- **Student Names:** Will Hogan & Andrej Lavrinovic
- **Student Number:** G00318460, G00196984
- **College Name:** GMIT
- **Course:** Software Development
- **Module:** Artifical Intelligence
- **Lecturer:** John Healy
- **Current College Year:** 4rd Year
- **Project Title:** Controlling Game Characters with Neural Networks and Fuzzy Logic

---

# Assignment Description

### Summary
Our game has been created as part of the Artifical Intelligence module, which is a 4th year project in Software Development in GMIT.
The Application is a maze game in which you control a Spartan Warrior by moving various arrow keys around a maze.
The warrior needs to navigate around the maze and either avoid or engage various coloured spiders that are moving around the maze. The warrior can also pick up various Weapons.

### Purpose
The purpose of this application is to demonstrate various Artificial Intelligence components such as Fuzzy Logic and Neural Networks and how they work within the game.

### Game Play Instructions
To play the game, you use the arrow keys to move the Spartan Warrior around the maze.

Here's the controls;
* **Key-up** - Move Up
* **Key-down** - Move down
* **Key-left** - Move left
* **Key-right** - Move right

At any point during the game, you can press the following keys, to provide extra information;
* **Z** - Zooms out of map and displays all game characters as small dots.
* **E** - Displays some in game information relating to the Spartan Warrior in a *JOptionPane*
   * *Current Warrior Health*
   * *Current Weapon Count*
   * *Current Weapon (The one that will be used next)*

The warrior can pick up Weapons.
Here's a break down of the type of weapons available and the damage they do;
* **FIST** - Default Weapon and Always available even when no other wepon in collection, Damage: 5
* **SWORD** - Damage: 15
* **BOMB** - Damage: 40
* **HYDROGENBOMB** - Damage: 75
* **QUESTION MARK** - Picks a random weapon consisting of Sword, Bomb or Hydrogen Bomb. Damage: Random number between 1-100

Each Spider has 500 health and the warrior has 1000 health. The game is over when the warrior's health is 0.

---

# Application Features

## Fuzzy Logic
Fuzzy Logic has been incorporated into this project by using the Fuzzy Logic API jar file. Each Spider (which are independently threaded), will move around the maze and if they come in contact with the Spartan warrior, ie they ocupy cells beside one another, then the Fuzzy Logic is triggered. The contents of the FCL file (Fuzzy Control Logic) will determine the outcome of the battle using fuzzy logic linguistic variables and ruleblocks. Once the outcome has been ascertained, the result will reduce the health of both the spider and the Spartan Warrior. The warrior has 1000 health and each spider has 500, with each altercation reducing their health by 250.

As the Fuzzy Logic outputs a Crisp Output, we needed to figure out what to do with this value. If the value was high, ie the result was favourable like for example 75, then the remaining amount of 25 would be the amount calculated as the damage taken by the warrior.

## Neural Network
We have incorporated a 3 layer back propagation Neural Network into our project. The 3 layers have been caluclated using the following code excerpt, taken from the NeuralNetwork.java file;
```java
public void feedForward(){
		//Feed the inputs forward through the network as a weighted sum
		double sum = 0.0d;

		//Compute Input->Hidden Layer
		for (int hid = 0; hid < hidden.length; hid++){
			sum = 0.0d;
			for (int in = 0; in < inputs.length; in++) sum += inputs[in] * ihW[in][hid];
			sum+= ihW[inputs.length][hid];
			hidden[hid] = activator.activate(sum); //Apply activation function
		}

		//Compute Hidden->Output Layer
		for (int out = 0; out < outputs.length; out++){
			sum = 0.0d;
			for (int hid = 0; hid < hidden.length; hid++)	sum += hidden[hid] * hoW[hid][out];
			sum+= hoW[hidden.length][out];
			outputs[out] = activator.activate(sum); //Apply activation function
		}
	}
```

The network will be trained using the following;

**data**
[Health, Anger, Strength, Defence]

**expected**
[Walk Away, Attack, Build Hedge, Run Away]

Each type of spider has different stats. Spiders will make different solutions, depend of its type. For example red spiders are most agressive, but green spiders are most friendly and never will attack.

Once the network is trained each spider, will be able to make any of the above Expected desisions, when they come in contact with the Spartan Warrior. The Attack option will trigger the Fuzzy Logic.

## Threaded Characters
This project has used an Executor service to deal with threads, that allows each spider to navigate independently around the maze.

## AI Search Algorithms

As AI Search Algorithm there was implemented BestFirstTraversor. When the spider is close to the warrior (distance is different for differernt spider colours) the algorithm is searching for shortest path to the warrior and spider start to hunting. The issue is there if spider behind the hedge, then sprite is freeze and mot moving anymore.

---

# Deployment
To run this application, download, unzip and run the jar file using the following command;

```bash
java -cp ./game.jar ie.gmit.sw.game.GameRunner
```


text:
# TouchJSON-Ordered

This is a fork of [TouchJSON](https://github.com/TouchCode/TouchJSON) which deserializes objects as
instances of `OrderedDictionary`. Refer to the original repository for more information about TouchJSON.
Don't use this fork unless you know what you are up to.


text:
# Editors

This folder contains configurations and best practices of editors and IDE
configurations for Fuchsia development.

* [YouCompleteMe integration](/docs/development/editors/youcompleteme.md)
* [VIM configuration](vim.md)
* [VS Code](/docs/development/editors/vscode.md)

repository: winksaville/fuchsia

repo_name: winksaville/fuchsia


text:
# Extra strict and opinionated rules for PHPStan

[![Build](https://github.com/phpstan/phpstan-strict-rules/workflows/Build/badge.svg)](https://github.com/phpstan/phpstan-strict-rules/actions)
[![Latest Stable Version](https://poser.pugx.org/phpstan/phpstan-strict-rules/v/stable)](https://packagist.org/packages/phpstan/phpstan-strict-rules)
[![License](https://poser.pugx.org/phpstan/phpstan-strict-rules/license)](https://packagist.org/packages/phpstan/phpstan-strict-rules)

[PHPStan](https://phpstan.org/) focuses on finding bugs in your code. But in PHP there's a lot of leeway in how stuff can be written. This repository contains additional rules that revolve around strictly and strongly typed code with no loose casting for those who want additional safety in extremely defensive programming:

* Require booleans in `if`, `elseif`, ternary operator, after `!`, and on both sides of `&&` and `||`.
* Require numeric operands or arrays in `+` and numeric operands in `-`/`*`/`/`/`**`/`%`.
* Require numeric operand in `$var++`, `$var--`, `++$var`and `--$var`.
* These functions contain a `$strict` parameter for better type safety, it must be set to `true`:
  * `in_array` (3rd parameter)
  * `array_search` (3rd parameter)
  * `array_keys` (3rd parameter; only if the 2nd parameter `$search_value` is provided)
  * `base64_decode` (2nd parameter)
* Variables assigned in `while` loop condition and `for` loop initial assignment cannot be used after the loop.
* Variables set in foreach that's always looped thanks to non-empty arrays cannot be used after the loop.
* Types in `switch` condition and `case` value must match. PHP compares them loosely by default and that can lead to unexpected results.
* Check that statically declared methods are called statically.
* Disallow `empty()` - it's a very loose comparison (see [manual](https://php.net/empty)), it's recommended to use more strict one.
* Disallow short ternary operator (`?:`) - implies weak comparison, it's recommended to use null coalesce operator (`??`) or ternary operator with strict condition.
* Disallow variable variables (`$$foo`, `$this->$method()` etc.)
* Disallow overwriting variables with foreach key and value variables
* Always true `instanceof`, type-checking `is_*` functions and strict comparisons `===`/`!==`. These checks can be turned off by setting `checkAlwaysTrueInstanceof`/`checkAlwaysTrueCheckTypeFunctionCall`/`checkAlwaysTrueStrictComparison` to false.
* Correct case for referenced and called function names.
* Correct case for inherited and implemented method names.
* Contravariance for parameter types and covariance for return types in inherited methods (also known as Liskov substitution principle - LSP)
* Check LSP even for static methods
* Require calling parent constructor
* Disallow usage of backtick operator (`` $ls = `ls -la` ``)
* Closure should use `$this` directly instead of using `$this` variable indirectly

Additional rules are coming in subsequent releases!

## Installation

To use this extension, require it in [Composer](https://getcomposer.org/):

```
composer require --dev phpstan/phpstan-strict-rules
```

If you also install [phpstan/extension-installer](https://github.com/phpstan/extension-installer) then you're all set!

<details>
  <summary>Manual installation</summary>

If you don't want to use `phpstan/extension-installer`, include rules.neon in your project's PHPStan config:

```
includes:
    - vendor/phpstan/phpstan-strict-rules/rules.neon
```
</details>

## Disabling rules

You can disable rules using configuration parameters:

```neon
parameters:
	strictRules:
		disallowedLooseComparison: false
		booleansInConditions: false
		uselessCast: false
		requireParentConstructorCall: false
		disallowedConstructs: false
		overwriteVariablesWithLoop: false
		closureUsesThis: false
		matchingInheritedMethodNames: false
		numericOperandsInArithmeticOperators: false
		strictCalls: false
		switchConditionsMatchingType: false
		noVariableVariables: false
```

## Enabling rules one-by-one

If you don't want to start using all the available strict rules at once but only one or two, you can!

You can disable all rules from the included `rules.neon` with:

```neon
parameters:
	strictRules:
		allRules: false
```

Then you can re-enable individual rules with configuration parameters:

```neon
parameters:
	strictRules:
		allRules: false
		booleansInConditions: true
```

repository: phpstan/phpstan-strict-rules

repo_name: phpstan/phpstan-strict-rules


text:
# fable-101

## Overview

A simple Fable application - an empty page that writes a line of text to console.

## Requirements

- .NET Core 2.2+
- Node.js 10.0+

## Installation

To install the project's dependencies, run the following commands:

```bash
dotnet restore
npm install
```

## Development

To start the development server, run the following commands:

```bash
npm start
```

## Build

To build the project, run the following commands:

```bash
npm run build
```


text:
# Waitlist
Waitlist is a simple web application that saves users email to the database and gets the number of users that join the waitlist

![Image description](public/img/screenshot.png)

# Technologies Used
- Node JS
- Express JS
- Ejs
- MYSQL
- faker
- dotenv
- bodyParser

# Installation
To install and run the project you need to do the following:

Clone the repository: git clone https://github.com/devwalex/waitlist.git in the folder you created

Install all dependencies by running the command: **npm install**

Start the server by running thhe command: **npm start**

# Author
**Salami Usman Olawale (devwalex)**

repository: devwalex/waitlist

gha_language: JavaScript

repo_name: devwalex/waitlist


text:
# ImageMagick: Postcard [Example 1]

In this example a postcard is generated by providing a APE with an `Image` and some `Content` as input. By setting the right constraint, we make sure the `Image` will get a border.

### For more information please visit [our page](https://ape-framework.readthedocs.io/en/latest/docs/demo/imagemagick/imagemagick.html#example-1).

gha_language: Shell


text:
# create-ssl-certs
Create self signed SSL certificates for development purposes

1. create ```certs``` folder
2. run ```npx create-ssl-certs yourdomain.com```


text:
# Calvin

## What is this?

Calvin is an application environment that lets things talk to things. It comprises of both a development framework for application developers, and a runtime environment that handles the running application. Calvin is based on the fundamental idea that application development should be simple and fun. There should be no unnecessary impediments between an idea and its implementation, and an app developer should not have to worry about communication protocols or hardware specifics (but will not stop you from doing it if you want to.)

There are a few [Ericsson Research blog](http://www.ericsson.com/research-blog/) posts that gives a layman introduction to some aspects of Calvin:

[Open Source release of IoT app environment Calvin](http://www.ericsson.com/research-blog/cloud/open-source-calvin/)
[A closer look at Calvin](http://www.ericsson.com/research-blog/cloud/closer-look-calvin/)
[Calvin means business](http://www.ericsson.com/research-blog/cloud/calvin-means-business/)

If you could not attend the [Mobile World Congress 2016](https://www.mobileworldcongress.com) in person there is at least a teaser of what our team showed there: [Calvin smart IoT development](http://www.ericsson.com/research-blog/internet-of-things/calvin/)

An early position paper on Calvin, [Calvin - Merging Cloud and IoT](http://www.sciencedirect.com/science/article/pii/S1877050915008595) describes many of the underlying ideas and overall goals with this project. There are also a growing number of Calvin related master's theses available:

* [Consistent Authentication in Distributed Networks](https://lup.lub.lu.se/student-papers/search/publication/8871006)
* [Dynamic Fault Tolerance and Task Scheduling in Distributed Systems](https://lup.lub.lu.se/student-papers/search/publication/8876351)
* [Secure Domain Transition of Calvin Actors](https://lup.lub.lu.se/student-papers/search/publication/8881650)
* [Authorization Aspects of the Distributed Dataflow-oriented IoT Framework Calvin](https://lup.lub.lu.se/student-papers/search/publication/8879081)

## Getting Started

When you have gone through the material above and want to try it yourself, there is a quick start below, but you can also dive head first into [Installing Calvin](https://github.com/EricssonResearch/calvin-base/tree/master/extras/install/) or even [Calvin and Docker](https://github.com/EricssonResearch/calvin-base/tree/master/extras/docker/) if that is your preference. There should be enough information there to set up a small system of Calvin runtimes and deploy a simple distributed application.

The next stop after that would be to have a look at the available [examples](https://github.com/EricssonResearch/calvin-base/tree/master/calvin/examples), where we have a collection of example applications. If you have a Raspberry Pi available, it should be straightforward to get most of then up and running.

There is also an abundance of detailed information on the [wiki](https://github.com/EricssonResearch/calvin-base/wiki).

## Contact
This is a community project that was started by a team in Ericsson Research. If you have questions or problems, post an issue and we'll get back go you as soon as we can.

## New in this version

The focus of this release has been to rework some of the innards of Calvin in order to prepare for future extensions. Of course, it is inevitable that some new features sneak in, such as the new authentication framework (described in the [wiki](https://github.com/EricssonResearch/calvin-base/wiki/Security)), or just plain improvements, such as the new keyword `voidport` in CalvinScript - a shortcut to mark a port as unused in a script.

### Dockers ###

The instructions for using Calvin in Dockers have been reworked and expanded. The creation of images have been simplified. See [here](https://github.com/EricssonResearch/calvin-base/tree/master/extras/docker).

### Examples ###

Some documentation have been added to the examples, and the necessary requirements are included as an option in the installation script available [here](https://github.com/EricssonResearch/calvin-base/tree/master/extras/install).

### Security ###

This version introduces a new flexible authentication framework for establishing the authenticity of the user that deploys and application, within a domain, the authentication procedure results in a set of user attributes associated with the instances of actors, the attributes are used as input for the authorization procedure. Similarly, a new flexible attribute based authorization framework  is introduced. The framework is similar to XACML but designed to be more compact and efficient, it uses JSON and JSON Web Tokens for rules and transport. The certificate and key management has been substantially updated. _Note_: As for previous releases, all security features are disabled by default.

### Under the hood ###

A lot of work has gone into restructuring and refactoring in preparation of the features planned for later this year. The parser and compiler has received a much needed overhaul in order to simplify extensions to CalvinScript, and the implementation of actor ports have been improved to allow for a more dynamic and configurable handling of tokens.

## Quick start

### Download

The latest version of Calvin can be found on [github](https://github.com/EricssonResearch/calvin-base).

### Setup

(For more information about installation options, see [the wiki](https://github.com/EricssonResearch/calvin-base/wiki/Installation)) or the [debian/raspbian/ubuntu instructions](https://github.com/EricssonResearch/calvin-base/tree/master/extras/install)

When all pre-requisites are installed (see previous links), Calvin can be installed using the accompanying `setup.py`

    $ python setup.py install

Alternatively, install using `pip`

    $ pip install -e .

To verify a working installation, try

    $ csruntime --host localhost calvin/examples/sample-scripts/test1.calvin

This should produced an output similar to this:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    [ ... ]

The exact output may vary; the number of lines will most likely be different between runs.

It is also possible to start a runtime without deploying an application to it,

    $ csruntime --host <address> --controlport <controlport> --port <port>

Note that csruntime will return until it exits; either have it run in the background (usually by adding `&` to the end of the command), or open a new terminal to continue.

Applications can then be deployed remotely using

    $ cscontrol http://<address>:<controlport> deploy <script-file>
    Deployed application <app id>

and stopped with

    $ cscontrol http://<address>:<controlport> applications delete <app id>

Alternatively, a nicer way of doing it is using the web interface, described next.

### Visualization

Start a runtime

    $ csruntime --host localhost --controlport 5001 --port 5000

Start web server

    $ csweb

In a web browser go to `http://localhost:8000`, enter the control uri of the runtime you wish to inspect (in this case `http://localhost:5001`)

To deploy an application to the runtime, go to the `Deploy` tab, load a script and deploy it. (_Note_: There have been issues with some browsers on this page. Only Google Chrome seems to work consistently.)

After deployment, the `Actor` tab lists the actors currently executing on this runtime, and the `Applications` tab shows all applications deployed from the current runtime. By selecting one of the application ids, it is possible to get a visual representation of the application in the form of a graph. It is also possible to turn on tracing in order to see what goes on w.r.t actions in each actor. Running applications can also be stopped here.

### Testing

If necessary, install the extra packages needed for testing

    $ pip install -r test-requirements.txt

Run the essential test suite

    $ py.test -m essential

Run the quick test suite

    $ py.test -m "not slow"

Some tests are skipped (marked `s`), some are expected to fail (marked `x` or `X`). The important thing is that the line at the bottom is green.

## My first Calvinscript

CalvinScript is a scripting language designed to take the ugliness out of writing calvin programs. Using your favorite editor, create a file named `myfirst.calvin` containing the following:

    # myfirst.calvin
    source : std.Trigger(tick=1, data="Hello, world")
    output : io.Print()

    source.date > output.token

Save the file, and deploy and run the program (assuming you have a runtime running on localhost):

    $ cscontrol http://localhost:5001 myfirst.calvin

The application should produce "Hello, world" once every second.

## Open issues

Several

repository: baddourr/calvin-base

repo_name: baddourr/calvin-base