text:
A WordPress REST API client for Node.js
=======================================

This is a client for the [WordPress REST API](http://wp-api.org/).

**This project is under active development**, and should be considered beta. [Issues](https://github.com/kadamwhite/wordpress-rest-api/issues) are welcome if you find something that doesn't work!

[![Build Status](https://api.travis-ci.org/kadamwhite/wordpress-rest-api.png?branch=master)](https://travis-ci.org/kadamwhite/wordpress-rest-api)

## Purpose

This library is designed to make it easy for your [Node.js](http://nodejs.org) application to request specific resources from a WordPress install. It uses a query builder-style syntax to let you craft the request being made to the WP-API endpoints, then returns the data to your application as a JavaScript object.

## Installation

Currently, this module only supports Node v0.10 & 0.11.

To use the library, install it with [npm](http://npmjs.org):
```bash
npm install --save wordpress-rest-api
```
Then, within your application's script files, `require` the module to gain access to it:
```javascript
var WP = require( 'wordpress-rest-api' );
```

## Using The Client

The module is a constructor, so you can create an instance of the API client bound to the endpoint for your WordPress install:
```javascript
var WP = require( 'wordpress-rest-api' );
var wp = new WP({ endpoint: 'http://src.wordpress-develop.dev' });
```
Once an instance is constructed, you can chain off of it to construct a specific request. (Think of it as a query-builder for WordPress!)

We support requesting posts using either a callback-style or promise-style syntax:
```javascript
// Callbacks
wp.posts().get(function( err, data ) {
    if ( err ) {
        // handle err
    }
    // do something with the returned posts
});

// Promises
wp.posts().then(function( data ) {
    // do something with the returned posts
}).catch(function( err ) {
    // handle error
});
```

### Filtering Collections

Queries against collection endpoints (like `wp.posts()`, which maps to `endpoint/posts/`) can be filtered to specify a subset of posts to return. Many of the WP_Query values are available by default, including `tag`, `author_name`, `page_id`, etc; even more parameters are available to filter byif you authenticate with the API using either [Basic Auth](https://github.com/WP-API/Basic-Auth) or [OAuth](https://github.com/WP-API/OAuth1). You can continue to chain properties until you call `.then`, `.get`, `.post`, `.put`, or `.delete` on the request chain.

Example queries:
```javascript
// All posts belonging to author with nicename "jadenbeirne"
wp.posts().filter( 'author_name', 'jadenbeirne' ).get();

// All posts in category "islands" and tags "clouds" & "sunset"
// (filter can either accept two parameters, as above where it's called with
// a key and a value, or an object of parameter keys and values, as below)
wp.posts().filter({
    category_name: 'islands',
    tag: [ 'clouds', 'sunset' ]
}).get();

// Convenience methods exist for filtering by taxonomy terms
// 'category' can accept either numeric IDs, or string slugs, but not both!
wp.posts().category( 7 ).tag( 'music' ).get();

// Convenience methods also exist for specifying an author: this can also take
// either a numeric ID, or a nicename string. Unlike tags, setting a new value
// will erase any prior value, regardless of type.

// equivalent to .filter( 'author_name', 'williamgibson' ):
wp.posts().author( 'williamgibson' ).get();
// equivalent to .filter( 'author', 42 ):
wp.posts().author( 42 ).get();
// last value wins: this queries for author_name == frankherbert
wp.posts().author( 42 ).author( 'frankherbert' ).get();

// Put it all together: Get the 5 most recent posts by jadenbeirne in 'fiction'
wp.posts()
    .author( 'jadenbeirne' )
    .filter( 'posts_per_page', 5 )
    .tag( 'fiction' )
    .get();

// posts_per_page is exposed to set the maximum number of posts to return
// All posts:
wp.posts().filter( 'posts_per_page', -1 )...
// 20 latest posts:
wp.posts().filter( 'posts_per_page', 20 )...
```

## API Documentation

In addition to the above getting-started guide, we have automatically-generated [API documentation](http://kadamwhite.github.io/wordpress-rest-api). More user-oriented documentation, including a more in-depth overview of available endpoint and filter methods, will be added to this README in the near future.

## Issues

If you identify any errors in this module, or have an idea for an improvement, please [open an issue](https://github.com/kadamwhite/wordpress-rest-api/issues). We're excited to see what the community thinks of this project, and we would love your input!

repository: jugglinmike/wordpress-rest-api

repo_name: jugglinmike/wordpress-rest-api


text:
# YAL (Yet Another Language) Compiler

A compiler designed for custom language YAL (Yet Another Language). It's developed in C++ for the Bachelors course **Compiler Construction** in Fall2015.

repository: hmhamza/yal-compiler-construction

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: hmhamza/yal-compiler-construction


text:
## Summary
Following on from last week’s article on [Planning Horizon](/blog/roi-of-the-planning-horizon), I wanted to provide an example.

So in this article, I follow a system across its lifetime and discusses both the drivers for change and the affect it has on the work.

## Meal Costing system
One of the first systems I ever produced was a Meal Costing system for an Inflight Catering company back in 1994/ 1995.

The system was built to allow the company to price up a variety of menus – which then provided quotes to their customers.  A menu would consist of a selection of ingredients – be they a pack of biscuits or the amount of potato required for the shepherd’s pie.

If writing this system today, I’d probably be able to provide most of the functionality with an Excel spreadsheet.

At the time though, Windows and Microsoft Excel were not mainstream.  I don’t think I had my first works PC until the end of the 90s.

At that point I was writing code for character based green screens:
![Terminal](/media/blog/roi-of-the-planning-horizon-an-example/Terminal.jpg)

I built the system using [Informix 4GL](https://en.wikipedia.org/wiki/IBM_Informix-4GL).  A reasonably well used language – but far from one of the major ones.

Initial effort to develop the system was probably around 8 weeks with various visits to customer site to tweak.  Largely speak though, by early 95 the software was in use and providing value.

So did the system stop there?  Was that all the investment that went in to it?

Of course not.

There was additional functionality required by the client over the remainder of 1995 – the odd day here … the odd week there.  Easily another 4 weeks of work.  Plus of course the costs of licences, support for the underlying hardware & software, electricity, etc.

## Time for the Crystal Ball
What follows from this point is speculation over the life of the system.  I left the software house that produced the software at the end of 1995 – so unfortunately, I don’t know the truth.  But I feel the below gives an idea of what that history could have looked like.

Ultimately the requirements for the system will be as true today as it was then.

## 1996 – The joy of Fax
Remember fax machines?  If not, lucky you.

But let’s assume that our client wants to be able to automatically fax their meal quotes to their customers at a push of button.

If you think that the meal costs may vary monthly or even weekly due to fluctuations in ingredient costs, it would be a fairly time consuming task for someone to print and then fax to every customer.  This automation would save them a fair amount of manual effort.

Let’s assume that it takes 2 weeks to implement.

## 1997 - Rise of Windows
The initial take up of Windows was fairly slow in most organisations – but once it took hold, everyone had their own personal computer.

And while you could still run “green screen” character based programs, users where expecting to have the productivity that came from Windows – and most importantly the mouse.

It would have been a natural evolution for the Meal Costing software to be re-written entirely to take advantage of the Windows innovation.

Spoiler alert – this is not likely to be the last re-write we see of the software during its lifetime.

While tools existed to “Window-fy” Informix 4gl – they were largely unsuccessful and fairly short lived.  So it would probably have been re-written in Visual Basic 6 from Microsoft.

Let’s assume this would have been another 4 weeks development.

## 1999 - Year 200 Bug
Anyone remember the panic over Y2K?

All computers were to fail, planes were to fall out of the sky and civilisation as we knew it would end.

While some of the claims were over-blown to say the least, the huge amount of work put in by IT professionals to validate and patch systems also helped.

I would have expected our client to want verification that the system would cope with Y2K – so let’s add another week for checking and testing the system.

## 2002 – The joy of Email
Fax is dead … long live email.

Let’s stop faxing and using email … it’s more convenient AND cheaper.

So another week of work to switch those Meal Costing quotes to email.

## 2005 – Moving to the Internet
The internet is gaining ground.  Customers are expecting to be able to just log on to a website to see their menus.  Possibly even have a greater variety available to them.

This really requires us to re-write the software again.  Visual Basic 6, while great on the Windows Desktop, really didn’t lend itself to websites … plus at this point it is really showing its age.

So I replace the entire system using VB.Net (the successor to Visual Basic 6) – a natural choice.

This is a major re-write and providing functionality not just for our client, but also their customers.

Let’s assume this take 8 weeks.

## 2006 – Electronic Data Interchange
Suppliers and customers want to deal electronically with our client and automate various supply chain tasks through [EDI](https://en.wikipedia.org/wiki/Electronic_data_interchange).

Let’s assume this is another 4 weeks.

## 2008 – Mobile Internet
Smartphones are on the rise.  From the humble beginnings of the XDA:
![XDA](/media/blog/roi-of-the-planning-horizon-an-example/xda.jpg)

An explosion of computers in our pockets.

Our client’s sales reps want to be able to capture customer data on their phone – rather than having to take manual notes, only to have to type them up later.

The website now also needs to be updated for the mobile phone screen size.

The system needs another re-write (or at least a good face lift) to do this.

Let’s assume this is another 4 weeks.

## 2010 –Social Media explosion
Facebook, Twitter, and a multitude of other Social Media tools … they are either here or coming.

Now this is a great time for our client to provide innovation to their customers.  Utilising Social Media they start to illicit feedback from their customer’s passengers.

Our client then uses that feedback to provide analysis to their customers on what is working well.  This is the start of providing intelligence to their customer – making them a valuable partner rather than just a supplier.

Let’s assume this is another 8 weeks.

## 2011 – Time for the iPad
And iPads make that job for our client’s sales reps so much easier.  And they introduce another screen size for the website.

Let’s assume this is another 4 weeks.

## 2012 – The joy of APIs
Our client’s customers and suppliers have enjoyed the benefits of the Electronic Data Interchange – but time marches on and [APIs](https://en.wikipedia.org/wiki/Application_programming_interface) are taking over from EDI.

Let’s assume another 4 weeks.

## 2014 – Device Tags
Adding [NFC](https://en.wikipedia.org/wiki/Near_field_communication) tags to meal containers allows our client to gather inventories faster – both on and off the plane.

It also allows collection of data of what meals appealed to what flights.

Again, this adds more detail to the analytic data our client can utilise to provide intelligence to their customers.

Let’s assume this is another 8 weeks.

## 2015 – JavaScript framework
JavaScript frameworks are making websites much more feature rich.  They have gained their reputation within high traffic systems like Facebook.

Using these enable a much high level of functionality for our client’s customer.  This opens the way for allowing a customer to generate their own menu through dragging and dropping various component parts.

This is yet another re-write.

Let’s assume this is another 4 weeks.

## 2016 – Internet Of Things
With IOT, everything can be intelligent – allowing even greater inventory and supply chain efficiencies.

Let’s assume this is another 4 weeks.

## 2017 – Artificial Intelligence
Our client has been collecting data for years.  They have been ahead of the market in providing their customers analytical data.

They see the advent of artificial intelligence and machine learning as the next step in providing even deeper insight to their customer.

Let’s assume this is another 4 weeks.

## Summary
Ok, I admit I’ve taken artistic licence with some of the dates and timescales – but hopefully the message is clear – the world changes and our software needs to change with it.

While our initial investment in the software was fairly minimal, the investment during its full lifetime dwarfs it almost into insignificance.  If you see the below, the original build accounts for just over 10% of the effort – and this really doesn’t take into account day-to-day maintenance (assume 10-25% on top of total development effort), licences, hardware, training, etc.

Task	Weeks

Original Build	8

Snagging	4

Fax	2

Windows	4

Y2K	1

Email	1

Website	8

EDI	4

Social Media	8

Smartphone	4

iPad	4

API	4

NFC	8

JavaScript	4

IOT	4

AI	4

Total	72

Thus, as I asked in my last article, why are we only looking at the immediate future when considering our planning (and thus ROI investment).

While I’d never expect anyone to plan over 20 years into the future – then certainly the next 3-5 years should be in mind when making todays decisions.

How will this decision affect our productivity and effectiveness over the coming week, months AND years.

Without thinking in this way, it is too easy to focus on the now and not correctly apply those best practices and principals that will produce the best ROI over the lifetime of the software.

## Applying that thinking
In the next article, I will give a summary of some of the practices and principals (most of which I've covered previously) and how this longer term mindset affects our planning.

license: MIT

gha_language: C#

gha_license_id: MIT


text:
# OpenEthereum Agents runtime

This crate implements the basic of the data-flow based async agents runtime for the upcoming OpenEtherem architecture.

The basic idea behind this architecture is to split the system into separate autonomous agents that talk to each other through messages passing. Individual agents can run all locally on one machine or be distributed over a cluster of machines forming one clustered client.

Parts of this design are inspired by
  - [ConcRT C++ Asynchronous Agents Library](https://docs.microsoft.com/en-us/cpp/parallel/concrt/asynchronous-agents-library)
  - [Intel Thread Building Blocks Data Flow Graph](https://software.intel.com/content/www/us/en/develop/documentation/tbb-documentation/top/intel-threading-building-blocks-developer-guide/parallelizing-data-flow-and-dependence-graphs/parallelizing-data-flow-and-dependency-graphs.html)

Interaction with individual agents happens by sending them messages through `send()` or awaiting messages from them through `receive()`. Agents may publish and consume messages by implementing traits `Target` and `Source`. A high-level example of how this model works in practice is illustrated below using an example of a networking agent and a transaction pool then miner:

```rust
  let network = NetworkInterface::new();
  let auction = TransactionAuction::new();
  let miner = BlockMiner::new();

  let transaction1 = receive(&network).await?;
  let transaction2 = receive(&network).await?;
  let transaction3 = receive(&network).await?;

  send(&auction, transaction1).await;
  send(&auction, transaction2).await;
  send(&auction, transaction3).await;

  let block_proposal: BlockProposal = receive(&auction).await?;
  send(&miner, block_proposal).await;

  let minted_block = receive(&miner).await?;
```

You can see an actual compiling and running version of a `TransactionAuction` in the `auction` crate and an example of how its integrated with real transaction objects in the `oe` crate tests.

This kind of apporach gives us few benefits:
  - Each individual agent has its own threading model and may internally spawn several instances of itself according to its processing need (i.e. 3x EVM for each 1x Transaction Pool).
  - The overall understanding of the system is greatly simplified, because the developer now needs only to focus on the actual data flow of transformations. For example define that
    - a transaction comes from the network then goes to pool -> evm -> miner -> rpc -> stop.
    - a block comes from the network then goes to integrity verifier -> evm -> merkle proof verifier -> storage agent.
    - model things accordingly as a combination of `send`/`receive` between individual agents.
  - It is transparent to individual agents whether the messages are coming from shared memory, network, IPC, or through other means, this opens the door to have different pluggable implementations of individual components without even shutting down the system. For example plugging a network-local redis-based key-value store, or a message-based pool of local miners, or an rpc interface behind nginx, etc.

## Working Code Example:

```rust
#[cfg(test)]
mod tests {
  use std::{
    sync::Arc,
    time::{Duration, Instant},
  };

  use auction::TransactionsAuction;
  use ethereum::{Transaction, U256};
  use runtime::{receive, send};

  #[tokio::test(flavor = "multi_thread")]
  async fn transaction_auction_io() {
    let auction = Arc::new(TransactionsAuction::new());

    let ref1 = auction.clone();
    let task1 = tokio::task::spawn(async move {
      std::thread::sleep(Duration::from_secs(1));
      let t1 = Transaction {
        nonce: U256::from(1),
        ..Transaction::default()
      };

      std::thread::sleep(Duration::from_secs(1));
      let t2 = Transaction {
        nonce: U256::from(2),
        ..Transaction::default()
      };

      // send a transaction to the auction/pool
      send(&*ref1, t1).await;
      send(&*ref1, t2).await;
    });

    let ref2 = auction.clone();
    let task2 = tokio::task::spawn(async move {
      std::thread::sleep(Duration::from_secs(1));
      let t3 = Transaction {
        nonce: U256::from(3),
        ..Transaction::default()
      };

      std::thread::sleep(Duration::from_secs(2));
      let t4 = Transaction {
        nonce: U256::from(4),
        ..Transaction::default()
      };

      // send a transaction to the auction/pool
      send(&*ref2, t3).await;
      send(&*ref2, t4).await;
    });

    let start = Instant::now();
    let proposal = receive(&*auction).await.unwrap();
    assert_eq!(proposal.len(), 3);
    assert!(start.elapsed() >= Duration::from_secs(2));

    assert_eq!(proposal[0].nonce, U256::from(1));
    assert_eq!(proposal[1].nonce, U256::from(2));
    assert_eq!(proposal[2].nonce, U256::from(3));

    task1.await.unwrap();
    task2.await.unwrap();
  }
}
```

The implementation of a transaction pool/auction in this model looks like this:

```rust
use async_trait::async_trait;
use ethereum::Transaction;
use runtime::buffers;

pub type BlockProposal = Vec<Transaction>;

/// This type is responsible for selecting the most appropriate set of transactions
/// to be included in the next block.
///
/// In this first iteration it has a basic mock logic, that just porposes a
/// new block for every set of 3 transactions.
pub struct TransactionsAuction {
  incoming_tx: buffers::UnboundedBuffer<Transaction>,
}

impl TransactionsAuction {
  pub fn new() -> Self {
    TransactionsAuction {
      incoming_tx: buffers::UnboundedBuffer::new(),
    }
  }

  /// adds a transaction to the auction as a candidate for the next
  /// block that will be proposed
  pub async fn include_transaction(&self, tx: Transaction) {
    buffers::send(&self.incoming_tx, tx).await;
  }
}

#[async_trait]
impl buffers::Target<Transaction> for TransactionsAuction {
  async fn accept(&self, message: runtime::Message<Transaction>) -> runtime::MessageStatus {
    self.incoming_tx.accept(message).await
  }
}

#[async_trait]
impl buffers::Source<BlockProposal> for TransactionsAuction {
  fn try_consume(&self) -> Option<runtime::Message<BlockProposal>> {
    None
  }

  /// Aggregate transactions until 3 txs are available and then return them as one proposal
  async fn consume(&self) -> buffers::Result<runtime::Message<BlockProposal>> {
    let mut txs = Vec::with_capacity(3);
    while txs.len() != 3 {
      txs.push(self.incoming_tx.consume().await?.release());
    }
    txs.sort_by(|a, b| a.nonce.cmp(&b.nonce));
    Ok(buffers::Message::new(txs))
  }
}

```

See also:

- [Async Message Buffers Library](src/buffers/mod.rs)
- [UnboundedBuffer](src/buffers/unbounded.rs)
- [OverwriteBuffer](src/buffers/overwrite.rs)
- [WriteOnceBuffer](src/buffers/write_once.rs)
- [Message](src/buffers/message.rs)


text:
## Exercise 4: RPGInheritance

### Requirements

- Note: *No tests are required for this Exercise!*

In this exercise, you will design an inheritance hierarchy for characters in a video game. Your design must include a common base class for the following three character types:

- Farmer

- Constable

- Warrior

### Instructions

Create your solution in an IntelliJ project called (`RPGInheritance`).

- Farmer

    - Properties:
        - name
        - strength (initial value = 75)
        - health (initial value = 100)
        - stamina (initial value = 75)
        - speed (initial value = 10)
        - attackPower (initial value = 1)

    - Abilities:
        - run
        - plow
        - harvest
        - attack
        - heal
        - decreaseHealth
        - increaseStamina
        - decreaseStamina

- Constable

    - Properties
        - name
        - strength (initial value = 60)
        - health (initial value = 100)
        - stamina (initial value = 60)
        - speed (initial value = 20)
        - attackPower (initial value = 5)
        - jurisdiction

    - Abilities:
        - run
        - arrest
        - attack
        - heal
        - decreaseHealth
        - increaseStamina
        - decreaseStamina

- Warrior

    - Properties
        - name
        - strength (initial value = 75)
        - health (initial value = 100)
        - stamina (initial value = 100)
        - speed (initial value = 50)
        - attackPower (initial value = 10)
        - shieldStrength (initial value = 100)

    - Abilities:
        - run
        - attack
        - heal
        - decreaseHealth
        - increaseStamina
        - decreaseStamina
        - decreaseShieldStrength

### Exercise 4 Code: 20%

- Note: *No tests are required for this Exercise!*

- You create your solution in an IntelliJ project called `RPGInheritance`.

- Your design must include a common base class for the following three character types:

- Farmer

    - Properties
        - name
        - strength (initial value = 75)
        - health (initial value = 100)
        - stamina (initial value = 75)
        - speed (initial value = 10)
        - attackPower (initial value = 1)

    - Abilities
        - run
        - plow
        - harvest
        - attack
        - heal
        - decreaseHealth
        - increaseStamina
        - decreaseStamina

- Constable

    - Properties
        - name
        - strength (initial value = 60)
        - health (initial value = 100)
        - stamina (initial value = 60)
        - speed (initial value = 20)
        - attackPower (initial value = 5)
        - jurisdiction

    - Abilities
        - run
        - arrest
        - attack
        - heal
        - decreaseHealth
        - increaseStamina
        - decreaseStamina

- Warrior

    - Properties
        - name
        - strength (initial value = 75)
        - health (initial value = 100)
        - stamina (initial value = 100)
        - speed (initial value = 50)
        - attackPower (initial value = 10)
        - shieldStrength (initial value = 100)

    - Abilities
        - run
        - attack
        - heal
        - decreaseHealth
        - increaseStamina
        - decreaseStamina
        - decreaseShieldStrength

branch_name: refs/heads/main


text:
# A script for helping update ENCODE reference epigenomes on the portal

The `RefEpi_update.py` is designed to help collect relevant info for wranglers to check and decide how to update ENCODE reference epigenomes on the portal. There are three functions:

* `./RefEpi_updater.py create`

  This script looks for released core (H3K27me3, H3K36me3, H3K4me1, H3K4me3, H3K27ac, H3K9me3) reference epigenome experiments which don't belong to any current reference epigenomes. If found, it will list them out with relevant info so that wranglers can create new reference epigenomes based on that. You do want to run `update` to check if there are other experiments to be added to these new reference epigenomes.

* `./RefEpi_updater.py update`

  This script will go through all released reference epigenome relevant experiments and output a big table with one row describing experiments currently in each reference epigenomes and the next row below it describing candidate experiments which can be put into corresponding reference epigenomes. Wranglers need to go through this table carefully to decide what should be updated. After updates if any, you do want to run `find-controls` to update controls in reference epigenomes. For example, when a ChIP experiment is replaced, its control in the same reference epigenome also needs to be updated.

* `./RefEpi_updater.py find-controls`

  This script will go through every existing reference epigenome on the ENCODE portal, find out needed controls in each reference epigenome and compare this control set to controls currently in that reference epigenome. If any differences are found, it will output a new list of "related_datasets" with controls updated for that reference epigenome.

# Scripts for submitting reference epigenomes to IHEC

In general, a submission to IHEC contains two parts: EpiRR and IHEC data hub. For us, ENCODE, one prerequisite (step 0) is to make sure all our reference epigenomes are up to date on the production portal.
Both EpiRR and IHEC data hub submissions can be validated with ihec-ecosystems (https://github.com/IHEC/ihec-ecosystems). As for now (11-11-2019), it's worth to keep in mind two things:

1. The two validations are not strictly related, i.e. metadata from validated EpiRR submission may not pass IHEC data hub submission. Therefore, it might be better to adjust all scripts, reconcile all conflicts/errors and validate both EpiRR submission and IHEC data hub submissions before submitting any of them.
2. Both validations should be run within ihec-ecosystems code base. Those scripts and code are not yet packaged thus cannot be called properly from outside.

### EpiRR submission

* Scripts:

  - `epiRR.py`.

    This script needs to be run at the same directory as version_metadata folder of ihec-ecosystems repository because it will use ihec-ecosystems to validate outputs. An "ENCODE" folder need to be created in the same directory as the version_metadata folder if it's not there before running this script.

  - `compare_epirr_submission.py`.

    This script takes in two directories containing EpiRR submissions, compare validated XML and JSON one by one and output differences to stdout.

* Basic commands:

  - `./epiRR.py --one ENCSR191PVZ ENCSR867OGI`

    Create EpiRR submission(s) for one or more ENCODE reference epigenome(s) specified by accession(s).

  - `./epiRR.py --all`

    Create EpiRR submissions for all released ENCODE reference epigenomes.

  - `./compare_epirr_submission.py ENCODE_12112019/ ENCODE_12132019/`

    Compare two EpiRR submissions in "ENCODE_12112019" and "ENCODE_12132019"

* Expected outputs:

  The `epiRR.py` script will validate generated EpiRR submission using ihec-ecosystems. For every ENCODE reference epigenome, there will be five files:

  1. ENCSR191PVZ.refepi.json
  2. ENCSR191PVZ_experiment.xml
  3. ENCSR191PVZ_samples.xml
  4. ENCSR191PVZ_experiment.validated.xml
  5. ENCSR191PVZ_samples.validated.xml

  The last two are created by ihec-ecosystems validation code and will show up once an EpiRR reference epigenome submission passes validation.

  The `compare_epirr_submission.py` script will print the file name and the differences once it finds any differences like the following:

  ```
  ENCSR743BGS_samples.validated.xml
  [update-text, /SAMPLE_SET/SAMPLE[1]/SAMPLE_ATTRIBUTES/SAMPLE_ATTRIBUTE[9]/VALUE[1], "endoderm,ectoderm,mesoderm"]
  [update-text, /SAMPLE_SET/SAMPLE[2]/SAMPLE_ATTRIBUTES/SAMPLE_ATTRIBUTE[9]/VALUE[1], "endoderm,ectoderm,mesoderm"]
  [update-text, /SAMPLE_SET/SAMPLE[3]/SAMPLE_ATTRIBUTES/SAMPLE_ATTRIBUTE[9]/VALUE[1], "endoderm,ectoderm,mesoderm"]
  ```

* How to submit?

  Package all outputs for all reference epigenomes to be submitted into a tarball and email it to<EMAIL_ADDRESS>A ticket will be created in their system this way.

### IHEC data hub submission

* Scripts:

  - `ihec_data_hub.py`

    It is not required but it's better to run this script under IHEC_Data_Hub folder of ihec-ecosystems repository because the next validation script needs outputs to be in the same folder and will use ihec-ecosystems to validate outputs.

    __*It's worth noting*__ that this script heavily depends on the `batch_hub` end point of the portal and doesn't do too much customization on its own. Therefore, any changes in encoded `batch_hub` end point could affect this script and any changes needed for IHEC data hub submission should be address in encoded `batch_hub` end point.

  - `ENCODE_IHEC_data_hub_validation.sh`

    This script will assume there are three JSON submissions named as `ENCODE_IHEC_Data_Hub_hg19.json`, `ENCODE_IHEC_Data_Hub_hg38.json`, `ENCODE_IHEC_Data_Hub_mm10.json`. Such naming is not required. Feel free to run the command within the script separately as you like. Just remember to use the options as exampled in the script.

* Basic commands:

  - `./ihec_data_hub.py --one ENCSR191PVZ ENCSR867OGI`

    Create one set of submissions, one JSON per assembly (hg19, hg38, mm10), for one or more ENCODE reference epigenome(s) specified by accession(s).

  - `./ihec_data_hub.py --all`

    Create one set of submissions, one JSON per assembly (hg19, hg38, mm10), for all released ENCODE reference epigenomes.

  - `ENCODE_IHEC_data_hub_validation.sh &> validation.log`: validate three IHEC data submissions named as `ENCODE_IHEC_Data_Hub_hg19.json`, `ENCODE_IHEC_Data_Hub_hg38.json`, `ENCODE_IHEC_Data_Hub_mm10.json`.

* Expected outputs:
  IHEC data portal required us to combine tracks for all our reference epigenomes as one hub per assembly. The exact output depends on what reference epigenomes you'd like to submit. Generating submissions for all released ENCODE reference epigenomes will create three JSON files:

  - `ENCODE_IHEC_Data_Hub_hg19.json`
  - `ENCODE_IHEC_Data_Hub_hg38.json`
  - `ENCODE_IHEC_Data_Hub_mm10.json`.

* How to submit?

  Email JSON hub(s) to David Bujold<EMAIL_ADDRESS>and David Brownlee<EMAIL_ADDRESS>Those JSON files could be too big for email attachments. Using Google Drive is OK with David.

repository: ENCODE-DCC/pyencoded-tools

gha_language: Jupyter Notebook

repo_name: ENCODE-DCC/pyencoded-tools


text:
# Analysis Workflow

**Warning:** This file is still under construction. I promise it will be completed before this study is published.

First you'll need to clone this directory. The following workflow is designed to be run from the root directory of the repository.

	git clone https://github.com/SchlossLab/Baxter_glne007Modeling_GenomeMed_2015.git

### Acquiring the raw data
Download .sra files from the NCBI Sequence Read Archive.  The accession number for this study is SRP062005.

	wget -r -np -nd -k -P data/ ftp://ftp-trace.ncbi.nih.gov/sra/sra-instant/reads/ByStudy/sra/SRP/SRP062/SRP062005/

Extract fastq files from the sra files. You will need to have the [SRA Toolkit](http://www.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?cmd=show&f=software&m=software&s=software) installed on your system. This command will also delete the sra files so that they don't waste storage space.

	for FILE in data/*.sra; do fastq-dump --split-files --outdir data/ $FILE && rm -f $FILE; done

### Sequence Curation
The next step is sequence curation with [mothur](http://www.mothur.org/wiki/Download_mothur).

Download and unzip reference files.

	wget -P data/ http://www.mothur.org/w/images/b/be/Silva.nr_v123.tgz
	tar zxv -C data/ -f data/Silva.nr_v123.tgz
	wget -P data/ http://mothur.org/w/images/2/24/Trainset10_082014.pds.tgz
	tar zxv -C data/ -f data/Trainset10_082014.pds.tgz

The data/ directory should contain a file called glne007.files.  This file tells mothur which fastq files belong to each sample. You may notice that a few samples have more than one entry. Those are samples that were sequenced a second time to improve coverage. They will be merged during the make.contigs step of mothur.

At this point we need to run code/mothur.batch, which contains most of the commands we'll run in mothur. The mothur.pbs script can be used to run mothur.batch on a high-performance computing cluster. You will likely need to make modifications to mothur.pbs to run it on your cluster.

	qsub code/mothur.pbs

### OTU clustering and classification
The next step is OTU clustering (and some downstream mothur commands) using the cluster.batch file. This step is very memory intensive, so we run it with 1 processors and 150gb of memory.

	qsub code/cluster.pbs

### Generating and Testing models
The bulk of the analyses for this study are done through the Baxter_glne007_2016_manuscript.Rmd knitr document. It will generate and test the random forest models, generate figures, and render a docx of the manuscript.

	Rscript -e "library(knitr); knit('Baxter_glne007_2016_manuscript.Rmd')"


text:
This is the code for [dotnetmashup.azurewebsites.net](http://dotnetmashup.azurewebsites.net) a mashup of news feeds for the `.net` community.

## Why?

Right now ASP.NET 5 has a multitude of news from tweets, blog posts, [announcements repo](https://github.com/aspnet/Announcements), and the community standup.

This app is designed to try to aggregate them in one continuous scroll web page.

## How do I add my blog?

Add your blog information to src/DotNetMashup.Web/blogfeed.json submit a PR

## Contributing

Contributions are welcome, submit an issue with the feature you would like to add so we can discuss it ahead of time. To get the various feeds working you must add api keys to the `startup.cs` file.

You will need twitter, and github keys (or you can turn off said feeds in RepositoryFactory.cs)

You will need to do something like the following in `startup.cs` (please remember to not commit this). Usually these keys come from environment variables, you could also place them there, and not worry about altering `startup.cs`

```csharp
public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv)
       {
           config = new ConfigurationBuilder()
           .AddEnvironmentVariables()
           .Build();
           config["github"] = "githubkeyhere";
           config["twitterkey"] = "Consumer Key";
           config["twittersecret"] = "Consumer Secret ";
           config["twittertokenKey"] = "Access Token";
           config["twittertokenSecret"] = "Access Token Secret";
       }

```

repository: TerribleDev/DotNetMashup

repo_name: TerribleDev/DotNetMashup


text:
# PyTapo

Python library for communication with Tapo Cameras

## Install:

```
python3 -m pip install pytapo
```

## Usage examples:

### Initiate library:

```
from pytapo import Tapo

user = "" # user you set in Advanced Settings -> Camera Account
password = "" # password you set in Advanced Settings -> Camera Account
host = "" # ip of the camera, example: <IP_ADDRESS>

tapo = Tapo(host, user, password)

print(tapo.getBasicInfo())
```

## Authentication

Depending on your camera model and firmware version, the authentication method varies.

Normally you should be able to authenticate using the "camera account" created via the Tapo App (Settings > Advanced settings > Camera account).

In case of a similar stack trace:

```
Traceback (most recent call last):
  File "/home/user/Projects/pytapo/pytapo/__init__.py", line 41, in __init__
    self.basicInfo = self.getBasicInfo()
  File "/home/user/Projects/pytapo/pytapo/__init__.py", line 232, in getBasicInfo
    return self.performRequest(
  File "/home/user/Projects/pytapo/pytapo/__init__.py", line 95, in performRequest
    self.ensureAuthenticated()
  File "/home/user/Projects/pytapo/pytapo/__init__.py", line 61, in ensureAuthenticated
    return self.refreshStok()
  File "/home/user/Projects/pytapo/pytapo/__init__.py", line 80, in refreshStok
    raise Exception("Invalid authentication data")
Exception: Invalid authentication data
```

Attempt to authenticate using `admin` as `user` and your TP-Link cloud account password as `password`.

## Contributions:

Contributions to pytapo are welcomed.

By creating a PR you acknowledge and agree that you are not breaking any TOS, law and/or have a permission to provide and share the code changes.

Owner of this repository is not legally responsible for any PRs or code changes to this project created by 3rd parties.

When you make a new change to the code base, make sure to have 100% unit test coverage, see below for more information about tests.

### Test instructions

Set the following environment variables:

`PYTAPO_USER` - user you set in Advanced Settings -> Camera Account

`PYTAPO_PASSWORD` - password you set in Advanced Settings -> Camera Account

`PYTAPO_IP` - ip of the camera, example: <IP_ADDRESS>

Install `pre-commit` and `tox` from pip.

Run `pre-commit install` and `pre-commit install -t pre-push`.

Then run `tox` to run all the tests.

Linters are ran on every commit.

Tests are ran on push.

Your camera may do all the actions supported by this library, including, but not limited to, move, change privacy mode and reboot while tests are running. Camera does not format SD card during tests.

After the tests are done, your camera should be in the initial state.

## Thank you

- [Dale Pavey](https://research.nccgroup.com/2020/07/31/lights-camera-hacked-an-insight-into-the-world-of-popular-ip-cameras/) from NCC Group for the initial research on the Tapo C200
- [likaci](https://github.com/likaci) and [his github repository](https://github.com/likaci/mercury-ipc-control) for the research on the Mercury camera on which tapo is based
- [Tim Zhang](https://github.com/ttimasdf) for additional research for Mercury camera on [his github repository](https://github.com/ttimasdf/mercury-ipc-control)
- [Gábor Szabados](https://github.com/GSzabados) for doing research and gathering all the information above in [Home Assistant Community forum](https://community.home-assistant.io/t/use-pan-tilt-function-for-tp-link-tapo-c200-from-home-assistant/170143/18)
- [Davide Depau](https://github.com/Depau) for additional [research](https://md.depau.eu/s/r1Ys_oWoP) of the cameras and work on pytapo library

# Disclaimer

Pytapo is an unofficial module for achieving interoperability with Tapo cameras.

Author is in no way affiliated with Tp-Link or Tapo.

All the api requests used within the library are available and published on the internet (examples linked above) and this module is purely just a wrapper around those https requests.

Author does not guarantee functionality of this library and is not responsible for any damage.

All product names, trademarks and registered trademarks in this repository, are property of their respective owners.

repository: sidamos/pytapo

repo_name: sidamos/pytapo


text:
# Visualforce Development Cookbook (Second Edition)
Visualforce Development Cookbook (Second Edition) by Packt. It contains all the supporting project files necessary to work through the book from start to finish.

##Instructions and Navigation
This is the code repository for [Visualforce Development Cookbook](https://www.packtpub.com/application-development/visualforce-development-cookbook-%E2%80%93-second-edition), published by Packt. All you need is a web browser with internet connection to use this book and codes/instruction within.
The code samples can be added to your Salesforce instance in one of two ways:

1. Cut and Paste

Simply paste the body of the file into the online code editor, as detailed in the
recipe instructions.

2. Force.com IDE

If you are using the Force.com IDE (Eclipse Plugin) you can install all of the pages
and classes in one go.
Copy the files from the pages and classes folders to the respective pages and
classes folder under the src folder of your Salesforce project.
Right click the src folder of your Salesforce project and select Refresh from the
context menu. This will update the server with the newly added files.

Please see the README files in the individual chapters for specific instructions.

##Description
Visualforce Development Cookbook provides solutions to a variety of challenges faced by Salesforce developers
and demonstrates how easy it is to build rich, interactive pages using Visualforce. You will start by learning about
the simple utilities and will build up to more advanced techniques for data visualization and to reuse functionality.
You will learn how to perform various tasks such as creating multiple records from a single page, visualizing data as
charts, using JavaScript to enhance client-side functionality, building a public website, and making data available to a
mobile device.

##Related Salesforce Products:
* [Visualforce Development Cookbook](https://www.packtpub.com/application-development/visualforce-development-cookbook?utm_source=github&utm_medium=repository&utm_campaign=9781782170808)
* [Visualforce Developers Guide](https://www.packtpub.com/application-development/visualforce-developer%E2%80%99s-guide?utm_source=github&utm_medium=repository&utm_campaign=9781782170808)
* [Learning Apex Programming](https://www.packtpub.com/application-development/learning-apex-programming?utm_source=github&utm_medium=repository&utm_campaign=9781782170808)
### Download a free PDF

 If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.

 https://packt.link/free-ebook/9781782170808


text:
# Kalaha

> Kalah, also called Kalaha, is a copy of the ancient game mancala trademarked in the United States by William Julius Champion, Jr. in 1940. This game is sometimes also called "Kalahari", possibly by false etymology from the Kalahari desert in Namibia.
>
> As the most popular and commercially available variant of mancala in the West, Kalah is also sometimes referred to as Warri or Awari, although those names more properly refer to the game Oware.

\- Wikipedia

## How to play

> This section does not explain the rules, but how to start the game. For rules please look under "Rules".

This is a console implementation of Mancala.
To start the game go into the src-folder and open the console/terminal and start the game with python3:

```
Linux/Mac:
$ python3 ./app.py

Windows:
> python app.py

From now on I will use "python3".
If you are on windows only use "python"
```

You can also provide a game-code which will start the game in a certain configuration:

```
$ python3 app.py "0b06070103000611010503040107"
Layout
╔══╦══╦══╦══╦══╦══╦══╦══╗
║  ║ 6║ 5║ 4║ 3║ 2║ 1║  ║ <- Player 2
║  ╠══╬══╬══╬══╬══╬══╣  ║
║  ║ 1║ 2║ 3║ 4║ 5║ 6║  ║ <- Player 1
╚══╩══╩══╩══╩══╩══╩══╩══╝

GAME

    ╔══╦══╦══╦══╦══╦══╦══╦══╗
    ║  ║ 7║ 1║ 4║ 3║ 5║ 1║  ║
    ║11╠══╬══╬══╬══╬══╬══╣17║
    ║  ║ 6║ 7║ 1║ 3║ 0║ 6║  ║
    ╚══╩══╩══╩══╩══╩══╩══╩══╝

Player 1:
```

The players then take turns choosing a position to play the stones from by providing a number from 1 to 6. The positions are numbered as follows:

```
╔══╦══╦══╦══╦══╦══╦══╦══╗
║  ║ 6║ 5║ 4║ 3║ 2║ 1║  ║ <- Player 2
║  ╠══╬══╬══╬══╬══╬══╣  ║
║  ║ 1║ 2║ 3║ 4║ 5║ 6║  ║ <- Player 1
╚══╩══╩══╩══╩══╩══╩══╩══╝
```

The players can also exit the game by typing "exit". This will provide a game-code.

## Rules
The board is divided into two sets of 6 positions each filled with 6 stones and one House (Mancala) for each player.

```
╔══╦══╦══╦══╦══╦══╦══╦══╗
║  ║ 6║ 6║ 6║ 6║ 6║ 6║  ║
║0 ╠══╬══╬══╬══╬══╬══╣ 0║
║  ║ 6║ 6║ 6║ 6║ 6║ 6║  ║
╚══╩══╩══╩══╩══╩══╩══╩══╝
```

Player one starts by choosing a position and spreading the stones in their position counter-clockwise, putting one in their own Mancala (the first to encounter) if passed, but not in the opponents.

```
Example:
╔══╦══╦══╦══╦══╦══╦══╦══╗
║  ║10║ 3║ 9║10║ 0║ 9║  ║
║ 2╠══╬══╬══╬══╬══╬══╣ 5║
║  ║ 3║ 2║10║ 9║ 0║ 0║  ║
╚══╩══╩══╩══╩══╩══╩══╩══╝
     ^
     |
     Player 1 plays position 1

Result:
╔══╦══╦══╦══╦══╦══╦══╦══╗
║  ║10║ 3║ 9║10║ 0║ 9║  ║
║ 2╠══╬══╬══╬══╬══╬══╣ 5║
║  ║ 0║ 3║11║10║ 0║ 0║  ║
╚══╩══╩══╩══╩══╩══╩══╩══╝

Try it with the code: 0203020a0900000509000a09030a
```

If a player ends their turn on an empty position of their own and the opponents position opposite to the empty one has any stones in it the last stone played and the opponents stones in that opposing position are put into the players Manala.

```
Example:
╔══╦══╦══╦══╦══╦══╦══╦══╗
║  ║ 7║ 7║ 7║ 7║ 8║ 0║  ║
║ 1╠══╬══╬══╬══╬══╬══╣ 2║
║  ║ 1║ 0║ 8║ 8║ 8║ 8║  ║
╚══╩══╩══╩══╩══╩══╩══╩══╝
     ^
     |
     Player 1 plays position 1

Result:
╔══╦══╦══╦══╦══╦══╦══╦══╗
║  ║ 7║ 0║ 7║ 7║ 8║ 0║  ║
║ 1╠══╬══╬══╬══╬══╬══╣10║
║  ║ 0║ 0║ 8║ 8║ 8║ 8║  ║
╚══╩══╩══╩══╩══╩══╩══╩══╝

Try it with the code:<PHONE_NUMBER>080802000807070707
```

If a player ends their turn in their own Mancala they may play again.

If a player has no more possible moves all the stones on each side get counted up. The player with more stones wins.

repository: davidkowalk/Kalaha

repo_name: davidkowalk/Kalaha


text:
# Sample Blog Theme
Sample repo that allows to use external files in Podigee blog themes.

The top-level `files` directory is mandatory for a successful import of the theme files.

You'll find more detailed instructions here:

https://help.podigee.com/article/160-importing-themes-from-git-repos

---

## About us

**Podigee** is a podcast hosting software as a service. We help podcasters big and small getting their content out to their listeners as easy as possible. Find out more about us here: https://www.podigee.com/en/

repository: podigee/sample-blog-theme

gha_language: HTML

repo_name: podigee/sample-blog-theme


text:
Raspberry Stats
===============

Hello there!

Have you ever wondered how your Pi is doing?
What if you had a smart and super-awesome way to find out using nothing more than **NodeJS** and your web browser.
It makes use of hosting the User Interface with NodeJS and the streaming of data with Socket.io so that the stats you're seeing are realtime.

___

Screenshots :
-------------

![alt text](http://i.imgur.com/TeyMIRJ.png "The UI front-end.")
![alt text](http://i.imgur.com/CNNpubV.png "Highcharts is used to make charts.")

___

Dependencies :
--------------

The code depends on the following : Socket.io and Connect (Node).
You can install them using NPM with the following commands :

	npm install connect socket.io

___

How to install :
----------------

You can install the program using the following method in a(n) (SSH) terminal :

	#install all of the programs needed to run this.
	sudo apt-get install nodejs npm git

	#Clone this repository.
	git clone https://github.com/96AA48/raspberry-stats.git

	#Go inside the folder
	cd raspberry-stats

	#Install the needed NodeJS modules.
	npm install socket.io connect

	#Run the program
	sudo nodejs app.js

Make sure that when you're done that you edit some of the variables in app.js and client.js, these are just tiny things like server port and server location.

___

Disclaimer
----------

Hey there! Thanks for reading/using/editing this code, I just wanted to say a couple of things :

The code was made with the use of nothing more than the knowledge that I have of Javascript and NodeJS.
This means that I can't guarantee that the code is efficiŽnt, accurate and/or creates reliable information.

If there is any trouble setting this up, make an issue on this Github/Gitblit page and I'll help you as soon as I can.

You can also email me at : **96aa48 [at] gmail.com**

Thanks !

license: Unlicense

repository: linkris/raspberry-stats

repo_name: linkris/raspberry-stats

src_encoding: MacCentralEurope


text:
Ember (refactor)
======

Executing the command `./fiddle.sh "refactor" "ember" "0000" "fiddle-0100-Refactor"` from the scripts directory produces the following output.

    {{ ʕ・ɭ・ʔ }}

    FIDDLE-REFACTOR.SH
    Refactor process completed successfully.
    "fiddle-0008-ForkTemplate" is now "fiddle-0008-Refactor".

repository: bradyhouse/house

gha_language: JavaScript

repo_name: bradyhouse/house


text:
# Changelog

Documentation of all notable changes to the **evmone** project.

The format is based on [Keep a Changelog],
and this project adheres to [Semantic Versioning].

## [0.2.0] - unreleased
### Added
- **evm-test** - the testing tool for EVMC-compatible Ethereum Virtual Machine implementations
  [#85](https://github.com/ethereum/evmone/pull/85).

## [0.1.0] - 2019-06-19
### Added
- First release of the evmone project.
- Support for all current EVM revisions up to Petersburg.
- The [intx 0.2.0](https://github.com/chfast/intx/releases/tag/v0.2.0) library is used for 256-bit precision arithmetic.

[0.2.0]: https://github.com/ethereum/evmone/compare/v0.1.0..master
[0.1.0]: https://github.com/ethereum/evmone/releases/tag/v0.1.0

[Keep a Changelog]: https://keepachangelog.com/en/1.0.0/
[Semantic Versioning]: https://semver.org

repository: christianparpart/evmone

repo_name: christianparpart/evmone


text:
---
template: PracticePage
title: Brain Injury Lawyers
status: Published
date: 2020-09-03
featuredImage: /images/brain-injury-lawyer.jpg
excerpt: Brain injuries can be devastating for the person injured and their
  caregivers, yet these types of injuries are harder to prove and are often not
  adequately diagnosed.
categories:
  - category: Serious Personal Injury
meta:
  title: Brain Injury Lawyers
  description: Brain injuries can be devastating for the person injured and their
    caregivers, yet these types of injuries are harder to prove and are often
    not adequately diagnosed.
---

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

<!--StartFragment-->

Brain injuries can be devastating for the person injured and their caregivers, yet these types of injuries are harder to prove and are often not adequately diagnosed. That’s why you need to hire experienced brain injury lawyers right away.

<!--EndFragment-->

![](/images/study-shows-brain-injuries-may-increase-suicide-risk.jpg)

<!--StartFragment-->

I once handled a crash where my client threw up at the scene of the collision and then started having headaches soon thereafter. She ultimately ended up needing major surgery only to have her employer (who was also her insurance company) claim that the problem was there before the crash.

Another client’s doctors have diagnosed her with chronic, permanent headaches due to her collision and she’ll need treatment for the rest of her life. [These types of injuries can be very serious](/practice-areas/serious-personal-injury/).

If you’ve been [injured in a car wreck](/practice-areas/car-accidents/), it’s possible that you have suffered a [traumatic brain injury](/practice-areas/traumatic-brain-injuries-tbi/) or TBI. Traumatic brain injuries can range from mild to severe and are caused by an injury to the head from blunt trauma or acceleration or deceleration forces – forces common in an automobile collision – in fact, your head doesn’t even have to strike something in the car to suffer from one – you can have this type of injury just from the brain being pushed against the skull (think of a shaken baby).

The most common injury is the **mild traumatic brain injury** (“MTBI”), commonly known as a [concussion](/practice-areas/concussion-injury/). A concussion can result from even a relatively minor car wreck and symptoms can include loss of consciousness and blank spots or blacking out in your memory.

 It is called “mild” only because it’s not life-threatening, and because doctors used to think that it involves metabolic rather than physical damage. But “mild” brain injury affects every hour of a person’s (and her family’s) life. The problems grow worse over time. Mental senility sets in years sooner. And brain damage, mild or otherwise, renders the brain eggshell-vulnerable to future trauma, including low-level impacts that otherwise would have caused no harm.

Diagnosing concussions can be particularly difficult because symptoms are similar to other medical problems and are often overlooked. Signs and symptoms of an injury to your brain may include: attention difficulties, concentration problems, memory problems, headaches, dizziness, insomnia, fatigue, nausea, blurred vision, irritability, depression, anxiety, loss of initiative, and/ or problems related to your employment.

A mild concussion can be very serious. According to a recent paper from the Centers for Disease Control and Prevention, an MTBI can lead to significant, life-long impairment in your ability to function physically, cognitively, and/or psychologically. Some long term problems include persistent headaches, confusion, pain, memory problems, fatigue, changes in sleep patterns, mood changes, and/or vision or hearing changes. Proper diagnosis, referral, and patient/family education are critical for helping a concussion victim achieve optimal recovery and to avoid or reduce these life-long problems.

## Experienced Brain Injury Lawyers

Contact the brain injury lawyers at The Traub Law Office, P.C. in Austin Today. If you think you may have suffered a MTBI as a result of a car wreck, contact your doctor immediately. And, if your injury is the result of the negligence of a third party, contact us to discuss your legal rights. Call us at<PHONE_NUMBER> or complete the form below today.

<!--EndFragment-->

repository: emmadigital/austinlaw

repo_name: emmadigital/austinlaw


text:
# gaussian-cnn-anomaly-detection

This code is heavily borrowed from `PaDiM-Anomaly-Detection-Localization-master`(https://github.com/xiahaifeng1995/PaDiM-Anomaly-Detection-Localization-master).

## Setup

### Requirements

- Poetry

### Setup venv
```
poetry config virtualenvs.in-project true
poetry run pip install --upgrade pip
poetry install
```
`.venv` directory is created in this project directory and installed Python and packages.

## Run model
Please run below.
```
poetry run python main.py
```

branch_name: refs/heads/develop


text:
# FirebaseStream

FirebaseStream is a sample that shows basic usage of the `FirebaseArduino`
streaming API.

It displays the current bitcoin price on a OLED screen as it gets updated on
https://publicdata-cryptocurrency.firebaseio.com.

## Hardware setup

1. Get a [Feather Huzzah](https://www.adafruit.com/product/2821)
1. Get a [FeatherWing OLED](https://www.adafruit.com/products/2900)
1. Solder female headers on the `Feather Huzzah`
1. Solder mail headers on the `FeatherWing OLED`
1. Stack the `FeatherWing OLED` on top of the `Feather Huzzah`

## Software setup

1. Install [Arduino 1.6.9](https://www.arduino.cc/en/Main/Software)
1. Install [Arduino ESP8266 core](https://github.com/esp8266/Arduino#installing-with-boards-manager)
1. Download [FirebaseArduino library](https://github.com/googlesamples/firebase-arduino/archive/master.zip)
1. Start Arduino
1. Click `Sketch > Include Library > Add .ZIP Library...`
1. Choose `firebase-arduino-master.zip` downloaded in step `3.`
1. Install the following libraries using `Sketch > Include Library > Manage Libraries...`:
  - [Adafruit_GFX](https://github.com/adafruit/Adafruit-GFX-Library)
  - [Adafruit_SSD1306](https://github.com/adafruit/Adafruit_SSD1306)

## Configuration

1. Start Arduino
1. Open `File > Examples > FirebaseArduino > FirebaseRoom_ESP8266`
1. In `FirebaseRoom_ESP8266`: Replace `WIFI_SSID` and `WIFI_PASSWORD` with WiFi credentials
1. Go to https://firebase.google.com/console/ and create a new Firebase Project
1. Go to `Database`
1. Copy the `Database hostname` (Database URL without `https://` and trailing `/`)
1. In `FirebaseRoom_ESP8266`: replace `FIREBASE_HOST` with the `Database Hostname`
1. Go to  `⚙ > Project Settings > Database > Database secrets`
1. Click `Firebase Secrets > Show`
1. Copy the `Database Secret`
1. In `FirebaseRoom_ESP8266`:  Replace `FIREBASE_AUTH` with `Database Secret`
1. Select the board `Board > ESP8266 Modules > NodeMCU 1.0`
1. Select the serial port  `Port > /dev/tty...`
1. Select the upload speed `Upload Speed > 115200`
1. Click `Sketch > Upload`

## Play

1. Watch the screen be updated with the current bitcoin price.
1. Watch the data being modified as the sketch run

repository: kotl/firebase-arduino

repo_name: kotl/firebase-arduino


text:
Test latency of Celery RPC (Redis)
==================================

Testing latency for simple Celery RPC, using Redis for the backend:

    $ python consumer_serial.py 20
    Time per call: 1281.98ms

    $ python consumer_parallel.py 20
    Time per call: 4.92ms

Notes
-----

* This is very slow
* The consumer spends pretty much all its time waiting on
  rpc responses (unsurprisingly)

repository: adamcharnock/lightbus

gha_language: Python

repo_name: adamcharnock/lightbus


text:
PredictionBuilder
=================

[![Swift](https://img.shields.io/badge/Swift-5.1-orange.svg?style=flat)](https://swift.org)
[![Platform](https://img.shields.io/badge/platform-iOS%20%7C%20macOS%20%7C%20watchOS%20%7C%20tvOS%20%7C%20Linux-lightgrey.svg)](https://developer.apple.com/swift/)

PredictionBuilder is a library for machine learning that builds predictions using a linear regression.

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

#### CocoaPods

To install PredictionBuilder using [CocoaPods](https://cocoapods.org), add this line to your `Podfile`:

```ruby
pod 'PredictionBuilder', '~> 1.2.0'
```

#### Carthage

To install PredictionBuilder using [Carthage](https://github.com/Carthage/Carthage), add this line to your `Cartfile`:

```
github "denissimon/prediction-builder-swift"
```

#### Swift Package Manager

To install PredictionBuilder using [Swift Package Manager](https://swift.org/package-manager), add the following to your `Package.swift`:

```swift
dependencies: [
    .Package(url: "https://github.com/denissimon/prediction-builder-swift.git", majorVersion: 1)
]
```

#### Manually

Copy `PredictionBuilder.swift` into your project.

Example
-------

```swift
import PredictionBuilder

let data: [[Double]] = [[1,20],[2,70],[2,45],[3,81],[5,73],[6,80],[7,110]]
let x: Double = 4.5

let prediction = PredictionBuilder()

prediction.set(x: x, data: data)

// What is the expected y value for a given x value?
do {
    let result = try prediction.build() // y = 76.65
} catch let msg {
    print(msg)
}
```

The returned instance has the following properties:

`result.lnModel` linear model that fits the data: "29.56362+10.46364x"

`result.cor` correlation coefficient: 0.8348

`result.x` given x value: 4.5

`result.y` predicted y value: 76.65

License
-------

Licensed under the [MIT License](https://github.com/denissimon/prediction-builder-swift/blob/master/LICENSE)

repository: denissimon/prediction-builder-swift

repo_name: denissimon/prediction-builder-swift


text:
---
layout: post
title: "Predicting college basketball winners with machine learning"
subtitle:
author: "Ryan Berger"
date: "2019-02-11"
output:
  html_document:
    theme: spacelab
    highlight: tango
    keep_md: true
preserve_yaml: true
---

After doing some machine learning projects using public datasets in the past I decided I needed a new challenge on a project I would build from scratch: making a predictive model for college basketball games. The end goal that I wanted to accomplish with this project was to use machine learning algorithms and advanced analytics metrics to determine:

1. Which team will win every basketball game between NCAA division I teams
2. Projected final scores for each team
3. A reporting system where the daily predictions would automatically be displayed in an interactive Tableau visualization

## Machine learning model

After trying out a few different algorithms (linear regression, k-nearest neighbors, neural network), the best performance was achieved by treating each game as a binary classification using logistic regression (will the home team win the game: Yes or No?). The model was trained using game results from every game from the last 5 years (26,000+ games) using adjusted offensive and defensive efficiency ratings from [Bart Torvik](http://www.barttorvik.com/#) from the day the game was played as predictors and correctly picked the winning team 72% of the time in an independent test set of over 5,000 games.

For the current season the model is performing as expected; as of February 11 the winning team is being predicted with an accuracy rate of 72.3% rate in over 3,700 games.

## Tableau visualization

Generating a system to display the predictions for today's games required:
- Writing a script for scraping the team ratings data for the current day from barttorvik.com using `rvest`
- Making predictions in R using the logistic regression model
- Saving the results as a `.csv` output file and pushing to Google Sheets from R
- Linking the Google Sheet to a Tableau Public visualization
- Setting the Tableau viz to automatically refresh data every day

It sounds complicated but once assembled it requires one push of a button every day to update everything and push to Tableau. Here is the output with predictions for todays games:

<iframe src="https://public.tableau.com/views/college_basketball_predictions/Dashboard1?:embed=y&:display_count=yes&:showVizHome=no&:embed=true" width="90%" height="1000"></iframe>

## Notes

The challenges of this project were primarily in data wrangling and cleaning. Oh and web scraping, lots and lots of web scraping.

Past game results and future schedules were scraped from [college baskeball reference](https://www.sports-reference.com/cbb/) using the `rvest` package in R by looping over every date of every season from 2014-2018 (26,000+ games). Similarly, to provide analytics metrics for each team from [BartTorvik.com](http://www.barttorvik.com/#) on the day the game was played required scraping and cleaning analytics data for 353 teams on every date from 2014-2018 (250,000+ team ratings were scraped!).

To see the source code for this project, check out my [Github repository](https://github.com/rberger997/college_basketball_predictions).


text:
# sketch-align 0.4.0
Group and align your symbols and artboards by name

## Installation
Drop the .sketchplugin folder into your **Sketch plugins folder** (Plugins > Reveal Plugins Folder to find it).

## Align Artboards
Visually groups all layers(artboards) on a selected page based on the layer's name prefix.
Note: The plugin won't reorder the layers in the layer list to keep the process as fast as possible.

In the example below: the artboards with the same prefix (*'Note-'*, *'Notebook-'*) are aligned horizontally and a 200px padding is added under each row.

## Align Symbols
Visually groups all your symbols on the recently introduced 'Symbols' page based on the symbol's name and Sketch's default symbol foldering method. (You can organize your symbols to folders by including a slash “/” in their name.)
Based on the first folder name, the plugin visually organizes all your symbols to columns and adds an extra 200px right padding after each column.

repository: richardgazdik/sketch-align

repo_name: richardgazdik/sketch-align


text:
# burger

David K. Brown's Eat-Da-Burger App

## Table of Contents

- [Description](#description)

- [Screenshots](#screenshots)

- [Acceptance-Criteria](#Acceptance-Criteria)

- [Installation](#installation)

- [Credits](#credits)

- [Contributing](#contributing)

- [Copyright](#copyright)

## Description

The purpose of this project was to create an application that logs burgers using MySQL, Node, Express, Handlebars and a homemade ORM. The application follows the MVC design pattern and Handlebars to generate the HTML. From a user perspective they are able to submit new burgers and click a button to "devour" burgers which are tracked/saved in the database.

## Screenshots

![BurgerApp](./public/assets/images/BurgerApp.png)

## Acceptance-Criteria

```md
Application should allow users to input the names of burgers they'd like to eat.

Whenever a user submits a burger's name the app will display it waiting to be devoured.

Each burger has a Devour It button that when clicked moves it to the devoured section.

All of the burgers are stored in the database.
```

## Installation

To access this project you will need to visit my GitHub page and the "Burger" repository. After the repository is cloned/forked you can make edits to the project in your repository. Any questions should be directed to [David Brown](mailto:gatech55@gmail.com). The project can be found here: [Buger](https://github.com/GaTech55/burger). The Heroku site can be found here: [Heroku_Burger](https://polar-inlet-14628.herokuapp.com/).

## Credits

© 2019 Trilogy Education Services, a 2U, Inc. brand. All Rights Reserved.
[GitLab-13-Homework](https://gt.bootcampcontent.com/GT-Coding-Boot-Camp/gt-inc-fsf-pt-08-2020-u-c/tree/master/13-MVC/02-Homework/Instructions)

## Contributing

| **Commits** | **Contributor** |

| 16| [GaTech55](https://github.com/GaTech55)|

## Copyright

Copyright (c) 2020 David Brown.


text:
# [JavaScript Fundamentals][published url]

So you want to learn JavaScript? In this course we'll start at the very beginning and learn everything about the language that a beginner needs to know. Maybe you've never programmed anything before, or maybe you're coming to JavaScript from another language. Whatever your situation, we'll go through everything you need to get up and running with one of the most popular and dynamic languages in use today.

## Source Files Description
The source repository for this course contains all the sample and demonstration code created throughout the course. The `js` folder contains JavaScript sources for each of the topics covered. To run or experiment with one of these `.js` files, simply update the `script` element in `examples.html`.

These are source files for the Tuts+ course: [JavaScript Fundamentals][published url]

Available on [Tuts+](https://tutsplus.com). Teaching skills to millions worldwide.

[published url]: https://code.tutsplus.com/courses/javascript-fundamentals
[instructor url]: https://tutsplus.com/authors/dan-wellman

repository: SudiptoManna/javascriptlearning

repo_name: SudiptoManna/javascriptlearning


text:
# Source Control

Add all of your code into the [capcodigital](https://github.com/capcodigital) github organisation. Ensure that you have reviewed the [Git flow Branching](https://ilabs-capco.atlassian.net/wiki/spaces/BPG/pages/1355448321/Source+Code+Management) guidelines for Capco.

## Task

-   Create a new public repository within the [capcodigital](https://github.com/capcodigital) github organisation to store all of your java code. This can be stored in the master branch.
-   Create a .gitignore file. This should include the names of any paths which should be excluded from source control (git, gradle, build files). Remember to consider hidden files.
-   You can follow this tutorial to add the initial commit to git <https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/>
-   Use **git status** to ensure that only the desired files are going to be committed and pushed.
-   Note that you may have to run the following command:

>     git push -uf origin master

to force the initial commit

![](attachments/418971746/429096961.png?height=250)

repository: ablx-capco/team-course

repo_name: ablx-capco/team-course


text:
---
layout: post
title: Welcome to RO's OR Blog!
katex: True
---

Hello! Welcome to $$RO\displaystyle \int OR$$, a blog I created to share my passion for operations research with the ever-growing number of STEM enthusaists.

Why do my self-proclaimed expert opinions and posts warrant reading? Great question, they don't! There are several prolific Operations Research bloggers out there that this blog is very much inspired by. Some of my favorites include [Prof. Laura Albert's](https://punkrockor.com/), [Prof. Mike Trick's](https://mat.tepper.cmu.edu/blog/) and [Yet Another Math Programming Consultant's](http://yetanothermathprogrammingconsultant.blogspot.com/).

My super-secret mastermind plan is to use this blog as a means to brainwashing you into believing that operations research deserves just as much credit, if not more, than any of our favorite buzzwords (I'm looking at you *machine learning*). If I fail...well, at least I'd be convincing myself. I hope you all enjoy reading my future works and plethora of dorky jokes!


text:
# Twitter Tweets Part of Speech Tagger
Twitter POS tagger using hidden markov model with viterbi algorithm

## Result
```
==> Predictiing on Training Data
[111643/111643] right: 1002283 wrong: 77243
==> TAG Accuracy
{ right: 1002283, wrong: 77243 }
Total: 1079526
Accuracy: 92.84473000187118%

==> TWEET Accuracy
{ right: 62576, wrong: 49067 }
Total: 111643
Accuracy: 56.050088227654214%

==> Predictiing on Test Data
[47847/47847] right: 424563 wrong: 38839
==> TAG Accuracy
{ right: 424563, wrong: 38839 }
Total: 463402
Accuracy: 91.61872413153158%

==> TWEET Accuracy
{ right: 24990, wrong: 22857 }
Total: 47847
Accuracy: 52.22897987334629%
```

## Reference
Dataset : https://gate.ac.uk/wiki/twitter-postagger.html

repository: divyajyothii/tweet-postagger

repo_name: divyajyothii/tweet-postagger


text:
# ServiceFactory Smart Jacket Code
#### Arduino program using BLE to communicate with Smartphone App
## Libraries to include:
#### Libraries that need to be copied to "/USER/Documents/Arduino/libraries/"

- **<ArduinoJson.h>** - [https://github.com/bblanchon/ArduinoJson](https://github.com/bblanchon/ArduinoJson) v.5.13.1 (don't use newer version!!!)
- **<FastLED.h>** - IMPORTANT: As of May 2018, the FastLED v.3.1.6 doesn't work with the ESP32, therefore use [https://github.com/samguyer/FastLED](https://github.com/samguyer/FastLED) to compile. v.3.1.6
- **<OneButton.h>** - [https://github.com/mathertel/OneButton](https://github.com/mathertel/OneButton)
 v.1.2.0
- **<OneWire.h>** - [https://github.com/PaulStoffregen/OneWire](https://github.com/PaulStoffregen/OneWire)
 v.2.3.4

#### Libraries that are included within ESP32 Framework - have to exist in "USER/Documents/Arduino/hardware/espressif/esp32/libraries/BLE/" v.0.4.12

- **<BLE2902.h>**
- **<BLEDevice.h>**
- **<BLEServer.h>**
- **<BLEUUID.h>**
- **<BLEUtils.h>**

#### Local header files (contained within the code)

- **"DS2413helper.h"** - local helper file for Touch Inputs from OneWire Chip DS2413
- **"Ringbuffer.h"** - local helper file for comparing touch inputs ([https://github.com/ankraft/arduino-tools](https://github.com/ankraft/arduino-tools))
- **"TaskManager.h"** - local helper file for running independently timed tasks ([https://github.com/ankraft/arduino-tools](https://github.com/ankraft/arduino-tools))

# Hardware:
#### Main Controller = Sparkfun ESP32 Thing (Arduino-compatible µC with WiFi/BLE and Battery charging circuit)

- **Pin 19** - Button Input towards GND (Flag button)
- **Pin 22** - WS2811-compatible Neopixel-LEDs (#0-#4 = Intensity, #5-#9 = Progress)
- **Pin 27** - Toggle Power Switch towards GND (Connected to GND = ON, open = OFF)
- **Pin 33** - OneWire Pin connected to DS2413, pulled up 4k7Ω
- **Pin 34** - Battery sensing circuit - Rpup = 1MΩ, Rpdn = 300kΩ Voltage Divider, Rpin = 20kΩ as Input Protection (Pin35 - USB Voltage measure - to be ignored)

#### Touch circuit:

- Communication via One-Wire Protocol - Data Channel is pulled up with a 4k7Ω Resistor
- Protocol Controller Chip: MAXIM DS2413, 2 Port OneWire GPIO Extender
- Touch Chips: Atmel AT42QT1011, QTouch Technology Capacitive Sensing
- Eagle Files for Schematic and PCB are included in [doc/eagle](doc/eagle)

# Inputs:

- Flag Switch:
  - Short Press: Pause/Resume Training, Start Training after Loading from App
  - Long Press: Abort running Training, Restart Training if loaded by App
  - Double Click: Skip running Phase
- Power Switch: (if there is no state change, Power will be ON by default)
  - Closed = Power ON
  - Open   = Power OFF

#### Touch Inputs:
Touch Input can be done on two touch panels, sequentially leading to the following input gestures:

- Short Press Panel A - Vol Down
- Short Press Panel B - Vol Up
- Slide A->B - Volume Up
- Slide B->A - Volume Down
- Short Press A & B - Play/Pause
- Holding both Panels for >3 seconds - Emergency Call Trigger
- Input Sequences have to be completed between 200 ms and 1,2 sec

#### Config Parameters:

The following settings can be configured in [main.ino](main/main.ino):

- ```int DOTFADE = 64;```
   0-255 - fading time until running LEDs will turn off. (255 = no fade, 64 = med fade, 1 = very slow fade, 0 = all LEDS stay on)
- ```#define FRAMES_PER_SECOND 43```
   LED refresh FPS
- ```unsigned long BrightnessTimeout = 4000;```
  Delay after the LEDs will fade out
- ```int minimalBrightness = 50;```
  Brightness Percentage to set to after fading out
- ```int MinimumTouchTime = 200;```
  Minimum Touch Time to be sensed
- ```int MaximumTouchTime = 1000;```
  Maximum Touch Time to be sensed
- ```int ICETouchTime = 3000;```
  Delay after which the emergency call will be sent after holding both touch planes
- ```int debounceTouch = 2;```
  values to be removed from start and end of ringbuffer

And in [BLE.ino](main/BLE.ino):

- ```#define DEVICE_NAME "Smarte Jacke"```
  Bluetooth Broadcasting Name of the Device

#### Compiling / Building:
- install the Arduino IDE (e.g. for Windows [https://www.arduino.cc/download_handler.php?f=/arduino-1.8.5-windows.exe](https://www.arduino.cc/download_handler.php?f=/arduino-1.8.5-windows.exe))
- download all the libraries
- Start Arduino and open Preferences window.
- Enter *https://dl.espressif.com/dl/package_esp32_index.json* into *Additional Board Manager URLs* field. You can add multiple URLs, separating them with commas.
- Open Boards Manager from *Tools > Board* menu and install esp32 platform
  (and don't forget to select your ESP32 board from *Tools > Board* menu after installation).

Alternative, if the above method didn't work for you:

- install the ESP32 Core ([https://learn.sparkfun.com/tutorials/esp32-thing-hookup-guide/installing-the-esp32-arduino-core](https://learn.sparkfun.com/tutorials/esp32-thing-hookup-guide/installing-the-esp32-arduino-core))
- compile and upload using the Arduino IDE
- if necessary, install the FTDI Drivers: [https://learn.sparkfun.com/tutorials/how-to-install-ftdi-drivers/all](https://learn.sparkfun.com/tutorials/how-to-install-ftdi-drivers/all)


text:
# locationToGeohashes

Given a location (lat, lon) that represents an square area, it is converted to an array of geohashes that better represent that area.

## Usage

```javascript
const point = { lat: 50.846916, lon: 4.3489353 };
const resolution = 5;
const geohashes = locationToGeohashes(point, resolution);
// geohashes = ["u1517", "u1515", "u1514", "u1516"]
```

## Resolution parameter

Associated square side to a specific resolution. The square side is picked to minimize the number of geohashes necessary to represent the target area and to be small enough to represent it appropiately.

```
  1: 5000*1000,  // 5,009.4km x 4,992.6km
  2: 1252*1000,  // 1,252.3km x 624.1km
  3: 156*1000,   // 156.5km x 156km
  4: 40*1000,    // 39.1km x 19.5km
  5: 5*1000,     // 4.9km x 4.9km
  6: 1200,       // 1.2km x 609.4m
  7: 150,        // 152.9m x 152.4m
```

## How does this look like?

In this example you can see the outcome of requesting a resolution 5 around an arbitrary point in the center of Antwerp.
The target area for resolution 5 is a 4.9 x 4.9km square, which is best represented by geohashes: [ 'u155m', 'u155k' ].

![geohash-demo](/doc/geohash-demo.png)

## Search algorythm

Per item, check if any geohash of the item starts with any geohash of the user
Only user geohashes can englobe smaller geohash items, not the other way:

- If the user selects a small area (city), he doesnt care about national or global item geohashes
- But if he selects a big area (national), he wants to see all items within it, including the city ones

> NOTE: By returning true on first occurence, the search process if significantly speed up

```javascript
// 1. Prepare the items
const items = {
  item_01: [ 'u1514', 'u1515', 'u150g', 'u150f' ],
  item_02: [ 'u1516c', 'u15171', 'u15170', 'u1516b' ],
  ...
};

// 2. Generate the user position
const user = locationToGeohashes({ lat: 50.85, lon: 4.349 }, 5)
// user = [ 'u1514', 'u1515' ]

// 3. Check matches
const matchingItems = Object.keys(items).filter(itemKey => {
  for (userGeohash of user) {
    for (itemGeohash of items[itemKey]) {
      if (itemGeohash.startsWith(userGeohash)) return true;
    }
  }
});

// matchingItems = [ 'item_17', 'item_23', 'item_30', 'item_36', 'item_74', 'item_81' ]
```

repository: dapplion/locationToGeohashes

repo_name: dapplion/locationToGeohashes


text:
---
title: "A New Look"
date: 2020-08-23T11:45:00-04:00
draft: false
categories:
- Personal
tags:
- website
---

I was growing frustrated with my old website layout. It seemed like any time I went to write a post, I was breaking something in the theme. I'll admit that this was likely my own fault. To that end, I've switched from [Academic](https://themes.gohugo.io/academic/), which is a robust theme but more than I actually need, to [Hugo Future Imperfect Slim](https://themes.gohugo.io/hugo-future-imperfect-slim/).

Hopefully this will spur me to post more often. There's lots of news and thoughts I'd like to share. Since my last post, I've changed jobs, written new stories, lost several pets, and then there's the whole 2020 pandemic.


text:
# Work Day Planner

## Description
A work day planner that allows for dividing tasks up into the hour of the work day. The hours are color coded to reflect the time of day, red if the hour has already passed, blue for the current hour, and green for future hours. There is a save button that saves the input value which will be displayed even on page reload.

## Technologies
HTML
CSS
JS
The bootstrap framework was used for most of the styling, added mostly through JS.

repository: fatimaromagnoli/dayplannerhw

repo_name: fatimaromagnoli/dayplannerhw


text:
<!-- statamic:hide -->
# Statamic Live Search
![Statamic 3.0+](https://img.shields.io/badge/Statamic-3.0+-FF269E?style=for-the-badge&link=https://statamic.com)
[![Latest Version on Packagist](https://img.shields.io/packagist/v/jonassiewertsen/statamic-live-search.svg?style=for-the-badge)](https://packagist.org/packages/jonassiewertsen/statamic-live-search)
<!-- /statamic:hide -->

> A Statamic Live Search realised with [Laravel Livewire](https://laravel-livewire.com/).

It's fast to implement, hooks into the Statamic 3 core serach and does add the 'update as you type flavor'.

<img src="https://github.com/jonassiewertsen/statamic-live-search/blob/main/statamic-live-serach.gif?raw=true" alt="Statamic Live Search">

This Package extends my third-party [Statmic 3 Livewire integration](https://github.com/jonassiewertsen/statamic-livewire).

## No need for live search?

Check out my [Statmic 3 Livewire integration](https://github.com/jonassiewertsen/statamic-livewire).

## Installation
Pull in the package with composer
```bash
composer require jonassiewertsen/statamic-live-search
```

## Requirements
- PHP 7.4 or 8.0
- Laravel 7 or 8
- Statamic 3

## Set up Livewire
The `create your first search` does provide a quick start example to get you started.

As the `statamic-live-search` is extending the `statamic-livewire` addon, the setup is excactly the same and a deeper understanding might be useful. See the link below for more information.

[Statmic 3 Livewire integration Docs](https://github.com/jonassiewertsen/statamic-livewire#general-documentation)

## Create your first search

Add the `livewire:search` component to one of your templates and define your template.

```html
<!--
### If using Antlers ###
-->
<html>
<head>
    ...
    {{ livewire:styles }}
</head>
<body>
    {{ livewire:search }}

    <!-- Some crazy stuff going -->

    ...
    {{ livewire:scripts }}
</body>
</html>

<!--
### If using Blade ###
-->
<html>
<head>
    ...
    @livewireStyles
</head>
<body>
    <livewire:search />

    <!-- Some crazy stuff going -->

    ...
    @livewireScripts
</body>
</html>

```

## Setup the template

### Use the default dropdown layout

To get you started as fast as possible, we do provide a default template. You can publish it and edit it after your needs.

```bash
php artisan vendor:publish --tag=live-search:views
```

After publishing, you will find the template inside `resources/views/vendor/live-search/dropdown.blade.php`. It can be edited as you like.

### Use your own template

Create your own template and put it somewhere you like. Define the template in the tag and you are ready to go.

If you need augmented values, which is the case for images, it's the easiest way to use Antlers, so you don't need to worry about it.

```html
<!-- If using Antlers -->
{{ livewire:search template='partials.your-own-search-template' }}

<!-- If using Blade -->
<livewire:search :template='partials.your-own-search-template' />
```

If the template name is `partials.search`, the template is expected at `resources\views\partials\search.blade.php` or `resources\views\partials\search.antlers.php`.

This might be a solid starting point for your own template:

#### Blade

```html
<div>
    <input wire:model="q" type="search">

    <ul>
        @forelse($results as $result)
            <li>{{ $result['title'] }}</li>
        @empty
            No matches found
        @endforelse
    </ul>
</div>
```

#### Antlers
```html
<div>
    <input wire:model="q" type="search">

    <ul>
        {{ results }}
            <li>{{ title }}</li>
        {{ /results }}
    </ul>
</div>
```

## Configure your index

That's the great thing. This addon does hook into Statamic core search. Just configure your indexes in the `config/statamic/search.php` file.

If you don't provide any index, we will search in all existing. That's great for smaller sites.

A more specific search could look something similar:

```php
'blog' => [
     'driver' => 'local',
     'searchables' => 'collection:blog',
     'fields' => ['title'],
 ],
```

Remember to define the index in your component:

```html
<!-- If using Antlers -->
{{ livewire:search template='partials.search' index='blog' }}

<!-- If using Blade -->
<livewire:search :template='partials.search' :index='blog' />
```

To update your indexes, run `php please search:update` [More information](https://statamic.dev/search#updating-indexes)

[See the Statamic docs for more information](https://statamic.dev/search#searchables)

## Customize the search logic

The provied parts have been build modular, so you can easily extend those parts.

### Extend the Search Class

#### 1. Create your own Livewire Controller
`php artisan make:livewire YourCustomLivewireController`

#### 2. Extend the Search class
```php
namespace App\Your\Namespace;

use Jonassiewertsen\LiveSearch\Http\Livewire\Search;

class YourCustomLivewireController extends Search
{
    public $template;
    public $index;

    public function mount(string $template, string $index = null)
    {
        // You can pass those, but they can be hardcoded as well.
        $this->template = $template;
        $this->index = $index;
    }

    public function render()
    {
        // Do something crazy or funny.

        return view($this->template, [
            'results' => $this->search($this->q, $this->index),
        ]);
    }
}
```

#### 2. Use the SerachFacade Controller

It might be that you want to customize the name of the query string or that you want to use multiple filters.

You can import the SearchFacade trait and write a complete Livewire Controller as you need it.

`use Jonassiewertsen\LiveSearch\Traits\SearchFacade;`

The provided method does expect the following parameters:
`search($query, ?string $index = null, ?int $limit = 10)`

Have fun customizing.

## Credits

Thanks to:
- [Caleb](https://github.com/calebporzio) and the community for building [Livewire](https://laravel-livewire.com/)
- [Austenc](https://github.com/austenc) for the Statamic marketplace preview image

## Support
I love to share with the community. Nevertheless, it does take a lot of work, time and effort.

[Sponsor me on GitHub](https://github.com/sponsors/jonassiewertsen/) to support my work and the support for this addon.

## License
This plugin is published under the MIT license. Feel free to use it and remember to spread love.


text:
[![GitHub license](https://img.shields.io/github/license/Mo45/Rust-Server-Website-Template.svg)](https://github.com/Mo45/Rust-Server-Website-Template/blob/master/LICENSE)  [![GitHub issues](https://img.shields.io/github/issues/Mo45/Rust-Server-Website-Template.svg)](https://github.com/Mo45/Rust-Server-Website-Template/issues)   [![GitHub stars](https://img.shields.io/github/stars/Mo45/Rust-Server-Website-Template)](https://github.com/Mo45/Rust-Server-Website-Template/stargazers)   [![GitHub release (latest by date)](https://img.shields.io/github/v/release/Mo45/Rust-Server-Website-Template)](https://github.com/Mo45/Rust-Server-Website-Template/releases)   [![Twitter Follow](https://img.shields.io/twitter/follow/Mo_45)](https://twitter.com/Mo_45)

# Rust-Server-Website-Template
Website Template for Rust server

**Rust-Server-Website-Template** is a responsive, dynamically updated PHP/CSS template for Rust server website. It is build with Bootstrap 4 and **Rust-Servers.Info** or **Rust-Servers.Net** API.

![Rust-Server-Website-Template](https://i.imgur.com/VdDFKYg.png "Rust-Server-Website-Template Screenshot #1") ![Rust-Server-Website-Template](https://i.imgur.com/vyOqJyc.png "Rust-Server-Website-Template Screenshot #2")

![Rust-Server-Website-Template](https://i.imgur.com/mLVqOFf.png "Discord Feedback Message")

## Demo :tv:

See a demo at https://rust.krasin.space/

[![DigitalOcean Referral Badge](https://web-platforms.sfo2.cdn.digitaloceanspaces.com/WWW/Badge%201.svg)](https://www.digitalocean.com/?refcode=15b90cac0063&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge)

## WordPress Theme For Your Rust Servers :metal:

![Rust-Server-Website-Template](https://i.imgur.com/Zp8mtVq.png "RSWT WordPress Theme Screenshot #1")

**RSWT WordPress Theme** [demo](http://rust.krasin.space/wordpress/). Wordpress Theme for your Rust Server Website. Include News, Discord, Steam, Social, Store, Staff, Contact, FAQ and other modules.
Fully configurable via WordPress [Dashboard Settings Page](https://i.imgur.com/JEcoLm1.png). Theme available for [Patrons](https://www.patreon.com/bePatron?u=8929240) only.

## Extended access for Patreon Patrons :metal:

If you become my Patron and donate $10 or more, you will have an extended access to Template features, private modules, and [additional template styles](https://rust.krasin.space/?v=2) right after release.

You can help me by giving back to support developement. Become my patron on [Patreon](https://www.patreon.com/bePatron?u=8929240).

## Sponsors :dollar:

Many thanks for supporting the project to: **Wesley Seeley** ([The Rust City](http://therustcity.com)), **Roger Karlsen** ([theNords.no](https://theNords.no)).

## Features :thumbsup:

* **Responsive Design**
  * Valid HTML
  * PageSpeed Score Mobile:83% / PC:97% (Since i've add Discord avatar images overall score fall down little bit :sob: )
  * YSlow Score 91%
  * Fully Loaded Time 4.5s
* **Servers Module** (Rust-Servers.Info API)
  * Server Header Image (Dynamic)
  * Number of players Curr/Max with progress bar (Dynamic)
  * Online/Offline Indicator (Dynamic)
  * Connect and Vote buttons
* **Servers Module V2** (Rust-Servers.Net API)
  * Number of players Curr/Max with progress bar (Dynamic)
  * Online/Offline Indicator (Dynamic)
  * Connect and Vote buttons
* **Discord Server Module** (Discord Data)
  * Server Name (Dynamic)
  * Online Users (Dynamic)
  * Online Users Images (UP to 18 users)
* **Steam Group Module** (Steam Community Data)
  * Total Users (Dynamic)
  * Online Users (Dynamic)
  * In-Game Users (Dynamic)
* **Steam Authentication Module** (By [Ben Smith](https://github.com/SmItH197))
* **Feedback Module**
  * Send message directly to your Discord Channel
* **Full page caching** (Thx to [Jonatan](https://github.com/Jontis00))

## Download :arrow_down:

Please note the main repository is constantly being updated so may contain bugs and other bleeding edge risks. For a stable download please visit the releases page: https://github.com/Mo45/Rust-Server-Website-Template/releases

## Installation :construction_worker:

Upload files to your server.

Open up `config.php`
- change `SITE_URL` to your website url.
- change `SRV_NAME` to your server name.
- change `SRV_SLOGAN` to your server short slogan.
- change `SRV_TWITTER` to your server Twitter username.
- change `CACHE_LIFETIME` cache lifetime in seconds, default value - **300**, set to **0** to disable caching.
- change `STEAM_GID` to your Steam Group ID64 (https://support.multiplay.co.uk/support/solutions/articles/1000202859).
- change `DISCORD_SERVER_ID` to your Discord Server ID (Discord App -> Your Server -> Server Settings -> Widget -> Server ID)
- change `DISCORD_INVITE_LINK` to your Discord Server Invite Link (Discord App -> Your Server -> Server Settings -> Invites -> Create One (Set this link to never expire))
- change `STORE_URL` to your server store url.
- change `SERVER_1_KEY` to your server API Key from https://Rust-Servers.net.
- change `SERVER_1_DESC` to your server short description.

Open up `steamauth/SteamConfig.php`
- change `domainname` to your domain name.
- change `apikey` to your API-Key from http://steamcommunity.com/dev/apikey.

Open up `modules/feedback.php`
- change `$webhookurl` to your Discord Channel webhook. You can also change BOT name and avatar here.
- change `<@REPLACE_WITH_YOUR_DISCORD_USER_ID>` with your UserID like this: `<@75216985209700352>`, you can find it here - https://krasin.space/discord/

## Rust-Servers.INFO or Rust-Servers.NET API? :question:

You can choose your prefered monitoring service, **rust-servers.info** or **rust-servers.net** API. By default (from v**2.0**) this template using [Rust-Servers.Net API](https://rust-servers.net), in order to use it you need to provide API key for each of your servers.

If you want to use **rust-servers.info** API, you need to set `MODULE_SERVERS_V2` to `OFF` and `MODULE_SERVERS` to `ON`.

## Personalize your website :wrench:

- edit `/template/rules.php`
- edit `/template/staff.php`

## Contact module (Email form) :mailbox_with_mail:

Contact module contain only basic HTML form, without any functionality to send email's. If you want to have fully-functional feedback form you need to edit `/modules/contact.php` and add some additional code. Take a look at this [PHP:mail](http://php.net/manual/en/function.mail.php) or use [PHPMailer](https://github.com/PHPMailer/PHPMailer) class.

## How to add more than 2 servers :wrench:

Open `includes.php` and add this code after
```
//EXTRA SERVERS START
```
If you need more than 3 servers you need to change **3** to **4**,**5**,**6** etc.
```
	//GET JSON STATUS FOR SERVER #3
        $json_url = "https://api.rust-servers.info/info/".SRV_ID_3."";
        $json_string = file_get_contents($json_url);
        $parsed_json = json_decode($json_string,true);
		$s3_name        = $parsed_json['hostname'];
                $s3_status      = $parsed_json['online_state'];
                        if($s3_status == "1"){$s3_status = "Online";$s3_button = "class='btn btn-outline-success btn-lg'><i class='fa fa-play-circle' aria-hidden='true'></i> Connect</a>";}
			else{$s3_status = "Offline";$s3_button = "class='btn btn-outline-danger btn-lg disabled'><i class='fa fa-exclamation-circle' aria-hidden='true'></i> Offline</a> ";};
                $s3_cur         = $parsed_json['players_cur'];
                $s3_max         = $parsed_json['players_max'];
                $s3_img         = $parsed_json['image'];
		if ($s3_img == "") {$s3_img = "img/serverlogo.png";};//Empty path fix
		if (getimagesize($s3_img) == false) {$s3_img = "img/serverlogo.png";};
                $s3_ip          = $parsed_json['ip'];
                $s3_port        = $parsed_json['port'];
```
Next, open `config.php` and add this code after

```// Extra servers```

If you need more than 3 servers you need to change **3** to **4**,**5**,**6** etc.
```
//-----------------------------------------------------
// Server #3
//-----------------------------------------------------
	define( "SRV_ID_3","5" );
	# Your server #3 ID (Rust-Servers.Info)
	define( "SRV_3_DESC" , "This is short server description. Vanilla, Cool admins, etc." );
	# Your server #3 description
 ```
 Next, open `/modules/servers.php` and add this code after

```<!-- Server #2 END -->```

If you need more than 3 servers you need to change **3** to **4**,**5**,**6** etc.

```
<!-- Server #3 START-->
<div class="col-md-6 srv">
<div class="one-server">
<div class="<?php echo $s3_status; ?>">
<img src="<?php echo $s3_img; ?>" class="server-header img-fluid" alt="<?php echo $s3_name; ?>">
</div>
<h2><?php echo $s3_name; ?></h2>
<p><?php echo SRV_3_DESC; ?></p>
<span class="players">Players: <?php echo $s3_cur; ?>/<?php echo $s3_max; ?></span>
<div class="progress" style="height:3px;">
  <div class="progress-bar" role="progressbar" aria-valuenow="<?php echo $s3_cur; ?>" aria-valuemin="0" aria-valuemax="<?php echo $s3_max; ?>"></div>
</div>
<a href="steam://connect/<?php echo $s3_ip; ?>:<?php echo $s3_port; ?>" <?php echo $s3_button; ?>
<a target="_blank" href="https://rust-servers.info/login/?login&r=/vote/id-<?php echo SRV_ID_3; ?>.html" class="btn btn-outline-light btn-lg"><i class="fa fa-heart-o" aria-hidden="true"></i> Vote</a>
</div>
</div>
<!-- Server #3 END -->
```
## Copyright :copyright:

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

This is the reason why you're seeing these notices above. So legally, these notices shouldn't be removed from the works/files in which they're found.

If you really need to remove copyright from your project page, become my patron on [Patreon](https://www.patreon.com/bePatron?u=8929240) (**Supporter Level 2 Tier** or higher), and [contact me](https://t.me/Mo_45).

gha_language: PHP