text:
layout: page
title: Francis - Finley Wedding
date: 2016-05-24
author: Ann Leon
tags: weekly links, java
status: published
summary: Nulla ac tellus ac turpis mattis aliquam at.
banner: images/banner/leisure-03.jpg
booking:
  startDate: 03/18/2019
  endDate: 03/20/2019
  ctyhocn: JNSWIHX
  groupCode: FFW
published: true
---
Donec aliquam, nulla vitae aliquet semper, odio magna porta dolor, a dapibus enim diam finibus neque. Proin massa mi, interdum et risus id, suscipit tristique risus. Nulla eget libero nunc. Cras mollis eleifend lectus, at iaculis velit condimentum eget. Fusce aliquam sapien et ligula faucibus, ut pretium purus dictum. Nunc tincidunt lorem felis, ac sagittis ante hendrerit sodales. Morbi dapibus porta mauris, et facilisis justo varius vel. In et pellentesque ante. Aenean dictum dapibus tortor ut iaculis. Maecenas eu purus non leo scelerisque aliquet quis ac justo. Duis non tempus nulla. Vestibulum commodo pulvinar laoreet. Ut tellus eros, interdum vitae sem vel, luctus sagittis velit. Donec quis risus nec diam ornare molestie. Phasellus pharetra tincidunt metus, et mattis ex dictum ut.

* Donec vel neque sit amet urna fermentum suscipit quis non erat
* Nam bibendum dolor vitae lacus ultricies dictum
* Vivamus elementum neque sit amet sapien rhoncus bibendum
* Nulla viverra orci eu magna auctor, quis convallis magna rhoncus.

Quisque molestie sapien nec purus tincidunt, a pharetra sapien ultrices. Sed semper aliquet lobortis. Curabitur vel metus sed ante dignissim pulvinar sit amet ut nulla. Nullam blandit viverra quam, nec ornare leo bibendum sagittis. Morbi vehicula, enim at posuere rhoncus, leo ligula rutrum tortor, ut volutpat odio arcu sit amet velit. Sed vel diam nisi. Donec euismod malesuada sem dictum ullamcorper. Pellentesque sit amet semper enim, at sagittis augue. Nunc fermentum velit sed mi dictum tristique. Aenean finibus purus leo, eget interdum eros auctor ac. Nam nibh libero, bibendum at hendrerit eu, feugiat vitae ante. Cras leo arcu, vehicula vel pulvinar eget, interdum eu nibh. Nulla facilisi.
Morbi a orci sem. Morbi at odio scelerisque, maximus quam eget, ullamcorper lectus. Integer vel iaculis ex. Mauris rhoncus venenatis tellus sit amet hendrerit. Maecenas purus diam, tincidunt ac tellus sit amet, accumsan congue magna. Curabitur auctor congue sem vel vestibulum. In ut est orci. Morbi egestas porta porttitor.


text:
'use strict';

angular.module('mean.system').factory('Menus', ['$resource',
  function($resource) {
	return true;
    /*return $resource('api/admin/menu/:name', {
      name: '@name',
      defaultMenu: '@defaultMenu'
    });*/
  }
]);

redpajama_set_name: RedPajamaGithub


text:
package apple.corebluetooth;

import java.io.*;
import java.nio.*;
import java.util.*;
import com.google.j2objc.annotations.*;
import com.google.j2objc.runtime.*;
import com.google.j2objc.runtime.block.*;
import apple.audiotoolbox.*;
import apple.corefoundation.*;
import apple.coregraphics.*;
import apple.coreservices.*;
import apple.foundation.*;
import apple.dispatch.*;

/*<javadoc>*/
/*</javadoc>*/
@Library("CoreBluetooth/CoreBluetooth.h")
public class CBAdvertisementData
    extends Object
     {

    @GlobalConstant("CBAdvertisementDataLocalNameKey")
    public static native NSString LocalNameKey();
    @GlobalConstant("CBAdvertisementDataTxPowerLevelKey")
    public static native NSString TxPowerLevelKey();
    @GlobalConstant("CBAdvertisementDataServiceUUIDsKey")
    public static native NSString ServiceUUIDsKey();
    @GlobalConstant("CBAdvertisementDataServiceDataKey")
    public static native NSString ServiceDataKey();
    @GlobalConstant("CBAdvertisementDataManufacturerDataKey")
    public static native NSString ManufacturerDataKey();
    /**
     * @since Available in iOS 6.0 and later.
     */
    @GlobalConstant("CBAdvertisementDataOverflowServiceUUIDsKey")
    public static native NSString OverflowServiceUUIDsKey();
    /**
     * @since Available in iOS 7.0 and later.
     */
    @GlobalConstant("CBAdvertisementDataIsConnectable")
    public static native NSString IsConnectable();
    /**
     * @since Available in iOS 7.0 and later.
     */
    @GlobalConstant("CBAdvertisementDataSolicitedServiceUUIDsKey")
    public static native NSString SolicitedServiceUUIDsKey();

}


text:
/*
 * Alexa state machine version
 */

'use strict';

module.exports.version = '0.3.2';

const StateMachineSkill = require('./lib/StateMachineSkill');
const helpers = require('alexa-helpers');
const Reply = require('./lib/Reply');
const DefaultRenderer = require('./lib/renderers/DefaultRenderer');
const I18NRenderer = require('./lib/renderers/I18NRenderer');

/**
 * Plugins
 */
const badResponseReprompt = require('./lib/plugins/reprompt-on-bad-response');
const replaceIntent = require('./lib/plugins/replace-intent');
const stateFlow = require('./lib/plugins/state-flow');
const cloudWatch = require('./lib/plugins/cloud-watch');
const autoLoad = require('./lib/plugins/auto-load');

module.exports = StateMachineSkill;
module.exports.Reply = Reply;
module.exports.helpers = helpers;
module.exports.replyWith = (reply, to) => ({ reply, to });
module.exports.replyWithAudioDirectives = (reply, to, request, data, directives) => ({ reply, to, directives });

module.exports.I18NRenderer = I18NRenderer;
module.exports.DefaultRenderer = DefaultRenderer;

module.exports.plugins = {
  badResponseReprompt,
  replaceIntent,
  stateFlow,
  cloudWatch,
  autoLoad,
};


text:
/**
* hide and show check box
*/

CategorySelectionViz =  function(){
    this.crimeKey = "";
}

CategorySelectionViz.prototype.onCrimeChange = function(crimeKey){
    this.crimeKey=crimeKey
}

CategorySelectionViz.prototype.getWeights = function(){
    var topCount = 1000
    var bottomCount = 1000
    /*
     <button class="btn btn-info-darken btn-sm" id="weapon" value="weaponOffence">WEAPON</button>
     <button class="btn btn-info-darken btn-sm" id="drug" value="drugViolations">DRUG</button>
     <button class="btn btn-info-darken btn-sm" id="liquor" value="liquorViolations">LIQUOR</button>
     <button class="btn btn-info-darken btn-sm" id="murd" value="murderCount">MURD</button>
     <button class="btn btn-info-darken btn-sm" id="forcib" value="forcibleSexOffense">FORCIB</button>
     <button class="btn btn-info-darken btn-sm" id="robbe" value="robbery">ROBBE</button>
     <button class="btn btn-info-darken btn-sm" id="agg" value="aggravatedAssault">AGG</button>
     <button class="btn btn-info-darken btn-sm" id="burgla" value="burglary">BURGLA</button>
     <button class="btn btn-info-darken btn-sm" id="vehic" value="vehicleTheft">VEHIC</button>
     <button class="btn btn-info-darken btn-sm" id="arson" value="arson">ARSON</button>

     var initialWeights = [4,3,2,.5,.5,.2,1,.2,.1,.1,.1]
     var labels = ['Murder','Negl. Manslaughter', 'Forcible Sex Offence', 'Robbery', 'Burglary',
     'Vehicle Theft', 'Aggravated Assault', 'Arson', 'Weapons Offence', 'Drug Offence', 'Liquor Offence']

     */

    var hideSafeSchools = $("#cbxHideSafe").is(":checked")
    return {
        murdFactor: (this.crimeKey=='' || this.crimeKey=='murderCount') ? Math.pow(10,4) : 0,
        negligenceFactor: (this.crimeKey=='' || this.crimeKey=='negl') ?Math.pow(10,3) : 0,
        forcibleCrimeFactor: (this.crimeKey=='' || this.crimeKey=='forcibleSexOffense') ?Math.pow(10,2) : 0,
        robberyCrimeFactor: (this.crimeKey=='' || this.crimeKey=='robbery') ?Math.pow(10,.5) : 0,
        burglaryCrimeFactor: (this.crimeKey=='' || this.crimeKey=='burglary') ?Math.pow(10,.5) : 0,
        vehicleCrimeFactor: (this.crimeKey=='' || this.crimeKey=='vehicleTheft') ?Math.pow(10,.2) : 0,
        topCount: topCount,
        bottomCount:bottomCount,
        aggravatedAssaultFactor: (this.crimeKey=='' || this.crimeKey=='aggravatedAssault') ?Math.pow(10,1) : 0,
        arsonFactor: (this.crimeKey=='' || this.crimeKey=='arson') ?Math.pow(10,.2) : 0,
        weaponFactor: (this.crimeKey=='' || this.crimeKey=='weaponOffence') ?Math.pow(10,.1) : 0,
        drugFactor: (this.crimeKey=='' || this.crimeKey=='drugViolations') ?Math.pow(10,.1) : 0,
        liquorFactor: (this.crimeKey=='' || this.crimeKey=='liquorViolations') ?Math.pow(10,.1) : 0,
        sectId1:true,
        sectId2:true,
        sectId3:true,
        sectId4:true,
        sectId5:true,
        sectId6:true,
        sectId7:true,
        sectId8:true,
        sectId9:true,
        hideSafeSchools:hideSafeSchools
    }
}


text:
layout: post
title: "WildPhotos"
slug: wildphotos
source: http://wildphotos.org.uk/
---

<img src="/screenshots/wildphotos.jpg">


text:
New General Item Outward Entry

            Home

            GeneralItemOutwardEntry

            New General Item Outward Entry

        <form data-ng-submit="create()" novalidate>
          <fieldset>

                Delivery Chalan No

                  <input type="Number" data-ng-model="deliveryChalanNo" id="deliveryChalanNo" class="form-control" placeholder="" required />

                Receiver

                  <input type="Number" data-ng-model="receiver" id="receiver" class="form-control" placeholder="" required />

                Date

                  <input type="Date" data-ng-model="date" id="date" class="form-control" placeholder="" required />

                Delivery To

                  <input type="Text" data-ng-model="deliveryTo" id="deliveryTo" class="form-control" placeholder="" required />

                S No

                  <input type="Number" data-ng-model="sNo" id="sNo" class="form-control" placeholder="" required />

                Name of the Item

                  <input type="Text" data-ng-model="nameoftheItem" id="nameoftheitem" class="form-control" placeholder="" required />

                U.O.M

                  <input type="Number" data-ng-model="uOm" id="uom" class="form-control" placeholder="" required />

                Quantity

                  <input type="Number" data-ng-model="quantity" id="quantity" class="form-control" placeholder="" required />

                <input type="submit" class="btn btn-primary" />

          </fieldset>
        </form>


text:
struct Mtllib:
  Resource
{
  RESOURCE(Mtllib)

  const Material *operator[](const std::string &name) const;

private:
  std::map<std::string, const Material*> _materials;
};

#endif // _MTLLIB_HPP_


text:
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');

$GLOBALS['TL_DCA']['tl_form']['config']['oncopy_callback'][] = array('tl_subcolumnsCallback','formCheck');

?>


text:
class ImageUploads < ActiveRecord::Migration
  def up
    add_column :users, :avatar, :string
    add_column :projects, :profile, :string
    add_column :groups, :profile, :string
  end

  def down
    remove_column :users, :avatar
    remove_column :projects, :profile
    remove_column :groups, :profile
  end
end


