text:
# What Does It Mean to Be an Entrepreneur?

Entrepreneur means "undertaker" - one who undertakes a major project
- reform or revolutionize the pattern of production by exploiting an invertion or an untried technological possibility
- The discovery, evaluation and exploitation of opportunities

Creativity + Leadership = Innovation

Innovation + Leadership = Entrepreneurship

Entrepreneurial Mindset
- Creative problem solver
- Market aware
- Action-oriented
- Focused on value creation
- Tolerance for risk and uncertainty
- Willing and able to lead others
- Able to listen and absorb new information
- Able to learn from failures

# Where Do Entrepreneurial Ideas Come From?
- Daily life, work experience
- Emerging trend
- Specific market gap
- Drive to help others in new ways
- Special skill or expertise

Triggering Events
- Job loss
- Job dissatisfaction
- Education
- Lifestyle changes
- Frustration with business or personal challenges

Design Thinking
1. Define the problem
2. Ideate many solutions
3. Refine and test
4. Pick the winner, commit resources, execute

B2C Value Propositions

In general, Business-to-Consumer (B2C) value propositions should
1. Help customers save money
2. Help customers save time
3. Help customers enhance their status in some way
4. Help customers gain personal fulfillment

In general, Business-to-Business value propositions should
1. Help customers make more money
2. Help customers save money
3. Help customers save time
4. Help customers reduce a risk that threatens their business in some way

# Pitching Your Idea

1. Get your audience to listen
2.  Get them to believe
4. Get them to take action

Questions
- Why are they interested?
- What are their "hot buttons"?
- What objections are they likely to raise?

Why should they support you?
- To make money
- To have fun
- To make the world a better place

Describe the problem you're solving
- Who has the problem?
- Why does it matter?
- Why did you choose to try to solve it?

> We help X do Y by doing Z

- Why will customers buy your product
- What pain are you adressing?
- What gain are you enabling?
- How are you better/faster/cheaper/easier?

Market Size
- Total available market
- Serviceable Available Market
- Serviceable Obtainable Market

Customers
- Target customers
- Early adopters
    - They know they have the problem
    - They have the money
    - They have tried to solve the problem before

How will you reach your customers?
- Direct/indirect
- Online/offline
- Do you need a sales force?
- What sort of relationship do you need?
- How will you secure your early adopter customers?
- How will you scale?

Revenue Model
- Recurring vs non-recurring revenue
- Two-sided markets
- Third-party payers
- Pricing strategy
- Lifetime value of a customer

Financial Projections
- Top-down vs Bottom-up revenue forecasting
- Growth and profit drivers
- Customer acquisition cost
- Cash-to-cash cycle
- Overhead costs

Customers
- What are your customers doing now?
- Existing vs. potential competitors
- What are your competitive advantages
- Are they sustainable?

Establishing Credibility
- What have you achieved so far?
    - Technology
    - Customers
    - Revenue
    - Profits

Conclusion and Call to Action
- What will your audience remember?
- Remind them why it's important
- Tell the conclusion to the story
- Call to action
  - Follow up meeting
  - Introduction
  - Feedback

url: https://raw.githubusercontent.com/tohhongxiang123/Notes/1a4f32a9e0f38c08a8879aa0ef25da7e8e8ad330/content/Innovation - From Creativity to Entrepreneurship/Entrepreneurship I - Laying the Foundation/Module 1.md

filename: Module 1.md


text:
---
id: best-practices
title: "Best Practices"
---

This guide should help you to make sure you are following our best practices and writing tests that are more resilient.

## Testing philosophy

### Test user-visible behavior

Automated tests should verify that the application code works for the end users, and avoid relying on implementation details such as things which users will not typically use, see, or even know about such as the name of a function, whether something is an array, or the CSS class of some element. The end user will see or interact with what is rendered on the page, so your test should typically only see/interact with the same rendered output.

### Make tests as isolated as possible

Each test should be completely isolated from another test and should run independently with its own local storage, session storage, data, cookies etc. [Test isolation](./browser-contexts.md) improves reproducibility, makes debugging easier and prevents cascading test failures.

In order to avoid repetition for a particular part of your test you can use [before and after hooks](/api/class-test.md). Within your test file add a before hook to run a part of your test before each test such as going to a particular URL or logging in to a part of your app. This keeps your tests isolated as no test relies on another. However it is also ok to have a little duplication when tests are simple enough especially if it keeps your tests clearer and easier to read and maintain.

```js
import { test } from '@playwright/test';

test.beforeEach(async ({ page }) => {
  // Runs before each test and signs in each page.
  await page.goto('https://github.com/login');
  await page.getByLabel('Username or email address').fill('username');
  await page.getByLabel('Password').fill('password');
  await page.getByRole('button', { name: 'Sign in' }).click();
});

test('first', async ({ page }) => {
  // page is signed in.
});

test('second', async ({ page }) => {
  // page is signed in.
});
```

