text:
static-site-builder
===================

Create static site with templates and mock data.

Integrated with grunt, support:

* Freemarker templates compilation
* Less and coffee-script support
* Watch file changing and livereload
* Output project files with grunt build

## Start

```
git clone https://github.com/ijse/static-site-builder.git
cd static-site-builder
grunt server
grunt build
```

## Description

`/mocks` folder:

```
module.exports =[{
  view: "/simple.ftl",
  out: "/index.html",
  data: {
    name: "ijse"
  }
}];
```

 - view: template file relative to `/templates`
 - out: output html file
 - data: mock data to the template

`/templates` folder: contain template files

## License

(The MIT License)

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

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

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: ijse/static-site-builder

repo_name: ijse/static-site-builder


text:
# grunt-config-files [![Build Status](https://travis-ci.org/rterekhov/grunt-config-files.svg?branch=master)](https://travis-ci.org/rterekhov/grunt-config-files)

> Grunt plugin that generates config files from their templates.

## Getting Started

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```
$ npm install grunt-config-files --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-config-files');
```

## Overview

This is a solution for situation where your project needs several versions of configuration files for different environments. The solution is based on files and may be applied in any kind of projects. The grunt and this plugin are used just for generating config files from templates and a set of settings files.

The plugin uses `grunt.template.process` for the templating. It is very lightweight and doesn’t have any dependencies.

## Config task
_Run this task with the `grunt config` command._

Task options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.

### Options

#### settingsFile
Type: `String`
Default: `'settings.js'`

Path to the file with configuration settings.

#### templateFiles
Type: `Array`
Default: `['**/*.template']`

Paths to the configuration file templates to be processed.

#### logSettings
Type: `Boolean`
Default: `true`

Log configuration settings being used in templates.

#### logTemplateFiles
Type: `Boolean`
Default: `true`

Log all found configuration file templates.

## Setting files

Setting files are ordinary nodejs JavaScript files that export object with configuration settings. You may have as many setting files as you need by using suffixes in the file names: `settings.js`, `settings.default.js`, `settings.test.js`, `settings.prod.js`, `settings.common.js` etc. The `settings.js` file is used when no suffix is given in the task. The `settings.default.js` file is used for creating `settings.js` file when it is missing.

## Template files

Configuration file templates are used instead of real configuration files. The templates use placeholders `<%= value %>` for the values that should be different in the different environments.

