text:
---
title:  "Best online iOS Crash Course! (1 day)"
date:   2015-11-08 04:00:00
categories: [blogs]
tags: [tech]
---

**My Claim: ANYBODY* can learn to build an iOS app  24 hrs. Here’s how… (*Given the person wants to learn it in the first place)**

Fact: iOS development is a technical subject

Statement: Even a non-techy person can learn iOS development.

My Claim: ANYBODY* can learn to build an iOS app in one day. Here’s how… (*Given the person wants to learn it in the first place)

So the other day, I was wondering what kind of resources were available online for learning iOS development and so I googled “Learn iOS development” and predictable found enough online courses and tutorials to keep me busy learning iOS for the next year. It’s hard when you are trying to learn a new subject and there are not many resources available out there, but on the other hand it can be pretty overwhelming to find too many resources on a subject as well. I believe that the depth and duration of some of these courses offered online can seem unappealing to a complete newbie as nobody has so much time to commit these days with social media and life. Did you know that according to a new survey, Teens spend more time consuming media than they do sleeping. I am not even making that up, you can read more about the survey here.

So anyways, the reason I am writing this post in the first place is because in that huge dump of information relating to iOS development available online, I managed to find a gem of a crash course. It’s not too long, has just enough depth and is very hands on. Its called: iOS Crash Course taught by Janum trivedi. I looked into the course and starting working on it immediately. The entire course is divided into ten session most of which have pdf’s that you can go through and some of those sessions also have accompanying xcode project files. It took me roughly 5-6 hrs to go through the entire material including xcode project files and by the end of it I was able to develop my own to-do list app from scratch.

I would specifically like to bring to your attention that despite having developed iOS apps before, the crash course really helped me solidify some of the core iOS development concepts that I was fuzzy on. The xcode project was very well documented and was explained well throughout the course. So as it turns out each session needs to be downloaded separately from the github repo and while I was working on it, I found this to be very cumbersome. So I have taken the liberty of putting all of those sessions into one zip file available for download here. You can thank me later for this folks!

As I went through the course, I took notes of some of the key concepts presented in the pdf’s. So after reading this list of concepts, if you feel pretty confident I would recommended trying to build the app yourself using the xcode project only as a reference. On the other hand, if you are unfamiliar with many of these concepts I would highly recommend going through the crash course itself.

Key Concepts-

1. MVC Architecture-
Almost each file in the project can be put into either a Model (data), View (what the user sees or UI) and Controller (the layer between the view and the model that connects them both)

Model <-> Controller <-> Views (The symbol <-> means two way interaction).

Note that in this architecture, the view is totally unaware of the data that it is presenting and likewise, the Model is totally unaware of how the data is presented to the user. The Model and the View do not interact directly with one another.

2. Delegation- concept of assigning responsibility to another object or class. Key concept in iOS developement.

3. Objective-C Blocks- A block of code enclosed within the curly braces {}. Basically, Blocks let us pass in a block of code as a method parameter.
An important implementation of the Blocks is Callback functions. A callback function essentially allows us to pass a notification as a callback method when the function execution is complete. Highly useful in the case of multithreading.

4. Multithreading- Concept of running multiple threads to complete independent tasks required by the main thread to get overworked and freezing the app eventually.
Grand Central Dispatch (GCD)- It is a multithreading and concurrency API library written in C.

5. Persistence- Concept of storing app data in a local (sandboxed) filesystem across multiple sessions. This helps our apps maintain user state.
There are several way to implement persistence in the app:
a. NSUserDefaults- Part of the Foundation class. More often slow and not flexible. Hence mainly used to store user settings.
b. NSCoding/ NSKeyedArchive- More flexible and fast. Recommended to store data.
c. SQLite
d. Core Data

6. Git/ Version Control- Concept of keeping track of your file changes and allowing collaboration on the same files.

Just to reiterate, I do not own any of the above content and all credit goes to Janum Trivedi for putting this course together. The zip file containing the crash course can be downloaded here. Thanks for reading and let me know if you found this blog post useful in any way.


text:
---
title: My 2019 Book List
summary: Books I read in 2019.
date: 2019-12-31
categories:
  - literature
tags:
  - books
thumbnail: "images/stocksnap.io-C9E7B4U7QY.jpg" #https://stocksnap.io/photo/C9E7B4U7QY
---

Books I read during the year.

