text:
# Ruby SQLite C Extension

## About

This is a stripped-down Ruby C extension for SQLite. It compiles/embeds the
SQLite amalgamation in the extension and provides a very simple SQLite API and
higher level Query/Recordset API.

To install from the internets:

```
    gem install sqlite
```

To build/install from source:

```
    git clone git@github.com:mikeowens/SQLiteRuby.git
    cd SQLiteRuby
    gem install rake-compiler
    rake
    rake gem
    cd pkg
    gem install -l sqlite-*.gem
```

## Usage

```ruby
    @db = SQLite::Database.new()
    rc = @db.open("#{$test_dir}/files/foods.db")

    if rc != SQLITE_OK
      puts @db.error()
    end

    # Low-level SQLite statement handle API
    query = @db.prepare('select * from foods')

    while query.step() == SQLITE_ROW
      # Step though each field in row.
      # k is column name, v is field value
      query.each do |k,v|
        puts "  #{k}: #{v}"
      end
    end

    # High level Query/Recordset API
    query = SQLite::Query.new(@db)

    recordset = query.exec %Q{ select * from foods order by name }

    # Rows can key on both column ordinals and/or name.
    recordset.each do |row|
      puts "%3i %2i %-30s" % [row['id'], row[1], row[2]]
    end
```

repository: mikeowens/SQLiteRuby

repo_name: mikeowens/SQLiteRuby


text:
# go-codecov

<!-- [![CircleCI][circleci-badge]][circleci] -->
[![pkg.go.dev][pkg.go.dev-badge]][pkg.go.dev]
<!-- [![codecov.io][codecov-badge]][codecov] -->

Global coverage report uploader for [Codecov][Codecov] written in Go.

## Related repositories

### Official

