text:
'use strict';

const chai = require('chai');
const expect = chai.expect;
const Support = require('../support');
const DataTypes = require('../../../lib/data-types');
const dialect = Support.getTestDialect();

describe(Support.getTestDialectTeaser('QueryInterface'), () => {
  beforeEach(function() {
    this.sequelize.options.quoteIdenifiers = true;
    this.queryInterface = this.sequelize.getQueryInterface();
  });

  afterEach(function() {
    return Support.dropTestSchemas(this.sequelize);
  });

  // FIXME: These tests should make assertions against the created table using describeTable
  describe('createTable', () => {
    it('should create a auto increment primary key', function() {
      return this.queryInterface.createTable('TableWithPK', {
        table_id: {
          type: DataTypes.INTEGER,
          primaryKey: true,
          autoIncrement: true
        }
      }).then(() => {
        return this.queryInterface.insert(null, 'TableWithPK', {}, { raw: true, returning: true, plain: true })
          .then(([response]) => {
            expect(response.table_id || typeof response !== 'object' && response).to.be.ok;
          });
      });
    });

    it('should create unique constraint with uniqueKeys', function() {
      return this.queryInterface.createTable('MyTable', {
        id: {
          type: DataTypes.INTEGER,
          primaryKey: true,
          autoIncrement: true
        },
        name: {
          type: DataTypes.STRING
        },
        email: {
          type: DataTypes.STRING
        }
      }, {
        uniqueKeys: {
          myCustomIndex: {
            fields: ['name', 'email']
          },
          myOtherIndex: {
            fields: ['name']
          }
        }
      }).then(() => {
        return this.queryInterface.showIndex('MyTable');
      }).then(indexes => {
        switch (dialect) {
          case 'postgres':
          case 'postgres-native':
          case 'sqlite':
          case 'mssql':

            // name + email
            expect(indexes[0].unique).to.be.true;
            expect(indexes[0].fields[0].attribute).to.equal('name');
            expect(indexes[0].fields[1].attribute).to.equal('email');

            // name
            expect(indexes[1].unique).to.be.true;
            expect(indexes[1].fields[0].attribute).to.equal('name');
            break;

          case 'mariadb':
          case 'mysql':
            // name + email
            expect(indexes[1].unique).to.be.true;
            expect(indexes[1].fields[0].attribute).to.equal('name');
            expect(indexes[1].fields[1].attribute).to.equal('email');

            // name
            expect(indexes[2].unique).to.be.true;
            expect(indexes[2].fields[0].attribute).to.equal('name');
            break;

          default:
            throw new Error(`Not implemented fpr ${dialect}`);
        }
      });
    });

    it('should work with schemas', function() {
      return this.sequelize.createSchema('hero').then(() => {
        return this.queryInterface.createTable('User', {
          name: {
            type: DataTypes.STRING
          }
        }, {
          schema: 'hero'
        });
      });
    });

    describe('enums', () => {
      it('should work with enums (1)', function() {
        return this.queryInterface.createTable('SomeTable', {
          someEnum: DataTypes.ENUM('value1', 'value2', 'value3')
        }).then(() => {
          return this.queryInterface.describeTable('SomeTable');
        }).then(table => {
          if (dialect.includes('postgres')) {
            expect(table.someEnum.special).to.deep.equal(['value1', 'value2', 'value3']);
          }
        });
      });

      it('should work with enums (2)', function() {
        return this.queryInterface.createTable('SomeTable', {
          someEnum: {
            type: DataTypes.ENUM,
            values: ['value1', 'value2', 'value3']
          }
        }).then(() => {
          return this.queryInterface.describeTable('SomeTable');
        }).then(table => {
          if (dialect.includes('postgres')) {
            expect(table.someEnum.special).to.deep.equal(['value1', 'value2', 'value3']);
          }
        });
      });

      it('should work with enums (3)', function() {
        return this.queryInterface.createTable('SomeTable', {
          someEnum: {
            type: DataTypes.ENUM,
            values: ['value1', 'value2', 'value3'],
            field: 'otherName'
          }
        }).then(() => {
          return this.queryInterface.describeTable('SomeTable');
        }).then(table => {
          if (dialect.includes('postgres')) {
            expect(table.otherName.special).to.deep.equal(['value1', 'value2', 'value3']);
          }
        });
      });

      it('should work with enums (4)', function() {
        return this.queryInterface.createSchema('archive').then(() => {
          return this.queryInterface.createTable('SomeTable', {
            someEnum: {
              type: DataTypes.ENUM,
              values: ['value1', 'value2', 'value3'],
              field: 'otherName'
            }
          }, { schema: 'archive' });
        }).then(() => {
          return this.queryInterface.describeTable('SomeTable', { schema: 'archive' });
        }).then(table => {
          if (dialect.includes('postgres')) {
            expect(table.otherName.special).to.deep.equal(['value1', 'value2', 'value3']);
          }
        });
      });

      it('should work with enums (5)', function() {
        return this.queryInterface.createTable('SomeTable', {
          someEnum: {
            type: DataTypes.ENUM(['COMMENT']),
            comment: 'special enum col'
          }
        }).then(() => {
          return this.queryInterface.describeTable('SomeTable');
        }).then(table => {
          if (dialect.includes('postgres')) {
            expect(table.someEnum.special).to.deep.equal(['COMMENT']);
            expect(table.someEnum.comment).to.equal('special enum col');
          }
        });
      });
    });
  });
});


text:
namespace Poco {
namespace Crypto {

class X509Certificate;

class Crypto_API RSAKey
	/// This class stores an RSA key pair, consisting
	/// of private and public key. Storage of the private
	/// key is optional.
	///
	/// If a private key is available, the RSAKey can be
	/// used for decrypting data (encrypted with the public key)
	/// or computing secure digital signatures.
{
public:
	enum KeyLength
	{
		KL_512  = 512,
		KL_1024 = 1024,
		KL_2048 = 2048,
		KL_4096 = 4096
	};

	enum Exponent
	{
		EXP_SMALL = 0,
		EXP_LARGE
	};

	explicit RSAKey(const X509Certificate& cert);
		/// Extracts the RSA public key from the given certificate.

	RSAKey(KeyLength keyLength, Exponent exp);
		/// Creates the RSAKey. Creates a new public/private keypair using the given parameters.
		/// Can be used to sign data and verify signatures.

	RSAKey(const std::string& publicKeyFile, const std::string& privateKeyFile = "", const std::string& privateKeyPassphrase = "");
		/// Creates the RSAKey, by reading public and private key from the given files and
		/// using the given passphrase for the private key.
		///
		/// Cannot be used for signing or decryption unless a private key is available.
		///
		/// If a private key is specified, you don't need to specify a public key file.
		/// OpenSSL will auto-create the public key from the private key.

	RSAKey(std::istream* pPublicKeyStream, std::istream* pPrivateKeyStream = 0, const std::string& privateKeyPassphrase = "");
		/// Creates the RSAKey, by reading public and private key from the given streams and
		/// using the given passphrase for the private key.
		///
		/// Cannot be used for signing or decryption unless a private key is available.
		///
		/// If a private key is specified, you don't need to specify a public key file.
		/// OpenSSL will auto-create the public key from the private key.

	~RSAKey();
		/// Destroys the RSAKey.

	int size() const;
		/// Returns the RSA modulus size.

	RSAKeyImpl::ByteVec modulus() const;
		/// Returns the RSA modulus.

	RSAKeyImpl::ByteVec encryptionExponent() const;
		/// Returns the RSA encryption exponent.

	RSAKeyImpl::ByteVec decryptionExponent() const;
		/// Returns the RSA decryption exponent.

	void save(const std::string& publicKeyFile, const std::string& privateKeyFile = "", const std::string& privateKeyPassphrase = "");
		/// Exports the public and private keys to the given files.
		///
		/// If an empty filename is specified, the corresponding key
		/// is not exported.

	void save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyStream = 0, const std::string& privateKeyPassphrase = "");
		/// Exports the public and private key to the given streams.
		///
		/// If a null pointer is passed for a stream, the corresponding
		/// key is not exported.

	RSAKeyImpl::Ptr impl() const;
		/// Returns the impl object.

	const std::string& name() const;
		/// Returns "rsa"

private:
	RSAKeyImpl::Ptr _pImpl;
};

//
// inlines
//
inline RSAKeyImpl::Ptr RSAKey::impl() const
{
	return _pImpl;
}

} } // namespace Poco::Crypto

#endif // Crypto_RSAKey_INCLUDED

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

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

#### Published in
Uchino, Y. , Hirata, A. , Yokota, A. , and Sugiyama, J. "Reclassification of marine Agrobacterium species: proposals of Stappia stellulata gen. nov. , comb. nov. , Stappia aggregata sp. nov. , nom. rev. , Ruegeria atlantica gen. nov. , comb. nov. , Ruegeria gelatinovora comb. nov. , Ruegeria algicola comb. nov. , and Ahrensia kieliense gen. nov. , sp. nov. , nom. rev. " J. Gen. Appl. Microbiol. (1998) 44:201-210.

#### Original name
null

### Remarks
null


text:
force CLI

```
force
```

### Options

```
  -a, --account username    account username to use
  -V, --apiversion string   API version to use
  -h, --help                help for force
```

### SEE ALSO

