text:
namespace v8 {
namespace internal {
namespace wasm {

namespace {

using CacheKey =
    std::tuple<uint32_t, uint32_t, const WasmModule*, const WasmModule*>;

struct CacheKeyHasher {
  size_t operator()(CacheKey key) const {
    static constexpr size_t large_prime = 14887;
    return std::get<0>(key) + (std::get<1>(key) * large_prime) +
           (reinterpret_cast<size_t>(std::get<2>(key)) * large_prime *
            large_prime) +
           (reinterpret_cast<size_t>(std::get<3>(key)) * large_prime *
            large_prime * large_prime);
  }
};

class TypeJudgementCache {
 public:
  TypeJudgementCache()
      : zone_(new AccountingAllocator(), "type judgement zone"),
        subtyping_cache_(&zone_),
        type_equivalence_cache_(&zone_) {}

  static TypeJudgementCache* instance() {
    static base::LazyInstance<TypeJudgementCache>::type instance_ =
        LAZY_INSTANCE_INITIALIZER;
    return instance_.Pointer();
  }

  base::RecursiveMutex* type_cache_mutex() { return &type_cache_mutex_; }
  bool is_cached_subtype(uint32_t subtype, uint32_t supertype,
                         const WasmModule* sub_module,
                         const WasmModule* super_module) const {
    return subtyping_cache_.count(std::make_tuple(
               subtype, supertype, sub_module, super_module)) == 1;
  }
  void cache_subtype(uint32_t subtype, uint32_t supertype,
                     const WasmModule* sub_module,
                     const WasmModule* super_module) {
    subtyping_cache_.emplace(subtype, supertype, sub_module, super_module);
  }
  void uncache_subtype(uint32_t subtype, uint32_t supertype,
                       const WasmModule* sub_module,
                       const WasmModule* super_module) {
    subtyping_cache_.erase(
        std::make_tuple(subtype, supertype, sub_module, super_module));
  }
  bool is_cached_equivalent_type(uint32_t type1, uint32_t type2,
                                 const WasmModule* module1,
                                 const WasmModule* module2) const {
    if (type1 > type2) std::swap(type1, type2);
    if (reinterpret_cast<uintptr_t>(module1) >
        reinterpret_cast<uintptr_t>(module2)) {
      std::swap(module1, module2);
    }
    return type_equivalence_cache_.count(
               std::make_tuple(type1, type2, module1, module2)) == 1;
  }
  void cache_type_equivalence(uint32_t type1, uint32_t type2,
                              const WasmModule* module1,
                              const WasmModule* module2) {
    if (type1 > type2) std::swap(type1, type2);
    if (reinterpret_cast<uintptr_t>(module1) >
        reinterpret_cast<uintptr_t>(module2)) {
      std::swap(module1, module2);
    }
    type_equivalence_cache_.emplace(type1, type2, module1, module2);
  }
  void uncache_type_equivalence(uint32_t type1, uint32_t type2,
                                const WasmModule* module1,
                                const WasmModule* module2) {
    if (type1 > type2) std::swap(type1, type2);
    if (reinterpret_cast<uintptr_t>(module1) >
        reinterpret_cast<uintptr_t>(module2)) {
      std::swap(module1, module2);
    }
    type_equivalence_cache_.erase(
        std::make_tuple(type1, type2, module1, module2));
  }

 private:
  Zone zone_;
  ZoneUnorderedSet<CacheKey, CacheKeyHasher>
      // Cache for discovered subtyping pairs.
      subtyping_cache_,
      // Cache for discovered equivalent type pairs.
      // Indexes and modules are stored in increasing order.
      type_equivalence_cache_;
  // The above two caches are used from background compile jobs, so they
  // must be protected from concurrent modifications:
  base::RecursiveMutex type_cache_mutex_;
};

bool ArrayEquivalentIndices(uint32_t type_index_1, uint32_t type_index_2,
                            const WasmModule* module1,
                            const WasmModule* module2) {
  const ArrayType* sub_array = module1->types[type_index_1].array_type;
  const ArrayType* super_array = module2->types[type_index_2].array_type;
  if (sub_array->mutability() != super_array->mutability()) return false;

  // Temporarily cache type equivalence for the recursive call.
  TypeJudgementCache::instance()->cache_type_equivalence(
      type_index_1, type_index_2, module1, module2);
  if (EquivalentTypes(sub_array->element_type(), super_array->element_type(),
                      module1, module2)) {
    return true;
  } else {
    TypeJudgementCache::instance()->uncache_type_equivalence(
        type_index_1, type_index_2, module1, module2);
    // TODO(7748): Consider caching negative results as well.
    return false;
  }
}

bool StructEquivalentIndices(uint32_t type_index_1, uint32_t type_index_2,
                             const WasmModule* module1,
                             const WasmModule* module2) {
  const StructType* sub_struct = module1->types[type_index_1].struct_type;
  const StructType* super_struct = module2->types[type_index_2].struct_type;

  if (sub_struct->field_count() != super_struct->field_count()) {
    return false;
  }

  // Temporarily cache type equivalence for the recursive call.
  TypeJudgementCache::instance()->cache_type_equivalence(
      type_index_1, type_index_2, module1, module2);
  for (uint32_t i = 0; i < sub_struct->field_count(); i++) {
    if (sub_struct->mutability(i) != super_struct->mutability(i) ||
        !EquivalentTypes(sub_struct->field(i), super_struct->field(i), module1,
                         module2)) {
      TypeJudgementCache::instance()->uncache_type_equivalence(
          type_index_1, type_index_2, module1, module2);
      return false;
    }
  }
  return true;
}

bool FunctionEquivalentIndices(uint32_t type_index_1, uint32_t type_index_2,
                               const WasmModule* module1,
                               const WasmModule* module2) {
  const FunctionSig* sig1 = module1->types[type_index_1].function_sig;
  const FunctionSig* sig2 = module2->types[type_index_2].function_sig;

  if (sig1->parameter_count() != sig2->parameter_count() ||
      sig1->return_count() != sig2->return_count()) {
    return false;
  }

  auto iter1 = sig1->all();
  auto iter2 = sig2->all();

  // Temporarily cache type equivalence for the recursive call.
  TypeJudgementCache::instance()->cache_type_equivalence(
      type_index_1, type_index_2, module1, module2);
  for (int i = 0; i < iter1.size(); i++) {
    if (!EquivalentTypes(iter1[i], iter2[i], module1, module2)) {
      TypeJudgementCache::instance()->uncache_type_equivalence(
          type_index_1, type_index_2, module1, module2);
      return false;
    }
  }
  return true;
}

V8_INLINE bool EquivalentIndices(uint32_t index1, uint32_t index2,
                                 const WasmModule* module1,
                                 const WasmModule* module2) {
  DCHECK(index1 != index2 || module1 != module2);
  uint8_t kind1 = module1->type_kinds[index1];

  if (kind1 != module2->type_kinds[index2]) return false;

  base::RecursiveMutexGuard type_cache_access(
      TypeJudgementCache::instance()->type_cache_mutex());
  if (TypeJudgementCache::instance()->is_cached_equivalent_type(
          index1, index2, module1, module2)) {
    return true;
  }

  if (kind1 == kWasmStructTypeCode) {
    return StructEquivalentIndices(index1, index2, module1, module2);
  } else if (kind1 == kWasmArrayTypeCode) {
    return ArrayEquivalentIndices(index1, index2, module1, module2);
  } else {
    DCHECK_EQ(kind1, kWasmFunctionTypeCode);
    return FunctionEquivalentIndices(index1, index2, module1, module2);
  }
}

bool StructIsSubtypeOf(uint32_t subtype_index, uint32_t supertype_index,
                       const WasmModule* sub_module,
                       const WasmModule* super_module) {
  const StructType* sub_struct = sub_module->types[subtype_index].struct_type;
  const StructType* super_struct =
      super_module->types[supertype_index].struct_type;

  if (sub_struct->field_count() < super_struct->field_count()) {
    return false;
  }

  TypeJudgementCache::instance()->cache_subtype(subtype_index, supertype_index,
                                                sub_module, super_module);
  for (uint32_t i = 0; i < super_struct->field_count(); i++) {
    bool sub_mut = sub_struct->mutability(i);
    bool super_mut = super_struct->mutability(i);
    if (sub_mut != super_mut ||
        (sub_mut &&
         !EquivalentTypes(sub_struct->field(i), super_struct->field(i),
                          sub_module, super_module)) ||
        (!sub_mut && !IsSubtypeOf(sub_struct->field(i), super_struct->field(i),
                                  sub_module, super_module))) {
      TypeJudgementCache::instance()->uncache_subtype(
          subtype_index, supertype_index, sub_module, super_module);
      return false;
    }
  }
  return true;
}

bool ArrayIsSubtypeOf(uint32_t subtype_index, uint32_t supertype_index,
                      const WasmModule* sub_module,
                      const WasmModule* super_module) {
  const ArrayType* sub_array = sub_module->types[subtype_index].array_type;
  const ArrayType* super_array =
      super_module->types[supertype_index].array_type;
  bool sub_mut = sub_array->mutability();
  bool super_mut = super_array->mutability();
  TypeJudgementCache::instance()->cache_subtype(subtype_index, supertype_index,
                                                sub_module, super_module);
  if (sub_mut != super_mut ||
      (sub_mut &&
       !EquivalentTypes(sub_array->element_type(), super_array->element_type(),
                        sub_module, super_module)) ||
      (!sub_mut &&
       !IsSubtypeOf(sub_array->element_type(), super_array->element_type(),
                    sub_module, super_module))) {
    TypeJudgementCache::instance()->uncache_subtype(
        subtype_index, supertype_index, sub_module, super_module);
    return false;
  } else {
    return true;
  }
}

// TODO(7748): Expand this with function subtyping once the hiccups
// with 'exact types' have been cleared.
bool FunctionIsSubtypeOf(uint32_t subtype_index, uint32_t supertype_index,
                         const WasmModule* sub_module,
                         const WasmModule* super_module) {
  return FunctionEquivalentIndices(subtype_index, supertype_index, sub_module,
                                   super_module);
}

}  // namespace

// TODO(7748): Extend this with any-heap subtyping.
V8_NOINLINE V8_EXPORT_PRIVATE bool IsSubtypeOfImpl(
    ValueType subtype, ValueType supertype, const WasmModule* sub_module,
    const WasmModule* super_module) {
  DCHECK(subtype != supertype || sub_module != super_module);

  // This function checks for subtyping based on the kind of subtype.

  if (!subtype.is_reference_type()) return subtype == supertype;

  if (subtype.kind() == ValueType::kRtt) {
    return subtype.heap_type().is_generic()
               ? subtype == supertype
               : (supertype.kind() == ValueType::kRtt &&
                  subtype.depth() == supertype.depth() &&
                  EquivalentIndices(subtype.ref_index(), supertype.ref_index(),
                                    sub_module, super_module));
  }

  DCHECK(subtype.is_object_reference_type());

  bool compatible_references = subtype.kind() == ValueType::kOptRef
                                   ? supertype.kind() == ValueType::kOptRef
                                   : supertype.is_object_reference_type();
  if (!compatible_references) return false;

  DCHECK(supertype.is_object_reference_type());

  // Now check that sub_heap and super_heap are subtype-related.

  HeapType sub_heap = subtype.heap_type();
  HeapType super_heap = supertype.heap_type();

  if (sub_heap.representation() == HeapType::kI31 &&
      super_heap.representation() == HeapType::kEq) {
    return true;
  }
  if (sub_heap.is_generic()) return sub_heap == super_heap;

  DCHECK(sub_heap.is_index());
  uint32_t sub_index = sub_heap.ref_index();
  DCHECK(sub_module->has_type(sub_index));

  if (super_heap.representation() == HeapType::kEq) {
    return !sub_module->has_signature(sub_heap.ref_index());
  }
  if (super_heap.representation() == HeapType::kFunc) {
    return sub_module->has_signature(sub_heap.ref_index());
  }
  if (super_heap.is_generic()) return false;

  DCHECK(super_heap.is_index());
  uint32_t super_index = super_heap.ref_index();
  DCHECK(super_module->has_type(super_index));

  uint8_t sub_kind = sub_module->type_kinds[sub_index];

  if (sub_kind != super_module->type_kinds[super_index]) return false;

  // Accessing the caches for subtyping and equivalence from multiple background
  // threads is protected by a lock.
  base::RecursiveMutexGuard type_cache_access(
      TypeJudgementCache::instance()->type_cache_mutex());
  if (TypeJudgementCache::instance()->is_cached_subtype(
          sub_index, super_index, sub_module, super_module)) {
    return true;
  }

  if (sub_kind == kWasmStructTypeCode) {
    return StructIsSubtypeOf(sub_index, super_index, sub_module, super_module);
  } else if (sub_kind == kWasmArrayTypeCode) {
    return ArrayIsSubtypeOf(sub_index, super_index, sub_module, super_module);
  } else {
    DCHECK_EQ(sub_kind, kWasmFunctionTypeCode);
    return FunctionIsSubtypeOf(sub_index, super_index, sub_module,
                               super_module);
  }
}

V8_NOINLINE bool EquivalentTypes(ValueType type1, ValueType type2,
                                 const WasmModule* module1,
                                 const WasmModule* module2) {
  if (type1 == type2 && module1 == module2) return true;
  if (!type1.has_index()) return type1 == type2;
  if (type1.kind() != type2.kind()) return false;

  DCHECK(type1.has_index() && type2.has_index() &&
         (type1 != type2 || module1 != module2));

  DCHECK_IMPLIES(type1.has_depth(), type2.has_depth());  // Due to 'if' above
  if (type1.has_depth() && type1.depth() != type2.depth()) return false;

  DCHECK(type1.has_index() && module1->has_type(type1.ref_index()) &&
         type2.has_index() && module2->has_type(type2.ref_index()));

  return EquivalentIndices(type1.ref_index(), type2.ref_index(), module1,
                           module2);
}

ValueType CommonSubtype(ValueType a, ValueType b, const WasmModule* module) {
  if (a == b) return a;
  if (IsSubtypeOf(a, b, module)) return a;
  if (IsSubtypeOf(b, a, module)) return b;
  return kWasmBottom;
}

}  // namespace wasm
}  // namespace internal
}  // namespace v8


