text:
# 235 recent servers:

Latest update at: Tue Oct 22 07:10:15 UTC 2019

| ID | ASN | Server Country | Online |
| -- | --- | -------------- | ------ |
| #.1F0E | AS53667 | United States | 27 hrs |
| #.819F | AS51659 | Russia | 1 hrs offline |
| #.B6D7 | AS58073 | Netherlands | 391 hrs |
| #.D09B | AS174 | United States | 324 hrs |
| #.1AFA | AS63949 | United States | 391 hrs |
| #.3769 | AS21409 | France | 391 hrs |
| #.0613 | AS9009 | United States | 1 hrs offline |
| #.7F39 | AS53667 | United States | 1 hrs |
| #.8F12 | AS9009 | United States | 2 hrs offline |
| #.72B3 | AS63949 | United States | 391 hrs |
| #.0E01 | AS53667 | United States | 7 hrs |
| #.3C59 | AS63949 | Singapore | 391 hrs |
| #.9183 | AS63949 | United States | 47 hrs offline |
| #.766E | AS4760 | Hong Kong | 1 hrs |
| #.B83A | AS49392 | Russia | 12 hrs offline |
| #.D81F | AS199524 | Russia | 60 hrs offline |
| #.F221 | AS58073 | Netherlands | 391 hrs |
| #.903C | AS58073 | Netherlands | 391 hrs |
| #.0A09 | AS31798 | United States | 1 hrs |
| #.A8BA | AS58073 | Netherlands | 391 hrs |
| #.2B24 | AS58073 | Netherlands | 391 hrs |
| #.B3E3 | AS58073 | Netherlands | 391 hrs |
| #.8D5E | AS58073 | Netherlands | 391 hrs |
| #.BC6D | AS23033 | United States | 23 hrs offline |
| #.B396 | AS199524 | Russia | 30 hrs |
| #.2A79 | AS63949 | Japan | 391 hrs |
| #.1FF8 | AS31798 | United States | 1 hrs |
| #.140F | AS9009 | Japan | 393 hrs |
| #.BF82 | AS31798 | United States | 1 hrs |
| #.0777 | AS49392 | Russia | 11 hrs offline |
| #.7E77 | AS49392 | Russia | 5 hrs |
| #.82AA | AS35913 | United States | 57 hrs |
| #.8216 | AS35913 | United States | 67 hrs |
| #.5878 | AS58073 | Netherlands | 391 hrs |
| #.F7E6 | AS35913 | United States | 1 hrs |
| #.0640 | AS199524 | Russia | 60 hrs offline |
| #.149E | AS58073 | Netherlands | 391 hrs |
| #.4C5B | AS63949 | United States | 390 hrs |
| #.9872 | AS51659 | Russia | 11 hrs |
| #.EECC | AS63949 | United States | 3 hrs |
| #.BE83 | AS9009 | Japan | 60 hrs offline |
| #.E4DA | AS63949 | United States | 7 hrs |
| #.D645 | AS58073 | Netherlands | 346 hrs |
| #.6DA9 | AS63949 | United States | 4 hrs |
| #.8E29 | AS58073 | Netherlands | 346 hrs |
| #.02E7 | AS58073 | Netherlands | 346 hrs |
| #.19CA | AS58073 | Netherlands | 346 hrs |
| #.A5BF | AS58073 | Netherlands | 346 hrs |
| #.6364 | AS58073 | Netherlands | 346 hrs |
| #.AC62 | AS63949 | United States | 391 hrs |
| #.92CC | AS49392 | Russia | 1 hrs offline |
| #.7647 | AS63949 | United States | 391 hrs |
| #.98DC | AS49392 | Russia | 24 hrs |
| #.07E1 | AS199524 | Russia | 29 hrs |
| #.5EF0 | AS49392 | Russia | 1 hrs |
| #.76DC | AS63949 | United States | 391 hrs |
| #.7F1D | AS63949 | Singapore | 391 hrs |
| #.0690 | AS63949 | United States | 391 hrs |
| #.E00D | AS58073 | Netherlands | 391 hrs |
| #.D1F4 | AS63949 | United States | 391 hrs |
| #.0F28 | AS58073 | Netherlands | 391 hrs |
| #.65DE | AS63949 | United States | 104 hrs |
| #.013D | AS58073 | Netherlands | 391 hrs |
| #.A577 | AS63949 | United States | 391 hrs |
| #.9FC3 | AS53889 | United States | 391 hrs |
| #.EC5D | AS63949 | United States | 138 hrs |
| #.9B86 | AS63949 | United States | 391 hrs |
| #.0252 | AS63949 | United States | 391 hrs |
| #.3988 | AS63949 | Germany | 24 hrs offline |
| #.42A0 | AS63949 | Japan | 391 hrs |
| #.1385 | AS58073 | Netherlands | 391 hrs |
| #.6680 | AS49392 | Russia | 11 hrs offline |
| #.A01A | AS16509 | Japan | 1 hrs |
| #.D1F2 | AS9009 | United States | 2 hrs |
| #.F770 | AS16509 | Japan | 1 hrs offline |
| #.55A7 | AS63949 | United States | 48 hrs offline |
| #.C3C5 | AS23033 | United States | 24 hrs offline |
| #.8FE0 | AS49392 | Russia | 5 hrs |
| #.6ACA | AS16509 | Japan | 47 hrs offline |
| #.310D | AS45102 | China | 56 hrs offline |
| #.CA9C | AS16509 | Japan | 47 hrs offline |
| #.55B3 | AS58073 | Netherlands | 200 hrs |
| #.884D | AS58073 | Netherlands | 200 hrs |
| #.6826 | AS49392 | Russia | 100 hrs |
| #.5C04 | AS35913 | United States | 6 hrs |
| #.8FEC | AS53667 | United States | 135 hrs |
| #.F64E | AS63949 | United Kingdom | 47 hrs offline |
| #.D6C6 | AS63949 | United Kingdom | 47 hrs offline |
| #.08D9 | AS63949 | United States | 47 hrs offline |
| #.C06D | AS63949 | United States | 141 hrs |
| #.2468 | AS63949 | United States | 47 hrs offline |
| #.3328 | AS63949 | United States | 47 hrs offline |
| #.109A | AS63949 | United States | 47 hrs offline |
| #.F799 | AS63949 | United States | 47 hrs offline |
| #.B137 | AS16509 | Japan | 48 hrs offline |
| #.10A5 | AS63949 | United States | 47 hrs offline |
| #.E555 | AS63949 | United Kingdom | 47 hrs offline |
| #.53E3 | AS63949 | United Kingdom | 47 hrs offline |
| #.5487 | AS63949 | United Kingdom | 47 hrs offline |
| #.E4BB | AS63949 | United Kingdom | 47 hrs offline |
| #.0CB9 | AS63949 | United Kingdom | 47 hrs offline |
| #.8A0E | AS63949 | United Kingdom | 47 hrs offline |
| #.99BC | AS63949 | United Kingdom | 47 hrs offline |
| #.AFD4 | AS63949 | United Kingdom | 47 hrs offline |
| #.B4A5 | AS63949 | United Kingdom | 47 hrs offline |
| #.B1EE | AS63949 | United Kingdom | 47 hrs offline |
| #.07A9 | AS63949 | United States | 47 hrs offline |
| #.E584 | AS63949 | United Kingdom | 47 hrs offline |
| #.7F5D | AS63949 | United States | 47 hrs offline |
| #.788D | AS4760 | Hong Kong | 4 hrs |
| #.500E | AS16509 | Japan | 47 hrs offline |
| #.6BC2 | AS16509 | Japan | 47 hrs offline |
| #.5751 | AS63949 | Japan | 48 hrs offline |
| #.D5CF | AS63949 | Japan | 48 hrs offline |
| #.DF26 | AS16509 | Japan | 47 hrs offline |
| #.BA38 | AS16509 | Japan | 48 hrs offline |
| #.6C29 | AS16509 | Japan | 47 hrs offline |
| #.E995 | AS16509 | Japan | 34 hrs |
| #.6CD6 | AS16509 | Japan | 47 hrs offline |
| #.59C3 | AS16509 | Japan | 48 hrs offline |
| #.A5CD | AS16509 | Japan | 24 hrs |
| #.EDFB | AS16509 | Japan | 48 hrs offline |
| #.217E | AS16509 | Japan | 47 hrs offline |
| #.FB89 | AS63949 | Japan | 48 hrs offline |
| #.E49B | AS16509 | Japan | 47 hrs offline |
| #.0537 | AS16509 | Japan | 48 hrs offline |
| #.0D31 | AS63949 | Japan | 48 hrs offline |
| #.D4C2 | AS63949 | Japan | 48 hrs offline |
| #.8724 | AS16509 | Japan | 48 hrs offline |
| #.B7EE | AS58073 | Netherlands | 92 hrs |
| #.8C67 | AS51659 | Russia | 25 hrs |
| #.B056 | AS16509 | Japan | 48 hrs offline |
| #.FE73 | AS49392 | Russia | 7 hrs |
| #.DF7F | AS9009 | Japan | 1 hrs offline |
| #.2AFE | AS136793 | Macao | 46 hrs offline |
| #.4B04 | AS4760 | Hong Kong | 57 hrs offline |
| #.FC80 | AS4694 | Japan | 22 hrs offline |
| #.32B3 | AS14061 | United States | 54 hrs offline |
| #.3B5D | AS16509 | Japan | 41 hrs |
| #.846C | AS14061 | Singapore | 55 hrs offline |
| #.B6ED | AS14061 | United States | 54 hrs offline |
| #.E2A2 | AS16509 | Japan | 6 hrs |
| #.7A53 | AS63949 | United States | 49 hrs offline |
| #.E0CF | AS63949 | Germany | 56 hrs |
| #.670E | AS14061 | United States | 54 hrs offline |
| #.1AA4 | AS20473 | Singapore | 4 hrs |
| #.D580 | AS14061 | Singapore | 55 hrs offline |
| #.6E7B | AS14061 | United States | 55 hrs offline |
| #.1141 | AS20473 | Singapore | 60 hrs offline |
| #.DC56 | AS20473 | United States | 29 hrs offline |
| #.96B9 | AS54574 | Hong Kong | 25 hrs offline |
| #.81E7 | AS14061 | United States | 54 hrs offline |
| #.A8EC | N/A | N/A | 57 hrs offline |
| #.F0AD | AS16509 | Singapore | 1 hrs offline |
| #.71AD | AS14061 | Singapore | 38 hrs offline |
| #.43FA | AS14061 | Singapore | 38 hrs offline |
| #.FC3C | AS14061 | United States | 39 hrs offline |
| #.3D8E | AS14061 | United States | 39 hrs offline |
| #.E97E | AS16509 | Japan | 41 hrs |
| #.B86E | AS16509 | Japan | 11 hrs |
| #.4558 | AS63949 | Japan | 41 hrs |
| #.632C | AS63949 | Japan | 41 hrs |
| #.677E | AS63949 | Japan | 24 hrs offline |
| #.D554 | AS63949 | Japan | 24 hrs offline |
| #.FA3A | AS16509 | Japan | 3 hrs |
| #.C262 | AS16509 | Japan | 41 hrs |
| #.B0B1 | N/A | N/A | 41 hrs offline |
| #.8E82 | AS16509 | Japan | 24 hrs |
| #.301A | AS16509 | Japan | 41 hrs |
| #.E0EC | AS16509 | Japan | 23 hrs |
| #.7250 | AS16509 | Japan | 41 hrs |
| #.013A | AS16509 | Japan | 41 hrs |
| #.02A3 | AS14061 | United States | 39 hrs offline |
| #.4D5B | AS14061 | United States | 39 hrs offline |
| #.AB88 | AS16509 | Japan | 22 hrs |
| #.F902 | AS14061 | United States | 39 hrs offline |
| #.8F7D | AS63949 | United States | 41 hrs |
| #.FA83 | AS16509 | Japan | 41 hrs |
| #.CE78 | AS16509 | Japan | 41 hrs |
| #.3B3D | AS63949 | United Kingdom | 41 hrs |
| #.CA81 | AS63949 | United Kingdom | 41 hrs |
| #.EDE7 | AS63949 | United Kingdom | 41 hrs |
| #.DD45 | AS63949 | United Kingdom | 41 hrs |
| #.3183 | AS14061 | Singapore | 39 hrs offline |
| #.84F7 | AS16509 | Japan | 41 hrs |
| #.F455 | AS63949 | United States | 41 hrs |
| #.362E | AS63949 | United States | 24 hrs offline |
| #.FE8C | AS63949 | United States | 24 hrs offline |
| #.1EFA | AS63949 | United States | 24 hrs offline |
| #.92FB | AS63949 | United States | 24 hrs offline |
| #.22AC | AS63949 | United States | 41 hrs |
| #.AFF1 | AS63949 | United States | 41 hrs |
| #.F7E9 | AS63949 | United States | 41 hrs |
| #.ADDF | AS63949 | United States | 41 hrs |
| #.8C23 | AS63949 | United Kingdom | 41 hrs |
| #.847C | AS63949 | United Kingdom | 41 hrs |
| #.A67F | AS63949 | United Kingdom | 41 hrs |
| #.2A08 | AS63949 | United Kingdom | 41 hrs |
| #.FC49 | AS63949 | United Kingdom | 41 hrs |
| #.5EC9 | AS63949 | United Kingdom | 41 hrs |
| #.19B6 | AS63949 | United Kingdom | 41 hrs |
| #.1FC2 | AS63949 | United Kingdom | 41 hrs |
| #.DD8E | AS54600 | United States | 32 hrs |
| #.210F | AS14061 | United States | 25 hrs offline |
| #.795C | AS16509 | Japan | 41 hrs |
| #.4B0A | AS54600 | United States | 29 hrs offline |
| #.67D1 | AS54600 | United States | 32 hrs |
| #.3524 | AS54600 | United States | 32 hrs |
| #.51EF | AS136793 | Macao | 32 hrs |
| #.D516 | AS20473 | United States | 8 hrs |
| #.170C | AS14061 | United States | 24 hrs offline |
| #.7504 | N/A | N/A | 27 hrs offline |
| #.43FE | AS17511 | Japan | 32 hrs |
| #.98D6 | AS4694 | Japan | 1 hrs offline |
| #.1F50 | AS14061 | Singapore | 24 hrs offline |
| #.6C3C | AS14061 | United States | 24 hrs offline |
| #.F9A4 | AS63949 | United Kingdom | 41 hrs |
| #.AFDA | AS63949 | Japan | 24 hrs offline |
| #.22FB | AS24282 | Japan | 1 hrs |
| #.49C9 | AS24282 | Japan | 1 hrs |
| #.2DAC | AS3462 | Taiwan | 54 hrs offline |
| #.AEB3 | AS17511 | Japan | 32 hrs |
| #.704A | AS4808 | China | 12 hrs offline |
| #.7CE3 | AS14061 | Singapore | 6 hrs offline |
| #.0A11 | AS14061 | Singapore | 6 hrs offline |
| #.0787 | AS14061 | Singapore | 6 hrs offline |
| #.CFBC | AS63949 | Japan | 8 hrs |
| #.D56B | AS63949 | Japan | 1 hrs offline |
| #.20AE | AS63949 | Japan | 8 hrs |
| #.5705 | AS14061 | United States | 6 hrs offline |
| #.0188 | N/A | N/A | 7 hrs offline |
| #.892C | AS14061 | United States | 5 hrs offline |
| #.AA16 | AS14061 | United States | 5 hrs offline |
| #.F57A | AS14061 | United States | 5 hrs offline |
| #.0EFE | AS17621 | China | 13 hrs offline |

