text:
var DracoolaArt;
(function (DracoolaArt) {
    var KartwarsBot;
    (function (KartwarsBot) {
        var Manager;
        (function (Manager) {
            var Time;
            (function (Time) {
                var TimerFrame = (function () {
                    function TimerFrame() {
                        this.clocks = {};
                        this.elepsedTimes = {};
                    }
                    TimerFrame.getFunctionName = function () {
                        var frames = StackTrace.getSync();
                        //return frames[frames.length - 1].toString();
                        //return frames[frames.length - 1].functionName;
                        return frames[4].functionName;
                    };
                    TimerFrame.prototype.startFrame = function (groupName) {
                        var name = TimerFrame.getFunctionName();
                        if (groupName != undefined) {
                            name += " [" + groupName + "]";
                        }
                        if (this.clocks[name] == undefined) {
                            this.clocks[name] = Time.Timer.start();
                        }
                        else {
                            this.clocks[name].reset();
                        }
                        return this.clocks[name];
                    };
                    TimerFrame.prototype.endFrame = function (groupName) {
                        var name = TimerFrame.getFunctionName();
                        if (groupName != undefined) {
                            name += " [" + groupName + "]";
                        }
                        if (this.clocks[name] != undefined) {
                            this.elepsedTimes[name] = this.clocks[name].stop();
                        }
                        return this.clocks[name];
                    };
                    TimerFrame.prototype.clearFrames = function () {
                        this.elepsedTimes = [];
                    };
                    TimerFrame.prototype.getFrames = function () {
                        return this.elepsedTimes;
                    };
                    return TimerFrame;
                }());
                Time.TimerFrame = TimerFrame;
            })(Time = Manager.Time || (Manager.Time = {}));
        })(Manager = KartwarsBot.Manager || (KartwarsBot.Manager = {}));
    })(KartwarsBot = DracoolaArt.KartwarsBot || (DracoolaArt.KartwarsBot = {}));
})(DracoolaArt || (DracoolaArt = {}));


text:
<?php

/**
 * @file
 * Extends SolrConnectorPluginBase for acquia search.
 */

namespace Drupal\acquia_search\Plugin\SolrConnector;

use Drupal\acquia_connector\Helper\Storage;
use Drupal\Core\Url;
use Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\acquia_search\EventSubscriber\SearchSubscriber;
use Solarium\Client;

/**
 * Class SearchApiSolrAcquiaConnector.
 *
 * @package Drupal\acquia_search\Plugin\SolrConnector
 *
 * @SolrConnector(
 *   id = "solr_acquia_connector",
 *   label = @Translation("Acquia"),
 *   description = @Translation("Index items using an Acquia Apache Solr search server.")
 * )
 */
class SearchApiSolrAcquiaConnector extends SolrConnectorPluginBase {

  protected $eventDispatcher = FALSE;

  /**
   * {@inheritdoc}
   */
  public function defaultConfiguration() {
    $configuration = parent::defaultConfiguration();

    $configuration['index_id'] = Storage::getIdentifier();
    $configuration['path'] = '/solr/' . Storage::getIdentifier();
    $configuration['host'] = acquia_search_get_search_host();
    $configuration['port'] = '80';
    $configuration['scheme'] = 'http';

    unset($configuration['overridden_by_acquia_search']);

    // If auto-switch feature is turned off - do not attempt to determine the
    // preferred core.
    if (acquia_search_is_auto_switch_disabled()) {
      return $configuration;
    }

    // If the search config is overridden in settings.php, apply this config
    // to the Solr connection and don't attempt to determine the preferred
    // core.
    if (acquia_search_is_connection_config_overridden()) {
      $configuration = $this->setOverriddenCore($configuration);
      return $configuration;
    }

    $preferred_core_service = acquia_search_get_core_service();

    // If the preferred core available, set it.
    if ($preferred_core_service->isPreferredCoreAvailable()) {
      $configuration = $this->setPreferredCore($configuration, $preferred_core_service);
    }
    else {
      // This means we can't detect which search core should be used, so we
      // need to protect it by setting read-only mode but only if it applies.
      if (acquia_search_should_set_read_only_mode()) {
        $configuration = $this->setReadOnlyMode($configuration);
      }
    }

    return $configuration;
  }

  /**
   * Sets the preferred core in the given Solr config.
   *
   * @param $configuration
   *   Solr connection configuration.
   *
   * @param \Drupal\acquia_search\PreferredSearchCoreService $preferred_core_service
   *   Service for determining the preferred search core.
   *
   * @return array
   *   Updated Solr connection configuration.
   */
  protected function setPreferredCore($configuration, $preferred_core_service) {
    $configuration['index_id'] = $preferred_core_service->getPreferredCoreId();
    $configuration['path'] = '/solr/' . $preferred_core_service->getPreferredCoreId();
    $configuration['host'] = $preferred_core_service->getPreferredCoreHostname();
    $configuration['overridden_by_acquia_search'] = ACQUIA_SEARCH_OVERRIDE_AUTO_SET;
    return $configuration;
  }