text:
package com.brainacad.module_2.LabWork_2_17;

/**
 * Created by a.zemlyanskiy on 05.09.2016.
 * Create new project called  TestThread2.
 * Add package "com.brainacad.oop.testthread2".
 * In this exercise, you will create a simple counting thread. It will count to 10, pausing
 * one second between each number. Also, in keeping with the counting theme, it will
 * output a string every ten numbers.
 * 1. Create a class MySumCount which extends the Thread class.
 * 2. Add to class  MySumCount  two integer fields "startIndex" and "stopIndex" with setters and getters.
 * 3. Add to class  MySumCount  new field as array of integer type and setter for it;
 * 4. Add to class  MySumCount  new field "resultSum" of long type and getter for it;
 * Override the run()  method of Thread. Add code to calculate sum of array elements from startIndex to stopIndex and save result to resultSum field.
 * Create a class Main with a main( ) method.
 * Add to method main() code that declares local variable "myArray" as array of integer type (of 1000 size), and create two instancees of MySumCount.
 * Add code to fill all elements of myArray with random integer values generated from 0 to 1000 range.
 * Add code to calculates sum of myArray elements in two separate thread and then print result to console.
 * Execute the program.
 * The program output must be like next example:
 * [324,234,523,…,643]
 * Sum of array elements: 123457
 */
public class Lab_Work_2_17_3 {
}

redpajama_set_name: RedPajamaGithub


text:
var playerOneTurn = true;
var findWhiteKing;
var startPos;
var whiteCheckMate = false;
var blackCheckMate = false;
var whiteCheck = false;
var blackCheck = false;
var whiteCancelCastle = false;
var blackCancelCastle = false;
var saveRowObject = {};
var saveRowArray = [];
var saveSquareObject = {};

var playerTurn = function() {
  whiteCheck = false;
  blackCheck = false;
  saveRowObject = {};

  $( ".chess-piece" ).draggable({
    helper: "clone",
    start: function( event, ui ){
        startPos = $(this).parent();
        if($(this).attr("class") === "white-pawn white-piece chess-piece ui-draggable ui-draggable-handle" || $(this).attr("class") === "black-pawn black-piece chess-piece ui-draggable ui-draggable-handle") {
          pawnAction();
        }
        else if($(this).attr("class") === "white-rook white-piece chess-piece ui-draggable ui-draggable-handle" || $(this).attr("class") === "black-rook black-piece chess-piece ui-draggable ui-draggable-handle") {
          rookAction();
        }
        else if($(this).attr("class") === "white-knight white-piece chess-piece ui-draggable ui-draggable-handle" || $(this).attr("class") === "black-knight black-piece chess-piece ui-draggable ui-draggable-handle") {
          knightAction();
        }
        else if($(this).attr("class") === "white-king white-piece chess-piece ui-draggable ui-draggable-handle" || $(this).attr("class") === "black-king black-piece chess-piece ui-draggable ui-draggable-handle") {
          kingAction();
        }
        else if($(this).attr("class") === "white-bishop white-piece chess-piece ui-draggable ui-draggable-handle" || $(this).attr("class") === "black-bishop black-piece chess-piece ui-draggable ui-draggable-handle") {
          bishopAction();
        }
        else if($(this).attr("class") === "white-queen white-piece chess-piece ui-draggable ui-draggable-handle" || $(this).attr("class") === "black-queen black-piece chess-piece ui-draggable ui-draggable-handle") {
          queenAction();
        };
    }
  });
  if(playerOneTurn === true) {
     $( ".white-piece" ).draggable( "enable" );
     $( ".black-piece" ).draggable( "disable" );
     playerOneTurn = false;
  }
  else {
     $( ".white-piece" ).draggable( "disable" );
     $( ".black-piece" ).draggable( "enable" );
     playerOneTurn = true;
  };
};

$(document).ready(function() {

  loadGame();
  saveGame();
  playerTurn();
  setInterval(checkOnCheck, 2000);

});