text:
namespace ui {

TEST(LatencyInfoParamTraitsTest, Basic) {
  LatencyInfo latency;
  latency.set_trace_id(5);
  latency.set_ukm_source_id(10);
  latency.set_scroll_update_delta(12.5);
  latency.set_predicted_scroll_update_delta(12.5);
  ASSERT_FALSE(latency.terminated());
  latency.AddLatencyNumber(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT);
  latency.AddLatencyNumber(INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT);
  latency.AddLatencyNumber(INPUT_EVENT_LATENCY_FRAME_SWAP_COMPONENT);

  EXPECT_EQ(5, latency.trace_id());
  EXPECT_EQ(10, latency.ukm_source_id());
  EXPECT_TRUE(latency.terminated());

  IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL);
  IPC::WriteParam(&msg, latency);
  base::PickleIterator iter(msg);
  LatencyInfo output;
  EXPECT_TRUE(IPC::ReadParam(&msg, &iter, &output));

  EXPECT_EQ(latency.trace_id(), output.trace_id());
  EXPECT_EQ(latency.ukm_source_id(), output.ukm_source_id());
  EXPECT_EQ(latency.terminated(), output.terminated());
  EXPECT_EQ(latency.scroll_update_delta(), output.scroll_update_delta());
  EXPECT_EQ(latency.predicted_scroll_update_delta(),
            output.predicted_scroll_update_delta());

  EXPECT_TRUE(output.FindLatency(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
                                 nullptr));
}

TEST(LatencyInfoParamTraitsTest, InvalidData) {
  IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL);
  IPC::WriteParam(&msg, std::string());
  ui::LatencyInfo::LatencyMap components;
  IPC::WriteParam(&msg, components);
  IPC::WriteParam(&msg, static_cast<int64_t>(1234));
  IPC::WriteParam(&msg, true);

  base::PickleIterator iter(msg);
  LatencyInfo output;
  EXPECT_FALSE(IPC::ReadParam(&msg, &iter, &output));
}

}  // namespace ui


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Uses of Interface org.springframework.jdbc.core.ResultSetExtractor (Spring Framework API 2.5)
</TITLE>

<META NAME="date" CONTENT="2007-11-19">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

The Spring Framework

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Interface
org.springframework.jdbc.core.ResultSetExtractor

Packages that use ResultSetExtractor

org.springframework.jdbc.core
Provides the core JDBC framework, based on JdbcTemplate
and its associated callback interfaces and helper objects.

org.springframework.jdbc.core.namedparam
JdbcTemplate variant with named parameter support.

org.springframework.jdbc.core.support
Classes supporting the org.springframework.jdbc.core package.

Uses of ResultSetExtractor in org.springframework.jdbc.core

Classes in org.springframework.jdbc.core that implement ResultSetExtractor

 class
RowMapperResultSetExtractor

          Adapter implementation of the ResultSetExtractor interface that delegates
 to a RowMapper which is supposed to create an object for each row.

 class
SqlRowSetResultSetExtractor

          ResultSetExtractor implementation that returns a Spring SqlRowSet
 representation for each given ResultSet.

Methods in org.springframework.jdbc.core that return ResultSetExtractor

 ResultSetExtractor
ResultSetSupportingSqlParameter.getResultSetExtractor()

          Return the ResultSetExtractor held by this parameter, if any.

Methods in org.springframework.jdbc.core with parameters of type ResultSetExtractor

 Object
JdbcTemplate.query(PreparedStatementCreator psc,
      PreparedStatementSetter pss,
      ResultSetExtractor rse)

          Query using a prepared statement, allowing for a PreparedStatementCreator
 and a PreparedStatementSetter.

 Object
JdbcTemplate.query(PreparedStatementCreator psc,
      ResultSetExtractor rse)

 Object
JdbcOperations.query(PreparedStatementCreator psc,
      ResultSetExtractor rse)

          Query using a prepared statement, reading the ResultSet with a
 ResultSetExtractor.

 Object
JdbcTemplate.query(String sql,
      Object[] args,
      int[] argTypes,
      ResultSetExtractor rse)

 Object
JdbcOperations.query(String sql,
      Object[] args,
      int[] argTypes,
      ResultSetExtractor rse)

          Query given SQL to create a prepared statement from SQL and a list
 of arguments to bind to the query, reading the ResultSet with a
 ResultSetExtractor.

 Object
JdbcTemplate.query(String sql,
      Object[] args,
      ResultSetExtractor rse)

 Object
JdbcOperations.query(String sql,
      Object[] args,
      ResultSetExtractor rse)

          Query given SQL to create a prepared statement from SQL and a list
 of arguments to bind to the query, reading the ResultSet with a
 ResultSetExtractor.

 Object
JdbcTemplate.query(String sql,
      PreparedStatementSetter pss,
      ResultSetExtractor rse)

 Object
JdbcOperations.query(String sql,
      PreparedStatementSetter pss,
      ResultSetExtractor rse)

          Query using a prepared statement, reading the ResultSet with a
 ResultSetExtractor.

 Object
JdbcTemplate.query(String sql,
      ResultSetExtractor rse)

 Object
JdbcOperations.query(String sql,
      ResultSetExtractor rse)

          Execute a query given static SQL, reading the ResultSet with a
 ResultSetExtractor.

Constructors in org.springframework.jdbc.core with parameters of type ResultSetExtractor

ResultSetSupportingSqlParameter(String name,
                                int sqlType,
                                ResultSetExtractor rse)

          Create a new ResultSetSupportingSqlParameter.

SqlInOutParameter(String name,
                  int sqlType,
                  ResultSetExtractor rse)

          Create a new SqlInOutParameter.

SqlOutParameter(String name,
                int sqlType,
                ResultSetExtractor rse)

          Create a new SqlOutParameter.

SqlReturnResultSet(String name,
                   ResultSetExtractor extractor)

          Create a new instance of the SqlReturnResultSet class.

Uses of ResultSetExtractor in org.springframework.jdbc.core.namedparam

Methods in org.springframework.jdbc.core.namedparam with parameters of type ResultSetExtractor

 Object
NamedParameterJdbcTemplate.query(String sql,
      Map paramMap,
      ResultSetExtractor rse)

 Object
NamedParameterJdbcOperations.query(String sql,
      Map paramMap,
      ResultSetExtractor rse)

          Query given SQL to create a prepared statement from SQL and a list
 of arguments to bind to the query, reading the ResultSet with a
 ResultSetExtractor.

 Object
NamedParameterJdbcTemplate.query(String sql,
      SqlParameterSource paramSource,
      ResultSetExtractor rse)

 Object
NamedParameterJdbcOperations.query(String sql,
      SqlParameterSource paramSource,
      ResultSetExtractor rse)

          Query given SQL to create a prepared statement from SQL and a list
 of arguments to bind to the query, reading the ResultSet with a
 ResultSetExtractor.

Uses of ResultSetExtractor in org.springframework.jdbc.core.support

Classes in org.springframework.jdbc.core.support that implement ResultSetExtractor

 class
AbstractLobStreamingResultSetExtractor

          Abstract ResultSetExtractor implementation that assumes streaming of LOB data.

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

The Spring Framework

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2002-2007 The Spring Framework.


text:
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
             version="2.1">

  <persistence-unit name="cassandra">
    <provider>com.impetus.kundera.KunderaPersistence</provider>
    <class>debop4k.data.kundera.examples.model.Person</class>
    <class>debop4k.data.kundera.examples.model.collection.BlogPost</class>
    <!-- Dummy of Lightweight transaction Native query return value. -->
    <!--<class>models.TxResult</class>-->

    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
      <property name="kundera.nodes" value="localhost"/>
      <property name="kundera.port" value="9160"/>
      <property name="kundera.keyspace" value="KunderaExamples"/>
      <property name="kundera.dialect" value="cassandra"/>
      <property name="kundera.ddl.auto.prepare" value="create"/>
      <property name="kundera.client.lookup.class" value="com.impetus.client.cassandra.thrift.ThriftClientFactory"/>
      <property name="kundera.show.query" value="true"/>
      <property name="index.home.dir" value="./lucene"/>
    </properties>
  </persistence-unit>
</persistence>


text:
package io.github.lukehutch.fastclasspathscanner.utils;

import io.github.lukehutch.fastclasspathscanner.FastClasspathScanner;
import io.github.lukehutch.fastclasspathscanner.matchprocessor.FileMatchProcessor;

import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;

/**
 * An example wrapper for FastClasspathScanner that hashes the content of classfiles encontered on the classpath in
 * order to enable more precise change detection than provided by timestamp checking.
 *
 */
public class HashClassfileContents {
    private final FastClasspathScanner scanner;
    private final HashMap<String, String> classNameToClassfileHash;

    public HashClassfileContents(String... packagePrefixesToScan) {
        this.classNameToClassfileHash = new HashMap<>();
        this.scanner = new FastClasspathScanner(packagePrefixesToScan)
        // MD5-hash all files ending in ".class"
                .matchFilenameExtension("class", new FileMatchProcessor() {
                    @Override
                    public void processMatch(String relativePath, InputStream inputStream, int length)
                            throws IOException {
                        final MessageDigest digest;
                        try {
                            digest = MessageDigest.getInstance("MD5");
                        } catch (NoSuchAlgorithmException e) {
                            throw new RuntimeException(e);
                        }
                        final byte[] buffer = new byte[8192];
                        for (int read; (read = inputStream.read(buffer)) > 0;) {
                            digest.update(buffer, 0, read);
                        }
                        String hash = "0000000000000000000000000000000"
                                + new BigInteger(1, digest.digest()).toString(16);
                        String className = relativePath.substring(0, relativePath.length() - 6).replace('/', '.');
                        classNameToClassfileHash.put(className, hash.substring(hash.length() - 32));
                    }
                });
    }

    /**
     * Scans the classpath, and updates the mapping from class name to hash of classfile contents.
     */
    public HashClassfileContents scan() {
        classNameToClassfileHash.clear();
        scanner.scan();
        return this;
    }

    /**
     * Returns the mapping from class name to hash of classfile contents after the call to .scan().
     */
    public HashMap<String, String> getClassNameToClassfileHash() {
        return this.classNameToClassfileHash;
    }
}


text:
<?php

namespace App\Models;

use App\Models\Admin;
use App\Models\Traits\Attribute\DemandAttribute;
use App\Models\Traits\Relationship\DemandRelationship;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\Models\Demands\Demands
 */
class Demand extends Model
{
    use SoftDeletes, DemandRelationship, DemandAttribute;

    protected $dates = ['deleted_at'];

    /**
     * 参数白名单
     * @var array
     */
    protected $fillable = ['user_id', 'title', 'slug', 'quantity', 'unit', 'content', 'images', 'is_excellent'];

    public static function demandFilter($query, $request)
    {
        if ($request->has('id')) {
            $query = $query->where('demands.id', $request->get('id'));
        }

        if ($request->has('title')) {
            $query = $query->where('title', 'like', "%{$request->get('title')}%");
        }

        if ($request->has('username')) {
            $query = $query->where('username', 'like', "%{$request->get('username')}%");
        }

        if ($request->has('quantity')) {
            $query = $query->where('quantity', $request->get('quantity'));
        }

        if ($request->has('published_from') && !$request->has('published_to')) {
            $query = $query->where('published_at', '>=', $request->get('published_from'));
        }

        if (!$request->has('created_from') && $request->has('created_to')) {
            $query = $query->where('created_at', '<=', $request->get('created_to'));
        }

        if ($request->has('created_from') && $request->has('created_to')) {
            $query = $query->whereBetween('created_at', [$request->get('created_from'),$request->get('created_to')]);
        }

        return $query;
    }
}


text:
import { bigIntToJSON, isPlainObject, toBigInt } from '@terascope/utils';

const BIG_INT_PREFIX = '__transformed_bigint_';
/**
 * Converts the Metadata to JSON compatible objects
 * so it can be serialized
*/
export function convertMetadataToJSON(
    input: Record<string, unknown>
): Record<string, unknown> {
    return _convertValueToJSON(input).value as Record<string, unknown>;
}

function _convertValueToJSON(value: unknown): { value: unknown, transformed: boolean } {
    if (typeof value === 'bigint') {
        return {
            value: bigIntToJSON(value),
            transformed: true,
        };
    }

    if (isPlainObject(value)) {
        const metadata: Record<string, unknown> = Object.create(null);
        const entries = Object.entries(value as Record<string, unknown>);
        let transformedCount = 0;
        for (const [field, nestedValue] of entries) {
            const v = _convertValueToJSON(nestedValue);
            if (v.transformed) {
                metadata[`${BIG_INT_PREFIX}${transformedCount++}`] = {
                    value: v.value,
                    field
                };
            } else {
                metadata[field] = v.value;
            }
        }
        return {
            value: metadata,
            transformed: false,
        };
    }

    if (Array.isArray(value)) {
        let transformed = false;
        const values = value
            .map(_convertValueToJSON)
            .map((v) => {
                if (v.transformed) transformed = true;
                return v.value;
            });
        return {
            value: values,
            transformed,
        };
    }

    return { value, transformed: false };
}