  /**
   * Sets the current connection overrides to the given Solr config.
   *
   * @param $configuration
   *   Solr connection configuration.
   *
   * @return array
   *   Updated Solr connection configuration.
   */
  protected function setOverriddenCore($configuration) {
    $override = \Drupal::config('acquia_search.settings')->get('connection_override');
    $configuration['overridden_by_acquia_search'] = ACQUIA_SEARCH_EXISTING_OVERRIDE;
    $configuration['path'] = '/solr/' . $override['index_id'];
    return array_merge($configuration, $override);
  }

  /**
   * Sets read-only mode to the given Solr config.
   *
   * We enforce read-only mode in 2 ways:
   * - The module implements hook_search_api_index_load() and alters indexes'
   * read-only flag.
   * - In this plugin, we "emulate" read-only mode by overriding
   * $this->getUpdateQuery() and avoiding all updates just in case something
   * is still attempting to directly call a Solr update.
   *
   * @param $configuration
   *   Solr connection configuration.
   *
   * @return array
   *   Updated Solr connection configuration.
   */
  protected function setReadOnlyMode($configuration) {
    $configuration['overridden_by_acquia_search'] = ACQUIA_SEARCH_AUTO_OVERRIDE_READ_ONLY;
    return $configuration;
  }

  /**
   * {@inheritdoc}
   *
   * Acquia-specific: 'admin/info/system' path is protected by Acquia.
   * Use admin/system instead.
   */
  public function pingServer() {
    return $this->doPing(['handler' => 'admin/system'], 'server');
  }

  /**
   * {@inheritdoc}
   */
  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
    $form = parent::buildConfigurationForm($form, $form_state);
    unset($form['host']);
    unset($form['port']);
    unset($form['path']);
    unset($form['core']);
    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
    // Turn off connection check of parent class.
  }

  /**
   * {@inheritdoc}
   */
  protected function connect() {
    if (!$this->solr) {
      $this->solr = new Client();
      $this->solr->createEndpoint($this->configuration + [
        'key' => 'core',
        'port' => ($this->configuration['scheme'] == 'https') ? 443 : 80,
      ], TRUE);
      $this->attachServerEndpoint();
      $this->eventDispatcher = $this->solr->getEventDispatcher();
      $plugin = new SearchSubscriber();
      $this->solr->registerPlugin('acquia_solr_search_subscriber', $plugin);
      // Don't use curl.
      $this->solr->setAdapter('Solarium\Core\Client\Adapter\Http');
    }
  }

  /**
   * {@inheritdoc}
   */
  protected function getServerUri() {
    $this->connect();
    return $this->solr->getEndpoint('core')->getBaseUri();
  }

  /**
   * {@inheritdoc}
   *
   * Avoid providing an valid Update query if module determines this server
   * should be locked down (as indicated by the overridden_by_acquia_search
   * server option).
   */
  public function getUpdateQuery() {
    $this->connect();
    $overridden = $this->solr->getEndpoint('server')->getOption('overridden_by_acquia_search');
    if ($overridden === ACQUIA_SEARCH_AUTO_OVERRIDE_READ_ONLY) {
      $message = 'The Search API Server serving this index is currently in read-only mode.';
      \Drupal::logger('acquia search')->error($message);
      throw new \Exception($message);
    }
    return $this->solr->createUpdate();
  }

  /**
   * {@inheritdoc}
   */
  public function getCoreLink() {
    return $this->getServerLink();
  }

  /**
   * {@inheritdoc}
   */
  public function viewSettings() {
    $uri = Url::fromUri('http://www.acquia.com/products-services/acquia-search', array('absolute' => TRUE));
    drupal_set_message(t("Search is being provided by @as.", array('@as' => \Drupal::l(t('Acquia Search'), $uri))));
    return parent::viewSettings();
  }

}

redpajama_set_name: RedPajamaGithub


text:
@(form: Form[Login.PossibleClient])

@formInput(itype: String, attr: String, label: String, reuse: Boolean) = {

@label

<input type="@itype" name="@attr" id="@("input_"+attr)"
            value="@if(reuse){@form(attr).value}"
            class="form-control" required>

        @if(!form(attr).errors.isEmpty) {

          @for(error <- form(attr).errors) {
@error.message
}

}

}

<!DOCTYPE html>

  @head("IEDB - Signin")

      @top_bar()

      <form action="@routes.Login.authenticate" method="POST"
            class="form-signin" role="form">

Sign in

        @formInput("email",    "email",    "Email",    true)
        @formInput("password", "password", "Password", false)

<button class="btn btn-lg btn-primary btn-block"
                     type="submit">Sign in</button>

      </form>


text:
require 'spec_helper'