You can also reuse the signed-in state in the tests with [setup project](./auth.md#basic-shared-account-in-all-tests). That way you can log in only once and then skip the log in step for all of the tests.

### Avoid testing third-party dependencies

Only test what you control. Don't try to test links to external sites or third party servers that you do not control. Not only is it time consuming and can slow down your tests but also you can not control the content of the page you are linking to, or if there are cookie banners or overlay pages or anything else that might cause your test to fail.

Instead, use the [Playwright Network API](/network.md#handle-requests) and guarantee the response needed.

```js
await page.route('**/api/fetch_data_third_party_dependency', route => route.fulfill({
  status: 200,
  body: testData,
}));
await page.goto('https://example.com');
```

### Testing with a database

If working with a database then make sure you control the data. Test against a staging environment and make sure it doesn't change. For visual regression tests make sure the operating system and browser versions are the same.

## Best Practices

### Use locators

In order to write end to end tests we need to first find elements on the webpage. We can do this by using Playwright's built in [locators](./locators.md). Locators come with auto waiting and retry-ability. Auto waiting means that Playwright performs a range of actionability checks on the elements, such as ensuring the element is visible and enabled before it performs the click. To make tests resilient, we recommend prioritizing user-facing attributes and explicit contracts.

```js
// 👍
page.getByRole('button', { name: 'submit' });
```

#### Use chaining and filtering

Locators can be [chained](./locators.md#matching-inside-a-locator) to narrow down the search to a particular part of the page.

```js
const product = page.getByRole('listitem').filter({ hasText: 'Product 2' });
```

You can also [filter locators](./locators.md#filtering-locators) by text or by another locator.

```js
await page
    .getByRole('listitem')
    .filter({ hasText: 'Product 2' })
    .getByRole('button', { name: 'Add to cart' })
    .click();
```

#### Prefer user-facing attributes to XPath or CSS selectors

Your DOM can easily change so having your tests depend on your DOM structure can lead to failing tests. For example consider selecting this button by its CSS classes. Should the designer change something then the class might change breaking your test.

```js
// 👎
page.locator('button.buttonIcon.episode-actions-later');
```

Use locators that are resilient to changes in the DOM.

```js
// 👍
page.getByRole('button', { name: 'submit' });
```
### Generate locators

Playwright has a [test generator](./codegen.md) that can generate tests and pick locators for you. It will look at your page and figure out the best locator, prioritizing role, text and test id locators. If the generator finds multiple elements matching the locator, it will improve the locator to make it resilient and uniquely identify the target element, so you don't have to worry about failing tests due to locators.

#### Use `codegen` to generate locators

To pick a locator run the `codegen` command followed by the URL that you would like to pick a locator from.

```bash
npx playwright codegen playwright.dev
```

This will open a new browser window as well as the Playwright inspector. To pick a locator first click on the 'Record' button to stop the recording. By default when you run the `codegen` command it will start a new recording. Once you stop the recording the 'Pick Locator' button will be available to click.

You can then hover over any element on your page in the browser window and see the locator highlighted below your cursor. Clicking on an element will add the locator into the Playwright inspector. You can either copy the locator and paste into your test file or continue to explore the locator by editing it in the Playwright Inspector, for example by modifying the text, and seeing the results in the browser window.

#### Use the VS Code extension to generate locators

You can also use the [VS Code Extension](./getting-started-vscode.md) to generate locators as well as record a test. The VS Code extension also gives you a great developer experience when writing, running, and debugging tests.

### Use web first assertions

Assertions are a way to verify that the expected result and the actual result matched or not. By using [web first assertions](./test-assertions.md) Playwright will wait until the expected condition is met. For example, when testing an alert message, a test would click a button that makes a message appear and check that the alert message is there. If the alert message takes half a second to appear, assertions such as `toBeVisible()` will wait and retry if needed.

```js
// 👍
await expect(page.getByText('welcome')).toBeVisible();

// 👎
expect(await page.getByText('welcome').isVisible()).toBe(true);
```

#### Don't use manual assertions

Don't use manual assertions that are not awaiting the expect. In the code below the await is inside the expect rather than before it. When using assertions such as `isVisible()` the test won't wait a single second, it will just check the locator is there and return immediately.

```js
// 👎
expect(await page.getByText('welcome').isVisible()).toBe(true);
```

Use web first assertions such as `toBeVisible()` instead.

```js
// 👍
await expect(page.getByText('welcome')).toBeVisible();
```

### Configure debugging

#### Local debugging

For local debugging we recommend you [debug your tests live in VSCode.](/getting-started-vscode.md#live-debugging) by installing the [VS Code extension](./getting-started-vscode.md). You can run tests in debug mode by right clicking on the line next to the test you want to run which will open a browser window and pause at where the breakpoint is set.

You can live debug your test by clicking or editing the locators in your test in VS Code which will highlight this locator in the browser window as well as show you any other matching locators found on the page.

You can also debug your tests with the Playwright inspector by running your tests with the `--debug` flag.

```bash
npx playwright test --debug
```

You can then step through your test, view actionability logs and edit the locator live and see it highlighted in the browser window. This will show you which locators match, how many of them there are.

To debug a specific test add the name of the test file and the line number of the test followed by the `--debug` flag.

```bash
npx playwright test example.spec.ts:9 --debug
```
#### Debugging on CI

For CI failures, use the Playwright [trace viewer](./trace-viewer.md) instead of videos and screenshots. The trace viewer gives you a full trace of your tests as a local Progressive Web App (PWA) that can easily be shared. With the trace viewer you can view the timeline, inspect DOM snapshots for each action using dev tools, view network requests and more.

Traces are configured in the Playwright config file and are set to run on CI on the first retry of a failed test. We don't recommend setting this to `on` so that traces are run on every test as it's very performance heavy. However you can run a trace locally when developing with the `--trace` flag.

```bash
npx playwright test --trace on
```
Once you run this command your traces will be recorded for each test and can be viewed directly from the HTML report.

```bash
npx playwright show-report
````

Traces can be opened by clicking on the icon next to the test or by opening each of the test reports and scrolling down to the traces section.

### Use Playwright's Tooling

Playwright comes with a range of tooling to help you write tests.
- The [VS Code extension](./getting-started-vscode.md) gives you a great developer experience when writing, running, and debugging tests.
- The [test generator](./codegen.md) can generate tests and pick locators for you.
- The [trace viewer](./trace-viewer.md) gives you a full trace of your tests as a local PWA that can easily be shared. With the trace viewer you can view the timeline, inspect DOM snapshots for each action, view network requests and more.
- [Typescript](./test-typescript) in Playwright works out of the box and gives you better IDE integrations. Your IDE will show you everything you can do and highlight when you do something wrong. No TypeScript experience is needed and it is not necessary for your code to be in TypeScript, all you need to do is create your tests with a `.ts` extension.

### Test across all browsers

Playwright makes it easy to test your site across all [browsers](./test-projects.md#configure-projects-for-multiple-browsers) no matter what platform you are on. Testing across all browsers ensures your app works for all users. In your config file you can set up projects adding the name and which browser or device to use.

```js title="playwright.config.ts"
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
  projects: [
    {
      name: 'chromium',
      use: { ...devices['Desktop Chrome'] },
    },
    {
      name: 'firefox',
      use: { ...devices['Desktop Firefox'] },
    },
    {
      name: 'webkit',
      use: { ...devices['Desktop Safari'] },
    },
  ],
});
```

### Keep your Playwright dependency up to date

By keeping your Playwright version up to date you will be able to test your app on the latest browser versions and catch failures before the latest browser version is released to the public.

```bash
npm install -D @playwright/test@latest
```
Check the [release notes](./release-notes.md) to see what the latest version is and what changes have been released.

You can see what version of Playwright you have by running the following command.

```bash
npx playwright --version
```

### Run tests on CI

Setup CI/CD and run your tests frequently. The more often you run your tests the better.  Playwright comes with a [GitHub actions workflow](/ci-intro.md) so that tests will run on CI for you with no setup required. Playwright can also be setup on the [CI environment](/ci.md) of your choice.

Use Linux when running your tests on CI as it is cheaper. Developers can use whatever environment when running locally but use linux on CI.

### Lint your tests

Linting the tests helps catching errors early. Use [`@typescript-eslint/no-floating-promises`](https://typescript-eslint.io/rules/no-floating-promises/) [ESLint](https://eslint.org) rule to make sure there are no missing awaits before the asynchronous calls to the Playwright API.

#### Use parallelism and sharding

Playwright runs tests in [parallel](./test-parallel.md) by default. Tests in a single file are run in order, in the same worker process. If you have many independent tests in a single file, you might want to run them in parallel

```js
import { test } from '@playwright/test';

test.describe.configure({ mode: 'parallel' });

test('runs in parallel 1', async ({ page }) => { /* ... */ });
test('runs in parallel 2', async ({ page }) => { /* ... */ });
```

Playwright can [shard](./test-parallel.md#shard-tests-between-multiple-machines) a test suite, so that it can be executed on multiple machines.

```bash
npx playwright test --shard=1/3
```

## Productivity tips

### Use Soft assertions

If your test fails, Playwright will give you an error message showing what part of the test failed which you can see either in VS Code, the terminal, the HTML report, or the trace viewer. However, you can also use [soft assertions](/test-assertions.md#soft-assertions). These do not immediately terminate the test execution, but rather compile and display a list of failed assertions once the test ended.

```js
// Make a few checks that will not stop the test when failed...
await expect.soft(page.getByTestId('status')).toHaveText('Success');

// ... and continue the test to check more things.
await page.getByRole('link', { name: 'next page' }).click();
```

repository: microsoft/playwright

branch_name: refs/heads/main

extension: md

gha_language: TypeScript

license_type: permissive

repo_name: microsoft/playwright


text:
# Clean Code

It is really a very simple concept but one that sparked more debates and controversies than anything else in Computer Science. If you have ever thought about Tabs versus Spaces, snake_case versus CamelCase, verbNoun variable nomenclature or nounVerb, using is with booleans, or right level of abstraction then you know what it means. However, it is just the beginning. It's there in mathematics too. Mathematicians G.H Hardy and Betrand Russell use the term `elegance` and `rigour` for mathematical beauty. The term itself `Clean Code` is sufficiently descriptive and intuitively sensible, yet to put it into practice is as hard as composing a sonata, writing an opus, sculpting David and painting [The Last Supper](https://en.wikipedia.org/wiki/The_Last_Supper_(Leonardo_da_Vinci)). So if you are new to this concept, begin with the following links to get a gist of it. You'll get an idea about the same and form an opinion.

In short Clean Code is -

- Easy to understand.

- Easy to modify.

- Easy to test.

- Works correctly

Also, **if you always remember that code is written to read (by humans)** and not *just* to be executed, you'll mostly be on the right track.

- #### Articles

  - [What is Clean Code and why should you care?](http://cvuorinen.net/2014/04/what-is-clean-code-and-why-should-you-care/)

  - [Steps to better code](https://medium.com/@isaaclyman/steps-to-better-code-e6c3cce0c7f9)

  - [Clean code because it’s fun](https://medium.com/@adamzerner/clean-code-because-its-fun-71e45662a944)

  - [Keeping your code clean](https://codeburst.io/keeping-your-code-clean-d30bcffd1a10)

- #### Books

  - ***Structure and Interpretation of Computer Programs*** by Hal Abelson, Gerald Jay Sussman

  - ***Clean Code***, ***Agile Software Development*** and ***Clean Architecture*** by R C Martin.

  - ***Code Complete*** (2nd Edition) by Steve McConnell

  - ***Programming Pearls*** by Jon Bentley

  - ***Design Patterns*** by the Gang of Four (one of the best books for program architecture)

license: MIT

repository: bool-ptr/curriculum

path: /Clean Code/README.md

branch_name: refs/heads/master

gha_license_id: MIT

repo_name: bool-ptr/curriculum


text:
# merge-util

  Just another deep merge function for objects.
  Merge is recursive for nested objects by default.

## Installation

    $ component install cristiandouce/merge-util

or..

    $ npm install merge-util

## Usage
```javascript
var merge = require('merge-util');

var obj1 = { hello: 'World' };
var obj2 = { hello: 'World!', good: { bye: 'Lennin' } };

merge(obj1,obj2);

console.log(obj1); // out: "{ hello: 'World!', good: { bye: 'Lennin'}}"

```

## API
### merge(obj1, obj2, opts)
  Merge `obj2` into `obj1` with some options.

```javascript
var obj1 = { obj: { any: 'thing' }};
var obj2 = { obj: { something: 'wrong?' } };
merge(obj1, obj2); // out: "{ obj: { something: 'Wrong?', any: 'thing' }}"
```

Available options include:

* `inheritance` : *Defaults to* `false`. Include inherited members in the merge.

* `shallow` : *Defaults to* `false`. A `true` value prevents merge from being recursive to nested objects.

* `discardEmpty` : *Defaults to* `true`. A `false` value makes empty values (as defined by [`ianstormtaylor/is-empty`](https://github.com/ianstormtaylor/is-empty)) in the "right-hand" be preserved as they were instead of being merged as `undefined` attributes in the "left-hand" object.

_Note:_ you can also pass a `Boolean` as the `opts` parameter as value for `inheritance` alone. This provides backwards compatibility with version `0.1.0`

#### inheritance

```javascript
function Being () {
  this.living = true;
}

Youth.prototype = new Being;
function Youth () {
  this.plays = true;
}

function Robot() {
  this.material = "metal";
}

var bot = new Robot();
var kid = new Youth();

merge(bot, kid, { inheritance: false }); // merge(dog, kid, false); also works as in 0.1.0
//out => bot: "{ plays: true, material: 'metal' }"

merge(bot, kid, { inheritance: true }); // merge(dog, kid, true); also works as in 0.1.0
//out => bot: "{ living: true, plays: true, material: 'metal' }"
```

#### shallow

```javascript
var xBuster = { name: "X-Buster", power: 600 };
var zeroBlade = { name: "Zero Blade", power: 9001 }

var megaman = {
  name: "Megaman X",
  weapon: xBuster
}

var zero = {
  name: "Zero"
  weapon: zeroBlade
}

merge(megaman, zero); // same as merge(megaman, zero, { shallow: false });
//out => megaman: "{ name: "Zero", weapon: { name: "Zero Blade", power: 9001 } }"

log(xBuster);
//out: { name: "Zero Blade", power: 9001 }
// `xBuster` was merged with `zeroBlade`

//If instead we had done this...
merge(megaman, zero, { shallow: true });
//out => megaman: "{ name: "Zero", weapon: { name: "Zero Blade", power: 9001 } }"

log(xBuster);
//out: { name: "X-Buster", power: 600 }
// `megaman`'s' `weapon` was swapped for `zero`'s, but `xBuster` itself wasn't merged.
```

#### discardEmpty

```javascript
var lameArmor = { name: "Lame armor", defense: 10 };
var upgradableArmor = { name: "Cool armor", defense: 20, upgrades: { } }

var noob = {
  name: "Noob player",
  armor: lameArmor
}

var veteran = {
  name: "Looking for upgrades"
  armor: upgradableArmor
}

merge(noob, veteran); // same as merge(noob, veteran, { discardEmpty: true });
//out =>
//noob:
//  { name: "Looking for uprades",
//    weapon: {
//      name: "Cool armor",
//      defense: 20,
//      upgrades: undefined
//    }
//  }
// `upgrades` attribute was discarded because it was an empty object.

merge(noob, veteran, { discardEmpty: false });
//out =>
//noob:
//  { name: "Looking for uprades",
//    weapon: {
//      name: "Cool armor",
//      defense: 20,
//      upgrades: { }
//    }
//  }
// `upgrades` attribute was merged as an empty object.

```

## TODO
  * Add some tests.
  * Add more merge examples.

## License

  MIT

repository: cristiandouce/merge-util

gha_language: JavaScript

repo_name: cristiandouce/merge-util


text:
## mailrobot
This is a program to run basic commands via sending email. It is possible to use a lot of mailbox types.

## FIRST

* Configure system environment on Windows OS
* Download Pyhton from visualstudio code extensions

## SECOND

```
-- mailrobot folder right click open in terminal

python -m pip install --upgrade pip
python -m pip install -r requirements.txt

python -m venv env
. env/Scripts/activate.bat

python app.py

```

repository: smiley-py/mailrobot

repo_name: smiley-py/mailrobot


text:
# Vaadin Gradle Plugin

This is an experimental Vaadin Gradle Plugin for Vaadin 14 and newer. A stable version for older Vaadin versions can be found [here](https://devsoap.com/gradle-vaadin-flow-plugin/).

Gradle 6 is not yet supported. Use version 5.6.4.

Currently builds are available only from temporary pre-release repository. You can start with following build.gradle file (with final release the start will be simpler):

```
buildscript {
    repositories {
        gradlePluginPortal()
        maven {
            url "https://repo.vaadin.com/nexus/content/repositories/vaadin-prereleases-201912/"
        }
    }
    dependencies {
        classpath "com.vaadin:vaadin-gradle-plugin:0.1.0"
        classpath "com.moowork.gradle:gradle-node-plugin:1.2.0"
        classpath 'io.github.classgraph:classgraph:4.8.49'
        classpath "gradle.plugin.org.gretty:gretty:3.0.1"
    }
}
apply plugin: 'com.vaadin'
apply plugin: "org.gretty"

repositories {
    maven {
        url "https://repo.vaadin.com/nexus/content/repositories/vaadin-prereleases-201912/"
    }
}

vaadin.autoconfigure()

```

[Preliminary documentation (targeting for final release)](https://github.com/vaadin-learning-center/learning-content/blob/author/magi/gradle-plugin/learn/tutorials/gradle-plugin/content.adoc)

## License

This plugin is distributed under the Apache License 2.0 license. For more information about the license see the LICENSE file
in the root directory of the repository. A signed CLA is required when contributing to the project.

See [CONTRIBUTING](CONTRIBUTING.md) for instructions for getting the plugin sources, and for compiling and using the plugin locally.

repository: mstahv/vaadin-gradle-plugin

repo_name: mstahv/vaadin-gradle-plugin


text:
# ana

ana(穴=means hole in Japanese) is a tool to open/close the AWS security group 22 port from your machine. If you'd like to connect via ssh to your EC2 servers from the place such as a cafe and friend's home, the tool would be a very easy method to open ssh port.

# Installation

Use bin/ana_* or build.

# How to use

* settings

```
export AWS_SECURITY_GROUP_ID=<target aws security group id>
export AWS_ACCESS_KEY_ID=<your aws access key id>
export AWS_SECRET_ACCESS_KEY=<your aws secret access key>
export AWS_REGION=<aws region>
```

* run

```
# open. add <your global ip>:22 to the aws security group
ana open
# close. delete <your global ip>:22 from the aws security group
ana close
```

# License

MIT

repository: hiroakis/ana

repo_name: hiroakis/ana


text:
---
layout: post
title:  "查看MySQL的版本"
date:   2019-03-02 18:27:02 +0800
comments: true
tags:
- mysql
---

1. mysql -V
没有连接到MySQL服务器，查看MySQL的版本

```
develop@server:~$ mysql -V
mysql  Ver 14.14 Distrib 5.6.30-76.3, for debian-linux-gnu (x86_64) using readline 6.3
```

2. mysql -v
这个命令可以查看到更为详细的信息，它会用账号 ODBC，连接上MySQL服务器，默认连接到localhost上的3306端口

```
develop@server:~$ mysql -v
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 158276
Server version: 5.6.30-76.3 Percona Server (GPL), Release 76.3, Revision 3850db5

Copyright (c) 2009-2016 Percona LLC and/or its affiliates
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Reading history-file /home/develop/.mysql_history
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
```

extension: markdown

gha_language: CSS


text:
# Default Workflow of ReDroid

The default workflow does the following things:

1. Run `anti_sandbox_detector/scripts/trace_collector.py` to collect real/emu runtime traces by DroidBot
2. Run `anti_sandbox_detector/scripts/trace_comparator.py` to compare real/emu runtime traces and find out APIs to monitor return values
3. Run `dsm_patcher/scripts/trace_monitor.py` to replay DroidBot tests in step 1 and collect return values of APIS specified in step 2
4. Run `dsm_patcher/scripts/dsm_generator.py` to generate the DSM rule using results from step 3
5. Upload the DSM rule from step 4 to the emulator at `/data/system/ReDroid/dsm.json`
6. Install `app_samples/redroid.apk` (an Xposed module) on the emulator

repository: xianlimei/ReDroid

repo_name: xianlimei/ReDroid


text:
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
# neko-telegram-autopostbot
## Automatic publication of anime pictures to your telegram channel.
# Setup
* ### `pip install -r requirements.txt`
    [![Screenshot-32.png](https://i.postimg.cc/k5Y9mKts/Screenshot-32.png)](https://postimg.cc/qtKWctw6)
* ### You must create a telegram bot and get the http API token (all this can be done from @BotFather)
* ### Create a ".env" file in the directory
* ### Write the token of the bot and the tag of the channel in the ".env" file
    [![dotenv.png](https://i.postimg.cc/76Kk5vvz/dotenv.png)](https://postimg.cc/Kk3VWH8c)

    (the token above doesn't work)

# Tags are published along with the pictures:
### #neko
### #baka
### #fox_girl
### #poke
### #kiss


text:
# Usage
Since this is a demo app, login is only simulated. There is no HTTPS connection and there are no passwords. Enter a user name and you will be that user. Logout and enter a new user name to switch users. Use the user name `admin` to become the Admin user who has question management and statistics capabilities.

# Install
## Get the code
All commands below have been tested with `npm v2.14.7` and `node vv4.2.2`. While older versions of npm/node should be compatible, no testing has been done to verify this.

```
git clone https://github.com/MatthewHerbst/taco-surveyor.git
npm install
```

## Setup your database
**!

At a minimum, you will require a MySQL database running on your localhost, port 3306. The database must have the user account `taco_master` with the password `taco_warlord`. These values can be modified in `index.js` at the project root.

In addition, the database must have table `taco_surveyor`, and user `taco_warlord` must have full privileges within this table.

If tables from a previous install (without a major version change) already exist the app should continue to work, picking up the existing data automatically when run.

The app has been tested with `MySQL v5.7.10`. While older versions of MySQL should be compatible, no testing has been done to verify this.

# Run

## First, choose your build type:
### Dev
Dev builds include watch tasks for auto-rebuilding on code change.
Dev builds do not remove comments and logging code from the build.
Dev builds do not perform minification of core JavaScript

`npm run dev`

The build is completed after you see the x bytes written message. The command will not return due to the watch tasks. Force-exit the command when you want to stop watching and get control of the command line back.

### Prod
Prod builds do not include any development tools such as watch and auto-building available in dev builds.
Prod builds remove all comments and logging code from the build.
Prod builds perform minification of core JavaScript. Source maps are provided.

`npm run prod`

The build is completed after you see the x bytes written message. The command will return once the build is complete.

## Start the server
Builds will be placed in `dist`, which acts as the document root.

After building, you may start the server/app with the following:

`npm start`

Visit http://localhost:3333 in your browser of choice.

repository: MatthewHerbst/taco-surveyor

repo_name: MatthewHerbst/taco-surveyor


text:
# Template Webpack FEND App

Template and Example using Webpack to build a FEND Browser App (with HTML/CSS/JS and Image files).

**Demo:**
 - Simple web interface for storing values in the Browser Local Storage.

## Dependencies
Node v12+ and npm

See package.json([github](https://github.com/devlinjunker/template.webpack.fend/blob/master/package.json))
for full list of current dependencies
 - [Webpack](https://webpack.js.org/) + [Loaders ](https://webpack.js.org/concepts/loaders/)-- managing the build process
 - [Babel](https://babeljs.io/) -- compiling newer ECMA2016+ into browser-capable javascript
 - [FlowJS](https://flow.org/) -- adding types to javascript
 - [ESLint](http://eslint.org/) -- enforcing javascript code style
 - [Webpack Dev Server](https://github.com/webpack/webpack-dev-server)-- rapid development with hot reloading
 - [Mocha](https://mochajs.org/), [Chai](https://www.chaijs.com/), and [Sinon](https://sinonjs.org/) -- unit testing
 - [Karma](https://karma-runner.github.io/) -- managing tests in different browsers
 - [EsDoc](https://esdoc.org/) -- creating easy javascript documentation
 - [PostCSS](https://postcss.org/) -- parsing and compiling css files
 - [HTMLHint](https://github.com/htmlhint/HTMLHint) -- parsing and enforcing HTML standards
 - [Tailwind](https://tailwindcss.com/) - Utility-first CSS Framework
 - [Zondicons](http://www.zondicons.com) - Free SVG Icon Library
 - [Handlebars](http://handlebarsjs.com/) - HTML Templating Engine

## Development

How to use this template to create a basic Frontend Application:

1. Download template and update dependencies
2. Create HTML files in `src/`
    - add HtmlWebpackPlugin instances for each new output page in webpack.config.js
    - add svg icons with `@svg()` using custom svg-pre-loader
3. Add javascript files and reference in `src/entry.js`  (for up your application
    - add additional javascript entry points in webpack.config.js
    - create handlebars partials and import then add to DOM
4. Add CSS files to `src` and import in javascript
   - or install CSS libraries with npm and import
5. Use `npm run start-watch` to compile and run dev server + tests in watch mode
   - or `npm run start-dev` to run the dev server and reload on changes
6. Navigate http://localhost:3030/ to see a development version of your web app with Hot reloading
   - or http://localhost:3030/docs/ to see the documentation

### Tests/Running

`npm run start-watch` to run Karma + Mocha and watch for changes while also opening the Webpack dev server that will recompile the project and reload the webpage on file changes on http://localhost:3030

`npm run test-watch` to run Karma + Mocha and all of the tests associated with the project and watch for changes on the files to re-run the tests

`npm run dev-watch` to run the only webpack development server and watch for changes on the files to reload

`npm run test-dev` to start the unit test runner for debugging unit tests in the browser

`npm run test` to run all of the unit tests for the application one time

`npm run lint` to run the linter on src directory

`npm run build` compile application to public directory

`npm run doc` to generate static documentation in the doc folder

`npm run doc-image` to update sourcemap image and static documentation in the doc folder

**TODO**

`npm run build-prod` ... TODO: create prod config

`npm run clean` ... TODO: clean the workspace

### TODO
 - [x] Install Dev Dependencies
 - [x] (^) Webpack config
 - [x] (^) Karma
 - [x] (^) Include eslint in test-watch?
 - [x] (^) Combined build and test watch
 - [x] (^) Setup Mocha
    - [x] (-) Setup global test objects
 - [x] (^) Karma webpack integration (for tests in browser)
    - [x] (^) Use rebuilt bundle when running tests
 - [x] (^) Flowtype eslint plugin
 - [x] (-) Setup EsDoc
    - [x] ~~(v) run doc before commit?~~ (run on merge to master)
 - [x] ~~(-) Prettier for autofix~~ (just use eslint atom plugin with fix)
 - [x] (^) karma/mocha unit test debugging ~~(with atom?)~~ in browser
 - [x] (^) Demo app in docs
 - [x] (^) Move js to `src/app`
 - [x] (^) Fix single build process (args/if statement in webpack)
 - [x] (^) Update linting rules
      - with descturing/filenames/naming conventions? https://github.com/devlinjunker/JS.Fun/tree/master/play/test.eslint#eslint-exploration
      - testing rules
      - naming conventions?
 - [ ] ~~(^) Absolute Paths~~
 - [x] (^) Update Node Version to v10
 - [x] (^) Update Dependencies
 - [x] (^) Different Folders for examples
 - [x] (^) HTML Page with important stuff
   - header/tags
 - [x] (^) Github Actions ----->> Build doc on commit to master <<-----
 - [x] (^) HTML Linting?
   - https://github.com/htmlhint/HTMLHint
   - Took some finagling to get this to work during watch process
 - [x] Clearing/standardizing browser css
   - Normalize CSS http://nicolasgallagher.com/about-normalize-css/
 - [..] PostCSS?
   - ecosystem of parsing css files
   - [..] (^) CSS Linting
      - stylelint
      - bem linting? https://github.com/postcss/postcss-bem-linter#stylelint-plugin
   - [x] css variables/hierarchy?
      - https://github.com/jonathantneal/precss
    - autoprefixer for making css look cleaner (browser prefixes don't need to be added)
    - list all selectors used: https://github.com/davidtheclark/list-selectors
 - [x] (^) Madge?
 - [x] (^) Manual in Docs
 - [x] (^) HTML template example
   - webpack/lodash style? https://github.com/emaphp/underscore-template-loader
   - handlebars?
      - seems like this isn't the best for javascript components, although it will work for this basic repo
      - problems with handlebar-webpack-plugin and webpack-dev-server
   - [x] Components (javascript methods that return compiled html, has params for template variables)
 - [x] (^) Base CSS Style for all apps
 - [x] (^) CSS Framework
   - [x] Tailwind - integrates with javascript
 - [ ] (^) Styleguide
    - Page in docsite
    - Examples: http://styleguides.io/examples.html
      - http://codeforamerica.clearleft.com/#
    - Fractal? https://github.com/adamlindqvist/fractal-webpack-plugin
 - [ ] (^) Githooks
 - [ ] (^) Configuration File
 - [ ] (^) If running in development -> console errors/warnings appear in UI bubble
 - [..] Helpers
   - ~~Localstorage~~
   - Performance Loggers (start/end/post to api? file?)
   - Internal API Helper
   - External API Helper?
 - [ ] Accessibility Linting
    - https://github.com/pa11y/pa11y
    - ASLint
    - https://www.24a11y.com/2017/reacts-accessibility-code-linter/
 - [ ] Basic UI Framework (other repos?)
    - [ ] Backbone?
    - [ ] Vue?
    - [ ] React?
    - [ ] Aurelia
  - [ ] Fork of this Repo with different directories for each css framework?
    - [ ] bulma https://bulma.io/documentation/overview/start/
    - [ ] Bootstrap?
    - [ ] Foundation?
    - [ ] Material Design?
 - [ ] (-) Mock API requests on localhost
    - Contract testing? https://docs.pact.io/
    - OpenAPI validation of mocks? https://bitbucket.org/atlassian/swagger-mock-validator/src/master/
 - [ ] (-) production configuration for webpack
    - Improve build speed in develop https://webpack.js.org/guides/build-performance/
    - Build caching https://webpack.js.org/guides/caching/
    - Minimize?
    - No Warnings? No output in tests?
    - CSS Generated to File and included at top of HTML
    - Accessibility validation?
 - [ ] (-) cleaner output from watch script?
 - [ ] (v) Cypress UI Testing?
 - [ ] (v) Serve docs with small script and `npm run doc-serve`
 - [ ] (v) package.json main script
    - (install/run application and open browser? or just point to entry or AppController?)
 - [ ] (v) parameterize directories in package.json scripts?
    - better npm script?

**Application**
 - [x] Local Storage DataService
 - [x] Controller/Component for saving/retrieving stored vals
 - [x] Interface for displaying vals
 - [ ] Weather/Other Free API
 - [ ] Redux Example (w/o React)
 - [ ] React Example
   - [ ] Notebook App
     - [ ] Daily Scratchpad
     - [ ] Save/Read Github Gists
       - https://developer.github.com/v3/gists/#list-gists-for-the-authenticated-user
     - [ ] Github Readmes in my repos and save with commit
     - [ ] Sorting Notes
       - A-Z
       - Date Created?
       - Date Modified
       - Custom (with dragging)
     - [ ] Font Size
     - [ ] Tagging
       - drag to tag
       - multiple tags per note
       - shift+click on tags section to filter notes
 - [ ] GraphQL Example
 - [ ] Websocket?

## Notes/Ideas
 - PostCSS vs CSS-Loader?
 - Why hold much state/data in UI rather than display from server on page load?
    - Pros:
      - Speed for user (when results can be preloaded)
      - Saves money in server computation costs to create UI/remember state
    - Cons:
      - Lots of bandwidth to deliver Single Page App
      - Can be slower when building large UI after data call
    - Overall: Save state/preload data in client to improve user experience. Use server for speed
      - Use client when small objects can be stored/edited and returned
      - Use server for displayed only data
    - Redux for sharing state between client/server
    - When should we vs static webpages? React/React Static?
 - Backbone for UI? Seems simpler than react? Doesn't rely/revolve around instant response to interaction
 - [ ] GraphQL


text:
# Secure_Communication_Channel
Program allowing two parties to establish a secure communication channel

# Summary
UDP program written in java allowing two parties to establish a secure communication channel. Programs “Host” and “Client”, which are executed by Alice and Bob, respectively.
Alice and Bob share a common password PW, which contains at least 6 alphanumeric characters.
Alice/Host stores the password in the hashed form (i.e., H(PW) where H denotes the SHA-1 hash function) and Bob/Client memorizes the password. They want to establish a secure communication channel that can provide data confidentiality and integrity. They aim to achieve this goal via the following steps: (1) use the shared password to establish a shared session key; (2) use the shared session key to secure the communication.

# Key Exchange Protocol

1: B -> A: “Bob”

2: A -> B:p,g,ga modp

3: B -> A: E(H(PW), gb mod p)

4: A -> B:E(K,NA)

5: B -> A: E(K, NA+1)

6: A -> B: “Successful” (or “Unsuccessful”)

# READ ME:

**readme file can be found under "Secure_Communication_Channel" Folder

REFERENCE/SOURCE:

ENCRYPTION/DECRYPTION SOURCE CODE:

https://stackoverflow.com/questions/12289717/rc4-encryption-java

SHA-1 HASH SOURCE CODE:

http://www.anyexample.com/programming/java/java_simple_class_to_compute_md5_hash.xml


text:
# Stonks App

A small emulation of a Stock exchange written in [Go](https://golang.org/) for the backend and [Flutter](https://flutter.dev/) for the app.

### Why?

Inspiration from @sasidakh made me want to learn Go and @yashwp put this idea across as a learning assignment. Learning a new language/technology while designing a very small system obviously is better than writing 'Hello World!' and quitting.

### Getting Started

1. [Go Server](https://github.com/ParadoxInfinite/go-stonks/tree/master/go-server/README.md)
2. [Stonks App (Flutter)](https://github.com/ParadoxInfinite/go-stonks/tree/master/stonks/README.md)

### Tech Stack

- Server - Golang
    - [Gorilla WebSocket](https://github.com/gorilla/websocket/) - Go package for websocket implementation
- Database - [Mongo Atlas](https://www.mongodb.com/cloud/atlas)
- Client App - Flutter

### Additional Tools Used
1. [Postman](https://www.postman.com/) - For testing the WS server

### References Used
1. [Gorilla WebSocket Chat Example](https://github.com/gorilla/websocket/tree/master/examples/chat)
2. [WebSocket Error Codes - MDN](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/code)
3. [Flutter Docs](https://flutter.dev/docs)
4. [Google Codelabs' Guide - First Flutter App](https://codelabs.developers.google.com/codelabs/first-flutter-app-pt1)
5. [Flutter Chips](https://api.flutter.dev/flutter/material/Chip-class.html)
6. [Flutter asBroadcastStream](https://api.flutter.dev/flutter/dart-async/Stream/asBroadcastStream.html)

### Roadmap

[Here](https://github.com/ParadoxInfinite/go-stonks/projects/1) is the roadmap for this project. Feel free to add issues/feature requests and I will try to get to them asap.

### Contributing Guidelines

Refer to any of my other repos for contributing guidelines. Too lazy to copy paste.

repository: ParadoxInfinite/go-stonks

gha_language: Go

repo_name: ParadoxInfinite/go-stonks


text:
This is an extremely minimalist vim colorscheme (almost no syntax highlighting).

To use:
- :colo nofrils-dark
- :colo nofrils-light

To customize:
- :let g:nofrils_strbackgrounds=1 to turn highlighted string backgrounds
- :let g:nofrils_heavycomments=1 to turn on high contrast comments rather than the default faded style

The only highlighted elements are spelling, errors, comments, vim features (diff, etc) and *optionally* string backgrounds

----

The below two screenshots.  The dark one is default, the light one had **:let g:nofrils_strbackgrounds=1** and **:let g:nofrils_heavycomments=1** set.

![Dark/Light Versions](http://i.imgur.com/WFTnVDk.png)

----

These two screenshots are with default settings on diffs.

![Dark Version](http://i.imgur.com/heBamCh.png)
![Light Version](http://i.imgur.com/RSMuzGh.png)

----

Why did you even create this thing?  https://www.robertmelton.com/2016/03/13/syntax-highlighting-off/

----

Forks

- Atom: https://atom.io/themes/nothrill-dark-syntax

repository: geppettodivacin/nofrils

repo_name: geppettodivacin/nofrils


text:
# Handbook Codes

Handbook Codes

    A C++ codes repository for Competitive Programming Handbook by Antti Laaksonen.

    Report Bug
    ·
    Request Code

  Table of Contents

      About The Project

Usage

Roadmap

Contributing

## About The Project

A Competitive Programmers Handbook by Antti Laaksonen is one of the good books which touches each topic for competitive programming. But the problem is that it just touches those topics and it becomes hard for a beginner to grasp those concepts and implement them simultaneously. I guess the book expects the reader to have at least once been introduced to the concepts. This repository comprises of all the possible codes from the same.
[Link](https://github.com/pllk/cphb)

## Usage

Read the book. Unable to understand any part? Come here look at the code.

## Roadmap

- [Open issue](https://github.com/pulkit1joshi/handbook_codes/issues) if you want a particular part of the handbook to be implemented earlier or have any issue in the present codes.
- Further, more codes will be added as I get time. :)

## Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b newalgorithm`)
3. Commit your Changes (`git commit -m 'Added algorithm/code: "Description" , Part of book: "Description"'`)
4. Push to the Branch (`git push origin newalgorithm`)
5. Open a Pull Request


text:
# HTTP Kit

[中文文档](https://github.com/shenfeng/http-kit/blob/master/README_CN.md)

Async HTTP Server and HTTP Client, write from scrach, for high performance, high concurrent Clojure application

## Features

Clean compact code: the jar size is ~80k

High performance, low resources usage, designed with server side use in mind

### HTTP Server

* High performance: thirdparty benchmark [clojure-web-server-benchmarks](https://github.com/ptaoussanis/clojure-web-server-benchmarks)
* Efficient support [long polling](http://en.wikipedia.org/wiki/Comet_(programming)
* Efficient Support [WebSocket](http://tools.ietf.org/html/rfc6455)
* Implement the ring adapter interface, just a drop in replacement to start
* Memory efficient: ~10K high traffic concurrent connections with ~128M heap

### HTTP Client

* Async with promise, async requests, single `@` to get the response synchronously
* Keep-alive
* Timeout per request

## Usage

### HTTP Server
```clj
[me.shenfeng/http-kit "2.0-SNAPSHOT"]

(:use me.shenfeng.http.server)          ; export run-server and defasync

(defn app [req]
  {:status  200
   :headers {"Content-Type" "text/html"}
   :body    "hello word"})

(run-server app {:port 8080
                 :thread 4                     ; 4 http worker thread
                 :queue-size 20480             ; max job queued before reject to project self
                 :ip "<IP_ADDRESS>"               ; bind to localhost
                 :worker-name-prefix "worker-" ; thread name worker-1, worker-2, worker-3, ......
                 :max-line 4096                ; max http header line length
                 :max-body 1048576})           ; max http request body, 1M
```

### Websocket
```clj
(:use me.shenfeng.http.server)

(defn chat-handler [req]
  (if-ws-request con
                 (on-mesg con (fn [msg]
                                ;; echo back
                                (send-mesg con msg)))))

(run-server chat-handler {:port 8080})

```

These is a live chartroom as an example:
[examples/websocket](https://github.com/shenfeng/http-kit/tree/master/examples/websocket)

run it:

```sh
./scripts/websocket # try open two browser tab, view it on http://<IP_ADDRESS>:9899/
```

### Asynchronous (Long polling)
```clj
(:use me.shenfeng.http.server)

(defn async-handler [req]
  (async-response respond!
                  (future (respond! "hello world async"))))

(run-server async-handler {:port 8080})
```

These is a live chartroom as an example:
[examples/polling](https://github.com/shenfeng/http-kit/tree/master/examples/polling)

run it:

```sh
./scripts/polling # try open two browser tab, view it on http://<IP_ADDRESS>:9898/
```

### HTTP Client

```clj
; `http/get` `http/post` `http/head` `http/put` `http/delete`
(:require [me.shenfeng.http.client :as http])
```

```clj
;; Asynchronous，return a promise, response is ignored
(http/get "http://host.com/path")

;; Handle response asynchronously
(let [options {:timeout 200             ; ms
               :basic-auth ["user" "pass"]
               :user-agent "User-Agent-string"
               :headers {"X-Header" "Value"}}]
  (http/get "http://host.com/path" options {:keys [status headers body] :as resp}
            (if status
              (println "Async HTTP GET: " status)
              (println "Failed, exception is " resp))))

;; Synchronous
(let [{:keys [status headers body] :as resp} @(http/get "http://host.com/path")]
  (if status
    (println "HTTP GET success: " status)
    (println "Failed, exception: " resp)))

;; Concurrent HTTP requests，handle responses in a sync style
(let [resp1 (http/get "http://host.com/path1")
      resp2 (http/get "http://host.com/path2")]
  (println "Response 1's status " {:status @resp1})
  (println "Response 2's status " {:status @resp2}))

;; Form params
(let [form-parms {:name "http-kit" :features ["async" "client" "server"]}
      {:keys [status headers body] :as resp} (http/post "http://host.com/path1"
                                                        {:form-parmas form-parms})]
  (if status
    (println "Async HTTP POST: " status)
    (println "Failed, exception is " resp)))

```

## Benchmark

[clojure-web-server-benchmarks](https://github.com/ptaoussanis/clojure-web-server-benchmarks)

**httperf and ab has some issues in OS X, On Linux runs fine**

The Server runs quite fast: It handles tens of thousands requests per seconds on moderate PC:

There are scripts to do some benchmark. I use it to get some ideas
about how fast it can send and receive bytes.

#### ab version:
```sh
git clone git://github.com/shenfeng/http-kit.git && cd http-kit && rake bench
```
It compare with
[ring-jetty-adapter](https://github.com/mmcgrana/ring)
[async-ring-adapter](https://github.com/shenfeng/async-ring-adapter)

#### [httperf version](https://github.com/shenfeng/http-kit/tree/master/scripts/httperf):

```sh
git clone git://github.com/shenfeng/http-kit.git && cd http-kit && ./scripts/httperf
```

## Contributors

*sort by emacs `sort-line`*

* [Max Penet](https://github.com/mpenet)
* [Peter Taoussanis](https://github.com/ptaoussanis)

## Motivation

I write it for the HTTP server and HTTP client of [Rssminer](http://rssminer.net)

* Rssminer needs to be fast.
* Efficiently fetch feeds from Web.
* An asynchronous Server and Client is needed to proxy blogspot like sites for Rssminer's user

## Update history

* 1.0.3  using UTF8 to encode HTTP response header: fix can not encode Chinese char
* 1.1.0 defasync and async HTTP client clojure API
* 1.1.1 HTTP client: allow custom ACCEPT_ENCODING, default gzip, deflate
* 1.1.3 Better syntax for defasync
* 1.1.6 WebSocket support
* 1.2   Fix content-type for multipart/form-data

#### 2.0 (not released yet, comming soon)

HTTP Server:
  1. Support HTTP/1.0 keep-alive
  2. Better error reporting
  3. Better serving larget file(mmap),
  4. `:queue-size` option to protect high traffic web server
  5. API redisign: `async-response` and `if-ws-request` for better flexibility. Thanks [Peter Taoussanis](https://github.com/ptaoussanis)

HTTP Client:
  1. API redesign: by using promise, support both sync and async call. Thanks [Peter Taoussanis](https://github.com/ptaoussanis)
  2. Timeout per request
  3. Support keep-alive

repository: DavyLin/http-kit

repo_name: DavyLin/http-kit


text:
Some people don’t like Prolog’s cut (`!/0`) predicate.  For example, Mercury doesn’t have that operator at all.  The opposition has good theoretical reasons, but cut seems quite practical as an optimization despite all that.  Certainly it can be misused, but that seems like a poor reason to eliminate it.  It would be better to write tools which warn about these poor behaviors.

I wonder if it’s worthwhile to have a predicate that blocks cut from cutting any further.  Perhaps a `cut_barrier(-ChoicePoint)` predicate.

    call Goal
        some_goal
	    cut_barrier _ // !/0 stops here
	    Goal          // seek solutions to Goal

Ancient Prologs, and some modern, have first class choicepoints and a `cut_to/1` predicate to cut all choicepoints before a given one. These are traditionally called ancestral cuts. `!/0` is obviously a special case which can be implemented with this underlying machinery. Perhaps `!/0` should just be a macro on top of `cut_to/1`. Try writing it and make sure it's possible.

If we have `cut_barrier(-ChoicePoint)` and `cut_to(+ChoicePoint)`, can `-> ;` be implemented as a macro? Should it be? Is there a reason to have if-then-else as a fundamental control construct?

First class choicepoints seem like a no brainer. It's always good to give the language access to meta information so that powerful extensions can be built on top of it.

license: Unlicense

repository: amalog/scratch

repo_name: amalog/scratch


text:
Scripts here will be copied to `~/.local/bin` which is set to be in the $PATH.

They are kept here instead of `home/.local/bin` as they are independently useful.

If this repository ever contains binaries, they do not belong here or
`home/.local/bin` as they are platform independent.

repository: naggie/dotfiles

gha_language: Vim script

repo_name: naggie/dotfiles


text:
# Pomodoro timer: Practical JavaScript

A Practical JavaScript Pomodoro timer

---

## Data

> describe the data used in your project.
>
> - what properties? Start time, Stop/pause time, break time
> - what types? Objects and functions
> - what are array entries like? Prototype

---

## User Story Dependencies

![Story Dependency Diagram](https://github.com/AnisyaPurnama/Pomofocus/blob/master/public/userStoryPomo.png?raw=true)

---

## WIREFRAME

![wireframe](https://github.com/AnisyaPurnama/Pomofocus/blob/master/public/wireframepomodoro.png?raw=true)

---

## 0.Setup

- Start a repo.
- Study (and possibly modify) the backlog
- Design a simple wireframe to set guidelines for UI/UX design.
- Devise a development strategy.

---

## 1. Initialize Application

**As a user I want to see the home page when I load the site**

- create HTLM index
- style with CSS

### REPO

- All the user story is developed on branch `master`.

### Task A
**As a user I want to start a timer and focus on the task for 25 minutes**

#### HTML
- Create start button `start`

#### CSS
- Styled the presentation of button, color, font, etc.

#### JS
- set the `timer`functionality in a class
- create EventListener `start`
- set the time Interval `setInterval`

### Task B
**As a user I want to pause the timer**
#### HTML
- Create pause button `pause`

#### CSS
- Styled the presentation of button, color, font, etc.

#### JS
- create the `stop` functionality in a class
- create EventListener `stop`
- stop the time Interval `stopInterval` & `clearInterval`

### Task C
**As a user I want have a break timer for 5 minutes**
#### HTML
- Create short break feature `Short Break`

#### CSS
- Styled the presentation of button, color, font, etc.

#### JS
- create condition in `timer` function
---

repository: AnisyaPurnama/Pomofocus

repo_name: AnisyaPurnama/Pomofocus


text:
# Package jupyter

## Function `run-kernel`

Run a kernel based on a kernel class and a connection file.

### Definition

```common-lisp
(run-kernel kernel-class connection-file-name)
```

## Generic Function `render`

Render evaluation result as a mime bundle for execute_result
  or display_data.

### Definition

```common-lisp
(render result)
```

## Class `comm`

### Superclasses

- `comm`
- `standard-object`

### Initial Arguments

- `:id`
- `:target-name`
- `:kernel`

## Function `jpeg`

Create a JPEG image result based on an inline value.

### Definition

```common-lisp
(jpeg value &optional display-data)
```

## Variable `*page-output*`

Output stream sent to Jupyter pager. Available during calls to evaluate-code.

### Definition

```common-lisp
nil
```

## Function `send-comm-open`

### Definition

```common-lisp
(send-comm-open comm &optional data metadata)
```

## Function `ps-file`

Create a PostScript result based on a file path.

### Definition

```common-lisp
(ps-file path &optional display-data)
```

## Function `get-comm`

### Definition

```common-lisp
(get-comm id)
```

## Generic Function `on-comm-message`

### Definition

```common-lisp
(on-comm-message comm data metadata)
```

## Function `jpeg-file`

Create a JPEG image result based on a file path.

### Definition

```common-lisp
(jpeg-file path &optional display-data)
```

## Class `kernel`

Kernel state representation.

### Superclasses

- `kernel`
- `standard-object`

### Initial Arguments

- `:name`
- `:version`
- `:banner`
- `:language-name`
- `:language-version`
- `:mime-type`
- `:file-extension`
- `:pygments-lexer`
- `:codemirror-mode`
- `:help-links`
- `:package`
- `:transport`
- `:ip`
- `:shell-port`
- `:stdin-port`
- `:iopub-port`
- `:control-port`
- `:hb-port`
- `:signature-scheme`
- `:key`
- `:prompt-prefix`
- `:prompt-suffix`
- `:input-queue`

### Slots

- `name` — Kernel name. Used as a unique identifier in kernel
         description.
- `version` — Kernel version.
- `banner` — Banner text used to describe kernel. Used in
           kernel_info_reply messages.
- `language-name` — Display name of implementation language. Used
                  in kernel_info_reply messages.
- `language-version` — Version of implementation language. Used in
                     kernel_info_reply messages.
- `mime-type` — Default MIME type for source files. Used in
              kernel_info_reply messages.
- `file-extension` — Default file extension for source files. Used
                   in kernel_info_reply messages.
- `pygments-lexer` — Name of Pygments lexer for source files. Used
                   in kernel_info_reply messages.
- `codemirror-mode` — CodeMirror mode for source files. Used in
                    kernel_info_reply messages.
- `help-links` — An association list of help links. The car is the
               description and the cdr is URL. Used in kernel_info_reply
               messages.
- `package` — The package in which evaluate-code,
            code-is-complete and others are called.
- `transport` — Transport protocol from connection file.
- `ip` — IP address from connection file.
- `shell-port` — SHELL port from connection file.
- `stdin-port` — STDIN port from connection file.
- `iopub-port` — IOPUB port from connection file.
- `control-port` — CONTROL port from connection file.
- `hb-port` — HB port from connection file.
- `signature-scheme` — Signature scheme from connection file.
- `key` — Signing key from connection file.
- `prompt-prefix` — String prefix using in *standard-output* to
                  indicate the start of prompt.
- `prompt-suffix` — String suffix using in *standard-output* to
                  indicate the end of prompt.
- `ctx` — pzmq ctx handle.
- `hb` — Heartbeat channel.
- `shell` — SHELL channel.
- `stdin` — STDIN channel.
- `iopub` — IOPUB channel.
- `session` — Session identifier.
- `input-queue` — Input queue used to feed values into
                execute_result payloads.
- `history` — Kernel history manager.
- `execution-count` — Kernel execution count.
- `comms` — Currently open comms.

## Function `inline-result`

Create a result based on an inline value.

### Definition

```common-lisp
(inline-result value mime-type &optional display-data)
```

## Class `inline-result`

### Superclasses

- `inline-result`
- `result`
- `standard-object`

### Initial Arguments

- `:display-data`
- `:value`
- `:mime-type`

## Function `send-comm-message`

### Definition

```common-lisp
(send-comm-message comm &optional data metadata)
```

## Function `markdown`

Create a Markdown result based on an inline value.

### Definition

```common-lisp
(markdown value &optional display-data)
```

## Function `html`

Create a HTML result based on an inline value.

### Definition

```common-lisp
(html value &optional display-data)
```

## Function `info`

Display informational message regarding kernel status.

### Definition

```common-lisp
(info &rest args)
```

## Function `svg-file`

Create a SVG result based on a file path.

### Definition

```common-lisp
(svg-file path &optional display-data)
```

## Generic Function `on-comm-close`

### Definition

```common-lisp
(on-comm-close comm data metadata)
```

## Function `clear`

Send clear output message to frontend.

### Definition

```common-lisp
(clear &optional wait)
```

## Generic Function `kernel-prompt-suffix`

### Definition

```common-lisp
(kernel-prompt-suffix sb-pcl::object)
```

## Function `make-inline-result`

Make a result based on an inline value. The handle argument is used by the
  convenience functions to instantly process the result.

### Definition

```common-lisp
(make-inline-result value &key mime-type display-data handle)
```

## Function `latex`

Create a LaTeX result based on an inline value.

### Definition

```common-lisp
(latex value &optional display-data)
```

## Function `send-result`

Send a result either as display data or an execute result.

### Definition

```common-lisp
(send-result result)
```

## Class `quit-condition`

A condition for identifying a request for kernel shutdown.

### Superclasses

- `quit-condition`
- `error`
- `serious-condition`
- `condition`

## Generic Function `evaluate-code`

Evaluate code along with paged output. Kernel implementations
  must return a list of evaluated results. Each result should be wrapped with an
  appropriate `result` class instance. Sending the results to the client will be
  handled by the calling method.

### Definition

```common-lisp
(evaluate-code kernel code)
```

## Function `json-getf`

Safe accessor for the internal JSON format that behaves like getf

### Definition

```common-lisp
(json-getf object indicator &optional default)
```

## Function `quit-eval-error-p`

Predicate to determine if result is an quit result.

### Definition

```common-lisp
(quit-eval-error-p result)
```

## Generic Function `inspect-code`

Inspect code at cursor-pos with detail-level. Successful
  inspection should return a single wrapped result.

### Definition

```common-lisp
(inspect-code kernel code cursor-pos detail-level)
```

## Generic Function `complete-code`

Complete code at cursor-pos. Successful completion should
  return three values, first a list of strings, then the cursor start position
  and finally the cursor end position.

### Definition

```common-lisp
(complete-code kernel code cursor-pos)
```

## Function `png-file`

Create a PNG image result based on a file path.

### Definition

```common-lisp
(png-file path &optional display-data)
```

## Function `text`

Create a plain text result based on an inline value.

### Definition

```common-lisp
(text value &optional display-data)
```

## Function `file`

Create a result based on a file path. The mime type with automatically be
  determined from the file extension.

### Definition

```common-lisp
(file path &optional display-data)
```

## Function `enqueue-input`

Add code to input queue.

### Definition

```common-lisp
(enqueue-input kernel code)
```

## Generic Function `create-comm`

### Definition

```common-lisp
(create-comm target-name id data metadata)
```

## Function `pdf-file`

Create a PDF result based on a file path.

### Definition

```common-lisp
(pdf-file path &optional display-data)
```

## Function `make-error-result`

Make a result based on an error. The quit the parameter indicates that the
  kernel should exit. The handle argument is used by the convenience functions
  to instantly process the result.

### Definition

```common-lisp
(make-error-result ename evalue &key quit traceback)
```

## Function `gif-file`

Create a GIF image result based on a file path.

### Definition

```common-lisp
(gif-file path &optional display-data)
```

## Generic Function `code-is-complete`

Check code for completeness. Kernel implementations should
  result one of the permitted values of complete, incomplete, unknown or
  invalid.

### Definition

```common-lisp
(code-is-complete kernel code)
```

## Function `install-kernel`

Install a kernel spec file given a kernel name and a language name.

### Definition

```common-lisp
(install-kernel &key argv class name language resources)
```

## Function `svg`

Create a SVG result based on an inline value.

### Definition

```common-lisp
(svg value &optional display-data)
```

## Class `result`

Base class for encapsulation of evaluation result.

### Superclasses

- `result`
- `standard-object`

### Initial Arguments

- `:display-data`

### Slots

- `display-data` — Show result as display_data in client.

## Function `make-lisp-result`

Make a lisp result based on an inline value.

### Definition

```common-lisp
(make-lisp-result value &key display-data)
```

## Function `make-file-result`

Make a result based on a file. The handle argument is used by the convenience
  functions to instantly process the result.

### Definition

```common-lisp
(make-file-result path &key mime-type display-data handle)
```

## Macro `handling-errors`

Macro for catching any conditions including quit-conditions during code
  evaluation.

### Definition

```common-lisp
(handling-errors
  &body
  body)
```

## Generic Function `on-comm-open`

### Definition

```common-lisp
(on-comm-open comm data metadata)
```

## Generic Function `comm-id`

### Definition

```common-lisp
(comm-id sb-pcl::object)
```

## Generic Function `kernel-prompt-prefix`

### Definition

```common-lisp
(kernel-prompt-prefix sb-pcl::object)
```

## Function `png`

Create a PNG image result based on an inline value.

### Definition

```common-lisp
(png value &optional display-data)
```

## Function `send-comm-close`

### Definition

```common-lisp
(send-comm-close comm &optional data metadata)
```


text:
# Material Text Field

`material-text-field` is a nice, flexible and customizable text field. This design is based on [Google's Material Design](https://material.io/guidelines/#) and is very much customizable and extensible.

![](http://i65.tinypic.com/3462tfd.gif)

## Compatibility

`material-text-field` is compatible with Swift 3.

## Installation

You can download the project from `Github` and after doing so, copy the files in the `Sources` folder to your project.

## Usage

### Interface Builder

Most of the `material-text-field's` properties are editable by the interface builder. This makes it much faster and easier to use. All you have to do is drag a UITextField and change it's Class to GDevTextField as shown below.

![](http://i65.tinypic.com/flan0l.png)

After that, you will be able to see IBDesignables properties on xcode as shown below.

![](http://i67.tinypic.com/2d0jar7.png)

### Code

```swift
let textField = GDevTextField(frame: CGRect(x: 10, y: 10, width: 200, height: 45))
textField.titleText = "Name"
textField.placeholder = "Name"
self.view.addSubview(textField)
```

## Contributing

All contributions are welcome.

repository: gasigo/material-text-field

repo_name: gasigo/material-text-field


text:
# CodePlayer
An online judge system for competitive programming platform, The website is hosted on http://codeplayer.ninja

## Installation
The installation has been well tested to work on Ubuntu 16.04. Issues have been reported with installation on windows.
* Install latest version of docker in your system.
* Please pull two images `stepik/epicbox-gcc:6.3.0` and `python:3.6.5-alpine` using `docker pull <image_name>`
* Clone this project; actually you only require the `docker-stack.yml` file and the three `*.env` files : )
* Change the env variables in `worker.env`, `frontend.env` and `server.env` as per your required variables. Note the frontend service will start on port `80` only due to image.
* Run the command in terminal `docker swarm init` to initialize a docker swarm.
* Execute `docker stack deploy -c docker-stack.yml cp` and as easy as that.
* All the four services will be up and running in a few minutes (depending upon your internet connectivity).
* You can check for running service by command `docker service ls`
* Any of these four running services can easily be scaled by writing `docker service scale cp_<serive_name>=<number_of_replicas_required>`

## Features
* Micro-service based architecture makes it super simple to scale. Docker images can be found at https://hub.docker.com/saurass
* Untrusted code is run in one time use isolated docker container based sandboxes, which enhances security of the website.
* Socket IO for real time status update of our submitted code.
* Use of docker swarm for orchestration. Thus making clustering of resources and scaling of services super simple.

## Services
* The app has mainly four services running independently which can be scaled individually as per requirement.
  * Frontend - The frontend is made using ReactJS and uses Redis Client to connect with socket IO server.
  * Backend - Backed or API server is based on NodeJS. We are using MongoDB for database.
  * Compiler- Microservice - This microservice is responsible for compilation, execution and evaluation of our code. This is written in Python3 and uses docker socket API to interact with docker container and execute the code in isolated docker containers.
  * Redis server - This server is responsible to maintain submission queue and is used as adapter for socket IO server.

## WorkFlow
* The code is submitted and server pushes the corresponding submission data in Redis Queue.
* The compiler microservice which is also connected on socket IO server, starts evaluation of code and gives real time update on status of evaluation.
* The status is notified to client as well as the server in real time.

## Contribution
The repository is open to contributions, feel free to raise issues and make contributions. If you like what we do, Please do buy us a coffee, the setup can be found at home page of http://codeplayer.ninja


text:
# Transformer API

Transformers are used by the source plugins to parse content. They are automatically used as long as they are installed and found in `package.json`.

## Mime types

### `transformer.mimeTypes()`

A transformer must have a static `mimeTypes` method which returns an array of [mime types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) the transformer should be able to parse.

## Parse content

### `transformer.parse(source)`

A transformer must also implement a `parse` method that will be executed by source plugins to parse content. The method must return a node.

## Add GraphQL fields

### `transformer.extendNodeType()`

Transformers can also extend nodes in the GraphQL schema with additional fields by implementing a `extendNodeType` method. The fields will only be added to nodes it has transformed.

## Example

```js
class Transformer {
  static mimeTypes () {
    return ['application/json']
  }

  parse (source) {
    const { title, ...fields } = JSON.parse(source)

    return {
      title,
      fields
    }
  }

  extendNodeType ({ graphql }) {
    return {
      // custom GraphQL fields for transformed node
    }
  }
}

module.exports = Transformer
```

gha_language: Vue


text:
# Code Of  Conduct [ simple-react-setup ]

## Our Pledge

In the interest of fostering an open and inclusive environment, we, as contributors and maintainers, pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

- Being respectful and considerate of different viewpoints and experiences.
- Using welcoming and inclusive language.
- Gracefully accepting constructive criticism.
- Focusing on what is best for the community.
- Showing empathy towards other community members.

Examples of unacceptable behavior include:

- The use of offensive or derogatory language.
- Harassment or bullying of any kind.
- Publishing others' private information without explicit permission.
- Any behavior that would be considered inappropriate in a professional setting.

## Responsibilities of Project Maintainers

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that do not align with this Code of Conduct, and to ban temporarily or permanently any contributor for behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all project spaces, including the repository, issue trackers, discussion forums, social media channels, and any other public or private communication related to this project.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [insert project team contact email]. All complaints will be reviewed and investigated promptly and fairly.

Project maintainers are obligated to respect the privacy and security of the reporter of any incident.

## Attribution

This Code of Conduct is adapted from the Contributor Covenant, version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html

For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq

## Acknowledgment

We acknowledge that creating an open and inclusive community requires continuous effort from all contributors, and we appreciate your support in achieving this goal.

# Email Me : [ahr<EMAIL_ADDRESS>
# Visit ME : [ahroniy.me](https://ahroniy.me)

Happy Coding 🙃


text:
# @solid-primitives/countdown

[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)

Creates a countdown primitive based on supplied dates and interval.

## How to use it

```ts
const { days, hours, minutes, seconds, milliseconds } = createCountdown(
  new Date("January 1, 2025 00:00:00")
);
```

## Demo

You may view a working example here: https://codesandbox.io/s/create-countdown-s5f6n?file=/src/index.tsx

## Changelog

Expand Changelog

0.0.100

First commit of the countdown primitive.


text:
# Recipies for Development

In this section you will find useful code snippets and explanations.

## Yeoman
* [Run install](run-install.md)

## SPFx related
* [Inject custom gulp configuration and tasks](inject-gulp-tasks.md)
* [Deploy Web Part Content, Extensions and Customizer](deploy-custom-code.md)

repository: pnp/generator-spfx

repo_name: pnp/generator-spfx


text:
> https://fivethirtyeight.com/features/how-do-you-like-these-rectangles/

## Express

![img](https://espnfivethirtyeight.files.wordpress.com/2017/09/roeder-riddler-0922-1.png?w=575&h=444&quality=90&strip=info)

24/4 = 6 => width of the topmost rectangle.

Width of second rectangle = 6+3
=> Width of bottom most rectangle = 6+3+2 = 11
=> Height of bottom most rectanlge = 44/11 = 4

## Classic
![img](https://espnfivethirtyeight.files.wordpress.com/2017/09/roeder-riddler-0922-2.png?w=575&h=342&quality=90&strip=info)

Let's call the '?' area to be A.

Draw a small rectangle in the rectangle with are 34 of area 2. sharing an edge with rectangle of area 32. Extend this all the way to the lower rectangle.
Also complete the upper rectangle by extending it so that the top half consists of 4 rectangles with are 32, 2, 32 and A'. The bottom rectangle half consists of these rectangles: A, x, 32, 45-A-x

Now, using similar rectangles: 32/A = 2/x => x = A/16

Total area (after extending the top rectangle half) = 14 x 11

(32 + 2 + 32   + A') + (A + A/16 + 32 + 45-A-A/16) = 154

 => A+A' = 43 (1)

But similar rectangles again: 32/A = A'/(45-A-A/16)  (2)

Solving (1) and (2) gives a quadratic in A:

A^2- 77A + 32*45 = 0

=> A = 32 or 45

But 45-17A/16 > 0 so A cannot be 45.

Hence '?' = 32

repository: saketkc/riddler

repo_name: saketkc/riddler


text:
### [CVE-2007-1923](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-1923)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

(1) LedgerSMB and (2) DWS Systems SQL-Ledger implement access control lists by changing the set of URLs linked from menus, which allows remote attackers to access restricted functionality via direct requests.

### POC

#### Reference
- http://securityreason.com/securityalert/2552

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

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
#Delve

I don't know if it's my destiny to write syntactic skins. Other than the CoffeScript and MoonScript fellows, the notion isn't popular.

It's actually more popular than that, but most of them are sold as new languages. Adherence to the original semantics isn't normally considered a virtue.

Okay. Delve is a Clu project off the main path but damn, I really want it. It's an s-expression C.

Why? Well, C is great and every extension of it is an attempt to automate things that are idiomatic in C.

Nothing ANSI C provides is available as a runtime. Anything else is more like a preprocessor than a compiler, though since it's all in S-expressions and the compile time stage is Lispy two times over, since it's run by Clu and it's Sexprs. You could call it SexC and I wouldn't stop you but the name is Delve. I'll let you guess why.

There's not much to add except I intend to use cryptics: Anything in the standard keyword plane can be written using two or three glyphs in combination. Everything built out of letters is available to the user, redefining cryptics must be flag enabled and is normally illegal. This is a tool for advanced users. Cryptics are exactly equivalent to their plain English cousins and you can filter them into such if you insist, just watch your namespace hygiene.

```lisp

(defn foo {char bar uint_least8_t baz} int ( ; void return may be ommitted
  (set global bar)
  (ret (>> baz 4))))

```

```c
int function foo(char bar, uint_least_8_t baz) { // this would have the same comment
	global = bar;
	return baz >> 4;
}

repository: mnemnion/loon

repo_name: mnemnion/loon


text:
---
title: container_fs_limit_bytes
brief: Number of bytes that the container may occupy on this filesystem.
metric_type: gauge
---
### container_fs_limit_bytes

Number of bytes that the container may occupy on this filesystem.

gha_language: Python


text:
---
path: "/services/managed-portfolios"
date: "31/07/19"
title: "Discretionary Managed Portfolios"
type: "service"
---

Based on a detailed understanding of what you want to achieve and the risks you are willing to take, we create portfolios which enable you to focus on Asian markets or achieve more global exposure, providing a comprehensive choice of investment and currency options.

The portfolios we create for our clients invest exclusively in carefully selected, actively managed funds, harnessing the expertise of some of the best fund managers and investment companies around the world to capture opportunities across all global markets and asset classes.

Your diversified, discretionary portfolio may incorporate a mix of established proven brands across the spectrum of asset classes - domestic, international and emerging market fixed income and equities, as well as alternative investments - based on your individual needs.

* Global liquidity including multi-currency
* Domestic, global and emerging markets fixed income
* Domestic, global and emerging markets equities
* Multi-asset programmes
* Alternative investments – discretionary hedge fund portfolios and advisory hedge portfolios

Please get in touch with one of advisors here at RP Financial to find out more.


text:
# Basic voltha setup
Assumes a running k8s environment.  Only installs yaml files specific to voltha

## Stage local persistent directories

Needed to simulate persistent storage for various dependent services
```
sudo mkdir -p /var/lib/voltha-runtime/etcd
sudo mkdir -p /var/lib/voltha-runtime/consul/data
sudo mkdir -p /var/lib/voltha-runtime/consul/config
sudo mkdir -p /var/lib/voltha-runtime/fluentd
sudo mkdir -p /var/lib/voltha-runtime/kafka
sudo mkdir -p /var/lib/voltha-runtime/zookeeper/data
sudo mkdir -p /var/lib/voltha-runtime/zookeeper/datalog
sudo mkdir -p /var/lib/voltha-runtime/onos/config
sudo chown -R $(id -u):$(id -g) /var/lib/voltha-runtime
```

## Git clone ATT voltha.

Contains deployment yaml for specific pods and services.  And other goodies.
Checkout repo, if not done already.
```
mkdir -p ~/source
cd ~/source
git clone https://github.com/donNewtonAlpha/voltha.git
cd ~/source/voltha/k8s/
```

## Install ingress and namespace

```
kubectl apply -f namespace.yml
kubectl apply -f ingress/
```

## BASE COMPONENTS

This process will manually apply k8s yaml files to deploy the environment.  This does NOT use helm.

Install non-voltha specific software components.
These files have been edited to reflect persistent environment
```
kubectl apply -f foundry-node/zookeeper_persist.yml
kubectl apply -f foundry-node/kafka_persist.yml
kubectl apply -f foundry-node/etcd_persist.yml
kubectl apply -f foundry-node/fluentd.yml
```

Verify pods startup, describe and get logs on select ones
```
kubectl get pod -n voltha
kubectl describe pod kafka-0 -n voltha
kubectl describe pod etcd-0 -n voltha
```

Verify mount binds are writing data
```
ls -atlrR /var/lib/voltha-runtime/
```

## VOLTHA CORE AND ACCESSORY CONTAINERS

Actual pods needed to run voltha. Edited to reflect ATT foundry docker repo
```
kubectl apply -f foundry-node/vcore_for_etcd_repo.yml
kubectl apply -f foundry-node/ofagent_repo.yml
kubectl apply -f foundry-node/envoy_for_etcd_repo.yml
kubectl apply -f foundry-node/vcli_repo.yml
kubectl apply -f foundry-node/netconf_repo.yml
```

Edit onos network config to reflect your OLT hardware.  Otherwise copy as-is.  Install onos needed to drive the voltha "switch"
```
cp ~/source/voltha/onos-config/network-cfg.json /var/lib/voltha-runtime/onos/config/
kubectl apply -f foundry-node/onos_repo.yml
```

Verify all pods
```
kubectl get pods -n voltha
```

Check health, vcore is the big one
```
kubectl get pods -n voltha   # choose pod name to investigate
kubectl describe pod <pod-name> -n voltha
kubectl log <pod-name> -n voltha -f --tail=20
```

Get service ip, either NodePort or ClusterIP, and connect to CLI services.
```
kubectl get svc -n voltha  # note the vcli clusterIP, and the onos clusterIP

# voltha, password admin
ssh -p 5022 voltha@<vcli-cluster-IP>
## run "devices" to verify connectivity to etcd.  you should see "table empty"
## type quit to exit voltha shell

# onos, password karaf
ssh -p 8101 karaf@<onos-cluster-IP>
## run "netcfg" to verify
## type logout to exit onos shell
```

At this point voltha and its required pods are running.  Use the CLI or API to add your OLT "linecard".  We typically use EdgeCore OLT devices.

## USEFUL SCRIPTS AND ALIASES

Add an entry called master0 into your hosts file.  This is to stay consistent with cluster naming later:
```
localip=$(ip addr show dev eth0|grep "inet "|awk '{ print $2 }' |cut -d'/' -f1)
sudo bash -c "echo \"${localip}     master0\" >> /etc/hosts"
```

Add this to your .bashrc file for ease of system usage.
```
export EDITOR=vi
export HELM_HOME=/home/foundry/.helm
export ETCDCTL_API=3

source <(kubectl completion bash)
alias purge='~/source/voltha/k8s/foundry-node/scripts/etcd-clean.sh purge'
alias onos='ssh-keygen -f "/home/foundry/.ssh/known_hosts" -R [master0]:30115; ssh -p 30115 -o StrictHostKeyChecking=no karaf@master0'
alias vcli='ssh-keygen -f "/home/foundry/.ssh/known_hosts" -R [master0]:30110; ssh -p 30110 -o StrictHostKeyChecking=no voltha@master0'
alias kgp='kubectl get pods --all-namespaces -o wide'

kol ()
{
    pod=$(kubectl get pods -n voltha |grep onos |grep Running | awk '{print $1}');
    kubectl logs $pod -n voltha $@
}
kvl ()
{
    pod=$(kubectl get pods -n voltha |grep vcore |grep Running | awk '{print $1}');
    kubectl logs $pod -n voltha $@
}
```

purge clears etcd data and delete/re-applys pods.  Good for development cycle iteration.
vcli alias accesses voltha cli.
onos alias accesses onos cli.
kgp gets kubernetes pods without all the typing.
kvl get vcore's log.
kol get onos' log.

## TO BUILD CONTAINERS

If need to modify code or build your own Docker image follow these steps.
```
sudo apt-get update
sudo apt-get install build-essential virtualenv python-dev python-pip python libssl-dev libpcap-dev python-netifaces \
python-virtualenv python-urllib3 python-nose python-flake8 python-scapy

cd ~/source/voltha

. env.sh
make install-protoc
make build

# Next time if you just want to rebuild the voltha container
. env.sh
make build voltha
```

repository: donNewtonAlpha/voltha

repo_name: donNewtonAlpha/voltha


text:
# RoEngine
> A library mainly for pygame and twisted.

You can find the GitHub Repository
[here](https://github.com/ROTARTSI82/RoEngine).


text:
# nodeExpressRedisJade

A basic example showcasing a Redis Database with server side rendering

## Installation

First make sure you already have Redis installed. Clone the repository, then

```
cd nodeExpressRedisJade

redis-server

npm install

npm start
```

And your app should be running on http://localhost:3000 .

## Reference

https://github.com/john-guerra/nodeExpressRedisJade

repository: michelle-duan/NodeRedis

repo_name: michelle-duan/NodeRedis


text:
---
title: Bucardo removetable
permalink: /Bucardo/removetable/
---

To remove a table or a sequence from an existing sync:

` bucardo_ctl update sync `<syncname>` remove table foobar`
` `
` bucardo_ctl update sync `<syncname>` remove sequence foobar_seq`

This will not change any running syncs: to do that, you should run:

` bucardo_ctl reload `<syncname>


text:
## Description:

Two-Factor authentication and Step-up authentication

MSTG-AUTH-9: A second factor of authentication exists at the remote endpoint and the 2FA requirement is consistently enforced.

MSTG-AUTH-10: Sensitive transactions require step-up authentication.

Two-factor authentication (2FA) is standard for apps that allow users to access sensitive functions and data. Common implementations use a password for the first factor and any of the following as the second factor:

	- One-time password via SMS (SMS-OTP)
	- One-time code via phone call
	- Hardware or software token
	- Push notifications in combination with PKI and local authentication

## Mitigation:

Whatever option is used as 2nd factor, it always must be enforced and verified on the server-side and never on client-side. Otherwise the 2nd factor can be easily bypassed within the app.

The secondary authentication can be performed at login or later in the user's session. For example, after logging in to a banking app with a username and PIN, the user is authorized to perform non-sensitive tasks. Once the user attempts to execute a bank transfer, the second factor ("step-up authentication") must be presented.


text:
---
title: "About"
draft: false
standalone: true
weight: 2
---

# What is this?

My website.  _My_ website.  As in, it's personal to me.  If I happen to be employed at some point, nothing I write here necessarily reflects anything anyone employed by my employer wouldn't be horrified at.  Or would.

Unless I'm self-employed again.

Don't try to find who my employer is, unless you're going out of your way to harm my real life livelihood, in which case, go for it.  There's nothing anyone can say to you to make you see sense.

# Who are you?

Adam Barnes.  Programmer, weeb, general living pestilence.

I grew up as introverts do, turning to computers (and games).  I assumed programming was something only accessible to big businesses who could spend thousands of pounds on software licenses for whatever tools it is you need to program.  When I was 13, however, I found out that programming was something one could do for free, thanks to a copy of Visual Studio Express Edition on a disc that came with a magazine, (which also contained a VB.NET tutorial).

I moved quickly on from that to Python2 where I stayed until it was reasonable to use Python3.  Once I had a job in the industry, it became apparent knowing _only_ Python wasn't quite good enough, and I picked up supporting skills for web development.

If you're looking for a Python or React tutor, [hit me up]({{< ref "contact" >}}).  I'm always interested in teaching.

My favourite anime are [Hibike! Euphonium](https://www.crunchyroll.com/sound-euphonium), and [Code GEASS](https://www.hulu.com/series/code-geass-1858aace-a7fb-4d6f-b770-61dc121185b4).  My favourite films are the [Matrix](https://www.imdb.com/title/tt0133093/?ref_=fn_al_tt_1) trilogy.  My favourite music changes by the second, (but [GYARI](https://www.youtube.com/watch?v=czizBiAhHiI) is doing well at the moment).

Since late 2019, I have been particularly interested in VTubers.  My favourite is [角巻わため (Tsunomaki Watame)](https://www.youtube.com/channel/UCqm3BQLlJfvkTsX_hvm0UmA) by far, following behind her is everyone else in hololive, a couple from Nijisanji, and a lot of indies.  From them I've [learnt the Japanese that I know so far]({{< ref "on-language" >}}), which isn't much, but it's also not nothing.

Reasonable contact details are over at [contact]({{< ref "contact" >}}) in the sidebar, and this site is reposited<sup>?</sup> at [github](https://github.com/asday/righttobeoffensive.com), where you can crack open an issue or a pull request should the fancy strike you.


text:
# Cram

This project is the home to **Cram - Complete Ratings of All Movies** for Android.

Started off as a canvas to explore the new Android Libraries and Material Design.

## License

    Copyright 2015 Avinash Hindupur

    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.

repository: cequencer/showtime

repo_name: cequencer/showtime


text:
---
title: 'Liskov substitution principle'
date: 2020-08-17 16:34:00
author: 'Aneesh Mistry'
subtitle: 'The Liskov substitution principle emphasises the importance to inspect the behaviours that subclasses inherit from their parents to ensure they can be completely substitutable for all instances of the parent.'
time: '5'
tags:
- Patterns
- Java
---

Key Takeaways

• Understand the importance of the Liskov substitution principle to inheritance and shared class behaviour.

• Review the rules that ensure the inherited behaviours of subclasses from their parents are as expected.

• Design tests to ensure the behaviour of a parent class is not modified by its subclasses.

What is the Liskov Substitution Principle?

Introduced by Barbara Liskov, the Liskov substitution principle (LSP) is used to decide when it is appropriate to extend a class as opposed to other strategies of abstraction to achieve the goal of shared properties between classes. As we have seen in the previous blog, the open-closed principle can be used to abstract the behaviours of a method; the Liskov substitution principle is used to extend upon the design by contract approach where the behaviour of the class is the primary concern.

The Liskov substitution principle is used to make assertions upon the substitution of behaviours that are implied by a subclass from its parent.
When a class is extended, we are in effect implying that the subclass "IS A" extension of the parent class. While the open-closed principle is a focussed upon the structure of a class, LSP promotes strong behaviour sub-typing of classes to the parent class to ensure the expected behaviour of the methods are applicable to the extension.

The below quote is often used to describe the importance of behaviours between inherited classes:

"If it looks like a duck, quacks like a duck, but needs batteries - you probably have the wrong abstraction"

Liskov Substitution by design

When we use inheritance to share class methods and properties, we are implying that the subclass can be used to replace instances of the parent class.

The LSP asserts three rules when applying inheritance with subclasses:

• The subclass cannot enforce stricter rules than the parent class.

• The return value of a subclass method can only differ as a subclass of the return type from the parent.

• The subclass of a parent must be completely capable of substitution for its parent across each behaviour.

Implementing LSP by design

If we reflect upon the rules above, the first two can be validated through the Java compiler and are therefore inherent with Java.
A problem can arise with ensuring the behaviour of each method is appropriate for the subclass of the parent.

Demonstration: Is a Penguin a bird?

The below code example demonstrates how easily behaviour can be modified from the intuition that a subclass IS AN extension of a parent class. When we design an application of Birds, Penguins, and Seagull Objects, we may reflect upon the use of class inheritance by saying, out loud, "a Penguin is a Bird, and a Seagull is also a Bird". In our source code, we may therefore create the Seagull and Penguin as subclasses of Bird.

![Image of the classes](../../src/images/020_bird.png)

```java{numberLines:true}
class Bird{
    private boolean hasWings = true;

    public void fly(){

    }
    public boolean getWings(){
        return this.hasWings;
    }
}

class Penguin extends Bird{

}
class Seagull extends Bird{

}
```

In our example above, we have confused the properties of the Bird class with the behaviours of the Bird class when creating the Penguin class. The Penguin is a bird because it has the properties of a bird: it has wings, lays hard-shelled eggs etc. However the Penguin does not behave like a bird in the sense that it cannot fly.

The LSP has been breached as the Penguin class is now capable of calling the .fly() method; a behaviour that should not be possible.

Complying with LSP

To resolve the problem, the behaviour of the Bird class can be further split into two: BirdCanFly and BirdCannotFly:

```java{numberLines:true}
class BirdCanFly{
   private boolean hasWings = true;

    public void fly(){

    }
    public boolean getWings(){
        return this.hasWings;
    }
}

```
```java{numberLines:true}
class BirdCannotFly{

   private boolean hasWings = true;

    public boolean getWings(){
        return this.hasWings;
    }
}
```

The Penguin and Seagull can now extend the appropriate class to obtain the Bird properties with and without the flying behaviours:

```java{numberLines:true}

class Penguin extends BirdCannotFly{

}

class Seagull extends BirdCanFly{

}

```

The example above illustrates the potential conflict that can arise with the implied substitution from inheritance. The behaviours of flying can be further imposed by the parent class with methods such as "getTopFlightSpeed" and "land" that would imply further irrelevance for the Penguin class without the redefined BirdCannotFly class. The

Conclusion

The LSP is applied to application design when we consider the behaviours of classes that are inherited from other parent classes. Inheritance is one of the most valuable OOP concepts and therefore LSP is an important consideration to make upon child classes whenever a class is extended.

While it may seem natural to extend classes that fit into the "IS A" Object construct, we must consider how the behaviours of a class are inherited, and not just the properties. LSP can be implemented by reviewing the behaviours each class will inherit before adding behaviours to a parent class or extending them, or they can be implemented through unit testing of a parent class with each of their child classes.

Series link: Go to the next SOLID principle: Interface segregation Principle