* [force active](force_active.md)	 - Show or set the active force.com account
* [force apex](force_apex.md)	 - Execute anonymous Apex code
* [force apiversion](force_apiversion.md)	 - Display/Set current API version
* [force bigobject](force_bigobject.md)	 - Manage big objects
* [force bulk](force_bulk.md)	 - Load csv file or query data using Bulk API
* [force create](force_create.md)	 - Creates a new, empty Apex Class, Trigger, Visualforce page, or Component.
* [force datapipe](force_datapipe.md)	 - Manage DataPipes
* [force describe](force_describe.md)	 - Describe the types of metadata available in the org
* [force eventlogfile](force_eventlogfile.md)	 - List and fetch event log file
* [force export](force_export.md)	 - Export metadata to a local directory
* [force fetch](force_fetch.md)	 - Export specified artifact(s) to a local directory
* [force field](force_field.md)	 - Manage SObject fields
* [force import](force_import.md)	 - Import metadata from a local directory
* [force limits](force_limits.md)	 - Display current limits
* [force log](force_log.md)	 - Fetch debug logs
* [force login](force_login.md)	 - Log into Salesforce and store a session token
* [force logins](force_logins.md)	 - List force.com logins used
* [force logout](force_logout.md)	 - Log out from Force.com
* [force notify](force_notify.md)	 - Should notifications be used
* [force oauth](force_oauth.md)	 - Manage ConnectedApp credentials
* [force open](force_open.md)	 - Open a browser window, logged into an authenticated Salesforce org
* [force package](force_package.md)	 - Manage installed packages
* [force password](force_password.md)	 - See password status or reset password
* [force push](force_push.md)	 - Deploy metadata from a local directory
* [force query](force_query.md)	 - Execute a SOQL statement
* [force quickdeploy](force_quickdeploy.md)	 - Quick deploy validation id
* [force record](force_record.md)	 - Create, modify, or view records
* [force rest](force_rest.md)	 - Execute a REST request
* [force security](force_security.md)	 - Displays the OLS and FLS for a given SObject
* [force sobject](force_sobject.md)	 - Manage standard & custom objects
* [force test](force_test.md)	 - Run apex tests
* [force trace](force_trace.md)	 - Manage trace flags
* [force usedxauth](force_usedxauth.md)	 - Authenticate with SFDX Scratch Org User
* [force version](force_version.md)	 - Display current version
* [force whoami](force_whoami.md)	 - Show information about the active account


text:
========================
Production read cleanups
========================

Use Case
--------

Rally should delete in any case all resources that it created during benchmark.

Problem Description
-------------------

* (implemented) Deletion rate limit

  You can kill cloud by deleting too many objects simultaneously, so deletion
  rate limit is required

* (implemented) Retry on failures

  There should be few attempts to delete resource in case of failures

* (implemented) Log resources that failed to be deleted

  We should log warnings about all non deleted resources. This information
  should include UUID of resource, it's type and project.

* (implemented) Pluggable

  It should be simple to add new cleanups adding just plugins somewhere.

* Disaster recovery

  Rally should use special name patterns, to be able to delete resources
  in such case if something went wrong with server that is running rally. And
  you have just new instance (without old rally db) of rally on new server.


text:
#import "TiLayoutQueue.h"
#import "TiViewProxy.h"
#import <CoreFoundation/CoreFoundation.h>
#import <pthread.h>

#define LAYOUT_TIMER_INTERVAL	0.05

NSMutableArray * layoutArray = nil;
CFRunLoopTimerRef layoutTimer = NULL;
pthread_mutex_t layoutMutex;

void performLayoutRefresh(CFRunLoopTimerRef timer, void *info)
{
	pthread_mutex_lock(&layoutMutex);
	for (TiViewProxy *thisProxy in layoutArray)
	{
		[thisProxy repositionIfNeeded];
		[thisProxy layoutChildrenIfNeeded];
	}
	if ([layoutArray count]==0)
	{
		//Might as well stop the timer for now.
		RELEASE_TO_NIL(layoutArray);
		if (layoutTimer != NULL)
		{
			CFRunLoopTimerInvalidate(layoutTimer);
			layoutTimer = NULL;
		}
	}
	else
	{
		[layoutArray removeAllObjects];
	}

	pthread_mutex_unlock(&layoutMutex);
}

@implementation TiLayoutQueue

+(void)initialize
{
	pthread_mutex_init(&layoutMutex, NULL);
	pthread_mutex_unlock(&layoutMutex);
}

+(void)addViewProxy:(TiViewProxy*)newViewProxy
{
	pthread_mutex_lock(&layoutMutex);

	if (layoutArray == nil)
	{
		layoutArray = [[NSMutableArray alloc] initWithObjects:newViewProxy,nil];
	}
	else if([layoutArray containsObject:[newViewProxy parent]])
	{//For safety reasons, we do add this to the list. But since the parent's already here,
	//We add it to the last so that it's likely the parent already call the child before we need to.
		[layoutArray addObject:newViewProxy];
	}
	else
	{//We might be someone's parent, so let's add to to the front just incase.
		[layoutArray insertObject:newViewProxy atIndex:0];
	}

	if (layoutTimer == NULL)
	{
		layoutTimer = CFRunLoopTimerCreate(NULL,
				CFAbsoluteTimeGetCurrent()+LAYOUT_TIMER_INTERVAL,
				LAYOUT_TIMER_INTERVAL,
				0, 0, performLayoutRefresh, NULL);
		CFRunLoopAddTimer(CFRunLoopGetMain(), layoutTimer, kCFRunLoopCommonModes);
	}

	pthread_mutex_unlock(&layoutMutex);
}

@end


text:
package graph

// This file will not be regenerated automatically.
//
// It serves as dependency injection for your app, add any dependencies you require here.

type Resolver struct{}


text:
/**
 * openui5-googlemaps - OpenUI5 Google Maps library
 * @version v0.0.27
 * @link http://jasper07.github.io/openui5-googlemaps/
 * @license MIT
 */sap.ui.define(['jquery.sap.global', 'sap/ui/core/Core', 'sap/ui/core/library'],
    function(jQuery) {

        "use strict";
        (function() {

            var sPath = jQuery.sap.getResourcePath("openui5/googlemaps/loadScripts");
            jQuery.sap.registerResourcePath('google.maps', sPath);
            jQuery.sap.require('openui5.googlemaps.ScriptsUtil');

            //preload types
            jQuery.sap.require('openui5.googlemaps.MapTypeId');
            jQuery.sap.require('openui5.googlemaps.Animation');
            jQuery.sap.require('openui5.googlemaps.TravelMode');
            jQuery.sap.require('openui5.googlemaps.UnitSystem');

            // delegate further initialization of this library to the Core
            sap.ui.getCore().initLibrary({
                name: "openui5.googlemaps",
                dependencies: ["sap.ui.core"],
                types: [
                    "openui5.googlemaps.MapTypeId",
                    "openui5.googlemaps.Animation",
                    "openui5.googlemaps.TravelMode",
                    "openui5.googlemaps.UnitSystem"
                ],
                interfaces: [],
                controls: [
                    "openui5.googlemaps.Map",
                    "openui5.googlemaps.Marker",
                    "openui5.googlemaps.Polyline",
                    "openui5.googlemaps.Polygon",
                    "openui5.googlemaps.Directions",
                    "openui5.googlemaps.Waypoint",
                    "openui5.googlemaps.MarkerCluster"
                ],
                elements: [],
                version: "0.0.27"

            });
        })();
        return true;
    }, true);


text:
package xyz.mcex.plugin.equity.chart;

import io.vertx.core.AbstractVerticle;
import io.vertx.core.Vertx;
import io.vertx.core.http.HttpServer;
import io.vertx.ext.web.Router;
import org.bukkit.configuration.file.FileConfiguration;
import xyz.mcex.plugin.DatabaseManager;

public class ChartVerticle extends AbstractVerticle
{
  private final FileConfiguration _config;
  private final DatabaseManager _manager;

  public ChartVerticle(FileConfiguration config, DatabaseManager manager)
  {
    this._config = config;
    this._manager = manager;
  }

  @Override
  public void start()
  {
    if (!_config.getBoolean("chart-enabled", false))
      return;

    int port = _config.getInt("chart-port", 2015);

    Vertx vertx = this.getVertx();
    HttpServer server = vertx.createHttpServer();

    Router router = Router.router(vertx);
    JsonDataHandler jsonHandler = new JsonDataHandler(this._manager);
    router.route("/charts/:item").handler(new ChartHandler(_config.getString("chart-url") + ":" + port, jsonHandler));
    router.route("/charts/:item/json").handler(jsonHandler);

    server.requestHandler(router::accept).listen(port);
  }
}


text:
# Use, modification and distribution is subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

# Test all_reduce() collective.

import boost.parallel.mpi as mpi
from generators import *

def all_reduce_test(comm, generator, kind, op, op_kind):
    if comm.rank == 0:
        print ("Reducing to %s of %s..." % (op_kind, kind)),
    my_value = generator(comm.rank)
    result = mpi.all_reduce(comm, my_value, op)
    expected_result = generator(0);
    for p in range(1, comm.size):
        expected_result = op(expected_result, generator(p))

    assert result == expected_result
    if comm.rank == 0:
        print "OK."
    return

all_reduce_test(mpi.world, int_generator, "integers", lambda x,y:x + y, "sum")
all_reduce_test(mpi.world, int_generator, "integers", lambda x,y:x * y, "product")
all_reduce_test(mpi.world, string_generator, "strings", lambda x,y:x + y, "concatenation")
all_reduce_test(mpi.world, string_list_generator, "list of strings", lambda x,y:x + y, "concatenation")


text:
describe('Service: debounce', function () {

  beforeEach(module('ngNephila.services.debounce'));

  var debounce, $timeout;

  beforeEach(inject(function (_nphDebounce_,  _$timeout_) {
    debounce = _nphDebounce_;
    $timeout = _$timeout_;
  }));

  it('should fucking work', function () {
    expect(debounce).toBeDefined();
  });

  it('shouldnt execute immediately', function(){
    var counter = 0;
    var incr = debounce(function(){
      counter += 1;
    }, 100, false);
    expect(counter).toBe(0);
    incr();
    expect(counter).toBe(0);
  });

  it('should execute immediately', function(){
    var counter = 0;
    var incr = debounce(function(){
      counter += 1;
    }, 100, true);
    incr();
    expect(counter).toBe(1);
  });

  it('should execute after delay', function(){
    var counter = 0;
    var incr = debounce(function(){
      counter += 1;
    }, 200);
    incr();
    expect(counter).toBe(0);
    $timeout.flush(200);
    expect(counter).toBe(1);
  });

  it('should only happen once', function(){
    var counter = 0;
    var incr = debounce(function(){
      counter += 1;
    }, 200);
    incr();
    incr();
    expect(counter).toBe(0);
    $timeout.flush(200);
    expect(counter).toBe(1);
    incr();
    incr();
    $timeout.flush(200);
    expect(counter).toBe(2);
  });

});