text:
<?php
// split_federation.php
require_once 'bootstrap.php';

$shardManager->splitFederation(60);


text:
<?php

namespace Zend\Stdlib\Hydrator\Strategy;

final class ExplodeStrategy implements StrategyInterface
{
    /**
     * @var string
     */
    private $valueDelimiter;

    /**
     * @var int|null
     */
    private $explodeLimit;

    /**
     * Constructor
     *
     * @param string   $delimiter    String that the values will be split upon
     * @param int|null $explodeLimit Explode limit
     */
    public function __construct($delimiter = ',', $explodeLimit = null)
    {
        $this->setValueDelimiter($delimiter);

        $this->explodeLimit = ($explodeLimit === null) ? null : (int) $explodeLimit;
    }

    /**
     * Sets the delimiter string that the values will be split upon
     *
     * @param  string $delimiter
     * @return self
     */
    private function setValueDelimiter($delimiter)
    {
        if (!is_string($delimiter)) {
            throw new Exception\InvalidArgumentException(sprintf(
                '%s expects Delimiter to be string, %s provided instead',
                __METHOD__,
                is_object($delimiter) ? get_class($delimiter) : gettype($delimiter)
            ));
        }

        if (empty($delimiter)) {
            throw new Exception\InvalidArgumentException('Delimiter cannot be empty.');
        }

        $this->valueDelimiter = $delimiter;
    }

    /**
     * {@inheritDoc}
     *
     * Split a string by delimiter
     *
     * @param string|null $value
     *
     * @return string[]
     *
     * @throws Exception\InvalidArgumentException
     */
    public function hydrate($value)
    {
        if (null === $value) {
            return [];
        }

        if (!(is_string($value) || is_numeric($value))) {
            throw new Exception\InvalidArgumentException(sprintf(
                '%s expects argument 1 to be string, %s provided instead',
                __METHOD__,
                is_object($value) ? get_class($value) : gettype($value)
            ));
        }

        if ($this->explodeLimit !== null) {
            return explode($this->valueDelimiter, $value, $this->explodeLimit);
        }

        return explode($this->valueDelimiter, $value);
    }

    /**
     * {@inheritDoc}
     *
     * Join array elements with delimiter
     *
     * @param string[] $value The original value.
     *
     * @return string|null
     */
    public function extract($value)
    {
        if (!is_array($value)) {
            throw new Exception\InvalidArgumentException(sprintf(
                '%s expects argument 1 to be array, %s provided instead',
                __METHOD__,
                is_object($value) ? get_class($value) : gettype($value)
            ));
        }

        return empty($value) ? null : implode($this->valueDelimiter, $value);
    }
}


text:
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;

namespace SourceBrowser.Generator
{
    public static class Utilities
    {
        /// <summary>
        /// Creates a relative path from one file or folder to another.
        /// </summary>
        /// <param name="fromPath">Contains the directory that defines the start of the relative path.</param>
        /// <param name="toPath">Contains the path that defines the endpoint of the relative path.</param>
        /// <returns>The relative path from the start directory to the end path.</returns>
        /// <exception cref="ArgumentNullException"></exception>
        /// <exception cref="UriFormatException"></exception>
        /// <exception cref="InvalidOperationException"></exception>
        public static String MakeRelativePath(String fromPath, String toPath)
        {
            if (String.IsNullOrEmpty(fromPath)) throw new ArgumentNullException("fromPath");
            if (String.IsNullOrEmpty(toPath)) throw new ArgumentNullException("toPath");

            fromPath = Path.GetFullPath(fromPath);
            toPath = Path.GetFullPath(toPath);

            Uri fromUri = new Uri(fromPath);
            Uri toUri = new Uri(toPath);

            if (fromUri.Scheme != toUri.Scheme) { return toPath; } // path can't be made relative.

            Uri relativeUri = fromUri.MakeRelativeUri(toUri);
            String relativePath = Uri.UnescapeDataString(relativeUri.ToString());

            if (toUri.Scheme.ToUpperInvariant() == "FILE")
            {
                relativePath = relativePath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
            }

            return relativePath;
        }

        public static string GetHash(string result)
        {
            result = GetMD5Hash(result, 16);
            return result;
        }
        static string GetMD5Hash(string input, int digits)
        {
            using (var md5 = MD5.Create())
            {
                var bytes = Encoding.UTF8.GetBytes(input);
                var hashBytes = md5.ComputeHash(bytes);
                return ByteArrayToHexString(hashBytes, digits);
            }
        }
        static string ByteArrayToHexString(byte[] bytes, int digits = 0)
        {
            if (digits == 0)
            {
                digits = bytes.Length * 2;
            }

            char[] c = new char[digits];
            byte b;
            for (int i = 0; i < digits / 2; i++)
            {
                b = ((byte)(bytes[i] >> 4));
                c[i * 2] = (char)(b > 9 ? b + 87 : b + 0x30);
                b = ((byte)(bytes[i] & 0xF));
                c[i * 2 + 1] = (char)(b > 9 ? b + 87 : b + 0x30);
            }

            return new string(c);
        }
    }
}


text:
package org.apache.karaf.packages.core.internal;

import org.apache.karaf.packages.core.internal.filter.AndExpression;
import org.apache.karaf.packages.core.internal.filter.Expression;
import org.apache.karaf.packages.core.internal.filter.FilterParser;
import org.apache.karaf.packages.core.internal.filter.NotExpression;
import org.apache.karaf.packages.core.internal.filter.SimpleItem;

/**
 * Helps to parse the expression
 *
 * This class is internal to hide the FilterParser in the PackageService api
 */
class ImportDetails {
    String name;
    String minVersion;
    String maxVersion;

    public ImportDetails(String filter) {
        Expression filterExpr = new FilterParser().parse(filter);
        if (filterExpr instanceof AndExpression) {
            AndExpression andExpr = (AndExpression)filterExpr;
            for (Expression expr : andExpr.expressions) {
                parseSimpleItem(expr);
            }
        }
        parseSimpleItem(filterExpr);
    }

    private void parseSimpleItem(Expression expr) {
        if (expr instanceof SimpleItem) {
            SimpleItem simpleItem = (SimpleItem)expr;
            if ("osgi.wiring.package".equals(simpleItem.attr)) {
                this.name = simpleItem.value;
            }
            if ("version".equals(simpleItem.attr)) {
                this.minVersion = simpleItem.value;
            }
        }
        if (expr instanceof NotExpression) {
            SimpleItem simpleItem = (SimpleItem)((NotExpression)expr).expression;
            this.maxVersion = simpleItem.value;
        }
    }
}


text:
<?php
/**
 *
 *
 * @author Roman Piták <roman@pitak.net>
 *
 */

namespace DotMailer\Api\Rest;

final class ConflictException extends Exception
{

}


text:
<!DOCTYPE HTML>

			<title>Johnny's Journeys - Authors</title>
			<meta http-equiv="content-type" content="text/html; charset=utf-8" />
			<meta charset="utf-8" />
			<link href="http://johnnysjourneys.com/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Johnny's Journeys Full Atom Feed" />
			<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,900,300italic" rel="stylesheet" />
				<link rel="stylesheet" href="/theme/css/pygment.css" />

				<link rel="stylesheet" href="/theme/css/skel-noscript.css" />
				<link rel="stylesheet" href="/theme/css/style.css" />
				<link rel="stylesheet" href="/theme/css/style-desktop.css" />

Johnny's Journeys

About Me

Contact

Archives

Authors on Johnny's Journeys

Jonathan Colon (3)

Latest articles

											Jan 10

Don't Fear The Lisp

Functional Programming, Seriously?

Let, me start this off by saying this, the exercises I have done this week already make me want to
explore the language even further. the language I am referring to, of course, is Clojure. Just in case
you don't know it is part of the ...

											Jan 03

The Road To Rethink

In The Beginning.

Learning a new language has its ups and its downs, but one thing that always holds true is, once you understand it fully you feel so accomplished. The languages I am referring to are formal languages, languages like Python. This is the language I chose to learn ...

											Jan 03

The Journey Begins

Where Do I Begin?

My name is Jonathan Colon, and over the past year or so I have been developing in Python.
I love developing in Python, and just programming in general. That is why I have made it my mission
to learn more languages, mainly C and Clojure. I ...

What's this all about?

										It's about my life and my coding journey!

												Find out more

Blogroll

Python.org

CodeNewbie

Categories

Clojure

Databases

My Thoughts

Contact

Twitter

Mail

johnc@johnnysjourneys.com

© Jonathan Colon

Images: Dreametry Doodle + Iconify.it

Design: HTML5 UP


text:
<?php
class logToCSV
{
    const CSV_LOCATION = 'log.csv';

    private $__errorObject;

    public function __construct($errorObject)
    {
        $this->__errorObject = $errorObject;
    }

    public function write()
    {
        $line = $this->__errorObject->getErrorNumber();
        $line .= ',';
        $line .= $this->__errorObject->getErrorText();
        $line .= "\n";

        file_put_contents(self::CSV_LOCATION, $line, FILE_APPEND);
    }
}
?>


text:
<?php

namespace DinnerBundle\Loader;

