text:
---
layout: post
title: "[Ruby on Rails] Send limited mail on staging environment"
date: 2015-04-28 17:16:33 +0800
comments: true
categories: ["Ruby on Rails"]
keywords: "staging, Ruby on Rails, howto, mail, interceptor, actionmailer, settingslogic"
description: "this article show you how to avoid sending mail to real user on staging server"
---

For simulating production environment, we will build up a stage machine.

Plus, we usually use the copy of production database in stage server.

In some applications, we will send email to users for some purposes such as confirmation mail after user

register, reset password mail...etc.

And, in staging environment, we have to avoid our operators accidentally send email to real users.

Therefore, we have to implement some codes for filtering.

Let's go

<!-- more -->

According to [Action Mailer Basics](http://edgeguides.rubyonrails.org/action_mailer_basics.html#intercepting-emails), we can register an interceptor to avoid some unexpected actions.

And my requirement is I want staging server can send mail to our employees. In our case, our company mail address is<EMAIL_ADDRESS>So, we have to implement code that only allow email server send to users like<EMAIL_ADDRESS>

## Step1. *Gemfile*

    gem 'settingslogic'

## Step2. Add a lib on *app/lib/settings.rb*

    class Settings < Settingslogic
        source "#{Rails.root}/config/application.yml"
        namespace Rails.env
    end

## Step3. Add your white list on *application.yml*

    defaults: &defaults
      allowed_send_mail_domain<EMAIL_ADDRESS>
    development:
      <<: *defaults

    test:
      <<: *defaults

    production:
      <<: *defaults

## Step4. Write a interceptor on *app/interceptor/staging_mail_interceptor.rb*

ref: [Filtering emails on staging](http://renderedtext.com/blog/2012/04/27/filtering-emails-on-staging/)

    class StagingMailInterceptor

      def self.delivering_email(message)
        message.to = extract_allowed_recepients(message)
        message.perform_deliveries = false if message.to.empty?
      end

      private

      def self.extract_allowed_recepients(message)
        message.to.select { |address| allowed_address?(address) }
      end

      def self.allowed_address?(address)
        allowed_domains = Settings.allowed_send_mail_domain.split(',')

        matches_allowed = allowed_domains.count { |domain| address.include?(domain) }

        matches_allowed != 0
      end

    end

## Step5. Register interceptor to ActionMailer on *app/config/initializers/sandbox_email_interceptor.rb*

    require 'staging_mail_interceptor'

    if Rails.env.staging?
      ActionMailer::Base.register_interceptor(StagingMailInterceptor)
    end

## Done

repository: alChaCC/blog

repo_name: alChaCC/blog


text:
## Introduction
The IBM Streams Messaging Toolkit is designed to get you connected to your messaging servers as quickly as possible. Kafka is an ideal messaging server for stream computing. This guide will get you sending and receiving messages in no time, and will highlight some of the best practices. We will also cover how to get the Kafka operators running in a consistent region.

## Skill Level
Readers of this guide are expected to have a basic understanding of Kafka and IBM Streams terminology. To get up to speed on Kafka basics, run through their great Quick Start guide. To get a basic understanding of IBM Streams, you can read our Quick Start.

## Requirements
Prior to using Kafka operators, the following software must be installed and configured:

* **IBM Streams** - A [Quick Start Edition VM](../4.1/Install-VM) is available for free. This guide assumes that you have a Streams domain and instance up and running.
* **Messaging Toolkit 4.0+** - You can download it from the IBM Streams Github Messaging Toolkit Repository Release Page.
* **Kafka Brokers** - This guide assumes you are using Kafka 0.9 or above. To quickly get a Kafka server up and running, follow these directions.

## Information to Collect
Once you have your Kafka server (or servers) set up, you will need their hostnames and listener ports. You can find them in your configuration file for each server (default is `<Kafka-Install>/config/server.properties`):

            # The port the socket server listens on
            port=9092

            # Hostname the broker will bind to. If not set, the server will bind to all interfaces
            host.name=myhost.mycompany.com

## Steps - Send and Receive Messages
1.    **Configure the SPL compiler to find the messaging toolkit directory. Use one of the following methods.**
    *    Set the STREAMS_SPLPATH environment variable to the root directory of the toolkit (with : as a separator)

            export STREAMS_SPLPATH=<messaging-toolkit-location>/com.ibm.streamsx.messaging:$STREAMS_SPLPATH

    * Specify the -t or --spl-path command parameter when you run the sc command.

            sc -t $STREAMS_INSTALL/toolkits/com.ibm.streamsx.messaging -M MyMain

        If  Streams Studio is used to compile and run SPL application, add messaging toolkit to toolkit locations in Streams Explorer by following [these directions](http://www.ibm.com/support/knowledgecenter/SSCRJU_4.1.1/com.ibm.streams.studio.doc/doc/tusing-working-with-toolkits-adding-toolkit-locations.html?lang=en).

2. **Create an SPL application and add a toolkit dependency on the Messaging toolkit in your application.** You can do this by [editing the application dependency](http://www.ibm.com/support/knowledgecenter/SSCRJU_4.1.1/com.ibm.streams.studio.doc/doc/tcreating-spl-toolkit-app-elements-edit-toolkit-information-dependencies.html) in Streams Studio, or by creating/editing the info.xml for the application and adding the dependency directly (you can also just start with the KafkaSample to skip this and the following step).

    Sample info.xml from the KafkaSample:

        <?xml version="1.0" encoding="UTF-8"?>
        <info:toolkitInfoModel xmlns:common="http://www.ibm.com/xmlns/prod/streams/spl/common" xmlns:info="http://www.ibm.com/xmlns/prod/streams/spl/toolkitInfo">
          <info:identity>
        <info:name>KafkaSample</info:name>
        <info:description>Sample application showing a Streams Kafka Producer and Consumer</info:description>
        <info:version>1.0.0</info:version>
        <info:requiredProductVersion><IP_ADDRESS></info:requiredProductVersion>
          </info:identity>
          <info:dependencies>
            <info:toolkit>
              <common:name>com.ibm.streamsx.messaging</common:name>
              <common:version>[3.0.0,6.0.0)</common:version>
            </info:toolkit>
          </info:dependencies>
        </info:toolkitInfoModel>

3. **Add the Kafka operator use directives to your application.** If Streams Studio is used, this directive is automatically added when dragging and dropping a Kafka operator onto SPL application in the graphical editor (if you start with a sample from the messaging toolkit, this step is already done for you).

        use com.ibm.streamsx.messaging.kafka::*;

    or

        use com.ibm.streamsx.messaging.kafka::KafkaProducer;
        use com.ibm.streamsx.messaging.kafka::KafkaConsumer;

4. **Configure the Kafka Producer to send messages to a Kafka Broker.** You must:

    * Create a producer.properties file and place it in the `etc` directory of your application. **This ensures that it will be included in the .sab application bundle (important for cloud and HA deployment)**. The following is a sample producer.properties file. See here for more producer configuration details.

            bootstrap.servers=broker.host.1:9092,broker.host.2:9092,broker.host.3:9092
            acks=0

    * Specify the location of the producer.properties file in the KafkaProducer operator using the propertiesFile parameter.You can specify either an absolute or a relative file path, where the path is relative to the application directory:

            propertiesFile : etc/producer.properties

    * Specify the Kafka topic to send messages to.** This can be done via the rstring topic attribute in the incoming tuple or you can specify this using the topic parameter in the KafkaProducer (see the highlighted code in the beacon operator below).

    Here is the sample beacon and KafkaProducer code from the KafkaSample:

        //create some messages and send to KafkaProducer
        stream<rstring topic, rstring key, rstring message> OutputStream = Beacon() {
            param
                initDelay : 5.0;
                period : 0.2;
            output
                OutputStream: topic = $topic
                            , message = "Reality is merely an illusion, albeit a very persistent one."
                            , key = "Einstein";
        }
        () as KafkaSinkOp = KafkaProducer(OutputStream) {
            param
                propertiesFile : "etc/producer.properties";
        }

Notice: We don't specify the topic as a parameter, but instead as a part of the incoming tuple. This means that each incoming tuple can be directed towards a different topic.

4. **Configure the Kafka Consumer to receive messages from the Kafka Broker.** You must:

    * **Create a consumer.properties file and place it in the `etc` directory of your application.** Here is a sample consumer.properties file (for more details on Kafka Consumer configs, see here:

            bootstrap.servers=broker.host.1:9092,broker.host.2:9092,broker.host.3:9092
            group.id=mygroup

    * **Specify the location of the consumer.properties file in the KafkaConsumer operator using the propertiesFile parameter:**

        `propertiesFile : etc/consumer.properties`

    Specify the Kafka topic (or topics) to subscribe to receive messages from.** Do this using the rstring topic parameter in the KafkaConsumer. You can subscribe to multiple topics by using a comma separated list:

        topic: "topic1" , "topic2" , "topic3";

	Here is the KafkaConsumer operator from the KafkaSample:

            stream<rstring key, rstring message> KafkaStream = KafkaConsumer()
            {
                param
                    propertiesFile : "etc/consumer.properties";
                    topic : $topic;
            }

Tip: Not seeing any messages coming into your consumer? You may have stray consumers in the same consumer group reading from your topic. Try adding this as a KafkaProperty parameter:

    kafkaProperty : "group.id=" + (rstring) getTimestampInSecs() ;

## Consistent Regions

Kafka operators support consistent regions, which are sections of your operator graph where tuple processing is guaranteed. The KafkaProducer can participate in a consistent region (it cannot be the start), and can guarantee at-least-once tuple processing. No special configuration is required to use the KafkaProducer in a consistent region, so this section will only focus on the KafkaConsumer.

The KafkaConsumer supports exactly-once tuple processing and starts a consistent region (since it is a source).
  For general questions on consistent region, read this overview and these docs.

To start a consistent region with a KafkaConsumer, you must:

1. **Place an `@consistent` annotation above the operator**

2. **Specify the partition parameter**  - The partition refers to the Kafka topic partition that we will maintain exactly-once processing for. This example is for a single-partition topic, but for a three-partition topic you can simple specify: `partition: 0,1,2;`
3. **Specify triggerCount parameter for operatorDriven trigger** - The trigger count gives you control over the approximate number of messages between checkpointing. If you are using a periodic trigger for your consistent region, you do not need to specify this.
Here is the KafkaConsumer from the KafkaConsistentRegionConsumerSimple sample:

         //Read in from a kafka server and start consistent region
         @consistent(trigger = operatorDriven)
         stream<rstring message, rstring key> KafkaConsumerOut = KafkaConsumer()
         {
             param
                 propertiesFile : "etc/consumer.properties" ;
                 topic : $topic ;
                 partition : 0 ;
                 triggerCount : 20 ;
         }

## Parallel Consuming
Consuming in parallel lets you take advantage of the scalability of both Kafka and Streams. Kafka allows for parallel consumption of multi-topic partitions via consumer groups. Any consumer with the same `group.id=<consumer-group-name>` will be a part of the same consumer group and will share the partitions of a topic. If you would like to directly control which partitions your consumer is reading from, you can do that by specifying the `partition` parameter in the KafkaConsumer operator.

Best Practice: For a multi-partition topic, you can have as many consumers as you have partitions (if you have more consumers than partitions, they will just sit idly).

The easiest way to consume from a single topic in parallel is to:

* **Use @parallel with a width equal to the number of partitions in your topic:**

    `@parallel(width = $numTopicPartitions)`

    Here is a simple example of using three consumers to read from a 3-partition topic using User Defined Parallelism:

        @parallel(width = 3)
        stream<rstring message, rstring key> KafkaConsumerOut = KafkaConsumer()
        {
            param
                propertiesFile : "etc/consumer.properties" ;
                topic : $topic ;
        }

If you would like to consume in parallel within a consistent region, check out this KafkaConsistentRegionConsumerParallel sample.

## Advanced Parallel Processing
**This section is under construction**

## Connecting to Message Hub in the Cloud
You can use the Streams Kafka operators to produce to and consume from the Kafka-based Message Hub Bluemix service. For a complete guide on how to do this, check out this great article.

## Additional Resources
* Streams Messaging Toolkit SPLDoc
* Kafka Documentation website
* Kafka Streams Performance Summary

branch_name: refs/heads/master

extension: markdown

license_type: permissive


text:
# Real-World Design Patterns

## Give a Star! :star:

If you liked my work and want to support me, please give it a star. Thanks!

## Introduction
In software engineering, **Design Patterns** are typical solutions to commonly occurring problems. They propose **well-defined**, **decoupled**, **reusable**, **easily testable**, and **extensible** software components. The idea was introduced in the Architecture area and then adapted for software engineering by the legendary **Gang-of-Four (GoF)**.

## Benefits
- Already validated and documented solutions
- A common vocabulary for the team
- Maintainability, testability, reuse, and more

## Motivation
Since there are a lot of misconceptions and some controversy about **real-world use cases** and the **benefits** of **Design Patterns**, I've decided to create this repository where I'll develop and share some implementations of them. Each pattern will have a **README** file with a **components relationship diagram** and explanations about it.

## Language
The code will be in **C#**, but the concept is **language agnostic**. Some languages make it easier to implement some patterns, **Kotlin**, for example, has a **Singleton** native implementation with _object_ modifier, and **Python** has a native **Decorator**. On the other hand, languages that don't have _interfaces_ need some workaround with _abstract classes_. But at the end of the day, each one can deliver the same results.

## Patterns
### Behavioral
- [Strategy](Patterns/Behavioral/RealWorldDesignPatterns.Strategy)
- [Rules Engine](Patterns/Behavioral/RealWorldDesignPatterns.RulesEngine)

### Creational

### Structural
- [Decorator](Patterns/Structural/RealWorldDesignPatterns.Decorator)
- [Adapter](Patterns/Structural/RealWorldDesignPatterns.Adapter)

## SOLID
In **2000** Robert C. Martin (a.k.a. **Uncle Bob**) published the _Design Principles and Design Patterns_ paper. In this paper, he introduced the **SOLID** principles. Resuming, they are five principles that make software designs more **understandable**, **flexible**, and **maintainable**.

### Single Responsibility Principle - SRP
The patterns suggest using dedicated components instead of multipurpose ones. In **Strategy Pattern**, for example, each strategy is responsible for itself and should not know about others. **SRP** has a similar approach, proposing that each component should have only one reason to change.

### Open-Closed Principle - OCP
The **OCP** quotes that a software module should be open for extension but closed for modification. The **Decorator** and other patterns do that. With Decorator, you can extend your software component's behaviors without touching implementation.

### Liskov Substitution Principle - LSP
While using the patterns, you will notice constant care about **polymorphism**, **inheritance**, and **composition**. Good use of these principles will simplify the understanding of **LSP** because when you make good use of these concepts, each component could be replaceable for a parent without extra conditions.

### Interface Segregation Principle - ISP
**Separation of Concerns** and **Encapsulation** are recurrent concerns in the patterns. Favor a decoupled, focused communication between the components is the **Mediator's** intent. So, keeping  a module free from dependencies that he doesn't need, as **ISP** proposes, occurs naturally.

### Dependency Inversion Principle - DIP
**DIP** says that a software module should depend upon abstractions instead of implementation details. Similarly, the patterns favor **Contract-Based Communications** between components. The **Rules Engine** pattern, for instance, abstracts low-level rules implementation details from the service that is validating the operation. The service only needs to know that he must apply some rules. The details about how many rules or what is validated don't matter for him.

repository: j-didi/real-world-design-patterns

branch_name: refs/heads/main

extension: md

repo_name: j-didi/real-world-design-patterns


text:
# EJS/Scss Site WebStorm Template

A template using WebStorm file watchers to compile Scss and EJS and move assets to build directory.

Uses bash to copy files to build directory and generate new project directory.

## Usage

1. Install Sass and EJS-CLI globally

    ```bash
    sudo npm install -g sass ejs-cli
    ```

2. Clone this repository

    ```bash
    git clone https://github.com/h-crocker/EJS-Scss-WebStorm-Template.git
    ```

3. Create new project

    ```bash
    cd EJS-Scss-WebStorm-Template/
    ./new-project.sh "New Project Name"
    ```

4. Open new project using WebStorm

5. If needed navigate to "Settings -> Tools -> File Watchers" and adjust each watcher to point to the correct command for Sass, ejs-cli, and bash

license: MIT

repository: h-crocker/EJS-Scss-WebStorm-Template

repo_name: h-crocker/EJS-Scss-WebStorm-Template


text:
# Conversion Measurement API

Feb 22, 2021

Meet link: [https://meet.google.com/jnn-rhxv-nsy](https://meet.google.com/jnn-rhxv-nsy)

Use Google meet “Raise hand” for queuing

# Agenda

*   Introductions
*   Scribe volunteer
*   App to web conversions → continue discussion
    *   [https://github.com/WICG/conversion-measurement-api/issues/54](https://github.com/WICG/conversion-measurement-api/issues/54)
    *   4x4 grid
    *   Webview security model and support limitation
    *   Built-in click verification
    *   Click verification composed with blind-signature authentication
*   View-stuffing fraud prevention ([#101](https://github.com/WICG/conversion-measurement-api/issues/101))
*   False-positive event reporting w/ fraud prevention ([#111](https://github.com/WICG/conversion-measurement-api/issues/111))
*   Any other business

# Attendees — please sign yourself in!

1. Brian May (dstillery)
2. Brendan Riordan-Butterworth (IAB Tech Lab / eyeo GmbH)
3. Charlie Harrison (Google)
4. Erik Anderson (Microsoft)
5. Erik Taubeneck (Facebook)
6. Ben Savage (Facebook)
7. John Delaney (Google)
8. Aditya Desai (Google)
9. Basile Leparmentier (Criteo)
10. Larissa Licha (NextRoll)
11. Andrew Pascoe (NextRoll)
12. Matt Zambelli (Neustar)
13. Danny Rojas (Google)

# Notes

App to Web Conversions

*   [https://github.com/WICG/conversion-measurement-api/issues/54#issuecomment-782204187](https://github.com/WICG/conversion-measurement-api/issues/54#issuecomment-782204187)
*   Ben Savage
    *   Show an ad within an app that opens safari web browser
        *   PCM supports this specific use case
    *   On facebook ,show ads in app that take you to a WKWebview instance
        *   It could be possible to support this in a Safari View Controller / (CCT equivalent)
    *   Websites rendered in Webviews / view controllers might care about measuring conversions as well
*   Charlie - Is supporting webview conversions a non starter?
*   Ben - Concerns regarding view controller support, due to timing attacks etc. Could use conversions to track when view controller is active due to delayed sending. This is even harder for WebView. Need some system level integration to implement delay + reporting sending. Can you manipulate a webview environment to enabled tracked?
    *   Two goals, don’t enable tracking and verify user gestures.
    *   CCT is similar to safari view controller. Has some trust boundaries, and even less in WebView
    *   Are there any other goals on the Chrome team?
*   Brad - Should CCT/Web cells all be filled?
*   Charlie - Yes, this should all work out of the box
*   Ben - Is there shared storage? If I click on an ad in CCT and then convert the day later in Chrome browser, does that work?
*   Brad - Yes this works out of the box
*   Charlie - We see needs for every one of these cells. We are envisioning this as each of the cells on the left, (app + webview) to send their events into Chrome/CCT. Unclear if this includes conversions, mostly focused on impressions/clicks. App->Web. WebView->Web are higher priority at the moment. Unclear story for webviews, which may be wose than WkWebView. WkWebview renders out of process (maybe), which introduces some boundary between the app. The same is not true for Android webview which doesn’t have any boundaries.
    *   Android Webviews are in-process, code can be written on the fly from the app, network requests can be intercepted, etc.
    *   Publisher origins/impression origins are important for rate limiting etc. Webviews could allow apps to fake impressions for other origins
    *   Looking at attributing events to the top level APK, rather than origins. Wouldn’t support clicking links inside of a webview for a specific ite
*   Brad - Could imagine that facebook itself is implementing measurement on behalf of sites that are being rendered in a webview. Falls on the browser container to handle these associations.
*   Ben Savage - That sounds interesting, but complicated and hard. From a privacy perspective, ideally apps wouldn’t be responsible for holding and relaying other parties data. If you are attributing events to the app, how do we verify that these clicks are legitimate?
*   Erik Taubneck - Do to a lack of trust boundary, you essentially have to treat the webview as being the app.
*   Charlie - Basic approach for verifying clicks is exposing a new browser API, which could be implemented by any browser. At a high level, you would need to package an “input” event to the call. In the new version of Android, there is a way to verify input events against the system. Will need other techniques to guarantee that you can’t reuse verified input events, etc. Only the newest Android can support this (11+). Not possible in older versions. For apps, they would need to track the input events for each click. Harder for webview, there may be some approach with having the webview implementation track these events.
*   Erik Taubneck - What types of events can be verified here? Can you verify that a certain image was shown, etc?
*   Charlie - We are only talking about verifying inputs, e.g. did a click happen. Chrome the browser doesn’t even have the capability today to verify this with click coordinates. More authentication will require relying on the blind signature verification. Need to think more about how these can be composed.
*   Ben Savage - Apps on android can ask for permissions, ushc as accessibility which give lots of controls like “when an app is installed”. When an app is installed, show an ad for the app and simulate a click. Click fraud is very common, especially click spamming/click stuffing. Not limited to fake user gestures. Terrible user experiences where the ad pops up without the user realizing they are clicking. Lots of ways to make a user “accidentally” click. Needed other protections, e.g. dropping conversions where the user clicked and browser for less than x seconds. Should try an avoid incentivizing poor user experiences.
*   Charlie - Is there similar behavior on web?
*   Ben Savage - Yes, also happens on web.
*   Charlie - Would you be supportive of having a broad threshold implemented by the API. E.g. a minimum time between impression and conversion/
*   Basile - There may be ways to game any limits. Would be nice to have the availability to change it.
*   Erik Taubneck - Having a generalized aggregate API would be beneficial. Being able to set these limits based on your own priors would be useful.
*   Brendan Butterworth - Focusing on primitives and allowing systems to define their own thresholds is great, having a global baseline can make it a hassle.
*   Charle - Talking about enforcing a time between impression and conversion.
*   Ben Savage - If you do not have a minimum bar, there is a financial incentive to compete. They will lower the bar for themselves to take credit for more things. There is financial incentive that could introduce a race to the bottom for this limit. Even some minimum however small is necessary.
*   Basile - Agree its good to have a minimum, but should have the ability to customize. Would make the API more usable.
*   Brendan - Having a common default baseline is a good thing.

Erik - Some approach for using blind signature auth alongside click verification.

View stuffing (#101) -

*   Erik Taubneck - Just as with clicks, the same click stuffing can be done for views. Whatever limits there are, any adversary will push up against the limit to try and claim credits / generate reports.
*   Charlie - Original idea for signatures is that they go to a 3rd party configured by the tag. In our current design, the simplest thing is to you the reporting origin as the one to sign impressions.
*   Erik - Giving tokens can be tricky in an open web setting, when you don’t know what publisher you will be on. There may need to be some request when an ad is shown
*   Charlie - Makes sense to request tokens after viewability requirements are met
*   Erik - May want to verify that the number of ads you paid for matched up to the number of tokens you registered
*   Charlie - Only if your definition of bidding and viewability match up
*   Erik - You need to trust the source, as they are requesting the token
*   Charlie - In some cases you are on the page and have javascript running. Can use these when requesting a blind signature to have more context.
*   Erik - Is it possible to avoid the real time request by having the publisher have a set of tokens, and give one for each request.
*   Charlie - It makes sense for the reporting origin to request/manage these tokens.
*   Mehul Parsana - Ad tech provider would know if the user is real, even when the ad is authentic on a publisher. Could try to overlay with a Trust token. Does signature request carry additional context to get signed?
*   Charlie - For every event you are signing, there are a set of signals you are collecting that come alongside the event. It wont be perfect. Can ask the server if this set of signals look trusted. This can include 1P cookie information and site activity on the 1P.
*   Mehul - Talking about a completely compromised client. Most fraud systems look at cross site behavior rather than 1P data. How many domains did you visit in the last 24 hours, etc. Currently possible via 3P cookies.
*   Ben Savage - Have seen click farms. In our proposal you sign the click and conversion with the same nonce. Just clicking wont get you any conversions. Harder to simulate conversions that have value. Need to have a click and conversion on the same device. Prevents stealing conversion events from other browsers. If there is a conversion payload, not signing that there was a conversion, but signing what the conversion was with a partially blind signature. If you can guarantee there are all signed on the same device it is more costly to forge these.
*   Mehul - Conversion rate is low, only need to simulate a few conversions to get many clicks through. Need a way to determine that the user and click looks organic.
*   Erik - Just trying to validate that a source said a click happened, and a destination says that a conversion happened. Thats the scope of the authentication here. Validating that the user is real is an important problem, but beyond the scope of this auth approach.
*   Charlie - A bit skeptical of the browser being able to verify this. Needs to be an interaction with a party who knows what is good behavior vs bad behavior. Trust tokens is one composable approach which allows conveying user level trust.
*   Ben Savage - Lookin at the distribution of revenue per user, a fraudster needs to have a weird distribution to make this work. Can potentially use aggregate API to look at whether an advertisers revenue per user is normal. At least can raise the bar for auth. Lots of conversion events which do not cost the fraudster anything.

gha_license_id: NOASSERTION


text:
---
title: HAProxy redirect root URL
tags:
  - haproxy
categories:
  - notes
header:
  overlay_filter: "0.5"
  overlay_color: "#000"
  teaser: /assets/the-most-terrifying.png
  overlay_image: /assets/the-most-terrifying.png
excerpt: How to redirect root URL to another URL
---
How to redirect root URL to another URL

```ini
## Redirect root to somewhere URL
    acl is_root path -i /
    redirect code 301 location /real/app/path if is_root
```


text:
# [Pipe Organ Trivia Game](http://alexa.amazon.com/#skills/amzn1.echo-sdk-ams.app.39c8773b-2051-46b3-93d8-df982bdd70dd)
![4.4 stars](../../images/ic_star_black_18dp_1x.png)![4.4 stars](../../images/ic_star_black_18dp_1x.png)![4.4 stars](../../images/ic_star_black_18dp_1x.png)![4.4 stars](../../images/ic_star_black_18dp_1x.png)![4.4 stars](../../images/ic_star_half_black_18dp_1x.png) 4

To use the Pipe Organ Trivia Game skill, try saying...

* *Alexa, open the pipe organ game*

* *Start new game*

* *Help*

In this trivia game, Alexa with ask questions such as....

Which classic movie featured the organ great: Toccata and Fugue in D minor by Bach??  And Alexa will score your responses.

This skill is a fun game the tests your knowledge of the many aspects the Pipe organ.

***

### Skill Details

* **Invocation Name:** the pipe organ game
* **Category:** null
* **ID:** amzn1.echo-sdk-ams.app.39c8773b-2051-46b3-93d8-df982bdd70dd
* **ASIN:** B01C6BGOHS
* **Author:** Don Holmberg
* **Release Date:** February 24, 2016 @ 15:26:00
* **In-App Purchasing:** No


text:
This gem vendors all the [font-awesome-more](http://gregoryloucas.github.io/Font-Awesome-More/) extensions through a single require (without IE7 support).  Can be used with or without less / scss.

## Usage

```
# Gemfile
# See http://rubygems.org/gems/more-font-awesome-rails for the current version
gem 'more-font-awesome-rails', '~> 3.0.2'

# application.css
//= require 'font-awesome-more'
```

If you're using bootstrap make sure to require bootstrap first.

## Versioning

`major.minor.patch` version will mirror the font-awesome-more version currently being vendored.

repository: sbkok/more-font-awesome-rails

repo_name: sbkok/more-font-awesome-rails


text:
---
layout: page
title: Eviction Process
description: Nowhere's eviction process
comments: true
---
# **Nowhere Eviction Process:**

- The following 3 people are needed to effect an eviction:
   - Malfare Shift Lead ("MSL")
   - Board Lead ("BL")
   - 1 Site Lead ("SL")

- Must have involvement of all three of the above to effect and
    eviction.

- No one else is involved in eviction decisions.

- None of the above individuals may be related to or close personal
    friends of the potential evictee, as this would constitute a
    conflict of interest.

- If the Board or Site Lead has a conflict of interests, an
    alternative, sober Board Member or Lead must be found.

- Tea & Empathy (T&E) Lead may step in for MSL if the latter has
    personal ties to the potential evictee.

## Roles

 - MSL/T&E Lead &endash; represent the health and safety interests of
     the potential evictee;
 - SL/Board Lead &endash; represent the interests of the event.

## When can someone be evicted?

 - For (suspected) criminal behaviour (theft, physical assault, sexual
    assault, rape);
 - For harmful or threatening behaviour toward other participants
    (preferably after receiving at least 1 warning if situation allows
    it).
 - Only if ALL 3 agree on eviction.

## Rules to follow
 - Eviction decisions are made behind closed doors, away from the
    general public;
 - Eviction decisions are made only by MSL, BL and SL (or their
     designated fill-ins, as outlined above), and only in unanimous
     agreement;
 - If there is no agreement, an alternative solution needs
    to be found;
 - The safety and welfare of the evictee should not be
    compromised by their eviction.

## Possible alternative solutions to immediate eviction
 - the potential evictee sobers up at T&E or Malfare before eviction;
 - the potential evictee stays at Malfare, under supervision, until
    morning when transportation and other services resume;
 - the potential evictee promises to avoid further confrontation /
    disruptive behaviour or else they will be evicted with no further
    questions or discussions;
 - friends take responsibility for the individual with the
     understanding that if the problem continues the individual will be
    evicted with no further questions or discussions;
 - the potential evictee agrees to move their tent to another area of
     the site to avoid confrontation / creating further problems;
 - a compromise is reached which the potential evictee and any others
     involved agree on.
  - these alternative solutions are to be used only if:
    1. The individual is not sober or well enough to leave site right
       then on their own;
    1. There is no further danger to any other participants on site.

**NOTE: in cases where a participant is out of control, volatile and
poses an immediate threat to themselves or others around them, law
enforcement must be called.**

repository: triphazzardUK/malfare-protocols

repo_name: triphazzardUK/malfare-protocols


text:
---
templateKey: blog-post
title: 5 Steps to a Quick Posture Fix for Neck Pain and Headache.
description: Neck pain and headaches can be an aftereffect of a bad posture. A
  sedentary lifestyle is a huge contributor to that problem.  Fact 2: neck pain and headache are often married- meaning one can trigger another.

Neck pain and headache are very common complaints in our modern-day desk-bound world. As many as [47%](https://wp.stolaf.edu/safety-committee/files/2016/06/June.pdf) of Americans suffer from a regular headache. We spend hours craning the neck in front of our computers, and after we step away from the workstation, we take that bad posture with us. We switch from computer to smartphone to driving to house chores- all with our ever-present forward head position. This repetitive postural abnormality causes a lot of tension in the upper back and neck muscles.

Wouldn’t it be nice to fix your posture and avoid the unpleasant neck pain and headaches?

In this article, I’m going to write about why do we experience these throbbing headaches and why it is crucial to keep the position of your head in mind (pun intended!). I’m also going to give you a few examples of how you can fix your posture with a few simple techniques. So read on.

## What Are the Common Types and Causes of Neck Pain and Headaches

There are many reasons why you might be suffering from a headache or neck pain or both.

The three [most common types of headaches ](https://www.bodyorganics.com.au/headache-relief-massage/)are:

1 Migraine Headaches

2 Tension Headaches

3 Cervicogenic Headaches

1. **Migraine Headaches**

   This is a [neurological condition](https://www.healthline.com/health/migraine) that can cause multiple symptoms. Migraines are identified by throbbing headaches often followed by nausea, vomiting, or sensitivity to light and sound. Migraine headaches are often hereditary and [affect women more frequently than men](1.https://migraineresearchfoundation.org/about-migraine/migraine-in-women/).

   According to [Spine-Health](https://www.spine-health.com/conditions/neck-pain/neck-pain-and-migraine-headache), out of the 12% of the population experiencing migraines headaches, nearly half complain about neck pain before and/ or during the episode of migraine.

![Migraine headache statistics](/img/group-287.png "Migraine headache statistics and symptoms")

2. **Tension Headaches**

   These are the most common types of headaches. [Tension headaches](https://www.healthline.com/health/tension-headache) are often described as mild to severe pain behind the eyes and in the head and neck. They are closely associated with the tightness of the neck and head muscles.

   Emotional stress, poor posture, and sedentary lifestyle are huge contributors to tension headaches.

![Tension headache statistics](/img/tension.png "Tension headache statistics and symptoms")

3. **Cervicogenic Headaches**

   They are secondary headaches. Secondary means that they are caused by underlying conditions. According to [Medical News Today](https://www.medicalnewstoday.com/articles/324108), conditions include neck injuries, structural problems in the neck, or constant strain on the neck due to the nature of one's job, for example, office workers, hairstylists, or manual labor.

   The cervicogenic headaches originate in the neck and radiate towards the head. These headaches are often associated with pain on one side of the head and stiffness in the neck.

![Cervicogenic headache statistics](/img/group-289.png "Cervicogenic headache statistics and symptoms")

Now that we have an overview of different types of headaches and neck pains, let's further explore those associated with an abnormal head posture.

Do you know that your head weighs about 12 pounds (5.4kg)? That doesn’t sound too heavy, BUT do you know that the more forward it leans, the heavier it is? With every inch, it moves out if its neutral alignment the weight increases by about 10 pounds (4.5kg). When misaligned, your head weight can even feel like 60 pounds (27kg). It is about five times as much as optimal!

![ The imbalance you create by holding your head out of its optimal alignment causes one side of the body to become tight while the other side becomes overstretched.

[Ortopedic and Balance Therapy](https://orthopedicandbalancetherapy.com/7-times-bad-posture-caused-your-headaches-and-neck-pain/) states that:

> Imbalance in the muscles and strength is a leading cause of injury.

The muscles that are continuously held long are overworking to counterbalance the weight of your head coming out of its desired position. The musculature of the base of your skull becomes tight, and as a result, causes headaches and neck pain.

##### How the Head Position Impacts the Rest of Your Body

The head coming out of its alignment causes your shoulder to round forward, which tightens up your chest muscles. In the long term, your upper back becomes hunched. The lousy posture continues down your spine and eventually affects your lower back.

## Quick Posture Fix

Currently, there are a lot of devices on a market that coach you about your spine position. That is great! However, if your upper back muscles aren’t mobile and strong enough, your neck will keep craning over and over again no matter how many gadgets you use.

So here is a quick fix of our seated posture that you can start applying right away!

1.  Start at the base of your spine. The moment you tuck your tail under, you are causing your back to round. It is harder to keep your head in its neutral alignment when your spine is in the „C shape.” So you want your head to stay more easily in the correct alignment? Untuck your tail and sit pretty.

2. **Find a neutral head position**

   Experience your extremes. How does it feel to move your head too far forward? How does it feel to tuck it far back? Find your neutral in between these extremes.

3. **Practice chin nods**

   One of the best exercises to help you stretch the neck and at the same time, find a correct head position. Your chin nods are not only good exercises to relieve the neck and head tension but could be used as a safe practice to look down and up without over engaging your neck muscles. Need to look up or down? Hinge!

4.  Fix their position by taking them back and down away from the ears. On top of that, try this side-lying rotation to open up the chest

5. **Keep things at the eye level**

   Okay, the screens are ever-present, and we won’t get rid of them, but for once, we can set them at the eye level to ease your neck and shoulders.

## How to Maintain the Good Posture

Taking little steps to fix your posture at the workstation is essential and has an excellent long term effect on your body. Make sure you maintain a good posture outside your desk.

To enhance the positive effects of the quick fix techniques listed above, try implementing these extra steps:

1. **Take a 15-minute break to RELEVEL your body**

   Keeping up with a well-designed personalized workout routine is essential in preventing headaches and neck pain. Just a 15-minute break can be helpful in aligning your body.
2. **Stretch your neck and shoulders**

   Stiff muscles are not going to be able to hold your position for too long. See how you can mobilize and stretch your upper back for the best assistance. (Pain from the neck to shoulder. Fight it off with these five stretches at your desk.)
3. **Get a professional massage**

   [Muscles](https://www.bodyorganics.com.au/headache-relief-massage/) that are often involved in headaches are:

   * Trapezius muscles, in particular, upper and middle fibers
   * Scalenes
   * Sternocleidomastoid (SCM)
   * Sub-occipitals
   * Splenius Cervicis

   Show this list to your massage therapist, and they can work wonders in releasing the tension headaches.
4. **Self- massage the base of your skull**

   This is one of the areas in our body that gets very tight. Tightness in the area may cause tension headaches. If you feel thumping pain in your temples or front or top of the head, give yourself a 2-3 minute massage.

    **Optimize your work station**

   Lastly, if your workstation isn’t ergonomic, you are going to be straining your body to adjust to an incorrect setup desk, chair, and monitor.

   Read how you can set up [a standing and sitting workstation to avoid the aches](https://www.relevelapp.com/blog/standing-vs-sitting-desk-how-to-set-up-your-workstation-to-prevent-the-aches/).

## Be Patient and Consistent

To see an improvement might take some time, be patient. Think, how many years did you spend in this lousy posture? It won’t change overnight, but if you are persistent and stick to your routine, your posture will improve!

If your headaches are persistent, check with your doctors are they could be a sign of a more serious underlying condition.

Stay healthy and remember just 15 minutes a day Relevel can help you keep your body ache-free!

![3 common types of headaches](/img/group-293.png "Headache and neck pain- 3 common types")

repository: marcintreder/relevel-landing-page

gha_language: JavaScript

gha_license_id: MIT

repo_name: marcintreder/relevel-landing-page


text:
# Journal Club reveal.js presentation

Here I am trying out reveal.js as a way to produce talks for journal clubs and other academic talks. I try out various features (lists, links, nested slides, images, slide numbers and maths).

To view the slides, clone the repo and open index.html in your browser. Then, navigate using the arrows on the slides or your arrow keys. To see a slide overview, press ESC.


text:
 Chrome-Extension-012MobileLoader

- versions   <IP_ADDRESS>-<IP_ADDRESS> Keeps loop checking for a non-repeative number:<PHONE_NUMBER>/054-213-6887/...
- version(s) 2.0.0.* look for numbers with four repeative digits:<PHONE_NUMBER>/054-213-9999/... (since the non-repeative rule is so rare..)
- version(s) 3.0.0.* look for five repeating digits:<PHONE_NUMBER>/054-219-9999/... (since the four repeating actually found few matches quite early..)
- version(s) 4.0.0.* look for '5555' in the number
- version(s) 5.0.0.* look for multiple "nice patterns" (more efficient matching).

- The page will show a match/no match using each phone-number's span-container-background-color.
- main-logic will keep refreshing the page until at-least one-match were found.
- sometimes the page will get-stuck, this always happens in automated-real web "test-like" pages, global TIMEOUT is set to fix that.

012Mobile uses unique-user-identification which is stored on the sessionStorage,
or in-case of non-sessionStorage supporting browsers, it will fallback to using cookie instead,
in that case that cookie IS JavaScript accessible.

Developer's HUB / Changelog

<IP_ADDRESS>
* engine update, when restart is needed it executes asynchronously, with engine-processing stop.

<IP_ADDRESS>
* efficient multi-match each number to list of "nice number" patterns, instead of single one (logic upgrade).

<IP_ADDRESS>
* changed condition to number containing '5555'.

<IP_ADDRESS>
+ adding restart points if important-elements from the work-phase are missing.

<IP_ADDRESS>
* changing the condition: looking for repeating of 5 digits..<PHONE_NUMBER>

<IP_ADDRESS>
+ adding status on document.title, helps to verbose state when window is minimized.

<IP_ADDRESS>
+ top frame (window) only.

<IP_ADDRESS>
+ notification by background color, using CSS (faster rendering).
* engine update (setTimeout is embedding-internally on click-emulation method(s), and on DOM-related-method(s), just a wrap).
* rule update.
* meaning commenting (Hebrew).

<IP_ADDRESS>
+ fail-safe reload after 30sec of inactivity, when there are no "nice numbers" found..

<IP_ADDRESS>
+ delay after DOM changes

<IP_ADDRESS>
+ initial

license: Unlicense


text:
# README

## Ruby Version:
```
2.5.1
```
## Rails Version:
```
5.2.1
```
## Setup
Check out this repository and then,
```
$ bundle install
$ bundle exec rails db:migrate
$ bundle exec rails server
```
## Features
This application doesn't provide many features in order to keep it simple. Here are the features that it does include:

- **News feed**
- **Create new post**
- **Edit Post**
- **Delete Post**
- **Create Account/Sign on/Sign out**
- **View Profile**
- **Who to Collab With screen**

## Gems Used

#### For CSS Style
- bulma
- font-awesome-sass

#### For testing
- factory_bot
- faker
- rspec

#### For debugging
- bullet
- pry-byebug
- pry-rails
- web-console
**See more details in Gemfile**

## Testing
```
$ bundle exec rspec
```
#### Data reset and sample data creation
```
$ bundle exec rails db:reset    # Data reset
$ bundle exec rails db:populate # Create sample data
```

## Licensing
This project is licensed under the MIT License - see the LICENSE.md file for details


text:
---
layout: post
title: Why not 5j?
excerpt: "In which our hero decyphers"
keywords: "aws, linux, debian, java, neo4j, install, admin, sysad"
series: aws
part: 3
---

## installing `neo4j` on aws

first of all, we're installing the latest and greatest (`neo4j v3.2`). In order to do this, I went to the project documentation found [here](http://neo4j.com/docs/operations-manual/3.2-alpha/installation/linux/debian/).

### prerequisites

first, we need us some `java` 8. I decided to go with my trust ol' `debian` environment (see aws install instructions [here](https://wiki.debian.org/Cloud/AmazonEC2Image)). At the time of writing, the newest version supported was still `jessie`, so I went with that.

Fortunately, I'm not the first person to ever install `java` 8 on `debian jessie`, so [instructions](http://neo4j.com/docs/operations-manual/3.2-alpha/installation/linux/debian/) were already readily available from `neo4j`. Not too shabby.

Just a quick heads up, though: I was unable to get the command

``` shell
apt-get install openjdk-8-jdk
```

to run successfully even after adding it to my `apt` sources files. Perhaps this was my fault. The way I dealt with this, eventually, was by being explicit about the targeted version (i.e. demanding we install the backports library, because apparently there was a non-backports version available for me in the default package repositories?). In any case, the working command was

``` shell
apt-get install -t jessie-backports openjdk-8-jdk
```

where, above, the `jessie-backports` above was the alias given to the backports repo url in my `apt` sources file (per the `neo4j` site instructions).

Confusingly, I had to open more than just the http and https ports -- I also had to open the bolt port, as that was used for the web interfact (this is spelled out *very* clearly in the documentation, but why read documentation when you canjust yolo?).


text:
# Lightweight Adventure Roleplay Kit

## Elevator Pitch

LARK is a tabletop RPG ruleset built to allow players to start playing without
needing to take a semester studying at Harvard Law first. Have a buddy that's
daunted by the volume of rules involved in picking up DnD, or have one who can't
be bothered to learn the rules of a different edition than the one he already
knows? LARK's [ruleset][rules] fits on a single printed page and takes only a
few minutes to fully understand.

LARK is also built for DMs that feel cramped or constrained by heavier
rulesets. Want to run a hard sci-fi campaign but don't feel like spending 20+
hours crafting custom house rules to adapt the swords-and-horses fantasy ruleset
you'd usually use to work for it? LARK's rules are simple and adaptable enough
to apply to just about any setting you can imagine.

## Design Considerations

If you aren't already familiar with the [rules][rules] of LARK, you should take
a moment to read them before perusing this section.

### Core Engagement

Tabletop RPGs are a lot of fun, but depending on who's playing at what table
*why* it's fun might vary. Broadly speaking, there are three core modes of
engagement for RPGs:

1. Social interaction. Everybody loves faffing about with their friends, and
tabletop RPGs provide an excuse to do just that.
1. Fantasy and Imagination. We all loved playing pretend as children; it was
both a wonderful creative outlet and an opportunity to live out in imagination
scenarios that we'd never be able to in real life. As we get older and more
jaded, though, we find ourselves needing more than a stick we found in the yard
to fashion ourselves into gallant knights. The structure and rules of RPG
systems provide that something extra.
1. Rule Hacking. The complexity of many RPG rulesets presents a puzzle of sorts
to players, namely how to become as stupid, broken overpowered as
possible without actually cheating.

LARK's simplicity makes it useless as a rule-hacking platform, which is a double
edged sword. On the one hand, if you and those at your table really enjoy
building the perfect skull-cracking barbarians and fireball-flinging wizards,
then LARK isn't for you. On the other hand, Rule Hacking is frequently at odds
with Fantasy and Imagination (just look at all the epithets for people that rule
hack too hard: munchkin, min-maxer, rules-laywer, meta-gamer), which is really
wher LARK's wheelhouse is.

To put it another way, LARK dumps Rule Hacking so it can buff Fantasy and
Imagination.

### Difficulty Curve Structure

LARK's difficulty curve has two notable theoretical attributes:

1. Difficulties grow exponentially in run length: an inconceivable task requires
twice the run of a heroic task requires twice the run of an hard task, and so
on.
1. Events (success or failure) are
[geometric](https://en.wikipedia.org/wiki/Geometric_distribution).

Both of these are in service to the difficulty curve's fundamental requirement
that difficulties be qualitatively different from one another.
[Weber-Fechner](https://en.wikipedia.org/wiki/Weber%E2%80%93Fechner_law) tells
us that in order to achieve this for quantitative features -- which difficulties
are, since they will ultimately reduce to probabilities -- we must separate them
by exponentially growing distances. A geometric methodology was chosen as a
natural double-able difficulty, since a run of length 2N is exactly two
consecutive runs of length N.

Practically, it is notable that we use a one on a 1d6 as our failure condition.
this was done for a couple of reasons:

1. A 1d6 is incredibly easy to come by, which is in line with our
simplicity-first design goals.
1. A ~17% chance of failure for an easy task is frequent enough to keep things
interesting, but uncommon enough to keep players from feeling cheated all the
time.
1. A ~5.5% chance of success for an inconceivable task lines up very nearly with
the 5% chance of rolling a "nat-20" in a d20-based ruleset, which many people
are very familiar with.

[rules]: https://github.com/alan-christopher/LARK/blob/main/pdf/lark.pdf

repository: alan-christopher/LARK

repo_name: alan-christopher/LARK


text:
# **Finding Lane Lines on the Road**
---
**Finding Lane Lines on the Road**

The goals / steps of this project are the following:
* Make a pipeline that finds lane lines on the road
* Reflect on the work in a written report

[//]: # (Image References)

[image1]: md_imgs/orig.png "Original"
[image2]: md_imgs/color_slct.png "Color Selection"
[image3]: md_imgs/gray.png "Grayscale"
[image4]: md_imgs/blur.png "Blurring"
[image5]: md_imgs/canny.png "Cannt Edge Detection"
[image6]: md_imgs/roi.png "Region of Interest Selection"
[image7]: md_imgs/final.png "Final"

---

### 1. Pipeline Description ##
Answer to Question 1 from Udacity [rubric](https://review.udacity.com/#!/rubrics/322/view).

The following sections describe the steps in the image processing pipeline. These steps are illustrated as applied to the image below:

![alt text][image1]

**1) Color Selection**
As a first step, I isolated only the colors in the image with which the systems is concerned - yellow and white (i.e.: the colors of the lane lines) - leaving all other pixels black/empty. My assumption here was that this would filter out a significant number of lines in the image that would otherwise have been created later in the pipeline during canny edge detection.

For color selection, images were converted to the [HSV](https://www.lifewire.com/what-is-hsv-in-design-1078068) color space, which made selection of specific colors easier.

In some cases, parts of the sky ended up being included in the selected colors (i.e.: they were white). These portions end up being filtered out later in the pipeline during Canny edge detection and region of interest selection.

![alt text][image2]

**2) Grayscale Conversion**
Images were converted to grayscale, as required by the Canny edge detection algorithm.

![alt text][image3]

**3) Gaussian Blurring**
A Gaussian blur was applied, as suggested in the Udcaity course work.

![alt text][image4]

**4) Canny Edge Detection**
Canny edge detection was performed on the images. Paramters were tuned manually until appropriate results were achieved.

![alt text][image5]

**5) Region of Interest Selection**
A general mathematical formula was applied to select only a portion of the image.

![alt text][image6]

**6) Hough Transform**
A Hough transform was applied to capture lines in the image. Parameters were tuned manually until appropriate results were achieved.

**7) Slope Selection and Averaging (w/in Draw Lines Function)**
The results of the Hough transform were filtered, to extract only lines within a range of slopes. This was performed separately for left and right lane lines (i.e.: they have different slopes). It's important to note that the y-intercept of each line was not considered, since there is no guarantee that it will remain the same over time. Generally, the same can be said of filtering just on the basis of slope, so care must be taken not to be too selective.

Once lines were filtered for slopes, each set of left and right lane lines - both slope and y-intercept - were averaged together, and the final mean slope and y-intercepts were used to generate final left and right lane lines, which were plotted on the image.

![alt text][image7]

### 2. Potential Shortcomings and Possible Improvements
Answer to Questions 2 and 3 of Udacity [rubric](https://review.udacity.com/#!/rubrics/322/view).

The following outline potential shortcomings and possible improvements to the pipeline:

**1) Dataset Size**
This isn't necessarily a shortcoming of the pipeline itself, but it's been validated only on a very small dataset. The dataset is also very homogenous, containing a small subset of the all possible driving scenarios (ex: daytime, nighttime, good/bad weather, various road conditions, various line qualities (ex: new versus faded lines), and the list goes on...). Even given the small sample size, the pipeline struggled in some areas, such as when the shadow of a tree passed over lane lines, or when the road switched from asphalt to concrete and lines were harder to make out.

**2) Use of Historical/Temporal Information**
Currently, the pipeline examines each image individually, without considering the position of the lane lines in time. As a result, the lines "jitter" throughout the videos as they change freely in each frame.

Lines on the road change slowly enough over time (depending on sample time) that considering historical information - by using a weighted average of the lane line definitions over time, for example - would be beneficial. This may reduce the lane "jitter" seen in the video.

**3) Lane Line Filtering**
The algorithm currently averages all perceived lane lines (see **Slope Selection and Averaging** above), meaning that all lines, regardless of size, etc, are applied equally to average. The algorithm could be improved by applying a more complex algorithm to appropriately weight lines that might more clearly depict a line direction (ex: weighted average based on line length).

**4) Consideration of Curvature**
In general, the lane lines in the dataset are relatively straight, with only low rates of curvature. Higher rates of curvature may cause issues with "line" detection.

The algorithm could be improved by using an elliptical fitting technique. Road/lane curvature could also be beneficial for use as an input to path planning/navigation algorithms as well (in the absence of more robust information such as from mapping data). This has the potential to be rather computationally intensive.

**5) Handling Traffic**
While not shown in the test videos, traffic may obstruct lines (ex: vehicles performing lane changes), and the current algorithm will struggle with this. Historical information (as discussed in point 2 above) could help with this.


text:
---
layout: default
---

# 1996-07-29 - Re: your favorite poison recipes

## Header Data

From: The Deviant<EMAIL_ADDRESS>To: jim bell<EMAIL_ADDRESS>Message Hash: cc2d6777364715b64cf557bcc883bb53891145b50ca61ccc387cd0fc7527ccb2

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-07-29 02:18:10 UTC

Raw Date: Mon, 29 Jul 1996 10:18:10 +0800

## Raw message

```
{% raw  %}From: The Deviant<EMAIL_ADDRESS>Date: Mon, 29 Jul 1996 10:18:10 +0800
To: jim bell<EMAIL_ADDRESS>Subject: Re: your favorite poison recipes
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

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

On Sun, 28 Jul 1996, jim bell wrote:

> Date: Sun, 28 Jul 1996 14:22:40 -0800
> From: jim bell<EMAIL_ADDRESS>> To<EMAIL_ADDRESS>> Subject: Re: your favorite poison recipes
>
> At 12:11 PM 7/28/96 -0700<EMAIL_ADDRESS>wrote:
> >Please post your favorite poison recipes to this mlist.
>
>
> I recommend a book called "Handbook for Poisoners," by Raymond Bond.  While
> it is mostly a collection of (mostly fictional) poison stories, the forward
> is a rather extensive non-fictional summary of poisons as was commonly known
> when the book was written, in 1950 or so.  The main problem is that it
> doesn't include the various anticholinesterases then known, such as Tabun or
> Sarin.
>

Speaking of poison's, and finding pipe-bomb info on the net and such, i
might add that it is probably safer to let your children on the net than
it is to let them play near a vegitable garden.  That is, at least if you
grow tomatos...

 --Deviant
Whatever occurs from love is always beyond good and evil.
		-- Friedrich Nietzsche

P.S. -- for those who don't know, Tomatos were, for many years, thought to
be poisonous, and whoever ate them and lived were considered to be
witches.  The reason for this is that tomato leaves have a high
concentration of CN in them.  If you don't know what CN is, just remember
not to eat any  tomato leaves, and don't drop them in HCl either.

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQEVAwUBMfwCJzAJap8fyDMVAQFNZAf/T3XPwEHYMyt2IbNKFLhu7Jm44xRatC0x
yaKVP6PRYewrea4My6UuSKsLZi+oHI0Ffhk9Ij/IOQUJNIg34YdCiE++h5r/gWiD
q1rC0EteqpMhmlRwzk0XqMCFIdP4S5gBpYKe/s5939s6cTQHIiF3YeN1Y5XbUrl9
sFQuKQkL+SuOqdYPmihyWL5qjt2+q41wE2wc+rEVLJSQYPfeu73Vb5o8ap6IvFKq
yzm8bFKJ+4cDAFFmDPLkhbNxgc+qtvO6y1ZqnV4wnnHyeZejiZIlP/j5HbN8ER15
FGvzt7u3s++CFtNjWUvrgCHbJ69QnYwvRrCsqYZybfDN7ph/uBy1EA==
=uqsa
-----END PGP SIGNATURE-----

{% endraw %}
```

## Thread

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

+ Return to "["Christopher J. Shaulis" <cjs@netcom.com>](/authors/christopher_j_shaulis_cjs_at_netcom_com_)"
+ Return to "[jim bell <jimbell@pacifier.com>](/authors/jim_bell_jimbell_at_pacifier_com_)"
+ Return to "[The Deviant <deviant@pooh-corner.com>](/authors/the_deviant_deviant_at_poohcorner_com_)"

+ 1996-07-28 (Mon, 29 Jul 1996 07:20:46 +0800) - [Re: your favorite poison recipes](/archive/1996/07/48be36ae8adce55d38fbd7f54b87e266f8e353e236dd2ecee9d009df27b6fcf7) - _jim bell<EMAIL_ADDRESS>  + 1996-07-29 (Mon, 29 Jul 1996 10:18:10 +0800) - Re: your favorite poison recipes - _The Deviant<EMAIL_ADDRESS>  + 1996-07-29 (Mon, 29 Jul 1996 10:41:47 +0800) - [Re: your favorite poison recipes](/archive/1996/07/6787cf009f542b0f7d780dbfb8a13a2dd6847d7567def8a2562d1acca0aadee9) - _"Christopher J. Shaulis"<EMAIL_ADDRESS>


text:
# Bookmarks

## Python BookMarks

* [Awesome Python](https://awesome-python.com/) - A curated list of awesome Python frameworks, libraries, software and resources.

---

1. [Learn Python The Hard Way](https://learnpythonthehardway.org/book/ex0.html)
2. [Powerful Python One-Liners](https://wiki.python.org/moin/Powerful%20Python%20One-Liners)
3. [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html)
4. [Variables and Datatypes](http://pymbook.readthedocs.io/en/latest/variablesanddatatypes.html)
5. [Google Python Introduction](https://developers.google.com/edu/python/introduction)
6. [Python OOPS](http://anandology.com/python-practice-book/object_oriented_programming.html)


text:
---
layout: post
title: 'around town'
categories:
 - imagining
---

I was going to write an essay about my sister-in-law Eva, how you can learn so much from people that society, in general, discounts because of their handicap. Maybe I will still write that essay, although I am always the most inspired when I'm around her. One thing I will say now is that she is the person I most look forward to meeting in the afterlife. We're gonna talk for a long time. Anyway, I like this picture of her I took while they were in town. This is a common look for her. Pretty scholarly, actually.

Sitting in the air and space museum, snapping some pics...this one came out the best.

The sticker at the top says:
Classical Biblical Musical

Transcendental Instrumental

ACHIEVE BELIEVE

ENLIST ATHEIST
...I have no idea what that is supposed to mean.

Fire escape, M St. NW

repository: dealingwith/poole

gha_language: CSS

repo_name: dealingwith/poole


text:
# RTL433 to MQTT Bridge hass.io addon

These are the customizable scripts for the [RTL433 to MQTT Bridge hass.io addon](https://github.com/james-fry/hassio-addons/tree/master/rtl4332mqtt).

## Scripts

### [`📡 ./rtl2mqtt.sh`](rtl2mqtt.sh)

This is the main entry point for the Docker container. It is currently set to respond to only one protocol for [AcuRite's 592TXR Temp/Humidity sensor](https://www.acurite.com/indoor-temperature-sensor-and-humidity-gauge.html), therefore it would need to be modified should more than one device type need to be handled.

repository: ItownTech/home-assistant-config

repo_name: ItownTech/home-assistant-config


text:
# gemp-swccg
GEMP-SWCCG - server/client for playing Star Wars CCG using a web browser. The program takes care of the rules so you don't have to.

## TOC

* Docker
* Vagrant
* Formats

## Docker

### Dockerfiles

* `Dockerfile` is the container configuration for gemp.
  - The environment variables that configure gemp are set to some default values in the Dockerfile.
  - The container is based on Ubuntu Focal for compatibility with development environments.
  - The container uses OpenJDK 11. Newer versions of OpenJDK, such as OpenJDK 18, have compatibility issues with gemp.
  - Both `test-log4j.xml` and `prod-log4j.xml` are copied in to the container so it can be used in either a test or production context.
  - Both test and prod log4j files configure logs to go to `/logs`.
  - gemp replays are written to `/opt/gemp-swccg/replay`. The container filesystem is ephemeral and will not persist the contents across runs.
* `db.Dockerfile` is the container configuration for MariaDB when used as a backend database in the development/test context.
  - The Dockerfile copies `./database_script.sql` and `./initial_user_setup.sql` in to the container to populate the database in a development/test context.
  - Do NOT use this container to operate a production workload.
  - The database name must be `gemp-swccg` to maintain compatibility with `database_script.sql`.

### Docker-Compose

* `docker-compose.yml` can be used, _instead of the utility scripts below,_ to create a development/test environment.
* Docker compose will build the container images.
* Before bringing up the test environment using `docker-compose`, compile gemp.

```bash
mvn clean install
docker-compose up
```

### Utility Scripts

* `docker_build.sh` will compile gemp and create the relevant container image(s).
* `docker_run_db.sh` will run the backend database in a development, or test, context.
* `docker_run_app.sh` will run the gemp server in a development, or test, context.
* `docker_purge.sh` will delete old stopped containers and images.

### Connecting to the local dev/test gemp server

* After starting the server, point your browser of choice to: http://<IP_ADDRESS>:8080/gemp-swccg/

## Running a Dev VM with Vagrant

Vagrant is a tool for automating the creation of virtual machines. This allows us to mimic the server environment more closely and have a single set of commands to run the program, regardless of what OS is used for development. Your dev machine can be used to code and compile in whatever IDE you like. The code is automatically shared with the VM, which is used to run it. The virtual machine is also capable of compiling the source using maven.

### Setup

Install vagrant (https://www.vagrantup.com/downloads.html) and virtualbox (https://www.virtualbox.org/wiki/Downloads) for your OS.

From the command line run:
```bash
vagrant plugin install vagrant-vbguest
```

This plugin keeps the host and guest OS in sync and allows directories to be seamlessly shared.

### Spinning up the VM

The following command will spin up the virtual machine, install all dependencies needed for running and compiling GEMP, and create the database if it does not already exist. From the `gemp-swccg` repository root directory, run the following command:
```bash
vagrant up
```

### Logging into the VM

Log into the VM by using the following command from the repository root:
```bash
vagrant ssh
```

### Compiling Gemp

The VM can use pre-compiled .jar and .zip files if they are located in the `gemp-swccg-async/target/` directory. However, you can also compile on the VM directly.

After running `vagrant ssh`, run the following command ON THE VM:
```
mvn clean install
```

### Running GEMP

From the SSH login direcory on the VM (`/vagrant`) run:
```bash
./run-gemp.sh
```

You can now access GEMP by visiting `http://<IP_ADDRESS>:8080/gemp-swccg/` in your browser.

The bootstrap script automatically creates 2 test admin accounts, `test1` and `test2`, with the password "test". It also creates the `Librarian` user with the password "test" and loads several sample decks. When the server first starts, it is in non-operational standby mode which does not allow games to be started. To enable operational mode, when logged in visit `http://<IP_ADDRESS>:8080/gemp-swccg/admin.html` in your browser and click the "Startup" link.

### Other VM Commands

* `vagrant halt`: Hard shutdown of the VM
* `vagrant suspend`: Soft shutdown of the VM (this is faster)
* `vagrant destroy`: Remove VM from your system

## Formats

* The formats are defined in:
  * `gemp-swccg-server/src/main/resources/swccgFormats.json`
  * `gemp-swccg-async/src/main/web/js/gemp-016/cardFilter.js`
  * `gemp-swccg-async/src/main/web/leagueAdmin.html`
* The `cardFilder.js` and `leagueAdmin.html` files are just admin pages, so the lists there are used for interacting with the content in `swccgFormats.json`.
* `swccgFormats.json` contains a list of formats in the order they will appear within the gemp system.
  * The first entry within the list will be the default format used by gemp.
  * The The display name _("name" field)_ is used within the database. Once a single game has been played for a format, the name can not be changed without manually updating the database.
  * The format of the json records is not unmarshaled is a static typed way, so you can optionally add _"comment"_ fields.

### Disabling Formats

* Formats, once used, should never be deleted from `swccgFormats.json`.
* **Disable** a format by setting the `"hall":false` field:

```javascript
  {
    "name":"Dream Cards",
    "code":"dream_cards",
    "set":[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],
    "hall":false
  },

```

### Links to Tenets

* Tenets are the guidelines behind the format.
* The tenet guides any person to be able to update the format with consistency.
* Tenets are sometimes displayed to suplement the list of format settings available in Gemp and provide additional

```javascript
  {
    "comment": "use utinni_maker.py to update the Utinni format. Do not update manually.",
    "name":"Utinni! (Jawas Only)",
    "code":"utinni",
    "setComment": "All sets are always valid",
    "set":[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],
    "bannedComment": "generate the list of banned cards with utinni_maker.py",
    "bannedIconsComment": "get reference list of icons from gemp-swccg-common/src/main/java/com/gempukku/swccgo/common/Icon.java",
    "bannedIcons":[
      "DARK_JEDI_MASTER",
      "FIRST_ORDER",
      "JEDI_MASTER",
      "SITH",
      "PERMANENT_WEAPON",
      "SIDIOUS",
      "SKYWALKER"
    ],
    "tenetsLink": "https://www.starwarsccg.org/utinni/"
  }

```

### Customizing the game time

* The `defaultGameTimerMinutes` field can be used to customize the time per game on a format.

```javascript
  {
    "name":"Open (100 cards)",
    "code":"open_100_card",
    "set":[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],
    "deckSize":100,
    "defaultGameTimerMinutes":90,
    "tenetsLink": "https://www.starwarsccg.org/100card/"
  },
```

### Banning by Icon

* Get the list of icons from `gemp-swccg-common/src/main/java/com/gempukku/swccgo/common/Icon.java`
* Use the `bannedIcons` item:

```javascript
    "bannedIcons":[
      "DARK_JEDI_MASTER",
      "FIRST_ORDER",
      "JEDI_MASTER",
      "SITH",
      "PERMANENT_WEAPON",
      "SIDIOUS",
      "SKYWALKER"
    ],
```

repository: PlayersCommittee/gemp-swccg-public

gha_language: Java

repo_name: PlayersCommittee/gemp-swccg-public


text:
VObject 3 documentation
=======================

The VObject library allows you to easily parse and manipulate [iCalendar](https://tools.ietf.org/html/rfc5545)
and [vCard](https://tools.ietf.org/html/rfc6350) objects using PHP.
The goal of the VObject library is to create a very complete library, with an easy to use API.

This project is a spin-off from [SabreDAV](http://code.google.com/p/sabredav/), where it has
been used for several years. The VObject library has 100% unittest coverage.

VObject 3 is the new and improved version of the library.

Notable new stuff:

* New and improved parser.
* Better support for vCard 2.1.
* Support for RFC6868.
* Serializing to jCard/jCal.
* Lots of tiny API improvements that combined make everything much easier.

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

VObject requires PHP 5.3, and should be installed using composer.
The general composer instructions can be found on the [composer website](http://getcomposer.org/doc/00-intro.md composer website).

After that, just declare the VObject dependency as follows:

```
"require" : {
    "sabre/vobject" : "3.0.*"
}
```

Then, run `composer.phar update` and you should be good.

Usage
-----

A few notes about the examples:

1. The assumption for every example, is that the VObject source has been
   included.
2. It's also assumed that `use Sabre\VObject` has been called to import the
   VObject namespace.
3. While sabre/vobject supports PHP 5.3, most of the examples in this document
   use syntax that has been introduced in PHP 5.4. PHP 5.4 introduces a new way
   to create arrays, which is a lot shorter and looks better. If you are
   running PHP 5.3, you may need to replace `[` and `]` with `array(` and `)`.

### Creating vCards.

To create a vCard, you can simply instantiate the vCard component, and pass
the properties you need:

```php
<?php

$vcard = new VObject\Component\VCard([
    'FN'  => 'Cowboy Henk',
    'TEL' => '+1 555 34567 455',
    'N'   => ['Henk', 'Cowboy', '', 'Dr.', 'MD'],
]);

echo $vcard->serialize();
```

This will output:

```
BEGIN:VCARD
VERSION:3.0
PRODID:-//Sabre//Sabre VObject 3.0.0-alpha5//EN
FN:Cowboy Henk
TEL:+1 555 34567 455
N:Henk;Cowboy;;Dr.;MD
END:VCARD
```

### Adding properties

Certain properties, such as `TEL`, `ADR` or `EMAIL` may appear more than once.
To add any additional properties, use the `add()` method on the vCard.

```php
<?php

$vcard->add('TEL', '+1 555 34567 456', ['type' => 'fax']);
```

The third argument of the add() method allows you to specify a list of
parameters.

### Manipulating properties

The vCard also allows object-access to manipulate properties:

```php
<?php

// Overwrites or sets a property:
$vcard->FN = 'Doctor McNinja';

// Removes a property
unset($vcard->FN);

// Checks for existence of a property:

isset($vcard->FN);
```

### Working with parameters

To get access to a parameter, you can simply use array-access:

```php
$type = $vcard->TEL['TYPE']:
echo (string)$type;
```

Parameters can also appear multiple times. To get to their values, just loop
through them:

```php
if ($param = $vcard->TEL['TYPE']) {
    foreach($param as $value) {
      echo $value, "\n";
    }
}
```

To change parameters for properties, you can use array-access syntax:

```php
<?php

$vcard->TEL['TYPE'] = ['WORK','FAX']:
```

Or when you're working with singular parameters:

```php
$vcard->TEL['PREF'] = 1;
```

It is also possible add a list of parameters while creating the property.

```php
$vcard->add(
    'EMAIL',
<EMAIL_ADDRESS>    [
        'type' => ['home', 'work'],
        'pref' => 1,
    ]
);
```

### Parsing vCard or iCalendar

To parse a vCard or iCalendar object, simply call:

```php
<?php

// $data must be either a string, or a stream.
$vcard = VObject\Reader::read($data);
```

When you're working with vCards generated by broken software (such as the
latest Microsoft Outlook), you can pass a 'forgiving' option that will do an
attempt to mend the broken data.

```php
<?php

$vcard = VObject\Reader::read($data, VObject\Reader::OPTION_FORGIVING);
```

### Reading property values

For properties that are stored as a string, you can simply call:

```php
<?php

echo (string)$vcard->FN;
```

For properties that contain more than 1 part, such as `ADR`, `N` or `ORG` you
can call `getParts()`.

```php
<?php

print_r(
    $vcard->ORG->getParts();
);
```

### Looping through properties.

Properties such as `ADR`, `EMAIL` and `TEL` may appear more than once in a
vCard. To loop through them, you can simply throw them in a `foreach()`
statement:

```php
<?php

foreach($vcard->TEL as $tel) {
    echo "Phone number: ", (string)$tel, "\n";
}

foreach($vcard->ADR as $adr) {
    print_r($adr->getParts());
}
```

### vCard property grouping

It's allowed in vCards to group multiple properties together with an arbitrary
string.

Apple clients use this feature to assign custom labels to things like phone
numbers and email addresses. Below is an example:

```
BEGIN:VCARD
VERSION:3.0
groupname.TEL:+1<PHONE_NUMBER>7
groupname.X-ABLABEL:UK number
END:VCARD
```

In our example, you can see that the TEL properties are prefixed. These are 'groups' and
allow you to group multiple related properties together.

In most situations these group names are ignored, so when you execute the following
example, the `TEL` properties are still traversed.

```php
<?php

foreach($vcard->TEL as $tel) {
    echo (string)$tel, "\n";
}
```

But if you would like to target a specific group + property, this is possible too:

```php
<?php

echo (string)$vcard->{'groupname.TEL'};
```

To expand that example a little bit; if you'd like to traverse through all phone
numbers and display their custom labels, you'd do something like this:

```php
<?php

foreach($vcard->TEL as $tel) {

    echo (string)$vcard->{$tel->group . '.X-ABLABEL'}, ": ";
    echo (string)$tel, "\n";

}
```

### iCalendar

iCalendar works much the same way as vCards, but has a couple of features
that vCard does not.

First, in vCard there's only 1 component (everything between `BEGIN:VCARD`
and `END:VCARD`), but in iCalendar, there are nested components.

A simple illustration, lets create an iCalendar that contains an event.

```php
<?php

$vcalendar = new VObject\Component\VCalendar();

$vcalendar->add('VEVENT', [
    'SUMMARY' => 'Birthday party',
    'DTSTART' => new \DateTime('2013-04-07'),
    'RRULE' => 'FREQ=YEARLY',
]);

echo $vcalendar->serialize();
```

This will output the following:

```
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Sabre//Sabre VObject 3.0.0-alpha5//EN
CALSCALE:GREGORIAN
BEGIN:VEVENT
SUMMARY:Birthday party
DTSTART;TZID=Europe/London;VALUE=DATE-TIME:20130407T000000
RRULE:FREQ=YEARLY
END:VEVENT
END:VCALENDAR
```

The add() method will always return the instance of the property or
sub-component it's creating. This makes for easy further manipulation.

Here's another example that adds an attendee and an organizer:

```php
<?php

$vcalendar = new VObject\Component\VCalendar();

$vevent = $vcalendar->add('VEVENT', [
    'SUMMARY' => 'Meeting',
    'DTSTART' => new \DateTime('2013-04-07'),
]);

$vevent->add('ORGANIZER','mailto:organizer@example.org');
$vevent->add('ATTENDEE','mailto:attendee1@example.org');
$vevent->add('ATTENDEE','mailto:attendee2@example.org');
```

### Date and time handling

Parsing Dates and Times from iCalendar and vCard can be difficult.
Most of this is abstracted by the VObject library.

Given an event, in a calendar, you can get a real PHP `DateTime` object using
the following syntax:

```php
<?php

$start = $vcalendar->VEVENT->DTSTART->getDateTime();
echo $start->format(\DateTime::W3C);
```

To update the property with a new `DateTime` object, just use the following syntax:

```php
<?php

$dateTime = new \DateTime('2012-08-07 23:53:00', new \DateTimeZone('Europe/Amsterdam'));
$event->DTSTART = $dateTime;
```

### Expanding recurrence rules

Recurrence rules allow events to recur, for example for a weekly meeting, or an anniversary.
This is done with the `RRULE` property. The `RRULE` property allows for a LOT of different
rules. VObject only implements the ones that actually appear in calendar software.

To read more about `RRULE` and all the options, check out [RFC5545](https://tools.ietf.org/html/rfc5545#section-3.8.5).
VObject supports the following options:

1. `UNTIL` for an end date.
2. `INTERVAL` for for example "every 2 days".
3. `COUNT` to stop recurring after x items.
4. `FREQ=DAILY` to recur every day, and `BYDAY` to limit it to certain days.
5. `FREQ=WEEKLY` to recur every week, `BYDAY` to expand this to multiple weekdays in every week and `WKST` to specify on which day the week starts.
6. `FREQ=MONTHLY` to recur every month, `BYMONTHDAY` to expand this to certain days in a month, `BYDAY` to expand it to certain weekdays occuring in a month, and `BYSETPOS` to limit the last two expansions.
7. `FREQ=YEARLY` to recur every year, `BYMONTH` to expand that to certain months in a year, and `BYDAY` and `BYWEEKDAY` to expand the `BYMONTH` rule even further.

VObject supports the `EXDATE` property for exclusions, but not yet the `RDATE` and `EXRULE`
properties. If you're interested in this, please file a github issue, as this will put it
on my radar.

This is a bit of a complex subject to go in excruciating detail. The
[RFC](https://tools.ietf.org/html/rfc5545#section-3.8.5) has a lot of examples though.

The hard part is not to write the RRULE, it is to expand them. The most complex and
hard-to-read code is hidden in this component. Dragons be here.

So, if we have a meeting every 2nd monday of the month, this would be specified as such:

```
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Sabre//Sabre VObject 2.0//EN
BEGIN:VEVENT
UID:1102c450-e0d7-11e1-9b23-0800200c9a66
DTSTART:20120109T140000Z
RRULE:FREQ=MONTHLY;BYDAY=MO;BYSETPOS=2
END:VEVENT
END:VCALENDAR
```

Note that I added in `UID` property. For simplicity I've kept it out of
previous examples, but do note that a `UID` property is required for all
`VEVENT`, `VTODO` and `VJOURNAL` objects!

To figure out all the meetings for this year, we can use the following syntax:

```php
<?php

$vcalendar = VObject\Reader::read($data);
$vcalendar->expand(new DateTime('2012-01-01'), new DateTime('2012-12-31'));
```

What the expand method does, is look at its inner events, and expand the recurring
rule. Our calendar now contains 12 events. The first will have its RRULE stripped,
and every subsequent VEVENT has the correct meeting date and a `RECURRENCE-ID` set.

This results in something like this:

```
BEGIN:VCALENDAR
  VERSION:2.0
  PRODID:-//Sabre//Sabre VObject 2.0//EN
  BEGIN:VEVENT
    UID:1102c450-e0d7-11e1-9b23-0800200c9a66
    DTSTART:20120109T140000Z
  END:VEVENT
  BEGIN:VEVENT
    UID:1102c450-e0d7-11e1-9b23-0800200c9a66
    RECURRENCE-ID:20120213T140000Z
    DTSTART:20120213T140000Z
  END:VEVENT
  BEGIN:VEVENT
    UID:1102c450-e0d7-11e1-9b23-0800200c9a66
    RECURRENCE-ID:20120312T140000Z
    DTSTART:20120312T140000Z
  END:VEVENT
  ..etc..
END:VCALENDAR
```

Note that I added some extra spaces for convenience..

To show the list of dates, we would do this as such:

```php
<?php

foreach($vcalendar->VEVENT as $vevent) {
    echo $vevent->DTSTART->getDateTime()->format(\DateTime::ATOM);
}
```

In a recurring event, single instances can also be overriden. VObject also takes these
into consideration. The reason we needed to specify a start and end-date, is because
some recurrence rules can be 'never ending'.

You should make sure you pick a sane date-range. Because if you pick a 50 year
time-range, for a daily recurring event; this would result in over 18K objects.

### Free-busy report generation

Some calendaring software can make use of FREEBUSY reports to show when people are
available.

You can automatically generate these reports from calendars using the `FreeBusyGenerator`.

Example based on our last event:

```php
<?php

// We're giving it the calendar object. It's also possible to specify multiple objects,
// by setting them as an array.
//
// We must also specify a start and end date, because recurring events are expanded.
$fbGenerator = new VObject\FreeBusyGenerator(
    new DateTime('2012-01-01'),
    new DateTime('2012-12-31'),
    $vcalendar
);

// Grabbing the report
$freebusy = $fbGenerator->getResult();

// The freebusy report is another VCALENDAR object, so we can serialize it as usual:
echo $freebusy->serialize();
```

The output of this script will look like this:

```
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Sabre//Sabre VObject 2.0//EN
CALSCALE:GREGORIAN
BEGIN:VFREEBUSY
DTSTART;VALUE=DATE-TIME:20111231T230000Z
DTEND;VALUE=DATE-TIME:20111231T230000Z
DTSTAMP;VALUE=DATE-TIME:20120808T131628Z
FREEBUSY;FBTYPE=BUSY:20120109T140000Z/20120109T140000Z
FREEBUSY;FBTYPE=BUSY:20120213T140000Z/20120213T140000Z
FREEBUSY;FBTYPE=BUSY:20120312T140000Z/20120312T140000Z
FREEBUSY;FBTYPE=BUSY:20120409T140000Z/20120409T140000Z
FREEBUSY;FBTYPE=BUSY:20120514T140000Z/20120514T140000Z
FREEBUSY;FBTYPE=BUSY:20120611T140000Z/20120611T140000Z
FREEBUSY;FBTYPE=BUSY:20120709T140000Z/20120709T140000Z
FREEBUSY;FBTYPE=BUSY:20120813T140000Z/20120813T140000Z
FREEBUSY;FBTYPE=BUSY:20120910T140000Z/20120910T140000Z
FREEBUSY;FBTYPE=BUSY:20121008T140000Z/20121008T140000Z
FREEBUSY;FBTYPE=BUSY:20121112T140000Z/20121112T140000Z
FREEBUSY;FBTYPE=BUSY:20121210T140000Z/20121210T140000Z
END:VFREEBUSY
END:VCALENDAR
```

### Converting to jCard

To create a json-version of your iCalendar or vCard, simply call
`jsonSerialize` on your component:

```php
<?php

echo json_encode($vcard->jsonSerialize());
```

The json formats are based on these RFCs:

* http://tools.ietf.org/html/rfc7095
* http://tools.ietf.org/html/draft-ietf-jcardcal-jcal-08

Because these are still in draft, so is the jsonSerialize implementation. The
output format may therefore break between versions to comply with the latest
version of the spec.

### Parsing jCard and jCal.

To parse a jCard or jCal object, use the following snippet:

```php
<?php

$input = 'jcard.json';
$jCard = VObject\Reader::readJson(fopen('jcard.json', 'r'));

?>
```

You can pass either a json string, a readable stream, or an array if you
already called json_decode on the input.

This feature was added in sabre/vobject 3.1.

### Splitting export files

Generally when software makes backups of calendars or contacts, they will
put all the objects in a single file. In the case of vCards, this is often
a stream of VCARD objects, in the case of iCalendar, this tends to be a
single VCALENDAR objects, with many components.

Protocols such as Card- and CalDAV expect only 1 object per resource. The
vobject library provides 2 classes to split these backup files up into many.

To do this, use the splitter objects:

```php
<?php

// You can either pass a readable stream, or a string.
$h = fopen('backupfile.vcf', 'r');
$splitter = new VObject\Splitter\VCard($h);

while($vcard = $splitter->next()) {

    // $vCard is a single vCard object. You can just call serialize() on it
    // if you were looking for the string version.

}
```

Next to the VCard splitter, there's also an ICalendar splitter. The latter
creates a `VCALENDAR` object per `VEVENT`, `VTODO` or `VJOURNAL`, and ensures
that the `VTIMEZONE` information is kept intact, and any `VEVENT` objects that
belong together (because they are expections for an `RRULE` and thus have the
same `UID`) will be kept together, exactly like CalDAV expects.

### Converting between different vCard versions.

Since sabre/vobject 3.1, there's also a feature to convert between various
vCard versions. Currently it's possible to convert from vCard 2.1, 3.0 and
4.0 and to 3.0 and 4.0. It's not yet possible to convert to vCard 2.1.

To do this, simply call the convert() method on the vCard object.

```php
<?php

$input = <<<VCARD
BEGIN:VCARD
VERSION:2.1
FN;CHARSET=UTF-8:Foo
TEL;PREF;HOME:+1 555 555 555
END:VCARD
VCARD;

$vCard = VObject\Reader::read($input);
$vCard->convert(VObject\Document::VCARD40);

echo $vcard->serialize();

// This will output:
/*
BEGIN:VCARD
VERSION:4.0
FN:Foo
TEL;PREF=1;TYPE=HOME:+1 555 555 555
END:VCARD
*/
?>
```

Note that not everything can cleanly convert between versions, and it's
probable that there's a few properties that could be converted between
versions, but isn't yet. If you find something, open a feature request ticket
on Github.

Full API documentation
----------------------

Full API documentation can be found on github:

https://github.com/fruux/sabre-vobject/wiki/ApiIndex

Reading the source may also be helpful instead :)

CLI tool
--------

Since vObject 3.1, a new cli tool is shipped in the bin/ directory.

This tool has the following features:

* A `validate` command.
* A `repair` command to repair objects that are slightly broken.
* A `color` command, to show an iCalendar object or vCard on the console with
  ansi-colors, which may help debugging.
* A `convert` command, allowing you to convert between iCalendar 2.0, vCard 2.1,
  vCard 3.0, vCard 4.0, jCard and jCal.

Just run it using `bin/vobject`. Composer will automatically also put a
symlink in `vendor/bin` as well, or a directory of your choosing if you set
the `bin-dir` setting in your composer.json.

Support
-------

Head over to the [SabreDAV mailing list](http://groups.google.com/group/sabredav-discuss) for any questions.

repository: churchcommunitybuilder/sabre-vobject

repo_name: churchcommunitybuilder/sabre-vobject


text:
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.4.1] - 2020-03-06

### Added
-   added first and last block methods ([#183])

### Changed
-   improved building as a project dependency ([#176])

## [1.4.0] - 2020-02-13

### Added
-   added Core 2.6 endpoints ([#159])

## [1.3.0] - 2019-10-09

### Added
-   added Blockchain API endpoint ([#104])

### Changed
-   moved external libraries out of source tree ([#140])
-   improved API query usage to accept strings ([#114])
-   improved class members and test coverage ([#93])
-   improved formatting and maintainability ([#92])
-   dropped Hunter Package Manager in favor of git submodules in OS builds ([#90])
-   updated ArduinoJson 5.13.2 >> 6.10.1, usage patterns, and documentation/examples ([#87])

### Fixed
-   fixed typos in Arduino examples ([#86])
-   changed to "statusCode" '422' to test API Post response for empty Transactions objects ([#85])

## [1.2.0] - 2019-02-16

### Added
-   arduino CircleCI config ([#73])

### Changed
-   removed `./src/stl` library ([#78])
-   updated `keywords.txt`. ([#77])
-   updated `ARDUINO_IDE.sh` script to reflect `lib/` changes ([#76])
-   reorganized files and documentation ([#75])
-   automated `ARDUINO_IDE.sh` script ([#72])
-   updated `./library.json` package export settings ([#70])

## [1.1.0] - 2019-02-07

### Added
-   added Arduino Sketch Paths to `library.json` ([#67])
-   added an API `send()` method for the `Transactions` class ([#64])

### Fixed
-   renamed `Helpers` class to avoid naming collision with Cpp-Crypto `Helpers` ([#65])
-   fixed unterminated comment which resulted in skipped `Node` tests ([#63])

## [1.0.0] - 2019-01-19
-   Initial Release

[1.0.0]: https://github.com/ArkEcosystem/cpp-client/compare/1.0.0...master
[#63]: https://github.com/ArkEcosystem/cpp-client/pull/63
[#64]: https://github.com/ArkEcosystem/cpp-client/pull/64
[#65]: https://github.com/ArkEcosystem/cpp-client/pull/65
[#67]: https://github.com/ArkEcosystem/cpp-client/pull/67
[1.1.0]: https://github.com/ArkEcosystem/cpp-client/compare/1.0.0...1.1.0
[#70]: https://github.com/ArkEcosystem/cpp-client/pull/70
[#72]: https://github.com/ArkEcosystem/cpp-client/pull/72
[#73]: https://github.com/ArkEcosystem/cpp-client/pull/73
[#75]: https://github.com/ArkEcosystem/cpp-client/pull/75
[#76]: https://github.com/ArkEcosystem/cpp-client/pull/76
[#77]: https://github.com/ArkEcosystem/cpp-client/pull/77
[#78]: https://github.com/ArkEcosystem/cpp-client/pull/78
[1.2.0]: https://github.com/ArkEcosystem/cpp-client/compare/1.1.0...1.2.0
[#85]: https://github.com/ArkEcosystem/cpp-client/pull/85
[#86]: https://github.com/ArkEcosystem/cpp-client/pull/86
[#87]: https://github.com/ArkEcosystem/cpp-client/pull/87
[#90]: https://github.com/ArkEcosystem/cpp-client/pull/90
[#92]: https://github.com/ArkEcosystem/cpp-client/pull/92
[#93]: https://github.com/ArkEcosystem/cpp-client/pull/93
[#104]: https://github.com/ArkEcosystem/cpp-client/pull/104
[#114]: https://github.com/ArkEcosystem/cpp-client/pull/114
[#140]: https://github.com/ArkEcosystem/cpp-client/pull/140
[1.3.0]: https://github.com/ArkEcosystem/cpp-client/compare/1.2.0...1.3.0
[#159]: https://github.com/ArkEcosystem/cpp-client/pull/159
[1.4.0]: https://github.com/ArkEcosystem/cpp-client/compare/1.3.0...1.4.0
[#176]: https://github.com/ArkEcosystem/cpp-client/pull/176
[#183]: https://github.com/ArkEcosystem/cpp-client/pull/183
[1.4.1]: https://github.com/ArkEcosystem/cpp-client/compare/1.4.0...1.4.1

repository: ArkEcosystemArchive/cpp-client

repo_name: ArkEcosystemArchive/cpp-client


text:
# graphql-getting-started

Studying GraphQL.

## Install

Simple run `yarn`.

## Running

For development run `yarn dev`, then visit [localhost:3000/graphql](http://localhost:3000/graphql).

Or for productoin run `yarn start`.

## Queries

#### Get video by id

```js
{
  video(id: "a") {
    id
    title
    duration
    released
  }
}
```

#### Get videos

```js
{
  videos {
    id
    title
    duration
    released
  }
}
```

## Mutations

#### Create video

```js
mutation M {
  createVideo(video: {
    title: "Foo Video"
    duration: 400
    released: false
  }) {
    id
    title
  }
}
```

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3.  Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## License

[MIT License](http://iagodahlem.mit-license.org/) © Iago Dahlem

repository: iagodahlem/graphql-getting-started

repo_name: iagodahlem/graphql-getting-started


text:
# Quotient Buildings

A MAGMA framework for computing quotients of Bruhat-Tits buildings over function fields modulo congruence subgroups
and their Hecke operators.

This is the source code of algorithms developed in my Master's thesis [Algorithmen zur Berechnung arithmetischer Quotienten von Bruhat-Tits-Gebäuden zu PGL_d+1(K_inf)](thesis.pdf) (available in German only). Example output can be found in Chapter 5.

## Usage

See the examples `building.m` and `harmonic.m` for basic usage of this framework.
They contain complete programs to compute quotient buildings and Hecke operators respectively
for the congruence subgroup Gamma_0(N). If you only want to run computations, adjust the parameters
within these files and run `magma building.m` or `magma harmonic.m` respectively.

The scripts `log2tex.py` and `log2txt.py` convert logs generated by `harmonic.m` into the respective formats.
They are expected to be run inside directory `lib`.

#### Custom congruence subgroups

It is also possible to use this framework to compute quotients modulo arbitrary congruence subgroups.
Refer to the implementation of `QuotientGamma0N` and the definition of `QuotientBuildingRec` in `lib/buildingQuotient.m`
for how to achieve this. You will need to adjust the creation of the `QuotientBuildingRec` structure as follows:

* Mandatory fields are `representatives`, `q`, `d`, `N` and `subgroupCondition`.
* If you also provide `reductionFunc`, the computation of the quotient building will be much faster.
Hecke operatores are not implemented in the case where this function is missing.

#### Higher dimensions

For dimensions `d` greater than `2`, the following functions need minor adjustments:

`QuotientCusp`, `PermutationsAtVertex`, `HeckeLeftCosets`.

## Unit Tests

Run unit tests using `magma unit_tests.m`. Some of those will use optional dependencies if available, see folder
`optional_dependencies` for detail.

## Precomputed examples

The folder `examples` contains some precomputed tables of Hecke operators, in plain-text and LaTeX format.
However, only the LaTeX files contain characteristic polynomials factorized into irreducibles.

## Dependencies

* code was tested using Magma V2.21-4
* JavaView: http://javaview.de/ (for visualising 2-dimensional quotients)
* GraphViz: http://www.graphviz.org/ (for visualising 1-dimensional quotients)
* The script `spring_layout.py` needs NetworkX (https://networkx.github.io) installed. It is invoked by `QuotientToJavaView` in `buildingQuotient.m` if parameter `Python` is set to `true`.

repository: lhofmann/buildings

repo_name: lhofmann/buildings


text:
# Instagram Explorer
Get interaction on your post and suggested more by Instagram, just by interacting with
other users with same interest and location!
Fully automated on selenium and chrome, just enter username and password and you are all done
If you think you are getting unnecessary followers, Instagram Unfollower is also uploaded on my Github
😛
Log of every followed account is saved in form of CSV file.
## Installation
>Required Libraries: Selenium & Pandas

>This project runs on Chrome Driver (recommended), or you may use any other Web Browser
If you don't have chromedriver follow this [blog](http://jonathansoma.com/lede/foundations-2018/classes/selenium/selenium-windows-install/)

Download the files in your prefer method (Downloading ZIP or through the url)
```
pip install -r requirements.txt
```

##### Before runing the main.py file, make sure you change the following things in the code

Chromedriver Path: Line 15
Instagram Username and Password: Line 26 & 27
Hastags you want to interect: Line 44
Number of people you want to follow per tag (default 10): Line 80
.
.
##### Now you can run the main.py file
.
```
py main.py
```
After runnning the above commands, a chrome window will appear and will start its work

## License

MIT
**Free Software, Hell Yeah!**