- [codecov/uploader](https://github.com/codecov/uploader)
- [codecov/codecov-bash: Global coverage report uploader for Codecov](https://github.com/codecov/codecov-bash)
- [codecov/codecov-node: Global coverage report uploader for Codecov in NodeJS](https://github.com/codecov/codecov-node)
- [codecov/codecov-python: Python report uploader for Codecov](https://github.com/codecov/codecov-python)
- [codecov/codecov-ruby: Ruby uploader for Codecov](https://github.com/codecov/codecov-ruby)
- [codecov/codecov-perl: Backend for Codecov reporting of coverage](https://github.com/codecov/codecov-perl)

<!-- links -->
[Codecov]: https://codecov.io

<!-- badge links -->
[circleci]: https://app.circleci.com/pipelines/github/zchee/go-codecov
[pkg.go.dev]: https://pkg.go.dev/github.com/zchee/go-codecov
[codecov]: https://codecov.io/gh/zchee/go-codecov

[circleci-badge]: https://img.shields.io/circleci/build/github/zchee/go-codecov/master.svg?style=for-the-badge&label=CIRCLECI&logo=circleci
[pkg.go.dev-badge]: http://bit.ly/pkg-go-dev-badge
[codecov-badge]: https://img.shields.io/codecov/c/github/zchee/go-codecov/master?logo=codecov&style=for-the-badge

repository: zchee/go-codecov

branch_name: refs/heads/main

extension: md

license_type: permissive

repo_name: zchee/go-codecov


text:
---
layout: default
---

# 1993-10-14 - Re: DES

## Header Data

From<EMAIL_ADDRESS>(wonderer)

To<EMAIL_ADDRESS>Message Hash: 8e9b98a944ec1800c1e493944fa8e4ec71bb250a36d51c4fff74ee2a48e31c1c

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1993-10-14 17:51:59 UTC

Raw Date: Thu, 14 Oct 93 10:51:59 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(wonderer)
Date: Thu, 14 Oct 93 10:51:59 PDT
To<EMAIL_ADDRESS>Subject: Re: DES
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

I don't think it takes the cube of it. There are 56 bits in
one key, and 112 bits in two keys, so there could not be
an entropy of more than 112 bits to triple DES. It is no
more cryptographically secure than double DES because it
uses 2 keys.
-------------------------------------------------------------------------
To find out more about the anon service, send mail to<EMAIL_ADDRESS>Due to the double-blind, any mail replies to this message will be anonymized,
and an anonymous id will be allocated automatically. You have been warned.
Please report any problems, inappropriate use etc. to<EMAIL_ADDRESS>

{% endraw %}
```

## Thread

+ Return to [October 1993](/archive/1993/10)

+ Return to<EMAIL_ADDRESS>(wonderer)](/authors/an41418_at_anon_penet_fi_wonderer_)"
+ Return to "[Matthew J Ghio <mg5n+@andrew.cmu.edu>](/authors/matthew_j_ghio_mg5n_at_andrew_cmu_edu_)"
+ Return to "["Perry E. Metzger" <pmetzger@lehman.com>](/authors/perry_e_metzger_pmetzger_at_lehman_com_)"

+ 1993-10-14 (Thu, 14 Oct 93 10:51:59 PDT) - Re: DES -<EMAIL_ADDRESS>(wonderer)_
  + 1993-10-14 (Thu, 14 Oct 93 11:11:58 PDT) - [Re: DES](/archive/1993/10/7d2b4656b77b08abda53c2496b4245c8ec8bd56cb0ff43f6de460c62632060ca) - _"Perry E. Metzger"<EMAIL_ADDRESS>  + 1993-10-15 (Thu, 14 Oct 93 17:32:04 PDT) - [Re: DES](/archive/1993/10/48144fe6125ce8fb479da3e697b017d6594b0c45f4e070042bec0480343e512e) - _Matthew J Ghio<EMAIL_ADDRESS>

license: MIT

branch_name: refs/heads/master

gha_license_id: MIT


text:
# Pack Documentation

This pack is used to access Recorded Future Identity data.

## Integration

The integration is used to access the data from the API.

### Available Actions

* Identity data actions
  * Using the new Recorded Future Identity module.
  * Available actions: recordedfuture-identity-lookup; recordedfuture-identity-search; recordedfuture-password-lookup.

## Playbooks

All the playbooks are meant to be used as sub-playbooks to get Identities data.

### Available sub-playbooks

* Recorded Future External Usecase Playbook
* Recorded Future Workforce Usecase Playbook
* Recorded Future Identity - Create Incident (sub)
* Recorded Future Identity - Lookup Identities (parent)
* Recorded Future Identity - Identity Found (incident)

repository: demisto/content

gha_language: Python

repo_name: demisto/content


text:
---
title: "A Great HR Organization"
sources:
  [
    {
      title: "The Hard Thing About Hard Things",
      authors: ["Ben Horowitz"],
      link: "https://www.amazon.com/Hard-Thing-About-Things-Building/dp/0062273205",
    },
  ]
tags:
  - business
  - human resources
---

Everyone in the technology industry seems to agree that people are paramount, yet nobody seems to be on the same page with what the people organization—human resources—should look like.

The problem is that when it comes to HR, most CEOs don’t really know what they want. In theory, they want a well-managed company with a great culture. Instinctively they know that an HR organization probably can’t deliver that. As a result, CEOs usually punt on the issue and implement something that’s suboptimal, if not worthless.

A high quality human resources organization cannot make you a well-managed company with a great culture, but it can tell you wen you and your managers are not getting the job done. You want to look at this through the lens of the employee life cycle. From hire to retire, how good is your company? Is your management team world-class in all phases? How do you know?

A great HR organization will support, measure, and help improve your management team. Some of the questions they will help you answer:

#### Recruiting and Hiring

1. Do you sharply understand the skills and talents required to succeed in every open position?
1. Are your interviewers well prepared?
1. Do your managers and employees do an effective job of selling your company to prospective employees?
1. Do interviewers arrive on time?
1. Do managers and recruiters follow up with candidates in a timely fashion?
1. Do you compete effectively for talent against the best companies?

#### Compensation

1. Do your benefits make sense for your company demographics?
1. How do your salary and stock option packages compare with the companies that you compete with for talent?
1. How well do your performance rankings correspond to your compensation practices?

#### Training and Integration

1. When you hire an employee, how long does it take them to become productive from the perspective of the employee, her peers, and her manager?
1. Shortly after joining, how well does an employee understand what’s expected of her?

#### Performance Management

1. Do your managers give consistent, clear feedback to their employees?
1. What is the quality of your company’s written performance reviews?
1. Did all of your employees receive their reviews on time?
1.

#### Motivation

1. Are your employees excited to come to work?
1. Do your employees believe in the mission of the company?
1. Do they enjoy coming to work every day?
1. Do you have any employees who are actively disengaged?
1. Do your employees clearly understand what’s expected of them?
1. Do employees stay a long time or do they quit faster than normal?
1. Why do employees quit?

What kind of person should you look for to comprehensively and continuously understand the quality of your management team? Here are some key requirements:

1. **World-class process design skills.** The head of HR must be a masterful process designer. One key to accurately measuring critical management processes is excellent process design and control.
1. **A true diplomat.** Nobody likes a tattletale and there is no way for an HR organization to be effective if the management team doesn’t implicitly trust it. Managers must believe that HR is there to help them improve rather than police them. Great HR leaders genuinely want to help the managers and couldn’t care less about getting credit for identifying problems. They will work directly with the managers to get quality up and only escalate to the CEO when necessary. If an HR leader hoards knowledge, makes power plays, or plays politics, he will be useless.
1. **Industry knowledge.** Compensation, benefits, best recruiting practices, etc. are all fast-moving targets. The head of HR must be deeply networked in the industry and stay abreast of all the latest developments.
1. **Intellectual heft to be the CEO’s trusted advisor.** None of the other skills matter if the CEO does not fully back the head of HR in holding the managers to a high quality standard. In order for this to happen, the CEO must trust the HR leader’s thinking and judgment.
1. **Understanding things unspoken.** When management quality starts to break down in a company, nobody says anything about it, but super-perceptive people can tell that the company is slipping. You need one of those.


text:
---
title: Attribute.External - aesi-java
---

[aesi-java](../../index.html) / [com.virtlink.editorservices.codecompletion](../index.html) / [Attribute](index.html) / [External](.)

# External

`External`

The member is external to this project.

repository: Virtlink/aesi

repo_name: Virtlink/aesi


text:
---
author: dealingwith
date: '2005-09-14 11:26:00'
layout: post
slug: continuing-the-thread
status: publish
title: continuing the thread
wordpress_id: '565'
---

The part of [that last rambling post][1] that I've been most stuck on has been
the total aside ("Like {...}"), where I use the term "financial independence"
to mean two different things, meaning what it means--never needing to work
again--but also just "not being dependent on others" or really just
"sustained." But the reason I'm hung up on the aside is because the end-end
I'm really thinking about here is happiness. (Something [Benson][2] has done a
lot of thinking/writing/toolbuilding around.)

There's a ton of research on this from [Freud][3] [on down][4]. ([OMG exactly][5].)* Besides the scholarly research yet to be parsed, I'm interested
in collecting layman's tools for creating environments nurturing to our semi-
universal end-ends. (Aside: this kind of stuff is the reason I majored in
Psych in the first place, and I am somewhat surprising myself that I am
returning to this subject matter at this time. I have some ideas as to why,
which I may write on if I feel they are helpful in the broader discussion.)

[Something][6] I saw yesterday was from Jason Fried, net-famous founder of 37
Signals.

_**As a successful entrepreneur and businessman, you've got many important
demands on your time, yet you still manage to get stuff done. What's your
secret to time management? What methods/tools do you employ to manage your
time well?**

I'm really not that great at time management. I forget to do a lot of things
(especially writing thank you notes which is a horrible thing to forget to
do). Backpack reminders have definitely helped, but I'm still not great at
remembering the little things. It's something I need to get better at (and
that's not a software thing, it' a personal thing). Software doesn't solve
problems unless you make the software solve problems. Software is dead unless
you breathe life into it.

The other thing is to make things easy on you. It's a lot like our Less
Software approach -- the less features and the less code, the less can go
wrong and the less you have to manage. It's the same with time. Make things
easier on you -- make quick, simple decisions and then go back and change that
decision if it doesn't work. If you make a mistake it's no big deal if you can
correct that mistake quickly. Don't burden yourself with stuff that really
doesn't matter. It's a bit of an art to figure out what really doesn't matter,
but it's more than you probably think. Most things we all spend our time on
don't really matter._

The interesting thing here is _he doesn't answer the question_ (although his
comment _Software doesn't solve problems unless you make the software solve
problems_ is very helpful to our discussion). He implies that knowing what
doesn't "really matter" is an inherit skill, as is choosing what does "really
matter" over what doesn't. But I would argue that this exceptionally soft
skill is exactly what seperates "successful" people from not. My question is,
what tools are there to facilitate and nurture this ability? [Covey][7] saw
wild success putting a point on some techniques for just that, but I'm more
interested in tools to fundamentally rewire the neurological events that
create such behavior-or-the-lack-thereof. What-the-bleep meets Covey, I guess.
Hmm...I'm already in academic territory. But, in the meantime, I'll continue
to be on the lookout for layman's tools, and thinking about low- and hi-tech
methodologies for nurturing "happy" "pre-ends."

*(Holding a strong goal intention ('I intend to reach Z!') does not guarantee
goal achievement because people may fail to deal effectively with self-regulatory problems
during goal pursuit. The present review analyzes whether realization of intentions is facilitated by
forming an implementation intention that spells out the when, where, and how of goal
pursuit in advance ('If situation Y is encountered, then I will initiate goal-directed behavior X!').
Findings from 94 independent tests showed that implementation intentions had a positive effect
of medium-to-large magnitude (d = .65) on rate of goal attainment. Implementation intentions
proved effective for selfregulatory problems having to do with initiating goal pursuit, shielding ongoing goal
pursuit from unwanted influences, disengaging from failing goals, and conserving capacity
for future goal striving. There was also strong support for postulated component processes;
implementation intention formation both enhanced the accessibility of specified opportunities
and automated respective goal-directed responses.)

   [1]: http://www.livejournal.com/users/dealingwith/141853.html

   [2]: http://www.erikbenson.com/

   [3]: http://en.wikipedia.org/wiki/Freud

   [4]: http://scholar.google.com/scholar?hl=en&hs=hOu&lr=&client=firefox-a&rls=org.mozilla:en-US:official&sa=X&oi=scholart&q=delayed+gratification+goal+achievement

   [5]: http://gsbwww.uchicago.edu/research/workshops/behavioral/Gollwitzer.pdf

   [6]: http://www.workhappy.net/2005/09/interview_with_.html

   [7]: http://www.franklincovey.com/

repository: dealingwith/poole

extension: markdown

gha_language: CSS

repo_name: dealingwith/poole


text:
# Sheer Heart Attack [![GitHub release](https://img.shields.io/github/release/k1LoW/sheer-heart-attack.svg)](https://github.com/k1LoW/sheer-heart-attack/releases)

`sheer-heart-attack` is a debugging tool that can execute any command on the process/host metrics trigger.

## Quick Start

``` console
# source <(curl -sL https://git.io/sheer-heart-attack)
You can use `sheer-heart-attack` command in this session.
# sheer-heart-attack launch
```

## Install

**manually:**

Download binany from [releases page](https://github.com/k1LoW/sheer-heart-attack/releases)

**go get:**

``` console
go get github.com/k1LoW/sheer-heart-attack
```

## Alternatives

- [ProcDump for Linux](https://github.com/Microsoft/ProcDump-for-Linux) - A Linux version of the ProcDump Sysinternals tool

## TODO

- Slack notify when execute command.

repository: sonod/sheer-heart-attack

repo_name: sonod/sheer-heart-attack


text:
---
layout: default
---

# 1993-12-18 - DES chips.

## Header Data

From<EMAIL_ADDRESS>(Lance Cottrell)

To<EMAIL_ADDRESS>Message Hash: 22954b21fa83be173caa0e8ae4d624e7f6c34620252c2b793703afc0b9577081

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1993-12-18 00:41:55 UTC

Raw Date: Fri, 17 Dec 93 16:41:55 PST

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Lance Cottrell)
Date: Fri, 17 Dec 93 16:41:55 PST
To<EMAIL_ADDRESS>Subject: DES chips.
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

I am looking for suppliers of DES chips. I wanted to use an IDEA chip
in the phone I am designing, but the only one made is 177Mbps and costs
about 200SFR. So one possibility is IDEA in software, and the other is
DES (or tripple DES) in hardware. So, if you know name, address, phone,
or email for companies that produce or sell DES chips, please let me know.

----------------------------------------------------------
Lance Cottrell	who does not speak for CASS/UCSD
Obscura Security Products
<EMAIL_ADDRESS>PGP 2.3 key available by finger or server.

"Love is a snowmobile racing across the tundra.  Suddenly
it flips over, pinning you underneath.  At night the ice
weasels come."
			--Nietzsche
----------------------------------------------------------

{% endraw %}
```

## Thread

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

+ Return to<EMAIL_ADDRESS>(Lance Cottrell)](/authors/loki_at_nately_ucsd_edu_lance_cottrell_)"

+ 1993-12-18 (Fri, 17 Dec 93 16:41:55 PST) - DES chips. -<EMAIL_ADDRESS>(Lance Cottrell)_


text:
# ShapeUp

A Pure-Ruby library for interacting with shapes. So far, only triangles are supported, but maybe more will come later.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'shape_up'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install shape_up

## Usage

There will eventually be a simple command-line utility useful for very basic operations, but for now the library can only be used in `irb` or in some other Ruby code.

To get started with the ShapeUp shapes library do the following:

```ruby
require 'shape_up'
```

This isn't strictly required, but it makes working with shapes a whole lot easier:

```ruby
include ShapeUp::Shapes
```

From here, the Triangle class provides most of the useful capabilities of this library:

```ruby
triangle = Triangle.new(3, 4, 5)
triangle.right?           # => true
triangle.oblique?         # => false
triangle.obtuse?          # => false
triangle.acute?           # => false
triangle.scalene?         # => true
triangle.equilateral?     # => false
triangle.isosceles?       # => false
triangle.angle_a          # => #<ShapeUp::Angle:0x007f8ce2025f5...
triangle.angle_a.degrees  # => 36.8698976458
triangle.angle_a.radians  # => 0.6435011088
triangle.side_c           # => #<ShapeUp::Side:0x009e6fe21354d...
triangle.side_c.length    # => 5
triangle.side_c.altitude  # => 2.4
triangle.area             # => 6.0
triangle.perimeter        # => 12
triangle.semiperimeter    # => 6.0
triangle.inradius         # => 1.0
```

Triangle values default to a precision of 10 decimal places, though this can be overridden, even on an existing Triangle:

```ruby
# Change an existing Triangle's precision
less_precise = triangle.to_precision(6)
less_precise.angle_a.degrees # => 36.869898
more_precise = triangle.to_precision(12)
more_precise.angle_a.degrees # => 36.869897645844

# Set a Triangle's precision on creation
#  Note that _more_ precision can lead to unusual rounding errors
special_right = Triangle.new(1, 1, Math.sqrt(2), precision: 13)
special_right.side_c.length  # => 1.4142135623731
```

Triangles can also be split by bisecting an angle by its label:

```ruby
triangle.angle_c.degrees                # => 90.0
abd, acd = triangle.bisect_on_angle(:c)
abd.area                                # => 2.5714285714
acd.area                                # => 3.4285714286
triangle.area == (abd.area + acd.area)  # => true
abd.angle_a.degrees                     # => 45.0
# This is the length of the bisector
abd.side_c.length                       # => 2.4243661069
acd.side_c.length                       # => 2.4243661069
```

Triangles can also be compared:

```ruby
other = Triangle.new(9, 12, 15)
triangle.similar? other   # => true
triangle.congruent? other # => false
```

## Development

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

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

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jgnagy/shape_up.

## License

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

gha_language: Ruby


text:
# abr-viewer
Photoshop brushes (*.abr files) viewer.

1. Run AbrViewer.exe
2. Click "Open folder..." and choose your folder with brushes (containing *.abr files)
3. Explore brushes, delete unwanted with "Delete" key

Also, you can start application with command line argument specifying path to folder or file to explore:
```
AbrViewer.exe d:\my-brushes
```
or
```
AbrViewer.exe d:\my-brushes\test.abr
```

license: Unlicense

repository: alex-kabin/abr-viewer

repo_name: alex-kabin/abr-viewer


text:
---
layout: post
title: Week Eight
---

What did you do this past week?
This week we read a paper on the Interface Segregation Principle which states that objects should not inherit interfaces that they do not use. In class we discussed our third project which involves simulating a heap and discussed Allocating objects on the heap. Outside of oop we finished our inverted pendulum project in Cyberphysical Systems, I had my second chem exam, and I graded Assignment 5 for CS312.

What's in your way?
I have not started on Project 3 or looked at any of the materials for the next week of class. Also since this week is spring break I need to make sure to go over what we have discussed in class before the next quiz and I probably will not remember a lot of it. Also I always find it difficult to find time or motivation to work over breaks but I need to get stuff done this next week.

What will you do next week?
Since this week is Spring Break there isn't a lot I have to do but doing some stuff will make the coming weeks easier. Project three is due the week after Spring Break so I need to get started on it this week and I also should go ahead and read the paper on The Dependence Inversion Principle.

What's my experience of the class?
I did well on the first quiz this week but I missed a question on the second since I didn't think about the fact that the new keyword allocates objects on the heap. Project Three sounds interesting and Downing did a good job explaining it.

What's my pick-of-the-week or tip-of-the-week?
Have some free time during Spring Break but don't feel like doing homework? Well Spring Break is the perfect time to work on a personal project. Take some time a learn a new technology or work on something that you have been wanting to work on. I'm going to spend some time trying out some of the features introduced in newer versions of Unity


text:
# install-peers-cli

CLI to install project's peerDependencies, without side effects.
Works with `npm`, `yarn`. Supports yarn workspaces flow.

## Install

### yarn

```
$ yarn add --dev install-peers-cli
```
### npm

```
$ npm install --save-dev install-peers-cli
```

## Usage

Add package.json script:

```
{
  "scripts": {
    "install-peers": "install-peers"
  }
}
```

Then run `yarn install-peers` (or `npm run install-peers`) to install `peer` dependencies of your project. It won't update lock files or modify package.json, keeping your setup pure and clean. Any other lifecycle script could be used depending on your use case.

_You still may see "unmet peer dependency" warnings during regular install phase, due to installation flow of npm/yarn._

## License

Install-Peers-CLI is released under the MIT license.

repository: iERP-ai/install-peers-cli

repo_name: iERP-ai/install-peers-cli


text:
---
title: Marathon Integration
tags: [integrations list]
permalink: marathon.html
summary: Learn about the Wavefront Marathon Integration.
---
## Marathon Integration

Marathon is a container orchestration platform for the Mesosphere Datacenter Operating System (DC/OS) and Apache Mesos.
This integration installs and configures Telegraf to send Marathon metrics into Wavefront. Telegraf is a light-weight server process capable of collecting, processing, aggregating, and sending metrics to a [Wavefront proxy](https://docs.wavefront.com/proxies.html).

In addition to setting up the metrics flow, this integration also installs a dashboard. Here are the **Overview** and **Task Processing** sections of a dashboard displaying Mesos cluster metrics:
{% include image.md src="images/marathon_dashboard.png" width="80" %}

To see a list of the metrics for this integration, select the integration from <https://github.com/influxdata/telegraf/tree/master/plugins/inputs>.
## Marathon Setup

### Step 1. Install the Telegraf Agent

This integration uses the HTTP input plugin for Telegraf to extract metrics from Marathon.

Log in to your Wavefront instance and follow the instructions in the **Setup** tab to install Telegraf and a Wavefront proxy in your environment. If a proxy is already running in your environment, you can select that proxy and the Telegraf install command connects with that proxy. Sign up for a [free trial](http://wavefront.com/sign-up/?utm_source=docs.vmware.com&utm_medium=referral&utm_campaign=docs-front-page){:target="_blank" rel="noopenner noreferrer"} to check it out!

### Step 2. Enable the HTTP input plugin

Create a `marathon.conf` file in `/etc/telegraf/telegraf.d` and add the following snippet:
{% raw %}
   ```
       [[inputs.http]]
       ## One or more URLs from which to read formatted metrics
       urls = [
           "http://<mesos_leader_ip>:8080/metrics",
           "http://<mesos_leader_ip>:8080/v2/tasks",
           "http://<mesos_leader_ip>:8080/v2/queue",
           "http://<mesos_leader_ip>:8080/v2/deployments",
       ]
       data_format = "json"
       name_prefix = "marathon."
   ```
{% endraw %}

### Step 3. Restart Telegraf

Run `sudo service telegraf restart` to restart your Telegraf agent.

repository: srujann/docs

repo_name: srujann/docs


text:
---
layout: example
image: gallery-00.jpg
title: "Complex Suraces with Specular Highlights"
---

VisIt readily computes and renders complex surfaces such as the one shown
in the featured visualization. Note the use of specular lighting to highlight
curved features on the surface.

repository: visit-dav/visit-website

branch_name: refs/heads/gh-pages

gha_language: JavaScript

repo_name: visit-dav/visit-website


text:
## Get Set Up
1.  Log into the **Student** account with the password +++Pa55w.rd+++
2.  Start Visual Studio Code. When it opens, you should see the MSLEARN-AI900 project on the left-hand panel.
3.  We will pull the latest version of the project. In the open terminal type +++getfiles.cmd+++ and press **enter**. This command pulls the latest version of the project to your folder.
4.  Once the command runs, you can close the terminal panel. Now you can begin the lab.

url: https://raw.githubusercontent.com/AmjadMKhan/mslearn-ai900/304a5faf389ce879b5fb6c2466a3e3583ff2386c/lab_docs/00 - Pull latest files.md

path: /lab_docs/00 - Pull latest files.md

filename: 00 - Pull latest files.md


text:
# Clean Code

- [Clean Code](#clean-code)
  - [Swapping Values In Two Variables](#swapping-values-in-two-variables)
  - [Convert String to Number](#convert-string-to-number)
  - [Substitute A Variable Inside A String](#substitute-a-variable-inside-a-string)
  - [Optional Chaining](#optional-chaining)
  - [Creating Copy Of An Array](#creating-copy-of-an-array)
    - [Split A String Into An Array](#split-a-string-into-an-array)
    - [Remove Duplicate Values From An Array](#remove-duplicate-values-from-an-array)
  - [Single Line If-Else Condition Check](#single-line-if-else-condition-check)
  - [Check If Object Is Empty using `jQuery.isEmptyObject()`](#check-if-object-is-empty-using-jqueryisemptyobject)
  - [Shuffle an Array / Randomize an Array](#shuffle-an-array--randomize-an-array)

## Swapping Values In Two Variables

The basic way for Swapping value in two variable can be

```javascript
let a = 10;
let b = 20;
console.log(a, b);
// Output: 10 20
// Now lets swap value for a with b
let temp = a;
a = b;
b = temp;
console.log(a, b);
// Output: 20 10
```

But there is another one liner code to do the same

```javascript
let a = 10;
let b = 20;
console.log(a, b);
// Output: 10 20
// Now lets swap value for a with b
[a,b]=[b,a];
console.log(a, b);
// Output: 20 10
```

---

## Convert String to Number

Basic Way

```javascript
let str = "90";
let num = parseInt(str)
console.log(typeof num);
// Output: number
console.log(num);
// Output: 90
```

Short Code Way

```javascript
let str = "90";
let num = +str
console.log(typeof num);
// Output: number
console.log(num);
// Output: 90
```

---

## Substitute A Variable Inside A String

Basic Way

```javascript
let score = 100;
let subject = "Physics"
let message = "I scored " + score + " marks in " + subject + " in my exam";
console.log(message);
// Output: I scored 100 marks in Physics in my exam
```

Better Way is to use ` backticks to define a string and insert the variable name between ${}

```javascript
let score = 100;
let subject = "Physics"
let message = `I scored ${score} marks in ${subject} in my exam`;
console.log(message);
// Output: I scored 100 marks in Physics in my exam
```

---

## Optional Chaining

Lets consider an example: You have a data with nested properties i.e `data` has `prop1` which has `subprop1` which has `subsubprop1`. Now if you want to access `subsubprop1` you can do it like this `data.prop1.subprop1.subsubprop1`. But there is one issue, if left unchecked, you might get an error `somegivenproperty is not defined`. So to avoid this we have to check for undefined data. Basic way to do so is as follows

```javascript
let extractedData
if (data && data.prop1 && data.prop1.subprop1 && data.prop1.subprop1.subsubprop1) {
  extractedData = data.prop1.subprop1.subsubprop1;
}
```

Now above same can be done in simpler way - Using `?.` you can read the value of a property located deep within a chain of connected objects without having to expressly validate that each reference in the chain is valid

```javascript
let extractedData = data?.prop1?.subprop1?.subsubprop1;
```

---

## Creating Copy Of An Array

`arr1 = arr2` will never create a copy. They still point to the same values. So if you change value in one array it will get reflected in another array. So better way is to use `[...]`. For Example

```javascript
let arr1 = [1,2,3];
let arr2 = [...arr1];
let notacopy = arr1;

// Lets change value of arr1
arr1[1] = 90;

// Lets print all arrays
console.log(arr1);
// Output: [1, 90, 3]
console.log(arr2);
// Output: [1, 2, 3]
console.log(notacopy);
// Output: [1, 90, 3]
```

### Split A String Into An Array

You can also use `[...]` to Split A String Into An Array

```javascript
let string = "ABCDA";
let arr = [...string];
console.log(arr);
// Output: ["A", "B", "C", "D", "A"]
```

### Remove Duplicate Values From An Array

You can also use `[...]` and `new Set()` to Remove Duplicate Values From An Array

```javascript
let duparr = [1,1,1,1,2,2,2,3,3,3,3,4,5];
let uniquearr = [...new Set(duparr)];
console.log(uniquearr);
// Output: [1, 2, 3, 4, 5]
```

---

## Single Line If-Else Condition Check

Basic Code Example

```javascript
let age = 25
if (age > 18) {
  console.log("Can Play Cyberpunk");
} else {
  console.log("Not Suitable To Play Cyberpunk");
}
// Output: Can Play Cyberpunk
```

Short Code Example For Above Example

```javascript
let age = 25
age > 18 ? console.log("Can Play Cyberpunk") : console.log("Not Suitable To Play Cyberpunk");
// Output: Can Play Cyberpunk
```

## Check If Object Is Empty using `jQuery.isEmptyObject()`

You can use `jQuery.isEmptyObject()` to Check to see if an object is empty (contains no enumerable properties).

```javascript
jQuery.isEmptyObject({}); // true
jQuery.isEmptyObject({ foo: "bar" }); // false
jQuery.isEmptyObject(""); // true
jQuery.isEmptyObject("Akash"); // false
```

## Shuffle an Array / Randomize an Array

Below `shuffle()` function can help you randomize/shuffle the array.

```javascript
// shuffle function to shuffle the input array
function shuffle(array) {
    return array.sort(() => Math.random() - 0.5);
}
let sample = [1,2,3,4,5];
console.log(shuffle(sample));
// Output: [3, 2, 1, 4, 5]
```

repository: aasisodiya/WebProjects

repo_name: aasisodiya/WebProjects


text:
---
id: movie_mcan
sidebar_label: Movie+MCAN (VQA 2020 Winner)
title: MoViE+MCAN (VQA 2020 Challenge Winner)
---

This is a tutorial for running the MoViE+MCAN model which won the VQA Challenge at CVPR 2020. The winning team comprised of Nguyen, D. K., Jiang, H., Goswami, V., Yu. L. & Chen, X. MoViE+MCAN model is derived from the following papers, and is released under the MMF. Please cite both these papers if you use the model or the grid features used to train this model in your work:

* Nguyen, D. K., Goswami, V., & Chen, X. (2020). *Revisiting Modulated Convolutions for Visual Counting and Beyond*. arXiv preprint arXiv:2004.11883. ([arXiV](https://arxiv.org/abs/2004.11883))
```
@article{nguyen2020revisiting,
  title={Revisiting Modulated Convolutions for Visual Counting and Beyond},
  author={Nguyen, Duy-Kien and Goswami, Vedanuj and Chen, Xinlei},
  journal={arXiv preprint arXiv:2004.11883},
  year={2020}
}
```

and

* Jiang, H., Misra, I., Rohrbach, M., Learned-Miller, E., & Chen, X. (2020). *In Defense of Grid Features for Visual Question Answering*. arXiv preprint arXiv:2001.03615. ([arXiV](https://arxiv.org/abs/2001.03615))
```
@article{jiang2020defense,
  title={In Defense of Grid Features for Visual Question Answering},
  author={Jiang, Huaizu and Misra, Ishan and Rohrbach, Marcus and Learned-Miller, Erik and Chen, Xinlei},
  journal={arXiv preprint arXiv:2001.03615},
  year={2020}
}
```

## Installation

Install MMF following the [installation guide](https://mmf.sh/docs/getting_started/installation/).

## Data Setup

Annotations and features for VQA2.0 and VisualGenome will be automatically downloaded. The grid image features were extracted using the models trained in this [repo](https://github.com/facebookresearch/grid-feats-vqa). Other variants of features data available in that [repo](https://github.com/facebookresearch/grid-feats-vqa) can also be used.

## Training and Evaluation

To train MoViE+MCAN model on the VQA2.0 + Visual Genome dataset, run:

```bash
mmf_run config=projects/movie_mcan/configs/vqa2/defaults.yaml \
    model=movie_mcan \
    dataset=vqa2 \
    run_type=train
```

this will save the trained model `movie_mcan_final.pth` in your `./save` directory for the experiment.

To evaluate the trained model on the VQA2.0 val set, run:

```bash
mmf_run config=projects/movie_mcan/configs/vqa2/defaults.yaml \
    model=movie_mcan \
    dataset=vqa2 \
    run_type=val \
    checkpoint.resume_file=<path_to_trained_pth_file>
```

## Inference Prediction for Eval AI Submission

To generate the vqa prediction file for Eval AI submission on `test-dev`, run:

```bash
mmf_predict config=projects/movie_mcan/configs/vqa2/defaults.yaml \
    model=movie_mcan \
    dataset=vqa2 \
    run_type=test \
    checkpoint.resume_file=<path_to_trained_pth_file>
```

## Pretrained model

| Datasets | Config File | Pretrained Model Key | Metrics | Notes |
| --- | --- | --- | --- | --- |
| VQA2.0 (`vqa2`) | `projects/movie_mcan/configs/vqa2/defaults.yaml` | `movie_mcan.grid.vqa2_vg` | testdev accuracy - 73.92% | Uses Visual Genome as extra data |

To generate predictions with the pretrained MoViE+MCAN model on VQA2.0 `test-dev` set (assuming that the pretrained model that you are evaluating is `movie_mcan.grid.vqa2_vg`), run:

```bash
mmf_predict config=projects/movie_mcan/configs/vqa2/defaults.yaml \
  dataset=vqa2 \
  model=movie_mcan \
  run_type=test \
  checkpoint.resume_zoo=movie_mcan.grid.vqa2_vg
```

:::tip

Follow [checkpointing](https://mmf.sh/docs/tutorials/checkpointing) tutorial to understand more fine-grained details of checkpoint, loading and resuming in MMF

:::

repository: fdsig/Transformer-MM-Explainability

repo_name: fdsig/Transformer-MM-Explainability


text:
# SharePoint 2010: Creating a .NET Connectivity Assembly for BCS
## Requires
* Visual Studio 2010
## License
* Apache License, Version 2.0
## Technologies
* SharePoint 2010
* Business Connectivity Services
## Topics
* .NET Framework connectivity assembly
## IsPublished
* True
## ModifiedDate
* 2011-08-09 03:06:57
## Description

Introduction

Learn how to create a Microsoft .NET Framework connectivity assembly for Microsoft Business Connectivity Services (BCS) by using Microsoft Visual Studio 2010. This sample accompanies the article
Creating a .NET Connectivity Assembly for Business Connectivity Services by Using Visual Studio 2010 in the MSDN Library.

Description

Visual Studio 2010 provides a project type that developers can use to build .NET Framework connectivity assemblies for Business Connectivity Services.

This sample and the accompanying article show how to create a .NET Framework connectivity assembly for Business Connectivity Services by using the following steps:

Create the Business Data Connectivity model.

Define type descriptors for the ReadItem and ReadList methods.

Create additional data operation methods.

Implement the data operation methods with code.

Add permission on the new entity.

Set up and use external lists in Microsoft SharePoint 2010.

Review changes to the back-end data repository.

In this example, you create a BDC model that uses BCS entities in Visual Studio to access a "Training" matrix in Microsoft SQL Server. The matrix consists of a many-to-many relationship between People and the Courses that those people have attended or that
 they are scheduled to attend. The solution includes adding, updating, and deleting entities that comprise several database tables.

repository: techbuzzz/Samples-archive-msdn-products

path: /Microsoft Office Developer Documentation Team/SharePoint-2010-Creating-a-NET-Connectivity-4143/Readme.md

repo_name: techbuzzz/Samples-archive-msdn-products


text:
---
layout: post
title: "Reflecting on one year of designing for Parkinson's research"
date: 2021-01-28 20:19:12 -0400
categories: jekyll update
excerpt: "Helping Parkinson’s researchers and patients track progression of the disease"
image: "zoom.png"
---

![Presentation screenshot](/assets/images/blackfynn/collage.png){:class="full-width add-margin"}

After 4 years designing products to help college students find jobs, I joined Blackfynn to apply my experience to an entirely different problem space: Parkinson’s Disease research.

I quickly realized just how much I had to learn about this new industry when I was introduced to my first project:

“Your first project is going to be updating our LEDD ConMed Log so that researchers can collect a standard calculated daily dose of levodopa equivalent medication for each patient by providing a curated list of medications like carbidopa/levodopa, amantadine, benzotropine, etc.”

That project kicked off a great year at Blackfynn. I learned about a brand new problem space, applied my past experience to a new team, and continued to expand my skillset as a designer. While I worked on many projects, I’ve highlighted three of my favorites below.

## Correcting my assumptions about how people with Parkinson’s Disease experience technology

![Presentation screenshot](/assets/images/blackfynn/user-testing.gif){:class="pop-out-width shadow add-margin"}
![Presentation screenshot](/assets/images/blackfynn/user-testing-blobs.png){:class="pop-out-width add-margin"}
One of my favorite projects I worked on last summer was designing a platform to engage up to 500,000 people in a digital Parkinson’s study.

I went into this project with a goal of prioritizing accessibility. Among other ideas, I assumed that minimizing scrolling would be helpful for people with Parkinson’s who experience a tremor in their hands.

### By building prototypes and user testing with actual users, I learned that my assumptions were incorrect.

The core functionality for this digital health study platform was a set of multiple-choice surveys that participants would fill out every three months.

I assumed that navigating between questions by clicking a button would be easier for our users than scrolling between questions. To test this hypothesis, I built 2 prototypes in React and observed 6 users who tried out both options. One version allowed users to advance between questions by clicking a “Next” button, while the other allowed them to scroll to advance.

(I chose to use React instead of a more basic design tool to allow participants to select and possible answer and preserve their state. That would have been almost impossible to do in Figma.)

![Presentation screenshot](/assets/images/blackfynn/user-quotes.png){:class="pop-out-width add-margin"}

### Some of our assumptions about accessibility were helpful, others caused frustration.

One thing we got right: Larger fonts and tap targets helped all participants use the product. Many participants specifically mentioned how much easier it was to use compared to other apps and websites they use today.

One thing we got wrong: Presenting one question at a time frustrated many participants. Constantly clicking “Next” felt unnecessary for many users and also made it challenging to go back and reference previous questions and answers since they couldn’t just scroll back up.

One additional insight: Having a tremor doesn’t automatically mean it’s hard for a participant to scroll. For example, one participant showed us that scrolling with their thumb while holding their phone was much easier than scrolling on an iPad perched on a table.

### We corrected our assumptions and gained valuable insights for future projects

Conducting these user tests helped me check my assumptions about how to design products for people with Parkinson’s. I realized that constraining an experience to minimize scrolling was based on a bad assumption. Instead, we needed to acknowledge that scrolling could result in a few mis-taps here and there and we needed to make it easy for participants to check and adjust their responses.

While this project has been de-prioritized for the time being, we’ve been incorporating these insights into other participant-focused features and have continued to test our assumptions with additional user testing sessions.

## Improving design quality and engineering handoff with a Figma component library

![Presentation screenshot](/assets/images/blackfynn/figma-library.png){:class="full-width add-margin"}

In addition to tackling core product projects, I worked on a variety of design process and tooling improvements. One of those improvements – establishing and maintaining our component library in Figma – has been a highlight of my time at Blackfynn.

### Our design and engineering collaboration had some pain-points;  Figma was the solution.

When I joined Blackfynn we were using a combination of Adobe Xd and Abstract to manage and share design files. This setup had a few issues, including styles and patterns that unintentionally varied between projects and files. This inconsistency caused confusion about what the current version was and whether the inconsistency was intentional.

![Presentation screenshot](/assets/images/blackfynn/audit-example.png){:class="pop-out-width add-margin"}

When I was at Handshake, we solved this issue by using Figma’s component and style libraries. I worked with the team at Blackfynn to try out Figma and solve this problem by setting up a global style and component library as the source of truth in all design files going forward.

### This library has already helped us create consistent, high quality designs, sped up our ability to produce mock ups, and improved engineering collaboration.

Now all of our projects reference this global style library and this library matches the styles of Vue.js components our engineering team uses. It’s cut down on a lot of confusion and created a consistent, high-quality product.

### We supplement our design system with opportunities for exploration and evolution

![Presentation screenshot](/assets/images/blackfynn/digital-critique.png){:class="pop-out-width add-margin"}

When I was at Handshake, our design system was treated like a source of truth that should be followed at all times, leaving little room for evolution or exploration. At times, this got in the way of delivering the best experience for our users.

At Blackfynn, we set different expectations. We encourage exploration through activities like sketching before evaluating if our current system best serves our solutions. Sometimes we stick to the system and quickly deliver results. Other times, we expand the system and invest some extra time to best tackle new use cases.

## Expanding my skillset while evolving our illustration style

![Presentation screenshot](/assets/images/blackfynn/illustrations.png){:class="pop-out-width add-margin"}

My favorite new skill I developed over the last year was illustration. Our illustration system was limited to small spot illustrations and didn’t solve for medium sized promotional content. I got to try my hand at illustration and evolve our system.

### This was a great opportunity for to learn from peers and invest in my skills

![Presentation screenshot](/assets/images/blackfynn/illustration-explorations.png){:class="full-width"}

Working with the design team, I created moodboards for our styles, set some initial guidelines, and then started exploring. I used Procreate and Illustrator to explore a few different visual styles, and refined my approach after gathering feedback from the team.

### We now have an illustration system that provides more depth while still maintaining our brand values.

![Presentation screenshot](/assets/images/blackfynn/illustration-template.png){:class="pop-out-width shadow add-margin"}

As part of this project, I documented my approach and created templates for the team to use in future illustrations. In a sense, I re-applied some of my design system principles to illustration to make it easy for any member of the design team to create their own assets and expand the system.

## I’m grateful for the opportunity to share my experience, grow as a designer, and contribute to the Parkinson’s research community

The past year has been incredibly rewarding. I learned about a brand new problem space, applied my past experience to a new team, and continued to expand my skillset as a designer.

In 2021 I’m looking forward to another opportunity to tackle a new set of challenges with a new team. If you’re hiring or if you want to work together on a project, feel free to reach out! I’d love to chat!

gha_language: SCSS


text:
# angularjs-virtual-keyboard
An angular js directive implementation of Mottie Keyboard Library

## Getting Started

Import the angularjs-virtual-keyboard.js and angularKeyboard.css files in your page

Include the module ng-virtual-keyboard in your angular app.

Pass to keyboard directive an input field id, with an optional configuration (you can find options doc at mottie keyboard page

### Dependencies

Jquery

Jquery UI (draggable)

Mottie keyboard

Font awesome icons

### Example
You can find an example in src folder

### Installation
You can install it using npm

## Contributing

Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.

## Authors

* **Andrea Di Blasi** - *Initial work*

## License

This project is licensed under the MIT License

repository: Adibla/angularjs-virtual-keyboard

repo_name: Adibla/angularjs-virtual-keyboard


text:
# Employee Content Management System (CMS)

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Description

Express.js / Node.js / mySQL application allowing a user to control an employee database of Departments, Roles, Managers, and Salaries.

## Table Of Contents

- [Video](#video)
- [Installation](#installation)
- [Usage](#usage)
- [Built Using](#built)
- [License](#license)
- [Contribution](#contribution)
- [Tests](#tests)
- [Questions](#questions)

## Video

- [View video Demo](https://drive.google.com/file/d/1BZNu-U7wr0QcwgEKdHiDxR1ZoVBr2jfG/view?usp=sharing)

## Installation

- To install locally, clone the respository
  - run `npm install` to download dependencies
  - `cd` to the cloned directory and run `npm start`
    - localhost:3001 will be utilized, and page can be viewed in a web browser

## Usage

- Presented with a main menu, your options are:
  - View all departments
    - Presented with table showing `id`, `name`, and `number of department roles`
  - View all roles
    - Presented with table showing `id`, `role_title`, `department`, `salary`, and `employee count` within each departments
  - View all employees
    - Presented with table showing `id`, `name`, `job_title`, `department`, `salary`, and `manager` ( derived from same employee list )
  - Add a department
    - Create a new department by name
  - Add a role
    - Create a new role
      - Child of a department
      - Defined salary
  - Add an employee
    - Create new employee
      - Child of a role
      - Can be assigned manager (from list of employees)
  - Update an employee role
    - Select an employee from the list, and choose a new role
  - Update an employee manager
    - Select an employee from the list, and choose a new manager
  - View employees by manager
    - Select a manager from the list (an employee who has > 0 employees who report to them)
    - Presented with a table listing the employees who report to the selected manager
  - View employees by departments
    - Select a department from the list
    - Presented with a table listing the employees who are assigned the selected role
  - View departmental salary budget
    - Presented with a table that shows each department, and the allocated salary (based on the employees and roles currently assigned)
  - Delete a department
    - Delete a department from the list
      - Will cascase to role
  - Delete a role
    - Delete a role from the list
  - Delete an employee
    - Delete an employee

## Built

- [Node.js](https://nodejs.org/en/)
- [Inquirer](https://www.npmjs.com/package/inquirer)
- [mySQL2](https://www.npmjs.com/package/mysql2)
- [console.table](https://www.npmjs.com/package/console.table)

## License

This application is covered under the [MIT](https://opensource.org/licenses/MIT) license.

## Contribution

- There is no contribution required for this project

## Tests

- There are no tests for this project

## Questions

Please feel free to contact me regarding any further questions:

- [GitHub Profile](https://github.com/PrimalOrB)
- [Email<EMAIL_ADDRESS>


text:
# Multiline Clamp

[![license][license]][license-url]
[![fossa][fossa]][fossa-url]
[![gzipped size][gzip]](#no-link)
[![dev deps][dev-deps]][dev-deps-url]
[![build status][travis]][travis-url]
[![npm][npm]][npm-url]
[![jsDelivr][jsdelivr]][jsdelivr-url]

_An lightweight and performance-minded library that minipulates DOM content in a respectful and transparent manor._

Even in the modern age of browsers, technologies and API's alike; we still don't have a full-proof method that enables a designers vision when they show off some cool multiline text with an ellipsis at the end. I needed a solution for a project that not only allowed me to clamp text over multiple lines but also over multiple breakpoints too.

Looking around the web I found a couple of decent libraries but nothing that has decent breakpoint support out-of-the-box.

## So How Does It Work?

_Good question!_

Rather than calculating positions, widths etc., my solution is allowing a developer to specifically define how many characters should be displayed before a clamp is applied. This solution also takes HTML elements into account which can break the clamp entitely, so instead I also allow a configurable regular expression to be defined which automatically strips elements out if they are at the end which has the added benifit of not destroying the original intention of the text.

## Browser Support
I don't claim to have 100% browser support but if you find an issue please [create one](https://github.com/cshawaus/multiline-clamp/issues/new) and I'll try and get to it.

![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) |
--- | --- | --- | --- | --- | --- |
Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 10+ ✔ |

## Installation

Using npm:

```bash
$ npm install multiline-clamp --save
```

Using Yarn:

```bash
$ yarn add multiline-clamp
```

Using CDN:

```html
<!-- jsDelivr -->
<script src="https://cdn.jsdelivr.net/npm/multiline-clamp/dist/multiline-clamp.min.js"></script>

<!-- unpkg -->
<script src="https://unpkg.com/multiline-clamp/dist/multiline-clamp.min.js"></script>
```

## Usage

If you are using a tool such as Webpack or Rollup, you may use ES6 or CommonJS imports which expose the `MultilineClamp` class.

```js
var MultilineClamp = require('multiline-clamp');
```

```js
import MultilineClamp from 'multiline-clamp';
```

## Example

Getting set up is quick and simple, simply define the element you wish to clamp on your page and you're good to go.

```js
new MultilineClamp(document.querySelector('p'))
```

### Bind to a `NodeList`
There may also come a time when you need to bind a clamp to many targets, this can be accomplished by passing a collection to the constructor.

```js
new MultilineClamp(document.querySelectorAll('p'))
```

### Responsive
You can also define per breakpoint clamps for any resolution you choose. This can be done by setting the `responsive` property which accepts an object.

```js
new MultilineClamp(document.querySelector('p'), {
  responsive: {
    768: 50,
    480: 30
  }
})
```

## API

### `MultilineClamp(target, options)`

    parameter
    description

    target

      Type: Element, NodeList

      Required: Yes

    options

      Type: Object

      Default: {}

      Required: No

      Please see the options list below for a complete list.

## Options

### `clamp`
`string | element`, defaults to `...`.

A string or element that is appended after the clamped content. When using an element you can simply pass the `HTMLElement` node as the value.

### `clampSize`
`number`, defaults to `72`.

The number of characters that should appear before the ellipsis.

### `partialTags`
`string`, defaults to `complete`.

Defines how partial/invalid tags are handled when found in a clamped string. Valid values are:

- `complete` — Completes the partial tag by restoring the closing end of the tag _(only works for partial closing tags)_
- `pull` — Pulls the clamp back to just before the tag, this strips all content within it
- `pull-and-retain` — Removes the tag but retains any content that was within it

### `responsive`
`boolean | { [number]: number }`, defaults to `false`.

Allows an object of clamps to be defined for different breakpoints. Please see the example above.

### `tagsExpression`
`expression`, defaults to `/<(.|\n)*?>/g`.

Regular expression for matching certain tags within the content.

### `trimWhitespace`
`boolean | expression`, defaults to `true`.

Defines whether the whitespace before/after the content should be stripped out. `false` disables this functionality, setting a regular expression allows more finite control over how the spaces are handled.

## Performance

I am constantly trying new ways to improve the performance of _Multiline Clamp_ through the use of modern API's but it's not possible to promise your result will match mine. Through my testing in Google Chrome and Firefox, performance exceeds my expectations with a respectful amount of elements on the page.

If you have ideas for improving my implementation feel free to make a pull request.

## Todo

* _Ignore tags in the clamping process_, this will ensure the correct clamp size is maintained instead of counting tags which can increase/decrease the amount of content left

## Resources

* [Changelog](https://github.com/cshawaus/multiline-clamp/blob/master/CHANGELOG.md)

## License

MIT

[gzip]: https://badges.herokuapp.com/size/github/cshawaus/multiline-clamp/master/dist/multiline-clamp.min.js?gzip=true&label=gzipped%20size

[license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=rounded
[license-url]: https://github.com/cshawaus/multiline-clamp/blob/master/LICENSE

[fossa]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Fcshawaus%2Fmultiline-clamp.svg?type=shield
[fossa-url]: https://app.fossa.io/projects/git%2Bgithub.com%2Fcshawaus%2Fmultiline-clamp?ref=badge_shield

[travis]: https://api.travis-ci.org/cshawaus/multiline-clamp.svg
[travis-url]: https://travis-ci.org/cshawaus/multiline-clamp

[npm]: https://img.shields.io/npm/v/multiline-clamp.svg
[npm-url]: https://www.npmjs.com/package/multiline-clamp

[jsdelivr]: https://data.jsdelivr.com/v1/package/npm/multiline-clamp/badge?style=rounded
[jsdelivr-url]: https://www.jsdelivr.com/package/npm/multiline-clamp

[dev-deps]: https://david-dm.org/cshawaus/multiline-clamp/dev-status.svg?theme=shields.io
[dev-deps-url]: https://david-dm.org/cshawaus/multiline-clamp?type=dev

repository: cshawaus/multiline-clamp

repo_name: cshawaus/multiline-clamp


text:
---
layout: post
title: What I Need in a PHP Framework
---

Most PHP frameworks provide a common set of capabilities to help developers build good applications more quickly.  They often include the following.

* A database abstraction.
* A request and response abstraction.
* A templating system or method to use existing templating system.
* MVC-orientation.
* HTML Form abstractions.
* Filters.

Those are all pretty simple (not easy, but in contrast to complex) to design and implement for an experienced software developer.  While highly useful, they don't address directly the things which are actually hard to get right or are complex.

These hard or complex areas of functionality require a great deal of depth and breadth of experience to get right.  Their best practices are developed not by one guru, but by an entire community of people.  The best example is security.  Security can be broken down into quite a few major sub-categories, which in itself begins to show just how hard an area it is to get right.

There's encryption of data, user authentication, user authorization, CSRF defense, XSS defense, SQL injection defense, and probably a lot more -- precisely showing my personal lack of expertise in this area.

Database abstractions (above) often provide a good deal of SQL injection defense.  Often HTML form abstractions (above as well) improve upon that, and also provide CSRF defense capabilities.  But not always.

Thus a truly useful and powerful PHP web framework would attempt to provide maximal help in solving the hard problems.  The expertise of many people in an open-source community building a framework is more likely to solve hard problems correctly.

Using such a framework would greatly benefit a web application development team.  The application team is required to have business domain knowledge to implement their solutions, in addition to their technical skills.  They have limited mental bandwidth to be expert at everything.  Just as one should probably not write one's own encryption algorithm, one should probably not write one's own suite of web security routines.

I want to find a PHP web framework which helps me use best practices for the hard problems:  for security, authentication, session management, caching, and perhaps others.  A good DB abstraction, SQL builder or HTML form builder would be nice.  But if most senior developers had to, they could build decent versions of those from scratch.  That's not true of the hard problems.


text:
Welcome to the "Mükemmel Blog" ⭐

> Backend repository of the Winner of the Selman Kahya's blog website competition.

## Author

👤 **Berkay Çimşir**

* Website: https://mukemmel-blog-frontend.herokuapp.com/
* Twitter: [@berkaycimsir](https://twitter.com/berkaycimsir)
* Github: [@berkaycimsir](https://github.com/berkaycimsir)

## Show your support

Give a ⭐ if this project helped you!

repository: Musti-ysr/mukemmel-blog-backend

repo_name: Musti-ysr/mukemmel-blog-backend


text:
# coastguard

Controller to facilitate network policing on a multi-cluster connected environments (proof-of-concept state)

## setup development environment

You will need docker installed in your system, and at least 8GB of RAM.

## testing

### run e2e testing

e2e testing is currently broken.

### run unit testing

```bash
make unit
```

repository: submariner-io/coastguard

branch_name: refs/heads/devel

gha_language: Go

repo_name: submariner-io/coastguard


text:
---
layout: post
comments: true
title: "Cardboard coffee table"
date: 2016-05-29
---
Today I decided to use what little materials and tools I have to make something.
Making things is good for the soul, and I needed to overcome some of the frustration
caused by the long delivery time for the container from South Africa.

Ikea have graciously provided me with a large supply or reasonably-strong corrugated
cardboard.  I added a cheap, steel ruler and a hot-glue gun to my set of tools, and then
made this little cardboard coffee table.  It might not look like much, but it did me good
to make it.

![Cardboard coffee table](/assets/IMG_20160529_154542.jpg)


text:
# Causal Inference for The Brave and True

![img](./data/img/brave-and-true.png)

A light-hearted yet rigorous approach to learning impact estimation and sensitivity analysis. Everything in Python and with as many memes as I could find.

Part I of the book contains core concepts and models for causal inference. You will learn how to represent causal questions with potential outcome notation, learn about causal graphs, what is bias and how to deal with it. Most of the content here is well established. It's an amalgamation of materials I've found on books, university curriculums and online courses. You can think of Part I as the solid and safe foundation to your causal inquiries.

Part II (WIP) contains modern development and applications of causal inference to the (mostly tech) industry. While Part I focuses mostly on identifying average treatment effects, Part II takes a shift to personalization and heterogeneous effect estimating with CATE models. Most of what is written there was taken from my personal experience and is by no means well established science. It's much more experimental and subject to change, afterall, I, too, am learning.

## Acknowledgments

I like to think of this entire series as a tribute to Joshua Angrist, Alberto Abadie and Christopher Walters for their amazing Econometrics class. Most of the ideas from Part I are taken from their classes at the American Economic Association. Watching them was what kept me sane during the tough year of 2020.
* [Cross-Section Econometrics](https://www.aeaweb.org/conference/cont-ed/2017-webcasts)
* [Mastering Mostly Harmless Econometrics](https://www.aeaweb.org/conference/cont-ed/2020-webcasts)

I'll also like to reference the amazing books from Angrist. They have shown me that Econometrics, or 'Metrics as they call it, is not only extremely useful but also profoundly fun.

* [Mostly Harmless Econometrics](https://www.mostlyharmlesseconometrics.com/)
* [Mastering 'Metrics](https://www.masteringmetrics.com/)

My final reference is Miguel Hernan and Jamie Robins' book. It has been my trustworthy companion in the most thorny causal questions I had to answer.

* [Causal Inference Book](https://www.hsph.harvard.edu/miguel-hernan/causal-inference-book/)

## Contribute

Causal Inference for the Brave and True is an open-source material on causal inference, the statistics of science. It uses only free software, based in Python. Its goal is to be accessible monetarily and intellectually.
If you found this book valuable and you want to support it, please go to [Patreon](https://www.patreon.com/causal_inference_for_the_brave_and_true). If you are not ready to contribute financially, you can also help by fixing typos, suggesting edits or giving feedback on passages you didn't understand. Just go to the book's repository and [open an issue](https://github.com/matheusfacure/python-causality-handbook/issues). Finally, if you liked this content, please share it with others who might find it useful and give it a [star on GitHub](https://github.com/matheusfacure/python-causality-handbook/stargazers).

repository: matheusfacure/python-causality-handbook

gha_language: Jupyter Notebook

repo_name: matheusfacure/python-causality-handbook


text:
---
# *Beehive Monitoring System*

## *Background*

The interior climate of a beehive is vital for a healthy colony and efficient
honey production. A healthy colony will work to strictly regulate the
temperature and humidity of the brood nest (the part of the hive where eggs are
laid and develop). Any deviation from ideal brood nest climate will give the
beekeeper an indication of poor colony health or hive equipment.

## *Objectives*

Design and test a battery-powered sensor solution for reporting the interior
temperature and humidity of a [Langstroth
beehive](https://en.wikipedia.org/wiki/Langstroth_hive). Measured data must be
logged via a wireless connection and can be accessed from any web browser with
internet connection. Power consumption should be as low as possible to prolong
battery life.

## *Bee Space Constraints*

Bee space refers to the dimensions of open space which occur between the combs
and interior walls of a natural beehive (Figure 1). Bee space is commonly said
to be between 4.5 mm and 8.0 mm, which is approximately the gap bees require to
pass freely. Violating bee space (i.e. creating open space with dimensions
greater than 8.0 mm or smaller than 4.5 mm) can cause bees to fill the space
with extra comb, making hive inspection more difficult. Violating bee space may
also provide pests such as the hive beetle to access an area unreachable by
worker bees, allowing the pests to reproduce without intervention.

Figure 1: Bee Space

## *Hardware Design*

To meet the desired functionality, an ESP8266 based embedded sensor solution has
been designed and tested. The entire solution is mounted on a simple laser cut
frame which is sized to sit on top of a standard langstroth super. 12 bit
temperature and humidity samples are provided by a lower power [Silicon Labs
SI7021](https://www.silabs.com/sensors/humidity/si7006-13-20-21-34/device.si7021-a20-gm)
temperature and humidity sensor embedded in a custom 3D printed probe. This
probe is plugged through the frame wall into the back face of the main
electronic enclosure and is suspended over the brood nest frames. The main
enclosure is mounted on the exterior frame surface and with the solar cell. A
[Texas Instruments BQ24210](http://www.ti.com/product/BQ24210) LiPo Charger IC
charges the on board 18650 lithium ion cell via a small 5W solar cell or USB
port. On board debugging and programming is provided with a [Silicon Labs
CP2102N](https://www.silabs.com/interface/usb-bridges/usbxpress) USB to UART
bridge. Charge status LEDs and switches for resetting the device have proven
convenient when debugging and verifying this device.

Figure 2: Laser Cut Frame and Enclosure Assembly

Figure 3: 3D Printed Probe

Figure 4: Assembled PCB


text:
[![Go Report Card](https://goreportcard.com/badge/github.com/jedi91/mob-stor)](https://goreportcard.com/report/github.com/jedi91/mob-stor)  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

# MobStor

Multi-Cloud Object Storage

## Description

Upload to multiple object stores through a single Api.

## Supported Object Stores

* Azure Blob
* AWS S3
* GCP Cloud Storage


text:
# ParticleConnect

[![CI Status](http://img.shields.io/travis/d8915d4c64a5f9654c7e3ca0a00fcac82db05acc/ParticleConnect.svg?style=flat)](https://travis-ci.org/d8915d4c64a5f9654c7e3ca0a00fcac82db05acc/ParticleConnect)
[![Version](https://img.shields.io/cocoapods/v/ParticleConnect.svg?style=flat)](http://cocoapods.org/pods/ParticleConnect)
[![License](https://img.shields.io/cocoapods/l/ParticleConnect.svg?style=flat)](http://cocoapods.org/pods/ParticleConnect)
[![Platform](https://img.shields.io/cocoapods/p/ParticleConnect.svg?style=flat)](http://cocoapods.org/pods/ParticleConnect)

## Example

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

## Requirements

## Installation

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

```ruby
pod 'ParticleConnect'
```

## Author

Mike Kavouras

## License

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

repository: mikekavouras/ParticleConnect

gha_language: Swift

repo_name: mikekavouras/ParticleConnect


text:
Title: Reproducible Python Environments for Science
Date: 2022-05-13
Tags: engineering
Slug: reproducible-python-environments
Author: Pedro Rodriguez

The topic of how to create and maintain reproducible experiments has come up a few times recently.
I've previously discussed ways to do [reproducible hyper parameter sweeps](https://www.pedro.ai/blog/2020/03/24/reproducible-ml-and-parameter-sweeps/) and as part of that briefly discussed using anaconda environments.
This (short) post elaborates on that with what I've learned since then.
I'll break this into two parts: (1) how to manage python installations and (2) how to manage python packages.
The first part will discuss how to actually install python and specify which version of python to use.
The second part will discuss how to define python package versions, assuming the specified python version is active.

## Managing Python Installations

When using python, it is extremely desirable to separate the python system-wide installation from the installation used by your experimental code.
Mixing these to leads to a bad time for various reasons and should be avoided.
The easiest way to accomplish this is to use [Anaconda python](https://www.anaconda.com/products/distribution) or its minimal cousin [miniconda](https://docs.conda.io/en/latest/miniconda.html).
Installing in both cases is as easy as downloading the binary, running `bash downloaded_binary.sh`, and following the instructions.

After this, for every project you should run a command like:

```bash
# Create a new environment
conda create -n mynewenv python=3.9

# When working on project code, activate it
conda activate mynewenv
```

This will let you install packages in that environment without affecting the system python installation or any other installation.
It also makes it incredibly easy to use different python versions for each experiment (e.g., some older code might require older python versions, while newer code requires newer versions).
Let's move to defining python package dependencies now.

## Managing Python Packages

Generally speaking, I've found three ways to manage python package versions:

1. Using [Python Poetry](https://python-poetry.org)
2. Using a hand-crafted conda `environment.yaml` or pip `requirements.txt` file
3. Using `pip freeze` or `conda list --export` to generate `requirements.txt` (or the conda equivalent).

Before discussing why I think poetry is the best option, let's take a step back and outline what we need a package management system to do:

1. It should be easy to fully reproduce an experiment, down to exact package versions, whether that is tomorrow or in three years.
2. It should be easy to add a package as a dependency
3. It should be easy to upgrade package versions

The main problem with solution (2) is that it does not define transitive dependencies, and it is very easy to under-specify required packages.
This is the main reason I avoid this solution in most cases.

The problem with solution (3) is that nothing distinguishes direct project dependencies from transitive dependencies.
Because of this, it is difficult to upgrade package versions.
This also becomes a problem when adding a package that requires the transitive dependency of a direct project dependency to be upgraded.
Since there is no version solver in this case, you have to resolve this manually.
Here is one concrete example: suppose you have package `A` which transitively depends on `B=1.0.*`; then you add `C` which transitively depends on `B>1.0.0,B=1.0.*`.

For this reason I prefer poetry. A poetry configuration will add direct dependencies to `pyproject.toml` and define a complete, exhaustive dependency list in `poetry.lock`.
This site uses this `pyproject.toml` for example:

```toml
[tool.poetry.dependencies]
python = "^3.8"
pelican = "^4.7.2"
pygments = "2.7.4"
typogrify = "2.0.7"
markdown = "3.1.1"
webassets = "0.12.1"
cssmin = "0.2.0"
bibtexparser = "^1.1"
nbconvert = "^5.6.1"
rich = "^10.7.0"
ipython = "^7.13.0"
ipython_genutils = "^0.2.0"
pelican-jupyter = "^0.10.1"
contextfilter = "^0.3.0"
jinja2 = "3.0.3"
pelican-render-math = "^1.0.3"

[tool.poetry.dev-dependencies]
black = "^19.10b0"
pylint = "^2.4.4"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
```

You get best of both worlds, plus an easy way to manage dependencies.
As an added bonus, you get some other nice things like easy ability to `poetry publish` to pypi.

I'll wrap up with a summary of the development flow.

### The Development Flow

1. Create a conda environment like `conda create -n project python=3.9`
2. Activate the environment like `conda activate project`
3. Initiate poetry (one-time) `poetry init`
4. (To Add Packages): `poetry add packagename`
5. (To Upgrade Packages): `poetry update`
6. (To Install everything, e.g., a fresh environment): `poetry install`
7. Commit both `pyproject.toml` and `poetry.lock` to git.

The one last thing I'll mention, is that sometimes there are dependencies that are not `pip` installable for various reasons.
In this case, I resort to a manually and carefully updated conda environment file or documentation.
There are two main cases I've run into this for.
First, the main package I do this for is `altair` which for rendering to PDF requires vega-lite which requires vega which requires the node stack.
In this specific case, I start out with `conda install -c conda-forge vega-cli vega-lite-cli` then figure out what the current version of packages is to pin to.
The second case is needing a specific version of `cuda`, which you can also specify with conda, but can't with pip

Thanks and happy packaging!

### Alternatives

A few alternatives I've seen:

1. [pip-compile](https://modelpredict.com/wht-requirements-txt-is-not-enough): Have not tried, but know someone who likes it.
2. Pipenv: Tried this one time, didn't mesh with my mental model.

### Bonus

Another situation I often find needing to manage changing code is:

1. Code lives in an NFS directory, e.g., on a slurm cluster.
2. I am editing code directly on NFS (e.g., via VS Code Remote Plugin), but am **also** running experiments on the cluster at the same time.
3. So a change while I am editing code could crash or change the behavior of a previously launched experiment.

The only real solution to this is to create a snapshot of the code and having the running experiments use that snapshot.
A while back I created a script to help do exactly this transparently, feel free to steal/adapt for your use case.
In ironic contrast to this post, I simply have its dependencies installed in my base system python...
I saved this as `snapshot`, installed `typer` and `rich`, and put it in my path:

```python
#!/usr/bin/env python
from typing import Optional, List
from pathlib import Path
import random
import shutil
import subprocess
import os
import typer
from rich.console import Console

console = Console()

def main(
    command: str,
    exclude: List[str] = None,
    # CHANGE ME: To where you want to save experiments to.
    base_dir: str = "/checkpoint",
    experiment_id: Optional[str] = None,
    dry_run: bool = False,
):
    """
    This tool helps isolate experiments on NFS by:
    1. Copying the contents of the current directory to another one, keyed either randomly or using a given identifier
    2. Changing the current directory to that new directory
    3. Executing the given command in the new directory

    For example, you can run:
    $ snapshot --experiment-id 42 'echo "my awesome experiment"'
    """
    if dry_run:
        console.log("Running in dry run mode, no changes will be made")
    current_dir = os.getcwd()
    if experiment_id is None:
        experiment_id = random.randint(200_000, 300_000)
    experiment_dir = Path(base_dir) / f"experiment_{experiment_id}"
    if experiment_dir.exists():
        console.log("Experiment code dir exists, deleting before copying")
        shutil.rmtree(experiment_dir)
    console.log(f"Excluding: {exclude} for Copying: {current_dir} to {experiment_dir}")
    if not dry_run:
        if exclude is None:
            shutil.copytree(
                current_dir, experiment_dir,
            )
        else:
            shutil.copytree(
                current_dir, experiment_dir, ignore=shutil.ignore_patterns(*exclude)
            )
        os.chdir(experiment_dir)
    console.log(f"Running: {command} from {os.getcwd()}")
    if not dry_run:
        subprocess.run(command, shell=True, check=True)

if __name__ == "__main__":
    typer.run(main)
```


text:
# Natantispora retorquens (Shearer & J.L. Crane) J. Campb., J.L. Anderson & Shearer, 2003 SPECIES

#### Status
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycologia 95(3): 543 (2003)

#### Original name
Halosarpheia retorquens Shearer & J.L. Crane, 1981

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# Neural Production Systems

```
@incollection{nps_neurips21,
author = {Aniket Didolkar and Anirudh Goyal and Nan Ke and Charles Blundell and Philippe Beaudoin and Nicolas Heess and Michael Mozer and Yoshua Bengio},
title = {Neural Production Systems},
booktitle = {Advances in Neural Information Processing Systems (NeurIPS) 34},
year = {2021},
publisher = {Curran Associates, Inc.}
}
```

links
- [neurips](https://neurips.cc/Conferences/2021/ScheduleMultitrack?event=26838)


text:
[![Build Status](https://travis-ci.org/esimov/caire.svg?branch=master)](https://travis-ci.org/esimov/caire)
[![GoDoc](https://godoc.org/github.com/golang/gddo?status.svg)](https://godoc.org/github.com/esimov/caire)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat)](./LICENSE)
[![release](https://img.shields.io/badge/release-v1.1.1-blue.svg)]()
[![homebrew](https://img.shields.io/badge/homebrew-v1.1.1-orange.svg)]()

**Caire** is a content aware image resize library based on *[Seam Carving for Content-Aware Image Resizing](https://inst.eecs.berkeley.edu/~cs194-26/fa16/hw/proj4-seamcarving/imret.pdf)* paper.

### How does it work
* An energy map (edge detection) is generated from the provided image.
* The algorithm tries to find the least important parts of the image taking into account the lowest energy values.
* Using a dynamic programming approach the algorithm will generate individual seams accrossing the image from top to down, or from left to right (depending on the horizontal or vertical resizing) and will allocate for each seam a custom value, the least important pixels having the lowest energy cost and the most important ones having the highest cost.
* Traverse the image from the second row to the last row and compute the cumulative minimum energy for all possible connected seams for each entry.
* The minimum energy level is calculated by summing up the current pixel with the lowest value of the neighboring pixels from the previous row.
* Traverse the image from top to bottom and compute the minimum energy level. For each pixel in a row we compute the energy of the current pixel plus the energy of one of the three possible pixels above it.
* Find the lowest cost seam from the energy matrix starting from the last row and remove it.
* Repeat the process.

#### The process illustrated:

| Original image | Energy map | Seams applied
|:--:|:--:|:--:|
| ![original](https://user-images.githubusercontent.com/883386/35481925-de130752-0435-11e8-9246-3950679b4fd6.jpg) | ![sobel](https://user-images.githubusercontent.com/883386/35481899-5d5096ca-0435-11e8-9f9b-a84fefc06470.jpg) | ![debug](https://user-images.githubusercontent.com/883386/35481949-5c74dcb0-0436-11e8-97db-a6169cb150ca.jpg) | ![out](https://user-images.githubusercontent.com/883386/35564985-88c579d4-05c4-11e8-9068-5141714e6f43.jpg) |

## Features
Key features which differentiates from the other existing open source solutions:

- [x] Customizable command line support
- [x] Support for both shrinking or enlarging the image
- [x] Resize image both vertically and horizontally
- [x] Can resize all the images from a directory
- [x] Does not require any third party library
- [x] Use of sobel threshold for fine tuning
- [x] Use of blur filter for increased edge detection
- [x] Make the image square with a single command
- [x] Support for proportional scaling
- [x] Face detection to avoid face deformation

## Face detection

The library is capable detecting human faces prior resizing the images via https://github.com/esimov/pigo, which does not require to have OpenCV installed.

The image below illustrates the application capabilities to detect human faces prior resizing. It's clearly visible from the image that with face detection activated the algorithm will avoid cropping pixels inside faces, retaining the face zone unaltered.

| Original image | With face detection | Without face detection
|:--:|:--:|:--:|
| ![Original](https://user-images.githubusercontent.com/883386/37569642-0c5f49e8-2aee-11e8-8ac1-d096c0387ca0.jpg) | ![With Face Detection](https://user-images.githubusercontent.com/883386/41292871-6ca43280-6e5c-11e8-9d72-5b9a138228b6.jpg) | ![Without Face Detection](https://user-images.githubusercontent.com/883386/41292872-6cc90e8e-6e5c-11e8-8b41-5b4eb5042381.jpg) |

[Sample image source](http://www.lens-rumors.com/wp-content/uploads/2014/12/EF-M-55-200mm-f4.5-6.3-IS-STM-sample.jpg)

## Install
First, install Go, set your `GOPATH`, and make sure `$GOPATH/bin` is on your `PATH`.

```bash
$ export GOPATH="$HOME/go"
$ export PATH="$PATH:$GOPATH/bin"
```
Next download the project and build the binary file.

```bash
$ go get -u -f github.com/esimov/caire/cmd/caire
$ go install
```

## MacOS (Brew) install
The library now can be installed via Homebrew. The only thing you need is to run the commands below.

```bash
$ brew tap esimov/caire
$ brew install caire
```

## Usage

```bash
$ caire -in input.jpg -out output.jpg
```

To detect faces prior rescaling use the `-face` flag and provide the face clasification binary file included in the `data` folder. The sample code below will rescale the provided image with 20% but will check for human faces prior rescaling.

```bash
$ caire -in input.jpg -out output.jpg -face=1 -cc="data/facefinder" -perc=1 -width=20
```

### Supported commands:
```bash
$ caire --help
```
The following flags are supported:

| Flag | Default | Description |
| --- | --- | --- |
| `in` | n/a | Input file |
| `out` | n/a | Output file |
| `width` | n/a | New width |
| `height` | n/a | New height |
| `perc` | false | Reduce image by percentage |
| `square` | false | Reduce image to square dimensions |
| `scale` | false | Proportional scaling |
| `blur` | 1 | Blur radius |
| `sobel` | 10 | Sobel filter threshold |
| `debug` | false | Use debugger |
| `face` | false | Use face detection |
| `cc` | string | Cascade classifier |

In case you wish to scale down the image by a specific percentage, it can be used the `-perc` boolean flag. For example to reduce the image dimension by 20% both horizontally and vertically you can use the following command:

```bash
$ caire -in input/source.jpg -out ./out.jpg -perc=1 -width=20 -height=20 -debug=false
```

Also the library supports the `-square` option. When this option is used the image will be resized to a squre, based on the shortest edge.

The `-scale` option will resize the image proportionally. First the image is scaled down preserving the image aspect ratio, then the seam carving algorithm is applied only to the remaining points. Ex. : given an image of dimensions 2048x1536 if we want to resize to the 1024x500, the tool first rescale the image to 1024x768, then will remove only the remaining 268px. **Using this option will drastically reduce the processing time.**

The CLI command can process all the images from a specific directory too.

```bash
$ caire -in ./input-directory -out ./output-directory
```

### Caire integrations
- [x] Caire can be used as a servesless function via OpenFaaS: https://github.com/esimov/caire-openfaas
- [ ] Integrate Caire into snap (https://snapcraft.io/)

## Sample images

#### Shrunk images
| Original | Shrunk |
| --- | --- |
| ![broadway_tower_edit](https://user-images.githubusercontent.com/883386/35498083-83d6015e-04d5-11e8-936a-883e17b76f9d.jpg) | ![broadway_tower_edit](https://user-images.githubusercontent.com/883386/35498110-a4a03328-04d5-11e8-9bf1-f526ef033d6a.jpg) |
| ![waterfall](https://user-images.githubusercontent.com/883386/35498250-2f31e202-04d6-11e8-8840-a78f40fc1a0c.png) | ![waterfall](https://user-images.githubusercontent.com/883386/35498209-0411b16a-04d6-11e8-9ce2-ec4bce34828a.jpg) |
| ![dubai](https://user-images.githubusercontent.com/883386/35498466-1375b88a-04d7-11e8-8f8e-9d202da6a6b3.jpg) | ![dubai](https://user-images.githubusercontent.com/883386/35498499-3c32fc38-04d7-11e8-9f0d-07f63a8bd420.jpg) |
| ![boat](https://user-images.githubusercontent.com/883386/35498465-1317a678-04d7-11e8-9185-ec92ea57f7c6.jpg) | ![boat](https://user-images.githubusercontent.com/883386/35498498-3c0f182c-04d7-11e8-9af8-695bc071e0f1.jpg) |

#### Enlarged images
| Original | Extended |
| --- | --- |
| ![gasadalur](https://user-images.githubusercontent.com/883386/35498662-e11853c4-04d7-11e8-98d7-fcdb27207362.jpg) | ![gasadalur](https://user-images.githubusercontent.com/883386/35498559-87eb6426-04d7-11e8-825c-2dd2abdfc112.jpg) |
| ![dubai](https://user-images.githubusercontent.com/883386/35498466-1375b88a-04d7-11e8-8f8e-9d202da6a6b3.jpg) | ![dubai](https://user-images.githubusercontent.com/883386/35498827-8cee502c-04d8-11e8-8449-05805f196d60.jpg) |
### Useful resources
* https://en.wikipedia.org/wiki/Seam_carving
* https://inst.eecs.berkeley.edu/~cs194-26/fa16/hw/proj4-seamcarving/imret.pdf
* http://pages.cs.wisc.edu/~moayad/cs766/download_files/alnammi_cs_766_final_report.pdf
* https://stacks.stanford.edu/file/druid:my512gb2187/Zargham_Nassirpour_Content_aware_image_resizing.pdf

## Author

Simo Endre [@simo_endre](https://twitter.com/simo_endre)

## License

Copyright © 2018 Endre Simo

This project is under the MIT License. See the LICENSE file for the full license text.

repository: esimov/caire-openfaas

repo_name: esimov/caire-openfaas


text:
# Learning Recompose

This repository was created for a [workshop event for PhoenixReactJS](https://www.meetup.com/Phoenix-ReactJS/events/241181068/).

This repository was built with [Create React App](https://github.com/facebookincubator/create-react-app), which provides a simple way to start React projects with no build configuration needed.

Projects built with Create-React-App include support for ES6 syntax, as well as several unofficial / not-yet-final forms of Javascript syntax such as Class Properties and JSX.  See the list of [language features and polyfills supported by Create-React-App](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#supported-language-features-and-polyfills) for more information.

This repository, specifically, heavily uses ES6+ syntax. If you need a (re)fresher on ES6 syntax, checkout [this great JavaScript primer](https://github.com/ReactTraining/react-subjects/blob/master/JavaScriptPrimer.md)

## Getting started

Clone this repository onto your computer.
```
$ git clone https://github.com/garretttaco/learning-recompose.git
```

In the project directory, run:
```
$ npm install
$ npm start
```

This will run the app in the development mode and should open your browser to [http://localhost:3000](http://localhost:3000).

The page will reload if you make edits.<br>
You will also see any code errors directly in your browser.

In your browser you will see lessons, in order, that have both an exercise and the solution. Clicking on either, you will see that they should both work the same. This is because we have the same logic implemented in the exercise as the solution.
The only difference is, we implemented the solution using `Recompose`'s' HoCs and the container/presentational component pattern.

If you look in the repository root, you will see that under `src/lessons/` we have the exercise in `exercise.js` and the solution in `solution.js`. Each exercise has instructions above the code explaining how you should tackle the lesson.
The solution, has the, you guessed it, solution to the exercise. Try not to look at it, unless you really get stuck on the exercise. Then once you're done, you can compare your implementation to the solution.
You know you have successfully finished the lesson when you have no class based components and the exercise works just like the solution.

## Introduction
Before we jump into recompose and all its glory, let us go over a few things.

### Buzzwords
- Functional composition: applying one function to the results of another
- Higher-order component(HoC): a function that takes a component and returns a new component.
- Container component: A component that is concerned with how things work. Often stateful and tends to serve as a data source.
- Presentational component: A component that is concerned with how things look. Does not specify how the data is loaded or mutated. Receives data and callbacks exclusively via props.
- Stateless functional component: A pure function that receives props and returns JSX (mostly).

### What is the problem
The core problem that React tries to solve is to build user interfaces more efficiently, with flexible, declarative and easy to maintain code.
With this library, we got components and the HoC pattern. We know that this has been game changing for how we develop SPA and user interfaces now. So what's wrong?
The issue that arises is that even though we have these wonderful components and can add functionality to them with HoCs, we still fall into bad practices. Combining functionality with UI.
This makes our codebase more brittle and less reusable. Even if we follow the container/presentational component pattern, we may still declare functionality in the render method of our presentational component. This makes it less reusable. So how do we solve this problem? We want to utilize composition as much as possible.

### Why use Recompose?
Let's start with the meaning of Recompose
> to compose again, differently.

Again, differently is the key. How much composition can we add to our application?
As we go through these lessons, I want you to keep in mind that the point of converting classes to HoCs and stateless functional components is to get used to that pattern.
Once we start converting these, you might think to yourself, why would I be swapping this code, out for other code? The reason is because our code is always more maintainable and reusable when it is composed.
Lets take a simple example like rendering a spinner. Before using components, you would have to write out the surrounding HTML with a spin class, add the font icon or image then you would use your reusable css to make the magic happen.
Then we move to components. You can abstract all that into a component and only ever have to write that once. However, you still have to write the conditional logic of when to display that component in your class container component.
Enter Recompose. You can now reuse that logic too! One line of code (two with the import) and you have a spinner that reliably renders when it receives a prop called `loading` for example.
I admit that sometimes on more simple components, you will end up with more code than if you just used a class component. However, for larger components (we have all seen/written these) it is incredibly more reusable and maintainable to use this level of composition.

## Common Recompose HoC quirks and gotchas I have run into
### `compose`
- Definition: Use to compose multiple HoCs into a single HoC.

`compose` invokes the given HoCs from right to left, or from the bottom up(if each HoC is on its own line). This is important to receive the props you expect.

`compose(CalledLast, CalledSecond, CalledFirst)(BaseComponent)`

### `branch`
- Definition: Accepts a test function and two higher-order components. The test function is passed the props from the owner. If it returns true, the left higher-order component is applied to BaseComponent; otherwise, the right higher-order component is applied. If the right is not supplied, it will by default render the wrapped component.

```
compose(
  branch(
  	props => !props.thisIsTrue,
  	ComponentWillNotRender,
  ),
)(ComponentWillBeRendered)
```

### `withHandlers`
Definition: Takes an object map of handler creators or a factory function. These are higher-order functions that accept a set of props and return a function handler
- `withHandlers` uses currying to access the props inside the handler when called. This can be confusing syntax at first, but you will get the hang of it.
- Sibling `withHandlers` can not be called from within the same `withHandlers` HoC. There is a [PR](https://github.com/acdlite/recompose/pull/401) for this fix which is not merged in(yet?).
```
withHandlers({
  increment: ({ setCounter }) => () => setCounter(n => n + 1),
  decrement: ({ setCounter }) => () =>  setCounter(n => n - 1),
  reset: ({ setCounter }) => () => setCounter(0)
})
```

### `lifecycle`
Definition: A higher-order component version of React.Component(). It supports the entire Component API, except the render() method
- `lifecycle` is a class and the methods are bound to the component's `this` so you can access props by `this.props`.

### Handling propTypes on the stateless functional component
- Do not wrap the component with your enhance HoC while declaring propTypes with `Component.propTypes` because you will incorrectly get propTypes errors. Instead create a SFC, add your propTypes and then wrap the component with the HoC.

Do this:
```
const AppComponent = () => (
  <div />
)

AppComponent.propTypes = {}

const App = enhance(AppComponent)
```

Not this:
```
const App = enhance(() => (
  <div />
))

App.propTypes = {}
```

## Resources
- https://github.com/acdlite/recompose/blob/master/docs/API.md
- https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0
- https://gist.github.com/chantastic/fc9e3853464dffdb1e3c
- https://medium.com/@dan_abramov/mixins-are-dead-long-live-higher-order-components-94a0d2f9e750

repository: tylercollier/learning-recompose

repo_name: tylercollier/learning-recompose


text:
Welcome!
The maze solver is an application that solves a hand drawn mazes, using a Raspberry PI, DE1-SOC and a Pi camera.

It uses the processing power of the DE1 SOC to solve the maze. The Raspberry Pi is used for images processing and the user interaction.

Module 5 project TCS & EE, Universisty of Twente, 2017

Heleen Visserman	S1838636
Bram Denkers	S1828053
Jeroen Waterink	S1736167
Anh Dang Dinh Viet Anh	S1843044