/**
 * Converts the Metadata from JSON compatible objects
 * so it can be serialized
*/
export function convertMetadataFromJSON(
    input: Record<string, unknown>
): Record<string, unknown> {
    return _convertValueFromJSON(input) as Record<string, unknown>;
}

function _convertValueFromJSON(value: unknown): unknown {
    if (isPlainObject(value)) {
        const metadata: Record<string, unknown> = Object.create(null);
        const entries = Object.entries(value as Record<string, unknown>);
        for (const [field, nestedValue] of entries) {
            if (field.startsWith(BIG_INT_PREFIX)) {
                const { field: ogField, value: transformed } = (nestedValue as any);
                metadata[ogField] = Array.isArray(transformed)
                    ? transformed.map(toBigInt)
                    : toBigInt(transformed);
            } else {
                metadata[field] = _convertValueFromJSON(nestedValue);
            }
        }
        return metadata;
    }

    if (Array.isArray(value)) {
        return value.map(_convertValueFromJSON);
    }

    return value;
}


text:
.. _android_sdk/getting_started:
.. include:: /partials/common.rst

Getting Started
===============

The Getting Started guide shows you how to setup and launch Referral Campaign
as quickly as possible with Talkable Android SDK.

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

1. Add the JitPack repository to your project's top level *build.gradle* file.

   .. code-block:: groovy

      allprojects {
        repositories {
          ...
          maven { url 'https://jitpack.io' }
        }
      }

2. Add TalkableSDK as a dependency to your module's *build.gradle* file.

   .. code-block:: groovy

      dependencies {
        ...
        implementation 'com.github.talkable:android-sdk:0.5.11'
      }

.. _setup_credentials:

3. Setup Talkable credentials in ``AndroidManifest.xml`` file inside
   ``<application>`` element in the following format:

   .. code-block:: xml

      <application>
          ...
          <meta-data
              android:name="tkbl-api-key-{{YOUR_SITE_ID}}"
              android:value="{{YOUR_TALKABLE_PUBLIC_API_KEY}}" />
          ...
      </application>

   .. note::

      You can locate your credentials inside Talkable site:

      - Select site and go to **Dashboard** → **Settings** → **Site Settings**.
        Find **API integration** section and there you will see your API Keys and Site ID (also known as Site slug).
        Use only the *Public API Key* in your production application.

.. _deep_linking_scheme:

4. Add deep linking scheme handler into your main activity entry or an activity you
   want to handle deep links from Talkable.

   .. code-block:: xml

      <activity>
          ...
          <intent-filter>
              <action android:name="android.intent.action.VIEW" />

              <category android:name="android.intent.category.DEFAULT" />
              <category android:name="android.intent.category.BROWSABLE" />

              <data android:scheme="tkbl-{{YOUR_SITE_ID}}" />
          </intent-filter>
      </activity>

.. _main_activity_setup:

5. Initialize Talkable in the ``Application``:

   .. code-block:: java

      import com.talkable.sdk.Talkable;
      import android.app.Application;

      public class App extends Application {
          @Override
          public void onCreate() {
              super.onCreate();
              Talkable.initialize(this);
          }
      }

   .. note::

      Make sure to add your application class name as ``android:name`` parameter of
      the ``<application>`` element in your manifest

6. Call ``Talkable.trackAppOpen`` inside you main activity class, like this:

   .. code-block:: java

      import com.talkable.sdk.Talkable;
      import android.app.Activity;

      public class MainActivity extends Activity {
          @Override
          public void onCreate(Bundle savedInstanceState) {
              ...

              Talkable.trackAppOpen(this);
          }
      }

Here is an example of ``AndroidManifest.xml`` file (with ``"demo-site"`` site
ID) you should setup after steps above:

  .. code-block:: xml

     <?xml version="1.0" encoding="utf-8"?>
     <manifest xmlns:android="http://schemas.android.com/apk/res/android"
         package="com.talkable.demo">

         <application
             android:allowBackup="true"
             android:icon="@mipmap/ic_launcher"
             android:label="@string/app_name"
             android:supportsRtl="true"
             android:theme="@style/AppTheme"
             android:name=".App">
             <activity android:name=".MainActivity">
                 <intent-filter>
                     <action android:name="android.intent.action.MAIN" />

                     <category android:name="android.intent.category.LAUNCHER" />
                 </intent-filter>

                 <intent-filter>
                     <action android:name="android.intent.action.VIEW" />

                     <category android:name="android.intent.category.DEFAULT" />
                     <category android:name="android.intent.category.BROWSABLE" />

                     <data android:scheme="tkbl-demo-site" />
                 </intent-filter>
             </activity>

             <!-- Talkable -->

             <meta-data
                 android:name="tkbl-api-key-demo-site"
                 android:value="nacsc9XseW4Kxne6AaJ" />

             <!-- End Talkable -->
         </application>
     </manifest>

Your environment is all set up! Now you need to
:ref:`integrate <android_sdk/integration>` the Talkable campaign piece.

Requirements
------------

The SDK supports Android 4.1 and later.

.. _`Talkable SDK framework`: https://talkable-downloads.s3.amazonaws.com/android-sdk/talkable-sdk.aar

.. container:: hidden

   .. toctree::


text:
FactoryGirl.define do
  factory :prepared_params, class: PreparedParams do
    skip_create

    transient do
      params_hash = {data: {id: 1, attributes: {name: 'Joe'}},
                     sort: 'name,-age',
                     fields: {effort: 'name,age,stateCode'},
                     filter: {state_code: 'NM,NY,BC', gender: 'female', search: 'jane'},
                     include: 'efforts,efforts.splitTimes'}
      params ActionController::Parameters.new(params_hash)
      permitted [:id, :name, :age, :state_code, :gender]
      permitted_query [:id, :name, :age, :state_code, :gender]
    end

    initialize_with { new(params, permitted, permitted_query) }
  end
end


text:
#include <OpenFrames/FocalPointShadowMap.hpp>
#include <OpenFrames/Model.hpp>
#include <OpenFrames/Sphere.hpp>
#include <OpenFrames/WindowProxy.hpp>
#include <osgDB/ReadFile>
#include <osgGA/GUIEventHandler>

using namespace OpenFrames;

static int ReceivesShadowTraversalMask_earth = 0x1;
static int CastsShadowTraversalMask_earth = 0x2;
static int ReceivesShadowTraversalMask_comet = 0x1;
static int CastsShadowTraversalMask_comet = 0x2;
static unsigned int BaseShadowTexUnit_earth = 3;
static unsigned int BaseShadowTexUnit_comet = 1;

class MoveModelHandler : public osgGA::GUIEventHandler
{
public:
  MoveModelHandler(Model *model)
  : _model(model)
  {}

  virtual bool handle(osgGA::Event* event, osg::Object* object, osg::NodeVisitor* nv)
  {
    osgGA::GUIEventAdapter* ea = event->asGUIEventAdapter();
    if(ea)
    {
      if(ea->getEventType() == osgGA::GUIEventAdapter::KEYDOWN)
      {
        double delta = 10.0;
        if(ea->getModKeyMask() & osgGA::GUIEventAdapter::MODKEY_SHIFT) delta *= 0.1;

        if(ea->getKey() == '=' || ea->getKey() == '+')
        {
          osg::Vec3d pos;
          _model->getPosition(pos);
          _model->setPosition(pos + osg::Vec3d(delta, 0.0, 0.0));
          return true;
        }
        else if(ea->getKey() == '-' || ea->getKey() == '_')
        {
          osg::Vec3d pos;
          _model->getPosition(pos);
          _model->setPosition(pos - osg::Vec3d(delta, 0.0, 0.0));
          return true;
        }
        else if(ea->getKey() == osgGA::GUIEventAdapter::KEY_Up)
        {
          osg::Vec3d pos;
          _model->getPosition(pos);
          _model->setPosition(pos - osg::Vec3d(0.0, 0.0, delta));
          return true;
        }
        else if(ea->getKey() == osgGA::GUIEventAdapter::KEY_Down)
        {
          osg::Vec3d pos;
          _model->getPosition(pos);
          _model->setPosition(pos + osg::Vec3d(0.0, 0.0, delta));
          return true;
        }
        else if(ea->getKey() == osgGA::GUIEventAdapter::KEY_Left)
        {
          osg::Vec3d pos;
          _model->getPosition(pos);
          _model->setPosition(pos - osg::Vec3d(0.0, delta, 0.0));
          return true;
        }
        else if(ea->getKey() == osgGA::GUIEventAdapter::KEY_Right)
        {
          osg::Vec3d pos;
          _model->getPosition(pos);
          _model->setPosition(pos + osg::Vec3d(0.0, delta, 0.0));
          return true;
        }
      }
    }

    return false;
  }

protected:
  Model* _model;
};