describe 'presence of various blocks in the manifest' do

  before :each do
    ;
  end

  it 'has various blocks in the manifest' do
    manifest = File.read( './manifests/init.pp' )

    exec_block_names = [ 'restart_ntp', 'restart_syslog', 'restart_snmp', 'load_nfs_config', 'change_nms_reporter', 'ses_check_flapping', 'enable_nfs' ]

    exec_block_names.each do |p|
      manifest.include?( p ).should eql true
    end
  end

end


text:
// @flow

import { utf8ToBase64 } from './common/base64';
import type { MapOf, LocaleFunctionT } from './common/types';

type MapOfLocaleFunctionsT = MapOf<LocaleFunctionT>;
type MapOfStringsT = MapOf<string>;
type MapOfMapOfLocaleFunctionsT = MapOf<MapOfLocaleFunctionsT>;

// Current locales
let _locales: MapOfLocaleFunctionsT = {};

// Caches
const allLocales: MapOfMapOfLocaleFunctionsT = {};
const allLocaleCode: MapOfStringsT = {};
const keyCache: MapOfStringsT = {};

const translate = (utf8: string, data: ?Object): string => {
  let base64 = keyCache[utf8];
  if (base64 == null) {
    base64 = utf8ToBase64(utf8);
    keyCache[utf8] = base64;
  }
  const fnTranslate = _locales[base64];
  let out;
  if (fnTranslate) {
    out = fnTranslate(data);
  } else {
    out = utf8;
    const contextSeparatorIndex = out.indexOf('_');
    if (contextSeparatorIndex >= 0) {
      out = out.substring(contextSeparatorIndex + 1, out.length);
    }
  }
  out = out.trim();
  return out;
};

const getLocaleOrLocaleCode = <T>(
  cache: MapOf<T>,
  initialLang: string
): { lang: ?string, result: ?T } => {
  let result = null;
  let lang = initialLang;
  while (!(result = cache[lang])) {
    lang = _t.getParentBcp47(lang);
    if (!lang) break;
  }
  return { lang, result };
};

const _t = translate;

_t.addLocales = (lang: string, locales: MapOfLocaleFunctionsT): void => {
  allLocales[lang] = locales;
};
_t.addLocaleCode = (lang: string, localeCode: string): void => {
  allLocaleCode[lang] = localeCode;
};

_t.setLocales = (langOrLocales: string | MapOfLocaleFunctionsT): ?string => {
  let out = null;
  if (typeof langOrLocales === 'string') {
    const { lang, result } = getLocaleOrLocaleCode(allLocales, langOrLocales);
    if (lang && result) _locales = result;
    out = lang;
  } else {
    _locales = langOrLocales;
  }
  return out;
};

_t.getLocales = (
  lang: string
): { lang: ?string, result: ?MapOfLocaleFunctionsT } =>
  getLocaleOrLocaleCode(allLocales, lang);
_t.getLocaleCode = (lang: string): { lang: ?string, result: ?string } =>
  getLocaleOrLocaleCode(allLocaleCode, lang);

_t.getParentBcp47 = (bcp47: string): ?string => {
  const tokens = bcp47.replace(/_/g, '-').split('-');
  if (tokens.length <= 1) return null;
  return tokens.slice(0, tokens.length - 1).join('-');
};

// =======================================
// Public API
// =======================================
module.exports = _t;


text:
// Copyright (c) 2011-2018 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <qt/transactiondesc.h>

#include <qt/bitcoinunits.h>
#include <qt/guiutil.h>
#include <qt/paymentserver.h>
#include <qt/transactionrecord.h>

#include <consensus/consensus.h>
#include <interfaces/node.h>
#include <key_io.h>
#include <validation.h>
#include


text:
from case import Case

class Case1_2_8(Case):

   DESCRIPTION = """Send binary message message with payload of length 65536. Sent out data in chops of 997 octets."""

   EXPECTATION = """Receive echo'ed binary message (with payload as sent). Clean close with normal code."""

   def onOpen(self):
      payload = "\xfe" * 65536
      self.expected[Case.OK] = [("message", payload, True)]
      self.expectedClose = {"closedByMe":True,"closeCode":[self.p.CLOSE_STATUS_CODE_NORMAL],"requireClean":True}
      self.p.sendFrame(opcode = 2, payload = payload, chopsize = 997)
      self.p.killAfter(10)


text:
package ajmas74.dxread;

public interface ColorMap {

    public int indexToRgb(int index);
}


text:
module Unveil
  class Rails
    module ViewHelper
      def lazy_image_tag(source, options = {})
        placeholder_source = options[:placeholder] || Unveil::Rails.config.default_placeholder
        options[:alt] = options[:alt] || image_alt(source)

        lazy_options = options.merge('data-src' => image_path(source))

        if options.has_key?(:retina)
          lazy_options['data-src-retina'] = image_path(options[:retina])
        end

        html = [image_tag(placeholder_source, lazy_options)]

        html << '<noscript>'
        html << image_tag(source, options)
        html << '</noscript>'

        html.join("\n").html_safe
      end
    end
  end
end


text:
/*
* Created by suemi on 2017/2/14.
*/

