text:
---
layout: post
title: Charging AirPods with an iPhone
comments: true
---
<meta property="og:image" content="https://raw.githubusercontent.com/sunnybala/sunnybala.github.io/master/assets/solder_lightning.jpg"/>

Several [tech journalists](https://appleinsider.com/articles/19/04/01/2019-iphone-should-be-able-to-power-the-airpods-wireless-charging-case) have speculated that the new iPhone later this year will be able to share its power to charge AirPods. That's great for people that buy the new airpods and the newest phone...but what about the rest of us? **Good news -- there's no need to wait till October 2019 when we can build something to do it today!**

## The Plan

Build a cable to extract power from an iPhone and use it to charge other devices. I don't have much experience with electronics so it's also an

## Background

I couldn't seem to find much online about this except other people asking if this sort of thing was possible. There was a [crowdfunded product](https://www.indiegogo.com/projects/chargebite-a-social-charger "Indiegogo") for something in the space 5-6 years ago, but that required having 2 iPhones to donate power to charge 1. There's one  YouTube video  that claimed to do this but many of the comments suggested that it was fake. Based on what I've seen, the specific claims of iPhone to iPhone charging appear to be fake but using that method for airpods works. The lack of other prior work on charging in this way, even for hobby projects, definitely made me suspicious that there was a big roadblock somewhere in the process that I would hit. I was pretty surprised to see this actually work! I think I lucked out due to the lower charging requirements of the AirPods relative to the iPhone.

For anyone following along to try the same, **definitely proceed at your own risk with making this. I’m no expert so I can’t speak to whether this can damage your devices.**

## Hardware Setup

Recipe:
- [1x Lightning Port Fan](https://www.amazon.com/gp/product/B078P7WVKD "Amazon")
- [3V to 5V Step Up Board](https://www.amazon.com/gp/product/B07F266X24 "Amazon")
- 1x Lightning cable
- Some wire

I bought a 4 pack of the fans knowing I'd probably mess up and break a few. That ended up being a good call because I broke 3.

Required Tools:
- Soldering Iron
- Some sort of cutting tool (I used a Dremel)

I also found my hot glue gun and heat shrink tubing for wires helped keep things in place but it's not necessary.

## Build

 There’s only 2 steps here to get this working.

#### Step 1: Power Extraction

The iPhone lightning port isn’t really meant to be used to draw power. Finding information on how to do this is pretty tough – perhaps being a member of the Apple hardware development program would make finding that easier, but only corporations can join (not individuals). Finally, lightning devices have authentication chips inside the cable, so building this part from scratch didn’t seem viable for me.

However, there are lightning accessories that don’t have power of their own. For example, [this keyboard](https://www.amazon.com/Logitech-Wired-Keyboard-Lightning-Connector/dp/B079VTRQVG) or [this flash drive](https://www.amazon.com/SanDisk-iXpand-Flash-Drive-iPhone/dp/B01CIEBU22) or [this fan](https://www.amazon.com/Pack-Phone-Fans-Portable-iPhone/dp/B078P7WVKD). If we can just take apart one of these accessories, we can take advantage of whatever power drawing method they’ve built. I chose this 1 Watt lightning fan based on something I saw in a  similar YouTube video.

I used my Dremel to cut away the hard plastic casing of the fan. Despite being lightning, the fan only worked when plugged into my phone with the fan facing me. When facing the fan away from me, nothing happened. While taking this apart, make sure to remember which way the cable has to be plugged in. For me, the flatter side of the chip had to be facing up.

Next, I de-solder the connections between the chip and the fan’s motor. This gives me a standalone chip. Plugging it into my phone and using a multimeter, I recorded a voltage of 3.3V.

#### Step 2: Matching Voltage

This presents 2 issues. USB charging needs 5V, so we’ll need to step it up. However, once we step it up, we’ll only be running 200 mA (1W/5V) through our charger. For comparison, standard Apple wall USB chargers are 5 Watts and therefore provide 1000 mA (and 2000 mA for fast charging 10 Watt adapter!). This 200 mA is too low for charging Apple’s bigger devices (iPhone, iPad) but as I see later, it’s enough for AirPods.

I used a step up regulator I bought from Amazon to convert from 3.3V to 5V. The additional benefit is that the USB output keeps things pretty flexible on what I want to power (ex. my kindle instead of AirPods). After soldering the connection I checked my multimeter to confirm I was getting 5V. I was ready to test!

#### Results

Plugging the devices into each other was the scary part...but it worked. The AirPods charged without a fuss and my phone didn't burst into flames. I kept track of the charge reported and measured a charge of rate of 2% per minute on the case (measured minutely over 40 minutes). My expectation was that this DIY charger would be slower. Surprisingly, that's the same charge rate that I record with the standard wall adapter over a similar measurement period!

It's also true that if I plug my iPhone 6 into my iPhone X (using the 6 as the charge donor) the charging does appear to activate, however, it doesn't seem to actually charge. This is likely because there just isn't enough power coming out of the donor iPhone.

## Gotchas

The iPhone fan connector is pretty sensitive and easy to break – I broke my first version of this after testing for a day just from repeated insertion. I suggest putting some sort of casing around the chip so it doesn’t flex against the lightning connector. In my final build, I cut the fan casing to keep part of the shell around the lightning cable and used hot glue to keep it fixed to the circuit. That way I could insert the cable without worrying as much about breaking the connector.

## Sources

 This youtube video  claims to make an iPhone to iPhone charger in a similar way. Several comments suggest the charging shown here might be fake. From the calculations, I just don’t see how it’s possible to extract enough power to charge a phone in this way. But it’s not totally fake – I think if he had tried other devices it might have worked, just like what I'm seeing in these results.


text:
# Greatheart
A webapp template utilizing MongoDB, Express, React, and Node.js, and a _work in progress_. Enjoy!

## Table of Contents

- [To Do](#to-do)
- [Me](#me)
- [You](#you)
- [Getting Started](#getting-started)
- [Firing up the Application](#firing-up-the-application)
  * [Express Server](#express-server)
    - [Restarting with Nodemon](#restarting-with-nodemon)
  * [Development Server](#development-server)
- [Secure Cookies](#secure-cookies)
- [Database](#database)
  * [Database Operations](#database-operations)
    - [Testing Connections](#testing-connections)
    - [Writing to a Collection](#writing-to-a-collection)
    - [Searching a Collection](#searching-a-collection)
    - [Updating a Record in a Collection](#updating-a-record-in-a-collection)
    - [Removing a Record from a Collection](#removing-a-record-from-a-collection)
  * [Promise-based Database Methods](#promise-based-database-methods)
- [Helpful Resources](#helpful-resources)

### To Do
- ~~Scan user uploads for malware~~
- Update ClamAV with daily definitions
- Create log files for each api
- Fix issue with `maxsize` not rotating logs
- Better handling of nonexistent URLs

### Me

I'm Matt Tischler, a software engineer living, working, and learning in the DC area. Separate from my day job I'm working on a few other applications, one of which is _The Greatheart Project_ (shortened here to _TGP_). While the full scope of _TGP_ has yet to be fleshed out, my first step in its creation is to build a reusable repo consisting of a server, client, and database. This repository will be used as a basis for both _TGP_ and future web applications.

### You

Welcome! I'm glad you stopped by. Please feel free to submit a pull request, review some code, fork the repo, or copy any part of this project.

### Getting Started

**NOTE**: As of 04/08/2018, Redis has been implemented to handle the new Node cluster functionality. This will break Windows installations that don't utilize Redis.

First, clone the repo:

`git clone git@github.com:mjtischler/greatheart.git`

The TGP server utilizes [ClamAV](https://www.clamav.net/documents/installing-clamav) and [clamscan](https://github.com/kylefarris/clamscan) to sanitize user uploads. Clamscan is added via npm, but you'll need to follow the install instructions for ClamAV via the link above. On a Debian distro use:

`sudo apt-get install clamav`

This project requires [Node.js](https://nodejs.org/en/download/), so be sure you have at least version 8.x it installed on your platform of choice. On a Debian distro you can make sure you're pointed to the latest NodeJS and install it with:

`curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -`

`sudo apt-get install -y nodejs`

This project will require installing dependencies from both the `/greatheart/client` and `/greatheart/server` directories using:

`npm install`

**NOTE**: On Linux there is currently an issue with the `uglifyjs-webpack-plugin`, so you'll want to run the following commands from the `greatheart/client` directory:

`npm install`

`npm i -D uglifyjs-webpack-plugin@beta`

`npm install`

Config files for [ESLint](https://www.npmjs.com/package/eslint) are provided under each application directory, and will lint according to that application's technology (i.e. `/server` will lint using `eslint-plugin-node` and `/client` will do the same using `eslint-plugin-react`). Your'll want to install these plugins globally if you plan on using ESLint in your editor:

`npm install -g eslint-plugin-node`

`npm install -g eslint-plugin-react`

### Firing up the Application

#### Express Server

The workflow for local development is a tad awkward and may be tweaked in the future. Before running the Express server, you'll want to generate a production build of the project for Express to provide to the client. From the `/greatheart/client` directory:

`npm run build`

**NOTE**: This will delete the last built client-side code from the server's `public` directory and copy the latest front-end updates for Express to serve up. See the client's `package.json` for how we're doing this if you have issues.

To start the Express server, navigate to the `/greatheart/server` directory and run:

`npm start`

This will serve a copy of the production build of the React app and all APIs at `http://localhost:3001/`.

**NOTE**: This version is for production testing and API access only. Any changes to the development version of the client app will not be reflected here until `npm run build` is executed from the `greatheart/client` directory.

##### Restarting with Nodemon

To automatically restart the Express server when a file changes, use:

`npm run nodemon`

#### Development Server

To launch a live-reloading development server, head to `/greatheart/client` and run:

`npm start`

You can now access your client-side code at:

`http://localhost:3000/`

### Secure Cookies

For now, we're going to use secure cookies to store session data. You can choose to use a memory cached method (like Redis or Memcached), or store your sessions in the DB.

Express will look for a secret key `string` for your cookie on application load. You'll need to create a file in `/cookies` called `secret-key.json` and have it contain a random string:

`"THISISASUPERRANDOMAMAZINGSTRING"`

**NOTE**: This directory is `gitignore`'d because it contains sensitive information.

### Database

This project utilizes [MongoDB](https://www.mongodb.com) for data storage. You'll need to sign up for a MongoDB Atlas cluster [here](https://www.mongodb.com/download-center).

Our project will be looking for a database connection string in `/server/db/access/connection-string.json`, which has been `gitignore`'d for this project since it contains sensitive data. You need to create this file using the following template:

`
 "mongodb://{{USERNAME}}:{{PASSWORD}}@{{PRIMARY_NODE}}:27017,{{SECONDARY_NODE_1}}:27017,{{SECONDARY_NODE_2}}:27017/{{DATABASE_NAME}}?ssl=true&replicaSet={{NODE_MASTER_SOURCE}}-0&authSource=admin"
`

Further information on connecting to your Atlas instance can be found [here](https://docs.atlas.mongodb.com/driver-connection/#node-js-driver-example) in the section _MongoDB Version 3.4 and earlier_, and by logging into Atlas and checking *Clusters -> Connect -> Connect Your Application.* Replace the code above demarcated by `{{PARAMETER}}` with the necessary information. Once you've established a connection to your database, you'll be able to perform all necessary CRUD operations.

If you want to avoid installing the entire MongoDB framework on your machine or just like using a GUI, [download Robo 3T](https://robomongo.org/download) and follow [this tutorial](https://www.datduh.com/blog/2017/7/26/how-to-connect-to-mongodb-atlas-using-robo-3t-robomongo) to get connected to your Atlas instances.

#### Database Operations

To access the library of CRUD commands, you'll need to use `require()` in your modules:

`const db = require('../db/db-access');`

**NOTE**: The pathing may vary depending on where your file is located (i.e. `../db/db-access` vs `../../db/db-access`)

You can now call any operation by utilizing `db.{{FUNCTION_NAME}}`.

##### Testing Connections

The `testConnection()` function requires no parameters and will either fail the system (since a database connection is required) or return a successful response.

##### Writing to a Collection
(_Promise-based_, [see below](#promise-based-database-methods))

`writeToCollection()` is used for writing one or more objects to the database and requires two parameters: `collectionName` and `newRecord`. `collectionName` is the document of your database to which you wish to write and must be a `string`. `newRecord` can be an `object`, or an `array` of `objects`. `isInsertingMultiple` is a `boolean` and if `newRecord` is an array then it must set to `true`.

##### Searching a Collection
(_Promise-based_, [see below](#promise-based-database-methods))

`searchCollection()` is used for returning records from a collection based on a query and requires one parameter: `collectionName`. `collectionName` is the document of your database through which you wish to search and must be a `string`. `query` is an `object` that matches the collection's data structure (i.e. the key/pair for which you're searching). Not passing a `query` will return the entire collection.

##### Updating a Record in a Collection
(_Promise-based_, [see below](#promise-based-database-methods))

`updateCollection()` is used for updating one or more objects in the database and requires two parameters: `collectionName` and `recordID`. `collectionName` is the document of your database to which you wish to write and must be a `string`. `recordID` is the `string` key that matches the document's `_id`. `updatedRecord` must be an `object`. **TO DO**: Allow updating multiple records.

##### Removing a Record from a Collection
(_Promise-based_, [see below](#promise-based-database-methods))

`removeFromCollection()` is used for removing a record from the database and requires two parameters: `collectionName` and `recordID`. `collectionName` is the document of your database to which you wish to write and must be a `string`. `recordID` is `string` key that matches the document's `_id`. **TO DO**: Allow removing multiple records.

#### Promise-based Database Methods

CRUD operations against the database will return a promise of either `resolve` or `reject`. When calling a promise-based function in an API, you'll want to append the call with `.then()` to retrieve the response (`updateCollection()` can be an exception depending on circumstance). All CRUD operations return a `.catch()` when a promise is rejected, and that will need to be accounted for as well. An example:

```
router.get('/', (req, res) => {
  db.searchCollection('test')
    .then(resolve => {
      res.json([resolve.result]);
    })
    .catch(reject => {
      console.log(reject.status, reject.result);
    });
});
```

### Helpful Resources

This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app) and utilizes tutorials from [Dave Ceddia](https://daveceddia.com/) ([Create React App with an Express Backend](https://daveceddia.com/create-react-app-express-backend/), [Create React App with Express in Production](https://daveceddia.com/create-react-app-express-production/)). You can find further information on tasks related to the React portion of this project [here](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md).

[Daniel Deutsch](https://medium.com/@ddcreationstudi) has written a [good primer](https://medium.com/of-all-things-tech-progress/starting-with-authentication-a-tutorial-with-node-js-and-mongodb-25d524ca0359) on authentication with Node.js and MongoDB. I'm much obliged for his tutelage.

license: MIT

repository: mjtischler/greatheart

branch_name: refs/heads/develop

extension: md

gha_language: JavaScript

license_type: permissive

repo_name: mjtischler/greatheart


text:
---
layout: post
title: 'Conservatives Deconstructed'
categories:
 - elsewhere
---

Conservatives Deconstructed by Joel Bleifuss

Numerous studies have also shown that conservative policymakers entertain less cognitively complex thoughts than their liberal or moderate counterparts.

...The authors write that the fact that conservatives are "less tolerant of ambiguity, less open to new experiences, and more avoidant of uncertainty. may help explain why "congressional Republicans and other prominent conservatives in the United States have sought unilaterally to eliminate public funding for the contemporary arts."

From an early age, conservatives demonstrate a personal need for order and structure. One study has shown that conservative teens are more likely to say they are "neat, orderly and organized" than are liberal adolescents...

"framing events in terms of potential losses rather than gains leads people to adopt cognitively conservative, as opposed to innovative, orientations."

Of course, the greatest personal loss is death. Studies demonstrate that the people who most fear death are the most conservative. More generally, the fear of death and the resulting protective posture that such a threat engenders cause people to become conservative and to strongly "defend culturally valued norms and practices" and "to distance themselves from, and even to derogate, out-group members to greater extent."

repository: dealingwith/poole

branch_name: refs/heads/master

extension: markdown

gha_language: CSS

repo_name: dealingwith/poole


text:
[![Contributors][contributors-shield]][contributors-url]
[![Stargazers][stars-shield]][stars-url]
[![MIT License][license-shield]][license-url]

Sorting Visualiser

    Visualise and benchmark sorting algorithms

    View Demo
    ·
    Report Bug
    ·
    Request Feature

  Table of Contents

      About The Project

Components

Built With

      Getting Started

Prerequisites

Installation

Usage

Roadmap

Contributing

License

Contact

## About The Project
[![Sorting-visualiser][product-screenshot]](https://sort-visualise.herokuapp.com/)

This is a web application created to visualise all sorts of sorting algorithms and to benchmark them in order to be able to compare them

What it does:
* Lets the user choose between a list of implemented sorting algorithms
* Lets the user customise the application behaviour by modifying given settings
* Visualise results, directly on canvas or having charts (ex. pie-chart) and table results

How it does it:
* All sorting algorithms are implemented in place, so that the input array reference is shared between the UI component that renders the animated charts and the sorting algorithm function (mutable array). This allows real-time drawing, as the UI gets re-rendered automatically if the internal representation of any input variable changes (array in this case) - see Angular Change Detection and how it is triggered for more information

### Components

I've tried to create this application as modular as possible, by creating loosely-coupled interactions between components using services and RxJS in Angular

Here is a list of components (main-layout deals with rendering the needed components):
* [Sorting selection](sorting-visualiser/src/app/main-layout/sorting-selector)
* [Modular sorting chart/canvas](sorting-visualiser/src/app/main-layout/sorting-chart)
* [Settings](sorting-visualiser/src/app/main-layout/settings)
* Results:
    * [Bar chart](sorting-visualiser/src/app/main-layout/results/bar-chart)
    * [Line chart](sorting-visualiser/src/app/main-layout/results/line-chart)
    * [Pie chart](sorting-visualiser/src/app/main-layout/results/pie-chart)
    * [Table](sorting-visualiser/src/app/main-layout/results/table)
    * [Loading HoC](sorting-visualiser/src/app/main-layout/results/loading-wrapper)

### Built With

Frameworks:
* [Angular](https://angular.io/)
* [Angular Material](https://material.angular.io/)

Libraries / plugins / add-ons / toolkits:
* [Ng2-Charts](https://valor-software.com/ng2-charts/)
* [Ngx-color-picker](https://www.npmjs.com/package/ngx-color-picker)
* [Boostrap](https://getbootstrap.com/)

## Getting Started

To get a local copy up and running follow these simple example steps.

### Prerequisites

A list of prerequisites in order to run the project:
* npm
  ```sh
  npm install npm@latest -g
  ```

### Installation

1. Clone the repo
   ```sh
   git clone https://github.com/mihai10001/sorting_visualiser.git
   ```
2. From the root folder
   ```sh
   cd ./sorting-visualiser
   ```
3. Install NPM packages
   ```sh
   npm install
   ```
4. Run the application with NPM
   ```sh
   npm run start
   ```

### Docker

If you prefer using Docker, you can build and run the application using the following commands:
   ```sh
   docker build -t sorting-visualiser .
   docker run -d sorting-visualiser
   ```

## Usage

Pick a list of sorting algorithms from the selection dropdown, and press the Play button

Customise any preferred settings from the settings area

Please feel free to add new sorting algorithms by modifying [this file](sorting-visualiser/src/app/sorting-functions.ts).
If you want results displayed, follow the interface for defining a sorting function from the file above, and return a Results object at the end of the function

## Roadmap

Version 2.0
* Will contain many more sorting algorithms
* Will fix the delay logic that biases algorithms by swaps (rather by swaps and comparisons)
* Might defer the sorthing algorithms execution to different threads (web-workers) to alleviate processes running on the main UI thread

Version 3.0
* Maybe will find a way to implement algorithms that are not sorted in place

See the [open issues](https://github.com/mihai10001/sorting_visualiser/issues) for a list of proposed features (and known issues).

## Contributing

Feel free to reuse any of the code from this project. Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3.  Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## License

Distributed under the MIT License. See `LICENSE` for more information.

## Contact

Iliuta Mihai-Victor -<EMAIL_ADDRESS>
Project Link: [https://github.com/mihai10001/sorting_visualiser](https://github.com/mihai10001/sorting_visualiser)

It is one of the projects I've always wanted to create because it ties together knowledge from many areas I'm interested in, such as algorithms, benchmarking, animations and UI interactions, etc.

[contributors-shield]: https://img.shields.io/github/contributors/mihai10001/sorting_visualiser.svg?style=for-the-badge
[contributors-url]: https://github.com/mihai10001/sorting_visualiser/graphs/contributors
[stars-shield]: https://img.shields.io/github/stars/mihai10001/sorting_visualiser.svg?style=for-the-badge
[stars-url]: https://github.com/mihai10001/sorting_visualiser/stargazers
[license-shield]: https://img.shields.io/github/license/mihai10001/sorting_visualiser.svg?style=for-the-badge
[license-url]: https://github.com/mihai10001/sorting_visualiser/blob/main/LICENSE.txt
[product-screenshot]: images/screenshot.png

branch_name: refs/heads/main


text:
## Overview :notebook:

> A brief description of what this PR does and what's its purpose.

## Links to issues/other PRs :link:

> Every PR has to have an associated issue (use `closes` keyword to close issue automatically after merging).

## Screenshots, video :framed_picture:

| Before | After |
|--------|-------|
| | |

## Testing :mag:
> Consider to write tests to cover the new changes and provide instructions on how to test your changes (if applicable).

1.
1.
1.

## Notes :spiral_notepad:

> Include any other relevant information, e.g. warnings, help with review, new dependencies you included, etc. (if applicable)

repository: cookpad/SocialConnect

gha_language: Kotlin

gha_license_id: MIT

repo_name: cookpad/SocialConnect


text:
# Observable

This is ultimately what is always consumed in React Zedux. An observable or a [StoreApi](/api/StoreApi.md) may be passed to [`createContext()`](/api/createContext.md). But since a StoreApi is just a wrapper around an observable, observables are what it all comes down to.

## Definition

```typescript
interface Observable<TState> {
  getState?(): TState
  subscribe(observer: Observer<TState>): { unsubscribe(): void } | (() => void)
}
```

Observables can take many forms. But they must have a `subscribe()` function that accepts an observer function. The observer should be called every time the observable emits (for a store, that's when the store's state updates).

They can return either:

- A function that can be called to unsubscribe from the observable.
- An object containing an `unsubscribe()` property that can be called to unsubscribe from the observable.

If the observer is not passed the new state, React Zedux will try to call the observable's optional `getState()` method to retrieve the new state. This is because Redux. Yep.

## Examples

The following are all valid observables:

```js
import { Observable } from 'rxjs'

const state$ = Observable.interval(1000)
```

```js
import { BehaviorSubject } from 'rxjs'

const state$ = new BehaviorSubject()
```

```js
import { createStore } from 'zedux'

const store = createStore()
```

```js
import { createStore } from 'redux'
import rootReducer from './rootReducer'

const store = createStore(rootReducer)
```

```js
import { createStore } from 'redux'
import { Observable } from 'rxjs'
import rootReducer from './rootReducer'

const store = createStore(rootReducer)
const state$ = Observable.from(store)
```

These can all be passed directly to [`createContext()`](/api/createContext.md) or set as a [StoreApi's store prop](/api/StoreApi.md).

repository: bowheart/react-zedux

repo_name: bowheart/react-zedux


text:
---
layout: blank
title: "Discrete Mathematics"
---
# Discrete Matematics

A **variable** is a number which we don't know yet.

A **universal statement** says that a certain property is true for all elements in a set.

A **conditional statement** says that if once thing is true then some other thing also has to be true.

Given a property that may or may not be true, an **existential sattement** says that there is atleast on King
for mhich the property is ture.

A **universal conditional statement** is a statement that is universal and conditional.

E.g. For all real numbers x, if x is nonzero then x^2 is positive. If a real number
is nonzero, then its square is positive. For all nonzero numbers x, x^2 . If x is a nonzero
real number, then x^2 is positive. The square of any nonzero real number is positive.
All nonzero real numbers have positive squares.


text:
# Routine Design

Docker image with the routine-design Nodejs package globally installed.

## Publish new version

First build, and tag as `routine-design`.

```
docker build -t lynnmercier/routine-design .
docker push lynnmercier/routine-design:latest
```

repository: lynn-mercier/routine-design

repo_name: lynn-mercier/routine-design


text:
# ACME

**ACME** is an Application Configuration ManagEr. It is written in Python and provides a Tk GUI for configurations manipulation.

## Overview

The idea is to define configuration schemas and get a proper way of:

- Sharing and versioning your project’s configuration schemas, but not your configurations. That way, you avoid overwriting configurations from different developers. Each developer has his own configurations that need to match the configuration schemas in the project. Whenever a project’s configuration schema changes, each developer is reponsible for updating his configurations to match the new schemas.
- Being able to define configuration schemas from the GUI, with no need for programming in most cases.
- Provide configurations documentation and validation.
- Edit configurations from a GUI.
- Define your own option configurations types and provide validation for them.

## Install

Using pip:
```
sudo pip install https://github.com/mmontone/acme/archive/master.zip
```

or download Acme and then run ``sudo python setup.py install``. That installs ``acme`` binary on ``/usr/local/bin``. After that, you can run acme typing ``acme`` at the shell.

## Documentation

User manual: [HTML](http://mmontone.github.io/acme/doc/user-manual/acme.html) [PDF](http://mmontone.github.io/acme/doc/user-manual/acme.pdf)

Developer manual: [HTML](http://mmontone.github.io/acme/doc/developer-manual/html/index.html) [PDF](http://mmontone.github.io/acme/doc/developer-manual/acme.pdf)

## Quick introduction ##

### Running

Acme is run invoking acme command from the command line. By default, it runs in normal mode; that means, it opens a GUI for adding, removing and editing configurations.

A configuration schemas files is required. The schemas file contains a serialization of the configuration schemas in XML format.

By default, Acme looks for acme.schema in the current directory. It shows an error if it can not find it. A different file or location can be specified through the –schemas SCHEMAS option. If the schemas file is found, then it is parsed and loaded.

Apart from that, Acme maintains configurations in another file, which by default is acme.config. That file contains the configurations serialized in XML format. It can be specified to be something else WITH the -–configs CONFIGS option.

Acme can be run in three different modes fundamentally.

- **Normal mode**: this mode is invoked running acme with no special arguments from the command line (apart from the schema and configs arguments). In this mode, the standard configuration navigation UI is opened. This UI is meant for end users. The user can create, remove and edit his configurations from here. He doesn’t need to know about how to build a configuration schema (although that is not difficult at all, as we will see.) Apart from that, when editing the configuration, the user gets a (hopefully) decent UI with custom option editors depending on the type of options and validation.

    This is an example of Acme running in normal mode:

![configs](https://raw.github.com/mmontone/acme/master/doc/user-manual/images/acme1.png)

- **Setup mode**: this mode is invoked running acme with the --setup option from the command line. In this mode, the configuration schemas navigator UI is opened. The developer can create, remove and edit configuration schemas from here. Configuration schemas are descriptions of how configurations should be, with nested sections and different type of options. He can build the application specific configuration schemas from here.

    This is an example of Acme running in setup mode:

![schemas](https://raw.github.com/mmontone/acme/master/doc/user-manual/images/schemas1.png)

- **Full mode:** this mode is invoked running acme with the –full option from the command line. In this mode, both the configurations navigator and the configurations schemas navigator are available in two different tabs.

   This is an example of Acme running in full mode:

![full](https://raw.github.com/mmontone/acme/master/doc/user-manual/images/full.png)

### Configuration schemas ###

Configuration schemas define the configurations structure. They have a name, a list of parents, and a list of sections with options definitions.

![newschema](https://raw.github.com/mmontone/acme/master/doc/user-manual/images/newschema.png)

Configuration schemas can be composed by inheriting from multiple parents. Configuration sections from the parents appear in the child configuration schema. For instance, a full stack web framework configuration schema could inherit from a generic Web schema for web server configuration, and another Database schema for database connection configuration.

Configuration schemas have sections, each containing other sections and schema options. The schemas sections and options can be manipulated in the tree appearing on the left of the configuration schemas navigator.

![schemas_navigation](https://raw.github.com/mmontone/acme/master/doc/user-manual/images/schemas_navigation.png)

Each configuration schema section has a name, a documentation, subsections and a list of option schemas. Sections, subsections, and sections' options can all be added and removed from the tree widget on the left of the schemas navigator.

Options in schemas have a name and a type.

![schema_option](https://raw.github.com/mmontone/acme/master/doc/user-manual/images/schema_option.png)

The type of option determines the possible values that can be assigned to it in configurations. The option type can be String, Number, Boolean, Email, URI, Filename, Directory, Color, Timezone, Language, Country, Currency, Date, Time, Datetime, etc. Some of them will be described later. When editing configurations, each option is edited with its corresponding editor, depending on the type of option. For instance, options of type Date are edited using a calendar.

![option_editing](https://raw.github.com/mmontone/acme/master/doc/user-manual/images/option_editing.png)

Apart from name and type, schema options specify if it required for the option to be assigned a value in the configuration. Also, they can have a default value in case the user doesn't assign one in the configuration.

They also have a documentation string. This is very important for the end user to know the option meaning.

### Configurations ###

Configurations are instances of Configuration schemas, much like objects are instances of classes in object oriented programming languages. That is, configurations structure is determined by the configuration schema they belong to. In particular, their sections are that of their configuration schemas; and their options values depend on the option schemas defined in the configruration schemas.

Configurations belong to one and only one configuration schema, and that's compulsory, as it can be expected. Besides, configurations can inherit from each other: a configuration can inherit from another configuration and overwrite its parent options values. A configuration can have one and only one parent, o no parent; this is different from configuration schemas, that can have several parents. An understandable restriction is that the configuration parent schema has to be the same that the configuration schema.

Configurations can be added and removed from the list appering on the left of the configurations navigator.

![configs](https://raw.github.com/mmontone/acme/master/doc/user-manual/images/acme1.png)

Configurations can be loaded and saved. They are serialized in XML format. The default filename is ``acme.config``, but it can be changed if desired.

Configuration options editing happens on the right panel of the configurations navigator. A specific option editor is offered for each type of option, and each option documentation is displayed too. When trying to save a configuration section, it is ensured that required options (options declared with ``required`` enabled in the configuration schema) are filled. Options that are not currently set have their default value, if any. Also, options can be ``set`` and ``unset``. Setting a configuration option means setting the configuration option in the current configuration to the value being shown in the option editor. Unsetting a configuration option means removing the option value setting from the current configuration.

### Examples ###

There are some example configurations and schemas to see what the application is about.

Run ``acme``, ``acme --full``, and ``acme --setup`` from the ``doc/example`` directory.

repository: mmontone/acme

repo_name: mmontone/acme


text:
Central Laundry NITK

    An application to automate mundane tasks done at the Central Laundry, NITK

    Explore the docs »

    Report Bug
    ·
    Request Feature

# Laundry Portal - Backend

A RESTful JSON API webservice for Laundry Portal NITK, written in
Django.

## Installation Instructions

1. *Recommeded:* Create and activate a virtual environment using the
   [following tutorial by Python Packaging Authority](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/).
   * Linux/OSX
      Create Environment
      ```sh
      python3 -m venv env
      ```
      Activate Environment
      ```sh
      source env/bin/activate
      ```
   * Windows
      Create Environment
      ```sh
      py -m venv env
      ```
      Activate Environment
      ```sh
      .\env\Scripts\activate
      ```

2. Install application-specific dependencies by:

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

3. Run migrations by:

```bash
python3 manage.py migrate
```

4. Start the server:

```bash
python3 manage.py runserver 8000
```

5. If everything works correctly, you should be able to access Django
site admin on http://localhost:8000/admin.

repository: addhyanmalhotra/laundry-NITK

repo_name: addhyanmalhotra/laundry-NITK


text:
# C_Programming
This is a compilation of C Programming exercises.

# Contents
## Exercise 1: Hello World!
- 01_Hello World.c

## Exercise 2: Variable & Constant
- 02_Size.c
- 03_Variables Test.c
- 04_Overflow.c
- 05_2 Variables.c
- 06_Salary.c

## Exercise 3: Data Type
- 07_int and char.c
- 08_int changing.c
- 09_Get Second.c

## Exercise 4: Operator
- 10_Plus Plus.c
- 11_complicated.c
- 12_Relations.c
- 13_Logic.c

## Exercise 5: Condition & Loop
- 14_Conditions.c
- 15_Pow.c
- 16_if abs.c
- 17_Credit.c
- 18_leap year reading program.c
- 19_Sum from 1 to 1000.c
- 20_print rectangle.c
- 21_Pyramid printing.c

## Exercise 6: Input & Output
- 22_1_Calculator practice.c
- 22_simple calculator program.c
- 23_Program to add a fixed number of integers.c
- 24_A program that outputs a multiplication table of a specific stage.c

## Exercise 7: User-defined Function
- 25_hour plus program.c
- 26_Minimum number of money return program.c
- 27_Find the number of days from January 1st.c

## Exercise 8: Iterative Function & Recursive Function
- 28_printing the number pyramid with a repeat function.c
- 29_Printing the number pyramid with a recursive function.c
- 30_Implementing a combination with recursive functions.c

## Exercise 9: Array
- 31_Program that informs the location of the maximum and minimum values in five integers.c
- 32_Program to find even maximum and odd maximum among 5 integers.c
- 33_Printing a two-dimensional array using multiplication table. C
- 34_Sum of student scores.c

## Exercise 10: Pointer
-35_Converting two variable values to each other.c
-36_Changing the value of the pointer variable.c

## Exercise 11: String
- 37_counting the number of characters in a string.c
- 38_strlen().c
- 39_strcmp().c
- 40_strcpy().c

## Exercise 12: Sturcture
- 41_Student information structure.c
- 42_Utilization of student information structure.c
- 43_distance between two points.c
- 44_program to find the area and perimeter of a square.c
- 45_Comparison of structures.c
- 46_arrangement of structures.c

## Exercise 13: Read & Write
- 47_File I / O.c
- 48_reading text file.c
- 49_text file analysis.c

## Exercise 14: Dynamic Memory
- 50_ Dynamic memory basic example.c
- 51_Printing the alphabet in dynamic memory.c
- 52_Processing 5 integers with dynamic memory.c
- 53_structure dynamic memory allocation.c
- 54_Dynamic memory two-dimensional array.c


text:
# gram2
Nonpolynomial superpower parser, better, faster

# Differences from gram1
* strict operation `=` not exist, use `==`
* penetration flag removed
* @ is position pass, not value
* You can't write more ms rule `delimiter=, ` use quotes `delimiter=','` or double quotes
* `parse_text_list` not exists anymore. Use `go`. No ugly "simple tokenizer" incorporated
* deep pass `value` is not working anymore. Use `value_view` or `node.value or node.value_view`.
* all possible hask_keys should be present in gram rules.
* BUG/FEATURE. You must match not only value but also hash_key, because no base.


text:
# Using the `formant` python module for Formant protobuf classes

### Installation

Installing `formant` will allow access to Formant gRPC classes in Python environments without requiring a copy of the Formant `protos` folder with your application.

`pip install formant`

This command will also install the required dependencies to communicate with the agent's gRPC interface:

```
grpcio==1.37.0
protobuf==3.17.2
six==1.12.0
grpcio-status == 1.29.0
```

The `formant` module works in Python ^2.7 and ^3.6.

### Usage

You can access the gRPC classes from the `formant` module with import statements like:

```
from formant.protos.agent.v1 import agent_pb2, agent_pb2_grpc
from formant.protos.model.v1 import commands_pb2, datapoint_pb2, file_pb2, navigation_pb2, math_pb2
```

See the [protos](https://github.com/FormantIO/formant/tree/master/formant/protos) folder in our public repo for all available protobuf types.

See [examples](https://github.com/FormantIO/formant/tree/master/examples) for how to integrate your application with Formant.

repository: FormantIO/formant

gha_language: Dockerfile

repo_name: FormantIO/formant


text:
# Vision App (Swift)

* This project is based on a [Udemy course](https://www.udemy.com/devslopes-ios11/) as part of my journey in learning how to code in Swift.
* The lesson covers various topics including CoreML, Speech Synthesizer, Vision and AVFoundation in Swift
* This app only serves as self-study.

### Created by [IasJem](https://github.com/iasjem)

repository: DrOlu/vision-app

repo_name: DrOlu/vision-app


text:
# NAME
push!, pop! - stack manipulation.

# SYNOPSIS

    (push! VAL VAR)
    (pop! VAR)

# DESCRIPTION
These macros are for treating lists like a stack.

The macro `push!` treats the list of referenced by the symbol `VAR` as a stack and pushes the value `VAL` onto the stack.

The macro `pop!` treats the list of referenced by the symbol `VAR` as a stack and pops and returns the top of the stack.

Both macros destructively modify the list referenced by the symbol `VAR`.

# RETURN VALUE
The macro `push!` returns `VAL`.

The macro `pop!` returns first element of the list referenced by the symbol `VAR`.

# EXAMPLES

    ) (<- stack nil)
    nil
    ) (push! 1 stack)
    1
    ) (push! 2 stack)
    2
    ) (push! 3 stack)
    3
    ) stack
    (3 2 1)
    ) (pop! stack)
    3
    ) (pop! stack)
    2
    ) (pop! stack)
    1
    ) stack
    nil

# SEE ALSO
- `list(3)`

repository: mukaiizawa/Paren

gha_language: OpenEdge ABL

gha_license_id: NOASSERTION

repo_name: mukaiizawa/Paren


text:
# hackTAMS Registration Site

This is the registration site for hackTAMS 2021! Our main site can be found at https://21.hacktams.org! This repository is still **heavily WIP**, so please contact @MichaelZhao21 for more info on how to contribute and join the hacktams team.

## Installation

Simply type `yarn install` to install the libraries!

Create `.env`:

```
MONGO_URL=[URL of mongodb instance (eg. <IP_ADDRESS>:27017 or my-amazing-atlas-db.g349ds.mongodb.net)]
MONGO_USER=[Username to access mongodb (not needed if open access)]
MONGO_PASS=[Password to access mongodb (not needed if open access)]
```

## Execution

To develop the app, simply use the `yarn start` command, and it will use chokidar and listen for changes.

## Build

Finally, to build the app for production, use `yarn build`. The gulp script will bundle and parse all the files for production.

repository: tams-cso/hacktams-registration

repo_name: tams-cso/hacktams-registration


text:
# Team-Profile-Generator

  ![](https://img.shields.io/badge/license-Apache-blue)

  ## Description

  This application is a Node.js command-line application that takes information about team members of an Engineering firm. At the end part of the application, an HTML webpage that displays information for each member will be displayed. This project also demonstrates how to test classes using npm jest package.

  ## Table of Contents

  * [Installation](#installation)
  * [Usage](#usage)
  * [License](#license)
  * [Contributing](#contributing)
  * [Tests](#tests)
  * [Questions](#questions)

  ## Installation

  The project requires that node.js file system, npm inquirer, and npm jest to be installed. A package.json file should contain all dependencies given by each npm package.

  ## Usage

  A demonstration of the project functionality could be accessed in this link: https://drive.google.com/file/d/1HQvlnfyHKVNJjpwhDT2cEXH1BMXdOoC4/view. A demonstation on how to test classes could be accessed in this link: https://drive.google.com/file/d/1VxLJd74wYvX-orrDrjLLi1VxAHZ8ruNf/view . A sample output index.html is also included in the project folder.

  A generated index.html from the application itself is also included in the repo. Only the links under my name are real email and github page links.

  The repository for this application could be accessed using the following link:

  https://github.com/apolinar1607/Team-Profile-Generator.git

  ## License

  Licensed by : [Apache](./utils/license-Apache)

  ## Contributing

  To contribute to this project, clone the repo, work on it and issue a pull request.

  ## Tests

  To run the application, type node index.js in the command line inside the folder containing the index.js file.

  To run the classes test, type npm run test in the command line inside the _tests_ folder before executing.

  ## Questions

  Github Username:
  [apolinar1607](https://github.com/apolinar1607)

  Please send me an email if you have any question(s):
<EMAIL_ADDRESS>

  ---
  © 2021 JM Automation . All Rights Reserved.


text:
# Dart Getters And Setters
## Automatically Generate Getters And Setters
-------------------

[![Version](https://vsmarketplacebadge.apphb.com/version-short/PeterHdd.dartgettersetter.svg)](https://marketplace.visualstudio.com/items?itemName=PeterHdd.dartgettersetter)
[![Installs](https://vsmarketplacebadge.apphb.com/installs/PeterHdd.dartgettersetter.svg)](https://marketplace.visualstudio.com/items?itemName=PeterHdd.dartgettersetter)
![issues](https://img.shields.io/github/issues/peterhdd/gettersetter)
![tweet](https://img.shields.io/twitter/url/https/github.com/PeterHdd/gettersetter.svg?style=social)
![license](https://img.shields.io/github/license/peterhdd/gettersetter)

## Installation

You can either install it from vscode or from the following link:

https://marketplace.visualstudio.com/items?itemName=PeterHdd.dartgettersetter

## Information

This vscode extension will automatically create the getters and setters for the fields in the dart file.

## Usage

Select the fields you want, right click and click on *Generate Getter And Setter*:

![example-image](images/examplegetset.png)

```
String _name;
int _age;

 String get name => this._name;

 set name(String value) => this._name = value;

 int get age => this._age;

 set age(int value) => this._age = value;
 ```

 ## Support!
Support the repository by joining the [stargazers](https://github.com/PeterHdd/Firebase-Flutter-tutorials/stargazers) for this repo ⭐

### Created & Maintained By

[Peter](https://github.com/peterhdd) ([@peterndev](https://www.twitter.com/peterndev))

If you found this extension helpful and want to thank me, consider buying me a cup of :coffee:

repository: PeterHdd/gettersetter

gha_language: TypeScript

repo_name: PeterHdd/gettersetter


text:
# group `mountainbike` {#group__mountainbike}

Mountain bike module contains the `MountainBike` class. Mountain bikes are a kind of bike for cycling on rough terrain.

## Summary

 Members                        | Descriptions
--------------------------------|---------------------------------------------
`class `[`transport::MountainBike`](#classtransport_1_1MountainBike) | Mountain bike implementation of a `[Bicycle](example/doc/api-bicycle.md#classtransport_1_1Bicycle)`.

# class `transport::MountainBike` {#classtransport_1_1MountainBike}

```
class transport::MountainBike
  : public transport::Bicycle
```

Mountain bike implementation of a `[Bicycle](example/doc/api-bicycle.md#classtransport_1_1Bicycle)`.

[MountainBike](#classtransport_1_1MountainBike) is an implementation of a [Bicycle](example/doc/api-bicycle.md#classtransport_1_1Bicycle) providing a bike for cycling on rough terrain. Mountain bikes are pretty cool because they have stuff like **Suspension** (and you can even adjust it using SetSuspension). If you're looking for a bike for use on the road, you might be better off using a [RacingBike](example/doc/api-racingbike.md#classtransport_1_1RacingBike) though.

## Summary

 Members                        | Descriptions
--------------------------------|---------------------------------------------
`public bool `[`SetSuspension`](#classtransport_1_1MountainBike_1a04caecd7e5ff7572b6ac1dc283510301)`(double stiffness)` | Set suspension stiffness.  the suspension stiffness.
`public template<>`
`inline bool `[`ChangeBreak`](#classtransport_1_1MountainBike_1afd02513876a196e98acaacdc555aeb52)`(BreakType breakType)` | Change the break type.  the break type.  the type of the break.

## Members

#### `public bool `[`SetSuspension`](#classtransport_1_1MountainBike_1a04caecd7e5ff7572b6ac1dc283510301)`(double stiffness)` {#classtransport_1_1MountainBike_1a04caecd7e5ff7572b6ac1dc283510301}

Set suspension stiffness.  the suspension stiffness.

SetSuspension changes the stiffness of the suspension on the bike. The method will return false if the stiffness could not be adjusted.

#### Returns
true if the suspension was adjusted successfully, false otherwise.

#### `public template<>`
`inline bool `[`ChangeBreak`](#classtransport_1_1MountainBike_1afd02513876a196e98acaacdc555aeb52)`(BreakType breakType)` {#classtransport_1_1MountainBike_1afd02513876a196e98acaacdc555aeb52}

Change the break type.  the break type.  the type of the break.

ChangesBreak changes the type of break fitted to the bike. The method will return false if the break type could not be fitted.

#### Returns
true if the break was adjusted successfully. false otherise

repository: sourcey/moxygen

repo_name: sourcey/moxygen


text:
# Recycler-Core

Recycler-Core provides a clean MVC framework for managing your RecyclerView Adapters.

## Motivation

Blindly dealing with multiple view types in a `RecyclerView.Adapter` can frequently lead to unmaintainable source code.  The standard pattern of managing multiple views also does not promote reusability between multiple adapters.

Recycler-Core attempts to solve the maintainability and reusability problems that are ran into when dealing with multiple views in a `RecyclerView.Adapter` by creating an MVC pattern for RecyclerViews.

Download
--------
Configure the project-level `build.gradle` to include the 'android-apt' plugin
```groovy
buildscript {
  repositories {
    jcenter()
  }
  dependencies {
    ...
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
  }
}
```

Then, apply the 'android-apt' plugin in the module-level `build.gradle` and add the Recycler-Core dependencies:

Gradle:
```groovy
apply plugin: 'com.neenbedankt.android-apt'

android {
  ...
}

dependencies {
  compile 'com.carrotcreative.recyclercore:recycler-core:2.0-alpha'
  apt 'com.carrotcreative.recyclercore:recyclercore-compiler:2.0-alpha'
}
```

## Usage

### The View

To create a View Type for your RecyclerView, you're going to have to build out a component for the Model, View, and Controller.

In this example, we will build out an element that will display basic information about a user.

The View is a standard Layout XML file with nothing special about it.

`element_user.xml`:

```xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="32dp"
    >

    <TextView
        android:id="@+id/name"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        />

    <TextView
        android:id="@+id/email"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        />

</LinearLayout>
```

### The Model

Next I create the model.

The model is a standard POJO class, which is responsible for storing all of the data
that defines our views.

When defining the model, we need to declare a class level annotation `InjectController`
and pass in the controller and the layout.

`UserModel.java`:

```java
// ...
@RCModel(controller = UserController.class)
public class UserModel {

    public String mName;
    public String mEmail;

    // ... Setters + Getters

}
```

### The Controller

Now we create the controller.

This class must extend `RecyclerCoreController` with the generic of the model that was just created.

The magic happens in the `bind` method, where this object will be passed an instance of the model.

`UserController.java`:

```java
// ...
@RCController(layout = R.layout.element_user_list)
public class UserController extends RecyclerCoreController<UserModel> {

    private TextView mName;
    private TextView mEmail;

    public UserController(View itemView, Activity activity)
    {
        super(itemView, activity);
        mName = (TextView) itemView.findViewById(R.id.name);
        mEmail = (TextView) itemView.findViewById(R.id.email);
    }

    @Override
    public void bind(UserModel model)
    {
        mName.setText(model.getName());
        mEmail.setText(model.getEmail());
    }

}
```

### In use

`MainActivity.java`:

```java
// ...
ArrayList<RecyclerCoreModel> models = new ArrayList<>();

UserModel brandon = new UserModel()
<EMAIL_ADDRESS>        .setName("Brandon");
models.add(brandon);

UserModel rob = new UserModel()
<EMAIL_ADDRESS>        .setName("Rob");
models.add(rob);

RecyclerCoreAdapter adapter = new RecyclerCoreAdapter(models);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mRecyclerView.setAdapter(adapter);
```

And now you have:

![img](http://i.imgur.com/NP7Wboq.png)

## Extras

### ProgressRecyclerViewLayout

RecyclerCore also provides a custom view called `ProgressRecyclerViewLayout`.  This is just a `RecyclerView` with a `ProgressBar` inside of a `RelativeLayout` and it manages displaying the `ProgressBar` when the adapter is set.

I pretty much never use RecyclerViews that aren't encapsulated inside this pattern so I decided to include it in this library.

### SwipeRefreshProgressRecyclerView

We also have a `SwipeRefreshProgressRecyclerView` that is same as `SwipeRefreshLayout` with `ProgressRecyclerViewLayout` as a child. So it encapsulates the features or `SwipeRefreshLayout`, `RecyclerView` in one View.

### OnLoadPointListener

`ProgressRecyclerViewLayout` also provides us interfaces that can allow us to add unlimited scroll.

```
    /**
     * An interface to add a callback that gets called when the load point is reached.
     * For the load point callback to work, we need to set
     * {@link #setDistanceFromBottomToLoadMore(int)} and the
     * {@link #setOnLoadPointListener(OnLoadPointListener)}
     * <p>
     * This currently only supports {@link android.support.v7.widget.LinearLayoutManager},
     * {@link android.support.v7.widget.StaggeredGridLayoutManager},
     * {@link android.support.v7.widget.GridLayoutManager}
     */
    public interface OnLoadPointListener
    {
        void onReachedLoadPoint();
    }
```

In order to get that working, we need to set `distanceFromBottomToLoadMore` attribute value, which can be set either in the Layout or programmatically.

```
<com.carrotcreative.recyclercore.widget.ProgressRecyclerViewLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/recycler_view_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:distanceFromBottomToLoadMore="0"
    />
```
OR
```
    /**
     * Helper method to set the distance from bottom value programmatically, if its not set in
     * the layout file.
     * <p>
     * A value of 0, means the #onReachedLoadPoint is called when the last child starts becoming
     * visible.
     * <p>
     * A value of 1 means the #onReachedLoadPoint is called when the secnd last child starts
     * becoming visible
     * <p>
     * A Negative value is considered and invalid value
     *
     * @param distanceFromBottomToLoadMore The no of item from the bottom of the recycler view,
     *                                    after which #OnLoadPointListener is called
     */
    public void setDistanceFromBottomToLoadMore(int distanceFromBottomToLoadMore)
```

Once this is done, we need to set a listener that will be called when the recycler view reached the load point
```
        mRecyclerViewLayout.setOnLoadPointListener(new ProgressRecyclerViewLayout
                .OnLoadPointListener()
        {
            @Override
            public void onReachedLoadPoint()
            {
                loadMoreData();
            }
        });
```

## License

[MIT](license.txt)

repository: carrot/recycler-core

gha_language: Java

repo_name: carrot/recycler-core


text:
---
id: "7"
order: 7
title: 'Creating Pods'
excerpt: 'How to create Pods'
coverImage: ''
module: ''
videoId: 'n2iN9Gl1zfM'
duration: '5:20'
---

## Creating Pods

Usually, you shouldn't be creating Pods manually. You can do it, but you really should not. The reason being is that if the Pod crashes or if it gets deleted, it will be gone forever. That said, throughout this book, we will be creating Pods directly for the sake of simplicity and purposes of learning and explaining different concepts. However, if you're planning to run your applications inside Kubernetes, make sure you aren't creating Pods manually.

Let's look at how a single Pod can be defined using YAML.

```yaml
apiVersion: v1
kind: Pod
metadata:
  name: hello-pod
  labels:
    app.kubernetes.io/name: hello
spec:
  containers:
    - name: hello-container
      image: busybox
      command: ["sh", "-c", "echo Hello from my container! && sleep 3600"]
```

In the first couple of lines, we define the kind of resource (`Pod`) and the metadata. The metadata includes the name of our Pod (`hello-pod`) and a set of labels that are simple key-value pairs (`app.kubernetes.io/name=hello`).

In the `spec` section, we are describing how the Pod should look. We will have a single container inside this Pod, called `hello-container`, and it will run the image called `busybox`. When the container starts, it executes the command defined in the `command` field.

To create the Pod, you can save the above YAML to a file called `pod.yaml`. Then, you can use Kubernetes CLI (`kubectl`) to create the Pod:

```bash
$ kubectl apply -f pod.yaml
pod/hello-pod created
```

Kubernetes responds with the resource type and the name it created. You can use `kubectl get pods` to get a list of all Pods running the `default` namespace of the cluster.

```bash
$ kubectl get pods
NAME        READY   STATUS    RESTARTS   AGE
hello-pod   1/1     Running   0          7s
```

You can use the `logs` command to see the output from the container running inside the Pod:

```bash
$ kubectl logs hello-pod
Hello from my container!
```

> When you have multiple containers running inside the same Pod, you can use the `-c` flag to specify the container name whose logs you want to get. For example: `kubectl logs hello-pod -c hello-container`

If we delete this Pod using `kubectl delete pod hello-pod`, the Pod will be gone forever. There's nothing that would automatically restart it. If you run the `kubectl get pods` again, you will notice the Pod is gone:

```bash
$ kubectl get pods
No resources found in default namespace.
```

Not automatically recreating the Pod is the opposite of the behavior you want. If you have your containers running in a Pod, you would want Kubernetes to reschedule and restart them if something goes wrong automatically.

To make sure the crashed Pods get restarted, you need a **controller** to manage the Pods' lifecycle. This controller automatically reschedules your Pod if it gets deleted or if something terrible happens (cluster nodes go down and Kubernetes need to evict the Pods).


text:
# Simple Image Proxy Server

Powered by [intervention/image](http://image.intervention.io/)

## Guide

Example URL : `http://[your-domain-name]/index.php?s=7E0D0626111602763FAE22A905A5096F&w=413&h=640&url=aHR0cHM6Ly9pLmltZ3VyLmNvbS9xNE1xUS5qcGc=`

- URL query params
    + `url` : base64_encode of remote url
    + `w` : width of returned image (optional if height is set)
    + `h` : height of  returned image (optional if width is set)
    + `s` : signature to verify origin
- `storage` directory contains 2 sub-dirs:
    + `image` : storage downloaded image from remote resource
    + `cache` : store manipulated image to re-use in next request
- supports `signature` via `s` query param with simple hash function : `$signature = md5(base64_encode($remote_url).$secret)` (left it blank means no checking signature)

**For large scale of production environment, please consider use [Thumbor](https://github.com/thumbor/thumbor)**

## LICENSE

This project is licensed under the MIT license.

repository: khanhicetea/simple-image-proxy-server

repo_name: khanhicetea/simple-image-proxy-server


text:
React Router Docs
===

Read the unofficial docs here : [http://knowbody.github.io/react-router-docs/](http://knowbody.github.io/react-router-docs/)

**Note: This is work in progress. Please use the [main docs](https://github.com/reactjs/react-router/tree/master/docs) as this ones can contain mistakes. At some point once we feel that these docs are good I'd like them to be merged to the main repo. Feel free to contribute, point out mistakes and things which the docs are lacking.**

*As there is quite a few talks about the docs not being very accesible this is my attempt to improve them. I will reuse some of the docs from the [main repo](https://github.com/reactjs/react-router/tree/master/docs) and also add the missing parts here.*

### Need help with React Router

To get help with React Router I highly recommend using [StackOverflow](http://stackoverflow.com/tags/react-router/) or [Reactiflux](http://www.reactiflux.com/), these are the places where React Router community hangs out and where you get help quickly.

**BUT...**

This is my personal repo and I want to try out something *experimental*.

As one of the maintainers I get quite a few emails, private messages on Twitter, Discord, etc. I don't mind them and I always try to help whenever I have some free time.

So I want you to use this repo instead and I will try to help here.

#### How

I added the `playground` folder where you can play around with the React Router. And if you need help use it as a boilerplate to replicate your issue and send the PR.
**Make sure that the PR title includes: `[Help needed] Your title`**

#### Why

I do this so others can look into the problem and the solution and also because I will be able to see what issues are mentioned the most so I can include examples in the new docs.

#### Important

To be very productive I switched off GH issues. As I said I'm experimenting here and I think this is going to make me productive.

##### Tldr;
- want to help with docs - send the PR with the new additions
- found a mistake - send the PR with the fix
- need help with your project - send the PR using the `playground` boilerplate

Here is a longer explanation: https://gist.github.com/ryanflorence/8a62abea562ca2896dee

repository: knowbody/react-router-docs

repo_name: knowbody/react-router-docs


text:
---
layout: post
title: "Time and allocation profiling in Haskell"
description: "A few things to watch out while profiling (time and allocation) with Haskell and Cabal"
category: blog
tags: [haskell, profiling, cabal]
---
{% include JB/setup %}

This post describes how to enable time and allocation profiling in Haskell
(with cabal). When I first tried so, it took me a while to get this working. It
is basically very straightforward but there are a few things to watch out for,
which I want to uncover now.

## Configuring Cabal

First of all, to avoid a mess with dependencies (packages) they are not
installed for profiling, one should change the cabal configuration to enable
executable-profiling as well as library-profiling by default. To do so open
the file **~/.cabal/config** and change the following parameters from false
to **true**:

{% highlight bash %}
library-profiling: True
executable-profiling: True
{% endhighlight %}

## Configuring the project

The project you are working at has to be configured for profiling as well.
Therefore use the following cabal command:

{% highlight bash %}
cabal configure --enable-library-profiling --enable-executable-profiling
{% endhighlight %}

After this, the required dependencies can be installed:

{% highlight bash %}
cabal install -p
{% endhighlight %}

*The option -p can be omitted if cabal was configured globally as described before*

## Configuring executable

While building the executable, several options can be passed along to the
GHC. In this example we refer to the *Time Profiling* chapter from [Real
World Haskell](http://book.realworldhaskell.org/):

{% highlight bash %}
cabal build --ghc-options="-prof -auto-all -caf-all -fforce-recomp"
{% endhighlight %}

 - `-prof` Enables basic time and allocation profiling
 - `-auto-all` Add [cost centres](https://downloads.haskell.org/~ghc/7.0.4/docs/html/users_guide/profiling.html#cost-centres) on all top level functions
 - `-caf-all` Include [constant applicative forms (CAF)](https://wiki.haskell.org/Constant_applicative_form) (one time computed values)
 - `-fforce-recomp` Force full recompilation

Further explanation can be found here: [Profiling and optimization](http://book.realworldhaskell.org/read/profiling-and-optimization.html)

## Run the program

After the executable was built successfully, we now can run the program. By
doing so we can pass options to the runtime-system (RTS) by appending +RTS
-options. In our case of time and allocation profiling we run the program as
follows:

{% highlight bash %}
./dist/build/program/program +RTS -p
{% endhighlight %}

 - `-p` Produces a time profile report and is written to the file **program.prof**
 - More options can be found here: [Time and allocation profiling](https://downloads.haskell.org/~ghc/7.8.2/docs/html/users_guide/prof-time-options.html)


text:
**CNV format**

This format only works for gene-level CNV data.

First line must be the header with following columns:

-   Gene

    -   The gene name

-   Cnv

    -   Allowed values:

        -   Amplification

        -   Gain

        -   Deletion

        -   loss

Following columns are optional:

-   Sample

-   Patient

-   Sampletype

-   Disease

Lines starting with '#' will be ignored.

repository: pandurang-kolekar/docs

repo_name: pandurang-kolekar/docs


text:
# Team 188 Website
This is the repository for Team 188's website

# Demo
Live versions of the branches in this repository can be found at the following links:

- [Staging](https://frc-team188-website-staging.herokuapp.com/)
- [Master](https://frc-team188-website.herokuapp.com/)

# Tasks
- [ ] Make site responsive to mobile
- [x] Design "Home" Page
- [ ] Get content for "Home" page
- [x] Design "About" page
- [ ] Get content for "About" page
- [ ] Design the "Team Page"
- [ ] Get content for "Team" page
- [ ] Design the "FIRST" Page
- [ ] Get content for "FIRST" page
- [ ] Design the "VEX Page"
- [ ] Get content for "VEX" page
- [ ] Design the "FLL Page" (I'm not entirely sure we need this page but I'll keep it in for now)
- [ ] Get content for "FLL" page`
- [ ] Design the "Sponsors" page
- [ ] Get content for "Sponsors" page
- [ ] Design the footer
- [ ] Add a site map to the footer
- [ ] ...add more through the README.md file, please do not remove any tasks
- [ ] Merge all PRs created by dependabot for outdated dependencies.

# Installation
### Required:
- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- [Node.js](https://nodejs.org/)

#### Clone the repository

```sh
$ git clone https://github.com/frcteam188/frc-team188-website.git
$ cd frc-team188-website
```

#### Install the dependencies and devDependencies and start the server.

```sh
$ npm install -d
$ npm start
```

#### Open browser and website will be at [localhost:3001](localhost:3001)


text:
# kb-node-lru

Simple JS LRU Cache, v3.0.0+ now written in TypeScript.

```
npm install kb-node-lru
```

```javascript
import LRU from 'kb-node-lru'

const cache1 = new LRU({maxAgeMs: 10000, maxStorage: 100})
const cache2 = new LRU({
  maxAgeMs: 10000,
  maxStorage: 100,
  sizeFn: o => {
    o.kilobytes_or_whatever()
  },
})
const cache3 = new LRU({maxAgeMs: Infinity, maxStorage: Infinity})

cache2.put('foo', someObject)
cache2.get('foo') // someObject
cache2.has('foo') // true
cache2.remove('foo') // removes it
cache2.toArray() // an array of objects with keys and access times
cache2.logMe() // returns big string for debugging
```

### Contributing

- run `yarn modules` to install necessary dev modules
- run `yarn dev --watch` to watch typescript and compile while working
- run `yarn test` to make sure it passes all tests
- run `yarn memtest` to watch how much memory it uses with repeated large LRU creation/removals

repository: BillBarnhill/node-lru

repo_name: BillBarnhill/node-lru


text:
![](../../../../images/banner_ASO.PNG)

# [Lab] TDE - View Software Keystore

To view the software keystore you first need to have a keystore. Follow the labs in [Create_Software_Keystore](../Create_Software_Keystore/README.md) for instructions.
.

- Open a SSH session on your DBSec-Lab VM as Oracle User

        sudo su - oracle

- Go to the scripts directory

        cd /home/oracle/DBSecLab/workshops/Database_Security_Labs/Advanced_Security/TDE/View_Software_Keystore

- Once you have a keystore, you can run either of these scripts.

You will notice there are multiple copies of the `ewallet.p12` file.

Every time you make a change, including create or rekey, the `ewallet.p12` file is backed up.

You will also see the contents of the wallet file by using `orapki`

    - View the OS files related to the keystore

            ./01_view_wallet_on_os.sh

      ![](../images/TDE_008.PNG)

    - View the keystore data in the database

            ./02_view_wallet_in_db.sh

      ![](../images/TDE_009.PNG)

---
Move up one [directory](../README.md)

Click to return [home](/README.md)

repository: mrabhiram/learning-library

repo_name: mrabhiram/learning-library


text:
Asterisk 101
============

This is a project of book writing. A companion materials for Asterisk 101 training.

The book content is in [Wiki page](https://github.com/antonraharja/book-asterisk-101/wiki).

Configuration files or related files used in the book are stored in `attached-files` folder.

Any questions may be directed to me through my email<EMAIL_ADDRESS>or my Twitter handle [antonrd](http://twitter.com/antonrd).

If you speaks Bahasa Indonesia you may also post questions or start discussions in [ID-Asterisk](http://asterisk.web.id).

--

Anton Raharja
http://www.antonraharja.com

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/antonraharja/book-asterisk-101/trend.png)](https://bitdeli.com/free "Bitdeli Badge")


text:
---
layout: default
---

# 1995-12-16 - Re: NET - HLR on highway privacy (fwd)

## Header Data

From: "Jeff Hupp"<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 007c5c8148c89ff1dff0b9b612c017ab89f94b543f2fc78089d9897ec4bc0c03

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1995-12-16 05:39:47 UTC

Raw Date: Sat, 16 Dec 1995 13:39:47 +0800

## Raw message

```
{% raw  %}From: "Jeff Hupp"<EMAIL_ADDRESS>Date: Sat, 16 Dec 1995 13:39:47 +0800
To<EMAIL_ADDRESS>Subject: Re: NET - HLR on highway privacy (fwd)
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

-----BEGIN PGP SIGNED MESSAGE-----

On 15 Dec 95 at 13:54, Jon Lasser wrote:

: I hadn't seen this cross the list yet...
:
: ------------------------------------------------------------------------------
: Jon Lasser<EMAIL_ADDRESS>          (410)494-3072
:           Visit my home page at http://www.goucher.edu/~jlasser/
:   You have a friend at the NSA: Big Brother is watching. Finger for PGP key.
:
: ---------- Forwarded message ----------
: Date: Mon, 11 Dec 1995 05:59:53 -0600
: From: FringeWare Daily<EMAIL_ADDRESS>: Subject: NET - HLR on highway privacy
:
: Sent from<EMAIL_ADDRESS>(Howard Rheingold)
:
: We Need Privacy Protection On Intelligent Highways
: 	-- By Howard Rheingold
:
: 	Ominous steps have been taken recently, steps that perhaps move us
: all closer to a global surveillance state, but few people are aware of them.
: Governments around the world are installing "intelligent highways," whose
: snooping capabilities ought to concern every driver.

[	Much about automatic tool billing and how it can be used to track
vehicles deleted.}

	The MTA (the people who 'run' the toll roads about Houston) have an
automatic payment system in place that use transponders mounted on
windshields.  Most people who have these don't know it, but they have
pickups for these little devices all over the freeway system, not just
at the toll booths.

	But if you go to http://herman.tamu.edu/houston-real.html
you can get an idea of what they are able to do with the data.  And
then they have the lobes to ask you to volunteer to put one of these
things on your car.  What boggles the mind, is that people do...

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQEVAwUBMNIdqjUjeCeeebC9AQG7XAf/YgxgSAhNrsEFMtjUtS4UrzTVNhEkzBK6
IQv+LMb45B/niD+fQYKmViTu8ki/jEoBZ4zLEmSLmrE8Gl0vhmSgnYCoLjVeURxo
k4JEf3uYRCrGWt94hihiLl+2GahqkPdaxBdksGVR0DHAF6SIWKbwvh0LRgDiUcOT
lQ6Cb9AwthPuX2BYx/1kmijABSwsEJYv2mF7J3mWwqR/3C9u92thMqfMVPIWkPfn
mzgK+/OROzug2nPjIZ2ULhbJYY05mrVr0JD70kmBoThH1kqt8+1xU9v9HeziZl/y
WZ8b24i3rKxLZq4PaPMsKX6TlWpIlnJt4QPTwVt4gr0sRwuY4I37sw==
=GJjw
-----END PGP SIGNATURE-----
--
<EMAIL_ADDRESS>         |For PGP Public Key:
http://gensys.com          |finger<EMAIL_ADDRESS>The difference between science and the fuzzy subjects is that science
requires reasoning, while those other subjects merely require
scholarship.

{% endraw %}
```

## Thread

+ Return to [December 1995](/archive/1995/12)

+ Return to "["Jeff Hupp" <jhupp@novellnet.gensys.com>](/authors/jeff_hupp_jhupp_at_novellnet_gensys_com_)"

+ 1995-12-16 (Sat, 16 Dec 1995 13:39:47 +0800) - Re: NET - HLR on highway privacy (fwd) - _"Jeff Hupp"<EMAIL_ADDRESS>


text:
---
title: "Godot history in images!"
excerpt: "How does more than a decade of engine development look like?"
categories: ["news"]
author: Juan Linietsky
image: /storage/app/uploads/public/57f/215/a0e/57f215a0e3c2a359176299.png
date: 2014-01-15 00:00:00
---

## A trip down Godot Memory Lane

Godot was not always called Godot, it went through many (horrible) names, in the following order:

* Larvotor
* Legacy
* NG3D
* Larvita
* Larvita2
* Larvita3
* Godot

In fact, Godot was just a code-name for what would be something else, a more general purpose engine with a proper UI instead of a set of assorted tools. We knew it would take a long time, so we used a name based on a play by Samuel Becket to represent that feeling. Eventually the name would change to something with a connection to our home country, Argentina.

In a bizarre twist of fate, at some point and well into the development of the engine, we played a video game with a character that formed that connection (bonus points to anyone who figures it out), so the engine is also named in honor to that. This is good, because the original Godot was never supposed to arrive (well, that’s one interpretation...).

## History in pictures

Enough talk. So, how does more than a decade of engine development look like? Like a mess, obviously! (wait for images to load if it’s taking too long!)

![godotmemorylane.jpg](/storage/app/uploads/public/56c/32e/57a/56c32e57afa65446636279.jpg)

We hope that future screens in the next years will be of your games, not ours!

repository: godotengine/godot-website

gha_language: HTML

repo_name: godotengine/godot-website


text:
The pprof command line provides many commands.
Commonly used commands include "top" that prints a summary of the top program attractions and "web" that opens an interactive graph of the attractions and their call graphs.
Use "help" to get information about all pprof commands

> cmd:
```cassandraql
$ go tool pprof memprofile.prof
$ (pprof) top
$ ......
$ ......
$ ......

$ (pprof) web
$ ......
$ ......
$ ......
```

repository: josenspire/goim-pro

gha_language: Go

repo_name: josenspire/goim-pro


text:
# Skyra [![Discord](https://discordapp.com/api/guilds/254360814063058944/embed.png)](https://join.skyra.pw)

[![Total alerts](https://img.shields.io/lgtm/alerts/g/skyra-project/skyra.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/skyra-project/skyra/alerts/)
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/skyra-project/skyra.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/skyra-project/Skyra/context:javascript)
[![Discord Bots](https://discordbots.org/api/widget/status/266624760782258186.svg?noavatar=true)](https://discordbots.org/bot/266624760782258186)
[![Discord Bots](https://discordbots.org/api/widget/servers/266624760782258186.svg?noavatar=true)](https://discordbots.org/bot/266624760782258186)
[![Discord Bots](https://discordbots.org/api/widget/upvotes/266624760782258186.svg?noavatar=true)](https://discordbots.org/bot/266624760782258186)

## Development Requirements

-   [`Node.js`]: To run the project.
-   [`PostgreSQL`]: (Dev Optional) To store persistent data.
-   [`Lavalink`]: (Dev Optional) Audio server.

## Set-Up

Copy and paste the [`config.example.ts`] file in the `src` directory and rename it to `config.ts`, then fill it with the precise variables.
Once all development requirements are set up:

```bash
# Lints and format all the code:
$ yarn lint

# Run Skyra in development mode:
$ yarn start

# Run Skyra in production mode, requires
# Lavalink and PostgreSQL to be running:
$ yarn pm2:start
```

> **Note**: Before pushing to the repository, please run `yarn lint` so formatting stays consistent and there are no linter warnings.

## Story

**A bit of story**: Skyra, formerly known as kyraBOT (renamed in the middle of March of 2017), is a multipurpose Discord
Bot that was born out of curiosity in a SoloLearn guild. With help from other developers, due to my lack of experience
(I made websites and templates for After Effects, but never a backend application). Skyra was born. Skyra's name comes
from a comment made by a user, joining "kyra" with "SkyNET", creating "SkyraNET", I liked the name and later, she got
renamed to "Skyra". Originally, it was going to be renamed as "Shiny" (name taken for the currency) or "Shyy" (original
name from the lore) however I decided "Skyra" would be a better name.

Skyra does not only feature almost every feature that is needed in the majority of guilds (discord servers) while being
completely configurable, she also has a backstory, inherited from the lore I have been creating since I was a child.

There have been over 13 rewrites with an active development of over two years, I have met many developers and friends in
Discord, and in February 2017, I met the Dirigeants team, upon which I started to contribute to Komada, and later, for
Klasa.

_Who knows, I might write a book someday for Skyra's lore._

## Links

**Skyra links**

-   [Skyra Invite Link]
-   [Support Server]
-   [Patreon]
-   [Translation]

**Framework links**

-   [Klasa's Website]

## Buy us some donuts

Skyra Project is open source and always will be, even if we don't get donations. That said, we know there are amazing people who
may still want to donate just to show their appreciation. Thanks you very much in advance!

We accept donations through Patreon, BitCoin, Ethereum, and Litecoin. You can use the buttoms below to donate through your method of choice.

| Donate With |         QR         |                                                                  Address                                                                  |
| :---------: | :----------------: | :---------------------------------------------------------------------------------------------------------------------------------------: |
|   Patreon   | ![PatreonImage][]  |                                               [Click Here](https://www.patreon.com/kyranet)                                               |
|   BitCoin   | ![BitcoinImage][]  |         [3JNzCHMTFtxYFWBnVtDM9Tt34zFbKvdwco](bitcoin:3JNzCHMTFtxYFWBnVtDM9Tt34zFbKvdwco?amount=0.01&label=Skyra%20Discord%20Bot)          |
|  Ethereum   | ![EthereumImage][] | [0xcB5EDB76Bc9E389514F905D9680589004C00190c](ethereum:0xcB5EDB76Bc9E389514F905D9680589004C00190c?amount=0.01&label=Skyra%20Discord%20Bot) |
|  Litecoin   | ![LitecoinImage][] |         [MNVT1keYGMfGp7vWmcYjCS8ntU8LNvjnqM](litecoin:MNVT1keYGMfGp7vWmcYjCS8ntU8LNvjnqM?amount=0.01&label=Skyra%20Discord%20Bot)         |

<!----------------- LINKS --------------->

[`node.js`]:            https://nodejs.org/en/download/current/
[`postgresql`]:         https://www.postgresql.org/download/
[`lavalink`]:           https://github.com/Frederikam/Lavalink

[`config.example.ts`]:  /src/config.example.ts

[skyra invite link]:    https://skyra.pw/invite
[support server]:       https://join.skyra.pw
[patreon]:              https://www.patreon.com/kyranet
[translation]:          https://skyra.pw/translate

[klasa's website]:      https://klasa.js.org

[patreonimage]:         https://raw.githubusercontent.com/skyra-project/Skyra/master/assets/github/patreon.png
[bitcoinimage]:         https://raw.githubusercontent.com/skyra-project/Skyra/master/assets/github/bitcoin.png
[ethereumimage]:        https://raw.githubusercontent.com/skyra-project/Skyra/master/assets/github/ethereum.png
[litecoinimage]:        https://raw.githubusercontent.com/skyra-project/Skyra/master/assets/github/litecoin.png

repository: ImmortalSnake/skyra

repo_name: ImmortalSnake/skyra


text:
# Quick start

This is a reference page to quick start your knowledge of the project.

## Using the prototype online

If you don't want to deploy or develop the current project state, you may test online our [prototype](https://b2stage.cineca.it/api/status). If that is the case see the [dedicated instructions](prototype.md).

Please feel free [to report or comment](https://gitter.im/EUDAT-B2STAGE/http-api) to help us improve!

## Start-up the project

Before starting up head to the [pre-requisites](docs/deploy/preq.md) page.
Here's step-by-step tutorial to work with the HTTP API project.

`TO BE COMPLETED`

repository: Vathasav/http-api

repo_name: Vathasav/http-api


text:
# <polymer-localforage>

A Polymer element for Mozilla's [localForage](https://github.com/mozilla/localForage) (async storage via IndexedDB or WebSQL)

> Maintained by [Addy Osmani](https://github.com/addyosmani).

## Demo

> [Check it live](http://addyosmani.github.io/polymer-localforage/smoke.html).

## Installation

Using [Bower](http://bower.io), run:

```shell
bower install polymer-localforage
```

## Usage

1. Import Web Components' polyfill:

    ```html
    <script src="//cdnjs.cloudflare.com/ajax/libs/polymer/0.1.4/platform.js"></script>
    ```

2. Import Custom Element:

    ```html
    <link rel="import" href="src/polymer-localforage.html">
    ```

3. Start using it!

    ```html
    <polymer-localforage><polymer-localforage>
    ```

## Examples

Store a string/object value under a particular key name (`my-app-storage`):

```
<polymer-localforage name="my-app-storage" value="{{value}}"></polymer-localforage>
```

## Setup

In order to run it locally you'll need a basic server setup.

1. Install [NodeJS](http://nodejs.org/download/).
2. Install [GruntJS](http://gruntjs.com/):

    ```sh
    $ [sudo] npm install -g grunt-cli
    ```

3. Install local dependencies:

    ```sh
    $ npm install
    ```

4. Run a local server and open `http://localhost:8000`.

    ```sh
    $ grunt connect
    ```

## Options

Attribute  | Options                   | Default             | Description
---        | ---                       | ---                 | ---
`name`      | *string*                  | `null`               | The key to the data stored in localforage.
`value`      | *string*                  | `null`               | The data associated with the specified name.
`useRaw`      | *boolean*                  | `false`               | If true, the value is stored and retrieved without JSON processing.
`autoSaveDisabled`      | *boolean*                  | `false`               | If true, auto save is disabled.

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3.  Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## License

[MIT License](http://opensource.org/licenses/MIT)

repository: gronke/polymer-localforage

branch_name: refs/heads/gh-pages

repo_name: gronke/polymer-localforage


text:
---
layout: default
---

This is just a collection of stuff on the internet that I like in no particular order.
See also [blogroll]({{ '/blogroll' | absolute_url }})

## Bookmarks

* [The joel test](https://www.joelonsoftware.com/2000/08/09/the-joel-test-12-steps-to-better-code/)
* [Makers Schedule](http://www.paulgraham.com/makersschedule.html)
* [Always use \[closed, open) intervals](https://fhur.me/posts/always-use-closed-open-intervals)
* [Boring technology](https://mcfunley.com/choose-boring-technology) / [boringtechnology.club](https://boringtechnology.club/)
* [1x engineer](https://1x.engineer/)
* [killedbygoogle](https://killedbygoogle.com/)
* [WAT ruby](https://www.destroyallsoftware.com/talks/wat)
* [Stop citing TIOBE for language popularity](https://blog.nindalf.com/posts/stop-citing-tiobe/)
* [Python's Super Considered Harmful](https://fuhm.net/super-harmful/)
* ["Considered Harmful" Essays Considered Harmful](https://meyerweb.com/eric/comment/chech.html)
* [Questions I'm asking in interviews](https://jvns.ca/blog/2013/12/30/questions-im-asking-in-interviews/)
* [Software development is very subjective](https://vadimkravcenko.com/shorts/software-development-subjective/)
* [Web fingerprinting is worse than I thought](https://www.bitestring.com/posts/2023-03-19-web-fingerprinting-is-worse-than-I-thought.html)
* [The close door button](https://computer.rip/2023-03-13-the-door-close-button.html)
* [WAT orgs](https://danluu.com/wat/)
* [Yearn for balance](https://cdoyle.me/2023/02/22/yearn-for-balance/)
* [The Case Against Relying Solely on DRY](https://betterprogramming.pub/a-case-against-relying-solely-on-dry-16dd712e422b) Avoid Hasty Abstractions
* [Sound](https://ciechanow.ski/sound/)
* [Pragmatic programmer summary](https://github.com/HugoMatilla/The-Pragmatic-Programmer) + other tech book summaries on this profile
* [Don't call yourself a programmer](https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/)
* [GitHub shouldn't become the only option](https://blog.edwardloveall.com/lets-make-sure-github-doesnt-become-the-only-option)


text:
phpkg-crypt
==========

Contains `Md5::short`, shorter version of MD5(22 digit), originally written by Serge at 20-May-2008 03:19, found on [the official md5 function manual][].

[the official md5 function manual]: http://php.net/md5

Installation
------------

Install composer in your project:

    curl -s https://getcomposer.org/installer | php

Create a composer.json file in your project root:

    {
        "require": {
            "pokelabo/crypt": "*"
        },
        "repositories": [
            {
                "type": "git",
                "url": "https://github.com/pokelabo/phpkg-crypt.git"
            }
        ]
    }

License
-------

MIT Public License

repository: pokelabo/phpkg-crypt

repo_name: pokelabo/phpkg-crypt


text:
Change: Enable/disable accounts in accounts UI

We added a new feature in the ocis-accounts web extension to enable or disable accounts. This also introduces batch actions, where accounts can be selected and a batch action applied to them. The UI for this is the same as in the files extension of ocis-web.

https://github.com/owncloud/product/issues/118
https://github.com/owncloud/ocis-accounts/pull/109
https://github.com/owncloud/ocis/pull/525


text:
Hub20 is a fairly standard application implemented in
[Django](https://djangoproject.com) and
[Celery](https://docs.celeryproject.org). Django provides the HTTP API and
the website, while celery is using to run background tasks and
services.

### Integrated services

 - Ethereum node client: to keep track of all of the transactions on
   the blockchain. You can run your own or rely on a third-party
   service provider such as infura.
 - Raiden client: to be able to make and receive payments on the
   raiden network. This client needs to run on your own infrastructure
   and should have its access *always* protected. Currently Raiden
   does not provide any kind of access control or authorization checks
   for its API, which means that anyone with direct network access to
   raiden will be able to make operations with it.

### Dependencies

 - [PostgreSQL](https://postgresql.org) to record all user account
   data and relevant transactions that happen on either raiden or the
   blockchain
 - [Redis](https://redis.io) provides a cache layer, a message broker
   for celery and the scheduling of celery tasks and also as the
   comunication layer for django channels. It is *strongly*
   recommended that you use separate redis databases for each of these
   duties.


text:
---
permalink: /wheelEncoder/
title: Wheel Encoders
---

The robot determines where it is in relation to a coordinate frame by using it's wheel encoders. Current implementation uses a custom package with custom code, located in the [mpdr](https://github.com/hannabanana96/MPDR_Masters/tree/master/mpdr) package, in [encoder.py](https://github.com/hannabanana96/MPDR_Masters/blob/master/mpdr/src/encoders.py)

# Implementation Overview
This implementation uses "tick" values from the wheel encoder. Tick values relate to the angle at which the wheel encoder is compared to the location of the magnet (seen on the gear). As the gear rotates (as the wheel rotates and the robot moves), the ticks values reported by the wheel encoder will either increase or decrease. The increase or descrease of tick value relates to the increase or decrease of position of the robot. Consequently, the rate at which the ticks values increase or decrease relates to the velocity of the wheel. The individual velocities of the wheel need to be put in terms of the robot as a linear and angular velocity.

Below is how to take ticket values from the individual wheel encoders and translate them to position and velocity of the differential drive robot. This requires two samples of the wheel encoders, the previous and current sample.
```
dt = current_time - prev_sample_time

# Difference in tick values between samples
deltaLeftTicks = current_tick_L - prev_tick_L
deltaRightTicks = current_tick_R - prev_tick_R

# Calculate the velocity of each wheel
# DISTANCE_PER_TICK is the distance traveled by tick value (2*pi*wheelradius) / (# of ticks per rev of the wheel)
# (2*pi*wheelradius) is the circumfrance of the wheel
vel_wheel_L = (deltaLeftTicks * DISTANCE_PER_TICK) / dt
vel_wheel_R = (deltaRightTicks * DISTANCE_PER_TICK) / dt

# Determine the robot body's linear and angular velocities
# From the robot's point of view, it can only ever move forward (in the x direction),
#  so velocity in the y direction will always be 0
robot.vx = (vel_wheel_R + vel_wheel_L) / 2
robot.vy = 0;
robot.vth = -(vel_wheel_R - vel_wheel_L) / ROBOT_RADIUS

# Computing the robot's change in position and angle
delta_x = (robot.vx * cos(robot.th) - robot.vy * sin(robot.th)) * dt
delta_y = (robot.vx * sin(robot.th) + robot.vy * cos(robot.th)) * dt
delta_th = robot.vth * dt

```
![Wheel Encoder](https://hannabanana96.github.io/MPDR_Project/assets/images/wheel_encoder_motor.jpg){: .align-center}

# Hardware Setup
The current implementation uses an [AS5047P](https://ams.com/as5047p) 14-bit an axis magnetic rotary position sensor. The [development board](https://www.digikey.com/en/products/detail/ams/AS5047P-TS-EK-AB/5452344) was used for quick prototype (it includes a magnet and can be powered from 3V3 or 5V. An Arduino can be used to test the functionality of the sensors before integration with the robot:
* [Arduino Reference Page](https://www.arduino.cc/reference/en/libraries/as5047p/)
* [AS5047P Arduino Library Tutorial (Github)](https://github.com/jonas-merkle/AS5047P)

This wheel encoder has several different communication schemes. SPI was chosen because it could be quickly tested via the Arduino for debugging purpose. SPI is not natively actived on the Rasp Pi 4, which has up to 6 SPI busses. For our purposes, I chose SPI0. To activate SPI do the following:
`sudo vi /boot/firmware/usercfg.txt` \
And add: `dtparam=spi=on` \
Close the file and in the command line: `pip3 install spidev` \
Then reboot. \
This automatically addes two chip select lines (by default you can run two devices on this SPI line). Next, check that your user has permissions to access the the SPI buss: `ls -l /dev/spi*`
![image-center](https://hannabanana96.github.io/MPDR_Project/assets/images/spi_cmdline.JPG){: .align-center}

# Software Setup
Assuming the Pi has ROS and the [project code](https://github.com/hannabanana96/MPDR_Masters) installed already, the wheel encoder code can be launched by the following:
* Start a ROS core: `roscore`
* In another window: `rosrun mpdr encoder.py` \
*This runs just the wheel encoders code, nothing else

# Checking Odometry Messages/Broadcast
It is very important to make sure the odometry messages are being created correctly. [Odometry](http://docs.ros.org/en/noetic/api/nav_msgs/html/msg/Odometry.html) messages are made Pose and Twist messages. Read through [REP 103](https://www.ros.org/reps/rep-0103.html) to gain an understanding of which direction relation to positive and negative in changes in position and orientation. The pose.z should always be 0 because the robot cannot move in the z direction (that would be up towards the sky or down into the ground). For example when the robot moves forward, there should be +x position (pose) and +x velocity (Twist), y position and velocity would be the same. When the robot rotates about the Z axis, there should be a positive rotation in the Pose.rotation_about_the_z_axis part of the Odometry message.

# Sources of Error
The are many sources of error with this as wheel encoders can produce false reports when there is wheel slippage. The implementation senses the position of the wheel at the base of the motor on the gearbox instead of the actual wheel. This means that there are several revoluations of the gear per one revolution of the wheel (another potential source of error). The ratio of the gear to the wheel is seen in a DISTANCE_PER_TICK macro: \
`(2 * Pi * Wheel Radius) / (# of ticks per Gear revolutions * # of Gear turns per Wheel revolution)` \

The rate at which the wheel encoders are sampled are also a point of interest.