int main()
{
  const double r_earth = 6371.0;
  const double r_moon = 1737.0;
  const double r_sun = 695000.7;
  const double d_sun = 149600000.0;
  const double d_moon = 384400.0;
  const double d_cg = 100000.0;

  // Create the interface that represents a window
  osg::ref_ptr<WindowProxy> myWindow = new WindowProxy(30, 30, 1024, 768, 1, 1, false, false);

  // Create a ReferenceFrame for the root
  ReferenceFrame* root = new ReferenceFrame("Root");
  root->showAxes(ReferenceFrame::NO_AXES);
  root->showAxesLabels(ReferenceFrame::NO_AXES);
  root->showNameLabel(false);

  // Create a Sphere for the Sun
  Sphere* sun = new Sphere("Sun");
  sun->showAxes(ReferenceFrame::NO_AXES);
  sun->showAxesLabels(ReferenceFrame::NO_AXES);
  sun->showNameLabel(false);
  sun->setTextureMap("Images/SunTexture.jpg");
  sun->setRadius(r_sun);
  sun->setPosition(-d_sun, 0.0, 0.0);
  root->addChild(sun);

  // Set Sun material
  // Sun has emission but no reflection
  {
    osg::Material* mat = new osg::Material;
    mat->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4(0, 0, 0, 1));
    mat->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4(0, 0, 0, 1));
    mat->setSpecular(osg::Material::FRONT_AND_BACK, osg::Vec4(0, 0, 0, 1));
    mat->setEmission(osg::Material::FRONT_AND_BACK, osg::Vec4(1, 1, 1, 1));
    sun->setMaterial(mat);
  }

  // Make the Sun a light source
  // By default this will use GL_LIGHT0 which overrides the global light
  // If using multiple lights, call light->setLightNum(num) with unique light numbers
  {
    sun->setLightSourceEnabled(true);
    osg::Light* sunLight = sun->getLightSource()->getLight();
    sunLight->setPosition(osg::Vec4(0.0, 0.0, 0.0, 1.0)); // At center of Sun
    sunLight->setAmbient(osg::Vec4(0.0, 0.0, 0.0, 1.0));
    sunLight->setDiffuse(osg::Vec4(2.0, 2.0, 2.0, 1.0)); // Bright sun!
    sunLight->setSpecular(osg::Vec4(0.8, 0.8, 0.8, 1.0));
  }

  // Create an empty ReferenceFrame to serve as the shadowed scene root for the comet
  ReferenceFrame* shadowedSceneRoot_earth = new ReferenceFrame("Shadow Scene Root - Earth");
  shadowedSceneRoot_earth->showAxes(ReferenceFrame::NO_AXES);
  shadowedSceneRoot_earth->showAxesLabels(ReferenceFrame::NO_AXES);
  shadowedSceneRoot_earth->showNameLabel(false);
  shadowedSceneRoot_earth->setShadowedSceneRoot(true);
  root->addChild(shadowedSceneRoot_earth);

  // Initialize shadowing info
  OpenFrames::FocalPointShadowMap *fpsm_earth;
  {
    osgShadow::ShadowedScene* shadowedScene = shadowedSceneRoot_earth->getShadowedSceneRoot();
    osgShadow::ShadowSettings *shadowSettings = shadowedScene->getShadowSettings();
    shadowSettings->setReceivesShadowTraversalMask(ReceivesShadowTraversalMask_earth);
    shadowSettings->setCastsShadowTraversalMask(CastsShadowTraversalMask_earth);
    shadowSettings->setBaseShadowTextureUnit(BaseShadowTexUnit_earth);
    int texSize = 1024;
    shadowSettings->setTextureSize(osg::Vec2s(texSize, texSize));

    fpsm_earth = new OpenFrames::FocalPointShadowMap;
    fpsm_earth->setLightSize(r_sun);
    fpsm_earth->setAmbientBias(osg::Vec2(0.0, 1.0));
    fpsm_earth->setPolygonOffset(osg::Vec2(-0.5, -0.5));
    fpsm_earth->setSceneScale(1.0/std::sqrt(3.0));
    shadowedScene->setShadowTechnique(fpsm_earth);
  }

  // Create a Sphere for the Earth
  Sphere* earth = new Sphere("Earth");
  earth->showAxes(ReferenceFrame::NO_AXES);
  earth->showAxesLabels(ReferenceFrame::NO_AXES);
  earth->showNameLabel(false);
  earth->setTextureMap("Images/land_shallow_topo_2048.jpg");
  earth->setNightTextureMap("Images/land_ocean_ice_lights_2048.jpg");
  earth->setRadius(r_earth);
  earth->setAutoLOD(true);
  earth->getSphereTransform()->setNodeMask(ReceivesShadowTraversalMask_earth);
  shadowedSceneRoot_earth->addChild(earth);

  // Set Earth material, which overrides any color set for the Sphere
  // Use diffuse but no ambient reflections (so dark side can show night texture)
  {
    osg::Material* mat = new osg::Material;
    mat->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4(0.0, 0.0, 0.0, 1.0));
    mat->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4(1.0, 1.0, 1.0, 1.0));
    mat->setSpecular(osg::Material::FRONT_AND_BACK, osg::Vec4(0.5, 0.5, 0.5, 1.0));
    mat->setShininess(osg::Material::FRONT_AND_BACK, 100);
    earth->setMaterial(mat);
  }

  // Create a Sphere for the Moon
  Sphere* moon = new Sphere("Moon");
  moon->showAxes(ReferenceFrame::NO_AXES);
  moon->showAxesLabels(ReferenceFrame::NO_AXES);
  moon->showNameLabel(false);
  moon->setTextureMap("Images/MoonTexture.bmp");
  moon->setRadius(r_moon);
  moon->setPosition(-d_moon, 0.0, 0.0);
  moon->getSphereTransform()->setNodeMask(CastsShadowTraversalMask_earth | ReceivesShadowTraversalMask_earth);
  earth->addChild(moon);

  // Set Moon material
  // Use diffuse but no ambient reflections (dark side of Moon will be black)
  {
    osg::Material* mat = new osg::Material;
    mat->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4(0.0, 0.0, 0.0, 1.0));
    mat->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4(1.0, 1.0, 1.0, 1.0));
    moon->setMaterial(mat);
  }

  // Create an empty ReferenceFrame to serve as the shadowed scene root for the comet
  ReferenceFrame* shadowedSceneRoot_comet = new ReferenceFrame("Shadow Scene Root - Comet");
  shadowedSceneRoot_comet->showAxes(ReferenceFrame::NO_AXES);
  shadowedSceneRoot_comet->showAxesLabels(ReferenceFrame::NO_AXES);
  shadowedSceneRoot_comet->showNameLabel(false);
  shadowedSceneRoot_comet->setShadowedSceneRoot(true);
  shadowedSceneRoot_comet->setPosition(0.0, 0.0, d_cg);
  root->addChild(shadowedSceneRoot_comet);

  // Initialize shadowing info
  OpenFrames::FocalPointShadowMap *fpsm_comet;
  {
    osgShadow::ShadowedScene* shadowedScene = shadowedSceneRoot_comet->getShadowedSceneRoot();
    osgShadow::ShadowSettings *shadowSettings = shadowedScene->getShadowSettings();
    shadowSettings->setReceivesShadowTraversalMask(ReceivesShadowTraversalMask_comet);
    shadowSettings->setCastsShadowTraversalMask(CastsShadowTraversalMask_comet);
    shadowSettings->setBaseShadowTextureUnit(BaseShadowTexUnit_comet);
    int texSize = 1024;
    shadowSettings->setTextureSize(osg::Vec2s(texSize, texSize));

    fpsm_comet = new OpenFrames::FocalPointShadowMap;
    fpsm_comet->setLightSize(r_sun);
    fpsm_comet->setAmbientBias(osg::Vec2(0.0, 1.0));
    fpsm_comet->setPolygonOffset(osg::Vec2(-0.5, -0.5));
    shadowedScene->setShadowTechnique(fpsm_comet);
  }

  // Create a Model for the Comet
  Model* cg = new Model("67P_CG");
  cg->showAxes(ReferenceFrame::NO_AXES);
  cg->showAxesLabels(ReferenceFrame::NO_AXES);
  cg->showNameLabel(false);
  //cg->setModel("Models/Comet67P_CG.3ds");
  //cg->setModel("Models/CSHP_DV_257_01_______00343.obj");
  //cg->setModel("Models/halley.3ds");
  //cg->setModel("Models/BennuRadarShape.obj");
  cg->setModel("Models/Bennu_v20_200k.obj");
  double cgScale = 1000.0;
  cg->setModelScale(cgScale, cgScale, cgScale);
  //cg->getModel()->setNodeMask(CastsShadowTraversalMask_comet | ReceivesShadowTraversalMask_comet);
  cg->getModel()->setNodeMask(ReceivesShadowTraversalMask_comet);
  shadowedSceneRoot_comet->addChild(cg);

  // Set comet material
  {
    osg::Material* mat = new osg::Material;
    mat->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4(0.0, 0.0, 0.0, 1.0));
    mat->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4(0.25, 0.25, 0.25, 1.0));
    mat->setSpecular(osg::Material::FRONT_AND_BACK, osg::Vec4(0.1, 0.1, 0.2, 1.0));
    mat->setShininess(osg::Material::FRONT_AND_BACK, 100);
    cg->getModel()->getOrCreateStateSet()->setAttributeAndModes(mat, osg::StateAttribute::ON);
  }

  // Create a model for spacecraft near comet
  Model* sc = new Model("SC");
  sc->showAxes(ReferenceFrame::NO_AXES);
  sc->showAxesLabels(ReferenceFrame::NO_AXES);
  sc->showNameLabel(false);
  sc->setModel("Models/OsirisRex-2013-comp.lwo");
  sc->setPosition(-cg->getBound()._radius, 0.0, 0.0);
  sc->setAttitude(osg::Quat(osg::PI/2.0, osg::Vec3(0.0, 1.0, 0.0)));
  double scScale = 0.001;
  sc->setModelScale(scScale, scScale, scScale);
  sc->addDraggerCallback(nullptr);
  sc->getDragger()->setNodeMask(ReceivesShadowTraversalMask_comet);
  sc->getModel()->setNodeMask(CastsShadowTraversalMask_comet | ReceivesShadowTraversalMask_comet);
  shadowedSceneRoot_comet->addChild(sc);

  // Create a manager to handle access to the scene
  FrameManager* fm = new FrameManager;
  fm->setFrame(root);

  // Add the scene to the window
  myWindow->setScene(fm, 0, 0);

  // Set up sky background using the Gaia DR2 galactic disk texture and HYGv3 star database
  myWindow->getGridPosition(0, 0)->setBackgroundColor(0, 0, 0); // Black background
  myWindow->getGridPosition(0, 0)->setSkySphereTexture("Images/ESA_Gaia_DR2_2048.jpg");
  myWindow->getGridPosition(0, 0)->setSkySphereStarData("Stars/Stars_HYGv3.txt", -2.0, 6.0, 40000); // At most 40000 stars of magnitude range [-2.0, 6.0] from the HYGv3 database

  // The Gaia image is in Galactic coordinates, so transform it to J2000 Equatorial coordinates
  // to match the HYGv3 coordinate system
  // Matrix that transforms ICRS (J2000 Equatorial) to Galactic coordinates
  // Source: Gaia Data Release 1 (DR1), Documentation Release 1.2, Section 3.1.7 (Eqn 3.11).
  //         https://gea.esac.esa.int/archive/documentation/GDR1/Data_processing/chap_cu3ast/sec_cu3ast_intro.html
  // Source: Lui et al, "Reconsidering the Galactic Coordinate System", Astronomy & Astrophysics 526, A16, 2011.
  //         https://www.aanda.org/articles/aa/pdf/2011/02/aa14961-10.pdf (See equation for matrix N_Hip in Section 2.2)
  osg::Matrixd eq_to_gal_mat(-0.0548755604162154, +0.4941094278755837, -0.8676661490190047, 0.0,
                             -0.8734370902348850, -0.4448296299600112, -0.1980763734312015, 0.0,
                             -0.4838350155487132, +0.7469822444972189, +0.4559837761750669, 0.0,
                             0.0                , 0.0                , 0.0                , 1.0);
  osg::Quat eq_to_gal = eq_to_gal_mat.getRotate();

  // Quaternion that transforms Galactic to J2000 Equatorial coordinates
  osg::Quat gal_to_eq = eq_to_gal.inverse();

  // Gaia image is offset by 180 degrees as compared to the OpenFrames::Sphere texture wrapping
  // convention, so rotate it by 180 degrees before performing the Galatic->J2000 transformation
  myWindow->getGridPosition(0, 0)->getSkySphere()->setSphereAttitude(osg::Quat(osg::PI, osg::Vec3d(0, 0, 1))*gal_to_eq);

  // Create views of the Earth and Moon
  View *viewEarth = new View(root, earth);
  View *viewMoon = new View(root, moon);
  View *viewSun = new View(root, sun);
  View *viewCG = new View(root, cg);
  View *viewSC = new View(root, sc);
  myWindow->getGridPosition(0, 0)->addView(viewEarth);
  myWindow->getGridPosition(0, 0)->addView(viewMoon);
  myWindow->getGridPosition(0, 0)->addView(viewSun);
  myWindow->getGridPosition(0, 0)->addView(viewCG);
  myWindow->getGridPosition(0, 0)->addView(viewSC);

  // Install event handler to move model
  myWindow->getGridPosition(0, 0)->getSceneView()->addEventHandler(new MoveModelHandler(sc));

  myWindow->startThread(); // Start window animation

  // Add debug HUD for ShadowMap
#if 0
  while(!myWindow->isAnimating()) OpenThreads::Thread::YieldCurrentThread();

  {
    OpenThreads::Thread::microSleep(500000);
    osg::ref_ptr<osg::Camera> hudCam = myWindow->getGridPosition(0, 0)->getHUD();
    osg::GraphicsContext* gc = hudCam->getGraphicsContext();

    osg::ref_ptr<osg::Camera> smDebugHUD = fpsm_earth->makeDebugHUD();
    smDebugHUD->setGraphicsContext(gc);
    smDebugHUD->setViewport(new osg::Viewport(0, 0, 400, 400));
    hudCam->addChild(smDebugHUD);
  }
#endif

  myWindow->join(); // Wait for window animation to finish

  return 0;
}


text:
<?php namespace Blackbox\Traits;

/**
 * This file is copied/based from Laravel/Envoy package
 * which is released under MIT license
 *
 * @see  https://github.com/laravel/envoy
 */

use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

trait InteractWithConsole {

    /**
     * Execute the command.
     *
     * @param  \Symfony\Component\Console\Input\InputInterface  $input
     * @param  \Symfony\Component\Console\Output\OutputInterface  $output
     * @return void
     */
    public function execute(InputInterface $input, OutputInterface $output)
    {
        $this->input = $input;
        $this->output = $output;

        return $this->fire();
    }

    /**
     * Get an argument from the input.
     *
     * @param  string  $key
     * @return string
     */
    public function argument($key)
    {
        return $this->input->getArgument($key);
    }

    /**
     * Get an option from the input.
     *
     * @param  string  $key
     * @return string
     */
    public function option($key)
    {
        return $this->input->getOption($key);
    }