#include <cstring>
#include <cctype>
#include <vector>
#include <functional>
#include <cstdlib>
#include <sstream>
#include <cassert>
#include "slog/utils/string_util.h"

namespace slog {

std::string StringUtil::ToUpper(const std::string &str) {
  std::string res;
  using func = int (*)(int);
  std::transform(str.begin(), str.end(), std::back_inserter(res), (func) std::toupper);
  return res;
}

char StringUtil::ToUpper(char ch) {
  return (char) std::toupper(ch);
}

std::string StringUtil::ToLower(const std::string &str) {
  std::string res;
  using func = int (*)(int);
  std::transform(str.begin(), str.end(), std::back_inserter(res), (func) std::tolower);
  return res;
}

char StringUtil::ToLower(char ch) {
  return (char) std::tolower(ch);
}

template<class Iterator>
std::string StringUtil::Join(Iterator first, Iterator last, const std::string &sep) {
  std::string res;
  if (first != last) res = *first++;
  for (; first != last; ++first) {
    res += sep;
    res += *first;
  }
  return res;
}

std::string StringUtil::ConvertInt(int val) {
  return std::to_string(val);
}

bool StringUtil::ParseBool(bool &val, const std::string &str) {
  std::istringstream iss(str);
  std::string word;

  // Read a single "word".
  iss>>word;
  if (!iss)
    return false;

  // Following extraction of a character should fail
  // because there should only be a single "word".

  char ch;
  if (iss >> ch)
    return false;

  // Compare with "true" and "false".

  std::transform(word.begin(), word.end(), word.begin(), ::tolower);
  bool result = true;
  if (word == "true")
    val = true;
  else if (word == "false")
    val = false;

    // Try to interpret the "word" as a number.

  else {
    // Seek back to the start of stream.

    iss.clear();
    iss.seekg(0);
    assert(iss);

    // Extract value.

    long lval;
    iss >> lval;

    // The extraction should be successful and
    // following extraction of a characters should fail.

    result = !!iss && !(iss >> ch);
    if (result)
      val = !!lval;
  }

  return result;
}

int StringUtil::ParseInt(const std::string &str) {
  return std::stoi(str);
}

template<class OutputIterator>
void StringUtil::Tokenize(const std::string &str, char ch, OutputIterator out, bool collapse) {
  auto first = str.begin();
  auto last = first;
  for(;last!=str.end();++last){
    if(*last==ch){
      *out++ = std::string(first,last);
      if(collapse)
        for (; last != str.end() && *last == ch; ++last);

      if (last == str.end()) {
        first = last;
        break;
      } else
        first = *last == ch ? last + 1 : last;
    }
  }
  if(first!=last) *out = std::string(first,last);
}

std::vector<std::string> StringUtil::Split(const std::string &str, char sep) {
  std::vector<std::string> res;
  for(auto it=str.begin();it!=str.end();){
    auto tmp = std::find_if(it, str.end(), [sep](char ch) {
      return ch==sep;
    });
    res.push_back(std::string(it,tmp));
    it = tmp;
    if(it!=str.end()) ++it;
  }
  return res;
}

void StringUtil::LTrim(std::string &str) {
  str.erase(str.begin(), std::find_if_not(str.begin(), str.end(), std::ptr_fun<int, int>(std::isspace)));
}

void StringUtil::RTrim(std::string &str) {
  str.erase(std::find_if_not(str.rbegin(), str.rend(), std::ptr_fun<int, int>(std::isspace)).base(), str.end());
}

void StringUtil::Trim(std::string &str) {
  LTrim(str);
  RTrim(str);
}

void StringUtil::RemoveEmpty(std::vector<std::string> &components, unsigned int reserve) {
  components.erase(std::remove_if(components.begin()+reserve,components.end(),[](const std::string& str){
    return str.empty();
  }),components.end());
}

bool StringUtil::Environment(std::string &dst, const std::string &key) {
  auto val = std::getenv(key.c_str());
  if(val) dst = val;
  return !!val;
}

using VectorStringIterator = std::vector<std::string,std::allocator<std::string>>::iterator;
template std::string StringUtil::Join<VectorStringIterator>(VectorStringIterator first, VectorStringIterator last, const std::string &sep);

using VectorInsertIterator = std::back_insert_iterator<std::vector<std::string,std::allocator<std::string>> >;
template void StringUtil::Tokenize<VectorInsertIterator >(const std::string &str, char ch, VectorInsertIterator out, bool collapse);

}


text:
{% extends 'templates/layout.html' %}

{% block title %}Hosted App Starter{% endblock %}

{% block head %}
  {% parent %}
{% endblock %}

{% block content %}

Title Goes Here!

{% endblock %}


text:
//extern alias tpx;

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SharpTestsEx;
using Topics.Radical.ComponentModel;

namespace Test.Radical
{
    [TestClass()]
    public class GenericTimeStampTest : TimeStampTest
    {
        const Int32 VALUE = 1000;

