text:
# README

# Overview
Simple Inventory Management System provides a way to simply manage inventory levels in multiple distribution centers.

# REST Resources
There are three main resources:
* __Products:__ A unique type of an item, such as a Toyota Corolla or iPhone 6s gold model A1634.
* __Distribution Centers:__ Physical places that stores inventory.
* __Inventory:__ An inventory item represents a specific product in a specific distribution center. For example, an inventory item might contain the information on how many Toyota Corollas are available and reserved at the Japan distribution center.

# Available REST Routes
|Verb  | URI Pattern | Description |
|------|-------------|-------------|
|GET   | /products   | List all products. |
|GET   | /products/:id | Get the info for the product with the specified id. |
|GET   | /distribution_centers  | List all distribution centers |
|GET   | /distribution_centers/:id | Get the info for the distribution center with the specified id. |
|GET   | /distribution_centers/:distribution_center_id/inventory/report | Report displaying the current stock on hand and current pending shipped inventory in json format. (This is a shortcut to report_as_json URI below.) |
|GET   | /distribution_centers/:distribution_center_id/inventory/report_as_json | Report displaying the current stock on hand and current pending shipped inventory in json format. |
|GET   | /distribution_centers/:distribution_center_id/inventory/report_as_csv | Report displaying the current stock on hand and current pending shipped inventory in csv format. |
|GET   | /distribution_centers/:distribution_center_id/inventory | List all inventory  |
|GET   | /distribution_centers/:distribution_center_id/inventory/:id | Get info for inventory item specified by id. |
|PATCH | /distribution_centers/:distribution_center_id/inventory/:id/add_to_available_amount | Add to the current stock on-hand for the specified inventory item. |
|PATCH | /distribution_centers/:distribution_center_id/inventory/:id/remove_from_available_amount | Remove from the current stock on-hand for the specified inventory item. |
|PATCH | /distribution_centers/:distribution_center_id/inventory/:id/reserve | Reserve some or all of the available on-hand stock for the specified inventory item. |
|PATCH | /distribution_centers/:distribution_center_id/inventory/:id/move_reserved_back_to_available | Move reserved stock back to available/on-hand stock for the specified inventory item. |
|PATCH | /distribution_centers/:distribution_center_id/inventory/:id/remove_reserved | Remove reserved stock (such as due to it being shipped out) for the specified inventory item. |