    /**
     * Output message to console
     *
     * @param string $type
     * @param string $message
     * @return string
     */
    public function say($type, $message)
    {
        $message = "<{$type}>{$message}</{$type}>";

        return $this->output->write($message.PHP_EOL);
    }

}


text:
using atmelstudio_cppcheck.Parser;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;

namespace atmelstudio_cppcheck.test
{
    [TestClass]
    public class CppCheckResultParserTest
    {
        [TestMethod]
        [TestCategory("result-parser")]
        public void InvalidVersionGivesNullParser()
        {
            var parser = CppCheckParserFactory.GetParser(CppCheckXmlOutput.ResultsInvalidVersion);

            Assert.IsNull(parser, "Giving a result xml with unknown version should return a null");
        }

        [TestMethod]
        [TestCategory("result-parser")]
        public void ParseVersion1Data()
        {
            var parser = CppCheckParserFactory.GetParser(CppCheckXmlOutput.ResultsVersion1);

            var result = parser.Parse().ToList();

            Assert.AreEqual(1, parser.Version());
            Assert.AreEqual(3, result.Count);

            var firstError = result.First();
            Assert.AreEqual(1, firstError.Locations.ToList().Count);

            var location = firstError.Locations.First();

            Assert.AreEqual("led_flasher_main.c", location.File);
            Assert.AreEqual(12, location.Line);

            Assert.AreEqual(CppCheckError.CppCheckErrorSeverity.Style, firstError.Severity);
            Assert.AreEqual("unreadVariable", firstError.Type);
            Assert.IsFalse(firstError.Inconclusive.HasValue);
        }

        [TestMethod]
        [TestCategory("result-parser")]
        public void ParseVersion2Data()
        {
            var parser = CppCheckParserFactory.GetParser(CppCheckXmlOutput.ResultsVersion2);

            var result = parser.Parse().ToList();

            Assert.AreEqual(2, parser.Version());
            Assert.AreEqual(3, result.Count);

            var firstError = result.First();
            Assert.AreEqual(1, firstError.Locations.ToList().Count);

            var location = firstError.Locations.First();

            Assert.AreEqual("led_flasher_main.c", location.File);
            Assert.AreEqual(12, location.Line);

            Assert.AreEqual(CppCheckError.CppCheckErrorSeverity.Style, firstError.Severity);
            Assert.AreEqual("unreadVariable", firstError.Type);
            Assert.IsFalse(firstError.Inconclusive.HasValue);

            var parser2 = (CppCheckParserV2)parser;
            Assert.AreEqual("1.73", parser2.CppCheckVersion);

        }
    }
}


text:
from typing import List

from approval_utilities.utilities.os_utilities import run_command
from approval_utilities.utils import ensure_file_exists
from approvaltests.command import Command
from approvaltests.core.reporter import Reporter
from approvaltests.reporters.generic_diff_reporter_config import (
    GenericDiffReporterConfig,
    create_config,
)
from approval_utilities.utils import to_json

PROGRAM_FILES = "{ProgramFiles}"

class GenericDiffReporter(Reporter):
    """
    A reporter that launches
    an external diff tool given by config.
    """

    @staticmethod
    def create(diff_tool_path: str) -> "GenericDiffReporter":
        return GenericDiffReporter(create_config(["custom", diff_tool_path]))

    def __init__(self, config: GenericDiffReporterConfig) -> None:
        self.name = config.name
        self.path = self.expand_program_files(config.path)
        self.extra_args = config.extra_args

    def __str__(self) -> str:
        if self.extra_args:
            config = {
                "name": self.name,
                "path": self.path,
                "arguments": self.extra_args,
            }
        else:
            config = {"name": self.name, "path": self.path}

        return to_json(config)

    @staticmethod
    def run_command(command_array: List[str]) -> None:
        run_command(command_array)

    def get_command(self, received: str, approved: str) -> List[str]:
        return [self.path] + self.extra_args + [received, approved]

    def report(self, received_path: str, approved_path: str) -> bool:
        if not self.is_working():
            return False
        ensure_file_exists(approved_path)
        command_array = self.get_command(received_path, approved_path)
        self.run_command(command_array)
        return True

    def is_working(self) -> bool:
        found = Command(self.path).locate()
        if found:
            self.path = found
        return found

    @staticmethod
    def expand_program_files(path: str) -> str:
        if PROGRAM_FILES not in path:
            return path

        for candidate in [
            r"C:/Program Files",
            r"C:/Program Files (x86)",
            r"C:/ProgramW6432",
        ]:
            possible = path.replace(PROGRAM_FILES, candidate)
            if Command.executable(possible):
                return possible
        return path.replace(PROGRAM_FILES, "C:/Program Files")


text:
yaml-linter-python-wrapper
==========================

A simple python wrapper using PyYAML to perform a well-formed synthax check against a file


text:
//
//  OculusHandler.h
//  XPlaneOculus
//
//  Created by Mike Akers on 5/31/13.
//  Copyright (c) 2013 Runway12. All rights reserved.
//

#ifndef __XPlaneOculus__OculusHandler__
#define __XPlaneOculus__OculusHandler__

#include <iostream>
#include "OVR.h"

//using namespace OVR;
//
//class OculusHandler : public MessageHandler {
//public:
//    virtual ~OculusHandler() {}
//
//};

#endif /* defined(__XPlaneOculus__OculusHandler__) */


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<meta http-equiv="content-type" content="text/html;charset=UTF-8" />

<title>  Painless Node Creation with DOM Builder - The Web Standards Project</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="The Web Standards Project is a grassroots coalition fighting for standards which ensure simple, affordable access to web technologies for all." />
<meta name="MSSmartTagsPreventParsing" content="true" />

<link rel="stylesheet" type="text/css" media="screen, projection" href="/wp/wp-content/themes/web-standards-project/styles.css" />
<link rel="stylesheet" type="text/css" media="print" href="/wp/wp-content/themes/web-standards-project/print.css" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="/feed/index.html" />
<link rel="alternate" type="text/xml" title="RSS .92" href="/feed/rss/index.html" />
<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="/feed/atom/index.html" />
<link rel="pingback" href="/wp/xmlrpc.php" />
<link rel="Shortcut Icon" type="image/ico" href="/files/theme/wasp.ico" />
<link rel="home" title="Web Standards Project Home" href="/index.html" />
	<link rel='archives' title='March 2013' href='/2013/03/index.html' />
	<link rel='archives' title='February 2012' href='/2012/02/index.html' />
	<link rel='archives' title='December 2011' href='/2011/12/index.html' />
	<link rel='archives' title='November 2011' href='/2011/11/index.html' />
	<link rel='archives' title='March 2011' href='/2011/03/index.html' />
	<link rel='archives' title='February 2011' href='/2011/02/index.html' />
	<link rel='archives' title='January 2011' href='/2011/01/index.html' />
	<link rel='archives' title='August 2010' href='/2010/08/index.html' />
	<link rel='archives' title='June 2010' href='/2010/06/index.html' />
	<link rel='archives' title='March 2010' href='/2010/03/index.html' />
	<link rel='archives' title='February 2010' href='/2010/02/index.html' />
	<link rel='archives' title='January 2010' href='/2010/01/index.html' />
	<link rel='archives' title='November 2009' href='/2009/11/index.html' />
	<link rel='archives' title='June 2009' href='/2009/06/index.html' />
	<link rel='archives' title='May 2009' href='/2009/05/index.html' />
	<link rel='archives' title='April 2009' href='/2009/04/index.html' />
	<link rel='archives' title='March 2009' href='/2009/03/index.html' />
	<link rel='archives' title='February 2009' href='/2009/02/index.html' />
	<link rel='archives' title='January 2009' href='/2009/01/index.html' />
	<link rel='archives' title='December 2008' href='/2008/12/index.html' />
	<link rel='archives' title='November 2008' href='/2008/11/index.html' />
	<link rel='archives' title='October 2008' href='/2008/10/index.html' />
	<link rel='archives' title='September 2008' href='/2008/09/index.html' />
	<link rel='archives' title='August 2008' href='/2008/08/index.html' />
	<link rel='archives' title='July 2008' href='/2008/07/index.html' />
	<link rel='archives' title='June 2008' href='/2008/06/index.html' />
	<link rel='archives' title='May 2008' href='/2008/05/index.html' />
	<link rel='archives' title='April 2008' href='/2008/04/index.html' />
	<link rel='archives' title='March 2008' href='/2008/03/index.html' />
	<link rel='archives' title='February 2008' href='/2008/02/index.html' />
	<link rel='archives' title='January 2008' href='/2008/01/index.html' />
	<link rel='archives' title='December 2007' href='/2007/12/index.html' />
	<link rel='archives' title='November 2007' href='/2007/11/index.html' />
	<link rel='archives' title='October 2007' href='/2007/10/index.html' />
	<link rel='archives' title='September 2007' href='/2007/09/index.html' />
	<link rel='archives' title='August 2007' href='/2007/08/index.html' />
	<link rel='archives' title='June 2007' href='/2007/06/index.html' />
	<link rel='archives' title='May 2007' href='/2007/05/index.html' />
	<link rel='archives' title='April 2007' href='/2007/04/index.html' />
	<link rel='archives' title='March 2007' href='/2007/03/index.html' />
	<link rel='archives' title='February 2007' href='/2007/02/index.html' />
	<link rel='archives' title='January 2007' href='/2007/01/index.html' />
	<link rel='archives' title='December 2006' href='../../../12/index.html' />
	<link rel='archives' title='November 2006' href='../../../11/index.html' />
	<link rel='archives' title='October 2006' href='../../../10/index.html' />
	<link rel='archives' title='September 2006' href='../../../09/index.html' />
	<link rel='archives' title='August 2006' href='../../../08/index.html' />
	<link rel='archives' title='July 2006' href='../../../07/index.html' />
	<link rel='archives' title='June 2006' href='../../../06/index.html' />
	<link rel='archives' title='May 2006' href='../../../05/index.html' />
	<link rel='archives' title='April 2006' href='../../index.html' />
	<link rel='archives' title='March 2006' href='../../../03/index.html' />
	<link rel='archives' title='February 2006' href='../../../02/index.html' />
	<link rel='archives' title='January 2006' href='../../../01/index.html' />
	<link rel='archives' title='December 2005' href='/2005/12/index.html' />
	<link rel='archives' title='November 2005' href='/2005/11/index.html' />
	<link rel='archives' title='October 2005' href='/2005/10/index.html' />
	<link rel='archives' title='September 2005' href='/2005/09/index.html' />
	<link rel='archives' title='August 2005' href='/2005/08/index.html' />
	<link rel='archives' title='July 2005' href='/2005/07/index.html' />
	<link rel='archives' title='June 2005' href='/2005/06/index.html' />
	<link rel='archives' title='May 2005' href='/2005/05/index.html' />
	<link rel='archives' title='April 2005' href='/2005/04/index.html' />
	<link rel='archives' title='March 2005' href='/2005/03/index.html' />
	<link rel='archives' title='February 2005' href='/2005/02/index.html' />
	<link rel='archives' title='January 2005' href='/2005/01/index.html' />
	<link rel='archives' title='December 2004' href='/2004/12/index.html' />
	<link rel='archives' title='November 2004' href='/2004/11/index.html' />
	<link rel='archives' title='October 2004' href='/2004/10/index.html' />
	<link rel='archives' title='September 2004' href='/2004/09/index.html' />
	<link rel='archives' title='August 2004' href='/2004/08/index.html' />
	<link rel='archives' title='July 2004' href='/2004/07/index.html' />
	<link rel='archives' title='June 2004' href='/2004/06/index.html' />
	<link rel='archives' title='May 2004' href='/2004/05/index.html' />
	<link rel='archives' title='April 2004' href='/2004/04/index.html' />
	<link rel='archives' title='March 2004' href='/2004/03/index.html' />
	<link rel='archives' title='February 2004' href='/2004/02/index.html' />
	<link rel='archives' title='January 2004' href='/2004/01/index.html' />
	<link rel='archives' title='December 2003' href='/2003/12/index.html' />
	<link rel='archives' title='November 2003' href='/2003/11/index.html' />
	<link rel='archives' title='October 2003' href='/2003/10/index.html' />
	<link rel='archives' title='September 2003' href='/2003/09/index.html' />
	<link rel='archives' title='August 2003' href='/2003/08/index.html' />
	<link rel='archives' title='July 2003' href='/2003/07/index.html' />
	<link rel='archives' title='June 2003' href='/2003/06/index.html' />
	<link rel='archives' title='May 2003' href='/2003/05/index.html' />
	<link rel='archives' title='April 2003' href='/2003/04/index.html' />
	<link rel='archives' title='March 2003' href='/2003/03/index.html' />
	<link rel='archives' title='February 2003' href='/2003/02/index.html' />
	<link rel='archives' title='January 2003' href='/2003/01/index.html' />
	<link rel='archives' title='December 2002' href='/2002/12/index.html' />
	<link rel='archives' title='November 2002' href='/2002/11/index.html' />
	<link rel='archives' title='October 2002' href='/2002/10/index.html' />
	<link rel='archives' title='September 2002' href='/2002/09/index.html' />
	<link rel='archives' title='August 2002' href='/2002/08/index.html' />
	<link rel='archives' title='July 2002' href='/2002/07/index.html' />
	<link rel='archives' title='June 2002' href='/2002/06/index.html' />
	<link rel='archives' title='April 2002' href='/2002/04/index.html' />
	<link rel='archives' title='March 2002' href='/2002/03/index.html' />
	<link rel='archives' title='December 2001' href='/2001/12/index.html' />
	<link rel='archives' title='September 2001' href='/2001/09/index.html' />
	<link rel='archives' title='November 2000' href='/2000/11/index.html' />
	<link rel='archives' title='July 2000' href='/2000/07/index.html' />
	<link rel='archives' title='April 2000' href='/2000/04/index.html' />
	<link rel='archives' title='March 1999' href='/1999/03/index.html' />
	<link rel='archives' title='October 1998' href='/1998/10/index.html' />
	<link rel='archives' title='August 1998' href='/1998/08/index.html' />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="/wp/xmlrpc0db0.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="/wp/wp-includes/wlwmanifest.xml" />