        public override Timestamp CreateMock()
        {
            Timestamp<Int32> ts = new Timestamp<Int32>( VALUE );

            return this.CreateMock<Int32>( VALUE );
        }

        public Timestamp<T> CreateMock<T>( T initialValue )
        {
            Timestamp<T> ts = new Timestamp<T>( initialValue );

            return ts;
        }

        protected override void AssertGetHashCode( Timestamp ts )
        {
            unchecked
            {
                Timestamp<Int32> target = ( Timestamp<Int32> )ts;

                Int32 expected = ( target.Value * 35 ) ^ 73;
                Int32 actual = target.GetHashCode();

                Assert.AreEqual<Int32>( expected, actual );
            }
        }

        [TestMethod()]
        public void valueTest()
        {
            Timestamp ts = this.CreateMock();
            Timestamp<Int32> target = ( Timestamp<Int32> )ts;

            Int32 expected = VALUE;
            Int32 actual = target.Value;

            Assert.AreEqual<Int32>( expected, actual );
        }

        [TestMethod()]
        [ExpectedException( typeof( ArgumentNullException ) )]
        public void value_ctor_Test()
        {
            Timestamp<Object> target = this.CreateMock<Object>( null );
        }

        [TestMethod()]
        public void implicit_op_from_T_to_timeStamp()
        {
            Timestamp<Int32> target = VALUE;

            Assert.IsNotNull( target );
            Assert.AreEqual<Int32>( VALUE, target.Value );
        }

        [TestMethod()]
        public void implicit_op_from_timeStamp_to_T()
        {
            Timestamp<Int32> target = new Timestamp<int>( VALUE );
            Int32 actual = target;

            Assert.AreEqual<Int32>( VALUE, actual );
        }

        [TestMethod()]
        public void implicit_op_from_null_timeStamp_to_T()
        {
            Timestamp<Int32> target = null;
            Int32 actual = target;

            Assert.AreEqual<Int32>( 0, actual );
        }

        [TestMethod]
        public void genericTimeStamp_equals_to_null_timestamp_should_return_false()
        {
            Timestamp<Int32> target = new Timestamp<int>( VALUE );
            Boolean actual = target.Equals( ( Timestamp )null );

            actual.Should().Be.False();
        }

        [TestMethod]
        public void genericTimeStamp_equals_using_non_iComparbale_values_should_return_true_using_same_reference()
        {
            Object val = new Object();

            Timestamp<Object> v1 = new Timestamp<Object>( val );
            Timestamp<Object> v2 = new Timestamp<Object>( val );
            Boolean actual = v1.Equals( v2 );

            actual.Should().Be.True();
        }

        [TestMethod]
        public void genericTimeStamp_equals_using_non_iComparbale_values_should_return_false_using_different_reference()
        {
            Object val1 = new Object();
            Object val2 = new Object();

            Timestamp<Object> v1 = new Timestamp<Object>( val1 );
            Timestamp<Object> v2 = new Timestamp<Object>( val2 );
            Boolean actual = v1.Equals( v2 );

            actual.Should().Be.False();
        }
    }
}


text:
@implementation HMMessageBusiness

+ (void)readNewestCommonMsgFromServerWithFamilyId:(NSString *)familyId messageType:(HMMessageType)messageType completion:(commonBlockWithObject)completion {
    // 获得本地数据库中当前家庭普通消息的最大序号
    int maxUserSequence = [HMMessageCommonModel getMaxSequenceNumWithFamilyId:familyId messageType:messageType];
    [self readCommonMsgBetweenMinSequence:maxUserSequence andMaxSequence:-1 familyId:familyId messageType:messageType completion:completion];
}

+ (void)readNewestSecurityMsgFromServerWithFamilyId:(NSString *)familyId completion:(commonBlockWithObject)completion {
    // 获得本地数据库中当前家庭安防消息的最大序号
    int maxUserSequence =  [HMMessageSecurityModel getMaxSequenceNumWithFamilyld:familyId];
    [self readSecurityMsgBetweenMinSequence:maxUserSequence andMaxSequence:-1 familyId:familyId completion:completion];
}

+ (void)readSecurityMsgBetweenMinSequence:(int)minSe andMaxSequence:(int)maxSe familyId:(NSString *)familyId completion:(commonBlockWithObject)completion {
    if (!isNetworkAvailable()) {
        if (completion) {
            completion(KReturnValueNetWorkProblem,nil);
        }
        return;
    }
    QueryUserMessage *cmd = [QueryUserMessage object];
    cmd.userId = userAccout().userId;
    cmd.familyId = familyId;
    cmd.tableName = @"messageSecurity";
    cmd.maxSequence = maxSe;
    cmd.minSequence = minSe;
    cmd.readCount = kHMMessageAPI_PerReadCount;
    cmd.sendToServer = YES;
    sendCmd(cmd, ^(KReturnValue returnValue, NSDictionary *returnDic) {
        if (returnValue == KReturnValueSuccess) {
            NSArray *statusRecordArr = returnDic[@"data"];
            for (NSDictionary *dic in statusRecordArr) {
                if (dic && [dic isKindOfClass:[NSDictionary class]]) {
                    HMMessageSecurityModel *model = [HMMessageSecurityModel objectFromDictionary:dic];
                    model.readType = 0;
                    [model insertObject];
                }
            }
            if (completion) {
                completion(returnValue,returnDic);
            }
        }
    });

}