# How to Install Ruby on Rails (If needed)
[Follow the guide here to install Ruby on Rails for your chosen OS](http://installrails.com/)

# Simple Deployment in a development environment
1. Clone repository.
```
git clone https://github.com/appaulo14/simple-inventory-management-system.git
```
2. cd to the newly cloned repository.
```
cd simple-inventory-management-system
```
3. Install the gems for the application.
```
bundle install
```
4. Create the database.
```
rails db:migrate
rails db:migrate RAILS_ENV=test
```
5. Generate the seed data.
```
rails db:seed
```
6. Confirm tests pass.
```
rails spec
```
7. Start the server in development mode.
```
rails s
```

# Production Deployment
For production deployment, Ruby on Rails is commonly deployed to a cloud provider such as Amazon Web Services (AWS) or Microsoft Azure for improved scalability, availability, cost, deployment time, and many other benefits.

Below are two guides for deploy on AWS and Azure respectively:
* [Creating and Deploying Ruby Applications on AWS Elastic Beanstalk](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Ruby.html)
* [Build a Ruby and Postgres web app in Azure App Service on Linux](https://docs.microsoft.com/en-us/azure/app-service/containers/tutorial-ruby-postgres-app)

### Testing Performance in a Production-Simulation Environment
One tool that can be used to measure the performance and do load testing of the deployed web application is [httperf](https://github.com/httperf/httperf). This should be run on a deployment as similar as possible to the production environment but not on the production environment itself. See [Performance Testing With httperf](http://www.mervine.net/performance-testing-with-httperf) for more best practices and tips.

### Additional AWS Best Practices
* [AWS Web Hosting Best Practices](https://d1.awsstatic.com/whitepapers/aws-web-hosting-best-practices.pdf)
* [AWS Cloud best practices](https://d1.awsstatic.com/whitepapers/AWS_Cloud_Best_Practices.pdf)
* [AWS guidelines for both horizontally and vertically scaling relational database](https://aws.amazon.com/blogs/database/scaling-your-amazon-rds-instance-vertically-and-horizontally/)
* [AWS Cloud Architecture Guidelines in 5 Pillars (Operational Excellence, Security, Reliability, Performance Efficiency, Cost Optimization)](https://d1.awsstatic.com/whitepapers/architecture/AWS_Well-Architected_Framework.pdf)

### Additional Azure Best Practices
* [Azure reference architecture for scale-able web applications](https://docs.microsoft.com/en-us/azure/architecture/reference-architectures/app-service-web-app/scalable-web-app)
* [Scaling out with Azure SQL database](https://docs.microsoft.com/en-us/azure/sql-database/sql-database-elastic-scale-introduction)

# Further Possible Enhancements
* More race-condition/load/stress testing.
* Add more validation for the amount attribute to the app/api_model/inventory/* classes as a first line of defense. The existing database constraints are the last line of defense.
* Switch from SQLite to a more production-ready data such as PostgreSQL or MySQL and tune settings/indexes appropriately.
* Batch update to reduce the number of requests against the server.
* Look for ways to optimize queries more.
* Look for more shared test code to move into shared_examples.rb files.
* Authentication/Authentication
* Allow client to filter and pagination results.
* Allow inventory to be referenced by distribution-center-specific ids.
* Addition/update/deletion of products/distribution centers/inventory items as needed.
* Move this list to the Issues section of this GitHub repo.

gha_language: Ruby


text:
# Amalia Rover Gazebo Model

![Amalia Rover Gazebo Model](/uploads/amalia_rover_gazebo_model.png)

In order to control the vehicle more easily, use the [generic_input_controller](generic_input_controller.md)

## Components
---
The rover is defined with [xacro](wiki.ros.org/xacro) and [sdf 1.5](http://osrf-distributions.s3.amazonaws.com/sdformat/api/1.5.html).

![Amalia Rover components](/uploads/gazebo-composable-models.png)

## Plugins
---
The enabled plugins are:

- Skid Steer
  virtualizes all the powertrain.
- Multicamera
  virtualizes the stereo cameras.
- Depth Camera
  virtualizes the ToF camera.
- [Joint Commander](joint_commander_plugin.md)
  virtualizes the pan-tilt.
- [Dynamixel Motor Plugin](gazebo_amalia_rover_suspensions.md)
  virtualizes the active suspensions system.

These plugins can be installed via [our repository](team_diana_ubuntu_repo.md#Add_the_repository), and then installed with the commands listed [here](getting_started.md#Install_Team_Diana_Packages)

## SDF
---
The sdf file is available [here](https://raw.githubusercontent.com/team-diana/gazebo-models/master/models/rover_amalia/model.sdf) and is ready to be used in Gazebo.

![Amalia Rover gazebo model with joints](/uploads/amalia_rover_gazebo_model_joints.png)

*the sdf model with its joints*

## URDF
The urdf is available [here](https://raw.githubusercontent.com/team-diana/gazebo-models/master/urdf/rover_amalia/model.urdf)

The urdf is us created using [team-diana/sdf2urdf](https://github.com/team-diana/sdf2urdf)

warning: the converter is not completed yet, and the converted urdf model still needs manual modifications.

In order to use the urdf model, use the [launch files](https://github.com/team-diana/gazebo-models/tree/master/urdf/rover_amalia)

```bash
# Run the robot_state_publisher:
roslaunch robot_state_publisher.launch

# Run rviz with the same urdf model:
roslaunch rviz.launch
```

The **rover amalia** model publishes all the joint_states but **map -> odom** and  **base_footprint -> rover_amalia_chassis**
which can be published with **static_transform_publisher**

```bash
rosrun tf static_transform_publisher 0 0 0 0 0 0 map odom $(( 1000/30)) &
rosrun tf static_transform_publisher 0 0 0 0 0 0 base_footprint base_link $(( 1000/30)) &
python2 odom_publisher.py odom base_footprint /rover_amalia/odom
python2 imu_tf_broadcaster.py base_link rover_amalia_chassis /imu_data
```

## Troubleshooting

### Check that the tree of transform has only one root:

```bash
rosrun tf view_frames
# View the created pdf document:
evince frames.pdf
```
the expected tf tree should look like this:

![gazebo tr tree](/uploads/gazebo_tf_tree.png)

## Videos

[Rover Amalia - Gazebo and Rviz](https://drive.google.com/file/d/0B095UfSp5Q4USUNadGhFNHdpZk0/view?usp=sharing)

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
1529. Bulb Switcher IV

Medium

There is a room with n bulbs, numbered from 0 to n - 1, arranged in a row from left to right. Initially, all the bulbs are turned off.

Your task is to obtain the configuration represented by target where target[i] is '1' if the ith bulb is turned on and is '0' if it is turned off.

You have a switch to flip the state of the bulb, a flip operation is defined as follows:

Choose any bulb (index i) of your current configuration.

Flip each bulb from index i to index n - 1.

When any bulb is flipped it means that if it is '0' it changes to '1' and if it is '1' it changes to '0'.

Return the minimum number of flips required to form target.

Example 1:

Input: target = "10111"
Output: 3
Explanation: Initial configuration "00000".
flip from the third bulb:  "00000" -> "00111"
flip from the first bulb:  "00111" -> "11000"
flip from the second bulb:  "11000" -> "10111"
We need at least 3 flip operations to form target.

Example 2:

Input: target = "101"
Output: 3
Explanation: "000" -> "111" -> "100" -> "101".

Example 3:

Input: target = "00000"
Output: 0

Example 4:

Input: target = "001011101"
Output: 5

Constraints:

1 <= target.length <= 105

target[i] is either '0' or '1'.

repository: itzpankajpanwar/Leetcode

branch_name: refs/heads/main

repo_name: itzpankajpanwar/Leetcode


text:
---
title: CreateWebChatConversationRequest
---
## ININ.PureCloudApi.Model.CreateWebChatConversationRequest

## Properties

|Name | Type | Description | Notes|
|------------ | ------------- | ------------- | -------------|
| **OrganizationId** | **string** | The organization identifier. | |
| **DeploymentId** | **string** | The web chat Deployment ID which contains the appropriate settings for this chat conversation. | |
| **RoutingTarget** | [**WebChatRoutingTarget**](WebChatRoutingTarget.html) | The routing information to use for the new chat conversation. | |
| **MemberInfo** | [**GuestMemberInfo**](GuestMemberInfo.html) | The guest member info to use for the new chat conversation. | |
| **MemberAuthToken** | **string** | If the guest member is an authenticated member (ie, not anonymous) his JWT is provided here. The token will have been previously generated with the \"POST /api/v2/signeddata\" resource. | [optional] |
| **JourneyContext** | [**JourneyContext**](JourneyContext.html) | A subset of the Journey System's data relevant to this conversation/session request (for external linkage and internal usage/context). | [optional] |
{: class="table table-striped"}

repository: MyPureCloud/platform-client-sdk-dotnet

gha_language: C#

gha_license_id: MIT

repo_name: MyPureCloud/platform-client-sdk-dotnet


text:
# Class Component Iterating State

Another common state pattern you'll see being used in React components is iterating over an array in our state object and rendering each array element in its own tag. This is often used in order to render lists.

Additionally, we want to be able to easily update lists and have React re-render our updated list. We'll see how both of these are done and how they work together within a single component in order to create the behavior of a dynamic list.

```
import React, { Component } from 'react';

class ClassComponentIteratingState extends Component {
    constructor() {
        super();

        this.state = {
            ingredients: ['flour', 'eggs', 'milk', 'sugar', 'vanilla extract'],
            newIngredient: ''
        };
    }

    handleIngredientInput = (event) => {
        this.setState({ newIngredient: event.target.value });
    };

    addIngredient = (event) => {
        event.preventDefault();
        const ingredientsList = this.state.ingredients;
        ingredientsList.push(this.state.newIngredient);
        this.setState({
            newIngredient: '',
            ingredients: ingredientsList
        });
    };

    render() {
        return (
            <div>
                {this.state.ingredients.map(ingredient => <div>{ingredient}</div>)}
                <form onSubmit={this.addIngredient}>
                    <input type="text" onChange={this.handleIngredientInput} placeholder="Add a new ingredient" value={this.state.newIngredient} />
                </form>
            </div>
        );
    }
}

export default ClassComponentIteratingState;
```

The first change to note is that our state object now has an 'ingredients' array, and a 'newIngredient' field that has been initialized to an empty string. The ingredients array contains the elements that we'll want to render in our list. We'll see shortly why the newIngredient field is needed.

The `addIngredient` and `handleIngredientInput` methods we've added to our class receives a parameter called 'event'. This event object is part of the browser's API. When we interact with some DOM element, such as clicking on an HTML button, the function that is invoked upon that button being clicked actually receives the event object. So when we type some input into an input tag, we're able grab each character that was typed into the input field through the event object paramter.

The `handleIngredientInput` method is what gets invoked every time the user presses a key to enter text in the input box for adding a new ingredient. Every character the user types gets persisted in the `newIngredient` field on the state object. We're able to grab the text in the input box using `event.target.value`, which holds the value of the string text that is currently in the input box. We use that to update our `newIngredient` string field.

Breaking down the `addIngredient` method, we see this `event.preventDefault()` invocation. This is because this method will be used upon submitting a form, and it turns out that submitting a form triggers some default form behavior that we don't want to trigger when we submit the form (namely refreshing the entire page). `event.preventDefault()` will prevent this default form behavior, meaning our form will only do what we want it to do when it is submitted.

Next, we store a reference to `this.state.ingredients` in a variable called `ingredientsList`. So we now have a copy of the array that is stored in our state object. We want to update the copy of the ingredients array first instead of directly updating the actual array itself in state. This is a React best practice.

Now we push whatever value is being stored at our `newIngredient` field onto the `ingredientsList` array so that our `ingredientsList` array is now more up-to-date than our `this.state.ingredients` array. So all we have to do now is call `setState` appropriately in order to update the value in our state object. Additionally, we also set the `newIngredient` field back to an empty string in order to clear out the input field once we submit a new ingredient. Now it's ready to accept more user input!

Looking at our render function, first note the `this.state.ingredients.map` call. This is looping through each ingredient in our `ingredients` array and returning each one within its own div tag. This is a very common syntax for rendering everything inside an array.

Then we have an HTML form which contains an input field. The purpose of this form is to allow a user to add new ingredients to the list. Note that we're passing our `addIngredient` method to the form's `onSubmit` handler. This means that our `addIngredient` method gets invoked whenever our form is submitted.

Lastly, the input field has an `onChange` handler that invokes our `handleIngredientInput` method whenever there is some sort of change in the input field, namely when a user types into it. Notice that the `value` field in our input tag reads off of `this.state.newIngredient` in order to know what value to display. So when a user enters text into the input field, the `onChange` handler is invoked every time, which updates our `this.state.newIngredient` field, which the input field
then renders.


text:
# React plugin for [Desech Studio](https://www.desech.com/)

[www.desech.com](https://www.desech.com/)

## Install

- In Desech Studio
  - Go to Settings > Plugins > React and install it
  - Go to File > Project Settings > Export Code Plugin > set to "React"
- Using a design system works with this plugin, because we copy over all the css/js files.

## Test the react app

- In Desech Studio add an element to the canvas and Save.
- Every time you save, the react app files will be copied over to the `_export` folder of your desech project.
- There you can run the following, to test the react app:

```sh
npm install --force
npm start
```

- Now you can access you react app at `http://localhost:3000/`
- Every time you save inside Desech Studio, it will push updates to the react app

## Desech Studio integration

### React attributes/properties

- Inside Desech Studio there are 2 places where you can add react attributes/properties:
  - when you click on a component
  - when you click on an html element in the HTML section > Element properties
- Here you can set any react specific attributes like `tabIndex`, `onClick`, `dangerouslySetInnerHTML`, etc.
  - If you set `className` it will be added to the existing classes set by `Desech Studio`
- To use `if conditions` or `for loops` you need to use `reactIf` or `reactFor`, similar to how angular and vue works:
  - `reactIf` with `users.length > 0` will export this react code:
    - `{users.length > 0 && <div>...</div>}`
  - `reactFor` with `users :: user` will export this react code:
    - `{users.map(user => <li>...</li>)}`
    - Please remember to add a `key` property too, for example `key` = `{user.id}`
  - `reactIfFor` with `users.length > 0 :: users :: user` will export this react code:
    - `{users.length > 0 && users.map(user => <li>...</li>)}`
  - `reactForIf` with `users :: user :: user.id > 0` will export this react code:
    - `{users.map(user => user.id > 0 && <li>...</li>}`
  - You can only have one of these properties at one time. You can't have both `reactIf` and `reactFor` for example. Instead use `reactIfFor` or `reactForIf`
  - As you have noticed the split string between these values is a ` :: ` - double colon with spaces in between.

### Tips

- Make sure you set an `alt` value for images, otherwise react will complain about it
- `checked` html attributes are removed; instead use the property `defaultChecked`
- `selected` html attributes are removed; instead use the property `value` in the `select` element instead of the `option` element
- Anywhere inside text you can write code like `{user.userId}` and it will be exported as react JSX code
- SVG code inside html is poorly supported by JSX, so it's best to include svg as images

- That's it. Ignore the rest if you don't plan on doing development on this plugin.

## Plugin Development

If you plan on helping out with code or extend this plugin, do the following:

- delete everything in the `dist` folder so we can restart the build process

```sh
cd /~/somewhere-but-not-inside-the-plugin-folder
git clone https://github.com/facebook/create-react-app
npx create-react-app my-app
cd my-app
npm run eject
npm install react-router-dom
```

- Cleanup

```sh
rm -rf node_modules public .git package-lock.json yarn.lock
cd src
rm -rf App* index.css logo.svg
```

- open the `src/index.js` file and delete the `import './index.css';` line
- move the `my-app` folder to the plugin `dist` folder
- you can delete the `create-react-app` folder and anything you setup for it

```sh
cd /~/user/.config/Electron/plugin/desech-studio-react
npm install
```

## Included npm packages

All Desech Studio plugins have access to the following npm libraries, because they come with the application:
- `lib.AdmZip` [adm-zip](https://www.npmjs.com/package/adm-zip)
- `lib.archiver` [archiver](https://www.npmjs.com/package/archiver)
- `lib.fse` [fs-extra](https://www.npmjs.com/package/fs-extra)
- `lib.jimp` [jimp](https://www.npmjs.com/package/jimp)
- `lib.beautify` [js-beautify](https://www.npmjs.com/package/js-beautify)
- `lib.jsdom` [jsdom](https://www.npmjs.com/package/jsdom)
- `lib.fetch` [node-fetch](https://www.npmjs.com/package/node-fetch)

## Other Documentation

- Go to [facebook/create-react-app](https://github.com/facebook/create-react-app) to read the documentation.

## Desech Studio website

 - [www.desech.com](https://www.desech.com/)

repository: youngjid/studio-react

repo_name: youngjid/studio-react


text:
# Data Doser
This script creates a sequence of test files and delivers or doses them into an S3 bucket at random times over a period of time.

## Usage
To make the data doser:

```python doser.py --chunks 5 --duration 100 --numfiles=20```

## Prerequisites
A working s3 bucket configured that you can write to.

gha_language: Python


text:
# Exercises related to Non-Monotonic Reasoning and Answer Set Programming

These are exercise questions about *non-monotonic reasoning and answer set programming* that you can use
to get a better understanding of the material related to this topic.
The solutions to these exercise questions are not published here, but you are free
to ask about the solutions (e.g., on the [course Canvas page](https://canvas.uva.nl/courses/10768))
if you get stuck and you are free to discuss these exercise questions and their solutions
with other students in the course.

Moreover, these exercise questions are indicative of the type of questions that
you can expect on the final exam.

---

## Exercise 2.1: Strong Equivalence in Answer Set Programming

### Exercise 2.1.a

Consider the following two logic programs *P1* and *P2*.
Are these strongly equivalent
(see Definition 7.3.10 in [[Van Harmelen, Lifschitz, Porter, 2008]](https://github.com/rdehaan/KRR-course#hokr))?
If so, explain why this is the case.
If not, give a program *P* such
that *P ∪ P1*
and *P ∪ P2* have different answer sets.

The program *P1*:
```
a :- b.
b :- c.
c :- a.
```

The program *P2*:
```
a :- b.
b :- a.
a :- c.
c :- a.
```

### Exercise 2.1.b

Consider the following two logic programs *P1* and *P2*.
Are these strongly equivalent
(see Definition 7.3.10 in [[Van Harmelen, Lifschitz, Porter, 2008]](https://github.com/rdehaan/KRR-course#hokr))?
If so, explain why this is the case.
If not, give a program *P* such
that *P ∪ P1*
and *P ∪ P2* have different answer sets.

The program *P1*:
```
b :- a.
b.
```

The program *P2*:
```
b :- a.
:- not b.
```

### Exercise 2.1.c

Consider the following two logic programs *P1* and *P2*.
Are these strongly equivalent
(see Definition 7.3.10 in [[Van Harmelen, Lifschitz, Porter, 2008]](https://github.com/rdehaan/KRR-course#hokr))?
If so, explain why this is the case.
If not, give a program *P* such
that *P ∪ P1*
and *P ∪ P2* have different answer sets.

The program *P1*:
```
:- a.
:- not a.
```

The program *P2*:
```
a :- not b.
b :- not a.
:- a.
:- b.
```

### Exercise 2.1.d

Let *P1* and *P2* be two logic programs
that are strongly equivalent
(see Definition 7.3.10 in [[Van Harmelen, Lifschitz, Porter, 2008]](https://github.com/rdehaan/KRR-course#hokr)).
Let *Q1* and *Q2* also be two logic programs
that are strongly equivalent.

Show that *P1 ∪ Q1*
and *P2 ∪ Q2*
are strongly equivalent.

---

## Exercise 2.2

### Exercise 2.2.a

Give a logic program *P* that has exactly 1024 answer sets.

### Exercise 2.2.b

Give a logic program *P* that has exactly 1000 answer sets.

### Exercise 2.2.c

Give a default theory *(W,D)* that has exactly 1024 extensions.

### Exercise 2.2.d

Give a default theory *(W,D)* that has exactly 1000 extensions.

---

## Exercise 2.3: Modelling non-monotonic reasoning

### Exercise 2.3.a

Model the following (made-up!) scenario of legal reasoning using default logic:
- A suspect should be convicted if they committed a crime.
- Theft is a crime.
- Murder is a crime.
- A suspect should not be convicted if they have immunity from prosecution.
- Immunity from prosecution does not hold if the suspect committed a murder.

To keep things simple (or to oversimplify things),
use the following propositional atoms for this:
`convicted`, `committed_crime`, `committed_theft`, `committed_murder`, `immunity`.
(You may use additional atoms.)

That is, construct a set *D* of defaults, so that:
- Together with *W = {`committed_theft`}*, all extensions of the resulting default
theory contain `convicted`.
- Together with *W = {`committed_theft`,`immunity`}*, all extensions of the resulting default
theory do not contain `convicted`.
- Together with *W = {`committed_murder`}*, all extensions of the resulting default
theory contain `convicted`.
- Together with *W = {`committed_murder`,`immunity`}*, all extensions of the resulting default
theory contain `convicted`.

### Exercise 2.3.b

Model the above scenario of legal reasoning using answer set programming.
Use the same propositional atoms (again, you may use additional atoms).

That is, construct a logic program *P*, so that:
- All answer sets of *P ∪ {`committed_theft.`}* contain `convicted`.
- All answer sets of *P ∪ {`committed_theft.`,`immunity.`}* do not contain `convicted`.
- All answer sets of *P ∪ {`committed_murder.`}* contain `convicted`.
- All answer sets of *P ∪ {`committed_murder.`,`immunity.`}* contain `convicted`.

### Exercise 2.3.c

Model the following (made-up!) scenario of deontic reasoning using default logic:
- One should not do things that are forbidden.
- Speeding is forbidden.
- Fraud is forbidden.
- Forbidden things may be done if they can save lives.
- In an emergency, speeding can save lives.

To keep things simple (or to oversimplify things),
use the following propositional atoms for this:
`should_not_do(speeding)`, `allowed_to_do(speeding)`,
`should_not_do(fraud)`, `allowed_to_do(fraud)`,
`forbidden(speeding)`, `forbidden(fraud)`,
`can_save_lives(speeding)`, `emergency`.
(You may use additional atoms.)

That is, construct a set *D* of defaults
and a set *W0* of background facts, so that:
- Together with *W = W0 ∪ {`emergency`}*,
all extensions of the resulting default
theory contain `forbidden(speeding)`, `forbidden(fraud)`,
`allowed_to_do(speeding)` and `should_not_do(fraud)` and do not
contain `allowed_to_do(fraud)` and `should_not_do(speeding)`.
- Together with *W = W0 ∪ ∅*,
all extensions of the resulting default
theory contain `forbidden(speeding)`, `forbidden(fraud)`,
`should_not_do(speeding)` and `should_not_do(fraud)` and do not
contain `allowed_to_do(fraud)` and `allowed_to_do(speeding)`.

### Exercise 2.3.d

Model the above scenario of deontic reasoning using answer set programming.
Use the same propositional atoms (again, you may use additional atoms).

That is, construct a logic program *P*, so that:
- All answer sets of *P*
contain `forbidden(speeding)`, `forbidden(fraud)`,
`allowed_to_do(speeding)` and `should_not_do(fraud)` and do not
contain `allowed_to_do(fraud)` and `should_not_do(speeding)`.
- All answer sets of *P ∪ {`emergency.`}*
contain `forbidden(speeding)`, `forbidden(fraud)`,
`should_not_do(speeding)` and `should_not_do(fraud)` and do not
contain `allowed_to_do(fraud)` and `allowed_to_do(speeding)`.

---

## Exercise 2.4

### Exercise 2.4.a

Show that the default theory *(W,D)* with *W = ∅*
and *D = { `T : p / ~q`, `T : q / ~r`, `T : r / ~s` }*
(where `~` denotes negation)
has exactly one extension.

### Exercise 2.4.b

What extensions does the default theory *(W,D)* with *W = { `p -> (~q & ~r)` }*
and *D = { `T : p / p`, `T : q / q`, `T : r / r` }*
(where `~` denotes negation, `&` denotes conjunction, and `->`
denotes logical implication) have?

### Exercise 2.4.c

Show that the default theory *(W,D)* with *W = { `p` }*
and *D = { `p : r / q`, `p : s / ~q` }*
(where `~` denotes negation)
has no extensions.

repository: paulltk/KRR-course

repo_name: paulltk/KRR-course


text:
---
type: Content
directory: app/resourcebundles
title: Resource Bundles
page_title: resourceBundles
description: The ResourceBundle class is used to show messages or content in multiple languages. In other words, we can say that it provides a mechanism to globalize the messages.

---
Rendering sunbird portal pages in multiple languages , user can view page elements in their preferred language.

## How Resource Bundle Work

The Resource Bundle reads a property file based on the locale and name suffix used in the naming of the property. For example, consider a label file named en.properties. This file is read by ResourceBundle helper(app/helpers/resourceBundlesHelper.js) and it will generate js file in app/common folder .
Locale represents a region or location with its attributes. Locale is generally used to maintain details about the client using our application. Locale contains attributes of location and language to be used for the respective location. Thus, a Locale assists ResourceBundle to pick the right label file by determining the location to which the user belongs.

### How to add resource element for existing languages in resource bundles

There are two sections,
1. **Form elements(app/reosurcebundles/data/formElements/en.Properties)**
2. **Messages(app/reosurcebundles/data/messages/en.Properties)**

      * While adding new resource element(like if we want to add text for a label or for button or add new success/error messages) first add in en.properties file.

      * en.properties file is a primary bundle, if any resorce elements not available in other language bundle files it gets copied from en.properties file.

### How to add a resource bundle for a new language

   * To add a new language,  create a property file for respective language under formElements and messsages folder and copy the resource elements from primary language bundle(en.properties) to target language properties file and then replace the translation of the values in the new language.

   * Finally run the server.js file of app folder to complie the resource bundle properties file and verify the new generated/updated js files under app/common folder.

branch_name: refs/heads/dev

gha_language: HTML


text:
# Ubuntu Server (VM-)boxes

* **radicv144**: Ubuntu Server LTS x86-64 (QEMU-KVM)

---

Launching an Ubuntu Server guest on an Arch Linux host:

```
$ qemu-system-x86_64 -m 1.8G -enable-kvm -cpu host -smp 2 -net nic,model=virtio -net vde -drive file=/opt/radicv144/radicv144ubuntu14044serveramd6401,format=raw > /dev/null 2>&1 &
```

Starting up SSH agent in the background and adding a private key:

```
$ eval `ssh-agent -s` && ssh-add
Agent pid <PID>
Enter passphrase for /home/radic/.ssh/id_rsa:
Identity added: /home/radic/.ssh/id_rsa (/home/radic/.ssh/id_rsa)
```

**Note:** `radicv144` below is the Ubuntu Server hostname assigned to its IP address `<IP_ADDRESS>` as the following:

```
$ cat /etc/hosts
# /etc/hosts: static lookup table for host names

#<ip-address>   <hostname.domain.org>   <hostname>
<IP_ADDRESS>       localhost.localdomain   localhost       radicz580  # <== Arch Linux host (IPv4)
::1             localhost.localdomain   localhost       radicz580  # <== Arch Linux host (IPv6)

<IP_ADDRESS>                              localv144       radicv144  # <== Ubuntu Server VM
<IP_ADDRESS>                              localv610       radicv610  # <== OpenBSD VM
```

SSH-ing into this box:

```
$ ssh -C radicv144
Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-78-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Wed Aug  9 08:40:10 PM +03 2023

  System load:  0.0                Processes:                98
  Usage of /:   22.5% of 78.56GB   Users logged in:          1
  Memory usage: 13%                IPv4 address for docker0: <IP_ADDRESS>
  Swap usage:   0%                 IPv4 address for ens3:    <IP_ADDRESS>

Expanded Security Maintenance for Applications is not enabled.

0 updates can be applied immediately.

2 additional security updates can be applied with ESM Apps.
Learn more about enabling ESM Apps service at https://ubuntu.com/esm

Last login: Wed Aug  9 20:40:00 2023 from <IP_ADDRESS>
$
$ uname -a
Linux radicv144 5.15.0-78-generic #85-Ubuntu SMP Fri Jul 7 15:25:09 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
```

**Adding another disk partition (if needed), let's say of 60 Gigabytes:**

1. In an Arch Linux host **do**:

```
$ sudo qemu-img resize /opt/radicv144/radicv144ubuntu14044serveramd6401 +60G
```

2. In an Ubuntu Server guest **do**:

Run `sudo fdisk /dev/sda` and add a new partition, then reboot the VM.

Check/watch this new change:

```
$ sudo fdisk -l /dev/sda
Disk /dev/sda: 80 GiB,<PHONE_NUMBER>0 bytes, 167772160 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot    Start       End   Sectors Size Id Type
/dev/sda1  *        2048  41940991  41938944  20G 83 Linux
/dev/sda2       41940992 167772159 125831168  60G 83 Linux
```

Format this new partition using `sudo mkfs.ext4 /dev/sda2` and mount it:

```
$ sudo mkdir /sda2
$
$ sudo mount /dev/sda2 /sda2
```

Check/watch this new partition is mounted:

```
$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
fd0      2:0    1    4K  0 disk
sda      8:0    0   80G  0 disk
├─sda1   8:1    0   20G  0 part /
└─sda2   8:2    0   60G  0 part /sda2
sr0     11:0    1 1024M  0 rom
```

It now can be used as usual, just like the root partition, for any kind of activities.

The last thing have to do is to update the `/etc/fstab` configuration:

```
$ cat /etc/fstab
/dev/sda1 /     ext4 errors=remount-ro 0 1
/dev/sda2 /sda2 ext4 errors=remount-ro 0 1
/swap     none  swap defaults          0 0
```

**Increasing (or adding initially) a swap file (if needed), let's say for 5 Gigabytes:**

Deactivate an old one (if any):

```
$ sudo swapoff /swap
```

Reallocate it then (or create a new one):

```
$ sudo fallocate -l 5G /sda2/swap
```

If it resides on another disk partition and in order not to change the corresponding entry in the `/etc/fstab` configuration (see above), make a symlink to it:

```
$ cd /
$
$ sudo ln -sfnv /sda2/swap
'./swap' -> '/sda2/swap'
```

(Re-)format and activate the swap file:

```
$ sudo mkswap /swap
mkswap: /swap: warning: wiping old swap signature.
Setting up swapspace version 1, size = 5 GiB<PHONE_NUMBER> bytes)
no label, UUID=389fc137-73b5-4464-9bda-da173e5be8e5
$
$ sudo swapon /swap
```

Finally, check/watch the swap file is utilized by the system:

```
$ ls -al /swap /sda2/swap
-rw------- 1 root root<PHONE_NUMBER> Nov 30 16:40 /sda2/swap
lrwxrwxrwx 1 root root         10 Nov 30 16:40 /swap -> /sda2/swap
$
$ free
               total        used        free      shared  buff/cache   available
Mem:         1803188      256264      562288         968      984636     1383300
Swap:        5242876           0     5242876
```

license: Unlicense

repository: rgolubtsov/dotfiles

gha_language: Shell

gha_license_id: Unlicense

repo_name: rgolubtsov/dotfiles


text:
---
# Required front matter
layout: post # Posts should use the post layout
title: Thomas Daft Punk Helmet  # Post title
date: 2019-10-30 # Publish date in YYYY-MM-DD format

# Recommended front matter
tags: 3D-Printing micro-electronics programming # A list of tags
splash_img_source: /assets/img/2019-10-30-daft-punk-helmet/daft-punk-parking.jpg # Splash image source, high resolution images with an aspect ratio close to 4:3 recommended
splash_img_caption: Halloween 2019 # Splash image caption
---

It had been two years since my last major 3D printing project, and I had much bigger ambitions this time. I decided on recreating Thomas Bangalter’s helmet from Daft Punk.

# Printing
I opted to use an already proven model, but design my own electronics. The model I ended up using was [this one.](https://www.thingiverse.com/thing:338831)
The model itself was very accurate. However, it was divided into several small pieces intended for smaller printers. More time in the assembly was required.

# Assembly
Each section of the helmet is held against each other with zip-ties and 2-part epoxy glue. This part was tedious and messy, but the result was strong and solid.

![Helmet Assembly](/assets/img/2019-10-30-daft-punk-helmet/daft-punk-printing.jpg)

# Electronics
While looking at other renditions of this helmet, many people either build their own LED matrix diode by diode or used LED strips. I wanted to be somewhere in-between and used 8x8 MAX7219 LED matrices. I ordered 8 and planned to use all 8. Due to my weaker soldering skills at the time, I killed 4 of those 8 modules. The front matrix was going to be 8x32 pixels as a result. The ear cups on the side are strips of WS2812 individually addressable LEDs.

<embed src="/assets/img/2019-10-30-daft-punk-helmet/scrolling-text.mp4" autostart="false" height="200" width="200"/>

The ear LEDs go through a pre-defined loop of effects that I programmed. The matrix is controllable from a phone using a HC05 Bluetooth module that then relays the text via serial to the Arduino.
The library used for the text animations/transitions is [MD_MAX72XX](https://majicdesigns.github.io/MD_MAX72XX/)

![Helmet Electronics](/assets/img/2019-10-30-daft-punk-helmet/daft-punk-electronics.jpg)

# Finishing
To smooth out the printing lines, I experimented using Bondo Filler. Usually used in automotive, it allowed me to fill the gaps and then sand the excess Bondo off. While it was miles better than just sanding the plastic directly, it was quite difficult to work with. I only got the hang of the proper mixture amount and spreading techniques when I was done. I would still use it again if needed for some other project.

![Helmet Finishing](/assets/img/2019-10-30-daft-punk-helmet/daft-punk-bondo.jpg)

# Final Result

![Helmet Final](/assets/img/2019-10-30-daft-punk-helmet/daft-punk-hallway.jpg)
![Helmet Final](/assets/img/2019-10-30-daft-punk-helmet/daft-punk-parking.jpg)


text:
# Swagger UI

**Video**

[Swagger: How to Create an API Documentation](https://www.youtube.com/watch?v=xggucT_xl5U)

**commend**

```
npm run build
npm run serve
```

repository: alincode/api-docs

repo_name: alincode/api-docs


text:
# Biological Sequence Learning with Deep Learning

## Table of Contents
-   [Introduction](#introduction)
-   [Data Hierarchy](#data-hierarchy)
    -   [Biological Segmentation](#biological-segmentation)
    -   [Statistical Segmentation](#statistical-segmentation)
-   [Learning Model](#learning-model)
    -   [Network Architecture](#network-architecture)
    -   [Training Task](#training-task)
-   [Evaluation Method](#evaluation-method)

---
## Introduction

This project applies the state-of-the-art deep learning models to biological sequences (amino acid or nucleotide sequences).
There are several notable challenges for learning on biological sequences:
-   **biological sequences, especially nucleotide ones, could be extremely long**
-   **knowledge is buried deep inside the sequences, and therefore hard to learn**
-   the sheer amount of data and the quality issues;

The first two challenges are more relevant to the research of machine learning and its application in biology, and interestingly enough, despite being two distinct challenges, they could be solved at the same time with [a better model](#learning-model) and/or [data hierarchy](#data-hierarchy).

---
## Data Hierarchy

In the context of this project, the hierarchy for biological sequences indicates the inner relation and structure of smaller segments. For instance, the protein coding regions on top of genome sequences is a level of hierarchy.

The hierarchical structure of the biological sequences makes the learning easier in two ways:
1.  sequences are presented in a more structured and hopefully more "understandable" way for machine learning models
2.  longer sequences could be segmented into shorter chunks, which are easier to process and learn

The segmentation could be either [biological](#biological-segmentation) or [statistical](#statistical-segmentation), as explained separably in the subsections below.

### Biological Segmentation

This segmentation method is based on the human understanding of biological sequences.
For example, a genome can be segmented into coding regions and non-coding regions for proteins; and on coding regions, there could be [conserved domains]((https://en.wikipedia.org/wiki/Conserved_Domain_Database)), which is an extra level of hierarchy.
Another good example is the [secondary structure](https://en.wikipedia.org/wiki/Protein_secondary_structure) of protein, which segments the sequences into alpha-helix, beta-sheet, etc.

The applied biological knowledge for this segmentation method is very likely to benefit the learning process. However, the segmented sequence could still be too long for learning. Some coding regions in E. Coli genomes have more than 5,000 nucleotide bases, which cannot easily fit into some deep learning models, especially the ones that rely on self-attention.

#### Conserved Domain as Biological Segmentation

Conserved domains "can be thought of as distinct functional and/or structural units of a protein". Ideally, if one can segment the genomes or proteins sequences based on conserved domain, the data hierarchy might provide the model with valuable information.

However, the "distribution", for lack of a better word, of different conserved domains are rather skewed. There are more than 13,000 different conserved domains found in E. Coli genomes, but most of them are rather rare, appearing less then 500 times across more than 1,000 whole genomes. So training with conserved domains as if they are words in natural languages is probably not feasible.
Not to mention that the occurrences of conserved domains are relatively rare already.
And the definition of conserved domain is not clear-cut, but largely defined on the database to perform conserved domain search with.

Combine all the factors together, conserved domains are probably not the best way to provide hierarchy. If we are going to try segmenting the sequences with conserved domains anyway, we should focus only on the most common conserved domains from our dataset.

### Statistical Segmentation

Unlike biological segmentation, this segmentation method is purely based on the statistical property of the sequences.
For example, one can segment a long genome sequence into multiple smaller ones within some pre-defined length. Another good example is to segment a genome sequence with the occurrence of start and stop codon.

The biggest disadvantage of this method is that it provides little if none biological knowledge to the learning model, but it is easily to implement. Moreover, the segmented sequences could be shorter and faster to learn.

---
## Learning Model

A model suitable for the learning task of biological sequences should be able to digest ultra-long sequences and provided good performance at the same time. The definition of learning model can be boiled down to two orthogonal components: the [network architecture](#network-architecture) and the [training task](#training-task).

### Network Architecture

There are several network architecture suitable for learning on biological sequences:
-   dense neural network (baseline)
-   **1-D convolution neural network**
-   transformer (BERT) encoder
    - **transformer (BERT) encoder with sparse attention**

Out of all the models listed above, dense models and the original transformer (with dense self-attention) are not as suitable as the other two because of the length of the biological sequences. Some level of sparsity like convolution might be the only solution.
Note that recurrent neural network might not be a good idea here because the information might be lost as the recurrent process continues on the ultra-long sequences.

### Training Task

Since there is an enormous amount of genome/protein sequences available without too much informative labeling or easy supervised-learning task, it is only reasonable to apply unsupervised learning.

**TODO: research on the unsupervised tasks for sequences.**

---
## Evaluation Method
<!---
-   [ ] tSNE visualization of genetic codes
-   [ ] faster conserved domain search (BLAST score)
-   [ ] protein family/function classification
-   [ ] protein structural similarity (TM alignment score) prediction
-   [ ] mutation effect
-   [ ] gene regulatory network prediction inference
-   [ ] co-varying mutations
--->


text:
# Einstein's webshop
[![Generic badge](https://img.shields.io/badge/DJANGO-3.1.7-green.svg)](/)
[![Generic badge](https://img.shields.io/badge/HTML-5-blue.svg)](/)
[![Generic badge](https://img.shields.io/badge/CSS-3-orange.svg)](/)
[![Generic badge](https://img.shields.io/badge/BOOTSTRAP-5.0-purple.svg)](/)
[![Generic badge](https://img.shields.io/badge/MYSQL-blue.svg)](/)
[![Generic badge](https://img.shields.io/badge/HEROKU-purple.svg)](/)
[![Generic badge](https://img.shields.io/badge/Python-3.X-yellow.svg)](/)

## Overview

This is a demo online webshop with users and managers features.

- [Einstein's webshop](#einsteins-webshop)
  - [Overview](#overview)
  - [Features](#features)
    - [Frontend](#frontend)
    - [Backend](#backend)
  - [Use cases by roles](#use-cases-by-roles)
    - [Buyer](#buyer)
    - [Manager](#manager)
    - [Admin](#admin)
  - [FAQ](#faq)
  - [For Developers](#for-developers)
    - [Architecture decisions](#architecture-decisions)
    - [Stack specifications](#stack-specifications)
    - [Configurations](#configurations)
  - [To-do's](#to-dos)
    - [UI](#ui)
    - [Developers](#developers)

## Features

### Frontend
- Creation/editing of products
- Filtering by name or code
- Sort by name or price

### Backend
- REST API's
- Authentication
-

## Use cases by roles
### Buyer
1. Search products
2. Order by diff properties
3. Add to cart
### Manager
1. Create product
2. Edit/Delete product
### Admin
1. Admin dashboards
## FAQ

## For Developers

### Architecture decisions

1. Frontend (FE) and Backend (BE) apps:
This application is was originally created as a stand-alone application, yet the REST API functionalities allows this project to be part of the backend server for FE applications with different technologies (e.g. React, Vue, etc.).

2. Authentication:
As a common feature in moderm applications, the authentication process is a natural feature when configuring and creating and manipulate data or other users' access.
3. Filtering of product
At this point, the filtering is done by js, although it could also be accomplished by filtering using extension of API and partially update the page (This will be included in future releases).

### Stack specifications

- HTML and CSS
- Django and Dj-REST Framework
- JavaScript
- MySQL
- Heroku
- Gunicorn

### Configurations

For customization, there are some places where you can modify the code.

Software development (SW Dev)
- This includes the configurations for the applications to work correctly when customizing it.

Development operations (DEVOPS)
- This includes configurations to different deployment heroku pipelines according to the branch (i.e. Main for production, dev for staging/development)

## To-do's
### UI
1. [ Manager view ] Bulk operations
   1. Delete

### Developers
1. Django tests
2. Authentication views
   1. Customized login/out view
   2. Include the logo in the title and change background
3. Creation of product
   1. Auto refresh of the products view
   2. Improvement of the form to create products
   3. 1-clicker to create test products
4. Consolidation of css into files

repository: jealdana/ewebshop

gha_language: JavaScript

repo_name: jealdana/ewebshop


text:
# tdd-node-api-es6

#### the practice of test driving node.js
---

## Getting Started##

#### Change the node version, clone the repo, install the modules, run lint and run the tests:####

````
nvm use v6.8.0
git clone git@github.com:wpannell/tdd-node-api-es6.git
cd tdd-node-api-es6
npm install
npm run lint
npm run spec
npm test
````

---


text:
# Nalu examples

To run the examples:

* install nalu: [https://github.com/FrankHossfeld/nalu-parent] and follow the instructions

* clone the repository

* run ```mvn clean``` & ```mvn gwt:devmode```

* copy the link and paste the link into the browser url

I have tested the examples on OS X with Safari, Chrome and FireFox.

## Notes

Some things are nonsens and only implemented to test the features.

If Bart Simpson is selected from the list, the application will route to the search view. This is the desired behavior: see ```BartSimpsonFilter```-class.


text:
logplexc
========

Golang Logplex Client Driver

This library handles interactions with
[Logplex](https://github.com/heroku/logplex), and is able to be
imported to send logs.

For documentation, see
[Godoc](http://godoc.org/github.com/logplex/logplexc)

repository: logplex/logplexc

gha_language: Go

repo_name: logplex/logplexc


text:
# laravel-google-authenticator

Google Authenticator implementation for Laravel

The package has a trait and a custom validation rule that you can use on any model for verifying the Google Authenticators code.

## Table of contents

* [Installation](#installation)
* [Example](#example)
* [Displaying the QR code](#displaying-the-qr-code)
* [Verifying that the User set up Google Authenticator](#verifying-that-the-user-set-up-google-authenticator)
* [Adding 2FA custom Validation](#adding-2fa-custom-validation)
* [Adding 2FA custom Validation using route model binding](#adding-2fa-custom-validation-using-route-model-binding)
* [Adding a custom name in Google Authenticator](#adding-a-custom-name-in-google-authenticator)

## Installation

Pull the lib with composer:

```bash
composer require doge-dev/laravel-google-authenticator
```

Add the service provider in ```config/app.php```

```php
DogeDev\GoogleAuthenticator\GoogleAuthenticatorServiceProvider::class,
```

You can add 2 Factor Verification to any model, and it will create:

 * A getter (accessor) for **enabled_2fa** attribute
 * function **enable2FA()** - enables 2 Factor Authentication on the model.
 * function **getQRCodeURL()** - gets the URL for retrieving the QR code image for the User to scan with Google Authenticator
 * function **getBase64EncodedQRImage()** - gets the base64 encoded image (convenient for placing into <img src="..."> for emails and such...)
 * function **verifyCode($code)** - attempts to verify the code submitted by the user (will increment the attempts)
 * function **activate2FA($code)** - attempts to verify the code and on successful verification will set the ```activated_2fa``` attribute to true
 * function **getNameForQRCode()** -  function that is used for generating a name that will be displayed in the Google Authenticator App (you can overwrite this function to use a custom naming convention)

## Example

Add the ```Verifies2FACode``` trait to your User model (or any other model on which you might want to enable 2FA):

```php
<?php

namespace App;

use DogeDev\GoogleAuthenticator\Traits\Verifies2FACode;
use Laravel\Passport\HasApiTokens;
use Illuminate\Notifications\Notifiable;
use Jenssegers\Mongodb\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use HasApiTokens, Notifiable, Verifies2FACode;

    ...
```

For MySQL databases you will need to add these attributes to your Model's migration:

```php
$table->boolean('activated_2fa')->default(false); // you can index it if needed
$table->string('secret')->nullable();
```

Call the ```enable2FA()``` function on your model, and you're done. This will generate a secret for the given model.

```php
$user->enable2FA();
```

You can add some helper attributes to your model, for the sake of convenience. We've also added ```enabled_2fa``` and ```activated_2fa``` to the **$visible** attribute, tho this is not necessary either.

```php

    /**
     * The attributes that should be visible for arrays.
     *
     * @var array
     */
    protected $visible = ['name', 'enabled_2fa', 'activated_2fa'];

    /**
     * The accessors to append to the model's array form.
     *
     * @var array
     */
    protected $appends = ['enabled_2fa'];

```

That's it! :) Now you can display the QR code to your user so that he can start using the Google Authenticator with your app.

## Displaying the QR code

Now you can show the QR code to the user either with:

```html
<img src="{{ $user->getQRCodeURL() }}">
```

or

```html
<img src="{{ $user->getBase64EncodedQRImage() }}">
```

## Verifying that the User set up Google Authenticator

You can check if the User successfully activated his 2FA:

```php
$user->activated_2fa
```

When a User scans the QR Code, prompt him for the code and validate the User's 2FA:

```php
$user->activate2FA($request->get('code'));
```

For simple verification you can use:

```php
$user->verifyCode($request->get('code'));
```

## Adding 2FA custom Validation

You can easily verify the code on any custom request by adding the validation:

```php
<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class SomeCustomRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'code' => 'required|2fa'
        ];
    }
}
```

The validator will try to validate the code using the logged in user (Auth::user()).

## Adding 2FA custom Validation using route model binding

Or you can leverage route model binding and create a validation in your custom Request model:

```php
<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UpdateAccountDetails extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'code' => 'required|2fa:account'
        ];
    }
}
```

In this case the validator expects to find an ```account``` object in the route. The object needs to implement the above mentioned Trait in order for the validation to work.

## Adding a custom name in Google Authenticator

You can set the text that is displayed in Google Authenticator by overriding the traits default **getNameForQRCode()** function in your Model implementation:

```php
class User extends Model
{

    ...

    /**
     * Gets the name to be displayed in Google Authenticator
     *
     * @return string
     */
    public function getNameForQRCode()
    {
        return env('APP_NAME') . "@" . $this->email;
    }
}

```

repository: doge-dev/laravel-google-authenticator

repo_name: doge-dev/laravel-google-authenticator


text:
## Codec

**File: [`x/simple_governance/codec.go`](https://github.com/cosmos/cosmos-sdk/blob/fedekunze/module_tutorial/examples/simpleGov/x/simple_governance/codec.go)**

The `codec.go` file allows developers to register the concrete message types of their module into the codec. In our case, we have two messages to declare:

```go
func RegisterCodec(cdc *codec.Codec) {
    cdc.RegisterConcrete(SubmitProposalMsg{}, "simple_governance/SubmitProposalMsg", nil)
    cdc.RegisterConcrete(VoteMsg{}, "simple_governance/VoteMsg", nil)
}
```
Don't forget to call this function in `app.go` (see [Application - Bridging it all together](app-structure.md)) for more).

repository: rekoner/cosmos-sdk

branch_name: refs/heads/develop

repo_name: rekoner/cosmos-sdk


text:
---
author: phwl
comments: true
date: 2018-09-11 05:37:21+00:00
slug: nobel-laureates-joachim-frank-and-dan-shechtman
title: Nobel laureates Joachim Frank and Dan Shechtman
classes: wide
categories:
- academia
header:
  teaser: /assets/images/2018/09/img_2034.jpg
---

Q&A session with Nobel laureates Joachim Frank (Columbia) and Dan Shechtman (Technion, Israel), moderated by Julie Carney.

Professor Shechtman won the 2011 Nobel Prize in Chemistry for the discovery of quasicrystals. Professor Frank's Nobel Prize in Chemistry was awarded in 2017 for developing cryo-electron microscopy for the high-resolution structure determination of biomolecules in solution

{% include figure image_path="/assets/images/2018/09/img_2034.jpg" caption="" %}

<!-- more -->

Prof Dan Shechtman

  * _Did you worry when people (such as Linus Pauling) said your work was wrong?_ I am my own hardest critic of my own work so I verify my work over and over to ensure it is correct.

  * _How do you find what to research?_ What you should pursue comes by chance, learn lots of things, find something you are interested in and become an expert.

  * _Did Nobel Prize change your life?_

  * _How are things changing for the younger generation for the worse and better? _As technology develops we need people that are experts in different things e.g. nobody can make a cellphone by themselves. In the past you could only become an entrepreneur if your father owned a factory, now everybody has the opportunity.

Prof Joachim Frank

  * _Is it harder for researchers now than before?_ Compared to 30 years ago researchers now have tools such as the internet for communications which allow scientific collaborations that were not feasible in the past.

  * _How are things changing for the younger generation for the worse and better?_ Social media has created a dystopic environment. People need to look at their phones every 2 minutes and have serious attention deficit. Awareness has dramatically improved about world events, transcending the idea of nation states.

  * _Advice to a scientist embarking on their career. _If you have an idea that you have checked and believe in, don't let someone discourage you.


text:
# H2O Vagrant Development Environment

You can use the `Vagrantfile` and `bootstrap.sh` in this directory to create a Ubuntu 14.04 LTS (Trusty Tahr) virtual machine up and running, with the correct developer dependencies.

## Instructions

1. Install [VirtualBox](https://www.virtualbox.org/).
2. Install [Vagrant](http://www.vagrantup.com/downloads).
3. Create a working directory, fetch scripts, setup the virtual machine and `ssh` into it.

        mkdir development
        cd development
        curl -sL https://raw.githubusercontent.com/h2oai/h2o-3/master/vagrant/Vagrantfile
        curl -sL https://raw.githubusercontent.com/h2oai/h2o-3/master/vagrant/bootstrap.sh
        vagrant up
        vagrant ssh

If everything goes correctly, you'll now be inside a virtual machine with git, Java, Python, R, Node.js installed, and with H2O's sources (master) fetched and built in `~/h2o-3`.

gha_language: Jupyter Notebook


text:
# ebils
EBILS - Erlang Binary Lightweight Search

[![Hex.pm](https://img.shields.io/hexpm/v/ebils.svg)](https://hex.pm/packages/ebils)
[![Build Status](https://travis-ci.org/zgbjgg/ebils.svg?branch=master)](https://travis-ci.org/zgbjgg/ebils)
[![License: MIT](https://img.shields.io/github/license/zgbjgg/ebils.svg)](https://raw.githubusercontent.com/zgbjgg/ebils/master/LICENSE)
[![Hex.pm](https://img.shields.io/hexpm/dt/ebils.svg)](https://hex.pm/packages/ebils)
[![Hex.pm](https://img.shields.io/hexpm/dw/ebils.svg)](https://hex.pm/packages/ebils)

A single binary search for large and huge binary into pure erlang, this uses small chunk of binaries to search in them using single processes and delivering message to the main process.

With single tests of a large binary this method can be 17x faster that single `binary:match` and allows to you seek results in the process.

A single example:

```erlang
1> {ok, File} = file:read_file("test.data").
{ok,<<"AAAAAAAA|J|89\nBBBBBBBB|J|89\nCCCCCCC|J|89\nDDDDDDDD|J|89\nEEEEEEE|J|89\nFFFFFFFF|J|89\n"...>>}
2> byte_size(File).
234179947
3> ebils:load(File, <<"\n">>).
true
4> timer:tc(ebils, search, [<<"ZbZbZbZbZb">>]).
{4031,{{ok,{2341677,13},<0.161.0>}}
5> {Found, Pid} = ebils:search(<<"ZbZbZbZbZb">>).
{ok,{2341677,13},<0.160.0>}
6> ebils:fetch(Pid, {get, {found, Found}, 4}).
{ok,<<"ZbZbZbZbZb|J|89">>}
```
In the example:

* Line 1: Load a huge file
* Line 2: Check the byte size ( it's very large :-D )
* Line 3: Parse file into chunks and load into memory
* Line 4: Perform a single search, the result is the position of the match
* Line 5: Perform a search and store result in a var to use after
* Line 6: Extract a binary part of the chunk where found the match

## API

Load a binary into the system to use after for seeking matches, you can specify the name for the workers,
the length of workers created to process the binary and the pattern to split the chunks.

### ebils:load/2 ###

`ebils:load(Binary::binary(), Pattern::binary()) -> true`

### ebils:load/3 ###

`ebils:load(Name::atom(), Binary::binary(), Pattern::binary()) -> true`

### ebils:load/4 ###

`ebils:load(Name::atom(), Binary::binary(), Pattern::binary(), Workers::non_neg_integer()) -> true`

Search a single binary into the preloaded binary, you can specify the binary to seek and the name for the workers,
(default name to ebils, used with ebils:search/1)

### ebils:search/1 ###

`ebils:search(Binary::binary()) -> {ok, {non_neg_integer(), non_neg_integer()}, pid()}`

### ebils:search/2 ###

`ebils:search(Name::atom(), Binary()) -> {ok, {non_neg_integer(), non_neg_integer()}, pid()}`

Get the data from the process where the binary was found. Use a simple gen_server call using the pid where found
the data and the tuple of Found data, also you should provide a third parameter containing the size of data to retrieve.

### ebils:fetch/2 ###

`ebils:fetch(pid(), {get, {found, {non_neg_integer(), non_neg_integer}}, integer}) -> {ok, binary()}`

Unload all data kept in processes and kill the processes, you can specify the name for the workers, this method will be helpful
to re-run the data (if binary changes)

### ebils:unload/0 ###

`ebils:unload() -> ok`

### ebils:unload/1 ###

`ebils:unload(Name::atom()) -> ok`

Refresh the chunks and the workers (processes) with new binaries in their state

### ebils:reload/2 ###

`ebils:reload(Binary :: binary() | [binary(), ...], Pattern :: binary()) -> ok`

### ebils:reload/3 ###

`ebils:reload(Name :: atom(), Binary :: binary() | [binary(), ...], Pattern :: binary()) -> ok`

### ebils:reload/4 ###

`ebils:reload(Name :: atom(), Binary :: binary() | [binary(), ...], Pattern :: binary(), Workers :: non_neg_integer()) -> ok`

repository: zgbjgg/ebils

repo_name: zgbjgg/ebils


text:
---

layout: post
title: "Sports and Caffeine"
date: 2023-08-21 04:44:02 +0530
comments: true
categories:
- Nutrition

---

### Sports and Caffeine

These are my notes on how caffeine works and how it can be used to enhance sports performance. I will keep on updating as I learn more.

**The Inner Workings of Caffeine**

* Think of your brain like a castle with tiny locks on its walls, and  adenosine is the key that makes you feel tired and sleepy. But caffeine  plays the role of a vigilant guard that prevents these adenosine keys  from working. When caffeine takes over, you feel wide awake, and your  brain functions at its best.

* This "guarding" action of caffeine leads to improved alertness, better  focus, quicker reactions, and an overall boost in how well your brain  works.

* As a central nervous system stimulant, caffeine reduces the perception  of effort during physical activities. This is reflected in a lower Rate  of Perceived Exertion (RPE)

  {% include image.html file="/images/Caffeine/CaffeineBinding.jpg" description="Caffeine Binding" max-width="50" %}.

* Caffeine's impact on physical performance extends to various metrics including time-to-exhaustion, time-trial performance, muscle strength and endurance, as well as high-intensity sprints often encountered in team sports.

* (Science Insights: Caffeine works its magic by mimicking adenosine, fooling the brain into thinking it's the same key. When caffeine enters the brain, it attaches to the adenosine locks and prevents them from working. This slowdown in brain activity triggers your body to make more adrenaline, like a superhero booster. That's why you feel super alert for about four to six hours until the caffeine wears off.)

{% include image.html file="/images/Caffeine/9_grande-1692572528847-4.webp" description="How Caffeine works" max-width="50" %}

**Recommended Dosage**

- Notably, improvements in physical performance tend to become evident when caffeine is consumed in doses surpassing approximately 200mg (equivalent to around 3mg per kg of body weight).
- Recommended Dosage: 3 to 6 mg per kg of body weight
- **Notes:**
  - Caffeine has half life of 5 hours and it takes one hour to reach its peak impact
  - Food intake also impacts the absorption of caffeine. Best response is fasted state. To be experimented individually.
  - Best source of caffeine is caffeine pills. Coffee is not a good source if one wants precision. The amount of caffeine in coffee depends a lot on beans, roasting mechanism (light roast has more caffeine compared to dark roast), brewing method.

**How to take during the race**

* Approach 1 : Take full dosage (mega dosage - 6mg per body weight) before the race. For full ironman, renew it after 6 hours.
* Approach 2 : Take full dosage when needed. Eg, if bike is the struggle, take full dosage in the bike leg.
* Approach 3: Take micro dosage throughout the race, 50-75mg per hour.
* Approach 4 :  (My preferred)
  * Take Full Dosage (300mg - 400mg (4-6)x BW) after bike start
  * Take half dosage (100mg 1.5x ) every two hour
  * Advantage : Not taking too early will avoid going too hard in the start.

{% include image.html file="/images/Caffeine/CaffeineIntake.jpg" description="Caffeine Intake Strategy" max-width="50" %}

Good Resources

1. [TrainerRoad podcast on Caffeine and Racing (17 min)](https://www.youtube.com/watch?v=5S8l40GlLsA)
2. Image reference: https://www.trainerroad.com/forum/t/caffeine-half-life-and-performance/15951/8

gha_language: SCSS


text:
# Single Pin Sigma Delta ADC Driver v1

By: Parallax Inc

Language: Spin

Created: Jan 22, 2015

Modified: January 22, 2015

Theory of Operation:

A key feature with this sigma-delta ADC is that the drive pin is only an output for a brief amount of time, while the remainder of the time it is an input and used as the feedback pin.

A Typical Sigma Delta configuration will have the Drive pin always set as an output and driven either HIGH or LOW while another pin is always an input and used as Feedback.  This technique combines the two methods so that only one pin is necessary.

url: https://raw.githubusercontent.com/parallaxinc/propeller/3f485a2dbf7dc7a23b39387c63c5a626fbcf017e/libraries/community/p1/All/Single Pin Sigma Delta ADC Driver v1/README.md

repository: parallaxinc/propeller

gha_language: Propeller Spin

repo_name: parallaxinc/propeller


text:
# Protostrap - a data driven prototyping framework for designers

#### Version 3.0

Protostrap is a framework intended for high-end prototypes of complex, content-rich applications.
It helps you design role based experiences using almost real data.

Documentation: http://protostrap.ch/start.php
Demo: http://demo.protostrap.ch

## Licence
Protostrap is Licenced under Apache Licence Version 2.0
http://www.apache.org/licenses/LICENSE-2.0.txt

repository: lessamess/protostrap-site

repo_name: lessamess/protostrap-site


text:
# SupplyMission
Story:You are a sergeant on a military peacekeeping mission delivering essential medical supplies
and food to a designated drop zone in a zombie infested city. The zombies don't know about
this drop zone and couldn't care less about medicines.

Because of the nature of the package content, you have ensured that you pack the supplies in a safety package which is soft and will take most of the impact.

This package should bounce a couple of times, before coming to a stop.

Link to Access the Program:-
https://manastech2.github.io/SUPPLY-MISSION-1-Project-C-22-/


text:
## Features

### Clean Playback User Interface

I'm satisfied with the way my playback UI turned out. It's achieved by using [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code), which I had no idea existed before this project.

### Audio Support

I initially played around with [portaudio](https://github.com/gordonklaus/portaudio) for audio support in this project, however I ended up using the [Beep](https://github.com/faiface/beep) library. I chose this library because it had slightly more usage in Github, was being kept up-to-date (last commit about a month ago), and had great documentation.

### Configurability

If you spend a little time in my test-based User Interface, you'll see that multiple aspects of a track can be changed. In addition to different BPMs, the project supports different lengths of tracks, as well as volume control for each individual instrument.

## If I Had More Time

### Testing

I'm generally happy with how I tested the package, however I feel that tests around the `input` package could have been more thorough. In general, it seems difficult to test user input in go, however I still feel that I could have abstracted my menu functionality out a bit better.

### User Interface

Speaking of the user interface, I decided early on that I would not be connecting this project to a UI. This was a conscious decision - I'm not a frontend engineer, so I figured my time would be better-spent implementing more backend features (e.g. volume control) rather than building out a frontend.

### Multi-Platform Support

I've tested this project fairly thoroughly on my own machine, and it works pretty much the way I want it to. That being said, I was able to test in a limited capacity on other platforms (why does my housemate own a Windows laptop) and the results were ... less than stellar.

On Windows, the audio was much choppier than on Mac, and it turns out the generic Windows terminal does NOT support ANSI escape codes, so the text printout was absolute garbage.

I don't have access to a Linux machine that has speakers, so I tested the project in a docker container, where the text printout worked perfectly (minus the audio libraries spewing errors when trying to initialize).

### Dynamic Controls

While my project does allow the user to control multiple aspects of playback before a track begins playing, it does not allow for control during playback. I toyed around with this concept, however ran into a wall when trying to figure out how to add keybindings during playback. I'm sure this is possible, probably even without adding a larger dependency like [tcell](https://github.com/gdamore/tcell).

## Potential Extensions

### User interface

I feel like the first logical extension for this project would be building out a web-based user interface. The terminal, while flexible in its own right, really does pale in comparison with what modern javascript frameworks can accomplish.

Building out this UI would be paired with server-ifying the go project.

### Easier addition of new tracks

Right now, this project features 3 tracks - Four on the Floor, Gravity, and Take Five. I've already done the work the support adding new tracks via new JSON files (also helpful for an API), however the user menus are still hard-coded to display only those three tracks. A simple extension of this project would be to have been to abstract the menu away from these tracks, so that any JSON could just be dropped in an would be able to be played.

### Datastore

Right now tracks live only in memory. This is great for simplicity, but fails when the system needs to handle hundreds or thousands of tracks or instruments. Adding a datastore of any sort could help the system scale with increasing object numbers.

## General Thoughts

### Previous Art

When I initially started thinking about this exercise, I did a quick git search to see if any previous applicants had uploaded their code. As it turns out, I found two - [drumMachine](https://github.com/kdrombosky/drumMachine) and [sm-808-splice](https://github.com/vmogilev/sm-808-splice). These projects both served as inspiration for how I began implementation of some of my features, however I made sure that my project diverged in implementation from either solution early on.

### Thanks

I had a lot of fun with this coding exercise. Different aspects of the project took me to software areas I don't normally interact with (audio, user input, multi-platform, etc). Thanks for providing a fun side project to work on!


text:
#PHP MVC FRAMEWORK

This php MVC Framework uses as a dependency  the package :  illuminate/database to manage database

"require": {
   "php": ">=5.4.0",
    "illuminate/database": "^5.1"
}

###INSTALATION

####DOWNLOAD

Download the github repo  Unzip it then make a composer install to install dependencies

####DATABASE

To setup your database go to  /app/database.php and change the (username,password,atabase)

####HTML HELPERS
Example of script & css tags

```php

    echo Html::script($src);

    echo Html::css($link);

```

####MAIL
Example of creating an e-mail using Nette\Mail\Message class:

```php
 use Nette\Mail\Message;

    $mail = new Message;

    $mail->setFrom('John<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>    ->setSubject('Order Confirmation')
    ->setBody("Hello, Your order has been accepted.");
```

####UPLOAD

Example of UPLOADING  a file

```php
    if (!empty($_FILES['file'])) {

      $handle = new upload($_FILES['file']);
      if ($handle->uploaded) {
        $file_name = md5(rand(1000, 9999999)) ;
       $ext =   explode(".", strtolower($_FILES['file']['name']));
        $handle->file_new_name_body   = $file_name ;

        $handle->image_ratio_y        = true;
        $handle->process(APP.'files');
        if ($handle->processed) {

          $handle->clean();
        } else {
          echo 'error : ' . $handle->error;
        }
      }

}
```
##DOCUMENTATION

### License

This framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

repository: gitter-badger/Chiheb-PHP

repo_name: gitter-badger/Chiheb-PHP


text:
# VikingPress
This is the repository for VikingPress, our custom content management system that uses [Express](https://expressjs.com/) and [Nuxt](https://nuxtjs.org/) to provide a feature set tailored to [The Viking Voice](https://nsmsvikingvoice.org/).

VikingPress is currently under development. If my spaghetti code makes you want to cry, I'm very sorry.

repository: chewtoys/vikingpress

repo_name: chewtoys/vikingpress


text:
# nvm-win
this package as a version management  for the windows platform with nodeJs,type 'nvm-win' for more useful information.

## Purpose

A nodeJs module for controlling the current nodeJs version you use in windows system.

## Installation

npm install nvm-win@latest


text:
# bunto-import

[![Build Status](https://travis-ci.org/bunto/bunto-import.svg?branch=master)](https://travis-ci.org/bunto/bunto-import)
[![Security](https://hakiri.io/github/bunto/bunto-import/master.svg)](https://hakiri.io/github/bunto/bunto-import/master)

The new __Bunto__ command for importing from various blogs to Bunto format.

**Note: _migrators_ are now called _importers_ and are only available if one installs the `bunto-import` _gem_.**

## How `bunto-import` works:

### Bunto v2.x and higher

1. Install the _rubygem_ with `gem install bunto-import`.
2. Run `bunto import IMPORTER [options]`

### Bunto v1.x

Launch IRB:

```ruby
# 1. Require bunto-import
irb> require 'bunto-import'
# 2. Choose the importer you'd like to use.
irb> importer_class = "Behance" # an example, there are many others!
# 3. Run it!
irb> BuntoImport::Importers.const_get(importer_class).run(options_hash)
```

## Documentation

bunto-import has its own documentation site, found at https://bunto-import.tk/.
Dedicated [documentation for each migrator](https://bunto-import.tk/docs/home/) is available there.

repository: bunto/bunto-import

extension: markdown

repo_name: bunto/bunto-import


text:
## Simple HTTP server based on asyncore/asynchat
Originally published: 2004-01-01 10:31:00
Last updated: 2005-10-16 08:26:59
Author: Pierre Quentel

A simple HTTP Server, intended to be as simple as the standard module SimpleHTTPServer, built upon the asyncore/asynchat modules (uses non-blocking sockets). Provides a Server (copied from medusa http_server) and a RequestHandler class. RequestHandler handles both GET and POST methods and inherits SimpleHTTPServer.SimpleHTTPRequestHandler

It can be easily extended by overriding the handle_data() method in the RequestHandler class


text:
# systemd services for Confluent Platform

Available for:
- Confluent Kafka
- Confluent Schema Registry
- Confluent Kafka Connect
- Confluent ZooKeeper
- Confluent Control Center

## Prerequisites

### Users, groups and directories
- Create the users and group:
  - kafka
  - zookeeper
  - confluent-cc
- Create directories:
  - /var/log/kafka
  - /var/log/zookeeper
  - /var/log/confluent-control-center
- Set appropriate permissions

### Kafka Connect Log4j settings
Edit /etc/kafka/connect-log4j.properties, add/change the following lines
```
log4j.rootLogger=INFO, kafkaConnectAppender

log4j.appender.kafkaConnectAppender=org.apache.log4j.DailyRollingFileAppender
log4j.appender.kafkaConnectAppender.DatePattern='.'yyyy-MM-dd-HH
log4j.appender.kafkaConnectAppender.File=${kafka.logs.dir}/connect.log
log4j.appender.kafkaConnectAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.kafkaConnectAppender.layout.ConversionPattern=[%d] %p %m (%c)%n
```

### Confluent Control Center
For logging into files, rename log4j-rolling.properties to log4j.properties. </br>
By default Control Center will log to /tmp. To change, set the paths in log4j.properties after renaming.

# Installation
Put the unit file into the location: /etc/systemd/system/ </br>
Reload systemd:
```
systemctl daemon-reload
```

For auto restart of these services use:
```
systemctl enable servicename.service
```

# Additional settings
Some Apache Kafka settings are set via JVM parameters and environment variables. For example security settings or log paths.

To add environment parameters for systemd services "Environment" entries can be added to the "Service" section of a service. As an example the following line can be added to specify the path to the jaas configuration file needed to enable Kerberos for authentication.

```
Environment="KAFKA_OPTS=-Djava.security.auth.login.config=/etc/kafka/kafka-jaas.conf"
```

More information about Apache Kafka settings and environment variables can be found in the official documentation.

# Summary
JMX is enabled by default. To disable JXM remove the "Environment=" line.

## Confluent Kafka
Kafka properties: /etc/kafka/server.properties </br>
Logs: /var/log/kafka </br>
JMX Port: 10030

## Confluent Schema Registry
Schema Registry properties: /etc/schema-registry/schema-registry.properties </br>
JMX Port: 10050

## Confluent Kafka Connect
Kafka Connect properties: /etc/kafka/connect-distributed.properties </br>
Log: /var/log/kafka/connect.log           </br>
JMX Port: 10040

## Confluent ZooKeeper
ZooKeeper properties: /etc/kafka/zookeeper.properties </br>
Logs: /var/log/zookeeper                              </br>
JMX Port: 10020                                       </br>

repository: Vickells/confluent-systemd

repo_name: Vickells/confluent-systemd


text:
[build badge]: https://github.com/glitch-tools/sync-glitch-cli/workflows/E2E/badge.svg
[build url]:   https://github.com/glitch-tools/sync-glitch-cli/actions

[vulnerabilities badge]: https://snyk.io//test/github/glitch-tools/sync-glitch-cli/badge.svg?targetFile=package.json
[vulnerabilities url]:   https://snyk.io//test/github/glitch-tools/sync-glitch-cli?targetFile=package.json

# sync-glitch-cli [![build status][build badge]][build url] [![Known Vulnerabilities][vulnerabilities badge]][vulnerabilities url]

> Sync changes in your GitHub repository to glitch.com

It pushes changes from a GitHub repository to glitch.com. It does **NOT** pull changes from glitch.com to GitHub.

**Heads-up!**  It uses undocumented API so it can be changed without any notice. However, I am making efforts to know whether it works or not with [test-sync-glitch-cli](https://github.com/sotayamashita/test-sync-glitch-cli). It executes test every day with TravisCI. It helps my recognise as soon as possible if it could be wrong. I am looking forward to official API. :unicorn:

## Install

```bash
npm install sync-glitch-cli --save-dev
```

## Usage

### How to get required environment variables

1. Open your project on Glitch
1. Open devtool and click the Network tab
1. Select Project name > Advanced Options > Import from GitHub
1. You can find a request URL which starts from `https://api.glitch.com/projects/githubImport ~`:

   ![network](https://raw.githubusercontent.com/glitch-tools/sync-glitch-cli/master/public/assets/capture.png)

1. It has three params. These params are what you need.

### How to set environment variables

You have to set the following environment variables:

- `GLITCH_PROJECT_ID` _(the Glitch project id.)_
- `GLITCH_TOKEN` _(the Glitch authorization)_
- `GH_REPO` _(the GitHub repo. e.g `sotayamashita/sync-glitch-cli`)_

```console
GLITCH_PROJECT_ID='' GLITCH_TOKEN='' GH_REPO='' ./node_modules/.bin/sync-glitch
```

Enable debug logs:

```console
GLITCH_PROJECT_ID='' GLITCH_TOKEN='' GH_REPO='' DEBUG=sync-glitch* ./node_modules/.bin/sync-glitch
```

## License

sync-glitch-cli © [Sam Yamashita](https://twitter.com/sota0805). Released under the [Apache 2.0](LICENSE)

Authored and maintained by [Sam Yamashita](https://twitter.com/sota0805) with help from [contributors](https://github.com/glitch-tools/sync-glitch-cli/contributors).

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fglitch-tools%2Fsync-glitch-cli.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fglitch-tools%2Fsync-glitch-cli?ref=badge_large)

repository: glitch-tools/sync-glitch-cli

repo_name: glitch-tools/sync-glitch-cli


text:
DROP ROLE
=========

Synopsis
--------

``` sql
DROP ROLE role_name
```

Description
-----------

`DROP ROLE` drops the specified role in the current catalog.

For `DROP ROLE` statement to succeed, the user executing it should possess admin privileges for the given role.

Examples
--------

Drop role `admin` :

    DROP ROLE admin;

Limitations
-----------

Some connectors do not support role management. See connector documentation for more details.

See Also
--------

[CREATE ROLE](./create-role.md), [SET ROLE](./set-role.md), [GRANT ROLES](./grant-roles.md), [REVOKE ROLES](./revoke-roles.md)


text:
# Invert Image Colors
Use this simple script to help you invert image colors just by selecting the input directory (should only contain the images that need to be processed) and the output directory where the processed images will be saved.

### Hope it was helpful!

repository: astqx/InvertImageColors

repo_name: astqx/InvertImageColors


text:
# Disaster-Response-Classification

## Table of Contents
1. [Description](#description)
2. [Motivation](#motivation)
3. [Getting Started](#getting_started)
    1. [Dependencies](#dependencies)
    2. [Installing](#installing)
    3. [Executing Program](#executing)
4. [Acknowledgement](#acknowledgement)
5. [Screenshots](#screenshots)

## Description
This project is part of Data Scientist Nanodegree Program by Udacity in collaboration with Figure Eight.
The initial dataset contains pre-labelled tweet and messages from real-life disaster.
The aim of the project is to build a Natural Language Processing tool that categorize messages.

The project is divided in the following Sections:

1. Data Processing, ETL Pipeline to extract data from source, clean data and save them in a proper database structure
2. Machine Learning Pipeline to train a model able to classify text message in categories
3. Web App to show model results in real time.

## Project Motivation
Following a disaster, there are a number of different problems that may arise. Different types of disaster response
organizations take care of different parts of the disasters and observe messages to understand the needs of the
situation. They have the least capacity to filter out messages during a large disaster, so predictive modeling can help
classify different messages more efficiently. This is where a project like this can help. This will classify incoming
 messages into categories so that first responder and organisations can prioritize help to people who need it the most.

## Getting Started

### Dependencies
* Python 3.7 (Anaconda preferred)
* Machine Learning Libraries: NumPy, SciPy, Pandas, Sciki-Learn
* Natural Language Process Libraries: NLTK
    * NLTK specific libraries: punkt, wordnet, averaged_perceptron_tagger
* SQLlite Database Libraqries: SQLalchemy
    * You may also need to get SQLlite related driver files.
* Web App and Data Visualization: Flask, Plotly

### Installing
* Clone this repository:

```commandline
git clone git@github.com:agpt8/Disaster-Response-Classificatio.git
```

* Go into this directory and install the dependencies

```commandline
cd Disaster-Response-Classification

conda env create -f environment.yml
```
* If you don't have conda installed, isntall the dependencies with the following command

```commandline
pip install scikit-learn=0.19 numpy pandas flask plotly nltk scipy sqlalchemy
```

* You need to install a specific version of scikit-learn (shown above) as later versions of the library throws a
 specific attribute error regarding deprecation script.

### Executing Program:
1. Run the following commands in the project's root directory to set up your database and model (the order of the
 arguments is important).

    - To run ETL pipeline that cleans data and stores in database

        ```commandline
      python data/process_data.py data/disaster_messages.csv data/disaster_categories.csv data/DisasterResponse.db
      ```

    - To run ML pipeline that trains classifier and saves

        ```commandline
      python models/train_classifier.py data/DisasterResponse.db models/classifier.pkl
      ```

    - If you get an error during any of the above reagrding nltk module not found, refer
    [this](https://www.nltk.org/data.html), to download the modules manually.

    - The training could take several hours. On my PC, it took ~9 hours to train the model. If you just want to test
     this, feel free to use the included model.

2. Run the following command to start the web app.
    `python app/run.py`

    * If during running the app, if you run into error saying model not found in `joblib.load(model/classifier.pkl
    )`, try using absolute path of the model here. Python some times fail to use relative paths. Also, if the
     absolute path has backslash `"\"`, don't forget to escape it (`\\`).

3. Go to http://<IP_ADDRESS>:3001/

## Acknowledgements

* [Udacity](https://www.udacity.com/) for providing such a complete Data Science Nanodegree Program
* [Figure Eight](https://www.figure-eight.com/) for providing messages dataset to train my model

## Screenshots
Screenshot of the APP:
![Home Page](png/home_page_1.jpg)
![Home Page](png/home_page_2.jpg)
![Results page](png/results_page.png)


text:
Miscellaneous public domain utility scripts. See
[tools](https://github.com/jangler/tools) for compiled utilities.

Scripts are organized by language. Sometimes a script has implementations in
multiple languages.

- `bash/explode` - explode directories
- `bash/gifopt` - optimize the size of a GIF using
  [gifdrop](https://github.com/jangler/tools) and gifsicle
- `bash/jpegopt` - optimize the size of a JPEG using ImageMagick
- `bash/mdgen` - generate a full HTML document from a Markdown file
- `bash/moss-find` - invoke a [moss](https://github.com/jangler/moss) command
  with arguments given by find
- `bash/mp3mod` - convert tracker modules in a folder to volume-equalized MP3
  using schismtracker,
  [loudness-scanner](https://github.com/jiixyj/loudness-scanner), and sox
- `bash/prune` - remove empty directories from a directory tree
- `bash/wdname` - rename tmux window to basename of working directory
- `bash/wri` - view formatted ri output in browser using markdown
- `bash/xsync` - synchronize clipboard with primary selection using xclip
- `chicken/bundle` - collect a dynamically linked executable's dependencies in
  the working directory, and make the executable load its libraries from its
  working directory
- `chicken/r7rs-benchmark-stats` - run stats on
  <https://ecraven.github.io/r7rs-benchmarks/all.csv>
- `luajit/randparty` - generate a random pokémon red and/or blue party
- `python/automaster` - master and encode a set of audio files
- `python/finances` - tally ledger information from a JSON file
- `python/hex2schism` - convert a 24-bit hex color to a 3-tuple for
  schismtracker
- `python/jsonfmt` - pretty-print JSON
- `python/mp3level` - slightly more specific variation of `automaster`
- `python/musorg` - organize audio files based on metadata using pytaglib
- `python/pyjson` - load JSON files and enter a Python REPL
- `{python,racket}/tab` - pretty-print or un-pretty-print CSV
- `python/shellname` - translate arguments or lines to ASCII letters, digits,
  and hyphens
- `ruby/taginfo` - print information about a git tag

repository: jangler/scripts

repo_name: jangler/scripts


text:
Isolated VirtualBot Thing
=========================

A proof of concept server to host VirtualBot and run VirtualBot code.

## Instructions

1. Clone the VirtualBot repository (https://github.com/OASTEM/VirtualBot) and build it with Apache Ant using `build.xml`.
2. Install Docker from its official repositories, and then build the Dockerfile with `docker build -t oastem/virtualbot .`.
3. Start the Python webserver by starting the virtual environment and then running `web.py`.
4. Have students run code.

repository: OASTEM/robot-simulator-server

repo_name: OASTEM/robot-simulator-server


text:
# Kunstmaan German Backend Bundle

## What does it do?

Adds and overrides german translations for the Kunstmaan CMS backend.

## Installation

    composer install dreadlabs/kunstmaan-german-backend-bundle

## How to use?

  1. Load the bundle in your `AppKernel`

         // snip
         new DreadLabs\KunstmaanGermanBackendBundle\DreadLabsKunstmaanGermanBackendBundle()
         // snap

repository: DreadLabs/KunstmaanGermanBackendBundle

repo_name: DreadLabs/KunstmaanGermanBackendBundle


text:
# intro-to-ml [![Gitter chat](https://badges.gitter.im/csc_training/intro-to-ml.svg)](https://gitter.im/csc_training/intro-to-ml)
Exercises for [CSC](https://www.csc.fi/)'s Practical Machine Learning course

See [SETUP.md](SETUP.md) for instructions on how to set up Notebooks.

## Exercises

* Exercise 01: [Introduction to Notebooks, Python](https://github.com/csc-training/python-introduction/blob/gh-pages/notebooks/examples/1%20-%20Introduction.ipynb), and [numpy](https://github.com/csc-training/python-introduction/blob/gh-pages/notebooks/examples/7%20-%20NumPy.ipynb)
* Exercise 02: [Linear classifiers](Exercise-02.ipynb)
* Exercise 03: [Nearest neighbor classifiers](Exercise-03.ipynb)
* Exercise 04: [Linear and polynomial regression](Exercise-04.ipynb)
* Exercise 05: [Classification with SVMs](Exercise-05.ipynb)
* Exercise 06: [Regression with SVMs](Exercise-06.ipynb)
* Exercise 07: [Classification with decision trees](Exercise-07.ipynb)
* Exercise 08: [Regression with decision trees](Exercise-08.ipynb)
* Exercise 09: [Classification with neural networks](Exercise-09.ipynb)
* Exercise 10: [Regression with neural networks](Exercise-10.ipynb)
* Exercise 11: [Dimensionality reduction](Exercise-11.ipynb)
* Exercise 12: [Data visualization](Exercise-12.ipynb)
* Exercise 13: [Clustering](Exercise-13.ipynb)
* Exercise 14: [Anomaly detection](Exercise-14.ipynb)

## Extra

* Extra 01: [Classification with naive Bayes](Extra-01.ipynb)
* Extra 02: [Parameter grid search for SVM classification](Extra-02.ipynb)
* Extra 03: [Ensemble of classifiers](Extra-03.ipynb)


text:
# Queue

## Quick reference

|           | Worst Case |
| --------- | ---------- |
| space     | O(n)       |
| enqueue   | O(1)       |
| dequeue   | O(1)       |
| peek      | O(1)       |

A queue stores items in a first-in, first-out (FIFO) order.

**Strengths**:
1. Fast operations. All queue operations take O(1) time.

**Uses**:
1. Breadth-first search uses a queue to keep track of the nodes to visit next.
2. Printers use queues to manage jobs — jobs get printed in the order they're submitted.
3. Web servers use queues to manage requests — page requests get fulfilled in the order they're
received.
4. Processes wait in the CPU scheduler's queue for their turn to run.

## Implementation

Queues are easy to implement with linked lists:
1. To enqueue, insert at the tail of the linked list.
2. To dequeue, remove at the head of the linked list.

repository: RommelTJ/ExercisesAndAlgorithms

gha_language: Java

repo_name: RommelTJ/ExercisesAndAlgorithms


text:
The requirements.txt and requirements_ansible.txt files are generated from requirements.in and requirements_ansible.in, respectively, using `pip-tools` `pip-compile`. The following commands should do this if ran inside the tools_awx container.

Run these commands from the root of the awx repo. This will produce python 3 requirements files.
If you do not wish to upgrade dependencies generally (such as adding a specific dependency
needed for a feature) then do not use the `-U` flag.

```
python3 -m venv /buildit
source /buildit/bin/activate
pip install pip-tools
pip install pip --upgrade

pip-compile -U -r --allow-unsafe --output-file requirements/requirements.txt requirements/requirements.in
pip-compile -U -r --allow-unsafe --output-file requirements/requirements_ansible_py3.txt requirements/requirements_ansible.in
```

Remove the `docutils` line from `requirements/requirements.txt`.

The Ansible venv requirements file needs to start with the python 2 version
as a base. Then we can run the tool again to get the python 3 version.
Consult the output of the `diff` command and add a conditional switch in those cases.

```
virtualenv -p python2 /buildit_py2
source /buildit_py2/bin/activate
pip install pip-tools
pip install pip --upgrade

pip-compile -U -r --allow-unsafe --output-file requirements/requirements_ansible.txt requirements/requirements_ansible.in
diff requirements/requirements_ansible_py3.txt requirements/requirements_ansible.txt
rm requirements/requirements_ansible_py3.txt
```

Python 3 exceptions should be added to relevant `requirements_ansible.txt` lines
after version numbers with the syntax of `; python_version < '3'`.

## Licenses and Source Files

If any library has a change to its license with the upgrade, then the license for that library
inside of `docs/licenses` needs to be updated.

For libraries that have source distribution requirements (LGPL as an example),
a tarball of the library is kept along with the license.
To download the PyPI tarball, you can run this command:

```
pip download <pypi library name> -d docs/licenses/ --no-binary :all: --no-deps
```

Make sure to delete the old tarball if it is an upgrade.

repository: shaunstanislauslau/awx

branch_name: refs/heads/devel

gha_license_id: NOASSERTION

repo_name: shaunstanislauslau/awx


text:
# ember-table-it
{{table-it}} component addon for simple table construction using Bootstrap 3

# Ember-table-it

![Simple table example](https://cloud.githubusercontent.com/assets/891261/6999826/5e1d677c-dbe3-11e4-8c63-60ab12685a15.png)

## Dependencies

* **Bootstrap 3** for style
* **Ember-data** This library assumes to be working with Ember-data

## Getting Started

Install via ember-cli, `ember install:addon ember-table-it`, then use in your app.

### Available Options

#### Required
- `columns`: An array of column identifications. `label` is the text to show and `name` is the attribute name to pull from model
```js
[
  {
    label: 'ID',
    name: 'id'
  }, {
    label: 'Name',
    name: 'name'
  }, {
    label: 'Birthday',
    name: 'dob'
  }
];
```

- `rows`: Model collection

#### Optional
- `action`: Handler for the `setPage` action that gets raised during pagination

Following outlines the details of collaborating on this Ember addon.

### Quick Example
Assuming we have a simple model called `user`. And we wanted to display them paginated.

**NOTE** For pagination to work, you have to have meta data called `total_pages` in your response from server. See [serializers](http://emberjs.com/api/data/classes/DS.RESTSerializer.html#method_extractMeta) for converting meta data if your server is returning different attribute for number of total pages

**NOTE 2** Pagination has to be applied to the models and handled by the calling controller/component

After you set your model in your route. In your controller or component
```js
import Ember from 'ember'

export default Ember.Controller.extend(
  columns:
    [
      {
        label: 'ID',
        name: 'id'
      }, {
        label: 'Name',
        name: 'name'
      }, {
        label: 'Birthday',
        name: 'dob'
      }
    ];
  actions: {
    setPage: function(pageNum){
      this.set('users', this.store.find('user'), { page: pageNum });
    }
  }
);
```

In the corresponding template

```js
{{table-it columns=columns rows=rows action="setPage"}}
```

This will fully render the data.

## Installation

* `git clone` this repository
* `npm install`
* `bower install`

## Running

* `ember server`
* Visit your app at http://localhost:4200.

## Running Tests
### Unit tests aren't completed yet
* `ember test`
* `ember test --server`

## Building

* `ember build`

For more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/).

repository: tolgaek/ember-table-it

repo_name: tolgaek/ember-table-it