<link rel='prev' title='DOM Builder' href='../../13/dom-builder/index.html' />
<link rel='next' title='Print-ready poster:  separation in a nutshell' href='../../17/print-ready-poster-separation-in-a-nutshell/index.html' />
<meta name="generator" content="WordPress 3.3.1" />
<link rel='canonical' href='index.html' />
<link rel='shortlink' href='../../../../indexe1f1.html?p=877' />

Working together for standards  The Web Standards Project

		Skip to content

				<form id="fm-search" method="get" action="http://www.webstandards.org/index.php">
			<fieldset>
				<legend>Search</legend>
				Search WaSP
				<input id="s" name="s" class="search" value="" />
				<input type="submit" class="submit" name="submit" value="Go!" />
			</fieldset>
		</form>

Home

About

Learn

Action

Buzz

Press

Painless Node Creation with DOM Builder

By Jeremy Keith | April 14th, 2006 | Filed in Authoring Tools, DOM, DOM Scripting TF

Dan Webb’s DOM Builder takes the finickiness out of standards-based markup generation.

				Skip to comment form

If you haven’t seen it yet, be sure to read the latest post over on the Vivabit blog. In it, Dan Webb debuts a small but perfectly formed little script that solves a problem familiar to many of us.

The innerHTML property is quick and easy to use. But it’s also proprietary and heavy-handed. DOM methods like createElement and createTextNode, on the other hand, are precise and part of a standard but they can be finicky and repetitive to use.

Dan’s script takes the finickiness out of standards-based markup generation while keeping the precision. The 1K file is called DOM Builder and it could prove to be a very useful addition to your DOM Scripting arsenal.

The script has been released under an MIT license.

			Return to top

Post a Reply

Comments are closed.

Back to Top

All of the entries posted in WaSP Buzz express the opinions of their individual authors. They do not necessarily reflect the plans or positions of the Web Standards Project as a group.

This site is valid XHTML 1.0 Strict, CSS | Get Buzz via RSS or Atom | Colophon | Legal


text:
import test from 'tape';
import {visit} from '../../lib/utils';
import routeConfigVisitor from '../../visitors/routeConfig';

test('<Route> handler is renamed to component', assert => {
  // arrange
  const input = '<Route handler={Home} />;';
  const expected = '<Route component={Home} />;';

  // act
  const result = visit(input, routeConfigVisitor);

  // assert
  assert.equal(result, expected);
  assert.end();
});

test('<Route> name is removed', assert => {
  const input = '<Route name="app" />;';
  const expected = '<Route />;';

  const result = visit(input, routeConfigVisitor);

  assert.equal(result, expected);
  assert.end();
});

test('<Route> attributes on other components remain unaffected', assert => {
  const input = '<CustomComponent name="Timmy" age="42" handler="Jimmy" />;';
  const expected = '<CustomComponent name="Timmy" age="42" handler="Jimmy" />;';

  const result = visit(input, routeConfigVisitor);

  assert.equal(result, expected);
  assert.end();
})


text:
---

copyright:
  years: 2015, 2017
lastupdated: "2017-07-19"

---

{:new_window: target="_blank"}
{:shortdesc: .shortdesc}
{:screen: .screen}
{:codeblock: .codeblock}
{:pre: .pre}