+ (void)readNewStatusRecordWithSecurityDevice:(HMDevice *)device completion:(commonBlockWithObject)completion {
    if (![device isKindOfClass:[HMDevice class]]) {
        if (completion) {
            completion(KReturnValueParameterError,nil);
        }
        return;
    }
    if (!isNetworkAvailable()) {
        if (completion) {
            completion(KReturnValueNetWorkProblem,nil);
        }
        return;
    }
    int minSequence = (int)[HMStatusRecordModel getLastDeleteSequence:device recordType:StatusRecordTypeAll];
    QueryStatusRecordCmd *qsrCmd = [QueryStatusRecordCmd object];
    qsrCmd.deviceId = device.deviceId;
    qsrCmd.maxSequence = -1;
    qsrCmd.minSequence = minSequence;
    qsrCmd.readCount = kHMMessageAPI_PerReadCount;
    qsrCmd.userName = userAccout().userName;
    qsrCmd.uid = device.uid;
    qsrCmd.sendToServer = YES;
    sendCmd(qsrCmd, ^(KReturnValue returnValue, NSDictionary *returnDic) {

        if (returnValue == KReturnValueSuccess) {
            [HMDatabaseManager insertInTransactionWithHandler:^(NSMutableArray *objectArray) {
                NSArray *statusRecordArr = returnDic[@"statusRecordList"];
                if ([statusRecordArr isKindOfClass:[NSArray class]]) {

                    for (NSDictionary *dic in statusRecordArr) {
                        HMStatusRecordModel *model = [HMStatusRecordModel objectFromDictionary:dic];
                        model.readType = 1;
//                        [model insertObject];
                        [objectArray addObject:model];
                    }

                }
            } completion:^{
                if (completion) {
                    completion(returnValue,returnDic);
                }
            }];
        }
    });
}

+ (void)readOldCommonMsgBeforeSequence:(int)sequence familyId:(NSString *)familyId messageType:(HMMessageType)messageType completion:(commonBlockWithObject)completion {
    int maxDeleteSequence = [HMMessageCommonModel getMaxDeleteSequenceWithFamilyId:familyId messageType:messageType];
    if (sequence <= maxDeleteSequence) {
        DLog(@"打算请求序号:%d以前的数据  最大删除序号:%d 不再请求小于最大删除序号的数据",sequence,maxDeleteSequence);
    }
    [self readCommonMsgBetweenMinSequence:maxDeleteSequence andMaxSequence:sequence familyId:familyId messageType:messageType completion:completion];
}

+ (void)readCommonMsgBetweenMinSequence:(int)minSe andMaxSequence:(int)maxSe familyId:(NSString *)familyId messageType:(HMMessageType)messageType completion:(commonBlockWithObject)completion {
    if (!isNetworkAvailable()) {
        if (completion) {
            completion(KReturnValueNetWorkProblem,nil);
        }
        return;
    }
    QueryUserMessage *qurCmd = [QueryUserMessage object];
    qurCmd.userId = userAccout().userId;
    qurCmd.familyId = familyId;
    qurCmd.tableName = @"messageCommon";
    qurCmd.minSequence = minSe;
    qurCmd.maxSequence = maxSe;
    qurCmd.type = (int)messageType;
    qurCmd.readCount = kHMMessageAPI_PerReadCount;
    qurCmd.sendToServer = YES;
    sendCmd(qurCmd, ^(KReturnValue returnValue, NSDictionary *returnDic) {
        DLog(@"读messageCommon表返回数据:%@",returnDic);

        NSString *tableName = returnDic[@"tableName"];
        if ([tableName isKindOfClass:[NSString class]] && [tableName isEqualToString:@"messageCommon"]) {

            NSArray *commonMsgArr = returnDic[@"data"];

            if ([commonMsgArr isKindOfClass:[NSArray class]]) {

                if (commonMsgArr.count) {

                    [[HMDatabaseManager shareDatabase]inSerialQueue:^{

                        NSMutableArray *objectsArray = [NSMutableArray array];

                        for (NSDictionary *msgDic in commonMsgArr) {

                            //DLog(@"msgDic  : %@",msgDic);
                            HMMessageCommonModel *model = [HMMessageCommonModel objectFromDictionary:msgDic];
                            NSString *paramStr = [msgDic objectForKey:@"params"];
                            if (paramStr != nil && ![paramStr isEqual:[NSNull null]]) {
                                NSData *jsonData = [paramStr dataUsingEncoding:NSUTF8StringEncoding];
                                if (jsonData.length) {
                                    NSDictionary *paramStrDic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingAllowFragments error:nil];
                                    if (paramStrDic) {
                                        id deviceNameObj = [paramStrDic objectForKey:@"deviceName"];
                                        id roomNameObj = [paramStrDic objectForKey:@"roomName"];

                                        if ([deviceNameObj isKindOfClass:[NSString class]]) {
                                            model.deviceName = deviceNameObj;
                                        }else {
                                            model.deviceName = @"";
                                        }
                                        if ([roomNameObj isKindOfClass:[NSString class]]) {
                                            model.roomName = roomNameObj;
                                        }else {
                                            model.roomName = @"";
                                        }
                                    }
                                }
                            }
                            [model sql];
                            [objectsArray addObject:model];
                        }

                        [[HMDatabaseManager shareDatabase]inTransaction:^(FMDatabase *db, BOOL *rollback) {

                            [objectsArray setValue:db forKey:@"insertWithDb"];

                            if (completion) {

                                dispatch_async(dispatch_get_main_queue(), ^{
                                    completion(returnValue,returnDic);
                                });
                            }
                        }];

                    }];

                }
            }
        }
    });

}

