text:
<!--
Copyright (c) 2010 Yahoo! Inc., 2012 - 2015 YCSB contributors.
All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You
may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing
permissions and limitations under the License. See accompanying
LICENSE file.
-->

# Install Hypertable

Installation instructions for Hypertable can be found at:

    code.google.com/p/hypertable/wiki/HypertableManual

# Set Up YCSB

Clone the YCSB git repository and compile:

    ]$ git clone git://github.com/brianfrankcooper/YCSB.git
    ]$ cd YCSB
    ]$ mvn clean package

# Run Hypertable

Once it has been installed, start Hypertable by running

    ]$ ./bin/ht start all-servers hadoop

if an instance of HDFS is running or

    ]$ ./bin/ht start all-servers local

if the database is backed by the local file system. YCSB accesses
a table called 'usertable' by default. Create this table through the
Hypertable shell by running

    ]$ ./bin/ht shell
    hypertable> use '/ycsb';
    hypertable> create table usertable(family);
    hypertable> quit

All iteractions by YCSB take place under the Hypertable namespace '/ycsb'.
Hypertable also uses an additional data grouping structure called a column
family that must be set. YCSB doesn't offer fine grained operations on
column families so in this example the table is created with a single
column family named 'family' to which all column families will belong.
The name of this column family must be passed to YCSB. The table can be
manipulated from within the hypertable shell without interfering with the
operation of YCSB.

# Run YCSB

Make sure that an instance of Hypertable is running. To access the database
through the YCSB shell, from the YCSB directory run:

    ]$ ./bin/ycsb shell hypertable -p columnfamily=family

where the value passed to columnfamily matches that used in the table
creation. To run a workload, first load the data:

    ]$ ./bin/ycsb load hypertable -P workloads/workloada -p columnfamily=family

Then run the workload:

    ]$ ./bin/ycsb run hypertable -P workloads/workloada -p columnfamily=family

This example runs the core workload 'workloada' that comes packaged with YCSB.
The state of the YCSB data in the Hypertable database can be reset by dropping
usertable and recreating it.

# Configuration Parameters

Hypertable configuration settings can be found in conf/hypertable.cfg under
your main hypertable directory. Make sure that the constant THRIFTBROKER_PORT
in the class HypertableClient matches the setting ThriftBroker.Port in
hypertable.cfg.

To change the amount of data returned on each call to the ThriftClient on
a Hypertable scan, one must add a new parameter to hypertable.cfg. Include
ThriftBroker.NextThreshold=x where x is set to the size desired in bytes.
The default setting of this parameter is 128000.

To alter the Hypertable namespace YCSB operates under, change the constant
NAMESPACE in the class HypertableClient.

repository: aliyun/alibabacloud-gdb-tools

repo_name: aliyun/alibabacloud-gdb-tools


text:
# Glowing Cursor
A customizable glowing colorful cursor for Atom.