For more details and examples, see the [documentation for the `_.template()` method](http://lodash.com/docs#template).

## Usage example

Having the configuration files:
```
├── app.config.template
└── config
    ├── settings.common.js
    ├── settings.default.js
    ├── settings.prod.js
    └── settings.test.js
```

Use the following plugin options:
```js
config: {
    options: {
        settingsFile:    'config/settings.js',
        templateFiles:  ['app.config.template'],
        logSettings:      true,
        logTemplateFiles: false
    }
}
```

Generate configuration file with:
```
$ grunt config
```
This command will create `settings.js` file (if it missing) from `settings.default.js` and then process configuration template with the settings from this file.

You can also generate configuration file with the following commands:
```
$ grunt config:default
$ grunt config:test
$ grunt config:prod
```
In this case `settings.js` is not created but rather `settings.default.js`, `settings.test.js` or `settings.prod.js` are used directly.

Generated configuration file `app.config` and `settings.js` should not be tracked by source control.

File `.gitignore`:
```shell
# Track config file templates instead of real config files
/app.config

# The file will be created from 'settings.default.js' when missing
/config/settings.js
```

Since `settings.js` is not tracked, the file may be adjusted for current development needs. The file will not be overridden when you run `grunt config` task. It is just created from `settings.default.js` when it missing.

Settings defined by an ordinary JavaScript file.

File `config/settings.common.js`:
```js
module.exports = {
    user: {
        name: 'Administrator',
        email<EMAIL_ADDRESS>    }
};
```

You may process and override settings in any way you like. Put, for example, common settings in a separate file like `settings.common.js` and then import them from another settings file. Use `deep-extend` module to easy add new or override existing settings.

File `config/settings.test.js`:
```js
var deepExtend = require('deep-extend');

var commonSettings = require('./settings.common');

module.exports = deepExtend(commonSettings, {
    user: {
        email<EMAIL_ADDRESS>    },
    connection_string: 'test_connection_string'
});
```

The configuration file template contains placeholders instead of the values itself.

File `app.config.template`:
```xml
<config>
    <name><%= user.name %></name>
    <email><%= user.email %></email>
    <connection_string><%= connection_string %></connection_string>
</config>
```

license: MIT

repository: rterekhov/grunt-config-files

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: rterekhov/grunt-config-files


text:
---
layout: post
title: "CSS stuff: All on the <table>"
comments: true
---

### Styling tables

Tables are an incredibly useful tool for displaying data. Your users will want their data displayed in a readable manner, and doing so requires a different approach from styling something like a `div`. Below I've gone over some basic fundamentals for how to control borders and create spacing in tables using HTML and CSS.

#### Border spacing

One of the first decisions to make when styling a table is to think about how you want your borders to stack. The `border-collapse` property controls this stacking behavior.

The values that `border-collapse` takes are:

1. `collapse` - collapse border widths to not stack
2. `separate` (default) - border widths will stack up
3. `inherit`

Having borders that don't stack means that if you create a border around a table element such as a `td`, another `td`'s border width won't be added to the computed total width of the adjacent border (where the two borders meet).

However, one interesting effect you can make use of if you keep the default value `border-collapse: separate` is that you can use `border-spacing`.

> `border-spacing` - determines space between borders. Only usable with `border-collapse: separate`

Here's an example of a table making use of `border-spacing`:

```css
table {
  border-collapse: separate;
  border-spacing: 4px;
}
table,
th,
td {
  border: 1px solid #cecfd5;
}
```

![](/assets/table-border-spacing.png)

[Codepen](http://codepen.io/shayhowe/pen/geoAh) and original [source](http://learn.shayhowe.com/html-css/organizing-data-with-tables/)

The `table` selector creates an outer border, while the `th, td` selectors make up the inner cell borders.

#### Styling borders (rows)

When styling a table you often want to create a unbroken border. However barring certain resets, the example below will not create a continuous bottom-border for a row.

```css
table {
  border-collapse: separate;
}
th,
td {
  border-bottom: 1px solid #cecfd5;
  padding: 10px 15px;
}
```

It will probably have spaces in between the `td`s like this:

![Screenshot showing white space between table cells](/assets/table-cell-spaces.png)

To create a continuous bottom border either:

- Change to `border-collapse: collapse` or
- Add `border-spacing: 0px`

Some resets include both (i.e Code Pen reset option), although some advise just using the `border-collapse: collapse` method.

**`tr` borders**

If you use `border-collapse: collapse`, you can now apply borders to `tr` elements.

#### Spacing with table cells

**text-indent**

`th` and `td` are `display: table-cell` elements, and therefore [cannot take a margin](https://developer.mozilla.org/en-US/docs/Web/CSS/margin) (`tr` can't either)

Solutions:

1) Use `text-indent` for pixelated control over text spacing in a `td` or `th`.

2) Creating dummy/spacer `td`, like this

```html
  </tr>
    <td class="spacer"></td>
    <td>
      <dl>
        <dt>Saturated Fat</dt>
        <dd>1g</dd>
      </dl>
    </td>
    <td>5%</td>
  </tr>
```

```css
tbody tr .spacer {
  width: 20px;
  border-top: none;
}
```

The second option is useful if you want get rid of a top border

#### Overriding table cell spacing

If you want to place two elements closer than normal table cell boundaries allow, such as this screenshot below...

![Two elements sitting close and inline off to the left in a table row](/assets/table-wrapped-sample.png)

I've found that you're in for a challenge using standard just `td` and `th` elements. Basic table markup like below makes it difficult to move the `td` elements because they are relatively fixed in place.

```html
<tr>
  <td>Total Fat</td>
  <td>8g</td>
  <td>12%</td>
</tr>
```

![Example HTML for a basic table](/assets/table-basic.png)

What are we to do? Using `colspan` with these elements doesn't seem to work.

```html
<tr>
  <th scope="row" colspan="2">
  <td>Total Fat</td>
  <td>8g</td>
  </th>
  <td>12%</td>
</tr>
```

This code above renders like this:

![Bad table element html](/assets/table-error.png)

Some trickery with `dl` causes the `dl` to be rendered over two `col`s.

```html
<tr>
 <th scope="row" colspan="2">
  <dl>
    <dt>Total Fat</dt>
    <dd>8g</dd>
  </dl>
 </th>
 <td>12%</td>
</tr>
```
![Two elements sitting close and inline off to the left in a table row with inspector open](/assets/table-wrapped-inspector.png)

##### Centering images in a table element

Finally, it's helpful to know that `text-align: center` will center an image in a table cell.

![Centered image in a td](/assets/table-img-center.png)

*Uncited examples are mostly adaptations from the excellent curriculum at [LaunchSchool](https://launchschool.com), an online school for developers.*


text:
# Krashna Musika Website

A prototype for the Krashna Musika site, built with React and Gatsby.js.

## Installation

To get started, you'll need the [Node.js environment](https://nodejs.org) and the [Yarn package manager](https://yarnpkg.com). Once you have those installed, run the following commands from the root directory of this repo:

```bash
yarn
yarn global add gatsby-cli
```

## Running

To run a development server (with live-reloading), run:

```bash
gatsby develop
```

To build a production bundle, run:

```bash
gatsby build
```

repository: kandreadis/krashna-site

repo_name: kandreadis/krashna-site


text:
# Knowledge Repo

[![PyPI](https://img.shields.io/pypi/status/knowledge-repo.svg)]()
[![license](https://img.shields.io/github/license/airbnb/knowledge-repo.svg)]()
[![PyPI version](https://badge.fury.io/py/knowledge-repo.svg)](https://badge.fury.io/py/knowledge-repo)
[![Python](https://img.shields.io/pypi/pyversions/knowledge-repo.svg?maxAge=2592000)](https://pypi.python.org/pypi/knowledge-repo)
[![Build Status](https://github.com/airbnb/knowledge-repo/actions/workflows/main.yml/badge.svg)](https://github.com/airbnb/knowledge-repo/actions)
[![PyPI downloads](https://static.pepy.tech/personalized-badge/knowledge-repo?period=total&units=international_system&left_color=black&right_color=brightgreen&left_text=total%20downloads)](https://pepy.tech/project/knowledge-repo)
[![PyPI monthly downloads](https://static.pepy.tech/personalized-badge/knowledge-repo?period=month&units=international_system&left_color=black&right_color=brightgreen&left_text=downloads/month)](https://pepy.tech/project/knowledge-repo)

## About the Knowledge Repo
The Knowledge Repo project aims to streamline the sharing of knowledge among data scientists and other technical roles
by utilizing data formats and tools that are commonly used in these professions. Our platform offers various options for
storing and managing "knowledge posts", with a focus on utilizing notebooks (such as R Markdown and Jupyter/IPython
Notebook) to better promote reproducible research.

## Content Submission Options
### 1. Github Integration:
Easily submit your posts in markdown format directly through Github. Our platform will automatically
detect and publish your new content in a timely manner.

### 2. Built-in Editor:
Utilize our user-friendly editor to compose and upload your posts in various formats including Jupyter Notebook, R
markdown, and Google document link. We securely store your content on our internal storage for easy access and management.
Users can make updates, delete, share, and add comments to their posts after publishing.

## Getting Started
- #### [**Installation Instruction**](http://knowledge-repo.readthedocs.io)
- #### [**Hosted Live Version**](https://www.knowledge-repo.com)
- #### [**Source**](https://github.com/airbnb/knowledge-repo)
For more information about the motivation and inspiration behind this project, we encourage you to read our
[Medium Post](https://medium.com/airbnb-engineering/scaling-knowledge-at-airbnb-875d73eff091).

## Contact
- [**Bug reports**](https://github.com/airbnb/knowledge-repo/issues)
- **Ask us questions**
  - [**Knowlegde-repo Slack**](https://join.slack.com/t/knowledgerepogroup/shared_invite/zt-1oxlql877-R_WUl5qGWVOt3EMs9iRKZQ)
  - **Email**<EMAIL_ADDRESS>
## Screenshots

| Name                                              | Screenshot(s)                                                                                |
|---------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|
| [Feed](https://www.knowledge-repo.com/feed)       |                                                                                |
| [Example Post](https://www.knowledge-repo.com/post/example%2Fexample_md.kp)       |  |
| [New Post](https://www.knowledge-repo.com/create)       |  |
| [Post Form](https://www.knowledge-repo.com/edit?proxy=true)       |  |
| [Stats](https://www.knowledge-repo.com/stats)       |                               |

repository: airbnb/knowledge-repo

gha_language: Python

repo_name: airbnb/knowledge-repo


text:
# v2.0.0

 - Added support for Kafka 3.1.0.
 - Breaking change introduced for metrics exported to AWS CloudWatch.
 - Upgraded Docker base image to use Java 17.
 - Upgraded all dependencies caused by migration from SBT (v0.13 to v1.6), and Scala (v2.11 to v2.13).
 - Moved team name (ownership) to 'Buffalo' in Docker / Pierone. Images are now published to `registry-write.opensource.zalan.do/buffalo` instead of `registry-write.opensource.zalan.do/machina`.

# v1.3.0

 - Added support for filtering CloudWatch metrics.
 - Added support for configuring AdminClient in KafkaSettings.
 - Added support for specifying root log level via Java options.

# v1.2.0

 - Added support for Kafka 2.2.0.
 - Improved DataDog metric name format (reducing redundancy with metric tags).

# v1.1.0

 - Added improved application health checks.

# v1.0.7

 - Added support for Kafka 2.0.0.

# v1.0.6

 - Added support for Kafka 1.1.0.
 - Added support for connecting to Kafka brokers using authentication.

# v1.0.3

 - Moved team name (ownership) to 'Machina' in Docker / Pierone. Images are now published to `registry-write.opensource.zalan.do/machina` instead of `registry-write.opensource.zalan.do/dougal`.

# v1.0.2

 - Added support for reporting aggregated consumer lag in exported metrics.

# v1.0.1

 - Added support for publishing metrics to Datadog.

# v1.0.0

 - Added support for Kafka 1.0.0.

# v0.3.0

 - Added support for exporting lag metrics to AWS CloudWatch.

# v0.2.1

 - Fixed logging issues.

# v0.2.0

 - Support added for Kafka <IP_ADDRESS>.

# v0.1.0

 - Initial release for Kafka <IP_ADDRESS>.

repository: zalando-incubator/remora

gha_language: Scala

gha_license_id: MIT

repo_name: zalando-incubator/remora


text:
# sample_humidity
Sample project for the SW01 sensor that displays humidity data on the OLED

###### Source code

Adapted from this [Hackster Project](https://www.hackster.io/Brittany_Bull/serial-humidity-monitor-7c30d5)


text:
# Sequential
Sequential lets you create sequences of ID numbers, optionally formatted.

## Install

With composer:

    require "errant/sequential": "1.0.*"

## Examples

    $sequencer = new \Sequential\Sequence('tcp://<IP_ADDRESS>:6379');
    $sequencer->reset('test_sequence');
    echo $sequencer->getNextID('test_sequence');

You can also format IDs:

    function padFormat($sequence) {
        return str_pad($sequence, 5, '0', STR_PAD_LEFT);
    }
    echo $sequencer->getNextIDFormatted('test_sequence', padFormat);

repository: errant/sequential

repo_name: errant/sequential


text:
# BMP085
Python library for Bosch BMP085 sensor for Raspberry Pi

## Requirements

 - python-smbus

## Usage

Please check example.py

### Method List

* get_temperature(): _returns temperature in degrees Celsius_
* get_pressure(): _returns pressure in Pascals_


text:
---
title: ' React context '
slug: react-context
date: 2019-10-23
language: english
category: Programming
tags:
  - Hooks
  - React
published: true
description: 'A simple explanation about how the context works in React and how to use context with useContext hook.'
---

# What is react context

The react context api is a way to pass data deeply throughout your app without having to manually pass props down through multiple levels.

# Comparison between the old class way and the useContext way

## The old class way

We have to wrap our content in a `NumberContext.Consumer` and use the render props pattern – passing a function as a child – to retrieve the value and display it.

```jsx
import React from 'react'
import ReactDOM from 'react-dom'

// Create a Context
const NumberContext = React.createContext()
// It returns an object with 2 values:
// { Provider, Consumer }

function App() {
  // Use the Provider to make a value available to all
  // children and grandchildren
  return (
    <NumberContext.Provider value={42}>
      <div>
        <Display />
      </div>
    </NumberContext.Provider>
  )
}

function Display() {
  // Use the Consumer to grab the value from context
  // Notice this component didn't get any props!
  return (
    <NumberContext.Consumer>
      {value => <div>The answer is {value}.</div>}
    </NumberContext.Consumer>
  )
}

ReactDOM.render(<App />, document.querySelector('#root'))
```

## The useContext Way

Call useContext, pass in the context object you got from React.createContext, and out pops the value.

```tsx
// import useContext (or we could write React.useContext)
import React, { useContext } from 'react'
import ReactDOM from 'react-dom'

type NumberValues = {
  number: number
}

// Create a Context
const NumberContext = React.createContext<Partial<NumberValues>>({})
// It returns an object with 2 values:
// { Provider, Consumer }

function App() {
  // Use the Provider to make a value available to all
  // children and grandchildren
  return (
    <NumberContext.Provider value={{ number: 42 }}>
      <div>
        <Display />
      </div>
    </NumberContext.Provider>
  )
}

function Display() {
  const value = useContext(NumberContext)
  return <div>The answer is {value}.</div>
}
```

### Create a Hook for easier access to the value

```tsx
import React, { useContext } from 'react'

type NumberValues = {
  number: number
}

const NumberContext = React.createContext<Partial<NumberValues>>({})

const App = () => {
  return (
    <NumberContext.Provider value={{ number: 42 }}>
      <div>
        <Display />
      </div>
    </NumberContext.Provider>
  )
}

// Hook!
export const useNumber = () => {
  return useContext(NumberContext)
}

function Display() {
  const { number } = useNumber()
  return <div>The answer is {number}.</div>
}

export default App
```

# References

- [How the useContext Hook Works](https://daveceddia.com/usecontext-hook/)
- [useContext(): a React hook that's an obvious win – Frontend Armory](https://frontarm.com/james-k-nelson/usecontext-react-hook)
- [Make useContext Data More Discoverable with Typescript](https://www.fullstacklabs.co/blog/usecontext-data-discoverable-typescript)

gha_language: TypeScript


text:
## Singly Linked List
A singly linked list is a type of linked list that is unidirectional, that is, it can be traversed in only one direction from head to the last node (tail).

## Challenge
it was hard to deal with tests

## Approach & Efficiency
O(n) for str function

## API

## whitebord code06
![](./code06.jpg)

## whitebord code07
![](./code07.jpg)

branch_name: refs/heads/main

gha_language: JavaScript


text:
---
layout: default
---

# 1998-02-24 - Re: Five industry giants propose encryption plan to protect Hollywood

## Header Data

From: sunder<EMAIL_ADDRESS>To: "William H. Geiger III"<EMAIL_ADDRESS>Message Hash: ed20d668df778442844a7a9f41fd05628d8b6e148c127bd4ae04e383ddd312a5

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1998-02-24 00:24:09 UTC

Raw Date: Mon, 23 Feb 1998 16:24:09 -0800 (PST)

## Raw message

```
{% raw  %}From: sunder<EMAIL_ADDRESS>Date: Mon, 23 Feb 1998 16:24:09 -0800 (PST)
To: "William H. Geiger III"<EMAIL_ADDRESS>Subject: Re: Five industry giants propose encryption plan to protect Hollywood
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Oh please.  You could always (for computers anyway) write your own drivers for
video cards and sound cards that not only display stuff, but also save it to
a hard drive as it's being recieved.  Whoop!

 >   >   Date: Thu, 19 Feb 1998 11:13:50 -0800 (PST)
> >   >   From: William Knowles<EMAIL_ADDRESS>> >   >
> >   >   BURBANK, Calif. (February 19, 1998 09:06 a.m. EST
> >   >   http://www.nando.net) -- Five computer and electronics industry
> >giants
> >   >   have agreed on a strategy to prevent people from illegally copying
> >   >   digital movies and music, the Los Angeles Times reported Thursday.
> >   >
> >   >   According to the proposal, high-definition TV sets, personal

> Well I have gone over this in previous posts that right's management
> woun't work against the bootlegers as at some time you have to display the
> raw data to the user. what it will to is make things that much harder for
> the average user.

Exactly, it will probably require the average user to get involved in weird
type in the 5th word of the 6th paragraph on page 60 in volume 6 of your
book and your ssn and your 3rd daughter's birth hour to display.  But once
displayed... it's yours.  Shit, things like Lotus ScreenCam can grab anything
displayed on screen.

--

=====================================Kaos=Keraunos=Kybernetos==============
.+.^.+.|  Ray Arachelian    |Prying open my 3rd eye.  So good to see |./|\.
<EMAIL_ADDRESS>once again. I thought you were      |/\|/\
<--*-->| ------------------ |hiding, and you thought that I had run  |\/|\/
../|\..| "A toast to Odin,  |away chasing the tail of dogma. I opened|.\|/.
.+.v.+.|God of screwdrivers"|my eye and there we were....            |.....
======================= http://www.sundernet.com ==========================

{% endraw %}
```

## Thread

+ Return to [February 1998](/archive/1998/02)

+ Return to "[Information Security <guy@panix.com>](/authors/information_security_guy_at_panix_com_)"
+ Return to "[sunder <sunder@brainlink.com>](/authors/sunder_sunder_at_brainlink_com_)"
+ Return to "["William H. Geiger III" <whgiii@invweb.net>](/authors/william_h_geiger_iii_whgiii_at_invweb_net_)"

+ 1998-02-20 (Sat, 21 Feb 1998 06:11:38 +0800) - [Re:  Five industry giants propose encryption plan to protect Hollywood](/archive/1998/02/1c0cbb8a44705a3e61bba0ac2c4f164363d29db0429f6783179e5cc595ade622) - _Information Security<EMAIL_ADDRESS>  + 1998-02-21 (Sat, 21 Feb 1998 08:38:36 +0800) - [Re:  Five industry giants propose encryption plan to protect Hollywood](/archive/1998/02/56c23ccf7ca7b804c7ef02457057c7682feb7583f26a8a40fb20a0a41e60556e) - _"William H. Geiger III"<EMAIL_ADDRESS>    + 1998-02-24 (Mon, 23 Feb 1998 16:24:09 -0800 (PST)) - Re: Five industry giants propose encryption plan to protect Hollywood - _sunder<EMAIL_ADDRESS>      + 1998-02-24 (Tue, 24 Feb 1998 03:04:15 -0800 (PST)) - [Re: Five industry giants propose encryption plan to protect Hollywood](/archive/1998/02/b5a7bb6ae2040134f2c2700732f620e5ec8f37432649f0447cb4ab34ab3d7764) - _"William H. Geiger III"<EMAIL_ADDRESS>


text:
# Metroplex

More efficient non-autoregressive image modeling inspired by VD-VAE and ViT

- VQ-VAE-based image modeling is currently very popular (e.g. DALL-E). However, it is both computationally inefficient due to the use of discrete bottleneck and extremely slow at sampling due to its autoregressive sampling of discrete latents, the latter of which is especially problematic for audio and video.

- Continuous VAE (e.g. VD-VAE) resolves the latter point but has further space for improvement w.r.t. the former, such as by incorporating the ideas from the SotA models like ViT, which allow to compress a patch of an image into a single timestep of Transformer.

- Metroplex combines continuous VAE and ViT-style compression together. This allows to project the image into smaller resolution to process it more efficiently and decompresses at the final linear layer. Stable end-to-end training without discrete bottleneck is possible thanks to the use of VD-VAE.

This is a research repo to run experiments to show that Metroplex outperforms VD-VAE and to perform architecture optimization and scaling analysis. It is probably hard for other people to use at the current state. Once the experiments are done, more simplified repositories (TF & PyTorch) will be set up to ease any modification or further extension. For more details about Metroplex, please refer to [this paper](https://www.overleaf.com/read/qjrfdgtghsph) (wip).

We have borrowed the data pipeline from [DALLE-mtf](https://github.com/EleutherAI/DALLE-mtf), which was developed by [Sid Black](https://github.com/sdtblck), [Ben Wang](https://github.com/kingoflolz) and a few others.

## Setup

Install the dependencies:
```bash
pip3 install -r requirements.txt
```

Dataset preparation is identical to that of [DALLE-mtf](https://github.com/EleutherAI/DALLE-mtf). Please refer to the link for details.

Runs on TPUs, untested on GPUs but should work *in theory*.
The example configs are designed to run on a TPU v3-32 pod.

To set up TPUs, sign up for [Google Cloud Platform](https://cloud.google.com/), and create a [storage bucket](https://cloud.google.com/storage).

Create your VM through a google shell (`https://ssh.cloud.google.com/`) with `ctpu up --vm-only` so that it can connect to your Google bucket and TPUs and setup the repo as above.

## Training

To run the training, adjust the params in a JSON file of your choice in `configs` to a glob path pointing to a dataset of tfrecords, and adjust image size to the appropriate size, e.g.

```
    "dataset":{
      "train_path":"gs://aran-test/imagenet32/train/*.tfrecords",
      "eval_path":"gs://aran-test/imagenet32/valid/*.tfrecords",
      "image_size":32,
      "tfrecords":true
    }
```

I believe the adjusting the params properly is not easy for the user at this moment. Please wait until this issue is resolved.

Once this is all set up, create your TPU, then run:

```bash
python train.py --tpu your_tpu_name --model json_file_name
```

The training logs image tensors and loss values, to check progress, you can run:

```bash
tensorboard --logdir your_model_dir
```

## TODO

- [x] Test Metroplex
- [x] Add experiments
- [x] Finish `run_experiment.py`
- [x] Add Imagenet-21k for experiments
- [ ] Finish all the experiments
- [ ] Enable decoding (pretty much done, but low-priority as ELBO is a robust indicator of quality as in LM)
- [ ] Build a simple repo streamlined for extension of Metroplex with clear documentation
- [ ] Modify Metroplex for other modalities, such as audio and video

repository: iCodeIN/Metroplex

repo_name: iCodeIN/Metroplex


text:
# todo-list
Vanilla JavaScript Excersise

*ToDo list app:*
- renders list of "todo" items
- has form to add new item to the "todo" list: name and points
- renders sum of done tasks points and all tasks points
- has functionality to mark todo item done (checkbox checked and item name striked through)
- has functionaluty to delete any item from the list (both done and not done)
- persists changes on refresh the page (using LocalStorage)

https://nadyailinskiy.github.io/todo-list/

repository: NadyaIlinskiy/todo-list

repo_name: NadyaIlinskiy/todo-list


text:
# Bootstrapping & managing kubernetes cluster with kops

This guide is for managing k8s cluster on AWS with kops

## Prerequisites

- An account on github (or your preferred git provider) which has the ability to create private repositories. This is needed because terraform state gets pushed to the repository and it should be kept private
- An organization on your preferred git provider. In this guide, we will consider `stackator` as the organization name.
- A jenkins server which is configured with the above git account.

## Step 1: Create a repo to hold git provider config

We manage git state with code as well which we call e.g. `github-as-code`
This is the only repo which is created manually; and all other repo's will be created automatically.
To create and configure this repo, follow the following steps.

- Choose an appropriate Repository name. Recommended naming convention is `{project-name|company-name}-{git-provider}-config` e.g. `stackator-github-config`
- Go to github (or your preferred git provider) and create a private repository with the decided name.
- Add `.gitignore` file with following content

    ```bash
    # Compiled files
    terraform.tfvars
    *.backup
    .terraform
    *.sh
    ```

- Create `Jeknisfile` with following content

    ```bash
    #!/usr/bin/groovy
<EMAIL_ADDRESS>
    def dummy

    terraformValidateAndApply {

    }
    ```

- Create `main.tf` file with following content

    ```terraform
    provider "github" {
        organization = "${var.github_organization}"
        version = "1.2.1"
    }

    terraform {
        required_version = ">= 0.11.8"
    }
    ```

    If you are using a service other than github as your git provider then explore terraform and use correct provider.

- Create `variables.tf` file with following content

    ```terraform
    variable "github_organization" {
        default = "stackator"
    }
    ```

    You should replace `stackator` with your organization name on github (or your preferred git provider).

## Step 2: Create Pipeline to automatically create github repositories

Create a new pipeline in the Jenkins server. Give it an appropriate name e.g `stackator-github-config`. Configure the pipeline type e.g `multibranch`, git credentials, project and the repository name. Specify the build configuration to `by Jenkinsfile` and specify the path of Jenkinsfile which is `Jenkinsfile`.

## Step 3: Configure a git repo for creating cluster using terraform

To manage the infrastructure components needed by kops; we use terraform. Let's create a github repo using terraform to contain all this terraform code.

To create the repo, follow these steps.

- Create a file named `repo-stackator-aws-config.tf` with the following content.

    ```terraform
    module "stackator-aws-config" {
        source         = "github.com/stakater/terraform-module-github.git//modules/repository?ref=1.0.9"
        name           = "stackator-aws-config"
        require_status_checks = true
        enable_branch_protection = true
        enforce_admins = false
        private = true
        description = "Jenkins pipeline to deploy, teardown and upgrade AWS resources"
        topics = ["stakater", "kops", "kubernetes"]
        webhooks = [
            {
            url = "{YOUR_JENKINS_WEBHOOK_URL}",
            events = "push,pull_request"
            secret = "mySecret"
            }
        ]
    }
    ```

    Do replace `YOUR_JENKINS_WEBHOOK_URL` to enable automatic pipeline triggering. The webhooks block can also be removed in case you want to trigger pipelines manually.

- If your webhook works then the pipeline should get triggered automatically and create the repo in your organization.

- Create a role on AWS IAM that will be used to create resources on AWS using terraform. The role should have access to resources that you will be creating. General services allowed should be iam, cloudfront, s3, route53, ec2 etc. This role should be assumable from your jenkins server via trust relationship. Note down the arn of this role. It will be needed later on.
- In the newly created repo add the following files:
  - `.gitignore` with following content

    ```bash
    # Compiled files
    terraform.tfvars
    *.backup
    .terraform
    *.sh
    .idea
    ```

  - `Jenkinsfile` with following content

    ```bash
    #!/usr/bin/groovy
<EMAIL_ADDRESS>
    def dummy

    terraformValidateAndApply {

    }
    ```

  - `main.tf` with following content

    ```terraform
    provider "aws" {
        region     = "eu-west-1"
        assume_role {
            role_arn = "{your_role_arn}"
        }
    }
    ```

This repo is now ready to manage all of your terraform related resources on AWS.

## Step 4: Create cluster using kops

### I) Create s3 bucket to store terraform state of kops cluster

To store the state of kops cluster, you need to create an s3 bucket that will store the state of resources created by kops. To create the s3 bucket, add a file by the name of `stackator-s3-kops-state.tf` with following content

```terraform
module "stackator_s3_kops_state" {
  source = "github.com/stakater/blueprint-storage-aws.git//modules/s3/private?ref=v3.0.0"
  name = "stackator-kops-state"
}
```

### II) Create route 53 hosted zone to be used by kops

In order to build a Kubernetes cluster with `kops`, we need to prepare somewhere to build the required DNS records. In AWS, DNS records are managed by `Route53` hosted zones.
To create a simple Route53 hosted zone, let's create a file `route53-zone-stackator.tf` with following content

```terraform
module "stackator_route53_zone" {
  source = "github.com/stakater/blueprint-utilities-aws.git//modules/route53/public?ref=v0.3.0"
  public_domain = "${var.public_domain}"
  force_destroy = "${var.force_destroy}"
}
```

For different scenarios like assigning a sub domain hosted zone to kops etc, read the detailed `kops` documentation [here](https://github.com/kubernetes/kops/blob/master/docs/aws.md#configure-dns)

### III) Create a repo for kops cluster

Now lets create a new repo for kops cluster that will actually create the cluster. The naming convention should be `{repo-company|project-kops-cluster.tf}`

Create a file named `repo-stackator-aws-config.tf` with the following content.

```terraform
module "stackator-kops-cluster" {
    source         = "github.com/stakater/terraform-module-github.git//modules/repository?ref=1.0.9"
    name           = "stackator-aws-config"
    require_status_checks = true
    enable_branch_protection = true
    enforce_admins = false
    private = true
    description = "Jenkins pipeline to deploy, teardown and upgrade a kubernetes cluster via kops"
    topics = ["stakater", "kops", "kubernetes"]
}
```

It is better not to add a webhook to this repo since the pipeline should be built with parameters and hence the pipeline shouldn't get triggered automatically.

Once this repo is created, create the follwing lines in the created repo

- Create a file named `Jenkinsfile` with following content

    ```groovy
    #!/usr/bin/groovy
    @Library('github.com/stakater/stakater-pipeline-library@master')

    String auth_method_arn = "arn"
    String auth_method_access_key = "access_key"
    String aws_auth_method = ""

    try {
        aws_auth_method = AWS_AUTH_METHOD
    } catch (Throwable e) {
        throw e
    }

    if ( ! (aws_auth_method in [auth_method_arn, auth_method_access_key]) ) {
        error("AWS_AUTH_METHOD must either be 'arn' or 'access_key'")
    }

    String aws_role_arn = ""
    try {
        aws_role_arn = AWS_ROLE_ARN
    } catch (Throwable e) {
        throw e
    }

    if (aws_role_arn == "" && aws_auth_method == auth_method_arn) {
        error("AWS_ROLE_ARN must be specified when auth method is $auth_method_arn")
    }

    String aws_access_key_id = ""
    try {
        aws_access_key_id = AWS_ACCESS_KEY
    } catch (Throwable ignored) {
        aws_access_key_id = ""
    }

    String aws_secret_access_key = ""
    try {
        aws_secret_access_key = AWS_ACCESS_KEY_SECRET
    } catch (Throwable ignored) {
        aws_secret_access_key = ""
    }

    if ( (aws_access_key_id == "" || aws_secret_access_key == "") && aws_auth_method == auth_method_access_key ) {
        error("AWS_ACCESS_KEY and AWS_ACCESS_KEY_SECRET must be specified when auth method is $auth_method_access_key")
    }

    String kopsStateStore = ""
    try {
        kopsStateStore = KOPS_STATE_STORE_NAME
    } catch (Throwable e) {
        throw e
    }

    if (kopsStateStore == "") {
        error("KOPS_STATE_STORE_NAME must be specified")
    }

    String clusterName = ""
    try {
        clusterName = CLUSTER_NAME
    } catch (Throwable e) {
        throw e
    }

    if (CLUSTER_NAME == "") {
        error("CLUSTER_NAME must be specified")
    }

    String clusterConfigFile = ""
    try {
    clusterConfigFile = CLUSTER_CONFIG_FILE
    } catch(Throwable ignored) {
    clusterConfigFile = "cluster.yaml"
    }

    String action = ""
    try {
        action = ACTION
    } catch (Throwable ignored) {
        action = "deploy"
    }

    String sshPubKey = ""
    try {
        sshPubKey = SSH_PUB_KEY
    } catch (Throwable ignored) {
        sshPubKey = ""
    }

    Boolean isDryRun = true
    try {
        isDryRun = IS_DRY_RUN == "true" ? true : false
    } catch (Throwable e) {
        error("IS_DRY_RUN must be specified either true or false")
    }

    numberOfNodesIncludingMaster="4"
    MOUNT_PATH = '/home/jenkins/.ssh'
    awsSudoCommand = ""
    if (aws_auth_method == auth_method_arn) {
        awsSudoCommand = "awssudo -u ${aws_role_arn}"
    }
    dryRunFlag = isDryRun ? "" : "--yes"

        clientsK8sNode(clientsImage: 'stakater/pipeline-tools:v2.0.4') {

            def amazon = new io.stakater.cloud.Amazon()
            def common = new io.stakater.Common()

            stage('Checkout Code') {

                checkout scm
                sh """
                    mkdir -p ${MOUNT_PATH}
                    echo "${sshPubKey}" > ${MOUNT_PATH}/stakater_id_rsa.pub
                """

            }

            container('clients') {
                if (aws_auth_method == auth_method_access_key) {
                    amazon.persistAwsKeys(aws_access_key_id, aws_secret_access_key)
                }

                if (action.equals('deploy')) {

                    stage('Configure Cluster') {
                        sh """
                            ${awsSudoCommand} kops replace -f cluster.yaml --name ${clusterName} --state ${kopsStateStore} --force
                            ${awsSudoCommand} kops create secret --name ${clusterName} --state ${kopsStateStore} sshpublickey admin -i ${MOUNT_PATH}/stakater_id_rsa.pub
                        """
                    }

                    stage('Create Cluster') {
                        sh """
                            ${awsSudoCommand} kops update cluster ${clusterName} --state ${kopsStateStore} ${dryRunFlag}
                        """
                        if (!isDryRun) {
                            sh """
                                ${awsSudoCommand} kops export kubecfg --name ${clusterName} --state ${kopsStateStore}
                            """
                        }

                    }

                    stage('Verify Cluster') {
                        if (!isDryRun) {
                            String count = "0"
                            int tryLimit=100
                            while ((! count.equals(numberOfNodesIncludingMaster)) && tryLimit > 0) {
                                count = common.shOutput """
                                    ${awsSudoCommand} kops validate --state ${kopsStateStore} cluster ${clusterName} | grep "True" | wc -l
                                """
                                sh "echo 'Sleeping for 15 seconds ...' && sleep 15s"
                                println "Try Limits remaining:" + tryLimit--
                            }
                        }
                    }

                    stage('Rolling Upgrade Cluster') {
                        sh """
                            ${awsSudoCommand} kops rolling-update cluster --name ${clusterName} --state ${kopsStateStore} ${dryRunFlag}
                        """

                        if (!isDryRun) {
                            sh """
                                echo '***************KUBE CONFIG**************'
                                echo ''
                                cat \${HOME}.kube/config
                                echo ''
                                echo '"*****************************************"'
                            """
                        }
                    }
                } else if (action.equals('teardown')) {

                    stage('Cluster Teardown') {
                        sh """
                            ${awsSudoCommand} kops delete cluster --name ${clusterName} --state ${kopsStateStore} ${dryRunFlag}
                        """
                    }
                }
            }
        }
    ```

- Next use [stakater kops templates](https://github.com/stakater/kops-cluster-templates) to generate your own kops cluster template and copy it to this repo and name it `cluster.yaml`

### IV) Prepare IAM Role for cluster creation

We will need an aws role to create the cluster. The role should have administrator access i.e

```json
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Statement1",
            "Effect": "Allow",
            "Action": [
                "iam:*",
                "cloudfront:*",
                "s3:*",
                "route53:*",
                "ec2:*",
                "autoscaling:*"
            ],
            "Resource": "*"
        }
    ]
}
```

Now there are two ways to use this IAM role

1. Your jenkins should either be able to assume this role. For this edit trust relationship of this role and specify jenkins role there.
2. Create a programmatic access user and assign the above role/policy to that user. Note down the access key id and password and we will use it later on to access.

### V) Create a pipeline for kops cluster

In Jenkins create a simple pipeline that should execute the above Jenkinsfile. Follow these steps to configure the pipeline.I

- Under general heading select `This project is parameterized` option. Then add the following parameters

    |Key |Type|Default|Description|
    |----|----|-------|-----------|
    |CLUSTER_NAME|string||Name of the cluster e.g test.stackator.com|
    |KOPS_STATE_STORE_NAME|string||The name of s3 bucket e.g s3://stackator-kops-state|
    |CLUSTER_CONFIG_FILE|string|cluster.yaml|The kops config file i.e inside the `stackator-kops-cluster` repo|
    |AWS_AUTH_METHOD|string-options|arn|Auth method to use (either arn or access_key)|
    |AWS_ROLE_ARN|string||AWS Role ARN that should be assumed (must be specified if `AWS_AUTH_METHOD` is `arn`)|
    |AWS_ACCESS_KEY|string||Id of access key to use. (must be specified if `AWS_AUTH_METHOD` is `access_key`)|
    |AWS_ACCESS_KEY_SECRET|string||Secret of access key to use. (must be specified if `AWS_AUTH_METHOD` is `access_key`)|
    |SSH_PUB_KEY|string||Pub key to be used by kops for ssh|
    |ACTION|string-options|deploy|The action to perform (either deploy or teardown)
    |IS_DRY_RUN|Boolean|true|set to true to dry run or false to actually apply the change|

- Under Pipeline heading select `Pipeline script from SCM` under `definition` drop down. Then in `SCM` drop down select `Git`. Add Repository URL and credentials and specify branch.
- Specify the location of `Jenkinsfile` as well if you placed it in a nested folder. For this guide it should be `Jenkinsfile`.

repository: stakater/Playbook

gha_language: Dockerfile

repo_name: stakater/Playbook


text:
# assert

Assertion library for shell scripting.

## Example

```bash
#!/usr/bin/env import
import<EMAIL_ADDRESS>
assert_equal foo bar
# assertion error: foo = bar
```

## API

### `assert $test`

 * `message` - Optional message to print for the assertion failure. Prints the actual test if not specified.

Tests the given expression using bracket notation. This is very similar to the
built in `test` command, except that the an "assertion failed" message is printed
to stderr upon failure.

Returns 0 if the test passes, or 1 if the test fails.

```bash
#!/usr/bin/env import
import<EMAIL_ADDRESS>
assert 1 -eq 2
# assertion error: 1 -eq 2

message="one does not equal two" assert 1 -eq 2
# assertion error: one does not equal two
```

### `assert_equal $actual $expected`

Tests that the the _actual_ value is equal to the _expected_ value. Strings or
numbers may be used interchangeably, since the `=` operator is used under the
hood.

```bash
#!/usr/bin/env import
import<EMAIL_ADDRESS>
assert_equal foo bar
# assertion error: foo = bar
```

### `assert_exit $exit_code $command`

Tests that the given `command` exits with the specified `exit_code`.

```bash
#!/usr/bin/env import
import<EMAIL_ADDRESS>
# Passes
assert_exit 0 true

# This will fail
assert_exit 6 sh -c "exit 7"
# assertion failed: `sh -c exit 7` exited with 0, not 6
```

repository: importpw/assert

gha_language: Shell

repo_name: importpw/assert


text:
---
title: "Finding The Kth Smallest Item In A Binary Search Tree"
excerpt: "In this post we are going to talk about how to find the kth smallest item in a binary search tree."
header:
  overlay_image: /images/code.jpeg
date: 2022-01-13
tags: [Data Structures, Binary Search Tree]
---

In the [previous post]({{ site.baseurl}}/binary-search-tree-lca) we spoke about how we can find the lowest common ancestor between two nodes. In the post we are going to tackle another [LeetCode](https://leetcode.com/problems/kth-smallest-element-in-a-bst/submissions/) problem -- finding the $$ k^{th} $$ smallest element in a binary search tree.

## The Problem

Given the root of a binary search tree, and an integer $$ k $$, return the $$ k^{th} $$ smallest value (1-indexed) of all the values of the nodes in the tree.

## Solution

To find the smallest $$ k^{th} $$ smallest element we need to do an in-order traversal of the tree while incrementing a counter. Once the counter is equal to $$ k $$ then we return the current node. Time complexity of the algorithm is $$ O(h) $$ and space complexity is also $$ O(h) $$. Here is the code:

```csharp
public TreeNode<T> GetKthSmallestNode(int k)
{
    var count = 0;
    return FindKthSmallest(_root, k, ref count);
}

private TreeNode<T> FindKthSmallest(TreeNode<T> node, int k, ref int count)
{
    if (node is null)
    {
        return null;
    }

    var left = FindKthSmallest(node.Left, k, ref count);

    if (left != null)
    {
        return left;
    }

    count++;

    if(count == k)
    {
        return node;
    }

    return FindKthSmallest(node.Right, k, ref count);
}
```

Please note that it is important to pass the `count` by reference (trust me, I got burned once) since we are recursively calling `FindKthSmallest`. Passing it by value throws everything under the bus since the function calls already on the call stack might be holding onto a wrong value.

This is how we find the $$ k^{th} $$ smallest element in a binary search tree. All the code is available on [GitHub](https://github.com/vince-nyanga/data-structures). Till next time, thanks so much for taking your time to read.


text:
---
uid: testcasedata
---

# TestCaseData

The `TestCaseData` class provides extended test case information for a parameterized test, although any object deriving from `TestCaseParameters` may be used. Unlike NUnit 2, you cannot implement `ITestCaseData`, you must derive from `TestCaseParameters`.

[!code-csharp[TestCaseDataExample](~/snippets/Snippets.NUnit/TestCaseDataExample.cs#TestCaseDataExample)]

This example uses the fluent interface supported by **TestCaseData**
to make the program more readable.

**TestCaseData** supports the following properties
and methods, which may be appended to an instance in any order.

* **Explicit()** or **Explicit(string)** causes the test case to be marked explicit, optionally specifying the reason for doing so.
* **Ignore(string)** causes the test case to be ignored and specifies the reason, which is required.
* **Returns** specifies the expected result to be returned from the method, which must have a compatible return type.
* **SetCategory(string)** applies a category to the test.
* **SetDescription(string)** sets the description property of the test.
* **SetName(string)** provides a name for the test. If not specified, a name is generated based on the method name and the arguments provided. See [Template Based Test Naming](xref:templatebasedtestnaming).
* **SetProperty(string, string)**, **SetProperty(string, int)** and **SetProperty(string, double)** apply a named property and value to the test.

license: MIT,zlib-acknowledgement

repository: nunit/docs

detected_licenses: MIT zlib-acknowledgement

gha_language: PowerShell

repo_name: nunit/docs


text:
---
layout: post
title: ColdFusion Builder Released
slug: coldfusion-builder-released
date: 2010-03-22
categories:
- ColdFusion
- ColdFusion Builder
tags:
- Adobe
- Builder
status: publish
type: post
published: true
---

Today is a good day to code.

Adobe have officially released ColdFusion Builder, the ColdFusion specific IDE.

I've been a devoted user of CF Builder for a good few months now after making the switch from Dreamweaver, my old IDE of choice. I must say that I haven't look back since.

Using Builder and the Eclipse workspace layout has drastically increased and improved my overall development in terms of time-management (things just seem quicker in CF Builder), and thanks to the ability to install Flex Builder as a plugin, all of my development can be managed and accessed through the one IDE - no need to switch to multiple applications.

What's the cost?

It's a deal, a steal, the sale of the century - the pricing for CF Builder is actually very impressive.

A copy of ColdFusion Builder will cost $299.00, and with that purchase you also receive a copy of Flash Builder 4 standard edition as part of the package. Two fantastic applications for less than I'd consider one would cost.

Alternatively, purchase a copy of Flash Builder 4 Premium Edition, and your package will include a license for ColdFusion Builder.

Whichever option you choose, you certainly get two amazing products in one package.

I want it

Of course you do.

You can download trial versions of the software applications here:

ColdFusion Builder Trial

Flash Builder 4 Trial

Alternatively, if you're looking to purchase (and you should be, because the products rock), have a look at the ColdFusion Builder purchase options, or speak to Fuzzy Orange, Adobe Resellers in the UK.

Education?

For those lucky enough to be involved in the education sector, as a student, member of faculty or employee, you are able to get free copies of ColdFusion 9, Coldfusion Builder and Flash Builder 4 from https://freeriatools.adobe.com/

gha_language: CSS


text:
# Logout

The `logout` component is a small convenience component for a widely used concept in an app, the logout link. Often this action sits in a menu item with other hyperlinks. But a logout is meant as an actionable link rather than a `GET` request. Therefor a `POST` request is better suited. And thus it deserves its own component.

## Installation

The `logout` component comes ready out-of-the-box with Blade UI Kit. Simply [install the package](/docs/{{version}}/installation) and you're good to go.

## Basic Usage

The most basic usage of the component is as a self-closed tag:

```html
<x-logout class="text-gray-500" />
```

This will output the following HTML:

```html
<form method="POST" action="http://localhost/logout">
    <input type="hidden" name="_token" value="...">

    <button type="submit" class="text-gray-500">
        Log out
    </button>
</form>
```

As you can see, the component renders a form to a logout route. It makes use of the named `logout` route of your app by default so make sure you've defined this in your app:

```php
Route::post('/logout', 'AuthController@logout');
```

If you're using the [frontend scaffolding](https://laravel.com/docs/frontend) from Laravel you should already have this route from the `Auth::routes()` call in your `routes/web.php` file.

You might also notice it automatically sets the button label. Behind the scenes the component also uses the `__()` translation helper so you can easily translate the label.

## Customizing

Adjusting either the route or button label can be done by setting the `action` attribute and the slot:

```html
<x-logout :action="route('custom-logout')" class="text-gray-500">
    Sign Out
</x-logout>
```

This will output the following HTML:

```html
<form method="POST" action="http://localhost/custom-logout">
    <input type="hidden" name="_token" value="...">

    <button type="submit" class="text-gray-500">
        Sign Out
    </button>
</form>
```

> Note that when using the slot, the `__()` translation helper isn't applied anymore. This gives you full control over the slotted content should you want to for example, incorporate an icon.

repository: AlexMartinFR/docs

repo_name: AlexMartinFR/docs


text:
# 👷 `worker-template` CORS Preflight

A template for handling CORS preflight requests with Workers.

With this Worker, you can handle [CORS preflight requests](https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request). It passes GET, POST and HEAD requests through to the origin, while OPTIONS requests are answered directly.

[`index.js`](https://github.com/cloudflare/worker-template/blob/master/index.js) is the content of the Workers script.

#### Wrangler
To generate using [wrangler](https://github.com/cloudflare/wrangler)

```
wrangler generate myApp https://github.com/conzorkingkong/cors-preflight-template
```

#### Serverless
To deploy using serverless add a [`serverless.yml`](https://serverless.com/framework/docs/providers/cloudflare/) file.

repository: ConzorKingKong/cors-preflight-template

gha_license_id: NOASSERTION

repo_name: ConzorKingKong/cors-preflight-template


text:
---
layout: default
---

# 1993-12-25 - Random numbers again

## Header Data

From<EMAIL_ADDRESS>(Jeremy Porter)

To<EMAIL_ADDRESS>(cypher)

Message Hash:<PHONE_NUMBER>5415ad4ca448eb388f8d0b8dafcc6e832727ebca18355317e142ef

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1993-12-25 21:16:43 UTC

Raw Date: Sat, 25 Dec 93 13:16:43 PST

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Jeremy Porter)
Date: Sat, 25 Dec 93 13:16:43 PST
To<EMAIL_ADDRESS>(cypher)
Subject: Random numbers again
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Well, I've finished my prototype version of my hardware random number
generator.  According to preliminary work the numbers are truely random and
evenly distributed.  The circuit plugs into the parallel port(bi-directional
mode) and presents 8 bits of data on the data lines.  You can
quickly generate 10k bytes of data with this device.
	I am intrested in hearing from anyone that wishes to take
a look at some data to measure the randomness of the data.  If anyone
is interested I will provide two sets of data, one from my random number
generator and one from a pseudo-random number generator.
	The circuit uses some 555based timers and some RC networks.  A lot
of people will not believe that this circuit is truely random, but it works
out to be, under some conditions.  It boils down using two variable,
independent, periodic functions to generate one bit.  Due to temperature
effects, oscillator stability, circuit noise, and some other factors,
the error in frequency and phase of the two oscillators is larger effect
than the measurable characteristics of the circuit.  In this circuit,
I use the 555 timers as the oscillators (with the restistors and capacitors
determining the frequency).  The second periodic functions is the PC
in a loop polling the parallel port.
	The whole circuit can be built for $5-$10 worth of parts.  It
should also be possible to rig it up as a passthrough device, in case
you don't have an extra parallel port.

--
| Jeremy Porter  -----------------  Dell Computer Corp. ----
| Systems Engineering ---<EMAIL_ADDRESS>--------
|-------------------------------------------------------------
|  Support your Second Amendment rights to encryption technology.

{% endraw %}
```

## Thread

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

+ Return to<EMAIL_ADDRESS>(Jeremy Porter)](/authors/jerry_at_terminus_dell_com_jeremy_porter_)"

+ 1993-12-25 (Sat, 25 Dec 93 13:16:43 PST) - Random numbers again -<EMAIL_ADDRESS>(Jeremy Porter)_


text:
Terraform and Ansible deployment templates
==========================================

This repo contains some generic templates to deploy systems using Terraform and Ansible.

Terraform is used to deploy the systems while Ansible will take care of the configuration of those systems.

Remarks - Terraform
-------------------

* Make sure you set the GOOGLE_CREDENTIALS environment variable to point to your GCP service account key (JSON file) in the host running terraform.
* If using the tkam8/tfansible container on docker hub, make sure that you mount your GCP service account key credentials (JSON file) to /tmp/gcp_creds.json on the container. Terraform is configured to look here for GCP credentials via the GOOGLE_CREDENTIALS environment variable set in the dockerfile of the tfansible container.
* Update terraform/terraform.tfvars to deploy the infrastructure components acordingly (specifically the AllowedIPs to allow access from your public IP to your env). If you want more customization, you may check terraform/variables.tf
* Update terraform/templates/ansible_inventory.tpl file so that you specify the right ansible_python_interpreter for your local environment
* Do *terraform init* / *terraform get* / *terraform plan* / *terraform apply* to deploy your infrastructure
* *terraform output* will give you the relevant public IPs related to your infrastructure.

Remarks - Ansible
-----------------

* ansible/inventory/hosts will be created automatically by Terraform. *vs_ip* in the hosts file is the PRIVATE IP of your BIG-IP.
* Playbooks/group_vars/F5_systems/vars will list the tags to look for to identify the AWS instances to define as pool members. This file is created automatically by Terraform
* Ansible and Terraform are configured to pass IP addresses of upstream endpoints to the AS3 declaration for automating the population of pool member IPs.
* The AS3 declaration can be setup to do *Service Discovery* (OFF by default) to identify the NGINX instances deployed. To do so, AS3 needs to have access to your GCP infrastructure: It needs the base64 encoded private key. Ansible playbook is setup to look for 1 environment variable1: GCP_CREDS_RO. Make sure to setup this environment variables on the device triggering the ansible playbook
* Optionally, you can update ansible/playbooks/group_vars/all file with the location of your private key

  + Once it's done, encrypt the file with the command *ansible-vault encrypt ansible/playbooks/group_vars/F5_systems/f5_vault*
  + Update your ansible roles accordingly if needed.
* You can run *ansible-playbook -i inventory/hosts site.yml --ask-vault-pass*

gha_language: HCL


text:
fork from https://github.com/mzlogin/mzlogin.github.io

启动方式:
```
export SSL_CERT_FILE=~/Downloads/cacert.pem && bundle exec jekyll serve
```

# 启动问题：
1、Liquid Exception: SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate) in /_layouts/page.html

```
Download https://curl.haxx.se/ca/cacert.pem
Add a environment variable SSL_CERT_FILE values /path/to/cacert.pem
export SSL_CERT_FILE=~/Downloads/cacert.pem
```


text:
# SilverStripe Event Management Module

The Silverstripe Event Management Module allows you to model real life events and display them in calendar and list views on your SilverStripe website.

## Features
* Simple recurring event support
* iCalendar based export option allows user to save events to their calendar application of choice
* Responsive calendar and list views for displaying events to users

## Requirements
[`silverstripe/cms: 3.x`](https://github.com/silverstripe/silverstripe-cms/tree/3)

## Installation
### Composer
```bash
composer require quadra-digital/silverstripe-event-management-module
```
### Manual
* Download the code base by either cloning this repository or downloading the provided .zip file
* Name the module directory "event-management"
* Place the module directory in the sites web root (i.e. at the same level as /mysite)
* Run a /dev/build and /?flush=all against the website

## Configuration
* Custom Colours - You can modify the primary and secondary colour definitions in /scss/layout.scss, run `npm install` in the events-management directory, run gulp and voila, colour coded event templates

## Licence
This module uses the BSD 3-Clause license. See the [LICENCE.md](/LICENCE.md) file for the full licence.

## Copyright
Copyright (c) 2016, [Quadrahedron Limited](https://www.quadradigital.co.uk)
All rights reserved.

##Roadmap
### To Do

### Known Issues

## Contact
This module is built by [Quadra Digital](https://www.quadradigital.co.uk) and has been made open source for free, we are unlikly to be able to offer much support however if you have any queries regarding usage, licencing, bugs or improvements please use one of the appropriate contact below.
#### Technical
Joe Harvey <[joe.harvey@quadradigital.co.uk](mailto:joe.harvey@quadradigital.co.uk)>
#### Administrative
Ping Ho <[ping.ho@quadradigital.co.uk](mailto:ping.ho@quadradigital.co.uk)>


text:
# Heat enhancement problem with 10x10 variables

## Software environment

* COMSOL Multiphysics 5.4
* Matlab 2019b
* Python 3.7
    * PyTorch 1.2.0

## Code

* heat.m: MATLAB script to generate a COMSOL file, used to calculate charging time based on given density distribution
* heat_approx.m: MATLAB script to generate a COMSOL file, used to calculate optimal configuration based on MMA ("Approximated" method
  in the paper)

* func_*.m: MATLAB function scripts
    * func_inputs_gen.m: a function to generate input data, i.e., $\rho$ in paper
    * func_outputs.m: a function to calculate output, i.e., reciprocal of charging time, 1/t
    * func_outputs_par.m: a function to calculate output, a parallel version of func_outputs.m
    * func_outputs_withgrad_par.m: a function to calculate output and its gradient w.r.t design variables, with parallel computing
    * func_test.m: a function to evaluate the optimized solution $\hat{\rho}$ from DNN
    * Others are used to plot

* main_*.m: MATLAB code to generate data
    * main_solo.m: code to implement our proposed SOLO algorithm, and generate data in subfolder "data_solo"
    * main_direct.m: code to implement "Direct" algorithm, and generate data in "data_direct.mat"

* plot_*.m: MATLAB code to plot the data
    * plot_b.m: plot figure b
    * plot_c_d_e.m: plot figures c, d, and e
    * plot_s7.m: plot Supplementary Figure 7

* mlopt.py: (abbreviation of Machine Learning and OPTimization) python code to train a Deep Learning Network (DNN) and obtain the
  optimized solution based on the DNN by Bat Algorithm (BA)
* ba.py: python function for Bat Algorithm (BA)

## Data

If you run the code, data will be generated and stored in subfolders:

* data_solo: data generated by the code "main_solo.m" for SOLO

You will also get a file:

* data_direct.mat: data generated by "main_direct.m" for "Direct" method

Data is not uploaded to Github. Please download
from [Google Drive](https://drive.google.com/drive/folders/1f6Xrd9e-RAUsh9vqIqUXbEw8F1_2Qg_5?usp=sharing) or email us.

## How to run

1. Connect MATLAB with COMSOL server
2. Run __heat.m__ by COMSOL to generate __heat.mph__, or download it
   from [Google Drive](https://drive.google.com/drive/folders/1f6Xrd9e-RAUsh9vqIqUXbEw8F1_2Qg_5?usp=sharing)
3. Run __main_solo.m__ and __main_direct.m__
4. Run __heat_approx.m__ by COMSOL to generate __heat_approx.mph__, or download it
   from [Google Drive](https://drive.google.com/drive/folders/1f6Xrd9e-RAUsh9vqIqUXbEw8F1_2Qg_5?usp=sharing)
5. [optional] Run __plot_b.m__ and __plot_s7.m__
6. [optional] Run __plot_c_d_e.m__

As long as a __*.m__ file says `Comsol server required` in the comment at the top, you need to connect the MATLAB with a COMSOL server to run the
file. I recommend adding parameters `-autosave off -np 1 -multi on` (`-autosave off` turns off autosave, `-np 1` sets number of CPU cores of each
server to 1, and
`-multi on` keeps the server after disconnecting COMSOL from MATLAB). You could add to target if you use Shortcut to start the server or to the
command if using command line to start.


text:
## Deploying a Container to Kubernetes

**In this section**, we'll run our first container on Kubernetes. We'll work with a docker image that already has content in it. One of the things that makes containers easy and helpful is you can obtain images with software that's been pre-packaged and ready to run... that simplifies the usual effort to install and configure software.

`NOTE: Your USERID is your namespace`

## Task 1: Deploy an Nginx server

In this section we'll deploy an Nginx web server...

`NOTE: Change the namespace to your USERID in the command`
```
$ kubectl run my-deploy --image=nginx:1.7.9 --port=80 --namespace=userxx

deployment "my-deploy" created
```
You can see what you just deployed by issuing the **get deploy** command.

`NOTE: Change the namespace to your USERID in the command`
```
$ kubectl get deploy --namespace=userxx

NAME        DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
my-deploy   1         1         1            1           1m
$
```
You can see the pod you created issuing the **get pods** command

`NOTE: Change the namespace to your USERID in the command`
```
$ kubectl get pods --namespace=userxx
NAME                         READY     STATUS        RESTARTS   AGE
my-deploy-dbc4b8b5d-krhwh    1/1       Running       0          1m

```

Now we have a container running...we'll need to provide access to the server by creating a [service](https://kubernetes.io/docs/concepts/services-networking/service/) to make a port available.

`NOTE: Change the namespace to your USERID in the command`
```
$ kubectl expose deployment my-deploy  --type=NodePort --namespace=userxx
service "my-deploy" exposed
$
$ kubectl get service --namespace=user99-ns
NAME         TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
kubernetes   ClusterIP      <IP_ADDRESS>       <none>        443/TCP          1d
my-deploy    LoadBalancer   <IP_ADDRESS>    <pending>     80:30839/TCP     1m

```

The port is open, so the nginx server should be available... now, we'll use the ip of the cluster, and the port we've exposed to access the server.

`NOTE: Use http to access your app (NOT https)`

Then we can assemble the url as http:// + [icp master ip] + ":" + [port assigned by the service].
If the ip address for the master of our cluster is <IP_ADDRESS> then we should use http://<IP_ADDRESS>:30839 to access our new Nginx server.

You can either use the browser or the curl command below. Both should work!

`Note: The master ip address is the ip address you used to log into the console, not the ip address listed in the previous command.`

```
$ curl http://<IP_ADDRESS>:30839
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>

...
</html>
```

## Task 2: Scale the Nginx deployment and test its resilience

The server is deployed, but what if we get a lot more traffic than we expected? Fortunately we can manage more instances of our Nginx pods to handle the additional traffic. We'll use the kubectl client to scale our deployment so it has 5 copies running instead of just one.

`NOTE: Change the namespace to your USERID in the command`

```
$ kubectl scale deploy my-deploy --replicas=5 --namespace=userxx
deployment "my-deploy" scaled
```

`NOTE: Change the namespace to your USERID in the command`

```
$ kubectl get deploy --namespace=userxx
NAME        DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
my-deploy   5         5         5            5           58s

```

You should now see 5 instances of your pod running

`NOTE: Change the namespace to your USERID in the command`
```
$ kubectl get pods --namespace=userxx
NAME                         READY     STATUS    RESTARTS   AGE
my-deploy-6fd857889c-8pm6x   1/1       Running   0          50s
my-deploy-6fd857889c-ht7pv   1/1       Running   0          1m
my-deploy-6fd857889c-kkx5k   1/1       Running   0          50s
my-deploy-6fd857889c-nmccq   1/1       Running   0          50s
my-deploy-6fd857889c-xqvqz   1/1       Running   0          50s

```

Our workloads on Kubernetes are quite resilient if we let the system handle things for us. Let's see how resilient our workload is by deleting a few pods!

`NOTE: Change the namespace to your USERID in the command`

`NOTE: Change the pod NAME to match any one of your pods`

```
$ kubectl delete pod my-deploy-6fd857889c-xqvqz --namespace=userxx
pod "my-deploy-6fd857889c-xqvqz" deleted

```
The pod is deleted as you requested... but a new pod has been created in its place! Best of all... the service continues to keep track of all the appropriate pods and route network traffic to them as soon as they're available.

```
$ kubectl get pods --namespace=userxx
NAME                         READY     STATUS        RESTARTS   AGE
my-deploy-6fd857889c-8nvf5   1/1       Running       0          12s
my-deploy-6fd857889c-8pm6x   1/1       Running       0          3m
my-deploy-6fd857889c-dzwlf   1/1       Running       0          12s
my-deploy-6fd857889c-ht7pv   1/1       Running       0          4m
my-deploy-6fd857889c-kkx5k   1/1       Running       0          3m
my-deploy-6fd857889c-xqvqz   0/1       Terminating   0          3m
```

## Task 3: Update the pod with a new version of the software

It's great that the system scales now... but what happens when we have new versions of our software to deploy? To do that we can simply update the existing deployment and tell it that there's a new version of the image currently in use that should be rolled out.

```
$ kubectl set image deployment/my-deploy my-deploy=nginx:1.9 --namespace=userxx
deployment "my-deploy" image updated

```

When we tell kubernetes that our deployment needs to update a new container image it terminates the old versions while rolling out the new version, and ensures that the service will re-route traffic to the proper pods.

```

$ kubectl get pods --namespace=userxx
NAME                         READY     STATUS        RESTARTS   AGE
my-deploy-6fd857889c-8nvf5   0/1       Terminating   0          17m
my-deploy-6fd857889c-8pm6x   0/1       Terminating   0          20m
my-deploy-6fd857889c-dzwlf   0/1       Terminating   0          17m
my-deploy-6fd857889c-ht7pv   0/1       Terminating   0          21m
my-deploy-6fd857889c-kkx5k   0/1       Terminating   0          20m
my-deploy-857bc7b484-4j684   1/1       Running       0          11s
my-deploy-857bc7b484-mx75q   1/1       Running       0          12s
my-deploy-857bc7b484-phfct   1/1       Running       0          10s
my-deploy-857bc7b484-ttspq   1/1       Running       0          13s
my-deploy-857bc7b484-w27c2   1/1       Running       0          13s

```

To validate that the proper pod is running, do a 'describe' on the deployment or one of the pods and see what image is currently in use...

Let's save the results of our deployment, just in case we want to recreate it

```
kubectl get deployment my-deploy -o=yaml --export --namespace=userxx > ./apache-deploy.yaml
```
You can now view the YAML file on your local machine to ensure that it was updated to the new version

Now that we've gotten a bit of a feel for working with Kubernetes we can clean up and move on to the next thing!

```
$ kubectl delete deployment my-deploy --namespace=userxx
deployment "my-deploy" deleted

```

---


text:
# Oscar Winner Prediction based on Wikipedia Page Views and User Reviews

Project for EECS 6895 Spring 2016, that explores data collection, feature extraction, and training of binary classifiers for prediction of Best Picture Award winners among nominees.

More information is available for id 201605-32 at the [final project workshop website](http://www.ee.columbia.edu/~cylin/course/bigdata/workshop/May2016/).

repository: Sapphirine/oscar-winner-prediction

repo_name: Sapphirine/oscar-winner-prediction


text:
# ThePessimist

[![Build Status](https://travis-ci.org/turboMaCk/thepessimist.svg?branch=master)](https://travis-ci.org/turboMaCk/thepessimist)

Light-weight UNIX style argv option parsing with depression. [Optimist](https://www.npmjs.com/package/optimist) alternative with purer white-list oriented API.

![Grumpy cat](http://campusriot.com/wp-content/uploads/2014/10/grumpycat.jpg)

## Why?

Parsing command line arguments is an essential part of many programs. Yet I haven't found any suitable existing library.
Using `process.argv` is not enough so everybody ends up writing some parsing layer on top of it.
[Optimist](https://www.npmjs.com/package/optimist) is now deprecated and its API is way too over complicated.
[Minimist](https://www.npmjs.com/package/minimist)'s API is hard to work with since it parse types dynamically.
More importantly the basic idea behind ThePessimist is it's using **defaults** as **whitelist** for passed arguments and forces you to keep convention of having full named version beginning with `--` and short one with `-`.
The idea is to be defensive to everything which comes from *the cruel outside world* and to bring conventions over unnecessary options.
**White-listing by defaults** makes it also much easier to reason about values you're passing around your application.

[![ScreenShot](http://img.youtube.com/vi/27nNSocP7Dc/0.jpg))](https://www.youtube.com/watch?v=27nNSocP7Dc)

## Instalation

As you expected:

```
npm install --save thepessimsit
```

## Example

Open your favorite Emacs and create simple `index.js` file

```javascript
var thePessimist = require('thepessimist').default;

var defaultValues = {
  positive: false,
  negative: true,
  list: ['one', 'two'],
  single: 'thing'
};

var shortcutMappings = {
  p: 'positive',
  l: 'list',
  s: 'single'
};

var settings = thePessimist(defaultValues, process.argv, shortcutMappings);

console.log(settings);
```

then from your terminal you can play with settings:

```
node index.js --single hi
{
  positive: false,
  negative: true,
  list: ['one', 'two'],
  single: 'hi'
}

node index.js -p --negative -l just
{
  positive: true,
  negative: false,
  list: ['just'],
  single: 'thing'
}

node index.js --positive --nonsense
{
  positive: true,
  negative: true,
  list: ['one', 'two'],
  single: 'thing'
}
```

Pretty straight forward, don't you think?

**See that types are garantees to stay same as in defaults. All extra arguments are not accepted which adds some extra security.**

### Supported Options Types

There are three types of options supported - booleans, stringsa and Arrays of strungs.

#### Booleans (Toggables)

Boolean options have no values. You can define default value to both `true` or `false`. Passig that option from terminal then toggle default value (`true => false` or `false => true`).

#### Strings

Single string values are defined in defaults like `single: 'b'`. If value with spaces is passed as arg, this value will become string with spaces `--single with space` => `{ single: 'with space'}`.
If value is not passed like `--single` value becomes `undefined`.

#### Arrays of strings

If default value is array, spaces are used as separator for its items like `--arr one two 3` => `{ arr: ['one', 'two', '3'] }`.
If value is not pased, it's parsed as empty array like `--arr` => `{ arr: [] }`.

## Limitations

I've decided to not support numeric values parsing. Numbers are always parsed as string so you can always handle retyping by yourself.
If you try to pass defaults object containing numeric value it throws an exception. This means you have to define numbers as string also in defaults and deal with retyping later.

## Development

Source code is written in Typescript to make it easier for people who want to use this with typescript.
Anyway you do not have to has typescript globally installed in order to be able to compile this project by yourself.

First install all dependencies:
```
npm install
```

then you're able run tests:
```
npm test
```
doing so should not create any diff in git besides your changes in ts files

If you want to create new build just run:
```
npm run build
```

This will compile JavaScript files from typescript.

## License

The MIT License (MIT)
Copyright (c) 2016 Marek Fajkus

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

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

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

repository: turboMaCk/thepessimist

repo_name: turboMaCk/thepessimist


text:
# UFOs

 The goal of the project was to present a provided json file of UFO data and create an HTML interface to filter the data. Using JavaScript, I wrote a couple functions for the data to be presented in a table and, using D3 to listen for filter clicks, allow users to filter the date. In the HTML code, Bootstrap was used to format the information and set up the presented table along with the filter button. Bootstrap elements were also used to customize the header and create a navigation bar. Another step for the site would be to clean the comment field for formatting or look at including a scraping function to have more current data available.

Project for UC Berkeley Data Analytics Boot Camp.

### Tech Used
- JavaScript
- HTML
- Bootstrap
- VS Code

#### Sample of table
![table](/static/images/table.png)

repository: caznoe/UFOs

repo_name: caznoe/UFOs


text:
# Encryptior .net App

This is .net implementation of the wallet which can be used to buy/sell encrypted files via encryptior.com
It contains of the app source code.

### Prerequisites

.NET Framework 4.5
Project was built with VS2015. You'd probably need that version or higher.

### Installing

Once you start the solution, you need to download packages... In theory just building the application should download everything and start the app.
If this doesn't work then install them manually, or by using "nuget.restore".

## Running the tests

I know...

## Pre-Built packages

You can add your own installer project. There is a pre-built version available here : [https://www.encryptior.com/#downloads](https://www.encryptior.com/#downloads)

## License

This project is licensed under the MIT License - see the [licence.txt](licence.txt) file for details

repository: Encryptior/EncryptiorDotNetApp

repo_name: Encryptior/EncryptiorDotNetApp


text:
---
layout: default
---

# 1996-07-19 - Re: Surf-filter lists

## Header Data

From: "Vladimir Z. Nuri"<EMAIL_ADDRESS>To: "Declan B. McCullagh"<EMAIL_ADDRESS>Message Hash: fd76f68f87d76e084fcc8d8d27f5cb308269731ced6382dfd4b2af5a81131d1a

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-07-19 00:20:19 UTC

Raw Date: Fri, 19 Jul 1996 08:20:19 +0800

## Raw message

```
{% raw  %}From: "Vladimir Z. Nuri"<EMAIL_ADDRESS>Date: Fri, 19 Jul 1996 08:20:19 +0800
To: "Declan B. McCullagh"<EMAIL_ADDRESS>Subject: Re: Surf-filter lists
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

>
>L.D. fails to say why NOW and gay history sites and gun rights sites and
>EFF and LPF and SAFE @ MIT and HotWired should be blocked.

absolutely no reason is necessary. when a parent says to their
child, "because I said so", what recourse does that child have?
the service is doing the equivalent of this, and will be appropriate
for and appeal to the many parents who raise their children in this
authoritarian manner.

a company does not have to give reasons. as TCM just wrote, people
will vote with their cash. the ultimate determinant is if the company
is profitable under a capitalist system. they could have ex-nazi's
doing the filtering, and if they are making money even when their
customers know about it, what's the problem?

now, Meeks is doing a valuable public service in *informing* the
public of criteria customers may be interested in they may
not have been previously aware of (to the minor extent that
he did so in an objective way). however, they
are the ones to make the decision. they may decide that they
like the whole idea of secrecy. the market is deciding as we
speak. the article is in a sense part of this decision-making
process. your own opinion is not irrelevant-- I have never said
that. it's a nice additional perspective.
I'm only saying its a small factor and you're awfully
presumptuous to think everyone (esp. those that use the services)
feels the same way about a lot
of subjective material as you do.

McCullagh, have you thought out your position at all on this? all the
responses I have gotten from you show you haven't put much thought into the
matter and are quite caught off guard by my fairly basic points.

let me ask you: Yahoo *routinely* rejects zillions of URLs
submitted to them. an equally emotional article could be written
that highlights their editorial decisions in borderline cases.
"Yahoo rejected a link to [x]!!! that's censorship!!!". please
figure out what you are and are not opposed to, and have a
clearcut stand. don't you see the amazing similarity between
rating services and Yahoo? what, in principle, is the difference?
your own arbitrary opinions?

 He also fails
>to understand that Brock and I both wrote the article.

the article is ambiguous about who wrote what.  It's clearly
Meeks writing style. I give you credit for whatever research you
contributed. if I were you I would not want to be associated
with that particular article however <g>

> He finally fails
>to understand that CyberPatrol's categories are anything but clear.

I don't recall the service you were picking apart in particular, but
I thought Meeks ranting over the "monkey with his eye poked out"
as not necessarily "gratuitous depictions of violence" was a real
big lose position for himself.  the categories may be clear enough
for the *customers*, i.e. parents, and that's all that matters. you
can rant all you want, but if people are paying money and continue
to do so in spite of your objections, where does that leave the
validity of your opinion?

{% endraw %}
```

## Thread

+ Return to [July 1996](/archive/1996/07)

+ Return to "[Damaged Justice <frogfarm@yakko.cs.wmich.edu>](/authors/damaged_justice_frogfarm_at_yakko_cs_wmich_edu_)"
+ Return to "[David Sternlight <david@sternlight.com>](/authors/david_sternlight_david_at_sternlight_com_)"
+ Return to "["Declan B. McCullagh" <declan+@CMU.EDU>](/authors/declan_b_mccullagh_declan_at_cmu_edu_)"
+ Return to "["Vladimir Z. Nuri" <vznuri@netcom.com>](/authors/vladimir_z_nuri_vznuri_at_netcom_com_)"

+ 1996-07-16 (Tue, 16 Jul 1996 22:11:20 +0800) - [Surf-filter lists](/archive/1996/07/8a57c9df32a2f589fd54de7ae1df6ad26feecbbdf61471b705f6091713087413) - _Damaged Justice<EMAIL_ADDRESS>  + 1996-07-17 (Wed, 17 Jul 1996 23:17:56 +0800) - [Re: Surf-filter lists](/archive/1996/07/bfc47cc9e824cbd50bf07580960db558abbd0cbb1710e2c89742dade2f7ddacd) - _David Sternlight<EMAIL_ADDRESS>  + 1996-07-18 (Thu, 18 Jul 1996 09:47:02 +0800) - [Re: Surf-filter lists](/archive/1996/07/6102c0a300a0439ac1574b3fb108d2dd6ba14088186332da0f530b4acd31d20a) - _"Vladimir Z. Nuri"<EMAIL_ADDRESS>    + 1996-07-18 (Thu, 18 Jul 1996 12:53:15 +0800) - [Re: Surf-filter lists](/archive/1996/07/02ca9744432fdd7dd01433988d57ba5ebde483cb551344ff1532b330a6e97878) - _"Declan B. McCullagh"<EMAIL_ADDRESS>      + 1996-07-19 (Fri, 19 Jul 1996 08:20:19 +0800) - Re: Surf-filter lists - _"Vladimir Z. Nuri"<EMAIL_ADDRESS>


text:
# Logical comment
- `phplint`
- `phplint-disable`
- `phplint-enable`
- `phplint-disable-line`
- `phplint-disable-line`
- `phplint-disable-next-line`

## Disabling Rules with Inline Comments

To temporarily disable rule warnings in your file, use block comments in the following format:

```php
<?php
/* phplint-disable */

echo "foo";

/* phplint-enable */
```

You can also disable or enable warnings for specific rules:

```php
<?php
/* phplint-disable noEcho, useNamespace */

echo "foo";

/* phplint-enable noEcho, useNamespace */
```

To disable rule warnings in an entire file, put a `/* phplint-disable */` block comment at the top of the file:

```php
<?php
/* phplint-disable */

echo "foo";
```

You can also disable or enable specific rules for an entire file:

```php
<?php
/* phplint-disable noEcho */

echo "foo";
```

To disable all rules on a specific line, use a line comment in one of the following formats:

```php
<?php
 echo "foo";// phplint-disable-line

// phplint-disable-next-line
echo "foo";
```

To disable a specific rule on a specific line:

```php
<?php
 echo "foo";// phplint-disable-line NoEcho

// phplint-disable-next-line NoEcho
echo "foo";
```

To disable multiple rules on a specific line:

```php
<?php
 echo "foo"; // phplint-disable-line NoEcho

// phplint-disable-next-line NoEcho
echo "foo";
```

All of the above methods also work for plugin rules. For example, to disable `phplint-plugin-example`'s `rule-name` rule, combine the plugin's name (`example`) and the rule's name (`rule-name`) into `example/rule-name`:

```php
<?php
foo(); // phplint-disable-line example/rule-name
```

**Note:** Comments that disable warnings for a portion of a file tell PHPLint not to report rule violations for the disabled code. PHPLint still parses the entire file, however, so disabled code still needs to be syntactically valid JavaScript.

repository: DragorWW/phplint

branch_name: refs/heads/develop

gha_language: PHP

repo_name: DragorWW/phplint


text:
# Day 1- Getting Setup

## Goals
* Setup an RSA key for sshing into the class server
* Clone the class git repository to both your server account
* Test out terminal functionality in RStudio

### Logging into the class server

Due to security reasons this will be a live demo in class.

### Setting up an RSA key

#### OS X
First, check to make sure you don't already have one
`ls -a ~/.ssh`

Make sure that there is nothing that looks like: `id_rsa` or `id_rsa.pub`

##### If you do already have one
* Run the command `cat ~/.ssh/id_rsa.pub` and copy the contents.
* Once the key is copied, log into the server using your password and navigate to: `~/.ssh`
* Then, enter `nano authorized_keys`
* Copy the contents into the window
* Hit CTL+X to exit and save.  Press Y to confirm. Then hit enter.

##### If you do NOT already have one
If there is not, then generate a new key:

`ssh-keygen -t rsa`

Just hit enter when it asks for a passphrase:

`Enter passphrase (empty for no passphrase):`

Hit enter again to confirm.

Now, you can copy your key to the server.  Let's pretend the user name on the server is ged.

`ssh-copy-id<EMAIL_ADDRESS>-p 22`

You should see somthing like this:
```
The authenticity of host '131.XXX.XXX.X' can't be established.
RSA key fingerprint is XXXXXXXXXX.
Are you sure you want to continue connecting (yes/no)?
```
Enter yes, and you should see the following:

```
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
*******************************************
      ______ _______________________      *
      ___  //_/___  _/__  __/__  __/      *
      __  ,<   __  / __  /  __  /         *
      _  /| | __/ /  _  /   _  /          *
      /_/ |_| /___/  /_/    /_/           *
                                          *
The population genomics workstation of the*
Puritz Lab of Marine Evolutionary Ecology *
*******************************************

You're begining a shadowy flight into the dangerous
world of loci that might not exist.

You're a young loner on a crusade to champion the
cause of the innocent, the helpless, the powerless
in a world of bioinformatics that operates above the law.

Please be responisble using this shared resource.  Do not use
more than 20 processors or threads, total, per user.

Contact Jon Puritz<EMAIL_ADDRESS>with any issues.

<EMAIL_ADDRESS>password:
```
Enter the password that's on the board and you should be set.

### Windows

I reccomend following the steps in this [LINK](https://docs.joyent.com/public-cloud/getting-started/ssh-keys/generating-an-ssh-key-manually/manually-generating-your-ssh-key-in-windows) through step 8.

>To generate an SSH key with PuTTYgen, follow these steps:

> 1. Open the PuTTYgen program.
> 2. For Type of key to generate, select SSH-2 RSA.
> 3. Click the Generate button.
> 4. Move your mouse in the area below the progress bar. When the progress bar is full, PuTTYgen generates your key pair.
> 5. Type a passphrase in the Key passphrase field. Type the same passphrase in the Confirm passphrase field. You can use a key >without a passphrase, but this is not recommended.
> 6. Click the Save private key button to save the private key. Warning! You must save the private key. You will need it to connect to your machine.
> 7. Right-click in the text field labeled Public key for pasting into OpenSSH authorized_keys file and choose Select All.
> 8. Right-click again in the same text field and choose Copy.

* Once the key is copied, log into the server using your password and navigate to: `~/.ssh`
* Then, enter `nano authorized_keys`
* Copy the contents into the window
* Hit CTL+X to exit and save.  Press Y to confirm. Then hit enter.

## Using git to clone class repository

If you haven't signed up for a [github](https://github.com) account, please do so now.  Once you have a username and email address associated with you account. Log onto the class server-

Run this command:
`git config --global user.email<EMAIL_ADDRESS>then
`git config --global user.name "Your Name"`

Next make a directory called `repos`

`mkdir ~/repos`

Change into that directory: `cd repos`

Now, you can clone (copy) the whole repository: `git clone https://github.com/jpuritz/BIO_594_2019.git`

You should have a directory called `BIO_594_2019` that will have all the current class materials.
We'll get into this more next week, but you can always update this repo with these two commands:
```
cd ~/repos/BIO_594_2019
git pull
```

### I also highly recommend cloning the class repository to your own laptop for reference.
All class materials and exercises will be posted to the repository, so it will be useful to have access to it in multiple places.

I find it easiest to manage local repositories with the [Desktop Client](https://desktop.github.com)

## Other handy software

### Text Editor
A good text editor can make a huge difference in Bioinformatics.  There are built editors (nano) on the class server that we will explore, but having one on your laptop will be useful.  Below are a few examples:

#### OS X
* [Text Wrangler](http://www.barebones.com/products/textwrangler/)

#### Windows
* [Notepad++](http://notepad-plus-plus.org/)

#### Linux
* [Gedit](https://wiki.gnome.org/Apps/Gedit)

#### Cross-Platform
* [Sublime Text](http://www.sublimetext.com/)

### Markdown Editor
All work in this class will be documented on the github repository which uses markdown formatting.  You can certainly work with a basic text editor to do this or using the web interface, but a stand alone app helps as well.

#### OS X
* [Quiver](http://happenapps.com)

#### Windows
* [MarkdownPad](http://markdownpad.com/)

#### Cross-Platform
* [Haroopad](http://pad.haroopress.com/)

## Rstudio
Class demo
* Open up a web browswer window and go to `kitt.uri.edu:8787`
* Log in with you username and password

## Further Reading (Highly Recommended)
* [Github Guide](https://guides.github.com/activities/hello-world/)
* [Markdown Guide](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/)
* [Markdown Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)


text:
zxcvbn-Haskell
==============

The zxcvbn password strength estimator algorithm
(https://tech.dropbox.com/2012/04/
zxcvbn-realistic-password-strength-estimation/) ported to Haskell

This is my first Haskell application. Please feel free to comment on the style
or to suggest improvements.

repository: grkuntzmd/zxcvbn-Haskell

repo_name: grkuntzmd/zxcvbn-Haskell


text:
Pattern: Use of space in indentation

Issue: -

## Description

This rule forbids spaces in indentation. It is disabled by default.

## Further Reading

* [CoffeeLint - no_spaces](https://coffeelint.github.io/#options)

repository: Adroiti/docs-for-code-review-tools

repo_name: Adroiti/docs-for-code-review-tools


text:
# Athon API
***

## Requires

* [NodeJS](https://nodejs.org/en/docs/)
* [TypeScript](https://www.typescriptlang.org/docs/home.html)
* [Docker](https://www.docker.com/products/docker-hub)

## To run Developer environment

* Up database ```docker-composer up```
* Up Dev ```npm run dev```
* Test dist ```npm start```

## Environment Variables

On Development environment need to create a file `.env` with then variables:
```.dotenv
# VARIABLES OF ENVIROMENT
# ENVIRONMENT
NODE_ENV=

# SERVER CONFIGS
PORT=
HOST=

# TIMEZONE
TIMEZONE=

# DATA BASE CONFIG CONNECTIONS RELATIONAL
DB_CLIENT=
DB_HOST=
DB_NAME=
DB_USER=
DB_PASSWORD=
DB_PORT=

# CACHE CONFIGS
CACHE_CONFIG=
CACHE_TIME=
REDISHOST=
REDISPORT=

# SECURITY CONFIGS
SALT_ROUNDS=
STORAGE_TYPE=
ENABLE_HTTPS=
CERT_FILE=
KEY_FILE=

# AWS CONFIGS
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=
AWS_BUCKET=

AUTHSECRET=

```
On test environment create ```.env.testing```:
```.dotenv
# VARIABLES OF ENVIROMENT
# ENVIRONMENT
NODE_ENV=

# SERVER CONFIGS
PORT=
HOST=

# TIMEZONE
TIMEZONE=

# DATA BASE CONFIG CONNECTIONS RELATIONAL
# USE SQLITE3
DB_CLIENT=
DB_FILENAME=

# DATA BASE CONFIG CONNECTIONS NO RELATIONAL
DBNR_PREFIX=
DBNR_USER=
DBNR_PASSWORD=
DBNR_HOST=
DBNR_PORT=
DBNR_DATABASE=

# CACHE CONFIGS
REDISHOST=
REDISPORT=

# SECURITY CONFIGS
SALT_ROUNDS=
ENABLE_HTTPS=
AUTHSECRET=
```
## To use Https in Dev

To use ```https``` or ```ssl``` in the development environment is necessary to create a
directory ssl with the tree:

```tree
certs
├── cert.pem
└── key.pem
```

the directory must contain in root:
* ```server.csr``` file;
* ```server.key``` file;
* ```cert``` directory;
	* ```server.crt``` file;

To generate self-signed certificate is suitable for the development environment. To generate the certificate files and ``openssl`` must be installed on the computer.
First generate a private key:
```shell
openssl genrsa -des3 -out server.key 1024
```
_this command need to type a private phrase_

Next step generate ``file.csr`` use this command

```shell
openssl req -new -key server.key -out old_server.csr
```
_Answer all questions this step will request your private phrase_

Last step generate ``file.crt`` use this command;

```shell
openssl x509 -req -days 365 -in old_server.csr -signkey server.key -out server.crt
```
_To generate this file it is necessary to have generated the two previous files_

to configure the application for https work's, fill in the following environment variables in the ``.env`` file
```dotenv
ENABLE_HTTPS=#Set value 'true' falue defaut is 'false'
CERT=#path for file.crt
KEY=#path for file.key
```

## End-Points

##### LOGIN ON APLLICATION AND GENERATE TOKEN: ###
* Method: POST
* security: Open
* url: "/signin"
* Params:
	* **email:** "String, Required"
	* **password:** "String, Required"

repository: rafalogan/athonApi

repo_name: rafalogan/athonApi


text:
# lv_replace_all_text_labels
This shortcut menu plugin enables you to easily replace text labels.

## Requirement
LabVIEW 2020

Note: If you want to use this plugin in previous version, please use "Save for Previous Version" function.

## Install
Place Replace All Text Labels.llb in the following path.

`%USERPROFILE%\Documents\LabVIEW Data\PopupMenus\edit time panel and diagram`

## Usage
Just select objects and input "Find what" and "Replace with".

## Video
[![thumbnail](https://pbs.twimg.com/ext_tw_video_thumb/1270458400426438656/pu/img/WBtcR7POznCLNJ-n.jpg)](https://twitter.com/m_iidas/status/1270459598084820992)