@end


text:
package com.airbnb.aerosolve.core.images;

import com.airbnb.aerosolve.core.FeatureVector;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.awt.image.BufferedImage;
import java.util.Map;
import java.util.List;

import static org.junit.Assert.assertTrue;

public class ImageFeatureExtractorTest {
  private static final Logger log = LoggerFactory.getLogger(ImageFeatureExtractorTest.class);

  public void validateFeature(Map<String, List<Double>> denseFeatures,
                              String name,
                              int expectedCount) {
    assertTrue(denseFeatures.containsKey(name));
    assertTrue(denseFeatures.get(name).size() == expectedCount);
    log.info("feature " + name + "[0] = " + denseFeatures.get(name).get(0));
  }

  public void validateFeatureVector(FeatureVector featureVector) {
    Map<String, List<Double>> denseFeatures = featureVector.getDenseFeatures();
    assertTrue(denseFeatures != null);
    assertTrue(denseFeatures.containsKey("rgb"));
    final int kNumGrids = 1 + 4 + 16;
    validateFeature(denseFeatures, "rgb", 512 * kNumGrids);
    validateFeature(denseFeatures, "hog", 9 * kNumGrids);
    validateFeature(denseFeatures, "lbp", 256 * kNumGrids);
    validateFeature(denseFeatures, "hsv", 65 * kNumGrids);
  }

  @Test
  public void testBlackImage() {
    BufferedImage image = new BufferedImage(10, 10, BufferedImage.TYPE_BYTE_GRAY);
    ImageFeatureExtractor featureExtractor = ImageFeatureExtractor.getInstance();
    FeatureVector featureVector = featureExtractor.getFeatureVector(image);
    validateFeatureVector(featureVector);
  }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Branch Demo Page</title>
    <meta name="viewport" content="width=device-width">
    <meta name="description" content="Branch Demo Page">
    <meta name="author" content="Mike Kwon">
    <link rel="alternate" type="application/rss+xml" title="RSS" href="/feed.xml">

    <meta name="branch:deeplink:productId" content="1234" />
    <meta name="branch:deeplink:productId" content="5678" />
    <meta name="branch:deeplink:$ios_deeplink_path" content="branch tags do not take priority over others" />
    <meta name="twitter:app:url:iphone" content="this is a Twitter tag that's used for $ios_deeplink_path. Since it's listed later than Branch's $ios_deeplink_path tag, this value is used by Branch's scraper">

    <link rel="stylesheet" href="/style.css">

    <link rel="stylesheet" href="/css/font-awesome/css/font-awesome.min.css">
    <link href="//fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href="//fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                Branch Demo

                        Top Section

                        Middle Section

                        Bottom Section

                        Branch Journeys Demo

                        Testpage displaying a Journeys Banner

                        <button onclick="launchBranchJourney()" onmouseover="" style="cursor: pointer; border-radius: 12px; background-color: #008CBA; border: none; color: white; padding: 12px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19); width:100%; margin: 5px 0px 5px 0px;">Click to Launch Banner</button>
                        <button onclick="closeBranchJourney()" onmouseover="" style="cursor: pointer; border-radius: 12px; background-color: #008CBA; border: none; color: white; padding: 12px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19); width:100%; margin: 5px 0px 5px 0px;">Click to Close Banner</button>

The banner is built in Branch's Dashboard

The web SDK must be embedded in the page HTML

The web SDK uses HuffPost's Test API key

To prevent the banner from overlapping with the page's fixed nav bar, a special Branch div is embedded as the first child element of the nav bar.  This div can be retrieved from the dashboard template editor

Dismissing the banner will hide the banner from that user for a set timeframe (customizable in the dashboard)

The banner's "Get|Open" button will recognize if the user has the app (app must have the same API key)

Banner button clicks will always pass in the referring page's URL in the link data, under a key called "$canonical_url"

Filler Text

Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem

Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem

Filler Text

Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem

Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem

Branch Demo Page

