text:
package com.ibm.spark.communication.socket

import org.scalatest.concurrent.Eventually
import org.scalatest.mock.MockitoSugar
import org.scalatest.time.{Milliseconds, Span}
import org.scalatest.{BeforeAndAfter, FunSpec, Matchers}
import org.zeromq.ZMQ
import org.zeromq.ZMQ.{Socket, Context}

import scala.util.Try

class ZeroMQSocketRunnableSpec extends FunSpec with Matchers
  with MockitoSugar with Eventually with BeforeAndAfter {

  implicit override val patienceConfig = PatienceConfig(
    timeout = scaled(Span(2000, Milliseconds)),
    interval = scaled(Span(5, Milliseconds))
  )

  private val TestAddress = "inproc://test-address"
  private var mockSocketType: SocketType = _
  private var zmqContext: ZMQ.Context = _
  private var pubSocket: ZMQ.Socket = _

  private class TestRunnable(
    private val socket: ZMQ.Socket,
    private val context: Context,
    private val socketType: SocketType,
    private val inboundMessageCallback: Option[(Seq[String]) => Unit],
    private val socketOptions: SocketOption*
  ) extends ZeroMQSocketRunnable(
    context,
    socketType,
    inboundMessageCallback,
    socketOptions: _*
  ) {
    override protected def newZmqSocket(zmqContext: Context, socketType: Int): Socket = socket
  }

  before {
    mockSocketType = mock[SocketType]
    zmqContext = ZMQ.context(1)
    pubSocket = zmqContext.socket(PubSocket.`type`)
  }

  after {
    Try(zmqContext.close())
  }

  describe("ZeroMQSocketRunnable") {
    describe("constructor") {
      it("should throw an exception if there is no bind or connect") {
        intercept[IllegalArgumentException] {
          new ZeroMQSocketRunnable(zmqContext, mockSocketType, None)
        }
        pubSocket.close()
      }

      it("should throw an exception if there is more than one connect") {
        intercept[IllegalArgumentException] {
          new ZeroMQSocketRunnable(
            zmqContext,
            mockSocketType,
            None,
            Connect(TestAddress),
            Connect(TestAddress)
          )
        }
        pubSocket.close()
      }

      it("should throw an exception if there is more than one bind") {
        intercept[IllegalArgumentException] {
          new ZeroMQSocketRunnable(
            zmqContext,
            mockSocketType,
            None,
            Bind(TestAddress),
            Bind(TestAddress)
          )
        }
        pubSocket.close()
      }

      it("should throw an exception if there is a connect and bind") {
        intercept[IllegalArgumentException] {
          new ZeroMQSocketRunnable(
            zmqContext,
            mockSocketType,
            None,
            Connect(""),
            Bind("")
          )
        }
        pubSocket.close()
      }
    }

    describe("#run"){
      it("should set the linger option when provided") {
        val expected = 999

        val runnable: TestRunnable = new TestRunnable(
          pubSocket,
          zmqContext,
          PubSocket,
          None,
          Connect(TestAddress),
          Linger(expected)
        )
        val thread = new Thread(runnable)

        thread.start()

        eventually {
          val actual = pubSocket.getLinger
          actual should be (expected)
        }

        runnable.close()
      }

      it("should set the identity option when provided") {
        val expected = "my identity".getBytes(ZMQ.CHARSET)

        val runnable: TestRunnable = new TestRunnable(
          pubSocket,
          zmqContext,
          PubSocket,
          None,
          Connect(TestAddress),
          Identity(expected)
        )
        val thread = new Thread(runnable)

        thread.start()

        eventually {
          val actual = pubSocket.getIdentity
          actual should be (expected)
        }

        runnable.close()
      }

      it("should close the thread when closed"){
        val runnable = new TestRunnable(
          pubSocket,
          zmqContext,
          PubSocket,
          None,
          Connect(TestAddress)
        )

        val thread = new Thread(runnable)

        thread.start()

        eventually {
          runnable.isProcessing should be (true)
        }

        runnable.close()

        eventually{
          thread.isAlive should be (false)
        }
      }
    }

    describe("#isProcessing") {
      it("should be false when the runnable is closed") {
        val runnable = new TestRunnable(
          pubSocket,
          zmqContext,
          PubSocket,
          None,
          Connect(TestAddress)
        )

        val thread = new Thread(runnable)

        thread.start()

        eventually {
          runnable.isProcessing should be (true)
        }

        runnable.close()

        eventually {
          runnable.isProcessing should be (false)
        }
      }

      it("should eventually be true when the runnable is started") {
        val runnable = new TestRunnable(
          pubSocket,
          zmqContext,
          PubSocket,
          None,
          Connect(TestAddress)
        )

        val thread = new Thread(runnable)

        thread.start()

        eventually{
          runnable.isProcessing should be (true)
        }

        runnable.close()
      }
    }

    describe("#close"){
      it("should close the thread"){
          val runnable = new TestRunnable(
            pubSocket,
            zmqContext,
            PubSocket,
            None,
            Connect(TestAddress)
          )

          val thread = new Thread(runnable)

          thread.start()

          eventually {
            runnable.isProcessing should be (true)
          }

          runnable.close()

          eventually{
            thread.isAlive should be(false)
          }
      }
    }
  }

}


text:
/*
 * Do not modify this file. This file is generated from the route53-2013-04-01.normal.json service model.
 */
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;

using Amazon.Route53.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;

namespace Amazon.Route53.Model.Internal.MarshallTransformations
{
    /// <summary>
    /// Response Unmarshaller for ChangeInfo Object
    /// </summary>
    public class ChangeInfoUnmarshaller : IUnmarshaller<ChangeInfo, XmlUnmarshallerContext>
    {
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public ChangeInfo Unmarshall(XmlUnmarshallerContext context)
        {
            ChangeInfo unmarshalledObject = new ChangeInfo();
            int originalDepth = context.CurrentDepth;
            int targetDepth = originalDepth + 1;

            if (context.IsStartOfDocument)
               targetDepth += 2;

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Id", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        unmarshalledObject.Id = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("Status", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        unmarshalledObject.Status = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("SubmittedAt", targetDepth))
                    {
                        var unmarshaller = DateTimeUnmarshaller.Instance;
                        unmarshalledObject.SubmittedAt = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("Comment", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        unmarshalledObject.Comment = unmarshaller.Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return unmarshalledObject;
                }
            }
            return unmarshalledObject;
        }

        private static ChangeInfoUnmarshaller _instance = new ChangeInfoUnmarshaller();