[Factfulness](https://www.amazon.com/Factfulness-audiobook/dp/B07BFDCWZP)

Ten Reasons We're Wrong About the World - and Why Things Are Better Than You Think

By: Hans Rosling, Anna Rosling Rönnlund, Ola Rosling

![:inline](https://m.media-amazon.com/images/I/51d+ytjbn7L._SL500_.jpg)

[Accelerate: Building and Scaling High Performing Technology Organizations](https://www.amazon.com/Accelerate-Building-Performing-Technology-Organizations/dp/B07BMBYHXL)

By: Nicole Forsgren PhD, Jez Humble, Gene Kim

![:inline](https://m.media-amazon.com/images/I/51CjXuVck+L._SL500_.jpg)

[The ONE Thing](https://www.amazon.com/The-ONE-Thing-audiobook/dp/B00FPVS27W)

The Surprisingly Simple Truth Behind Extraordinary Results

By: Gary Keller, Jay Papasan

![:inline](https://m.media-amazon.com/images/I/41JjnANocAL._SL500_.jpg)

[The Manager's Path](https://www.amazon.com/The-Managers-Path-audiobook/dp/B07SV4VDWC)

A Guide for Tech Leaders Navigating Growth and Change

By: Camille Fournier

![:inline](https://m.media-amazon.com/images/I/61ohIdFlPsL._SL500_.jpg)

[Radical Candor](https://www.amazon.com/Radical-Candor-Revised-Kick-Ass-Humanity/dp/B07XVQB7XV)

Be a Kick-Ass Boss Without Losing Your Humanity

By: Kim Scott

![:inline](https://m.media-amazon.com/images/I/514VS0190IL._SL500_.jpg)

[The Algebra of Happiness](https://www.amazon.com/The-Algebra-of-Happiness-audiobook/dp/B07PMFG3SZ)

Notes on the Pursuit of Success, Love, and Meaning

By: Scott Galloway

![:inline](https://m.media-amazon.com/images/I/41SNHH7bs2L._SL500_.jpg)

[Atomic Habits](https://www.amazon.com/Atomic-Habits-Proven-Build-Break/dp/0735211299)

An Easy & Proven Way to Build Good Habits & Break Bad Ones

By: James Clear

![:inline](https://m.media-amazon.com/images/I/513Y5o-DYtL._SL500_.jpg)

[The Undoing Project](https://www.amazon.com/Undoing-Project-Friendship-Changed-Minds/dp/0393354776)

A Friendship That Changed Our Minds

By: Michael Lewis

![:inline](https://m.media-amazon.com/images/I/51nvb0ypULL._SL500_.jpg)

[The Ideal Team Player](https://www.amazon.com/Ideal-Team-Player-Recognize-Cultivate/dp/1119209595)

How to Recognize and Cultivate the Three Essential Virtues: A Leadership Fable

By: Patrick M. Lencioni

![:inline](https://m.media-amazon.com/images/I/518SzRCF+HL._SL500_.jpg)

[Liar's Poker](https://www.amazon.com/Liars-Poker-25th-Anniversary-Wreckage/dp/0393246108)

Rising Through the Wreckage on Wall Street

By: Michael Lewis

![:inline](https://m.media-amazon.com/images/I/61BvzbbLq0L._SL500_.jpg)

[Rich Dad Poor Dad](https://www.amazon.com/Rich-Dad-Poor-Teach-Middle/dp/1612680194)

What the Rich Teach Their Kids About Money - That the Poor and Middle Class Do Not!

By: Robert T. Kiyosaki

![:inline](https://m.media-amazon.com/images/I/51AHZGhzZEL._SL500_.jpg)

branch_name: refs/heads/main

extension: md

gha_language: HTML

gha_license_id: MIT

license_type: permissive


text:
Slack-Ruby-Bot
==============

[![Gem Version](https://badge.fury.io/rb/slack-ruby-bot.svg)](http://badge.fury.io/rb/slack-ruby-bot)
[![Build Status](https://travis-ci.org/slack-ruby/slack-ruby-bot.svg)](https://travis-ci.org/slack-ruby/slack-ruby-bot)
[![Code Climate](https://codeclimate.com/github/slack-ruby/slack-ruby-bot/badges/gpa.svg)](https://codeclimate.com/github/slack-ruby/slack-ruby-bot)

A generic Slack bot framework written in Ruby on top of [slack-ruby-client](https://github.com/slack-ruby/slack-ruby-client). This library does all the heavy lifting, such as message parsing, so you can focus on implementing slack bot commands. It also attempts to introduce the bare minimum number of requirements or any sorts of limitations. It's a Slack bot boilerplate.

If you are not familiar with Slack bots or Slack API concepts, you might want to watch [this video](http://code.dblock.org/2016/03/11/your-first-slack-bot-service-video.html).

![](slack.png)

## Useful to Me?

* If you are just trying to send messages to Slack, use [slack-ruby-client](https://github.com/slack-ruby/slack-ruby-client), which this library is built on top of.
* If you're trying to roll out a full service with Slack button integration, check out [slack-ruby-bot-server](https://github.com/slack-ruby/slack-ruby-bot-server), which uses this library.
* Otherwise, this piece of the puzzle will help you create a single bot instance for one team.

## Stable Release

You're reading the documentation for the **next** release of slack-ruby-bot.
Please see the documentation for the [last stable release, v0.12.0](https://github.com/slack-ruby/slack-ruby-bot/tree/v0.12.0) unless you're integrating with HEAD.
See [CHANGELOG](CHANGELOG.md) for a history of changes and [UPGRADING](UPGRADING.md) for how to upgrade to more recent versions.

## Usage

### A Minimal Bot

#### Gemfile

```ruby
source 'https://rubygems.org'

gem 'slack-ruby-bot'
gem 'async-websocket', '~>0.8.0'
```

#### pongbot.rb

```ruby
require 'slack-ruby-bot'

class PongBot < SlackRubyBot::Bot
  command 'ping' do |client, data, match|
    client.say(text: 'pong', channel: data.channel)
  end
end

PongBot.run
```

After [registering the bot](DEPLOYMENT.md), run with `SLACK_API_TOKEN=... bundle exec ruby pongbot.rb`. Have the bot join a channel and send it a ping.

![](screenshots/demo.gif)

### A Production Bot

A typical production Slack bot is a combination of a vanilla web server and a websocket application that talks to the Slack Real Time Messaging API. See our [Writing a Production Bot](TUTORIAL.md) tutorial for more information.

### More Involved Examples

The following examples of bots based on slack-ruby-bot are listed in growing order of complexity.

* [slack-bot-on-rails](https://github.com/dblock/slack-bot-on-rails): A bot running on Rails and using React to display Slack messages on a website.
* [slack-mathbot](https://github.com/dblock/slack-mathbot): Slack integration with math.
* [slack-google-bot](https://github.com/dblock/slack-google-bot): A Slack bot that searches Google, including CSE.
* [slack-aws](https://github.com/dblock/slack-aws): Slack integration with Amazon Web Services.
* [slack-deploy-bot](https://github.com/accessd/slack-deploy-bot): A Slack bot that helps you to deploy your apps.
* [slack-gamebot](https://github.com/dblock/slack-gamebot): A game bot service for ping pong, chess, etc, hosted at [playplay.io](http://playplay.io).
* [slack-victorbot](https://github.com/uShip/victorbot): A Slack bot to talk to the Victorops service.

### Commands and Operators

Bots are addressed by name, they respond to commands and operators. You can combine multiple commands.

```ruby
class CallBot < SlackRubyBot::Bot
  command 'call', '呼び出し' do |client, data, match|
    client.say(channel: data.channel, text: 'called')
  end
end
```

Command match data includes `match['bot']`, `match['command']` and `match['expression']`. The `bot` match always checks against the `SlackRubyBot::Config.user` and `SlackRubyBot::Config.user_id` values obtained when the bot starts.

The `command` method can take strings, which will have to be escaped with `Regexp.escape`, and regular expressions.

```ruby
class CallBot < SlackRubyBot::Bot
  command 'string with spaces', /some\s*regex+\?*/ do |client, data, match|
    client.say(channel: data.channel, text: match['command'])
  end
end
```

Operators are 1-letter long and are similar to commands. They don't require addressing a bot nor separating an operator from its arguments. The following class responds to `=2+2`.

```ruby
class MathBot < SlackRubyBot::Bot
  operator '=' do |client, data, match|
    # implementation detail
  end
end
```

Operator match data includes `match['operator']` and `match['expression']`. The `bot` match always checks against the `SlackRubyBot::Config.user` setting.

### Threaded Messages

To reply to a message in a thread you must provide a reference to the first message that initiated the thread, which is available as either `data.ts` if no threaded messages have been sent, or `data.thread_ts` if the message being replied to is already in a thread. See [message-threading](https://api.slack.com/docs/message-threading) for more information.

```ruby
command 'reply in thread' do |client, data, match|
  client.say(
    channel: data.channel,
    text: "let's avoid spamming everyone, I will tell you what you need in this thread",
    thread_ts: data.thread_ts || data.ts
  )
end
```

_Note that sending a message using only `thread_ts: data.ts` can cause some permanent issues where Slack will keep reporting inaccessible messages as unread. At the time of writing the slack team is still having problems clearing those notifications. As recommended by the slack documentation ..._

> A true parent's thread_ts should be used when replying. Providing a child's message ID will result in a new, detached thread breaking all context and sense.

_... the replies to a thread should always be sent to the message `ts` that started the thread, available as `thread_ts` for subsequent messages. Hence `data.thread_ts || data.ts`._

For additional options, including broadcasting, see [slack-ruby-client#chat_postMessage](https://github.com/slack-ruby/slack-ruby-client/blob/41539c647ac877400f20aa338aa42d2ebfd2866b/lib/slack/web/api/endpoints/chat.rb#L105).

### Bot Aliases

A bot will always respond to its name (eg. `rubybot`) and Slack ID (eg. `@rubybot`), but you can specify multiple aliases via the `SLACK_RUBY_BOT_ALIASES` environment variable or via an explicit configuration.

```
SLACK_RUBY_BOT_ALIASES=:pp: table-tennis
```

```ruby
SlackRubyBot.configure do |config|
  config.aliases = [':pong:', 'pongbot']
end
```

This is particularly fun with emoji.

![](screenshots/aliases.gif)

Bots will also respond to a direct message, with or without the bot name in the message itself.

![](screenshots/dms.gif)

### Generic Routing

Commands and operators are generic versions of bot routes. You can respond to just about anything by defining a custom route.

```ruby
class Weather < SlackRubyBot::Bot
  match /^How is the weather in (?<location>\w*)\?$/ do |client, data, match|
    client.say(channel: data.channel, text: "The weather in #{match[:location]} is nice.")
  end
end
```

![](screenshots/weather.gif)

You can also capture multiple matchers with `scan`.

```ruby
class Market < SlackRubyBot::Bot
  scan(/([A-Z]{2,5})/) do |client, data, stocks|
    # lookup stock market price
  end
end
```

![](screenshots/market.gif)

See [examples/market](examples/market/marketbot.rb) for a working example.

### Matching text in message attachments

You can respond to text in [attachments](https://api.slack.com/docs/message-attachments) with
`attachment`. It will scan `text`, `pretext` and `title` fields in each attachment until a first
match is found.

For example you can match [this example attachment](http://goo.gl/K0cLkH)
by its `title` with the following bot:

```ruby
class Attachment < SlackRubyBot::Bot
  attachment 'Slack API Documentation' do |client, data, match|
    client.say(channel: data.channel, text: "Matched by #{match.attachment_field}.")
    client.say(channel: data.channel, text: "The attachment's text: #{match.attachment.text}.")
  end
end
```

You can also define which fields in attachment object should be scanned.

Scan only a single field:

```ruby
class Attachment < SlackRubyBot::Bot
  attachment 'Slack API Documentation', :title do |client, data, match|
    # implementation details
  end
end
```

Scan multiple fields:

```ruby
class Attachment < SlackRubyBot::Bot
  attachment 'Slack API Documentation', %i[text pretext author_name] do |client, data, match|
    # implementation details
  end
end
```

### Providing description for your bot and commands

You can specify help information for bot or commands with `help` block, for example:

in case of bot:

```ruby
class WeatherBot < SlackRubyBot::Bot
  help do
    title 'Weather Bot'
    desc 'This bot tells you the weather.'

    command 'clouds' do
      desc 'Tells you how many clouds there\'re above you.'
    end

    command 'What\'s the weather in <city>?' do
      desc 'Tells you the weather in a <city>.'
      long_desc "Accurate 10 Day Weather Forecasts for thousands of places around the World.\n" \
        'Bot provides detailed Weather Forecasts over a 10 day period updated four times a day.'
    end
  end

  # commands implementation
end
```

![](screenshots/help.png)

in case of your own command:

```ruby
class Deploy < SlackRubyBot::Commands::Base
  help do
    title 'deploy'
    desc 'deploys your app'
    long_desc 'command format: *deploy <branch> to <env>* where <env> is production or staging'
  end
end
```

### Customize your command help output

If you've used the `help` block described above to document your
commands, you can provide your own implementation of outputting help
for commands like so:

```ruby
class Market < SlackRubyBot::Bot
  command 'help' do |client, data, match|
    user_command = match[:expression]
    help_attrs = SlackRubyBot::Commands::Support::Help.instance.find_command_help_attrs(user_command)
    client.say(channel: data.channel, text: "#{help_attrs.command_desc}\n\n#{help_attrs.command_long_desc}")
  end
end
```

### SlackRubyBot::Commands::Base

The `SlackRubyBot::Bot` class is DSL sugar deriving from `SlackRubyBot::Commands::Base`. For more involved bots you can organize the bot implementation into subclasses of `SlackRubyBot::Commands::Base` manually. By default a command class responds, case-insensitively, to its name. A class called `Phone` that inherits from `SlackRubyBot::Commands::Base` responds to `phone` and `Phone` and calls the `call` method when implemented.

```ruby
class Phone < SlackRubyBot::Commands::Base
  command 'call'

  def self.call(client, data, match)
    client.say(channel: data.channel, text: 'called')
  end
end
```

To respond to custom commands and to disable automatic class name matching, use the `command` keyword. The following command responds to `call` and `呼び出し` (call in Japanese).

```ruby
class Phone < SlackRubyBot::Commands::Base
  command 'call'
  command '呼び出し'

  def self.call(client, data, match)
    client.say(channel: data.channel, text: 'called')
  end
end
```

### Authorization

The framework does not provide any user authentication or command authorization capability out of the box. However, the `SlackRubyBot::Commands::Base` class does check every command invocation for permission prior to executing the command. The default method always returns true.

Therefore, subclasses of `SlackRubyBot::Commands::Base` can override the `permitted?` private method to provide its own authorization logic. This method is intended to be exploited by user code or external gems that want to provide custom authorization logic for command execution.

```ruby
class AuthorizedBot < SlackRubyBot::Commands::Base
  command 'phone home' do |client, data, match|
    client.say(channel: data.channel, text: 'Elliot!')
  end

  # Only allow user 'Uxyzabc' to run this command
  def self.permitted?(client, data, match)
    data && data.user && data.user == 'Uxyzabc'
  end
end
```

### Animated GIFs

The `SlackRubyBot::Client` implementation comes with GIF support. To enable it add `gem GiphyClient` (official Giphy SDK) or `gem giphy` (older SDK, deprecated) to your **Gemfile** and set a Giphy key via `ENV['GIPHY_API_KEY']`. Obtain one from [developers.giphy.com](https://developers.giphy.com).

**Note:** Bots send animated GIFs in default commands and errors.

```ruby
class Phone < SlackRubyBot::Commands::Base
  command 'call'

  def self.call(client, data, match)
    client.say(channel: data.channel, text: 'called', gif: 'phone')
    # Sends the text 'called' and a random GIF that matches the keyword 'phone'.
  end
end
```

Giphy API key is set automatically via `ENV['GIPHY_API_KEY']`. You can override this manually.

```ruby
Giphy.configure do |config|
  config.api_key = 'key'
end
```

With `GiphyClient` you can configure the default GIF rating, which supports Y, G, PG, PG-13, and R. The default value is `G`.

```ruby
Giphy.configure do |config|
  config.rating = 'Y' # illustrated content only, i.e. cartoons
end
```

If you use giphy for something else but don't want your bots to send GIFs you can set `ENV['SLACK_RUBY_BOT_SEND_GIFS']` or `SlackRubyBot::Config.send_gifs` to `false`. The latter takes precedence.

```ruby
SlackRubyBot.configure do |config|
  config.send_gifs = false
end
```

### Built-In Commands

Slack-ruby-bot comes with several built-in commands. You can re-define built-in commands, normally, as described above.

#### [bot name]

This is also known as the `default` command. Shows bot version and links.

#### [bot name] hi

Politely says 'hi' back.

#### [bot name] help

Get help.

### Hooks

Hooks are event handlers and respond to Slack RTM API [events](https://api.slack.com/events), such as [hello](lib/slack-ruby-bot/hooks/hello.rb) or [message](lib/slack-ruby-bot/hooks/message.rb). You can implement your own in a couple of ways:

#### Implementing and registering a Hook Handler

A Hook Handler is any object that respond to a `call` message, like a proc, instance of an object, class with a `call` class method, etc.

Hooks can be registered using different methods based on user preference / use case.
Currently someone can use one of the following methods:

* Pass `hooks` in `SlackRubyBot::Server` initialization.
* Register `hooks` on `SlackRubyBot::Server` using `on` class method.
* Register `hooks` on `SlackRubyBot::Server` using `on` instance method.

##### Hooks registration on `SlackRubyBot::Server` initialization

```ruby
SlackRubyBot::Server.new(hook_handlers: {
  hello: MyBot::Hooks::UserChange.new,
  user_change: [->(client, data) {  }, ->(client, data) {}]
})
```

##### Hooks registration on a `SlackRubyBot::Server` instance

```ruby
# Register an object that implements `call` method
class MyBot::Hooks::Hello
  def call(client, data)
    puts "Hello"
  end
end

server.on(:hello, MyBot::Hooks::Hello.new)

# or register a lambda function to handle the event
server.on(:hello, ->(client, data) { puts "Hello!" })
```

For example, the following hook handles [user_change](https://api.slack.com/events/user_change), an event sent when a team member updates their profile or data. This can be useful to update the local user cache when a user is renamed.

```ruby
module MyBot
  module Hooks
    class UserChange
      def call(client, data)
        # data['user']['id'] contains the user ID
        # data['user']['name'] contains the new user name
        # ...
      end
    end
  end
end
```

##### Hooks registration on `SlackRubyBot::Server` class

Example:

```ruby
module MyBot
  class MyServer < SlackRubyBot::Server
    on 'hello' do |client, data|
      # data['user']['id'] contains the user ID
      # data['user']['name'] contains the new user name
    end

    on 'user_change', ->(client, data) {
      # data['user']['id'] contains the user ID
      # data['user']['name'] contains the new user name
    }
  end
end
```

These will get pushed into the hook set on initialization.

Either by configuration, explicit assignment or hook blocks, multiple handlers can exist for the same event type.

#### Deprecated hook registration

Registering a hook method using `hooks.add` is considered deprecated and
will be removed on future versions.

```ruby
# [DEPRECATED]
server.hooks.add(:hello, MyBot::Hooks::UserChange.new)
server.hooks.add(:hello, ->(client, data) { puts "Hello!" })

```

### Message Loop Protection

By default bots do not respond to their own messages. If you wish to change that behavior, set `allow_message_loops` to `true`.

```ruby
SlackRubyBot.configure do |config|
  config.allow_message_loops = true
end
```

### Logging

By default bots set a logger to `$stdout` with `DEBUG` level. The logger is used in both the RealTime and Web clients.

Silence logger as follows.

```ruby
SlackRubyBot::Client.logger.level = Logger::WARN
```

If you wish to customize logger, set `logger` to your logger.

```ruby
SlackRubyBot.configure do |config|
  config.logger = Logger.new("slack-ruby-bot.log", "daily")
end
```

### Advanced Integration

You may want to integrate a bot or multiple bots into other systems, in which case a globally configured bot may not work for you. You may create instances of [SlackRubyBot::Server](lib/slack-ruby-bot/server.rb) which accepts `token`, `aliases` and `send_gifs`.

```ruby
EM.run do
  bot1 = SlackRubyBot::Server.new(token: token1, aliases: ['bot1'])
  bot1.start_async

  bot2 = SlackRubyBot::Server.new(token: token2, send_gifs: false, aliases: ['bot2'])
  bot2.start_async
end
```

For an example of advanced integration that supports multiple teams, see [slack-gamebot](https://github.com/dblock/slack-gamebot) and [playplay.io](http://playplay.io) that is built on top of it.

### Proxy Configuration

There are [several proxy options](https://github.com/slack-ruby/slack-ruby-client#web-client-options) that can be configured on `Slack::Web::Client`. You can also control what proxy options are used by modifying the `http_proxy` environment variable per [Net::HTTP's documentation](https://docs.ruby-lang.org/en/2.0.0/Net/HTTP.html#class-Net::HTTP-label-Proxies).

Note that Docker on OSX seems to incorrectly set the proxy, [causing `Faraday::ConnectionFailed`](https://github.com/slack-ruby/slack-ruby-bot/issues/155), `ERROR -- : Failed to open TCP connection to : (getaddrinfo: Name or service not known)`. You might need to manually unset `http_proxy` in that case, eg. `http_proxy="" bundle exec ruby ./my_bot.rb`.

### Model-View-Controller Design

The `command` method is essentially a controller method that receives input from the outside and acts upon it. Complex behaviors could lead to a long and difficult-to-understand `command` block. A complex `command` block is a candidate for separation into classes conforming to the Model-View-Controller pattern popularized by Rails.

The library provides three helpful base classes named `SlackRubyBot::MVC::Model::Base`, `SlackRubyBot::MVC::View::Base`, and `SlackRubyBot::MVC::Controller::Base`.

Testing a `command` block is difficult. As separate classes, the Model/View/Controller's behavior can be tested via `rspec` or a similar tool.

#### Controller

The Controller is the focal point of the bot behavior. Typically the code that would go into the `command` block will now go into an instance method in a Controller subclass. The instance method name should match the command name exactly (case sensitive).

As an example, these two classes are functionally equivalent.

Consider the following `Agent` class which is the simplest default approach to take.

```ruby
class Agent < SlackRubyBot::Bot
  command 'sayhello', 'alternate way to call hello' do |client, data, match|
    client.say(channel: data.channel, text: "Received command #{match[:command]} with args #{match[:expression]}")
  end
end
```

Using the MVC functionality, we would create a controller instead to encapsulate this function.
```ruby
class MyController < SlackRubyBot::MVC::Controller::Base
  def sayhello
    client.say(channel: data.channel, text: "Received command #{match[:command]} with args #{match[:expression]}")
  end
  alternate_name :sayhello, :alternate_way_to_call_hello
end
MyController.new(MyModel.new, MyView.new)
```
Note in the above example that the Controller instance method `sayhello` does not receive any arguments. When the instance method is called, the Controller class sets up some accessor methods to provide the normal `client`, `data`, and `match` objects. These are the same objects passed to the `command` block.

However, the Controller anticipates that the model and view objects should contain business logic that will also operate on the `client`, `data`, and `match` objects. The controller provides access to the model and view via the `model` and `view` accessor methods. The [inventory example](examples/inventory/inventorybot.rb) provides a full example of a Model, View, and Controller working together.

A Controller may need helper methods for certain work. To prevent the helper method from creating a route that the bot will respond to directly, the instance method name should begin with an underscore (e.g. `_my_helper_method`). When building the bot routes, these methods will be skipped.

Calling `alternate_name` after the method definition allows for method aliases similar to the regular `command` structure. When commands can be triggered by multiple text strings it's useful to have that ability map to the controller methods too.

Lastly, the Controller class includes `ActiveSupport::Callbacks` which allows for full flexibility in creating `before`, `after`, and `around` hooks for all methods. Again, see the [inventory example](examples/inventory/inventorybot.rb) for more information.

#### Model

A complex bot may need to read or write data from a database or other network resource. Setting up and tearing down these connections can be costly, so the model can do it once upon instantiation.

The Model also includes `ActiveSupport::Callbacks`.

```ruby
class MyModel < SlackRubyBot::MVC::Model::Base
  define_callbacks :sanitize
  set_callback :sanitize, :around, :sanitize_resource
  attr_accessor :_resource

  def initialize
    @db = setup_database_connection
  end

  def read(resource)
    self._resource = resource
    run_callbacks :sanitize do
      @db.select(:column1 => resource)
      # ... do some expensive work
    end
  end

  private

  def sanitize_resource
    self._resource.downcase
    result = yield
    puts "After read, result is #{result.inspect}"
  end
end
```

Like Controllers, the Model is automatically loaded with the latest version of the `client`, `data`, and `match` objects each time the controller method is called. Therefore the model will always have access to the latest objects when doing its work. It will typically only use the `data` and `match` objects.

Model methods are not matched to routes, so there is no restriction on how to name methods as there is in Controllers.

#### View

A typical bot just writes to a channel or uses the web client to react/unreact to a message. More complex bots will probably require more complex behaviors. These should be stored in a `SlackRubyBot::MVC::View::Base` subclass.

```ruby
class MyView < SlackRubyBot::MVC::View::Base
  define_callbacks :logit
  set_callbacks :logit, :around, :audit_trail

  def initialize
    @mailer = setup_mailer
    @ftp = setup_ftp_handler
  end

  def email_admin(message)
    run_callbacks :logit do
      @mailer.send(:administrator, message)
    end
  end

  def react_thumbsup
    client.web_client.reactions_add(
      name: :thumbsup,
      channel: data.channel,
      timestamp: data.ts,
      as_user: true)
  end

  def react_thumbsdown
    client.web_client.reactions_remove(
      name: :thumbsup,
      channel: data.channel,
      timestamp: data.ts,
      as_user: true)
  end

  private

  def audit_trail
    Logger.audit("Sending email at [#{Time.now}]")
    yield
    Logger.audit("Email sent by [#{Time.now}]")
  end
end
```
Again, the View will have access to the most up to date `client`, `data`, and `match` objects. It will typically only use the `client` and `data` objects.

View methods are not matched to routes, so there is no restriction on how to name methods as there is in Controllers.

### Testing

#### RSpec Shared Behaviors

Slack-ruby-bot comes with a number of shared RSpec behaviors that can be used in your RSpec tests.

* [behaves like a slack bot](lib/slack-ruby-bot/rspec/support/slack-ruby-bot/it_behaves_like_a_slack_bot.rb): A bot quacks like a Slack Ruby bot.
* [respond with slack message](lib/slack-ruby-bot/rspec/support/slack-ruby-bot/respond_with_slack_message.rb): The bot responds with a message.
* [respond with slack messages](lib/slack-ruby-bot/rspec/support/slack-ruby-bot/respond_with_slack_messages.rb): The bot responds with a multiple messages.
* [respond with error](lib/slack-ruby-bot/rspec/support/slack-ruby-bot/respond_with_error.rb): An exception is raised inside a bot command.
* [start typing](lib/slack-ruby-bot/rspec/support/slack-ruby-bot/start_typing.rb): The bot calls `client.start_typing`.

Require `slack-ruby-bot/rspec` in your `spec_helper.rb` along with the following dependencies in Gemfile.

```ruby
group :development, :test do
  gem 'rack-test'
  gem 'rspec'
  gem 'vcr'
  gem 'webmock'
end
```

Use the `respond_with_slack_message` matcher.

```ruby
describe SlackRubyBot::Commands do
  it 'responds with any message' do
    expect(message: "#{SlackRubyBot.config.user} hi").to respond_with_slack_message
  end
  it 'says hi' do
    expect(message: "#{SlackRubyBot.config.user} hi").to respond_with_slack_message('hi')
  end
end
```

Use the `respond_with_slack_messages` matcher for multiple messages.

```ruby
describe SlackRubyBot::Commands do
  it 'responds with more than one message' do
    expect(message: "#{SlackRubyBot.config.user} count").to respond_with_slack_messages
  end
  it 'says one and two' do
    expect(message: "#{SlackRubyBot.config.user} count").to respond_with_slack_messages(['one', 'two'])
  end
end
```

Message matchers support regular expressions.

```ruby
describe SlackRubyBot::Commands do
  it 'says hi' do
    expect(message: "#{SlackRubyBot.config.user} hi").to respond_with_slack_message(/hi/)
  end
end
```

Check that the bot called `client.start_typing(channel: 'channel')`.

```ruby
describe SlackRubyBot::Commands do
 it 'starts typing on channel' do
    expect(message: "#{SlackRubyBot.config.user} hi").to start_typing(channel: 'channel')
  end
end
```

#### Testing Lower Level Messages

You can test client behavior at a lower level by fetching the message hook. The following example expects a bot command to call `client.typing(channel: data.channel)`.

```ruby
describe SlackRubyBot::Commands do
  let(:app) { Server.new }
  let(:client) { app.send(:client) }
  let(:message_hook) { SlackRubyBot::Hooks::Message.new }
  it 'receives a typing event' do
      expect(client).to receive(:typing)
      message_hook.call(
        client,
        Hashie::Mash.new(text: "#{SlackRubyBot.config.user} type something", channel: 'channel')
      )
    end
  end
end
```

### Useful Libraries

* [newrelic-slack-ruby-bot](https://github.com/dblock/newrelic-slack-ruby-bot): NewRelic instrumentation for slack-ruby-bot.

## Contributing

See [CONTRIBUTING](CONTRIBUTING.md).

## Upgrading

See [CHANGELOG](CHANGELOG.md) for a history of changes and [UPGRADING](UPGRADING.md) for how to upgrade to more recent versions.

## Copyright and License

Copyright (c) 2015-2020, [Daniel Doubrovkine](https://twitter.com/dblockdotorg), [Artsy](https://www.artsy.net) and [Contributors](CHANGELOG.md).

This project is licensed under the [MIT License](LICENSE.md).

license: MIT

repository: dblock/slack-ruby-bot

branch_name: refs/heads/master

gha_language: Ruby

repo_name: dblock/slack-ruby-bot


text:
# Elastic Compute Cloud (EC2)

```
Host server > Hypervisor > Guest 1 | Guest 2 | Guest n
```

### AMI

Amazon Machine Image

It is an image with special requirements and special tools inside (Amazon Linux, Red Hat Linux, Windows 10, etc.)

### Configure Instance Details

| Key | Value | Notes
|-----|-------|-----
| Number of instances | 1 |
| Purchasing option | - |
| Network | vpc-59... (default) |
| Auto-assign Public IP      | Enable |
| IAM role | None | Allows this machine to work with other services.
| Shutdown behavior | Stop | `Stop` vs `Terminate`. Terminate will delete instance. Stop can be rerun.
| Enable termination protection | - | Additional popup
| Monitoring | - | Monitor CPU/memory/instance types/.. Requires additional charges
| Tenancy | Shared | `Shared` vs `Dedicated` vs `Dedicated host`. Should your machine be dedicated physical machine or just virtual machine?
| T2 Unlimited | - |

### Add Storage

Root - /dev/xvda - 30GB - ...

### Add Tags

It is not possible to assign name to instance from the scratch. But it is possible to tag them.

*e.g. `Alex`*

### Configure Security Group

| Key | Value | Notes
|-----|-------|-------
| Assign a security group | `Create a new security group` | You can use existing security groups
| Security group name | http-and-ssh | any names

| Type | Protocol | Port Range | Source | Description
|------|----------|------------|--------|------------
| SSH | TCP | 22 | Anywhere (or My IP or ...) |
| HTTP | TCP | 80 | Anywhere (...) |

*It's a good practice to limit access by IP.*

### Select an existing key pair or create a new key pair

If you go to `Network and Security` tab in EC2, you will see all the key pars. (public-private keys for protected connections)

You can `import key pair` here or `create new key pair`.

### Launch

Click `Launch` and wait around 2-3 minutes.

You can name it somehow.

| Name | Instance ID | Instance Type | Availability Zone | Instance State | Status Checks | Alarm Status | Public DNS (IPV4) | IPv4 Public IP | Security Groups
|------|-------------|---------------|-------------------|----------------|---------------|--------------|-------------------|----------------|----------------
| alex | i-09...     | t2.micro      | eu-central-1b     | running        |               |              | ...               | ...            | (link to group)

Below you can see:
* Public IP
* Public DNS
* Private IPs
* Private DNS (IP + region + suffix)
* Root device type (`ebs`)
* Root device `/dev/xvda`
* Some metrics
* other props

### Connect

1. Click `Connect`
2. Locally `chmod 400 you_perm_key.pem`
3. Locally `ssh -i "you_perm_key.pem"<EMAIL_ADDRESS>
Amazon AMI contains:
yum, java, python, ruby, ...

### Price

You pay for seconds of running instance.
*t2.micro - 0.0116 per hour*

## Instance Storage - Elastic Block Store (EBS)

It is a network drive located in a special dedicated server.

`Instance Volume` (separated SSD) vs `EBS Volume + EBS Volume Snapshot` (virtual block storage) vs `EFS (elastic file system)` (file system storage).

* EBS has ~125MB per sec, but depends on instance.
* SSD is good for cache, it will be clear after usage

*0.1$ per GB + replication*
*0.1-0.2% AFR*

There are special ebs optimized instances.

### Attach new volume

If you want to add new volume, there is a `Elastic Block Store` tab in EC2 bar.

1. Create new volume

| Key | Value | Notes
| --- | ----- | ------
| Volume Type | General Purpose SSD (GP2)
| Size (GB) | 100
| IOPS | 300/3000
| Availability Zone | eu-central-1b
| Throughput | N/A
| Snapshot ID | - |
| Encryption | - | Allow to encrypt volume

Volumes:

| Name | Volume ID | Size | Volume Type
|------|-----------|------|-------------
| -    | vol-..    | 100  | gp2

2. Click `Attach volume`

| Key | Value
|-----|------
| Volume | vol-...
| Instance | i-..(alex)

3. Connect to machine
`ssh -i "you_perm_key.pem"<EMAIL_ADDRESS>
4. Check that disk is available
`sudo df -h` or `lsblk`

5. Mount disk

5.1. `sudo file -s /dev/xvdf`
If `data`, then it's ok, the disk is empty

5.2. Create ext4 file system
`sudo mkfs -t ext4 /dev/xvdf`

5.3. Create directory
`sudo mkdir /data`

5.4. Mount disk to new directory
`sudo mount /dev/xvdf /data`

5.5. Change directory owner to ec2-user
`sudo chown -R ec2-user: /data`

5.6. Create new files and have fun :smile:
`nano my_file.txt`

5.7. Allow to show volume as a part of system size
`sudo resize2fs /dev/xvdf/`

* It is possible to change disk size
* It is possible to create snapshot of disk

*Snapshots contains difference, just like git. So do not delete old snapshots*

*You pay for usage + read/write*

## Amazon Lightsail

There is an analogue of EC2 with simple configurations

It has nice UI. Prices equal to Digital Ocean machines.

*One month free*

* You can create snapshots
* You can add storage
* You can add load balancers

Note - they can go to S3 or smth like that.


text:
Resin SDK
---------

[![npm version](https://badge.fury.io/js/resin-sdk.svg)](http://badge.fury.io/js/resin-sdk)
[![dependencies](https://david-dm.org/resin-io/resin-sdk.png)](https://david-dm.org/resin-io/resin.sdk.png)
[![Build Status](https://travis-ci.org/resin-io/resin-sdk.svg?branch=master)](https://travis-ci.org/resin-io/resin-sdk)
[![Build status](https://ci.appveyor.com/api/projects/status/qbsivehgnq0vyrrb?svg=true)](https://ci.appveyor.com/project/jviotti/resin-sdk)

Join our online chat at [![Gitter chat](https://badges.gitter.im/resin-io/chat.png)](https://gitter.im/resin-io/chat)

The official JavaScript [Resin.io](https://resin.io/) SDK.

Role
----

The intention of this module is to provide developers a nice API to integrate their JavaScript applications with Resin.io.

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

Install the Resin SDK by running:

```sh
$ npm install --save resin-sdk
```

Platforms
---------

We currently only support NodeJS, but there are plans to make the SDK available in the browser as well.

Documentation
-------------

We generate JSDoc markdown documentation in [DOCUMENTATION.md](https://github.com/resin-io/resin-sdk/blob/master/DOCUMENTATION.md).

Support
-------

If you're having any problem, please [raise an issue](https://github.com/resin-io/resin-sdk/issues/new) on GitHub and the Resin.io team will be happy to help.

Tests
-----

Run the test suite by doing:

```sh
$ gulp test
```

Contribute
----------

- Issue Tracker: [github.com/resin-io/resin-sdk/issues](https://github.com/resin-io/resin-sdk/issues)
- Source Code: [github.com/resin-io/resin-sdk](https://github.com/resin-io/resin-sdk)

Before submitting a PR, please make sure that you include tests, and that [coffeelint](http://www.coffeelint.org/) runs without any warning:

```sh
$ gulp lint
```

License
-------

The project is licensed under the Apache 2.0 license.

repository: fedealconada/resin-sdk

repo_name: fedealconada/resin-sdk


text:
# 51 - [Unbound loop enables denial of service](./Unbound%20loop%20enables%20denial%20of%20service.md)

Unbound loop enables denial of service The swap function relies on an unbounded loop. An attacker could disrupt swap operations by forcing the loop to go through too many operations, potentially trapping the swap due to a lack of gas.

1. Recommendation: Bound the loops and document the bounds.
2. Medium Risk severity finding from [ToB’s Audit of Uniswap V3](https://github.com/Uniswap/uniswap-v3-core/blob/main/audits/tob/audit.pdf)

___
## Slide Screenshot
![051.png](../../images/7.%20Audit%20Findings%20101/051.png)
___
## Slide Text
-
___
## References
- Youtube Reference
___
## Tags

url: https://raw.githubusercontent.com/0xRektora/secureum-mind_map/c15a93fc9714de59e6847dbc6e5f99e32a5d9d31/content/7. Audit Findings 101/Unbound loop enables denial of service.md


text:
[![Iroki](https://github.com/mooreryan/iroki_web/blob/master/public/iroki_logo3.png)](https://github.com/mooreryan/iroki_web/blob/master/public/iroki_logo3.png)

# Iroki

Rails 5 source for the [Iroki webapp](https://www.iroki.net), a viewer and customizer for phylogenetic trees.

## Citation

If you find Iroki useful in your research, please cite the [Iroki manuscript](https://doi.org/10.7717/peerj.8584).  Thank you!!

> Moore RM, Harrison AO, McAllister SM, Polson SW, Wommack KE. 2020. Iroki: automatic customization and visualization of phylogenetic trees. PeerJ 8:e8584 https://doi.org/10.7717/peerj.8584

You can also download the citation and import it into your favorite reference manager!

- [BibTeX](https://raw.githubusercontent.com/mooreryan/iroki/master/manuscript_citation/peerj-8584.bib)
- [RIS | Zotero | Mendeley](https://raw.githubusercontent.com/mooreryan/iroki/master/manuscript_citation/peerj-8584.ris)

### Manuscript

Iroki has been published!  Check out the [manuscript on PeerJ](https://doi.org/10.7717/peerj.8584)!

## Documentation

Please see the [the docs](https://www.iroki.net/docs) for info on how to run Iroki.

repository: mooreryan/iroki

repo_name: mooreryan/iroki


text:
# EPA AVERT Web App

Front end of the AVERT web app built with React and Redux (bootstrapped with [create-react-app](https://github.com/facebook/create-react-app)).

## Local Development

Running the **client app** locally depends on a running local instance of the [server app](/server). Please view the 'Local Development' section of the [repository’s README](../README.md) to get started.

## Cloud.gov Deployment

**NOTE:** See the _server_ app’s ['Cloud.gov Deployment' section](/server#cloudgov-deployment) after following the client app’s build steps below.

### Development Deployment

- The app is configured to be deployed to Cloud.gov at the following development route: https://avert-dev.app.cloud.gov

  If that route ever changes, update the `REACT_APP_URL` environment variable set in the npm `build:dev` script in the `package.json` file to reflect the updated route.

- Ensure you're in this directory ([client](/client)) and run:
  `npm run build:dev`

- Follow the 'Development Deployment' instructions found in the [server app’s README](/server#development-deployment).

### Production Deployment

- The app is configured to be deployed to Cloud.gov at the following production route: https://avert.app.cloud.gov

  If that route ever changes, update the `REACT_APP_URL` environment variable set in the `.env.production` file to reflect the updated route.

- Ensure you're in this directory ([client](/client)) and run:
  `npm run build`

- Follow the 'Production Deployment' instructions found in the [server app’s README](/server#production-deployment).

repository: USEPA/AVERT

gha_language: TypeScript

repo_name: USEPA/AVERT


text:
FREE MAGIC CARDS .com

Every day, all over this country, magic cards are being thrown away.  When people draft (open packs and build decks) or just straight up open packs, they inevitably accrue more than enough of some commons, maybe uncommons.

FreeMagicCards.com serves as an exchange for magic cards between people who want to give them away and people who would like to have them.

There are two ways I want to be able to deliver these cards.
Shipping - within the U.S., I will have certain size/price packages that I will work out with the Post Office.  I’m considering taking a percentage of the “shipping fees” as a source of income.
Drop Off / Pick Up - working with local stores or at individuals’ locations people can pick up cards
This is basically like a craigslist for magic cards, but I want to keep it simple.
location
must have city and zipcode
amount and some basic details of what the cards are
I will also want to populate a database with all the magic stores in the United States.

The website will also have links to magic formats that use only commons and/or uncommons.  There will also be a blog about “Card of the Week” or something.

It has been suggested that I partner up with a non-profit to legitimize it and offer tax write-offs for people who donate.

repository: mrpatzsch/FreeMagicCards

repo_name: mrpatzsch/FreeMagicCards


text:
# Play Game

## Feature

Begin Game

## Acceptance Criteria

Player able to play the game

### Scenario: Players enters in single-mode

  Given - Player starts the game

  When - Single-mode is selected as the game mode

  Then - A bot is assigned to play the game as Player 2

### Scenario: Players enters in player mode

  Given - Player starts the game

  When - Player mode is selected as the game mode

  Then - A player first logs in is assigned to be player 1 and second as player 2.

### Scenario: Players start the game

  Given - Player starts the game

  When - Player hit the ball to the wall of the opposite player

  Then - A goal is added to the scorecard of the player.

### Scenario: Players scores 10

  Given - Player starts the game

  When - Scorecard reaches 10 of any of  the player

  Then - The player whose score is 10 is declared as the winner and level is incremented
  AND Player 2 level is decremented.

### Scenario: Players exits the game in middle of the game

  Given - Players are playing the game

  When - A player exits the game

  Then - The second player is declared as winner and level is incremented
  AND Player 2 level is decremented.

repository: Engin-Boot/pong-stage-GaganPunjabi

repo_name: Engin-Boot/pong-stage-GaganPunjabi


text:
---
id: "2019-10-17-yaz-contract-extension"
title: "ETC Cooperative extends Yaz Khoury's contract"
date: 2019-10-17
author: Bob Summerwill
featuredImage: bob_and_yaz.jpeg
tags: [people]
---

**17th October 2019 – Vancouver, Canada** – The [ETC Cooperative](https://etccooperative.org) today announced that it has extended [Yaz Khoury](https://twitter.com/Yazanator)'s contract for another year.  Yaz joined the ETC Cooperative in October 2018 and has been doing amazing work every since:

- “[Ethereum Classic on Raspberry Pi](https://medium.com/ethereum-classic/ethereum-classic-on-raspberry-pi-a3be200cdca0)” - 10th Jan 2019.
- “[Analyzing Ethereum Classic with Google BigQuery](https://medium.com/ethereum-classic/analyzing-ethereum-classic-with-google-bigquery-df55822ec6a6)” - 6th Feb 2019.
- “[Kotti, Solidity, ETC, Oh My!”](https://medium.com/ethereum-classic/kotti-solidity-etc-oh-my-2ae36926454d)" - 22nd March 2019.
- “[ETC: Wanted Dev or Alive](https://medium.com/ethereum-classic/etc-wanted-dev-or-alive-2581a5079aa1)" - talk given at EDCON 2019 in Sydney, Australia, 11th April 2019.  Covering Kotti/Gorli, Ethernode, Mantis, OpenRPC, IOHK research work, BigQuery and Kaggle.
- “[Quantifying Immutability](https://medium.com/ethereum-classic/quantifying-immutability-e8f2b1bb9301)" - 6th May 2019.
- “[Ethercluster: An Open-Source Alternative to Infura](https://medium.com/ethereum-classic/ethercluster-an-open-source-alternative-to-infura-b8799b2122d3)” - 1st July 2019.

Executive Director Bob Summerwill [tweeted](https://twitter.com/BobSummerwill/status/1184986345929789441) "*I am delighted to say that I have just signed a contract extension for our very own ETC Aquaman, Yaz,so he can continue his great work at the ETC Cooperative for another year!*"

Yaz [replied](https://twitter.com/Yazanator/status/1184986694577262593) "*Happy to continue working at the ETC Coop, the best nonprofit with the best leader I have the pleasure of working for!*"

## About ETC Cooperative

The ETC Cooperative is a Delaware-incorporated 501(c)(3) public charity, which seeks to accelerate the growth of Ethereum Classic.

repository: ETCCooperative/etc-cooperative-website

gha_language: MDX

repo_name: ETCCooperative/etc-cooperative-website


text:
---
layout: page
title: Pattern Evaluation
tagline:
categories:

---

{% include JB/setup %}

在同一个系统的中：

1. 不同的level应该有不同的阀值
2. 不同的商品也应该有不同的阀值

Multi-Dimensional Associations

1. single-dimensional 如果A买苹果，也买了香蕉

2. Inter-dimensional 如果A是18-25岁，并且是学生，所以买coke
3. Hybrid-dimensional 如果A是18-25岁，并且买popcorn，可能会买coke

Mining Quantitative Associations

- Numberical atrributes: age and salary
- Deviation analysis: gender: male and female

Rare Patterns vs. Negative Patterns

Rare Patterns

- Very low support but interesting
- How to mine them? different group-based thresholds

Nagative Patterns

- Nagetively corealted
- How to define

Constraint Based Mining

- Different kinds of constraints lead to different pruning strategies

constraints can be categorized as

1. Pattern sapce pruning (pruning某些data)
    - Anti-monotonic
    - Monotonic
    - Succinct
    - Convertible

2. data space pruning (pruning 一个data的一部分)
    - Data succinct
    - Data anti-monotonic

Sequence Patterns

- Sequence Databases

- Gapped sequential patterns (GSP)
- Non-gapped sequential patterns

- Generalized Sequential Patterns
- Vertical format-based
- Pattern-growth methods

Pattern-Based Classification

- apple pie
- apple ipad

- pattern first, then classification

- CBA (Classification Based on Associations)
- CMAR

Discriminative Patterns

- 选取数据集中最具代表性的properties


text:
---
layout: default
---

# 1996-02-16 - Re: Remailers Pose Risk

## Header Data

From: Deranged Mutant<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 8648ace599902d9d02e26d65b0af92dae09b29f292298d4a8621e7a465d158a6

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1996-02-16 07:01:39 UTC

Raw Date: Fri, 16 Feb 1996 15:01:39 +0800

## Raw message

```
{% raw  %}From: Deranged Mutant<EMAIL_ADDRESS>Date: Fri, 16 Feb 1996 15:01:39 +0800
To<EMAIL_ADDRESS>Subject: Re: Remailers Pose Risk
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

-----BEGIN PGP SIGNED MESSAGE-----

>    Computerworld, February 12, 1996, Front page:
>
>    Stealth E-mail poses corporate security risk
>
>    By Gary H. Anthes[..]
>    Anonymous remailers on the Internet are emerging as a
>    threat to national and corporate security, some experts
>    warn.

FNORD!
[..]
>    For corporate information systems managers, stealth E-mail
>    is especially troubling because it allows hackers to attack
>    systems, steal trade secrets and broadcast them worldwide
>    without leaving an audit trail for authorities to follow.

Dumpster-diving the corporate offices and mailing the results to the
media doesn't leave much of an audit trail either. Perhaps a problem lies
in their own security...

>    "Anonymous remailers have a lot of nasty potential," said
>    Stephen T. Kent, chief scientist for security technology at

So do kitchen knives or automobiles.
[..]
[..]
>    One snowy day last month, for example, about 25% of the
>    workforce at a defense contractor in Rockville, Md., went
>    home after they received a bogus E-mail message dismissing
>    them for the day. The message originated from an anonymous
>    remailer that allowed the user to impersonate a senior
>    company official.

Was that a remailer or simply forged mail?
>    Last year, the U.S. Supreme Court struck down an Ohio law
>    that required the authors of political posters and
>    pamphlets to identify themselves. "In the case of political
>    speach, you can't make people tell you who they are," said
>    Patrick Sullivan, executive director of the Computer Ethics
>    Institute in Washington.

BTW, "Docket 93-986 -- Decided April 19, 1995" from Cornell's Law site

[..]
>    "As in the case of smallpox, yellow fever, flu epidemics,
>    AIDS or malaria, it will take disasters before the public
>    may accept that some forms of restrictions on the
>    electronic freedom of speech and  that  privacy may be
>    worthwhile."FNORD!
[..]
>    Do's and don'tsAhem
>    Unethical or illegal uses of anonymous remailers:[..]
>    -  To violate copyright lawsScientology...
>    -  To encourage others to commit unethical or illegal
>       behaviorAhem. Illegal<>Unethical... it may be very ethical to violate some laws.
And then again, so what about unethical? So what if an anonymous poster
advocates adultury or pilfering paperclips from your employer...
- ---
[This message has been signed by an auto-signing service.  A valid signature
means only that it has been received at the address corresponding to the
signature and forwarded.]

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
Comment: Gratis auto-signing service

iQBFAwUBMSQGzCoZzwIn1bdtAQFw8wF/Ta61GbzPyYQR9CZPl7TEa6gA3O32OyLS
OqQeEA6k/Ehtd0TjCdMRRfsOOf6xfQ5w
=zBHu
-----END PGP SIGNATURE-----

{% endraw %}
```

## Thread

+ Return to [February 1996](/archive/1996/02)

+ Return to "[Deranged Mutant <wlkngowl@unix.asb.com>](/authors/deranged_mutant_wlkngowl_at_unix_asb_com_)"

+ 1996-02-16 (Fri, 16 Feb 1996 15:01:39 +0800) - Re: Remailers Pose Risk - _Deranged Mutant<EMAIL_ADDRESS>


text:
# Contribute to ButterFly

We are happy to contribute source code to you and make ButterFly getting better and better. Please read the following guidelines carefully before you submit your code.：
* [Code of Conduct](https://github.com/alibaba/butterfly/blob/master/docs/CODE_OF_CONDUCT.md)
* [Issue rule](#issue-submit)
* [Pull request rule](#pull-request-guidelines)

##  Issue rule
* Before you submit a question, search the archive to see if there is a problem.

* Check if the issue has been fixed, please use the latest version of the master repository to develop.

* As much as possible in the report to explain the problem, for example, what is your environment? What browser and operating system are experiencing problems? Do other browsers have different display errors? What do you expect from the results? It's best to reproduce the error, provide clear steps or a demo.

## Pull request rule

* Please fork a copy to your own project, do not build branches directly under the warehouse.

* The commit information should be filled in as `[component name]: description information`, for example `[canvas]:fix xxx bug`.

* If you have fixed the bug or added a code to test, add a test!

* Be sure to rebase before submitting the PR to keep the commit records clean.

* Make sure the PR is committed to the `dev` branch instead of the `master` branch.

* If the bug is fixed, please give a description in the PR.


text:
# openVALIDATION Language Server Backend

[![npm version](https://badge.fury.io/js/openvalidation-languageserver-backend.svg)](https://badge.fury.io/js/openvalidation-languageserver-backend)

This package starts the REST-API of openVALIDATION specially for being used by the openVALIDATION-Language-Service.
Since the REST-API is written in Java the package loads the platform-specific openJDK version to run the generated JAR.

This only happens, when no Java ist installed on the system.


text:
# vault-pam-ui
Vault PAM UI - a web client to connect to an existing Vault server.

#### License
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)

#### Pipeline status
[![Pipeline status](https://gitlab.com/mountaingapsolutions/vault-pam-ui/badges/develop/pipeline.svg)](https://gitlab.com/mountaingapsolutions/vault-pam-ui/pipelines)

#### Test coverage
[![Coverage report](https://gitlab.com/mountaingapsolutions/vault-pam-ui/badges/develop/coverage.svg)](https://mountaingapsolutions.gitlab.io/vault-pam-ui)

## Quick start guide
1. Install [Node.js](https://nodejs.org).
2. Run `npm install`.
3. Run `cp .env.TEMPLATE .env` (You will need the actual values from a fellow developer).
4. Run `npm start`.

## Running the built application
To run the client with built code locally, execute the following:
```
$ npm run build
$ cd dist
$ npm install --production
$ USE_HSTS=false PORT=8080 npm run startprod
```

## Application stack
### Front End
- [React](https://facebook.github.io/react/docs/why-react.html) - JavaScript library for building user interfaces.
- [React Redux](http://redux.js.org/index.html) - Application state container.
- [React Router](https://reacttraining.com/react-router) - Declarative routing library for React.
- [Material UI](https://material-ui.com/) - React components that implement Google's Material Design.

### Back End
- [Express.js](https://expressjs.com) - Web application framework. The ubiquitous Node.js web server.
- [Sequelize](http://docs.sequelizejs.com) - Node.js ORM for PostgreSQL, MySQL, MariaDB, SQLite and Microsoft SQL Server.
- [Socket.IO](https://socket.io) - Library to enable realtime bi-directional communication between clients and servers.
- [Nodemailer](https://nodemailer.com) - Node.js SMTP library for sending email notifications.
- [Vault](https://www.vaultproject.io]) - The secrets engine behind the application.

### And More...
- For the exhaustive list of libraries leveraged by the application, refer to the list of `dependencies` in the [package.json](../package.json) manifest file.

## Application dependencies
- [Node.js](https://nodejs.org/) - JavaScript runtime built on [Chrome's V8](https://developers.google.com/v8/) engine. In practical terms, when running the [client application locally](../README.md), an [Express server](http://expressjs.com/) instance is started providing a simple proxy router with CORS support.
- [npm](https://www.npmjs.com/) - JavaScript package manager. In fact, it goes hand in hand with Node.js. When you download Node, npm will come packaged together with it.
- [Babel](https://babeljs.io/) - JavaScript ES6 (aka ES2015 or ECMAScript 6) compiler, or [transpiler](https://en.wikipedia.org/wiki/Source-to-source_compiler) to be more precise. Because the client application is written in ES6, the source code must be transpiled to standard ES5 syntax for browsers that do not yet support it.
- [webpack](https://webpack.github.io/) - Module bundler. In short, when running a build of the client application, webpack is used to bundle and package all the individual JavaScript modules into one or more compiled files to lessen the overhead of making multiple network requests.
- For the exhaustive list of application development dependencies, refer to the list of `devDependencies` in the [package.json](../package.json) manifest file.

## Code organization
### /src/app
- Any and all frontend code.
- React + Redux
### src/services
- Any and all server code.
- Express + Node.js

## General coding style
- Use an indent of 4 spaces, with no tabs. And absolutely under no circumstances shall there be a mixture of both spaces and tabs. Lastly, please refrain including trailing spaces within the codebase. Anywhere.
- When comparing equality, use the triple-equals operator (`===`) to enforce type safety.
- All methods must be accompanied by a JSDoc description.
- All private method names should be prefixed by an underscore (e.g. `_invokeHelperMethod() {...}`.
- Unless there is a specific reason, method definitions for a class should follow this order:
    1. constructor method
    2. private methods
    3. protected methods
    4. public methods
- Use single quotes for strings.
- The codebase is full ES6. As such, avoid using `var` to declare variables. Instead, use `let` or `const` where appropriate. Additionally, when declaring functions, the arrow syntax is preferred (e.g. `(myArg) => {...}` vs. `function(myArg) {...}`).

## Naming conventions
- All variables names should be camel-cased.
- Singleton classes should be **lower camel cased**.
- Abstract/base classes should be prefixed with an underscore.

## Code delivery standards
- Prior to delivering _any_ code changes, be sure to run:
    - `npm run lint`
    - `npm test`

## Installation through Docker
- Pull the latest Docker image: `docker pull mountaingapsolutions/vault-pam-ui:latest`
- `./install.sh`
    - The script will first look for the .env and validate the environment variables. There is an option not to use this file and fill up the custom values instead.

### Build from base images
- `./install.sh --build`

## Vault data setup
For Vault PAM UI to function properly, the following **must** be present:
- A `pam-approver` internal group exists. Members within this group act as request approvers. For additional information regarding groups, refer to the official [Vault documentation](https://learn.hashicorp.com/vault/identity-access-management/iam-identity#step-3-create-an-internal-group).
- Standard users must be granted `list` access to the paths that they are supposed to see. Example:
```
path "secrets/*"
{
    capabilities = ["list"]
}
```

## FAQ
- Q: How do I find the complete set of REST endpoints that Vault PAM UI invokes?
    - A: You can access the custom REST APIs through [Swagger](http://localhost:3000/rest/api).

repository: mountaingapsolutions/vault-pam-ui

branch_name: refs/heads/develop

gha_language: JavaScript

repo_name: mountaingapsolutions/vault-pam-ui


text:
# Motimize Postman

Collection of Postman requests and environment to work with Motimize. Motimize is an open source self-hosted REST web service to optimize and compress images.

## Installation :rocket:
Download `motimize.postman_collection.json` and `motimize.postman_environment.json` files and import them to your Postman application.

Postman collection need URL to your Motimize instane to work properly. You can set URL to your instane in [environment settings](https://www.getpostman.com/docs/v6/postman/environments_and_globals/manage_environments).

## License :book:
The project is licensed under the [MIT](https://github.com/motivast/motimize-postman/blob/master/LICENSE).

Copyright (c) 2018-present, Motivast

repository: motivast/motimize-postman

repo_name: motivast/motimize-postman


text:
## CodeMeta Task Force

### Aligning schema.org with CodeMeta vocabulary

The CodeMeta community has created a vocabulary adapted to describe software and specifically research software, by including a codemeta.json file in the root directory of your repository.

The vocabulary is a subset of schema.org (see [issue 161](https://github.com/codemeta/codemeta/issues/161)).

The following terms are not part of schema.org:
- softwareSuggestions
- maintainer
- contIntegration
- buildInstructions
- developmentStatus
- embargoDate
- funding
- issueTracker
- referencePublication
- readme

To easily work on the properties propositions, it would be best to use
the detailed table with the following columns for each item:

status of each term:

- term
- type
- description
- lead
- status
- proposal text
- issue on CodeMeta
- issue on schema.org
- similar terms
- similar proposals
- Wikidata term
- Notes

#### Dashboard: [Google spreadsheet](https://docs.google.com/spreadsheets/d/1VmUBdgaC7mtj7gDNqTBzPUdosux1R26Cyp7qA7WHkNA/edit?usp=sharing)

### The steps for the adoption workflow

For each step you do, *update* in the Dashboard the status of the proposal with the step number and notes relative to the proposal

1. [done for all] *Choose* a property and note you are the lead for its preparation.
2. *Check* if there has been a proposal for this property on schema.org repository with or without label:"schema.org vocab"  ([all issues](https://github.com/schemaorg/schemaorg/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+))
3. *Check* if the property exists on schema.org in other classes for a different domain (consider that the property may exist but its label may be a synonym of the property identified in Codemeta)
4. *Check* if the property exist on Wikidata ([https://www.wikidata.org/wiki/Q7397](https://www.wikidata.org/wiki/Q7397)) which will help in community consensus (see [Wikidata issue on schema.org](https://github.com/schemaorg/schemaorg/issues/280))
5. *Prepare* a proposition text.

Here are a couple of examples:

- [https://github.com/schemaorg/schemaorg/issues/809](https://github.com/schemaorg/schemaorg/issues/809)
- [https://github.com/schemaorg/schemaorg/issues/148](https://github.com/schemaorg/schemaorg/issues/148)
- [https://github.com/schemaorg/schemaorg/issues/2300](https://github.com/schemaorg/schemaorg/issues/2300)
- Add interesting examples here

6. *Post* issue on the CodeMeta repository with the proposal to get feedback from the CodeMeta community and improve proposal and fix proposal submission date on schema.org: [https://github.com/codemeta/codemeta/issues/160](https://github.com/codemeta/codemeta/issues/160)
7. *Post* issue on schema.org with one or more labels:

  - [org vocab](https://github.com/schemaorg/schemaorg/labels/schema.org%20vocab)
  - [type:exact proposal](https://github.com/schemaorg/schemaorg/labels/type%3Aexact%20proposal)
  - [type:small proposal](https://github.com/schemaorg/schemaorg/labels/type%3Asmall%20proposal)


text:
---
layout: default
---

# (Unknown Date) - No Subject

## Header Data

From: Anonymous

To: _N/A_

Message Hash: 1ff1722de832aac0dfc1fee95e8eac74a55bb2a3c6c8e23dcee270546af7902e

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: (Unknown Date)

Raw Date: _N/A_

## Raw message

```
{% raw  %}From: Anonymous
Date: Tue Sep 07 12:57:54 1999
Subject: No Subject
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Ayse Sercan wrote:

> At any rate, if I were the mother, and my kid was being led away by a
> clerk who could have been the very pervert who thought that those nude
> pictures meant child pornography, I'd certainly do everything in my power
> to protect my child from such an individual.

That's rediculous. The mother did not flip because Zona led the child away.
The mother flipped when asked about the photos. This caused Zona to not
want the child to see argument. The mother just has serious problems in
general. She feels justified in trashing the place and throwing the lamp,
which is why she refused the punishment and took 30 days in jail. She,
in the presence of her child, was wrong to get violent. She has a lack of
control.

--

617/253-6515   http://grim.media.mit.edu

{% endraw %}
```

## Thread

+ Return to "[Anonymous](/authors/anonymous)"

+ (Unknown Date) (None) - No Subject - _Anonymous_


text:
# LucidLink
Features:
* Dream journal
* Random-voice-prompt engine
* Muse eeg monitor
* User scripts

Download page: https://play.google.com/store/apps/details?id=v.lucidlink
Task list: https://trello.com/b/2ZYLJ2l1/lucid-link

### Prepare

1) Ensure prerequisite programs are installed: Git (+TortoiseGit), NodeJS, Android SDK, VirtualBox, Genymotion
2) Ensure prerequisite Android SDK packages are installed: [...]
3) Ensure prerequisite npm modules are installed: react-native-cli
4) Ensure a virtual Android 5+ device is set up in Genymotion (which uses VirtualBox). (or have an Android 5+ device)

### Install

1) Clone this repo to your computer using git. (I use TortoiseGit)
2) Open console in "Main" folder, and run "npm install".
3) Fix metro-bundler file (temp; till I update react-native): https://stackoverflow.com/a/58798648/2441655
4) Make sym-link from "./node-modules/react-native-libmuse" to "Source/react-native-libmuse". (temp)
5) Replace "./node_modules/rn-spinner/index.js" with (temp): https://github.com/RNComponents/rn-spinner/blob/f6b817071b22ea491acfe144ea191470ac1e9172/index.js

### Compile and run

1) Start up the virtual Android device. (or connect Android device through usb/wifi)
2) Compile the TS (TypeScript) files to JS, either by:
2.A) Open the project in Visual Studio Code and run the build task. (ctrl+shift+b)
2.B) Run ```npm run dev``` in main folder.
3) Build the Android project, and start the JS packager, either by:
3.A) Run "react-native run-android" in main folder.
3.B) Run "react-native start" in main folder, then press "Launch" in Android Studio. (preferred if Android Studio is open, to avoid file-usage clashes)
4) On first launch, the js won't load, because the server address+port aren't specified. Set these through the react-native options panel, and reload.

### Making changes

* For JS (ui) changes, edit the files in "Main/Source". (I use Visual Studio Code)
* For Java changes, edit the files in "Main/android/app/src". (I use Android Studio)

### Troubleshooting

For common troubleshooting solutions (for developers), see Troubleshooting.md.

repository: Venryx/LucidLink

repo_name: Venryx/LucidLink


text:
# Mattermost

**Estimated Time:**

* Smart Hands Preparation Time: 15 mins
* Deployment Time: 20 mins

## Prerequisites

* These instructions assume running in windows
* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest) - included in install bits
* Latest version of [PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7) - included in install bits
* [Porter](https://porter.sh) - included in install bits
* Access to a functional Openshift 3.11 cluster

## Deployment (testing) Instructions

Running the deployment will connect to Azure using the cli, copy files to the bastion, and deploy into the kubernetes cluster.

1. Open `./deployment/deployment.vars.ps1` in a text editor. We're going to change a few variable values before starting the deployment.

1. In the `AZ CLI Configuration` section, update the following values:

    ```powershell
    [string] $DepArgs.SubscriptionId = ""
    [string] $DepArgs.TenantId = ""
    ```

1. (optional) Change the PostgreSQL username from its default values

    ```powershell
    [string] $DepArgs.PostgresUsername = "postgres"
    ```

1. (optional) Change the PostgreSQL password from a generated value

    ```powershell
    [string] $DepArgs.PostgresPassword = Get-RandomString 15 -IncludeNumber
    ```

1. (Optional) Update the default namespace for Mattermost from its default value

    ```powershell
    [string] $DepArgs.Namespace = "ns-mattermost"
    ```

1. Update the `AppUrl` to use the same DNS that was setup in the OCP deployment. The ip address that this should resolve to is the `RouterPrivateClusterIp` from the OCP deployment. Below is the default value.

    ```powershell
    [string] $DepArgs.AppUrl = "mattermost.apps.dev-openshift.com"
    ```

1. You will need to find the ip for the `ContainerRegistry` from the OCP deployment. Then vm names ends in `SYDR-001v`.

    ```powershell
    [string] $DepArgs.ContainerRegistry = "<IP_ADDRESS>:5000"
    ```

    > **[!TIP]**
    > You can run the following command to get the ip address of the container registry for OCP. If you changed the naming of the OCP cluster, you will need to account for that.
    >
    > `az vm show -g AZS-DEP-OCP-RG94 -n BETA-EAST-SYDR-001v -d --query privateIps -o tsv`

1. The `SshKey` is the default setup from the OCP deployment. If a new key was generated, then the value much be updated here and the key must be placed in the `/certs/` folder.

    ```powershell
    [string] $DepArgs.SshKey = "cfs-cert"
    ```

1. (Optional) Update email and smtp settings.  If you wish to enable email notifications, update the following values in the variable file.

    ```powershell
    [bool] $DepArgs.EmailNotifications = $false
    [bool] $DepArgs.EnableSmtpAuth = $false
    [string] $DepArgs.SmtpUsername =<EMAIL_ADDRESS>    [string] $DepArgs.SmtpPassword = ""
    [string] $DepArgs.SmtpServer = "smtp.office365.com"
    [int] $DepArgs.SmtpPort = 587
    ```

1. If you changed the naming for the OCP cluster, you will need to update the `ResourceGroup` and `BastionMachineName` to match those changes.

1. To begin the deployment:
    1. Open `pwsh.lnk`
    1. Navigate to the `deployment` folder beside these instructions
    1. Run the following command to execute install file and start the deployment

    ```powershell
    ./install.ps1 -VariableFile ./deployment.vars.ps1
    ```

## Post Deployment Steps (success criteria)

The output from the installation will complete in a matter of minutes, however, the pods that get spun up will take upwards to 20 minutes to finish post installation steps.

After waiting, open a browser and navigate to **https://[AppUrl]/**. Remember that the OCP installation uses self signed certificates by default. The means that when opening Mattermost, you will have to chose to continue past an untrusted certificate because the issuer is not know. However, we know that we can trust the certificate because we just completed the install.

You will be prompted to create an initial administrative account when first visiting the landing page. After creation, you'll be able to log in with the account you just created and then begin configuring Mattermost for additional users.

## Troubleshooting Guide (error mitigation plan)

All installation logs are output to the `./deployment/output/` folder. Look there first for any issues. There are no known issues with this deployment.

repository: Azure/ato-toolkit

gha_language: PowerShell

repo_name: Azure/ato-toolkit


text:
---
title: Modeling in Code
---
####Read the following in advance:

1. An Introduction to Mathematical Modeling (http://www.maths.bris.ac.uk/~madjl/course_text.pdf)

2. Agent Based Models: (http://www.palgrave-journals.com/jos/journal/v4/n3/full/jos20103a.html)

####If you have time, also consider:

3. Compartmental Models and Mathematical Epidemiology

(http://www.springer.com/cda/content/document/cda_downloaddocument/9783540789109-c1.pdf?SGWID=0-0-45-532715-p173817706)

4. Other modeling techniques, software, code packages

(http://pycx.sourceforge.net/) about: (http://www.casmodeling.com/content/1/1/2)

repository: tjhladish/seams

branch_name: refs/heads/gh-pages

repo_name: tjhladish/seams


text:
# Presentation
This project performs a ICP mapping with a graph-based slam from a dataset gathered in underwater enviroement.

I have tried and installed it on ubuntu 14.04 LTS.
# Requirements

* dlib 18.18
* kalman filter librairy 1.3
* ROS indigo or kinetic
* rviz
* cmake
* Eigen3
* Octave (freeware, only used to display the result of the slam)

## Installation
### dlib C++ library

Dlib is a modern C++ toolkit containing machine learning algorithms and tools
for creating complex software in C++ to solve real world problems.  See
[dlib website](http://dlib.net for the main project documentation and API reference)

Type the following to compile the librairy after the Download of dlib 18.18:
  first go to the dlib-18.18 folder.

	cd dlib
	mkdir build
	cd build
	cmake ..
	sudo make install

Please refer to README.txt of dlib for more information.

### kalman filter librairy
Please refer to INSTALL.txt of kalman librairy for more information.

### g2o librairy
g2o is an open-source C++ framework for optimizing graph-based nonlinear error functions.
The librairy is a git repository you can find it [here](https://github.com/RainerKuemmerle/g2o).

To use it you need some requirements to build :
* cmake
* Eigen3

You can install them manualy or follow the full installation [here](http://sayantanfoto.blogspot.se/2015/06/installing-g2o-on-ubuntu.html).

# How to run
To launch the dataset from an abondoned marina near St. Pere Percador, Spain :

	// go to abondonedmarina package
	mkdir bagfiles
	cd bagfiles
	// set your data files
	roslaunch abondonedmarina marina.launch file:=myDataSetName.bag

In this package, only the ICP mapping is perform.

To launch the dataset from the Stevens pier on the Hudson river :

	// go to mapping package
	mkdir bagfiles
	cd bagfiles
	// set your data files
	roslaunch mapping mapping.launch file:=myDataSetName.bag

In this package you can find the scan matching slam, with feedback on rviz, and a graph-based slam on background. The resuts of the graph-based slam can be find on the Octave folder.

# OctaveFiles folder
In this folder you can find programs displaying the slam results. Please refer to [README.txt] (filtering process/OctaveFiles/README.txt) on OcataveFiles folder.

# License
This project is licensed under the MIT License. However, some librairies are available under different license terms.
Please refer to README.txt of the g2o librairy for more information.

repository: marwahaha/filteringprocess

repo_name: marwahaha/filteringprocess


text:
---
title: mom_hud_speedometer_colorize
category: var
tags:
  - hud
  - speedometer
  - color
minimum_value: 0
maximum_value: 1
default_value: 1
---

Toggles the speedometer colorization. Off = `0`, On (Based on acceleration) = `1`, On (Staged by relative velocity to max.).


text:
floodgate [![Build Status](https://travis-ci.org/moznion/floodgate.svg?branch=master)](https://travis-ci.org/moznion/floodgate)
==

A tool to accumulate input from STDIN and flush that with according to rule.

Usage
--

### Options

```
Options:

  -h, --help              display help
  -i, --interval[=0]      intarval time to flush (second)
  -t, --threshold[=0]     throshold size of memory to flush (byte)
  -c, --concat[=\n]       character to concat for each line
      --stderr            flush to STDERR (default: STDOUT)
```

### Examples

#### Accumulate input and flush that every 30 seconds

```
$ tail -F /path/to/file | floodgate --interval=30
```

#### Accumulate input and flush that when buffer size is reached to 300 bytes

```
$ tail -F /path/to/file | floodgate --threshold=300
```

#### Accumulate input and flush that when buffer size is reached to 300 bytes or after waiting 30 seconds

```
$ tail -F /path/to/file | floodgate --interval=30 --threshold=300
```

Author
--

moznion<EMAIL_ADDRESS>
License
--

MIT

repository: moznion/floodgate

repo_name: moznion/floodgate


text:
# REST-Scaffold.js

![npm](https://img.shields.io/npm/v/rest-scaffold)

`rest-scaffold.js` is a JavaScript library for building scaffolds (tables +
actions) that represent objects which are exposed by a RESTful API.

## How It Works

The basic idea is that you have some API at `https://example.com/api/thing` and
you provide a `div` with a `data-rest-scaffold` property which is a
configuration in the form of a JSON, like:

```json
{
  "title": "Things",
  "subtitle": "that go in the kitchen",
  "recordTitle": "Thing",
  "pkField": "id",
  "url": "https://example.com/api/thing",
  "csrfToken": "blahblah"
}
```

If you're using a tool like
[`django-rest-scaffolds`](https://github.com/gregschmit/django-rest-scaffold)
to generate all this, then the tool can escape the quotes in the JSON.
Otherwise, using single quotes for the property is helpful.

The `div` would look like this:

```html
<div data-rest-scaffold='{
  "title": "Things",
  "subtitle": "that go in the kitchen",
  "recordTitle": "Thing",
  "pkField": "id",
  "url": "https://example.com/api/thing",
  "csrfToken": "blahblah"
}'></div>
```

The library will assume the following endpoints exist:
- `GET`->`thing` A listing of the objects
- `POST`->`thing` A creation of a single object
- `GET`->`thing/pk` A retrieval of a single object
- `PUT`->`thing/pk` A update of a single object
- `DELETE`->`thing/pk` A deletion of a single object

## CDN Links

https://cdn.jsdelivr.net/npm/rest-scaffold/dist/rest-scaffold.js

https://cdn.jsdelivr.net/npm/rest-scaffold/dist/rest-scaffold.css

## Configuration Options

### Common Options

`apiType` (string, default: `"plain"`) : This defines the structure of the API
that we are interacting with. `plain` indicates that a listing should return a
JSON list with no pagination. If you use Django with the Rest Framework
paginator, then you should put `django-paged`. This is a shortcut configuration
option and the individual attributes that this affects can all be edited
selectively.

`title` (string, default: `""`): The main bold text shown at the top of the
scaffold.

`subtitle` (string, default: `""`): Lighter text shown after the title at the
top of the scaffold.

`url` (string, default: `"/"`): The url that we should use to access the REST
API.

`csrfToken` (string, default: `""`): Cross-Site Request Forgery token to use
during `POST`/`PUT` requests.

`debug` (boolean, default: `true`): Whether debugging information (including
request payload) should be displayed in scaffold error messages.

`fields` (array, default: `[]`): The fields that we should expect. If this is
falsy, then the scaffold will try to infer them from a listing.

`pkField` (string, default: `"id"`): The field that we can use as a primary
key.

### Other Options

`actionsLabel` (string, default: `"."`): The label for the actions column in
the scaffold.

`csrfTokenHeader` (string, default: `"X-CSRFToken"`): The HTTP header for
passing the CSRF Token.

`isPaged` (boolean, default: `false`): Whether the API listing returns results
in a paged format.

`rawCreateForm` (string, default: `null`): The HTML create form.

`rawUpdateForm` (string, default: `null`): The HTML update form.

`recordTitle` (string, default: `"Record"`): The name for a single record.

## Development

To build:

    $ npm run-script build

For watch/compile for any changes:

    $ npm run-script watch

repository: gregschmit/rest-scaffold

repo_name: gregschmit/rest-scaffold


text:
---
layout: post
title:  "Rough program logic of FindBugs 0.5.2"
date:   2015-7-8
tags:
- Lab
- FindBugs
---

###Rough running sequence of FindBugs 0.5.2:
* FindBugs.examineClass()
* BytecodeScanningDetector.visitClassContext()
* JavaClass.accept()
* PreorderVisitor.visitJavaClass()
* PreorderVisitor.visitMethod()
* PreorderVisitor.visitCode()
* BetterVisitor.visitCode()
* DismantleBytecode.visit()

###More Question:
* Why BetterVisitor can call DismantleByteCode?

##Posible explanation
* DismantleByteCode extends BetterVisitor
* DismantleByteCode is abstract
* Or, explanation is not hiding here(in extend and abstract)?
(Maybe refer to BCEL manual, PDF highlighted part)

extension: markdown

filename: 2015-7-8-b.FindBugs Structure.markdown


text:
# Setting up the development environment for BSD operatings systems such as NetBSD, FreeBSD, Dragonfly BSD, or OpenBSD

## Required software

Building OpenToonz from source requires the following dependencies:
- Git
- GCC or Clang
- CMake (3.4.1 or newer).
- Qt5 (5.9 or newer)
- Boost (1.55 or newer)
- LibPNG
- SuperLU
- Lzo2
- FreeType
- LibMyPaint (1.3 or newer)
- Jpeg-Turbo (1.4 or newer)
- OpenCV 3.2 or newer

## OpenBSD example
```
# pkg_add git cmake pkgconf boost qt5 lz4 usb lzo2 png jpeg glew freeglut freetype json-c mypaint opencv
```
For programs such as SuperLU or Jpeg-Turbo, you might need to compile from source.

Notes:
* It's possible we also need `libgsl2` (Called gsl in BSD systems or maybe `libopenblas-dev` (called just blas in BSD.))
* We may also need `libegl1-mesa-dev libgles2-mesa-dev libglib2.0-dev liblzma-dev` Install the BSD equivilency to those GNU/Linux packages. They might not be available as precompiled packages, so compiling from source might be required.
* If your BSD operating system doesn't have the up to date packages such as gsl, you may install them by compiling from source.

Continue the instructions as stated in [the linux guide](https://github.com/opentoonz/opentoonz/blob/master/doc/how_to_build_linux.md) to finish the compilation.

repository: manongjohn/OTX

gha_license_id: NOASSERTION

repo_name: manongjohn/OTX


text:
Enter to win a free ebook!
date: '2013-05-12T13:58:53-05:00'
status: publish
path: >-
  /amandas-books-and-more-calls-miri-attwater-and-the-oceans-secret-a-mermaid-story-like-no-others-enter-to-win-a-free-ebook
author: ES Ivy
excerpt: ''
type: post
category:
  - Book Reviews
  - Miri Attwater
---
![Children's book week 231x300](/uploads/2013/05/childrens-book-week-231x300.gif)I’m so excited to be a part of my first give-away! To celebrate Children’s Book Week, May 13-19, I’m taking part in a blog hop through [Mother Daughter Book Reviews](http://motherdaughterbookreviews.com/). Renee linked me up with the lovely Tina at [Amanda’s Books and More](http://abooksandmore.blogspot.com/2013/05/5-mermaid-ebooks-giveaway.html).

This week, we’ll be giving away FIVE free ebooks of Miri Attwater and the Ocean’s Secret!

Here’s what Tina had to say about the book:
“\[Miri Attwater and the Ocean’s Secret is\] a really neat mermaid story like no other for girls ages 6 – 12. I read the first book in the series and got really caught up in the story. I wanted to read more!”

So, don’t wait! Hop on over to [Amanda’s Books and More](http://abooksandmore.blogspot.com/2013/05/5-mermaid-ebooks-giveaway.html) and enter the Rafflecopter give-away now! (Contest closes 5/19/2013.)

Then go to the end of Tina’s post to look up the other blogs on the hop to enter for even more prizes!


text:
---
layout: post
title: Knockout.js Widget Binding
date: 2013-02-27 04:38
header-img: "img/headers/code.jpg"
author: Matthew
comments: true
---
Over the past few months I have been working a lot of JavaScript and with that comes it's fair share of "new hotness" frameworks. One that I always use though is [knockout.js](http://knockoutjs.com). For those that don't know knockout is basically a MVVM framework for JavaScript and well it's pure magic made from unicorns! Anyway one of the most common things that I have been doing is using knockout templates and creating jQuery UI widgets. For instance I want to add another item to a grid and wire up a bootstrap tooltip widget. I can do this after binding takes place and every time binding is updated, or I can create a custom knockout binding. So here it is, one of a growing number of helpers that I will be sharing over the next few weeks.

{% gist osbornm/5045086 %}


text:
esp8266-wifi-setup
======

ESP8266 Wifi setup using SoftAP, Captive Portal and EEPROM.

1. booting and read Wifi config from EEPROM.
2. if Wifi config is not found, starting SoftAP at SSID "LyariWiFi_SETUP".
3. connect this Access point with your devices. (ex. iPhone, Android...)
4. Wifi Settings page will automatically open by Captive Portal.
5. select the SSID, enter the password.
6. writing SSID and password to EEPROM, then reboot ESP8266 automatically.
7. booting with STA(client) mode and get IP address from DHCP, then start web server.
8. now you can connect from within the same LAN.

日本語の解説は[ブログ](http://eleclog.quitsq.com/2015/08/esp8266-wifi-setup.html)を参照してください。

## Wiring

Boot from flash memory:

* GPIO 0 - Pulled HIGH with a 10k resistor
* GPIO 2 - Pulled HIGH with a 10k resistor
* GPIO 15 - Pulled LOW with a 10k resistor

![schematic](https://raw.githubusercontent.com/9SQ/esp8266-wifi-setup/master/schematic.png)

If GPIO 0 pin is pulled low during power-up it will start firmware flashing mode.

See also [official documents](https://github.com/espressif/esptool/wiki/ESP8266-Boot-Mode-Selection).

## Demo
### mobile
![sample](http://3.bp.blogspot.com/-ETIrnJynYj8/VdzTZQfJqLI/AAAAAAAATPU/_qUS0v57Bk0/esp8266-wifi-setup.gif)

### serial monitor
![sample_serial](http://2.bp.blogspot.com/-OOwLd6lHLTY/VdzWCOpQFUI/AAAAAAAATPg/9M1z1Lm3iWQ/s600/esp8266-wifi-setup_serial.png)

## Requirements

* [Arduino core for ESP8266 WiFi chip](https://github.com/esp8266/Arduino)


text:
This is an application that can make you write script with the Go language.

It is *NOT* an interpreter but the pure Go. The preprocessor tranforms the script into a Go program, instantly compiles and runs. So it is almost same as the standard Go with the same efficiency.

Benefits

- Pure Go language. No need to learn a new script language.
- Pre-imported packages and pre-defined functions make it easy to code.
- Seamless integration with the Go project. E.g. can easily load configuration or data file from the Go project.
- Running efficiency same as Go, much faster than Python.

### Example

* Simple

```go
#!/bin/gosl

import "encoding/json"

toJson := func(lines []string) string {
  res, _ := json.Marshal(struct {
    Lines []string `json:"lines"`
  }{
    Lines: lines,
  })
  return string(res)
}

files := BashEval("ls -l %s", "/tmp/")

Println(toJson(Split(files, "\n")))
```

* [Go Search](http://go-search.org/) is now operating with gosl. So you can find some good examples at: https://github.com/daviddengcn/gcse/tree/master/scripts

* [go-diff](http://github.com/daviddengcn/go-diff) also provides scripts in gosl: https://github.com/daviddengcn/go-diff/tree/master/scripts

### Installation and Usage

#### Download and install the package

```bash
go get github.com/daviddengcn/gosl
go install github.com/daviddengcn/gosl
```

#### (Optional) Link to `/bin`

```bash
sudo ln -s $GOPATH/bin/gosl /bin/gosl
```

If you don't want to do this, the interpreter line can be like this, assuming `$GOPATH/bin` is in your `$PATH`:

```bash
#!/usr/bin/env gosl
```

#### Run a script

If a script starts with the bash interpreter line: `#!/bin/gosl`. You can run it like this

```bash
chmod a+x example.go
./example.go [params...]
```

Or you can explictly call `gosl` to run it:

```bash
gosl example.go [params...]
```

### Pre-imported Packages

The following packages are pre-imported with `.`, i.e. you can directly use the methods exported by them. No complain of the compiler if you don't use them.

`fmt`, `os`, `strings`, `strconv`, `math`, `time`, and `github.com/daviddengcn/gosl/builtin`

### Frequently Used `builtin` Functions

Method | Description | Example
--------|------------|-----------------------
`S`     | Convert anything to a `string` | `S(1234) == "123"`
`I`     | Convert anything to an `int`   | `I("1234") == 1234`
`BashEval` | Similar to bash backtick substitution. | `lsstr := BashEval("ls -l")`
`Exec`  | Execute an command with arguments  | `err, code := Exec("rm", "-rf" "tmp")`
`Bash`  | Execute a bash line           | `err, code := Bash("rm -rf tmp")`
`ScriptDir` | Returns the directory of the script | `file := ScriptDir() + "/" + fn`

More functions are defined in package [daviddengcn/gosl/builtin/](https://github.com/daviddengcn/gosl/tree/master/builtin) ([godoc](http://godoc.org/github.com/daviddengcn/gosl/builtin))

### License

Apache License V2

repository: ibmendoza/ezdocs

repo_name: ibmendoza/ezdocs


text:
# FranticApparatusObjC

[![CI Status](http://img.shields.io/travis/jkolb/FranticApparatusObjC.svg?style=flat)](https://travis-ci.org/Justin Kolb/FranticApparatusObjC)
[![Version](https://img.shields.io/cocoapods/v/FranticApparatusObjC.svg?style=flat)](http://cocoadocs.org/docsets/FranticApparatusObjC)
[![License](https://img.shields.io/cocoapods/l/FranticApparatusObjC.svg?style=flat)](http://cocoadocs.org/docsets/FranticApparatusObjC)
[![Platform](https://img.shields.io/cocoapods/p/FranticApparatusObjC.svg?style=flat)](http://cocoadocs.org/docsets/FranticApparatusObjC)

## Important

Found a bug in 1.0.0 that causes an infinite loop. Please upgrade to 1.0.1 as soon as possible.

## Usage

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

See the Swift version of [FranticApparatus](https://github.com/jkolb/FranticApparatus) for more information about promises and how to use the library.

## Installation

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

    pod "FranticApparatusObjC"

## Author

Justin Kolb<EMAIL_ADDRESS>
## License

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

repository: jkolb/FranticApparatusObjC

gha_language: Objective-C

repo_name: jkolb/FranticApparatusObjC


text:
# mapserverapi

[//]: # (automatically generated from https://github.com/metwork-framework/github_organization_management/blob/master/common_files/README.md)

**Status (master branch)**

[![GitHub CI](https://github.com/metwork-framework/mapserverapi/workflows/CI/badge.svg?branch=master)](https://github.com/metwork-framework/mapserverapi/actions?query=workflow%3ACI+branch%3Amaster)
[![Maintenance](https://raw.githubusercontent.com/metwork-framework/resources/master/badges/maintained.svg)](https://github.com/metwork-framework/resources/blob/master/badges/maintained.svg)

## What is it ?

This is a tiny C library to invoke [mapserver](http://mapserver.org) engine
as a library (with no daemon or CGI).

## Build

### Prerequisites

- mapserver installed
- standard compilation tools (gcc, make...)
- glib2 library and corresponding headers

### Building

To build the library you must specify:

- `MAPSERVER_LIB_DIR`: the full path of the directory containing `libmapserver.so`
- `PREFIX`: the full path of the directory where you want to install the library

For example:

```
make MAPSERVER_LIB_DIR=/opt/mapserver/lib PREFIX=/usr/local clean all install
```

### Testing

You must have `valgrind` tool installed.

```
make MAPSERVER_LIB_DIR=/opt/mapserver/lib PREFIX=/usr/local test
```

## Usage

### Compilation flags

The library use `pkg-config` tool. So you can use the following command to
get the compilation flags:

```
pkg-config --cflags --libs mapserverapi
```

If not found, you may have to add `PREFIX` at the end of `${PKG_CONFIG_PATH}`
environnement variable.

### In your code

```C
#include <mapserverapi.h>

// [...]

# Init the library (mandatory)
mapserverapi_init();

gchar *mapfile_content;
# [...]
# Put a mapfile content into mapfile_content string

# Set a WMS query_string (for this example)
gchar *query_string = "LAYERS=ocean&TRANSPARENT=true&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_xml&SRS=EPSG%3A4326&BBOX=-180.0,-90.0,180.0,90.0&WIDTH=500&HEIGHT=250"

# Invoke mapserver
void *body;
gchar *content_type = NULL;
gsize body_length;
gboolean b = mapserverapi_invoke(mapfile_content, query_string, &body, &content_type, &body_length);
if (b == TRUE) {
    # you have the full body (PNG image in this example) in body variable (this buffer is managed by the library, don't free it by yourself !)
    # you have the body length in body_length variable.
    # you have the content_type of the body in content_type variable (you have to free it after use).

    # [...]

    # free content_type when you have finished with them
    # (but don't free body variable)
    g_free(content_type);
}

# Destroy the library
mapserverapi_destroy();
```

### Uninstalling

```
make MAPSERVER_LIB_DIR=/opt/mapserver/lib PREFIX=/usr/local uninstall
```

## Contributing guide

See [CONTRIBUTING.md](CONTRIBUTING.md) file.

## Code of Conduct

See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) file.

## Sponsors

*(If you are officially paid to work on MetWork Framework, please contact us to add your company logo here!)*

[![logo](https://raw.githubusercontent.com/metwork-framework/resources/master/sponsors/meteofrance-small.jpeg)](http://www.meteofrance.com)

repository: metwork-framework/mapserverapi

gha_language: C

repo_name: metwork-framework/mapserverapi