text:
#Fitbit OAuth Server app for GIMWearables project

This is a skeleton app to save authorization tokens for multiple devices and then expose the fitbit API (using python-fitbit) to grab data.
It is written in Python 3.5 and based on code from https://github.com/Bachmann1234/FitbitFlaskTemplate

To install, clone this repo somewhere, and create a virtual environment (I am using conda):
```
# Create a virtual environment for
conda create --name <yourenv> python==3.5 pip
conda activate <yourenv>
pip install -r requirements.txt
```

Then go to the [Fitbit App Config](https://dev.fitbit.com/apps/new), use Server mode with Callback URL http://localhost:5000/oauth-redirect. Note that the account must be approved for 'Intraday' data for non-personal devices in order to work like this in server mode.

Once you have that you need to define some environment variables. I am running Windows so I made the following batch script and included it as part of the conda environment activation script:

```
:: %CONDA_PREFIX%\etc\conda\activate.d\env_vars.bat
set FITBIT_CLIENT_ID=<your_client_id>
set FITBIT_CLIENT_SECRET=<your_secret_key>
set SECRET_KEY=sdasdas
set FLASK_CONFIG=development
```

Only development mode has been tested so far - works fine as a local application.

After defining those you are ready to setup development.

The app stores usernames and tokens in an sqlite database. This is by no means secure and is not meant to be deployed to the web.

The OAuth scopes are defined in fitbit.py. This app requests all persmissions.

The first time you run the app you need to create the database. With your virtual environment activated run
```
python manage.py createdb
```

Finally to run the app simply make sure your virtual environment is active and run

```
python manage.py
 * Running on http://<IP_ADDRESS>:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger pin code: 129-285-482
```

Authenticate users on the index page, then access the data using an HTTP GET request (i.e. in the browser):
```
http://localhost:5000/data/<username>/intraday/activities-heart/2019-06-13/1sec
```
Where 'username' is either the email associated with the fitbit device, or the string 'all', which will cause a dump of data from all registered devices as a JSON dict. Only intraday activity for heartrate is currently setup.

The idea is to have this flask server running on a local machine as an authentication layer for multiple accounts, and then use a separate process to send a daily request and log the data. The list of authenticated users is available at http://localhost:5000/users

repository: keithgunaratne/gimfitbitflask

repo_name: keithgunaratne/gimfitbitflask


text:
# mithril.sugartags

Sugar'd tags for mithril templating system - less code, less clutter, more awesome.

## Installing

Either simply include mithril.sugartags.min.js in your project, or install via bower:

    bower install mithril.sugartags --save

Or install via npm:

    npm install mithril.sugartags --save

## What does it do?

With sugar tags, your code can be nice like this:

    view: function(ctrl) {
        return [
            UL({class: "listy"}, [
                LI(A({href: '#'}, "item 1")),
                LI(A({href: '#'}, "item 2")),
                LI(A({href: '#'}, "item 3"))
            ])
        ];
    },

Without sugar tags it is a little verbose:

    view: function(ctrl) {
        return [
            m("ul", {class: "listy"}, [
                m("li", m("a", {href: '#'}, "item 1")),
                m("li", m("a", {href: '#'}, "item 2")),
                m("li", m("a", {href: '#'}, "item 3"))
            ])
        ];
    }

It works the same as normal mithril tags, and can be compiled just the same.

You can also use lowercase tags by doing:

    with(m.sugarTags.lower()) { ...

Note: if you prefer to not pollute the global namespace with the methods to create tags, you can do:

    m.localSugarTags = true;

And then in the template:

    with(m.sugarTags) { ...

*Note:* Using `with` might have some performance implications in some circumstances, using global uppercase sugartags is the recommended way.

license: MIT

branch_name: refs/heads/master

extension: md

gha_language: JavaScript

license_type: permissive


text:
# Foodhub Sample Site

This web application currently allows users to store and display items that they produce, including a name, inventory count and price, and allows for editing and deletion of items.  Items are persisted via ActiveRecord, which at this time connects to a SQLite database file.  Future versions of this app will allow consumers to browse and purchase items as well (maybe for real if this turns out to be a solution for the Riverton Local Food Hub's future online marketplace), and will allow producers to include detailed descriptions and keywords for their inventory.

# Installation

- Clone this repository to your machine.
- Run `bundle install` from the app's root directory (i.e. `foodhub-sample/`).
- Run `rake db:migrate` to initialize the database.
- Run the app from the web server of your choice.

# Usage

At this time, accessing the home page will redirect you to the producers' dashboard, where you will (once signed up and logged in) be able to create, edit and delete items from your inventory.  Prices are assumed to be USD.

# License
Copyright © 2020, Alex S. Engelhart

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

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

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

https://mit-license.org

repository: asengelhart/foodhub-sample

gha_language: Ruby

repo_name: asengelhart/foodhub-sample


text:
# FileSort utilities

**FileSort**

FileSort is a simple command line tool for sorting files.
Depending on size of a file different sorting methods could be applied:
- **OppositeMergeSort** is a classic implementation of bottom-up merge sort.
Algorithm is not so fast comparing to quick sort and is effective only for small files less than 1KB.
- **OppositeMergeQuickSort** represents combination of quick and merge sort: chunks of lines are sorted in memory by quicksort and then merged together via mergesort.
Algorithm is faster than the previous one but still not fast for files larger than 10MB.
Size of a chunk is configurable via command line.
- **ConcurrentOppositeMergeQuickSort** represents a concurrent version of OppositeMergeQuickSort algorithm: chunks of lines are processed in separate threads.
Number of concurrent operations is configurable via command line.

*Command line example:*

FileSort.exe 1GB.txt 1GB_sorted.txt

*Command line description:*

FileSort.exe
  - --file-buffer         (Default: 1MB) Size of FileStream internal buffer
  - --stream-buffer       (Default: 4KB) Size of StreamReader internal buffer
  - --memory-buffer       (Default: 150MB) Size of memory buffer
  - --quick-sort-size     Amount of records which will be quicksorted in memory before mergesort
  - --channel-capacity    (Default: 2) Capacity of channel in concurrent sorting method
  - --concurrency         (Default: 10) Number of concurrent sorting operations in concurrent sorting methods
  - -s, --sort-method     Sorting algorithm
  - --help                Display this help screen.
  - --version             Display version information.
  - value pos. 0          Required. Path to the source file
  - value pos. 1          Required. Path to the target file

*!WARNING! For large files sorting a large amount of memory is availble by default.
If you run out of memory you can descrease memory limit by decreasing '--memory-buffer', '--channel-capacity' and '--merge-concurrency' settings.*

**FileGenerate**

FileGenerate is a command line tool for random files generation.
For generation of random lines following modes are available:
- constant (constant string),
- sequence (simple sequental words selection with some fixed step),
- random (generation using Random class),
- bogus (generation with Bogus library),
- autofixture (generation with AutoFixture library)

*Command line example:*

FileGenerate.exe 10MB.txt -s 10MB

*Command line description:*

FileGenerate.exe
  - -s, --size         (Default: 10485760) Target file size
  - -g, --generator    (Default: Random) Random string generation algorithm (sequence, random, bogus, autofixture)
  - --file-buffer      (Default: 4KB) Size of FileStream internal buffer
  - --memory-buffer    (Default: 100MB) Size of memory buffer
  - --duplicates       (Default: 10) Amount of duplicated blocks after each random block
  - --help             Display this help screen.
  - --version          Display version information.
  - value pos. 0       Required. Target file path

**FileCheck**

FileCheck is a simple utility for line order check or file format check.

*Command line example:*

FileCheck.exe 10MB.txt

*Command line description:*

FileCheck.exe
  - --file-buffer      (Default: 1MB) Size of FileStream internal buffer
  - --stream-buffer    (Default: 4KB) Size of StreamReader internal buffer
  - --check-format     Check only file format, do not check lines order
  - --help             Display this help screen.
  - --version          Display version information.
  - value pos. 0       Required. Path to the sorted file that need to be checked

repository: olegbevz/FileSort

gha_language: C#

gha_license_id: MIT

repo_name: olegbevz/FileSort


text:
# Dump Memory Allocation Settings

Store the currently configured memory allocation settings for all persistent memory modules in the system to a file in order to replicate the configuration elsewhere. Apply the stored memory allocation settings using the command [Load Memory Allocation Goal](load-memory-allocation-goal.md)

```
$ ipmctl dump [OPTIONS] -destination (path) -system -config
```

## **Example**

```
$ ipmctl dump -destination config.txt -system -config
```

## **Limitations**

Only memory allocation settings for manageable persistent memory modules that have been successfully applied by the BIOS are stored in the file. Unconfigured modules are not included, nor are memory allocation goals that have not been applied.

repository: pmem/docs

repo_name: pmem/docs


text:
+++
# Accomplishments widget.
widget = "accomplishments"  # See https://sourcethemes.com/academic/docs/page-builder/
headless = true  # This file represents a page section.
active = true  # Activate this widget? true/false
weight = 80  # Order that this section will appear.

title = "Accomplishments"
subtitle = ""

# Date format
#   Refer to https://sourcethemes.com/academic/docs/customization/#date-format
date_format = "Jan 2006"

# Accomplishments.
#   Add/remove as many `[[item]]` blocks below as you like.
#   `title`, `organization` and `date_start` are the required parameters.
#   Leave other parameters empty if not required.
#   Begin/end multi-line descriptions with 3 quotes `"""`.

# TODO: Upload certificates

[[item]]
  organization = "Graduate Program at DLR"
  organization_url = "https://www.dlr.de/dlr/desktopdefault.aspx/tabid-10450/649_read-6933#/gallery/26723"
  title = "Soft Skill Seminars"
  url = ""
  certificate_url = ""
  date_start = "2014-08-01"
  date_end = "2019-06-20"
  description = """
  Various soft skill seminars in the areas:

  * Project Management
  * Communication
  * Effective Presentations
  * Business Knigge
  * Writing Scientific Papers
  """

[[item]]
  organization = "Robocup"
  organization_url = "https://www.robocup.org/"
  title = "Finalist, Robocup Logistics League, Brazil"
  url = ""
  certificate_url = "https://ll.robocup.org/page-5/"
  date_start = "2014-07-01"
  date_end = ""
  description = """
  Second Place in the Logistics League of the International Robotics Competition in Joao Pessoa (Brazil)

  Team: TUMsBendingUnits

  Affiliation: German Aerospace Center
  """

[[item]]
  organization = "Robocup"
  organization_url = "https://www.robocup.org/"
  title = "First Place, Robocup Logistics League, Netherlands"
  url = ""
  certificate_url = "https://ll.robocup.org/page-5/"
  date_start = "2013-07-01"
  date_end = ""
  description = """
  First Place in the Logistics League of the International Robotics Competition in Eindhoven (Netherlands)

  Team: TUMsBendingUnits

  Affiliation: Technical University Munich
  """

[[item]]
  organization = "Robocup"
  organization_url = "https://www.robocup.org/"
  title = "First Place, Robocup Logistics League, Mexico"
  url = ""
  certificate_url = "https://ll.robocup.org/page-5/"
  date_start = "2012-07-01"
  date_end = ""
  description = """
  First Place in the Logistics League of the International Robotics Competition in Mexico City

  Team: TUMsBendingUnits

  Affiliation: Technical University Munich
  """

[[item]]
  organization = "Student Council MPI, TUM"
  organization_url = "https://www.tum.de/en/"
  title = "Award for Outstanding Student Projects"
  url = ""
  certificate_url = "https://mpi.fs.tum.de/die-fachschaft/preise/preis-fuer-hervorragende-studierendenprojekte-informatik/"
  date_start = "2012-12-07"
  date_end = ""
  # description = "Award for outstanding student projects awarded by the Student Council MPI, TUM"

[[item]]
  organization = "DAAD"
  organization_url = "https://www.daad.de"
  title = "DAAD Student Exchange Scholarship"
  #url = "https://www.erasmusprogramme.com/"
  certificate_url = ""
  date_start = "2011-07-01"
  date_end = ""
  description = ""

[[item]]
  organization = "IBM"
  organization_url = "https://www.ibm.com/"
  title = "IBM Certified Database Administrator"
  url = ""
  certificate_url = "https://www.ibm.com/certify"
  date_start = "2010-03-22"
  date_end = ""
  description = "DB2 9 for Linux, UNIX and Windows"

+++

repository: sebastian-brunner/academic-kickstart

repo_name: sebastian-brunner/academic-kickstart


text:
# Twitter Sentiment Analyzer

Description:

The aim of the project was to fetch tweets on user given keyword and assign sentiment to those tweets.
Tweets are classified as Positive, Negative or Neutral using Naive Bayes Classifier.

This project is tested on Python 2.7 with Xampp as PHP working environment on Google Chrome v50.x and above.

Minimum Requirements:

1. Python 2.7
2. PHP
3. Twitter Login credentials(consumer_key,consumer_secret,access_token,access_token_secret)

Steps to Setup Environment:

1. Clone the project on your system.
2. Place your appropriate Twitter credentials in config.json.
3. Place search_result.php file in your htdocs folder of php installation directory(like Xampp).
4. Place appropriate path of your this project in search_result.php at line number 4.

Steps to run the Project:

5. Open cmd console in current dir. and execute the program with following command:
	python -m HTTPCGIServer 9002 (You can specify any Port number).

6. Open any Web Browser, type localhost:Port Number (eg: 9002. Same as in step 5)
7. Click start button.
8. Enter the keyword to search for.
9. Results will be displayed in Web Browser itself.

#License
Copyright 2016 © Karandeep Singh

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


text:
---
title: 'Gratitude for Tech'
date: '2020-05-30'
---

There are a few prevailing narratives on technology out there. Generally, they tend to flip between frustration that tech is dehumanizing, taking us away from the moment, and that technology is an absolutely necessary mechanism for survival that we can't live without.

I would venture to guess that both of these notions are correct in some capacity. Our opinions on technology are strong.

But when do we really look at technology with dispassionate gratitude? There's so much we can notice about how technology has fundamentally impacts the way we live. How many times do we stop to notice, without judging or applying our opinions on the impact of tech?

In times like these, our connection to humanity relies upon the tech's capability to connect us.

That's why it's even more important to notice our relationship with technology. How does using technology connect us deeper? How does it make us further away from our current moment?

In any case, I'm grateful for its existence. It's made what was once impossible, into a reality.

What are 3 aspects of technology that you're grateful for?

Here's mine!

1. Grateful that technology shrinks the physical borders and distance between us.
2. Grateful for the spirit of improvement and innovation that's inherent to developing technology. It's that spirit that motivates me to move forward.
3. Grateful for the imagination that arises when solving real-world problems with digital solutions.

I'd love to hear your list!

repository: SaalikLok/blog-musings

repo_name: SaalikLok/blog-musings


text:
# FlinkLearning
It's a repository to share Flink Learning. I will learn Flink by its [official documentation](https://ci.apache.org/projects/flink/flink-docs-release-1.8/) as a RoadMap.

## 1. Local Setup

I have already set up the Flink-1.8.0 local environment on MacOS and Intellij IDEA.

- [x] The **Setup Proccedure** is at the directory /Doc/**MacOS Flink1.8 Setup.md**
- [x] The official provided test file WordCountExamples.java is at the directory /src/main/java/WordCountExamples.java

## 2. Application Learning

### 2.1 Basic API Concepts

### 2.2 Streaming

### 2.3 Batch

### 2.4 Table & SQL

### 2.5 Machine Learning

## 3. Code

TODO

## 4. License

```
MIT License

Copyright (c) 2019 icmpnorequest

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

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

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

repository: JdaDong/FlinkLearning

repo_name: JdaDong/FlinkLearning


text:
# Sequent

[![Build Status](https://travis-ci.org/zilverline/sequent.svg?branch=master)](https://travis-ci.org/zilverline/sequent) [![Code Climate](https://codeclimate.com/github/zilverline/sequent/badges/gpa.svg)](https://codeclimate.com/github/zilverline/sequent) [![Test Coverage](https://codeclimate.com/github/zilverline/sequent/badges/coverage.svg)](https://codeclimate.com/github/zilverline/sequent)

Sequent is a CQRS and event sourcing framework written in Ruby.

In short: This means instead of storing the current state of your domain model we only store _what happened_ (events).

If you are unfamiliar with these concepts you can catch up with:

* [Event sourcing](http://martinfowler.com/eaaDev/EventSourcing.html)
* [Lars and Bob's presentation at GOTO Amsterdam](http://gotocon.com/dl/goto-amsterdam-2013/slides/BobForma_and_LarsVonk_EventSourcingInProductionSystems.pdf)
* [Erik's blog series](http://blog.zilverline.com/2011/02/10/towards-an-immutable-domain-model-monads-part-5/)
* [Simple CQRS example by Greg Young](https://github.com/gregoryyoung/m-r)
* [Google](http://www.google.nl/search?ie=UTF-8&q=cqrs+event+sourcing)

# Tutorial

## Getting started

    gem install sequent

    require 'sequent'

## Introduction

In short the main building blocks of CQRS and Eventsourcing are Commands, Aggregates and Events. To explain
how you can use sequent we start with an example of a simple domain (creating accounts) and write some specs and code.

Sequent provides a given, when, then stanza when testing your domain code. These test are typically very fast
since they do not rely on a database.

## Project setup

Our folder structure for this example is as follows:

    Gemfile
    Rakefile
    spec/
    lib/

First setup the `Gemfile`

    source "https://rubygems.org"

    # let's use the latest and greatest
    gem 'sequent', git: 'git@github.com:zilverline/sequent.git'

In `spec/spec_helper.rb` add the necessary plumbing code to be able to test. The helpers
provided by sequent expect an `@event_store`, `@repository` to exist in the tests.

    # spec/spec_helper.rb
    require 'bundler/setup'
    Bundler.setup

    require 'sequent/test'

    RSpec.configure do |config|
      config.include Sequent::Test::CommandHandlerHelpers

      config.before :each do
        @event_store = Sequent::Test::CommandHandlerHelpers::FakeEventStore.new
        @repository = Sequent::Core::AggregateRepository.new(@event_store)
        @repository.clear
      end
    end

In `spec/account_spec.rb` the actual tests for our domain are added. The first test will be to
add an account. In eventsourced system we typically test this by checking which Events will occur
after a certain Command is executed. The `when_command `helper provided by sequent expect an `@command_handler`
variable to exist.

    # spec/account_spec.rb
    require 'spec_helper'

    describe 'Account' do
      let(:aggregate_id) { Sequent.new_uuid }

      before :each do
        @command_handler = AccountCommandHandler.new
      end

      it 'creates an account' do
        when_command CreateAccount.new(aggregate_id: aggregate_id, name: 'ben')
        then_events AccountCreated.new(aggregate_id: aggregate_id, sequence_number: 1),
          AccountNameChanged.new(aggregate_id: aggregate_id, sequence_number: 2, name: 'ben')
      end
    end

Run the spec: `rake spec` and it will fail since none of the domain classes exist.

In `lib/domain.rb` we are going to create the domain code. For now we keep it simple
and put the Commands, CommandHandlers, Events and Aggregates all in the same file.

    # the command
    class CreateAccount < Sequent::Core::Command
      attrs name: String
      validate_presence_of :name
    end

    # events
    class AccountCreated < Sequent::Core::CreateEvent
    end

    class AccountNameChanged < Sequent::Core::Event
      attrs name: String
    end

    # aggregate root
    class Account < Sequent::Core::AggregateRoot
      def initialize(command)
        super(command.aggregate_id)
        # apply will set the mandatory event attributes aggregate_id and sequence_number
        apply AccountCreated
        apply AccountNameChanged, name: command.name
      end

      on AccountCreated do
      end

      on AccountNameChanged do |event|
        @name = event.command
      end
    end

    # command handler
    class AccountCommandHandler < Sequent::Core::BaseCommandHandler
      on CreateAccount do |command|
        repository.add_aggregate Account.new(command)
      end
    end

Now when we run the spec: `rake spec` and it will succeed.

## More examples

See the [sequent example app](https://github.com/zilverline/sequent-examples)

# The Database

The database is actually split in 2 parts. The Eventstore and the View schema. The eventstore is where all events are stored.

## Eventstore

Sequent uses a Postgres database with the eventstore schema. The current schema is maintained in `db/sequent_schema.rb`.

It is strongly recommended to copy this schema into your first migration and use migrations to keep it up to date. You can use ActiveRecord migrations
with Sequent and provides a task to run them (see section on Rake Tasks).

If you have trouble migrating from an older schema, please let us know. We'll be glad to help out.

## View Schema

Besides the event store database schema your app needs view projections. Projections are versioned and kept in a different database schema, but in
the same database.

Sequent adds support to maintain both schemas in the same database. Set the `schema_search_path` in your database config to your event store schema and
your view projection schema, respectively. E.g. 'event_store, view_1'.

The view schema is not maintained through migrations but instead is rebuild from recorded events. Therefore, there are no migrations on the view schema.
Its schema should be provided as a schema definition (e.g. in `db/view_schema.rb`).

To load the view schema in a different database schema use the `Sequent::Support::ViewSchema` extension of `ActiveRecord::Schema` to define it.

For example:

    Sequent::Support::ViewSchema.define(view_projection: Sequent::Support::ViewProjection.new(..)) do
      create_table 'accounts' do |t|
        t.string 'name', null: false
        t.string 'email', null: false
      end
    end

The support module is not required with sequent automatically. Require `sequent/support` to enable it.

## Rake Tasks for migrations

Sequent provides some Rake tasks to ease setup. To make them available in your project, add
the following to your `Rakefile`.

    begin
      require 'sequent/rake/tasks'
      Sequent::Rake::Tasks.new({db_config_supplier: YAML.load_file('db/database.yml'), environment: ENV['RACK_ENV'] || 'development'}).register!
    rescue LoadError
      puts 'Sequent tasks are not available'
    end

You *must* pass some options (`opts`) to tell Sequent your configuration.

* `db_config_supplier` — function that takes an environment and returns the database configs for that environment (e.g. `YAML.load_file('db/database.yml')`)
* `environment` — deployment environment (like `RAILS_ENV`) to get the appropriate database config
* `event_store_schema` — name of the database schema that contains the event store (defaults to `public`)
* `view_projection` — a `Sequent::Support::ViewProjection` that specifies your view schema
* `migration_path` — path to your ActiveRecord migrations directory (defaults to `db/migrate`)

And you're all set to use the Rake tasks (see `rake -T` for a description).

## Upgrading to a new view schema version

1. Install new version of you app on the server
2. Create new view schema in the database
3. Set application in maintenance mode
4. Replay all events
5. Switch to new version
6. Maintenance mode off

To support deploying sequent provides the following methods in the `EventStore`

`Sequent::Core::Eventstore.replay_events_from_cursor(block_size: 2000, get_events:, on_progress: )`

Sequent uses the `postgresql_cursor` gem for iterating through large result sets. The `block_size`
param is passed to the `each_row` method and denotes the number of rows to fetch per db block fetch.
The `get_events` is an `ActiveRecord::Relation` containing the stream of events. Typically this is ordered
per aggregate per sequence number. The `on_progress` parameter is a block that is called after the number
of rows in `block_size` are processed and at the end of the method. By default the `on_progress` just
prints the progress to `STDOUT`

So a very simple replay of all events:

    all_events = Sequent::Core::EventRecord.order('aggregate_id asc, sequence_number asc')
    Sequent::Core::Eventstore.replay_events_from_cursor(
      block_size: 2000,
      get_events: all_events,
    )

This strategy is fine when you don't have many events and it is okay to have downtime when doing a view schema upgrade.

## Upgrading to a new view schema version with virtually no downtime

Since the view schema's can always be regenerated from events
we can deploy and run migrations for a new version of a Sequent powered app with virtually
no downtime since we can do the generation of the new view schema in the background.

1. Install new version of your app on the server
2. Create new view schema in the database
3. Replay all events in the new view schema while the current version of you app is running
4. When all events are replayed set application set application in maintenance mode
5. Get new events since 3.
6. Switch to new version
7. Maintenance mode off

To support this way of deploying sequent we can use the `on_progress` parameter of
the `EventStore.replay_events_from_cursor` method.

As we read earlier the `on_progress` parameter is a block that is called after the number
of rows in `block_size` are processed and at the end of the method. It takes 3 parameters
of which the last is the ids of the `EventRecord` replayed. We need to keep track of this
during step 3 so in step 5 we can query all events expect for those events. We can not
simply keep track of the last id replayed since sequences in postgres can be out of order.

Replay of all events (step 3):

    Sequent::Core::EventRecord.connection.execute('create table replay_ids(event_id numeric)')
    all_events = Sequent::Core::EventRecord.order('aggregate_id asc, sequence_number asc')
    Sequent::Core::Eventstore.replay_events_from_cursor(
      block_size: 2000,
      get_events: all_events,
      on_progress: ->(progress, done, ids_replayed) {

      }
    )

# Reference Guide

Sequent provides the following concepts from a CQRS and an event sourced application:

* Commands
* CommandService
* CommandHandlers
* AggregateRepository
* Events
* EventHandlers
* Projectors
* Workflows
* EventStore
* Aggregates
* ValueObjects
* Snapshotting

## Commands
Commands are the instructions typically initiated by the users, for instance by submitting forms.
Good practive is to give them descriptive names like `PayInvoice`.
Commands in sequent use ActiveModel for validations.

```ruby
class PayInvoice < Sequent::Core::UpdateCommand
  validates_presence_of :pay_date
  attrs pay_date: Date, amount: Integer
end
```

Sequent will automatically add validators in `Sequent::Core::BaseCommand`s for frequently used classes like:

* Date
* DateTime
* Integer
* Boolean

When posted form the web and created like `PayInvoiceCommand.from_params(params[:pay_invoice_command])` its values are typically still all String.
Sequent takes care of parsing the string values to the correct types automatically when a Command is valid (`valid?`).
Its values will be parsed to the correct types by the CommandService. If you instantiate a Command manually with the correct types nothing will change.

## CommandService

Sequent provides a `Sequent::Core::CommandService` to propagate the commands to the correct aggregates. This is done
via the registered CommandHandlers.

```ruby
command = PayInvoiceCommand.new(aggregate_id: "10", pay_date: Date.today, amount: 100)
Sequent.command_service.execute_commands command
```

## CommandHandlers

CommandHandlers are responsible to interpreting the command and sending the correct message to an Aggregate, or in some
cases create a new Aggregate and store it in the AggregateRepository.

```ruby
class InvoiceCommandHandler < Sequent::Core::BaseCommandHandler
  on PayInvoiceCommand do |command|
    do_with_aggregate(command, Invoice) { |invoice| invoice.pay(command.pay_date, command.amount) }
  end
end
```

## AggregateRepository

Repository for aggregates. Implements the Unit-Of-Work and Identity-Map patterns
to ensure each aggregate is only loaded once per transaction and that you always get the same aggregate instance back.

On commit all aggregates associated with the Unit-Of-Work are queried for uncommitted events. After persisting these events
the uncommitted events are cleared from the aggregate.

The repository is keeps track of the Unit-Of-Work per thread, so can be shared between threads.

```ruby
AggregateRepository.new(Sequent.config.event_store)
```

## Events

Events describe what happened in the application. Events, like commands, have descriptive names in past tense e.g. InvoicePaidEvent

```ruby
class InvoicePaidEvent < Sequent::Core::Event
  attrs date_paid: Date
end
```

## EventHandlers

### Projectors

Projectors are registered with the EventStore and will be notified if an Event happened, so the view model (projection) can be updated.

```ruby
class InvoiceProjector < Sequent::Core::Projector
  on InvoicePaidEvent do |event|
    update_record(InvoiceRecord, event) do |record|
      record.pay_date = event.date_paid
    end
  end
end
```

Sequent currently supports updating the view model using ActiveRecord out-of-the-box.
See the `Sequent::Core::RecordSessions::ActiveRecordSession` if you want to implement another view model backend.

### Workflows

Workflows are registered with the Eventstore and will be notified if an Event happened, so a new command could be executed.

```ruby
class AccountWorkflow < Sequent::Core::Workflow
  on EmailClaimed do |event|
    execute_commands RegisterAccountForClaimedEmail.new(event)
  end
end
```

## EventStore

The EventStore is where the Events go. As a user you only have to configure the EventStore, Sequent takes care of the rest.
The EventStore is configured and accessible via the configuration.

```ruby
Sequent.configure do |config|
  config.record_class = Sequent::Core::EventRecord # configured by default but can be overridden
  config.event_handlers = [MyEventHandler.new]     # put your event handlers here
end

Sequent.configuration.event_store
```

## Aggregates

Aggregates are you top level domain classes that will execute the 'business logic'. Aggregates are called by
the CommandHandlers.

```ruby
class Invoice < Sequent::Core::AggregateRoot
  def initialize(params)
    apply InvoiceCreatedEvent, params
  end

  def pay(date, amount)
    raise "not enough paid" if @total_amount > amount
    apply InvoicePaidEvent, date_paid: date
  end

  on InvoiceCreatedEvent do |event|
    @total_amount = event.total_amount
  end

  on InvoicePaidEvent do |event|
    @date_paid = event.date_paid
  end

end
```

Event sourced application separates the business logic (in this case the check for the amount paid) with updating the state.
Since event sourced applications rebuild the model from the events, the state needs to be replayed but not your business rules.

## ValueObjects

Value objects, like commands, use ActiveModel for validations.

```ruby
class Country < Sequent::Core::ValueObject
  validate_presence_of :code, :name
  attrs code: String, name: String
end

class Address < Sequent::Core::ValueObject
  attrs street: String, country: Country
end
```

Sequent will automatically add validators in `Sequent::Core::ValueObject`s for frequently used classes like:

* Date
* DateTime
* Integer
* Boolean

Validation is automatically triggered when adding `ValueObject`s to Commands.

## Snapshotting

Snapshotting is an optimization where the aggregate's state is saved in the event stream. With snapshotting the state of an aggregate can be restored from a snapshot rather than by replaying all of its events.

Sequent supports snapshots on aggregates that call `enable_snapshots` with a default threshold. In general it is recommended to keep the threshold low, to surface possible snapshot bugs sooner.

```ruby
class MyAggregateRoot < Sequent::Core::AggregateRoot
  enable_snapshots default_threshold: 30
end
```

To adjust the threshold of individual aggregates you can update its `StreamRecord`.

Snapshots can be taken with a `SnapshotCommand`. For example by a Rake task.

```ruby
namespace :snapshot do
  task :take_all do
    catch (:done) do
      while true
        command_service.execute_commands Sequent::Core::SnapshotCommand.new(limit: 10)
      end
    end
  end
end
```

# Testing

Sequent adds some test helpers to help test your event sourced application. Only RSpec is supported at the moment.
The use of these modules are documented in the source code.

```ruby
require 'sequent/test'

RSpec.configure do |c|
  c.include Sequent::Test::CommandHandlerHelpers
  c.include Sequent::Test::WorkflowHelpers
  c.include Sequent::Test::EventStreamHelpers # FactoryGirl is required for these helpers.
end
```

It's best to scope inclusion of `CommandHandlerHelpers` to your command handler specs and `WorkflowHelpers` to your workflows.

# Contributing

Fork and send pull requests

# Releasing

Change the version in `lib/version.rb`. Commit this change.

Then run `rake release`. A git tag will be created and pushed, and the new version of the gem will be pushed to rubygems.

## Running the specs
If you wish to make changes to the `sequent` gem you can use `rake
spec` to run the tests. Before doing so you need to create a postgres
user and database first:

```sh
createuser -D -s -R sequent
createdb sequent_spec_db -O sequent
bundle exec rake db:create
```

The data in this database is deleted every time you run the specs!

# License

Sequent is released under the MIT License.

repository: macobo/sequent

repo_name: macobo/sequent


text:
---
layout: default
---

# 1994-08-09 - Re: GAK & RSA

## Header Data

From<EMAIL_ADDRESS>(Timothy C. May)

To<EMAIL_ADDRESS>Message Hash: 3dced00f516228d961a6bc0e2275d50bd2f5c62df55cb6cf233fd6856fce2a89

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1994-08-09 17:52:40 UTC

Raw Date: Tue, 9 Aug 94 10:52:40 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Timothy C. May)
Date: Tue, 9 Aug 94 10:52:40 PDT
To<EMAIL_ADDRESS>Subject: Re: GAK & RSA
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Paul Robichaux writes:

> RSADSI has been adamantly opposed to Clipper. You'd expect them to be
> opposed on business grounds; after all, Clipper wouldn't bring them
> any revenue and could quite possibly put them out of business if other
> forms of encryption were outlawed. I don't remember seeing many
> specific comments indicating that RSA was opposed to GAK on
> philosophical grounds (well, OK; some quotes on their "Sink Clipper"
> poster, if those count).

I communicated with Jim Bidzos about this, asking him what he'd heard
about the Karlsruhe/Walker-Belenson proposal--he said he'd gotten no
wind of it, thinking it to be just another academic paper. Later
messages indicated he was taking it more seriously.

As to RSADSI's objections or approvals, I can't say. They are a
_company_, planning to (someday??) turn a profit for their investors
(Note: Alan Alcorn, the inventor of "Pong," invested in them in the
early or mid-80s, and says he's not seen a dime come back, nor has the
company gone public). That is, RSADSI is not run along Cypherpunkesque
lines, but you all knew that.

> Putting the cypherpunkesque arguments about how GAK is a big step down
> the path towards a surveillance state, is it possible that the
> software GAK (SGAK) scheme could easily incorporate RSA's technology?

My understanding is that the Walker-Belenson algorithm is quite strong
as it is. I tried to ftp to ftp.tis.com, and succeeded, but could not
find the Karlruhe paper(s) there, yet. If someone knows where they are
(Carl?) or otherwise gets ahold of them, they might be useful
additions to our own archives. Or a pointer, at least.

> thus use RSA without any problem. The "Skipjack, DSS, and SHA may be
> weak" crowd can't object to RSA's strength, and of course RSADSI will be
> in no position to object.

I think 95% of the opposition to Clipper came from two sources:

1. General opposition to the principle of "escrowed encryption"

2. Disinterest/opposition to the idea of buying special hardware.

I don't see the "Skipjack is weak" argument as ever having been
persuasive. Hence, I don't see the following as too big a concern:

> _This_ is what's scaring me. If Microsoft, Apple, et al offer weak
> encryption as part of SGAK, objections can be made to the weakness. If
> they use RSA, that avenue is gone.

What scares me is the incorporation of the SKE or GAK into products.
Not that RSA may offer an even stronger system.

It's the principle.

--Tim May

--
..........................................................................
Timothy C. May         | Crypto Anarchy: encryption, digital money,
<EMAIL_ADDRESS>     | anonymous networks, digital pseudonyms, zero
408-688-5409           | knowledge, reputations, information markets,
W.A.S.T.E.: Aptos, CA  | black markets, collapse of governments.
Higher Power: 2^859433 | Public Key: PGP and MailSafe available.
"National borders are just speed bumps on the information superhighway."

{% endraw %}
```

## Thread

+ Return to [August 1994](/archive/1994/08)

+ Return to "[Carl Ellison <cme@tis.com>](/authors/carl_ellison_cme_at_tis_com_)"
+ Return to<EMAIL_ADDRESS>(Eric Hughes)](/authors/hughes_at_ah_com_eric_hughes_)"
+ Return to<EMAIL_ADDRESS>(Paul Robichaux)](/authors/paul_at_poboy_b17c_ingr_com_paul_robichaux_)"
+ Return to<EMAIL_ADDRESS>(Timothy C. May)](/authors/tcmay_at_netcom_com_timothy_c_may_)"

+ 1994-08-09 (Tue, 9 Aug 94 08:50:56 PDT) - [GAK & RSA](/archive/1994/08/10cd0dd7f0115beac38ef42b8ae8ed0e1316878817f7bcbe237adb3925f42ece) -<EMAIL_ADDRESS>(Paul Robichaux)_
  + 1994-08-09 (Tue, 9 Aug 94 09:16:15 PDT) - [GAK & RSA](/archive/1994/08/63ca41ef51d1dc37aced1ffad1ef8f8add6a27565dff572bd0e3dcb45c047b9f) -<EMAIL_ADDRESS>(Eric Hughes)_
  + 1994-08-09 (Tue, 9 Aug 94 10:52:40 PDT) - Re: GAK & RSA -<EMAIL_ADDRESS>(Timothy C. May)_
    + 1994-08-09 (Tue, 9 Aug 94 11:24:40 PDT) - [Re: GAK & RSA](/archive/1994/08/ce5ba93ddcf14c5a0c177fad5d66cfc839507e030b55ac1f21b23239ba7e4bc3) - _Carl Ellison<EMAIL_ADDRESS>


text:
# Inference with TensorFlow Serving

This example shows how to start a TensorFlow Serving GPU instance and sends translation requests via a simple Python client.

## Requirements

* Docker 19.03 or above

## Usage

**1\. Go into this directory, as assumed by the rest of the commands:**

```bash
cd examples/serving/tensorflow_serving
```

**2\. Download the English-German pretrained model:**

```bash
wget https://s3.amazonaws.com/opennmt-models/averaged-ende-export500k-v2.tar.gz
tar xf averaged-ende-export500k-v2.tar.gz
mkdir ende
mv averaged-ende-export500k-v2 ende/1
```

**3\. Start a TensorFlow Serving GPU instance in the background:**

```bash
docker run --gpus=all -d --rm -p 9000:9000 -v $PWD:/models \
  --name tensorflow_serving --entrypoint tensorflow_model_server \
  tensorflow/serving:2.3.0-gpu \
  --enable_batching=true --batching_parameters_file=/models/batching_parameters.txt \
  --port=9000 --model_base_path=/models/ende --model_name=ende
```

*For more information about the `batching_parameters.txt` file, see the [TensorFlow Serving Batching Guide](https://github.com/tensorflow/serving/tree/master/tensorflow_serving/batching).*

**4\. Install the client dependencies:**

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

**5\. Run the interactive client:**

```bash
python ende_client.py --port 9000 --model_name ende \
  --sentencepiece_model ende/1/assets.extra/wmtende.model
```

The client will read your input and outputs the translation. You can terminate it with Ctrl-C.

**6\. Stop TensorFlow Serving:**

```bash
docker kill tensorflow_serving
```

## Going further

Depending on your production requirements, you might need to build a simple proxy server between your application and TensorFlow Serving in order to:

* manage multiple TensorFlow Serving instances (possibly running on multiple hosts) and keep persistent channels to them
* apply tokenization and detokenization

repository: OpenNMT/OpenNMT-tf

gha_language: Python

repo_name: OpenNMT/OpenNMT-tf


text:
![ScreenShot](http://www.atsspeed.com/images/xATSSPEED_logo_plusshout_728x91.png.pagespeed.ic.8mRpu2PXS0.png
)

Apache Traffic Server web content optimization plugin powered by Google PageSpeed

The current state compiles against mod_pagspeed svn revision 3537
Please note the this plugin will generate asserts when build against
the debug version of mps (option->Merge from a different thread).

Work in progress! This plugin is known to be working on ubuntu 12.x (x64)

There are some hard-coded things in the plugin, so it expects:
- /tmp/ps_log/ to exist
- /tmp/ats_ps/ to exist

Configuration files go into `/usr/local/etc/trafficserver/psol.`
That folder is monitored, and changes to files in there are picked
up immediately. A sample configuration:

```
# [host]
[<IP_ADDRESS>]
# Force traffic server to cache all origin responses
override_expiry
pagespeed FlushHtml on
pagespeed RewriteLevel CoreFilters
pagespeed EnableFilters rewrite_domains,trim_urls
pagespeed MapRewriteDomain http://<IP_ADDRESS> http://www.foo.com
pagespeed MapOriginDomain http://<IP_ADDRESS> http://www.foo.com
pagespeed EnableFilters prioritize_critical_css,move_css_to_head,move_css_above_scripts
pagespeed EnableFilters fallback_rewrite_css_urls,insert_img_dimensions,lazyload_images,local_storage_cache
pagespeed EnableFilters prioritize_critical_css,rewrite_css
pagespeed EnableFilters combine_javascript,combine_css
```

It also expects this in records.config from ATS to function:
`CONFIG proxy.config.url_remap.pristine_host_hdr INT 0`

You can view debug output of the plugin using `traffic_server -T ".*speed.*"`


text:
# Terminology

| Name                                   | Description                                         |
|:---                                    |:---                                                 |
| **Artifact**                           |
| **Asset**                              | **Assets**
* have one content type
* can be a finite as a (set of) file(s) or non finite as a service, stream
* are the _unit of sharing_
* can point to one or more (physical) asset elements
| **Asset Element**                      |
| **Asset Index**                        | **Asset Index**
* manages assets
* provided by an extension
* may support external catalogs
* can be queried
| **Broker**                             | see **IDS Broker**
| **Connector**                          |
| **Connector Directory**                |
| **Contract**                           |
| **Contract Agreement**                 | **Contract Agreement**
* points to a **Contract Offer**
* results from a **Contract Negotation Process**
* has a start date and may have a expiry date and a cancellation date
| **Contract Negotiation**               |
| **Contract Offer**                     | **Contract Offer**
* set of obligations and permissions
* can be generated on the fly on provider side (see **Contract Offer Framework**)
* are immutable
* persisted in **Contract Negotiation Process** once the negotiation has startet
* updated versions during the **Contract Negotiation Process** may be generated manually
* target of rules

| **Contract Offer Framework**           | **Contract Offer Framework**
* generates **Contract Offers**
* refers to 0..n **Consumers** and to 1..n **Assets**
* provided by an **Extension**
* can be based on "pre-established agreements"
| **Consumer**                           |
| **Dataspace**                          |
| **EDC Extension**                      |
| **Element**                            | see **Asset Element**
| **Extension**                          | see **EDC Extension**
| **Framework**                          | see **Contract Offer Framework**
| **Identity Provider**                  |
| **IDS Broker**                         | IDS version of the **Connector Directory**
| **Offer**                              | see **Contract Offer**
| **Offer Framework**                    | see **Contract Offer Framework**
| **Provider**                           |
| **Resource**                           |
| **Resource Manifest**                  |
| **Rule**                               | **Rules**
* bound to a **Contract Offer**, **Contract Agreement** or **Contract Offer Framework**
* exist independent from an **Asset**
| **Transfer Process**                   | **Transfer Process**
* based on a **Contract Agreement**

repository: DevotionZhu/DataSpaceConnector

branch_name: refs/heads/main

repo_name: DevotionZhu/DataSpaceConnector


text:
---
applied_at: '2019-09-11'
applies_to:
  - api
is_impactful: false
is_new_feature: false
---

# New `completion_rule` field for Tasks

A new optional field has been made available within the Task object,
`completion_rule`. This field may be set through the use of the the
[Create Task](endpoint://post-tasks) and [Update Task](endpoint://put-tasks-id)
endpoints, and will be returned as part of the standard
[Task object](endpoint://resources/task/).

The purpose of this field is to set the conditions under which a task is
completed, based on user involvement. When a task is created with a completion
rule of `all_assignees` (default), the task will only be considered completed
when all assignees have completed the task. When a task is created with a
completion rule of `any_assignee`, the task will be considered completed when
one assignee has completed the task.

repository: box/box-developer-changelog

repo_name: box/box-developer-changelog


text:
# Phomopsis vignae (Speg.) Aa & Vanev SPECIES

#### Status
ACCEPTED

#### According to
Index Fungorum

#### Published in
A Revision of the Species Described in Phyllosticta (Utrecht) 477 (2002)

#### Original name
Phyllosticta vignae Speg.

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# Personal Blog

#### By Panatda Catlin
###### Initiated December 21th, 2019.

## Description

A static blog webpage. This project will demonstrate how Flexbox works together with CSS grid. Using purely HTML, CSS, CSS Grid, and Flexbox. Design process includes HTML Responsive Web Design, Moblie First Design, prototyping and mockups.

## Mock-Up Samples

    [Landing page](https://wireframe.cc/EUk5J5).
    [Blog Page](https://wireframe.cc/KkoBmv).
    [Contact Us Form
](https://wireframe.cc/LXNvXh).

## Project Screenshoot Samples

* Deskstop View

* Mobile View

## Prerequisites & Installation

None.

## Live demo

* To visit the project [Click Here](https://panatdacatlin.github.io/personal-blog/). This should redirect to `https://panatdacatlin.github.io/personal-blog/`

## Download Repo

* Clone this repository: in the command-line enter:`$ git clone https://github.com/PanatdaCatlin/personal-blog`.

## Usage

To open locally once project is cloned:
1. Navigate to the application directory: `$ cd personal-blog`
2. Execute the command `$ open index.html` or `$ <your browser> index.html`
3. The application will be opened in your browser

## Technologies Used

```
* HTML 5
* CSS
* CSS Grid
* Flexbox
```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

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

repository: PanatdaCatlin/personal-blog

repo_name: PanatdaCatlin/personal-blog


text:
# Contributing

> First and foremost, thank you for stepping in and trying to be part of the effort.

### Goals

When expanding Kint, keep in mind its main priorities:

1. **Maximum PHP version range compatibility**: Kint supports and must continue to work down to at least PHP 5.3 and support all latest stable PHP features and additions as soon as they are released
2. **Ease of use**: developers must be able to install Kint effortlessly and start using it immediately with no additional required steps. JS/CSS resources and the single PHP file should be rebuilt with `composer build` and committed when changed.
3. **No feature creep**: requests for edge use cases, especially ones that can be worked around with some configuration, should *not* be catered to. The definition of edge case is the popularity of the feature request, if it's popular - it's a workflow, if not - it might be an edge case.
4. **Do not compromise information clarity**: displaying relevant information and not omitting meaningful data takes precedence over every principle in this list - as well as (and not limited to) performance and tidy Kint codebase.
5. **Code quality**: the nature of Kint implies that it will be continued to develop for many years - at least to adapt to new language features and quirks. Keep the codebase as maintainable as possible. Keep code style and quality consistent by finishing every commit with `composer format`, and `composer analyze`.
6. **Stable releases**: Try not to push backwards compatibility breaking or untested changes to the master branch. Because it is a development tool, people may leave their `composer require-dev` Kint configuration to allow auto-updates.

### Don't alter user input

For the parser to do proper recursion checking it has to take things by reference. Since it's taking things by reference there's a good chance your parser plugin can change your end-users data. **NEVER ALTER INPUT VARIABLES**

### Development instructions

```sh
composer install # Install dependencies
composer format  # Format code style
composer analyze # Analyze code
composer build   # Build JS/CSS resources, and the final phar file
```

Note: Full format and build depends on `npm` being in your `$PATH`.


text:
# Contributors

## Special thanks for all the people who had helped this project so far

* [All Contributors](https://github.com/DZetaDev/Blacklist-Alpha/graphs/contributors)

## I would like to join this list. How can I help the project?

We're currently looking for contributions for the following:

- [ ] New spammers and bad/malwares domains/IPs/emails
- [ ] New usage examples

For more information, please refer to our [CONTRIBUTING](CONTRIBUTING.md) guide.

repository: DZetaDev/Blacklist-Alpha

repo_name: DZetaDev/Blacklist-Alpha


text:
# cosmicvelocity/lumen-helpers
[![Build Status](https://travis-ci.org/cosmicvelocity/lumen-helpers.svg?branch=master)](https://travis-ci.org/cosmicvelocity/lumen-helpers)

Improves interoperability between Lumen and Laravel.

Since Lumen started focusing on providing stateless APIs from 5.2, session etc etc has been removed.
However, Lumen, which has a low processing speed, is also attractive for regular web application development.

Fortunately, Lumen can incorporate the components of Laravel and reintroduce the removed function.
This library provides functions that are missing when you use Lumen like that.

In addition, it supports the upgrading of applications developed under Lumen 5.1,
It can be used for improving implementation compatibility, assuming that you are planning to migrate to Laravel in the future.

## Installation
If composer is used, it can be introduced by adding the following description.

```json
{
    "require": {
        "cosmicvelocity/lumen-helpers": ">=1.0"
    }
}
```

When using helpers related to sessions, Lumen needs to be set so that sessions can be used.

To enable sessions with Lumen 5.4, set the Application in bootstrap.php as shown below.

```php
// Add required alias.
$app->alias('cookie', \Illuminate\Cookie\CookieJar::class);
$app->alias('cookie', \Illuminate\Contracts\Cookie\Factory::class);
$app->alias('cookie', \Illuminate\Contracts\Cookie\QueueingFactory::class);
$app->alias('session', \Illuminate\Session\SessionManager::class);
$app->alias('session.store', \Illuminate\Session\Store::class);
$app->alias('session.store', \Illuminate\Contracts\Session\Session::class);

// Read the configuration file.
// You need to prepare a configuration file similar to Laravel in config/session.php.
$app->configure('session');

$app->withFacades(true, [
    \Illuminate\Support\Facades\Config::class => 'Config'
]);

// Set cookie, Session service provider.
$app->register(\Illuminate\Cookie\CookieServiceProvider::class);
$app->register(\Illuminate\Session\SessionServiceProvider::class);

// Set middleware.
$app->middleware([
    \Illuminate\Cookie\Middleware\EncryptCookies::class,
    \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
    \Illuminate\Session\Middleware\StartSession::class,
    \Illuminate\View\Middleware\ShareErrorsFromSession::class,
]);
```

## How to use
The helper currently provided is as follows.

I will do the same operation as Laravel 's same name helper.

- **abort_if**
- **abort_unless**
- **action**
- **app_path**
- **asset**
- **auth**
- **back**
- **bcrypt**
- **cache**
- **cookie**
- **csrf_field**
- **csrf_token**
- **logger**
- **method_field**
- **mix**
- **old**
- **policy**
- **public_path**
- **report**
- **session**
- **validator**

In addition, we provide our own helper as below.

- **app_with**:
    An app () compatible helper corresponding to makeWith call.
    illuminate/container: From 5.4, you can not pass $parameters to make, instead makeWith prepared,
    By using app_with, make can be done by passing parameters that ask Lumen, illuminate / container version.

- **redirect_with_session**:
    Since the redirect helper from Lumen 5.2 onward does not take over the session, we provide redirect_with_session to inherit the session.
    However, it must be built in advance such as SessionServiceProvider and session must be enabled in Lumen.

    ```php
    return redirect_with_session(route('index'))
        ->withErrors($errors)
        ->withInput();
    ```

    By using redirect_with_session, you will be expecting withErrors, withInput etc.
    If you want to replace redirect with redirect_with_session you can replace it with bootstrap/app.php as follows.

    ```php
    // Define redirect first.
    function redirect($to = null, $status = 302, $headers = [], $secure = null) {
      return redirect_with_session($to, $status, $headers, $secure);
    }

    require_once __DIR__ . '/../vendor/autoload.php';
    ```

repository: cosmicvelocity/lumen-helpers

repo_name: cosmicvelocity/lumen-helpers


text:
react-weback-hot-loader的空白项目
===
[参考链接](https://www.robinwieruch.de/minimal-react-webpack-babel-setup/#react-project-setup)
[参考项目](https://github.com/rwieruch/minimal-react-webpack-babel-setup)

react,webpack都是使用当前最新版本
react 16.x
webpack 4.x
webpack-cli 3.x

- npm init -y
- mkdir -p dist src
- touch dist/index.html src/index.js webpack.config.js .babelrc
- 安装webpack,webpack-dev-server,webapck-cli
    ```
    cnpm install --save-dev webpack webpack-dev-server webpack-cli
    ```
- 安装babel相关的依赖
    ```
    cnpm install --save-dev babel-core babel-loader babel-preset-env babel-preset-react babel-preset-stage-2
    ```
- 安装react, react-dom
    ```
    cnpm install --save react react-dom
    ```
- 安装ract-hot-loader
    ```
    cnpm install --save-dev react-hot-loader
    ```
- 安装style-loader, css-loader, less, less-loader
    ```
    cnpm install --save-dev style-loader css-loader less less-loader
    ```
`.babelrc`
```json
{
    "presets": [
        "env",
        "react",
        "stage-2"
    ]
}
```

`package.json`
```
...,
"scripts" {
    ...,
    "start": "webpack-dev-server --config ./webpack.config.js --mode development",
    ,,,
}
...
```

`webpack.config.js`
```
const webpack = require('webpack');

module.exports = {
    entry: [
        'react-hot-loader/patch',
        './src/index.js'
    ],
    output: {
        path: __dirname + '/dist',
        filename: 'bundle.js',
        publicPath: '/'
    },
    devServer: {
        contentBase: './dist',
        hot: true
    },
    module: {
        rules: [
            {
                test: /\.(js|jsx)$/,
                exclude: /node_modules/,
                use: ['babel-loader']
            }
        ]
    },
    resolve: {
        extensions: ['*', '.js', '.jsx']
    },
    plugins: [
        new webpack.HotModuleReplacementPlugin()
    ]
}
```

`dist/index.html`
```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="app">
        hello react, hello webpack.
    </div>
    <script src="/bundle.js"></script>
</body>
</html>
```

`src/index.js`
```js
import React from 'react';
import ReactDom from 'react-dom';

ReactDom.render(
    <div>hello react, hello webpack</div>,
    document.getElementById('app')
);

module.hot.accept();
```

# 错误处理

在运行过程中报错

```log
ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve './decode' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.0.2.1@querystring-es3'
<EMAIL_ADDRESS>3:33-52
<EMAIL_ADDRESS> @ ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve './encode' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.0.2.1@querystring-es3'
<EMAIL_ADDRESS>4:37-56
<EMAIL_ADDRESS> @ ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080
Module not found: Error: Can't resolve './overlay' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.3.1.4@webpack-dev-server/client'
 @ ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 10:14-34
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080
Module not found: Error: Can't resolve './socket' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.3.1.4@webpack-dev-server/client'
 @ ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 9:13-32
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve './util' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.0.11.0@url'
<EMAIL_ADDRESS>25:11-28
 @ ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve 'fbjs/lib/ExecutionEnvironment' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.16.4.1@react-dom/cjs'
<EMAIL_ADDRESS>21:27-67
<EMAIL_ADDRESS> @ ./src/index.js
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve 'fbjs/lib/camelizeStyleName' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.16.4.1@react-dom/cjs'
<EMAIL_ADDRESS>30:24-61
<EMAIL_ADDRESS> @ ./src/index.js
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve 'fbjs/lib/containsNode' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.16.4.1@react-dom/cjs'
<EMAIL_ADDRESS>27:19-51
<EMAIL_ADDRESS> @ ./src/index.js
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve 'fbjs/lib/emptyFunction' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.16.4.1@react-dom/cjs'
<EMAIL_ADDRESS>23:20-53
<EMAIL_ADDRESS> @ ./src/index.js
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve 'fbjs/lib/emptyFunction' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.16.4.1@react/cjs'
<EMAIL_ADDRESS>22:20-53
<EMAIL_ADDRESS> @ ./src/index.js
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve 'fbjs/lib/emptyObject' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.16.4.1@react-dom/cjs'
<EMAIL_ADDRESS>28:18-49
<EMAIL_ADDRESS> @ ./src/index.js
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve 'fbjs/lib/emptyObject' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.16.4.1@react/cjs'
<EMAIL_ADDRESS>20:18-49
<EMAIL_ADDRESS> @ ./src/index.js
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve 'fbjs/lib/getActiveElement' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.16.4.1@react-dom/cjs'
<EMAIL_ADDRESS>25:23-59
<EMAIL_ADDRESS> @ ./src/index.js
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve 'fbjs/lib/hyphenateStyleName' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.16.4.1@react-dom/cjs'
<EMAIL_ADDRESS>29:25-63
<EMAIL_ADDRESS> @ ./src/index.js
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve 'fbjs/lib/invariant' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.16.4.1@react-dom/cjs'
<EMAIL_ADDRESS>18:16-45
<EMAIL_ADDRESS> @ ./src/index.js
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve 'fbjs/lib/invariant' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.16.4.1@react/cjs'
<EMAIL_ADDRESS>19:16-45
<EMAIL_ADDRESS> @ ./src/index.js
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve 'fbjs/lib/shallowEqual' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.16.4.1@react-dom/cjs'
<EMAIL_ADDRESS>26:19-51
<EMAIL_ADDRESS> @ ./src/index.js
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve 'fbjs/lib/warning' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.16.4.1@react-dom/cjs'
<EMAIL_ADDRESS>20:14-41
<EMAIL_ADDRESS> @ ./src/index.js
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve 'fbjs/lib/warning' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.16.4.1@react/cjs'
<EMAIL_ADDRESS>21:14-41
<EMAIL_ADDRESS> @ ./src/index.js
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080
Module not found: Error: Can't resolve 'loglevel' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.3.1.4@webpack-dev-server/client'
 @ ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 8:10-29
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve 'object-assign' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.16.4.1@react-dom/cjs'
<EMAIL_ADDRESS>22:14-38
<EMAIL_ADDRESS> @ ./src/index.js
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve 'object-assign' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.16.4.1@react/cjs'
<EMAIL_ADDRESS>18:14-38
<EMAIL_ADDRESS> @ ./src/index.js
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve 'prop-types/checkPropTypes' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.16.4.1@react-dom/cjs'
<EMAIL_ADDRESS>24:21-57
<EMAIL_ADDRESS> @ ./src/index.js
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in<EMAIL_ADDRESS>Module not found: Error: Can't resolve 'prop-types/checkPropTypes' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.16.4.1@react/cjs'
<EMAIL_ADDRESS>23:21-57
<EMAIL_ADDRESS> @ ./src/index.js
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js
Module not found: Error: Can't resolve 'react-hot-loader/patch' in '/Users/tuyu/learn/react-webpack-demo'
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js +2

ERROR in ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080
Module not found: Error: Can't resolve 'strip-ansi' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.3.1.4@webpack-dev-server/client'
 @ ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 7:16-37
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js

ERROR in multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js
Module not found: Error: Can't resolve 'webpack/hot/dev-server' in '/Users/tuyu/learn/react-webpack-demo'
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js +1

ERROR in ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080
Module not found: Error: Can't resolve 'webpack/hot/emitter' in '/Users/tuyu/learn/react-webpack-demo/node_modules/.3.1.4@webpack-dev-server/client'
 @ ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 225:21-51
 @ multi ./node_modules/.3.1.4@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server react-hot-loader/patch ./src/index.js
ℹ ｢wdm｣: Failed to compile.
```
原因：webpack.config.js文件中extensions属性的值写错，即把'.js'和'.jsx'写做'js'和'jsx'少些了一个点号

2. 错误把node_modules文件夹里的内容也加入了git版本控制
删除.git文件，重新初始化.git文件，编写.gitignore文件后即可

3. pakage.json文件是一个json文件，如果属性之间少写了逗号，会报错误，比如：
```
SyntaxError: Unexpected string in JSON at position 460 (file: /Users/tuyu/test/react-webpack-hot-loader/package.json)
    at JSON.parse (<anonymous>)
    at Object.readJSON (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/utils.js:21:17)
    at readJSON.next (<anonymous>)
    at onFulfilled (/usr/local/lib/node_modules/cnpm/node_modules/co/index.js:65:19)
    at <anonymous>
```

repository: scutuyu/react-webpack-hot-loader

repo_name: scutuyu/react-webpack-hot-loader


text:
## Countdown using React

![Example screenshot](./screenshot.png)

## Features

- Navigation and usage with keyboard only
- Set countdown as milliseconds
- Configurable output (Years, Months, Days, Hours, Minutes)
- Saving countdown in browser storage (you can close browser without losing countdown)
- Countdown continue during closed browser (wow, can you imagine about this feature?)

repository: Sovgut/PF-Countdown-timer

repo_name: Sovgut/PF-Countdown-timer


text:
The real test in performance is showing a chart with a lot of data points and more than a few indicators.  As an example, let us work with MSFT from 1986-03-13 till 2015-06-05

That is more than 7000 one day periods, how can all that fit into one screen? Although technically it can be done there are a few problems

1. Every time you zoom/pan a chart with that many data points it just does not work. Browsers do not have the power to recalculate the scales for the new domain and appear responsive.
1. Even with cross hair and tool tip you could see the lag

Fortunately seeing end of day data over 30 years on a single chart is not really useful. React stockcharts has sane defaults to show 2 data point per pixel width.

Let us see all this in action for MSFT 1986-03-13 till 2015-03-26


text:
---
title: 'Assignment 2: Test a Basic Linear Regression Model'
date: '2016-09-10 18:40:00 -0300'
categories:
  - Regression Modeling Practice
tags:
  - Regression Modeling Practice
published: true
---
This is the second assignment for the regression modeling practice course, third from a series of five courses from Data Analysis and Interpretation ministered from Wesleyan University.
The previous content you can see [here](https://yan-duarte.github.io/tags/).

In this assignment, we have to Test a Basic Linear Regression Model with our data.

To do that, one management with the data must be done. As both explanatory and response variable are quantitative the only modification to do is to center in the mean the explanatory variable by subtracting the mean from the data values, then the value 0 will be the mean. (The mean value of the explanatory variable is 76.2383942414).

The complete program for this assignment can be download [here](https://yan-duarte.github.io/archives/rmp-assignment2.py) and the dataset [here](https://yan-duarte.github.io/archives/separatedData.csv).

## **Test a Basic Linear Regression Model**

```python
import pandas
import statsmodels.api as sm
import statsmodels.formula.api as smf
import seaborn
import matplotlib.pyplot as plt
import statistics

# bug fix for display formats to avoid run time errors
pandas.set_option('display.float_format', lambda x:'%.2f'%x)

# Import the data set to memory
data = pandas.read_csv("separatedData.csv", low_memory = False)

# Change data type among variables to numeric
data["breastCancer100th"] = data["breastCancer100th"].convert_objects(convert_numeric=True)
data["meanSugarPerson"]   = data["meanSugarPerson"].convert_objects(convert_numeric=True)

# Create a subData with only the variables breastCancer100th, meanSugarPerson, meanFoodPerson, meanCholesterol
sub1 = data[['breastCancer100th','meanSugarPerson']]

#If you have a quantitative explanatory variable, center it so that the mean = 0 (or really close to 0) by subtracting the mean, and then calculate the mean to check your centering.
mean = statistics.mean(sub1['meanSugarPerson'])
sub1['meanSugarPerson'] = sub1['meanSugarPerson'] - mean

# BASIC LINEAR REGRESSION
scat1 = seaborn.regplot(x="meanSugarPerson", y="breastCancer100th", scatter=True, data=sub1)
plt.xlabel('Mean of the sugar consumption between 1961 and 2002.')
plt.ylabel('Incidence of breast cancer in 100,000 female residents during the 2002 year.')
plt.title('Scatterplot for the association between the incidence of breast cancer and the sugar consumption.')
plt.show()

print(scat1)

print ("OLS regression model for the association between incidence of breast cancer and the sugar consumption")
reg1 = smf.ols('breastCancer100th ~ meanSugarPerson', data=sub1).fit()
print (reg1.summary())
```

```
OLS regression model for the association between incidence of breast cancer and the sugar consumption
                            OLS Regression Results
==============================================================================
Dep. Variable:      breastCancer100th   R-squared:                       0.410
Model:                            OLS   Adj. R-squared:                  0.406
Method:                 Least Squares   F-statistic:                     88.34
Date:                Sat, 10 Sep 2016   Prob (F-statistic):           2.99e-16
Time:                        19:28:53   Log-Likelihood:                -560.18
No. Observations:                 129   AIC:                             1124.
Df Residuals:                     127   BIC:                             1130.
Df Model:                           1
Covariance Type:            nonrobust
===================================================================================
                      coef    std err          t      P>|t|      [95.0% Conf. Int.]
-----------------------------------------------------------------------------------
Intercept          37.9876      1.651     23.007      0.000        34.720    41.255
meanSugarPerson     0.3667      0.039      9.399      0.000         0.289     0.444
==============================================================================
Omnibus:                        3.414   Durbin-Watson:                   1.778
Prob(Omnibus):                  0.181   Jarque-Bera (JB):                3.052
Skew:                           0.291   Prob(JB):                        0.217
Kurtosis:                       2.522   Cond. No.                         42.3
==============================================================================

Warnings:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.
```

![Figure 1]({{site.baseurl}}/yan-duarte.github.io/images/rmp-assignments/rmp-ass2-fig1.png)

We can see in the OLS Regression Results that the p-value is considerably less than our alpha level of 0.05 wich tells us that we can reject the null hypothesis and concludes that the sugar consumption is significantly associated with the incidence of breast cancer cases.

The coefficient for sugar consumption is 0.3667 and the intercept is 37.9876. This means that the equation for the best line of this graph is:

  - **breastCancer100th = 37.9876 + 0.3667 * meanSugarPerson**

The column **P>\| t \|** give us the p-value for our explanatory variables, association with the response variable. This p-value is 0.000 wich means that it is really small confirming the significance associated with the variables.

Other information that OLS Regression Results give to us is the R-square. This value can be interpreted in the following way: If we know the sugar consumption grams per day of a woman we can predict 41% of the variability we will see in the incidence of breast cancer cases.


text:
# Issue on installation on Ubuntu 18.04, remove -O3 compiler optimization flag in CMakeLists.txt of gpd and gpd_ros
https://github.com/atenpas/gpd/issues/88#issuecomment-610466113

rosrun pcl_ros pcd_to_pointcloud Scene_1.pcd 0.1

rostopic echo /cloud_pcd | rostopic pub /camera/depth/points sensor_msgs/PointCloud2

# error while loading shared libraries: libpcl_features.so.1.9: cannot open shared object file: No such file or director
find library location; here its /usr/local/lib; then

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
check with: echo $LD_LIBRARY_PATH
sudo ldconfig


text:
# Swap Global Property Values

Set temporary variables in the `global` namespace and restore them once complete.

Don't worry about leaving a messy trail behind you.

## Usage

Assign new values to properties using `swap()`.

```js
import { swap } from 'swap-global'

swap('somePropertyName', 'someValue')
// will set value of `global.somePropertyName` to `someValue`
```
Can replace existing properties like `isNaN`

```js
swap('isNaN', 'someValue')
// will set value of `global.isNaN` and store default (or previously assigned) value in memory.
```
Can continuously update with new values and original (pre-swap) value will still be restored.

```js
swap('isNaN', 'someNewValue')
// will set new value of `global.isNaN` and keep original value in memory.
isNaN
// => 'someNewValue'
```

Check properties assigned using `pending()`.

```js
import { pending } from 'swap-global'

pending()
// returns all properties that have been swapped
// => ['somePropertyName', 'isNaN']
```

Check properties which had previous values using `inMemory()`.

```js
import { inMemory } from 'swap-global'

inMemory()
// returns all properties that are currently held in memory
// => ['isNaN']
```

Restore properties using `restore()`. Properties that did not have a value will be reverted to `undefined`.

```js
import { restore } from 'swap-global'

restore()
// all properties changed using `swap` will be reverted back to previous values.
// typeof('somePropertyName') === 'undefined'
// typeof('isNaN') === 'function'
```

## License

[MIT](LICENSE).

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

repository: TravisMullen/swap-global

repo_name: TravisMullen/swap-global


text:
# Verify2.js (DEPRECATED)
Is simple to use library for verifying form inputs on websites.

## Requirements
jQuery :(

## Installation guide
1) Copy verify2.js to your website (via script tag)
2) Add class __form-validate__ to your send button
3) Add attribute __novalidate__ to form tag _disables default browser validation_
4) Add __data-type__ to inputs (example: < input name="email" data-type="email" >)
5) If you want input to be requiered, just add requiered attribute ( just like in standard browser validation )

## Standard input types
__Every regular expression can be changed__
* name (Name Surname , space required)
* email (standard email)
* phone (+123 123 123 123 , +123 is optional and spaces too)
* date (in format dd.mm.rrr)
* text (only a-z A-Z letters)
* number (only 0-9 numbers)

## How to add your own input types or change existing one?
1) Find array with regular expressions:
```javascript
var expressions = Array();
```
2) Add your own or change existing
3) Done!

## What does front-end validation mean?
That meas, this script runs in browser, so anyone can disable it. So make sure to validate your inputs also at back-end!


text:
Duckling VMT
============

Virtual orgnization Management Tool (组织通讯录)

Build
-----
The localdeps of vmt is not complete so that please install localdeps
of 'ddl' as well.

'mvn package' and get 'vmt.war'.

Setup
-----
1) Have tomcat ready.

2) In WEB-INF/classes/conf, copy 'vmt-TEMPLATE.properties' to
'vmt.properties' and edit the latter.

3) Create database in mysql and create tables with
'WEB-INF/classes/conf/vmt_schema-xxx.sql'.

4) Setup LDAP db according to 'WEB-INF/classes/conf/ldap/README-LDAP.

5) Setup memcached. (download & make & make install, '$memcached -d')

6) Setup rabbitmq. (apt-get rabbitmq-server, no more config if using
default account guest/guest)

7) 'vmt.properties' mentions ddl/clb, which can be set later. Of
course, umt must be ready.

8) Start tomcat and enjoy.

repository: ducklingcloud/vmt

repo_name: ducklingcloud/vmt


text:
# Lux AI Season 1 Specifications

For documentation on the API, see [this document](https://github.com/Lux-AI-Challenge/Lux-Design-2021/blob/master/kits/). To get started developing a bot, see our [Github](https://github.com/Lux-AI-Challenge/Lux-Design-2021)

## Background

The night is dark and full of terrors. Two teams must fight off the darkness, collect resources, and advance through the ages. Daytime finds a desperate rush to gather and build the resources that can carry you through the impending night. Plan and expand carefully -- any city that fails to produce enough light will be consumed by darkness.

## Environment

In the Lux AI Challenge Season 1, two competing teams control a team of [Units](#Units) and [CityTiles](#CityTile) that collect resources to fuel their Cities, with the main objective to own as many [CityTiles](#CityTiles) as possible at the end of the turn-based game. Both teams have complete information about the entire game state and will need to make use of that information to optimize resource collection, compete for scarce resources against the opponent, and build cities to gain points.

Each competitor must program their own agent in their language of choice. Each turn, your agent gets 3 seconds to submit their actions, excess time is not saved across turns. In each game, you are given a pool of 60 seconds that is tapped into each time you go over a turn's 3-second limit. Upon using up all 60 seconds and going over the 3-second limit, your agent freezes and can no longer submit additional actions.

The rest of the document will go through the key features of this game.

## The Map

The world of Lux is represented as a 2d grid. Coordinates increase east (right) and south (down). The map is always a square and can be 12, 16, 24, or 32 tiles long. The (0, 0) coordinate is at the top left.

![](https://raw.githubusercontent.com/Lux-AI-Challenge/Lux-Design-2021/master/assets/game_board.png)

The map has various features including [Resources](#Resources) (Wood, Coal, Uranium), [Units](#Units) ([Workers](#Workers), [Carts](#Carts)), [CityTiles](#CityTiles), and [Road](#Roads).

In order to prevent maps from favoring one player over another, it is guaranteed that maps are always symmetric by vertical or horizontal reflection.

Each player will start with a single [CityTile](#CityTiles) and a single worker on that [CityTile](#CityTiles)

## Resources

There are 3 kinds of resources: Wood, Coal, and Uranium (in order of increasing fuel efficiency). These resources are collected by workers, then dropped off once a worker moves on top of a [CityTile](#CityTiles) to then be converted into fuel for the city. Some resources require research points before they are possible to collect.

Wood in particular can regrow. Each turn, every wood tile's wood amount increases by 2.5% of its current wood amount rounded up. Wood tiles that have been depleted will not regrow. Only wood tiles with less than 500 wood will regrow.

   Resource Type

   Research Points
Pre-requisite

   Fuel Value
per Unit

   Units Collected
per Turn

   Wood

   0

   1

   20

   Coal

   50

   10

   5

   Uranium

   200

   40

   2

### Collection Mechanics

At the end of each turn, [Workers](#Workers) automatically receive resources from all adjacent (North, East, South, West, or Center) resource tiles they can collect resources from according to the current symmetric formula:

- Iterating over uranium, coal, then wood resources:
  - Each unit makes resource collection requests to collect an even number of resources from each adjacent tile of the current iterated resource such that the collected amount takes the unit's cargo above capacity. E.g. worker with 60 wood adjacent to 3 wood tiles asks for 14 from each, receives 40 wood, and wastes 2.
  - All tiles of the current iterated resource then try to fulfill requests, if they can't they make sure all unfulfilled requests get an equal amount, the leftover is wasted. E.g. if 4 workers are mining a tile of 25 wood, but one of them is only asking for 5 while the others are asking for 20 wood each, then first all workers get 5 wood each, leaving 5 wood left over for 3 more workers with space left. This can evenly be distributed by giving 1 wood each to the last 3 workers, leaving 2 wood left that is then wasted.

[Workers](#Workers) cannot mine while on [CityTiles](#CityTiles). Instead, if there is at least one Worker on a CityTile, that CityTile will automatically collect adjacent resources at the same rate as a worker each turn and directly convert it all to fuel. The collection mechanic for a CityTile is the same as a worker and you can treat a CityTile as an individual Worker collecting resources.

## Actions

Units and CityTiles can perform actions each turn given certain conditions. In general, all actions are simultaneously applied and are validated against the state of the game at the start of a turn. The next few sections describe the Units and CityTiles in detail.

## CityTiles

A CityTile is a building that takes up one tile of space. Adjacent CityTiles collectively form a City. Each CityTile can perform a single action provided the CityTile has a [Cooldown](#Cooldown) < 1.

Actions

- Build Worker - Build [Worker](#Workers) unit on top of this CityTile (cannot build a worker if the current number of owned workers + carts equals the number of owned CityTiles)
- Build Cart - Build [Carts](#Carts) unit on top of this CityTile (cannot build a cart if the current number of owned workers + carts equals the number of owned CityTiles)
- Research - Increase your team’s Research Points by 1

## Units

There are two unit types, [Workers](#Workers), and [Carts](#Carts). Every unit can perform a single action once they have a [Cooldown](#Cooldown) < 1.

All units can choose the move action and move in any of 5 directions, North, East, South, West, Center. Moreover, all units can carry raw resources gained from automatic mining or resource transfer. [Workers](#Workers) are capped at 100 units of resources and [Carts](#Carts) are capped at 2000 units of resources.

Whenever a unit moves on top of a friendly [CityTile](#CityTiles), the City that [CityTile](#CityTiles) forms converts all carried resources into fuel.

There can be at most one unit on tiles without a [CityTile](#CityTiles). Moreover, units cannot move on top of the opposing team’s [CityTiles](#CityTiles). However, units can stack on top of each other on a friendly [CityTile](#CityTiles).

If two units attempt to move to the same tile that is not a [CityTile](#CityTiles), this is considered a collision, and the move action is canceled.

### Workers

Actions

- Move - Move the unit in one of 5 directions, North, East, South, West, Center.
- Pillage - Reduce the [Road](#Roads) level of the tile the unit is on by 0.5
- Transfer - Send any amount of a single resource-type from a unit's cargo to another (start-of-turn) adjacent Unit, up to the latter's cargo capacity. Excess is returned to the original unit.
- Build [CityTile](#CityTiles) - Build a [CityTile](#CityTiles) right under this worker provided the worker has 100 total resources of any type in their cargo (full cargo) and the tile is empty. If building is successful, all carried resources are consumed and a new [CityTile](#CityTiles) is built with 0 starting resources.

### Carts

Actions

- Move - Move the unit in one of 5 directions, North, East, South, West, Center.
- Transfer - Send any amount of a single resource-type from a unit's cargo to another (start-of-turn) adjacent Unit, up to the latter's cargo capacity. Excess is returned to the original unit.

## Cooldown

[CityTiles](#CityTiles), [Workers](#Workers) and [Carts](#Carts) all have a cooldown mechanic after each action. [Units](#Units) and [CityTiles](#CityTiles) can only perform an action when they have < 1 Cooldown.

At the **end of each turn**, after [Road](#roads) have been built and pillaged, each unit's Cooldown decreases by 1 and further decreases by the level of the [Road](#Roads) the unit is on at the end of the turn. CityTiles are not affected by road levels and cooldown always decreases by 1. The minimum Cooldown is 0.

After an action is performed, the unit’s Cooldown will increase by a Base Cooldown.

   Unit Type

   Base Cooldown

   CityTile

   10

   Worker

   2

   Cart

   3

## Roads

As [Carts](#Carts) travel across the map, they start to create roads that allow all [Units](#Units) to move faster (see [Cooldown](#Cooldown)). At the end of each turn, [Cart](#Carts) will upgrade the road level of the tile it ends on by 0.75. The higher the road level, the faster [Units](#Units) can move and perform actions. All tiles start with a road level of 0 and are capped at 6.

Moreover, [CityTiles](#CityTiles) automatically have the max road level of 6.

Roads can also be destroyed by [Workers](#Workers) via the pillage action which reduces road level by 0.5 each time.

If a City is consumed by darkness, the road level of all tiles in the City's CityTiles will go back to 0.

## Day/Night Cycle

The Day/Night cycle consists of a 40 turn cycle, the first 30 turns being day turns, the last 10 being night turns.

During the night, [Units](#Units) and Cities need to produce light to survive. Each turn of night, each [Unit](#Units) and [CityTile](#CityTiles) will consume an amount of fuel, see table below for rates. [Units](#Units) in particular will use their carried resources to produce light whereas [CityTiles](#CityTiles) will use their fuel to produce light.

[Workers](#Workers) and [Carts](#Carts) will only need to consume resources if they are not on a [CityTile](#CityTiles). When outside the City, Workers and [Carts](#Carts) must consume whole units of resources to satisfy their night needs, e.g. if a worker carries 1 wood and 5 uranium on them, they will consume a full wood for 1 fuel, then a full unit of uranium to fulfill the last 3 fuel requirements, wasting 37 fuel. [Units](#Units) will always consume the least efficient resources first.

Lastly, at night, [Units](#Units) gain 2x more Base [Cooldown](#Cooldown)

Should any [Unit](#Units) during the night run out of fuel, they will be removed from the game and disappear into the night forever. Should a City run out of fuel, however, the entire City with all of the [CityTiles](#CityTiles) it owns will fall into darkness and be removed from the game.

   Unit

   Fuel Burn in City

   Fuel Burn Outside City

   CityTile

   23 - 5 * number of adjacent friendly CityTiles

   N/A

   Cart

   0

   10

   Worker

   0

   4

## Game Resolution order

To help avoid confusion over smaller details of how each turn is resolved, we provide the game resolution order here and how actions are applied.

Actions in the game are first all validated against the current game state to see if they are valid. Then the actions, along with game events, are resolved in the following order and simultaneously within each step

1. [CityTile](#CityTiles) actions along with increased cooldown
2. [Unit](#Units) actions along with increased cooldown
3. [Roads](#Roads) are created
4. [Resource](#Resources) collection
5. [Resource](#Resources) drops on [CityTiles](#CityTiles)
6. If night time, make [Units](#Units) consume resources and [CityTiles](#CityTiles) consume fuel
7. Regrow wood tiles that are not depleted to 0
8. [Cooldowns](#Cooldown) are handled / computed for each unit and CityTile

The only exception to the validation criteria is that units may move smoothly between spaces, meaning if two units are adjacent, they can swap places in one turn.

Otherwise, actions such as one unit building a CityTile, then another unit moving on top of the new CityTile, are not allowed as the current state does not have this newly built city and units cannot move on top of other units outside of CityTiles.

## Win Conditions

After 360 turns the winner is whichever team has the most [CityTiles](#CityTiles) on the map. If that is a tie, then whichever team has the most units owned on the board wins. If still a tie, the game is marked as a tie.

A game may end early if a team no longer has any more [Units](#Units) or [CityTiles](#CityTiles). Then the other team wins.

## Note on Game Rule Changes
(This is also in the [competition rules](https://www.kaggle.com/c/lux-ai-2021/rules))

Our team at the Lux AI Challenge reserves the right to make any changes on game rules during the course of the competition. We will work to keep our decision-making as transparent as possible and avoid making changes late on in the competition.

gha_language: Jupyter Notebook


text:
---
name: Alexis Kelley
startdate: [2021-06-14]
enddate: [2022-07-31]
image: /static/img/members/kelley.jpg #365 x 365 pixels, 72 dpi
altimage: /static/img/members/kelley_pb.jpg #365 x 365 pixels, 72 dpi
position: "[PROPEL](https://propel.ucsf.edu) Scholar"
subsequent: Graduate Student - Johns Hopkins University
pronouns: she/her/hers
email: alexiskelley1207 (at) gmail.com #Preferred public email address
scholar:
website:
UCSF:
twitter: Penguin_Chika
linkedin: alexis-kelley-469881141
github: akelley1207
orcid:
description: "Alexis graduated from UC Merced with a degree in Applied Mathematics with emphasis in Computational Biology. During undergrad, she studied prostate cancer heterogenity and used predictive modeling to study cells that undergo Intermittent Androgen Suppression Therapy with [Dr. Erica Rutter](https://www.ucmerced.edu/content/erica-rutter) at UC Merced. Alexis has also completed other projects in prostate cancer and antigen-antibody interactions at Lawrence Livermore National Laboratory and the University of Southern California.

In the Fraser lab, Alexis will use enzymology and structural biology to identify PROSS mutants of mouse Acidic Mammalian Chitinase (mAMCase) that improve expression and solubility in bacteria, and enzyme activity against complex chitin substrates.

When not in the lab, Alexis enjoys playing jazz trumpet, exploring new places, and relaxing at home."
---

gha_language: HTML


text:
# SendBack API

This repository houses the core API for [SendBack.io](http://sendback.io)

## Contributing

Want to raise an issue or pull request? Do give our [Contributing page](https://github.com/abinavseelan/sendback-api/blob/master/CONTRIBUTING.md) a read. 🤓

### Getting started

_Note: This has been developed on node 9.x. Please develop your feature and/or bugfix with a node version that is 9.0 and above_ 😄

1. Clone repository
2. Run `npm install` to install all the dependencies
3.  Please make sure that your code conforms to the linting rules. We use [Airbnb's linting rules](https://github.com/airbnb/javascript) in this project.

To lint your code manually you can run

```bash
$ npm run lint
```

This will both lint and _try_ to fix your linting errors.

_Note: The linter may fix some lint issues during the pre-commit phase. Please make sure to do a `git status` before pushing to Github to make sure that all your changes are pushed!_

There are also some unit tests for the APIs in the `/test` folder. When making changes to the core functionality, make sure the test pass, and are updated if the changes requires it.

The pre-commit hook runs the tests are well.

If you want to run the tests manually you can run

```bash
$ npm run test
```

Our CI builds will test to see
- if the packages in package.json are valid
- if the code is formatted correctly
- if the tests pass

Please make sure everything that is run by pre-commit hook passes locally. 🙂

## Updating docs

There is a separate [repo for the docs](https://github.com/abinavseelan/sendback-website). If you're adding a new feature or changing existing functionality, please do raise a PR to our docs repository as well! 🙇

repository: abinavseelan/sendback-api

repo_name: abinavseelan/sendback-api