        /// <summary>
        /// Gets the singleton.
        /// </summary>
        public static ChangeInfoUnmarshaller Instance
        {
            get
            {
                return _instance;
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
What like the drag racing series? **no**

**NHRA** stands for **Nagios Host RESTful API**. NHRA is a RESTful API for adding/removing hosts from a Nagios configuration. This was in response to the stupid decision of the developers to make operations engineers update text files by hand.

### Why do I need this?
Unless you like writing text files by hand, then you probably need this.

### How does it work?
Instead of parsing Nagios `.cfg` files, we just back them up and dump from a MongoDB database that NHRA maintains. Whenever a host is added through the API, the details are saved into a MongoDB database, then dumped to a clean copy of the `hosts.cfg`.

### How do I use it?
Once the daemon (`nhra.service`) is running, you can update the hosts through the URL. See the `API` documentation below.

### Any weird things I should know about?
Right now NHRA only supports using a template called `linux-default`. This will change, but for now you're SOL.

## API
All HTTP hooks are `GET`, because it makes it easy to use a browser or curl or whatnot.

All requests should be in the format of `http://someurl/<method>?param=value&param=value...`

Valid params (HTTP queries, really) are as follows:
```c++
key=<key>                   // your API key, an 8-character string
hostname=<hostname>         // the FQDN of the host you are adding. this is the database key so it must be unique.
ip=<ip_address>             // IP address of the host you are adding
alias=<alias>               // the friendly name of the host. Nagios uses this, IDGAF what you put as long as its a string.
group=<hostgroup>           // the hostgroup the new host belongs to
refresh                     // automatically refreshes the hosts.cfg file when the operation is done
list=<list>                 // a list of hosts to remove
```

As of right now there are only 5 API hooks:
```c++
/add                        // adds a host to the config
/remove                     // removes a host from the config
/remove-many                // removes a comma-delimeated list of hosts
/refresh                    // manually dumps the database to the hosts.cfg file
/debug/config               // dumps the nhra.conf file to the requester
/debug/hosts                // dumps the hosts.cfg file to the requester
/debug/hostdb               // dumps the hosts in the DB to the requester
```

### API Key
Each server, on first-run, generates an 8-character key based on an UUID. This is to keep unauthorized scripts/people from updating the configuration files. This is what I'm calling 'lazy authentication'. If someone really wants to get past it, they could, but this way keeps the casual interloper from f---ing everything up. The key must be supplied with all queries else you will get an error message.

 The API key can be found in `/etc/nhra/nhra.conf`.

### Examples

To add a host:
```bash
Server to add:              172.16.10.1
FQDN:                       app1.hexapp.net
Alias:                      APP_1
API Key:                    abcd1234

Command:
$> curl http://nagios.hexapp.net:5000/add?key=abcd1234&ip=172.16.10.1&hostname=app1.hexapp.net&alias=APP_1
200
```

To remove a host:
```bash
FQDN to remove:             oldDB.hexapp.net
API Key:                    abcd1234

Command:
$> curl http://nagios.hexapp.net:5000/add?key=abcd1234&hostname=oldDB.hexapp.net
200
```

To remove a list of hosts:
```bash
Servers to remove:          host1, host2, host3
API key:                    abcd1234

Command:
$> curl http://nagios.hexapp.net:5000/remove-many?key=abcd1234&list=host1,host2,host3
200
```

### Known Bugs
None?

### Acknowledgements
`NHRA` uses some pretty cool open-source software:
* `pymongo` ([Apache](http://choosealicense.com/licenses/apache-2.0/)) -- https://github.com/mongodb/mongo-python-driver
* `flask` ([BSD](http://choosealicense.com/licenses/isc/)) -- http://flask.pocoo.org/


text:
class Region < ActiveRecord::Base
  has_and_belongs_to_many :providers
  #has_many :areas, :through => :providers
  attr_accessible :latitude, :longitude, :name, :slug
end


text:
package org.elasticsearch.plugin.example;

import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;

import java.io.IOException;
import java.nio.file.Path;
import java.util.Locale;

/**
 * Example configuration.
 */
public class ExamplePluginConfiguration {

    private final Settings customSettings;

    public static final Setting<String> TEST_SETTING =
      new Setting<String>("test", "default_value",
      (value) -> value, Setting.Property.Dynamic);

    @Inject
    public ExamplePluginConfiguration(Environment env) throws IOException {
        // The directory part of the location matches the artifactId of this plugin
        Path path = env.configFile().resolve("jvm-example/example.yaml");
        customSettings = Settings.builder().loadFromPath(path).build();

        // asserts for tests
        assert customSettings != null;
        assert TEST_SETTING.get(customSettings) != null;
    }

    public String getTestConfig() {
        return TEST_SETTING.get(customSettings);
    }
}


text:
package org.reactor.utils;

import static com.google.common.base.CharMatcher.anyOf;
import static java.lang.String.format;
import java.util.Iterator;

public class StringUtils {

    public static final char ESCAPE_QUOTE = '"';

    private static class EscapingStringsIterator implements Iterator<String> {

        private static final String WHITESPACE = " ";
        private final Iterator<String> strings;
        private final char escapeCharacter;

        public EscapingStringsIterator(Iterable<String> strings, char escapeCharacter) {
            this.strings = strings.iterator();
            this.escapeCharacter = escapeCharacter;
        }

        @Override
        public boolean hasNext() {
            return strings.hasNext();
        }

        @Override
        public String next() {
            String nextString = strings.next();
            if (anyOf(WHITESPACE).matchesAnyOf(nextString)) {
                return format("%s%s%s", escapeCharacter, nextString, escapeCharacter);
            }
            return nextString;
        }

        @Override
        public void remove() {
            // do nothing
        }
    }

    public static Iterable<String> quotedIterable(final Iterable<String> strings) {
        return () -> new EscapingStringsIterator(strings, ESCAPE_QUOTE);
    }

    public static boolean matchesWildcard(String input, String wildcard) {
        String text = input + '\0';
        String pattern = wildcard + '\0';

        int N = pattern.length();

        boolean[] states = new boolean[N + 1];
        boolean[] old = new boolean[N + 1];
        old[0] = true;

        for (int i = 0; i < text.length(); i++) {
            char c = text.charAt(i);
            states = new boolean[N + 1];
            for (int j = 0; j < N; j++) {
                char p = pattern.charAt(j);
                if (old[j] && (p == '*')) old[j + 1] = true;
                if (old[j] && (p == c)) states[j + 1] = true;
                if (old[j] && (p == '.')) states[j + 1] = true;
                if (old[j] && (p == '*')) states[j] = true;
                if (old[j] && (p == '*')) states[j + 1] = true;
            }
            old = states;
        }
        return states[N];
    }
}


text:
ACCEPTED

#### According to
IRMNG Homonym List

#### Published in
Mitt. Nat. Ges. Bern, 1849, 27.

#### Original name
null

### Remarks
null


text:
<?xml version="1.0" encoding="UTF-8" ?>

<routes xmlns="http://symfony.com/schema/routing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">

	<route id="_wdt" pattern="/{token}">
		<default key="_controller">WebProfilerBundle:Profiler:toolbar</default>
	</route>
</routes>


text:
<?php

App::uses('ModelBehavior', 'Model');

/**
 * Aliasable Behavior
 *
 * Utility behavior to allow easy retrieval of records by id or its alias
 *
 * @package  Croogo.Croogo.Model.Behavior
 * @since    1.4
 * @author   Rachman Chavik <rchavik@xintesa.com>
 * @license  http://www.opensource.org/licenses/mit-license.php The MIT License
 * @link     http://www.croogo.org
 */

class AliasableBehavior extends ModelBehavior {

/**
 * _byIds
 *
 * @var array
 */
	protected $_byIds = array();

/**
 * _byAlias
 *
 * @var array
 */
	protected $_byAlias = array();

/**
 * setup
 *
 * @param Model $model
 * @param array $config
 * @return void
 */
	public function setup(Model $model, $config = array()) {
		$config = Hash::merge(array(
			'id' => 'id',
			'alias' => 'alias',
		), $config);
		$this->settings[$model->alias] = $config;
		$this->reload($model);
	}

/**
 * reload
 *
 * @param Model $model
 * @return void
 */
	public function reload(Model $model) {
		$config = $this->settings[$model->alias];
		$this->_byIds[$model->alias] = $model->find('list', array(
			'fields' => array($config['id'], $config['alias']),
			'conditions' => array(
				$model->alias . '.' . $config['alias'] . ' != ' => '',
			),
		));
		$this->_byAlias[$model->alias] = array_flip($this->_byIds[$model->alias]);
	}

/**
 * byId
 *
 * @param Model $model
 * @param integer $id
 * @return boolean
 */
	public function byId(Model $model, $id) {
		if (!empty($this->_byIds[$model->alias][$id])) {
			return $this->_byIds[$model->alias][$id];
		}
		return false;
	}

/**
 * byAlias
 *
 * @param Model $model
 * @param string $alias
 * @return boolean
 */
	public function byAlias(Model $model, $alias) {
		if (!empty($this->_byAlias[$model->alias][$alias])) {
			return $this->_byAlias[$model->alias][$alias];
		}
		return false;
	}

/**
 * listById
 *
 * @param Model $model
 * @return string
 */
	public function listById(Model $model) {
		return $this->_byIds[$model->alias];
	}

/**
 * listByAlias
 *
 * @param Model $model
 * @return string
 */
	public function listByAlias(Model $model) {
		return $this->_byAlias[$model->alias];
	}

}


text:
<title>Debug Session - Debugging with GDB</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Debugging with GDB">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Remote-Stub.html#Remote-Stub" title="Remote Stub">
<link rel="prev" href="Bootstrapping.html#Bootstrapping" title="Bootstrapping">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">

<meta http-equiv="Content-Style-Type" content="text/css">

Previous: Bootstrapping,
Up: Remote Stub

20.5.3 Putting it All Together

In summary, when your program is ready to debug, you must follow these
steps.

Make sure you have defined the supporting low-level routines
(see What You Must Do for the Stub):

          getDebugChar, putDebugChar,
          flush_i_cache, memset, exceptionHandler.

Insert these lines near the top of your program:

          set_debug_traps();
          breakpoint();

For the 680x0 stub only, you need to provide a variable called
exceptionHook.  Normally you just use:

          void (*exceptionHook)() = 0;

but if before calling set_debug_traps, you set it to point to a
function in your program, that function is called when
gdb continues after stopping on a trap (for example, bus
error).  The function indicated by exceptionHook is called with
one parameter: an int which is the exception number.

Compile and link together: your program, the gdb debugging stub for
your target architecture, and the supporting subroutines.

Make sure you have a serial connection between your target machine and
the gdb host, and identify the serial port on the host.

Download your program to your target machine (or get it there by
whatever means the manufacturer provides), and start it.

Start gdb on the host, and connect to the target
(see Connecting to a Remote Target).


text:
@interface SessionCustomViewController () <UITableViewDelegate, UITableViewDataSource>
{
    NSArray *sessionsArray;
    NSIndexPath *selectedIndexPath;
}

@end

@implementation SessionCustomViewController

@synthesize tblAuths;

- (void)viewDidLoad
{
    [super viewDidLoad];

    UIBarButtonItem *rightItemEndAll = [[UIBarButtonItem alloc] initWithTitle:@"End All" style:UIBarButtonItemStylePlain target:self action:@selector(endAllSessionsPressed)];
    [rightItemEndAll setAccessibilityIdentifier:@"sessions_end_all"];
    [self.navigationItem setRightBarButtonItems:[NSArray arrayWithObjects:rightItemEndAll, nil]];

    self.navigationItem.title =  @"Sessions (Custom UI)";

    [[LKCAuthenticatorManager sharedClient] getSessions:^(NSArray* array, NSError *error)
     {
         if(error)
             NSLog(@"Oops error: %@", error);
         else
         {
             sessionsArray = array;

             for(LKCSession *appObject in sessionsArray)
                 NSLog(@"app name: %@", appObject.serviceName);

             [tblAuths reloadData];
         }
     }];
}

-(void)viewWillAppear:(BOOL)animated
{
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceUnlinked) name:deviceUnlinked object:nil];
}

-(void)viewWillDisappear:(BOOL)animated
{
    [[NSNotificationCenter defaultCenter] removeObserver:self name:deviceUnlinked object:nil];
}

-(void)deviceUnlinked
{
    dispatch_async(dispatch_get_main_queue(), ^{
        [self.navigationController popViewControllerAnimated:NO];
    });
}

#pragma mark - TableView Delegate Methods
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [sessionsArray count];
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 100.0;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *MyIdentifier = @"AuthCell";
    UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];

    if (cell == nil)
    {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
                                      reuseIdentifier:MyIdentifier];
    }

    //Set Cell Tags
    UILabel *labelAuthName = (UILabel*)[cell viewWithTag:1];
    UIButton *btnRemove = (UIButton*)[cell viewWithTag:6];

    [btnRemove addTarget:self action:@selector(btnRemovePressed:) forControlEvents:UIControlEventTouchUpInside];

    LKCSession *appObject = [sessionsArray objectAtIndex:indexPath.row];
    NSString *appName = appObject.serviceName;

    labelAuthName.text = appName;

    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    cell.accessoryType = UITableViewCellAccessoryNone;
    return cell;
}

-(NSIndexPath *) getButtonIndexPath:(UIButton *) button
{
    CGRect buttonFrame = [button convertRect:button.bounds toView:tblAuths];
    return [tblAuths indexPathForRowAtPoint:buttonFrame.origin];
}

#pragma mark - Buttons Methods
-(void)btnRemovePressed:(id)sender
{
    NSIndexPath *indexPath = [self getButtonIndexPath:sender];
    selectedIndexPath = indexPath;

    [[LKCAuthenticatorManager sharedClient] endSession:[sessionsArray objectAtIndex:selectedIndexPath.row] completion:^(NSError *error) {
            [self refreshView];
    }];
}

#pragma mark - Refresh View
-(void)refreshView
{
    [[LKCAuthenticatorManager sharedClient] getSessions:^(NSArray* array, NSError *error)
     {
         sessionsArray = array;
         [tblAuths reloadData];
     }];
}

#pragma mark - End All Sessions
-(void)endAllSessionsPressed
{
     [[LKCAuthenticatorManager sharedClient] endAllSessions:^(NSError *error)
     {
         if(error != nil)
         {
             NSLog(@"Error: %@", error);
         }
         else
         {
             [self refreshView];
         }
     }];
}

@end


text:
class LaunchAnimation : public Animation
{
public:
	//Target is a centerpoint
	LaunchAnimation(Eigen::Affine3f& camera, float& fade, const Eigen::Vector3f& target, int duration) :
	  mCameraStart(camera), mTarget(target), mDuration(duration), cameraOut(camera), fadeOut(fade) {}

	int getDuration() const override { return mDuration; }

	void apply(float t) override
	{
		cameraOut = Eigen::Affine3f::Identity();

		float zoom = lerp<float>(1.0, 4.25f, t*t);
		cameraOut.scale(Eigen::Vector3f(zoom, zoom, 1));

		const float sw = (float)Renderer::getScreenWidth() / zoom;
		const float sh = (float)Renderer::getScreenHeight() / zoom;

		Eigen::Vector3f centerPoint = lerp<Eigen::Vector3f>(-mCameraStart.translation() + Eigen::Vector3f(Renderer::getScreenWidth() / 2.0f, Renderer::getScreenHeight() / 2.0f, 0),
			mTarget, smoothStep(0.0, 1.0, t));

		cameraOut.translate(Eigen::Vector3f((sw / 2) - centerPoint.x(), (sh / 2) - centerPoint.y(), 0));

		fadeOut = lerp<float>(0.0, 1.0, t*t);
	}

private:
	Eigen::Affine3f mCameraStart;
	Eigen::Vector3f mTarget;
	int mDuration;

	Eigen::Affine3f& cameraOut;
	float& fadeOut;
};


text:
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'seasyar'
require 'seasy'
require 'active_record'

describe Seasyar::ActiveRecordStorage do
  before :all do
    ActiveRecord::Base.configurations = YAML::load(IO.read('db/config.yml'))
    ActiveRecord::Base.establish_connection('development')
  end

  it "should save entries and make them searchable" do
    target = 1
    weights = Fragmentizer.new.fragmentize 'test'
    subject.save target, weights, :source => "1"
    subject.search( 'es' ).should == {"1" => 1}
  end

  it "should remove entries when saving new ones" do
    target = 1
    weights = Fragmentizer.new.fragmentize 'test'
    subject.save target, weights, :source => "1"

    weights = Fragmentizer.new.fragmentize 'different'
    subject.save target, weights, :source => "1"

    subject.search( 'es' ).should == {}
  end

  it "should accept a source as basis for what to delete in between adding" do
    Seasy.configure do |config|
      config.storage = Seasyar::ActiveRecordStorage
    end
    i = Seasy::Index.new
    i.add 'ruben', 'landsnora', :source => 'veddesta'
    i.search( 'ruben' ).should == {'landsnora' => 1}

    i.add 'ruben', 'edsberg', :source => 'edsberg'
    i.search( 'ruben' ).should == {'landsnora' => 1, 'edsberg' => 1}

    i.add 'sten', 'landsnora', :source => 'veddesta'
    i.search( 'ruben' ).should == {'edsberg' => 1}

    i.add 'sten', 'edsberg', :source => 'edsberg'
    i.search( 'ruben' ).should == {}
  end

  it "should have two seperate indices" do
    Seasy.configure do |config|
      config.storage = Seasyar::ActiveRecordStorage
    end
    i1 = Seasy::Index.with_name 1
    i2 = Seasy::Index.with_name 2
    i1.add 'ruben', 'landsnora'#, :source => 'landsnora'
    i2.add 'ruben', 'edsberg'#, :source => 'edsberg'
    i1.search( 'ruben').should == {'landsnora' => 1}
    i2.search( 'ruben').should == {'edsberg' => 1}
  end

  it "should split query strings on space" do
    Seasy.configure do |config|
      config.storage = Seasyar::ActiveRecordStorage
    end
    i = Seasy::Index.new
    i.add 'Frodolin', 'a hobbit', :source => 'a gossipy hobbit'
    i.search( 'Frodo Baggins' ).should == {'a hobbit' => 1}
  end
end


text: Resource/provider for handling setting Gnome dconf settings.


text:
"""
@name:      Modules/House/Entertainment/pioneer/pioneer.py
@author:    D. Brian Kimmel
@contact:   D.BrianKimmel@gmail.com
@copyright: (c) 2016-2019 by D. Brian Kimmel
@note:      Created on Jul 10, 2016
@license:   MIT License
@summary:

Control of pioneer home entertainment devices'.
First is an A/V receiver VSX-822-K.

Listen to Mqtt message to control device
==> pyhouse/<house name>/house/entertain/<device>/<function>

    <device> = receiver, tv, etc...
    <function> = control, status
    <value> = on, off, 0-100, zone#, input#

"""

__updated__ = '2020-02-17'
__version_info__ = (19, 10, 4)
__version__ = '.'.join(map(str, __version_info__))

#  Import system type stuff
from twisted.internet.endpoints import TCP4ClientEndpoint
from twisted.internet.error import ConnectionDone
from twisted.internet.protocol import Protocol, ClientFactory
from twisted.conch.telnet import StatefulTelnetProtocol
from queue import Queue

#  Import PyMh files and modules.
from Modules.Core.Config.config_tools import Api as configApi
from Modules.Core.Utilities import extract_tools
from Modules.House.Entertainment.entertainment_data import EntertainmentDeviceInformation, EntertainmentDeviceStatus
from Modules.House.Entertainment import EntertainmentPluginInformation

from Modules.Core.Utilities.debug_tools import PrettyFormatAny

from Modules.Core import logging_pyh as Logger
LOG = Logger.getLogger('PyHouse.Pioneer        ')

SECTION = 'pioneer'
DISCONNECT_TIMER = 30  # Seconds
CONFIG_NAME = 'pioneer'

# See https://tylerwatt12.com/vsx-822k-telnet-interface/
CONTROL_COMMANDS = {
    'PowerQuery':       b'?P',
    'PowerOn':          b'PN',
    'PowerOff':         b'PF',
    'VolumeQuery':      b'?V',
    'VolumeUp':         b'VU',
    'VolumeDown':       b'VD',
    'MuteQuery':        b'?M',
    'FunctionQuery':    b'?F',
    'FunctionPandora':  b'01FN'
    }

class PioneerPluginInformation(EntertainmentPluginInformation):
    """
    """

    def __init__(self):
        super(PioneerPluginInformation, self).__init__()

class PioneerDeviceInformation(EntertainmentDeviceInformation):
    """
    """

    def __init__(self):
        super(PioneerDeviceInformation, self).__init__()
        self.CommandSet = None  # Command sets change over the years.
        self.RoomName = None
        self.Type = None
        self.Volume = None
        self._isControlling = False
        self._isRunning = False

class PioneerDeviceStatus(EntertainmentDeviceStatus):
    """
    The device family is part of the topic.
    """

    def __init__(self):
        super(PioneerDeviceStatus, self).__init__()

class MqttActions:
    """
    """

    m_transport = None

    def __init__(self, p_pyhouse_obj):
        self.m_pyhouse_obj = p_pyhouse_obj

    def _find_device(self, p_family, p_model):
        l_devices = self.m_pyhouse_obj.House.Entertainment[SECTION].Devices
        for l_device in l_devices.values():
            if l_device.Name.lower() == p_model.lower():
                LOG.info("found model - {} {}".format(p_family, p_model))
                return l_device
        LOG.error('No such model as {}'.format(p_model))
        return None

    def _get_power(self, p_msg):
        """
        force power to be None, 'On' or 'Off'
        """
        l_ret = extract_tools.get_mqtt_field(p_msg, 'Power')
        if l_ret == None:
            return l_ret
        if l_ret == 'On':
            return 'On'
        return 'Off'

    def _decode_control(self, _p_topic, p_message):
        """ Decode the message.
        As a side effect - control pioneer.

        @param p_message: is the payload used to control
        """
        LOG.debug('Decode-Control called:\n\tTopic:{}\n\tMessage:{}'.format(_p_topic, p_message))
        l_family = extract_tools.get_mqtt_field(p_message, 'Family')
        if l_family == None:
            l_family = 'pioneer'
        l_model = extract_tools.get_mqtt_field(p_message, 'Model')
        # l_device_obj = self._find_device(l_family, l_model)
        l_power = self._get_power(p_message)
        l_input = extract_tools.get_mqtt_field(p_message, 'Input')
        l_volume = extract_tools.get_mqtt_field(p_message, 'Volume')
        l_logmsg = '\tPioneer Control:\n\t\tDevice:{}-{}\n\t\tPower:{}\n\t\tVolume:{}\n\t\tInput:{}'.format(l_family, l_model, l_power, l_volume, l_input)
        #
        if l_power != None:
            l_logmsg += ' Turn power {} to {}.'.format(l_power, l_model)
            self._pioneer_power(l_family, l_model, l_power)
        #
        if l_input != None:
            l_logmsg += ' Turn input to {}.'.format(l_input)
            self._pioneer_input(l_family, l_model, l_input)
        #
        if l_volume != None:
            l_logmsg += ' Change volume {}.'.format(l_volume)
            self._pioneer_volume(l_family, l_model, l_volume)
        #
        return l_logmsg

    def decode(self, p_msg):
        """ Decode the Mqtt message
        ==> pyhouse/<house name>/entertainment/pioneer/<type>/<Name>/...
        <type> = ?

        @param p_msg.Topic: is the topic with pyhouse/housename/entertainment/pioneer stripped off.
        """
        l_topic = p_msg.UnprocessedTopic
        p_msg.UnprocessedTopic = p_msg.UnprocessedTopic[1:]
        # LOG.debug('Decode called:\n\tTopic:{}\n\tMessage:{}'.format(p_msg.Topic, p_message))
        p_msg.LogMessage += ' Pioneer-{}'.format(l_topic[0])
        if l_topic[0].lower() == 'control':
            p_msg.LogMessage += '\tPioneer: {}\n'.format(self._decode_control(p_msg.Topic, p_msg.Payload))
        elif l_topic[0].lower() == 'status':
            pass
        else:
            p_msg.LogMessage += '\tUnknown Pioneer sub-topic: {}  Message: {}'.format(p_msg.Topic, PrettyFormatAny.form(p_msg.Payload, 'Entertainment msg', 160))

class LocalConfig:
    """
    """

    m_config = None
    m_pyhouse_obj = None

    def __init__(self, p_pyhouse_obj):
        self.m_pyhouse_obj = p_pyhouse_obj
        self.m_config = configApi(p_pyhouse_obj)

    def dump_struct(self):
        """
        """
        l_entertain = self.m_pyhouse_obj.House.Entertainment
        l_pioneer = l_entertain.Plugins['pioneer']
        LOG.debug(PrettyFormatAny.form(l_entertain, 'Entertainment'))
        LOG.debug(PrettyFormatAny.form(l_pioneer, 'Pioneer'))
        LOG.debug(PrettyFormatAny.form(l_pioneer.Services, 'Pandora'))
        #
        for l_service in l_pioneer.Services.values():
            LOG.debug(PrettyFormatAny.form(l_service, 'Service'))
            if hasattr(l_service, 'Connection'):
                LOG.debug(PrettyFormatAny.form(l_service.Connection, 'Connection'))
            if hasattr(l_service, 'Host'):
                LOG.debug(PrettyFormatAny.form(l_service.Host, 'Host'))
            if hasattr(l_service, 'Access'):
                LOG.debug(PrettyFormatAny.form(l_service.Access, 'Access'))

    def _extract_one_device(self, p_config):
        """
        """
        # self.dump_struct()
        l_required = ['Name', 'Type', 'Host']
        l_obj = PioneerDeviceInformation()
        for l_key, l_value in p_config.items():
            if l_key == 'Host':
                l_obj.Host = self.m_config.extract_host_group(l_value)
            else:
                setattr(l_obj, l_key, l_value)
        # Check for data missing from the config file.
        for l_key in [l_attr for l_attr in dir(l_obj) if not l_attr.startswith('_') and not callable(getattr(l_obj, l_attr))]:
            if getattr(l_obj, l_key) == None and l_key in l_required:
                LOG.warning('Pioneer Yaml is missing an entry for "{}"'.format(l_key))
        return l_obj  # For testing.

    def _extract_all_devices(self, p_config):
        """
        """
        l_dict = {}
        for l_ix, l_value in enumerate(p_config):
            l_device = self._extract_one_device(l_value)
            l_dict[l_ix] = l_device
        return l_dict

    def _extract_all_pioneer(self, p_config, p_api):
        """
        """
        # self.dump_struct()
        l_required = ['Name']
        l_obj = PioneerPluginInformation()
        l_obj._Api = p_api
        l_old = self.m_pyhouse_obj.House.Entertainment['pioneer']
        l_obj._Api = l_old._Api
        l_obj._Module = l_old._Module
        for l_key, l_value in p_config.items():
            if l_key == 'Device':
                l_devices = self._extract_all_devices(l_value)
                l_obj.Devices = l_devices
                l_obj.DeviceCount = len(l_devices)
            else:
                setattr(l_obj, l_key, l_value)
        # Check for data missing from the config file.
        for l_key in [l_attr for l_attr in dir(l_obj) if not l_attr.startswith('_') and not callable(getattr(l_obj, l_attr))]:
            if getattr(l_obj, l_key) == None and l_key in l_required:
                LOG.warning('Pioneer Yaml is missing an entry for "{}"'.format(l_key))
        return l_obj  # For testing.

    def load_yaml_config(self, p_api):
        """ Read the pioneer.yaml file.
        """
        LOG.info('Loading Config - Version:{}'.format(__version__))
        self.m_pyhouse_obj.House.Rooms = None
        l_yaml = self.m_config.read_config_file(CONFIG_NAME)
        if l_yaml == None:
            LOG.error('{}.yaml is missing.'.format(CONFIG_NAME))
            return None
        try:
            l_yaml = l_yaml['Pioneer']
        except:
            LOG.warning('The config file does not start with "Pioneer:"')
            return None
        l_pioneer = self._extract_all_pioneer(l_yaml, p_api)
        self.m_pyhouse_obj.House.Entertainment['pioneer'] = l_pioneer
        return l_pioneer

class PioneerControl:
    """
    """

    m_pyhouse_obj = None

    def __init__(self, p_pyhouse_obj):
        self.m_pyhouse_obj = p_pyhouse_obj

    def _get_endpoint(self, p_device_obj):
        """
        """
        l_reactor = self.m_pyhouse_obj._Twisted.Reactor
        l_host = p_device_obj.Host.Name
        l_port = p_device_obj.Host.Port
        l_endpoint = TCP4ClientEndpoint(l_reactor, l_host, l_port)
        return l_endpoint

    def pioneer_start_connecting(self, p_device_obj):
        """ Open connections to the various Pioneer devices we will communicate with.
        This will also publish a status message with controller info.

        @param p_device_obj: PioneerDeviceInformation()
        """

        def cb_got_protocol(p_protocol, p_device_obj, p_status):
            p_device_obj._Protocol = p_protocol
            p_device_obj._isRunning = True
            p_status.Type = 'Connected'
            p_status.Connected = True
            p_status.ControllingNode = self.m_pyhouse_obj.Computer.Name
            l_topic = 'house/entertainment/pioneer/status'
            self.m_pyhouse_obj.Core.MqttApi.MqttPublish(l_topic, p_status)

        def eb_got_protocol(p_reason, p_device_obj, p_status):
            p_device_obj._Protocol = None
            p_device_obj._isRunning = False
            p_status.Type = 'UnConnected'
            p_status.Connected = False
            l_topic = 'house/entertainment/pioneer/status'
            self.m_pyhouse_obj.Core.MqttApi.MqttPublish(l_topic, p_status)
            LOG.debug('Got an error connecting to Pioneer device - {}'.format(p_reason))
            LOG.debug(PrettyFormatAny.form(p_device_obj, 'Device'))
            LOG.debug(PrettyFormatAny.form(p_device_obj.Host, 'Host'))

        p_device_obj._Queue = Queue(32)
        l_status = PioneerDeviceStatus()
        l_status.Family = 'pioneer'
        l_status.Model = p_device_obj.Model
        l_status.Node = self.m_pyhouse_obj.Computer.Name
        l_endpoint = self._get_endpoint(p_device_obj)
        p_device_obj._Endpoint = l_endpoint
        LOG.debug(PrettyFormatAny.form(l_endpoint, 'Endpoint'))
        d_connector = l_endpoint.connect(PioneerFactory(self.m_pyhouse_obj, p_device_obj))
        d_connector.addCallback(cb_got_protocol, p_device_obj, l_status)
        d_connector.addErrback(eb_got_protocol, p_device_obj, l_status)
        p_device_obj._Connector = d_connector
        # self.m_device_lst.append(p_device_obj)

class PioneerProtocol(StatefulTelnetProtocol):
    """ There is an instance of this for every pioneer device that we are controlling.

    Each protocol instance is mapped to a Pioneer Device (and visa  versa)
    """

    m_pyhouse_obj = None
    m_pioneer_device_obj = None

    def __init__(self, p_pyhouse_obj, p_device_obj):
        self.m_pyhouse_obj = p_pyhouse_obj
        self.m_pioneer_device_obj = p_device_obj
        LOG.debug('Factory init for {}'.format(PrettyFormatAny.form(self.m_pioneer_device_obj, 'PioneerFactory-')))
        LOG.info('PioneerProtocol Init - Version:{}'.format(__version__))

    def _get_status(self):
        LOG.debug('Get Status')
        self.send_command(self.m_pioneer_device_obj, CONTROL_COMMANDS['PowerQuery'])  # Query Power
        self.send_command(self.m_pioneer_device_obj, CONTROL_COMMANDS['MuteQuery'])
        self.send_command(self.m_pioneer_device_obj, CONTROL_COMMANDS['VolumeQuery'])
        self.send_command(self.m_pioneer_device_obj, CONTROL_COMMANDS['FunctionQuery'])

    def dataReceived(self, p_data):
        """ This seems to be a line received function
        """
        Protocol.dataReceived(self, p_data)
        self.setLineMode()
        l_data = p_data[:-2]  # Drop the trailing CrLf
        if l_data == b'R':
            return
        LOG.info('Data Received.\n\tData:{}'.format(l_data))

    def lineReceived(self, p_line):
        StatefulTelnetProtocol.lineReceived(self, p_line)
        LOG.info('Line Received.\n\tData:{}'.format(p_line))

    def connectionMade(self):
        """ *3
        Setup
        We have connected - now get the initial conditions.
        """
        Protocol.connectionMade(self)
        self.setLineMode()
        LOG.info('Connection Made.')
        self.m_pioneer_device_obj._Transport = self.transport
        self._get_status()

    def connectionLost(self, reason=ConnectionDone):
        """ TearDown
        """
        Protocol.connectionLost(self, reason=reason)
        LOG.warning('Lost connection.\n\tReason:{}'.format(reason))

class PioneerClient(PioneerProtocol):
    """
    """

    m_pyhouse_obj = None
    m_pioneer_device_obj = None

    def __init__(self, p_pyhouse_obj, p_device_obj):
        self.m_pyhouse_obj = p_pyhouse_obj
        self.m_pioneer_device_obj = p_device_obj

    def send_command(self, p_device_obj, p_command):
        LOG.info('Send command {}'.format(p_command))
        try:
            l_host = p_device_obj.Host.Name
            p_device_obj._Transport.write(p_command + b'\r\n')
            LOG.info('Send TCP command:{} to {}'.format(p_command, l_host))
        except AttributeError as e_err:
            LOG.error("Tried to call send_command without a pioneer device configured.\n\tError:{}".format(e_err))

class PioneerFactory(ClientFactory):
    """
    This is a factory which produces protocols.
    By default, buildProtocol will create a protocol of the class given in self.protocol.
    """

    m_pyhouse_obj = None

    def __init__(self, p_pyhouse_obj, p_device_obj):
        self.m_pyhouse_obj = p_pyhouse_obj
        self.m_pioneer_device_obj = p_device_obj
        LOG.debug(PrettyFormatAny.form(p_device_obj, 'Pioneer Device'))
        LOG.info('PioneerFactory Init - Version:{}'.format(__version__))

    def startedConnecting(self, p_connector):
        """ *1
        Called when we are connecting to the device.
        Provides access to the connector.
        """
        LOG.debug(PrettyFormatAny.form(p_connector, 'Connector'))
        self.m_pioneer_device_obj._Connector = p_connector

    def buildProtocol(self, p_addr):
        """ *2
        Create an instance of PioneerProtocol.

        @param p_addr: an object implementing twisted.internet.interfaces.IAddress
        @return:
        """
        self.protocol = PioneerProtocol(self.m_pyhouse_obj, self.m_pioneer_device_obj)
        l_client = PioneerClient(self.m_pyhouse_obj, self.m_pioneer_device_obj)
        LOG.info('BuildProtocol\n\tAddr = {};\n\tClient:{}'.format(p_addr, l_client))
        return l_client

    def clientConnectionLost(self, p_connector, p_reason):
        LOG.warning('Lost connection.\n\tReason:{}'.format(p_reason))
        ClientFactory.clientConnectionLost(self, p_connector, p_reason)

    def clientConnectionFailed(self, p_connector, p_reason):
        LOG.error('Connection failed.\n\tReason:{}'.format(p_reason))
        ClientFactory.clientConnectionFailed(self, p_connector, p_reason)

    def connectionLost(self, p_reason):
        """ This is required. """
        LOG.error('ConnectionLost.\n\tReason: {}'.format(p_reason))

    def makeConnection(self, p_transport):
        """ This is required. """
        LOG.warning('makeConnection - Transport: {}'.format(p_transport))

class Api(MqttActions, PioneerClient):
    """This interfaces to all of PyHouse.
    """

    m_local_config = None
    m_pyhouse_obj = None

    def __init__(self, p_pyhouse_obj):
        self.m_pyhouse_obj = p_pyhouse_obj
        self.m_local_config = LocalConfig(p_pyhouse_obj)
        LOG.info("Api Initialized - Version:{}".format(__version__))

    def _pioneer_power(self, p_family, p_model, p_power):
        """
        @param p_power: 'On' or 'Off'
        """
        # Get the device_obj to control
        l_device_obj = self._find_device(p_family, p_model)
        if p_power == 'On':
            self.send_command(l_device_obj, CONTROL_COMMANDS['PowerOn'])  # Query Power
        else:
            pass
        LOG.debug('Change Power to {}'.format(p_power))

    def _pioneer_volume(self, p_family, p_model, p_volume):
        """
        @param p_volume: 'VolumeUp1', 'VolumeUp5', 'VolumeDown1' or 'VolumeDown5'
        """
        LOG.debug('Volume:{}'.format(p_volume))
        l_device_obj = self._find_device(p_family, p_model)
        if p_volume == 'VolumeUp1':
            self.send_command(l_device_obj, CONTROL_COMMANDS['VolumeUp'])
        elif p_volume == 'VolumeUp5':
            self.send_command(l_device_obj, b'VU')
            self.send_command(l_device_obj, CONTROL_COMMANDS['VolumeUp'])
            self.send_command(l_device_obj, CONTROL_COMMANDS['VolumeUp'])
            self.send_command(l_device_obj, CONTROL_COMMANDS['VolumeUp'])
            self.send_command(l_device_obj, CONTROL_COMMANDS['VolumeUp'])
        elif p_volume == 'VolumeDown1':
            self.send_command(l_device_obj, CONTROL_COMMANDS['VolumeDown'])
        elif p_volume == 'VolumeDown5':
            self.send_command(l_device_obj, CONTROL_COMMANDS['VolumeDown'])
            self.send_command(l_device_obj, CONTROL_COMMANDS['VolumeDown'])
            self.send_command(l_device_obj, CONTROL_COMMANDS['VolumeDown'])
            self.send_command(l_device_obj, CONTROL_COMMANDS['VolumeDown'])
            self.send_command(l_device_obj, CONTROL_COMMANDS['VolumeDown'])
        else:
            pass
        LOG.debug('Change Volume to {}'.format(p_volume))

    def _pioneer_input(self, p_family, p_model, p_input):
        """
        @param p_input: Channel Code
        """
        l_device_obj = self._find_device(p_family, p_model)
        self.send_command(l_device_obj, b'01FN')
        LOG.debug('Change input channel to {}'.format(p_input))

    def LoadConfig(self):
        """ Read the XML for all Pioneer devices.
        """
        self.m_local_config.load_yaml_config(self)
        LOG.info("Loaded Pioneer Device(s) - Version:{}".format(__version__))

    def Start(self):
        """ Start all the Pioneer factories if we have any Pioneer devices.
        """
        LOG.info('Api Start...')
        l_count = 0
        l_devices = self.m_pyhouse_obj.House.Entertainment[SECTION].Devices
        for l_device_obj in l_devices.values():
            # # Read Yaml here
            LOG.debug(PrettyFormatAny.form(l_device_obj, 'Device'))
            l_count += 1
            if l_device_obj._isRunning:
                LOG.info('Pioneer device {} is already running.'.format(l_device_obj.Name))
                continue
            PioneerControl(self.m_pyhouse_obj).pioneer_start_connecting(l_device_obj)
        LOG.info("Started {} Pioneer device(s).".format(l_count))

    def SaveConfig(self):
        LOG.info("Saved Pioneer Config.")

    def Stop(self):
        LOG.info("Stopped.")

# ## END DBK


text:
"use strict";

var _ScrollBehaviorContext = require("./ScrollBehaviorContext");

var _ScrollBehaviorContext2 = _interopRequireDefault(_ScrollBehaviorContext);

var _ScrollContainer = require("./ScrollContainer");

var _ScrollContainer2 = _interopRequireDefault(_ScrollContainer);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.ScrollContainer = _ScrollContainer2.default;
exports.ScrollContext = _ScrollBehaviorContext2.default;


text:
package jsint;

public class JschemeThrowable extends RuntimeException {
public Object contents;

public JschemeThrowable(Object contents) {
    this.contents = contents;
}

public JschemeThrowable(String message, Object contents) {
    super(message);
    this.contents = contents;
}

public String toString() {
    return ("JschemeThrowable:[[" + U.stringify(this.getMessage(), false) +
            "," + U.stringify(contents, false)) + "]]";
}

/** Clever performance trick i found in
    http://docs.msdnaa.net/ark_new/Webfiles/WhitePapers/Babel01/bab12.pdf
**/
public Throwable fillInStackTrace() {
    return this;
}
}


text:
* Updates from `purescript-language-server` version `0.11.0`:
  - Add find references command (requires purs 0.12). Currently works at the value level

## 0.23.1

* List `pscIdePort` config on config page

## 0.23.0

* Updates from `purescript-language-server` version `0.10.2`
  - 0.10.2
    - Add warning/build option on missing output directory - https://github.com/nwolverson/purescript-language-server/commit/83e7f2b884915100318bb6a06eb5b59fd7e39354
  - 0.10.1
    - Respect `pscIdePort` config - when absent port will be auto-chosen, when present server will be found or started on that port
    - Respect `autoStartPscIde` config
    - Make `executeCommandProvider` optional
    - `fixTypo` position fix
  - 0.10.0
    - Replace typed hole command & code action (requires LSP client support) https://github.com/nwolverson/purescript-language-server/issues/14
      - *Not supported in atom-ide-purescript*
    - Move dependencies from purescript-ide-purescript-core
    - Configurable output directory #30
    - Fix all suggestions commands https://github.com/nwolverson/purescript-language-server/issues/12
  - 0.9.0
    - Add documentation to hover tooltips https://github.com/nwolverson/purescript-language-server/pull/25 [@Krzysztof-Cieslak](https://github.com/Krzysztof-Cieslak)
    - Make compiler fixes (particularly import fixes) not leave extra blank lines https://github.com/nwolverson/purescript-language-server/issues/13
    - Fix `preludeModule` adding a prelude import if it is already imported explicitly https://github.com/nwolverson/purescript-language-server/issues/26
    - Ensure IDE server dependencies are reloaded on full build (particularly in case of editor mode) https://github.com/nwolverson/purescript-language-server/issues/19
    - Fix completion edits in some circumstances https://github.com/nwolverson/vscode-ide-purescript/issues/96
  - 0.8.0
    - Add suggestion ranking heuristics, currently these are for qualified import suggestions https://github.com/nwolverson/purescript-language-server/pull/15 [@natefaubion](https://github.com/natefaubion)
      - *Not properly supported in atom-ide-purescript*
    - Add configurable Prelude open import via `preludeModule` https://github.com/nwolverson/purescript-language-server/pull/16 [@natefaubion](https://github.com/natefaubion)
    - Use Markdown for suggestion details https://github.com/nwolverson/purescript-language-server/pull/23 [@Krzysztof-Cieslak](https://github.com/Krzysztof-Cieslak)

* Fix issues with starting/stopping language servers & command execution with multiple project folders [#190](https://github.com/nwolverson/atom-ide-purescript/issues/190). Note that due to atom-languageclient design currently the IDE server will be stopped on closing the last project file in the directory, and started fresh on opening a new one.

## 0.22.0

* Updates from `purescript-language-server` version `0.7.1`
  - Automatically add qualified imports on completion with an unknown qualifier https://github.com/nwolverson/purescript-language-server/pull/7 [@natefaubion](https://github.com/natefaubion)
  - Fix extraneous newlines in case split/add clause https://github.com/nwolverson/purescript-language-server/pull/9

## 0.21.0

* Updates from `purescript-language-server` version `0.6.0`:
  - Support psc-package source globs. Toggled via `addPscPackageSources` config (default `false`) and using `psc-package sources` command.
  - Show expanded type in tooltips (when different from non-expanded one)
  - Show module tooltip for qualified imports (hover over the qualifier of a qualified identifier)

## 0.20.0

* Switch to using purescript-language-server

## ... changelog unmaintained

## 0.1.0 - First Release
* Kind of works for me (OSX). Needs config.


text:
				<button type="button" ng-click="reset()" class="close"
					data-dismiss="modal" aria-label="Close">
					×
				</button>

suppression de catégories

				Souhaitez-vous réellement supprimer la (les)
				catégorie(s) suivante(s) ?

{{category.label}}

				<button type="button" ng-click="reset()" class="btn btn-default"
					data-dismiss="modal">fermer</button>
				<button type="button" ng-click="confirm(object)"
					class="btn btn-danger">confirmer</button>


text:
layout: doc
title: Field Papers
permalink: /it/beginner/field-papers/
lang: it
category: beginner
---

Rilievo con Field Paper
=============================
In questo capitolo vedremo come possiamo registrare le coordinate dei luoghi senza GPS.

Useremo uno strumento chiamato Field Papers (http://fieldpapers.org/), che consente di stampare la mappa di un territorio, disegnare su di essa e aggiungere note, e ricaricare la mappa cartacea su JOSM, dove è possibile aggiungere la tua posizione su OpenStreetMap.

Panoramica di Field Papers
--------------------------
Prima di entrare nei particolari di Field Papers, diamo un'occhiata panoramica a come funziona il processo:

-  Individua l'area che desideri mappare sul sito web Field Papers. Stampa una mappa di questa zona. Puoi scegliere di stampare la mappa corrente dell'area su OpenStreetMap, oppure puoi scegliere di stampare immagini aeree, se è disponibile quella della tua zona.

![field papers homepage][]

- Usa la stampata della tua mappa per analizzare la zona. Aggiungere altri luoghi disegnandoli sulla mappa. Disegna linee per le strade, forme per edifici, e così via. Scrivi note su ogni posizione direttamente sulla mappa, o scrivi i numeri sulla mappa che si riferiscono ai numeri nei tuoi appunti, dove  puoi scrivere informazioni più dettagliate su ogni oggetto.

![paper example][]

- Effettua la scansione del documento e importalo nel computer. Se non disponi di uno scanner, puoi fotografare il foglio, se la tua macchina fotografica è in grado di scattare foto di alta qualità. Carica l'immagine nel sito web di Field Papers.

- Carica i Field Paper su JOSM. Usa gli oggetti disegnati come riferimento per aggiungerli digitalmente in OpenStreetMap.

![fieldpaperjosm][]

Come funziona Field Papers?
-----------------------------
Se segui il processo descritto sopra raccoglierai coordinate geografiche precise di luoghi che non hanno nulla di più di quelle cartacee. Come è possibile?

![paper QR code][]

Quando stampi un documento Field Paper, la carta ha un codice a barre quadrato nella parte inferiore della pagina. Questo codice a barre consente a Field Papers di determinare la posizione esatta della mappa che stai utilizzando per l'analisi. Più tardi, quando ricaricherai la carta in JOSM, tutti gli oggetti che disegnerai saranno mostrati nella loro posizione reale. È come usare un GPS per raccogliere coordinate esatte, eccetto che ti serve solo la carta.
Ora impariamo come creare e utilizzare i Field Paper.

Creare e stampare
-----------------
- Apri il browser. Nella barra dell'indirizzo nella parte superiore della finestra, digita  [fieldpapers.org] (http://fieldpapers.org) e premi Invio:
- Il sito web dovrebbe essere simile a questo:

![field papers homepage][]

- Clicca **Realizza un atlante** per selezionare l'area che desideri stampare.

![makeatlas][]

- Sarai reindirizzato a questa pagina:

![atlas][]

- Digita nell'apposito spazio il nome dell'area che ti interessa- Poi clicca su "inizia".
- La mappa che vedi mostra l'area che desideri stampare su carta. È possibile far scorrere la mappa così come si sposta la mappa sul sito OpenStreetMap, utilizzando il pulsante sinistro del mouse per trascinare la mappa, e la rotellina di scorrimento per ingrandire e rimpicciolire.
    Per ingrandire e rimpicciolire si può anche fare clic sinistro sui pulsanti (+) e (-) nell'angolo in alto a sinistra.

![zoominout][]

 - Appena sopra la mappa ci sono alcune opzioni aggiuntive. La prima serve a selezionare l'orientamento della carta che si desidera utilizzare per la stampa di Field Paper. Puoi scegliere la modalità ritratto o panorama.

![choosetile][]

- L'opzione successiva consente di selezionare il tipo di dati che desideri utilizzare per il tuo Field Paper. Qui è possibile scegliere tra diverse opzioni che cambiano l'aspetto della mappa. Per ora selezioneremo  **In bianco e nero**.

![blackandwhite][]

 - Assicurati che la finestra mostri l'area che vuoi mappare. È possibile usare i controlli nella finestra della mappa per ridimensionare le pagine di Field Paper, o per farne di più o di meno. Verifica anche che la tua cartina copra un'area ragionevolmente piccola, o non ti sarà di grande utilità quando sarai in giro.
Se la prima volta fai degli errori, non preoccuparti, è possibile creare tutte i Field Paper di cui hai bisogno.

 - Adesso facciamo una stampata! Se hai trovato l'area che ti interessa nella mappa e hai selezionato le opzioni che danno alla tua versione l'aspetto che ti soddisfa, sei pronto.

 - Clicca il pulsante "Next" nella tendina.

![labelnext][]

- Dai un nome al Field Paper. Se vuoi puoi aggiungere del testo che apparirà in ogni foglio stampato.

![name][]

- L'opzione successiva ti permette di scegliere un layout. Hai tre opzioni.
Se vuoi puoi aggiungere una griglia UTM sovrapposta a ogni mappa. Nella maggior parte dei casi, puoi selezionare "Solo Mappe" (già selezionato di default).

![layout][]

- Clicca su "Fine!"
- Vedrai che la tua stampata è in elaborazione. Quando sarà finita vedra il tuo Field Paper nella pagina. Di solito la preparazione di stampa richiede pochi minuti, secondo il numero di pagine che stai creando.

![preparing your atlas][]

-  Quando la stampa è pronta, clicca su "Scarica mappa PDF per la stampa". Dovrebbe iniziare il download.

![downloadpdf][]

 - Quando il download è terminato, apri il file PDF. Collega il computer a una stampante e

stampa il Field Paper. Se tutto va bene, ora dovresti avere la tua mappa stampata su carta.

Mappa con Field Paper
-----------------------
- Porta fuori il tuo Field Paper e usalo come guida per camminare e identificare nuovi luoghi che non sono sulla mappa.
- Traccia le linee per le strade, le forme degli edifici, e così via. Scrivi note su ogni posizione direttamente sulla mappa, o scrivi sulla mappa i numeri che si riferiscono ai numeri sul tuo blocco appunti, sul quale puoi scrivere informazioni più dettagliate per ogni oggetto.
- Quando sarai soddisfatto delle tue aggiunte sulla mappa cartacea, potrai aggiungerle digitalmente in OpenStreetMap.

Scannerizza e carica
--------------------
I Field Paper sono molto utili per la mappatura con la sola carta, ma non sono magici. Dovrai ancora inserire la carta in JOSM, aggiungere le informazioni in formato digitale, e salvare le modifiche su OpenStreetMap.

-  Il primo passo consiste nello scannerizzare i documenti di carta e salvarli nel computer. Per ottenere questo risultato devi collegare uno scanner al computer, scannerizzare la carta e salvarla come file immagine. Se non possiedi uno scanner, puoi fare una fotografia della carta, ma devi fare attenzione che la foto sia di ottima qualità. Accertati che la carta sia liscia e che la tua macchina fotografica sia posizionata esattamente davanti ad essa.

- Accertati che nell'immagine sia visibile il codice a barre perchè senza Field Papers non funziona. Ecco l'esempio di una immagine scannerizzata/fotografata:

![scrnsht][]

- Una volta che il Field Paper è scannerizzato e salvato sul computer, apri il browser Web e torna a fieldpapers.org, proprio come prima.
- Clicca su "Upload".

![upload][]

- Clicca su "Scegli file" e individua il file in cui hai scannerizzato / fotografato i tuoi Field Papers.

![uploadfp][]

 -  Clicca su "Upload"
 -  Potrebbero essere necessari alcuni minuti perchè il Field Paper venga caricato: questo dipende dalla velocità della tua connessione internet. Quando il caricamento finisce, vedrai qualcosa che somiglia a questa foto:
![paper upload 2][]

Aggiungere il Plugin Field Papers
---------------------------------
Prima di poter aprire il Field Paper in JOSM, dobbiamo installare il plugin JOSM Field Papers.
> I plugins aggiungono ulteriori funzionalità a JOSM. Il plugin Field Papers consente di caricare il nostro Field Paper scannerizzato come sfondo, così come possiamo vedere come sfondo l'immagine satellitare.
<!-- link to josm plugins section here -->
- Apri JOSM e vai in Modifica -> Preferenze.
- Clicca sul tab Plugins.
- Trova il plugin Field Papers e seleziona la casella accanto ad essa. Clicca su OK.

![field papers plugin][]

- Riavvia JOSM.

Aprili in JOSM
--------------
Ora puoi caricare il tuo Field Paper su JOSM e usarlo per aggiungere le informazioni raccolte su OpenStreetMap. Ritorna al sito web di Field Papers, digitando nel browser, come già fatto prima, [fieldpapers.org] (http://fieldpapers.org/).

- Clicca sul tab "Watch" e poi clicca su "Snapshots".
- Trova il tuo Field Paper nell'elenco e clicca su di esso. Dovresti vedere qualcosa simile a questo:

![paper scanned][]

- Per caricare il Field Paper su JOSM, devi copiare la snapshot dell'ID del Field Papers scannerizzati. Nella barra delle Url nella parte superiore del browser internet, seleziona il testo e premi CTRL + C sulla tastiera per copiare. Il testo dovrebbe essere simile a questo:
[http://fieldpapers.org/snapshot.php?id=zqw8m33x#16/14.6582/121.1098](http://fieldpapers.org/snapshot.php?id=zqw8m33x#16/14.6582/121.1098)

![fieldpaperid][]

- Clicca "Field Papers" sul menu principale di JOSM. Poi clicca "Scanned Map ... "

![scannedmap][]

- Premi CTRL + V sulla tastiera per incollare sul sito web il testo copiato da Field Papers

![fsnapshot][]

- clicca su OK.
- Se tutto è andato bene, dovresti vedere il tuo Field Paper caricato su JOSM.
     Nel prossimo capitolo, vedremo come aggiungere in OpenStreetMap i luoghi che hai mappato.

![fieldpaperjosm][]

Puoi anche usare i Field Paper scannerizzati in altri editor on line OSM, come iD o Potlatch: cliccando i link "Edit in iD" o "Edit in Potlatch" nella pagina scannerizzata di Field Paper.

![editinidorpot][]

![paper in id][]

Ripeti!
-------
Le modifiche aggiunte a OSM, verranno salvate sulla  mappa. La prossima volta che vorrai migliorare la mappa, potrai stamparla in un nuovo Field Papers che comprenderà le modifiche che hai fatto. Se questo procedimento viene ripetuto, più volte mapperai e più la mappa migliorerà!

Conclusioni
-------
Congratulazioni! In questo capitolo hai imparato a conoscere e usare
i Field Paper. Hai imparato a stampare, mappare e scannerizzare un
Field Paper per migliorare OpenStreetMap.

[field papers homepage]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image00_homepage.png
[paper example]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image01_fieldp.png
[fieldpaperjosm]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image02_fieldpaperjosm.png
[paper QR code]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image03_paper_qrc.png
[makeatlas]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image04_makeatlas.png
[atlas]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image05_makeyourselfanatlas.png
[zoominout]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image06_zoominout.png
[choosetile]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image07_choosetile.png
[blackandwhite]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image08_blackandwhite.png
[zoom]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image09_zoom.png
[labelnext]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image10_labelnext.png
[name]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image11_name.png
[layout]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image12_layout.png
[preparing your atlas]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image13_preparingyouratlas.png
[downloadpdf]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image14_downloadpdf.png
[scrnsht]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image15_scrnsht.png
[upload]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image16_upload.png
[uploadfp]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image17_uploadfp.png
[paper upload 2]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image18_asd.png
[field papers plugin]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image19_plugin.png
[paper scanned]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image20_watchsnapshot.png
[fieldpaperid]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image21_fieldpaperid.png
[scannedmap]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image22_scannedmap.png
[fsnapshot]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image23_fsnapshot.png
[editinidorpot]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image24_editinidorpot.png
[paper in id]: /images/it/beginner/06_field-papers/it_beg_06_field-papers_image25_id.png


text:
A Web crawler to create a list of all (download links) available books on http://grontho.com

# Usage
>>scrapy crawl grontho -o yourfilename.json

# Output
https://gist.github.com/prantu/2172bf412b5cb56b82f0858767fc2ea2


text:
from core import Config
from core import GMail
from core import Drive
from core import GoogleAccounts
from core import URLShortener
from core import Tasks

__all__ = [
        Config,
        GMail,
        Drive,
        GoogleAccounts,
        URLShortener,
        Tasks
]


text:
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}

module Pipes.Extended
  ( module Pipes.Extended,
    module Pipes
  ) where

import           Control.Lens hiding (Getter, each)
import           Control.Monad
import qualified Control.Monad.Trans.State.Strict as S
import qualified Data.Attoparsec.ByteString.Char8 as AC
import qualified Data.Attoparsec.Types as Attoparsec
import           Data.Binary (Binary)
import           Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as C
import qualified Data.ByteString.Lazy as L
import           Data.ByteString.Lazy.Builder
import           Data.ByteString.Lazy.Internal (foldrChunks)
import           Data.Foldable (forM_)
import           Data.Map as Map
import           Data.Monoid
import           Data.Tuple (swap)
import           Pipes
import           Pipes.Attoparsec
-- import qualified Pipes.Binary as PBIN
import qualified Pipes.ByteString as PB
-- import           Pipes.Getter
import           Pipes.Internal (unsafeHoist)
import           Pipes.Lift (distribute)
-- import           Pipes.Monoid
import qualified Pipes.Prelude as Pipes
import           Pipes.Safe as X
import           Prelude hiding (readFile, writeFile, lines)
import           System.IO as IO hiding (readFile)

readFile :: FilePath
         -> Producer' ByteString (SafeT IO) ()
readFile file = bracket (openFile file ReadMode) hClose PB.fromHandle
{-# INLINABLE readFile #-}

writeFile :: FilePath
          -> Consumer' ByteString (SafeT IO) ()
writeFile file = bracket (openFile file WriteMode) hClose
                   -- PB.toHandle
                   (\h -> forever $ do
                      a <- await
                      liftIO $ C.hPut h a)
{-# INLINABLE writeFile #-}

{- $verbose -}
readFile' :: FilePath
          -> Producer' ByteString (SafeT IO) ()
readFile' file = bracket
                   (do
                      h <- openFile file ReadMode
                      C.putStrLn $ C.concat ["{", C.pack file, " open}"]
                      return h)
                   (\h -> do
                      hClose h
                      C.putStrLn $ C.concat ["{", C.pack file, " closed}"])
                   PB.fromHandle
{-# INLINABLE readFile' #-}

writeFile' :: FilePath
           -> Consumer' ByteString (SafeT IO) ()
writeFile' file = bracket
                    (do
                       h <- openFile file WriteMode
                       C.putStrLn $ C.concat ["{", C.pack file, " open}"]
                       return h)
                    (\h -> do
                       hClose h
                       C.putStrLn $ C.concat ["{", C.pack file, " closed}"])
                    -- PB.toHandle
                    (\h -> forever $ do
                       a <- await
                       liftIO $ C.hPut h a)
{-# INLINABLE writeFile' #-}

readLines :: FilePath -> Producer ByteString (SafeT IO) ()
readLines file =
  over PB.lines id (readFile file) >-> Pipes.filter (/= "\n")
{-# INLINABLE readLines #-}

{- $unsafe -}
unsafeReadFile :: FilePath
               -> Producer' ByteString IO ()
unsafeReadFile file = do
  h <- lift $ openFile file ReadMode
  PB.fromHandle h
  lift $ hClose h

unsafeWriteFile :: FilePath -> Consumer ByteString IO ()
unsafeWriteFile f = do
  h <- lift $ openFile f WriteMode
  _ <- forever $ do
         a <- await
         liftIO $ C.hPut h a
  lift $ hClose h

-- using hPutBuilder
writeFileLazy :: FilePath
              -> Consumer' Builder (SafeT IO) ()
writeFileLazy file = bracket (openFile file WriteMode) hClose
                       (\h -> forever $ do
                          a <- await
                          liftIO $ hPutBuilder h a)

{- $pparse
   parser pipe assuming no errors

   This is typically used with (almost) no-fail Parsers, like 'pLine' where a error catching parser is included to prevent failure.

-}
parseP :: Monad m => AC.Parser a -> Pipe ByteString (Either String a) m r
parseP parser = goread ""
  where
    goread input = do
      r <- await
      goparse (input <> r)
    goreadc cont = do
      r <- await
      handleParseResult $ cont r
    goparse input = handleParseResult $ AC.parse parser input
    handleParseResult parseresult =
      case parseresult of
        (AC.Fail _ _ e) -> do
          yield (Left e)
          goread ""
        (AC.Partial c) -> goreadc c
        (AC.Done t r) -> do
          (yield . Right) r
          if t == ""
            then goread ""
            else goparse t

parseP' :: AC.Parser a -> Proxy () ByteString () (Either String a) IO r
parseP' parser = goread ""
  where
    goread input = do
      r <- await
      goparse (input <> r)
    goreadc cont = do
      r <- await
      handleParseResult $ cont r
    goparse input = handleParseResult $ AC.parse parser input
    handleParseResult parseresult =
      case parseresult of
        (AC.Fail t ctx e) -> do
          lift $ putStrLn $ "parse fail with error " <> e
          lift $ putStrLn $ "context " <> mconcat ctx
          lift $ putStrLn $ "not yet consumed " <> show t
          yield (Left e)
          goread ""
        (AC.Partial c) -> goreadc c
        (AC.Done t r) -> do
          (yield . Right) r
          if t == ""
            then goread ""
            else goparse t

parseOnlyP :: (Monad m) => AC.Parser a -> Pipe ByteString (Either String a) m ()
parseOnlyP parser = Pipes.map (AC.parseOnly parser)

keepGoing :: (Monad m, ParserInput a)
          => Attoparsec.Parser a b
          -> Producer a m r -> Producer b m ()
keepGoing parser p = do
  (x, p') <- lift $ S.runStateT (Pipes.Attoparsec.parse parser) p
  case x of
    Nothing -> return ()
    Just (Left _) -> return ()
    Just (Right b) -> do
      yield b
      keepGoing parser p'

{- $pparse
   parser pipe

   This is typically used with (almost) no-fail Parsers, like where a error catching parser is included to prevent failure.

   The logic checks first for partials that can be completed.  And this then avoids a partial reaching end of input (and thus dying).

-}
parsePipePartial :: (Monad m) => AC.Parser a -> Pipe ByteString (Either String a) m r
parsePipePartial parser = goread ""
  where
    goread input = do
      r <- await
      -- lift $ putStrLn (show r)
      goparse (input <> r)
    goreadc cont = do
      r <- await
      handleParseResult $ cont r
    goparse input = handleParseResult $ AC.parse parser input
    handleParseResult parseresult =
      case parseresult of
        (AC.Fail _ _ e) -> do
          yield (Left e)
          goread ""
        (AC.Partial c) ->
          case c "" of
            (AC.Done t r) -> do
              (yield . Right) r
              if t == ""
                then goread ""
                else goparse t
            _ -> goreadc c
        (AC.Done t r) -> do
          (yield . Right) r
          if t == ""
            then goread ""
            else goparse t

parsePipePartial' :: (Show a) => AC.Parser a -> Pipe ByteString (Either String a) IO r
parsePipePartial' parser = goread ""
  where
    goread input = do
      r <- await
      lift $ putStrLn $ "goread await: " <> show r
      goparse (input <> r)
    goreadc cont = do
      r <- await
      lift $ putStrLn $ "next goreadc await: " <> show r
      handleParseResult $ cont r
    goparse input = handleParseResult $ AC.parse parser input
    handleParseResult parseresult =
      case parseresult of
        (AC.Fail c context e) -> do
          lift $ putStrLn $ "fail: input: " <> show c <> " context: " <> show context <> " error: " <> e
          yield (Left e)
          goread ""
        (AC.Partial c) ->
          case c "" of
            (AC.Done t r) -> do
              lift $ putStrLn $ "Partial yield: " <> show r <> " remaining: " <> show t
              (yield . Right) r
              if t == ""
                then goread ""
                else goparse t
            (AC.Partial _) -> do
              lift $ putStrLn "double partial"
              goreadc c
            (AC.Fail c' context' e') -> do
              lift $ putStrLn $ "partial -> fail: " <> show c' <> " context: " <> show context' <> " error: " <> e'
              goreadc c
        (AC.Done t r) -> do
          lift $ putStrLn $ "Done yield: " <> show r
          (yield . Right) r
          if t == ""
            then goread ""
            else goparse t

-- { error handling } unwrapping `Just`s
justP :: (Monad m) => Pipe (Maybe a) a m r
justP = forever $ do
  a <- await
  Data.Foldable.forM_ a yield

-- passes a Right, discarding Left information
eitherP :: (Monad m) => Pipe (Either a b) b m ()
eitherP = forever $ do
  a <- await
  case a of
    Left _  -> return ()
    Right r -> yield r

-- passes a Right, dealing with Lefts using the supplied function
eitherPM :: (MonadIO m) => (a -> m ()) -> Pipe (Either a b) b m ()
eitherPM f = forever $ do
  a <- await
  case a of
    Left e  -> lift $ f e
    Right r -> yield r

-- fast lazy to strict pipe
toStrictP :: (Monad m) => Pipe L.ByteString ByteString m ()
toStrictP = forever $ do
  a <- await
  foldrChunks (\e a' -> yield e >> a') (return ()) a

-- { $counting }
addCountP :: (Monad m) => Pipe a (Int, a) m ()
addCountP = flip S.evalStateT 0 $ distribute $ do
  lift $ S.put 0
  forever $ do
    s <- await
    lift $ S.modify (+ 1)
    y <- lift S.get
    yield (y, s)

countP :: (Monad m) => Pipe a Int m ()
countP = flip S.evalStateT 0 $ distribute $ forever $ do
  _ <- await
  lift $ S.modify (+ 1)
  y <- lift S.get
  yield y

{- | yield every x awaits
λ> runEffect $ each [1..] >-> modP 100 >-> Pipes.take 2 >-> Pipes.print
1
2
-}
modP :: (Monad m) => Int -> Pipe a a m ()
modP m = flip S.evalStateT 0 $ distribute $ forever $ do
  a <- await
  lift $ S.modify (+ 1)
  n <- lift S.get
  when (m `mod` n == 0) $ yield a

-- count map
countMapP :: (Monad m, Ord a)
          => Producer a m r
          -> m (Map.Map a Int)
countMapP p = Pipes.fold incMap Map.empty id (void p)
  where
    incMap mp k = Map.insertWith (+) k 1 mp

countMapKeyP :: (Monad m, Ord b)
             => Producer a m r
             -> (a -> b)
             -> m (Map.Map b Int)
countMapKeyP p key =
  let fn x a = Map.insertWith (+) (key a) 1 x
  in Pipes.fold fn Map.empty id (void p)

-- ----------------------------------------------------------------------------- branching pipes
dupP :: (Monad m) => Pipe a (a, a) m r
dupP = Pipes.map dup
  where
    dup a = (a, a)

splitP :: (Monad m) => Pipe (a, a) a m r
splitP = forever $ do
  (a1, a2) <- await
  yield a1
  yield a2

firstP :: (Monad m) => Pipe b c m () -> Pipe (b, d) (c, d) m ()
firstP p = flip S.evalStateT undefined $ distribute $ firstSaveP >-> unsafeHoist lift p >-> firstRestoreP

secondP :: (Monad m) => Pipe c d m () -> Pipe (b, c) (b, d) m ()
secondP p = Pipes.map swap >-> firstP p >-> Pipes.map swap

bothP :: (Monad m) => Pipe b c m () -> Pipe b' c' m () -> Pipe (b, b') (c, c') m ()
bothP p1 p2 = firstP p1 >-> secondP p2

zipP :: (Monad m) => Pipe b c m () -> Pipe b c' m () -> Pipe b (c, c') m ()
zipP p1 p2 = dupP >-> firstP p1 >-> secondP p2

zipWithP :: (Monad m) => (c -> c' -> d) -> Pipe b c m () -> Pipe b c' m () -> Pipe b d m ()
zipWithP f p1 p2 = dupP >-> firstP p1 >-> secondP p2 >-> Pipes.map (uncurry f)

dupFirstP :: (Monad m) => Pipe b c m () -> Pipe b (c, b) m ()
dupFirstP p = dupP >-> firstP p

dupSecondP :: (Monad m) => Pipe b c m () -> Pipe b (b, c) m ()
dupSecondP p = dupP >-> secondP p

dupBothP :: (Monad m) => Pipe b c m () -> Pipe b c' m () -> Pipe b (c, c') m ()
dupBothP p1 p2 = dupP >-> bothP p1 p2

fanOutP :: (Monad m) => [Pipe b c m ()] -> Pipe b [c] m ()
fanOutP [p] = p >-> Pipes.map (: [])
fanOutP (p:ps) = dupBothP p (fanOutP ps) >-> Pipes.map (uncurry (:))
fanOutP _ = Pipes.map $ const []

branchP :: (Monad m) => [Pipe b c m ()] -> Pipe b c m ()
branchP l = fanOutP l >-> flatten

firstSaveP :: (Monad m) => Pipe (b, d) b (S.StateT d m) ()
firstSaveP = forever $ do
  (b, d) <- await
  lift $ S.put d
  yield b

firstRestoreP :: (Monad m) => Pipe c (c, d) (S.StateT d m) ()
firstRestoreP = forever $ do
  c <- await
  d <- lift S.get
  yield (c, d)

-- ----------------------------------------------------------------------------- Lens pipes
viewP :: (Monad m) => Lens' a b -> Pipe b c m () -> Pipe a c m ()
viewP l p = Pipes.map (view l) >-> p

viewSetP :: (Monad m) => Lens' a b -> Pipe b b m () -> Pipe a a m ()
viewSetP l p = dupFirstP (viewP l p) >-> Pipes.map (uncurry (set l))

-- debug pipe
debugP :: (MonadIO m, Show a) => String -> Pipe a a m r
debugP s = Pipes.chain (\x -> liftIO $ Prelude.putStrLn $ "debug: " ++ s ++ " " ++ show x)

parseFileP :: AC.Parser a -> FilePath -> Producer (Either String a) (SafeT IO) ()
parseFileP parser file = readFile file >-> parseP parser

-- List pipes
splitListP :: (Monad m) => Pipe [a] a m r
splitListP = forever (await >>= mapM_ yield)

-- Display pipes
displayP :: (MonadIO m, Show a) => Int -> Consumer a m ()
displayP n = Pipes.take n >-> Pipes.print

discardP :: (Monad m) => Consumer a m r
discardP = forever (void await)

-- | Apply a monadic function to the first value of a tuple
mapMFst :: (Monad m) => (a -> m b) -> Pipe (a, c) (b, c) m r
mapMFst f = for cat $ \(a, c) -> do
  b <- lift (f a)
  yield (b, c)

flatten :: (Monad m) => Pipe [a] a m r
flatten = forever $ do
  a <- await
  mapM_ yield a

listP :: (Monad m) => Pipe a [a] m ()
listP = go []
  where
    go l' = do
      a <- await
      let l'' = l' ++ [a]
      yield l''
      go l''

until' :: (Monad m, Eq a) => a -> Pipe a a m ()
until' stop = do
  a <- await
  yield a
  when (a /= stop) (until' stop)

-- | Getter stuff
firstSaveG :: (Monad m) => Producer (b, d) (S.StateT d m) () -> Producer b (S.StateT d m) ()
firstSaveG = loop
  where
    loop p = do
      n <- lift $ next p
      case n of
        Left () -> return ()
        Right ((b, d), p') -> do
          lift $ S.put d
          yield b
          loop p'

firstRestoreG :: (Monad m)
              => Producer c (S.StateT d m) ()
              -> Producer (c, d) (S.StateT d m) ()
firstRestoreG = loop
  where
    loop p = do
      n <- lift $ next p
      case n of
        Left () -> return ()
        Right (c, p') -> do
          d <- lift S.get
          yield (c, d)
          loop p'


text:
<?php

namespace Kunstmaan\FormBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
 * This class represents the type for the file FileUploadPagePart
 */
class FileUploadPagePartAdminType extends AbstractType
{

    /**
     * @param FormBuilderInterface $builder The form builder
     * @param array                $options The options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('label', TextType::class, array(
                'required' => true,
                'label' => 'kuma_form.form.file_upload_page_part.label.label',
            ))
            ->add('required', CheckboxType::class, array(
                'required' => false,
                'label' => 'kuma_form.form.file_upload_page_part.required.label',
            ))
            ->add('errormessage_required', TextType::class, array(
                'required' => false,
                'label' => 'kuma_form.form.file_upload_page_part.errormessage_required.label',
            ))
        ;
    }

    /**
     * @return string
     */
    public function getBlockPrefix()
    {
        return 'kunstmaan_formbundle_fileuploadpageparttype';
    }

    /**
     * @param OptionsResolver $resolver
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(array('data_class' => 'Kunstmaan\FormBundle\Entity\PageParts\FileUploadPagePart'));
    }
}


text:
<!doctype html>

    <title>CodeMirror: Full Screen Editing</title>
    <link rel="stylesheet" href="../lib/codemirror.css">

    <link rel="stylesheet" href="../theme/night.css">

    <link rel="stylesheet" href="../doc/docs.css">

CodeMirror: Full Screen Editing

<form><textarea id="code" name="code" rows="5">

indentWithTabs (boolean)

Whether, when indenting, the first N*8 spaces should be
        replaced by N tabs. Default is false.

tabMode (string)

Determines what happens when the user presses the tab key.
        Must be one of the following:

"classic" (the default)

When nothing is selected, insert a tab. Otherwise,
                behave like the "shift" mode. (When shift is
                held, this behaves like the "indent" mode.)

"shift"

Indent all selected lines by
                one indentUnit.
                If shift was held while pressing tab, un-indent all selected
                lines one unit.

"indent"

Indent the line the 'correctly', based on its syntactic
                context. Only works if the
                mode supports it.

"default"

Do not capture tab presses, let the browser apply its
                default behaviour (which usually means it skips to the next
                control).

enterMode (string)

Determines whether and how new lines are indented when the
        enter key is pressed. The following modes are supported:

"indent" (the default)

Use the mode's indentation rules to give the new line
                the correct indentation.

"keep"

Indent the line the same as the previous line.

"flat"

Do not indent the new line.

enterMode (string)

Determines whether and how new lines are indented when the
        enter key is pressed. The following modes are supported:

"indent" (the default)

Use the mode's indentation rules to give the new line
                the correct indentation.

"keep"

Indent the line the same as the previous line.

"flat"

Do not indent the new line.

enterMode (string)

Determines whether and how new lines are indented when the
        enter key is pressed. The following modes are supported:

"indent" (the default)

Use the mode's indentation rules to give the new line
                the correct indentation.

"keep"

Indent the line the same as the previous line.

"flat"

Do not indent the new line.

enterMode (string)

Determines whether and how new lines are indented when the
        enter key is pressed. The following modes are supported:

"indent" (the default)

Use the mode's indentation rules to give the new line
                the correct indentation.

"keep"

Indent the line the same as the previous line.

"flat"

Do not indent the new line.

</textarea></form>

Press F11 when cursor is in the editor to toggle full screen editing. Esc can also
    be used to exit full screen editing.

Note: Does not currently work correctly in IE
    6 and 7, where setting the height of something
    to 100% doesn't make it full screen.


text:
namespace Lpm {

class Particles {
    public:
        Particles(const std::shared_ptr<Coords> crds, const std::shared_ptr<Coords> lagCrds = NULL, const int prank = 0);
        Particles(const std::shared_ptr<Coords> crds, const std::shared_ptr<Coords> lagCrds = NULL,
            const std::vector<std::shared_ptr<Field>> fields = std::vector<std::shared_ptr<Field>>(), const int prank = 0);
        Particles(const index_type nMax, const std::vector<std::string>& fnames, const std::vector<int>& fdims,
            const std::vector<std::string>& funits, const GeometryType gkind, const bool lagrangian = false,
            const scalar_type domainRadius = 1.0, const int prank = 0);

        Particles(MeshSeed& seed, const int maxRecursionLevel, const scalar_type domainRadius = 1.0,
            const bool lagrangian = false, const int prank = 0);

        std::shared_ptr<Field> getFieldPtr(const std::string& fieldname);

        std::shared_ptr<Coords> getCoordPtr(const bool lagrangian = false);

        void insert(const XyzVector& newCoord);
        void replaceCoordinate(const index_type ind, const XyzVector& newCoord, const bool lagrangian = false);
        void setScalarFieldValues(const index_type pIndex, const std::vector<std::string>& fnames, const std::vector<scalar_type>& vals);
        void setVectorFieldValues(const index_type pIndex, const std::vector<std::string>& fnames, const std::vector<XyzVector>& vecVals);

        inline scalar_type scalarFieldValue(const std::string& fname, const index_type pIndex) const {
            return _fieldMap.at(fname)->getScalar(pIndex);}
        inline XyzVector vector2dFieldValue(const std::string& fname, const index_type pIndex) const {
            return _fieldMap.at(fname)->get2dVector(pIndex);
        }
        inline XyzVector vector3dFieldValue(const std::string& fname, const index_type pIndex) const {
            return _fieldMap.at(fname)->get3dVector(pIndex);
        }

        inline void setLogProc(const int rank) {log->setProcRank(rank);}

        inline index_type n() const {return _coords->n();}
        inline index_type nMax() const {return _coords->nMax();}

        void createField(const std::string& fieldName, const std::string& fieldUnits, const int fieldDim);
        void registerField(const std::shared_ptr<Field>& field);
        void initializeFieldWithFunction(const std::string& fieldname, const AnalyticFunction* fn);

        inline GeometryType geometry() const {return _coords->geometry();}
        inline std::vector<BoundaryCondition> boundaryConditions() const {return _boundaryConditions;}

    protected:
        Particles(){};
        std::shared_ptr<Coords> _coords;
        std::shared_ptr<Coords> _lagCoords;

        std::vector<BoundaryCondition> _boundaryConditions;

        std::map<std::string, std::shared_ptr<Field>> _fieldMap;

        static std::unique_ptr<Logger> log;
};

}

#endif


text:
<#
	===========================================================================
	 Created with: 	SAPIEN Technologies, Inc., PowerShell Studio 2019 v5.6.157
	 Created on:   	2/8/2019 12:12 PM
	 Created by:   	CERBDM
	 Organization: 	Cerner Corporation
	 Filename:     	VE_XD7StoreFrontWebReceiverPluginAssistant.psm1
	-------------------------------------------------------------------------
	 Module Name: VE_XD7StoreFrontWebReceiverPluginAssistant
	===========================================================================
#>

Import-LocalizedData -BindingVariable localizedData -FileName VE_XD7StoreFrontWebReceiverPluginAssistant.Resources.psd1;

function Get-TargetResource
{
    [CmdletBinding()]
    [OutputType([System.Collections.Hashtable])]
    param
    (
        [Parameter(Mandatory = $true)]
        [System.String]
        $StoreName
    )

    Import-module Citrix.StoreFront -ErrorAction Stop -Verbose:$false;

    try {

        Write-Verbose -Message ($localizedData.CallingGetSTFStoreService -f $StoreName)
        $StoreService = Get-STFStoreService | Where-Object { $_.friendlyname -eq $StoreName }
        Write-Verbose -Message $localizedData.CallingGetSTFWebReceiverService
        $webreceiverservice = Get-STFWebReceiverService -StoreService $Storeservice
        Write-Verbose -Message $localizedData.CallingGetSTFWebReceiverPluginAssistant
        $Configuration = Get-STFWebReceiverPluginAssistant -WebReceiverService $webreceiverservice
    }
    catch {

        Write-Verbose -Message ($localizedData.TrappedError -f $Error[0].Exception.Message)
    }

    $returnValue = @{
        StoreName = [System.String]$StoreName
        Enabled = [System.Boolean]$Configuration.Enabled
        UpgradeAtLogin = [System.Boolean]$Configuration.UpgradeAtLogin
        ShowAfterLogin = [System.Boolean]$Configuration.ShowAfterLogin
        Win32Path = [System.String]$Configuration.Win32.Path
        MacOSPath = [System.String]$Configuration.MacOS.Path
        MacOSMinimumSupportedVersion = [System.String]$Configuration.MacOS.MinimumSupportedVersion
        Html5Enabled = [System.String]$Configuration.Html5.Enabled
        Html5Platforms = [System.String]$Configuration.html5.Platforms
        Html5Preferences = [System.String]$Configuration.html5.Preferences
        Html5SingleTabLaunch = [System.Boolean]$Configuration.html5.SingleTabLaunch
        Html5ChromeAppOrigins = [System.String]$Configuration.html5.ChromeAppOrigins
        Html5ChromeAppPreferences = [System.String]$Configuration.html5.ChromeAppPreferences
        ProtocolHandlerEnabled = [System.Boolean]$Configuration.ProtocolHandler.Enabled
        ProtocolHandlerPlatforms = [System.String]$Configuration.ProtocolHandler.Platforms
        ProtocolHandlerSkipDoubleHopCheckWhenDisabled = [System.Boolean]$Configuration.ProtocolHandler.SkipDoubleHopCheckWhenDisabled
    }

    $returnValue
}

function Set-TargetResource
{
    [CmdletBinding()]
    [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')]
    param
    (
        [Parameter(Mandatory = $true)]
        [System.String]
        $StoreName,

        [Parameter()]
        [System.Boolean]
        $Enabled,

        [Parameter()]
        [System.Boolean]
        $UpgradeAtLogin,

        [Parameter()]
        [System.Boolean]
        $ShowAfterLogin,

        [Parameter()]
        [System.String]
        $Win32Path,

        [Parameter()]
        [System.String]
        $MacOSPath,

        [Parameter()]
        [System.String]
        $MacOSMinimumSupportedVersion,

        [Parameter()]
        [ValidateSet('Always','Fallback','Off')]
        [System.String]
        $Html5Enabled,

        [Parameter()]
        [System.String]
        $Html5Platforms,

        [Parameter()]
        [System.String]
        $Html5Preferences,

        [Parameter()]
        [System.Boolean]
        $Html5SingleTabLaunch,

        [Parameter()]
        [System.String]
        $Html5ChromeAppOrigins,

        [Parameter()]
        [System.String]
        $Html5ChromeAppPreferences,

        [Parameter()]
        [System.Boolean]
        $ProtocolHandlerEnabled,

        [Parameter()]
        [System.String]
        $ProtocolHandlerPlatforms,

        [Parameter()]
        [System.Boolean]
        $ProtocolHandlerSkipDoubleHopCheckWhenDisabled
    )

    Import-module Citrix.StoreFront -ErrorAction Stop -Verbose:$false;

    try {
        Write-Verbose -Message ($localizedData.CallingGetSTFStoreService -f $StoreName)
        $StoreService = Get-STFStoreService | Where-object {$_.friendlyname -eq $StoreName};
        Write-Verbose -Message $localizedData.CallingGetSTFWebReceiverService
        $webreceiverservice = Get-STFWebReceiverService -StoreService $Storeservice
    }
    catch {

        Write-Verbose -Message ($localizedData.TrappedError -f $Error[0].Exception.Message)
    }

    $ChangedParams = @{
        webreceiverservice = $webreceiverservice
    }
    $targetResource = Get-TargetResource -StoreName $StoreName
    foreach ($property in $PSBoundParameters.Keys) {
        if ($targetResource.ContainsKey($property)) {
            $expected = $PSBoundParameters[$property];
            $actual = $targetResource[$property];
            if ($PSBoundParameters[$property] -is [System.String[]]) {
                if (Compare-Object -ReferenceObject $expected -DifferenceObject $actual) {
                    if (!($ChangedParams.ContainsKey($property))) {
                        Write-Verbose -Message ($localizedData.SettingResourceProperty -f $property)
                        $ChangedParams.Add($property, $PSBoundParameters[$property])
                    }
                }
            }
            elseif ($expected -ne $actual) {
                if (!($ChangedParams.ContainsKey($property))) {
                    Write-Verbose -Message ($localizedData.SettingResourceProperty -f $property)
                    $ChangedParams.Add($property, $PSBoundParameters[$property])
                }
            }
        }
    }

    $ChangedParams.Remove('StoreName')
    Write-Verbose -Message $localizedData.CallingSetSTFWebReceiverPluginAssistant
    Set-STFWebReceiverPluginAssistant @ChangedParams

}

function Test-TargetResource
{
    [CmdletBinding()]
    [OutputType([System.Boolean])]
    param
    (
        [Parameter(Mandatory = $true)]
        [System.String]
        $StoreName,

        [Parameter()]
        [System.Boolean]
        $Enabled,

        [Parameter()]
        [System.Boolean]
        $UpgradeAtLogin,

        [Parameter()]
        [System.Boolean]
        $ShowAfterLogin,

        [Parameter()]
        [System.String]
        $Win32Path,

        [Parameter()]
        [System.String]
        $MacOSPath,

        [Parameter()]
        [System.String]
        $MacOSMinimumSupportedVersion,

        [Parameter()]
        [ValidateSet('Always','Fallback','Off')]
        [System.String]
        $Html5Enabled,

        [Parameter()]
        [System.String]
        $Html5Platforms,

        [Parameter()]
        [System.String]
        $Html5Preferences,

        [Parameter()]
        [System.Boolean]
        $Html5SingleTabLaunch,

        [Parameter()]
        [System.String]
        $Html5ChromeAppOrigins,

        [Parameter()]
        [System.String]
        $Html5ChromeAppPreferences,

        [Parameter()]
        [System.Boolean]
        $ProtocolHandlerEnabled,

        [Parameter()]
        [System.String]
        $ProtocolHandlerPlatforms,

        [Parameter()]
        [System.Boolean]
        $ProtocolHandlerSkipDoubleHopCheckWhenDisabled
    )

    $targetResource = Get-TargetResource -StoreName $StoreName
    $inCompliance = $true;
    foreach ($property in $PSBoundParameters.Keys) {
        if ($targetResource.ContainsKey($property)) {
            $expected = $PSBoundParameters[$property];
            $actual = $targetResource[$property];
            if ($PSBoundParameters[$property] -is [System.String[]]) {
                if ($actual) {
                    if (Compare-Object -ReferenceObject $expected -DifferenceObject $actual -ErrorAction silentlycontinue) {
                        Write-Verbose ($localizedData.ResourcePropertyMismatch -f $property, ($expected -join ','), ($actual -join ','));
                        $inCompliance = $false;
                    }
                }
                else {
                    Write-Verbose ($localizedData.ResourcePropertyMismatch -f $property, ($expected -join ','), ($actual -join ','));
                    $inCompliance = $false;
                }
            }
            elseif ($expected -ne $actual) {
                Write-Verbose ($localizedData.ResourcePropertyMismatch -f $property, $expected, $actual);
                $inCompliance = $false;
            }
        }
    }

    if ($inCompliance) {
        Write-Verbose ($localizedData.ResourceInDesiredState -f $DeliveryGroup);
    }
    else {
        Write-Verbose ($localizedData.ResourceNotInDesiredState -f $DeliveryGroup);
    }

    return $inCompliance;

}

Export-ModuleMember -Function *-TargetResource


text:
Your mobile number has been activated

  You can now post from your phone ({{mobile}}). Save the number in your phone's contact list!

{{SITE_NAME}} U.S. SMS number

      <big>30300</big>

    You are {{view.extra.sms_notify|yesno:",not "}}currently
    receiving notifications via text message
    (Change notification options)

    {% block buttons %}

        Need to change your number?

    {% endblock %}