text:
![build](https://travis-ci.org/granturing/spark-power-bi.svg)

# This is no longer being maintained
Please see Azure Databricks for the latest [instructions](https://docs.azuredatabricks.net/user-guide/clusters/power-bi.html) on using Apache Spark with Power BI

# spark-power-bi
A library for pushing data from Spark, SparkSQL, or Spark Streaming to [Power BI](https://powerbi.com/).

## Requirements
This library is supported on Apache Spark 1.4 and 1.5. The versions of the library match to the Spark version. So v1.4.0_0.0.7 is for Apache Spark 1.4 and v1.5.0_0.0.7 is for Apache Spark 1.5.

## Power BI API
Additional details regarding the Power BI API are available in the [developer center](https://msdn.microsoft.com/en-us/library/dn877544.aspx). Authentication is handled via OAuth2 with your Azure AD credentials specified via Spark properties. More details on registering an app and authenticating are available in the Power BI dev center. When pushing rows to Power BI the library will create the target dataset with table if necessary. The current Power BI service is limited to 10,000 rows per call so the library handles batching internally. The service also limits to no more than 5 concurrent calls at a time when adding rows. This is handled by the library using coalesce and can be tuned by with the `spark.powerbi.max_partitions` property.

## Scaladoc
Scaladoc is available [here](http://granturing.github.io/spark-power-bi/docs)

## Configuration
A few of the key properties are related to OAuth2. These depend on your application's registration in Azure AD.
```
spark.powerbi.username
spark.powerbi.password
spark.powerbi.clientid
```

Rather than using your personal AD credentials for publishing data, you may want to create a service account instead. Then you can logon to Power BI using that account and share the data sets and dashboards with other users in your organization. Unfortunately, there's currently no other way of authenticating to Power BI. Hopefully in the future there'll be an organization-level API token that can publish shared data sets, without having to use an actual AD account. You can also use a Power BI group when publishing data.

### Setting Up Azure Active Directory
You'll need to create an application within your Azure AD in order to have a client id to publish data sets.

1. Using the Azure management portal, open up your directory and add a new Application (under the Apps tab)
2. Select "Add an application my organization is developing"
![step0](http://granturing.github.io/spark-power-bi/images/AD_Setup_0.png)
3. Enter any name you want and select "Native Client Application"
![step1](http://granturing.github.io/spark-power-bi/images/AD_Setup_1.png)
4. Enter a redirect URI, this can be anything since it won't be used
![step2](http://granturing.github.io/spark-power-bi/images/AD_Setup_2.png)
5. Once the app has been added you need to grant permissions, click "Add application"
![step3](http://granturing.github.io/spark-power-bi/images/AD_Setup_3.png)
6. Select the "Power BI Service"
![step4](http://granturing.github.io/spark-power-bi/images/AD_Setup_4.png)
7. Add all 3 of the delegated permissions
![step5](http://granturing.github.io/spark-power-bi/images/AD_Setup_5.png)
8. Save your changes and use the newly assigned client id for the `spark.powerbi.clientid` property
![step6](http://granturing.github.io/spark-power-bi/images/AD_Setup_6.png)

## Spark Core
```
import com.granturing.spark.powerbi._

case class Person(name: String, age: Int)

val input = sc.textFile("examples/src/main/resources/people.txt")
val people = input.map(_.split(",")).map(l => Person(l(0), l(1).trim.toInt))

people.saveToPowerBI("Test", "People")
```

## SparkSQL
```
import com.granturing.spark.powerbi._
import org.apache.spark.sql._

val sqlCtx = new SQLContext(sc)
val people = sqlCtx.jsonFile("examples/src/main/resources/people.json")

people.write.format("com.granturing.spark.powerbi").options(Map("dataset" -> "Test", "table" -> "People")).save
```

## Spark Streaming
```
val sc = new SparkContext(new SparkConf())
val ssc = new StreamingContext(sc, Seconds(5))

val filters = args

val input = TwitterUtils.createStream(ssc, None, filters)

val tweets = input.map(t => Tweet(t.getId, t.getCreatedAt, t.getText, t.getUser.getScreenName))
val hashTags = input.flatMap(t => t.getHashtagEntities.map(h => HashTag(t.getId, h.getText, t.getUser.getScreenName)))

tweets.saveToPowerBI(dataset, "Tweets")
hashTags.saveToPowerBI(dataset, "HashTags")

ssc.start()
ssc.awaitTermination()
```

## Referencing As A Dependency
You can also easily reference dependencies using the `--packages` argument:
```bash
spark-shell --package com.granturing:spark-power-bi_2.10:1.5.0_0.0.7
```

## Building From Source
The library uses SBT and can be built by running ```sbt package```.

repository: Auguronomics/spark-power-bi

repo_name: Auguronomics/spark-power-bi


text:
# Spec

A given program has only a single serialization as a byte stream.  A valid byte stream serialization has only a single in-memory representation.  In other words, programs are written in a canonical form.  Deviations from this canonical form are a syntax error.

Syntax errors:

  * presence of tab characters
  * presence of trailing spaces
  * presence of carriage return characters
  * missing a version number
  * using a non-UTF8 encoding

Outlawed characters are allowed within raw character strings.

# Examples

These two values are semantically identical.  However, only the first is in canonical form so it’s the only valid one.

    foo bar baz 2+3
    foo(bar baz +(2 3))

It’s expected that lenient tools will convert from the latter to the former.  This could be a helpful guide for those just learning the canonical syntax.

Lenient tools are also helpful during development.  I programmer doesn't have to fret about canonical syntax.  He types something that's roughly correct and his editor automatically converts it to canonical syntax when he saves.  The GoSublime package (for Sublime Text editor) does this.  It's a pleasure to work with.  I type out huge swaths of ugly code and it instantly reformats them nicely and cleanly.

# Reasoning

Writing programs in a canonical form eliminates bickering/policies/rewrites caused by unimportant layout details.  It allows SCM tools to perform diffs on the underlying data structure without tripping over semantically irrelevant layout details.  Tools can generate code (refactoring editors, etc) and have it automatically match the surrounding code style.  Primitive  analysis tools can pattern match the canonical syntax without having to cover hundreds of equivalent variants or write a full parser.

Most languages have pretty printers which reformat source code to comply with best practices.  Go takes this somewhat further by mandating specific layout on if-else blocks.  It works quite well in practice.  It also provides a lenient tool (`go fmt`) for converting from lazy to strict syntax.  OS X's AppleScript editor automatically converts lazy syntax into strict syntax when saving (changes layout, changes field names, etc).

By giving syntax errors for all deviations from canonical form, we reserve huge swaths of syntax for future expansion.  If the compiler leniently allowed syntax variations, developers would squat on that syntax (by using it in their code).  Then we’d lose it for productive future expansion.

# Use Cases

Static analysis tools, refactoring tools, source code management tools.  Future syntax expansion.

license: Unlicense

repository: amalog/scratch

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: amalog/scratch


text:
# ![Mosaic Logo](http://mindlab.ai/images/mosaic.png)
# Mosaic
The Ultimate JavaFX, Multi-split, Drag-n-Drop Layout Manager

[![htm.java awesomeness](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](http://cogmission.ai)
***

## On [YouTube](https://youtu.be/eVH-Q85hqe0) (CLICK!)

# ![Demo](http://mindlab.ai/images/MosaicDemo.gif)

Mosaic is an **amazing** new layout manager which allows you to split your screen however you want with no nesting; Drag dividers in _**ANY**_ direction; and Drag-N-Drop contents anywhere, and the layout will intelligently morph into a new configuration while snapping to suggested locations!

OH YEAH...

Using Any Java Windowing Toolkit! (i.e. JavaFX, Swing, Apache Pivot etc.)

**Discerning Developer:** "Sounds cool... How does it do that!!!?"

Mosaic is an engine that furnishes dimensions and locations for objects it is given. So...
Step 1: Load it with objects in the same container
Step 2: Attach mouse listener to your container (albeit JavaFX Node, Swing or Apach Pivot Container); inside of which; forward events to the Mosaic Engine
Step 3: Inside listener, apply location and dimension instructions to the object it tells you to...

Easy peasy!

***

### To use Demo: (in the "src/test/java" source tree)

1. Fork or clone repo
2. Setup in the IDE of your choice
3. Run the:
  * ai.cogmission.mosaic.refimpl.javafx.MosaicPaneRefImpl.java
  * -- or --
  * ai.cogmission.mosaic.refimpl.pivot.MosaicPaneRefImpl.java
4. All Dependencies are in "libs" directory.

***

### To Implement yourself: (in the "src/main/java" source tree)

Take a look at the  ai.cogmission.mosaic.refimpl.javafx.MosaicPane.java or  ai.cogmission.mosaic.refimpl.pivot.MosaicPane.java file for reference on how to implement your own container that can be managed by the Mosaic Engine.

Better instructions are on the way... (we need your help!)

***

### To Contribute: (This _**is**_ open source and free after all)

Contact me at<EMAIL_ADDRESS>

repository: myteer/Mosaic

repo_name: myteer/Mosaic


text:
---
title: Towards Crystal 1.0
summary: The upcoming efforts to release Crystal 1.0
thumbnail: +
author: bcardiff
---

Currently the main goal of the Crystal core team is to reach 1.0 in the near future. Since achieving that goal involves a number of non-obvious tradeoffs, we want to use this post to shed some light on those inherent tensions and how they drive our work and priorities for the next few releases.

There are three main aspects of the Crystal ecosystem that in a way compete for resources and design decisions (when we say "Crystal ecosystem", we mean: the compiler, the std-lib, official-ish and community shards, apps that depend on Crystal, and the community itself):

The language is already widely used, so we want to minimize the number of breaking changes, and when we can’t avoid them, at least minimize their impact on existing codebases.
We want 1.0 to be a stable version of the language.
We want the language to keep evolving (said another way, we don’t want the fact that we reached 1.0 to mean that we’re left with an ossified language).

The challenge at hand is to get as quickly as possible to a 1.0 version of Crystal that is at the same time as faithful as possible to the current state of the language, stable enough for individuals and organizations to feel comfortable adopting it for even their highest impact projects, and a solid foundation for future major versions.

Considering this context, the most important question to answer almost continuously is: what should happen before 1.0 and what can wait? Let’s delve into that!

## What **can** wait? - after 1.0

Since we created Crystal, the language kept evolving through a very free process of exploration of new ideas, sometimes experimental ones, that we hoped would bring joy and productivity to the programmer at the end of the day. Sometimes these ideas end up requiring changes in the language. We want to continue receiving and exploring these new ideas, because these organic processes are what made Crystal what it is.

However, paying excessive attention to these kinds of novel ideas takes away precious resources and focus from the main goal of releasing 1.0. While approaching that, there will be less focus on new and enhanced features that require changes to the language.

There are also important features that are strongly wanted, but they do not require changes in the language itself. These will likely keep receiving lots of attention from the community and we will do our best to review and give feedback to help them move forward. But we will mainly be focused on the features that are holding back 1.0.

Let us go over some of those features, which might well make it into eventual 1.x versions of the language:

**Windows**: We aim for most of the shards and apps built on Crystal to be portable. The std-lib should hide platform specific aspects as well as possible. With that in mind adding more platforms to the supported list should not impact neither the language nor the public API. Again, recently we integrated a CI for Windows to ensure we continue moving steadily forward.

**Debugger**: Improving the debugging capabilities requires changes to the compiler and tool ecosystem but not to the language. There is ongoing effort from the community and further collaboration is expected and welcome. The current efforts are looking amazing. These may or may not land in 1.0, it depends a lot on timing of testing and feedback.

**Multi-threading**: There are pending stories to make multi-thread mode a non preview feature. To mention a few: which the desired guarantees for some parts of the std-lib are, or how the scheduler and runtime could be improved. We already polished `GC`, `Channel`, `select` and `IO` to behave correctly with multi-threading on. Future potential enhancements may allow you to use multiple threads more freely, but the core aspects of the language and runtime are set and done.

**X or Y compiler bug**: We will keep fixing them, before and after 1.0. Their existence didn’t prevent the existing community from building awesome stuff.

## What **can’t** wait? - before 1.0

So, what is missing to reach 1.0?

**tooling**: There are a couple of stories regarding tooling that are missing and need improvements. Shards needs to be more solid for 1.0 (you might have noticed some work in the last couple of weeks on that).

**multi-thread stability & documentation**: With 0.33.0 we added some new features for multi-thread and improved IO handling. We want and need thread-safe IO, Channel and runtime.

**std-lib polishing**: Although the std-lib will keep evolving we know there are a couple of modules that do need at least a couple of iterations. We want to improve the current API before 1.0 so we allow more solid solutions to be built upon these features. Some examples of these modules include logging, Errno and general exceptions type hierarchy, as well as removing clutter from the top-level namespace.

These areas are the ones Manas & the rest of the core-team will invest most of their effort until 1.0 is reached.

## Summary

With this post, we want to provide some clarity on what to expect and what not to expect from the Crystal core team for the next few months.

Of course, other areas that are not mentioned can still receive contributions. But we want to be transparent on the need to aim for fewer, smaller and self-contained changes in the API to include them in 1.0. Said another way, we’ll be much more conservative as regards our merge policy until we get to 1.0.

We already have many plans for after 1.0 that we’ll be excited to start sharing and investing efforts on after celebrating Crystal 1.0. Let’s get there first!

repository: crystal-lang/crystal-website

gha_language: SCSS

repo_name: crystal-lang/crystal-website


text:
# CHANGELOG

## v0.8.1

- Fix typo's in readme
- Update mobc-postgres and mobc-redis to use latest version

## v0.8.0

- Replaces channels with Sempahores
- Adds metrics

## v0.7.3 2021-6-25

- Support the actix-rt v1.0.

## v0.7.2 2021-4-2

- Retry when connection check fails on checkout

## v0.7.1 2021-3-12

- Optimize the internal get requests queue.

## v0.7.0 2021-1-19

- Compatible with Tokio 1.0

## v0.5.12 2020-07-08

- Add a new method `into_inner` to `connection` to unwrap the raw connection.

## v0.5.11 2020-6-17

- Upgrade the `future-timer`.

## v0.5.10 2020-6-3

- Add a sync hook `validate` in the `Manager` trait to _quickly_ determine connections are still valid when check-in

## v0.5.9 2020-6-3

- Fix get timeout.

## v0.5.8(yanked) 2020-6-1

- Add a hook to determine connections are valid when check-in.

## v0.5.7 2020-03-28

- Fix PANIC: overflow when subtracting duration from instant.

## v0.5.6 2020-03-26

- Fixes to health checks, add a check interval

## v0.5.5 2020-03-24

- Add a new option to set connection's max idle lifetime.

## v0.5.4 2020-03-17

- Do not run the `check` if `health_check` is false.

## v0.5.3 2020-01-17

- Fix performance regression.

## v0.5.2 2020-01-17

- Do health check for the connection before return it.
- Add configure item `health_check`.
- Impl Debug for State.
- Add method is_brand_new to Connection, which returns true if the connection is newly established.
- Skip health check of those new connections.

## v0.5.1 2020-01-07

- Switch to `async-trait`
- Switch to `futures-timer`
- Add more examples

## v0.4.1 2019-12-29

#### Add

- Export `spawn`;

## v0.4.0 2019-12-24

#### Fix

- Tix tests

## v0.4.0-alpha.4 2019-12-24

#### Add

    * `Pool.set_max_open_conns` - Sets the maximum number of connections managed by the pool.
    * `Pool.set_max_idle_conns` - Sets the maximum idle connection count maintained by the pool.
    * `Pool.set_conn_max_lifetime` - Sets the maximum lifetime of connections in the pool.

## v0.4.0-alpha.3 2019-12-24

#### Update

- When specifying a timeout configuration, `None` means that a get connection will never timeout.

## v0.4.0-alpha.2 2019-12-23

#### Fixes

- Fix docs

## v0.4.0-alpha.1 2019-12-23

Refactored most of the code, but it was all tested. I'm sorry, some API changes, but in exchange for better experience and performance.

#### Changes

- ConnectionManager is changed to Manager and simplified.
  - `get_executor` are removed.
  - `has_broken` are removed.
  - `is_valid` to `check`
  - Add a provided method `spawn_task`. You might use it when using mobc in runtimes other than tokio-0.2 and async-std.
- The connection pool now initializes without creating a new database connection, which saves a lot of time and resources. So it becomes a synchronization API.
- `Pool.state()` will now return more detailed statistics.
- Some configuration items are changed.
  - `min_idle` to `max_idle`, which means that idle connections over this number will be closed
  - `max_size` to `max_open`. If you set it to 0, the pool will create unlimited new connections if necessary. However, these connections are still limited by `max_idle` when idle
- `Pool.try_get` are removed.

## v0.3.3 2019-12-23

#### Fixes

- Fix Connection recycle.
- Panics if `min_idle` is 0

## v0.3.2 2019-12-10

#### Fixes

- Timeout caused by reaping

## v0.2.11 2019-12-10

#### Fixes

- Timeout caused by reaping

## v0.3.1 2019-12-05

#### Fixes

- Documentation of `mobc::Builder`

repository: importcjj/mobc

branch_name: refs/heads/main

gha_language: Rust

repo_name: importcjj/mobc


text:
## Gutenberg Static Site Generator Reference

Notes on using the [Gutenberg static site generator](https://getgutenberg.io) to maintain and preview the content for your website in Markdown files.

[Start reading here](https://github.com/tomcam/g.github.io/blob/master/docs/index.md).

license: MIT


text:
# Attendance-Registration-System
First project for Software Engineering 1

## Installation
__*Backend*__
```
cd backend
virtualenv development
development\Scripts\activate.bat
pip install -e .
```

## How to run

##### Run the following commands in ```backend``` directory
```Activate the development enviroment```
```
Windows: development\Scripts\activate.bat
Linux: development/bin/activate
```
##### Set the environment variables

Replace ```export``` with ```set``` on a Windows machine
```
export FLASK_APP=flaskr
export FLASK_ENV=development
```
##### Run the web server
```
flask init-db
flask run
```


text:
# octopus_deploy_user

Describes an Octopus Deploy [User](https://octopus.com/docs/administration/managing-users-and-teams#Managingusersandteams-UserandServiceaccounts) resource.

## Example

```ruby
describe octopus_deploy_user('bobthedeveloper') do
  it { should exist }
  it { should be_active }
end
```

#### Type

This type can be instantiated in several ways, depending on [how you authenticate](authentication.md).

```ruby
octopus_deploy_user(url, api_key, user_name)  # url and apikey provided
octopus_deploy_user(user_name)                # using environment vars
octopus_user(url, api_key, user_name)         # shorthand
octopus_user(user_name)
```

#### Matchers

| Matcher | Description |
|:--------|:------------|
| should exist | Tests for existence of a User account with the given name |
| should be_active | Tests if the User is enabled/has the 'Is Active' checkbox checked |
| should have_email(email) | Tests the email address associated with the User account |
| should have_api_key(purpose) | Tests if the User has an API Key with the stated purpose field |
| should have_display_name(name) | Tests the Display Name set for the User |
| should be_service_account | Tests if the User is a service account |

gha_language: Ruby

gha_license_id: NOASSERTION


text:
# orientdb-gremlin

[![Build Status](https://travis-ci.org/orientechnologies/orientdb-gremlin.svg?branch=develop)](https://travis-ci.org/orientechnologies/orientdb-gremlin?branch=develop) [![Coverage Status](https://coveralls.io/repos/mpollmeier/orientdb-gremlin/badge.svg?branch=master)](https://coveralls.io/r/mpollmeier/orientdb-gremlin?branch=master) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.michaelpollmeier/orientdb-gremlin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.michaelpollmeier/orientdb-gremlin/)

[Apache TinkerPop](https://tinkerpop.apache.org/) 3 graph structure implementation for OrientDB. This started off as just a proof of concept, but thanks to a lot of help it's now in a really good shape and it has been officially adopted by the OrientDB team to be part of OrientDB `v3.x` and should eventually replace OrientDB's `graphdb` implementation that is still on TinkerPop 2.

The main area that need some more work is index lookups - currently it does find the right index for a simple case, e.g. `g.V.hasLabel("myLabel").has("someKey", "someValue")`. However if there are multiple indexes on the same property, or if there the traversal should better use a composite index, that's not handled well yet. If you feel inclined you can add these cases to the `OrientGraphIndexTest.java`. The function that looks up indexes is `OrientGraphStep.findIndex`.

## Tests
* you can run the standard tinkerpop test suite with `mvn install -P release`
* there are some additional tests that you can run independently with `mvn test`
* additionally there is a separate suite of tests in the `tests-scala` directory which you can run using `sbt test`
* to automatically format the code (travis CI enforces a format check), just run `mvn clean install`

## Usage
Have a look at the tests-scala which demonstrates the usage. There's also an orientdb example project in [gremlin-scala-examples](https://github.com/mpollmeier/gremlin-scala-examples).

## Labels and classes
Vertices and Edges are stored as classes based on their label. In order to allow vertices and edges to use the same label, the implementation prepends `V_` or `E_` in the class name:
* vertex with label `user` -> classname `V_user`
* edge with label `user` -> classname `E_user`

## Migrations
You might want to use [orientdb-migrations](https://github.com/springnz/orientdb-migrations) to create a schema with indexes etc.

## Release
* upgrade version: remove SNAPSHOT (driver/pom.xml and tests-scala/build.sbt)
* commit on branch, push, create PR on github
* await green light from travis
* merge PR on github
* then execute
```
* mvn pull
* mvn clean deploy -Prelease
* git tag VERSION
```
* bump versions to next SNAPSHOT (pom.xml, build.sbt)
* then
```
* git push
* git push --tags
```

repository: orientechnologies/orientdb-gremlin

branch_name: refs/heads/develop

gha_language: Java

repo_name: orientechnologies/orientdb-gremlin


text:
# A Simple Middleware for Laravel Allowing Long Requests

[![Latest Version on Packagist](https://img.shields.io/packagist/v/mydnic/laravel-allow-long-request.svg)](https://packagist.org/packages/mydnic/laravel-allow-long-request)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)
[![Build Status](https://img.shields.io/travis/com/mydnic/laravel-allow-long-request.svg)](https://travis-ci.com/mydnic/laravel-allow-long-request)
[![Code Quality](https://img.shields.io/scrutinizer/g/mydnic/laravel-allow-long-request.svg)](https://scrutinizer-ci.com/g/mydnic/laravel-allow-long-request/)

## Installation

You can install this package via composer using this command:

```bash
composer require mydnic/laravel-allow-long-request
```

The package will automatically register itself

You can publish the config-file with:

```bash
php artisan vendor:publish --provider="Mydnic\AllowLongRequests\AllowLongRequestsServiceProvider" --tag="config"
```

## Usage

In your Kernel.php you can register the middleware like this:

```php
protected $routeMiddleware = [
    // ...
    'allow-long-request' => \Mydnic\AllowLongRequests\Http\Middleware\AllowLongRequests::class,
]
```

Now you can apply the middleware on the route of your choice

```php
Route::get('/', function () {
    // code that takes a long time to execute
})->middleware('allow-long-request');
```

You can set the max waiting time in the config file.

repository: mydnic/laravel-allow-long-request

gha_language: PHP

gha_license_id: MIT

repo_name: mydnic/laravel-allow-long-request


text:
# Labels

A label is a dynamic piece of text. It may be changed in many ways once created. Changes can be triggered from other fields.

      colorlabel = Label.new @form, {'text' => "Select a color:", "row" => 2, "col" => 10, "color"=>"cyan", "mnemonic" => 'S'}

In the example, a mnemonic has been set. Alt-s will put the focus on the field or widget that this focus has been attached to using `label_for`. Other settings are self-explanatory. A label may be multi-line, is may be aligned right or left or center, any of its attributes may be changed at any time, including location (although that's rare, but mentioned to emphasize that unlike ncurses, all widgets may be created or modified at any time).

Next: [Fields](field.md)

repository: rkumar/rbcurse-tutorial

repo_name: rkumar/rbcurse-tutorial


text:
# Poll

This object contains information about a poll.

## Properties

- `$id`: _Unique poll identifier_
- `$question`: _Poll question, 1-300 characters_
- `$options`: [`Array of PollOption`](PollOption.md) _List of poll options_
- `$total_voter_count`: _Total number of users that voted in the poll_
- `$is_closed`: _True, if the poll is closed_
- `$is_anonymous`: _True, if the poll is anonymous_
- `$type`: _Poll type, currently can be “regular” or “quiz”_
- `$allows_multiple_answers`: _True, if the poll allows multiple answers_
- `$correct_option_id`: _Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot._
- `$explanation`: _Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters_
- `$explanation_entities`: [`Array of MessageEntity`](MessageEntity.md) _Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation_
- `$open_period`: _Optional. Amount of time in seconds the poll will be active after creation_
- `$close_date`: _Optional. Point in time (Unix timestamp) when the poll will be automatically closed_

repository: FraSharp/FraSharpBot

repo_name: FraSharp/FraSharpBot


text:
2010-06-30
==========

* Now using `document.implementation.createDocument` instead of `DOMParser` to create
  DOM documents.
* Tidied up the XML prototype method extension code.

2010-05-27
==========

* Minor speed and minification optimizations.

2010-04-02
==========

* Fixed `methods` variable global leak.
* Removed checks for `DOMParser` and `XMLSerializer`.

2010-03-13
==========

* No longer using version numbers as e4x.js only implements a static feature set.

0.2.2
=====

* Now partially using DOM methods to create a DOM document instead of using string
  serialization for the `xpath()` method.

0.2.1
=====

* Optimizations.


text:
```
此项目仅供本人学习用，更新频率慢，若在项目中使用请移步到其它成熟的组件库
This project is only for my own study, the update frequency is slow and untested, if you use it in the project, please move to other mature component libraries
```

# Flutter Vant Kit

Flutter Vant Kit is a [Vant](https://youzan.github.io/vant/#/zh-CN/intro) style flutter UI library.

## Introduction

### How to use

```
dependencies:
  flutter_vant_kit: ^0.2.5
```

### How to run demo

```
cd example/
flutter run
```

## API

View [Documentation](https://benjaken.gitbook.io/flutter-vant-kit) 或 【[中文版](./doc/zh)|[English](./doc/en)】

## Demo Screenshot


text:
### 2015-01-09

#### objective-c
* [
      StefanLage
      /
      SLPagingView
](https://github.com/StefanLage/SLPagingView):
      Navigation bar system allowing to do a Tinder like or Twitter like

* [
      ArtSabintsev
      /
      Harpy
](https://github.com/ArtSabintsev/Harpy):
      Notify users when a new version of your iOS app is available, and prompt them with the App Store link.

* [
      mbrenman
      /
      MBSimpleLoadingIndicator
](https://github.com/mbrenman/MBSimpleLoadingIndicator):
      An easy-to-use, highly-customizable loading indicator for iOS apps

* [
      Masonry
      /
      Masonry
](https://github.com/Masonry/Masonry):
      Harness the power of AutoLayout NSLayoutConstraints with a simplified, chainable and expressive syntax. Supports iOS and OSX Auto Layout

* [
      onevcat
      /
      VVBlurPresentation
](https://github.com/onevcat/VVBlurPresentation):
      A simple way to present a view controller with keeping the blurred previous one.

* [
      kevinzhow
      /
      PNChart
](https://github.com/kevinzhow/PNChart):
      A simple and beautiful chart lib used in Piner and CoinsMan for iOS

* [
      youtube
      /
      youtube-ios-player-helper
](https://github.com/youtube/youtube-ios-player-helper):
      Helper library for iOS developers looking to add YouTube video playback in their applications via the iframe player in a UIWebView

* [
      AFNetworking
      /
      AFNetworking
](https://github.com/AFNetworking/AFNetworking):
      A delightful iOS and OS X networking framework

* [
      mutualmobile
      /
      MMDrawerController
](https://github.com/mutualmobile/MMDrawerController):
       A lightweight, easy to use, Side Drawer Navigation Controller

* [
      smileyborg
      /
      PureLayout
](https://github.com/smileyborg/PureLayout):
      The ultimate API for iOS & OS X Auto Layout — impressively simple, immensely powerful. Objective-C and Swift compatible.

* [
      sibahota059
      /
      SPHChatCollectionView
](https://github.com/sibahota059/SPHChatCollectionView):
      SPHChatCollectionView to use in chat screens. (Supports iOS 8)

* [
      jessesquires
      /
      JSQMessagesViewController
](https://github.com/jessesquires/JSQMessagesViewController):
      An elegant messages UI library for iOS

* [
      atljeremy
      /
      JFMinimalNotifications
](https://github.com/atljeremy/JFMinimalNotifications):
      An iOS UIView for presenting a minimalistic notification that doesn't block the UI and is highly configurable.

* [
      coolbeet
      /
      CBStoreHouseRefreshControl
](https://github.com/coolbeet/CBStoreHouseRefreshControl):
      Fully customizable pull-to-refresh control inspired by Storehouse iOS app

* [
      newmarcel
      /
      KeepingYouAwake
](https://github.com/newmarcel/KeepingYouAwake):
      A Caffeine clone for OS X Yosemite (and Dark Mode).

* [
      xmartlabs
      /
      XLPagerTabStrip
](https://github.com/xmartlabs/XLPagerTabStrip):
      Android PagerTabStrip for iOS.

* [
      johnno1962
      /
      Remote
](https://github.com/johnno1962/Remote):
      Control your iPhone from inside Xcode for end-to-end testing.

* [
      facebook
      /
      AsyncDisplayKit
](https://github.com/facebook/AsyncDisplayKit):
      Smooth asynchronous user interfaces for iOS apps.

* [
      ReactiveCocoa
      /
      ReactiveCocoa
](https://github.com/ReactiveCocoa/ReactiveCocoa):
      A framework for composing and transforming streams of values

* [
      hackiftekhar
      /
      IQKeyboardManager
](https://github.com/hackiftekhar/IQKeyboardManager):
      IQKeyboardManager is a drop-in universal library allows to prevent issues of UIKeyboard sliding up and cover UITextField/UITextView. Neither need to write any code nor any setup required and much more.

* [
      omergul123
      /
      LLSimpleCamera
](https://github.com/omergul123/LLSimpleCamera):
      A simple, customizable camera control for iOS.

* [
      FabrizioBrancati
      /
      BFKit
](https://github.com/FabrizioBrancati/BFKit):
      BFKit is a collection of useful classes to develop Apps faster

* [
      andreamazz
      /
      AMScrollingNavbar
](https://github.com/andreamazz/AMScrollingNavbar):
      Scrollable UINavigationBar that follows the scrolling of a UIScrollView

* [
      nate-parrott
      /
      Flashlight
](https://github.com/nate-parrott/Flashlight):
      The missing Spotlight plugin system

* [
      MakeZL
      /
      ZLGotoSandboxPlugin
](https://github.com/MakeZL/ZLGotoSandboxPlugin):
      You can quickly enter the iOS simulator Xcode plugin!

#### go
* [
      nwidger
      /
      nintengo
](https://github.com/nwidger/nintengo):
      An NES emulator written in Go

* [
      google
      /
      novm
](https://github.com/google/novm):
      Experimental KVM-based VMM, written in Go.

* [
      mozillazg
      /
      go-pinyin
](https://github.com/mozillazg/go-pinyin):
      汉语拼音转换工具

* [
      golang
      /
      go
](https://github.com/golang/go):
      The Go programming language

* [
      ttacon
      /
      libphonenumber
](https://github.com/ttacon/libphonenumber):
      golang port of Google's libphonenumber

* [
      docker
      /
      docker
](https://github.com/docker/docker):
      Docker - the open-source application container engine

* [
      shazow
      /
      ssh-chat
](https://github.com/shazow/ssh-chat):
      Chat over SSH.

* [
      colinmarc
      /
      hdfs
](https://github.com/colinmarc/hdfs):
      A native go client for HDFS

* [
      GoogleCloudPlatform
      /
      kubernetes
](https://github.com/GoogleCloudPlatform/kubernetes):
      Container Cluster Manager

* [
      hashicorp
      /
      envconsul
](https://github.com/hashicorp/envconsul):
      Read and set environmental variables for processes from Consul.

* [
      astaxie
      /
      build-web-application-with-golang
](https://github.com/astaxie/build-web-application-with-golang):
      A golang ebook intro how to build a web with golang

* [
      Shopify
      /
      ejson
](https://github.com/Shopify/ejson):
      EJSON is a small library to manage encrypted secrets using asymmetric encryption.

* [
      syncthing
      /
      syncthing
](https://github.com/syncthing/syncthing):
      Open Source Continuous File Synchronization

* [
      influxdb
      /
      influxdb
](https://github.com/influxdb/influxdb):
      Scalable datastore for metrics, events, and real-time analytics

* [
      dropbox
      /
      godropbox
](https://github.com/dropbox/godropbox):
      Common libraries for writing Go services/applications.

* [
      limetext
      /
      lime
](https://github.com/limetext/lime):
      Open source API-compatible alternative to Sublime Text

* [
      coreos
      /
      rocket
](https://github.com/coreos/rocket):
      App Container runtime

* [
      coreos
      /
      etcd
](https://github.com/coreos/etcd):
      A highly-available key value store for shared configuration and service discovery

* [
      drone
      /
      drone
](https://github.com/drone/drone):
      Drone is a Continuous Integration platform built on Docker, written in Go

* [
      docker
      /
      machine
](https://github.com/docker/machine):
      Machine management for a container-centric world

* [
      cockroachdb
      /
      cockroach
](https://github.com/cockroachdb/cockroach):
      A Scalable, Geo-Replicated, Transactional Datastore

* [
      gogits
      /
      gogs
](https://github.com/gogits/gogs):
      Gogs(Go Git Service) is a painless self-hosted Git Service written in Go.

* [
      prometheus
      /
      prometheus
](https://github.com/prometheus/prometheus):
      The Prometheus systems and service monitoring server

* [
      revel
      /
      revel
](https://github.com/revel/revel):
      A high productivity, full-stack web framework for the Go language.

* [
      github
      /
      hub
](https://github.com/github/hub):
      hub helps you win at git.

#### javascript
* [
      daniel-lundin
      /
      snabbt.js
](https://github.com/daniel-lundin/snabbt.js):
      Fast animations with javascript and CSS transforms

* [
      ecomfe
      /
      echarts
](https://github.com/ecomfe/echarts):
      Enterprise Charts | Github pages : http://ecomfe.github.io/echarts/index-en.html | Email<EMAIL_ADDRESS>| Baidu Hi : 1379172 |

* [
      vesparny
      /
      morpheus
](https://github.com/vesparny/morpheus):
      The next generation web publishing platform.

* [
      keen
      /
      dashboards
](https://github.com/keen/dashboards):
      Responsive dashboard templates for Bootstrap

* [
      systemjs
      /
      systemjs
](https://github.com/systemjs/systemjs):
      Universal dynamic module loader

* [
      iojs
      /
      io.js
](https://github.com/iojs/io.js):
      A spork of Node.js with an open governance model

* [
      Zhouzi
      /
      TheaterJS
](https://github.com/Zhouzi/TheaterJS):
      Typing effect mimicking human behavior.

* [
      angular
      /
      angular.js
](https://github.com/angular/angular.js):
      HTML enhanced for web apps

* [
      meteoric
      /
      meteor-ionic
](https://github.com/meteoric/meteor-ionic):
      Ionic components for Meteor. No Angular!

* [
      allmobilize
      /
      amazeui
](https://github.com/allmobilize/amazeui):
      Amaze UI, a mobile-first and modular front-end framework.

* [
      6to5
      /
      6to5
](https://github.com/6to5/6to5):
      Turn ES6+ code into readable vanilla ES5 with source maps and more!

* [
      Semantic-Org
      /
      Semantic-UI
](https://github.com/Semantic-Org/Semantic-UI):
      Semantic is a UI component framework based around useful principles from natural language.

* [
      zxlie
      /
      WeixinApi
](https://github.com/zxlie/WeixinApi):
      专门用于微信公众平台的Javascript API

* [
      nnnick
      /
      Chart.js
](https://github.com/nnnick/Chart.js):
      Simple HTML5 Charts using the <canvas> tag

* [
      sindresorhus
      /
      got
](https://github.com/sindresorhus/got):
      Simplified HTTP/HTTPS requests

* [
      facebook
      /
      react
](https://github.com/facebook/react):
      A declarative, efficient, and flexible JavaScript library for building user interfaces.

* [
      facebook
      /
      flux
](https://github.com/facebook/flux):
      Application Architecture for Building User Interfaces

* [
      driftyco
      /
      ionic
](https://github.com/driftyco/ionic):
      Advanced HTML5 mobile development framework and SDK. Build great hybrid apps with web technologies you already know and love. Best friends with AngularJS.

* [
      angular
      /
      material
](https://github.com/angular/material):
      Material design for Angular

* [
      getify
      /
      You-Dont-Know-JS
](https://github.com/getify/You-Dont-Know-JS):
      A JavaScript book series. @YDKJS on twitter.

* [
      Unitech
      /
      PM2
](https://github.com/Unitech/PM2):
      Production process manager for Node.JS applications. Perfectly designed for microservice architecture.

* [
      joyent
      /
      node
](https://github.com/joyent/node):
      evented I/O for v8 javascript

* [
      strongloop
      /
      express
](https://github.com/strongloop/express):
      Fast, unopinionated, minimalist web framework for node.

* [
      jspm
      /
      jspm-cli
](https://github.com/jspm/jspm-cli):
      Package management CLI

* [
      dcloudio
      /
      mui
](https://github.com/dcloudio/mui):
      最接近原生APP体验的高性能框架

#### ruby
* [
      NARKOZ
      /
      ginatra
](https://github.com/NARKOZ/ginatra):
      A web frontend for Git repositories

* [
      markburns
      /
      to_factory
](https://github.com/markburns/to_factory):
      Auto generate factories from data

* [
      discourse
      /
      discourse
](https://github.com/discourse/discourse):
      A platform for community discussion. Free, open, simple.

* [
      jekyll
      /
      jekyll
](https://github.com/jekyll/jekyll):
      Jekyll is a blog-aware, static site generator in Ruby

* [
      Homebrew
      /
      homebrew
](https://github.com/Homebrew/homebrew):
      The missing package manager for OS X.

* [
      elabs
      /
      refile
](https://github.com/elabs/refile):
      Ruby file uploads, take 3

* [
      Yinfei
      /
      rpg_tools
](https://github.com/Yinfei/rpg_tools):
      RpgTools is a toolbox for tabletop games and RPGs

* [
      rails
      /
      rails
](https://github.com/rails/rails):
      Ruby on Rails

* [
      forgecrafted
      /
      finishing_moves
](https://github.com/forgecrafted/finishing_moves):
      Small, focused, incredibly useful methods added to core Ruby classes.

* [
      gitlabhq
      /
      gitlabhq
](https://github.com/gitlabhq/gitlabhq):
      Open source software to collaborate on code. Follow us on twitter @gitlab

* [
      elasticsearch
      /
      logstash
](https://github.com/elasticsearch/logstash):
      logstash - logs/event transport, processing, management, search.

* [
      caskroom
      /
      homebrew-cask
](https://github.com/caskroom/homebrew-cask):
      A CLI workflow for the administration of Mac applications distributed as binaries

* [
      rapid7
      /
      metasploit-framework
](https://github.com/rapid7/metasploit-framework):
      Metasploit Framework

* [
      seratch
      /
      rspec-kickstarter
](https://github.com/seratch/rspec-kickstarter):
      RSpec 3 code generator toward existing Ruby code.

* [
      chanks
      /
      que
](https://github.com/chanks/que):
      A Ruby job queue that uses PostgreSQL's advisory locks for speed and reliability.

* [
      outpunk
      /
      evil-icons
](https://github.com/outpunk/evil-icons):
      Simple and clean SVG icon pack with the code to support Rails, Node.js, Gulp and Grunt

* [
      sagivo
      /
      algorithms
](https://github.com/sagivo/algorithms):
      algorithms playground for common questions

* [
      plataformatec
      /
      devise
](https://github.com/plataformatec/devise):
      Flexible authentication solution for Rails with Warden.

* [
      lotus
      /
      lotus
](https://github.com/lotus/lotus):
      A complete web framework for Ruby

* [
      nomad
      /
      shenzhen
](https://github.com/nomad/shenzhen):
      CLI for Building & Distributing iOS Apps (.ipa Files)

* [
      bbatsov
      /
      rubocop
](https://github.com/bbatsov/rubocop):
      A Ruby static code analyzer, based on the community Ruby style guide.

* [
      skwp
      /
      dotfiles
](https://github.com/skwp/dotfiles):
      YADR - The best vim,git,zsh plugins and the cleanest vimrc you've ever seen

* [
      ruby
      /
      ruby
](https://github.com/ruby/ruby):
      The Ruby Programming Language

* [
      inf0rmer
      /
      blanket
](https://github.com/inf0rmer/blanket):
      A dead simple API wrapper

* [
      apotonick
      /
      trailblazer
](https://github.com/apotonick/trailblazer):
      A new architecture for Rails.

repository: josephyzhou/github-trending

gha_language: Go

repo_name: josephyzhou/github-trending


text:
# JPShrinkingButton

![Alt text](https://github.com/Julp04/JPShrinkingButton/blob/master/JPShrinkingButton.gif)

## Example

To run the example project, clone the repo. No need to run any carthage commands. Framework is included in project 😀

## Installation

To integrate JPShrinkingButton into your Xcode project using Carthage, specify it in your Cartfile:

```
github julp04/JPShrinkingButton
```

1. Run `carthage update`
1. A `Cartfile.resolved` file and a `Carthage` directory will appear in the same directory where your `.xcodeproj` or `.xcworkspace` is
1. Drag the built `.framework` binaries from `Carthage/Build/<platform>` into your application’s Xcode project.
1. If you are using Carthage for an application, follow the remaining steps, otherwise stop here.
1. On your application targets’ _Build Phases_ settings tab, click the _+_ icon and choose _New Run Script Phase_. Create a Run Script in which you specify your shell (ex: `/bin/sh`), add the following contents to the script area below the shell:

    ```sh
    /usr/local/bin/carthage copy-frameworks
    ```

- Add the paths to the frameworks you want to use under “Input Files". For example:

    ```
    $(SRCROOT)/Carthage/Build/iOS/JPShrinkingButton.framework
    ```

- Add the paths to the copied frameworks to the “Output Files”. For example:

    ```
    $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/JPShrinkingButton.framework
    ```

# Usage

## Initalizing Button

### Setup Button

Works just like any normal UIButton where you can set titles, images, etc.

```swift
button = JPShrinkingButton(frame: buttonFrame)

button?.setTitle("Send Message", for: .normal)
button?.setImage(#imageLiteral(resourceName: "message.png"), for: .normal)
button?.tintColor = .white
button?.backgroundColor = #colorLiteral(red: 0.1764705926, green: 0.4980392158, blue: 0.7568627596, alpha: 1)
button?.addTarget(self, action: #selector(showAlert), for: .touchUpInside)

view.addSubview(button!)
```

### Animations

There are two methods for animating the button: Expand and shrink

```swift
func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) {
      if velocity.y >= 0.6 {
          button?.shrink()
          return
      }

      if velocity.y <= -0.6 {
          button?.expand()
          return
      }
}
```

## Author

julp04<EMAIL_ADDRESS>
## License

JPShrinkingButton is available under the MIT license. See the LICENSE file for more info.

repository: julpanucci/JPShrinkingButton

repo_name: julpanucci/JPShrinkingButton


text:
# githass [![Build Status](https://travis-ci.org/fronzbot/githass.svg?branch=master)](https://travis-ci.org/fronzbot/githass)
## Home Assistant Configuration
Currently running on a home media server using [unRAID](https://lime-technology.com/) (Home Assistant runs in a docker)

### Components Used:
- Weather:
  - [wunderground](https://home-assistant.io/components/sensor.wunderground/)
  - [darksky](https://home-assistant.io/components/sensor.wunderground/)
- Device Tracking:
  - [nmap](https://home-assistant.io/components/device_tracker.nmap_tracker/)
- Climate:
  - [Ecobee](https://home-assistant.io/components/climate.ecobee/) Version 3 with one remote sensor
- Lights:
  - [Phillips Hue](https://home-assistant.io/components/light.hue/)
      - 5x 2nd Gen Color Ambience Bulbs
      - 8x White Ambience Bulbs
- [Zwave](https://home-assistant.io/docs/z-wave/):
  - Aeotec Z-wave Stick
      -  2x GE Z-wave Switches
      -  1x Leviton Z-wave+ Switch
      -  1x Aeotec Smart Switch
      -  3x First Alert ZCOMBO Smoke/CO2 detectors
- Media Players:
  - [Plex](https://home-assistant.io/components/media_player.plex/)
  - [Emby](https://home-assistant.io/components/media_player.emby/)
  - [Google Cast](https://home-assistant.io/components/media_player.cast/)
      - NVIDIA Shield TV
      - 2x Google
      - 1x Chromecast
- [Emulated Hue](https://home-assistant.io/components/emulated_hue/)
  - 1x Amazon Echo
  - 2x Amazon Echo Dot
  - 2x Google Home
- Notifications:
  - [HTML5](https://home-assistant.io/components/notify.html5/) Push Notifications
- Other Components:
  - [Blink Camera](https://home-assistant.io/components/blink/)
  - [Google Wifi](https://home-assistant.io/components/sensor.google_wifi/)
  - [PiHole](https://home-assistant.io/components/sensor.pi_hole/)
  - [Netdata](https://home-assistant.io/components/sensor.netdata/)
  - [Speedtest](https://home-assistant.io/components/sensor.speedtest/)
  - [Fast.com](https://home-assistant.io/components/sensor.fastdotcom/)
- Databases:
  - MySQL for default recorder
  - [Influx and Grafana](https://home-assistant.io/blog/2015/12/07/influxdb-and-grafana/) for more long-term trend plotting

### Automations:
- Light control based on device presence and sun status
- Theromstat control based on outside temperature and device presence
- HA Reset notifications and memory leak notifications
- Nightly data storage for daily average/max/min to be displayed as a graph in the front end (to get long-term history)

### Notes:
1. I use secrets.yaml to hide sensitive information (like API keys)
2. Currently, Home Assistant has local control over only Hue and Z-wave devices (Ecobee talks to cloud).  My goal is to force everything to be local so if the interenet goes out, my home will still be automated.
  * ~~Most likely I'll just slowly phase out Wink and get a zwave stick for future ZWAVE components~~.  I'll have to just live with the ecobee cloud-only BS for now...

### Future Improvements:
- ~~Automation override switches~~ (added 8/21/2016)
- ~~Rapberry pi status monitoring~~ (added 8/27/2016)
- ~~Integrate Alexa~~ (added 10/23/2016)
- ~~Selectable scenes~~ (added 11/6/2016)
- Vacation Mode
- ~~Thermostat automations (instead of using built-in Ecobee scheduling)~~ (added 7/8/2017)
- Full local control (Ecobee does not allow local only)
- Intents
- More components:
  - ~~Z-wave stick (for future Wink removal)~~ (added 11/25/2016)
  - Home weather station
  - More Lights/switches
  - Door/window sensors
  - IP Cameras
  - Sprinkler/Irrigation automation
  - ~~Washer status~~
  - Dishwasher status (custom sensor, probably)

(Images last updated July 23, 2017, may not reflect current configuration)
![](https://github.com/fronzbot/githass/blob/master/images/ha_home_page.png)
![](https://github.com/fronzbot/githass/blob/master/images/ha_media.png)
![](https://github.com/fronzbot/githass/blob/master/images/ha_media2.png)
![](https://github.com/fronzbot/githass/blob/master/images/ha_thermostat.png)
![](https://github.com/fronzbot/githass/blob/master/images/ha_weather1.png)
![](https://github.com/fronzbot/githass/blob/master/images/ha_weather2.png)
![](https://github.com/fronzbot/githass/blob/master/images/ha_stats.png)
![](https://github.com/fronzbot/githass/blob/master/images/ha_stats2.png)
![](https://github.com/fronzbot/githass/blob/master/images/ha_override.png)

repository: jelez/githass

repo_name: jelez/githass


text:
# jsTextManager
jsTextManager is a simple tool to manipulate string in Javascript.

Essentially all you have to do is download TexManager.html and open it in a browser.

The code is written in pure Js, without using any external object so it could be used also offline.

__BE CAREFUL:__ jsTextManager is tested on Chrome 40.0.2214.115 (64-bit) for OsX.

![image](https://github.com/gianx/jsTextManager/blob/master/Screenshot/TextManager_1.png)

From this screen you can do some operations with the text:

#### General functions
_ALL UPPER_: Converts all the text uppercase;

_ALL LOWER_: Converts all the text lowercase;

_REMOVE EMPTY LINES_: Removes all empty lines (both Unix and Windows formats);

### Extract
_URLS_: Extracts all the URLs embedded in the text;

_EMAIL_: Extracts all the Emails embedded in the text;

### Encode

_URI ENCODE_: Performs an encoding off each line of the text;

_URI DECODE_: Performs a decoding off each line of the text;

_XML ENCODE_: Replaces all XML need-to-be-escaped chars;

_XML DECODE_: Replaces all XML escape sequences with correspondents chars;

### ROWS

_ENUMERATE_: Enumerates all rows;

_LTRIM_: Removes spaces from the beginning of all rows;

_RTRIM_: Removes spaces from the ending of all rows;

### SINGLE PARAMETER

_AFTER ALL_: Inserts the parameter at the end of the text;

_AFTER EACH_: Inserts the parameter after each row;

_BEFORE ALL_: Inserts the parameter at the beginning of the text;

_BEFORE EACH_: Inserts the parameter before each line;

_COUNT_: Counts the occurrences of parameter;

_DELETE FROM CHAR_: Deletes each row from the string specified by the parameter;

_DELETE TO CHAR_: Deletes each row from the beginning to the firs occurrence of the string specified by the parameter;

_ENCAPSULATE_: Encapsulates each row with the parameter (it's inserted at the beginning and at the end of each lines);

_JOIN_: Merges rows in one using parameter as a separator

_REMOVE_: Removes every occurence of the parameter from the text;

_SPLIT_: Splits text into lines using parameter as delimiter;

### DELETE

_FIRST_: Deletes first X chars of each row;

_LAST_: Deletes last X chars of each row;

### REPLACE

_REPLACE_: Replaces all the occurences of a string with another;

### PAD

_ON LEFT_: Adds a number of a specified char on the left of each row to reach the specified length;

_ON RIGHT_: Adds a number of a specified char on the right of each row to reach the specified length;

### SPECIAL

_ORACLE IN_: Transform the text in a text suitable for using with PL-SQL insert putting all lines between "'", adding "," at the end of the line and putting all the text between "()".

For example:

	A
	B
	C
	D
	E

Becomes:

	('A',
	'B',
	'C',
	'D',
	'E')

repository: gianx/jsTextManager

repo_name: gianx/jsTextManager


text:
# Creating a self signed certificate

**NOTE: the keys provided are NOT secure as it is the same for all released versions of dStack.**

1) Run the following command replacing [mydomain] for that fully qualified domain
   name of the site you wish to create a new certificate for. This will create a key
   and a cert(certificate) file.

```
openssl req -nodes -new -x509  -keyout [mydomain].key -out [mydomain].cert
```

repository: GollyGood/dstack

repo_name: GollyGood/dstack


text:
---
title: Introducing Inertia for Popmotion Pure
description: The new inertia animation allows the creation of physics-based sliders and scroll views
published: 20190123
---

# Introducing Inertia for Popmotion Pure

Today, we're releasing the first new animation for Popmotion Pure in over a year!

[Inertia](/api/inertia) combines the best of the [spring](/api/spring) and [decay](/api/decay) animations, to allow for momentum-scrolling and other visceral slider interactions. Check it out:

<CodePen id="BMNvqj" />

repository: triptych/popmotion

gha_language: JavaScript

repo_name: triptych/popmotion


text:
# serverside
A framework to run Cheddar on serverside

---
#Getting started

 1. Fork the repo
 2. run `npm install`
 3. put your files in the `www` folder
 4. run `node server`
 5. Navigate to `localhost:4000` to see your website running!

---
#Further reading

If you're using this for a production website, I suggest you use a reverse proxy like HAProxy or nginx to manage the web traffic to the server

repository: cheddar-lang/serverside

repo_name: cheddar-lang/serverside


text:
# redisssh

SSH tunnels for your redis.Connection and redis.ConnectionPool, using Paramiko

This module allows you to connect to a remote redis server without having to rely on redis
for authentication and security. It should be a drop-in replacement for code that's already
using the standard redis-py module's Connection and ConnectionPool classes, just add the ssh
connection keyword-arguments or use the sane defaults.

# Multiplexing

RedisSSHConnectionPool can work in one of two ways:

1. Non-shared, where each redis connection has it's own SSH client connection with a single
forwarded channel. To use this behavior, pass the constructor keyword argument ssh_shared=False

    code example

2. Shared, where there is a single SSH client connection for the ConnectionPool instance, and
the connections in the pool are multiplexed each on it's own channel.

    code example

Which of these is right for you depends on a number of factors, and on how your application
makes use of redis.

## TO-DO

- port to asyncio, as it is the future, and the future is now
- is there an asyncio pure python ssh implementation comparable to paramiko? (look into this further)

# TO-DO (someday when I run out of more exciting stuff to work on)

- docs
- tests
- profit

=====
                       cheers - V


text:
## mytoken 0.6.1
- Fail on restrictions error
- Added possibility to revoke tokens by `mom_id`

## mytoken 0.6.0

### Breaking Changes
- Support for local profiles / templates is dropped. Instead, support for server profiles is added.

### Features
- Added support for server-side profiles / templates

### API
- Adapt to newest api

### Bugfixes
- Fixed the geoip allow and disallow command line options

## mytoken 0.5.2
- Added qr code to oidc flow
- Added application name to request

## mytoken 0.5.1
- bump json patch
- fixed `stdout` printing bug on windows

## mytoken 0.5.0
- Adapt to API
- Drop support for subtoken_capabilities
- Drop support for token management
- Add support for profiles & templates
- Add support for WLCG Bearer token discovery

## mytoken 0.4.2
- adapt to api 0.7

## mytoken 0.4.1
- adapt to api / lib changes

## mytoken 0.4.0
- Adapt to api and server version 0.4.0
- Improve some outputs with tables instead of json
- Add support for token rotation
- Add rename command
- Delete a mytoken from the tokens file on revocation if it is stored there
- Fix command line falgs position with subcommands
- Implement settings / user grants / ssh key list, upload, deletion
- Implement actions through ssh

## mytoken 0.3.0
- Changed cli lib; improved help output formatting

## mytoken 0.2.0
Mytoken 0.2.0 has the following features
- Obtain mytokens
    - Through authorization code flow
    - Through mytoken
    - Through transfer code
    - Support for native application (polling codes)
- Obtain access tokens
- Tokeninfo
- Token Revocation

## mytoken 0.1.0
This is the first release of the mytoken command line client.
mytoken is still under active development and is not yet considered stable.

The first release supports the following important features:

- Obtain and store super token
- Obtain super token for usage somewhere else
- Obtain access token from super token
- Token revocation
- Super token can be created from another super token or the authorization code flow
- Super tokens can be restricted
- Content of a super token can be printed
- Super tokens are encrypted with a password or gpg key

repository: oidc-mytoken/client

branch_name: refs/heads/prerel

repo_name: oidc-mytoken/client


text:
# New features in Pomelo 0.5

Pomelo 0.5 enhances the high availability of servers，including the HA of the master server and a configurable auto-restart for other servers. In addition, this version supplies the globalChannel component and the ability to bind processes to specified CPUs.

 In order to improve the availability of integrated service in Pomelo, we import zookeeper to implement the HA of the master server.
Since the HA of the master server is implemented by zookeeper, the availability of the zookeeper service itself needs to be as high as possible.
### Principle
The master server uses the hot standby technology, which uses one machine as a master and others as slaves. When the master goes down，one of the slaves will act as the new master, and connect with other servers to provide services. All these procedures are automatically applied.
### Instruction
If you want to use the HA of the master server, you just need to configure app.js as follows：
```javascript```
app.configure('production|development', function(){
	app.enable('masterHA');
	app.set('masterHAConfig',
		{
			server : '<IP_ADDRESS>:2181',
			path : '/pomelo/master'
		});
});
```
app.enable('masterHA') means opening the ability of master HA, at this time the server will load zookeeper client and try to connect the server(<IP_ADDRESS>:2181) which configured in app.js. Developers can use app.set('masterHAConfig') to configure zookeeper, in which server represents zookeeper server and path represents the node that zookeeper uses. This node must be visited normally.

There are two ways to start slave server：
* The first way is to modify /config/master.json，using different ip and port, then start it. At this time, the system knows it is a slave server so other services will not be started repeatedly.
* The second way is to start it with the command line tool. [pomelo add command](https://github.com/NetEase/pomelo/wiki/Command-Line-Document)

## globalChannel

globalChannel provides global channel service, which implements by storing information in redis. Developers can replace redis with other dbs; Pomelo channelService can only create channel in one specified server, and the channel can only store users' information in this server. The globalChannelService can create global channel, which can store users' information in any server.

### Instruction

globalChannel will not load as default，if you want to use, just configure it in app.js as follows:(redis-server opened)

```javascript```
app.configure('production|development', function(){
	app.set('globalChannelConfig',
		{
			host: '<IP_ADDRESS>',
		        port: 6379
		});
});
```

you can get the globalChannelService from application object like app.get('globalChannelService'); if you want to know specific interfaces, please refer to [Pomelo API document](http://pomelo.netease.com/api.html).

## Servers auto restart

Pomelo 0.5 add the ability that servers(not master) can automatic restart after disconnect from master server. We suggest to developers that only servers without status can be configured as auto-restart, only in this way the system will not be disrupted by the restart of servers. Servers will not automatic restart as default, if you want to open this ability just configure servers.json as follows:

```json```
{
    "development":{
        "connector":[
            {"id":"connector-server-1", "host":"<IP_ADDRESS>", "port":4050, "clientPort": 3050, "frontend": true}
         ]
        "chat":[
           {"id":"chat-server-1", "host":"<IP_ADDRESS>", "port":6050, "auto-restart": true}
        ]
        "gate":[
	   {"id": "gate-server-1", "host": "<IP_ADDRESS>", "clientPort": 3014, "frontend": true}
	]
    }
}
```

## Binding Process with CPU

In order to use cpu resource fully, Pomelo 0.5 add the ability that developers can bind specific cpu with different processes, this ability can only be used in linux sysstem. If you want to bind specific cpu with process, just configure in servers.json as follows:

```json```
{
    "development":{
        "connector":[
             {"id":"connector-server-1", "host":"<IP_ADDRESS>", "port":4050, "clientPort": 3050, "frontend": true, "cpu": 2}
         ]
        "chat":[
             {"id":"chat-server-1", "host":"<IP_ADDRESS>", "port":6050, "cpu": 1}
        ]
        "gate":[
	     {"id": "gate-server-1", "host": "<IP_ADDRESS>", "clientPort": 3014, "frontend": true, "cpu": 3}
	]
     }
}

```

## Before server stop hook

In order to add custom handler before servers stop for developers, Pomelo 0.5 add this kind of custom event of servers' lifecycle. Developers can use app.beforeStopHook add custom handler as follows:

```javascript```
app.configure('production|development', 'connector', function() {
          var fun = function(app, cb){
            //do something
            cb();
          }
          app.beforeStopHook(fun);
});
```

repository: hexcola/pomelo

repo_name: hexcola/pomelo


text:
# Cat vs. Dog Image Classifier

![1](https://user-images.githubusercontent.com/26208598/60211178-72137d00-9856-11e9-90b6-5a6a29094c0a.PNG)

## PROJECT OVERVIEW

Image classifier trained to distinct between cats and dogs images. Convolutional Neural Network was built with Keras & Tensorflow 2.0(GPU).
Heroku-hosted web application was built with Flask framework.

[Kaggle Dataset](https://www.kaggle.com/c/dogs-vs-cats/data)

## CONVOLUTIONAL NEURAL NETWORK CHARACTERISTICS

1. Image Input Shape - 128,128,3, activation - relu
2. Transferred Learning from Google MobileNetV2 with customized head
4. Compiler - optimizer = 'RMSprop', loss = 'binary_crossentropy', metrics = ['accuracy']
5. Acc - 92% Loss - 19% (approx 30min/epoch on GPU)
6. CNN Code Location: deep_learning/ConvolutionalNeuralNetwork_V2.py

## TOOLS, MODULES & TECHNIQUES:

##### Travis CI
[![Build Status](https://travis-ci.com/LukaszMalucha/Cat-vs.-Dog-Classifier.svg?branch=master)](https://travis-ci.com/LukaszMalucha/Cat-vs.-Dog-Classifier)

##### Python – web development:
Flask
##### Python – CNN:
keras | tensorflow | scikit-image | pandas | numpy | h5py
##### Web Development:
HTML | CSS | Bootstrap | Materialize

##### Thank you,

Lukasz Malucha

gha_language: CSS


text:
## Math Contract
It contains Math Contract implementation in Scilla.

References taken:<br>
https://github.com/OpenZeppelin/openzeppelin-solidity/tree/master/contracts/math

repository: abhishektanwar/scilla-vanilla

repo_name: abhishektanwar/scilla-vanilla


text:
## Features of OpenBMC Test Automation ##

**Interface Feature List**
* REST
* Out-of-band IPMI
* SSH to BMC and Host OS

**Key Feature List**
* Power on/off
* Reboot Host
* Reset BMC
* Code update BMC and host
* Power management
* HTX bootme
* XCAT execution
* Network

**Debugging Supported List**
* SOL collection
* FFDC collection
* Error injection from host

## Installation Setup Guide ##
* [Robot Framework Install Instruction](https://github.com/robotframework/robotframework/blob/master/INSTALL.rst)

* Miscelleneous
Packages required to be installed for OpenBmc Automation.
Install the packages and it's dependencies via `pip`

    REST base packages:
    ```
    $ pip install -U requests
    $ pip install -U robotframework-requests
    ```
    SSH and SCP base packages:
    For more detailed installation instructions see [robotframework-sshlibrary](https://pypi.python.org/pypi/robotframework-sshlibrary)
    ```
    $ pip install robotframework-sshlibrary
    $ pip install robotframework-scplibrary
    ```
## Testing Setup Steps ##

To verify the installation setup is completed and ready to execute.

* Download the openbmc-test-automation repository:
    ```
    $ git clone https://github.com/openbmc/openbmc-test-automation
    $ cd openbmc-test-automation
    ```
* Execute basic setup test run:
    ```
    $ robot -v OPENBMC_HOST:xx.xx.xx.xx templates/test_openbmc_setup.robot
    ```
    where xx.xx.xx.xx is the BMC hostname or IP.

## Test Layout ##

There are several sub-directories within the openbmc-test-automation base which
contain test suites, tools, templates, etc. These sub-directories are
classified as follows:

`tests/`: Contains the general test cases for OpenBMC stack functional
          verification.

`extended/`: Contains test cases for boot testing, network testing,
             code update, RAS (Reliability, availability and serviceability)
             testing, etc.

`systest/`: Contains test cases for HTX bootme.

`xcat/`: Contains test cases for XCAT automation.

`tools/`: Contains various tools.

`templates/`: Contains sample code examples and setup testing.
`

## Quickstart ##
To run openbmc-automation first you need to install the prerequisite Python
packages which will help to invoke tests through tox (Note that tox
version 2.3.1 or greater is required) or via Robot CLI command.

**Robot Command Line**

* Execute all test suites for `tests/`:
    ```
    $ robot -v OPENBMC_HOST:xx.xx.xx.xx  tests
    ```
* Execute a test suite:
    ```
    $ robot -v OPENBMC_HOST:xx.xx.xx.xx  tests/test_basic_poweron.robot
    ```
**Tox Command Line**

* Install the python dependencies for tox:
    ```
    $ easy_install tox
    $ easy_install pip
    ```

* Initialize the following environment variables which will be used during testing:
    ```
    $ export OPENBMC_HOST=<openbmc machine ip address>
    $ export OPENBMC_PASSWORD=<openbmc password>
    $ export OPENBMC_USERNAME=<openbmc username>
    $ export OPENBMC_MODEL=[./data/Barreleye.py, ./data/Palmetto.py, etc]
    $ export IPMI_COMMAND=<Dbus/External>
    $ export IPMI_PASSWORD=<External IPMI password>
    ```
* For tests requiring PDU, set the following environment variables as well:
    ```
    $ export PDU_IP=<PDU IP address>
    $ export PDU_USERNAME=<PDU username>
    $ export PDU_PASSWORD=<PDU password>
    $ export PDU_TYPE=<PDU type>
    $ export PDU_SLOT_NO=<SLOT number>
    ```
    Note: For PDU_TYPE we support only synaccess at the moment.

* For QEMU tests, set the following environment variables as well:
    ```
    $ export SSH_PORT=<ssh port number>
    $ export HTTPS_PORT=<https port number>
    ```
* For BIOS tests, set the following environment variables as well:
    ```
    $ export PNOR_IMAGE_PATH=<path to>/<machine>.pnor
    ```

* Run tests:
    ```
    $ tox -e tests
    ```

* How to run individual test:

    One specific test:
    ```
    $ tox -e default -- --include Power_On_Test  tests/test_basic_poweron.robot
    ```
    No preset environment variables, default configuration for all supported
    systems:
    ```
    $ OPENBMC_HOST=x.x.x.x tox -e default -- tests
    ```
    No preset environment variables, one test case from a test suite:
    ```
    $ OPENBMC_HOST=x.x.x.x tox -e default -- --include Power_On_Test tests/test_basic_poweron.robot
    ```
    No preset environment variables, the entire test suite:
    ```
    $ OPENBMC_HOST=x.x.x.x tox -e default -- tests
    ```
    Default CI test bucket list:

    No preset environment variables, the entire test suite excluding test
    cases using argument file:
    ```
    $ OPENBMC_HOST=x.x.x.x tox -e default -- --argumentfile test_lists/skip_test tests
    ```

    Exclude test list for supported systems:
    ```
    Barrleye:  test_lists/skip_test_barreleye
    Palmetto:  test_lists/skip_test_palmetto
    Witherspoon:  test_lists/skip_test_witherspoon
    ```

* Run extended tests:

    For BMC code update, download the system type *.all.tar image from https://openpower.xyz
    and run as follows:

    For Barreleye system:
    ```
    $ robot -v OPENBMC_HOST:x.x.x.x -v FILE_PATH:downloaded_path/barreleye-xxxx.all.tar  extended/code_update/update_bmc.robot
    ```
    For loop test (default iteration is 10):
    ```
    $ robot -v OPENBMC_HOST:x.x.x.x -v OPENBMC_SYSTEMMODEL:xxxxxx -v ITERATION:n -v LOOP_TEST_COMMAND:xxxxxx extended/full_suite_regression.robot
    ```
    Example using tox testing a test suite for 5 times:
    ```
    OPENBMC_HOST=x.x.x.x  LOOP_TEST_COMMAND="--argumentfile test_lists/skip_test tests/test_fw_version.robot" ITERATION=5  OPENBMC_SYSTEMMODEL=barreleye tox -e barreleye -- ./extended/full_suite_regression.robot
    ```

**Jenkins jobs tox commands**
* HW CI tox command:
    ```
    $ OPENBMC_HOST=x.x.x.x tox -e default -- --argumentfile test_lists/HW_CI tests
    ```

**Tools**

* Github script:

    Command to get GitHub issues (any GitHub repository) report in CSV format:

    Note: On Prompt "Enter your GitHub Password:" enter your GitHub password.

    Usage:
    ```
    $ cd tools/
    $ python github_issues_to_csv <github user> <github repo>
    ```
    Example for getting openbmc issues:
    ```
    $ python github_issues_to_csv <github user>  openbmc/openbmc
    ```
    Example for getting openbmc-test-automation issues:
    ```
    $ python github_issues_to_csv <github user>  openbmc/openbmc-test-automation
    ```

* Generate Robot test cases documentation:

    Usage:
    ```
    $ ./generate_test_document <Robot test directory path> <test case document file path>
    ```

    Example for generating tests cases documentation for tests directory:
    ```
    $ ./generate_test_document tests testsdirectoryTCdocs.html
    ```

    Example for generating tests cases documentation (tests, gui, extended TCs):
    Note: Invoke the tool without argument:
    ```
    $ ./generate_test_document
    ```

repository: chester-fan/openbmc-test-automation

gha_language: Python

repo_name: chester-fan/openbmc-test-automation


text:
# MAGI Annotations #

[MAGI Annotations](http://annotations.cs.brown.edu) is a Django web server that allows users to view and edit annotations of mutation and protein-protein interactions. It is complementary to [MAGI](http://magi.brown.edu). MAGI Annotations was built and is maintained by the Raphael group at Brown University.

### Setup ###

1. **Set your environment variables (see below)**. We suggest making a file `ENVIRONMENT` and then loading the variables into your shell with `source ENVIRONMENT`.
2. **Install dependencies (see below)**.
3. **Setup your Postgres user and database.**   Then set up your Postgres user and database. For example (depending on your set up, these commands may differ slightly):

        createuser $POSTGRES_DJANGO_USER
        createdb $POSTGRES_DJANGO_DBNAME

3. **Run the migrations**. This will setup the tables in your Postgres database.

        python manage.py migrate

4. **Create a superuser**.

        python manage.py createsuperuser

5. **Initialize the database**. We provide a tarball of the data used to initialize [MAGI Annotations](annotations.cs.brown.edu) on our group website. We provide the `setup.sh` script for convenience which includes the contains the commands for initializing the database.

#### Dependencies ####

Latest tested version in parentheses.

1. **Python** (2.7.11). We suggest managing Python requirements using virtualenv and pip. Execute the
following commands on the command-line:

        virtualenv venv
        source venv/bin/activate
        pip install -r requirements.txt
2. **Postgres** (9.5.3).

3. **Bower**. Bower is required for managing Javascript dependencies. First, you will need to install [Node.js](https://nodejs.org/en/) and [NPM](https://www.npmjs.com/). Then, install [Bower](http://bower.io/), and use it to install the Javascript dependencies:

        npm install -g bower
        bower install

See our wiki page  [Getting set up with MAGI Annotations](https://github.com/raphael-group/magi-annotations/wiki/Getting-set-up-with-MAGI-Annotations) for additional instructions.

#### Environment variables ####

Many of the settings of MAGI Annotations are configurable with the following environment variables. Note that some of these environment variables overlap with MAGI (see [MAGI: Environment](https://github.com/raphael-group/magi#environment)), so be sure to set these appropriately.

| **Name**                      | **Default**               | **Description**                                               |
| ----------------------------- | ------------------------- | ------------------------------------------------------------- |
| `MAGIPY_PORT`                 | `'8080'`                  | Port from which you are serving MAGI                          |
| `MAGIPY_ENV`                  | `'development'`           | "production" for publicly available on the web, or "development" for local/testing |
| `MAGIPY_SITE_URL`             | `''`                      | URL for MAGI Annotations server (required in production only) |
| `MAGI_SECRET_KEY`             | `'MAGI_FOR_PRESIDENT'`    | Secret key (required in production only)                      |
| `POSTGRES_DJANGO_DBNAME`      | `'magipy'`                | Name of Postgres database                                     |
| `POSTGRES_DJANGO_HOST`        | None                      | Name of Postgres host                                         |
| `POSTGRES_DJANGO_PORT`        | `'5432'`                  | Name of Postgres port                                         |
| `POSTGRES_DJANGO_USER`        | `'postgres'`              | Name of Postgres user                                         |
| `POSTGRES_DJANGO_PASSWORD`    | None                      | Name of Postgres host                                         |
| `MAGI_STATIC_ROOT`            | `'/var/www/magipy/static/'` | Path for static files                                       |
| `MAGIPY_GOOGLE_CLIENT_ID`     | None                      | Google OAuth2 client ID                                       |
| `MAGIPY_GOOGLE_CLIENT_SECRET` | None                      | Google OAuth2 client secret                                   |
| `NODE_MAGI_URL`               | `'http://localhost:8000'` | URL for MAGI server                                           |

We suggest creating a file `ENVIRONMENT` and exporting each variable (e.g. `export MAGI_SITE_URL="http://localhost:8000"`), and then loading these into your shell with `source ENVIRONMENT`.

### Usage ###

Run the server:

    python manage.py runserver $MAGIPY_PORT

repository: raphael-group/magi-annotations

repo_name: raphael-group/magi-annotations


text:
# ICLabel

[![CI Status](https://img.shields.io/travis/crany1992<EMAIL_ADDRESS>[![Version](https://img.shields.io/cocoapods/v/ICLabel.svg?style=flat)](https://cocoapods.org/pods/ICLabel)
[![License](https://img.shields.io/cocoapods/l/ICLabel.svg?style=flat)](https://cocoapods.org/pods/ICLabel)
[![Platform](https://img.shields.io/cocoapods/p/ICLabel.svg?style=flat)](https://cocoapods.org/pods/ICLabel)

## Example

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

ICLabel is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'ICLabel'
```

## Author

<EMAIL_ADDRESS><EMAIL_ADDRESS>
## License

ICLabel is available under the MIT license. See the LICENSE file for more info.

repository: iCrany/ICLabel

repo_name: iCrany/ICLabel


text:
---
theme: post
date: 22-11-2020
title: "c++: threading 1"
---

# C++ Threading

This is a subject that is both very interesting and exciting. I have had a lot
of fun experimenting with it so let's have a look. The best way, off the
bat, is to look at a simple example;

## Example 1: Threading

```c++
#include <iostream>
#include <thread> // for the thread library
#include <unistd.h> // for sleep

int main() {
  auto print = [] (int delay) {
    std::cout<<"thread: "<<delay<<" seconds\n";
    sleep(delay);
    std::cout<<"exiting thread: "<<delay<<" seconds\n";
  };

  std::thread first(print, 4);
  std::thread second(print, 1);

  first.join();
  second.join();

  return 0;
}
```

What is going on here:

- we are defining a lambda function (have a look at my lambda function post for
  more information) called print that has some telling printing capabilities
  and a delay
- we are then starting 2 threads:
  - `first` will take 4 seconds to complete
  - `second` will take 1 seconds to complete

The functionality of thread can then be seen easily in the console output from
running the above:

```
thread: 4 seconds
thread: 1 seconds
exiting thread: 1 seconds
exiting thread: 4 seconds
```

Let's analyse it:

1. `print(4)` and `print(1)` were able to start one after another - `print(1)`
   did not have to wait for `print(4)` to finish before it execute
2. `print(1)` finished before `print(4)` - because simply put, it took less
   time - NOT because of the order of execution

---

## Example 2: not threading

If this seems confusing, let's look at what the above program would have done
without the use of threads:

If we change the body of main with:

```C++
auto print = [] (int delay) {
    std::cout<<"thread: "<<delay<<" seconds\n";
    sleep(delay);
    std::cout<<"exiting thread: "<<delay<<" seconds\n";
    };

  print(4);
  print(1);
```

This will output:

```
thread: 4 seconds
exiting thread: 4 seconds
thread: 1 seconds
exiting thread: 1 seconds
```

Let's analyse it:

1. `print(4)` and `print(1)` started and finished in a sequential manner -
   `print(1)` had to wait for `print(4)` to finish before it executed
2. `print(4)` finished before `print(1)` started

---
## Ways of creating threads

### The lambda way
The lambda way is the way used in the example, and has a nice modern feel to
it (I also quite like lambda functions, so I am slightly biased). The structure
of this is:

```C++
std::thread name_of_thread(lambda, arguments);
```

Example:

```c++
//...
auto p = [](int delay){sleep(delay);std::cout<<"simple lambda thread"<<std::endl;};
std::thread first_thread(p,5);
std::thread first_thread(p,4);
std::thread first_thread(p,3);
//...
```

### The "normal" function call way

This is as simple as a calling a normal function or method. Let us adapt the above lambda to a classical call:

```C++
void p (int delay){
  sleep(delay);
  std::cout<<"classic function thread"<<std::endl;
}

void main(){
  std::thread aThread(p,5);
	std::thread bThread(p,4);
	std::thread cThread(p,3);
  //...
}
```

### The callable object way

When I was looking into threading I discovered that you can implement the
operator `()` for a class which allows it to implement calls. This was a great
find, and I will surely do a post on them. But until then, let's look at a
thread implementation of this:

```C++
class thread_obj {
public:
	void operator()(int delay)
  {
    sleep(delay);
    std::cout<<"Callable object thread \n";
  }
};

void main(){
  std::thread aThread(thread_obj(),5);
	std::thread bThread(thread_obj(),4);
	std::thread cThread(thread_obj(),3);
  //...
}
```

---
## The `.join()`

As previously seenthe `std::thread` object has a method called `join()` which
indicates that the program should wait for the thread to finish before
continuing . An example:

```c++
std::thread calculator(calc);
//... do stuff WHILE calc function executes
calculator.join(); // wait for calc function to finish
//... do stuff AFTER calc function has finished
```

---
## Conclusion

Hopefully you have a better understanding of how to implement threads in C++.
Now go and build fun projects with them!

We will look into further details about handling threads in a later post. Until
then, have fun, break stuff, and learn.

gha_language: HTML


text:
# co_canal_turtles

## Workflow

1. Set the species and testing in `Code/config.yml`
2. Run `Code/prep_data_species.R` to organize data, augment, set starting values
3. Run `Code/run_jags.R` to implement JAGS in parallel on 8 cores
4. Use `Code/mcmc_check.R` to visualize posteriors and check ESS and $\hat{R}$
5. The `mcmc_Analysis.Rmd` file can be used to create figures and tables (refine & turn into supplemental materials?)


text:
---
layout: post
title: "Is Attention Interpretable?"
date: 2019-06-09 22:46:12
categories: arXiv_CL
tags: arXiv_CL Attention Text_Classification Classification Prediction
author: Sofia Serrano, Noah A. Smith
mathjax: true
---

* content
{:toc}

##### Abstract
Attention mechanisms have recently boosted performance on a range of NLP tasks. Because attention layers explicitly weight input components' representations, it is also often assumed that attention can be used to identify information that models found important (e.g., specific contextualized word tokens). We test whether that assumption holds by manipulating attention weights in already-trained text classification models and analyzing the resulting differences in their predictions. While we observe some ways in which higher attention weights correlate with greater impact on model predictions, we also find many ways in which this does not hold, i.e., where gradient-based rankings of attention weights better predict their effects than their magnitudes. We conclude that while attention noisily predicts input components' overall importance to a model, it is by no means a fail-safe indicator.

##### Abstract (translated by Google)

##### URL
[http://arxiv.org/abs/1906.03731](http://arxiv.org/abs/1906.03731)

##### PDF
[http://arxiv.org/pdf/1906.03731](http://arxiv.org/pdf/1906.03731)


text:
# Import Paper Wallet

This guide will teach you how to import a paper wallet to spend funds.

This is available with [Spacecoind](https://github.com/spaceworksco/spacecoin) or [Spacecoin-QT](https://spacecoin.network/#wallets).

## Table of Contents

- [Please Note](#Please-Note)
- [Instructions](#Instructions)

### Please Note

With Spacecoin-QT the commands will need to be entered in the console. This is accessible at `Help -> Debug Window -> Console`.

Once a paper wallet is imported into Spacecoind or Spacecoin-QT, best practice is to not use the paper wallet again.

### Instructions

1. Navigate to `spacecoin-cli` or `Console` depending on your wallet.

2. Enter the command `importprivkey YourPaperWalletPrivateKey`.

    The wallet will start a rescan. This could take some time.

    When complete the output will show the address imported.

repository: SpaceWorksCo/guides

repo_name: SpaceWorksCo/guides


text:
---
{
  "title": "A hybrid unsupervised approach for document clustering",
  "date": "2005-08-21",
  "authors": [
    "M. Surdeanu",
    "J. Turmo",
    "A. Ageno"
  ],
  "abstract": "We propose a hybrid, unsupervised document clustering approach that combines a hierarchical clustering algorithm with Expectation Maximization. We developed several heuristics to automatically select a subset of the clusters generated by the first algorithm as the initial points of the second one. Furthermore, our initialization algorithm generates not only an initial model for the iterative refinement algorithm but also an estimate of the model dimension, thus eliminating another important element of human supervision. We have evaluated the proposed system on five real-world document collections. The results show that our approach generates clustering solutions of higher quality than both its individual components.",
  "links": [
    {
      "resource": "PDF",
      "icon": "pdf",
      "url": "http://dl.acm.org/citation.cfm?id=1081957"
    },
    {
      "resource": "Semantic Scholar",
      "icon": "semanticscholar",
      "url": "https://www.semanticscholar.org/paper/ce90a33d5f089b25c460f42584d24fdb0aacaf37"
    }
  ],
  "supervision": [],
  "tasks": [],
  "methods": [],
  "thumbnail": "a-hybrid-unsupervised-approach-for-document-clustering-thumb.jpg",
  "card": "a-hybrid-unsupervised-approach-for-document-clustering-card.jpg",
  "s2_paper_id": "ce90a33d5f089b25c460f42584d24fdb0aacaf37"
}
---

repository: virtualgraham/unsupervisedpapers

repo_name: virtualgraham/unsupervisedpapers


text:
Version 0.2.0
-------------

Released on March 22, 2013

- Implementing Stormpath Digest Authentication (SAuthc1).
- Fixing implementation when no 'base_url' is specified when creating a DataStore.

Version 0.1.1
-------------

Released on March 14, 2013

- Making the 'base_url' an optional argument in the Client class constructor.

Version 0.1.0
-------------

Released on March 14, 2013

- First release of the Stormpath Python SDK where all of the features available on the REST API, before the ones released on February 19th 2013, were implemented.

repository: maxwellhansen/stormpath-sdk-python

repo_name: maxwellhansen/stormpath-sdk-python


text:
## Metagenomic sequencing
### internal control
Using an internal control (IC) for metagenomic sequencing could lead to a better monitoring of wet lab performance.
Compared to other methods using internal controls, the amount of internal control detected in metagenomic sequencing is also affected by the amount of total DNA present in the sample (here called background DNA).
Goal of this app is to show how the sequenced reads of the IC are dependant not only of the amount spiked in but also the amount of background DNA.
#### How does it work
The amount of background and internal control DNA fragments can be chosen in the sidebar panel.

![ic_sidebar](images/ic_sidebar.jpg)

Those numbers represent the total points per category in the plot. Of those only a (random) subset are sequenced (points within ring).
The bar plot shows how many DNA fragments of each category are sequenced.

![ic_plot](images/ic_plot.jpg)

repository: sschmutz/internal-control

repo_name: sschmutz/internal-control


text:
---
layout: post
title:      "Cheat Sheet Part 2 "
date:       2019-03-15 22:33:36 +0000
permalink:  cheat_sheet_part_2
---

**CRUD**

CREATE
READ
UPDATE
DELETE

FOUR ACTIONS WE NEED TO CREATE A CMS

IMPORTANT FILE STRUCTURE INFORMATION BELOW!

app – contains the models, views, and controllers, along with the the rest of the core functionality of the application. This is the one directory where you can make a change and not have to restart the Rails server. The majority of your time will be spent working in this directory. In addition to the full MVC structure, this directory also contains non Ruby files, such as: css files, javascripts, images, fonts, etc.

bin – some built-in Rails tasks that you most likely will never have to work with.

config – the config directory manages a number of settings that control the default behavior, including: the environment settings, a set of modules that are initialized when the application starts, the ability to set language values, the application settings, the database settings, the application routes, and lastly the secret key base.

db – within the db directory you will find the database schema file that lists the database tables, their columns, and each column’s associated data type. The db directory also contains the seeds.rb file, which lets you create some data that can be utilized in the application. This is a great way to quickly integrate data in the application without having to manually add records through a web form element. The schema file can be found at db/schema.rb.

lib – while many developers could build full applications without ever entering the lib directory, you will discover that it can be incredibly helpful. The lib/tasks directory is where custom rake tasks are created. You have already used a built-in rake task when you ran the database creation and migration tasks; however, creating custom rake tasks can be very helpful and sometimes necessary. For example, a custom rake task that runs in the background, making calls to an external API and syncing the returned data into the application’s database.

log – within the log directory you will discover the application logs. This can be helpful for debugging purposes, but for a production application it's often better to use an outside service since they can offer more advanced services like querying and alerts.

public – this directory contains some of the custom error pages, such as 404 errors, along with the robots.txt file which will let developers control how search engines index the application on the web.

test – by default Rails will install the test suite in this directory. This is where all of your specs, factories, test helpers, and test configuration files can be found. Side note: We always use RSpec, which means this directory will actually be called spec.

tmp – this is where the temporary items are stored and is rarely accessed by developers.

vendor – this directory has been utilized for varying purposes in the past. In Rails 4+, its main purpose is for integrating Client-side MVC frameworks, such as AngularJS.

Gemfile – the Gemfile contains all of the gems that are included in the application; this is where you will place outside libraries that are utilized in the application. After any change to the Gemfile, you will need to run bundle. This will call in all of the code dependencies in the application. The Gem process can seem like a mystery to new developers, but it is important to realize that the Gems that are brought into an application are simply Ruby files that help extend the functionality of the app.

Gemfile.lock – this file should not be edited. It displays all of the dependencies that each of the Gems contain along with their associated versions. Messing around with the lock file can lead to application bugs due to missing or altered Gem dependencies.

README.rdoc – the readme file is an important place to document the details of the application. If the application is an open-source project, this is where you can place instructions to other developers, such as how to get the app up and running locally.

extension: markdown