repository: YuanGao-NAU/AutoSSR

repo_name: YuanGao-NAU/AutoSSR


text:
Hoaxwagen detects Volkswagen in dependencies. Brilliantly.

---

## Why?

Under no circumstances Americans (accoring to [Volkswagen package page](https://github.com/auchenberg/volkswagen)) shall be deceived! Tests are essential! Tests are one of the most important tools in developers world!
But what they did... they deceived us! How dare they do it?!  Just to get a nice green shield in README!?? It's miserable! If one doesn't want to write tests, he shouldn't be a developer, he really should not!
As the head of the Clean-Code Group, I present you the flawless tool for eradicating such a disease! Use it everywhere, anytime!

## How would I get it?

Use Yarn. (Or npm). `yarn add hoaxwagen` or `npm install hoaxwagen` will do exactly as the commands say.
Or, using it as a CLI, `yarn global add hoaxwagen` or `npm install -g hoaxwagen`

*Not really hard, is it?*

## How would I use it?

Well, you have two options: either to use `require()`, or to run a CLI

### Using as a library

Somewhere in your javascript project or, even better, in Webpack (or whatever tool you use), include the following code snippet:

```javascript
require('hoaxwagen').monitor();

// continue adding whatever usually needs to be added
```

That's it!

And, while building, you might see this:

```
✅ Clean!
```

or, occasionally, this:

```
🚨 WARNING 🚨

Volkswagen 🛴 is detected in the following packages:
├─ ugly-package-1 @ 0.0.0 (yarn.pm/ugly-package-1)
├─ ugly-package-2 @ 0.0.0 (yarn.pm/ugly-package-2)
└─ ugly-package-3 @ 0.0.0 (yarn.pm/ugly-package-3)

🚧🕳 BE AWARE OF POSSIBLE FUTURE CONSEQUENCES!
```

### Library methods

There're actually several things you can do apart from observing a warning message in the webpack:

Method name|Description|Return value|Appeared in
-----------|-----------|------------|-----------
`isFraud()`|Checks if Volkswagen library exists in `node_modules`|boolean|v1.0.0
`monitor()`|Shows an alert if `isFraud()` returns true|void|v1.0.0
`getPackages()`|Returns a list of packages that uses Volkswagen|IPackage|v1.0.1

```typescript
interface IPackage {
    name:    string;
    version: string;
    yarn:    string; // URL link to package
    path:    string; // absolute path
}
```

As an example, let's go over the packages that use Volkswagen:

```javascript
const hoax = require("hoaxwagen");

const rogues = hoax.getPackages(); // yeah, let's get them out!

rogues.forEach(p => { // p is an IPackage
  console.log(p.name);
});
```

### Running as CLI

Using a CLI is much simpler. Install hoaxwagen like this: `yarn global add hoaxwagen` or `npm i -g hoaxwagen`

Run `hoaxwagen` in terminal, in any javascript project folder, and it will show you how deep the rabbit hole goes:

```java

Well, I've got bad news for you...

  ___ _____   ____  _   _  ____ _  ______
 |_ _|_   _| / ___|| | | |/ ___| |/ / ___|
  | |  | |   \___ \| | | | |   | ' /\___ \
  | |  | |    ___) | |_| | |___| . \ ___) |
 |___| |_|   |____/ \___/ \____|_|\_\____/

Volkswagen was detected in the following packages:
├─ long-package @ 1.0.0 (yarn.pm/long-package) in /Users/user/path/to/long-package
└─ package      @ 2.0.0 (yarn.pm/package)      in /Users/user/path/to/package

```

or a boring version:
```
✅ Clean!
```

***Actually**, the use of the rabbit hole allegory was a little too generous. What this library is definitely not going to do is show you the dependency map. Search by yourself. (No offence).*

## S.H.I.E.L.D.

Look at it!  Feel free to use everywhere!

Including it in your README will make the code ~run 1000x faster~ look better than without it, I swear!

Use it in markdown like this:
```markdown
[![Not using VW](https://hoax.gq/not-using-vw.svg)](https://hoax.gq)
```

In html use this:

```html
<a href="https://hoax.gq"><img alt="Not using VW" src="https://hoax.gq/not-using-vw.svg"></a>
```

Or print it out and stick it on the things:

## Contributing to Hoaxwagen

Contributions are always welcome. There's no code of conduct, so feel free to do whatever you want, yeah!

**But don't forget to give it a star!**

## Disclaimer

Any similarities with a current event concerning (but not limited to) a multinational automobile manufacturer are purely coincidental.

license: MIT

repository: CleanCode-Group/hoaxwagen

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: CleanCode-Group/hoaxwagen


text:
Regression benchmarks
---

[![Build Status](https://travis-ci.org/Ohjeah/regression-benchmarks.svg?branch=master)](https://travis-ci.org/Ohjeah/regression-benchmarks) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

[![Documentation Status](https://readthedocs.org/projects/regression-benchmarks/badge/?version=latest)](https://regression-benchmarks.readthedocs.io/en/latest/?badge=latest)

repository: Ohjeah/regression-benchmarks

repo_name: Ohjeah/regression-benchmarks


text:
# Landing Page Example

This is a quick setup page with next features:

* Rails 4.2 with PG db
* Bootstrap 3
* A/B testing with split gem
* Track visits and events by ahoy_matey gem
* Gzip assets compression via Deflater
* Pre-Order (or opt-in) form with client-side validations
* Social share buttons (facebook, twitter, vkontakte, google plus, linkedIn, livejournal, etc)
* Dashboard page with pretty tables and charts
* User (admin) authentication with devise
* Ready for Heroku deployment (additionaly need to add redis-to-go plugin)
* ...many usefull development and testing gems (better_errors, letter_opener, brakeman, rspec, capybara, etc)

### Installation

Pre-requirements:

* PostgreSQL
* Redis (for ahoy_matey gem)

You need run:

```sh
$ bundle
$ rake db:migrate
$ rake db:seed
$ rails s
```

License
----

MIT


text:
---
layout: post
title: "What's in a Landing Page?"
author: erik
category: [programming,business]
tags: [givingjar]
permalink: /whats-in-a-landing-page/
excerpt: >

Last week Technical Rex launched its latest project: Giving Jar. Right now the landing page for Giving Jar looks pretty basic: some markety text, a pretty picture, and a place to sign up for a newsletter. There's more than meets the eye on that page, though, and creating it was quite the expedition.

    Many discoveries were made, there were several pitfalls, and good notes were taken so a map could be made. I share this map with you now so that you don't have to repeat the voyage without a guide.
---

Last week Technical Rex launched its latest project: [Giving Jar][1]. Right now the landing page for Giving Jar looks pretty basic: some markety text, a pretty picture, and a place to sign up for a newsletter. There's more than meets the eye on that page, though, and creating it was quite the expedition.

Many discoveries were made, there were several pitfalls, and good notes were taken so a map could be made. I share this map with you now so that you don't have to repeat the voyage without a guide.

## What is a Landing Page?

A *landing page* is web page that is typically arrived upon by clicking an advertisement, Internet search result, or other marketing campaign link. Its purpose is to promote a product or service in such a mind-blowing way that any visitor who so much as looks at the page will have no choice but to sign up to be the next early adopter, fanboy (or fangirl), or... sales lead.

In other words, a *landing page* gets people excited about something new on the Internet.

The landing page I created for Giving Jar announced that a new service is being built and anyone interested could sign up for a newsletter to get charity interviews and updates about how Giving Jar is coming along.

## On a Desktop Computer

Here's a screenshot of the whole Giving Jar landing page. The labels identify the important bits, and you can read more about each one in the list below the image.

{% include image.html src="/img/posts/landing-page/givingjar-landing-page-desktop.jpg" %}

#### 1. Logo

An easy-to-recognize symbol to represent your product or service. An SVG logo is easy to scale to any surface and transform in all sorts of creative ways.

#### 2. Name

The name of your product or service. Make it the first item in the navigation bar up top, next to the logo, so visitors see it first and can find their way home if they wander away.

#### 3. Navigation Bar

Link to an *About* page where visitors can read more details about the business. The *Contact* can link to an email address or contact form, but it should offer a way for visitors to ask questions. A *Blog* is an easy way to provide regular updates to visitors who don't want to sign up for anything right away.

#### 4. Social Links

Use social media to promote your product and business. Make sure they're always visible. Use icons instead of words to make them easier to recognize (and take up less space). [Font Awesome][2] has a great collection of such icons.

#### 5. Headline/Tagline

Make a good first impression by placing a catchy phrase and brief description of the product or service front and center on your landing page. If this tag line isn't great then a visitor probably won't bother reading any further into your page.

#### 6. Attractive Imagery

Use a beautiful image or video to help visitors relate to the product or service you are offering. It should stir a positive emotion of some kind and keep people focused on your page.

#### 7. Call to Action

This button or small form should be clearly visible on the page and minimize the barrier required for a visitor to act. The last words before the call to action should be a small reminder of what they are getting in return for providing an email address or phone number.

#### 8. Visual Cues

The landing page should look complete without scrolling. Use as much of the vertical space as possible and offer visual cues anywhere that the visitor needs to do something to see more. The arrow on the Giving Jar page is gently bouncing to indicate that there is more below the main image. A visitor can click it or scroll to see more.

#### 9. Brief Description

Briefly describe (readable in 30 seconds) the key features or values of your product or service. Expand on the headline and break up each point them easier to consume. Add a splash of color so it doesn't look like a wall of text.

#### 10. Footer

Include navigation and social media links, but don't make them stand out as much as the navigation bar at the top of the page. This is also where the copyright, links to businesses behind the product, Terms of Service, Privacy Policy, and Press Kit typically go.

## On a Small Screen

The landing page for a mobile phone will look much different. Besides the obvious decrease in screen size, you will now have much less horizontal real estate than vertical. Fortunately, CSS media queries and some minor adjustments to your HTML can make your landing page beautiful again.

If you designed your landing page mobile-first then you will probably still need to make some adjustments, but instead of thinking about how to trim back, you can think of how to expand and add content.

{% include image.html src="/img/posts/landing-page/givingjar-landing-page-mobile.jpg" align="right" %}

#### 1. Logo and Name

The logo and product/service name may be all that fits width-wise on a small screen. Be prepared to toss the rest of your navigation links.

#### 2. Collapsible Menu

A hamburger icon is generally understood as an interactive, collapsible menu. Any navigation and social media links that didn't fit in the navigation bar can be placed in here, but don't make the menu too tall.

#### 3. Visible Content

You may have to adjust some styles to make the headline and other text easier to read. Consider changing font colors or putting a translucent background behind the content to keep the content standing out like it should.

#### 4. Smaller Imagery

Smaller devices can often mean smaller bandwidth. Create a smaller resolution version of the background image to use on smaller screens so the page still loads quickly.

#### 5. Friendly Forms

Use HTML 5 input types such as "email" and "tel" to provide a more convenient keyboard that visitors can use to quickly enter the information you are requesting.

#### 6. Vertical Description

If you broke your product/service description up into small pieces as suggested in #9 above, this part will be easy.  You can get rid of horizontal separators in this case, too.

#### 7. Minimal Footer

The footer will have the same limitations as the top navigation bar because of the width of the screen. A collapsible menu at the bottom of the page is weird, so get rid of all unnecessary items that are already available in the menu up top.

## Link Destinations

A visitor's whole experience at your landing page should be great. Not only does the landing page have to look amazing, all of the pages that you link to from the landing page need to look good, too. Fortunately, you can reuse many of the visual assets used to create your landing page.

Here are some quick tips for polishing the pages your visitor might wind up at.

#### Social Media Sites like Facebook and Twitter

Your logo is a symbol that people see and immediately associate with your business, so use that as your profile photo on social media sites.

An easy way to create a banner image is to crop or scale the background image from your landing page. Each social media site's banner uses different dimensions and many blog articles tell you out-of-date dimensions. Go to the social media site and use your browser's developer tools to inspect the banner and get the current dimensions.

{% include image.html src="/img/posts/landing-page/givingjar-facebook.jpg" %}

Use a variation of your headline/tagline in your profile description and link to your landing page from each social media site.

Finally, post to your social media accounts regularly! If someone finds their way to your Twitter page and it's a barren wasteland or hasn't been used in months you will immediately lose credibility. It's easy to use [Buffer][3] and [Google Alerts][4] to queue up a steady stream of news related to your line of business.

#### About Page

If wants to know more about your product than what the landing page provides, the *About* page will likely be their next destination. Provide a description of the product or service that can be read in a couple of minutes (about 200 words).

Since there is a noticeable increase in the amount of text on this page, you may want to eliminate other distractions on the page such as images and links.

#### Blog

Offering a blog with regular written content is a cheap and easy way to offer product updates and what your business has learned recently. Feeling informed and learning about the challenges you face are two things early adopters and fans love!

{% include image.html src="/img/posts/landing-page/givingjar-blog.jpg" %}

Regardless of which blogging platform you choose, there are bound to be lots and lots of amazing looking themes. Pick a theme with a clean, professional look, minimalist color scheme, and elegant typography. Make sure the theme looks good on a mobile phone and can link to your social media accounts. People love to read and get lost in social media before bed.

Like social media pages, make sure you are posting to the blog regularly. Blogs contain longer content, so there's an expectation that it won't be updated as frequently. Shoot for once a month to start.

## Behind the Scenes

Visually, your landing page should be in good shape. Functionally, that's a different story.

Your landing page should be easy to share. Analytics will be invaluable for discovering how many visitors view your page versus how many complete the call to action. Oh, and that call to action needs to do something. And lastly, you need a domain and server where the page can be hosted!

#### Pretty Page Previews

When you or anyone else shares a link to the landing page, you can make a little preview of it appear in most social media sites. Do this by adding `meta` tags to the `head` element of every HTML file you expect people to share.

{% include image.html src="/img/posts/landing-page/givingjar-share.png" %}

Here's what Giving Jar's `meta` tag set looks like:

{% highlight html linenos %}

    <meta charset="utf-8">

    <meta name="description" content="Giving Jar is a platform that makes it convenient to donate to the charity of your choice online.">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta property="og:type" content="article" />
    <meta property="og:title" content="Giving Jar" />
    <meta property="og:url" content="http://givingjar.org" />
    <meta property="og:description" content="Giving Jar is a platform that makes it convenient to donate to the charity of your choice online." />
    <meta property="article:published_time" content="2015-11-16T00:00:00-00:00" />
    <meta property="article:modified_time" content="2015-11-16T00:00:00-00:00" />
    <meta property="og:site_name" content="Giving Jar" />
    <meta property="og:locale" content="en_US" />
    <meta property="og:image" content="http://givingjar.org/images/giving-jar-icon-196.png" />

    <meta name="twitter:card" content="summary" />
    <meta name="twitter:site" content="@givingjar" />
    <meta name="twitter:creator" content="@givingjar" />

{% endhighlight %}

These tags will make Facebook, Twitter, Google Plus, and a handful of other social media sites show a little preview of your site when a link is shared. You can control the image, title, and text by adjusting the `og:image`, `og:title`, and `og:description` content, respectively.

#### Analyze This!

These days, capturing site traffic data is pretty easy. I use [Google Analytics][5] to analyze landing page traffic because it's free, easy enough, and I already had a Google account. Feel free to try something else, though. Most of them work very similarly.

{% include image.html src="/img/posts/landing-page/givingjar-analytics.jpg" %}

The first step will be to create a new tracker in whichever tool you use. When you create the tracker, usually you are provided a snippet of JavaScript that you can embed on all of your HTML pages. Once you do that, go back to the tracker's dashboard and start watching people pour into your site!

#### Make the Call to Action Work

If you don't have a server to capture form input then you will need to use some other service to capture visitor sign-ups for you.

Giving Jar's call to action is a newsletter that visitors can subscribe to. [Mail Chimp][6] offers free mailing lists and a way to allow anyone who's not a robot to subscribe. Toss in a jQuery plugin that keeps the visitor on the landing page instead of bouncing them over to a Mail Chimp website, and you've got yourself a nice mailing list signup experience!

If you don't need a newsletter, but you still want to collect a little bit of info about a visitor, there are services to do that for you (and for free). Try [Google Forms][7], [Survey Monkey][8], or [Wufoo][9] (an offshoot of Survey Monkey).

#### Serve It Up

The last few steps involve hosting your landing page on the Internet somewhere.

There are a few free static site hosts. I'm a big fan of [GitHub Pages][10] and [Surge][11]. GitHub Pages operates off of a version-controlled repository and requires using Git, which isn't beginner-friendly but is an invaluable system for managing your site. Surge lets you upload a directory from your computer in one command. It's very easy to use. Both let you use a custom domain name. Of course, feel free to try something else if you're the adventurous type.

If you purchased a domain name, go to the dashboard where you can update your DNS settings and add the appropriate A and CNAME records to point at the server that hosts your files. Both GitHub Pages and Surge offer detailed instructions for how to do this. After you make the DNS changes, you may have to wait a day for your site to be available on your domain.

You may want to consider setting up email accounts on your domain name, too. This step is optional, but it adds a little bit of legitimacy to your site if someone sends an email to<EMAIL_ADDRESS>instead of<EMAIL_ADDRESS>[Zoho][12] offers free email services on your own domain for a limited number of users. Beyond that you should consider [Google Apps][13]. It's not free, but for about $4 per month per email account, it's pretty reasonably priced.

## You Made It!

I'm proud of you for reading this whole article, it wasn't short! Give yourself a high five.

In all seriousness, though, I trudged through figuring out all of these little pieces that make up a landing page and had to share it all. I knew it was a lot of information, but it also would have been great knowing that there's a lot more to a landing page than a dash of HTML and CSS.

Of course, if your eyes are bulging out of your head because of the amount of work involved with making your own landing page, there's always [Squarespace][14]. :)

[1]: http://givingjar.org/ "Giving Jar Landing Page"
[2]: http://fontawesome.io/ "Font Awesome Icon Set"
[3]: https://buffer.com "Buffer Homepage"
[4]: https://www.google.com/alerts "Google Alerts"
[5]: http://www.google.com/analytics/ "Google Analytics"
[6]: http://mailchimp.com/ "Mail Chimp Homepage"
[7]: https://www.google.com/forms/ "Google Forms"
[8]: https://www.surveymonkey.com/ "Survey Monkey"
[9]: http://www.wufoo.com/ "Wufoo Forms Homepage"
[10]: https://pages.github.com/ "GitHub Pages"
[11]: https://surge.sh/ "Surge Homepage"
[12]: https://www.zoho.com/ "Zoho Homepage"
[13]: https://apps.google.com/ "Google Apps"
[14]: http://www.squarespace.com/coverpage "Squarespace Landing Pages"


text:
---
title: What is Y Combinator?
tags:
  - Programming
  - Functional
  - Philosophy
  - Python
  - Recursion
  - Computer Science
  - English Post
date: 2012-08-22 13:34:00 +0700
revise:
  - date: 2022-12-12
    note: Add link to Sorawee
---

Now we can do a [recursion][] on [lambda][] function. (If not, read [the previous entry][self lambda recursion].)

Looking back, we'll see that we have to pass its own function name as an argument to one of its own parameter. (Whoa, what a mouthful to speak!)

``` python
lambda f, x: 1 if x == 0 else x * f(f, x-1)
```

Can we *not* doing that, and just write `f(x-1)` like other normal functions?

Take one step back and re-write the factorial function in a sanity manner.

``` python
f = lambda x: 1 if x == 0 else x * f(x-1)
```

This function works. Since we already reserve the name `f` for it (although it's not what we want). That is the name `f` must exists in this [scope][] in order for this function to works properly. And there's another way to make `f` exists without allocating the name in the global scope.

``` python
lambda f: lambda x: 1 if x == 0 else x * f(x-1)
```

However, this function will not work right away. To make it works, we have to feed the function as an argument repeatedly. For example, to find $5!$, we have to unroll everything into:

``` python
(lambda f: lambda x: 1 if x == 0 else x * f(x-1))(
  (lambda f: lambda x: 1 if x == 0 else x * f(x-1))(
    (lambda f: lambda x: 1 if x == 0 else x * f(x-1))(
      (lambda f: lambda x: 1 if x == 0 else x * f(x-1))(
        (lambda f: lambda x: 1 if x == 0 else x * f(x-1))(
          (lambda f: lambda x: 1 if x == 0 else x * f(x-1))(
            (lambda whatever: 42)
          )
        )
      )
    )
  )
)(5)     # i know, its a sin writing lisp-sy code with c style indentation
```

That is we have to write `lambda f: ...` again and again by ourselves. In the case of $5!$, we need to write the function at least five (plus one) times. If the factorial is larger, then we need to write the function repeatedly as many times.

So we need something that can *passing* the definition of this recursive function infinitely many times. This is the core concept of [fixed-point combinator][]. Which-- I failed to derived it[^1] --we have one of the most famous, the Y combinator, which can be implement in Python[^2] as:

``` python
Y = lambda f: (lambda x: f(lambda v: x(x)(v)))(lambda x: f(lambda v: x(x)(v)))
```

Or with the mathematical definition $Y = \lambda f.(\lambda x.f(x\;x))(\lambda x.f(x\;x))$ so we can ditch $v$.

Try applying a function $g$, we'll see that

$$
\begin{align}
Y\;g &= \Big( {\color{blue}\lambda f}.\big(\lambda x.{\color{blue}f}(x\;x)\big) \; \big(\lambda x.{\color{blue}f}(x\;x)\big) \Big) \; {\color{red}g}  \\
     &= \big(\lambda x.{\color{green}g}(x\;x)\big) \; \big(\lambda x.{\color{green}g}(x\;x)\big) \\
     &= \big({\color{blue}\lambda x}.g({\color{blue}x}\;{\color{blue}x})\big) \; {\color{red}\big(\lambda x.g(x\;x)\big)} \\
     &= g\Big( {\color{green}\big(\lambda x.g(x\;x)\big)}\;{\color{green}\big(\lambda x.g(x\;x)\big)} \Big) \\
     &= g\Big( \big(\lambda x.{\color{green}g}(x\;x)\big)\;\big(\lambda x.{\color{green}g}(x\;x)\big) \Big) \\
     &= g\Big( \Big( {\color{blue}\lambda f}. \big(\lambda x.{\color{blue}f}(x\;x)\big)\;\big(\lambda x.{\color{blue}f}(x\;x)\big) \Big) \; {\color{red}g} \Big) \\
     &= g \big( Y\;g \big) \\
     &= g \big( g \big( Y\;g \big) \big) = g \big( g \big( g \big( Y\;g \big) \big) \big) = g \big( g \big( g \big( g \big( \cdots \big) \big) \big) \big).
\end{align}
$$

To apply it in programming, just write:

``` python
(lambda f: (lambda x: f(lambda v: x(x)(v)))(lambda x: f(lambda v: x(x)(v))))( # Y
  lambda factorial:                                  # function name
    lambda n: 1 if n == 0 else n * factorial(n-1)    # function definition
  )(5)                                               # applying argument
```

What about a Fibonacci number...

``` python
(lambda f: (lambda x: f(lambda v: x(x)(v)))(lambda x: f(lambda v: x(x)(v))))(
  lambda fib:
    lambda n: n if n <= 1 else fib(n-1) + fib(n-2)
  )(5)
```

Isn't it easy?

[^1]: Still curious on how we get it? Read [Sorawee's article][sorawee y-comb], which walkthrough us step by step until we finally deriving the Y combinator.
[^2]: Actually, this code is Z combinator, which applied `x(x)(v)` right away.

[self lambda recursion]: /2012/08/21/recursion-on-lambda.html

[sorawee y-comb]://homes.cs.washington.edu/~sorawee/en/blog/2017/10-05-deriving-Y.html

[recursion]: //en.wikipedia.org/wiki/Recursion
[lambda]: //en.wikipedia.org/wiki/Anonymous_function
[scope]: //en.wikipedia.org/wiki/Scope_(computer_science)
[fixed-point combinator]: //en.wikipedia.org/wiki/Fixed-point_combinator


text:
I will be sharing a script using Keras for training a Convolutional Neural Network (CNN) with transfer learning for melanoma detection. You can find the code in this GitHub repository.

Before proceeding, make sure that you structure the data as follows (the numbers represent the number of images in each file):

![alt text](https://github.com/abderhasan/cnn_melanoma_classification_from_scratch_keras/blob/master/directory-structure.png)

You can download the data from, here. I used two classes as you can see from the figure above (nevus and melanoma). For training, I kept 374 images in each class to keep the data balanced.

To run the code:

`$ python cnn_transfer_learning.py`

The results will not be optimal, as the purpose is to show how one can train a CNN from scratch.

What variables to edit in the code?

You need to edit the following variables to point to your data:

train_directory (path to your training directory)

validation_directory (path to your training directory)

test_directory (path to your testing directory)


text:
---
layout: post
title: "Answer Interaction in Non-factoid Question Answering Systems"
date: 2019-01-11 06:02:22
categories: arXiv_CL
tags: arXiv_CL
author: Chen Qu, Liu Yang, Bruce Croft, Falk Scholer, Yongfeng Zhang
mathjax: true
---

* content
{:toc}

##### Abstract
Information retrieval systems are evolving from document retrieval to answer retrieval. Web search logs provide large amounts of data about how people interact with ranked lists of documents, but very little is known about interaction with answer texts. In this paper, we use Amazon Mechanical Turk to investigate three answer presentation and interaction approaches in a non-factoid question answering setting. We find that people perceive and react to good and bad answers very differently, and can identify good answers relatively quickly. Our results provide the basis for further investigation of effective answer interaction and feedback methods.

##### Abstract (translated by Google)

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

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


text:
## Discover

This is a more detailed documentation that includes private methods for reference.

Node ids in Discover are represented as base64 encoded Strings. This is because the default generated node ids (SHA-1 hashes) could be unsafe to print. `base64` encoding was picked over `hex` encoding because it takes up less space when printed or serialized in ASCII over the wire.

  * [new Discover(options)](#new-discoveroptions)
  * [discover.add(remoteContact)](#discoveraddremotecontact)
  * [discover.executeQuery(query, callback)](#discoverexecutequeryquery-callback)
  * [discover.find(nodeId, callback, \[announce\])](#discoverfindnodeid-callback-announce)
  * [discover.findViaSeeds(nodeId, callback, \[announce\])](#discoverfindviaseedsnodeid-callback-announce)
  * [discover.getClosestContacts(nodeId, closestKBuckets)](#discovergetclosestcontactsnodeid-closestkbuckets)
  * [discover.getClosestKBuckets(nodeId)](#discovergetclosestkbucketsnodeid)
  * [discover.queryCompletionCheck(query, callback)](#discoverquerycompletioncheckquery-callback)
  * [discover.register(contact)](#discoverregistercontact)
  * [discover.timerEndInMilliseconds(type, key)](#discovertimerendinmillisecondstype-key)
  * [discover.timerStart(type, key)](#discovertimerstarttype-key)
  * [discover.trace(message)](#discovertracemessage)
  * [discover.unreachable(contact)](#discoverunreachablecontact)
  * [discover.unregister(contact)](#discoverunregistercontact)
  * [Event 'stats.timers.find.ms'](#event-statstimersfindms)
  * [Event 'stats.timers.find.request.ms'](#event-statstimersfindrequestms)
  * [Event 'stats.timers.find.round.ms'](#event-statstimersfindroundms)

#### new Discover(options)

  * `options`:
    * `CONCURRENCY_CONSTANT`: _Integer_ _(Default: 3)_ Number of concurrent FIND-NODE requests to the network per `find` request.
    * `arbiter`: _Function_ _(Default: vector clock arbiter)_ `function (incumbent, candidate) {}` An optional arbiter function. `arbiter` function is used in three places. First, it is used as the k-bucket `arbiter` function. Second, it is used to determine whether a new remote contact should be inserted into the LRU cache (if `arbiter` returns something `!==` to the cached contact the remote contact will be inserted). Third, it is used to determine if unregistering a contact will succeed (if `arbiter` returns contact `===` to the stored contact, unregister will fail).
    * `arbiterDefaults`: _Function_ _(Default: vector clock arbiter defaults)_ `function (contact) {}` An optional arbiter defaults function that sets `contact` arbiter defaults when a `contact` is first registered. Remote contacts that are added via `add` are assumed to have appropriate arbiter properties already set.
    * `eventTrace`: _Boolean_ _(Default: false)_ If set to `true`, Discover will emit `~trace` events for debugging purposes.
    * `inlineTrace`: _Boolean_ _(Default: false)_ If set to `true`, Discover will log to console `~trace` messages for debugging purposes.
    * `maxCacheSize`: _Number_ _(Default: 1000)_ Maximum number of `contacts` to keep in non-kBucket cache (see #6)
    * `noCache`: _Boolean_ _(Default: false)_ If `true`, non-kBucket cache is not used.
    * `seeds`: _Array_ _(Default: [])_ An array of seed `contact` Objects that the `transport` understands.
    * `transport`: _Object_ _(Default: `discover-tcp-transport`)_ An optional initialized and ready to use transport module for sending communications that conforms to the Transport Protocol. If `transport` is not provided, a new instance of `discover-tcp-transport` will be created and used with default settings.

Creates a new Discover instance.

The `seeds` are necessary if joining an existing Discover cluster. Discover will use these `seeds` to announce itself to other nodes in the cluster. If `seeds` are not provided, then it is assumed that this is a seed node, and other nodes will include this node's address in their `seeds` option. It all has to start somewhere.

#### discover.add(remoteContact)

  * `remoteContact`: _Object_ Contact object to add that is not managed by this Discover node.
    * `id`: _String (base64)_ The contact id, base64 encoded.
    * `data`: _Any_ Data to be included with the contact, it is guaranteed to be returned for anyone querying for this `contact` by `id`.
  * Return: _Object_ Contact that was added.

Adds the `remoteContact`. This is different from `discover.register(contact)` in that adding a `remoteContact` means that the `remoteContact` _is not_ managed by this Discover node.

The use-case motivating existence of this method is being able to hint where to send a response in a request-response type of asynchronous messaging between nodes that are part of the same Discover DHT. More precisely:

  1. Server A creates a contact Alpha and registers it with Discover.
  2. Server A queries Discover to find contact Beta (already existing).
  3. Discover responds that contact Beta is on Server B.
  4. Server A sends a message to contact Beta (on Server B) expecting a response to contact Alpha.
  5. Server B wants to respond to Alpha "quickly". At this point, the contact Alpha information has not propagated through the DHT, so Server B will have to wait for it's Discover instance to query the DHT and make multiple trips looking for contact Alpha.

In order to "speed up" step 5 above, we'd like to be able to hint information that is known, but maybe has not propagated yet. This means, that as part of step 4 above, we could also send a "hint" containing information on contact Alpha. This way, when Server B receives the message with a "hint", it can use `discover.add(remoteContact)` to populate it's local Discover cache without additional network traffic.

#### discover.executeQuery(query, callback)

_**CAUTION: reserved for internal use**_

  * `query`: _Object_ Object containing query state for this request.
    * `nodeId`: _String (base64)_ Base64 encoded node id to find.
    * `nodes`: _Array_ `contact`s to query for `nodeId` arranged from closest to furthest
      * `node`:
        * `id`: _String (base64)_ Base64 encoded contact id.
    * `nodesMap`: _Object_ A map to the same `contact`s already present in `nodes` for O(1) access.
  * `callback`: _Function_ The callback to call with result.

Used internally by `discover.find()` to maintain query state when looking for a specific node on the network. It will launch up to `CONCURRENCY_CONSTANT` `findNode` requests via the `transport` and keep going until the node is found or there are no longer any nodes closer to it (not found). Additionally, this function reports unreachable and reached nodes to the appropriate `KBucket` which maintains the local node's awareness of the state of the network.

#### discover.find(nodeId, callback, [announce])

  * `nodeId`: _String (base64)_ The node id to find, base64 encoded.
  * `callback`: _Function_ The callback to call with the result of searching for `nodeId`.
  * `announce`: _Object_ _(Default: undefined)_ _**CAUTION: reserved for internal use**_ Contact object, if specified, it indicates an announcement to the network so we ask the network instead of satisfying request locally and the sender is the `announce` contact object.

The `callback` is called with the result of searching for `nodeId`. The result will be a `contact` containing `contact.id`, `contact.data`, `contact.transport` of the node. If an error occurs, only `error` will be provided.

```javascript
discover.find('bm9kZS5pZC50aGF0LmltLmxvb2tpbmcuZm9y', function (error, contact) {
    if (error) return console.error(error);
    console.dir(contact);
});
```

#### discover.findViaSeeds(nodeId, callback, [announce])

_**CAUTION: reserved for internal use**_

  * `nodeId`: _String (base64)_ Base64 encoded node id to find.
  * `callback`: _Function_ The callback to call with the result of searching for `nodeId`.
  * `announce`: _Object_ _(Default: undefined)_ Contact object, if specified, it indicates an announcement and the sender is the `announce` contact object.

Uses `seeds` instead of closest contacts (because those don't exist) to find the node with `nodeId`. The `callback` is called with the result of searching for `nodeId`. The result will be a `contact` containing `contact.id` and `contact.data` of the node. If an error occurs, only `error` will be provided.

#### discover.getClosestContacts(nodeId, closestKBuckets)

_**CAUTION: reserved for internal use**_

  * `nodeId`: _String (base64)_ Base64 encoded node id to find closest contacts to.
  * `closestKBuckets`: _Array_ Sorted array of `KBucket`s from closest to furthest from `nodeId`.
  * Return: _Array_ List of closest contacts.

Retrieves maximum of three closest contacts from the closest `KBucket`.

#### discover.getClosestKBuckets(nodeId)

_**CAUTION: reserved for internal use**_

  * `nodeId`: _String (base64)_ Base64 encoded node id to find closest contacts to.
  * Return: _Array_ List of closest `KBucket`s.

Retrieves a sorted list of all `KBucket`s from closest to furthest.

#### discover.queryCompletionCheck(query, callback)

_**CAUTION: reserved for internal use**_

  * `query`: _Object_ Object containing query state for this request.
    * `nodeId`: _String (base64)_ Base64 encoded node id to find.
    * `nodes`: _Array_ `contact`s to query for `nodeId` arranged from closest to furthest.
      * `node`:
        * `id`: _String (base64)_ Base64 encoded contact id.
    * `nodesMap`: _Object_ A map to the same `contact`s already present in `nodes` for O(1) access.
  * `callback`: _Function_ The callback to call with result.

Checks if query completion criteria are met. If there are any new nodes to add to the query, organizes them accordingly and sets the query state to incorporate new node information. Stops and returns failure or success otherwise.

#### discover.register(contact)

  * `contact`: _Object_ Contact object to register.
    * `id`: _String (base64)_ _(Default: `crypto.randomBytes(20).toString('base64'`)_ The contact id, base 64 encoded; will be created if not present.
    * `data`: _Any_ Data to be included with the contact, it is guaranteed to be returned for anyone querying for this `contact` by `id`.
  * Return: _Object_ Contact that was registered with `id` and generated arbiter defaults if necessary.

Registers a new node on the network with `contact.id`. Returns a `contact`:

```javascript
discover.register({
    id: 'Zm9v', // base64 encoded String representing nodeId
    data: 'foo'
});
```

_NOTE: Current implementation creates a new k-bucket for every registered node id. It is important to remember that a k-bucket could store up to k*lg(n) contacts, where lg is log base 2, n is the number of registered node ids on the network, and k is the size of each k-bucket (by default 20). For 1 billion registered nodes on the network, each k-bucket could store around 20 * lg (1,000,000,000) = ~ 598 contacts. This isn't bad, until you have 1 million local entities for a total of 598,000,000 contacts plus k-bucket overhead, which starts to put real pressure on Node.js/V8 memory limit._

#### discover.timerEndInMilliseconds(type, key)

_**CAUTION: reserved for internal use**_

  * `type`: _String_ Timer type.
  * `key`: _String_ Timer key.
  * Return: _Number_ Milliseconds since the first time in the timer.

Calculates a millisecond interval between now and the first timer that was stored at `type` and `key`.

#### discover.timerStart(type, key)

_**CAUTION: reserved for internal use**_

  * `type`: _String_ Timer type.
  * `key`: _String_ Timer key.

Starts a new timer indexed by `type` and `key`. Multiple starts will result in start times being stored in an array for use by `discover.timerEndInMilliseconds()` later.

#### discover.trace(message)

  * `message`: _String_ Message to trace.

Logs or emits a `~trace` for debugging purposes.

#### discover.unreachable(contact)

  * `contact`: _Object_ Contact object to report unreachable
    * `id`: _String (base64)_ The previously registered contact id, base 64 encoded.

Reports the `contact` as unreachable in case Discover is storing outdated information. This can happen because Discover is a local cache of the global state of the network. If a change occurs, it may not immediately propagate to the local Discover instance.

If it is desired to get the latest `contact` that is unreachable, the following code shows an example:

```javascript
discover.find("Zm9v", function (error, contact) {
    // got contact
    // attempt to connect ... and fail :(
    discover.unreachable(contact);
    discover.find(contact.id, function (error, contact) {
        // new contact will be found in the network
        // or an error if it cannot be found
    });
});
```

#### discover.unregister(contact)

  * `contact`: _Object_ Contact object to register
    * `id`: _String (base64)_ The previously registered contact id, base 64 encoded.

Unregisters previously registered `contact` (if `arbiter` returns `contact` and not other stored value) from the network.

#### Event: `stats.timers.find.ms`

  * `function (latency) {}`
    * `latency`: _Number_ Latency of `discover.find()` in milliseconds.

#### Event: `stats.timers.find.request.ms`

  * `function (latency) {}`
    * `latency`: _Number_ Latency of a single request to another Discover noder as part of a round of `discover.find()` DHT lookups.

#### Event: `stats.timers.find.round.ms`

  * `function (latency) {}`
    * `latency`: _Number_ Latency of a single round of `discover.find()` DHT lookups in milliseconds.


text:
# Dolphin Ride
### EnOceanGateways/DolphinRide

### [日本語はこちら](README_ja.md)

## Dolphin Ride (dpride) -- The open source basic EnOcean gateway.

Note: Need eep.xml from [DolphinView](https://www.enocean.com/download/) in your working directory.

### How to build

libxml2 is needed to build.

```sh
$ sudo apt install libxml2
```

### How to use
```sh
Usage: dpride [-m|-r|-o][-c][-v]
  [-d Directory][-f Controlfile][-e EEPfile][-b BrokerFile]
  [-s SeriaPort][-z CommandFile]
    -m    Monitor mode
    -r    Register mode
    -o    Operation mode
    -c    Clear settings before register
    -v    View working status
    -l    Output websocket log for logger client
    -d    Bridge file directrory
    -f    Control file
```

### History
```sh
Verion 1.00 releases notes.
 Fixed to apply radio filter.
 Fixed for ERP1 on 868MHz, 315MHz, 902MHz, and 928MHz.
 Fixed for 1BS, VLD and UTE telegram.
 Use signal SIG_BROKERS (SIGRTMIN + 6) to notify brokers immediately.
 Receive signal SIGUSR2 to get external command while in working.

Verion 1.01 releases notes.
 Fix 4BS telegram analysys and internal EEP cache management.
```

### Broker

You can see how to make brokers at https://github.com/ahidaka/Open62541-Work.

### Sample Client

#### epoclient -- WebSocket Client

Sample Client by Epoch.js.
EPOCH.js is a library that can draw graphs in real time.
Processes JSON data with the DolphinRide '-j'option to draw gauges and line graphs in real time.

#### jsclient -- Javascript Client

Sample Client by Node.js.
This uses DolphinRide '-j'option, and the client that handles JSON output data.
It shows how easy it is to handle JSON data in Javascript.

#### wsclient -- WebSocket Client

Sample WebSocket Client by Node.js, views, and ejs.
This uses the DolphinRide WebSocket interface. The received data is displayed in real time on the client browser.

<br/>

© 2017-2019 Atomu Hidaka  All rights reserved.

repository: ahidaka/EnOceanGateways

gha_language: C

gha_license_id: MIT

repo_name: ahidaka/EnOceanGateways


text:
# Watch
![Python 3.6](https://img.shields.io/badge/python-3.6-brightgreen.svg)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/181f83eb661045db82e7dbfa66b598c7)](https://www.codacy.com/manual/dtbx/watch?utm_source=github.com&utm_medium=referral&utm_content=alx-sdv/watch&utm_campaign=Badge_Grade)

Is another try to make Oracle Database monitoring more handy.

This app created for people who have to deal with long-term sql queries. In other words, if you are data warehouse developer or admin, it could be helpful.

Oracle DB has an infinity number of system views which may give answers for questions like:
* Why does my query run slow?
* Which user consumes too much resources?
* What is going on my database right now?
* How many rows were inserted in my table?
* and many many others.

The problem is you have no GUI to work with these views. So, you retype the same query every time you need some DB statistics.
This app provides easy way to wrap a query to a web report and share it with your team.
Of course, it is actual if your company don't want to buy Oracle Enterprise Manager.

### Features
* Flask-based. Minimum dependencies. Easy to customize.
* Permanent links to all reports and objects can be sent to other people or can be saved to favourites in your browser.
* Defining permitted targets to each user.
* A bunch of predefined reports & utilities for creation your's.
* Background monitoring tasks.
* Interacting through [Telegram](https://telegram.org/) chat (notifications & commands).

![Report example](/docs/top_activity.png) ![Report example](/docs/longops.png)

### Requirements
* Python 3.6+
* Flask
* cx_Oracle
* Pygal

### Installation
First thing you should know: cx_Oracle needs Oracle Instant Client. Installing it could be a bit painful, please read [cx_Oracle guide](https://cx-oracle.readthedocs.io/en/latest/installation.html) and [Oracle Client Guide](https://oracle.github.io/odpi/doc/installation.html). On Windows Oracle Client requires [redistributable libraries](https://www.oracle.com/database/technologies/instant-client/winx64-64-downloads.html).

Then create a new virtual environment if you don't want to mess your python instance.

Install Watch:
`pip install git+https://github.com/alx-sdv/watch.git`

If you deploy the app on Linux, please, add sqlnet.ora file to /usr/lib/oracle/XX.X/client64/lib with parameter "DISABLE_OOB=ON". Otherwise you will not be able to cancel heavy queries. For other platforms this problem also can be actual, it depends on Oracle Client version.

### Settings
Open `/config/config.py` and follow instructions inside.

Please check your database account privileges. By default Watch is not going to modify any data, but for heaven's sake make all accounts read-only.

Also restrict an access to critical business data if you find it necessary. All you need is to read system statistic views.

### Launch
Use `run.py` to run the application on internal web-server provided by Flask.

It is not recommended for production, so you can attach app object from `run.py` to your favourite wsgi server.

See the official [Flask docs](http://flask.pocoo.org/docs/1.0/deploying/#deployment), it contains a lot of scenarios to deploy flask-based application.

### Usage
Some popular system views already included as reports:

Report | View
------ | ----
Top activity | Inspired by OEM chart view, will be improved in further versions.
Top SQL | v$sqlarea
SQL monitor | v$sql_monitor
Session monitor | v$session
Plans cache | v$sql_plan
Top object waits | v$active_session_history
Long operations | v$session_longops
Temp usage | v$sort_usage
Undo usage | v$session
Rman status | v$rman_status
DML locks | dba_dml_locks
Workload | Oracle DB reports, generated by dbms_workload_repository functions.
Objects | all_objects
Table stats | all_tab_statistics
Index stats | all_ind_statistics
Segments | dba_segments
Segment usage | v$segment_statistics
Index usage | dba_index_usage
Tabspace usage | dba_free_space
Tabspace fragmentation | dba_segments
Users | dba_users
Synonyms | dba_synonyms
Privileges | dba_tab_privs
Tab partition count | Helps to find extremely partitioned tables.
Ind partition count | Helps to find extremely partitioned indexes.
Modifications | all_tab_modifications
Query text | v$sql
Query plan | dbms_xplan.display_cursor
Query waits | v$active_session_history
Query long ops | v$session_longops
Query plan stats | v$sql_plan_monitor
Monitor report | dbms_sqltune.report_sql_monitor
Table and View columns | all_tab_columns
Table indexes | all_indexes
Table partitions | all_tab_partitions
Table DDL and View script | dbms_metadata.get_ddl, view text
Row count | To count rows grouped by specified date.
Test scan speed | Performs full scan query over chosen table.

And some tasks:

Task | Description
---- | -----------
SQL execution | Notify when specified query will be finished.
Queued SQL | Notify if some query has been queued too long.
SQL concurrency | To monitor average concurrency time.
Heavy SQL | Notify if some query executes too long or consumes too much temp space.
Frequent SQL | Notify if some SQL statement executes too often.
SQL error | Notify if some query has failed. It is based on sql monitor, but a trigger on servererror is much better.
Session activity | Notify when specified session will be inactive (for example, when the client has got first portion of rows).
Session stats | To monitor session stat params.
Uncommitted transactions | Notify when somebody has an inactive session containing locks.
Zombie sessions | Notify if some sessions do nothing but still are active.
Temp usage | Notify when free temp space ends up.
Tabspace usage | Notify when some tablespace becomes full.
Recycled space | Notify to take out the trash.
Segment size | Notify when segment (table, index, ...) size has reached specified threshold.
Watch status | Notify when specified table will contain specified row.
Resource usage | Notify when some of server resource usage reached specified threshold.
Redo switches | Notify if redo logs switch too often.
Logs moving | Notify if too many archived redo logs wait for deletion.
Job health | Notify if Oracle Job became broken.
Expired users | Notify if some user account expires.
Compare structure | Notify if some source column has been changed.
Ping target | Notify if ping to the target has failed.

All views and tasks were tested on Oracle 11.2 & 12.1 (single instance mode).

### Making your own view
There is two ways to add your code to the app:
* Create a regular flask-view, and do everything you want inside it.
* Use some provided conveniences.

Let's open `/views/target.py` and go to a function named `get_target_objects`.
```python
@app.route('/<target>/objects')
@title('Objects')
@template('list')
@snail()
@select("all_objects")
@columns({"owner": 'str'
         , "object_name": 'str'
         , "subobject_name": 'str'
         , "object_type": 'str'
         , "created": 'datetime'
         , "last_ddl_time": 'datetime'
         , "status": 'str'})
@default_filters("object_type = 'TABLE' and object_name like '%%'")
@default_sort("object_name, subobject_name")
def get_target_objects(target):
    return render_page()
```
As you can see this view does not contain any specific python code.

How it works:
* You click "OBJECTS" item in the main menu.
* Your request maps to get_target_objects: `@app.route('/<target>/objects')`
* The server returns the view page. The page is generated on "standard" template: `@template('list')`.
* The page contains these controls:
  * "Filter" field with default value: `@default_filters("object_type = 'TABLE' and object_name like '%%'", ..., ...)`
  * "Sort" field with default value: `@default_sort("object_name, subobject_name")`
  * Draggable labels for columns names: `@columns({"owner": 'str' ... '})`. Use in for sorting and filtering. Note that both values will be parsed before sending to database. See the main page of the app for more information.
  * Draggable labels of all preset filters.
  * "Run" button.
* You press "Run" button.
* The app receives your request with "do" parameter, and executes `get_target_objects`.
* get_target_objects call render_page function.
* render_page parses params, builds a sql query to specified table: `@select("all_objects")`.
* render_page sends the query do DB, then renders "standard" template with fetched data.
* get_target_objects returns rendered template to your browser.

You can make your own view in the same way.
* If any additional steps needed, use `execute` function from `/utils/oracle.py` inside your view to send custom query to DB.
* To render "non-standard" template use `render_template` function from Flask.
* Put your view in a new python file into `/ext` folder.
* Add the view name in the menu structure by importing it from `config.menu` and setting a new key. `@title('<Choose a name>')` will be displayed.

### How to register a bot
* Add the BotFather to contacts and follow its instructions to create a bot.
* Send `/id` command to your new bot, it will show your account id.
* Set the bot name and token in local_config.py.
* Put your id into account properties (see `USERS` dict).
* Now you are able to get notifications an send some commands to the application.

### Making you own task
Watch task looks like a view, the difference is: it's code will never be executed in http request context.

Open `/views/task.py` and find `wait_for_execution` function:
* `@template('task')` lets the app know that `wait_for_execution` is not a report-view.
* `@period('1m')` defines default execution frequency.
* `@command('/wait')` is a command name that can be sent from a chat to register a new instance of the task.
* The task always must return two params:
  * The first one is a flag of completion (if true, the task will be deleted from the task queue).
  * The second is a message that should be sent to a subscriber.

### Contributing
Feel free to submit a pull request to improve or extend an existing functionality or just open an issue.

### Road map
* `usage` New data types 'bytes' and 'msecs' for pretty formatting and filtering (1.1Gb, 00:00:21.000, 1.1h).
* `usage` Ability to download report result or send it by e-mail.
* `usage` Easy copying to clipboard.
* `usage` User-specific report settings, recent views history.
* `usage` More detailed error messages returning from parser.
* `usage` Braces and IN operator support for parser.
* `usage` New value directive t(trunc). -t10d for date fields.
* `usage` Ability to cancel heavy view directly from it's form. Not only from administration page.
* `usage` Sign up via Telegram.
* `usage` Improve chat commands, use buttons.
* `report` Monitor for specified part of active sql text.
* `report` Which queries has been executed too often.
* `usage` Generate script for all necessary grants.
* `usage` Add an optional numeric argument to @auto() which will refresh a report each N minutes automatically.
* `report` Go deeper to [ASH](https://www.slideshare.net/jberesni/ash-architecture-and-advanced-usage-rmoug2014-36611678).
* `security` Encrypt app data.
* `usage` Ability to set hyperlinks via decorators. Add useful links to existing views.
* `report` Make a forecast for disk space usage.
* `report` Find unused indexes, partitions, tables.
* `general` Improve styles, IE support.
* `general` Fix spelling inaccuracies.

repository: adelinopds/watch

repo_name: adelinopds/watch


text:
# Generative Rainbow
 An extension to the Rainbow algorithm that also learns the transition function  in addition to learning an optimal policy by generating future states in reinforcement learning with GANs.

repository: suleymanaslan/generative-rainbow

repo_name: suleymanaslan/generative-rainbow


text:
---
layout: default
---

# Overview

You might've heard that TSA Security screeners failed 95% of tests conducted by Federal officials of Homeland Security. This revealed that several explosives and weapons are undetected through the body scanners. It was allegedly said that the reason is because of poor maintenance of the security screeners. But, the ground fact is that the algorithm itself is faulty which couldn't classify better. There are many false negatives leading to long-lasting queues also.

As they have put their 3D-image screening dataset on Kaggle, I got an opputinity to explore the data for exploration. They splitted the problem into two stages, this project considers only stage-1 data. I arrived at converting 3D-image to 2D-image patches, took a particular patch, trained a model with all data corresponding to that patch. Then I wanted to scale it for whole 3D-image, but couldn't finish due to lack of requirements (Data is in TBs and examining in AWS Cloud Platform consuming lot of runtime).

## Dataset

Find the dataset at [Kaggle PSA dataset](https://www.kaggle.com/c/passenger-screening-algorithm-challenge/data). Data is pretty standard and all the cleaning is  done by themselves before exposing it to Kaggle, hence I started making my EDA report(Exploratory Data Analysis).

Zones about how many ways do they examine using the 3D-image from the body scanner is provided as shown below. Instrument used is also displayed. I've taken initially the reduced dataset of only zone 6, then working on scaling it to other zones.

![body_zones](https://github.com/TejasReddy9/psa_homeland/blob/master/body_zones.png?raw=true)

![instrument](https://github.com/TejasReddy9/psa_homeland/blob/master/millimeter_scanner.jpg?raw=true)

## Reading Datasets and working

Scanned 3D-images have a certain way to read in images for our analysis. A IPython Notebook regarding reading images in Python was [posted](https://www.kaggle.com/wcukierski/reading-images) in Kaggle Kernels by [William Cukierski](https://www.kaggle.com/wcukierski), which was very useful.

Kaggle has given another nice feature to this particular problem. It's their integration with Google Cloud Storage Platform. They provided a [bucket](https://storage.cloud.google.com/kaggle-tsa-stage1/) in the cloud system which is accessible during the competition period. See [here](https://cloud.google.com/compute/docs/disks/gcs-buckets) for knowing about how to work with GCS buckets.

There are 4 formats of data for each entry. Description of them is in the Kaggle problem [site](https://www.kaggle.com/c/passenger-screening-algorithm-challenge/data). Please refer to it for better understanding of the terms.
1.  `.ahi` (Raw image data, upto 2.26GB per file)
2.  `.ads` (Projected image angle sequence, upto 10MB per file)
3.  `.a3d` (Combined 3D image file, upto 330MB per file)
4.  `.a3daps` (Combined image angle sequence, upto 41.2MB per file)

I've worked with `.ads` format, and even in that I've only taken Zone 6 initially. Then scaled Zone 6 that to `.a3daps` effectively.

## Extracting Zone6 filenames

I've done this with the help of `stage1_labels.csv` given by Kaggle, which contains the probability value for each entry. I sampled the data which matches with Zone6 for 30 samples. The Jupyter Notebook I worked on, is [here](https://github.com/TejasReddy9/psa_homeland/blob/master/lables_.ipynb). I've included this in the project files too. If anyone wanted to sample their own set of images and work on them, they can change code here and start working.

## My Deep learning model

I've created a simple Keras Artificial Neural Networks model in Python. The model is Squential and contains several Dense layers. Design summary for the optimizer which is used by KerasClassifier is:
*   Sequential Classifier
*   First Dense layer uses ReLU activation with uniform Kernel Initializer. Input Shape is `(512, 660, 16)`.
*   Followed by Dropout layer at rate `0.1`.
*   Followed by Flatten over the dimensions.
*   Now, another Dense layer(1) uses ReLU activation with uniform Kernel Initializer.
*   Followed by Dropout layer(1) at rate `0.1`.
*   Now, another Dense layer(2) uses ReLU activation with uniform Kernel Initializer.
*   Followed by Dropout layer(2) at rate `0.1`.
*   Now, another Dense layer(3) uses ReLU activation with uniform Kernel Initializer.
*   Followed by Dropout layer(3) at rate `0.1`.
*   Following these three duals of Dense and Dropout layers, a Dense layer uses Sigmoid activation with uniform Kernel Initializer.
*   Then we compile the classifier with `optimizer=optimizer, loss='binary_crossentropy', metrics=['accuracy']` parameters, which say that we use Binary Cross-Entropy loss function, with performance metrics to be evaluated on accuracy grounds.

## Testing and Performance

I've used GridSearchCV in scikit-learn module for validation results. I've used Adam Optimizer and RMSProp Optimizer, number of epochs as 20 with batch size of 10. Based on that pipeline, it gave best parameters and best accuracy among several tests throughout the process. Observed that accuracy was `91%` on Zone 6 and `45%` on Zone 17. I'd love to extend it to full image whenever time and requirements permit.


text:
# @accounts/boost

## 0.32.2

### Patch Changes

- [#1170](https://github.com/accounts-js/accounts/pull/1170) [`e81eb578`](https://github.com/accounts-js/accounts/commit/e81eb578b35906346b6fadd6c5768b82879f6cda) Thanks [@pradel](https://github.com/pradel)! - Upgrade tslib to 2.3.0

- Updated dependencies [[`1cf53c32`](https://github.com/accounts-js/accounts/commit/1cf53c3283cf1e058de090aa6c5d6b258b6740c5), [`926b4217`](https://github.com/accounts-js/accounts/commit/926b421710b134ed79272e5468b31e417708a3c4), [`e81eb578`](https://github.com/accounts-js/accounts/commit/e81eb578b35906346b6fadd6c5768b82879f6cda)]:
  -<EMAIL_ADDRESS>  -<EMAIL_ADDRESS>  -<EMAIL_ADDRESS>  -<EMAIL_ADDRESS>
## 0.32.1

### Patch Changes

- Updated dependencies [[`22056642`](https://github.com/accounts-js/accounts/commit/220566425755a7015569d8e518095701ff7122e2), [`304cc18d`](https://github.com/accounts-js/accounts/commit/304cc18d84d8153b7a4e857753eea85fa9f7a1f2), [`7726eaf7`](https://github.com/accounts-js/accounts/commit/7726eaf7fb12eb848de5dab0913a12a2e0283954), [`d29e91a6`](https://github.com/accounts-js/accounts/commit/d29e91a65215d08bda79eab1f7b142b615160241)]:
  -<EMAIL_ADDRESS>  -<EMAIL_ADDRESS>  -<EMAIL_ADDRESS>  -<EMAIL_ADDRESS>

repository: accounts-js/accounts

gha_language: TypeScript

repo_name: accounts-js/accounts


text:
---
title: "Code + design + write = SUPERPOWER"
created_at: 2020-08-05T22:10:47.000Z
published_at: 2020-08-05T22:36:35.000Z
---
Maker Twitter is awesome. Here's [a tweet by @jdnoc](https://twitter.com/jdnoc/status/1289358595616718848?s=21) that got me excited:

> _If you know how to code you can help people._

> _If you know how to write you can influence people._

> _If you know how to design you can attract people._

> _If you know how to do all three you can build incredibly valuable things._

I never thought about it that way before, even though I'd been dabbling in all three spaces. I'd been doing design for many years now, it's literally my day job and keeps me and my family provided for. Writing, on and off since my teens but only got more serious and regular here on 200wad since 600+ days ago. Coding, more recent, probably at baby stage now.

And yet I had never quite thought of stacking them together for maximum, multiplier effect. Right now the activities are mostly exclusive to each other, with writing being the most overlapping. I guess it's the nature of the job market and how work is done – people want to hire specialists and you're mostly only known for one thing and hired for one thing. But it makes perfect sense to stack these three skills as an indie maker, since we have to do literally everything when it comes to building, designing and marketing our products.

I should definitely seek more opportunities where I can combine all three skills. A few I can think of right now:

*   Write about my experience as I learn coding, while designing nice mini projects in public that are not just good for learning but also attractive to look at (I realised this when I was browsing Codepen – I tend to preview those that are well-designed, even if the function is small).
*   SEO-ing my products. Stunning landing pages, great writing content, combined with optimising the website with code.
*   Making great products. Designing in a user-centered way, using code as a way to address user needs and painpoints, and being able to talk/write about it in a way that resonates deeply with users.

_What other opportunities are there to stack code, pixels and words?_


text:
Fully Connected Deep Network for MNIST dataset
==
* project implemented as part of the *Deep Learning Methods* course attended on MSc degree of *Data Science* at the *Faculty of Mathematics and Information Sciences* in *Warsaw University of Technology*,
* written purely in NumPy (`numpy` branch) and CuPy (`master` branch) libraries.

Prerequisites
---
* Python 3.6
* Python's `pip`
* `wget`, `gunzip`
* `python3-tkinter` (if you want to plot metrics)
* `cuda` (if version with `cupy` will be used)

How to run via CLI
---
1. Download datasets to `data/` directory:
    ```bash
    cd data/
    wget http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz
    wget http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz
    wget http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz
    wget http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz
    ```
2. Unpack datasets in `data/` directory:
    ```bash
    gunzip *
    ```

3. Install python requirements:
    ```bash
    pip3 install -r requirements.txt
    ```

4. Install system requirements:
    ```bash
    sudo apt install python3-tk
    ```

5. Start training:
    ```bash
    python3 run.py
    ```

How to run via Google Colab
---
1. Open `google_colab.ipynb` in Google Colab by clicking [this](http://colab.research.google.com/github/VictorAtPL/MNIST_FCDN_NumPy/blob/master/google_colab.ipynb) link,
2. run all cells.

Results
---
Results obtained so far with *Weight decay*, *Adam optimizer* and *Dropout*:
```
2019-03-26 00:18:41,382 - MNIST_FCDN_NumPy - INFO - epoch 14 - training loss 0.381925 - training accuracy 0.977683
2019-03-26 00:18:42,486 - MNIST_FCDN_NumPy - INFO - epoch 14 - validation loss 11.725633 - validation accuracy 0.978400
2019-03-26 00:18:42,488 - MNIST_FCDN_NumPy - INFO - epoch 14 - time taken 1.79
```

Sample plots drawn by this application looks like this:
![Sample plot](experiments_images/best_model.png)

![Sample plot 2](experiments_images/best_model_misclassified.png)

![Sample plot 3](experiments_images/best_model_rocs.png)

Remarks
---
* as stated on [Yann Lecun's MNIST page](http://yann.lecun.com/exdb/mnist/), the best result for _Neural Nets_ is *0.35* error rate (in %). The model presented in this repository achieves *1.5* error rate. Possibly, adding data augmentation and/or using conv nets might result in further decreasing error rate,
* `run.py` script accepts a lot of arguments. Read more by executing `train.py -h` in console.


text:
# Trees

A **Tree** is a non-linear _collection_ of elements called nodes connected by edges, arranged in a hierarchical structure with a _parent-child_ relationship between items. There cannot be cycles or unconnected nodes, and at the top of every tree, there is a so-called _root node_, the ancestor of all the other nodes.

There are many special types of tree, that defines additional rules and can efficiently solve particular problems, like:

- ***Binary tree***: where a _parent node_ can have only two children.
- ***Binary search tree*** or (BST): where each node store a value greater than all the nodes of the left subtree, and less than those in the right subtree.
- ***Binary Space Partitioning tree*** or (BSP): that recursively divide an area into two convex sets, allowing faster execution of 3D algorithms that need to process a large set of spatial information.
- Heaps: that is an almost-complete tree where the key of a parent is always greater or equal to one of its children.
- ***Trie*** or prefix tree: where information is stored in edges.
- ***Fenwick tree***: an indexed tree that can efficiently calculate the prefix sum in a table of number.
- ***Red-black tree***: a self-balancing binary search tree.

## Terminology

![tree-structure](../images/tree_structure.png)

There is some specific terminology associated with the tree:

- `Node`: any structure that holds data.
- `Root`: the root node is the one from which all other nodes come.
- `Level` of a node: number of edges to the root plus one.
- `Parent`: node with other connecting nodes.
- `Child`: node connected to its parent.
- `Leaf`: a node that has no children.
- `Edge`: a connection between two nodes.
- `Path`: a group of connections.
- `Height of a tree`: number of levels in a _Tree_.
- `Depth of a node`: number of edges from the root of the _Tree_ to that node.

## Operations

### Insert

Inserting an element into a _Tree_ when he has no order is a simple operation, all we need to do is find the first node that doesn't have all the children and add to it the new node.

In the worst case, we need to travel through the number of nodes equal to the height of the tree.

### Search

Since there is no particular order in the nodes of a _Tree_, we could start off by using any of the traversal algorithms to go through the tree, and check if the node has the value that we are searching.

### Delete

A delete operation usually start with a search operation, and we can have different conditions to handle:

- the node found is a _leaf_: we can simply delete it.
- the node has only one child: we can delete it, and connect its child to the old node's parent.
- the node has two children: we can search a leaf, delete the node and attach its child to it.

### Traversal

Since a _Tree_ is a non-linear data structure, can be traversed in multiple ways.

![tree](../images/tree_traversal.png)

There are two common approaches used to explore it:

- **Depth First Search (DFS)**: where the priority is to explore child nodes first. There is three main way to do this.
  - **pre-order**: visit a node, traverse its left subtree and then its right subtree.
  - **in-order**: traverse its left subtree, visit the node, traverse its right subtree.
  - **post-order**: traverse its left subtree, traverse its a right subtree and then visit the node.
- **Breadth-First Search (BFS)**: where the priority is to visit each node that has the same level, before visiting child nodes.

## Implementation

### Basic Binary Tree

Python3 implementation: [binary_tree.py](../solutions/binary_tree.py)

```python
class Node:

    def __init__(self, value=None):
        self.value = value
        self.left_child = None
        self.right_child = None

class Tree:

    def __init__(self,value=None):
        self.root = Node(value)

    def get_root(self):
        return self.root
```

### Depth First Search

#### Pre Order

This is the iterative version.

```python
def pre_order_iterative(tree):
    visit_order = list()
    stack = Stack()
    node = tree.get_root()

    if node == None:
        return []

    stack.push(node)

    while(not stack.is_empty()):

        node = stack.pop()
        visit_order.append(node.value)

        if node.right_child:
            stack.push(node.right_child)
        if node.left_child:
            stack.push(node.left_child)
```

This is the recursive version.

```python
def pre_order(tree):
    visit_order = list()

    def traverse(node):
        if node:
            visit_order.append(node.value)
            traverse(node.left_child)
            traverse(node.right_child)

    traverse(tree.get_root())

    return visit_order
```

#### In Order

This is the iterative version.

```python
def in_order_iterative(tree):
    visit_order = list()
    stack = Stack()
    node = tree.get_root()

    if node == None:
        return []

    while(not stack.is_empty() or node):

        if node:
            stack.push(node)
            node = node.left_child
        else:
            node = stack.pop()
            visit_order.append(node.value)
            node = node.right_child

    return visit_order
```

This is the recursive version.

```python
def in_order(tree):
    visit_order = list()

    def traverse(node):
        if node:
            traverse(node.left_child)
            visit_order.append(node.value)
            traverse(node.right_child)

    traverse(tree.get_root())

    return visit_order
```

#### Post Order

This is the iterative version.

```python
def post_order_iterative(tree):
    visit_order = list()
    last_node_visited = None
    stack = Stack()
    node = tree.get_root()

    if node == None:
        return []

    while(not stack.is_empty() or node):

        if node:
            stack.push(node)
            node = node.left_child
        else:
            peek_node = stack.peek()
            if peek_node.right_child and last_node_visited != peek_node.right_child:
                node = peek_node.right_child
            else:
                visit_order.append(peek_node.value)
                last_node_visited = stack.pop()

    return visit_order
```

This is the recursive version.

```python
def post_order(tree):
    visit_order = list()

    def traverse(node):
        if node:
            traverse(node.left_child)
            traverse(node.right_child)
            visit_order.append(node.value)

    traverse(tree.get_root())

    return visit_order
```

### Breadth First Search

```python
def bfs(tree):
    visit_order = list()
    q = Queue()
    # start at the root node and add it to the queue
    node = tree.get_root()
    q.enq(node)
    while len(q) > 0:
        node = q.deq()
        visit_order.append(node.value)
        if node.left_child:
            q.enq(node.left_child)
        if node.right_child:
            q.enq(node.right_child)
    return visit_order
```

branch_name: refs/heads/main


text:
# journalQT #

### Introduction
journalQT is a Qt Project that provides a GUI front end to add, read, and query personal
journal entries stored in a sqlite database.

### Features
* Write or revise your journal entry in the large text box.
* Entries are added or revised when you press the "Write" button.
* Changing the date in the date selector moves to an existing or new entry corresponding
to that date.

![alt text](screenshots/textEditor8.png "Write your journal entry and insert or update record by pushing the Write button")

* You can see all of your entries from the same time of the year (i.e., what were you doing
last August, or the year before that) by pressing the "Similar Dates" button.
![alt text](screenshots/textEditor10.png "See all entries from the similar period in prior years")

* You can search your journal for all entries with the "Search" button using the term in the "Search
Term" box.
![alt text](screenshots/textEditor12.png "See all entries from the similar period in prior years")

* If you record your weight in your journal like weight = 174 or 'My weight was 174 this morning',
the "Weight Hist" button will create a list of dates and weights.  It will display it and save it
to a csv file.
![alt text](screenshots/textEditor11.png "See all entries from the similar period in prior years")

* You can export your entire journal to a html file with the "Export to HTML" button.

### Dependencies
journalQT requires an existing [Sqlite](https://www.sqlite.org/about.html) database. The name of
the database does not matter, but it needs a table "journal" with the columns indicated below.
You can create it with sqlite:

    sqlite3 journalSqlite.sqlite
    sqilte> CREATE TABLE journal(ID, Date, Month, Day, Year, DayOfWeek, Entry);
    sqlite> .quit

When you run journalQT it will ask for the location of your database, but then remember
it from then on.

### TODO

### License
MIT License

Copyright (c) 2016 Hugh Whelan

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

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

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

repository: citawds/journalQT

repo_name: citawds/journalQT


text:
# Roadmap TFTech

## Introduction

Our current 1.x series is in the field and empowers 18.000 CPU cores and more than 40.000.000 GB of storage. Today any container or S3 workload can run by means of the current solution.

Our aim is 100% autonomous IT and this can be used for quite some usecases.

![](./img/highlevel_roadmap_usecases.png)

## 3 components make it all happen

![](./img/3components.png)

## the 3 layers or our 2.x generation

### Capacity Layer

The 3 components are being used in this layer, this is the layer of providing capacity (storage, networking, compute) to the applications. On this layer the applications are not self managed, they are provisioned by means of scripts or api usage.

Interface is the shell from jumpscale which we call kosmos. Kosmos has a rich api and scripting capability to allow the creation of complex workloads which can be deployed on top of the zero-OS nodes.

Any container workload can be brought life on our system. We are close to release our v2.0 at this point.
The 1.x release can be used by anyone today. The bulk of the work so far has been on this layer.

### Autonomous Layer

This is a new layer which has as aim to let an application run full autonomous.
The main ingredient here is the 3bot. The 3bot can be programmed to perform complex tasks in an easy way.

The 3bot knows how to deploy and maintain the status of large scale applications.

Interface here is the 3bot API and the 3bot SDK = Jumpscale X which allows IT people to add more knowledge to the 3bot.

### App Layer

We have developed a layer which allows any web application to interact with the 3bot.
This allows an app developer to get to results much more quickly. We don't publicly promote this layer yet.
We use it for our own usecases but the purpose is eventually to let others use this layer as well.

## 1.x.0 stack (active since start April 2019)

Grid only usable by application developers

### Services

- S3 storage service
- Virtual Zero-OS = container host (compatible with Docker)
- ZDB backend storage service
- Web gateway: how to make your service public

Above capabilities allow you to run most workloads which today would typically run on digitalocean or Amazon. Any app which runs on linux can run on the TF Grid.

### Benefits

- no more docker images, flists allow faster deployment, 10x less storage and bandwidth required
- more security, because only signed files can run in the container
- more efficient storage leads in lower cost (10x less power used)
- can build any service on top

### Notes and Known Issues

- not user friendly, only meant for developers
- no user interface, only python scripting
- this is a pre-release version and the nodes are rebooted regularly and its data is erased (DO NOT RUN PRODUCTION !)
- uses TFT from testnet (so free money)

## TF Grid 1.0.1 (Aug 2019)

Still non production workloads and TFT's from testnet.

### Maintenance Release

- New JSX (jumpscale kosmos shell) release: easier to install/use
- Better documentation

### Example Workloads

easy to to deploy example workloads like

- Ethereum node example
- An Icecast node example
- A Minecraft server
- A Pastebin installation
- A PeerTube installation
- A multiplayer quake server (depends on licensing see http://ezquake.github.io/downloads.html)
- Odoo (ERP & Web Publishing system)
- Filemanager: see https://github.com/threefoldtech/tutorials/blob/master/tutorials/filestash/Filestash.py

## TFGrid 2.0.0 (Sept 2019)

Beta release which is using our self driving IT capabilities.

### NEW: Decentralized Apps (POC working on top of TFGrid 2.0)

SEE 3BOT app doc

Our community asked us to focus on enduser facing apps for the first production release.
The names are not final, it could be they will change for launch.

- FreeFlow Pages (alternative to Facebook): everyone can now create their own '''Facebook'''
- FreeFlow Browser (browser running in grid): privacy & freedom for all
- FreeFlow Connect (alternative to zoom/skype/hangout but decentralized): allow anyone to communicate, everywhere
- FreeFlow Files (filemanager, alternative to e.g. dropbox)
- FreeFlow Blog / News / Wiki

for business users (optional)

- FreeFlow Biz (ERP system with CRM, …) based on Odoo
- FreeFlow Publish (wiki & web publishing system)

Everyone will be able to provision their own private version of above described apps on top of the grid.
All integrated with our 3bot mobile app.

### NEW: Blockchain As A Service

Help resolve the blockchain dilema problem.

- Run HyperLedger (ethereum compatible), Rivine (our own) on top of our TFGrid (more blockchains to follow)
- Human empowered blockchain: together with friends launch a blockchain, no-one can access or manipulate the blockchain, consensus required between the group to start or invalidate the blockchain.
- Benefits: easy = deploy a blockchain<5 min, cost effective, much more secure (no-one can interact with the code), real decentralized

### NEW: BCDB = BlockChain DataBase

A True scalable blockchain Database.

- A true distributed, decentralized database (ledger)
- Store any information (e.g. contracts, …)
- Has all the features from a blockchain but not the downsides.
- Much more green & storage efficient (50x benefit compared to classic blockchain techno)
- Strongly Types schema support (complex types)
- Index & Search capabilities.
- Compatible with any chosen development language (Redis compatible API)
- Rich python client (userfriendly).

### NEW: 3bot = Your Digital Self

- host your own 3bot on the TF-Grid
- multi currency wallet (Gold, TFT, …)
- your own data/identity (API driven)
- integrates with 3bot mobile app

### NEW: “autonomous IT” preview (non production)

- run IT workloads with no people involved during operation has properties of a blockchain: consensus required for install, upgrade, remove.
- ultra secure, give hackers no chance because people are not involved in deploying or keeping the service up & running. There is nothing to hack.
- This is a preview release, only usable for real experts.

## TFGrid 2.1.0 (timing to be defined)

### upgrade to our compute & storage workloads

- even more decentralized S3 server, where each users 3bot manages the S3 server
- generic usable container service (docker conversion to container is supported ofcourse)
- web forwarding gateway (publish your services on the internet)

This service allows to run any application you want on the decentralized grid.
As long as an application runs on the linux operating system it can run on our grid.

### More decentralized apps

- FreeFlow Docs (office alternative running in cloud) based on OnlyOffice
- FreeFlow Git (Alternative to Github)


text:
# Kilo Client

A ruby client for the Kilo message queue system.

## Installation

### Gemfile

```ruby
gem 'kilo_client'
```

### Elsewhere

```bash
sudo gem install kilo_client
```

## Usage

### Initialization

```ruby
require 'kilo/client'

kilo = Kilo::Client.new(
  hostname: ENV['KILO_HOSTNAME'],
  vhost:    ENV['KILO_VHOST'],
  username: ENV['KILO_USERNAME'],
  password: ENV['KILO_PASSWORD']
)
```

### Publish

*Signature:* `publish(<channel>, <messages=[]>, options={})`

Send the message to a channel. It will be received by the first consumer which requests the message.

```ruby
kilo.publish('some.channel.name', 'Hello, World!')
```
###

### Broadcast

*Signature:* `broadcast(<channel>, <messages=[]>, options={})`

Send the message to a channel. It will be received by all connected consumers. The message will not be available to consumers who connect after the broadcast has already finished.

```ruby
kilo.broadcast('some.topic.name', 'Hello, World!')
```

### Subscribe

*Signature:* `subscribe(<channel>, &block(metadata, message_body))`