text:
# aw

AW is utility for switching DNS-records to ensure the availability of a web server

This repository has been archived. It is now read-only.

## Usage

The IP address of the primary website server is stored on the DNS service. In this case, it is cloudflare.com.
The secondary or standby servers will only come into play when the primary server is unavailable.

Lets assume, that www.example.com now point to <IP_ADDRESS> address.
Standby server IPs are <IP_ADDRESS> and <IP_ADDRESS>.

![AW workflow scheme](https://codeation.github.io/images/aw_scheme.png)

In this case, the cloudflare DNS records will be:

```
Type    Name            Value                   TTL         Status
A       example.com     points to <IP_ADDRESS>     Automatic   DNS only
A       www             points to <IP_ADDRESS>     Automatic   DNS only
A       *               points to <IP_ADDRESS>     Automatic
...
```

The AW utility will monitor all servers.
If the primary server does not respond, DNS records will be switched to the standby server.

## Installation

The AW utility can be built using the following command:

```
go get -u github.com/codeation/aw
```

The -u flag instructs get to use the network to update the named packages and their dependencies.
By default, get uses the network to check out missing packages but does not use it to look for updates
to existing packages.

The AW executable file will be in $GOPATH/bin directory.

## aw.ini

Sample configuration file:

```
; Watch interval, seconds
ttl=120
url=https://www.example.com/index.html
; Timeout to get URL, seconds
timeout=10

; CloudFlare account and records
apikey=012****************a12
domain=example.com
<EMAIL_ADDRESS>names=@,*,www

; nodes alias and ip
[nyc01]
ip=<IP_ADDRESS>

[nyc02]
ip=<IP_ADDRESS>

[sea01]
ip=<IP_ADDRESS>
```

The aw.ini must be in the working directory.

## Daemon

This is example of /etc/systemd/system/aw.service file, replace file paths and yours user and group name.
No any sudo privelegies are needed.

```
[Unit]
Description=aw
After=network.target
Requires=network.target

[Service]
Type=simple
User=username
Group=groupname
WorkingDirectory=/home/support/aw
ExecStart=/home/support/aw/aw
LimitSTACK=1048576
OOMScoreAdjust=-100
Restart=always
TimeoutSec=60

[Install]
WantedBy=multi-user.target
```

To enable and start AW as service, please run:

```
sudo systemctl enable aw.service
sudo systemctl start aw.service
```

To stop and disable:

```
sudo systemctl stop aw.service
sudo systemctl disable aw.service
```

Logs will be collected into /var/log/syslog file, to view:

```
sudo cat /var/log/syslog | grep aw
```

or

```
cat /var/log/syslog | grep " aw\[" | tail -n 20 | cut -d ' ' -f 7-
```

## IPv6

You can specify an IPv6 address for all or some of your servers, if they are accessible via IPv6.
All servers are monitored using the IPv4 protocol.
Thus, the AW utility can be deployed on the server without a IPv6 protocol.

Sample aw.ini file with IPv6 addresses:

```
; Watch interval, seconds
ttl=120
url=https://www.example.com/index.html
; Timeout to get URL, seconds
timeout=10

; CloudFlare account and records
apikey=012****************a12
domain=example.com
<EMAIL_ADDRESS>names=@,*,www

; nodes alias and ip
[nyc01]
ip=<IP_ADDRESS>
ipv6=2001:db8:85a3::8a2e:370:7334

[nyc02]
ip=<IP_ADDRESS>
ipv6=2001:db8:85a3::1e7a:629:2665

[sea01]
ip=<IP_ADDRESS>
```

When the AW utility finds that it is necessary to change the IPv4 address of the domain,
the IPv6 domain address will also be changed synchronously.
If the elected server does not support the IPv6 protocol, the AAAA-records will be deleted.
Conversely, if there were no AAAA-records, and the elected server supports the IPv6 protocol,
AAAA-records will be made.

repository: codeation/aw

repo_name: codeation/aw


text:
# Marginalized Frailty-Based Illness-Death Model: Application to the UK-Biobank Survival Data

# Author Contributions Checklist Form

## Data

### Abstract

UK Biobank is a national and international health resource following the
health and well-being of 500,000 volunteer participants and provides
health information, which does not identify them, to approved
researchers in the UK and overseas, from academia and industry. It aims
to improve the prevention, diagnosis and treatment of a wide range of
serious and life-threatening illnesses – including cancer, heart
diseases, stroke and more.

### Availability

The data will not become publicly available. It is open only to
bona-fide scientists undertaking health-related research that is in the
public good. Access to the data is granted only upon application to the
UK Biobank organization.

### Description

Since the UK Biobank data cannot be publicly published, we provide a
pseudo-dataset, similar to the datasets generated for the simulation
studies. The code for the generation of such datasets is also provided
separately as an R code.

## Code

### Abstract

We uploaded several code files:

Codes for data generation: available for 3 kinds of frailty
distributions (Gamma – the main simulations, and Inverse Gaussian and
Positive Stable – for sensitivity analysis). During data generation,
users may determine their preferred parameters.

Codes for data analysis:

One cpp file is provided for loading the required functions into the
main estimation procedure, and another R code for the main estimation
procedure. The dataset is inserted into the estimating wrapper function,
with instructions of usage provided within the code itself and in the
Readme file.

### Description

The code is written in R. MIT license.

Github repository: https://github.com/nirkeret/frailty-LTRC

Required libraries:

-   "survival" (Requires R (>= 3.4.0))

-   "Rcpp"

-   "parallel" (if one wants to perform parallel computation)

-   "Brobdingnag" (Requires R (≥ 2.13.0)

-   "statmod" (for sampling from the inverse Gaussian distribution,
    requires R (≥ 3.0.0))

### Optional Information

A part of the code (the computation intensive part) can be parallelized
to several cores in order to save computation time.

## Instructions for Use

### Reproducibility

All tables in the Simulation Study section can be reproduced (main
results and sensitivity analysis).

In order to reproduce a table, datasets should be generated with the
corresponding parameters. Results were mostly collected under seeds
1-100. In order to reproduce a table, 100 datasets, using seeds 1-100
should be generated, and then inserted to the estimation function.

It may take 3-5 hours to analyze a single 5000 observation dataset if no
parallelization is used. Each bootstrap round will require about the
same amount of time. If a higher tolerance for convergence is chosen,
less time will be required (the default tolerance is 0.001 and the
procedure stops when
$\frac{|\text{new\ log} - \text{likelihood} - \text{last\ log} - likelihood\ |}{|last\ log - likelihood\ |\ } < Tol$,
or when 100 iterations have been performed.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
This forks aims to handle 2 jsfmtrc
- one for storage
- one for view

Here we are doing it for [atom](http://atom.io) and [jsfmt](https://github.com/rdio/jsfmt)

this package is a forked from [atom-jsfmt](https://atom.io/packages/atom-jsfmt)

### TODO Improved UI
- currently this is not the proper

### .jsfmtrc && .jsfmtviewrc
- the .jsfmtrc is read is weird place
  - it doesnt honnor the path for .jsfmtrc
- it should support the .jsfmtrc in a parent directory
- there is load config function in node_modules/jsfmt/lib/Config.js
- this jsfmt rely on rc() which seems buggy
- there is a need to handle those files properly
- i will likely need to get .jsfmtrc and jsfmtviewrc

### Story

I am tired of all the fights over coding style.
Everybody got its opinion of 'what is best', which is rarely
the same best unfortunatly. So the fight goes on and on.
It is a very unproductive way to spend time.

Suddently it stroke me "EUREKA!".
We dont have to fight, we can satisfy everybody :)
The principle is simple.

1. When the file is loaded by the editor, we format it to the developper taste.
Thus the developper will see the style he is the most confortable with
and thus can be more efficient.
2. when the editor save the file, we format it to the project specification.
Thus all the files are stored according to a uniform coding style, thus
the project is easier to maintain over the long run.

All we need is program which automatically format the code according to some
specification. [jsfmt](https://github.com/rdio/jsfmt) can do that for javascript files

repository: jeromeetienne/atom-jsfmt

repo_name: jeromeetienne/atom-jsfmt


text:
# Syllabus - Fall 2019
CS1632 Software Quality Assurance

_Although the instructor will make a best effort to have the class topic on the day listed, occasionally a change must be made (e.g., a lecture going long, or a guest lecturer unable to make it to class that day).  However, these are the topics that will be covered and the expected date that they will be taught._

AFIST = _A Friendly Introduction to Software Testing_ by Bill Laboon

## WEEK 1 (Week of 26 AUG)
* (Class 1) Introduction - What is Software Quality Assurance?

* (Class 2)  Basic Testing Theory and Terminology
  * READING: AFIST, Chapters 2 - 4

## WEEK 2 (Week of 2 SEP)

* (Class 1) NO CLASS - LABOR DAY

* (Class 2) Requirements
  * READING: AFIST, Chapters 5

## WEEK 3 (Week of 9 SEP)

* (Class 1) Test Plans, TM and Defects
  * READING: AFIST, Chapters 6, 8-9

* (Class 2) EX1: Test Plans

## WEEK 4 (Week of 16 SEP)

* (Class 1) Breaking Software, Smoke / Exploratory / Path-based Testing
  * READING: AFIST, Chapters 7, 10-11

* (Class 2) Automated and Manual Testing, Unit Testing Part 1
  * READING: AFIST, Chapter 12-13

## WEEK 5 (Week of 23 SEP)

* (Class 1) Unit Testing Part 2
  * READING: AFIST, Chapter 14

* (Class 2) EX2: Unit Testing

## WEEK 6 (Week of 30 SEP)

* (Class 1) Test-driven Development
  * READING: AFIST, Chapter 15

* (Class 2) Writing Testable Code
  * READING: AFIST, Chapter 16

## WEEK 7 (Week of 7 OCT)

* (Class 1) Midterm 1 review

* (Class 2) MIDTERM 1

## WEEK 8 (Week of 14 OCT)

* (Class 1) Automated System Testing

* (Class 2) EX3: Automated System Testing

## WEEK 9 (Week of 21 OCT)

* (Class 1) Performance Testing
  * READING: AFIST, Chapter 19

* (Class 2) Stochastic and Property-Based Testing
  * READING: AFIST, Chapter 18

## WEEK 10 (Week of 28 OCT)

* (Class 1) EX4: Performance Testing / Stochastic Testing

* (Class 2) Pairwise and Combinatorial Testing
  * READING: AFIST, Chapter 17

## WEEK 11 (Week of 4 NOV)

* (Class 1) Static Analysis, Part 1

* (Class 2) Static Analysis, Part 2

## WEEK 12 (Week of 11 NOV)

* (Class 1) EX5: Static Analysis

* (Class 2) NetApp guest lecture on Continuous Integration / DevOps / Agile Testing

## WEEK 13 (Week of 18 NOV)

* (Class 1) Security Testing
  * READING: AFIST, Chapter 20

* (Class 2) EX6: Penetration Testing

## WEEK 14 (Week of 25 NOV)

* (Class 1) NO CLASS - THANKSGIVING

* (Class 2) NO CLASS - THANKSGIVING

## WEEK 15 (Week of DEC 2)

* (Class 1) Midterm 2 review

* (Class 2) MIDTERM 2 (Confirmed)

## WEEK 16 (Week of DEC 9)

* Finals week

* NO FINAL; You will be working on your final deliverable.

gha_license_id: MIT


text:
---
title: "Integrations"
---

In this section we will look at different technologies and how we can integrate them into our GraphQL server.

# Entity Framework Core

The package `HotChocolate.Data.EntityFramework` helps you to manage the `DBContext` life cycle.

[Learn more about our Entity Framework Core integration](/docs/hotchocolate/integrations/entity-framework)

# MongoDB

With the package `HotChocoalte.Data.MongoDb` you can integrate your MongoDB with ease.
This package adds support for filtering, sorting, projection and pagination with native MongoDB queries.

[Learn more about our MongoDB integration](/docs/hotchocolate/integrations/mongodb)

# Spatial Data

This collection of packages help you to expose [NetTopologySuite types](https://github.com/NetTopologySuite/NetTopologySuite) in form of [GeoJSON](https://geojson.org/) and even integrate it with the data api.

[Learn more about our Spatial Data integration](/docs/hotchocolate/integrations/spatial-data)

repository: alkharashiam/hotchocolate

branch_name: refs/heads/main

repo_name: alkharashiam/hotchocolate


text:
# CC Tables

## The program

CC is a program from SIL International called _Consistent Changes_. It is a simple search and replace program which operates character by character and also can work with multi-byte characters, or also strings.

silcc on the commandline is available from SIL International's ppa. Instructions for adding the ppa to your system can be found at http://packages.sil.org/.

## Usage

I use this program to take the final corpus and then convert it for analysis with Typing. I convert the characters in the corpus to what they would be if the same keystrokes would have been made on a QWERTY keyboard.

example commandline usage:
`silcc -u -t mande-table.cct final-corpus.txt > final-corpus-as-qwerty.txt`

## Folder Contents

I keep the various files needed by CC in this folder along with the only tutorial I have found for CC. This tutorial was taken from SIL's website at https://software.sil.org/cc/ and can be found embedded in the `.zip` download for windows version 7.5.

repository: HughP/dnj-corpus

repo_name: HughP/dnj-corpus


text:
---
aliases:
- /releases/3.3/design/hadr/decisions/crash-shell.html
date: '2020-01-08T09:59:25Z'
menu: []
tags:
- crash
- shell
title: 'Design Decision: Node starting & stopping'
---

# Design Decision: Node starting & stopping

## Background / Context

The potential use of a crash shell is relevant to high availability capabilities of nodes.

## Options Analysis

### 1. Use crash shell

#### Advantages

* Already built into the node.
* Potentially add custom commands.

#### Disadvantages

* Won’t reliably work if the node is in an unstable state
* Not practical for running hundreds of nodes as our customers already trying to do.
* Doesn’t mesh with the user access controls of the organisation.
* Doesn’t interface to the existing monitoring and control systems i.e. Nagios, Geneos ITRS, Docker Swarm, etc.

### 2. Delegate to external tools

#### Advantages

* Doesn’t require change from our customers
* Will work even if node is completely stuck
* Allows scripted node restart schedules
* Doesn’t raise questions about access control lists and audit

#### Disadvantages

* More uncertainty about what customers do.
* Might be more requirements on us to interact nicely with lots of different products.
* Might mean we get blamed for faults in other people’s control software.
* Doesn’t coordinate with the node for graceful shutdown.
* Doesn’t address any crypto features that target protecting the AMQP headers.

## Recommendation and justification

Proceed with Option 2: Delegate to external tools

## Decision taken

Restarts should be handled by polite shutdown, followed by a hard clear. (RGB, JC, MH agreed)

* [Design Review Board Meeting Minutes](drb-meeting-20171116.md)
    * [Attendees](drb-meeting-20171116.md#attendees)
    * [Minutes](drb-meeting-20171116.md#minutes)
        * [Near-term-target, Medium-term target](drb-meeting-20171116.md#near-term-target-medium-term-target)
        * [Message storage](drb-meeting-20171116.md#id1)
        * [Broker separation](drb-meeting-20171116.md#id2)
        * [Load balancers and multi-IP](drb-meeting-20171116.md#id3)
        * [Crash shell](drb-meeting-20171116.md#id4)

repository: nikinagy/corda-docs

repo_name: nikinagy/corda-docs


text:
A simple command-line application.

Created from templates made available by Stagehand under a BSD-style
[license](https://github.com/dart-lang/stagehand/blob/master/LICENSE).

Setting up the DART environment in widowsmachine
----------------------------------------------------

1, Install the package manager from https://chocolatey.org/

2, install the DART SDK using the commands mentioned in the link  https://dart.dev/get-dart

3, Install Visual Studio Code from the link  https://code.visualstudio.com/download, for the IDE

Configuring the Visual Studio Code Editor for DART development
---------------------------------------------------------------

1, Install the DART plugin to VS code as per the link https://dartcode.org/

2, Install the stagehand plugin for the dart  refer https://pub.dev/packages/stagehand, this will help to boostrap your code for diferent type of applciaiton you choose (cosnole, web etc ) A Dart project generator

https://dartcode.org/releases/v2-23/


text:
# NYT Article

This project consists in do a clone of a New York Times article page, based on an article from Space Ripples Reveal Big Bang’s Smoking Gun.

![Screenshot](https://github.com/rebeccayilma/NYT_article/blob/development/assets/Screenshot.png?raw=true)

## Description of the Project

This page was build to demonstrate the use of CSS grid, flexbox , and float inorder to align the of the elements in different sections of the page.

## Live Link

Feel free to check the [Live Demo](https://rebeccayilma.github.io/NYT_article)

## Built With

HTML & CSS

## Authors

👤 Rebecca Yilma

- GitHub: [@rebeccayilma](https://github.com/rebeccayilma)
- LinkedIn: [Rebecca Yilma](https://www.linkedin.com/in/rebecca-yilma-46a94a121)
- Twitter: [@Rebeccayilma](https://twitter.com/Rebeccayilma)

👤 Alexis Varela

- GitHub: [@alexisbec](https://github.com/alexisbec)
- LinkedIn: www.linkedin.com/in/alexis-varela-2584111b7
- Twitter: https://twitter.com/AlexisV31667779

## 🤝 Contributing

Contributions, issues, and feature requests are welcome!

## Show your support

Give a ⭐ if you like this project!

## Acknowledgments

To Microverse, the stand-up team, and mentors.

## 📝 License

This project is [MIT](https://github.com/rebeccayilma/NYT_article/blob/development/MIT%20License.txt) licensed.


text:
# Aruba Central REST API Python Sample Scripts and Libraries
Sample python scripts to generate API access token and make HTTP Requests such as GET, PUT, POST, PATCH and DELETE.
Tested with Python 3.6.7

# Requirements

* See requirements.txt
* Install with: `pip3 install -r requirements.txt`

# Execution

`python3 central_site_bringup.py -i=input_info.json`
(Update credentials and central info in input_info.json file)

# Python Sample Scripts

1. [central_session.py](/rest-api-python-scripts/central_session.py)
	- create a new session token
	- refresh already created token.
	- Store the new token in pickle file and obtain it next time for a refresh token. Otherwise, new token will be generated every time.

2. [central_main.py](/rest-api-python-scripts/central_main.py)
	- Has "command" method to do POST, GET, PATCH and DELETE Rest APIs in central
	- This script uses central_session.py to get a new session token from central API gateway.

3. [central_configuration.py](/rest-api-python-scripts/central_configuration.py)
	- Has methods to create/update/delete group, sites, template files, template variables and move devices to a certain group.
	- This script uses central_main.py (command method) to execute tasks in central via APIs.

4. [central_site_bringup.py](/rest-api-python-scripts/central_site_bringup.py)
	- This script uses central_configuration to demonstrate bringing up a site in Aruba Central.


text:
---
templateKey: blog-post
title: Toast Messages
devto_link: 'https://dev.to/nickytonline/toast-messages-4hhd'
date: 2019-10-24T03:45:40.498Z
description: I made a little toast message demo tonight
tags:
  - codepen
  - html
---
So I made a little toast message demo tonight. It also works with the keyboard if you tab. It will focus on the close button of the toaster and it you hit ENTER, the toast is toast!

  See the Pen Toast Messages by Nick Taylor
  (@nickytonline) on CodePen.

I was just having a little fun, but it brought up a question for me. What type of HTML element should a toast message be?

https://twitter.com/nickytonline/status/1187206862992789505

I will have a follow up post sometime in the near future explaining all the moving parts. 😉


text:
---
layout: post
category: FE
title: use dotjs instead of GreaseMonkey
date: 2011-07-06 19:04:16
---

First, [GreaseMonkey][GM] is too hard to use.

[GM]: http://www.greasespot.net/ "GreaseMonkey"

dotjs is a Google Chrome extension that executes JavaScript files in ~/.js based on their filename.

If you navigate to http://www.google.com/, dotjs will execute ~/.js/google.com.js.

This makes it super easy to spruce up your favorite pages using JavaScript.

Bonus: files in ~/.js have jQuery 1.6.2 loaded, regardless of whether the site you're hacking uses jQuery.

Double bonus: `~/.js/default.js` is loaded on every request, meaning you can stick plugins or helper functions in it.

INSTALL/UNINSTALL:

{% highlight bash %}
git clone git://github.com/hujinpu/dotjs.git
cd dotjs
rake install
# rake uninstall

#output
dotjs
-----
I will install:

1. The 'dotjs' Google Chrome Extension
2. djsd(1) in /usr/local/bin
3. com.github.dotjs in ~/Library/LaunchAgents

Ok? (y/n) y
cp -p bin/djsd /usr/local/bin
mkdir /Users/hjp/.js
chmod 755 /Users/hjp/.js
chmod 644 /Users/hjp/Library/LaunchAgents/com.github.dotjs.plist
starting djdb...
launchctl load -w /Users/hjp/Library/LaunchAgents/com.github.dotjs.plist
Installing Google Chrome extension...
open -a 'Google Chrome' builds/dotjs.crx &
dotjs installation worked
drop files like google.com.js in ~/.js and enjoy hacking the web
{% endhighlight %}

edit qunar.com.js and visit <http://qunar.com> . Note: becareful too many alert.

{% highlight js %}
alert($.fn.jquery); // 1.6.2
{% endhighlight %}

At last, you can keep ~/.js under version control and share it with the world.

extension: markdown


text:
---
layout: post
title: What is covariance ?
---

Baking a chocolate cake for 6 people requires specific ingredients and quantities such as 3 large eggs, 6 oz of sugar, 6 oz of flour etc ... If we instead want to bake for 5 people, decreasing the quantity of some ingredients might require changes in the quantity of other ingredients. The direction of the relationship between the ingredients’ quantities is called covariance.

If two ingredients both increase (decrease) at the same time, their covariance is positive. For example, less flour is required when the number of eggs is reduced. However, if two ingredients vary in opposite direction, their covariance is negative. For instance, less sugar is needed when honey is added to the recipe. Lastly, if two ingredients don’t have any effect on each other (i.e.: if they are independent), their covariance is zero.

However, does a 0 covariance imply independence? Let’s say you’re baking a lemon and a chocolate cake. The required sugar quantities are specified in the recipes; hence the covariance between the required amount of sugar in each cake is zero. But, imagine that you don’t have enough sugar for both cakes. This means that the amount of sugar you can add to the lemon cake depends on the quantity you’ll use for the chocolate cake. Therefore, the sugar quantities are not independent. This shows that a 0 covariance does not necessarily imply independence.

Let’s continue with the baking analogy to explore another characteristic of covariance. If the covariance between eggs and sugar is 3 and the covariance between flour and cocoa powder is 10, can we conclude the latter covariance is stronger than the former? The answer is no. Covariance does not give us the strength of the relationship between two variables because it doesn’t have a minimum and a maximum value (i.e. it is not normalized). Its magnitude depends on the magnitude of the variables.

Luckily, it is possible to scale the covariance such that it has a minimum value of -1 and a maximum value of 1. This is done by dividing it by the standard deviations of both variables. Doing so, transforms the covariance into its normalized form called correlation… Nothing is lost though, just transformed.

In probability and statistics, covariance is formally defined as “the expected product of deviations of two random variables from their mean values” (lab 551, lecture 3). In other words, it tells us whether we should expect one random variable to be below (above) its mean when the other is.

Covariance plays a key role in data science. Random variables with high covariance can be combined without losing significant information. It is also useful for inferences; it can be used to predict one result from another. In addition, it allows the integration of data from multiple sets which is key to machine learning.

**Source**:

- Michael Gelbart. (2018). "Descriptive statistics and probability for data science, lecture 3".<https://github.ubc.ca/MDS-2018-19/DSCI_551_stat-prob-dsci_students/blob/master/lectures/lecture3.ipynb>

- "Statistics how to?".Covariance in statistics: what is it?Example. Read on September 14, 2018 from <http://www.statisticshowto.com/covariance/>

- Ruslana Dalinina. "Oracle+ Datascience.com". Introduction to correlation. Read on September 14, 2018 from <https://www.datascience.com/blog/introduction-to-correlation-learn-data-science-tutorials>

- Brian Stacey."Quora". What is the purpose of covariance in statistics ? How does it differ from correlation? Read on September 14,2018 from  <https://www.quora.com/What-is-the-purpose-of-covariance-in-statistics-How-does-it-differ-from-correlation>

- Brian Quanz."Quora". What are the applications of data science. Read on September 14, 2018 from <https://www.quora.com/What-are-the-applications-of-covariance>

- Alan Anderson "dummies". How to measure the covariance and correlation of data samples. Read on September 14, 2018 <https://www.dummies.com/education/math/business-statistics/how-to-measure-the-covariance-and-correlation-of-data-samples/>

- Stack exchange. What is covariance in plain language. Read on September 14, 2018 from <https://stats.stackexchange.com/questions/29713/what-is-covariance-in-plain-language>


text:
### This code is associated with the paper from Jerison et al., "Genetic variation in adaptability and pleiotropy in budding yeast". eLife, 2017. http://dx.doi.org/10.7554/eLife.27167

# adaptability
Analysis scripts for "Genetic variation in adaptability and pleiotropy in budding yeast"

repository: elifesciences-publications/adaptability

repo_name: elifesciences-publications/adaptability


text:
---
layout: post
comments: true
title: "Python, sys.path and EasyInstall, programming"
date: 2008-03-18 00:00
categories: [python, programming]
---

# The Problem

At work, I'm wrapping up a script that does a custom install of a
whole bunch of software. We decided to install our stuff in a
[virtual Python environment][],
which provides several advantages that aren't especially germane to
this article. What *is* germane is that the installation script
must use the `virtualenv` package, but it cannot assume that the
`virtualenv` package has been installed.

<!-- more -->

This [chicken and egg][] problem is easily managed by adding a "bootstrap"
phase to the installation module. It works something like this:

{%codeblock lang:python %}
# create a temporary directory

import tempfile
bootstrapDir = tempfile.mkdtemp()

# Get and create the 'site-packages' directory
versionInfo = sys.version_info
sitePackagesDir = os.path.join(dir,
                               'lib',
                               'python%d.%d' % (versionInfo[0], versionInfo[1]),
                               'site-packages')
os.makedirs(path, 0755)

installBootstrapPackages(bootstrapDir) # left as exercise to reader

# Make sure Python can find the newly installed package

sys.path += [sitePackagesDir]
{% endcodeblock %}

In theory, this should work. In fact, if the dynamically installed
software resides in standard Python packages or modules, it *will*
work. However, it failed for me with `virtualenv`. My attempt to
import `virtualenv` failed with an `ImportError`. After some
head-scratching, some
[Googling][]
and some [UTSL][]'ing, the
solution became clear.

The problem is that
[EasyInstall][]
(which is what I'm using to install `virtualenv`) creates a
`virtualenv-1.0-py2.5.egg` directory in my temporary
`site-packages` directory. However, Python doesn't automatically
know to search the `virtualenv-1.0-py25.egg` directory, so
EasyInstall puts that directory's name in a special `.pth` file in
`site-packages`. Normally, that's enough; Python will read all the
`.pth` files it finds and add them to `sys.path`.

*However*... It only reads `.pth` files at startup. Adding a
directory to `sys.path` does *not* cause Python to re-read the
`.pth` files.

# A Solution

Fortunately, there's a simple solution: Replace:

    sys.path += [sitePackagesDir]

with

    import site
    site.addsitedir(sitePackagesDir)

The `site` module contains the logic that Python invokes, at
startup, to set `sys.path`, and it reads the `.pth` files. Calling
`site.addsitedir()` directly forces Python to re-read all those
`.pth` files.

If there's a more appropriate way to accomplish this task, I'd love
to hear about it. Meanwhile, this solution seems to get the job
done.

# Feedback

## 20 August, 2008

On [Reddit][], a user named **oblivion95**
[writes][]:

> I was just asking about a related problem on a newsgroup. All you
> have to do is:
>
>     sys.path.append(my_egg_dir)
>     from pkg_resources import require
>     require("virtualenv")
>     ...
>     import virtualenv
>
> This might seem like extra work, but the require() actually allows
> you to specify a range of versions. That is quite a benefit.
>
> And by the way, you can use the -m option to `easy_install` if you
> want to avoid the `.pth` and `site.py` complexity altogether. Just
> use `require()` for all modules that are in eggs.

[virtual Python environment]: http://pypi.python.org/pypi/virtualenv
[chicken and egg]: http://en.wikipedia.org/wiki/Chicken-and-egg_problem%22>chicken%20and%20egg%20problem
[Googling]: http://www.velocityreviews.com/forums/t342912-pth-files.html
[UTSL]: http://www.jargondb.org/glossary/utsl
[EasyInstall]: http://peak.telecommunity.com/DevCenter/EasyInstall
[Reddit]: http://www.reddit.com/
[writes]: http://www.reddit.com/r/python/comments/6vri8/python_syspath_and_easyinstall/

repository: bmc/brizzled

gha_language: HTML

repo_name: bmc/brizzled


text:
# React-Hangman.com

Demo: [React-Hangman]

React-Hangman is implementation of Hangman game using ReactJs, NodeJs and PosrgreSQL.

# How to play?

In this game player will have a 6 lives to guess a correct word. If he guess a correct word, the secret-keeper will reveal all occurrences of that letter in the word occurrences If the guesser runs out of guesses before the whole word is discovered,the game is over and player 1 has won.

# New Features!

- User is able to save his score.
- The Game is mobile responsive now.
- Recieved SSL certificate.

### Tech

- [ReactJS] - library to build great user interfaces.
- [NodeJS] - awesome javascript run-time environment. (Server)
- [SCSS] - superset of CSS cyntax. Also knows as "Sassy CSS".
- [Redux] - better state management for react
- [Express] fast node.js network app framework
- [Digitalocean] cloud hosting of webapp.

And of course react-hangman itself is open source with a [public repository]
on GitHub.

### Installation

React-Hangman requires [Node.js](https://nodejs.org/) v10+ to run.

Install the dependencies to start the server.

```sh
$ cd hangman-game
$ npm i
```

Start a server first.

```sh
$ node Server/
```

Start a wep app.

```sh
$ npm start
```

You will need to create a .env file in root of the poject.
This file should have a reference to DB connection and Session.
Example:

```sh
$ SESSION_SECRET=1mgKwqP09d
CONNECTION_STRING=postgres://someDBUrl?ssl=true

```

For DB I am using Heroku PostgreSQL.

#### Building for source

For production release:

```sh
$ npm run build
```

### Todos

- Improve UI of Leaderboard page.
- Create ability to restart the game without going to home screen.
- Add Sockets to the game. (Enable Multiplayer)

## License

MIT

[reactjs]: https://reactjs.org/
[nodejs]: https://nodejs.org/en/
[scss]: https://sass-lang.com/
[df1]: http://daringfireball.net/projects/markdown/
[markdown-it]: https://github.com/markdown-it/markdown-it
[redux]: https://redux.js.org/
[express]: http://expressjs.com
[digitalocean]: https://m.do.co/c/0168372e4d12
[public repository]: https://github.com/afiliptsov/hangman-game
[react-hangman]: https://react-hangman.com

repository: afiliptsov/react-hangman

repo_name: afiliptsov/react-hangman


text:
---
layout: default
---

# 1996-07-12 - Re: Another bad idea

## Header Data

From: "Peter D. Junger"<EMAIL_ADDRESS>To: Cypherpunks<EMAIL_ADDRESS>Message Hash: baac10bfdd5d844b122c10a6928d5c5bc6c33d864a6d6a306881763b79535bdf

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-07-12 21:06:30 UTC

Raw Date: Sat, 13 Jul 1996 05:06:30 +0800

## Raw message

```
{% raw  %}From: "Peter D. Junger"<EMAIL_ADDRESS>Date: Sat, 13 Jul 1996 05:06:30 +0800
To: Cypherpunks<EMAIL_ADDRESS>Subject: Re: Another bad idea
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Arun Mehta writes:

: As  I see it, the Chinese communist government will not live to see more
: than a few years (if any) of the 21st Century. We are all aware of the
: devastating impact of telecommunications, TV and computers on  authoritarian
: regimes.  E.g. in the fall of the Berlin Wall, the Easterners watching West
: German TV was a significant contributory factor.
:
: Satellite TV is available all over China.The government may, for a while, be
: able to ban satellite dishes, but soon their size will reduce to that of a
: wok (might even double as one). The Internet will soon be widespread. The
: real crunch will come when Hongkong becomes part of China. Inevitably, other
: parts of the country will want to know why the special status of Hongkong
: cannot be extended to them. There is a chance that instead of China taking
: over Hongkong, the reverse might happen.
:
: In cyberspace, the students have the more powerful tanks. Can you imagine
: how different a massacre a la Tiananmen Square would look in a couple of
: years? Images captured on camcorders would be beamed back to the Chinese via
: satellite, all the information would flow both ways on the net, the Hongkong
: stock market would take a dive, ... I would suggest that tacitly or at least
: implicitly, the Chinese goverment has conceded that it will never try a
: major violent suppression of political unrest again. That, or it will decide
: that the Internet is a bad influence, and should be abolished.
:
: What that does is give us a window of opportunity. Hongkong has one
: remaining  year of guaranteed unfettered flow of information. China still
: has the Internet. What can we do?
:
: 1) Collect the e-mail addresses as Allen suggested (including those in
: Hongkong), and send them a single, short message offering to teach them free
: of cost how to use pgp and all the goodies at
: http://www.eskimo.com/~joelm/cbsw.html

Unfortunately for those of us in the United States or who are
otherwise subject to its jurisdiction such an offer would require a
license or a waiver of jurisdiction under the International Traffic in
Arms Regulations before it could safely be carried out.  That
particular highly worthwhile project would seem to fall under the
definition of performing defense services as well as involving the
disclosure of technical data relating to an item on the United States
Munitions List.

: . . . .
:
: Thoughts?

Obscene isn't it?

--
Peter D. Junger--Case Western Reserve University Law School--Cleveland, OH
Internet<EMAIL_ADDRESS><EMAIL_ADDRESS>

{% endraw %}
```

## Thread

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

+ Return to "[Arun Mehta <amehta@giasdl01.vsnl.net.in>](/authors/arun_mehta_amehta_at_giasdl01_vsnl_net_in_)"
+ Return to "["Peter D. Junger" <junger@pdj2-ra.F-REMOTE.CWRU.Edu>](/authors/peter_d_junger_junger_at_pdj2ra_fremote_cwru_edu_)"

+ 1996-07-12 (Fri, 12 Jul 1996 23:19:43 +0800) - [Re: Another bad idea](/archive/1996/07/ce49a4797e7b01e91c2c3ae66ff4f61c6f57bd8ef032087ea956a7291eb5f9a4) - _Arun Mehta<EMAIL_ADDRESS>  + 1996-07-12 (Sat, 13 Jul 1996 05:06:30 +0800) - Re: Another bad idea - _"Peter D. Junger"<EMAIL_ADDRESS>


text:
---
title: Sliding Window Maximum
date: "2020-11-29"
type: problem-solving
description: Sliding Window Maximum
tags: csharp
---

Note: This problem was taken from LeetCode - [Sliding Window Maximum](https://leetcode.com/problems/sliding-window-maximum/)

### Using Deque (Linked List)

```csharp
public int[] MaxSlidingWindow(int[] nums, int k) {
	int[] output = new int[nums.Length - k + 1];

	LinkedList<int> deque = new LinkedList<int>(); // Stores the indices of the nums array

	for(int i = 0; i < nums.Length; i++){

		// Remove if deque contains an index which is not part of the window
		if(deque.Count > 0 && deque.First.Value + k <= i){
			deque.RemoveFirst();
		}

		// Remove indices whose value is less than the current number
		while(deque.Count > 0 && nums[deque.Last.Value] <= nums[i]){
			deque.RemoveLast();
		}

		// Adds the new index as the window slides
		deque.AddLast(i);

		if(i + 1 - k >= 0){
			output[i + 1 - k] = nums[deque.First.Value];
		}
	}

	return output;
}
```

repository: melwinalm/my-gatsby-blog

gha_language: JavaScript

repo_name: melwinalm/my-gatsby-blog


text:
# DreamLucker

DreamLucker is a tool for simulating luck. For example, the drop of an item from a mob in the game or an oncoming car from hundreds of others.

# How to use?

Just download Python and download zip, unzip zip and enter the directory ``src```.
Then type ```python main.py``` and enter how many times the simulation will be repeated and how many objects will participate.

license: Unlicense

repository: TheCoolestUshanka/DreamLucker

repo_name: TheCoolestUshanka/DreamLucker


text:
Ti=How the open source community solved the problem of getting substantial agreement ("Yes") on complex matters

1.sec=It's well-known that open source software develops excellent solutions.  Iteration, many eyeballs, etc.  The tools for doing this are modularity and versioning.  Modularity permits granular agreement.  Versioning permits it to get better.

2.sec=The critical condition for success is local necessity - or, to put it another way - running code.  Someone needs to solve a problem for their own purposes, in their own environment.

3.0.sec=The method:

3.1.sec=They do their best.

3.2.sec=If it looks like a good start on a problem that is relevant for others, they can publish.

3.3.sec=Then improve.  Perhaps someone else will pick up the solution and use it themselves.  And improve it and post the improvement.  Maybe it forks and wanders off to another solution.

3.4.sec=There is ongoing forking and convergence - eventually a few solutions emerge with strong followings.

3.=[G/Z/ol/s4]

4.0.sec=What may be less well recognized is that this can be applied to other uses of text, notable to legal relationships.  The critical concepts are:

4.1.sec=Modularity - disaggregation of a problem - taking it issue by issue.

4.2.sec=Versioning - continuous improvement.  One doesn't need a perfect solution, just one's best at any given moment.

4.3.sec=Running code - local decision and consequences.

4.=[G/Z/ol/s3]

=[G/Z/ol/s4]

repository: CommonAccord/Cmacc-Org

gha_language: CSS

repo_name: CommonAccord/Cmacc-Org


text:
# grunt-provecss
[![Build Status](https://travis-ci.org/gasolin/grunt-provecss.svg)](https://travis-ci.org/gasolin/grunt-provecss) [![NPM version](https://badge.fury.io/js/grunt-provecss.svg)](http://badge.fury.io/js/grunt-provecss) [![Dependency Status](https://david-dm.org/gasolin/grunt-provecss.svg)](https://david-dm.org/gasolin/grunt-provecss)

> grunt plugin for [provecss](https://github.com/gasolin/provecss)

## Getting Started
This plugin requires Grunt.

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

```shell
npm install grunt-provecss --save-dev
```

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

```js
grunt.loadNpmTasks('grunt-provecss');
```

## The "provecss" task

### Overview
In your project's Gruntfile, add a section named `provecss` to the data object passed into `grunt.initConfig()`.

```js
grunt.initConfig({
  provecss: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
      files: { 'dest': 'src'}
    },
  },
})
```

### Options

#### options.files
Type: `Dictionary`

A key/value pair that is used to define the source file and generated file destination.

### Usage Examples

#### Default Options
In this example, the default options are used to do something with whatever. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result would be `Testing, 1 2 3.`

```js
grunt.initConfig({
  provecss: {
    options: {},
    files: {
      'dest/calc.out.css': 'src/calc.css'
    },
  },
})
```

#### Custom Options
In this example, You can pass any provecss options in `options` section.

```js
grunt.initConfig({
  provecss: {
    options: {
      vars: true
    },
    files: {
      'dest/vars.out.css': 'src/vars.css'
    },
  },
})
```

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).

## Release History
0.3.0 first release

## License
Copyright (c) 2014 Fred Lin(gasolin). Licensed under the MIT license.

repository: gasolin/grunt-provecss

repo_name: gasolin/grunt-provecss


text:
## Model parser

### Purpose

This tool print operators, tensors, and buffers information in tflite model file (`.tflite`)

### How to use

```
./model_parser.py <model file>
```

### Example

```
$ ./tools/tflitefile_tool/model_parser.py /home/nnfw/convolution_test.tflite

[Main model]

Main model input tensors: [0]
Main model output tensors: [1]
Operators list

Operator 0: CONV_2D
        Input Tensors[0 3 2]
        Output Tensors[1]

Tensor-Buffer mapping & shape

Tensor    0 : buffer    3 |  Empty | FLOAT32 | Shape [1, 299, 299, 3] (Mul)
Tensor    1 : buffer    4 |  Empty | FLOAT32 | Shape [1, 149, 149, 32] (conv)
Tensor    2 : buffer    1 | Filled | FLOAT32 | Shape [32] (conv/Conv2D_bias)
Tensor    3 : buffer    2 | Filled | FLOAT32 | Shape [32, 3, 3, 3] (conv/conv2d_params)

$
```

## Model generator from other model file

### Purpose

This tool makes small model file from base model file (such as inception v3)

### How to use

```
./select_operator.py <base model file> <opcode list txt file> <output file name>
```

### Example

```
$ cat /home/nnfw/opcodelist.txt
107 108 109 110 111 112 113 114 115 116 117 118 119 120

$ ./tools/tflitefile_tool/select_operator.py /home/nnfw/inceptionv3_non_slim_2015.tflite \
/home/nnfw/opcodelist.txt /home/nnfw/test.tflite

Input tensor(s): [29]
Output tensor(s): [31]

$ Product/out/bin/tflite_run /home/nfs/inception_test.tflite
nnapi error: unable to open library libneuralnetworks.so
input tensor indices = [29,]
Input image size is smaller than the size required by the model. Input will not be set.
output tensor indices = [31(max:567),]
Prepare takes 0.000516954 seconds
Invoke takes 0.719677 seconds

$
```

You can use range such as `107-120` in `opcodelist.txt` instead of using each operator index

## Colaboration model parser and model generator

1. Get imformation about base model using model parser
2. Select operators you want to make test model
3. Make text file including selected operators index
4. Generate test model file using model generator


text:
# AWS-specific server setup instructions

These instructions are part of the instructions for
[Setting up `upspinserver`](/doc/server_setup.md).
Please make sure you have read that document first.

## Build `upspinserver-aws` and `upspin-setupstorage-aws`

To use Amazon Web Services fetch the `aws.upspin.io` repository and use the
`upspinserver-aws` and `upspin-setupstorage-aws` variants.

Fetch the repository and its dependencies:

```
local$ go get -d aws.upspin.io/cmd/...
```

Install the `upspin-setupstorage-aws` command:

```
local$ go install aws.upspin.io/cmd/upspin-setupstorage-aws
```

Build the `upspinserver-aws` binary:

```
local$ GOOS=linux GOARCH=amd64 go build aws.upspin.io/cmd/upspinserver-aws
```

## Install the AWS CLI

Ensure you have a working AWS environment set up before continuing and that you
are able to run basic commands using the
[CLI tool](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html).

## Set up storage, role account, and instance profile

Use `upspin setupstorage-aws` to create an S3 bucket, an associated
role account, and instance profile for accessing the bucket and provisioning.
Note that the bucket name must be globally unique among all AWS users, so it is
prudent to include your domain name in the bucket name.
(We will use `example-com-upspin`.)

```
local$ upspin setupstorage-aws -domain=example.com example-com-upspin
```

It should produce output like this:

```
You should now deploy the upspinserver binary and run 'upspin setupserver'.
```

If the command fails, it may leave things in an incomplete state.
You can use the -clean flag to clean up any potential entities created:

```
local$ upspin setupstorage-aws -clean -role_name=upspinstorage -domain=example.com example-com-upspin
```

**Notes**:

- The role has access to all S3 buckets by default. To restrict its access to
  only one bucket, follow [this guide](https://aws.amazon.com/blogs/security/how-to-restrict-amazon-s3-bucket-access-to-a-specific-iam-role/).
- The role name is also used as the name for the
  [instance profile](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html)
  you should use to provision the instance.
- If you are running `upspinserver` on an EC2 instance, ensure that your
  security group allows inbound TCP traffic on ports 80 and 443.

## Continue

You can now continue following the instructions in
[Setting up `upspinserver`](/doc/server_setup.md).

repository: upspin/upspin

gha_language: Go

repo_name: upspin/upspin


text:
---
topic: "Python Tutorials"
desc: "Online resources for learning Python"
---

Web sites where you can study Python:

* <https://www.learnpython.org/>
* [Principles of Computing in Python](https://oli.cmu.edu/jcourse/webui/guest/join.do?section=pricompute) from Carnegie Mellon's [Open Learning Initiative](https://oli.cmu.edu)

Web sites where you can practice Python coding

* <http://codingbat.com/python>    Practice problems that are autograded

References for Python

* <http://book.pythontips.com/>  When you are ready to go beyond the basics


text:
# EventService
The EventService is responsible for propagating player events.

##Endpoints
###/event [POST]
####Publishes the event to all subscribed services.
Every service type will receive this message only once.

**Body**:
```json
{"eventId": "join", "meta": {"uuid": "05b39a97-a9e4-4a17-8741-bedf13201f2f", "bungeeId": "24"}}
```
- eventId (string): The event identifier (e.g. "join")
- meta (json object): Event specific data (see Event meta's for more info)

###/subscribe [WEBSOCKET]:
####Creates a websocket that streams event data.

**Outbound Messages**:
- subscribe (string): Subscribes the service to the specified events.
```json
{"subscribe": {"events": ["join", "leave"], "serviceId": "MessageService", "instanceId": "05b39a97-a9e4-4a17-8741-bedf13201f2f"}}
```

**Inbound Messages**:
- event (string):
```json
{"eventId": "join", "meta": {"uuid": "05b39a97-a9e4-4a17-8741-bedf13201f2f", "bungeeId": "24"}}
```

##Event meta's

repository: Exorath/EventsService

repo_name: Exorath/EventsService


text:
## 0.1.0 - First Release
* Created the test runner pane
* Can run tests without leaving Atom and view output in the pane
* Can copy seeds used in test runs to the clipboard
* Can set the seed used for test runs
* Can toggle the behavior of automatically running tests when saving a file

repository: mbuscemi/elm-test-runner

repo_name: mbuscemi/elm-test-runner


text:
# GraphQl Custom Config Module for Magento 2
This module allow to configure the GraphQL complexity and depth inside the Magento administration

## Requirements
* Magento Community Edition 2.4.3

## Installation
```
composer require caravelx/module-graphql-config
php bin/magento module:enable Caravel_GraphQlConfig
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
```

## Support
If you have any issues with this extension, open an issue on [GitHub](https://github.com/caravelx/module-graphql-config/issues).

repository: caravelx/module-graphql-config

repo_name: caravelx/module-graphql-config


text:
---
layout: about
title: about
permalink: /
subtitle: Comp-Sci Grad Student @ University of Colorado Boulder
  CS Endowed Founder's Fellowship Winner (2022-2023)
  Previously: Sr. Data Scientist @ MakeMyTrip.com · Data Scientist @ General Electric Digital

profile:
  align: right
  image: Pic.jpg

news: false  # includes a list of news items
selected_papers: false # includes a list of papers marked as "selected={true}"
social: true  # includes social icons at the bottom of the page
---

Hi there, thanks for stopping by! 👋

I am a second-year research based master’s student at the Department of Computer Science at CU Boulder.

My research interests span the areas of `Computer Vision and Deep Learning`. I am generally fascinated about learning representations of images and videos from limited labeled datasets that are useful and transferable across a wide range of domains. Specifically, I am interested in working on problems in domain adaptation, salient object detection, semantic segmentation and few shot learning.

Currently, I am working at the Image and Video Computing Group as a graduate research student under the supervision of Dr. Danna Gurari, with a focus in the area of `Salient Object Detection`.

Prior to my master’s, I worked close to 4 years in the industry, where I developed products in the domain of computer vision and reinforcement learning. I recieved my undergraduate degree in Computer Science from RV College of Engineering, Bangalore.

In my spare time, I love to work on fun side projects, watch, play and analyse soccer! I am originally from Bengaluru, Karnataka, India, currently living in Boulder, Colorado, USA.


text:
Image-Card
====

Image Card is a Custom Element for displaying a slideshow powered by [Mozilla X-Tag](http://x-tags.org/).  I'll fix this soon. Stay tuned!

## Installation

Installation is simply done by using Bower:

```bash
$ bower install image-card --save
```

After that include the X-Tag-Core-library, the element's Javascript and the element's CSS into your page. That's it!

```html
…
<head>
  <link rel="stylesheet" href="bower_components/image-card/dist/styles/image-card.css">
  <script src="bower_components/x-tag-core/dist/x-tag-core.js"></script>
  <script src="bower_components/image-card/dist/scripts/image-card.js"></script>
</head>
<body>
  <!-- throw in some Image Cards! -->
  …
```

## Usage

Just wrap a bunch of images into the `<image-card>`-element:

```html
<image-card>
  <img src="path/to/img-1.jpg">
  <img src="path/to/img-2.jpg">
  <img src="path/to/img-3.jpg">
</image-card>
```

Set the second image as initially visible image:

```html
<image-card current="2">
  <img src="path/to/img-1.jpg">
  <img src="path/to/img-2.jpg">
  <img src="path/to/img-3.jpg">
</image-card>
```

(Hint: counting starts at 1)

Add bullet-controls beneath the Image Card:

```html
<image-card>
  <img src="path/to/img-1.jpg">
  <img src="path/to/img-2.jpg">
  <img src="path/to/img-3.jpg">
  <card-control></card-control>
</image-card>
```

## Methods

### `prev`

Toggles the previous image unless the first image is currently visible.

### `next`

Toggles the next image unless the last image is currently visible.

## Events

### `change`

When another image is shown.

```javascript
document.getElementsByTagName('image-card')[0].addEventListener('change', function () {
  // … do something
}, false);
```

## Properties

### `current`

Index of the current image starting at one!

```javascript
// get the current Index
var current = document.getElementsByTagName('image-card')[0].current;

// set the current Index; toggle the third image
document.getElementsByTagName('image-card')[0].current = 3;
```

### `images`

Returns a Node list containing all `<img>`-elements. Getter only, can't be overwritten.

```javascript
// get all images
var images = document.getElementsByTagName('image-card')[0].images;
```

## Attributes

### `current`

Sets the index of the initially visible image; starting at one.

```html
<!--
/**
 * Initially shows the second image
 */
-->
<image-card current="2">
  <img src="path/to/img-1.jpg">
  <img src="path/to/img-2.jpg">
</image-card>
```

## Author

**Emanuel Kluge**

![Emanuel Kluge](https://2.gravatar.com/avatar/4f965f0d32998cdf5b3576241aff3929?d=https%3A%2F%2Fidenticons.github.com%2Ff84c85567eb0521955aa7e52fa14d260.png&r=x&s=120)

[Website](http://www.emanuel-kluge.de/)

[twitter](https://twitter.com/Herschel_R)

[Google+](https://plus.google.com/+EmanuelKluge)

## License

Copyright 2014 Emanuel Kluge

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

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

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


text:
---
title: "ㅅ irregular - Korean Irregular Verbs #1"
published: 2016-09-05
date: 2016-09-05
---
<iframe id="audio_iframe" src="https://www.podbean.com/media/player/hvu2w-625ee5?skin=9" width="100%" height="100" frameborder="0" scrolling="no"></iframe>

From today, we'll learn irregular verbs of Korean. There are 9 types of irregular verbs in Korean. Today, we'll learn ㅅ irregular.

In English, irregular verbs have their own special past tense verb and past participle. In Korean, irregular verbs have different conjugation when endings or markers which start with a vowel are appended to them.

Irregular verbs are irregular. So, there is no reason behind them. You should just memorize them.

When some verbs which have 받침 ㅅ conjugate, ㅅ is eliminated. These irregular verbs are called ㅅ irregular or ㅅ 불규칙 활용. Some of you might have noticed that I used the phrase, "some verbs". It means that there are other verbs that have regular conjugations.

Irregular verbs: 긋다(draw), 낫다(disease is cured or better), 붓다(pour, swell), 잇다(connect), 젓다(stir), 짓다(make)
Regular verbs: 벗다(take off), 빼앗다(steal, rob), 씻다(wash), 솟다(soar, rise)

#  Irregular verbs examples.

##  Regular Cases

As I said before, if the verbs are appended with endings or markers that start with consonants, the conjugations are regular.

밤에 라면을 먹으면 아침에 얼굴이 붓습니다.
If you eat ramen at night, your face will be swollen in the morning.

영어 실력은 철수가 영희보다 낫다.
철수's English is better than 영희's.

그 두 점을 잇지 말고 이렇게 해 보는 것은 어때?
Don't connect those two dots. How about doing it like this?

After the verbs 붓다, 낫다, 잇다, there are endings or markers which start with consonants, -습니다, -다, -지. So, ㅅ is not eliminated.

##  Irregular Cases

종이 위에 선을 하나 그었다.
I've drawn a line on the paper.

카레 가루를 넣고 3분간 저어 줍니다.
Adding curry and stir it for 3 minutes.

그 집을 지은 사람은 우리 아버지이다.
It is my father who built that house.

Unlike the last examples, you can see that  there are endings or markers which start with vowels like -었, -어, -은. So, ㅅ is eliminated.

#  Regular Verbs

밥 먹기 전에는 손을 씻어라
Wash your hand before the meal.

땅에서 갑자기 불꽃이 솟아 올랐다.
Suddenly, the flame came out of the ground.

저것만 빼앗으면 이기는데 그게 쉽지 않네.
If we take that, we can win. But it's not that easy.

As you can see, there are endings or markers which start with vowels like -어, -아, -으면. But ㅅ is not eliminated.

repository: sainthkh/wiseinit-blog

repo_name: sainthkh/wiseinit-blog


text:
---
published: true
title: Group mind
tags: blog manager
---
> A mind that is disconnectable and reconnectable. A brain, for example, is fully physically connected all the time and doesn’t qualify. - [What is a group mind](https://abe-winter.github.io/2018/07/31/group-mind.html)

It doesn’t need to be ‘as conscious’ as a whole as the individual pieces. But at minimum, to qualify as a combined entity rather than a bucket of individuals, a group mind should be able to:

Enforce priorities (top down) that are relatively consistent over time.
Update priorities (bottom up / random). You can call this creativity if you like; in a singular brain the default mode network handles it.
Chunk out work so that between syncs, mental labor can be parallelized.
The goal is to:

Do cognitive work faster than any individual could, even if the speedup is less than linear
Ideally: solve in finite time problems too large for one individual given infinite time

## Companies need to

- Do multiple things at once i.e. multitask
- Stay on task i.e. don’t multitask and don’t react too quickly to change
- Change projects or strategy when indicated by a change in conditions, i.e. react quickly to change

If it seems like these three goals are at odds, you’re right – that’s why attention and memory are so difficult even in an individual brain. Even healthy teams can at times feel totally schizophrenic.


text:
# instantnews
## Get news instantly! :notes: :newspaper:
### Released v1.2.3
[![PyPI](https://img.shields.io/badge/instantnews-downloads-brightgreen.svg)](https://pypi.python.org/pypi?:action=display&name=instantnews&version=1.2.1)
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/instantnews/Lobby)

Install
=====

An API key from [newsapi](http://newsapi.org/) will be required and you can register for one [here](http://newsapi.com/register).

### Using `pip`

```bash
$ pip install instantnews
```
### Using `pip` upgrade

```bash
$ pip install instantnews --upgrade
```

Set your API key in an environment variable `IN_API_KEY`

For example:

```bash
export IN_API_KEY="<YOUR_API_TOKEN>"
```

### Build from source

```bash
$ git clone https://github.com/shivam043/instantnews.git
$ cd instantnew
$ python setup.py install
```
#### Note:
Python 2.7 and Python 3 compatible

Usage
====

### Get help

```bash
$ instantnews -h/--help  #Get Help
usage: instantnews [-h] [--show SHOW] [--show_all] [--news NEWS]

optional arguments:
  -h, --help            show this help message and exit
  --show SHOW, -s SHOW  Shows all the news channel codes category wise
  --show_all, -sa       Shows all the news channel codes
  --news NEWS, -n NEWS  Shows news
```

### Get news-code category-wise/all
```bash

$ instantnews -sa/--show_all
forexample:
instantnews --show_all
News Code: <abc-news-au> ABC News (AU)
News Code: <al-jazeera-english> Al Jazeera English
News Code: <ars-technica> Ars Technica
News Code: <associated-press> Associated Press
News Code: <bbc-news> BBC News
News Code: <bbc-sport> BBC Sport
News Code: <bild> Bild
News Code: <bloomberg> Bloomberg
News Code: <breitbart-news> Breitbart News .....

$ instantnews -s/--show business
forexample:
instantnews --show business  # Categories available-'business','entertainment','gaming','general','music','politics','science-and-nature','sport','technology'
News Code: <bloomberg> Bloomberg
News Code: <business-insider> Business Insider
News Code: <business-insider-uk> Business Insider (UK)
News Code: <cnbc> CNBC
News Code: <die-zeit> Die Zeit
News Code: <financial-times> Financial Times
News Code: <fortune> Fortune
News Code: <handelsblatt> Handelsblatt

```
### Get news
```bash
$ instantnews -n/--news  [news-id]
forexample:
instantnews --news bbc-news
[0] Title: Trump denies NFL kneel row race-related
Author: BBC News
Summary: Donald Trump says his words about political protests at sport events had "nothing to do with race".
--------------------------------------------
[1] Title: Germany's AfD to fight 'foreign invasion'
Author: BBC News
Summary: Nationalists lay out their plans after winning nearly 13% of the vote, weakening Chancellor Merkel.
--------------------------------------------
........
Want to see the news that interests you/open in a webpage? Enter Y/N # See news in a webpage by enter the number present in the box
```

License
====
Open sourced under [MIT License](LICENSE)

repository: pythongiant/instantnews

repo_name: pythongiant/instantnews


text:
# Portal

## Features

- Laravel 5.5 + Vue + Vue Router + Vuex
- Pages with custom layouts
- Login, register and password reset
- Skeleton setup of [INUITCSS 6.0.0_beta5](https://github.com/inuitcss/inuitcss)
- Integration with [vform](https://github.com/cretueusebiu/vform)
- Authentication with [JWT](https://github.com/tymondesigns/jwt-auth)
- Webpack with [laravel-mix](https://github.com/JeffreyWay/laravel-mix)
- SVG icons with [svg-sprite-loader](https://github.com/kisenka/svg-sprite-loader)

## Installation

- `git clone git@github.com:Jamiewarb/laravel-vue-spa-inuitcss`
- `cd laravel-vue-spa-inuitcss`
- `cp .env.example .env`
- `composer install`
- `php artisan key:generate`
- `php artisan jwt:secret`
- Edit `.env` and set your database connection details
- `php artisan migrate`
- `yarn install | npm install`
- `cp node_modules/inuitcss/settings/_example.settings.config.scss resources/assets/sass/settings/_settings.config.scss`

## Usage

#### Development

```bash
# build and watch
yarn run watch

# serve with hot reloading
yarn run hot
```

#### Production

```bash
yarn run production
```

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Credits
Based heavily on [laravel-vue-spa](https://github.com/cretueusebiu/laravel-vue-spa) from cretueusebiu

repository: Jamiewarb/laravel-vue-spa-inuitcss

repo_name: Jamiewarb/laravel-vue-spa-inuitcss


text:
# **Behavioural Cloning**

The goals / steps of this project are the following:

* Use the simulator to collect data of good driving behaviour
* Build, a convolution neural network in Keras that predicts steering angles from images
* Train and validate the model with a training and validation set
* Test that the model successfully drives around track one without leaving the road
* Summarise the results with a written report

[train.ipynb]: https://github.com/sandeeppatil/CarND-Behavioral-Cloning-P3/blob/master/train.ipynb
[model_lenet.h5]: https://github.com/sandeeppatil/CarND-Behavioral-Cloning-P3/blob/master/model_lenet.h5
[weights_lenet.h5]: https://github.com/sandeeppatil/CarND-Behavioral-Cloning-P3/blob/master/weights_lenet.h5
[drive.py]: https://github.com/sandeeppatil/CarND-Behavioral-Cloning-P3/blob/master/drive.py
[video.mp4]: https://github.com/sandeeppatil/CarND-Behavioral-Cloning-P3/blob/master/video.mp4
[video.py]: https://github.com/sandeeppatil/CarND-Behavioral-Cloning-P3/blob/master/video.py
[data.zip]: https://d17h27t6h515a5.cloudfront.net/topher/2016/December/584f6edd_data/data.zip
[linux_sim]: https://d17h27t6h515a5.cloudfront.net/topher/2017/February/58ae46bb_linux-sim/linux-sim.zip
[win_sim]: https://d17h27t6h515a5.cloudfront.net/topher/2017/February/58ae4419_windows-sim/windows-sim.zip
[LeNet]: http://yann.lecun.com/exdb/publis/pdf/lecun-01a.pdf
[Nvidia]: https://images.nvidia.com/content/tegra/automotive/images/2016/solutions/pdf/end-to-end-dl-using-px.pdf

## Files Submitted

Project include following files

* [train.ipynb] -> containing the script to create and train the model
* [model_lenet.h5] -> containing a trained model
* [weights_lenet.h5] -> containing a intermediate trained model
* [drive.py] -> for driving the car in autonomous mode
* [video.mp4] -> video recorded by running car autonomously using [model_lenet.h5]
* [video.py] -> for converting sequence of images into .mp4 video

## Testing Model

Using the Udacity provided simulator and my [drive.py] file, the car can be driven autonomously around the track by executing

```sh
python drive.py model_lenet.h5
```

## Model Architecture

### 1. Choosing Model

The [LeNet] Architecture is used to build the Convolution Neural Network with an input data normalised using keras lambda layer

### 2. Reduce Over-fitting in the Model

The Model contains l2 regularizer and dropout layers to reduce Over-fitting

### 3. Training & Validation Data Size

* Training Samples:  25712 from [data.zip] + 836 self generated using [linux_sim]
* Validation Samples:  6432 from [data.zip] + 212 self generated using [linux_sim]

Note: The above training data are combination of centre, left and right camera images generated by the simulator

### 4. Hyper-parameters

The following hyper parameters were used

* Epocs: **5**
* Optimizer: **Adam**
* Learning Rate: **0.01**
* Batch Size: **32**

## Training Strategy

### 1. Overall strategy

The overall strategy was to try at least 2 different well known models and compare. I choose [LeNet] and [Nvidia] model. [Nvidia] Model had more parameters than LeNet and I could achieve target with LeNet. This will not only reduce training time also uses less memory and runtime when deployed on hardware.

### 2. Final Model Architecture

|Layer (type)                  |Output Shape              |Param #   |
|------------------------------|:------------------------:|---------:|
|lambda_1 (Lambda)             |(None, 85, 96, 3)         |0         |
|conv2d_1 (Conv2D)             |(None, 81, 92, 6)         |456       |
|max_pooling2d_1 (MaxPooling2) |(None, 40, 46, 6)         |0         |
|conv2d_2 (Conv2D)             |(None, 36, 42, 16)        |2416      |
|max_pooling2d_2 (MaxPooling2) |(None, 18, 21, 16)        |0         |
|flatten_1 (Flatten)           |(None, 6048)              |0         |
|dense_1 (Dense)               |(None, 120)               |725880    |
|dropout_1 (Dropout)           |(None, 120)               |0         |
|dense_2 (Dense)               |(None, 84)                |10164     |
|dropout_2 (Dropout)           |(None, 84)                |0         |
|dense_3 (Dense)               |(None, 1)                 |85        |
|                              |                          |          |

* Total params: 739,001
* Trainable params: 739,001
* Non-trainable params: 0

### 3. Pre-processing of the Training/Validation Set

#### The original image shape: (160, 320, 3)

![original](./examples/original.jpg)

#### STEP1: Crop image to remove sky on top and car hood at the bottom, resulting image shape: (85, 320, 3)

![cropped](./examples/cropped.jpg)

#### STEP2: Resize the image to fasten the runtime without affecting the accuracy, resulting image shape: (85, 96, 3)

![resize](./examples/resize.jpg)

#### STEP3: Gaussian Blur the image to reduce noice and improve the accuracy: [Ref](https://arxiv.org/pdf/1604.04004.pdf)

![resize](./examples/blur.jpg)

#### STEP4: Change the color space from BGR to HSV to tackle shadows regions

![processed](./examples/processed.jpg)

#### Similar Pre-process in Drive.py

Same pre-process pipeline is used in [drive.py] before feeding to the model for predection

### 4. Training Process

#### 1. Captruring Data

Pre-captured driving behaviour is used from [data.zip]. [linux_sim] was used to capture more data for the cases where car was failing to be on track.

The data captured has 3 camera angle views, all of them were used with stering angle correction of 0.2 degrees for the left and right camera views.

To tackle right turn bias, the center images are flipped and stering angles are reversed to generate more data.

Here is the histogram for distrubution of various steering angle recorded

##### **For Training Set**

![hist_training](./examples/hist_train.jpg)

##### **For Validation Set**

![hist_training](./examples/hist_test.jpg)

#### 2. Feeding Data to the Model

Loading thounds of image files at a time in RAM would crash the system. Hence, a generator function is used to generate batch of data just before feeding to the model.

#### 3. Saving Model

The Loss is continuesly monitored during training and the best epoch with the lowest validation loss is saved using callback function ([weights_lenet.h5]).

Model generated from final Epoch is also saved as [model_lenet.h5]. This is used to retrain the model (transfer learning) with extra data recorded for the failing cases.

Following are the sample accuracy and loss curve for training and validation data which was captured during training extra data to tackle failed case

![curv_acc](./examples/acc.jpg)

![curv_loss](./examples/loss.jpg)

## Final Test Run Video Rcording

Here is the final test run video recorded at this link: [video.mp4]


text:
# DAT129 Final Project SP21

## Sources

[National Weather Service](https://www.weather.gov/)

[National Weather Service API Web Service](https://www.weather.gov/documentation/services-web-api#)

Websites referenced:

[Matplotlib](https://matplotlib.org/stable/tutorials/introductory/lifecycle.html)

[Geeks For Geeks](https://www.geeksforgeeks.org/finding-mean-median-mode-in-python-without-libraries/)

[Geeks For Geeks](https://www.geeksforgeeks.org/python-statistics-stdev/)

[Geeks For Geeks](https://www.geeksforgeeks.org/saving-a-pandas-dataframe-as-a-csv/)

Final Project expanded from previous assignment:

[National Weather Forecast API Assignment](https://github.com/ianorourke/dat129_ccac/edit/main/API_README.md)

## About The Project

Expanding from the original assignment, this program allows the user to send requests to the API endpoint as provided
by https://www.weather.gov to receive active weather alerts either by individual state or territory or produce a JSON
that can be referenced containing all current active weather alerts at the time of the request. These can be saved into
.csv format and perform basic statistical analysis. Currently, this program can perform this with the data retrieved
from the time of request but hopefully, these requests can be saved over time for more larger analyses.

## Inquiry Question

The larger inquiry question is more about the information available and if additional information regarding the
alerts can be drawn conveniently beyond the severity, but additional information regarding the areas affected. That is,
is it possible to take the information from the active alerts to potentially build a larger body of data, perhaps a
database, where statistical information about the frequency of grades of severity over time could be gathered.

## About the Program

The program operates in a straightforward way with five options accessed through a simple menu system.

![Program Start](https://github.com/ianorourke/dat129_ccac/blob/main/final1.png)

The first option allows the user to enter a valid state or territory code to produce a list of current alerts.

![Individual State/Territory Alerts](https://github.com/ianorourke/dat129_ccac/blob/main/final2.png)

The second option allows the user to make a request for all active alerts within each state and territory. This
request retrieves a fair amount of information so it often takes a moment for the request to fully process. As a result, a prompt
has been placed for the user to prevent any accidental requests (as the JSON currently overwrites).
```
...
state_data_list = []
    # Loop to run through each state for alert data.
    for state in state_list:
        new_state = state.upper()
        alerter = alert_grabber(new_state)
        alert_specs = alerter['features']
        grab_bag = list_comprehender(alert_specs,'properties')
        state_data_list.append(grab_bag)
        ...
    with open('state_weather_data.json','w') as filer:
        json.dump(state_data_list,filer)
...
```

![All Current Active Alerts](https://github.com/ianorourke/dat129_ccac/blob/main/final3.png)

Once completed, a JSON is created (or overwritten with current data) the user is notified and the menu restarts.

![Completed Request](https://github.com/ianorourke/dat129_ccac/blob/main/final4.png)

The third option then takes the current JSON and arranges for the user the relevant data regarding the alerts provided.

![Looking at Current Data for All Active Alerts](https://github.com/ianorourke/dat129_ccac/blob/main/final5.png)

The fourth option allows for some basic statistical analysis.

![Analyzing Current Data](https://github.com/ianorourke/dat129_ccac/blob/main/final7.png)

Currently, this analysis is very simple but a potential future development would be to expand on this further.

The fifth option creates a .csv from the current data, arranged by categories of severity, effective time of date of alert,
and headline/area information regarding the nature of the alert. Currently, this overwrites with active date from each
request but a future development would be to append this for larger, more impacting analyses.

![Creating .csv from the Current Data](https://github.com/ianorourke/dat129_ccac/blob/main/final8.png)

And the sixth option ends the program.

![End Program Message](https://github.com/ianorourke/dat129_ccac/blob/main/final9.png)

## Issues and Potential Future Developments

Currently, the JSON and the .csv that the program produces focuses only on the data pulled from the time of request
but a potential future development would be to append requests so that alerts over time could be saved and gathered
for more meaningful statistical analysis. A primary issue that can arose was not being able to figure out how to
properly append the information retrived from each request so that analysis of alerts over larger amount of time could be
conducted. Average lengths of time regarding the alerts and by each grade of severity as well as including the areas affected
could be conducted once this issue is resolved.


text:
# fnhub
Laravel + Angular2 Starter

## Dependencies or Prerequisites
What you need to run this app:
* composer (https://getcomposer.org/doc/00-intro.md)
* `node` and `npm` (`brew install node`)
* Ensure you're running the latest versions Node `v6.x.x`+ (or `v7.x.x`) and NPM `3.x.x`+

> If you have `nvm` installed, which is highly recommended (`brew install nvm`) you can do a `nvm install --lts && nvm use` in `$` to run with the latest Node LTS. You can also have this `zsh` done for you [automatically](https://github.com/creationix/nvm#calling-nvm-use-automatically-in-a-directory-with-a-nvmrc-file)

Once you have those, you should install these globals with `npm install --global`:
* `webpack` (`npm install --global webpack`)
* `webpack-dev-server` (`npm install --global webpack-dev-server`)
* `karma` (`npm install --global karma-cli`)
* `protractor` (`npm install --global protractor`)
* `typescript` (`npm install --global typescript`)

### Installations
```bash
# clone our repo
git clone https://github.com/backand/fnhub-web.git

# change directory to our repo
cd fnhub-web

# install dependencies
./install.sh -FNHUB_ENV dev

# build project
./build.sh -FNHUB_ENV dev (Local development)
./build.sh -FNHUB_ENV prod

```
php artisan serve

### Deployment on server
```bash

Option 1- If you have an access to server,

- login to server using ssh
- Install git
- install composer
- install node
- and other global dependecies , follow Dependencies or Prerequisites
# clone our repo
git clone https://github.com/backand/fnhub-web.git
# change directory to our repo
cd fnhub-web
# install dependencies
./install.sh -FNHUB_ENV prod
# build project
./build.sh -FNHUB_ENV prod

and point your domain to public directory
example :
http:www.fnhub.io ----> /fnhub-web/server/public

Option 2-

# clone repo to your local system
git clone https://github.com/backand/fnhub-web.git
# change directory to our repo
cd fnhub-web
# install dependencies
./install.sh -FNHUB_ENV prod
# build project
./build.sh -FNHUB_ENV prod

Now upload all content of `/www` directory to your server
and point your domain to public directory
example :
http:www.fnhub.io ----> /
```

# Best Practices
The following are some things that will make AoT compile fail.

- Don’t use require statements for your templates or styles, use styleUrls and templateUrls, the angular2-template-loader plugin will change it to require at build time.
- Don’t use default exports.
- Don’t use `form.controls.controlName`, use `form.get(‘controlName’)`
- Don’t use `control.errors?.someError`, use `control.hasError(‘someError’)`
- Don’t use functions in your providers, routes or declarations, export a function and then reference that function name
- @Inputs, @Outputs, View or Content Child(ren), Hostbindings, and any field you use from the template or annotate for Angular should be public

# External Stylesheets
Any stylesheets (Sass or CSS) placed in the `src/styles` directory and imported into your project will automatically be compiled into an external `.css` and embedded in your production builds.

For example to use Bootstrap as an external stylesheet:
1) Create a `styles.scss` file (name doesn't matter) in the `src/styles` directory.
2) `npm install` the version of Boostrap you want.
3) In `styles.scss` add `@import 'bootstrap/scss/bootstrap.scss';`
4) In `src/app/app.module.ts` add underneath the other import statements: `import '../styles/styles.scss';`

## Use latest TypeScript compiler
TypeScript 2.1.x includes everything you need. Make sure to upgrade, even if you installed TypeScript previously.

```
npm install --global typescript
```

# Types
> When you include a module that doesn't include Type Definitions inside of the module you can include external Type Definitions with @types

i.e, to have youtube api support, run this command in terminal:
```shell
npm i @types/youtube @types/gapi @types/gapi.youtube
```
In some cases where your code editor doesn't support Typescript 2 yet or these types weren't listed in ```tsconfig.json```, add these to **"src/custom-typings.d.ts"** to make peace with the compile check:
```es6
import<EMAIL_ADDRESS>import '@types/gapi';
import '@types/youtube';
```

## Custom Type Definitions
When including 3rd party modules you also need to include the type definition for the module
if they don't provide one within the module. You can try to install it with @types

```
npm install @types/node
npm install @types/lodash
```

If you can't find the type definition in the registry we can make an ambient definition in
this file for now. For example

```typescript
declare module "my-module" {
  export function doesSomething(value: string): string;
}
```

If you're prototyping and you will fix the types later you can also declare it as type any

```typescript
declare var assert: any;
declare var _: any;
declare var $: any;
```

If you're importing a module that uses Node.js modules which are CommonJS you need to import as

```typescript
import * as _ from 'lodash';
```
___

# License
 [MIT](/LICENSE)


text:
# LeetCode Problem List
> Abbr. Note:
> * WA: Wrong Answer
> * TLE: Time Limit Exceeded
> * ASR: Another Solution Required
## Algorithms
| # | Title | Difficulty | Tag |
| :---: | :---: | :---: | :---: |
| 001 | Two Sum | Easy | - |
| 002 | Add Two Numbers | Medium | - |
| 003 | Longest Substring Without Repeating Characters | Medium | - |
| 004 | Median of Two Sorted Arrays | Hard | - |
| 005 | Longest Palindromic Substring (93/94) | Medium | TLE |
| 006 | ZigZag Conversion | Medium | - |
| 007 | Reverse Integer | Easy | - |
| 008 | String to Integer (atoi) | Medium | - |
| 009 | Palindrome Number | Easy | - |
| 010 | Regular Expression | Hard | ASR |
| 012 | Integer to Roman | Medium | - |
| 013 | Roman to Integer | Easy | - |
| 014 | Longest Common Prefix | Easy | - |
| 015 | 3Sum | Medium | - |
| 016 | 3Sum Closest | Medium | - |

repository: umarufans/leetcode-prob

repo_name: umarufans/leetcode-prob


text:
WebatlasExamples
================

Examples of how to use our Leaflet plugins.

Questions? Create an Issue!

Plugins documented here
-----------------------

- `L.TileLayer.Webatlas`: Our plugin for using Webatlas maps as baselayers.

repository: Norkart/WebatlasExamples

repo_name: Norkart/WebatlasExamples


text:
---
title: Testable Architecture
subtitle: How to have fast and reliable tests
weight: 1400
---

Automated tests and executable specifications can only work with software that has a testable architecture.
A testable architecture enables fast and reliable tests that are easy to write, execute and maintain.

# Fast feedback
Fast tests enable the developers to run them frequently to obtain fast feedback on what they are building, without
losing focus or flow.

# Testability
When designing for testability, make sure that your products and services are composed of loosely-coupled,
well-encapsulated components or modules.

Decoupling your business logic from your infrastructure (the often slow and brittle components),
makes it possible to test at different levels, with maximum confidence and minimum cost.

* Ensure that you can run your tests without going through the user interface (UI). They are slow, brittle, expensive,
and hard to fix. Do not depend solely on UI tests.
* Running tests against a database makes tests slow. We need to make sure the database is in the expected state before
each test in order to make the tests behave consistently.
This will ensure that tests don't interfere with each other and can be executed in any order.

We want most of our tests to use some kind of in-memory stub implementation, instead of an actual database.
From the perspective of the domain logic, the behavior looks exactly the same.
To make sure that the stub works in the same way as the real thing, we need to have confidence, which we can obtain using [contract tests](https://martinfowler.com/bliki/IntegrationContractTest.html).

# Ports and adapters
We can think of our database and our stub as two things that can be plugged into the **port**.
The application containing the business logic doesn't need to know if it's talking to a stub or the actual database. This is because it's talking to this port
and storing and retrieving data. We can run our tests using both the stub and the real implementation. This gives us confidence that the stub behaves like the real thing.

The business logic is at the core of the application, completely decoupled
from external devices and services. It doesn’t know anything about databases, message queues,
or web services, because we have isolated them through these ports. Often,
these ports are connected to adapters that interact with the real implementation.
There will be an adapter for the database, an adapter for the queue, and an adapter for the web service.
The user interface defines how we can interact with our system. It will also have an adapter, such as
a web server that plugs into a port to display a UI in a browser. All the IO tends to happen outside of these ports.
By testing the core business logic directly though the ports, we can eliminate a lot of slow and brittle IO.

This architectural patterns is called **ports and adapters pattern** (or [hexagonal architecture](https://en.wikipedia.org/wiki/Hexagonal_architecture_(software))).
It enables you to connect your scenarios and unit tests at a lower level, while the contract tests give you the confidence to do that.

Diagnosing where the problem is in a full-stack, end-to-end test is really hard, because it can be anywhere.
These tests are brittle because one change can break all of them. They are also slow,
as there is IO involved when going through a browser, web service or database.

# Test Pyramid
Focus on having different kinds of tests: lots and lots of unit tests,
a few tests that don’t go through all the heavy infrastructure components and just a few tests that go through the UI.
This is called the [test pyramid](https://martinfowler.com/bliki/TestPyramid.html).

# More information

For an example of how to implement fast tests (in node.js), see [subsecondtdd on GitHub](https://github.com/subsecondtdd/todo-subsecond).

Or have a look at Aslak's [talk at Devlin 2017](https://skillsmatter.com/skillscasts/9971-testable-software-architecture-with-aslak-hellesoy)
- or the [slides](https://speakerdeck.com/aslakhellesoy/testable-architecture-devlin-2017) - about this subject.

repository: cucumber/docs

repo_name: cucumber/docs


text:
---
layout: post
title: Marcus Node Bits - Ok then, Moogose is pretty sweet
date: 2014-03-05T07:00:00.000Z
author: Marcus Hammarberg
tags:
  - MobProgramming
  - Javascript
  - Tools
  - Agile
modified_time: 2014-06-02T08:56:52.500Z
blogger_id: tag:blogger.com,1999:blog-36533086.post-2091121684384294337
blogger_orig_url: http://www.marcusoft.net/2014/03/mnb-mongoosejs.html
---

I often blog too early. I get excited and want to tell everyone as soon
as possible. I whip together a demo and then write a blog post about my
experience. Sometimes that is a bit too early. Sometimes you need
another look to really appreciate a tool, or to realize that it doesn't
do the job.

In my blog post about Monk (which I still think is
great... Monk, that is, not the blog post) I wrote that I didn't like
Mongoose that much.
That was too early to say. I have now used it for real and I think I
like it.

Let's me redeem my bad Mongoose-conscience and write a ~~short~~ post on
what I've picked up when trying it...
for
real.

The thing that ticked me off and actually made me
turn away from Mongoose on the idea-stadium was the fact that it needs a
typed model. To me, at the time, this seemed to go against the whole
idea of simplicity and dynamicallity (yeah, made that word up... but I
mean focus on dynamic stuff; I can store object that doesn't have
exactly the same properties in the same collection for example) that can
be seen through
Mongo and
Monk
for example.

As always with Node frameworks Mongoose is really simple to install:

> npm
> install mongoose

Optionally passing (--save) to
update your package.json file.

Here's an example on how to create a new thing (in this case a Post in
the AptiTalk application):

Let's go through it in detail, since it's not the most basic example
(that can be found on
the Mongoose homepage -
no use restating that here), but rather part of an API I wrote for our
application:

On line 1 we are requiring mongoose as normal

Line 3 - 9 declares our model. There are a lot of things that you can do
here, like setting constraints ({type: Date,
default: Date.now} and {type: String,
required: true} are a couple that springs to mind). You can then
use built-in Mongoose validation to validate that. I have not and
I will tell you more about why later.

Line 11-25 is where the storage takes place

On line 12 we create a new Post object. That is a new instance of our
Mongoose model.

Lines 13-16 sees us setting some values on it.

Line 18 calls the create()
method of the Post-object.
This can be thought of as a static method on the class rather than on
the instance. I will not try to explain this with prototypes etc in
Javascript. I think I understand it but dare not explain it. Read JavaScript the good parts. Twice.

- The  create()has
    the follow signature: create({doc},
    callback)or create(\[{doc},
    callback\])so you can add one or many objects.

Lines 19-23 is my callback function.
In fact I could have called the .save() method on the post object I new'ed up on line 12, but I
prefer this approach.

- To my callback I always get any errors as first param and then the
    document or documents created, updated or whatever as the second
    param.
- In my case I get the inserted post back with a generated id

The callback checks for errors and returns success or failure via two
methods I have created for that.

That's quite a lot of code you say. The good news, I respond, is that
the model of course only needs to be declare once. And the rest of the
operations you need (finding, updating, removing etc.) looks very
similar indeed. Here's a list of them in action:

###

### Testing Mongoose

Testing Mongoose is pretty straight forward. If you can live with
"integration"-tests that is. As I'm a recently converted C# developer
doing JavaScript mostly now I find myself searching for concepts and
implementations that I maybe shouldn't be looking for.

So for a long time I tried to mock the database out. Using a "tightly
shut" abstraction like Mongoose I found this very hard indeed. I can
mock out Mongoose itself... but then my tests are testing nothing.

(Mocking though, I should add, is pretty sweet in a dynamic language
like JavaScript. You can just supply your own implementation in the
test. Basically overriding the real implementation just for the test)

It all ended up with a real good comment from one of the best JavaScript
devs I know
- Carl
Bergquist:

> "How short are your feedback loops? Hit the database already!" (or
> something like that)

Hitting the database with Mongo and Mongoose is really really fast.
Mocha is reporting the tests that take longer than 100 ms as warnings
and it very seldom reports any warning for me. I sucked it in and
stopped trying mocking stuff out. I simply run my tests against a test
version of my database.

However that mean cleaning stuff up before and after your tests, since
you cannot guarantee the order the tests are run in.
Here's a an example test of adding a post:

Sorry about all those files, the original is a bit bigger and I had to
refactor it a bit.
Almost forgot... check out line 16 in testHelpers.js. You need to
connect to Mongo and since you cannot guarantee order I had to write a
little check to see if the connection was open or not... One of those
"doing it for real"-things that I talked about in the beginning of this
post ^^.

### ORM or Data Access framework?

Ok, so why did I diss this awesome framework the first time around?
Because I didn't even thing about a ORM, I just wanted data access. For
a number of years I've just used very
simple tools and shy'ed away from the complex as
much as I could. When I saw that I needed to create a model, and that
Mongoose hid all things Mongo from me... I was a bit hesitant.

Now, when I've used the tool I feel much better. It's worth the ...
"toll" I pay by creating models etc, I think. The API that Mongoose
exposes is very nice and powerful and I have yet been near running into
a situation that I cannot handle.

In short - I should have looked harder and longer. ORM can be
ligthweight too, apparently. Thank you Mongoose for showing me that.


text:
# Lab 01: ECS Cluster

## Goal

Create an ESC cluster.

## Instructions

Make sure you are starting from the starting point for Lab 01.

```
cp lab01-cluster/starting-point/template.yaml template.yaml
```

Extend the CloudFormation template (`template.yaml`) with the following resources.

### ECS Cluster

Define an ECS Cluster and with the required properties.

Finally, create your own ECS stack. Replace `$user` with your name (e.g. `andreas`).

```
aws cloudformation create-stack --stack-name ecs-$user --template-body file://template.yaml
```

## Help
* CloudFormation Resource [AWS::ECS::Cluster](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html)

repository: widdix/learn-fargate

gha_language: Shell

repo_name: widdix/learn-fargate


text:
# beta3

Experimental minimal Hammond organ emulation, on linux/JACK.

## Notes

Using jack: libjack-jackd2-dev (1.9.8~dfsg.1-1ubuntu1)

Header files in /usr/include/jack/*.h

## Sites

Another virtual Hammond project: http://lionel.cordesses.free.fr/lassoMain.html


text:
# Title Assistant Contentful Field Extension

This extension enables a content editor inside contentful to immediately see how a given page title, url-slug, and meta description will render in a google search result. The field itself is made to render a character count that warns the editor when the full title goes over a set limit as well as appending a globaly set brand-name to the chosen title fields. There is also a switch for manually removing the appending of the brand name and links to moz.com articles about SEO best practices for editors to quickly understand what the extension aims to do.

## Installation

### Using Contentful web-app and GitHub

The simplest way to install a github is to provide a link to an extension.json file in a public github repo. Simply navigate to extension.json file in the folder structure of the extension you wish to install and then copy the url for that file. Then, in contentful, navigate to Settings -> Extensions. In the extensions settings page, click Add new extension -> Install from Github. If the pop-up does not accept the url from github then the url probably doesn't end with extension.json. If it does you can click Install button and wait a moment for the extension to finish installing. Once completed, set the installation parameters and start using the extensions by adding it to an asset model and setting the instance parameters.

### Using CLI and command line

To install this extension into a contentful environment follow these steps.

* make sure that you have the user privileges to install and change your target contentful space & environment
* clone the project files
* cd into extension root folder and run npm install
* npm run login && npm run configure && npm run deploy

Run login will open up contentful and have you log in. Once that is done it will give you an access token that you paste into the command line. Run configure will use that token to check what spaces you have access to and have you run through an interactive propmt to first choose the space and which environment in that space to install the extension on. The login and configure commands will create a .contenfulrc.json to store the access token, space id, and environment id. There is also a key for host which is most likely refering to the self-hosting option that the Contentful Enterprise tier enables. Once done run npm run deploy to install the extension with hosting provided by contentful.

## Setup

### Parameters

Extension parameters in contentful are used to set space wide or asset type wide variables to specific values. Think of these as environment variables, useful for things like api-urls, access tokens or other single-source parameters.

#### Installation

This extension has three installation wide parameters.

* Brand Name (Symbol | Recommended | When set, the extension appends this to the end of the attached title field according to the moz guidelines of title tags)
* Url Stub (Symbol | Recommended | When set, prepends this to the url string set on the later instance field. Purely cosmetic but good to set in order for the google search preview to look complete)
* Title Max Length (Number | Optional (defaults to 60) | When set, overwrites the default value of 60 for when to warn editors that their title length is over limit)

#### Instance

This extension has two instance wide parameters. Both are purely cosmetic and are only used for rendering the search result previewer correctly.

* URL Slug Target Field (Symbol | Recommended | Set this to the id of the field in which you are writing the page url)
* Meta Description Target Field (Symbol | Recommended | Set this to the id of the field in which you write the meta description)


text:
### [CVE-2009-0441](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0441)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

PHP remote file inclusion vulnerability in skin_shop/standard/2_view_body/body_default.php in TECHNOTE 7.2, when register_globals is enabled, allows remote attackers to execute arbitrary PHP code via a URL in the shop_this_skin_path parameter, a different vector than CVE-2008-4138.

### POC

#### Reference
- https://www.exploit-db.com/exploits/7965

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

repo_name: trickest/cve


text:
<!-- add-breadcrumbs -->
# Working Days Calculation in the Salary Slip

Working Days are shown in the In the Salary Slip. Based on your preference, it may include holidays of the month or it may not. You can define your preference for the Working Days calculation in HR Settings.

`HR > Setup > HR Settings`

If you want to include holidays in the count of Total Working days, then ensure that in the HR Settings, field **Include holidays in Total no. of Working Days** is checked and vice versa.

<img alt="Role Desk Permission" class="screenshot" src="/docs/assets/img/articles/hr-working-days.png">

To learn how to define holidays for your company, check [Holiday List](/user/manual/en/human-resources/holiday-list) feature in the HR module.

repository: vishnus/foundation

repo_name: vishnus/foundation


text:
Caliperscript-functions-autocomplete
====================================
A while ago I needed to do some programming for TransCad, and created this, to speed up my work.

Auto-complete support for Caliper script (TransCad version 4.5) function syntax  for Sublime Text 2.

To use:
 1. Clone this repo into your ~\Sublime Text 2\Packages\GISDK\ directory (Create GISDK directory if there is none).
 2. Restart Sublime Text 2.
 3. Happy scripting!

 If you want more:
 morganherlocker (https://github.com/morganherlocker/Caliperscript-Syntax) provides splendid caliper script syntax lybrary.

The MIT License (MIT) Copyright (c) 2014 Villy L

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

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

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