![Preview](https://raw.githubusercontent.com/Matthew-Smith/atom-glowing-cursor/master/glowing-cursor.gif)

## Features
* #### adjustable width of cursor and the glow
 * ![Preview](https://raw.githubusercontent.com/Matthew-Smith/atom-glowing-cursor/master/cursor-width.gif)

* #### configurable color of cursor and its glow
 * ![Preview](https://github.com/Matthew-Smith/atom-glowing-cursor/raw/master/cursor-color.gif)

* #### configurable blink speed (0 is blink, 500ms is phase in and out)
 * ![Preview](https://raw.githubusercontent.com/Matthew-Smith/atom-glowing-cursor/master/cursor-blink.gif)

## Complementing themes and plugins
### Syntax
 * Steam Pirate Syntax: https://atom.io/themes/steam-pirate-syntax
 * Neon Syntax: https://atom.io/themes/neon-syntax

### UI themes
 * Steam Pirate UI: https://atom.io/themes/steam-pirate-ui

### Plugins
 * Neon Selection: https://atom.io/packages/neon-selection

#### Example using Steam Pirate UI, Neon Syntax, Neon Selector and Glowing Cursor
![Preview](https://github.com/Matthew-Smith/atom-glowing-cursor/raw/master/fullExample.gif)

### Inspired by and Referenced for development:
 * Neon Cursor: https://atom.io/packages/neon-cursor
 * Pulsing Cursor: https://atom.io/packages/pulsing-cursor
 * Block Cursor: https://atom.io/packages/block-cursor

[Buy me a coffee on Pledgie!](https://pledgie.com/campaigns/31674)

license: MIT

repository: Matthew-Smith/atom-glowing-cursor

branch_name: refs/heads/master

extension: md

gha_language: CoffeeScript

license_type: permissive

repo_name: Matthew-Smith/atom-glowing-cursor


text:
---
id: hooks_state
title: useState a state hook 📌
sidebar_label: useState
---

:::note Questions 🤔
1. **What do we pass to useState as an argument?**

  According to the React Doc useState allow only argument to set the initial state. Unlike classes, the state doesn’t have to be an object.

2. **What does useState return?**

  It returns a pair of values, The current state and a function that updates its current state
:::

`useState()` is a replacement for the traditional way to declare a state inside the class constructor. This hook method lets you add React state to function components.

Returns a stateful value, and a function to update it.

```jsx {2,11}
export default function App() {
  const [name, setName] = useState('Anonymous');

  useEffect(() => {
    document.title = name;
  });

  return (
    <div>
      <h2>{name}</h2>
      <input type="text" onChange={(e) => setName(e.target.value)}/>
    </div>
  );
}
```
alternate using class

```jsx
class App extends Component {
  constructor(props) {
    super(props);
    // highlight-start
    this.state = {
      name: 'Anonymous',
    };
    // highlight-end
  }

  render() {
    return (
      <div>
        <h2>{name}</h2>
        //  highlight-next-line
        <input type='text' onChange={(e) => this.setState({name: e.target.value})} />
      </div>
    );
  }
}
```

In the above example, we declare a new state variable, which I called "name".

`useState` method return array, In that first subscript value, states (name) and the second value is a method to mutate that state (setName) and we used Javascript `Array Destructing`

```jsx
let stateResult =  useState('Anonymous');
const name = stateResult[0];
const setName = stateResult[1];
```

In React state variables are preserved. They do not vanish like they normally would when a function exits.

## Lazy initial state
The initialState argument is the state used during the initial render. In subsequent renders, it is disregarded. If the initial state is the result of an expensive computation, you may provide a function instead, which will be executed only on the initial render

```jsx
const [state, setState] = useState(() => {
  const initialState = someComputation(props);
  return initialState;
});

```

:::info Remember
React guarantees that setState function identity is stable and won’t change on re-renders. This is why it’s safe to omit from the useEffect or useCallback dependency list.
:::

repository: krishnaUIDev/UI-Kit

gha_language: JavaScript

gha_license_id: MIT

repo_name: krishnaUIDev/UI-Kit


text:
---
layout: post
title: LeetCode - 132 Pattern
categories:
    - LeetCode
tags:
    - LeetCode
    - Medium
    - Stack
excerpt_separator: "<!--more-->"
---

### Question Definition
Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, ak such that i < j < k and ai < ak < aj. Design an algorithm that takes a list of n numbers as input and checks whether there is a 132 pattern in the list.
<!--more-->

**Note:** n will be less than 15,000.

**Example 1:**
```
Input: [1, 2, 3, 4]

Output: False

Explanation: There is no 132 pattern in the sequence.
```
**Example 2:**
```
Input: [3, 1, 4, 2]

Output: True

Explanation: There is a 132 pattern in the sequence: [1, 4, 2].
```
**Example 3:**
```
Input: [-1, 3, 2, 0]

Output: True

Explanation: There are three 132 patterns in the sequence: [-1, 3, 2], [-1, 3, 0] and [-1, 2, 0].
```
### Java Solution
```java
public boolean find132pattern(int[] nums) {
    int third = Integer.MIN_VALUE;
    Deque<Integer> s = new ArrayDeque<>();
    for (int i = nums.length - 1; i >= 0; --i) {
        if (nums[i] < third) return true;
        else while (!s.isEmpty() && nums[i] > s.peek()) {
            third = s.poll();
        }
        s.push(nums[i]);
    }
    return false;
}
```


text:
### Compute Cost

The objective of linear regression is to minimize the cost function:

where the hypothesis h(x) is given by the linear model:

Simply, hp is the predicted value and from predicted value, we can compute the square errors function which gives us the difference between the real value and the predicted value. Than we can compute the cost function, sum of squared errors.

### Gradient Descent

Gradient descent helps to estimate the parameters in the hypothesis function. The way we do this by taking the derivative of the cost function. With each step of gradient descent, our parameters (thetaj) come closer to the optimal values that will achieve the lowest cost J(theta). We need to first compute theta0 and theta1.

This method works for linear regression with one variable however if we have multiple variable we must use multivariate linear regression and the gradient descent should look like with vectorized version:

### Learning Rate

To compare how different learning learning rates affect convergence, it's helpful to plot J for several learning rates on the same figure. We select alpha, the learning rate equals to 1 denoted by blue and others are the results from division by 10,100,1000. It is clearly seen the learning rate 1 converges quickly than others and it the optimal alpha value.

### Feature Normalization

Some features might be 1000 times more than others and when features dier by orders of magnitude, first performing feature scaling can make gradient descent converge much more quickly. We should subtract the mean value first, then divide the result by standard deviation for each feature.

### Normal Equation

Gradient descent gives one way of minimizing J. In the normal equation method, we will minimize J by explicitly taking its derivatives with respect to the (theta j)’s and setting them to zero. We do not need to choose alfa and do not need to iterate. This approach is slow if the n the number of features is very large. The normal equation of theta is:

In Octave, pinv() function makes sure to take inverse.

repository: yilmazvolkan/CourseraML

repo_name: yilmazvolkan/CourseraML


text:
# σέβω.

<!-- Status: S2=NeedsReview -->
<!-- Lexica used for edits: BDAG LN FFM BN LSJM MM   -->

## Word data

* Strongs: G45760.

* Alternate spellings:

* Principle Parts:

* Part of speech:

[Verb](http://ugg.readthedocs.io/en/latest/verb.html).

* Instances in the New Testament: 10.

* All Scriptures cited: Yes.

## Etymology:

* LXX/Hebrew glosses:

;in LXX (chiefly for [יָרֵא](//en-uhal/H3372).

* Time Period/Ancient Authors:

* Related words:

* Antonyms for all senses:

* Synonyms for all senses:

## Senses:

### Sense  1.0:

#### Definition:

to worship

#### Glosses:

to worship

#### Explanation:

#### Citations:

~used of the worship of pagan gods: [Acts 18:13](act 18:13), [19:27](act 19:27),
~in the words of Jesus, referring to those who go through the outward motions of worship: [Matt 15:9](mat 15:9), [Mark 7:7](mrk 7:7),
~used frequently in Acts to refer to Gentiles who worshipped the Jewish God, but who had not formally become Jews; that is, a [προσήλυτος] (../G43390/01.md) : [Acts 13:43](act 13:43), [13:50](act 13:50), [Acts 16:14](act 16:14), [17:4](act 17:4), [17:17](act 17:17), [18:7](act 18:7).

repository: mandolyte/uw-obsidian

branch_name: refs/heads/main

repo_name: mandolyte/uw-obsidian


text:
---
hrs_structure:
  division: '1'
  volume: '3'
  title: '12'
  chapter: 173A
  section: ''
type: chapter
tags:
  - Government
menu:
  hrs:
    identifier: HRS0173A
    parent: title12
    name: Chapter 173A Acquisition of Resource Value Lands
weight: 70000
title: Acquisition of Resource Value Lands
full_title: Chapter 173A Acquisition of Resource Value Lands
---
**CHAPTER 173A**

**[ACQUISITION OF RESOURCE VALUE LANDS]**

Section

173A-1 Purpose

173A-2 Definitions

173A-2.4 Legacy land conservation commission

173A-2.5 Responsibilities of the legacy land conservation

commission

173A-2.6 Land acquisition priorities

173A-3 Resource land acquisition plan

173A-4 Authority to acquire and convey; easement required

and exemption

173A-4.5 Appraisal of land

173A-5 Land conservation fund

173A-6 Acquisition of land

173A-7 Administration and management

173A-8 Development of land acquired by the board

173A-9 Grants to state agencies, counties, and nonprofit

land conservation organizations

173A-10 Proceeds of sale, lease, or other disposition

173A-11 General powers

173A-12 Federal and other grants

173A-13 Payment of debt service on the Turtle Bay

reimbursable general obligation bonds

Cross References

Acquisition of important agricultural lands, see §§163D-31 to 33.

Environmental courts, jurisdiction over proceedings arising under this chapter, see §604A-2.

Important agricultural lands, see §§205-41 to 52.

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
# test-data-control

Imported from code.google.com/p/test-data-control

### Introduction

test-data-control is initially supposed to provide round-trip tools that will help you get data out of database and back in again, in JSON format (www.json.org). At present, it rests on top of dbunit (www.dbunit.org).
It may be combined with other tools, such as XStream or even xstream-java-code-writer (http://code.google.com/p/xstream-java-code-writer/) to further enhance and speed up your tests.
With time, I will add more components that is related to controlling test data and speeding up automated tests.

### How to Use

If you need to know how to use the library, you're best advised to look at the unit tests, in particular:
  * *`DbWrapperTest`*: here's how you'd import/export/delete database data, JSON and XML
  * *`DbWrapperJavaTest` / `JavaDemoTest`*: example use of several classes - how you'd import/export/delete database data

### More on testing

I have used the wiki here to put down some thoughts on testing, and a couple of presentations. I have put some links into [http://www.delicious.com/ParaTom/testing delicious]

## Procedure for releasing.

Deploying snapshots and releasing is done through:
  * Maven [http://maven.apache.org/plugins/maven-release-plugin/examples/prepare-release.html release] plugin.
  * Sonatype OSS Repository (see [https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide Usage guide])
A boiled-down, simple procedure with some additional notes is found below

### Details

Start with a tested, checked-in, clean project.

Useful commands:
  * mvn release:clean
  * mvn release:prepare -Dpassword=(...) -Dusername=(...)
  * mvn release:perform

*NB* separate [https://code.google.com/hosting/settings googlecode.com password] (under "Source" tab).

If anything goes wrong - remember that pom is changed and checked in, so you need to revert version and scm settings at least, you may try release:rollback.

If all is well, you should try and test the thing before you go on to the Sonatype [https://oss.sonatype.org/ staging repository] to *[https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-8.ReleaseIt close and release]* the staging repository
Once released it will be synched to Maven central (hourly)


text:
# HOW TO use aggregation functions and join clause in Sequelize

## Introduction

Suppose you have two models in Sequelize: One of them is about expense groups, with an ID and name; meanwhile the other, deals with expenses, storing a value and an association with a group of expenses.

Then, the expense groups model should look something like this:

```javascript
module.exports = (sequelize, DataTypes) => {
 const ExpenseGroups = sequelize.define(
   'expenseGroups',
   {
     id: { type: DataTypes.INTEGER, allowNull: false, autoIncrement: true, primaryKey: true },
     name: { type: DataTypes.STRING, allowNull: false }
   },
   {
     underscored: true,
     tableName: 'expense_groups'
   }
 );

 ExpenseGroups.associate = models => {
   ExpenseGroups.hasMany(models.expenses, { foreignKey: 'groupId' });
 };

 return ExpenseGroups;
};
```

And the expenses model can be this:

```javascript
module.exports = (sequelize, DataTypes) => {
 const Expenses = sequelize.define(
   'expenses',
   {
     groupId: { type: DataTypes.INTEGER, field: 'group_id', allowNull: false },
     value: { type: DataTypes.DOUBLE, allowNull: false }
   },
   {
     underscored: true,
     freezeTableName: true
   }
 );

 Expenses.associate = models => {
   Expenses.belongsTo(models.expenseGroups, {
     foreignKey: 'groupId'
   });
 };

 return Expenses;
};
```

Now suppose you have the next data:

#### Expenses Table

| group_id | value |
|:--------:|:-----:|
|1|10|
|1|10|
|1|10|
|2|20|

And you are expecting to obtain the total value of each group. But, how to achieve this?

## Aggregation functions

An aggregation function allow you to perform a calculation given a set of values. This values must be grouped by a common attribute using the  GROUP BY  statement.

From our early problem,  a common SQL query you can use to accomplish this, can be:

```sql
SELECT sum(value) as total FROM expenses GROUP BY group_id;
```

To make this, first you need to import `Sequelize` and use the function `fn`. This function request two parameters: the first is the name of the aggregate function and the second the name of which column will be affected (but this column has to be called with the col function). Bring in this together, the Sequelize query should look like this:

```javascript
const Sequelize = require(‘sequelize’);

exports.getExpenses = () =>
 Expenses.findAll({
   attributes: [[Sequelize.fn('sum', Sequelize.col('value'))], 'total', 'group_id'],
   group: ['group_id']
 });
```

This will generate the next result:

```js
[
 { total: 30, group_id: 1 },
 { total: 10, group_id: 2 }
]
```

After understanding the aggregation functions, let’s learn about the join clause

## Aggregation functions and the Join Clause

Sometimes when you have the foreign key and you need another attributes contained in the associated model, you can use the Join clause. In Sequelize, this is a easy task. Just add to the options of the query function, the include key. This will expect an array of objects specifying the model options. But, in our case, because the object will only specify the model key, we can pass the model object instead.

```javascript
const Sequelize = require('sequelize');

exports.getExpenses = () =>
 Expenses.findAll({
   attributes: [[Sequelize.fn('sum', Sequelize.col('value')), 'total']],
   group: ['group_id'],
   include: [Groups]
});
```

**Hold on!** If you run this code, this will throw the next error

> SequelizeDatabaseError: column "expenseGroups.id" must appear in the GROUP BY clause or be used in an aggregate function

This is caused because when we use the include key, Sequelize try to select all the fields of the associated model. To solve this, just group by a common attribute between expenses and groups. In our case, is the `id`. Try putting in the group key, `expenseGroup.id`

```javascript
const expenseGroups = require('../../models').expenseGroups,
 Expenses = require('../../models').expenses,
 Sequelize = require('sequelize');

exports.getExpenses = () =>
 Expenses.findAll({
  attributes: [[Sequelize.fn('sum', Sequelize.col('value')), 'total'], 'group_id'],
  group: ['group_id', 'expenseGroup.id'],
  include: [Groups]
});
```

This will generate the total value of each group and information about the group. So, it will look like this:

```js
[
    {
        "total": 30,
        "group_id": 1,
        "expenseGroup": {
            "id": 1,
            "name": "Group 1",
            "createdAt": "2019-03-20T03:11:46.679Z",
            "updatedAt": "2019-03-20T03:11:46.679Z"
        }
    },
    {
        "total": 10,
        "group_id": 2,
        "expenseGroup": {
            "id": 2,
            "name": "Group 2",
            "createdAt": "2019-03-20T03:33:18.178Z",
            "updatedAt": "2019-03-20T03:33:18.178Z"
        }
    }
]
```

And that’s all. Now you can use aggregation functions and include models. If you want, you can clean this data to return only the group name and nothing else. To do this, delete `group_id` in attributes, also in the group key because it not be necessary since `expenseGroups.id` is enough; finally, specify in the model clause that you need just the name. For it, pass into the array an object with key model and as value the model Group. Then, as before, set the attributes key and specify just the name. It will look like this:

```javascript
exports.getExpenses = () =>
Expenses.findAll({
  attributes: [[Sequelize.fn('sum', Sequelize.col('value')), 'total']],
  group: ['expenseGroup.id'],
  include: [{
    model: Groups,
    attributes: ['name']
  }]
});
```

And it will return this:
```js
[
    {
        "total": 10,
        "expenseGroup": {
            "name": "Group 2"
        }
    },
    {
        "total": 30,
        "expenseGroup": {
            "name": "Group 1"
        }
    }
]
```

## BONUS: Nested include

Let’s to something a little more *complex*. At the moment, we have two models, `expenses` and `expenseGroups`. An expense store the id from an expense group and a value and we are groupying these groups to obtain the total. Now suppose we add a model between, `expenseSubgroups`.

```javascript
module.exports = (sequelize, DataTypes) => {
 const Subgroups = sequelize.define(
   'expenseSubgroups',
   {
     id: { type: DataTypes.INTEGER, allowNull: false, autoIncrement: true, primaryKey: true },
     groupId: { type: DataTypes.INTEGER, field: 'group_id', allowNull: false },
     name: { type: DataTypes.STRING, allowNull: false }
   },
   {
     underscored: true,
     tableName: 'expense_subgroups'
   }
 );
 Subgroups.associate = models => {
   Subgroups.belongsTo(models.expenseGroups, { foreignKey: 'groupId' });
 };
 return Subgroups;
};

```

Now, an expense will store the id from an expense subgroup, and this will store the id from an expense group. Based on this, we can group by subgroup id. But, how can we still obtaining the group name and now, the subgroup name?

Suppose this data:

#### Expenses Table

| subgroup_id | value |
|:--------:|:-----:|
|1|10|
|1|10|
|1|10|
|2|10|
|3|10|
|3|10|

#### Expense Subgroups Table

| subgroup_id | group_id |
|:--------:|:-----:|
|1|1|
|2|1|
|3|2|

As before, if we want to obtain the total value from each subgroup, we just add into the include array the subgroup model, and into the group key, `expenseSubgroup.id`. At this point, we are only obtaining the subgroup name. To obtain the group name, we need to add in the include key inside the subgroup include and specify by the attributes key that we only want the name. The code isn’t complete yet. If we run the code now, it will throw an error because the generated query will try to obtain the group name, but the group model is not specified in the group by clause. To add this into the group by, maybe you are expecting to add something like this `expenseSubgroup.expenseGroup.id`, but now, because is a nested include, we need to use the `->` arrow expresion. Now, add to the group clause `expenseSubgroup->expenseGroup.id`.

The complete code will be something like this:

```javascript
exports.getExpenses = () =>
Expenses.findAll({
  attributes: [[Sequelize.fn('sum', Sequelize.col('value')), 'total']],
  group: ['expenseSubgroup.id', 'expenseSubgroup->expenseGroup.id'],
  include: [{
    model: Subgroups,
    attributes: ['name'],
    include: [{
      model: Groups,
      attributes: ['name']
    }]
  }]
});
```

And it will return this:

```js
[
    {
        "total": 30,
        "expenseSubgroup": {
            "name": "Group 1 Subgroup 1",
            "expenseGroup": {
                "name": "Group 1"
            }
        }
    },
    {
        "total": 20,
        "expenseSubgroup": {
            "name": "Group 2 Subgroup 1",
            "expenseGroup": {
                "name": "Group 2"
            }
        }
    },
    {
        "total": 10,
        "expenseSubgroup": {
            "name": "Group 1 Subgroup 2",
            "expenseGroup": {
                "name": "Group 1"
            }
        }
    }
]
```

_Made with passion :fire: by @Darvand_

Last update `March 25, 2019`

repository: Wolox/tech-guides

gha_language: Shell

repo_name: Wolox/tech-guides


text:
ROADMAP
=======

This document explains in as much details as possible the
list of planned changes and work to be done on the Cowboy
server. It is non-exhaustive and subject to change. Items
are not ordered.

 *  Add and improve examples

 *  Improve user guide

    We need feedback to improve the guide.

 *  Add and improve tests

    Amongst the areas less tested there is protocol upgrades
    and the REST handler.

    While eunit and ct tests are fine, some parts of the
    code could benefit from PropEr tests.

 *  Continuous performance testing

    Initially dubbed the Horse project, Cowboy could benefit
    from a continuous performance testing tool that would
    allow us to easily compare the impact of the changes we
    are introducing, similar to what the Phoronix test suite
    allows.

    Depending on the test it may be interesting to compare
    Cowboy to other servers and eventually take ideas from
    the servers that outperform Cowboy for the task being tested.

 *  Full HTTP/1.1 support

 *  Improved HTTP/1.0 support

    Most of the work on Cowboy has been done with HTTP/1.1
    in mind. But there is still a need for HTTP/1.0 code in
    Cowboy. The server code should be reviewed and tested
    to ensure compatibility with remaining HTTP/1.0 products.

 *  Continue improving the REST API

 *  SPDY support

The following items pertain to Ranch.

 *  Resizing the acceptor pool

    We should be able to add more acceptors to a pool but also
    to remove some of them as needed.

 *  Add Transport:secure/0

    Currently Cowboy checks if a connection is secure by
    checking if its name is 'ssl'. This isn't a very modular
    solution,  adding an API function that returns whether
    a connection is secure would fix that issue.

license: ISC


text:
# Team-Profile-Generator

 ![MIT](https://img.shields.io/badge/License-MIT-blue) ![JS](https://img.shields.io/badge/Language-JavaScript-yellow)

 ## Table of Contents
  * [Video](#Video)
  * [Installation](#installation)
  * [Usage](#usage)
  * [Contribution](#contribution)
  * [Tests](#tests)
  * [License](#license)
  * [Questions](#questions)

  ## Video

  [![Walkthrough Video](assets/tpg.JPG)](https://drive.google.com/file/d/1sSkgdEcti0c-UHjmGchhq_UYAUooKneY/view)

  ## Installation
  Clone the repository to your local machine, then in stall node.js in the root folder (in you don't have it globally installed), you will then need to install the Inquirer NPM   package. Run the command `npm install inquirer` to install.

  ## Usage
  To use the application simply run `node index` in your command line and follow the prompts. The Finished product will save to the ./dist file.

  ## Contribution
  Feel free to use, copy, and contribute as you see fit.

  ## Tests
  The testing package used in this project was Jest NPM. Install in your root folder with the `npm install --save-dev jest` command.

  ## License
  This project was done under the MIT license. To know more about it, please click here: [MIT](https://choosealicense.com/licenses/mit/)

  ## Questions
  Please visit my GitHub page: https://github.com/sam-walters93

  For more information please email me at<EMAIL_ADDRESS>


text:
| |
| --- |
|  ⚠ **HEADS UP**: CapsLock Indicator 4 is on the way. Completely rewritten with many new features and a new UI using WPF! However, it may still take some time until that version releases. |

----

![CapsLock Indicator](https://cli.jonaskohl.de/capslock-indicator-logo.png)

[![Visit project page](https://static.jonaskohl.de/q50c4wp6/cli-project-page_vlecvcbtz80tqvtt.svg)](https://cli.jonaskohl.de/)
[![License](https://img.shields.io/badge/License-Apache%202.0-red.svg)](https://opensource.org/licenses/Apache-2.0)
[![Version](https://cli.jonaskohl.de/version.php?shield=true&_=2)](https://cli.jonaskohl.de/!/download#latest)
[![Build Status](https://travis-ci.org/jonaskohl/CapsLockIndicator.svg?branch=master)](https://travis-ci.org/jonaskohl/CapsLockIndicator)

CapsLock Indicator is a small utility that indicates the state of the Num lock, Caps lock and Scroll lock key.

# [Download](https://cli.jonaskohl.de/!/download)

# Edit & compile source code
You need at least SharpDevelop 5.1 or Microsoft Visual Studio 2010 to edit and compile the source code, however Microsoft Visual Studio 2017 is recommended. CapsLock Indicator has no other dependencies other than the Microsoft .NET SDK 4.5.

# Contributing
If you have a feature suggestion or a bug to file **and you are able to implement this in the code**, feel free to [open a pull request](https://github.com/jonaskohl/CapsLockIndicator/pulls). If you only want to report a bug or suggest a feature, [open a new issue](https://github.com/jonaskohl/CapsLockIndicator/issues/new).

repository: xininye/CapsLockIndicator

repo_name: xininye/CapsLockIndicator


text:
## Remote - Control your iPhone from Xcode

"Remote" is a plugin for Xcode that allows you to control an iPhone
from a window on your Mac during development. Originally created to avoid
having to pick  up a device during testing you can record "macros"
of device touches and replay them. It will also compare the resulting screen
output against a snapshot for end-to-end testing. The Macro log is an
editable WebView that can be modified at will. Finally, you can now
record and save all display output into a quicktime movie.

**Update:** This former Xcode plugin has been re-organised into a
Swift Package for use in other apps. To use `Remote`, simply add this
project as a Swift package and the `RemoteCapture` target to your app.
It will connect automatically using the hostname of your desktop. You
also need to be running an application containg the `RemoteUI` target
such as [InjectionIII](https://github.com/johnno1962/InjectionIII) or the
[HotReloading](https://github.com/johnno1962/HotReloading) daemon with
"Remote Control" enabled to receive connections and render your device's
screen. By default, adding the package to a project will have it try to
connect to a process running the remote UI. The package manifest
compiles your hostname into the package so it should be able to
connect from a device.

![Icon](http://injectionforxcode.johnholdsworth.com/remote.gif)

(The gif shows the recording of a macro, saving it and then playing it
back - testing the screen is as expected in the snapshot.)

To use, download the zipped source for this plugin, build and restart
Xcode. You can then patch your project's main.m to include the Remote
client header using "Product/Remote/Patch App" or it can load from a
bundle on the fly if using the simulator. When using a device check that
the correct IP address has been patched into main.m so the device can connect.
To use with Swift, add an empty main.m to your project so it can be patched.

The display shadowing window will not display by default. Use the
Menu item "Product/Remote/Load" to have it appear. Thereafter, touches
on the shadow display or device applied and recorded. To save a macro
or a sequence of touches, enter a name into the textfield towards the
bottom of the touch display and click the save button. You can then
replay the macro either by loading it using the pulldown menu
at the top of the touch display and clicking replay or directly from
the "Product/Remote/<Macro Name>" Menu.

For end-to-end testing, include a snapshot in a macro by clicking
the "Snapshot" button. On replay, the macro will pause until the screen
matches the snapshot within the specified tolerance or it will timeout
asking if you would like to update the snapshot or the tolerance used
(remember to save the updated macro.) The units of tolerance are the
number of bytes the screen image differs after the run length encoding
of simular pixel values.

### Macro entries logged/replayed:

- Hardware <hw.machine> - device type from sysctlbyname()

- Device <screen width> <screen height> <snapshot scale> <device scale>

- Begin <wait time> <x> <y> [<x2> <y2>] - touch(s) start

- Moved/Ended <ditto> touches moved/ended - two touches maximum

- Expect timeout:<seconds> tolerance:<bytes different>.. <snapshot>

### Implementation Classes

UI:

- RMPluginController - interface between the Remote display and Xcode

- RMWindowController - macro re-player and overall nib controller

- RMMacroManager - controls display, saving and loading of macros

Internal (connected by protocol RMDeviceDelegate):

- RMImageView - subclass of NSImageView for event capture/device display

- RMDeviceController - interface between remote display and device

- RemoteCapture.h - #imported into application's main.m to connect to Xcode

RemoteCapture.h requires a patched main.m to be compiled using ARC.

### Limitations

Remote uses [UIWindow.layer renderInContext:] so most activity on the device is
captured including the keyboard but excepting video replay and openGL layers.
UIAlertView prompts are also not captured as they seem to render outside the window
hierarchy. Finally, UIDatePickers are not rendered correctly at all although they will
respond to events. To preserve network bandwidth to the device animations are not played.

Remote performs better with swipe events if you make an initial tap on the device.

Please note: for some reason it takes about a minute before Xcode will accept remote
connections on it's server socket (firewall complications?). After restarting Xcode
you may need to wait a while before being able to use the Remote plugin from a device.

### Thanks

AVFoundation code for video capture adapted from:
[https://github.com/acj/TimeLapseBuilder-Swift](https://github.com/acj/TimeLapseBuilder-Swift)

MIT license. Please see the LICENSE file for the particulars.

repository: satria-fextha/Remote

repo_name: satria-fextha/Remote


text:
## Install

```npm install gatsby-source-paystack```

## How to use

In the plugin options, you'll need to specify two parameters
* `dataObjects` - An array that represents the data you want to fetch. So if I wanted to fetch Products and Customers, I would pass the array `['products', 'customers']`.
* `apiKey` - Your Paystack secret key. You need to keep this secure and not commit it to your source control, so we recommend using `dotenv` to expose the key as an environment variable. Gatsby has a [guide on using environment variables and using dotenv](https://www.gatsbyjs.com/docs/how-to/local-development/environment-variables/) that you might find helpful.

Example:
```
// In your gatsby-config.js
module.exports  = {
    plugins: [
        {
	    resolve: `gatsby-source-paystack`,
	    options: {
		dataObjects: ["products"],
		apiKey: process.env.PAYSTACK_SECRET_KEY,
	    },
	},
    ]
}
```

repository: aremu-smog/gatsby-source-paystack

repo_name: aremu-smog/gatsby-source-paystack


text:
# Package

## Functions included in the package:

### datastruct.py

This file contains all the data managment for the package trackeddy. The main data type ar python `dictionaries`. Which allow the management of all the possible parameters available as outputs and diagnostics.

### geometryfunc.py

This file contains all the geometry functions used during the fitting and analysis of the input fields (SSHa, Vorticity or others).

### physics.py

This file contains all the physics functions like calculating vorticity, geostrophic velocity from ssh, Okubo-Weiss and others.

### printfunc.py

This file contains functions to print the progress in percent of the main function.

### savedata.py

This file contains some functions to translate python dictonaries to netCDF files and diferent functions to save datasets into netCDF.

### Tracking.py

This contain the main source of the trackeddy algorithm for more information check the **Read The Docs** documentation.

repository: josuemtzmo/trackeddy

gha_language: Python

repo_name: josuemtzmo/trackeddy


text:
# GS1

GS1 provides the tools to make your code GS1 compliant.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'gs1'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install gs1

## Usage

Follow the examples below to start using the gem.

### Configuration

There are some configuration you can do before start using this lib.

```ruby
GS1.configure do |config|
  config.company_prefix = '123456789'
  config.barcode_separator = '~' # Default is "\u001E"
end
```

### Application identifiers

To access the defined application identifier:

```ruby
GS1::AI::GTIN # => "01"
```

or via the class:

```ruby
GS1::ExpirationDate::AI # => "17"
GS1::ExpirationDate.ai # => "17"
```

To get the class from a numeric id:

```ruby
GS1::AI_CLASSES[GS1::AI::BATCH_LOT] # => "GS1::Batch"
```

### Healthcare barcodes

To initialize a healthcare barcode from scan input:

```ruby
GS1::Barcode::Healthcare.from_scan("01034531200000111719112510ABCD1234\u001E2110")
# => #<GS1::Barcode::Healthcare:0x007fe1b99ea280
#      @gtin=#<GS1::GTIN:0x007fe1b99e9a10 @errors=[], @data="03453120000011">,
#      @expiration_date=#<GS1::ExpirationDate:0x007fe1b99e8700 @errors=[], @data="191125">,
#      @batch=#<GS1::Batch:0x007fe1b99e3b10 @errors=[], @data="ABCD1234">,
#      @serial_number=#<GS1::SerialNumber:0x007fe1b99e2670 @errors=[], @data="10">,
#      @errors=[]>
```

or just get the attributes

```ruby
GS1::Barcode::Healthcare.from_scan("01034531200000111719112510ABCD1234\u001E2110")
# => {:gtin=>"03453120000011", :expiration_date=>"191125", :batch=>"ABCD1234", :serial_number=>"10"}
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/apoex/gs1. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

## Code of Conduct

Everyone interacting in the Gs1 project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/apoex/gs1/blob/master/CODE_OF_CONDUCT.md).


text:
# Pierre's Bakery

#### A program that utilizes C# classes for a bakery order interface.

#### By Benjamin Wilson

## Technologies Used

* C#
* MSTest
* .NET

## Description

This program utilizes two C# classes to create an interface for a bakery. The user can input the amount of bread and pastries they would like to order and it will output a total price upon checkout based on various cost methods.

## Setup/Installation Requirements

1. Install the [.NET framework](https://docs.microsoft.com/en-us/dotnet/core/install/windows?tabs=net50).
2. [Clone](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository-from-github/cloning-a-repository) this repository from GitHub to your local machine.
3. Open the new directory.
4. Open a new terminal instance in the Bakery.Solution/Bakery directory.
5. Type "dotnet build" in the terminal, then after completion type "dotnet run" to start the program.

* To run model tests, navigate to Bakery.Solution/Bakery.Tests in the console and type "dotnet test".

## Known Bugs

* _no bugs known_

## License

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

Copyright (c) 2021 Benjamin Wilson

## Contact Information

<benjaminw1030@gmail.com>


text:
# Symfony Micro Framework Bundle

A replacement of the official FrameworkBundle allowing Symfony to be used as a
micro-framework which follows the "add what you need" philosophy.

## Installation

First install it using [Composer](https://getcomposer.org/download):

    composer require gnugat/micro-framework-bundle:^0.1

Then enable it in your application's kernel (e.g. `app/AppKernel.php`):

    new Gnugat\MicroFrameworkBundle\GnugatMicroFrameworkBundle()

## Features

* compatible with third party bundles
* better performance than FrameworkBundle (faster autoloading, lighter DIC)

## Want to know more?

You can see the current and past versions using one of the following:

* the `git tag` command
* the [releases page on Github](https://github.com/gnugat/micro-framework-bundle/releases)
* the file listing the [changes between versions](CHANGELOG.md)

And finally some meta documentation:

* [copyright and MIT license](LICENSE)
* [versioning and branching models](VERSIONING.md)
* [contribution instructions](CONTRIBUTING.md)

repository: Natorator/micro-framework-bundle

repo_name: Natorator/micro-framework-bundle


text:
# How to Present Like Apple? - Recreating an Apple Keynote
This is an article and an accompanying video recreating an Apple Product Event. In this article (and complementary video), I will be introducing the new 16" MacBook Pro to the Special Event attendees and the press. And I will talk about the epic engineering journey behind the brand-new MacBook. I made this article and video to keep my presentation skills sharp while teaching others how to present like Apple (because, teaching is the best way of learning and re-learning).

## Resources
You can find the video narration of this article on YouTube: [https://www.youtube.com/watch?v=IuAIBY6NE6k](https://www.youtube.com/watch?v=IuAIBY6NE6k){:target="_blank"}{:rel="noopener"}

<iframe width="560" height="315" src="https://www.youtube.com/embed/IuAIBY6NE6k" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Video has additional tips and illustrations. If you want to read the comments or leave a comment, do so under the YouTube video. If you want to contribute to the article, make a pull request on GitHub.

Apple Logo Animation:
* [https://github.com/lorenzocadamuro/apple-fifth-avenue](https://github.com/lorenzocadamuro/apple-fifth-avenue){:target="_blank"}{:rel="noopener"}

## Stage Directions
[![Apple Special Event by QuanticDev](media/apple_special_event_quanticdev.jpg)](https://www.youtube.com/watch?v=IuAIBY6NE6k)

This section is the script with the stage directions for the presentation. If you want to watch it, check the video in the resources section out.

[stage-direction: camera on the ground, looking up, so everything looks bigger]

[stage-direction: Black Apple logo centered on the screen with sunbeams around it, which is at the center of the camera. Walk to stage from outside of it slowly. Empty hands, no q-cards, well-rehearsed.]

[stage-direction: Video starts with Steve introducing original iPhone in 2007 and slowly fuses into mine.]

Good afternoon and welcome to the Apple Keynote, 2020. [stage-direction: smile & pause] We have always believed that by giving people access to the best possible tools at a reasonable price, you enable them to do wonderful things. At Apple, we put innovation and excellence at the center of everything that we do. With that innovation, we help people to learn, create, and work better and faster. And with the engineering excellence, we give them tools that they can depend on. On this day, you will get a taste of the fusion of innovation and excellence made by Apple, and made for professionals, once again. [stage-direction: audience cheers]

Every once in a while, a revolutionary product comes along, changing the way we perceive productivity. Luckily for you, you are going to whiteness one of those moments.

We have been building towards this moment for the last 30 years. In 1984, we introduced the first Mac. From that moment on, nothing was going to be the same again in the computer industry. In 1991 came the first PowerBook. It put the entire power of a Mac in your backpack, revolutionizing the portable computing. In 2006, we introduced the MacBook, redefining what a laptop could be. [stage-direction: back to glowing apple logo] And today, the saga continues. [stage-direction: pause & exited crowd applauds]

[stage-direction: sliding images for each phrase – walking towards audience] A brand new operating system. [stage-direction: macOS Catalina logo] A gigantic screen. An 8-core CPU. A brand new operating system. A gigantic screen. [stage-direction: audience laughter and pause] Are you getting it? [stage-direction: back to glowing apple logo]

Today, Apple is going to reinvent the laptop. [stage-direction: pause] Here is... the state-of-the-art, 16" MacBook Pro.

[stage-direction: MacBook Pro 16" intro vid – 15s]

And that is it. That is all you need to see. [stage-direction: audience laughter – throwing hands forward] Do not worry, there is more. But first, let me give you some astounding numbers.

This is the most powerful MacBook ever made. In fact, it has 2000 times the processing power of the very first Mac we ever built. It has the biggest screen to body ratio of any computer we ever produced. We fitted the largest battery ever we shipped with any MacBook. As a matter of fact, it is the largest capacity allowed on flights by the FAA. We have also redesigned our software lineup to work better with the new MacBook Pro. Both Logic Pro X and Final Cut Pro X now take advantage of the new hardware to its fullest.

Now let us have a look at the internals and see what is going on under the chassis.

[stage-direction: internals video starts]

The new MacBook Pro opens the same way. [stage-direction: audience laughter] It has 4 thunderbolt-3 ports. Combined with the versatility of USB‑C, you can connect anything to any port. And for the first time, our ever-praised unibody enclosure is made from 100% recycled aluminum. We re-engineered the new enclosure down to the atomic level, making it more durable and stronger than ever. And to your joy, it is the best-looking MacBook to this date.

To engineer the thinnest and largest retina screen to ship with an Apple laptop, we have refined every component. The glass, the bezels, the edges, everything is thinner. [stage-direction: throwing hands forward as if throwing something on the ground]

We continued to refine our keyboard design, to be more accurate and comfortable. It is a delight to type on these things; they provide so much more feedback than anything that we ever shipped.

[stage-direction: a going-wider hand gesture] While at it, we have completely redesigned the speakers to produce a crystal clear and room-filling sound.

Up to 8TB of SSD storage, 64GB of RAM, and the new 8-core Intel CPU, this is a monster of machine in your hands. In fact, it has the most CPU cores ever shipped on a MacBook. This amount of power needed better cooling, so we went ahead and redesigned fans. They cool your Mac 28% better while being quieter.

And to power all these, we have developed several new battery technologies. We actually changed the construction and the chemistry of the cells.

And oh, hey, we did not forget to put in the T2 chip. You still get the most advanced security on any laptop, along with the convenience of Siri.

To fit all these professional components into the MacBook, we took an extreme approach to miniaturization. All the parts were optimized and engineered to fit together to create the highest density Mac motherboard yet. It is actually 65% smaller than any we have designed before.

[stage-direction: small pause and wall towards the center of the stage]

All of these get together to give you an uncompromising machine, the most powerful and purposeful creative tool. The best MacBook ever made.

[stage-direction: audience cheers]

## Q-Card
This is only used during rehearsing the speech. Presentation can have these on a hidden prompter facing away from cameras and audience. However, it is always best to not relay on anything and practice until you can deliver the speech in full without any tips.

```
Good afternoon … 2020
best ... tools ... enable ... wonderful
At Apple ... innovation and excellence ... center
Innovation ... learn, create, and work
engineering excellence ... depend
fusion of innovation and excellence [stage-direction: wait for audience cheers]

perceive productivity
Luckily for you

last 30 years
1984 ... first Mac.
computer industry
1991 ... PowerBook.
power of a Mac in your backpack ... revolutionizing the portable computing
2006 ... MacBook ... redefining laptop
saga continues [stage-direction: wait for exited crowd applauds]

[stage-direction: walking towards audience] operating system ... gigantic screen ... 8-core CPU
operating system ... gigantic screen. [stage-direction: wait audience laughter]
getting it?

Apple ... reinvent laptop [stage-direction: pause]
state-of-the-art, 16"

[stage-direction: wait for MacBook Pro 16" intro vid – 15s]

And that is it ... all ... to see. [stage-direction: wait audience laughter – throwing hands forward]
there is more.
But first ... numbers

most powerful MacBook
2000 times
biggest screen to body
largest battery
FAA
software lineup
Logic Pro X ... Final Cut Pro X ... fullest.

internals ... chassis.

uncompromising machine, the most powerful and purposeful creative tool

The best MacBook ever made.
```

## Part 1 Conclusion
This is part 1 of my 3-part mini-series on how to Present Like Apple. This 5-minute video took me approximately 20 hours to make as a senior software engineer, including rehearsals and reshoots, along with another 10 hours for the follow-ups. In part 2, I will explain how this video was made, how the script was written, the equipment used, the animations, and all the other production details. And in part 3, I will do an in-depth analysis of presentation techniques used in this video, including the bold script and the story, the body language, the emphases, the stage and much more.

repository: soygul/QuanticDev

repo_name: soygul/QuanticDev


text:
---
wts:
    title: '01 - Create a VM using ARM template (10 min)'
    module: 'Module 04 - Azure Resource Manager (ARM)'
---

To implement infrastructure as code for your Azure solutions, use Azure Resource Manager templates (ARM templates). The template is a JavaScript Object Notation (JSON) file that defines the infrastructure and configuration for your project. The template uses declarative syntax, which lets you state what you intend to deploy without having to write the sequence of programming commands to create it. In the template, you specify the resources to deploy and the properties for those resources.

# ARM tutorial
+ [Azure ARM tutorial](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-tutorial-create-first-template?tabs=azure-powershell)

# Lab 01: Create a VM using ARM template

## Task 01: Create a Linux VM using ARM template
+ Follow this [link](https://azure.microsoft.com/en-us/resources/templates/vm-simple-linux/) and click **Deploy to Azure** to deploy a Linux Virtual Machine.

repository: dramasamy/training

repo_name: dramasamy/training


text:
# Usage

bosh 2.0 CLI must be installed in your PATH as `bosh`
You need to login to the environment you're targeting beforehand

./bosh_vm_created_at <environment_alias> <deployment_name>

Output is a json array of vms in the deployment sorted by created at time.

license: Unlicense


text:
---
layout: post
category: lcftra
title: Animation System GSE
---
![Photo of control panel](/images/lcftra/GSE/panel assembled.jpg)

Testing, calibrating, and programming of the animation system requires some support hardware. The system uses several communications busses, as well as several hardware enable and status lines which all need to be accessed for programming.

![Assembled main PCBA](/images/lcftra/GSE/main PCBA.jpg)

This piece of GSE is capable of supplying individual valve bank boxes with the control signals needed to either emulate a connection to the main computer, as well as interface a valve bank module with a PC for testing purposes. For more information about how the various pieces of the animation system interface with one another, check out this summary of the new animation system.

![Assembled layered PCBAs mounted to underside of the panel](/images/lcftra/GSE/underside with PCBA.jpg)

This unit is essentially a glorified USB to serial converter. The main PCB consists of a quad USB to serial converter, and several transceivers. The Gilderfluke Br-EFB requires RS-422 for configuration, and uses DMX-512 (a specific RS-485 protocol) for command data. An additional RS-485 transceiver was included for a future hydraulic system monitoring project.

![Underside of panel, wired](/images/lcftra/GSE/panel underside.jpg)

Aside from handling data, the GSE also provides various enable signals for the valve bank module electronics. Each channel's hydraulic vavle driver, as well as the Br-EFB (the PID controller for all 4 channels in each bank), has an indiviudal enable.

![Photo of GSE and remote e-stop](/images/lcftra/GSE/GSE and Estop.jpg)

There is also a port for a remote e-stop button which must be connected in order to enable anything in the valve bank box.

![External photo of GSE enclosure](/images/lcftra/GSE/enclosure external.jpg)

The animation system has since successfully been down the parade route! The float, Tree Frog Night, featured 3 frog musicians and an accompanying cast of dancing fish. For an overview of the animation system's debut, check out this page.

gha_language: CSS


text:
---
layout: tip
title: "Install old versions therubyracer gem on Mac OS X."
date: 2015-10-31 15:30:00
categories: gem ruby rails
tags: gem ruby rails development web therubyracer
comments: true
excerpt: "Install old version of therubyracer gem on Mac OS X without pain."
tip_summary: "Install old version of therubyracer gem on Mac OS X without pain."
image:
  feature: header-image.png
url: /tips/2015-10-31-install-old-versions-therubyracer-gem-on-mac-os-x/
---

I had a problem when I tried to install version 0.10.2 of therubyracer gem on Mac OS X Yosemite, so I searched and I tried different solutions, and the one it works for me was this:

```sh
brew tap homebrew/dupes
brew install apple-gcc42

export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2
export CXX=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2
export CPP=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/cpp-4.2

brew uninstall v8

gem uninstall libv8

gem install therubyracer -v '0.10.2'
```

## Any place where I can pick the code of this tip?

Yeah! Here you have the [Github gist](https://gist.github.com/dreamingechoes/9b76b7eaf86ff1961804) for this tip :)


text:
# pratt

A Pratt parser builder.

Pratt parsers are top-down operator precedence (TDOP) parsers, and they are awesome.  They operate off of a few simple principles, and make expression parsing simple.

Read more about Pratt parsers:

* [here](http://javascript.crockford.com/tdop/tdop.html) (TDOP by Douglas Crockford)
* [here](http://journal.stuffwithstuff.com/2011/03/19/pratt-parsers-expression-parsing-made-easy/) (Pratt Parsers: Expression Parsing Made Easy)
* [and here](https://tdop.github.io/) (Top Down Operator Precedence [the original paper by Vaughan R. Pratt])

## Installation

```sh
npm install --save pratt
# or
yarn add pratt
```

## Usage

This README merely serves as an example. Be sure to [read the API documentation](https://jrop.github.io/pratt/index.html).

Make a simple calculator:

```js
import * as perplex from 'perplex'
import {Parser} from 'pratt'

const lex = perplex('1 + -2 * 3^4')
	.token('NUM', /\d+/)
	.token('+', /\+/)
	.token('-', /-/)
	.token('*', /\*/)
	.token('/', /\//)
	.token('^', /\^/)
	.token('(', /\(/)
	.token(')', /\)/)
	.token('$SKIP_WS', /\s+/)

const parser = new Parser(lex)
	.builder()
	.nud('NUM', 100, t => parseInt(t.match))
	.nud('-', 10, (t, bp) => -parser.parse(bp))
	.nud('(', 10, (t, bp) => {
		const expr = parser.parse(bp)
		lex.expect(')')
		return expr
	})
	.bp(')', 0)

	.led('^', 20, (left, t, bp) => Math.pow(left, parser.parse(bp - 1)))
	.led('+', 30, (left, t, bp) => left + parser.parse(bp))
	.led('-', 30, (left, t, bp) => left - parser.parse(bp))
	.led('*', 40, (left, t, bp) => left * parser.parse(bp))
	.led('/', 40, (left, t, bp) => left / parser.parse(bp))
	.build()

parser.parse()
// => -161
```

## License (ISC)

ISC License (ISC)
Copyright 2017 Jonathan Apodaca<EMAIL_ADDRESS>
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

repository: jrop/pratt

repo_name: jrop/pratt


text:
Cordova Push Notifications for iOS/Android FacebookConnect_Compatible

 (using Realtime Messaging)

Description

This Cordova plugin should be used with the iOS/Android platform together with the Realtime Messaging library (ORTC) for Push Notifications support.

Important

Push Notifications only work in real devices for the iOS platform (not on simulator).

Contents

Project configuration

Manual instalation

API reference

Usage examples

Testing the custom push notifications delivery

Project configuration

Plugin dependencies

iOS Realtime Messaging (ORTC) SDK: download

Android Realtime Messaging (ORTC) SDK: download

SocketRocket library: GitHub repo

Step by step iOS/Android

Add the plugin using the Cordova CLI

cordova plugin add co.realtime.plugins.cordovapush

Generate the APNS certificates for push notification on the Apple Developer Center

			Follow the iOS Push Notifications tutorial

Generate the Android API keys for push notification on the Google Cloud Messaging

			Follow the Android Push Notifications tutorial

Build and run the app in an iOS/Android device

			NOTE: iOS - The Push Notifications won't work on the simulators, only on actual devices.

			NOTE: Android - The Push Notifications will work on the emulators only if is a Google APIs emulator.

API reference

Plugin

checkForNotifications(callback())

This method is used to verify push notifications on buffer on the native code from the javascript interface.

callback() - is triggered after iOS/Android native finishes processing.

connect(config, successCallback(), errorCallback())

This method is used to establish the ORTC connection.

config - is a JSONObject with the config to connect. Ex: {'appkey':'YOUR_APPLICATION_KEY', 'token':'myToken', 'metadata':'myMetadata', 'url':'https://ortc-developers.realtime.co/server/ssl/2.1/','projectId':'YOUR_GOOGLE_PROJECT_NUMBER'}. ProjectId only necessary on Android Push Notifications.

successCallback() - this function is call when connection is established.

errorCallback() - this function is call when connection error exists.

disconnect(callback())

This method is used to disconnect the ORTC connection.

callback() - is triggered after connection is disconnected.

subscribe(channel, callback())

Subscribe a channel. Note: In order to receive the push notifications on the channel you just subscribed you have to add an event listener with the name "push-notification" to your html like:
document.addEventListener("push-notification",
	function(notification)
	{
		window.plugins.OrtcPushPlugin.log("Push-Received  channel: " + notification.channel + " payload: " + notification.payload);
		var payload = document.getElementById('payload');
		payload.innerHTML = JSON.stringify( notification.payload );
		payload.value = JSON.stringify( notification.payload );
	}, false);

The object notification passed as argument on the callback function is an JSONObject with the fields channel and payload, where channel is the name of the channel and payload is the content you sent. (like a JSONObject or a String).

Ex: {"channel":"mychannel","payload":"{"sound":"default","badge":"1","name":"Joe","age" :"48}"}

NOTE: Please in your payload try to avoid '\n' since you can have some issues.

is a JSONObject with the channel to subscribe. Ex: {'channel':'mychannel'}

callback() - is triggered after channel is subscribed.

unsubscribe(channel,callback())

This method is used to unsubscribe a channel previously subscribed.

channel - is a JSONObject with the channel name to unsubscribe. Ex: {'channel':'mychannel'}

callback() - is triggered after channel is unsubscribed.

setApplicationIconBadgeNumber(badge,callback())

This method is used to set the application badge number on iOS. Not implemented on Android.

badge - the number to appear on the bage.

callback() - is triggered after iOS/Android native code finishes.

send(config)

This method is used to send a message to a channel.

config - is a JSONObject with the channel to send the message. Ex: {'channel':'mychannel','message':'mymessage'}.

cancelAllLocalNotifications(callback())

This method is used to clear notifications from notification center.

callback() - is triggered after iOS/Android native code finishes.

log(logString)

This is a handy method to log data into XCODE/AndroidStudio console from the javascript code.

logString - is the string to be logged into the console.

Usage example

Add to your HTML page HEAD section:

<script type="text/javascript">
     document.addEventListener("deviceready",
              function () {
              	if(window.plugins && window.plugins.OrtcPushPlugin){
                		var OrtcPushPlugin = window.plugins.OrtcPushPlugin;
                		OrtcPushPlugin.checkForNotifications();
                 }
               }, false);
</script>

Add to your app:

//Establish connection with ORTC server and subscribe the channel entered in the input text box on the HTML interface.

function subscribe()
           {
               if(window.plugins && window.plugins.OrtcPushPlugin){
                   var OrtcPushPlugin = window.plugins.OrtcPushPlugin;
                   OrtcPushPlugin.log("Connecting");

                   OrtcPushPlugin.connect({'appkey':'YOUR_APPLICATION_KEY', 'token':'myToken', 'metadata':'myMetadata', 'url':'https://ortc-developers.realtime.co/server/ssl/2.1/','projectId':'YOUR_GOOGLE_PROJECT_NUMBER'}, function (){
                                    OrtcPushPlugin.log("Connected: ");
                                    var channel = document.getElementById('channel');
                                    OrtcPushPlugin.log("Trying to subscribe: " + channel.value);
                                    OrtcPushPlugin.subscribe({'channel':channel.value}, function (){
                                                               var subcribed = document.getElementById('subscribed');
                                                               subcribed.innerHTML = "subscribed: " + channel.value;
                                                               OrtcPushPlugin.log("subscribed: " + channel.value);
                                                               //OrtcPushPlugin.disconnect();
                                                               });
                                      });
               }
           };

//Catch the push-notification event when a new notification is received (or tapped by the user)
//Shows the extra property of push notification payload (can be customized using the Realtime Custom Push REST endpoint)

document.addEventListener("push-notification",
	function(notification)
	{
		window.plugins.OrtcPushPlugin.log("Push-Received  channel: " + notification.channel + " payload: " + notification.payload);
		var payload = document.getElementById('payload');
		payload.innerHTML = "payload: " + notification.payload.name;
		payload.value = "payload: " + notification.payload.name;
	}, false);

Testing the custom push notifications delivery

To test your Push Notifications you need to go through the setup process (see the iOS Push Notifications Starting Guide) and use the Realtime REST API to send a custom push with the following POST to https://ortc-mobilepush.realtime.co/mp/publish

{
   "applicationKey": "[INSERT YOUR APP KEY]",
   "privateKey": "[INSERT YOUR APP PRIVATE KEY]",
   "channel" : "[INSERT CHANNEL TO SEND PUSH]",
   "message" : "[INSERT ALERT TEXT]",
    "payload" : "{
     \"sound\" : \"default\",
     \"badge\" : \"1\",
     \"name\" : \"Joe\",
     \"age\" : \"48\"
    }"
}

Have fun pushing!

repository: silvanoAdami/CordovaPush

gha_language: Objective-C

repo_name: silvanoAdami/CordovaPush


text:
# Lab 01
## .NET C# Educational Lab Assignment - About Me

## Learning
This is an educational assignment that focuses on Exception handling and Debugging
- Main method
- External methods
- Return types
- Try Catch Block
You can read more about Try Catch Block

https://stackify.com/csharp-exception-handling-best-practices/

### What to Know Regading Properties and Methods
_Try_

A try block is used to encapsulate a region of code. If any code throws an exception within that try block, the exception will be handled by the corresponding catch.

_Catch_

When an exception occurs, the Catch block of code is executed. This is where you are able to handle the exception, log it, or ignore it.

_Finally_
The finally block allows you to execute certain code if an exception is thrown or not. For example, disposing of an object that must be disposed of.

_Throw_

The throw keyword is used to actually create a new exception that is the bubbled up to a try catch finally block.

### Assignment Specifications
> Your solution should include the following:

>> Main method

>>> external methods- (at least 3 non-void return types)

>>> Have different return types!

>>> At least one try/catch/finally implementation

### Visual
![aboutme](https://user-images.githubusercontent.com/39015829/47262891-5119b180-d4a9-11e8-98be-c6b8b0d6b279.jpg)


text:
# Casters

Program caster.py for command line management of
couchdb design documents

Extracted out of scripts from social farm project at
https://github.com/SocialFarm

# Installation

Download the script and resources somewhere in your
filesystem.  Make the script available in your executable path.

For example do the following in /usr/local/bin:

   ln -s /some/path/caster.py

# Usage

Create a design document skeleton structure

    caster.py [-d dirname] generate

Push/pull a given design document's code to/from a couchdb

    caster.py [-d dirname] pull couchdburl

    caster.py [-d dirname] push couchdburl

For example:

    caster.py -d ./testdesign pull http://usr:pwd@localhost:5984/testdb/_design/testdesign

## Test cases

Creates view directory along with i) a running example test case, ii) a
running sample library file which works through the common js modules
(http://wiki.apache.org/couchdb/CommonJS_Modules), and iii) and a test harness
to enforce identical execution of the map and reduce functions whether
they execute on couchdb or on local system with user inspection/control.

You can safely delete the example/sample files (eg: in lib or tests
directory)

Also note that -f will overwrite existing view on local directory.

    caster.py [-d dirname] [-f] create view name

Run either a single view test cases or all the test cases in all the views

    caster.py [-d dirname] test view name

    caster.py [-d dirname] test

In general you can always go to the tests directory below the view directory and
manually run the tests explicitly eg: js testExample.js

This feature can be used to for example profile your map or reduce function, eg
using the xpc shell javascript interpreter: https://developer.mozilla.org/en-US/docs/Mozilla/XPConnect/xpcshell/Profiling

Similarly, one can interactively debug the execution of map/reduce functions with the visual
rhino debugger: https://developer.mozilla.org/en-US/docs/Rhino/Debugger

## Dependencies
couchdb-python : https://pypi.python.org/pypi/CouchDB
python : tested with 2.7 , but should work a for a few older versions too.

## To be implemented
caster.py [-d dirname] test [show|list|update|filters] name

caster.py [-d dirname] create [show|list|update|filters] name

caster.py [-d dirname] delete [view|show|list|update|filters] name

# Directory stucture

    designname/   (could be any dir though - design doc name seems safer)

        _attachments/   (can have directory tree within here)

        views/
            lib/
            viewname1/
                map.js
                reduce.js
        shows
            show.js

        lists/
            listxxx.js

        updates/
            funcname.js

        filters/
            funcname.js

        validate_doc_update.js

# Goals for maintaining code in couchdb (views/lists/etc)
  - identical code on couchdb and local fs (eg: no include code through
    comment as in couchapp)
  - support common code includes consistent with couchdb through the
    "requires" construct
  - this "identical code" can be run through tools like unit testing
    framework,  debugger, and profiler - and can be better tracked through
    version control tools.

## Additionally, the standard goals (supported by other tools)
  - push your code to couchdb (TODO : skip push if identical)
  - pull code from couchdb
  - maintain any attachments - the attachment files should ideally
    be openable through browser on local system and relative
    links should also work

# Relevant external information

## Tuning javascript code
Javascript code used in map and reduce functions of couchdb
is hard to properly tune while loaded in couchdb

One way to improve code performance is to run the code
locally and time through js, eg:

    js -b test.js

## Readings and relevant links

http://wiki.apache.org/couchdb/JavascriptPatternViewCommonJs

http://wiki.apache.org/couchdb/CommonJS_Modules

https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey?redirectlocale=en-US&redirectslug=SpiderMonkey

https://github.com/WebReflection/wru

repository: vivekpathak/casters

repo_name: vivekpathak/casters


text:
---
title: Field Set
description: null
demo:
  embedded:
  - name: Default Fieldset Example
    slug: example-index
  pages:
  - name: 50/50 Fieldset Example
    slug: example-50-50
  - name: Example Showing Input Fields
    slug: example-fields
---

A field set uses the standard HTML `<fieldset>` and `<legend>` element and simply adds CSS to style the `<legend>` element text. A `<fieldset>` is not expandable. For that, you can use the [expandable area](./expandablearea) component.

Here is an example showing a few input fields in a `<fieldset>`. Anything can go inside a `<fieldset>` but is usually used for input fields.

```html
<form action="#" method="post">
  <fieldset role="region" aria-labelledby="fieldset-id">
    <legend id="fieldset-id">Company Information</legend>

    <div class="field">
      <label for="example-fs-company-name">Company Name</label>
      <input type="text" id="example-fs-company-name" name="example-fs-company-name">
    </div>

    <div class="field">
      <label for="example-fs-company-type">Company Type</label>
      <input type="password" id="example-fs-company-type" name="example-fs-company-type">
    </div>

    <div class="field">
      <label for="example-fs-company-address">Company Address</label>
      <input type="password" id="example-fs-company-address" name="example-fs-company-address">
    </div>

    <button id="submit" class="btn-primary" type="submit">Submit</button>
  </fieldset>
</form>
```

There are some added classes to style sections to look like `<fieldsets>` in cases you semantically choose not to use a `<fieldset>`. The `fieldset-title` class can be combined with a heading tag, like `<h2>`, to add this visual structure to your page. Then you can add a `<hr class="fieldset-hr">` element at the top of each subsequent section for a divider.

```html
<div class="row">
  <div class="twelve columns">
    <h2 class="fieldset-title">Section One</h2>
    <!-- Content Section One-->

    <hr class="fieldset-hr">
    <h2 class="fieldset-title">Section Two</h1>
    <!-- Content Section Two-->

  </div>
</div>

```

## Accessibility

- `role="region"` Should be added to the fieldset region to convey it to non-sighted users.
- `aria-labelledby` Should be added to the dynamic expandable region, where aria-labelledby points back to the fieldset title.

## Testability

You can add custom id's/automation id's to the fieldset component in the input markup inline. For this reason there is no `attributes` setting like some other components.

Please refer to the [Application Testability Checklist](https://design.infor.com/resources/application-testability-checklist) for further details.

## Upgrading from 3.X

- Remove the expand/collapse button
- Remove class `inforFieldSetLabel` and `inforFieldSet`

repository: infor-design/enterprise

gha_language: HTML

repo_name: infor-design/enterprise


text:
spreadsheet
===
[![Build Status](https://travis-ci.org/Iwark/spreadsheet.svg?branch=v2)](https://travis-ci.org/Iwark/spreadsheet)
[![Coverage Status](https://coveralls.io/repos/github/Iwark/spreadsheet/badge.svg?branch=v2)](https://coveralls.io/github/Iwark/spreadsheet?branch=v2)
[![GoReport](https://goreportcard.com/badge/Iwark/spreadsheet)](http://goreportcard.com/report/Iwark/spreadsheet)
[![GoDoc](https://godoc.org/gopkg.in/Iwark/spreadsheet.v2?status.svg)](https://godoc.org/gopkg.in/Iwark/spreadsheet.v2)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Package `spreadsheet` provides fast and easy-to-use access to the Google Sheets API for reading and updating spreadsheets.

Any pull-request is welcome.

## Installation

```
go get gopkg.in/Iwark/spreadsheet.v2
```

## Preparation

This package uses oauth2 client for authentication. You need to get service account key from [Google Developer Console](https://console.developers.google.com/project). Place the ``client_secret.json`` to the root of your project.

## Usage

First you need **service** to start using this package.

```go
data, err := ioutil.ReadFile("client_secret.json")
checkError(err)

conf, err := google.JWTConfigFromJSON(data, spreadsheet.Scope)
checkError(err)

client := conf.Client(context.TODO())
service := spreadsheet.NewServiceWithClient(client)
```

Or there is a shortcut which does the same things:

```go
service, err := spreadsheet.NewService()
```

### Fetching a spreadsheet

```go
spreadsheetID := "1mYiA2T4_QTFUkAXk0BE3u7snN2o5FgSRqxmRrn_Dzh4"
spreadsheet, err := service.FetchSpreadsheet(spreadsheetID)
```

### Create a spreadsheet

```go
ss, err := service.CreateSpreadsheet(spreadsheet.Spreadsheet{
	Properties: spreadsheet.Properties{
		Title: "spreadsheet title",
	},
})
```

### Find a sheet

```go
// get a sheet by the index.
sheet, err := spreadsheet.SheetByIndex(0)

// get a sheet by the ID.
sheet, err := spreadsheet.SheetByID(0)

// get a sheet by the title.
sheet, err := spreadsheet.SheetByTitle("SheetTitle")
```

### Get cells

```go
// get the B1 cell content
sheet.Rows[0][1].Value

// get the A2 cell content
sheet.Columns[0][1].Value
```

### Update cell content

```go
row := 1
column := 2
sheet.Update(row, column, "hogehoge")
sheet.Update(3, 2, "fugafuga")

// Make sure call Synchronize to reflect the changes.
err := sheet.Synchronize()
```

### Expand a sheet

```go
err := service.ExpandSheet(sheet, 20, 10) // Expand the sheet to 20 rows and 10 columns
```

### Delete Rows / Columns

```go
err := sheet.DeleteRows(0, 3) // Delete first three rows in the sheet

err := sheet.DeleteColumns(1, 4) // Delete columns B:D
```

More usage can be found at the [godoc](https://godoc.org/gopkg.in/Iwark/spreadsheet.v2).

## Example

```go
package main

import (
	"fmt"
	"io/ioutil"

	"gopkg.in/Iwark/spreadsheet.v2"
	"golang.org/x/net/context"
	"golang.org/x/oauth2/google"
)

func main() {
	data, err := ioutil.ReadFile("client_secret.json")
	checkError(err)
	conf, err := google.JWTConfigFromJSON(data, spreadsheet.Scope)
	checkError(err)
	client := conf.Client(context.TODO())

	service := spreadsheet.NewServiceWithClient(client)
	spreadsheet, err := service.FetchSpreadsheet("1mYiA2T4_QTFUkAXk0BE3u7snN2o5FgSRqxmRrn_Dzh4")
	checkError(err)
	sheet, err := spreadsheet.SheetByIndex(0)
	checkError(err)
	for _, row := range sheet.Rows {
		for _, cell := range row {
			fmt.Println(cell.Value)
		}
	}

	// Update cell content
	sheet.Update(0, 0, "hogehoge")

	// Make sure call Synchronize to reflect the changes
	err = sheet.Synchronize()
	checkError(err)
}

func checkError(err error) {
	if err != nil {
		panic(err.Error())
	}
}
```

## License

Spreadsheet is released under the MIT License.

repository: Iwark/spreadsheet

gha_language: Go

repo_name: Iwark/spreadsheet


text:
---
layout: post
comments: true
description:
categories: [collaboration]
last_modified_at: 2022-09-24T20:52:08.052481
last-modified-purpose:
permalink: /empathic-developer/
title: Be a more empathic developer
toc: false
image: /images/empathic-developer.jpg
---
![](/images/empathic-developer.jpg)

Photo by Annie Spratt on Unsplash

It's easy to blame. It's harder to empathize.

# It's easier to refactor than to create code from scratch.

If you are creating code from scratch. You wouldn't know many things because the requirements aren't clear.

But if you are refactoring or fixing bugs, requirements at that point are likely pretty clear.

# Everyone has had a different past experience.

Some people aren't even developers but jumped into the field for good money. They might have been poor in the past and for them, money is the main thing in Maslow's Hierarchy Of Needs.

Some are good developers but have too many things going on. Maybe family. Maybe something else.

Some are good developers but dragged into roles that aren't totally for them. For example Managers.

Some people didn't even have a Computer Science degree. They are from some other field.

Even if they are a good developer, most problems in Software Development & in #life are questions of knowing the right thing. If you don't, you are kind of lost. Therefore it's useful to rely upon and discuss with everyone before trying to implement something.

# Rather than blaming, look at the problem. Emphasize with one who is facing it. And be useful to suggest a path forward.

It isn't useful to run away. Stand there with them, and help them out on their task.

repository: ankschoubey/blog

repo_name: ankschoubey/blog


text:
# Moq SDK

As explained in the [Overview](Overview.md), the goal of this SDK is to provide a common low-level API that allows rich mocking APIs to be built on top. Moq itself is of course the primary example and driver of the SDK features, but they are not tied to any particular setup or verification API. In particular, it provides method invocation matching/setup and introspection, invocation recording and instrospection, and a general-purpose state bag associated with every mock object for use in custom behaviors.

The SDK builds on top of [Stunts](Stunts.md) and its behavior pipeline. The Moq SDK provides sub-pipelines of (mock) behaviors that are executed in order whenever the sub-pipeline setup matches the current invocation, such as:

```
MyProxy
    - stunt behavior 1 (i.e. record all calls)
    - stunt behavior 2 (i.e. logging)
    - mock (stunt) behavior 3 for setup X (i.e. a property getter)
        - stunt behavior a (i.e. invoke a callback)
        - stunt behavior b (i.e. return a value)
    - mock (stunt) behavior 4 for setup Y (i.e. a method invocation with specific argument values)
        - stunt behavior c (i.e. invoke a callback)
        - stunt behavior d (i.e. throw an exception)
    - stunt behavior 5 (i.e. return default values)
```

The SDK extends the *Stunts* [AppliesTo](../src/Stunts/Stunts/IStuntBehavior.cs#L14) concept (a simple boolean given an [IMethodInvocation](../src/Stunts/Stunts/IMethodInvocation.cs)) and turns into a flexible argument matching strategy configured via the mock's setup operations. The responsibility for matching an invocation to a given setup is in [MockSetup.AppliesTo](https://github.com/moq/moq/blob/master/src/Moq/Moq.Sdk/MockSetup.cs#L32) in Moq.

The SDK also extends the *Stunts* code generation, automatically implementing [IMock](https://github.com/moq/moq/blob/master/src/Moq/Moq.Sdk/IMock.cs) on all generated classes. This interface gives the mocking library author access to the following key features of a mock:

The first step in getting your mocking API going is to provide a static factory method for your mocks. *Moq* itself provides this via the [Mock.Of](https://github.com/moq/moq/blob/master/src/Moq/Moq/contentFiles/cs/netstandard2.0/Mock.Overloads.cs) static method overloads, which follows the same approach as the [Stunt.Of](https://github.com/moq/moq/blob/master/docs/Stunts.md#stunt-factory) factory, and leverages the code generation provided by the Stunts and Moq SDKs to emit the "proxy" classes (a.k.a. *stunts*) into the test/app assembly itself.

You could create the following static class in your test project that references the `Moq.Sdk`:

```csharp
using System;
using System.Reflection;
using Moq.Sdk;

public static class Mocker
{
    [MockGenerator]
    public static T For<T>()
        => (T)MockFactory.Default.CreateMock(typeof(Mocker).Assembly, typeof(T), new Type[0], new object[0]);
                                //CreateMock(mocksAssembly, baseType, implementedInterfaces, construtorArguments)
}
```

Marking a method with `[MockGenerator]` is all that's needed to trigger the code generation in the SDK whenever it's used. In the case above, we're using the default [MockFactory](https://github.com/moq/moq/blob/master/src/Moq/Moq.Sdk/MockFactory.cs) which looks up a matching type in the current assembly based on a default naming convention for mocks (i.e. for a `Mocker.For<IServiceProvider>`, it would attemt to locate a type named `Mocks.IServiceProviderMock`).

In the case above, the resulting mock won't be very useful, since it doesn't have any built-in behaviors. The following are some of the commonly used behaviors you can easily add to a mock before returning it from the factory method:

1. [PropertyBehavior](https://github.com/moq/moq/blob/master/src/Moq/Moq.Sdk/PropertyBehavior.cs): provides an automatic "backing field" in the mock' `State` to implement property getter/setters.

```csharp
    [MockGenerator]
    public static T For<T>()
        => (T)MockFactory.Default.CreateMock(typeof(Mocker).Assembly, typeof(T), new Type[0], new object[0])
                         .AddBehavior(new PropertyBehavior());
```

2.  [EventBehavior](https://github.com/moq/moq/blob/master/src/Moq/Moq.Sdk/EventBehavior.cs): implements events so that they support adding/removing event handlers, as well as raising events using an [EventRaiser](https://github.com/moq/moq/blob/master/src/Moq/Moq.Sdk/EventRaiser.cs), like [Moq.Raise](https://github.com/moq/moq/blob/master/src/Moq/Moq/Raise.cs) class does:

```csharp
    [MockGenerator]
    public static T For<T>()
        => (T)MockFactory.Default.CreateMock(typeof(Mocker).Assembly, typeof(T), new Type[0], new object[0])
                         .AddBehavior(new EventBehavior());

    ...
    using static Moq.Syntax;
    ...
    var changed = Mocker.For<INotifyPropertyChanged>();
    var property = "";
    mock.PropertyChanged += (sender, args) => property = args.PropertyName;

    // Raise the event
    mock.PropertyChanged += Raise<PropertyChangedEventHandler>(new PropertyChangedEventArgs("Mode"));

    Assert.Equal("Mode", property);
```

## Mock Introspection

All generated mocks implement `IMocked`, from which you can retrieve the mock introspection information via the `IMock Mock { get; }` property. The [IMock](https://github.com/moq/moq/blob/master/src/Moq/Moq.Sdk/IMock.cs) exposes:

* `Invocations`: a list of all invocations performed on the mock, which can be modified at will.
* `Setups`: an enumeration of the configured mock behaviors (sub-pipelines) within the overall behaviors of the stunt.
* `State`: a general purpose, concurrent-safe state bag associated with the mock.

The introspection API has been heavily annotated with debugger hints so that when inspecting a mock in the debugger, the rendering is useful and easy to explore:

By default, the received invocations are shown:

![Mock Debugger](https://raw.githubusercontent.com/moq/moq/master/docs/img/MockSdk_Debugger.png)

Expanding the Invocations property shows a friendly rendering of what they were:

![Mock Debugging Invocations](https://raw.githubusercontent.com/moq/moq/master/docs/img/MockSdk_DebuggerInvocations.png)

Setups shows the configured mock behaviors for a given setup (or invocation matcher):

![Mock Debugging Setups](https://raw.githubusercontent.com/moq/moq/master/docs/img/MockSdk_DebuggerSetups.png)

State renders the state bag associated with the mock, which in this case holds the backing field for the assigned Mode property, the backing delegate for the subscribed event, among other things:

![Mock Debugging State](https://raw.githubusercontent.com/moq/moq/master/docs/img/MockSdk_DebuggerState.png)

Finally, the overall collection of stunt behaviors is also available:

![Mock Debugging Behaviors](https://raw.githubusercontent.com/moq/moq/master/docs/img/MockSdk_DebuggerBehaviors.png)

repository: AzureMentor/moq

repo_name: AzureMentor/moq


text:
week-days-selector
===============================

Bootstrap Week days selector (combobox)

[See the demo](http://artemdude.github.io/week-days-selector/index.html)

![ScreenShot](https://raw.github.com/artemdude/week-days-selector/master/screenshots/week-days-selector.png)

repository: shkolovy/week-days-selector

repo_name: shkolovy/week-days-selector


text:
![GitHub package.json version](https://img.shields.io/github/package-json/v/nolindnaidoo/enterprise-react-components) ![Node](https://img.shields.io/badge/node%20-8-yellow.svg) ![Travis (.org)](https://img.shields.io/travis/nolindnaidoo/enterprise-react-components) ![GitHub repo size](https://img.shields.io/github/repo-size/nolindnaidoo/enterprise-react-components?color=g) ![GitHub](https://img.shields.io/github/license/nolindnaidoo/enterprise-react-components)

Enterprise React Components

A Design System / Component Library Template for enabling graphic consistency and legibility across web development projects by creating reusable components and styles with accessible & legible documentation. Built with [React 16](https://reactjs.org) and [Semantic UI React](https://react.semantic-ui.com/introduction). Package Management via [Yarn](https://yarnpkg.com/en/). Lint and Beautification handled by [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), and [Airbnb Config](https://www.npmjs.com/package/eslint-config-airbnb). Unit Testing executed by [Jest](https://facebook.github.io/jest/) with [Enzyme](https://github.com/airbnb/enzyme). Continuous Integration & Deployment with [Travis-CI](https://travis-ci.com/) and [Github](https://github.com/), but can easily be swapped out for any CI/CD system you require.

### Core Libraries

- [React](https://facebook.github.io/react) React makes it painless to create interactive, scale-able UIs.
- [Semantic UI React](https://react.semantic-ui.com/introduction) User Interface is the language of the web.
- [Video-React](https://video-react.js.org) The web video player built from the ground up for an HTML5 world using React library.
- [Airbnb/rheostat](https://github.com/airbnb/rheostat) Rheostat is a www, mobile, and accessible slider component built with React.
- [Jest](https://facebook.github.io/jest/) is a delightful JavaScript Testing Framework with a focus on simplicity.
- [Yarn](https://yarnpkg.com/en/) Fast, reliable and secure dependency management.

Quick Start

### Install

- `yarn add enterprise-react-components` - Install package from private [NPM Registry](https://docs.npmjs.com/getting-started)

### Usage Example

- Import Button component:

  ```
  import React, { Component } from 'react';
  import { Button } from 'enterprise-react-components';

  export default class App extends Component {
    render() {
      return (
        <Button />
      )
    }
  ```

Development Setup

## Scripts

- `yarn start` - Install dependencies, run lint, run verbose tests, and deploy development server.
- `yarn run build` - Install dependencies, run lint, run silent tests, and create production bundle
- `yarn run storybook` - Build and deploy Storybook

## Environment

- Install [NVM](https://github.com/nvm-sh/nvm) (Optional)
- Install [Node 8](https://nodejs.org/dist/latest-v8.x/)
- Install [YarnPKG](https://yarnpkg.com/en/docs/install)
- Install [Git](https://git-scm.com/downloads) and run these commands to configure it:
  - `> git config --global user.name "{FULL_NAME}"`
  - `> git config --global user.email {EMAIL}`
  - `> git config --global core.autocrlf false`.
  - Refer to [Advanced Git Configuration](https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration) for additional information
- Setup [SSH](https://help.github.com/articles/connecting-to-github-with-ssh/)
- Clone Repository `git clone git@github.com:nolindnaidoo/enterprise-react-components.git`
- Setup & Publish [NPM Registry](https://docs.npmjs.com/getting-started)

## Git

The Git Feature Branch Workflow is a composable workflow that can be leveraged by other high-level Git workflows. This project utilizes the [Github Flow](https://guides.github.com/introduction/flow/), which allows for fast-paced and high-quality parallel development.

#### Github Flow:

- Create the branch. Make sure it begins with the `feature/`, `hotfix/`, `bugfix/`, `semver/` prefix.
- Add commits
- Open a Pull Request
- Review & Collaborate changes
- Deploy and Test
- Merge

#### Merging from Main

A best practice is to perform merging when the working tree is clean. Use caution, first commit any unfinished work still desired, or reset the Git working tree. Choose `> git stash` and save the working tree until ready. Alternatively, reset the working tree. `> git reset --hard`

Staying up-to-date with the latest from `main` is beneficial to parallel development. Remote `main` represents the most stable and approved iteration of the product. In Parallel Development, updates to `main` may affect current implementation. Work with the latest from `main` by merging the latest from `main` into `feature/{name}` as frequently as possible, but only when necessary.

#### Merging from Main Procedure

- `> git reset --hard` or `> git stash`
- `> git checkout main`
- `> git pull`
- `> git checkout "feature/{name}"`
- `> git merge main`
- No Conflicts: Auto-merge Successful
- Conflicts: Resolve Conflicts and run:
  - `> git add .`
  - `> git commit -m "merge main, resolved conflicts"`
  - `> git push`

#### Merging to Main

- Make sure your feature branch is not behind the main. You can view it from the [Branch Status](https://github.com/nolindnaidoo/enterprise-react-components/branches) view in the Behind/Ahead column.
- Verify that your feature branch builds successfully on [TravisCI](https://travis-ci.org/github/nolindnaidoo/enterprise-react-components/branches).
- Check your coverage against main. The Feature Branch should be greater than or equal to the main.
- Resolve or reply to all Pull Request comments.
- Use the Merge button on the Pull Request to merge back to main.
- Once the test is successful and no further changes are needed for sign off delete the original feature branch.

## Unit Testing

- [Jest](https://facebook.github.io/jest/) is a delightful JavaScript Testing Framework with a focus on simplicity.
- [EnzymeComponent](https://github.com/airbnb/enzyme) is a JavaScript testing utility for [React](https://facebook.github.io/react).

## Continuous Integration & Deployment

The following links provide enhanced awareness throughout the Agile SDLC process. Save as bookmarks for rapid development.

- [Branch Status](https://github.com/nolindnaidoo/enterprise-react-components/branches)
- [Pull Request Status](https://github.com/nolindnaidoo/enterprise-react-components/pulls)
- [TravisCI Repo Dashboard](https://travis-ci.org/github/nolindnaidoo/enterprise-react-components)

## ESLint

Enterprise React Components uses [Airbnb ESLint rules](https://github.com/airbnb/javascript) for lint/syntax errors, along with [Prettier](https://github.com/prettier/prettier) for automated formatting and lint error fixing.

#### Exceptions

- [class-methods-use-this](http://eslint.org/docs/rules/class-methods-use-this) is not always needed in lifecycle/render methods.
- [react/no-unescaped-entities](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md) prevents characters that were meant as JSX escape characters.
- [react/jsx-filename-extension](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md) forces .js as the extension for files with JSX.
- [react/no-unused-prop-types](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-prop-types.md) fixes a bug when using `PropTypes.shape`.
- [react/require-default-props](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-default-props.md) was allowed to be undefined early on.

## IDE's

Take advantage of advanced workflow features by using supported IDE's with the appropriate plugins.

### Atom

- Install [Atom](https://atom.io)
- Install Packages
  - atom-css-clean
  - autoclose-html
  - autocomplete-json
  - autocomplete-modules
  - busy-signal
  - file-icons
  - highlight-selected
  - html-escaper
  - intentions
  - language-babel
  - linter
  - linter-eslint
  - linter-htmlhint
  - linter-ui-default
  - markdown-preview-enhanced
  - pigments
  - prettier-atom
  - sort-lines
  - terminal-panel-uoa

### Visual Studio Code

- Install [Visual Studio Code](https://code.visualstudio.com)
- Install Packages
  - christian-kohler.path-intellisense
  - dbaeumer.vscode-eslint
  - donjayamanne.githistory
  - emmanuelbeziat.vscode-great-icons
  - esbenp.prettier-vscode
  - formulahendry.auto-close-tag
  - vstirbu.vscode-mermaid-preview
  - wayou.vscode-todo-highlight
  - zhuangtongfa.Material-theme


text:
## Logging Configuration

Hazelcast has a flexible logging configuration and doesn't depend on any logging framework except JDK logging. It has in-built adaptors for a number of logging frameworks and also supports custom loggers by providing logging interfaces.

To use built-in adaptors you should set `hazelcast.logging.type` property to one of predefined types below.

-   **jdk:**JDK logging (default)

-   **log4j:**Log4j

-   **slf4j:**Slf4j

-   **none:**disable logging

You can set `hazelcast.logging.type` through configuration xml, configuration API or JVM system property.

-   **Configuration xml**

```xml
<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config
    http://www.hazelcast.com/schema/config/hazelcast-config-3.0.xsd"
    xmlns="http://www.hazelcast.com/schema/config"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    ....

    <properties>
        <property name="hazelcast.logging.type">jdk</property>
        ....
    </properties>
</hazelcast>
```
-   **Configuration API**

```java
Config cfg = new Config() ;
cfg.setProperty("hazelcast.logging.type", "log4j");
```
-   **System Property**

1.  Using JVM parameter: `java -Dhazelcast.logging.type=slf4j`

2.  Using System class: `System.setProperty("hazelcast.logging.type", "none");`

To use custom logging feature you should implement `com.hazelcast.logging.LoggerFactory` and `com.hazelcast.logging.ILogger` interfaces and set system property `hazelcast.logging.class` to your custom `LoggerFactory` class name.

```
java -Dhazelcast.logging.class=foo.bar.MyLoggingFactory
```
You can also listen to logging events generated by Hazelcast runtime by registering `LogListener`s to`LoggingService`.

```java
LogListener listener = new LogListener() {
    public void log(LogEvent logEvent) {
        // do something
    }
}
LoggingService loggingService = Hazelcast.getLoggingService();
loggingService.addLogListener(Level.INFO, listener):
```
Through the `LoggingService` you can get the current used ILogger implementation and log your own messages too.

repository: harunpehlivan/hazelcast

gha_language: Java

repo_name: harunpehlivan/hazelcast