                        Contact mkwon@branch.io for questions


text:
package com.dominichenko.pet.gwt.phys2d.client.collisions;

import com.dominichenko.pet.gwt.phys2d.client.gameplay.GameScene;
import com.dominichenko.pet.gwt.phys2d.client.gameplay.sprites.Sprite;

/**
 * Simple polygon-related collision detector.
 * It detects collisions between sprites, taking into account following assumptions:
 *

 *
Collidable sprites should have the collision polygons for detection.

 *
All polygons that are liable for detection must be convex.

 *
World bounds are also a polygon, but with inverted normals.

 *

 *
See Polygon Collision for theory.

 *
 * @author Maxim Dominichenko
 */
public class PolygonCollisionDetector extends AbstractCollisionDetector {

	@Override
	protected boolean testForCollisions(Sprite sprite1, Sprite sprite2) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	protected boolean testForCollisions(Sprite sprite, GameScene gameScene) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void computeCollision(Sprite sprite1, Sprite sprite2) {
		// TODO Auto-generated method stub
	}

	@Override
	public void computeCollision(Sprite sprite, GameScene gameScene) {
		// TODO Auto-generated method stub

	}
}


text:
<?php

namespace ZawidawieInfo\PagerBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class ZawidawieInfoPagerBundle extends Bundle
{
    public function getParent()
    {
        return 'WhiteOctoberPagerfantaBundle';
    }
}


text:
Provides the information that the `fdesetup -outputplist` flag returns

The table provides the following information per client:

+ EnabledDate - The data FileVault was enabled
+ EnabledUser - Users added to the EFI login (authorized to unlock the drive)
+ LVGUUID - (CoreStorage) Logical Volume Group UUID
+ LVUUID - (CoreStorage) Logical Volume UUID
+ PVUUID - (CoreStorage) Physical Volume UUID
+ RecoveryKey -  The personal recovery key
+ Also added is HddSerial - The serial number of the hard drive

# Remarks

The workflow:

1. Manually run the script that enables FileVault
   A sample script can be found in /app/modules/filevault_escrow/script/
   Note: This script isn't automatically downloaded by the client. Feel free to customize this script for your own needs.

 The sample script does the following:
 * Preforms some sanity checks such as making sure the OS is at least 10.8, Munkireport is installed,
FileVault isn't already on and a recovery partition present.

 * Saves the FileVault escrow data to /tmp/fvresults.plist
This file will automatically be deleted when the Mac is rebooted

 * Sets a filevault_escrow key to the MunkiReport.plist preference and removes the key after the escrow data is uploaded

 * Uploads the escrow data by running /usr/local/munki/postflight

2. Reboot the Mac to start the encryption
    * FileVault status and the account name(s) of the enabled users will not be collected until the next munki run after the reboot

# Dependencies

This module is dependent on the filevault_status model to provide the current status of FileVault and to list the user accounts who are authorized to unlock the drive

# To do

+ Add a section to the FileVault kickoff script to read the database and confirm the recovery key is safe before the Mac is rebooted.


text:
title: "Wind blowing blue green skies"
excerpt: "PaperFaces portrait of @joelmartinez drawn with Paper for iOS on an iPad."
image:
  path: &image /assets/images/paperfaces-joelmartinez-2-twitter.jpg
  feature: *image
  thumbnail: /assets/images/paperfaces-joelmartinez-2-twitter-150.jpg
categories: [paperfaces]
tags: [portrait, illustration, Paper for iOS, beard, time lapse]
---

PaperFaces portrait of project donator [@joelmartinez](https://twitter.com/joelmartinez). Check out the making of video capture below where I compress a hour's worth of drawing in Paper for iOS into 5 minutes.

{% include_cached boilerplate/paperfaces-2.md %}

{% youtube WjmQYBgHjFI %}


text:
package com.kaylerrenslow.armaplugin.lang.sqf.syntax;

import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Kayler
 * @since 06/11/2016
 */
public class BasicValueHolder implements ValueHolder {

	private boolean optional;

	private final ValueType type;
	private final String description;
	private final List<String> literals;

	public BasicValueHolder(@NotNull ValueType type, @NotNull String description, boolean optional) {
		this(type, description, optional, new ArrayList<>());
	}

	public BasicValueHolder(@NotNull ValueType type, @NotNull String description, boolean optional, @NotNull List<String> literals) {
		this.type = new PolymorphicWrapperValueType(type);
		this.description = description.trim();
		this.optional = optional;
		this.literals = literals;
	}

	@Override
	@NotNull
	public ValueType getType() {
		return type;
	}

	@Override
	@NotNull
	public String getDescription() {
		return description;
	}

	@Override
	public boolean isOptional() {
		return optional;
	}

	@NotNull
	public List<String> getLiterals() {
		return literals;
	}
}