# MQTT connectivity for applications
{: #mqtt}

MQTT is the primary protocol that devices and applications use to communicate with the {{site.data.keyword.iot_full}}. Client libraries, information, and samples are provided to help you to connect and integrate your {{site.data.keyword.iot_short_notm}} applications.
{:shortdesc}

## Client connections
{: #client_connections}

For information about client security and how to connect MQTT clients to applications in  {{site.data.keyword.iot_short_notm}}, see [Connecting applications, devices, and gateways to {{site.data.keyword.iot_short_notm}}](../reference/security/connect_devices_apps_gw.html).

## MQTT authentication
{: #mqtt_authentication}

{{site.data.keyword.iot_short_notm}} applications require an API key to connect to an organization. When an API key is registered, an authentication token is generated, which must be used with that API key.

The following example shows a typical API key:

a-<var class="keyword varname">orgId</var>-a84ps90Ajs

{: codeblock}

The following example shows a typical authentication token:

```
MP$08VKz!8rXwnR-Q*
```

When you make an MQTT connection by using an API key, ensure that the following guidelines are applied:

- The MQTT client ID is in the format: a:*orgId*:*appId*
- The MQTT user name is the API key (for example, a-*orgId*-a84ps90Ajs)
- The MQTT password is the authentication token (for example, MP$08VKz!8rXwnR-Q*)

## Publishing device events
{: #publishing_device_events}

An application can publish events as if they came from any registered device, for example:

-  Publish to topic iot-2/type/*device_type*/id/*device_id*/evt/*event_id*/fmt/*format_string*

To send existing data from a device into {{site.data.keyword.iot_short_notm}}, you can create an application to process the data and publish it into {{site.data.keyword.iot_short_notm}}.

**Important:** The message payload is limited to a maximum of 131072 bytes.  Messages that exceed the limit are rejected.

### Retained messages
{{site.data.keyword.iot_short_notm}} organizations are not authorized to publish retained MQTT messages. If an application, gateway, or device sends a retained message, the {{site.data.keyword.iot_short_notm}} service overrides the retained message flag when it is set to true and processes the message as if the flag is set to false.

## Publishing device commands
{: #publishing_device_commands}

- The MQTT user name is the API key (for example, a-*orgId*-a84ps90Ajs)
- The MQTT password is the authentication token (for example, MP$08VKz!8rXwnR-Q*)

## Publishing device events
{: #publishing_device_events}

An application can publish events as if they came from any registered device, for example:

-  Publish to topic iot-2/type/*device_type*/id/*device_id*/evt/*event_id*/fmt/*format_string*

To send existing data from a device into {{site.data.keyword.iot_short_notm}}, you can create an application to process the data and publish it into {{site.data.keyword.iot_short_notm}}.

**Important:** The message payload is limited to a maximum of 131072 bytes.  Messages that exceed the limit are rejected.

### Retained messages
{{site.data.keyword.iot_short_notm}} organizations are not authorized to publish retained MQTT messages. If an application, gateway, or device sends a retained message, the {{site.data.keyword.iot_short_notm}} service overrides the retained message flag when it is set to true and processes the message as if the flag is set to false.

## Publishing device commands
{: #publishing_device_commands}

An application can publish a command to any registered device, for example:

-  Publish to topic iot-2/type/*device_type*/id/*device_id*/cmd/*command_id*/fmt/*format_string*

## Subscribing to device events
{: #subscribe_device_events}

An application can subscribe to events from one or more devices, for example:

-  Subscribe to topic iot-2/type/*device_type*/id/*device_id*/evt/*event_id*/fmt/*format_string*

**Note:**  To subscribe to more than one type of event or to events from more than a single device, use the MQTT "any" wildcard character (+) for any of the following components:

- device_type
- device_id
- event_id
- format_string

## Subscribing to device commands
{: #subscribe_device_commands}

An application can subscribe to commands that are being sent to one or more devices, for example:

-  Subscribe to topic iot-2/type/*device_type*/id/*device_id*/cmd/*command_id*/fmt/*format_string*

**Note:** To subscribe to more than one type of event or to events from more than a single device, use the MQTT "any" wildcard character (+) for any of the following components:

-  device_type
-  device_id
-  cmd_id
-  format_string

## Subscribing to device status messages
{: #subscribe_device_status}

An application can subscribe to monitor the status of one or more devices, for example:

-  Subscribe to topic iot-2/type/*device_type*/id/*device_id*/mon

**Note:** To subscribe to updates from more than one device, use the MQTT "any" wildcard character (+) for any of the following components:

- device_type
- device_id

## Subscribing to application status messages
{: #subscribe_app_status}

An application can subscribe to monitor status of one or more applications, for example:

- Subscribe to topic iot-2/app/*appId*/mon

**Note:** To subscribe to updates for all applications, use the MQTT "any" wildcard character (+) for the *appId* component.

## Quickstart restrictions
{: #quickstart_restrictions}
If you are planning to create application code for use with the Quickstart service, the following features are not supported in Quickstart:

- Publishing commands
- Subscribing to commands
- Using the MQTT "any" wildcard character (+) in **deviceType** or **appId** components
- MQTT connection over Transport Layer Security (TLS)
- Scalable applications

## Scalable applications
{: #scalable_apps}

By adjusting the way that your applications connect, you can make your {{site.data.keyword.iot_short_notm}} applications more scalable by balancing the load handling of event messages across multiple instances of an application.

The number of clients that are required for optimum load balancing and scalability varies by deployment. To identify the optimum number of clients, you need to stress test your system.

Scalable applications are defined as either non-durable subscriptions or mixed-durability shared subscriptions (Beta).

### Non-durable subscriptions
{: #shared_sub_non_durable}

To enable load balancing, ensure that the application subscription is non-durable and that the client ID in the subscription matches the following format:

A:<var class="keyword varname">orgId</var>:<var class="keyword varname">appId</var>

{: codeblock}

Where:
-  The character **A** indicates that the client is a scalable application.
-  *orgId* is the unique six-character organization ID that was generated when you registered the service.
-  *appId* is a user-defined unique string identifier for the client. The string can contain only alphanumeric characters (a-z, A-Z, 0-9) and the dash (-), underscore (_), and dot (.) special characters.

**Important:**
- The client ID must start with an uppercase **A** character to be correctly designated as a scalable application by {{site.data.keyword.iot_short_notm}}.
- Other clients that are part of the scalable application must use the same client ID.
- The clean session value must be set to false (0) for durable subscriptions, or to true (1) for non-durable subscriptions.

### Mixed-durability shared subscriptions
{: #shared_sub_mixed}

The {{site.data.keyword.iot_short_notm}} service extends the MQTT V3.1.1 messaging protocol specification to support mixed-durability shared subscriptions. Shared subscriptions provide load balancing capabilities for applications. A shared subscription might be needed if a back-end enterprise application cannot process the volume of messages that are being published to a specific topic space. For example, when many devices publish messages that are being processed by a single application, it might be necessary to use the load balancing capability of a shared subscription.

For mixed-durability shared subscriptions, ensure that the client ID in the subscription matches the following format:

A:<var class="keyword varname">org</var>:<var class="keyword varname">appId</var>:<var class="keyword varname">instanceId</var>

{: codeblock}

Where:
- The character **A**, *orgId*, and *appId* in the client ID are defined in the same way as for [non-durable subscriptions](#shared_sub_non_durable).
- *instanceID* is a string that must be no more than 36 characters and can contain only the following characters:
   - Alpha-numeric characters (a-z, A-Z, 0-9)
   - Dashes ( - )
   - Underscores ( _ )
   - Dots ( . )

**Important:**
- The clean session value can be set to either true (1) or false (0) in mixed-durability shared subscriptions.
- Clients that connect with the instanceId use different subscriptions than clients that connect without the instanceId. Therefore, if you would like multiple clients to connect on a mixed-durability shared subscription, you need to specify the instanceID in all subscriptions.

**Example scenario**

The following scenario is one example of how a non-durable scalable application works in {{site.data.keyword.iot_short_notm}}:

- Client one connects as **A:abc123:myApplication** and subscribes to all device events, which means that client one receives 100% of the device events that are published.
- Client two connects as **A:abc123:myApplication** and also subscribes to all device events, which means that client one and client two both share all of the events that are published. The processing load is shared between client one and client two.
- Client three connects as **A:abc123:myApplication** and also subscribes to all device events, which means that client one, client two, and client three all share the processing load for events.
- Client two and client three then unsubscribe from all device events, which means that only client one receives all device events that are published. While client two and client three are still connected to the service, client one receives 100% of the device events that are published.
- When two or more applications share a subscription, messages might not arrive in the order in which they were sent. For example, message B might arrive at client one before message A arrives at client two, even though message A was sent first.


text:
module Accessors
  extend ActiveSupport::Concern

  class_methods do
    private
      def define_accessors(name, klass)
        define_method(name) { instance_eval "@#{name} ||= #{klass}.new" }
        define_method("#{name}=") { |v| instance_variable_set("@#{name}", v) }
        define_method("#{name}_attributes") { model_attrs[name] }

        klass.attribute_names.each do |attr|
          delegate attr, to: name, prefix: true

          define_method "#{name}_#{attr}=" do |v|
            model_attrs[name][attr] = v
            send(name).send("#{attr}=", v)
          end
        end
      end
  end

  private
    def model_attrs
      @model_attrs ||= Hash.new { |h,k| h[k] = {} }
    end
end


text:
using namespace acommon;

namespace acommon {
  struct CheckInfo;
}

namespace aspeller {

  struct SuggestRepl {
    const char * substr;
    const char * repl;
  };

  class SuggestReplEnumeration
  {
    const SuggestRepl * i_;
    const SuggestRepl * end_;
  public:
    SuggestReplEnumeration(const SuggestRepl * b, const SuggestRepl * e)
      : i_(b), end_(e) {}
    bool at_end() const {return i_ == end_;}
    const SuggestRepl * next() {
      if (i_ == end_) return 0;
      return i_++;
    }
  };

  // CharInfo

  typedef unsigned int CharInfo; // 6 bits

  static const CharInfo LOWER  = (1 << 0);
  static const CharInfo UPPER  = (1 << 1);
  static const CharInfo TITLE  = (1 << 2);
  static const CharInfo PLAIN  = (1 << 3);
  static const CharInfo LETTER = (1 << 4);
  static const CharInfo CLEAN  = (1 << 5);

  static const CharInfo CHAR_INFO_ALL = 0x3F;

  //

  enum StoreAs {Stripped, Lower};

  class Language : public Cacheable {
  public:
    typedef const Config CacheConfig;
    typedef String       CacheKey;

    enum CharType {Unknown, WhiteSpace, Hyphen, Digit,
                   NonLetter, Modifier, Letter};

    struct SpecialChar {
      bool begin;
      bool middle;
      bool end;
      bool any;
      SpecialChar() : begin(false), middle(false), end(false), any(false) {}
      SpecialChar(bool b, bool m, bool e) : begin(b), middle(m), end(e),
                                            any(b || m || e) {}
    };

  private:
    String   dir_;
    String   name_;
    String   charset_;
    String   charmap_;
    String   data_encoding_;

    ConvObj  mesg_conv_;
    ConvObj  to_utf8_;
    ConvObj  from_utf8_;

    unsigned char to_uchar(char c) const {return static_cast<unsigned char>(c);}

    SpecialChar special_[256];
    CharInfo      char_info_[256];
    char          to_lower_[256];
    char          to_upper_[256];
    char          to_title_[256];
    char          to_stripped_[256];
    char          to_plain_[256];
    int           to_uni_[256];
    CharType      char_type_[256];
    char          to_clean_[256];
    char          de_accent_[256];

    StoreAs       store_as_;

    String      soundslike_chars_;
    String      clean_chars_;

    bool have_soundslike_;
    bool have_repl_;

    StackPtr<Soundslike> soundslike_;
    StackPtr<AffixMgr>   affix_;
    StackPtr<Config>     lang_config_;

    StringBuffer buf_;
    Vector<SuggestRepl> repls_;

    Language(const Language &);
    void operator=(const Language &);

  public: // but don't use

    char          sl_first_[256];
    char          sl_rest_[256];

  public:

    Language() {}
    PosibErr<void> setup(const String & lang, const Config * config);
    void set_lang_defaults(Config & config) const;

    const char * data_dir() const {return dir_.c_str();}
    const char * name() const {return name_.c_str();}
    const char * charmap() const {return charmap_.c_str();}
    const char * data_encoding() const {return data_encoding_.c_str();}

    const Convert * mesg_conv() const {return mesg_conv_.ptr;}
    const Convert * to_utf8() const {return to_utf8_.ptr;}
    const Convert * from_utf8() const {return from_utf8_.ptr;}

    int to_uni(char c) const {return to_uni_[to_uchar(c)];}

    //
    // case conversion
    //

    char to_upper(char c) const {return to_upper_[to_uchar(c)];}
    bool is_upper(char c) const {return to_upper(c) == c;}

    char to_lower(char c) const {return to_lower_[to_uchar(c)];}
    bool is_lower(char c) const {return to_lower(c) == c;}

    char to_title(char c) const {return to_title_[to_uchar(c)];}
    bool is_title(char c) const {return to_title(c) == c;}

    char * to_lower(char * res, const char * str) const {
      while (*str) *res++ = to_lower(*str++); *res = '\0'; return res;}
    char * to_upper(char * res, const char * str) const {
      while (*str) *res++ = to_upper(*str++); *res = '\0'; return res;}

    void to_lower(String & res, const char * str) const {
      res.clear(); while (*str) res += to_lower(*str++);}
    void to_upper(String & res, const char * str) const {
      res.clear(); while (*str) res += to_upper(*str++);}

    bool is_lower(const char * str) const {
      while (*str) {if (!is_lower(*str++)) return false;} return true;}
    bool is_upper(const char * str) const {
      while (*str) {if (!is_upper(*str++)) return false;} return true;}

    //
    //
    //

    char to_plain(char c) const {return to_plain_[to_uchar(c)];}

    char de_accent(char c) const {return de_accent_[to_uchar(c)];}

    SpecialChar special(char c) const {return special_[to_uchar(c)];}

    CharType char_type(char c) const {return char_type_[to_uchar(c)];}
    bool is_alpha(char c) const {return char_type(c) >  NonLetter;}

    CharInfo char_info(char c) const {return char_info_[to_uchar(c)];}

    //
    // stripped
    //

    char to_stripped(char c) const {return to_stripped_[to_uchar(c)];}

    // return a pointer to the END of the string
    char * to_stripped(char * res, const char * str) const {
      for (; *str; ++str) {
        char c = to_stripped(*str);
        if (c) *res++ = c;
      }
      *res = '\0';
      return res;
    }
    void to_stripped(String & res, const char * str) const {
      res.clear();
      for (; *str; ++str) {
        char c = to_stripped(*str);
        if (c) res += c;
      }
    }

    bool is_stripped(char c) const {return to_stripped(c) == c;}

    bool is_stripped(const char * str) const {
      while (*str) {if (!is_stripped(*str++)) return false;} return true;}

    //
    // Clean
    //
    // The "clean" form is how words are indixed in the dictionary.
    // It will at very least convert the word to lower case.  It may
    // also strip accents and non-letters.
    //

    char to_clean(char c) const {return to_clean_[to_uchar(c)];}

    char * to_clean(char * res, const char * str) const {
      for (; *str; ++str) {
        char c = to_clean(*str);
        if (c) *res++ = c;
      }
      *res = '\0';
      return res;
    }
    void to_clean(String & res, const char * str) const {
      res.clear();
      for (; *str; ++str) {
        char c = to_clean(*str);
        if (c) res += c;
      }
    }

    bool is_clean(char c) const {return to_clean(c) == c;}

    bool is_clean(const char * str) const {
      while (*str) {if (!is_clean(*str++)) return false;} return true;}

    bool is_clean_wi(WordInfo wi) const {
      return false;
      //return wi & CASE_PATTEN == AllLower &&
    }

    const char * clean_chars() const {return clean_chars_.c_str();}

    //
    // Soundslike
    //

    bool have_soundslike() const {return have_soundslike_;}

    const char * soundslike_name() const {return soundslike_->name();}
    const char * soundslike_version() const {return soundslike_->version();}

    void to_soundslike(String & res, ParmStr word) const {
      res.resize(word.size());
      char * e = soundslike_->to_soundslike(res.data(), word.str(), word.size());
      res.resize(e - res.data());
    }

    // returns a pointer to the END of the string
    char * to_soundslike(char * res, const char * str, int len = -1) const {
      return soundslike_->to_soundslike(res,str,len);
    }

    char * to_soundslike(char * res, const char * str, int len, WordInfo wi) const {
      if (!have_soundslike_ && (wi & ALL_CLEAN)) return 0;
      else return soundslike_->to_soundslike(res,str,len);
    }

    const char * soundslike_chars() const {return soundslike_chars_.c_str();}

    //
    // Affix compression methods
    //

    const AffixMgr * affix() const {return affix_;}

    bool have_affix() const {return affix_;}

    void munch(ParmStr word, GuessInfo * cl, bool cross = true) const {
      if (affix_)
        affix_->munch(word, cl, cross);
    }

    WordAff * expand(ParmStr word, ParmStr aff,
                     ObjStack & buf, int limit = INT_MAX) const {
      if (affix_)
        return affix_->expand(word, aff, buf, limit);
      else
        return fake_expand(word, aff, buf);
    }
    WordAff * fake_expand(ParmStr word, ParmStr aff, ObjStack & buf) const;

    //
    // Repl
    //

    bool have_repl() const {return have_repl_;}

    SuggestReplEnumeration * repl() const {
      return new SuggestReplEnumeration(repls_.pbegin(), repls_.pend());}

    //
    //
    //

    WordInfo get_word_info(ParmStr str) const;

    //
    // fix_case
    //

    CasePattern case_pattern(ParmStr str) const;

    CasePattern case_pattern(const char * str, unsigned size) const;

    void fix_case(CasePattern case_pattern, char * str)
    {
      if (!str[0]) return;
      if (case_pattern == AllUpper) to_upper(str,str);
      else if (case_pattern == FirstUpper) *str = to_title(*str);
    }
    void fix_case(CasePattern case_pattern,
                  char * res, const char * str) const;
    const char * fix_case(CasePattern case_pattern,
                          const char * str, String & buf) const;

    //
    // for cache
    //

    static inline PosibErr<Language *> get_new(const String & lang, const Config * config) {
      StackPtr<Language> l(new Language());
      RET_ON_ERR(l->setup(lang, config));
      return l.release();
    }

    bool cache_key_eq(const String & l) const  {return name_ == l;}
  };

  typedef Language LangImpl;

  struct MsgConv : public ConvP
  {
    MsgConv(const Language * l) : ConvP(l->mesg_conv()) {}
    MsgConv(const Language & l) : ConvP(l.mesg_conv()) {}
  };

  struct InsensitiveCompare {
    // compares to strings without regards to casing or special characters
    const Language * lang;
    InsensitiveCompare(const Language * l = 0) : lang(l) {}
    operator bool () const {return lang;}
    int operator() (const char * a, const char * b) const
    {
      char x, y;
      for (;;)
      {
        while (x = lang->to_clean(*a++), !x);
        while (y = lang->to_clean(*b++), !y);
        if (x == 0x10 || y == 0x10 || x != y) break;
      }
      return static_cast<unsigned char>(x) - static_cast<unsigned char>(y);
    }
  };

  struct InsensitiveEqual {
    InsensitiveCompare cmp;
    InsensitiveEqual(const Language * l = 0) : cmp(l) {}
    bool operator() (const char * a, const char * b) const
    {
      return cmp(a,b) == 0;
    }
  };

  struct InsensitiveHash {
    // hashes a string without regards to casing or special begin
    // or end characters
    const Language * lang;
    InsensitiveHash() {}
    InsensitiveHash(const Language * l)
	: lang(l) {}
    size_t operator() (const char * s) const
    {
      size_t h = 0;
      for (;;) {
	if (*s == 0) break;
        unsigned char c = lang->to_clean(*s++);
	if (c) h=5*h + c;
      }
      return h;
    }
  };

  struct SensitiveCompare {
    const Language * lang;
    bool case_insensitive;
    bool ignore_accents;
    bool begin;
    bool end;
    SensitiveCompare(const Language * l = 0)
      : lang(l), case_insensitive(false), ignore_accents(false),
        begin(true), end(true) {}
    bool operator() (const char * word, const char * inlist) const;
  };

  struct CleanAffix {
    const Language * lang;
    OStream * log;
    MsgConv msgconv1;
    MsgConv msgconv2;
    CleanAffix(const Language * lang0, OStream * log0);
    char * operator() (ParmStr word, char * aff);
  };

  class WordListIterator
  {
  public:
    struct Value {
      SimpleString word;
      SimpleString aff;
    };
    WordListIterator(StringEnumeration * in,
                     const Language * lang,
                     OStream * log);
    // init may set "norm-strict" to true which is why it is not const
    PosibErr<void> init (Config & config);
    const Value * operator-> () const {return &val;}
    PosibErr<bool> adv();
  private:
    bool have_affix;
    bool validate_words;
    bool validate_affixes;
    bool clean_words;
    bool skip_invalid_words;
    bool clean_affixes;
    StringEnumeration * in;
    const Language * lang;
    ConvEC iconv;
    OStream * log;
    Value val;
    String data;
    const char * orig;
    char * str;
    char * str_end;
    char brk[3];
    CleanAffix clean_affix;
  };

  String get_stripped_chars(const Language & l);

  String get_clean_chars(const Language & l);

  PosibErr<void> check_if_valid(const Language & l, ParmStr word);
  PosibErr<void> validate_affix(const Language & l, ParmStr word, ParmStr aff);

  bool find_language(Config & c);

  PosibErr<Language *> new_language(const Config &, ParmStr lang = 0);

  PosibErr<void> open_affix_file(const Config &, FStream & o);
}

#endif


text:
/* eslint-disable sort-keys */

const http = require('http');
const path = require('path');
const fs = require('fs');
const connect = require('connect');
const optimist = require('optimist');
const reactMiddleware = require('react-page-middleware');
const convert = require('./convert.js');
const translationPre = require('./translationPre.js');
const translation = require('./translation.js');

console.log('server.js triggered...');

const argv = optimist.argv;

const PROJECT_ROOT = path.resolve(__dirname, '..');
const FILE_SERVE_ROOT = path.join(PROJECT_ROOT, 'src');

let port = argv.port;
if (argv.$0.indexOf('node ./server/generate.js') !== -1) {
  // Using a different port so that you can publish the website
  // and keeping the server up at the same time.
  port = 8079;
}

const buildOptions = {
  projectRoot: PROJECT_ROOT,
  pageRouteRoot: FILE_SERVE_ROOT,
  useBrowserBuiltins: false,
  logTiming: true,
  useSourceMaps: true,
  ignorePaths(p) {
    return p.indexOf('__tests__') !== -1;
  },
  serverRender: true,
  dev: argv.dev !== 'false',
  static: true,
};

// clean up localization files, it can take a while to remove files so let's
// have our next steps run in a callback
translationPre();

const app = connect()
  .use((req, res, next) => {
    // Convert localized .json files into .js
    translation();
    // convert all the md files on every request. This is not optimal
    // but fast enough that we don't really need to care right now.
    convert();
    next();
  })
  .use('/jest/blog/feed.xml', (req, res) => {
    res.end(
      fs.readFileSync(path.join(FILE_SERVE_ROOT, 'jest/blog/feed.xml')) + ''
    );
  })
  .use('/jest/blog/atom.xml', (req, res) => {
    res.end(
      fs.readFileSync(path.join(FILE_SERVE_ROOT, 'jest/blog/atom.xml')) + ''
    );
  })
  .use(reactMiddleware.provide(buildOptions))
  .use(connect['static'](FILE_SERVE_ROOT))
  // .use(connect.favicon(path.join(FILE_SERVE_ROOT, 'elements', 'favicon', 'favicon.ico')))
  .use(connect.logger())
  .use(connect.compress())
  .use(connect.errorHandler());

const portToUse = port || 8080;
const server = http.createServer(app);
server.listen(portToUse);
console.log('Open http://localhost:' + portToUse + '/jest/index.html');
module.exports = server;


text:
.. _pdc_client:

Script pdc_client
=================

.. note::

   Add argument ``-h`` or ``--help`` to get general help or help for a command.

This is a very simple client. Essentially this is just a little more
convenient than using ``curl`` manually. Each invocation of this client
obtains a token and then performs a single request.

This client is not meant for direct usage, but just as a helper for
integrating with PDC from languages where it might be easier than
performing the network requests manually.


text:
#include <vector>
#include "domain/cidade.h"
#include "domain/context.h"

namespace rotas
{
	namespace domain
	{
		class Caminho
		{
			std::vector<Rota> trajeto;
		public:
			Caminho() {};
			Caminho(std::vector<Rota> trajeto)
					: trajeto(trajeto) {};
			int get_id_origem();
			int get_id_destino();
			std::vector<Rota> get_trajeto();
			double get_distancia();
			size_t Caminho::quantidade_rotas_trajeto();
			Rota Caminho::get_rota_indice(int index);
			bool cidade_no_fim_excluindo_facilidade(int id_cidade);
			bool cidade_no_comeco_excluindo_facilidade(int id_cidade);
			bool cidade_esta_no_fim_ou_comeco_rota(int id_cidade);
			bool cidade_existe_na_rota(int id_cidade);
			void adiciona_rota_fim_trajeto(int id_cidade_origem, int id_cidade_destino, double distancia);
			void adiciona_rota_fim_trajeto(Rota rota);
			void adiciona_rota_comeco_trajeto(int id_cidade_origem, int id_cidade_destino, double distancia);
			void adiciona_rota_comeco_trajeto(Rota rota);
			void apaga_rota_comeco();
			void apaga_rota_fim();
		};
	} // domain
} // rotas

#endif // ROTAS_DOMAIN_PATH_H_


text:
Just for fun and AI. Written in Javascript, this is a project which the aim is to make a computer play against humans inside a human-driven game, which is in this case Slither.io. The goal is simple - try and make the snake live and get as long as possible.

[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg?maxAge=2592000)](https://gitter.im/ErmiyaEskandary/Slither.io-bot?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

# Table of Contents
- [Installation instructions](https://github.com/ErmiyaEskandary/Slither.io-bot#installation-instructions)
	- [Visual tutorial](https://github.com/ErmiyaEskandary/Slither.io-bot#visual-tutorial)
	- [Text tutorial](https://github.com/ErmiyaEskandary/Slither.io-bot#text-tutorial)
- [Hotkeys](https://github.com/ErmiyaEskandary/Slither.io-bot#hotkeys)
- [Contributing](https://github.com/ErmiyaEskandary/Slither.io-bot#contributing)
	- [Documentation](https://github.com/ErmiyaEskandary/Slither.io-bot#documentation)
- [Authors](https://github.com/ErmiyaEskandary/Slither.io-bot#authors)
- [License](https://github.com/ErmiyaEskandary/Slither.io-bot#license)

# Installation instructions

**NOTE: these instructions are for installing the bot at a production-ready, fully working and a fully tested state, which is recommended. For the latest bleeding edge code, which may not be fully tested, refer to the bot.user.js file in the current default develop branch as the instructions below refer the bot file in the master branch.**

## Interactive tutorial
http://slither.jlynx.net/

## Visual tutorial
https://www.youtube.com/watch?v=d7mkAgQNuCA - Created by http://slither.jlynx.net/

https://youtu.be/mlEKp-ZAi7w - Created by http://slithere.com/

https://youtu.be/QF9JBMi-fLo?t=38s - Created by SeppeTutorials

https://youtu.be/IpsAazbVIcw - Created by TheFlyingPlatypus

## Text tutorial
If you are on chrome, download the [TamperMonkey](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en) extension.

On other browsers, use the [GreaseMonkey](https://addons.mozilla.org/en-GB/firefox/addon/greasemonkey/) extension.

Once installed, click on [this](https://github.com/ErmiyaEskandary/slither.io-bot/raw/master/bot.user.js), and choose **Install**.

Go to [slither.io](http://slither.io/), and enjoy !

# Hotkeys

Key | Result
---|---
T / Right Click | Bot enabled/disabled
**O** | **Mobile rendering - Try this if you experience lag**
A/S | Radius multiplier
D | Quick radius change - "approach" and "avoid" mode
I | Auto respawn
G | Leaderboard overlay
Y | Visual debugging
U | Log debugging
H | Overlays
B | Background Change
Mouse wheel | Zoom in/out
Z | Reset zoom
ESC | Quick respawn
Q | Quit to menu

# Contributing

Please refer to the [guidelines for contributing](https://github.com/ErmiyaEskandary/Slither.io-bot/blob/master/.github/CONTRIBUTING.md) for all the information you need.

[Check the wiki for additional information](https://github.com/ErmiyaEskandary/Slither.io-bot/wiki)

NOTE : For existing collaborators, please refer to the [DEVELOPER.md file.](https://github.com/ErmiyaEskandary/Slither.io-bot/blob/master/DEVELOPER.md)
## Documentation

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

The [online documentation](http://slitherio-bot.readthedocs.io/en/master/) is maintained in the `/docs` directory.

# Authors
**Ermiya Eskandary & Théophile Cailliau (ErmiyaEskandary & FliiFe)**

Started as a collaborative and fun project between me and FliiFe on 2016/04/20, with this :
> Slither.io bot could be cool

# License

**Licensed under the Mozilla Public License, v. 2.0**

Read LICENSE.md for more info.


text:
using System.Linq;
using Orchard;
using Orchard.DisplayManagement.Descriptors;
using Orchard.Environment.Extensions;
using Orchard.UI.Resources;
using CloudBust.Resources.Services;
using Orchard.Environment;
using Orchard.UI.Admin;

namespace CloudBust.Resources.Shapes
{
    [OrchardFeature("CloudBust.Resources.FontAwesome")]
    public class FontAwesomeShapes : IShapeTableProvider
    {
        private readonly Work<WorkContext> _workContext;
        private readonly IFontAwesomeService _fontawesomeService;
        public FontAwesomeShapes(Work<WorkContext> workContext, IFontAwesomeService fontawesomeService)
        {
            _workContext = workContext;
            _fontawesomeService = fontawesomeService;
        }

        public void Discover(ShapeTableBuilder builder)
        {
            builder.Describe("HeadLinks")
            .OnDisplaying(shapeDisplayingContext =>
            {
                if (!_fontawesomeService.GetAutoEnable()) return;
                if (!_fontawesomeService.GetAutoEnableAdmin())
                {
                    var request = _workContext.Value.HttpContext.Request;
                    if (AdminFilter.IsApplied(request.RequestContext))
                    {
                        return;
                    }
                }

                var resourceManager = _workContext.Value.Resolve<IResourceManager>();
                var scripts = resourceManager.GetRequiredResources("stylesheet");

                string includecss = "FontAwesome";
                            // check to see if another module declared a script foundation. If so, we do nothing
                            var currentFontAwesome = scripts
                                    .Where(l => l.Name == includecss)
                                    .FirstOrDefault();

                if (currentFontAwesome == null)
                {
                                // temp untill we fix the logic
                                resourceManager.Require("stylesheet", includecss).AtHead();

                }

            });
        }
    }
}


text:
import { addons } from '@storybook/addons';
import theme from './theme/covalent.dark.theme';

addons.setConfig({
  theme,
});