text:
# body_parser
[![Pub](https://img.shields.io/pub/v/body_parser.svg)](https://pub.dartlang.org/packages/body_parser)
[![build status](https://travis-ci.org/angel-dart/body_parser.svg)](https://travis-ci.org/angel-dart/body_parser)

Parse request bodies and query strings in Dart, as well multipart/form-data uploads. No external
dependencies required.

This is the request body parser powering the
[Angel](https://angel-dart.github.io)
framework. If you are looking for a server-side solution with dependency injection,
WebSockets, and more, then I highly recommend it as your first choice. Bam!

### Contents

*   [Body Parser](#body-parser)
*   [About](#about)
*   [Installation](#installation)
*   [Usage](#usage)
*   [Thanks](#thank-you-for-using-body-parser)

# About

I needed something like Express.js's `body-parser` module, so I made it here. It fully supports JSON requests.
x-www-form-urlencoded fully supported, as well as query strings. You can also include arrays in your query,
in the same way you would for a PHP application. Full file upload support will also be present by the production 1.0.0 release.

A benefit of this is that primitive types are automatically deserialized correctly. As in, if you have a `hello=1.5` request, then
`body['hello']` will equal `1.5` and not `'1.5'`. A very semantic difference, yes, but it relieves stress in my head.

# Installation

To install Body Parser for your Dart project, simply add body_parser to your
pub dependencies.

    dependencies:
        body_parser: any

# Usage

Body Parser exposes a simple class called `BodyParseResult`.
You can easily parse the query string and request body for a request by calling `Future<BodyParseResult> parseBody`.

```dart
import 'dart:convert';
import 'package:body_parser/body_parser.dart';

main() async {
    // ...
    await for (HttpRequest request in server) {
      request.response.write(JSON.encode(await parseBody(request).body));
      await request.response.close();
    }
}
```

You can also use `buildMapFromUri(Map, String)` to populate a map from a URL encoded string.

This can easily be used with a library like [JSON God](https://github.com/thosakwe/json_god)
to build structured JSON/REST APIs. Add validation and you've got an instant backend.

```dart
MyClass create(HttpRequest request) async {
    return god.deserialize(await parseBody(request).body, MyClass);
}
```

## Custom Body Parsing
In cases where you need to parse unrecognized content types, `body_parser` won't be of any help to you
on its own. However, you can use the `originalBuffer` property of a `BodyParseResult` to see the original
request buffer. To get this functionality, pass `storeOriginalBuffer` as `true` when calling `parseBody`.

For example, if you wanted to
[parse GraphQL queries within your server](https://github.com/angel-dart/graphql)...

```dart
app.get('/graphql', (req, res) async {
  if (req.headers.contentType.mimeType == 'application/graphql') {
    var graphQlString = new String.fromCharCodes(req.originalBuffer);
    // ...
  }
});
```

repository: micimize/angel

repo_name: micimize/angel


text:
# Anatomical API

NeuroCore places a strong emphasis on arrays with named dimensions. This allows the use of well established interfaces for arrays across the julia ecosystem while still providing meaningful information that may be specific to the type of data being worked with.

## References

```@autodocs
Modules = [NeuroCore.AnatomicalAPI]
Order   = [:function, :type]
```

license: MIT

branch_name: refs/heads/master

extension: md

gha_license_id: MIT

license_type: permissive


text:
# Specifications for the CLI Assessment

Specs:
- [x] Have a CLI for interfacing with the application
	My CLI class is where my prompts are located.  It's what makes my program interactive.

- [x] Pull data from an external source
	I had to pull data from 2 pages on a website:
		(a) page 1 = https://insideschools.org/search/results?borough=bronx&district=8&neighborhood=&grade_level=ms&button=" (page 1 holds items 1-20)
		(b) page_2 = https://insideschools.org/search/results/page/2?borough=bronx&button=&district=8&grade_level=ms&neighborhood=" (page 2 holds items 21 and 22)

- [x] Implement both list and detail views
	The list is generated from the pages mentioned above while the majority of the school details had to be gathered from each school's link.

gha_language: Ruby


text:
youshouldknowbetter
===================

"You should know better" is a chrome extension helping you not to watch stuff you know you shouldn't.

You can install it in Chrome by visiting the [Chrome Web Store](https://chrome.google.com/webstore/detail/you-should-know-better/jeonnmbnhkgniebodpihikonemmaepnc)

repository: tante/youshouldknowbetter

gha_language: JavaScript

repo_name: tante/youshouldknowbetter


text:
# Table of Contents

- [0.3.0](#030---20181219)
- [0.2.0](#020---20181219)
- [0.1.0](#010---20181201)

## [0.3.0] - 2018/12/19

### Summary

- This release adds support for Kong 1.0.
  It is not compatible with 0.x.y  versions of Kong due to breaking
  Admin API changes as the deprecated API entity is dropped.
- The code and API for the library is same as 0.2.0, with the exception
  that struct defs and services related to `API` is dropped.

### Breaking changes

- `API` struct definition is no longer available.
- `APIService` is no longer available. Please ensure your code doesn't rely
  on these before upgrading.
- `Plugin` struct has dropped the `API` field.

## [0.2.0] - 2018/12/19

### Summary

- This release adds support for Kong 0.15.x.
  It is not compatible with any other versions of Kong due to breaking
  Admin API changes in Kong for Plugins, Upstreams and Targets entities.

### Breaking changes

- `Target` struct now has an `Upstream` member in place of `UpstreamID`.
- `Plugin` struct now has `Consumer`, `API`, `Route`, `Service` members
  instead of `ConsumerID`, `APIID`, `RouteID` and `ServiceID`.

### Added

- `RunOn` property has been added to `Plugin`.
- New properties are added to `Route` for L4 proxy support.

## [0.1.0] - 2018/12/01

### Summary

- Debut release of this library
- This release comes with support for Kong 0.14.x
- The library is not expected to work with previous or later
  releases of Kong since every release of Kong is introducing breaking changes
  to the Admin API.

[0.3.0]: https://github.com/hbagdi/go-kong/compare/0.2.0...0.3.0
[0.2.0]: https://github.com/hbagdi/go-kong/compare/0.1.0...0.2.0
[0.1.0]: https://github.com/hbagdi/go-kong/compare/87666c7fe73477d1874d35d690301241cd23059f...0.1.0


text:
Open Compare ![Build status](https://travis-ci.org/co-stig/opencompare.svg?branch=master)
===========

Open Compare is a generic open-source compare tool.

As the name suggests, the tool is designed to compare two instances of some system, e.g. SAP, Oracle, Linux, etc. The procedure is straightforward:

1. Create a “Reference snapshot”
2. Create an “Actual snapshot”
3. Obtain the difference between those two

The snapshot contains the following objects, organized in a tree structure:

* Folder structure (folders and filenames)
* ZIP and JAR structure (parsed recursively like a folder)
* (Java specific) Name-value pairs for .properties files
* (Java specific) Method signatures for .class files
* CRC32 checksums for all other files

This list is extensible -- arbitrary object types and structures are supported by flexible plugin architecture (see below).

# Sample usage scenarios

* New upgrade or migration project. Original installation, configuration and customization of the system were performed by 3rd party consultants, the documentation is incomplete and outdated. Comparison to the out-of-the-box (OOTB) snapshot reveals configuration differences and highlights customizations, allowing to validate and fix the documentation.

* The customer has his own IT or consulting team. When your specialists leave the project, they take a snapshot of the working system, and then attach it to the “frozen” project documentation. Next time your team works with this customer, they compare the current system instance to the documented one and update the documentation.

* Cluster. Two servers in a cluster behave differently for unknown reason. Their snapshots are compared to each other to identify configuration misalignment.

* Issues and tech support. Snapshot of the system instance might be useful when troubleshooting some complex customer cases. Snapshots taken at regular intervals can be compared to each other, helping to identify configuration changes that led to an issue.

* Regular updates. For some of the large projects, new customizations and patches are rolled on to the servers very often. Taking snapshots after each deployment can save time debugging some issues.

* Staging environments and virtual machines. Comparing development and pre-production servers with the actual productive environment results in more reliable and stress-free development.

# Screenshots / User guide

TODO

# Command line

TODO

# Installation

TODO

# Supported platforms

TODO

# Changelog

TODO

# Architecture

TODO

# Extending OC

TODO

# Known bugs and limitations

TODO

# Plans

TODO

# Credits

TODO

repository: co-stig/opencompare

repo_name: co-stig/opencompare


text:
# Simple Classifier

- Author: Francisco Reveriano
- Institution: Duke University
- Lab: Applied Machine Laboratory
- Date: April 13, 2020

## Details
This is a simple classifier that trains on top of a pre-trained network.
The pre-trained network is trained on ImageNet. The structure is very flexible and allows for multiple changes.

## Files
- train.py
- predict.py
- Image Classifier Project (Jupyter Notebook)

### Train
Optional changes to the train function.
- epochs
    - Number of Epochs To Train
- batch size
    - Batch Size for Each Epoch
- learning-rate
    - Learning Rate (Utilizing Adam Optimizer)
- architecture
    - Pre-Train Architecture
- directory
    - Directory of the dataset
- dropout
    - Dropout for the Classifier
- gpu
    - Whether to allow GPU training

### Predict
- image-path
    - Path of the Image we want to classify
- model-path
    - Checkpoint where the weight is saved
- json-path
    - Path of the JSON file holding the score dictionary
- gpu
    - Use GPU or not
-topk
    - How many of the top results to return
- display
    - Whether to display Matplotlib results


text:
---
title: 'A guide to React refs: useRef and createRef'
excerpt: In this article, we're going to investigate why React, a framework meant to abstract your code away from DOM manipulation, leaves the door open for developers to access it.
host: LogRocket
host_url: //blog.logrocket.com
external_url: //blog.logrocket.com/a-guide-to-react-refs/
---

As is the case with many other UI libraries, React offers a way to rethink a view as the result of a state of a component.

This is a big pivot away from how we usually build applications.

When we become familiar with some of these new concepts, we discover how easy it is to solve simple problems in the frontend world that used to cause us some trouble.

Part of that benefit comes from creating the views with the abstraction mechanisms React and JSX expose instead of doing it through DOM spec methods.

Still, the React team did something smart that all library authors should do: they provided escape hatches and kept the library open for situations beyond the ones they were specifically designed for, as well as situations the model may not work for.

## Creating refs

As I said, refs are escape hatches for React developers, and we should try to avoid using them if possible.

When we obtain a node by using a `ref` and later modify some attribute or the DOM structure of it, it can enter into conflict with React's diff and update approaches.

We're going to cover anti-patterns later in this article. First, let's start with a simple component and grab a node element using refs.

```js
import React from 'react';

class ActionButton extends React.Component {
  render() {
    const { label, action } = this.props;
    return <button onClick={action}>{label}</button>;
  }
}
```

The `<button>` expression here is actually the JSX way of calling the `React.createElement('button')` statement, which is not actually a representation of an HTML Button element — it's a React element.

You can gain access to the actual HTML element by creating a React reference and passing it to the element itself.

```js
import React, { createRef } from 'react';

class ActionButton extends React.Component {
  constructor() {
    super();
    this.buttonRef = createRef();
  }

  render() {
    const { label, action } = this.props;
    return (
      <button onClick={action} ref={this.buttonRef}>
        {label}
      </button>
    );
  }
}
```

This way, at any time in the lifecycle of the component, we can access the actual HTML element at `this.buttonRef.current`.

But what about functions that act as components?

Recently, the React team released Hooks to pair them with the same features class components have.

We can now import `useRef` for refs inside function components as well.

```js
import React, { useRef } from 'react'

function ActionButton({ label, action }) {
    const buttonRef = useRef(null)

    return (
      <button onClick={action} ref={buttonRef}>{label}</button>
    )
  }
}
```

We know how to access DOM nodes inside a React component. Let's take a look at some of the situations where this may be useful.

## Usage of React refs

One of the many concepts that React expanded in the web sphere is the concept of declarative views.

Before declarative views, most of us were modifying the DOM by calling functions that explicitly changed it.

As mentioned at the introduction of this article, we are now declaring views based on a state, and — though we are still calling functions to alter this `state` — we are not in control of when the DOM will change or even if it should change.

Because of this inversion of control, we'd have lost this imperative nature if it weren't for refs.

Here are a few use cases where it may make sense to bring refs into your code.

### Focus control

You can achieve focus in an element programmatically by calling `focus()` on the node instance.

Because the DOM exposes this as a function call, the best way to do this in React is to create a ref and manually do it when we think it's suitable.

```js
import React from 'react';

class InputModal extends React.Component {
  constructor(props) {
    super(props);

    this.state = { value: props.initialValue };
  }

  onChange = (e) => {
    this.setState({ value: e.target.value });
  };

  onSubmit = (e) => {
    e.preventDefault();
    const { value } = this.state;
    const { onSubmit, onClose } = this.props;
    onSubmit(value);
    onClose();
  };

  render() {
    const { value } = this.state;

    return (
      <div className="modal--overlay">
        <div className="modal">
          <h1>Insert a new value</h1>
          <form action="?" onSubmit={this.onSubmit}>
            <input type="text" onChange={this.onChange} value={value} />
            <button>Save new value</button>
          </form>
        </div>
      </div>
    );
  }
}

export default InputModal;
```

In this modal, we allow the user to modify a value already set in the screen below. It would be a better user experience if the input was on focus when the modal opens.

This could enable a smooth keyboard transition between the two screens.

The first thing we need to do is get a reference for the input:

```js
import React, { createRef } from 'react';

class InputModal extends React.Component {
  constructor(props) {
    super(props);
    this.inputRef = createRef();

    this.state = { value: props.initialValue };
  }

  onChange = (e) => {
    this.setState({ value: e.target.value });
  };

  onSubmit = (e) => {
    e.preventDefault();
    const { value } = this.state;
    const { onSubmit, onClose } = this.props;
    onSubmit(value);
    onClose();
  };

  render() {
    const { value } = this.state;

    return (
      <div className="modal--overlay">
        <div className="modal">
          <h1>Insert a new value</h1>
          <form action="?" onSubmit={this.onSubmit}>
            <input
              ref={this.inputRef}
              type="text"
              onChange={this.onChange}
              value={value}
            />
            <button>Save new value</button>
          </form>
        </div>
      </div>
    );
  }
}

export default InputModal;
```

Next, when our modal mounts, we imperatively call focus on our input ref:

```js
import React, { createRef } from 'react';

class InputModal extends React.Component {
  constructor(props) {
    super(props);
    this.inputRef = createRef();

    this.state = { value: props.initialValue };
  }

  componentDidMount() {
    this.inputRef.current.focus();
  }

  onChange = (e) => {
    this.setState({ value: e.target.value });
  };

  onSubmit = (e) => {
    e.preventDefault();
    const { value } = this.state;
    const { onSubmit, onClose } = this.props;
    onSubmit(value);
    onClose();
  };

  render() {
    const { value } = this.state;

    return (
      <div className="modal--overlay">
        <div className="modal">
          <h1>Insert a new value</h1>
          <form action="?" onSubmit={this.onSubmit}>
            <input
              ref={this.inputRef}
              type="text"
              onChange={this.onChange}
              value={value}
            />
            <button>Save new value</button>
          </form>
        </div>
      </div>
    );
  }
}

export default InputModal;
```

{% codeExampleLink '//codesandbox.io/s/input-modal-example-gvrpo' %}

Remember that you need to access the element through the `current` property.

### Detect if an element is contained

Similarly, sometimes you want to know if any element dispatching an event should trigger some action on your app. For example, our Modal component could get closed if you click outside of it:

```js
import React, { createRef } from 'react';

class InputModal extends React.Component {
  constructor(props) {
    super(props);
    this.inputRef = createRef();
    this.modalRef = createRef();

    this.state = { value: props.initialValue };
  }

  componentDidMount() {
    this.inputRef.current.focus();

    document.body.addEventListener('click', this.onClickOutside);
  }

  componentWillUnmount() {
    document.removeEventListener('click', this.onClickOutside);
  }

  onClickOutside = (e) => {
    const { onClose } = this.props;
    const element = e.target;

    if (this.modalRef.current && !this.modalRef.current.contains(element)) {
      e.preventDefault();
      e.stopPropagation();
      onClose();
    }
  };

  onChange = (e) => {
    this.setState({ value: e.target.value });
  };

  onSubmit = (e) => {
    e.preventDefault();
    const { value } = this.state;
    const { onSubmit, onClose } = this.props;
    onSubmit(value);
    onClose();
  };

  render() {
    const { value } = this.state;
    return (
      <div className="modal--overlay">
        <div className="modal" ref={this.modalRef}>
          <h1>Insert a new value</h1>
          <form action="?" onSubmit={this.onSubmit}>
            <input
              ref={this.inputRef}
              type="text"
              onChange={this.onChange}
              value={value}
            />
            <button>Save new value</button>
          </form>
        </div>
      </div>
    );
  }
}

export default InputModal;
```

{% codeExampleLink '//codesandbox.io/s/input-modal-example-1to08' %}

Here, we are checking if the element click is out of the modal limits.

If it is, then we are preventing further actions and calling the `onClose` callback, since the Modal component expects to be controlled by its parent.

_Remember to check if the DOM element current reference still exists as state changes in React are asynchronous._

To achieve this, we are adding a global click listener on the body element. It's important to remember to clean the listener when the element gets unmounted.

### Integrating with DOM-based libraries

As good as React is, there are a lot of utilities and libraries outside its ecosystem that have been in use on the web for years.

It's good to take advantage of their stability and resolution for some specific problems.

GreenSock library is a popular choice for animation examples. To use it, we need to send a DOM element to any of its methods.

Using refs allows us to combine React with a great animation library.

Let's go back to our modal and add some animation to make its entrance fancier.

```js
import React, { createRef } from 'react';
import gsap from 'gsap';

class InputModal extends React.Component {
  constructor(props) {
    super(props);
    this.inputRef = createRef();
    this.modalRef = createRef();
    this.overlayRef = createRef();

    this.state = { value: props.initialValue };

    const onComplete = () => {
      this.inputRef.current.focus();
    };
    const timeline = gsap.timeline({ paused: true, onComplete });
    this.timeline = timeline;
  }
  componentDidMount() {
    this.timeline
      .from(this.overlayRef.current, {
        duration: 0.25,
        autoAlpha: 0
      })
      .from(this.modalRef.current, {
        duration: 0.25,
        autoAlpha: 0,
        y: 25
      });
    this.timeline.play();

    document.body.addEventListener('click', this.onClickOutside);
  }

  componentWillUnmount() {
    this.timeline.kill();
    document.removeEventListener('click', this.onClickOutside);
  }

  onClickOutside = (e) => {
    const { onClose } = this.props;
    const element = e.target;
    if (this.modalRef.current && !this.modalRef.current.contains(element)) {
      e.preventDefault();
      e.stopPropagation();
      onClose();
    }
  };

  onChange = (e) => {
    this.setState({ value: e.target.value });
  };

  onSubmit = (e) => {
    e.preventDefault();
    const { value } = this.state;
    const { onSubmit, onClose } = this.props;
    onSubmit(value);
    onClose();
  };

  render() {
    const { value } = this.state;
    return (
      <div className="modal--overlay" ref={this.overlayRef}>
        <div className="modal" ref={this.modalRef}>
          <h1>Insert a new value</h1>
          <form action="?" onSubmit={this.onSubmit}>
            <input
              ref={this.inputRef}
              type="text"
              onChange={this.onChange}
              value={value}
            />
            <button>Save new value</button>
          </form>
        </div>
      </div>
    );
  }
}

export default InputModal;
```

{% codeExampleLink '//codesandbox.io/s/input-modal-example-z63vr' %}

At the constructor level, we are setting up the initial animation values, which will modify the styles of our DOM references. The timeline only plays when the component mounts.

When the element gets unmounted, we'll clean the DOM state and actions by terminating any ongoing animation with the `kill()` method supplied by the `Timeline` instance.

We'll turn our focus to the input after the timeline has completed.

## Rule of thumb for refs usage

After knowing how refs work, it's easy to use them where they're not needed.

There's more than one way to achieve the same thing inside a React component, so it's easy to fall into an anti-pattern.

My rule when it comes to ref usage is this: You need to imperatively call a function for a behavior React doesn't allow you to control.

A simpler way to put it would be this: You need to call a function, and that function has no association with a React method or artifact.

Let's explore an anti-pattern that I've seen repeatedly in articles and even in interviews.

```js
import React, { createRef } from 'react';

class Form extends React.Component {
  constructor(props) {
    super(props);
    this.inputRef = createRef();

    this.state = { storedValue: '' };
  }

  onSubmit = (e) => {
    e.preventDefault();
    this.setState({ storedValue: this.inputRef.current.value });
  };

  render() {
    return (
      <div className="modal">
        <form action="?" onSubmit={this.onSubmit}>
          <input ref={this.inputRef} type="text" />
          <button>Submit</button>
        </form>
      </div>
    );
  }
}
```

It's fair to say if you want to send a value on submit, this approach will work.

The issue is that, knowing refs are actually an escape hatch of the view model React offers, we are sniffing into DOM element values or properties that we have access to through the React interface.

Controlling the `input` value we can always check its value.

```js
render() {
  const { value } = this.state

  return (
    <input
      type="text"
      onChange={e => this.setState({ value: e.target.value })}
      value={value}
    />
  )
}
```

Let's go back to our rule: “You need to imperatively call a function for a behavior React doesn't allow you to control. ”

In our uncontrolled input we are creating a ref but not doing an imperative call. Then that function should exist, which is not satisfied as I can indeed control an input's value.

## Forwarding refs

As we've discussed, refs are actually useful for really specific actions. The examples shown are a little simpler than what we usually find in a web application codebase nowadays.

Components are more complex and we barely use plain HTML elements directly. It's really common to include more than one node to encapsulate more logic around the view behavior.

```js
import React from 'react';

const LabelledInput = (props) => {
  const { id, label, value, onChange } = props;

  return (
    <div class="labelled--input">
      <label for={id}>{label}</label>
      <input id={id} onChange={onChange} value={value} />
    </div>
  );
};

export default LabelledInput;
```

The issue now is that passing a ref to this component will return its instance, a React component reference, and not the input element we want to focus on like in our first example.

Luckily, React provides an out-of-the-box solution for this called `forwardRef`, which allows you to define internally what element the `ref` will point at.

```js
import React from 'react';

const LabelledInput = (props, ref) => {
  const { id, label, value, onChange } = props;

  return (
    <div class="labelled--input">
      <label for={id}>{label}</label>
      <input id={id} onChange={onChange} value={value} ref={ref} />
    </div>
  );
};

export default React.forwardRef(InputCombo);
```

{% codeExampleLink '//codesandbox.io/s/input-modal-example-l2wst' %}

To achieve this, we'll pass a second argument to our function and place it in the desired element.

Now, when a parent component passes a ref value, it's going to obtain the input, which is helpful to avoid exposing internals and properties of a component and breaking its encapsulation.

The example of our form that we saw failing at achieving focus will now work as expected.

## Conclusion

We started with a recap on the basic concepts of React and its usage, why we generally shouldn't break the framework's model, and why we may sometimes need to.

Accessing the DOM through the interface the library exposes helps to maintain the internals of React in place (remember that `setState` contains more logic than just triggering a re-render cycle, like batching updates and in the near future, time slicing).

Breaking this model with anti-patterns can make later performance improvements in the library useless or even create bugs in your applications.

Remember to use refs only when there is an implicit function call React can't handle through its methods.

Also, make sure it doesn't alter the internal state of the components.

For more information, [read the official React documentation](//reactjs.org/docs/react-api.html#reactcreateref) about refs.

repository: jeremenichelli/personal-site

repo_name: jeremenichelli/personal-site


text:
# What is this for?

Prior to the implementation of a nationwide contact tracing system in Singapore, all visitors to a building must have their particulars and contact information recorded. This creates a long queue at the entrance especially when there is a peak. Furthermore, the same information is solicited for every repeated entry.

This simple application is created to address some of these problems. The national identity number is used as an identifier. The first time the visitor enters the building the identity card number, name, and contact number need to be entered. Subsequent entries only need to enter the identity card number. The use of a barcode reader to scan the identity number virtually removes all manual keying in of information for repeated visitors.

# Technoloy stack

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.0.7.

The backend was implemented using spring boot.

# Notable Features

* No clear ID number is stored (uses a hash of the ID number for storage & searches)
* Generation of daily entry report in PDF (login required)
* Validation of identity number and phone number
* Allows for integraton to barcode scanner for ID number capture

# Screen shots

# Setup (Development)

## Frontend
npm update
ng serve

## Backend
mvn spring-boot:run

# Important notice

The default is using an in-memory database. The data stored in the backend will disapper with every restart. Please configure to use a persistent database of your choice!

SSL is not setup for the front/backend. Need to setup for SSL for production deployment!

The backend is using an in-memory authentication manager with the credentials hard-coded!

repository: leechiny/visiting

repo_name: leechiny/visiting


text:
---
title: Blog 21/06/17
layout: post
author: charles.rollins
permalink: /blog-21/06/17/
source-id: 1zccUPUuynDma49Ot5_MM5RNRoA0MIZJ5BtvsB2bixHY
published: true
---

    Title:
    Repl.it Python Code and Github improvement
     Date:
    21/06/16

    Starting point:
    Starter on Repl.it making a python code for asking your name and surname.

    Target for this lesson?
    Making a well working repl.it python code and improving github page.

    Did I reach my target?
(add details to "Lesson Review")
    I made a fully working python code, which worked well to ask somebody's name and surname whilst responding. In terms of my github page I have run into various problems however, I am on the path to reforming it.

    Lesson Review

    How did I learn? What strategies were effective?

    Listening to Mr Tansley and confidently following instructions whilst working well on my own and cooperating with others when I needed to.

    What limited my learning? Which habits do I need to work on?

    I need to put more time into solving a problem and persevere in order to solve it.

    What will I change for next time? How will I improve my learning?


text:
# Pseudonectria coronata (Juel) Lowen, 1993 SPECIES

#### Status
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycologia 85(4): 693 (1993)

#### Original name
Nectriella coronata Juel, 1925

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Ascomycota/Sordariomycetes/Hypocreales/Bionectriaceae/Bionectria/Bionectria coronata/ Syn. Pseudonectria coronata/README.md

repo_name: mdoering/backbone


text:
---
layout: post
title:      "Project One"
date:       2019-07-07 18:00:14 -0400
permalink:  project_one
---

*The problem*:  Given the [King County housing data](https://www.kaggle.com/harlfoxem/housesalesprediction), come up with a model to predict the price of a house.

In this project, I did a lot of things.

One of the hardest things I did was getting started.  It was really difficult to even know where to begin and so I fell back on the tactics that have worked for me as a math teacher and as a learner:
* Ignore the question
* *Do what you know how to do* <--- That's what this blog entry is about
* List out what you have/need
* Un-ignore the question
* Come up with a plan
* Revise, Revise, Revise
* Answer the question
* Make sure you've answered the question

Sometimes, the question being asked is just too much to take in all at once.  It's like trying to go to a far off destination without a map.  Instead of being overwhelmed by the whole problem at once, I just ignore the end goal for a little bit until I feel more oriented.   And that's exactly what I did with this project.  Before starting, I had some general idea of how to do it but it's sorta like if someone told me that my goal was to stand on the moon.  I mean, I know I need to take a rocket to the moon  but that's not enough of a plan to actually get me there.

After ignoring the actual problem, I get to make one of my own.  This is the part I like best because it's easy to feel successful here.  For this project, the first thing I knew I had to do was look at the data (obviously).  It's really hard to use the data if you haven't looked at it.  And, luckily, I'm an expert at looking at data.  Also - it's really great to start with something that you can be successful with because:
> Success breeds success.

It builds your confidence and, because of your strengthened confidence, you can stick with tasks longer and deal with more frustration.

Anyway, my plan, at first, was just to look at the data and so I did.

```
king_co = pd.read_csv("kc_house_data.csv")
king_co.head()
```

|id|date|price|bedrooms|bathrooms|...|long|sqft_living15|sqft_lot15|
|--|-----|------|------------|------------|--|-----|---------------|------------|
|7129300520|10/13/2014|221900.0|	3|	1.00	|...|	-122.257|	1340|	5650
|6414100192	|12/9/2014|	538000.0|	3	|2.25|...|-122.319|	1690	|7639
|5631500400|	2/25/2015	|180000.0	|2	|1.00|...|	-122.233|	2720|	8062
|2487200875	|12/9/2014|	604000.0|	4|	3.00	|...|-122.393|	1360|	5000
|1954400510|	2/18/2015	|510000.0|3	|2.00|...|-122.045	|1800	|7503

Easy.  What else do I know how to do?  (That's the big question that really drives this forward until I have a better idea of how to get to my goal - I just keep asking, "And what else?" Another good question is: "What does that mean?" because it usually leads to more questions.)

Everything looked alright from the table but I knew that this was a raw dataset so obviously things needed cleaned up.  I just didn't know exactly what cleaning needed to be done so, again, I did the easy things first.  I looked for null values, missing data, all that great stuff.  But once I'd cleaned up the straightforward things, I decided to take a look at the histograms to see what the variables looked like and if anything weird popped up.

![](https://i.imgur.com/zKoJmfW.png)

Those graphs seem fine but there are a number of weird things:
* there are only 19 graphs but 21 variables
* none of the variables are normally distributed
* the axis scales are different by orders of magnitude
* some of the graphs appear to only have one bar

If you want more details about how I dealt with all of those problems, you're welcome to read through the [code for my project](https://github.com/alvacat/dsc-v2-mod1-final-project-online-ds-pt-051319/blob/master/student.ipynb) but for this blog post, I'm going to zoom in one of those issues specifically:  none of the variables are normally distributed.

Normally distributed data can make for better models and so I thought I'd try to transform my variables to make them a bit less skewed.

I immediately ran into some issues.  First, there were several variables that had entries with a value of 0.  For example, `sqft_basement` was often 0.0 square feet (which is exactly how big the basement is for a basement-less house).

I don't know if you've ever tried to take the log 0 but it's not great.  By which I mean its undefined and impossible.  It's not even a complex/imaginary answer - it's just undefined.  So, for anything that had a potential value of 0, I actually had to take the log (x+1).  The graphs are practically the same (especially as x gets bigger) but it gets rid of the whole issue of impossible answers.

![](https://i.imgur.com/7AkCmZS.png)

The other issue is that some values are negative.  For instance, all of the longitude values are around -122 (which is really 122 degrees West).  Taking the log of negative numbers isn't as impossible as zero, at least.  In fact, log(-122) is equal to 2.08635983 + 1.36437635*i*.

But, having complex values in a regression model is probably something to avoid (for now, anyway).  The easiest way to deal with that was to just take the absolute value of the longitudes.  It's totally fine to do this because:
* all of the houses are in approximately the same longtitude.  I don't have to worry about getting -122 (122 West) mixed up with 122 (122 East) because none of the houses are anywhere close to 122 degrees East.
* the graph of log(x) is symmetric to the graph of log(-x), just reflected over the y-axis.

Here's my code:
```

maybe_log_columns=king_co_train.drop(['id','date','price','zipcode'],axis=1) #getting a list of the possible predictor columns

maybe_log_columns['long']=abs(maybe_log_columns['long']) #taking the absolute value of the longitude column

for column in maybe_log_columns: #graphing all of the variables with and without taking the log of their values
    fig=plt.figure()
    ax1=fig.add_subplot(121)
    ax2=fig.add_subplot(122)
    maybe_log_columns[column].hist(label=column,ax=ax1)
    column_log=np.log(maybe_log_columns[column]+1)
    column_log.hist(label=column +' log',ax=ax2)
    ax1.set_title(column)
    ax2.set_title("Log of " + column)
```

When I went to take the log of the variables, I realized that it might not be the right decision for every column so I wanted to compare their before/after graphs to see if taking the log actually made them more normal or not.  (Actually, I didn't think about this until I tried taking the log of everything and finding out that my model sucked.  Then I went back and was a little more intentional about my choices.)

These are (some of) the graphs I got from my code.

First, here's an example of one that benefited from the transformation:
![](https://i.imgur.com/2PD7erj.png)

And here's one that didn't benefit:

![](https://i.imgur.com/NmkJ13C.png)

And here's one that was worse off:

![](https://i.imgur.com/s9nS8Wc.png)

The ones that got more normal were `sqft_living`, `sqft_lot`, `sqft_above`, `sqft_living15`, and `sqft_lot15` so I transformed those.  Anything that didn't benefit or actively got worse was not transformed.

Being more intentional with my transformations did end up helping my model and the R-squared value got higher. Funnily enough though, only one of those transformed variables (`sqft_above`) actually ended up in my final model.

* **Square foot of living space**:  This got removed because it was highly correlated (r >0.75) with several other variables in the dataset.  It was highly correlated with the number of bathrooms, the non-basement square footage of the house (`sqft_above`), and the mean square footage of its nearest 15 neighbors (`sqft_living15`).  It was also pretty closely related to the grade.  All of those other variables (aside from `sqft_living15`) ended up in my final model.
* **Square footage of the lot**, of the **nearest 15 neighbors' lots**, of the **nearest 15 neighbors living spaces**:  These were all close to being included in my final model and could actually have been included but the increase of complexity wasn't worth the tiny boost to the adjusted R-squared value.

I realize that most of the variables that ended up in my final model aren't transformed - some of them are standardized but the shape of their distributions are the same.  In future projects, I'd like to figure out more transformations I could use and when it's appropriate and useful to do so.  I think I enjoy thinking about transformations because it's a very math-y part of this whole process and that's where I feel most comfortable right now.  It'll be interesting to see how things change over the next few months.

extension: markdown


text:
# VulnerabilityTypePackageIssue

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**affected_location** | [**VulnerabilityTypeVulnerabilityLocation**](VulnerabilityTypeVulnerabilityLocation.md) | The location of the vulnerability. | [optional]
**fixed_location** | [**VulnerabilityTypeVulnerabilityLocation**](VulnerabilityTypeVulnerabilityLocation.md) | The location of the available fix for vulnerability. | [optional]
**severity_name** | **str** | The severity (eg: distro assigned severity) for this vulnerability. | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

repository: bcostlow/client-python

repo_name: bcostlow/client-python


text:
# Code Coverage

While we recommend using one of the free websites available for monitoring code coverage during your continuous integration process, below is an example of how you can incorporate code coverage during the continuous integration process provided by GitHub actions and generate a code coverage report without one of those services.

This `yaml` file will run tests on multiple system configurations, but will produce a code coverage report on only one of those. It will then create a code coverage badge and add it to the README file.

This file should be put in the `.github/workflows` directory of your repo:

```yaml
name: Go  # The name of the workflow that will appear on Github

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:

  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest]
        go: [1.16, 1.17]
    steps:
    - uses: actions/checkout@v2

    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: ${{ matrix.go }}

    - name: Build
      run: go install

    - name: Test
      run: |
        go test -v -cover ./... -coverprofile coverage.out -coverpkg ./...
        go tool cover -func coverage.out -o coverage.out  # Replaces coverage.out with the analysis of coverage.out

    - name: Go Coverage Badge
      uses: tj-actions/coverage-badge-go@v1
      if: ${{ runner.os == 'Linux' && matrix.go == '1.17' }} # Runs this on only one of the ci builds.
      with:
        green: 80
        filename: coverage.out

    - uses: stefanzweifel/git-auto-commit-action@v4
      id: auto-commit-action
      with:
        commit_message: Apply Code Coverage Badge
        skip_fetch: true
        skip_checkout: true
        file_pattern: ./README.md

    - name: Push Changes
      if: steps.auto-commit-action.outputs.changes_detected == 'true'
      uses: ad-m/github-push-action@master
      with:
        github_token: ${{ github.token }}
        branch: ${{ github.ref }}

```

repository: avelino/awesome-go

branch_name: refs/heads/main

gha_language: Go

repo_name: avelino/awesome-go


text:
## gradle-env-plugin

In the groovy world `ConfigSlurper` provides an excellent way of configuring a system for many different environments. Besides it's strong points it falls short on two specific areas:
- Iterating over all defined environments is not possible
- It doesn't allow nesting of environments

This two missing feature lead to the implementation of this plugin.

## Release notes

### Version 1.2

- Hierarchical configuration

The plugin now has the ability to merge configuration with parent project's configuration (in a multi-project build).
This way configuration can be split to multiple config.gradle files, one for each sub-project. Merging is recursive,
it's allowed to have many levels of sub-projects.

- FIX: config file path is now more precise

## Usage

Create a file called `config.gradle` in your project root:

	dbUrl = 'localhost'
	dbUser = 'myuser'
	dbPass = 'mypass'
	dbSchema = 'myschema'
	dbType = 'mysql'
	env {
		prod {
			dbUrl = 'prod.mysystem.com'
			dbUser = 'produser'
			dbPass = 'prodpass'

			env {
				prod1 {
					dbSchema = 'prod1schema'
				}
				prod2 {
					dbSchema = 'prod2schema'
				}
			}
		}
		test {
			dbUrl = 'test.mysystem.com'
		}
	}

Apply the plugin with `apply plugin: 'environment'` and use the `environment` property to access the configuration:

	def envConfig = environment.get('prod:prod1')
	def envConfig = environment.get()		// Defaults

Or you can iterate over all the environment:

	environment.forEach { name, config ->
		println "Configuration for ${name} is: ${config.toProperties()}"
	}

One example of the possible uses is to create dynamic tasks for each environment:

	environment.forEach { name, config ->
		def envName = name.replace(":", "-")

		task "jar-${envName}"(type: Jar) {
			from: mydir
			expand config.toProperties()
		}
	}

In some cases we need to convert the config to a standard Properties format. The ConfigObject defines a method to do this:

	def config = environment.get()
	def p = config.toProperties()

The generated configuration will always contain a key called `env` which contains the name of the environment of that particular instance. This can be useful if you'd like to substitute it filtered/expanded files.

	assert "dev" == environment.get().env

## Override logic

To calculate the configuration for each environment the plugin uses a simple recursive override mechanism.

- Defaults are everything what is defined outside of the top level env {} block
- Environments will will override the defaults if the same key is specified within an environment
- Sub environments will override the parent environment's config

Please note that the configuration is calculated for each environment separately, they won't affect each other !

Taking the example above the calculated configuration for `prod:prod2` will look like this:

	dbUrl = 'prod.mysystem.com'		// defined on parent env level
	dbUser = 'produser'				// defined on parent env level
	dbPass = 'prodpass'				// defined on parent env level
	dbSchema = 'prod2schema'		// override from the actual environment
	dbType = 'mysql'				// default, no overrides

Configuration for the `test` environment is the following:

	dbUrl = 'test.mysystem.com'		// override by the environment
	dbUser = 'myuser'				// default
	dbPass = 'mypass'				// default
	dbSchema = 'myschema'			// default
	dbType = 'mysql'				// default

## Local override

To allow developer specific settings to the configuration without adding them to the main configuration file the developer can create a `local.gradle` file. Certain limitations are applied when using this file:

- Only the `getLocal()` method will read this file
- No environment specification is allowed
- The file specifies overrides over the default configuration (i.e.: only change what you need, everything else will be default)
- The `getLocal()` method will only override for the default environment

The recommended usage is to create a `local.gradle.sample` file within the project and tell developers to copy and rename this file to `local.gradle` to specify their own settings. The resulting `local.gradle` files shouldn't be checked in to the version control system.

## API

To identify a specific environment in the tree the plugin use colon as separator character when specifying nested environments. For example the `prod:prod1` string identifies the `prod1` within `prod` environment.

- `environment.get()`

Returns the default configuration as a `ConfigObject`

- `environment.get(name)`

Returns the configuration as a `ConfigObject` for a given environment name

- `environment.getLocal(name)`

Returns the configuration as a `ConfigObject` for a given environment name.
If no environment specified (using the default) and a `local.gradle` configuration file is present it will be merged with the defaults and returned. This allows developers to use their own settings on top of the defaults.

- `environment.forEach(closure)`

Invokes the given closure with the (name, config) parameters where name is the current environment's name and config is the `ConfigObject` associated with it. Please note that this method will only iterates the leaf environments, because most of the time that's what is really needed. Taking the example above the iterator will call the closure with the following parameters: `[dev, prod:prod1, prod:prod2, test]` Note the missing `prod` environment.

## Properties

Overwrite the following properties to change defaults in the plugin:

	environment.configFile = 'config.gradle'	// Default configuration file
	environment.defaultEnv = 'dev'				// Default environment name

## How is it working ?

Initially the plugin parses the config file using `ConfigSlurper`. A recursive method will visit all environments and create a merged `ConfigObject` for each of them, where merging will always be based on the parent's configuration. Given the recursive nature of the method this will ensure proper merging regardless of how many environments are nested into each other.

The config parsing is lazy, will only happen if the build refers to the environment. (i.e.: for a `gradle tasks` it won't be triggered normally)

## Limitations

- The `environment` key can't be used. (ConfigSlurper is working behind the scenes, the usage of this key would conflict with it's inner mechanism)
- Keys with dots in their names are not tested. At this stage please only use simple strings as keys.

repository: lferenczi/gradle-env-plugin

repo_name: lferenczi/gradle-env-plugin


text:
Open Audio Visualizers for Processing

A set of tools to help build interactive audio visualizers with [processing](https://processing.org), written in Java using the Processing java-applet library with the help of Minim, Ani and the Beads project libraries.

# Getting Started / Docs

Check out the full guide and docs available [at the repo's wiki here](https://github.com/nafeu/oavp/wiki). Documentation is a still a huge work-in-progress and I would greatly appreciate if anyone was interested in helping out :)

# Setup and Installation

- Download and install the [`Processing IDE`](https://processing.org/download/)
- Using the Processing IDE, install the following packages:
  - [`Minim`](https://github.com/ddf/Minim) (for realtime audio analysis)
  - [`Ani`](https://github.com/b-g/Ani) (for tweening and smooth animations)
  - [`Beads`](https://github.com/orsjb/beads) (for time/tempo synced rhythmic operations)
  - You may also need to install the [`Processing Video`](https://github.com/processing/processing-video) package.
- Setup your config.json file in `src/data`. An example file is provided to get you started.

## Using Sublime

- Download and follow the instructions to set up [processing-sublime](https://github.com/b-g/processing-sublime)

```
git clone https://github.com/nafeu/oavp.git [PROJECT_NAME]
cd [PROJECT_NAME]
subl .
```

Open the `sketch.pde` file and use the build command to run the sketch.

`CTRL/CMD + BUILD`

## Using Processing (IDE)

```
git clone https://github.com/nafeu/oavp.git [PROJECT_NAME]
```

Open the `sketch.pde` file in Processing and run it.

## Credits

Nafeu Nasir

## License

MIT

repository: sir-pinecone/oavp

repo_name: sir-pinecone/oavp


text:
---
layout: post
title: SmartStack vs. Consul
---

I am one of the primary authors of Airbnb's SmartStack, which is composed of two pieces: [nerve](https://github.com/airbnb/nerve) and [synapse](https://github.com/airbnb/synapse).
When we released this software, we documented a lot of the reasoning behind it in a [very comprehensive post](http://nerds.airbnb.com/smartstack-service-discovery-cloud/) on service discovery.
I recommend reading that post carefully to understand why we made the design decisions we did.

Recently, I've been getting a lot of questions on how SmartStack compares to [Consul](http://www.hashicorp.com/blog/consul.html), which is an alternative take on service discovery from the amazing guys at [HashiCorp](http://www.hashicorp.com/).
I am excited to see more people taking on this operational challenge.
In general, better service discovery will lead to more available SOA infrastructures, which makes for a better web experience for all web users.
Also, it will lead to a better engineering experience for the people maintaining those SOAs.

Recently, HashiCorp put out [a comparison between Consul and SmartStack](http://www.consul.io/intro/vs/smartstack.html), which gets somethings right but also some things wrong.
This post aims to complement HashiCorp's comparison from my perspective.
Of course, I welcome constructive criticism to the opinions expressed here.

## The Gossip Protocol ##

> Consul uses an integrated [gossip protocol](http://www.consul.io/docs/internals/gossip.html) to track all nodes and perform server discovery.
> This means that server addresses do not need to be hardcoded and updated fleet wide on changes, unlike SmartStack.

This is a fair criticism of SmartStack -- the addresses of the [Zookeeper](https://zookeeper.apache.org/) machines must be statically configured.
Of course, [Serf must also be bootstrapped](http://www.serfdom.io/intro/getting-started/join.html) with at least one existing node to join the cluster.
If all of the bootstrapped nodes you have hard-coded into your configuration management system (like [Chef](http://www.getchef.com/chef/) or [Puppet](http://puppetlabs.com/)) die, new nodes will not be able to join the cluster.

Really, there are two choices here.
The first is statically hard-coding a list of Zookeeper instances and relying on Zookeeper.
The second is static configuration of bootstrapping information for Serf and relying on Serf's [gossip protocol](http://www.serfdom.io/docs/internals/gossip.html).

The gossip protocol is a modified version of [SWIM](http://www.cs.cornell.edu/~asdas/research/dsn02-swim.pdf).
Consul uses this not just for bootstrapping but for propagate ALL information, including the availability information you're trying to discover.
I have many unanswered questions about the gossip protocol.
For instance, in the case of a network partition, it seems like a partitioned-off node will be alternatively marked suspected-down and then back up by different group members.
This may result in a partitioned-off node never leaving the cluster.

In the end, replacing ZooKeeper with Serf may be a viable option for SmartStack.
I would welcome pull requests to [synapse](https://github.com/airbnb/synapse) that use Serf, or maybe Consul, as a [service watcher](https://github.com/airbnb/synapse/tree/master/lib/synapse/service_watcher) instead of [Zookeeper](https://github.com/airbnb/synapse/blob/master/lib/synapse/service_watcher/zookeeper.rb).

## Service Discovery ##

> For discovery, SmartStack clients must use HAProxy, requiring that Synapse be configured with all desired endpoints in advance.
> Consul clients instead use the DNS or HTTP APIs without any configuration needed in advance.
> Consul also provides a "tag" abstraction, allowing services to provide metadata such as versions, primary/secondary designations, or opaque labels that can be used for filtering.
> Clients can then request only the service providers which have matching tags.

The first sentence here doesn't really even make sense.
Sure, Synapse must be configured to discover the services you are going to want to talk to, but you could just as easily configure it to discover ALL of your services.
On the other hand, explicitly specifying which services you are going to want to talk to from which box is extremely useful, because it allows you to build [a dependency graph of your infrastructure](/images/airbnb-infrastructure-oct13.png).
I view this as a benefit, not a drawback.

Another benefit is using [HAProxy](http://haproxy.1wt.eu/#desc) to actually route between services.
Whenever a service inside Airbnb talks to a dependency SmartStack, that service knows nothing about the underlying implementation.
The ability to avoid writing a client (even a simple, HTTP client) for service discovery into each application was a fundamental design goal for us.
If you want a third-party application you didn't write to run on your network and consume Consul information, you must use DNS.
However, DNS is even worse -- when, how, and for how long will DNS resolutions be cached by your underlying libraries or applications?

Instead of insisting on a simple HTTP API, Consul provides you with the ability to do complex tag-based discovery.
It is almost certainly a mistake to utilize these features.
Your infrastructure should aim to be as simple and flat as possible.
A service instance is a service instance, and if it's different then it is a different service!
If you find yourself 6 months in, only talking to instances of service Y which provide property X from some unknown number of clients which have requirement X hardcoded into an HTTP request buried in their codebase, you are going to wish that you hadn't done that.

Finally, HAProxy is an extremely stable, popular, well-tested, well-utilized, fundamental component of the internet which provides amazing introspection.
That we use HAProxy means that synapse and zookeeper can just go away, and your service will keep on working (although it won't get updates about new or down instances).
Using connectivity checks in HAProxy means that we can survive network partitions -- services which remain registered will be taken out of rotation by HAProxy.
Using HAProxy's [built-in load balancing algorithms](http://docs.neo4j.org/chunked/stable/ha-haproxy.html) meant that we didn't have to write them.
Using HAProxy's [built-in status page](http://haproxy.1wt.eu/img/haproxy-stats.png) means we can easily see what's happening on a particular box with that box's service dependencies.
Using HAProxy's logging, we can see a detailed history of communications between services.
And using monitoring tools that scrape and aggregate HAProxy's stats, we can get instant insight into what kinds of load services are seeing, from which kinds of other services.

Many of these advantages can again be gained by configuring synapse to use Consul as a discovery source.
But I strongly feel that synapse/HAProxy combo is better in many ways than Consul, and urge you to consider the benefits I've outlined above.

## Health Checking ##

> Consul generally provides a much richer health checking system.
> Consul supports Nagios style plugins, enabling a vast catalog of checks to be used.
> It also allows for service and host-level checks.

The current list of health checks in nerve is minimal at best, although it's been sufficient for our needs here at Airbnb.
I like the simple model, of nerve doing a direct check on a service from the machine it's running on.
Conceptually, it's easier to wrap your head around.
Why is this box deregistered?
Because it failed it's nerve health check?
Or because Nagios is down or overloaded, or because the application pinged your service to ask to be deregistered and then kept running, or for what other unseen reasons?

Although I would discourage the use of complex health checks, I can see the advantages, and I would welcome PRs to nerve to add better health checking.

## Multi-DC ##

> While it may be possible to configure SmartStack for multiple datacenters, the central ZooKeeper cluster would be a serious impediment to a fault tolerant deployment.

I am not certain that I would want to run a UDP-based gossip protocol across the public internet.
Running a Zookeeper cluster across the public internet is also not an ideal situation.

I think that the correct approach is to provide mostly-local service clusters per datacenter.
A single, global Zookeeper cluster will contain only the list of services that are truly cross-DC (like the front-end load balancers), while most services only talk to services inside their local DC.
Assuming a flat cross-DC topography is setting yourself up for much higher than necessary latency.

Of course, with Consul you could probably configure your services to discover only dependencies tagged with your local datacenter.
But this reaches into the realm of configuration management, and at that point both Consul and SmartStack become equivalent -- a Chef change is a Chef change.

## Summing up ##

I love Hashicorp, and I think Serf is a great idea, implemented well.
I think that from an operations perspective, SmartStack has a bit of an edge on Consul.
I am happy to have the opportunity to engage in dialog like this, and I'm excited about how much easier it's getting all of the time to operate internet infrastructure.
If you have comments, or corrections, please do get in touch!

gha_language: CSS


text:
## Youtube Clone

The purpose  of this project was to utilize the power of React to create small, fast youtube player.The base of the project is built with boiler plates created by Stephen Grider.

The project is broken into two main sections; the main index.js file that compiles all of the information and a components folder which holds each component (i.e search bar, video list, video detail).

Along with the React framework, the project is also utilizes Bootstrap, the Youtube API in order to pull live and active data, the Youtube API NPM package as well as Lobash extention to allow for timed delays between search queries.

Further projects for the app would be primarily to change the aesthetics to mirror the actual Youtube website.

repository: adrianpearman/ReduxSimpleStarter

repo_name: adrianpearman/ReduxSimpleStarter


text:
# Python

> Python is an interpreted, high-level, general-purpose programming language.

* Python - First shown publicly in 1991
* Python **2.0** - Released in 2000
  * List comprehensions, garbage collection, etc.
* Python **3.0** - Released in 2008
  * Major revision and **NOT** completely backward-compatible

> Several versions have been released for each language version (e.g. 2.* and 3.*)

## Latest

** Python **2.7** - The last release in the 2.* series and EOL in 2020
** Python **3.7** - Major release with updates/features continuing to be developed

gha_language: PowerShell


text:
# SignMeUp

[![GitHub release](https://img.shields.io/github/release/signmeup/signmeup.svg)](https://github.com/signmeup/signmeup/releases/latest)
[![Meteor version](https://img.shields.io/badge/meteor-<IP_ADDRESS>-brightgreen.svg)](https://meteor.com)
[![Dependencies](https://img.shields.io/david/signmeup/signmeup.svg)](https://david-dm.org/signmeup/signmeup)
[![Code Climate](https://img.shields.io/codeclimate/github/signmeup/signmeup.svg)](https://codeclimate.com/github/signmeup/signmeup)
[![License](https://img.shields.io/github/license/signmeup/signmeup.svg)](https://github.com/signmeup/signmeup/blob/master/LICENSE)

Real-time application to sign up for and manage TA hours.

## About

SignMeUp is a web application that allows teaching assistants to hold hours and
labs, and students to sign up for them. In essence, it is an online queue.

## Contributing

Contributions are welcome from one and all. Please read [CONTRIBUTING.md](.github/CONTRIBUTING.md)
to get set up. For questions, please email<EMAIL_ADDRESS>
## Team

SignMeUp was originally created by Dhruv Rawat '14, Anamta Farook '14, and
Mohsan Elahi '14 at Brown University. The latest version is being developed by:

| [![Athyuttam Eleti](https://avatars1.githubusercontent.com/u/1485350?v=3&s=160)](http://athyuttamre.com) |
|----------|
| [Atty Eleti '17](http://athyuttamre.com) |

For support, please email the team at<EMAIL_ADDRESS>
## License

MIT © Brown Computer Science, 2015–Present

repository: ali-mir/signmeup

repo_name: ali-mir/signmeup


text:
# yall.js (Yet Another Lazy Loader)

yall.js is a SEO-friendly lazy loader for `<video>` elements as well as CSS background images. It works in all modern browsers. It uses [Intersection Observer](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API) where available. yall.js can also monitor the DOM for changes using [Mutation Observer](https://hacks.mozilla.org/2012/05/dom-mutationobserver-reacting-to-dom-changes-without-killing-browser-performance/) to lazy load elements that have been appended to the DOM after initial load, which may be desirable for single page applications.

yall.js 4 removes lazy loading for `<img>`, `<picture>`, and `<iframe>` elements, as [native lazy loading](https://web.dev/browser-level-image-lazy-loading/) covers these use cases.

To use yall, grab `yall.min.js` (or `yall.min.mjs` if you're the modern sort) from the `dist` directory and slap it on your page. You can also install it with npm:

```shell
npm install yall-js
```

## Usage

This is version 4 of yall.js, and introduces a named export named `yall` rather than a single default export:

```javascript
// Import y'all
import { yall } from "yall-js";

// Invoke!
yall();
```

The above syntax is sufficient if you don't want to pass in any options. [If you _do_ want to specify options](#api-options), you'll need to use a slightly more verbose syntax:

```javascript
// Import y'all
import { yall } from "yall-js";

// Invoke!
yall({
  observeChanges: true
});
```

From there, lazy loading elements depends on _what_ you want to lazy load. Let's take a look at what you can do with it.

### `<video>`

yall.js covers two possible lazy loading patterns for video.

#### Lazy-loading videos intended as replacements for animated GIFs

yall.js can lazy load `<video>` elements intended to [replace animated GIFs with autoplaying videos](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/replace-animated-gifs-with-video/):

```html
<video class="lazy" autoplay loop muted playsinline>
  <source data-src="video.webm" type="video/webm">
  <source data-src="video.mp4" type="video/mp4">
</video>
```

The pattern is largely the same as it is with `<picture>`, only the `lazy` class is applied to the `<video>` element. **Tip:** If you're embedding videos that _don't_ emulate animated GIFs (i.e., non autoplaying video), it's better to _not_ lazy load them. Instead, use the [`preload` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#attr-preload) to defer loading of video content. Please also note that video autoplay policies can change at any time, meaning your video may not autoplay on some platforms! Such behaviors are not bugs, but rather features designed to respect users' bandwidth and preferences. Filing issues related to video autoplay issues will likely be rejected, as yall.js can't (and won't) override browser policies.

#### Lazy-loading `poster` placeholder images for non-autoplaying video

Sometimes you have video you'd rather not autoplay, such as those with an audio track. Or, perhaps you want to be more considerate of your user's bandwidth (how nice of you). In these cases, the [`poster` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#attr-poster) can be used to load a placeholder image. However, these images can also be rather large, especially if you have a number of videos on the page that use this pattern. You can lazy load `poster` images with the following markup pattern:

```html
<video class="lazy" data-poster="placeholder.jpg" controls preload="none">
  <source src="video.webm" type="video/webm">
  <source src="video.mp4" type="video/mp4">
</video>
```

This pattern is slightly different than the one before it. Because we're not trying to emulate animated GIFs, we've removed a number of attributes from the `<video>` element that aren't necessary in this case:

1. We've done away with the usual `data-src` attribute, and specified `preload="none"` to ensure the browser doesn't preload any portion of the video (which, depending on the browser, can't be guaranteed).
2. To lazy load the `poster` image itself, we specify the image to load in a `data-poster` attribute.
3. The `controls` attribute is added here to allow the user to control video playback.

**Note:** For the sake of your users, don't mix the above markup patterns. If a video is going to use `autoplay` to replace an animated image, lazy loading a placeholder image via `data-poster` isn't necessary. Furthermore, if you're unsure of what to do, _let browsers handle this stuff and don't use yall.js to manage loading of videos at all!_

 This might be useful if you have a very large `background-image` you'd like to defer. Proper use of this feature requires _both_ HTML and CSS. To start, let's say you have a `<div>` that loads a very large masthead `background-image`:

```html
<!-- I bet this loads a giant stock photo! -->
<div class="masthead lazy-bg"></div>
```

The key here is the `lazy-bg` class, which is a class yall.js looks for (and can be changed in the options). When yall.js sees elements with this class, it will remove that class and replace it with a class of `lazy-bg-loaded` (also changeable in the options). From here, it's up to you to author CSS that makes use of this class to swap the image in. Such CSS might look like this:

```css
/* Pre-lazy loading styles */
.masthead {
  background: #e6e6e6; /* A little placeholder color */
  height: 16.66vw;
  margin: 0 0 1rem;
}

/* BAM! Lazy loaded! */
.masthead.lazy-bg-loaded {
  background: url("masthead.jpg");
}
```

This works because, unlike HTML which loads most resources regardless of their visibility, CSS loads resources only if the current layout builds a CSSOM which includes them. That means if your document's style tree changes later on to request a background image, the browser will fetch it the moment the change is applied. Leaning on this behavior is more sensible than using a mess of `data-` attributes pointing to possible image candidates, which could potentially add a bunch of extra markup and introduce edge cases that are difficult to code for.

## What about users without JavaScript?

Slap on some `<noscript>`:

```html
<!-- A `<video>` example: -->
<video class="lazy" preload="none" autoplay loop muted playsinline>
  <source data-src="video.webm" type="video/webm">
  <source data-src="video.mp4" type="video/mp4">
</video>
<noscript>
  <video preload="none" autoplay loop muted playsinline>
    <source src="video.webm" type="video/webm">
    <source src="video.mp4" type="video/mp4">
  </video>
</noscript>

<!-- A `<video>` example: -->
<video class="lazy" preload="none" autoplay loop muted playsinline data-poster="img/video-poster.jpg">
  <source src="video.webm" type="video/webm">
  <source src="video.mp4" type="video/mp4">
</video>
<noscript>
  <video preload="none" autoplay loop muted playsinline poster="img/video-poster.jpg">
    <source src="video.webm" type="video/webm">
    <source src="video.mp4" type="video/mp4">
  </video>
</noscript>
```

Then place a `no-js` class on the `<html>` element:

```html
<html class="no-js">
```

Finally, add this one line `<script>` before any `<link>` or `<style>` elements in the document `<head>`:

```html
<!-- Remove the no-js class on the <html> element if JavaScript is on -->
<script>document.documentElement.classList.remove("no-js")</script>
```

Normally, this script will remove the `no-js` class from the `<html>` element as the page loads, but if JavaScript is turned off, this never happens. From there, you can add some CSS that hides elements with a `class` of `lazy` when the `no-js` class is present on the `<html>` element:

```css
/* Hide .lazy elements if JavaScript is off */
.no-js .lazy {
  display: none;
}
```

To see all these examples in action, clone the repo, install packages, run `npm test`, and check out the demos on your local machine at [http://localhost:8080](http://localhost:8080).

## API options

When you call the main `yall` initializing function, you can pass an in an options object. Here are the current options available:

### `lazyClass`

**default:** `"lazy"`

The element class used by yall.js to find elements to lazy load. Change this is if a `class` attribute value of `lazy` conflicts with your application.

### `lazyBackgroundClass`

**default:** `"lazy-bg"`

The element class used by yall.js to find elements to lazy load CSS background images for. Change this if you'd prefer not to use the default.

### `lazyBackgroundLoaded`

**default:** `"lazy-bg-loaded"`

When yall.js finds elements using the class specified by `lazyBackgroundClass`, it will remove that class and put this one in its place. This will be the class you use in your CSS to bring in your background image when the affected element is scrolled into the viewport.

### `threshold`

**default:** `200`

The threshold (in pixels) for how far elements need to be within the viewport to begin lazy loading.

### `events`
**default:** `{}`

An object of events that get sent directly to [`addEventListener`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener) for each element to be lazy loaded. Rather than building an opinionated, bespoke event management system, this system gets out of your way and lets you to specify whatever events are possible to bind with `addEventListener`. Here's an example below:

```javascript
yall({
  events: {
    // The object key is sent as the first argument to `addEventListener`,
    // which is the event. The corresponding value can be the callback if you
    // don't want to send any options to `addEventListener`.
    load: function (event) {
      if (!event.target.classList.contains("lazy")) {
        event.target.classList.add("yall-loaded");
      }
    },
    // If we want to pass options to the third argument in `addEventListener`,
    // we can use a nested object syntax like so:
    error: {
      // Here, the `listener` member is the callback.
      listener: function (event) {
        if (!event.target.classList.contains("lazy") && event.target.nodeName == "VIDEO") {
          event.target.classList.add("yall-error");
        }
      },
      // The option below is sent as the third argument to `addEventListener`,
      // offering more control over how events are bound. If you want to
      // specify `useCapture` in lieu of options pass a boolean here instead.
      options: {
        once: true
      }
    }
  }
});
```

Events for yall.js are bound at initialization time (often `DOMContentLoaded`). This means that some events _could_ fire multiple times, depending on the event. For instance, in the above `load` event example, you can see that we check for the default class of `lazy` on the element. This is because the `load` event could fire when the initial image placeholder loaded (if one is specified) _and_ when the final image is lazy loaded.

The advantage of this approach is that you can do pretty much anything you want in any of the events on the elements yall.js observes. The disadvantage is that it places the responsibility squarely on you to manage events. If you think yall.js has a bug in this behavior, do your due diligence to research whether your event callback code is buggy before filing issues.

### `observeChanges`

**default:** `false`

Use a `MutationObserver` to monitor the DOM for changes. This is useful if you're using yall.js in a single page application and want to lazy load resources for markup injected into the page after initial page render.

### `observeRootSelector`

**default:** `"body"`

If `observeChanges` is set to `true`, the value of this string is fed into `document.querySelector` to limit the scope in which the Mutation Observer looks for DOM changes. The `<body>` element is monitored by default, but you can confine the observer to any valid CSS selector (e.g., `#main-wrapper`).

### `mutationObserverOptions`

**default:** `{ childList: true, subtree: true }`

Options to pass to the `MutationObserver` instance. Read [this MDN guide](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver#MutationObserverInit) for a list of options. It's very possible that changing this value could result in yall.js failing to lazy load resources that are appended to the DOM later on.

## Words of advice

Unlike previous versions of yall-js, compatibility back to IE 11 is no longer a goal. If you need compatibility with older browsers, install the previous release of yall.js like so:

```shell
npm i<EMAIL_ADDRESS>```

Also, it is not this script's job to minimize [layout shifts](https://web.dev/cls/) for you. [Use appropriate `width` and `height` attributes](https://www.smashingmagazine.com/2020/03/setting-height-width-images-important-again/), styles, and lightweight placeholders for your images.

For `<video>` elements, avoid lazy loading a placeholder with the `data-poster` attribute for autoplaying videos and just use `poster`. On the other hand, _do_ consider lazy loading a placeholder image with `data-poster` for non-autoplaying videos. Or you can opt _not_ to use a `poster` image. Your website, your call.

Also, do _not_ lazy load resources that are likely to near the top of the page—or "above the fold", as it were. Doing so is an anti-pattern in that those resources will not begin loading until yall.js has been loaded, which may take much longer than if those resources were loaded normally. Such a pattern will negatively affect your page's [LCP](https://web.dev/lcp/).

## Contributing

Please read the [contribution guidelines](https://github.com/malchata/yall.js/blob/master/CONTRIBUTING.md). If you think I'm some kind of grumpy crank after reading that, please remember that this is a hobby project you can use for free.


text:
---
title: Properties, Methods and Events
page_title: Properties, Methods and Events - WinForms LayoutControl
description: This article lists the most commonly used properties, methods and events of RadLayoutControl.
slug: winforms/layoutcontrol/properties-methods-and-events
tags: properties,,events,and,methods
published: True
position: 4
previous_url: layoutcontrol-properties-events-and-methods
---

# Properties

|Property|Description|
|------|------|
|__AllowCustomize__| With this property you can disable the customize mode. This way the user will be not able to edit the layout at runtime.|
|__AllowHiddenItems__|By default you can hide the items when you are in customize mode and this can be disabled by setting the property to *false*.|
|__AllowResize__|When this property is set to true the user will be able to resize the control containers at run time – without opening the customize dialog.|
|__Items__|This collection contains the currently added items.|
|__DropDownMenu__|Gives access to the default context menu.|
|__DragOverlayVisible__|Gets a value which indicates if the [drag overlay]({%slug winforms/layoutcontrol/customize-layout-mode%}) is visible.|
|__CustomizeDialog__|Gives you access to the customize dialog instance. You can use it to assign custom dialog as well.|

## Methods

|Method|Description|
|------|------|
|__AddItem__|Adds item to the layout. You can directly pass an item or a control instance.|
|__RemoveItem__ |Removes an item. You can pass the item or the contained control as parameter.|
|__HideItem__|Hides an item, you can pass the item or the contained control as parameter.|
|__ShowCustomizeDialog__|Shows the customize dialog.|
|__CloseCustomizeDialog__|Closes the customize dialog.|
|__GetAllItems__|Returns IEnumerable collection of all the items. With the parameter you can include or exclude the hidden ones. This includes items nested within groups or tabbed groups.|
|__FindItemByControl__|Returns the item in which specific control is hosted in.|

## Events

|Event|Description|
|------|------|
|__StructureChanged__|Fires when the item position in the control is changed.|

## RadLayoutControlGroupItem Events

|Event|Description|
|------|------|
|Expanded|Occurs when the group item is expanded.|
|Collapsed|Occurs when the group item is collapsed.|
|Expanding|Occurs when the group item is about to be expanded.|
|Collapsing|Occurs when the group item is about to be collapsed.|

# See Also

* [Properties](https://docs.telerik.com/devtools/winforms/api/telerik.wincontrols.ui.radlayoutcontrol.html#propertiesm)
* [Methods](https://docs.telerik.com/devtools/winforms/api/telerik.wincontrols.ui.radlayoutcontrol.html#methods)
* [Events](https://docs.telerik.com/devtools/winforms/api/telerik.wincontrols.ui.radlayoutcontrol.html#events)

repository: telerik/winforms-docs

repo_name: telerik/winforms-docs


text:
---
title: "Can't view saved passwords in Chrome"
layout: post
categories: [browsers]
tags: [chrome, passwords, troubleshooting]
typora-copy-images-to: ../assets/post
---

Ahnii! G'day.

I tried to export my saved passwords from within Chrome and found what appears
to be placeholder text where I expected to see passwords. Observe my
[chrome://settings/passwords]:

{% include image.html src="/assets/post/chrome-saved-passwords.png" alt="Screenshot of Chrome settings with 'Saved passwords will appear here' message" description="Saved passwords will appear here" %}

## Cause

"Login Data" has become corrupted.

## Solution

To fix we have to allow Chrome to regenerate "Login Data".

1. Locate "Login Data" file
2.  Backup and remove "Login Data"
4. Start Chrome
5. Verify you can now view passwords
6. Jump for Joy :)

### 1. Locate "Login Data" file

In Chrome, type "chrome://version" into the address bar:

![chrome-version-profile-path](../assets/post/chrome-version-profile-path-1591453390495.png)

### 2.  Backup and remove "Login Data"

```bash
mkdir -p ~/.local/backups
mv
```

### 4. Start Chrome

repository: jonesrussell/blog

gha_language: HTML

repo_name: jonesrussell/blog


text:
This document is meant to help people who want to contribute to Makeup.

# High Level Architecture

## What Makeup Is

The goal of Makeup is to take up something plain, and turn it into something pretty.
The previous sentence is only the first of probably many puns about makeup.

Makeup takes as argument a string representing source code,
and returns some data that contains the highlighted source code.

Currently, Makeup only supports HTML output (actually HTML + CSS + a little Javascript).
In the future it might support other kinds of output.

It's made up of three parts:

  * The *Lexer*, which turns the raw source code into a list of tokens.
    There must be a lexer per programming language.
  * The *Formatter*, which turns the list of tokens into something else
    (what exactly is format dependent).
  * The *Styles*, which control the output of the Formatter.

The main goal of having syntax highlighting is to make the code more understandable
for a *human* audience.
As discussed above, there is no need to actually parse the raw source into a valid AST.
This allows us to make lots of simplifications regarding what exactly to parse,
and which kinds of tokens we recognize.

## What Makeup Is Not

Makeup is not a static code analyzer.
As an analyzer, Makeup is very shallow and only cares about the surface details of your code.
The goal here is to make the code pretty to humans, not to gain any deep insights.

Makeup is not a general-purpose language parser.
If it helps you write a better lexer, by all means implement a parser
for the language in question so that you can lex it better,
but in general it's probably not really worth it.

Makeup is not a tool to hyperlink your source code.
While such tools might be built on top of Makeup, it's not the original goal.

# Lexers

The *Lexer*, turns the raw source code into a flat list of tokens.

## Tokens

A token has the following type:

```elixir
{atom(), Map.t, String.t}
```

The token format was inspired by the format of the elixir AST node.

  * The *first* element of the 3-tuple is the type of token.
    Makeup supports a limited type of tokens.
    The supported token types are documented in the
    [Makeup.Token.TokenTypes](https://hexdocs.pm/makeup/Makeup.Token.TokenTypes.html) module.
    Although you can specify token types as atoms, the
    [Makeup.Token.TokenTypes](https://hexdocs.pm/makeup/Makeup.Token.TokenTypes.html) module
    defines a number of macros that expand into the correct atoms.
    Using these macros whenever possible is good practice, because it protects you
    from typos. Macro names will be checkes at compile times, unlike atoms, which
    might give rise to errors that will only be visible at runtime
    or may even remain undetected.
    In some places, like pattern matching in function heads,
    you won't be able to use the macros.
    In those cases, just use the corresponding atom.

  * The *second* element is a map, containing some metadata about the token.
    Some formatters can make use of the metadata in order to improve the output.
    The only piece of metadata currently used by the formatter is the `group_id` key.
    It's used to mark delimiters as belonging to the same group, so that they are both
    highlighted when the user places the mouse cursor on top of one of them.

  * The *third* element is the literal string containing the text that forms the token.
    The concatenation of the strings from all the tokens
    is equal to the contents fo the raw string used to generate the tokens.

For example, the following are valid tokens:

  * `{:name, %{}, "a"}` - represents the variable `a`

  * `{:string_double, %{}, "\"A String\""}` - represents a literal string

  * `{:number_integer, %{}, "17"}` - represents the number `17`

This token format was inspired by the format of the Elixir AST nodes.

## Improving an Existing Lexer

Current lexers are not necessarily written for efficiency.
There are probably lots of opportunities to profile the lexers and increase performance.
Although performance is important, being correct is the highest priority.
When faced between the choice between being fast or being correct,
we must always choose being correct.

Some concrete suggestions:

  * I the Elixir lexer, replace `alt([lit("word1"), lit("word2"), ...])`
    with the `symbols()` parser and a `ExSpirit.TreeMap`.

  * Write some utilities that make it easier to embed `ExSpirit.TreeMap`s
    inside parsers defined with `defrule`

## Writing a New Lexer

Makeup lexers use the excellent ExSpirit parsing library be default.
Writing an ExSpirit parser is not a requirement to write an Elixir lexer.
As said above, a lexer is just a module that contains a function that turns
the raw source code into a list of tokens.

You can write your lexer in any way you want.
You may use a different parsing library, a custom tokenizer, or even something like Regexs.
On the other hand, by doing so you won't be making use of the combinators defined by Makeup.
And ExSpirit is probably the best general-purpose parser available on Elixir.

Because a Lexer is just a module that exports a certain function,
there is no need for your parser to output the final token stream.
You can process the token stream any way you want, as long as the format is the same.
For example, the current Elixir lexer iterates over the identifiers
in the token list to highlight some keywords such as `if`, `when` and `defmodule`.

A new lexer should make an effort to match delimiters such as parenthesis when appropriate.
Such matched delimiters can be highlighted when the user places the mouse cursor
on top of one of the delimiters.
This makes it easy to visualize which part of the code is surrounded by the delimiters.
This is not a hard requirement for a new lexer, of course, but it's probably
quite easy to implement for almost every language.

TODO: Describe the most important parsers.

### Aside: A Parser? Why not Regexes? The're simpler...

Can't I just use a Regex-based lexer like normal people?

Well, you can if you really want to.
But Regexes are very weak, and clearly not enough to lex most programming languages.
Most Regex-based lexers (like those employed by Pygments) are actually state machines
with arbitrarily deep stacks with state transitions driven by Regex matches.
This is equivalent to a stack-based automaton, which allows these lexers
to support arbitrary levels of nesting.

This is good enough to reasonably tokenize most programming languages,
but it's much more low level than ExSpirit.
ExSpirit allows you to define possibly recursive rules
and handles the state transitions itself, probably with better performance.

It's easy to port a Pygments lexer into Elixir, and sometimes they are shorter.
The hardest part is actually to extract the rules from the Regex-driven state machine.

# Formatter

## Improving an Existing Formatter

The HTML formatter probably doesn't need many improvements.

## Writing a New Formatter

Some formatters that would be interesting to have:

  * HTLM Formatter with inline CSS styles (the default one uses CSS classes)
  * (La)TeX Formatter
  * Formatter suitable for use in terminals

While lexers will remain in separate packages for the foreseeable future,
I think formatters should be available on Makeup itself.
You can of course write your own formatters tailored to your projects.

# Style

## Improving an Existing Style

While existing styles could use some improvements, you're probably better off
writing and contributing new ones.

## Writing a New Style

Writing a style is easy.
A style is just an Elixir module that can be converted into a CSS stylesheet.
If you prefer, you can write the CSS stylesheet directly for your application,
but for now, Makeup will only accept styles written as Elixir modules.

It's possible that in the future there will be a macro that generates an
Elixir module at compile-time from a CSS stylesheet.
It's probably not too hard to write a simple CSS parser and interpreter using ExSpirit.

# Writing Documentation

## Improving Makeup's Documentation

This document is a work in progress.
Educating people so that they can contribute (especially new lexers) is a priority.
A tool such as Makeup depends ond the work of many people, as no one is proeficient
in all the programming languages Makeup might have to highlight.

Also, at the moment, the options recognized by the lexers are not documented properly.
Currently only the Elixir lexer recognizes options.

## Improving ExSpirit's Documentation

Makeup lexers depend on ExSpirit.
The ExSpirit docs are somewhat lacking at the moment.
Teaching people how to use ExSpirit is important if we want to encourage new contributions.

# Adoption and Marketing

Increasing the adoption of Makeup is desirable, because not only it enhances
the readability of code examples in the wild, but it might bring new contributors.
New contributors bring new lexers, which bring higher adoption, which brings new contributors.
This is a virtuous cycle we must encourage.

repository: ShalokShalom/makeup

repo_name: ShalokShalom/makeup


text:
# # InstitutionalOwnershipInfo

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**cik** | **string** | Investor's company CIK. | [optional]
**name** | **string** | Firm's name. | [optional]
**put_call** | **string** | put or call for options. | [optional]
**change** | **float** | Number of shares change. | [optional]
**no_voting** | **float** | Number of shares with no voting rights. | [optional]
**percentage** | **float** | Percentage of portfolio. | [optional]
**share** | **float** | News score. | [optional]
**shared_voting** | **float** | Number of shares with shared voting rights. | [optional]
**sole_voting** | **float** | Number of shares with sole voting rights. | [optional]
**value** | **float** | Position value. | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

repository: Finnhub-Stock-API/finnhub-php

gha_language: PHP

repo_name: Finnhub-Stock-API/finnhub-php


text:
# GRC-Netdata
Netdata charts for Gridcoin

# Prereqs

Install 'jq'

# Installation guide

* This has only been tested on Ubuntu
* This script assumes you've setup your fullnode using [the autonode script](https://github.com/gridcoin-community/Autonode/blob/master/GridcoinAutoNode.sh), and have created the 'grc' alias for running the Gridcoin client under the 'gridcoin' user.
* You need to install [Netdata](https://github.com/firehol/netdata/wiki/Installation) (remember the pre-req section too).
* Once netdata has been installed, place the stats.sh script somewhere memorable and run it using the command "source ./stats.sh >/dev/null 2>&1 < /dev/null &"
* Place the 'gridcoin.chart.sh' script into the "/usr/libexec/netdata/charts.d/" folder, and provide it full executable permissions "chmod +x gridcoin.chart.sh"
* Edit the file "/etc/netdata/charts.d.conf" and set both 'enable_all_charts="yes"' and 'gridcoin="yes"'
* Execute "killall netdata" then "netdata"
* Navigate to IP:19999 and your Gridcoin charts should be shown!

# Screenshot

![Screenshot](https://i.imgur.com/UZjKQE5.png)

# Got ideas/suggestions for improvements?

Please do raise a GitHub issue, bonus points for pull requests!

repository: nethershaw/GRC-Netdata

repo_name: nethershaw/GRC-Netdata


text:
---
title: Google Brain
date: 2021-03-07T09:33:43+05:30
lastmod: 2021-03-07T09:33:43+05:30
author: SUMAIYA
avatar: /img/Avatar_F.png
# authorlink: https://author.site
cover: /img/GoogleBrain_26/1.png
images:
- /img/GoogleBrain_26/1.png
tags:
  - Google
  - AI
draft: false
---

In the contemporary era, we all are revolved around the mobile phone, internet, youTube google, facebook, etc. Particularly, ***Google*** . It is an American multinational technology company that pursue in internet - related services and products. But, one question appears in human mind, " Where does all that sort of stuff comes in google ? " Is google have also brain like us? Yes, google brain is a deep learning artificial intelligence research team at google platform. It was founded by ***Andrew Yan -Tan Ng ( bristish born computer scientist)*** in the early year of 2010's at Mountain View, California.

<!--more-->

> ![1](/img/GoogleBrain_26/1.png)

##	History behind Artificial Intelligence

Google Brain project began in 2011, as a part -time research collaboration between google fellow Jeff Dean , Google researcher Greg Corrado,and standford university professor Andrew Ng . Google brain commence as a Google'X' project and became so successful that was graduated back to google.

It was founded as an academic discipline in 1955. In October 2016,the google brain work upon an experiment concerning the encryption of  communication artificial intelligence demonstrated by machines, unlike the natural intelligence displayed by humans and animal which involve consciousness 𝘢𝘯𝘥 passionate.

The conventional Intention of artificial intelligence Include learning ,reasoning, planning knowledge representation , perception , natural language processing, ability to proceed and manipulate objects.

Particularly, in the tedious  year of covid -19  period we all are confine in our home, Everything was lock, no student able to go their institution ( schools & colleges) ,people are not able to do their jobs , everyone Became depressed, desaponted. But, besides all these obstacles ,government has left  new ray of hope , they launch the notion of online teaching for students and work from home for doer.

> ![3](/img/GoogleBrain_26/3.png)

But students after doing online classes,how they can judge themselves that they will understand  particular concepts  or,not .

Artificial intelligence is a techniques which examine the students. . It can created by any particular institution ,they create their own website on Al . This site have lakhs and lakhs concpts, question, etc are available which helps students lot. In this, teacher create test for students to examine what they learn Judge them.

- Artificial intelligence works on 24*7 without interruption and has no downtime  .
- it  Facilitates decision - by making the process faster and Smarter.

### Disadvantages
- High cost
- unemployment
- no improvement with experience.

At last but not least  I conclude that artificial intelligence and technology are product of both facts and myths. The notion of google brain could think and perform tasks just as human intelligence. "𝘈𝘴 𝘢𝘳𝘵𝘪𝘧𝘪𝘤𝘪𝘢𝘭 𝘪𝘯𝘵𝘦𝘭𝘭𝘪𝘨𝘦𝘯𝘤𝘦 𝘪𝘴 𝘵𝘰𝘰𝘭, 𝘯𝘰𝘵 𝘵𝘳𝘦𝘢𝘵. "

repository: ietebits/ecrire

repo_name: ietebits/ecrire