use DinnerBundle\Entity\Guest;
use DinnerBundle\Repository\GuestRepository;
use Doctrine\ORM\EntityManager;
use Symfony\Component\Console\Output\OutputInterface;

class YKP implements Loader
{
    /** @var EntityManager */
    private $em;

    /** @var GuestRepository */
    private $repository;

    public function __construct(EntityManager $em)
    {
        $this->em = $em;
        $this->repository = $this->em->getRepository('DinnerBundle:Guest');
    }

    public function load(array $row, OutputInterface $output): void
    {
        $guest = $this->matchOnId($row) ?: $this->matchOnNames($row) ?: new Guest();
        $this->updateGuest($row, $guest);

        $output->writeln('Updating guest ' . $guest->__toString());

        $this->em->persist($guest);
    }

    private function matchOnId(array $row): ?Guest
    {
        return $this->repository->findOneBy(['ykpId' => $row['ykpId']]);
    }

    private function matchOnNames(array $row): ?Guest
    {
        return $this->repository->findOneBy([
            'familyName' => $row['familyName'],
            'hisName' => $row['hisName'],
            'herName' => $row['herName'],
        ]);
    }

    private function updateGuest(array $row, Guest $guest)
    {
        $guest->familyName = $guest->familyName ?: $row['familyName'];
        $guest->hisName = $guest->hisName ?: $row['hisName'];
        $guest->herName = $guest->herName ?: $row['herName'];
        $guest->ykpId = $guest->ykpId ?: $row['ykpId'];

        $guest->streetAddress = $row['streetAddress'];
        $guest->city = $row['city'];
        $guest->state = $row['state'];
        $guest->zip = $row['zip'];
        $guest->phone = $row['phone'];
    }
}


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

namespace i18n.Domain.Entities
{
	/// <summary>
	/// All the data that one translation one item can contain. Apart from Id (which is the string to translate) and Message (which is the translation) it contains some meta data. This is linked from Translation that ties many of these items together for a complete language
	/// </summary>
	public class TranslationItem
	{
		//todo: The po specification actually says that if you want to multiline the message (and possibly the id) it should looks like this
		//"this is line 1 of comment \n""
		//"this is line two"
		//this of course means that messages needs to be a collection and the POTranslationRepository's parse and save functions needs to be updated.
		//this should preferably be decided upon and fixed before anyone writes a database repository

		public string MsgKey { get; set; }
		public string MsgId { get; set; }
		public string Message { get; set; }
		public IEnumerable<string> References { get; set; }
		public IEnumerable<string> ExtractedComments { get; set; }
		public IEnumerable<string> TranslatorComments { get; set; }
		public IEnumerable<string> Flags { get; set; }

        public override string ToString()
        {
            return MsgKey;
        }
	}
}


text:
const {
  Parser,
  DomHandler
} = require('stricter-htmlparser2')

module.exports = function parse(sourceCode) {
  const handler = new DomHandler()
  new Parser(handler, {
    xmlMode: false,
    lowerCaseAttributeNames: false,
    recognizeSelfClosing: true,
    lowerCaseTags: false
  }).end(sourceCode)
  return {
    type: 'tag',
    name: 'root',
    attribs: {},
    children: Array.isArray(handler.dom) ? handler.dom : [handler.dom]
  }
}


text:
SHELL := /bin/bash

ESP_IDF_VERSION := "v4.4"

fmt:
	clang-format -i ./*.c ./*.h -style="{BasedOnStyle: Google, ColumnLimit: 120, SortIncludes: false}"
	clang-format -i ./test/main/*.c -style="{BasedOnStyle: Google, ColumnLimit: 120, SortIncludes: false}"

prepare:
	git clone --recursive  https://github.com/espressif/esp-idf.git test/esp-idf
	cd test/esp-idf; git fetch; git checkout $(ESP_IDF_VERSION)
	cd test/esp-idf/; git submodule update --recursive --init

update:
	cd test/esp-idf; git fetch; git checkout $(ESP_IDF_VERSION)
	cd test/esp-idf/; git submodule update --recursive --init

install:
	export IDF_TOOLS_PATH=$(shell pwd)/test/tools; cd test/esp-idf; ./install.sh esp32

config:
	export IDF_TOOLS_PATH=$(shell pwd)/test/tools; . test/esp-idf/export.sh; cd test; idf.py menuconfig

erase:
	export IDF_TOOLS_PATH=$(shell pwd)/test/tools; . test/esp-idf/export.sh; cd test; idf.py erase-flash

clean:
	export IDF_TOOLS_PATH=$(shell pwd)/test/tools; . test/esp-idf/export.sh; cd test; idf.py clean

build:
	export IDF_TOOLS_PATH=$(shell pwd)/test/tools; . test/esp-idf/export.sh; cd test; idf.py build

flash:
	export IDF_TOOLS_PATH=$(shell pwd)/test/tools; . test/esp-idf/export.sh;  cd test; idf.py flash

monitor:
	export IDF_TOOLS_PATH=$(shell pwd)/test/tools; . test/esp-idf/export.sh;  cd test; idf.py monitor

simple-monitor:
	@clear
	miniterm.py /dev/cu.SLAB_USBtoUART 115200 --rts 0 --dtr 0 --raw --exit-char 99

run: build flash monitor


text:
#Now the "geeky" md5 hash and archiving is disabled. It was of no practical use, really.

from datetime import datetime

classes = ["JSONSpecObject.js", "Ship.js", "Structure.js", "Hull.js", "BaseObject.js", "DerivedObject.js", "ShipState.js", "StateModule.js", "WaveCreator.js", "WaveMotion.js", "Positioning.js", "Manoeuvring.js", "FuelConsumption.js", "HullResistance.js", "PropellerInteraction.js"]
fileIO = ["browseShip.js", "loadShip.js", "downloadShip.js"]
math = ["Vectors.js", "interpolation.js", "areaCalculations.js", "volumeCalculations.js", "parametricWeightParsons.js", "combineWeights.js"]
filepaths = list(map((lambda filename: "../source/math/"+filename), math)) \
            + list(map((lambda filename: "../source/classes/"+filename), classes)) \
            + list(map((lambda filename: "../source/fileIO/"+filename), fileIO))

code = """
/*
Import like this in HTML:
<script src="vessel.js"></script>
Then in javascript use classes and functions with a vessel prefix. Example:
let ship = new vessel.Ship(someSpecification);
*/

"use strict";

var vessel = {};
var Vessel = vessel; //alias for backwards compatibility