text:
package fi.kapsi.kosmik.sfti

import java.io.InputStream

import scala.collection.{SortedMap, immutable, mutable}

object Chapter04 {

  /**
    * Set up a map of prices for a number of gizmos that you covet. Then produce
    * a second map with the same keys and the prices at a 10 percent discount.
    */
  object Ex01 {
    def discount(gizmos: Map[String, Double]): Map[String, Double] =
      gizmos.map({ case (name, price) => name -> price * 0.9 })
  }

  /**
    * Write a program that reads words from a file. Use a mutable map to count
    * how often each word appears... At the end, print out all words and their counts.
    * NOTE: I chose to use InputStream instead of File.
    */
  object Ex02 {
    def countWords(input: InputStream): Map[String, Int] = {
      val scanner = new java.util.Scanner(input)
      val occurrences = mutable.Map[String, Int]() withDefaultValue 0
      while (scanner.hasNext()) {
        val word = scanner.next()
        val count = occurrences(word)
        occurrences(word) = count + 1
      }

      occurrences.toMap
    }
  }

  /**
    * Repeat the preceding exercise with an immutable map.
    */
  object Ex03 {
    def countWords(input: InputStream): Map[String, Int] = {
      def countWords(acc: Map[String, Int], words: List[String]): Map[String, Int] = {
        if (words.isEmpty) acc
        else {
          val word = words.head
          val count = acc(word)
          countWords(acc + (word -> (count + 1)), words.tail)
        }
      }

      import scala.collection.JavaConverters._
      val scanner = new java.util.Scanner(input)
      countWords(Map() withDefaultValue 0, scanner.asScala.toList)
    }
  }

  /**
    * Repeat the preceding exercise with a sorted map, so that the words are
    * printed in sorted order.
    */
  object Ex04 {
    def countWords(input: InputStream): SortedMap[String, Int] = {
      def countWords(acc: SortedMap[String, Int], words: List[String]): SortedMap[String, Int] = {
        if (words.isEmpty) acc
        else {
          val word = words.head
          val count = if (acc.contains(word)) acc(word) else 0
          countWords(acc + (word -> (count + 1)), words.tail)
        }
      }

      import scala.collection.JavaConverters._
      val scanner = new java.util.Scanner(input)
      // NOTE: SortedMap does not support withDefaultValue
      countWords(SortedMap(), scanner.asScala.toList)
    }
  }

  /**
    * Repeat the preceding exercise with a java.util.TreeMap that you adapt to the
    * Scala API.
    */
  object Ex05 {
    def countWords(input: InputStream): mutable.Map[String, Int] = {
      import scala.collection.JavaConverters._
      val occurrences: mutable.Map[String, Int] = new java.util.TreeMap[String, Int]().asScala

      val scanner = new java.util.Scanner(input)
      while (scanner.hasNext()) {
        val word = scanner.next()
        val count = if (occurrences.contains(word)) occurrences(word) else 0
        occurrences(word) = count + 1
      }

      occurrences
    }
  }

  /**
    * Define a linked hash map that maps "Monday" to java.util.Calendar.MONDAY , and
    * similarly for the other weekdays. Demonstrate that the elements are visited
    * in insertion order.
    */
  object Ex06 {
    def toLinkedMap(entries: List[(String, Int)]): mutable.LinkedHashMap[String, Int] = {
      val map = mutable.LinkedHashMap[String, Int]()
      for ((key, value) <- entries)
        map(key) = value
      map
    }
  }

  /**
    * Print a table of all Java properties reported by the getProperties method of the
    * java.lang.System class
    */
  object Ex07 {
    def systemProps(printAlso: Boolean = false): String = {
      val properties = java.lang.System.getProperties
      import scala.collection.JavaConverters._
      val names = properties.stringPropertyNames().asScala.toList.sorted

      val maxLength = names
        .map(_.length)
        .sorted(Ordering.Int.reverse)
        .head

      val formatted = names.map(n => f"${n.padTo(maxLength, ' ')} | ${properties.getProperty(n)}%n").mkString("")
      if (printAlso) print(formatted)
      formatted
    }
  }

  /**
    * Write a function minmax(values: Array[Int]) that returns a pair containing the
    * smallest and the largest values in the array.
    */
  object Ex08 {
    def minmax(values: Array[Int]): (Int, Int) = (values.min, values.max)
  }

  /**
    * Write a function lteqgt(values: Array[Int], v: Int) that returns a triple containing
    * the counts of values less than v, equal to v, and greater than v.
    */
  object Ex09 {
    def lteqgt(values: Array[Int], v: Int): (Int, Int, Int) = {
      def count(acc: (Int, Int, Int), rem: Array[Int]): (Int, Int, Int) = {
        if (rem.isEmpty) acc
        else {
          if (rem.head < v) count(acc.copy(_1 = acc._1 + 1), rem.tail)
          else if (rem.head == v) count(acc.copy(_2 = acc._2 + 1), rem.tail)
          else count(acc.copy(_3 = acc._3 + 1), rem.tail)
        }
      }

      count((0, 0, 0), values)
    }
  }

  /**
    * What happens when you zip together two strings, such as "Hello".zip("World") ?
    * Come up with a plausible use case.
    */
  object Ex10 {
    def zip(a: String, b: String): immutable.IndexedSeq[(Char, Char)] = a.zip(b)
  }
}


text:
<http://maxjacobson.github.io/mapquest>

A fun, elegant game to see how many countries you can name.

## contributing

* fork and clone the repo
* `bundle install`
* head's up: [one gem](https://github.com/guard/guard-coffeescript#javascript-runtimes) depends on you having a javascript runtime such as node on your system
* `bundle exec guard`
* visit <http://localhost:4000> and check it out
* find or open [an issue](https://github.com/maxjacobson/mapquest/issues)
* start hacking
* squash your commits and reference the relevant issue, then submit a pull request
    * [this post](https://medium.com/code-adventures/a940ee20862d) by TJ Holowaychuk is a good explanation of the git conventions I want to try to follow

## goals

### design

* a clean map with all of the countries in the world, unlabeled
* a text box to type in countries as you think of them (case insensitive)
* when you match a country, it becomes labeled and you receive points
* the option to zoom in on the map
* a timer that starts when you start
* an option to tweet/facebook how you did

### meta

* hosted on GitHub pages
* fun exercise in front end development
* create Issues and receive Pull Requests from friends

## development diary

### 2013-11-01

Max here

* I've created a repository
* I've created a README
* I've switched the primary branch from `master` to `gh-pages`, which I'll consider the master branch for now so it will show up online at <http://maxjacobson.github.io/mapquest>
* I've created a simple jekyll site structure
* I want the site to be online at `/mapquest` but the local development server runs at `/` so I struggled for a little while with jekyll's `baseurl` configuration setting. [This thread](https://github.com/mojombo/jekyll/issues/1097) ultimately pointed me in the right direction.

### 2013-11-02

Max here

* I integrated [guard](https://github.com/guard/guard) to kind of emulate the rails asset pipeline for compiling Sass and CoffeeScript and serving the Jekyll site. Just run `bundle exec guard` and it does a whole lot of stuff.
* The weird thing about having a Gemfile in your Jekyll site is that it will be included in the compiled site as an arbitrary text file on your server unless you specifically exclude it in the `_config.yml`. So, for example, because <https://github.com/mojombo/mojombo.github.io/blob/master/README.textile> isn't excluded, this is online: <http://tom.preston-werner.com/README.textile>. Which is, I guess, cool for a README?

### 2013-11-03

Max here living the modular lyf

* Totally broke apart my layout to use [Jekyll includes](http://jekyllrb.com/docs/templates/#includes) which are basically just rails partials
* Totally broke apart the css to use [Sass imports](http://sass-lang.com/guide#5)

Max here adding lame gameplay mechanics

* lol this game sucks but it meets the definition of the word


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Gaea.Net.Core
{
    public class GaeaTcpServer:GaeaSocketBase
    {
        List<GaeaTcpListener> listeners = new List<GaeaTcpListener>();
        GaeaTcpListener defaultListener = null;
        private bool active;

        public GaeaTcpServer():base()
        {
            defaultListener = new GaeaTcpListener();
            defaultListener.TcpServer = this;
            defaultListener.RegisterContextClass(typeof(GaeaSocketContext));
        }

        public void Open()
        {
            defaultListener.Start();
            defaultListener.DoPostRequest(100);
            active = true;
        }

        public void Stop()
        {
            if (active)
            {
                active = false;
                // 停止监听
                defaultListener.Stop();

                // 请求断开
                RequestDisconnectAll();

                // 等待连接关闭
                WaitForContextRelease();

                LogMessage(String.Format(GaeaStrRes.STR_ServerOff, Name), LogLevel.lgvDebug);
            }
        }

        public int DefaultPort {
            set
            {
                defaultListener.Port = value;
            }
            get
            {
                return defaultListener.Port;
            }
        }

        public GaeaTcpListener DefaultListener { get { return defaultListener; } }

        public bool Active { get { return active; } set { } }

    }
}


text:
'''
Created on Mar 29, 2012

@author: ibagrak
'''
import logging
from datetime import datetime
from webapp2_extras import json

import settings
import utils

from google.appengine.ext import db

class UnsupportedFieldTypeError(Exception): pass
class InvalidFieldValueError(Exception): pass

class RESTModel(db.Model):
    # implemented by subclasses
    @classmethod
    def validate(cls, kvs):
        pass

    # returns an entity based on id
    @classmethod
    def get(cls, i):
        return cls.get_by_id(i)

    # creates a new entity
    @classmethod
    def put(cls, kvs, entity = None):

        # prevent malicious overwriting of system attrs
        for k in kvs.keys():
            if not k in cls.properties():
                del kvs[k]
                continue

            v = cls.__dict__[k]

            # convert unicode values to datastore value types
            if isinstance(v, db.IntegerProperty):
                kvs[k] = int(kvs[k])
            elif isinstance(v, db.FloatProperty):
                kvs[k] = float(kvs[k])
            elif isinstance(v, db.BooleanProperty):
                kvs[k] = True if kvs[k] == 'True' else False
            elif isinstance(v, db.StringProperty) or isinstance(v, db.TextProperty):
                kvs[k] = kvs[k]
            elif isinstance(v, db.DateProperty):
                kvs[k] = datetime.strptime(kvs[k], settings.DATE_FORMAT).date()
            elif isinstance(v, db.LinkProperty):
                kvs[k] = kvs[k] #TODO: verify URL
            elif isinstance(v, db.EmailProperty):
                kvs[k] = kvs[k] #TODO: verify email address
            else:
                raise UnsupportedFieldTypeError(v)

        # validate key/value pairs (semantic validation, assume type checking is finished)
        cls.validate(kvs)

        try:
            if not entity:
                entity = cls(**kvs)
            else:
                for k in kvs.keys():
                    setattr(entity, k, kvs[k])

            db.put(entity)
        except Exception as e:
            logging.error("Couldn't put entity: %s" % kvs)
            logging.error(e)
            return None

        return entity

    # updates existing entity based on id
    @classmethod
    def post(cls, i, kvs):
        entity = cls.get_by_id(i)
        return cls.put(kvs, entity = entity)

    # deletes an entity based on id
    @classmethod
    def delete1(cls, i):
        item = cls.get_by_id(i)
        if item:
            item.delete()
            return True

        return False

    @property
    def str(self):
        return str(json.encode(utils.to_dict(self)))

def generate_model_form(cls, with_key = False):
    fields = filter(lambda x: issubclass(type(x[1]), db.Property), cls.__dict__.iteritems())

    #firstly, let's add key to the form and make it disabled
    form = [{'element' : 'text', 'label' : 'id', 'id' : 'id'}] if with_key else []

    for (k, t) in fields:
        d = {'label' : k, 'id' : k}

        if isinstance(t, db.IntegerProperty) or isinstance(t, db.FloatProperty):
            d['element'] = 'text'
            d['class'] = 'number'

        elif isinstance(t, db.StringProperty):
            d['element'] = 'text'

        elif isinstance(t, db.TextProperty):
            d['element'] = 'textarea'
            d['class'] = 'textarea'

        elif isinstance(t, db.DateProperty):
            d['element'] = 'text'
            d['class'] = 'date'
            d['format'] = settings.DATE_FORMAT_HTML

        elif isinstance(t, db.BooleanProperty):
            d['element'] = 'checkbox'
            d['class'] = 'checkbox'

        elif isinstance(t, db.EmailProperty):
            d['element'] = 'text'
            d['class'] = 'email'

        elif isinstance(t, db.LinkProperty):
            d['element'] = 'text'
            d['class'] = 'url'

        else:
            raise UnsupportedFieldTypeError(k)

        form.append(d)

    return form

class Widget(RESTModel):
    int_field = db.IntegerProperty(required = True)
    boolean_field = db.BooleanProperty(required = True)
    string_field = db.StringProperty(required = True)
    text_field = db.TextProperty(required = True)
    email_field = db.EmailProperty(required = True)
    link_field = db.LinkProperty(required = True)
    date_field = db.DateProperty(required = True)

class EmailAddr(db.Model):
    email = db.EmailProperty(required = True)


text:
title: 'Installation'
excerpt: 'Learn how to install Jovo, the open source framework for voice and chat apps.'
---

# Installation

Learn how to install Jovo, the open source framework for voice and chat apps.

## Introduction

Jovo is an open-source framework based on [TypeScript](https://www.typescriptlang.org/) which can be used with both TypeScript and JavaScript. If you run into any problems while installing it, please let us know [in the Jovo forum](https://community.jovo.tech/) or [create an issue on GitHub](https://github.com/jovotech/jovo-framework/issues).

Before getting started, make sure you have the following installed on your computer or development environment:

- [Node.js](https://nodejs.org/en/download/) version `12.x` or later
- [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) (node package manager)

There are two ways how you can install Jovo:

- [Install the Jovo CLI](#install-the-cli) (recommended way in our [getting started guide](https://www.jovo.tech/docs/getting-started))
- [Clone a sample app](#clone-a-sample-app)

If you're looking to migrate to Jovo `v4` from a `v3` project, take a look at our [migration guide](./migration-from-v3.md).

## Install the CLI

You can install the new Jovo CLI like this:

```sh
$ npm install -g @jovotech/cli
```

After successful installation, you should be able to see the Jovo CLI menu by typing the following into your command line:

```sh
$ jovo
```

### Create a new Project

After installing the Jovo CLI, you can install the template ([TypeScript](https://github.com/jovotech/jovo-v4-template) or [JavaScript](https://github.com/jovotech/jovo-v4-template-js)) using the [`new` command](https://www.jovo.tech/docs/new-command):

```sh
$ jovo new <directory>
```

This will download the template into a new `<directory>` folder and install all necessary dependencies.

### Run the Local Development Server

Change your working directory into your newly created project directory and run your app:

```sh
# Change working directory to your previously specified directory
$ cd <directory>

# Run the local development server
$ jovo run
```

You can now open the [Jovo Debugger](./debugger.md) with the `.` key.

## Clone a Sample App

You can find a sample project for a Jovo app on GitHub:

- [TypeScript version](https://github.com/jovotech/jovo-v4-template)
- [JavaScript version](https://github.com/jovotech/jovo-v4-template-js)

You can clone it like this:

```sh
# TypeScript version
$ git clone https://github.com/jovotech/jovo-v4-template.git

# JavaScript version
$ git clone https://github.com/jovotech/jovo-v4-template-js.git
```

Then go into the directory and install the dependencies:

```sh
$ npm install
```


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NWhisper
{
    public struct Header
    {
        public Header(AggregationType aggregationType, long maxRetention, double xFilesFactor, List<ArchiveInfo> archiveList)
        {
            this.AggregationType = aggregationType;
            this.MaxRetention = maxRetention;
            this.xFilesFactor = xFilesFactor;
            this.ArchiveList = archiveList;
        }

        public readonly AggregationType AggregationType;
        public readonly long MaxRetention;
        public readonly double xFilesFactor;
        public readonly List<ArchiveInfo> ArchiveList;
    }
}


text:
package com.bootdo.oa.dao;

import com.bootdo.oa.domain.NotifyRecordDO;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;

/**
 * 通知通告发送记录
 *
 * @author chglee
 * @email 1992lcg@163.com
 * @date 2017-10-09 17:18:45
 */
@Mapper
public interface NotifyRecordDao {

	NotifyRecordDO get(Long id);

	List<NotifyRecordDO> list(Map<String, Object> map);

	int count(Map<String, Object> map);

	int save(NotifyRecordDO notifyRecord);

	int update(NotifyRecordDO notifyRecord);

	int remove(Long id);

	int batchRemove(Long[] ids);

	int batchSave(List<NotifyRecordDO> records);

	Long[] listNotifyIds(Map<String, Object> map);

	int removeByNotifbyId(Long notifyId);

	int batchRemoveByNotifbyId(Long[] notifyIds);

	int changeRead(NotifyRecordDO notifyRecord);
}


text:
////abstract class A {
////    abstract f(a: number, b: string): boolean;
////    abstract f(a: number, b: string): this;
////    abstract f(a: string, b: number): Function;
////    abstract f(a: string): Function;
////    abstract foo(): number;
////}
////
////class C extends A {}

verify.codeFix({
    description: "Implement inherited abstract class",
    newFileContent:
`abstract class A {
    abstract f(a: number, b: string): boolean;
    abstract f(a: number, b: string): this;
    abstract f(a: string, b: number): Function;
    abstract f(a: string): Function;
    abstract foo(): number;
}

class C extends A {
    f(a: number, b: string): boolean;
    f(a: number, b: string): this;
    f(a: string, b: number): Function;
    f(a: string): Function;
    f(a: any, b?: any) {
        throw new Error("Method not implemented.");
    }
    foo(): number {
        throw new Error("Method not implemented.");
    }
}`
});


text:
import IView from './IView';
import { Tag, Bookmark } from '../service';
import * as octicons from "octicons";

const template:string = `

    <select class="gitxpress__sidebar--bookmark__list--dropdown" placeholder="Type your tag..."></select>

`;

export default class BookmarkView extends IView {

  private props:any;
  private tags:Tag;

  constructor(props:any) {
    super('#gxContentArea', template);
    this.props = props;
    this.tags = props.state.tags || {};
  }

  componentDidRender(){
    $('#gxHeaderArea').html(`<span class="gitxpress__sidebar--header--action">Bookmark</span>`);
    let tagList = Object.keys(this.tags).reduce((acc:Array<String>, value:String, key:Number) => {
      acc.push(`<option value="${value}">${value}</option>`);
      return acc;
    }, ['<option value="all">All</option>']).join('');
    $('#gxBookmarkView select').html(tagList);
    $('#gxBookmarkView select').selectize();

    let repoListPromise = this.findRepos().reduce((acc:Array<any>, value:String, key:Number) => {
      let repoPath = value.split('_').join('/');
      let repoPromise = new Promise((resolve:Function, reject:Function) => {
        $.getJSON(`https://api.github.com/repos/${repoPath}`, (data:any) => {
          let description = data.description.replace(/:([a-zA-Z]*):/, "").trim();
          let download:string = octicons['cloud-download'].toSVG();
          let repoElement = `

              ${download}

              ${repoPath}
              ${description}

              sample
              another

`;
          resolve(repoElement);
        })
      });
      acc.push(repoPromise);
      return acc;
    }, []);

    Promise.all(repoListPromise).then((data:any) => {
      console.log(data);
      $('#gxBookmarkView ul').html(data.join(''));
    }, (error:any) => {

    })

    //$('#gxBookmarkView ul').html(repoList);
  }

  componentWillRender(){}

  findRepos(tag?:string) {

    let tagsValue:Tag = this.props.state.tags;

    if(tag) {
      let obj:Bookmark = {};
      obj[tag] = <Array<string>>this.tags[tag];
      tagsValue = obj;
    }

    return Object.keys(tagsValue).reduce((acc:Array<string>, value:string, key:number) => {
      let repos = tagsValue[value];
      acc = acc.concat(repos);
      return acc;
    }, []);
  }
}


text:
package VMOMI::PhysicalNicVmDirectPathGen2SupportedMode;
use parent 'VMOMI::SimpleType';

use strict;
use warnings;

1;


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <title>To refactor - First</title>

The Header

                            nav item 1

                            nav item 2

                            nav item 3

                           nav item 4

This is the heading of the main section

Post header

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris urna orci, euismod vitae sollicitudin et, varius et velit. Cras et tellus erat. Vestibulum auctor varius purus faucibus posuere. Maecenas et libero et orci bibendum eleifend sit amet ut purus. Sed at lorem in metus tempus pretium. Praesent cursus rhoncus nulla. Nulla condimentum lacus et ligula consectetur eu tristique sem scelerisque. Duis id velit enim, sed sodales nulla. Donec leo erat, posuere vel scelerisque in, rutrum ac magna. Donec elementum nunc molestie nulla semper vitae placerat turpis bibendum. Phasellus egestas lobortis dictum.

Post header

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris urna orci, euismod vitae sollicitudin et, varius et velit. Cras et tellus erat. Vestibulum auctor varius purus faucibus posuere. Maecenas et libero et orci bibendum eleifend sit amet ut purus. Sed at lorem in metus tempus pretium. Praesent cursus rhoncus nulla. Nulla condimentum lacus et ligula consectetur eu tristique sem scelerisque. Duis id velit enim, sed sodales nulla. Donec leo erat, posuere vel scelerisque in, rutrum ac magna. Donec elementum nunc molestie nulla semper vitae placerat turpis bibendum. Phasellus egestas lobortis dictum.

Post header

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris urna orci, euismod vitae sollicitudin et, varius et velit. Cras et tellus erat. Vestibulum auctor varius purus faucibus posuere. Maecenas et libero et orci bibendum eleifend sit amet ut purus. Sed at lorem in metus tempus pretium. Praesent cursus rhoncus nulla. Nulla condimentum lacus et ligula consectetur eu tristique sem scelerisque. Duis id velit enim, sed sodales nulla. Donec leo erat, posuere vel scelerisque in, rutrum ac magna. Donec elementum nunc molestie nulla semper vitae placerat turpis bibendum. Phasellus egestas lobortis dictum.

Post header

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris urna orci, euismod vitae sollicitudin et, varius et velit. Cras et tellus erat. Vestibulum auctor varius purus faucibus posuere. Maecenas et libero et orci bibendum eleifend sit amet ut purus. Sed at lorem in metus tempus pretium. Praesent cursus rhoncus nulla. Nulla condimentum lacus et ligula consectetur eu tristique sem scelerisque. Duis id velit enim, sed sodales nulla. Donec leo erat, posuere vel scelerisque in, rutrum ac magna. Donec elementum nunc molestie nulla semper vitae placerat turpis bibendum. Phasellus egestas lobortis dictum.

        and the footer


text:
// This sub-API supports the following functionalities:
//
//  - Audio device handling.
//  - Device information.
//  - CPU load monitoring.
//
// Usage example, omitting error checking:
//
//  using namespace webrtc;
//  VoiceEngine* voe = VoiceEngine::Create();
//  VoEBase* base = VoEBase::GetInterface(voe);
//  VoEHardware* hardware  = VoEHardware::GetInterface(voe);
//  base->Init();
//  ...
//  int n_devices = hardware->GetNumOfPlayoutDevices();
//  ...
//  base->Terminate();
//  base->Release();
//  hardware->Release();
//  VoiceEngine::Delete(voe);
//
#ifndef WEBRTC_VOICE_ENGINE_VOE_HARDWARE_H
#define WEBRTC_VOICE_ENGINE_VOE_HARDWARE_H

#include "webrtc/common_types.h"

namespace webrtc {

class VoiceEngine;

class WEBRTC_DLLEXPORT VoEHardware
{
public:
    // Factory for the VoEHardware sub-API. Increases an internal
    // reference counter if successful. Returns NULL if the API is not
    // supported or if construction fails.
    static VoEHardware* GetInterface(VoiceEngine* voiceEngine);

    // Releases the VoEHardware sub-API and decreases an internal
    // reference counter. Returns the new reference count. This value should
    // be zero for all sub-API:s before the VoiceEngine object can be safely
    // deleted.
    virtual int Release() = 0;

    // Gets the number of audio devices available for recording.
    virtual int GetNumOfRecordingDevices(int& devices) = 0;

    // Gets the number of audio devices available for playout.
    virtual int GetNumOfPlayoutDevices(int& devices) = 0;

    // Gets the name of a specific recording device given by an |index|.
    // On Windows Vista/7, it also retrieves an additional unique ID
    // (GUID) for the recording device.
    virtual int GetRecordingDeviceName(int index, char strNameUTF8[128],
                                       char strGuidUTF8[128]) = 0;

    // Gets the name of a specific playout device given by an |index|.
    // On Windows Vista/7, it also retrieves an additional unique ID
    // (GUID) for the playout device.
    virtual int GetPlayoutDeviceName(int index, char strNameUTF8[128],
                                     char strGuidUTF8[128]) = 0;

    // Checks if the sound card is available to be opened for recording.
    virtual int GetRecordingDeviceStatus(bool& isAvailable) = 0;

    // Checks if the sound card is available to be opened for playout.
    virtual int GetPlayoutDeviceStatus(bool& isAvailable) = 0;

    // Sets the audio device used for recording.
    virtual int SetRecordingDevice(
        int index, StereoChannel recordingChannel = kStereoBoth) = 0;

    // Sets the audio device used for playout.
    virtual int SetPlayoutDevice(int index) = 0;

    // Sets the type of audio device layer to use.
    virtual int SetAudioDeviceLayer(AudioLayers audioLayer) = 0;

    // Gets the currently used (active) audio device layer.
    virtual int GetAudioDeviceLayer(AudioLayers& audioLayer) = 0;

    // Gets the VoiceEngine's current CPU consumption in terms of the percent
    // of total CPU availability. [Windows only]
    virtual int GetCPULoad(int& loadPercent) = 0;

    // Not supported
    virtual int ResetAudioDevice() = 0;

    // Not supported
    virtual int AudioDeviceControl(
        unsigned int par1, unsigned int par2, unsigned int par3) = 0;

    // Not supported
    virtual int SetLoudspeakerStatus(bool enable) = 0;

    // Not supported
    virtual int GetLoudspeakerStatus(bool& enabled) = 0;

    // Native sample rate controls (samples/sec)
    virtual int SetRecordingSampleRate(unsigned int samples_per_sec) = 0;
    virtual int RecordingSampleRate(unsigned int* samples_per_sec) const = 0;
    virtual int SetPlayoutSampleRate(unsigned int samples_per_sec) = 0;
    virtual int PlayoutSampleRate(unsigned int* samples_per_sec) const = 0;

    // *Experimental - not recommended for use.*
    // Enables the Windows Core Audio built-in AEC. Fails on other platforms.
    //
    // Currently incompatible with the standard VoE AEC and AGC; don't attempt
    // to enable them while this is active.
    //
    // Must be called before VoEBase::StartSend(). When enabled:
    // 1. VoEBase::StartPlayout() must be called before VoEBase::StartSend().
    // 2. VoEBase::StopSend() should be called before VoEBase::StopPlayout().
    //    The reverse order may cause garbage audio to be rendered or the
    //    capture side to halt until StopSend() is called.
    //
    //    As a consequence, SetPlayoutDevice() should be used with caution
    //    during a call. It will function, but may cause the above issues for
    //    the duration it takes to complete. (In practice, it should complete
    //    fast enough to avoid audible degradation).
    virtual int EnableBuiltInAEC(bool enable) = 0;
    virtual bool BuiltInAECIsEnabled() const = 0;

protected:
    VoEHardware() {}
    virtual ~VoEHardware() {}
};

} // namespace webrtc

#endif  //  WEBRTC_VOICE_ENGINE_VOE_HARDWARE_H


text:
using Akka.Actor;
using System;

namespace TrivialWebApiWithActor
{
    class Greeter
        : ReceiveActor
    {
        public static readonly Props Create = Props.Create<Greeter>();

        public Greeter()
        {
            Receive<PrintGreet>(greet =>
            {
                Console.WriteLine($"Hello, {greet.Name}!");
            });

            Receive<GreetMe>(greet =>
            {
                Console.WriteLine($"Greeting '{greet.Name}'...");

                // Reply with greeting.
                Sender.Tell($"Hello, {greet.Name}!");
            });
        }
    }

    public class PrintGreet
    {
        public string Name { get; set; }
    }

    public class GreetMe
    {
        public string Name { get; set; }
    }
}


text:
from .environ import admin_only, cron_only, tasks_only
from .factory import AppConfig, create_app

__all__ = [
    "AppConfig",
    "admin_only",
    "create_app",
    "cron_only",
    "tasks_only",
]


text:
<?php

if ( ! class_exists( 'Presscore_Portfolio_Posts_Scroller', false ) ) {

	class Presscore_Portfolio_Posts_Scroller extends Presscore_Posts_Slider_Scroller {

		protected function setup_config() {
			$config = presscore_get_config();

			$config->set( 'is_scroller', true );
			$config->set( 'template', 'portfolio' );
			$config->set( 'template.layout.type', 'masonry' );
			$config->set( 'layout', 'grid' );
			$config->set( 'justified_grid', false );
			$config->set( 'all_the_same_width', true );
			$config->set( 'post.preview.width.min', $this->args['width'], 300 );
			$config->set( 'post.preview.load.effect', false );

			$config->set( 'show_titles', $this->args['show_title'] );
			$config->set( 'show_excerpts', $this->args['show_excerpt'] );

			if ( 'under_image' == $this->args['appearance'] ) {
				$config->set( 'post.preview.background.enabled', ! in_array( $this->args['bg_under_projects'], array( 'disabled', '' ) ) );
				$config->set( 'post.preview.background.style', $this->args['bg_under_projects'] );
			} else {
				$config->set( 'post.preview.background.enabled', false );
				$config->set( 'post.preview.background.style', false );
			}

			$config->set( 'post.preview.description.style', $this->args['appearance'] );
			$config->set( 'post.preview.description.alignment', $this->args['content_aligment'] );
			$config->set( 'post.preview.hover.animation', $this->args['hover_animation'] );
			$config->set( 'post.preview.hover.color', $this->args['hover_bg_color'] );
			$config->set( 'post.preview.hover.content.visibility', $this->args['hover_content_visibility'] );

			$config->set( 'show_links', $this->args['show_link'] );
			$config->set( 'show_details', $this->args['show_details'] );
			$config->set( 'show_zoom', $this->args['show_zoom'] );

			$config->set( 'post.meta.fields.date', $this->args['show_date'] );
			$config->set( 'post.meta.fields.categories', $this->args['show_categories'] );
			$config->set( 'post.meta.fields.comments', $this->args['show_comments'] );
			$config->set( 'post.meta.fields.author', $this->args['show_author'] );
		}

		protected function render_slide() {
			presscore_populate_portfolio_config();
			presscore_get_config()->set( 'post.preview.media.style', 'featured_image' );
			presscore_get_template_part( 'mod_portfolio', 'masonry/project' );
		}

		protected function add_hooks() {
			add_filter( 'dt_portfolio_thumbnail_args', array( &$this, 'set_image_dimensions' ) );
		}

		protected function remove_hooks() {
			remove_filter( 'dt_portfolio_thumbnail_args', array( &$this, 'set_image_dimensions' ) );
		}

	}

}


text:
var fs          = require('fs')
  , path        = require('path')
  , bundle      = require('./bundler')
  , type        = require('typr')
  , utils       = require('./utils')
  , log         = utils.logule
  , exists      = utils.exists
  , error       = utils.error
  , environment = process.env.NODE_ENV || 'development'
  , envCurrent  = 'all'
  , o           = {};

var logLevels = {
  error : 1
, debug : 4
};

var reserved = {
  'app'       : 'the main code where the entry point resides'
, 'data'      : 'injected data'
, 'external'  : 'externally loaded code'
, 'M8'        : 'the internal debug API'
, 'npm'       : 'node mdules'
};

/**
 * Base class
 */
function Base(sub) {
  this.sub = (sub) ? sub : 'None';
}

Base.prototype.subclassMatches = function (subclass, method) {
  if (this.sub !== subclass) {
    log.warn("Ignoring an invalid call to " + subclass + "::" + method + " after having broken out from the " + subclass + " subclass");
    return false;
  }
  return true;
};

Base.prototype.removeSubClassMethods = function () {
  this.sub = 'None';
};

// Helper for Base.prototype.in
function envCheck() {
  return (environment === envCurrent || envCurrent === 'all');
}

/**
 * Module Start
 * API starts by filling in the static options object
 * Then returning the chainable Base class instance
 */
module.exports = function (entry) {
  var dom = path.dirname(path.resolve(entry))
    , file = path.basename(entry);

  utils.updateProject(file);

  if (!exists(path.join(dom, file))) {
    error("cannot find entry file: " + path.join(dom, file));
  }
  o = {
    data        : {}
  , arbiters    : {}
  , domains     : {
      'app'       : dom
    }
  , pre         : []
  , post        : []
  , ignoreDoms  : []
  , compilers   : {}
  , entryPoint  : file
  , extSuffix   : false
  , domPrefix   : true
  , options     : {
      namespace   : 'M8'
    , domloader   : ''
    , logging     : 'ERROR'
    , force       : false
    , persist     : path.join(__dirname, '..', 'state.json')
    }
  };
  return new Base();
};

/**
 * in(env)
 * Do the next chained calls only if we are in env
 * Lasts until in('all') is called
 */
Base.prototype.in = function (env) {
  envCurrent = env;
  return this;
};

/**
 * logger
 * Any subsequent work will use the configured logule sub if called
 */
Base.prototype.logger = function (sub) {
  this.removeSubClassMethods();
  if (envCheck()) {
    // if a sub is passed in, it is assumed to be filtered outside this anyway
    utils.updateLogger(sub);
  }
  return this;
};

/**
 * before
 * Can be (repeat) called with a function or list of functions that will executed on the code before analysis
 * Good for internal test dependencies
 */
Base.prototype.before = function (fn) {
  this.removeSubClassMethods();
  if (envCheck()) {
    if (type.isArray(fn)) {
      var that = this;
      fn.forEach(function (f) {
        that.before(f);
      });
    }
    else if (!type.isFunction(fn)) {
      log.warn("require 'before' functions to actually be functions - got " + fn);
    }
    else {
      o.pre.unshift(fn);
    }
  }
  return this;
};

/**
 * after
 * Can be (repeat) called with a function or list of functions that will be executed on the code at compiliation time
 * Good for custom minification
 */
Base.prototype.after = function (fn) {
  this.removeSubClassMethods();
  if (envCheck()) {
    if (type.isArray(fn)) {
      var that = this;
      fn.forEach(function (f) {
        that.after(f);
      });
    }
    else if (!type.isFunction(fn)) {
      log.warn("require 'after' functions to actually be functions - got " + fn);
    }
    else {
      o.post.unshift(fn);
    }
  }
  return this;
};

/**
 * register
 * Call with an extension and a compiler to register compile-to-JS languages
 */
Base.prototype.register = function (ext, compiler) {
  this.removeSubClassMethods();
  if (envCheck()) {
    if (ext === '' || ext === '.js') {
      error("cannot re-register the " + (ext === '' ? 'blank' : ext) + " extension");
    }
    if (!type.isFunction(compiler)) {
      error("registered compilers must be a function returning a string - " + ext + " extension failed");
    }
    o.compilers[ext] = compiler;
  }
  return this;
};

/**
 * npm
 * Call with a path to a node_modules folder to enable requiring of browser compatible npm modules
 */
Base.prototype.npm = function (dir) {
  this.removeSubClassMethods();
  if (envCheck()) {
    o.domains.npm = path.resolve(dir);
    if (!fs.existsSync(o.domains.npm)) {
      error('could not resolve the npm path - ' + o.domains.npm + ' does not exist');
    }
  }
  return this;
};

/**
 * set
 * Set one of the valid options
 */
Base.prototype.set = function (key, val) {
  this.removeSubClassMethods();
  if (envCheck()) {
    if (Object.keys(o.options).indexOf(key) >= 0) {

      if (key === 'namespace') {
        if (!type.isString(val) || val === '') {
          error("cannot use a non-string or blank namespace");
        }
        if (!/^[\w_$]*$/.test(val) || !/^[A-Za-z_$]/.test(val)) {
          error("require a namespace valid as a variable name, got " + val);
        }
      }
      else if (key === 'persist') {
        if (!exists(val)) {
          error("got an invalid persist file: " + val);
        }
      }
      else if (key === 'logging') {
        o.logLevel = logLevels[(val + '').toLowerCase()] || 0;
      }
      else if (key === 'domloader') {
        if (!type.isString(val) && !type.isFunction(val)) {
          error("got an invalid domloader options - must be string of function");
        }
      }

      o.options[key] = val;
    }
  }
  return this;
};

/**
 * Data subclass
 */
function Data() {}
Data.prototype = new Base('Data');

/**
 * Entry point for Data subclass
 */
Base.prototype.data = function (input) {
  this.removeSubClassMethods();
  var dt = new Data();
  if (envCheck()) {
    if (type.isObject(input)) {
      Object.keys(input).forEach(function (key) {
        dt.add(key, input[key]);
      });
    }
  }
  return dt;
};

/**
 * Data subclass methods
 */
Data.prototype.add = function (key, val) {
  if (this.subclassMatches('Data', 'add') && envCheck()) {
    if (key && val) {
      key += '';
      o.data[key] = (type.isString(val)) ? val : JSON.stringify(val);
    }
  }
  return this;
};

/**
 * Domains subclass
 */
function Domains() {}
Domains.prototype = new Base('Domains');

/**
 * Entry point for Domains subclass
 */
Base.prototype.domains = function (input) {
  this.removeSubClassMethods();
  var dom = new Domains();
  if (envCheck()) {
    if (type.isObject(input)) {
      Object.keys(input).forEach(function (key) {
        dom.add(key, input[key]);
      });
    }
  }
  return dom;
};

/**
 * Domains subclass methods
 */
Domains.prototype.add = function (key, val) {
  if (this.subclassMatches('Domains', 'add') && envCheck()) {

    if (Object.keys(reserved).indexOf(key) >= 0) {
      error("reserves the '" + key + "' domain for " + reserved[key]);
    }

    o.domains[key] = path.resolve(val);
    if (!fs.existsSync(o.domains[key])) {
      error('could not resolve the ' + key + ' domain - ' + o.domains[key] + ' does not exist');
    }
  }
  return this;
};

/**
 * Libraries subclass
 */
function Libraries() {}
Libraries.prototype = new Base('Libraries');

/**
 * Entry point for Libraries subclass
 */
Base.prototype.libraries = function (list, dir, target) {
  this.removeSubClassMethods();
  var libs = new Libraries();
  if (envCheck()) {
    libs.list(list).path(dir).target(target);
  }
  return libs;
};

/**
 * Libraries subclass methods
 */
Libraries.prototype.list = function (list) {
  if (this.subclassMatches('Libraries', 'list') && envCheck()) {
    if (type.isArray(list)) {
      o.libFiles = list;
    }
  }
  return this;
};

Libraries.prototype.path = function (dir) {
  if (this.subclassMatches('Libraries', 'path') && envCheck()) {
    if (type.isString(dir)) {
      dir = path.resolve(dir);
      if (!fs.existsSync(dir)) {
        error('could not resolve the libraries path - ' + dir + ' does not exist');
      }
      o.libDir = dir;
    }
  }
  return this;
};

Libraries.prototype.target = function (target) {
  if (this.subclassMatches('Libraries', 'target') && envCheck()) {
    if (type.isString(target)) {
      o.libsOnlyTarget = path.resolve(target);
    }
    else if (type.isFunction(target)) {
      o.libsOnlyTarget = target;
    }
  }
  return this;
};

/**
 * Analysis subclass
 */
function Analysis() {}
Analysis.prototype = new Base('Analysis');

/**
 * Entry point for Analysis subclass
 */
Base.prototype.analysis = function (target, prefix, suffix, hide) {
  this.removeSubClassMethods();
  var ana = new Analysis();
  if (envCheck()) {
    ana.output(target).prefix(prefix).suffix(suffix).hide(hide);
  }
  return ana;
};

/**
 * Analysis subclass methods
 */
Analysis.prototype.output = function (target) {
  if (this.subclassMatches('Analysis', 'output') && envCheck()) {
    if (type.isString(target)) {
      o.treeTarget = path.resolve(target);
    }
    else if (type.isFunction(target)) {
      o.treeTarget = target;
    }
  }
  return this;
};

Analysis.prototype.prefix = function (prefix) {
  if (this.subclassMatches('Analysis', 'prefix') && envCheck()) {
    if (!type.isUndefined(prefix)) {
      o.domPrefix = !!prefix;
    }
  }
  return this;
};

Analysis.prototype.suffix = function (suffix) {
  if (this.subclassMatches('Analysis', 'suffix') && envCheck()) {
    if (!type.isUndefined(suffix)) {
      o.extSuffix = !!suffix;
    }
  }
  return this;
};

Analysis.prototype.hide = function (domain) {
  if (this.subclassMatches('Analysis', 'hide') && envCheck()) {
    if (type.isArray(domain)) {
      var that = this;
      domain.forEach(function (d) {
        that.hide(d);
      });
    }
    else if (type.isString(domain)) {
      if (domain === 'app') {
        log.warn("cannot ignore the app domain");
      }
      else {
        o.ignoreDoms.push(domain);
      }
    }
  }
  return this;
};

/**
 * Arbiters subclass
 */
function Arbiters() {}
Arbiters.prototype = new Base('Arbiters');

/**
 * Entry point for Arbiters subclass
 */
Base.prototype.arbiters = function (arbObj) {
  this.removeSubClassMethods();
  var arb = new Arbiters();

  if (envCheck()) {
    if (type.isObject(arbObj)) {
      Object.keys(arbObj).forEach(function (key) {
        arb.add(key, arbObj[key]);
      });
    }
    else if (type.isArray(arbObj)) {
      arbObj.forEach(function (a) {
        arb.add(a);
      });
    }
  }
  return arb;
};

/**
 * Arbiters subclass methods
 */
Arbiters.prototype.add = function (name, globs) {
  if (this.subclassMatches('Arbiters', 'add') && envCheck()) {
    if (type.isArray(globs) && name) {
      globs = globs.filter(function (e) {
        return (type.isString(e) && e !== '');
      });
      o.arbiters[name] = (globs.length === 0) ? name : globs;
    } else if (type.isString(globs) && globs !== '') {
      o.arbiters[name] = [globs];
    } else {
      o.arbiters[name] = [name];
    }
  }
  return this;
};

// use helper
function addPlugin(inst) {
  var name = inst.name
    , data = inst.data
    , dom = inst.domain;

  if (!name) {
    error('plugin has an bad/undefined name key');
  }

  if (type.isFunction(data)) {
    var dataval = data();
    if (!dataval) {
      error('plugin ' + name + 'returned bad value from its defined data method ' + dataval);
    }
    (new Data()).add(name, dataval);
  }

  if (type.isFunction(dom)) {
    var domval = dom();
    if (!type.isString(domval)) {
      error('plugin "' + name + '" returned bad value from its defined domain method');
    }
    (new Domains()).add(name, path.resolve(domval));
  }
}

/**
 * use
 * Call with a Plugin instance (or list of) to pull in bundled data &&|| code from a domain
 */
Base.prototype.use = function (inst) {
  this.removeSubClassMethods();
  if (envCheck()) {
    if (type.isArray(inst)) {
      inst.forEach(function (plugin) {
        addPlugin(plugin);
      });
    }
    else {
      addPlugin(inst);
    }
  }
  return this;
};

/**
 * End point of the chain if in the right environment
 * compile initiates the one time call to the bundler
 */
Base.prototype.compile = function (target) {
  this.removeSubClassMethods();
  if (envCheck()) {
    if (type.isFunction(target)) {
      o.target = target;
    }
    else if (type.isString(target)) {
      o.target = path.resolve(target);
    }
    o.exts = ['', '.js'].concat(Object.keys(o.compilers));
    bundle(o);
    // end chain here
  }
  return this;
};

// internal mini-tests
if (module === require.main) {
  var modul8 = {
    minifier: function () {},
    testcutter: function () {}
  };
  module.exports('app.cs')
  .set('domloader', function (code) {
    return code;
  })
  .set('namespace', 'QQ')
  .set('logging', 'INFO')
  .register('.cs', function (code, bare) {
    return code;
  })
  .before(modul8.testcutter)
  .libraries()
    .list(['jQuery.js', 'history.js'])
    .path('/app/client/libs/')
    .target('dm-libs.js')
  .arbiters()
    .add('jQuery', ['$', 'jQuery'])
    .add('Spine')
  .arbiters({
    'underscore': 'underscore',
    '_': '_'
  })
  .domains()
    .add('app', '/app/client/')
    .add('shared', '/app/shared/')
  .data()
    .add('models', '{modeldata:{getssenttoclient}}')
    .add('versions', {'users/view': [0, 2, 5]})
  .analysis()
    .prefix(true)
    .suffix(false)
  .in('development')
    .output(console.log)
  .in('production')
    .output('filepath!')
  .in('all')
    .after(modul8.minifier)
    .compile('dm.js');
}


text:
package com.netflix.atlas.core.algorithm

/**
  * Alternate between two DES functions after each training period. This provides a deterministic
  * estimate within a bounded amount of time.
  *
  * @param training
  *     Number of samples to record before emitting predicted values.
  * @param alpha
  *     Data smoothing factor.
  * @param beta
  *     Trend smoothing factor.
  */
case class OnlineSlidingDes(
  training: Int,
  alpha: Double,
  beta: Double,
  des1: OnlineDes,
  des2: OnlineDes
) extends OnlineAlgorithm {

  private var useOne = true
  private var currentSample = 0

  override def next(v: Double): Double = {
    currentSample += 1
    val v1 = des1.next(v)
    val v2 = des2.next(v)
    val retval = if (useOne) v1 else v2

    if (currentSample % training == 0) {
      if (useOne) des1.reset() else des2.reset()
      useOne = !useOne
    }

    retval
  }

  override def reset(): Unit = {
    des1.reset()
    des2.reset()
  }

  override def isEmpty: Boolean = false

  override def state: AlgoState = {
    AlgoState(
      "sliding-des",
      "training"      -> training,
      "alpha"         -> alpha,
      "beta"          -> beta,
      "useOne"        -> useOne,
      "currentSample" -> currentSample,
      "des1"          -> des1.state,
      "des2"          -> des2.state
    )
  }
}

object OnlineSlidingDes {

  def apply(state: AlgoState): OnlineSlidingDes = {
    val des1 = OnlineDes(state.getState("des1"))
    val des2 = OnlineDes(state.getState("des2"))
    val sdes = new OnlineSlidingDes(
      state.getInt("training"),
      state.getDouble("alpha"),
      state.getDouble("beta"),
      des1,
      des2
    )
    sdes.useOne = state.getBoolean("useOne")
    sdes.currentSample = state.getInt("currentSample")
    sdes
  }

  def apply(training: Int, alpha: Double, beta: Double): OnlineSlidingDes = {
    val des1 = OnlineDes(training, alpha, beta)
    val des2 = OnlineDes(training, alpha, beta)
    new OnlineSlidingDes(training, alpha, beta, des1, des2)
  }
}


text:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using AdventOfCode2015;

namespace AdventOfCode2015UnitTests
{
    [TestClass]
    public class Day21_UnitTest
    {

        //[TestMethod]
        //[TestCategory("Day21")]
        //public void InfiniteElvesAndInfiniteHouses_CalculatePresents_House1()
        //{
        //    Assert.AreEqual(10, 11);
        //}

    }
}


text:
<?php
if(!function_exists('qode_social_options_map')) {
    /**
     * Social options page
     */
    function qode_social_options_map()
    {

        $socialPage = new QodeAdminPage("_social", "Social", "fa fa-share-alt");
        qode_framework()->qodeOptions->addAdminPage("socialPage", $socialPage);

        //Social Share

        $panel1 = new QodePanel("Social Sharing", "social_sharing_panel");
        $socialPage->addChild("panel1", $panel1);

        $enable_social_share = new QodeField("yesno", "enable_social_share", "no", "Enable Social Share", "Enabling this option will allow social share on networks of your choice", array(),
            array("dependence" => true,
                "dependence_hide_on_yes" => "",
                "dependence_show_on_yes" => "#qodef_facebook_share_panel,#qodef_twitter_share_panel,#qodef_google_share_panel,#qodef_linked_share_panel,#qodef_tumblr_share_panel,#qodef_pinterest_share_panel,#qodef_vk_share_panel,#qodef_show_social_share_panel"));
        $panel1->addChild("enable_social_share", $enable_social_share);

        //Show Social Share

        $panel9 = new QodePanel("Show Social Share", "show_social_share_panel", "enable_social_share", "no");
        $socialPage->addChild("panel9", $panel9);

        $post_types_names_post = new QodeField("flagpost", "post_types_names_post", "", "Posts", "Show Social Share on Blog Posts");
        $panel9->addChild("post_types_names_post", $post_types_names_post);

        $post_types_names_page = new QodeField("flagpage", "post_types_names_page", "", "Pages", "Show Social Share on Pages");
        $panel9->addChild("post_types_names_page", $post_types_names_page);

        $post_types_names_attachment = new QodeField("flagmedia", "post_types_names_attachment", "", "Media", "Show Social Share for Images and Videos");
        $panel9->addChild("post_types_names_attachment", $post_types_names_attachment);

        $post_types_names_portfolio_page = new QodeField("flagportfolio", "post_types_names_portfolio_page", "", "Portfolio Item", "Show Social Share for Portfolio Items");
        $panel9->addChild("post_types_names_portfolio_page", $post_types_names_portfolio_page);

        if (qode_is_woocommerce_installed()) {
            $post_types_names_product = new QodeField("flagproduct", "post_types_names_product", "", "Product", "Show Social Share for Product Items");
            $panel9->addChild("post_types_names_product", $post_types_names_product);
        }

        //Facebook

        $panel2 = new QodePanel("Facebook Share Options", "facebook_share_panel", "enable_social_share", "no");
        $socialPage->addChild("panel2", $panel2);

        $enable_facebook_share = new QodeField("yesno", "enable_facebook_share", "no", "Enable Share", "Enabling this option will allow sharing via Facebook", array(), array("dependence" => true, "dependence_hide_on_yes" => "", "dependence_show_on_yes" => "#qodef_enable_facebook_share_container"));
        $panel2->addChild("enable_facebook_share", $enable_facebook_share);
        $enable_facebook_share_container = new QodeContainer("enable_facebook_share_container", "enable_facebook_share", "no");
        $panel2->addChild("enable_facebook_share_container", $enable_facebook_share_container);
        $facebook_icon = new QodeField("image", "facebook_icon", "", "Icon", "Upload Facebook icon");
        $enable_facebook_share_container->addChild("facebook_icon", $facebook_icon);

        //Twitter

        $panel3 = new QodePanel("Twitter Share Options", "twitter_share_panel", "enable_social_share", "no");
        $socialPage->addChild("panel3", $panel3);

        $enable_twitter_share = new QodeField("yesno", "enable_twitter_share", "no", "Enable Share", "Enabling this option will allow sharing via Twitter", array(), array("dependence" => true, "dependence_hide_on_yes" => "", "dependence_show_on_yes" => "#qodef_enable_twitter_share_container"));
        $panel3->addChild("enable_twitter_share", $enable_twitter_share);
        $enable_twitter_share_container = new QodeContainer("enable_twitter_share_container", "enable_twitter_share", "no");

        $panel3->addChild("enable_twitter_share_container", $enable_twitter_share_container);
        $twitter_icon = new QodeField("image", "twitter_icon", "", "Icon", "Upload Twitter icon");
        $enable_twitter_share_container->addChild("twitter_icon", $twitter_icon);
        $twitter_via = new QodeField("text", "twitter_via", "", "Via", "");
        $enable_twitter_share_container->addChild("twitter_via", $twitter_via);

        //Google Plus

        $panel4 = new QodePanel("Google Plus Share Options", "google_share_panel", "enable_social_share", "no");
        $socialPage->addChild("panel4", $panel4);

        $enable_google_plus = new QodeField("yesno", "enable_google_plus", "no", "Enable Share", "Enabling this option will allow sharing via Google Plus", array(), array("dependence" => true, "dependence_hide_on_yes" => "", "dependence_show_on_yes" => "#qodef_enable_google_plus_container"));
        $panel4->addChild("enable_google_plus", $enable_google_plus);
        $enable_google_plus_container = new QodeContainer("enable_google_plus_container", "enable_google_plus", "no");
        $panel4->addChild("enable_google_plus_container", $enable_google_plus_container);
        $google_plus_icon = new QodeField("image", "google_plus_icon", "", "Icon", "Upload Google Plus icon");
        $enable_google_plus_container->addChild("google_plus_icon", $google_plus_icon);

        //LinkedIn

        $panel5 = new QodePanel("LinkedIn Share Options", "linked_share_panel", "enable_social_share", "no");
        $socialPage->addChild("panel5", $panel5);

        $enable_linkedin = new QodeField("yesno", "enable_linkedin", "no", "Enable Share", "Enabling this option will allow sharing via LinkedIn", array(), array("dependence" => true, "dependence_hide_on_yes" => "", "dependence_show_on_yes" => "#qodef_enable_linkedin_container"));
        $panel5->addChild("enable_linkedin", $enable_linkedin);
        $enable_linkedin_container = new QodeContainer("enable_linkedin_container", "enable_linkedin", "no");
        $panel5->addChild("enable_linkedin_container", $enable_linkedin_container);
        $linkedin_icon = new QodeField("image", "linkedin_icon", "", "Icon", "Upload LinkedIn icon");
        $enable_linkedin_container->addChild("linkedin_icon", $linkedin_icon);

        //Tumblr

        $panel6 = new QodePanel("Tumblr Share Options", "tumblr_share_panel", "enable_social_share", "no");
        $socialPage->addChild("panel6", $panel6);

        $enable_tumblr = new QodeField("yesno", "enable_tumblr", "no", "Enable Share", "Enabling this option will allow sharing via Tumblr", array(), array("dependence" => true, "dependence_hide_on_yes" => "", "dependence_show_on_yes" => "#qodef_enable_tumblr_container"));
        $panel6->addChild("enable_tumblr", $enable_tumblr);
        $enable_tumblr_container = new QodeContainer("enable_tumblr_container", "enable_tumblr", "no");
        $panel6->addChild("enable_tumblr_container", $enable_tumblr_container);
        $tumblr_icon = new QodeField("image", "tumblr_icon", "", "Icon", "Upload Tumblr icon");
        $enable_tumblr_container->addChild("tumblr_icon", $tumblr_icon);

        // Pinterest

        $panel7 = new QodePanel("Pinterest Share Options", "pinterest_share_panel", "enable_social_share", "no");
        $socialPage->addChild("panel7", $panel7);

        $enable_pinterest = new QodeField("yesno", "enable_pinterest", "no", "Enable Share", "Enabling this option will allow sharing via Pinterest", array(), array("dependence" => true, "dependence_hide_on_yes" => "", "dependence_show_on_yes" => "#qodef_enable_pinterest_container"));
        $panel7->addChild("enable_pinterest", $enable_pinterest);
        $enable_pinterest_container = new QodeContainer("enable_pinterest_container", "enable_pinterest", "no");
        $panel7->addChild("enable_pinterest_container", $enable_pinterest_container);
        $pinterest_icon = new QodeField("image", "pinterest_icon", "", "Icon", "Upload Pinterest icon");
        $enable_pinterest_container->addChild("pinterest_icon", $pinterest_icon);

        //VK

        $panel8 = new QodePanel("VK Share Options", "vk_share_panel", "enable_social_share", "no");
        $socialPage->addChild("panel8", $panel8);

        $enable_vk = new QodeField("yesno", "enable_vk", "no", "Enable Share", "Enabling this option will allow sharing via VK", array(), array("dependence" => true, "dependence_hide_on_yes" => "", "dependence_show_on_yes" => "#qodef_enable_vk_container"));
        $panel8->addChild("enable_vk", $enable_vk);
        $enable_vk_container = new QodeContainer("enable_vk_container", "enable_vk", "no");
        $panel8->addChild("enable_vk_container", $enable_vk_container);
        $vk_icon = new QodeField("image", "vk_icon", "", "Icon", "Upload VK icon");
        $enable_vk_container->addChild("vk_icon", $vk_icon);

        if (defined('QODE_INSTAGRAM_WIDGET_VERSION')) {
            $instagram_panel = new QodePanel('Instagram', 'panel_instagram');
            $socialPage->addChild("instagram_panel", $instagram_panel);

            $instagram_button = new QodeInstagramFramework("Connect", "ThisIsDescription");
            $instagram_panel->addChild("instagram_button", $instagram_button);
        }

    }
    add_action('qode_options_map','qode_social_options_map',130);
}


text:
layout: page
title: Contact Us
---

You can RSVP the old fashioned way using the address supplied with the invitation, or by emailing us directly at [charlotteandjoe2015@gmail.com](mailto:charlotteandjoe2015@gmail.com).

Please clearly state who can attend and whether you have any dietary requirements.


text:
var express = require('express');
var http = require('http');
var WebSocketServer = require('ws').Server;
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');

var routes = require('./routes/index');
var users = require('./routes/users');
var receive = require('./routes/receive');

var app = express();

// global
logMessages = []
conf        = {
  "maxLines" : 50
}

var server = http.createServer(app);
var wss = new WebSocketServer({
  server: server,
  port: 3001
})

// ws
var connections = [];

wss.on('connection', function (ws) {
  connections.push(ws);
  ws.on('close', function () {
    connections = connections.filter(function (conn, i) {
        return (conn === ws) ? false : true;
    });
  });
  ws.on('message', function (message) {
    console.log('message:', message);
    broadcast(JSON.stringify(message));
  });
});

// Do broadcast.
broadcast = function(message) {
  connections.forEach(function (con, i) {
    con.send(message);
  });
};

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');

// uncomment after placing your favicon in /public
//app.use(favicon(__dirname + '/public/favicon.ico'));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

app.use('/', routes);
app.use('/users', users);
app.use('/receive', receive);

// catch 404 and forward to error handler
app.use(function(req, res, next) {
  var err = new Error('Not Found');
  err.status = 404;
  next(err);
});

// error handlers

// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
  app.use(function(err, req, res, next) {
    res.status(err.status || 500);
    res.render('error', {
      message: err.message,
      error: err
    });
  });
}

// production error handler
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
  res.status(err.status || 500);
  res.render('error', {
    message: err.message,
    error: {}
  });
});

module.exports = app;