(function() {
"""

for filepath in filepaths:
    file = open(filepath)
    code += file.read()
    file.close()

#This interface is currently very restricted.
#We can also include access to all of the functions.
#I just don't want to maintain a long list manually.
#Maybe there is an easier way...
code += """
Object.assign(vessel, {
	/*JSONSpecObject: JSONSpecObject,*/
	Ship: Ship,
	Structure: Structure,
	Hull: Hull,
	BaseObject: BaseObject,
	DerivedObject: DerivedObject,
	ShipState: ShipState,
	StateModule: StateModule,
	WaveCreator: WaveCreator,
	WaveMotion: WaveMotion,
	Positioning: Positioning,
	FuelConsumption: FuelConsumption,
	HullResistance: HullResistance,
	Manoeuvring: Manoeuvring,
	PropellerInteraction: PropellerInteraction,
	browseShip: browseShip,
	loadShip: loadShip,
	downloadShip: downloadShip,
        f: {
            linearFromArrays: linearFromArrays,
            bilinear: bilinear,
            bisectionSearch
        },
        Vectors: Vectors
});
})();
"""

timestamp = str(datetime.today())
#from hashlib import md5

# codehash = md5(code.encode()).hexdigest()

header = "//vessel.js library, built " + timestamp# + ", Checksum: " + codehash

output = header + code

# stamp = timestamp[0:17] + "." + codehash[0:5]
stamp = timestamp[0:17]

oFile = open("../build/vessel.js", "w")
oFile.write(output)
oFile.close()
# oFile = open("archive/vessel_"+stamp.replace("-","").replace(":","").replace(" ","")+".js", "w")
# oFile.write(output)
# oFile.close()


text:
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from libunity.djinni

#include "NativeIAccountsController.hpp"  // my header
#include "Marshal.hpp"
#include "NativeAccountRecord.hpp"
#include "NativeBalanceRecord.hpp"
#include "NativeIAccountsListener.hpp"
#include "NativeMutationRecord.hpp"
#include "NativeTransactionRecord.hpp"

namespace djinni_generated {

NativeIAccountsController::NativeIAccountsController() : ::djinni::JniInterface<::IAccountsController, NativeIAccountsController>("com/gulden/jniunifiedbackend/IAccountsController$CppProxy") {}

NativeIAccountsController::~NativeIAccountsController() = default;

CJNIEXPORT void JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_nativeDestroy(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef)
{
    try {
        DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
        delete reinterpret_cast<::djinni::CppProxyHandle<::IAccountsController>*>(nativeRef);
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}

CJNIEXPORT void JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_setListener(JNIEnv* jniEnv, jobject /*this*/, jobject j_accountslistener)
{
    try {
        DJINNI_FUNCTION_PROLOGUE0(jniEnv);
        ::IAccountsController::setListener(::djinni_generated::NativeIAccountsListener::toCpp(jniEnv, j_accountslistener));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}

CJNIEXPORT jobject JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_listAccounts(JNIEnv* jniEnv, jobject /*this*/)
{
    try {
        DJINNI_FUNCTION_PROLOGUE0(jniEnv);
        auto r = ::IAccountsController::listAccounts();
        return ::djinni::release(::djinni::List<::djinni_generated::NativeAccountRecord>::fromCpp(jniEnv, r));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}

CJNIEXPORT jboolean JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_setActiveAccount(JNIEnv* jniEnv, jobject /*this*/, jstring j_accountUUID)
{
    try {
        DJINNI_FUNCTION_PROLOGUE0(jniEnv);
        auto r = ::IAccountsController::setActiveAccount(::djinni::String::toCpp(jniEnv, j_accountUUID));
        return ::djinni::release(::djinni::Bool::fromCpp(jniEnv, r));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}

CJNIEXPORT jstring JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_getActiveAccount(JNIEnv* jniEnv, jobject /*this*/)
{
    try {
        DJINNI_FUNCTION_PROLOGUE0(jniEnv);
        auto r = ::IAccountsController::getActiveAccount();
        return ::djinni::release(::djinni::String::fromCpp(jniEnv, r));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}

CJNIEXPORT jstring JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_createAccount(JNIEnv* jniEnv, jobject /*this*/, jstring j_accountName, jstring j_accountType)
{
    try {
        DJINNI_FUNCTION_PROLOGUE0(jniEnv);
        auto r = ::IAccountsController::createAccount(::djinni::String::toCpp(jniEnv, j_accountName),
                                                      ::djinni::String::toCpp(jniEnv, j_accountType));
        return ::djinni::release(::djinni::String::fromCpp(jniEnv, r));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}

CJNIEXPORT jstring JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_getAccountName(JNIEnv* jniEnv, jobject /*this*/, jstring j_accountUUID)
{
    try {
        DJINNI_FUNCTION_PROLOGUE0(jniEnv);
        auto r = ::IAccountsController::getAccountName(::djinni::String::toCpp(jniEnv, j_accountUUID));
        return ::djinni::release(::djinni::String::fromCpp(jniEnv, r));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}

CJNIEXPORT jboolean JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_renameAccount(JNIEnv* jniEnv, jobject /*this*/, jstring j_accountUUID, jstring j_newAccountName)
{
    try {
        DJINNI_FUNCTION_PROLOGUE0(jniEnv);
        auto r = ::IAccountsController::renameAccount(::djinni::String::toCpp(jniEnv, j_accountUUID),
                                                      ::djinni::String::toCpp(jniEnv, j_newAccountName));
        return ::djinni::release(::djinni::Bool::fromCpp(jniEnv, r));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}

CJNIEXPORT jboolean JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_deleteAccount(JNIEnv* jniEnv, jobject /*this*/, jstring j_accountUUID)
{
    try {
        DJINNI_FUNCTION_PROLOGUE0(jniEnv);
        auto r = ::IAccountsController::deleteAccount(::djinni::String::toCpp(jniEnv, j_accountUUID));
        return ::djinni::release(::djinni::Bool::fromCpp(jniEnv, r));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}

CJNIEXPORT jboolean JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_purgeAccount(JNIEnv* jniEnv, jobject /*this*/, jstring j_accountUUID)
{
    try {
        DJINNI_FUNCTION_PROLOGUE0(jniEnv);
        auto r = ::IAccountsController::purgeAccount(::djinni::String::toCpp(jniEnv, j_accountUUID));
        return ::djinni::release(::djinni::Bool::fromCpp(jniEnv, r));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}

CJNIEXPORT jstring JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_getAccountLinkURI(JNIEnv* jniEnv, jobject /*this*/, jstring j_accountUUID)
{
    try {
        DJINNI_FUNCTION_PROLOGUE0(jniEnv);
        auto r = ::IAccountsController::getAccountLinkURI(::djinni::String::toCpp(jniEnv, j_accountUUID));
        return ::djinni::release(::djinni::String::fromCpp(jniEnv, r));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}

CJNIEXPORT jstring JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_getWitnessKeyURI(JNIEnv* jniEnv, jobject /*this*/, jstring j_accountUUID)
{
    try {
        DJINNI_FUNCTION_PROLOGUE0(jniEnv);
        auto r = ::IAccountsController::getWitnessKeyURI(::djinni::String::toCpp(jniEnv, j_accountUUID));
        return ::djinni::release(::djinni::String::fromCpp(jniEnv, r));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}

CJNIEXPORT jstring JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_createAccountFromWitnessKeyURI(JNIEnv* jniEnv, jobject /*this*/, jstring j_witnessKeyURI, jstring j_newAccountName)
{
    try {
        DJINNI_FUNCTION_PROLOGUE0(jniEnv);
        auto r = ::IAccountsController::createAccountFromWitnessKeyURI(::djinni::String::toCpp(jniEnv, j_witnessKeyURI),
                                                                       ::djinni::String::toCpp(jniEnv, j_newAccountName));
        return ::djinni::release(::djinni::String::fromCpp(jniEnv, r));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}

CJNIEXPORT jstring JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_getReceiveAddress(JNIEnv* jniEnv, jobject /*this*/, jstring j_accountUUID)
{
    try {
        DJINNI_FUNCTION_PROLOGUE0(jniEnv);
        auto r = ::IAccountsController::getReceiveAddress(::djinni::String::toCpp(jniEnv, j_accountUUID));
        return ::djinni::release(::djinni::String::fromCpp(jniEnv, r));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}

CJNIEXPORT jobject JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_getTransactionHistory(JNIEnv* jniEnv, jobject /*this*/, jstring j_accountUUID)
{
    try {
        DJINNI_FUNCTION_PROLOGUE0(jniEnv);
        auto r = ::IAccountsController::getTransactionHistory(::djinni::String::toCpp(jniEnv, j_accountUUID));
        return ::djinni::release(::djinni::List<::djinni_generated::NativeTransactionRecord>::fromCpp(jniEnv, r));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}

CJNIEXPORT jobject JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_getMutationHistory(JNIEnv* jniEnv, jobject /*this*/, jstring j_accountUUID)
{
    try {
        DJINNI_FUNCTION_PROLOGUE0(jniEnv);
        auto r = ::IAccountsController::getMutationHistory(::djinni::String::toCpp(jniEnv, j_accountUUID));
        return ::djinni::release(::djinni::List<::djinni_generated::NativeMutationRecord>::fromCpp(jniEnv, r));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}

CJNIEXPORT jobject JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_getActiveAccountBalance(JNIEnv* jniEnv, jobject /*this*/)
{
    try {
        DJINNI_FUNCTION_PROLOGUE0(jniEnv);
        auto r = ::IAccountsController::getActiveAccountBalance();
        return ::djinni::release(::djinni_generated::NativeBalanceRecord::fromCpp(jniEnv, r));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}

CJNIEXPORT jobject JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_getAccountBalance(JNIEnv* jniEnv, jobject /*this*/, jstring j_accountUUID)
{
    try {
        DJINNI_FUNCTION_PROLOGUE0(jniEnv);
        auto r = ::IAccountsController::getAccountBalance(::djinni::String::toCpp(jniEnv, j_accountUUID));
        return ::djinni::release(::djinni_generated::NativeBalanceRecord::fromCpp(jniEnv, r));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}

CJNIEXPORT jobject JNICALL Java_com_gulden_jniunifiedbackend_IAccountsController_00024CppProxy_getAllAccountBalances(JNIEnv* jniEnv, jobject /*this*/)
{
    try {
        DJINNI_FUNCTION_PROLOGUE0(jniEnv);
        auto r = ::IAccountsController::getAllAccountBalances();
        return ::djinni::release(::djinni::Map<::djinni::String, ::djinni_generated::NativeBalanceRecord>::fromCpp(jniEnv, r));
    } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}

}  // namespace djinni_generated


text:
'use strict';

module.exports = function(num) {
  if (typeof num === 'number') {
    return num - num === 0;
  }
  if (typeof num === 'string' && num.trim() !== '') {
    return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
  }
  return false;
};


text:
<?php
/*
Layout File, at least one main region must be added;
 */

$extended= true;

include __DIR__ . "/single-full.php";


text:
set :application, 'kabuofx'
set :repo_url, 'https://github.com/tmurakam/kabuofx.git'

# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }

set :deploy_to, '/home/rails/kabuofx'
set :scm, :git

# set :format, :pretty
# set :log_level, :debug
# set :pty, true

set :linked_files, %w{config/database.yml}
set :linked_dirs, %w{log public/ofx}
# set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

# set :default_env, { path: "/opt/ruby/bin:$PATH" }
# set :keep_releases, 5

namespace :deploy do

  desc 'Restart application'
  task :restart do
    on roles(:app), in: :sequence, wait: 5 do
      # Your restart mechanism here, for example:
      execute :mkdir, '-p', release_path.join('tmp')
      execute :touch, release_path.join('tmp/restart.txt')
    end
  end

  after :restart, :clear_cache do
    on roles(:web), in: :groups, limit: 3, wait: 10 do
      # Here we can do anything such as:
      # within release_path do
      #   execute :rake, 'cache:clear'
      # end
    end
  end

  after :finishing, 'deploy:cleanup'

end


text:
void sun3_cmp_byte(struct sun3 *);
void sun3_cmp_word(struct sun3 *);
void sun3_cmp_long(struct sun3 *);


text:
using IntelliTect.Coalesce.CodeGeneration.Generation;
using IntelliTect.Coalesce.TypeDefinition;
using System;
using System.Collections.Generic;
using System.Text;
using IntelliTect.Coalesce.CodeGeneration.Knockout.BaseGenerators;
using IntelliTect.Coalesce.Utilities;
using IntelliTect.Coalesce.Knockout.Helpers;
using System.Linq;
using IntelliTect.Coalesce.DataAnnotations;
using IntelliTect.Coalesce.Knockout.TypeDefinition;

namespace IntelliTect.Coalesce.CodeGeneration.Knockout.Generators
{
    public class CreateEditView : KnockoutViewGenerator
    {
        public CreateEditView(GeneratorServices services) : base(services) { }

        public override void BuildOutput(HtmlCodeBuilder b)
        {
            using (b.TagBlock("style"))
            {
                b.Lines(
                    "img.form-control-static {",
                    "    max-width: 100px;",
                    "    max-height: 100px;",
                    "}",
                    ".coalesce-upload-icon {",
                    "    cursor: pointer;",
                    "}"
                );
            }

            string viewModelsNamespace = "ViewModels";
            if (!string.IsNullOrWhiteSpace(AreaName))
            {
                viewModelsNamespace = AreaName + "." + viewModelsNamespace;
            }
            if (!string.IsNullOrWhiteSpace(ModulePrefix))
            {
                viewModelsNamespace = ModulePrefix + "." + viewModelsNamespace;
            }

            using (b.TagBlock("div", "card"))
            {
                using (b.TagBlock("div", "card-heading"))
                {
                    using (b.TagBlock("div", "btn-group pull-right"))
                    {
                        b.Line("<button onclick=\"window.history.back()\" class=\"btn btn-xs btn-default\"> Back</button>");
                        b.Line("<button data-bind=\"click:function() { load(); }\" class=\"btn btn-xs btn-default\"> Refresh</button>");
                    }
                    b.Line($"
{Model.DisplayName}
");
                    b.Line("Loading...");
                }

                using (b.TagBlock("div", "card-body").TagBlock("div", "form-horizontal"))
                {
                    using (b.TagBlock("div", "form-group btn-warning", dataBind: "if: errorMessage(), visible: errorMessage()", style: "display: none"))
                    {
                        b.Line("Error");
                        b.Line("
");
                        b.Indented("

");
                        b.Line("
");
                    }

                    foreach (var prop in Model.ClientProperties.Where(f => !f.IsHidden(HiddenAttribute.Areas.Edit)).OrderBy(f => f.EditorOrder))
                    {
                        using (b.TagBlock("div", "form-group"))
                        {
                            b.Line($"{prop.DisplayName}");
                            if (prop.IsPOCO && prop.PureTypeOnContext)
                            {
                                b.Line(Display.PropertyHelperWithSurroundingDiv(prop, !prop.IsReadOnly, AreaName, 7));
                                b.Line($"
");
                                b.Indented("");
                                b.Line("
");
                            }
                            else
                            {
                                b.Line(Display.PropertyHelperWithSurroundingDiv(prop, !prop.IsReadOnly, AreaName, 8));
                            }
                        }
                    }
                }
            }

            b.Line();
            WriteMethodsCard(b, Model.ClientMethods.Where(f => !f.IsStatic));

            b.Line();
            foreach (var method in Model.ClientMethods.Where(f => !f.IsStatic && f.ClientParameters.Any()))
            {
                b.Line(IntelliTect.Coalesce.Knockout.Helpers.Knockout.ModalFor(method).ToString());
            }

            b.Line();
            b.Line("@section Scripts");
            b.Line("{");
            b.Line("");
            b.Line("}");
        }

        ///
        /// Gets the methods that should be automatically invoked when their URL changes.
        /// The effect of this is that methods that download a file that we can detect changes in (via VaryByProperty)
        /// get auto loaded. If they're images or videos, they'll get rendered in the method result area.
        ///
        /// <returns></returns>
        public IEnumerable<MethodViewModel> GetFileAutoDownloadMethods()
        {
            // TODO: We could add HTTP HEAD support to file-returning GET endpoints
            // and then look at the size on the client to determine if an auto-download is practical.

            return Model.ClientMethods.Where(m =>
                m.IsModelInstanceMethod &&
                m.ResultType.IsFile &&
                m.ApiActionHttpMethod == HttpMethod.Get &&
                m.VaryByProperty?.IsClientProperty == true &&
                !m.ClientParameters.Any()
            );
        }
    }
}


text:
#include "curl_setup.h"

#ifndef CURL_DISABLE_GOPHER

#include "urldata.h"
#include <curl/curl.h>
#include "transfer.h"
#include "sendf.h"
#include "connect.h"
#include "progress.h"
#include "gopher.h"
#include "select.h"
#include "strdup.h"
#include "vtls/vtls.h"
#include "url.h"
#include "escape.h"
#include "warnless.h"
#include "curl_printf.h"
#include "curl_memory.h"
/* The last #include file should be: */
#include "memdebug.h"

/*
 * Forward declarations.
 */

static CURLcode gopher_do(struct Curl_easy *data, bool *done);
#ifdef USE_SSL
static CURLcode gopher_connect(struct Curl_easy *data, bool *done);
static CURLcode gopher_connecting(struct Curl_easy *data, bool *done);
#endif

/*
 * Gopher protocol handler.
 * This is also a nice simple template to build off for simple
 * connect-command-download protocols.
 */

const struct Curl_handler Curl_handler_gopher = {
  "GOPHER",                             /* scheme */
  ZERO_NULL,                            /* setup_connection */
  gopher_do,                            /* do_it */
  ZERO_NULL,                            /* done */
  ZERO_NULL,                            /* do_more */
  ZERO_NULL,                            /* connect_it */
  ZERO_NULL,                            /* connecting */
  ZERO_NULL,                            /* doing */
  ZERO_NULL,                            /* proto_getsock */
  ZERO_NULL,                            /* doing_getsock */
  ZERO_NULL,                            /* domore_getsock */
  ZERO_NULL,                            /* perform_getsock */
  ZERO_NULL,                            /* disconnect */
  ZERO_NULL,                            /* readwrite */
  ZERO_NULL,                            /* connection_check */
  ZERO_NULL,                            /* attach connection */
  PORT_GOPHER,                          /* defport */
  CURLPROTO_GOPHER,                     /* protocol */
  CURLPROTO_GOPHER,                     /* family */
  PROTOPT_NONE                          /* flags */
};

#ifdef USE_SSL
const struct Curl_handler Curl_handler_gophers = {
  "GOPHERS",                            /* scheme */
  ZERO_NULL,                            /* setup_connection */
  gopher_do,                            /* do_it */
  ZERO_NULL,                            /* done */
  ZERO_NULL,                            /* do_more */
  gopher_connect,                       /* connect_it */
  gopher_connecting,                    /* connecting */
  ZERO_NULL,                            /* doing */
  ZERO_NULL,                            /* proto_getsock */
  ZERO_NULL,                            /* doing_getsock */
  ZERO_NULL,                            /* domore_getsock */
  ZERO_NULL,                            /* perform_getsock */
  ZERO_NULL,                            /* disconnect */
  ZERO_NULL,                            /* readwrite */
  ZERO_NULL,                            /* connection_check */
  ZERO_NULL,                            /* attach connection */
  PORT_GOPHER,                          /* defport */
  CURLPROTO_GOPHERS,                    /* protocol */
  CURLPROTO_GOPHER,                     /* family */
  PROTOPT_SSL                           /* flags */
};

static CURLcode gopher_connect(struct Curl_easy *data, bool *done)
{
  (void)data;
  (void)done;
  return CURLE_OK;
}

static CURLcode gopher_connecting(struct Curl_easy *data, bool *done)
{
  struct connectdata *conn = data->conn;
  CURLcode result = Curl_ssl_connect(data, conn, FIRSTSOCKET);
  if(result)
    connclose(conn, "Failed TLS connection");
  *done = TRUE;
  return result;
}
#endif

static CURLcode gopher_do(struct Curl_easy *data, bool *done)
{
  CURLcode result = CURLE_OK;
  struct connectdata *conn = data->conn;
  curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
  char *gopherpath;
  char *path = data->state.up.path;
  char *query = data->state.up.query;
  char *sel = NULL;
  char *sel_org = NULL;
  timediff_t timeout_ms;
  ssize_t amount, k;
  size_t len;
  int what;

  *done = TRUE; /* unconditionally */

  /* path is guaranteed non-NULL */
  DEBUGASSERT(path);

  if(query)
    gopherpath = aprintf("%s?%s", path, query);
  else
    gopherpath = strdup(path);

  if(!gopherpath)
    return CURLE_OUT_OF_MEMORY;

  /* Create selector. Degenerate cases: / and /1 => convert to "" */
  if(strlen(gopherpath) <= 2) {
    sel = (char *)"";
    len = strlen(sel);
    free(gopherpath);
  }
  else {
    char *newp;

    /* Otherwise, drop / and the first character (i.e., item type) ... */
    newp = gopherpath;
    newp += 2;

    /* ... and finally unescape */
    result = Curl_urldecode(newp, 0, &sel, &len, REJECT_ZERO);
    free(gopherpath);
    if(result)
      return result;
    sel_org = sel;
  }

  k = curlx_uztosz(len);

  for(;;) {
    /* Break out of the loop if the selector is empty because OpenSSL and/or
       LibreSSL fail with errno 0 if this is the case. */
    if(strlen(sel) < 1)
      break;

    result = Curl_write(data, sockfd, sel, k, &amount);
    if(!result) { /* Which may not have written it all! */
      result = Curl_client_write(data, CLIENTWRITE_HEADER, sel, amount);
      if(result)
        break;

      k -= amount;
      sel += amount;
      if(k < 1)
        break; /* but it did write it all */
    }
    else
      break;

    timeout_ms = Curl_timeleft(data, NULL, FALSE);
    if(timeout_ms < 0) {
      result = CURLE_OPERATION_TIMEDOUT;
      break;
    }
    if(!timeout_ms)
      timeout_ms = TIMEDIFF_T_MAX;

    /* Don't busyloop. The entire loop thing is a work-around as it causes a
       BLOCKING behavior which is a NO-NO. This function should rather be
       split up in a do and a doing piece where the pieces that aren't
       possible to send now will be sent in the doing function repeatedly
       until the entire request is sent.
    */
    what = SOCKET_WRITABLE(sockfd, timeout_ms);
    if(what < 0) {
      result = CURLE_SEND_ERROR;
      break;
    }
    else if(!what) {
      result = CURLE_OPERATION_TIMEDOUT;
      break;
    }
  }

  free(sel_org);

  if(!result)
    result = Curl_write(data, sockfd, "\r\n", 2, &amount);
  if(result) {
    failf(data, "Failed sending Gopher request");
    return result;
  }
  result = Curl_client_write(data, CLIENTWRITE_HEADER, (char *)"\r\n", 2);
  if(result)
    return result;

  Curl_setup_transfer(data, FIRSTSOCKET, -1, FALSE, -1);
  return CURLE_OK;
}
#endif /*CURL_DISABLE_GOPHER*/


text:
{% from "render_post_macro.html" import render_post %}

{% extends "layout.html" %}

{% block content %}
  {{ render_post(post, now_datetime, 0) }}
{% endblock content %}


text:
package com.sun.corba.se.spi.activation;

/**
* com/sun/corba/se/spi/activation/ServerHelper.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from /HUDSON3/workspace/8-2-build-linux-amd64/jdk8u121/8372/corba/src/share/classes/com/sun/corba/se/spi/activation/activation.idl
* Monday, December 12, 2016 4:37:46 PM PST
*/

/** Server callback API, passed to Activator in active method.
    */
abstract public class ServerHelper
{
  private static String  _id = "IDL:activation/Server:1.0";

  public static void insert (org.omg.CORBA.Any a, Server that)
  {
    org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
    a.type (type ());
    write (out, that);
    a.read_value (out.create_input_stream (), type ());
  }

  public static Server extract (org.omg.CORBA.Any a)
  {
    return read (a.create_input_stream ());
  }

  private static org.omg.CORBA.TypeCode __typeCode = null;
  synchronized public static org.omg.CORBA.TypeCode type ()
  {
    if (__typeCode == null)
    {
      __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (ServerHelper.id (), "Server");
    }
    return __typeCode;
  }

  public static String id ()
  {
    return _id;
  }

  public static Server read (org.omg.CORBA.portable.InputStream istream)
  {
    return narrow (istream.read_Object (_ServerStub.class));
  }

  public static void write (org.omg.CORBA.portable.OutputStream ostream, Server value)
  {
    ostream.write_Object ((org.omg.CORBA.Object) value);
  }

  public static Server narrow (org.omg.CORBA.Object obj)
  {
    if (obj == null)
      return null;
    else if (obj instanceof Server)
      return (Server)obj;
    else if (!obj._is_a (id ()))
      throw new org.omg.CORBA.BAD_PARAM ();
    else
    {
      org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
      _ServerStub stub = new _ServerStub ();
      stub._set_delegate(delegate);
      return stub;
    }
  }

  public static Server unchecked_narrow (org.omg.CORBA.Object obj)
  {
    if (obj == null)
      return null;
    else if (obj instanceof Server)
      return (Server)obj;
    else
    {
      org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
      _ServerStub stub = new _ServerStub ();
      stub._set_delegate(delegate);
      return stub;
    }
  }

}


text:
class ShoppingCart(object):
    """Creates shopping cart objects
    for users of our fine website."""
    items_in_cart = {}
    def __init__(self, customer_name):
        self.customer_name = customer_name

    def add_item(self, product, price):
        """Add product to the cart."""
        if not product in self.items_in_cart:
            self.items_in_cart[product] = price
            print product + " added."
        else:
            print product + " is already in the cart."

    def remove_item(self, product):
        """Remove product from the cart."""
        if product in self.items_in_cart:
            del self.items_in_cart[product]
            print product + " removed."
        else:
            print product + " is not in the cart."
my_cart = ShoppingCart("arhtur")
my_cart.add_item("Car", 10000)


text:
package ch.bretscherhochstrasser.android.stickyviewpager.sample;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;

public abstract class AbstractViewPagerActivty extends FragmentActivity {

	ExamplePagerAdapter pagerAdapter;
	ViewPager viewPager;

	@Override
	protected void onCreate(final Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		onSetContentView();
		onSetTitle();
		pagerAdapter = new ExamplePagerAdapter(this, getSupportFragmentManager());
		viewPager = (ViewPager) findViewById(R.id.pager);
		viewPager.setAdapter(pagerAdapter);
	}

	abstract void onSetContentView();

	abstract void onSetTitle();
}


text:
#ifndef _RENDER_METHOD_CG_TEST_H_
#define _RENDER_METHOD_CG_TEST_H_

#include "RenderMethod.h"

/** Renders a model with a test CG shader */
class RenderMethod_CGTest : public RenderMethod {
public:
	/** Constructor */
	RenderMethod_CGTest();

	/** Called one time to set up the shader when the renderer starts */
	virtual void setupShader(CGcontext &cg,
	                         CGprofile &cgVertexProfile,
	                         CGprofile &cgFragmentProfile);

	/** Shader performs whatever work is necessary during the specified pass*/
	virtual void renderPass(RENDER_PASS pass);

	/** Indicates that the shader is supported on this hardware */
	virtual bool isSupported() const;

private:
	/** Pass for opaque, shaded objects */
	void pass_opaque();

	/** Allows a RenderMethod to set shader data per geometry chunk */
	virtual void setShaderData(const GeometryChunk &gc);

private:
	CGparameter cgProj;
	CGparameter cgView;
	CGparameter cgTexture;
};

#endif


text:
namespace glBase
{

	const std::wstring getGLError()
	{
		GLenum errorCode = glGetError();
		switch (errorCode)
		{
		case GL_NO_ERROR:
			return L"GL_NO_ERROR : No error has been recorded. The value of this symbolic constant is guaranteed to be 0.";
		case GL_INVALID_ENUM:
			return L"GL_INVALID_ENUM 0x0500: Given when an enumeration parameter is not a legal enumeration for that function. This is given only for local problems; if the spec allows the enumeration in certain circumstances, and other parameters or state dictate those circumstances, then GL_INVALID_OPERATION? is the result instead.";
		case GL_INVALID_VALUE:
			return L"GL_INVALID_VALUE? 0x0501: Given when a value parameter is not a legal value for that function. This is only given for local problems; if the spec allows the value in certain circumstances, and other parameters or state dictate those circumstances, then GL_INVALID_OPERATION is the result instead.";
		case GL_INVALID_OPERATION:
			return L"GL_INVALID_OPERATION? 0x0502: Given when the set of state for a command is not legal for the parameters given to that command. It is also given for commands where combinations of parameters define what the legal parameters are.";
		case GL_OUT_OF_MEMORY:
			return L"GL_OUT_OF_MEMORY 0x0503: Given when performing an operation that can allocate memory, but the memory cannot be allocated. The results of OpenGL functions that return this error are undefined; it is allowable for partial operations to happen.";
		case GL_INVALID_FRAMEBUFFER_OPERATION:
			return L"GL_INVALID_FRAMEBUFFER_OPERATION 0x0506: Given when doing anything that would attempt to read from or write/render to a framebuffer that is not complete, as defined here.";
		case GL_STACK_OVERFLOW:
			return L"GL_STACK_OVERFLOW? 0x0503: Given when a stack pushing operation cannot be done because it would overflow the limit of that stack's size.";
		case GL_STACK_UNDERFLOW:
			return L"GL_STACK_UNDERFLOW 0x0504: Given when a stack popping operation cannot be done because the stack is already at its lowest point.";
		default:
			return L"Unknow OpenGL error code.";
		}
	}

};

#endif


text:
from _and import *
from ap import *
from clause import *
from _finally import *
from globally import *
from implies import *
from next import *
from _not import *
from _or import *
from release import *
from until import *


text:
require 'spec_helper'

describe Genny do
  it 'has a version number' do
    expect(Genny::VERSION).not_to be nil
  end
end


text:
// Copyright 2012 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.collide.client.collaboration;

import java.util.List;

import com.google.collide.client.collaboration.FileConcurrencyController.DocOpListener;
import com.google.collide.client.document.DocumentManager;
import com.google.collide.client.document.DocumentMetadata;
import com.google.collide.dto.DocOp;
import com.google.collide.json.shared.JsonArray;
import com.google.collide.json.shared.JsonIntegerMap;
import com.google.collide.shared.document.Document;
import com.google.collide.shared.util.JsonCollections;
import com.google.collide.shared.util.ListenerRegistrar.RemoverManager;
import com.google.common.base.Preconditions;

/**
 * A utility class to register for callbacks when all of the doc ops in a particular scope are
 * saved (the server has successfully received and applied them to the document.)
 */
public class DocOpsSavedNotifier {

  public abstract static class Callback {

    private final DocOpListener docOpListener = new DocOpListener() {
      @Override
      public void onDocOpAckReceived(int documentId, DocOp serverHistoryDocOp, boolean clean) {
        Integer remainingAcks = remainingAcksByDocumentId.get(documentId);
        if (remainingAcks == null) {
          // We have already reached our ack count for this document ID
          return;
        }

        remainingAcks--;
        if (remainingAcks == 0) {
          remainingAcksByDocumentId.erase(documentId);
          tryCallback();
        } else {
          remainingAcksByDocumentId.put(documentId, remainingAcks);
        }
      }

      @Override
      public void onDocOpSent(int documentId, List<DocOp> docOps) {
      }
    };

    private RemoverManager remover;
    private JsonIntegerMap<Integer> remainingAcksByDocumentId;

    public abstract void onAllDocOpsSaved();

    private void initialize(
        RemoverManager remover, JsonIntegerMap<Integer> remainingAcksByDocumentId) {
      this.remover = remover;
      this.remainingAcksByDocumentId = remainingAcksByDocumentId;
    }

    /**
     * Stops listening for the doc ops to be saved.
     */
    protected void cancel() {
      remover.remove();

      remover = null;
      remainingAcksByDocumentId = null;
    }

    private void tryCallback() {
      if (!isWaiting()) {
        // Only callback after all documents' doc ops have been acked
        cancel();
        onAllDocOpsSaved();
      }
    }

    boolean isWaiting() {
      return remainingAcksByDocumentId != null && !remainingAcksByDocumentId.isEmpty();
    }
  }

  private final DocumentManager documentManager;
  private final CollaborationManager collaborationManager;

  public DocOpsSavedNotifier(
      DocumentManager documentManager, CollaborationManager collaborationManager) {
    this.documentManager = documentManager;
    this.collaborationManager = collaborationManager;
  }

  /**
   * @see #notifyForFiles(Callback, String...)
   */
  public boolean notifyForWorkspace(Callback callback) {
    JsonArray<Document> documents = documentManager.getDocuments();
    int[] documentIds = new int[documents.size()];
    for (int i = 0; i < documentIds.length; i++) {
      documentIds[i] = documents.get(i).getId();
    }

    return notifyForDocuments(callback, documentIds);
  }

  /**
   * @see #notifyForDocuments(Callback, int...)
   */
  public boolean notifyForFiles(Callback callback, String... fileEditSessionKeys) {
    int[] documentIds = new int[fileEditSessionKeys.length];
    for (int i = 0; i < documentIds.length; i++) {
      Document document = documentManager.getDocumentByFileEditSessionKey(fileEditSessionKeys[i]);
      Preconditions.checkNotNull(document,
          "Document for given fileEditSessionKey [" + fileEditSessionKeys[i] + "] does not exist");

      documentIds[i] = document.getId();
    }

    return notifyForDocuments(callback, documentIds);
  }

  /**
   * @return whether we are waiting for unacked or queued doc ops
   */
  public boolean notifyForDocuments(Callback callback, int... documentIds) {
    RemoverManager remover = new RemoverManager();
    JsonIntegerMap<Integer> remainingAcksByDocumentId = JsonCollections.createIntegerMap();

    for (int i = 0; i < documentIds.length; i++) {
      int documentId = documentIds[i];

      if (!DocumentMetadata.isLinkedToFile(documentManager.getDocumentById(documentId))) {
        // Ignore unlinked files
        continue;
      }

      DocumentCollaborationController documentCollaborationController =
          collaborationManager.getDocumentCollaborationController(documentId);
      Preconditions.checkNotNull(documentCollaborationController,
          "Could not find collaboration controller document ID [" + documentId + "]");

      FileConcurrencyController fileConcurrencyController =
          documentCollaborationController.getFileConcurrencyController();
      int remainingAcks = computeRemainingAcks(fileConcurrencyController);
      if (remainingAcks > 0) {
        remainingAcksByDocumentId.put(documentId, remainingAcks);
        remover.track(
            fileConcurrencyController.getDocOpListenerRegistrar().add(callback.docOpListener));
      }
    }

    callback.initialize(remover, remainingAcksByDocumentId);

    // If there aren't any unacked or queued doc ops, this will callback immediately
    callback.tryCallback();

    return callback.isWaiting();
  }

  private static int computeRemainingAcks(FileConcurrencyController fileConcurrencyController) {
    return fileConcurrencyController.getUnackedClientOpCount()
        + fileConcurrencyController.getQueuedClientOpCount();
  }
}


text:
'use strict';

angular.module('geekFoodApp')
    .factory('Recipes', function($resource) {
        return $resource('api/recipes/:category/:id');
    });


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.framework.multidexlegacytestservices"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="9"
        android:targetSdkVersion="19" />

    <application
        android:label="MultiDexLegacyTestServices">

        <service android:name=".Service1" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices1">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service1" />
            </intent-filter>
        </service>

        <service android:name=".Service2" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices2">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service2" />
            </intent-filter>
        </service>

        <service android:name=".Service3" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices3">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service3" />
            </intent-filter>
        </service>

        <service android:name=".Service4" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices4">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service4" />
            </intent-filter>
        </service>

        <service android:name=".Service5" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices5">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service5" />
            </intent-filter>
        </service>

        <service android:name=".Service6" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices6">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service6" />
            </intent-filter>
        </service>

        <service android:name=".Service7" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices7">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service7" />
            </intent-filter>
        </service>

        <service android:name=".Service8" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices8">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service8" />
            </intent-filter>
        </service>

        <service android:name=".Service9" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices9">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service9" />
            </intent-filter>
        </service>

        <service android:name=".Service10" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices10">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service10" />
            </intent-filter>
        </service>

        <service android:name=".Service11" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices11">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service11" />
            </intent-filter>
        </service>

        <service android:name=".Service12" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices12">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service12" />
            </intent-filter>
        </service>

        <service android:name=".Service13" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices13">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service13" />
            </intent-filter>
        </service>

        <service android:name=".Service14" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices14">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service14" />
            </intent-filter>
        </service>

        <service android:name=".Service15" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices15">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service15" />
            </intent-filter>
        </service>

        <service android:name=".Service16" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices16">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service16" />
            </intent-filter>
        </service>

        <service android:name=".Service17" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices17">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service17" />
            </intent-filter>
        </service>

        <service android:name=".Service18" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices18">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service18" />
            </intent-filter>
        </service>

        <service android:name=".Service19" android:exported="true" android:process=":com.android.framework.multidexlegacytestservices19">
            <intent-filter>
                <action android:name="com.android.framework.multidexlegacytestservices.action.Service19" />
            </intent-filter>
        </service>
        </application>

</manifest>


text:
@interface IDEDistributionCompileBitcodeStep : IDEDistributionProcessingStep
{
}

- (_Bool)runWithError:(id *)arg1;
- (_Bool)shouldSkip;
- (id)providedOutputContextPropertyNames;
- (id)requiredInputContextPropertyNames;
- (id)name;

@end


text:
"""
This is the PVPower Carousel demonstration project package.
"""

import os

__version__ = '0.1'
__author__ = 'Mark Mikofski'
__email__ = 'mark.mikofski@sunpowercorp.com'

PROJ_PATH = os.path.abspath(os.path.dirname(__file__))


text:
import {control, DomUtil} from 'leaflet'
import {PropTypes} from 'react'
import MapControl from 'react-leaflet/lib/MapControl'

export default class Legend extends MapControl {
  static propTypes = {
    html: PropTypes.string,
    position: PropTypes.string
  }

  componentWillReceiveProps (nextProps) {
    if (nextProps.html !== this.props.html) {
      this.div.innerHTML = nextProps.html
    }
  }

  createLeafletElement (props) {
    const legend = control({ position: props.position })
    this.div = DomUtil.create('div', 'legend')
    legend.onAdd = (map) => {
      this.div.innerHTML = props.html
      return this.div
    }
    return legend
  }
}