text:
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you 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.
#pragma once

#include <algorithm>
#include <cstdlib>
#include <functional>
#include <memory>
#include <string>
#include <vector>

#include <glog/logging.h>

#include "kudu/cfile/cfile.pb.h"
#include "kudu/cfile/cfile_reader.h"
#include "kudu/cfile/cfile_writer.h"
#include "kudu/common/columnblock.h"
#include "kudu/fs/fs_manager.h"
#include "kudu/gutil/port.h"
#include "kudu/gutil/stringprintf.h"
#include "kudu/util/int128.h"
#include "kudu/util/status.h"
#include "kudu/util/stopwatch.h"
#include "kudu/util/test_macros.h"
#include "kudu/util/test_util.h"

DEFINE_int32(cfile_test_block_size, 1024,
             "Block size to use for testing cfiles. "
             "Default is low to stress code, but can be set higher for "
             "performance testing");

namespace kudu {
namespace cfile {

// Abstract test data generator.
// You must implement BuildTestValue() to return your test value.
//    Usage example:
//        StringDataGenerator<true> datagen;
//        datagen.Build(10);
//        for (int i = 0; i < datagen.block_entries(); ++i) {
//          bool is_null = !BitmapTest(datagen.non_null_bitmap(), i);
//          Slice& v = datagen[i];
//        }
template<DataType DATA_TYPE, bool HAS_NULLS>
class DataGenerator {
 public:
  static bool has_nulls() {
    return HAS_NULLS;
  }

  static const DataType kDataType;

  typedef typename DataTypeTraits<DATA_TYPE>::cpp_type cpp_type;

  DataGenerator() :
    block_entries_(0),
    total_entries_(0)
  {}

  void Reset() {
    block_entries_ = 0;
    total_entries_ = 0;
  }

  void Build(size_t num_entries) {
    Build(total_entries_, num_entries);
    total_entries_ += num_entries;
  }

  // Build "num_entries" using (offset + i) as value
  // You can get the data values and the null bitmap using values() and non_null_bitmap()
  // both are valid until the class is destructed or until Build() is called again.
  void Build(size_t offset, size_t num_entries) {
    Resize(num_entries);

    for (size_t i = 0; i < num_entries; ++i) {
      if (HAS_NULLS) {
        BitmapChange(non_null_bitmap_.get(), i, !TestValueShouldBeNull(offset + i));
      }
      values_[i] = BuildTestValue(i, offset + i);
    }
  }

  virtual cpp_type BuildTestValue(size_t block_index, size_t value) = 0;

  bool TestValueShouldBeNull(size_t n) {
    if (!HAS_NULLS) {
      return false;
    }

    // The NULL pattern alternates every 32 rows, cycling between:
    //   32 NULL
    //   32 alternating NULL/NOTNULL
    //   32 NOT-NULL
    //   32 alternating NULL/NOTNULL
    // This is to ensure that we stress the run-length coding for
    // NULL value.
    switch ((n >> 6) & 3) {
      case 0:
        return true;
      case 1:
      case 3:
        return n & 1;
      case 2:
        return false;
      default:
        LOG(FATAL);
    }
  }

  virtual void Resize(size_t num_entries) {
    if (block_entries_ >= num_entries) {
      block_entries_ = num_entries;
      return;
    }

    values_.reset(new cpp_type[num_entries]);
    non_null_bitmap_.reset(new uint8_t[BitmapSize(num_entries)]);
    block_entries_ = num_entries;
  }

  size_t block_entries() const { return block_entries_; }
  size_t total_entries() const { return total_entries_; }

  const cpp_type *values() const { return values_.get(); }
  const uint8_t *non_null_bitmap() const { return non_null_bitmap_.get(); }

  const cpp_type& operator[](size_t index) const {
    return values_[index];
  }

  virtual ~DataGenerator() {}

 private:
  std::unique_ptr<cpp_type[]> values_;
  std::unique_ptr<uint8_t[]> non_null_bitmap_;
  size_t block_entries_;
  size_t total_entries_;
};

template<DataType DATA_TYPE, bool HAS_NULLS>
const DataType DataGenerator<DATA_TYPE, HAS_NULLS>::kDataType = DATA_TYPE;

template<bool HAS_NULLS>
class UInt8DataGenerator : public DataGenerator<UINT8, HAS_NULLS> {
 public:
  UInt8DataGenerator() {}
  ATTRIBUTE_NO_SANITIZE_INTEGER
  uint8_t BuildTestValue(size_t block_index, size_t value) OVERRIDE {
    return (value * 10) % 256;
  }
};

template<bool HAS_NULLS>
class Int8DataGenerator : public DataGenerator<INT8, HAS_NULLS> {
 public:
  Int8DataGenerator() {}
  ATTRIBUTE_NO_SANITIZE_INTEGER
  int8_t BuildTestValue(size_t block_index, size_t value) OVERRIDE {
    return ((value * 10) % 128) * (value % 2 == 0 ? -1 : 1);
  }
};

template<bool HAS_NULLS>
class UInt16DataGenerator : public DataGenerator<UINT16, HAS_NULLS> {
 public:
  UInt16DataGenerator() {}
  ATTRIBUTE_NO_SANITIZE_INTEGER
  uint16_t BuildTestValue(size_t block_index, size_t value) OVERRIDE {
    return (value * 10) % 65536;
  }
};

template<bool HAS_NULLS>
class Int16DataGenerator : public DataGenerator<INT16, HAS_NULLS> {
 public:
  Int16DataGenerator() {}
  ATTRIBUTE_NO_SANITIZE_INTEGER
  int16_t BuildTestValue(size_t block_index, size_t value) OVERRIDE {
    return ((value * 10) % 32768) * (value % 2 == 0 ? -1 : 1);
  }
};

template<bool HAS_NULLS>
class UInt32DataGenerator : public DataGenerator<UINT32, HAS_NULLS> {
 public:
  UInt32DataGenerator() {}
  ATTRIBUTE_NO_SANITIZE_INTEGER
  uint32_t BuildTestValue(size_t block_index, size_t value) OVERRIDE {
    return value * 10;
  }
};

template<bool HAS_NULLS>
class Int32DataGenerator : public DataGenerator<INT32, HAS_NULLS> {
 public:
  Int32DataGenerator() {}
  ATTRIBUTE_NO_SANITIZE_INTEGER
  int32_t BuildTestValue(size_t block_index, size_t value) OVERRIDE {
    return (value * 10) *(value % 2 == 0 ? -1 : 1);
  }
};

template<bool HAS_NULLS>
class UInt64DataGenerator : public DataGenerator<UINT64, HAS_NULLS> {
 public:
  UInt64DataGenerator() {}
  ATTRIBUTE_NO_SANITIZE_INTEGER
  uint64_t BuildTestValue(size_t /*block_index*/, size_t value) OVERRIDE {
    return value * 0x123456789abcdefULL;
  }
};

template<bool HAS_NULLS>
class Int64DataGenerator : public DataGenerator<INT64, HAS_NULLS> {
 public:
  Int64DataGenerator() {}
  ATTRIBUTE_NO_SANITIZE_INTEGER
  int64_t BuildTestValue(size_t /*block_index*/, size_t value) OVERRIDE {
    int64_t r = (value * 0x123456789abcdefULL) & 0x7fffffffffffffffULL;
    return value % 2 == 0 ? r : -r;
  }
};

template<bool HAS_NULLS>
class Int128DataGenerator : public DataGenerator<INT128, HAS_NULLS> {
public:
  Int128DataGenerator() {}
  ATTRIBUTE_NO_SANITIZE_INTEGER
  int128_t BuildTestValue(size_t /*block_index*/, size_t value) OVERRIDE {
    int128_t r = (value * 0x123456789abcdefULL) & 0x7fffffffffffffffULL;
    return value % 2 == 0 ? r : -r;
  }
};

// Floating-point data generator.
// This works for both floats and doubles.
template<DataType DATA_TYPE, bool HAS_NULLS>
class FPDataGenerator : public DataGenerator<DATA_TYPE, HAS_NULLS> {
 public:
  typedef typename DataTypeTraits<DATA_TYPE>::cpp_type cpp_type;

  FPDataGenerator() {}
  cpp_type BuildTestValue(size_t block_index, size_t value) OVERRIDE {
    return static_cast<cpp_type>(value) * 1.0001;
  }
};

template<bool HAS_NULLS>
class StringDataGenerator : public DataGenerator<STRING, HAS_NULLS> {
 public:
  explicit StringDataGenerator(const char* format)
      : StringDataGenerator(
          [=](size_t x) { return StringPrintf(format, x); }) {
  }

  explicit StringDataGenerator(std::function<std::string(size_t)> formatter)
      : formatter_(std::move(formatter)) {
  }

  Slice BuildTestValue(size_t block_index, size_t value) OVERRIDE {
    data_buffers_[block_index] = formatter_(value);
    return Slice(data_buffers_[block_index]);
  }

  void Resize(size_t num_entries) OVERRIDE {
    data_buffers_.resize(num_entries);
    DataGenerator<STRING, HAS_NULLS>::Resize(num_entries);
  }

 private:
  std::vector<std::string> data_buffers_;
  std::function<std::string(size_t)> formatter_;
};

// Class for generating strings that contain duplicate
template<bool HAS_NULLS>
class DuplicateStringDataGenerator : public DataGenerator<STRING, HAS_NULLS> {
 public:

  // num specify number of possible unique strings that can be generated
  explicit DuplicateStringDataGenerator(const char* format, int num)
  : format_(format),
    num_(num) {
  }

  Slice BuildTestValue(size_t block_index, size_t value) OVERRIDE {
    // random number from 0 ~ num_-1
    value = random() % num_;
    char *buf = data_buffer_[block_index].data;
    int len = snprintf(buf, kItemBufferSize - 1, format_, value);
    DCHECK_LT(len, kItemBufferSize);
    return Slice(buf, len);
  }

  void Resize(size_t num_entries) OVERRIDE {
    if (num_entries > this->block_entries()) {
      data_buffer_.reset(new Buffer[num_entries]);
    }
    DataGenerator<STRING, HAS_NULLS>::Resize(num_entries);
  }

 private:
  static const int kItemBufferSize = 16;

  struct Buffer {
    char data[kItemBufferSize];
  };

  std::unique_ptr<Buffer[]> data_buffer_;
  const char* format_;
  int num_;
};

// Generator for fully random int32 data.
class RandomInt32DataGenerator : public DataGenerator<INT32, /* HAS_NULLS= */ false> {
 public:
  int32_t BuildTestValue(size_t /*block_index*/, size_t /*value*/) override {
    return random();
  }
};

class CFileTestBase : public KuduTest {
 public:
  void SetUp() OVERRIDE {
    KuduTest::SetUp();

    fs_manager_.reset(new FsManager(env_, FsManagerOpts(GetTestPath("fs_root"))));
    ASSERT_OK(fs_manager_->CreateInitialFileSystemLayout());
    ASSERT_OK(fs_manager_->Open());
  }

  // Place a ColumnBlock and SelectionVector into a context. This context will
  // not support decoder evaluation.
  ColumnMaterializationContext CreateNonDecoderEvalContext(ColumnBlock* cb, SelectionVector* sel) {
    return ColumnMaterializationContext(0, nullptr, cb, sel);
  }
 protected:
  enum Flags {
    NO_FLAGS = 0,
    WRITE_VALIDX = 1,
    SMALL_BLOCKSIZE = 1 << 1
  };

  template<class DataGeneratorType>
  void WriteTestFile(DataGeneratorType* data_generator,
                     EncodingType encoding,
                     CompressionType compression,
                     int num_entries,
                     uint32_t flags,
                     BlockId* block_id) {
    std::unique_ptr<fs::WritableBlock> sink;
    ASSERT_OK(fs_manager_->CreateNewBlock({}, &sink));
    *block_id = sink->id();
    WriterOptions opts;
    opts.write_posidx = true;

    if (flags & WRITE_VALIDX) {
      opts.write_validx = true;
    }
    if (flags & SMALL_BLOCKSIZE) {
      // Use a smaller block size to exercise multi-level indexing.
      opts.storage_attributes.cfile_block_size = 1024;
    }

    opts.storage_attributes.encoding = encoding;
    opts.storage_attributes.compression = compression;
    CFileWriter w(opts, GetTypeInfo(DataGeneratorType::kDataType),
                  DataGeneratorType::has_nulls(), std::move(sink));

    ASSERT_OK(w.Start());

    // Append given number of values to the test tree. We use 100 to match
    // the output block size of compaction (kCompactionOutputBlockNumRows in
    // compaction.cc, unfortunately not linkable from the cfile/ module)
    const size_t kBufferSize = 100;
    size_t i = 0;
    while (i < num_entries) {
      int towrite = std::min(num_entries - i, kBufferSize);

      data_generator->Build(towrite);
      DCHECK_EQ(towrite, data_generator->block_entries());

      if (DataGeneratorType::has_nulls()) {
        ASSERT_OK_FAST(w.AppendNullableEntries(data_generator->non_null_bitmap(),
                                                      data_generator->values(),
                                                      towrite));
      } else {
        ASSERT_OK_FAST(w.AppendEntries(data_generator->values(), towrite));
      }
      i += towrite;
    }

    ASSERT_OK(w.Finish());
  }

  std::unique_ptr<FsManager> fs_manager_;

};

// Fast unrolled summing of a vector.
// GCC's auto-vectorization doesn't work here, because there isn't
// enough guarantees on alignment and it can't seem to decode the
// constant stride.
template<class Indexable, typename SumType>
ATTRIBUTE_NO_SANITIZE_INTEGER
SumType FastSum(const Indexable &data, size_t n) {
  SumType sums[4] = {0, 0, 0, 0};
  size_t rem = n;
  int i = 0;
  for (; rem >= 4; rem -= 4) {
    sums[0] += data[i];
    sums[1] += data[i+1];
    sums[2] += data[i+2];
    sums[3] += data[i+3];
    i += 4;
  }
  for (; rem > 0; rem--) {
    sums[3] += data[i++];
  }
  return sums[0] + sums[1] + sums[2] + sums[3];
}

template<DataType Type, typename SumType>
void TimeReadFileForDataType(CFileIterator* iter, int* count) {
  ScopedColumnBlock<Type> cb(8192);
  SelectionVector sel(cb.nrows());
  ColumnMaterializationContext ctx(0, nullptr, &cb, &sel);
  ctx.SetDecoderEvalNotSupported();
  SumType sum = 0;
  while (iter->HasNext()) {
    size_t n = cb.nrows();
    ASSERT_OK_FAST(iter->CopyNextValues(&n, &ctx));
    sum += FastSum<ScopedColumnBlock<Type>, SumType>(cb, n);
    *count += n;
    cb.arena()->Reset();
  }
  LOG(INFO)<< "Sum: " << sum;
  LOG(INFO)<< "Count: " << *count;
}

template<DataType Type>
void ReadBinaryFile(CFileIterator* iter, int* count) {
  ScopedColumnBlock<Type> cb(100);
  SelectionVector sel(cb.nrows());
  ColumnMaterializationContext ctx(0, nullptr, &cb, &sel);
  ctx.SetDecoderEvalNotSupported();
  uint64_t sum_lens = 0;
  while (iter->HasNext()) {
    size_t n = cb.nrows();
    ASSERT_OK_FAST(iter->CopyNextValues(&n, &ctx));
    for (size_t i = 0; i < n; i++) {
      if (!cb.is_null(i)) {
        sum_lens += cb[i].size();
      }
    }
    *count += n;
    cb.arena()->Reset();
  }
  LOG(INFO) << "Sum of value lengths: " << sum_lens;
  LOG(INFO) << "Count: " << *count;
}

void TimeReadFile(FsManager* fs_manager, const BlockId& block_id, size_t *count_ret) {
  Status s;

  std::unique_ptr<fs::ReadableBlock> source;
  ASSERT_OK(fs_manager->OpenBlock(block_id, &source));
  std::unique_ptr<CFileReader> reader;
  ASSERT_OK(CFileReader::Open(std::move(source), ReaderOptions(), &reader));

  std::unique_ptr<CFileIterator> iter;
  ASSERT_OK(reader->NewIterator(&iter, CFileReader::CACHE_BLOCK, nullptr));
  ASSERT_OK(iter->SeekToOrdinal(0));

  Arena arena(8192);
  int count = 0;
  switch (reader->type_info()->physical_type()) {
    case UINT8:
    {
      TimeReadFileForDataType<UINT8, uint64_t>(iter.get(), &count);
      break;
    }
    case INT8:
    {
      TimeReadFileForDataType<INT8, int64_t>(iter.get(), &count);
      break;
    }
    case UINT16:
    {
      TimeReadFileForDataType<UINT16, uint64_t>(iter.get(), &count);
      break;
    }
    case INT16:
    {
      TimeReadFileForDataType<INT16, int64_t>(iter.get(), &count);
      break;
    }
    case UINT32:
    {
      TimeReadFileForDataType<UINT32, uint64_t>(iter.get(), &count);
      break;
    }
    case INT32:
    {
      TimeReadFileForDataType<INT32, int64_t>(iter.get(), &count);
      break;
    }
    case UINT64:
    {
      TimeReadFileForDataType<UINT64, uint64_t>(iter.get(), &count);
      break;
    }
    case INT64:
    {
      TimeReadFileForDataType<INT64, int64_t>(iter.get(), &count);
      break;
    }
    case INT128:
    {
      TimeReadFileForDataType<INT128, int128_t>(iter.get(), &count);
      break;
    }
    case FLOAT:
    {
      TimeReadFileForDataType<FLOAT, float>(iter.get(), &count);
      break;
    }
    case DOUBLE:
    {
      TimeReadFileForDataType<DOUBLE, double>(iter.get(), &count);
      break;
    }
    case STRING:
    {
      ReadBinaryFile<STRING>(iter.get(), &count);
      break;
    }
    case BINARY:
    {
      ReadBinaryFile<BINARY>(iter.get(), &count);
      break;
    }
    default:
      FAIL() << "Unknown type: " << reader->type_info()->physical_type();
  }
  *count_ret = count;
}

} // namespace cfile
} // namespace kudu


text:
$(document).ready(function() {

	$(".nav__list-item").hover(function () { //When trigger is hovered...
        $(this).children(".nav__list--submenu").slideDown('fast');
    }, function () {
        $(this).children(".nav__list--submenu").slideUp('slow');
    });

});

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace MirrorApiBundle\Repository;

/**
 * WeatherRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class WeatherRepository extends \Doctrine\ORM\EntityRepository
{
}


text:
/**@file tsdp_header_C.h
 * @brief SDP "c=" header (Connection Data).
 *
 * @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
 *
 *
 */
#ifndef _TSDP_HEADER_C_H_
#define _TSDP_HEADER_C_H_

#include "tinysdp_config.h"
#include "tinysdp/headers/tsdp_header.h"

TSDP_BEGIN_DECLS

#define TSDP_HEADER_C_VA_ARGS(nettype, addrtype, addr)		tsdp_header_C_def_t, (const char*)(nettype), (const char*)(addrtype), (const char*)(addr)

////////////////////////////////////////////////////////////////////////////////////////////////////
/// @struct
///
/// @brief	SDP "c=" header	(Connection Data).
/// A session description MUST contain either at least one "c=" field in
///    each media description or a single "c=" field at the session level.
///    It MAY contain a single session-level "c=" field and additional "c="
///    field(s) per media description, in which case the per-media values
///    override the session-level settings for the respective media.
///
///
///
/// @par ABNF : c= nettype SP addrtype SP connection-address
///
////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct tsdp_header_C_s
{
	TSDP_DECLARE_HEADER;
	char* nettype;
	char* addrtype;
	char* addr;
}
tsdp_header_C_t;

typedef tsk_list_t tsdp_headers_C_L_t;

TINYSDP_API tsdp_header_C_t* tsdp_header_c_create(const char* nettype, const char* addrtype, const char* addr);
TINYSDP_API tsdp_header_C_t* tsdp_header_c_create_null();

TINYSDP_API tsdp_header_C_t *tsdp_header_C_parse(const char *data, tsk_size_t size);

TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_C_def_t;

TSDP_END_DECLS

#endif /* _TSDP_HEADER_C_H_ */


text:
package alien4cloud.rest.orchestrator.model;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class UpdateLocationRequest {
    private String name;
    private String environmentType;
}


text:
from .trace import (
    AttributeValue,
    Module,
    Span,
    StackTrace,
    TruncatableString,
)
from .tracing import (
    BatchWriteSpansRequest,
)

__all__ = (
    "AttributeValue",
    "Module",
    "Span",
    "StackTrace",
    "TruncatableString",
    "BatchWriteSpansRequest",
)


text:
<!DOCTYPE html>

        <title>FormKiQ Server -  Details</title>

       	<input type="hidden" th:value="${param.folder[0]}" id="folder" />
       	<input type="hidden" th:value="${param.foldername[0]}" id="foldername" />
       	<input type="hidden" id="uuid" />

Folder Forms

								<button class="backbutton alt">Back</button>

 Folders

								<button class="icon fa-user-plus"> Upload Form</button>

									Form Name
									Type
									Identity
									Status
									Last Updated

							Previous Page

							Next Page

		<object th:include="fragments/scripts" th:remove="tag" />

		<object th:include="fragments/sidebar-admin" th:remove="tag" />


text:
namespace Seed
{
    using System;
    using System.Collections.Generic;

    public partial class Projectss
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public Projectss()
        {
            this.ProjectsEmployees = new HashSet<ProjectsEmployee>();
        }

        public int Id { get; set; }
        public string Name { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<ProjectsEmployee> ProjectsEmployees { get; set; }
    }
}


text:
const picard = require('../lib');
const program = require('commander');
const colog = require('colog');

program
    .version('0.0.1')
    .description('Quotes from the Legendary Jean-Luc Picard')
    .parse(process.argv);

picard.quote((quote) => {
    if (quote) return console.log(colog.yellow(`\n"${quote.quote}" `) + colog.blue(`- Jean-Luc Picard\n`));
});


text:
require 'spec_helper'

describe 'App' do
  it "produces notes" do
    get "/"
    expect(last_response).to be_ok
  end
end


text:
<!--
  Copyright 2014-2016 CyberVision, Inc.

  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.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.kaaproject</groupId>
        <version>0.8.1</version>
        <artifactId>kaa</artifactId>
    </parent>
    <groupId>org.kaaproject.kaa</groupId>
    <artifactId>client</artifactId>
    <packaging>pom</packaging>

    <name>Kaa Client</name>
    <url>http://kaaproject.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <main.dir>${basedir}/..</main.dir>
    </properties>

    <modules>
        <module>client-multi</module>
    </modules>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


text:
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;
using Azure.ResourceManager.DataBoxEdge;

namespace Azure.ResourceManager.DataBoxEdge.Models
{
    internal partial class DataBoxEdgeDeviceList
    {
        internal static DataBoxEdgeDeviceList DeserializeDataBoxEdgeDeviceList(JsonElement element)
        {
            Optional<IReadOnlyList<DataBoxEdgeDeviceData>> value = default;
            Optional<string> nextLink = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List<DataBoxEdgeDeviceData> array = new List<DataBoxEdgeDeviceData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DataBoxEdgeDeviceData.DeserializeDataBoxEdgeDeviceData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return new DataBoxEdgeDeviceList(Optional.ToList(value), nextLink.Value);
        }
    }
}


text:
'use strict';

var express = require('express');
var router = new express.Router();
var rootRoute = router.route('foobar');

var _ = require("lodash");

rootRoute.post(function(req, res) {
    nullPointer(req.body);

    nullPointer2(req.body);

    nullPointer3(req.body);

    lodashPointer(req.body);

    lodashArrowFunc(req.body);
});

function nullPointer(val) {
    var ret = [];

    for (var i = 0; i < val.length; i++) { // OK
        ret.push(val[i].foo + 42);
    }
}

function nullPointer2(val) {
    var ret = [];

    for (var i = 0; i < val.length; i++) { // OK
    	var element = val[i];
        ret.push(element.foo + 42);
    }
}

function nullPointer3(val) {
	let arr = val.messaging
	for (let i = 0; i < arr.length; i++) { // OK
		let event = val.messaging[i]
		let sender = event.sender.id
	}
}

function lodashPointer(val) {
    return _.map(val, function(e) { // OK
        return e.foo;
    })
}

function lodashArrowFunc(val) {
	return _.map(val, (e) => { // OK
        return e.foo;
    });
}


text:
Template.regolamento.helpers({
	minAllowedAge: function() {
		return Meteor.settings.public.rules.minAllowedAge;
	}
});


text:
package angulate2.core

import angulate2.internal.JSType

import scala.annotation.StaticAnnotation

class ViewChild(selector: String, read: JSType = null) extends StaticAnnotation


text:
package consulo.play1.template.base.editor.highlight;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Nonnull;
import consulo.play1.editor.highlight.PlayJavaColors;
import consulo.play1.template.base.parser.PlayBaseTemplateTokenSets;
import consulo.play1.template.base.parser.PlayBaseTemplateTokens;
import consulo.play1.template.base.parser.lexer.PlayBaseTemplateLexer;
import com.intellij.lexer.Lexer;
import com.intellij.openapi.editor.DefaultLanguageHighlighterColors;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.TokenSet;

/**
 * @author VISTALL
 * @since 19:45/18.03.13
 */
public class PlayBaseTemplateSyntaxHighlighter extends SyntaxHighlighterBase implements PlayBaseTemplateTokens
{
	private static final Map<IElementType,TextAttributesKey> map = new HashMap<IElementType, TextAttributesKey>();

	static
	{
		safeMap(map, TokenSet.create(COMMENT, COMMENT_START, COMMENT_END), DefaultLanguageHighlighterColors.LINE_COMMENT);
		safeMap(map, STRING, DefaultLanguageHighlighterColors.STRING);
		safeMap(map, COMMA, DefaultLanguageHighlighterColors.COMMA);
		safeMap(map, PlayBaseTemplateTokenSets.TEMPLATE_ELEMENTS, PlayJavaColors.TEMPLATE_ELEMENTS);
		safeMap(map, TAG_NAME, PlayJavaColors.PLAY_TAG_NAME);
	}

	@Nonnull
	@Override
	public Lexer getHighlightingLexer()
	{
		return new PlayBaseTemplateLexer();
	}

	@Nonnull
	@Override
	public TextAttributesKey[] getTokenHighlights(IElementType tokenType)
	{
		return pack(map.get(tokenType));
	}
}


text:
package com.mongodb.internal.connection;

import com.mongodb.event.ServerClosedEvent;
import com.mongodb.event.ServerDescriptionChangedEvent;
import com.mongodb.event.ServerListener;
import com.mongodb.event.ServerOpeningEvent;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Predicate;

import static com.mongodb.assertions.Assertions.notNull;

public class TestServerListener implements ServerListener {
    private ServerOpeningEvent serverOpeningEvent;
    private ServerClosedEvent serverClosedEvent;
    private final List<ServerDescriptionChangedEvent> serverDescriptionChangedEvents = new ArrayList<>();
    private final Lock lock = new ReentrantLock();
    private final Condition condition = lock.newCondition();
    private volatile int waitingForEventCount;
    private Predicate<ServerDescriptionChangedEvent> waitingForEventMatcher;

    @Override
    public void serverOpening(final ServerOpeningEvent event) {
        serverOpeningEvent = event;
    }

    @Override
    public void serverClosed(final ServerClosedEvent event) {
        serverClosedEvent = event;
    }

    @Override
    public void serverDescriptionChanged(final ServerDescriptionChangedEvent event) {
        notNull("event", event);
        lock.lock();
        try {
            serverDescriptionChangedEvents.add(event);
            if (waitingForEventCount != 0 && containsEvents()) {
                condition.signalAll();
            }

        } finally {
            lock.unlock();
        }
    }

    public ServerOpeningEvent getServerOpeningEvent() {
        return serverOpeningEvent;
    }

    public ServerClosedEvent getServerClosedEvent() {
        return serverClosedEvent;
    }

    public List<ServerDescriptionChangedEvent> getServerDescriptionChangedEvents() {
        return serverDescriptionChangedEvents;
    }

    public void waitForServerDescriptionChangedEvent(final Predicate<ServerDescriptionChangedEvent> matcher, final int count,
            final int time, final TimeUnit unit) throws InterruptedException, TimeoutException {
        if (count <= 0) {
            throw new IllegalArgumentException();
        }
        lock.lock();
        try {
            if (waitingForEventCount != 0) {
                throw new IllegalStateException("Already waiting for events");
            }
            waitingForEventCount = count;
            waitingForEventMatcher = matcher;
            if (containsEvents()) {
                return;
            }
            if (!condition.await(time, unit)) {
                throw new TimeoutException("Timed out waiting for " + count + " ServerDescriptionChangedEvent events. "
                        + "The count after timing out is " + countEvents());
            }
        } finally {
            waitingForEventCount = 0;
            waitingForEventMatcher = null;
            lock.unlock();
        }
    }

    private long countEvents() {
        return serverDescriptionChangedEvents.stream().filter(waitingForEventMatcher).count();
    }

    private boolean containsEvents() {
        return countEvents() >= waitingForEventCount;
    }
}


text:
class PeopleController < ApplicationController

  skip_before_filter :require_activation, :only => :verify_email
  skip_before_filter :admin_warning, :only => [ :show, :update ]
  before_filter :login_required, :only => [ :show, :edit, :update,
                                            :common_contacts ]
  before_filter :correct_user_required, :only => [ :edit, :update ]
  before_filter :setup

  def index
    @people = Person.mostly_active(params[:page])

    respond_to do |format|
      format.html
    end
  end

  def show
    @person = Person.find(params[:id])
    unless @person.active? or current_person.admin?
      flash[:error] = "That person is not active"
      redirect_to home_url and return
    end
    if logged_in?
      @some_contacts = @person.some_contacts
      page = params[:page]
      @common_contacts = current_person.common_contacts_with(@person,
                                                             :page => page)
      # Use the same max number as in basic contacts list.
      num_contacts = Person::MAX_DEFAULT_CONTACTS
      @some_common_contacts = @common_contacts[0...num_contacts]
      @blog = @person.blog
      @posts = @person.blog.posts.paginate(:page => params[:page])
      @galleries = @person.galleries.paginate(:page => params[:page])
    end
    respond_to do |format|
      format.html
    end
  end

  def new
    @body = "register single-col"
    @person = Person.new

    respond_to do |format|
      format.html
    end
  end

  def create
    cookies.delete :auth_token
    @person = Person.new(params[:person])
    respond_to do |format|
      @person.email_verified = false if global_prefs.email_verifications?
      @person.identity_url = session[:verified_identity_url]
      @person.save
      if @person.errors.empty?
        session[:verified_identity_url] = nil
        if global_prefs.email_verifications?
          @person.email_verifications.create
          flash[:notice] = %(Thanks for signing up! Check your email
                             to activate your account.)
          format.html { redirect_to(home_url) }
        else
          self.current_person = @person
          flash[:notice] = "Thanks for signing up!"
          format.html { redirect_back_or_default(home_url) }
        end
      else
        @body = "register single-col"
        format.html { if @person.identity_url.blank?
                        render :action => 'new'
                      else
                        render :partial => "shared/personal_details.html.erb", :object => @person, :layout => 'application'
                      end
                    }
      end
    end
  rescue ActiveRecord::StatementInvalid
    # Handle duplicate email addresses gracefully by redirecting.
    redirect_to home_url
  rescue ActionController::InvalidAuthenticityToken
    # Experience has shown that the vast majority of these are bots
    # trying to spam the system, so catch & log the exception.
    warning = "ActionController::InvalidAuthenticityToken: #{params.inspect}"
    logger.warn warning
    redirect_to home_url
  end

  def verify_email
    verification = EmailVerification.find_by_code(params[:id])
    if verification.nil?
      flash[:error] = "Invalid email verification code"
      redirect_to home_url
    else
      cookies.delete :auth_token
      person = verification.person
      person.email_verified = true; person.save!
      self.current_person = person
      flash[:success] = "Email verified. Your profile is active!"
      redirect_to person
    end
  end

  def edit
    @person = Person.find(params[:id])

    respond_to do |format|
      format.html
    end
  end

  def update
    @person = Person.find(params[:id])
    respond_to do |format|
      case params[:type]
      when 'info_edit'
        if !preview? and @person.update_attributes(params[:person])
          flash[:success] = 'Profile updated!'
          format.html { redirect_to(@person) }
        else
          if preview?
            @preview = @person.description = params[:person][:description]
          end
          format.html { render :action => "edit" }
        end
      when 'password_edit'
        if @person.change_password?(params[:person])
          flash[:success] = 'Password changed.'
          format.html { redirect_to(@person) }
        else
          format.html { render :action => "edit" }
        end
      end
    end
  end

  def common_contacts
    @person = Person.find(params[:id])
    @common_contacts = @person.common_contacts_with(current_person,
                                                    :page => params[:page])
    respond_to do |format|
      format.html
    end
  end

  private

    def setup
      @body = "person"
    end

    def correct_user_required
      redirect_to home_url unless Person.find(params[:id]) == current_person
    end

    def preview?
      params["commit"] == "Preview"
    end
end


text:
#import "NSObject-Protocol.h"

@protocol UIWebViewDelegate <NSObject>
@end


text:
title: Server-side Selection
page_title: Server-side Selection | RadTreeList for ASP.NET AJAX Documentation
description: Server-side Selection
slug: treelist/functionality/selecting/server-side-selection
tags: server-side,selection
published: True
position: 1
---

# Server-side Selection

There might be scenarios where you need to perform server-side selection for the RadTreeList items.For that purpose, you can use one of the below approaches:

* Add a **TreeListSelectColumn** and provide the ability to the user toselect the desired items through it.

* Use server-side code to programmatically select the treelist items.

In both cases, to enable multi-item selection, you need to set the RadTreeList **AllowMultiItemSelection** property to **true**.

## Using the TreeListSelectColumn

RadTreeList server-side selection is enabled for the users once you add the **TreeListSelectColumn** to the RadTreeList Columns collection. You do not need toset any additional properties. Then checking the checkbox rendered in the column marks the correspondingitem as selected. As a result, postback is performed and the **ItemCommand** eventis fired with command name **RadTreeList.SelectCommandName**. To deselect an item,one should uncheck the checkbox in the select column. Then again postback is performed and theItemCommand event is fired with command name **RadTreeList.DeselectCommandName**.

````ASPNET
<telerik:RadTreeList ID="RadTreeList1" runat="server" DataKeyNames="EmployeeID" DataSourceID="SqlDataSource1"
	ParentDataKeyNames="ReportsTo" AllowMultiItemSelection="True" OnItemCommand="RadTreeList1_ItemCommand">
	<Columns>
		<telerik:TreeListSelectColumn UniqueName="SelectColumn">
		</telerik:TreeListSelectColumn>
	</Columns>
</telerik:RadTreeList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
	SelectCommand="SELECT [EmployeeID], [LastName], [FirstName], [Title], [TitleOfCourtesy], [City], [ReportsTo] FROM [Employees]">
</asp:SqlDataSource>
````
````C#
protected void RadTreeList1_ItemCommand(object sender, Telerik.Web.UI.TreeListCommandEventArgs e)
{
	if (e.CommandName == RadTreeList.SelectCommandName)
	{
		//item is being selected
	}
	if (e.CommandName == RadTreeList.DeselectCommandName)
	{
		//item is being deselected
	}
}
````
````VB.NET
Protected Sub RadTreeList1_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.TreeListCommandEventArgs)
	If e.CommandName = RadTreeList.SelectCommandName Then
		'item is being selected
	End If
	If e.CommandName = RadTreeList.DeselectCommandName Then
		'item is being deselected
	End If
End Sub
````

## Programmatic items selection

To select an item/items with server-side code, you can set the particular item/items **Selected** property to **true**:

````C#
protected void Page_PreRender(object sender, EventArgs e)
{
	TreeListDataItem item = RadTreeList1.Items[0];
	item.Selected = true;
}
````
````VB.NET
Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As EventArgs) Handles Me.PreRender
	Dim item As TreeListDataItem = RadTreeList1.Items(0)
	item.Selected = True
End Sub
````

## Deselecting items programmatically

To deselect an item/items programmatically, set its **Selected** property to **false**.

You can also call the **ClearSelectedItems()** method of the RadTreeList controlto deselect all selected items which are visible on the current page.


text:
<?php

namespace Bex\Behat\ScreenshotExtension\ServiceContainer;

use Behat\Testwork\ServiceContainer\Extension;
use Behat\Testwork\ServiceContainer\ExtensionManager;
use Bex\Behat\ExtensionDriverLocator\DriverLocator;
use Bex\Behat\ExtensionDriverLocator\DriverNodeBuilder;
use Bex\Behat\ScreenshotExtension\Driver\ImageDriverInterface;
use Bex\Behat\ScreenshotExtension\ServiceContainer\Config;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;

/**
 * This class is the entry point of the screenshot extension
 *
 * It provides debugging functionality by taking a screenshot of a failed tests.
 *
 * @license http://opensource.org/licenses/MIT The MIT License
 */
final class ScreenshotExtension implements Extension
{
    /**
     * @var DriverNodeBuilder
     */
    private $driverNodeBuilder;

    /**
     * Constuctor: init extension
     */
    public function __construct()
    {
        $this->driverNodeBuilder = DriverNodeBuilder::getInstance(
            Config::IMAGE_DRIVER_NAMESPACE,
            Config::IMAGE_DRIVER_PARENT
        );
    }

    /**
     * {@inheritdoc}
     */
    public function getConfigKey()
    {
        return Config::EXTENSION_CONFIG_KEY;
    }

    /**
     * {@inheritdoc}
     */
    public function process(ContainerBuilder $container)
    {

    }

    /**
     * {@inheritdoc}
     */
    public function initialize(ExtensionManager $extensionManager)
    {

    }

    /**
     * {@inheritdoc}
     */
    public function configure(ArrayNodeDefinition $builder)
    {
        $this->configureExtensionParams($builder);
        $this->configureDriverParams($builder);
    }

    /**
     * {@inheritdoc}
     */
    public function load(ContainerBuilder $container, array $config)
    {
        $extensionConfig = new Config($config);

        if ($extensionConfig->isEnabled()) {
            $extensionConfig->loadServices($container);
            $container->set(Config::CONFIG_CONTAINER_ID, $extensionConfig);
        }
    }

    private function configureExtensionParams(ArrayNodeDefinition $builder)
    {
        $builder
            ->children()
                ->booleanNode(Config::CONFIG_PARAM_EXTENSTION_ENABLED)
                    ->defaultTrue()
                ->end()
                ->enumNode(Config::CONFIG_PARAM_SCREENSHOT_TAKING_MODE)
                    ->values(Config::getScreenshotTakingModes())
                    ->defaultValue(Config::DEFAULT_SCREENSHOT_TAKING_MODE)
                    ->validate()
                        ->ifTrue(Config::getScreenshotTakingModeValidator())
                        ->thenInvalid(Config::ERROR_MESSAGE_IMAGICK_NOT_FOUND)
                    ->end()
                ->end()
            ->end();
    }

    private function configureDriverParams(ArrayNodeDefinition $builder)
    {
        $this->driverNodeBuilder->buildDriverNodes(
            $builder,
            Config::CONFIG_PARAM_ACTIVE_IMAGE_DRIVERS,
            Config::CONFIG_PARAM_IMAGE_DRIVER_CONFIGS,
            [Config::DEFAULT_IMAGE_DRIVER_KEY]
        );
    }
}


text:
angular.module("umbraco").controller("Umbraco.PrevalueEditors.MultiColorPickerController",
    function ($scope, $timeout, assetsService, angularHelper, $element, localizationService, eventsService) {
        //NOTE: We need to make each color an object, not just a string because you cannot 2-way bind to a primitive.
        var defaultColor = "000000";
        var defaultLabel = null;

        $scope.newColor = defaultColor;
        $scope.newLabel = defaultLabel;
        $scope.hasError = false;
        $scope.focusOnNew = false;

        $scope.labels = {};

        var labelKeys = [
            "general_cancel",
            "general_choose"
        ];

        $scope.labelEnabled = false;
        eventsService.on("toggleValue", function (e, args) {
            $scope.labelEnabled = args.value;
        });

        localizationService.localizeMany(labelKeys).then(function (values) {
            $scope.labels.cancel = values[0];
            $scope.labels.choose = values[1];
        });

        assetsService.load([
            //"lib/spectrum/tinycolor.js",
            "lib/spectrum/spectrum.js"
        ], $scope).then(function () {
            var elem = $element.find("input[name='newColor']");
            elem.spectrum({
                color: null,
                showInitial: false,
                chooseText: $scope.labels.choose,
                cancelText: $scope.labels.cancel,
                preferredFormat: "hex",
                showInput: true,
                clickoutFiresChange: true,
                hide: function (color) {
                    //show the add butotn
                    $element.find(".btn.add").show();
                },
                change: function (color) {
                    angularHelper.safeApply($scope, function () {
                        $scope.newColor = color.toHexString().trimStart("#"); // #ff0000
                    });
                },
                show: function() {
                    //hide the add butotn
                    $element.find(".btn.add").hide();
                }
            });
        });

        if (!Utilities.isArray($scope.model.value)) {
            //make an array from the dictionary
            var items = [];
            for (var i in $scope.model.value) {
                var oldValue = $scope.model.value[i];
                if (oldValue.hasOwnProperty("value")) {
                    items.push({
                        value: oldValue.value,
                        label: oldValue.label,
                        sortOrder: oldValue.sortOrder,
                        id: i
                    });
                } else {
                    items.push({
                        value: oldValue,
                        label: oldValue,
                        sortOrder: sortOrder,
                        id: i
                    });
                }
            }

            //ensure the items are sorted by the provided sort order
            items.sort(function (a, b) { return (a.sortOrder > b.sortOrder) ? 1 : ((b.sortOrder > a.sortOrder) ? -1 : 0); });

            //now make the editor model the array
            $scope.model.value = items;
        }

        // ensure labels
        for (var i = 0; i < $scope.model.value.length; i++) {
            var item = $scope.model.value[i];
            item.label = item.hasOwnProperty("label") ? item.label : item.value;
        }

        function validLabel(label) {
            return label !== null && typeof label !== "undefined" && label !== "" && label.length && label.length > 0;
        }

        $scope.remove = function (item, evt) {

            evt.preventDefault();

            $scope.model.value = _.reject($scope.model.value, function (x) {
                return x.value === item.value && x.label === item.label;
            });

            angularHelper.getCurrentForm($scope).$setDirty();
        };

        $scope.add = function (evt) {
            evt.preventDefault();

            if ($scope.newColor) {
                var newLabel = validLabel($scope.newLabel) ? $scope.newLabel : $scope.newColor;
                var exists = _.find($scope.model.value, function(item) {
                    return item.value.toUpperCase() === $scope.newColor.toUpperCase() || item.label.toUpperCase() === newLabel.toUpperCase();
                });
                if (!exists) {
                    $scope.model.value.push({
                        value: $scope.newColor,
                        label: newLabel
                    });
                    $scope.newLabel = "";
                    $scope.hasError = false;
                    $scope.focusOnNew = true;
                    angularHelper.getCurrentForm($scope).$setDirty();
                    return;
                }

                //there was an error, do the highlight (will be set back by the directive)
                $scope.hasError = true;
            }

        };

        $scope.sortableOptions = {
            axis: 'y',
            containment: 'parent',
            cursor: 'move',
            //handle: ".handle, .thumbnail",
            items: '> div.control-group',
            tolerance: 'pointer',
            update: function (e, ui) {
                angularHelper.getCurrentForm($scope).$setDirty();
            }
        };

        //load the separate css for the editor to avoid it blocking our js loading
        assetsService.loadCss("lib/spectrum/spectrum.css", $scope);
    });


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Data;
using Viteyka.ORM.Contexts;
using Viteyka.ORM.Helpers;

namespace Viteyka.ORM.Builders
{
    internal class CommandBuilder : CommandBuilderBase
    {
        public static IDbCommand BuildSelect<T>(IDbConnection connection, IClassMap<T> classMap)
        {
            var ctx = new QueryContext(classMap);
            var columnList = classMap.Properties.Aggregate(string.Empty, GetColumnListAggregator(ctx.AliasForTable(classMap)));

            return DbCommandDecorator.Create(connection, String.Format(SELECTALL, columnList, classMap.TableName, ctx.AliasForTable(classMap)));
        }

        public static IDbCommand BuildSelect<T>(IDbConnection connection, IClassMap<T> classMap, Expression<Func<T, bool>> predicate)
        {
            if (predicate == null)
                throw new ArgumentNullException("predicate");

            var ctx = new QueryContext(classMap);
            var columnList = classMap.Properties.Aggregate(string.Empty, GetColumnListAggregator(ctx.AliasForTable(classMap)));

            var command = DbCommandDecorator.Create(connection);
            var visitor = new PredicateVisitor(ctx);
            visitor.Visit(predicate.Body);
            foreach (var pair in visitor.Parameters)
                command.AddParam(pair.Key, pair.Value);
            command.CommandText = String.Format(SELECT, columnList, classMap.TableName, ctx.AliasForTable(classMap), visitor.ToString());
            return command;
        }

        public static IDbCommand BuildSelect<T, TProperty>(IDbConnection connection, IClassMap<T> classMap, Expression<Func<T, bool>> predicate, PageFilter<T, TProperty> pageFilter)
        {
            if (classMap == null)
                throw new ArgumentNullException("classMap");
            if (pageFilter == null)
                throw new ArgumentNullException("pageFilter");

            var ctx = new QueryContext(classMap);
            var filterColumn = ctx.AliasForColumn();
            var columnList = String.Format("row_number() over (order by [{0}] {1}) {2}, {3}",
                    MemberHelper.GetName(pageFilter.OrderProperty), pageFilter.Desc ? "desc" : "asc", filterColumn,
                    classMap.Properties.Aggregate(string.Empty, GetColumnListAggregator(ctx.AliasForTable(classMap))));
            var command = DbCommandDecorator.Create(connection);
            if (predicate != null)
            {
                var visitor = new PredicateVisitor(ctx);
                visitor.Visit(predicate.Body);
                foreach (var pair in visitor.Parameters)
                    command.AddParam(pair.Key, pair.Value);
                command.CommandText = String.Format(SELECT, columnList, classMap.TableName, ctx.AliasForTable(classMap), visitor.ToString());
            }
            else
                command.CommandText = String.Format(SELECTALL, columnList, classMap.TableName, ctx.AliasForTable(classMap));

            var fromParam = command.AddParam(null, pageFilter.From);
            var toParam = command.AddParam(null, pageFilter.To);
            command.CommandText = String.Format("select {4} from ({0}) d where d.[{1}] between {2} and {3} order by d.[{1}] asc",
                command.CommandText, filterColumn, fromParam.ParameterName, toParam.ParameterName,
                classMap.Properties.Aggregate(string.Empty, GetPropListAggregator("d")));
            return command;
        }

        public static IDbCommand BuildJoin<T, T1>(IDbConnection connection, IClassMap<T> classMap, IClassMap<T1> joinMap, Expression<Func<T, T1, bool>> predicate)
        {
            if (classMap == null)
                throw new ArgumentNullException("classMap");
            if (joinMap == null)
                throw new ArgumentNullException("joinMap");
            if (predicate == null)
                throw new ArgumentNullException("predicate");

            var ctx = new QueryContext(classMap, joinMap);
            var columnList = classMap.Properties.Aggregate(string.Empty, GetColumnListAggregator(ctx.AliasForTable(classMap)));
            var command = DbCommandDecorator.Create(connection);
            var visitor = new PredicateVisitor(ctx);
            visitor.Visit(predicate.Body);
            foreach (var pair in visitor.Parameters)
                command.AddParam(pair.Key, pair.Value);
            command.CommandText = String.Format(SELECTJOIN, columnList, classMap.TableName, ctx.AliasForTable(classMap), joinMap.TableName, ctx.AliasForTable(joinMap), visitor.ToString());
            return command;
        }

        public static IDbCommand BuildJoin<T, T1, TProperty>(IDbConnection connection, IClassMap<T> classMap, IClassMap<T1> joinMap, Expression<Func<T, T1, bool>> predicate, PageFilter<T, TProperty> pageFilter)
        {
            if (classMap == null)
                throw new ArgumentNullException("classMap");
            if (joinMap == null)
                throw new ArgumentNullException("joinMap");
            if (predicate == null)
                throw new ArgumentNullException("predicate");

            var ctx = new QueryContext(classMap, joinMap);
            var filterColumn = ctx.AliasForColumn();
            var columnList = String.Format("row_number() over (order by [{0}] {1}) {2}, {3}",
                    MemberHelper.GetName(pageFilter.OrderProperty), pageFilter.Desc ? "desc" : "asc", filterColumn,
                    classMap.Properties.Aggregate(string.Empty, GetColumnListAggregator(ctx.AliasForTable(classMap))));
            var command = DbCommandDecorator.Create(connection);
            var visitor = new PredicateVisitor(ctx);
            visitor.Visit(predicate.Body);
            foreach (var pair in visitor.Parameters)
                command.AddParam(pair.Key, pair.Value);
            command.CommandText = String.Format(SELECTJOIN, columnList, classMap.TableName, ctx.AliasForTable(classMap), joinMap.TableName, ctx.AliasForTable(joinMap), visitor.ToString());

            var fromParam = command.AddParam(null, pageFilter.From);
            var toParam = command.AddParam(null, pageFilter.To);
            command.CommandText = String.Format("select {4} from ({0}) d where d.[{1}] between {2} and {3} order by d.[{1}] asc",
                command.CommandText, filterColumn, fromParam.ParameterName, toParam.ParameterName,
                classMap.Properties.Aggregate(string.Empty, GetPropListAggregator("d")));
            return command;
        }

        public static IDbCommand BuildExecProc<T>(IDbConnection connection, IClassMap<T> classMap, string procName, object parameters)
        {
            if (procName == null)
                throw new ArgumentNullException("procName");

            var command = DbCommandDecorator.Create(connection, procName, CommandType.StoredProcedure);
            if (parameters != null)
            {
                foreach (var prop in parameters.GetType().GetProperties())
                    if (prop.CanRead)
                        command.AddParam("@" + prop.Name, prop.GetValue(parameters, null));
            }
            return command;
        }

        public static IDbCommand BuildCount<T>(IDbConnection connection, IClassMap<T> classMap)
        {
            if (classMap == null)
                throw new ArgumentNullException("classMap");

            var ctx = new QueryContext(classMap);
            var command = DbCommandDecorator.Create(connection);
            command.CommandText = String.Format(SELECTALL, "count(1)", classMap.TableName, ctx.AliasForTable(classMap));
            return command;
        }

        public static IDbCommand BuildCount<T>(IDbConnection connection, IClassMap<T> classMap, Expression<Func<T, bool>> predicate)
        {
            if (classMap == null)
                throw new ArgumentNullException("classMap");
            if (predicate == null)
                throw new ArgumentNullException("predicate");

            var ctx = new QueryContext(classMap);
            var command = DbCommandDecorator.Create(connection);
            var visitor = new PredicateVisitor(ctx);
            visitor.Visit(predicate.Body);
            foreach (var pair in visitor.Parameters)
                command.AddParam(pair.Key, pair.Value);
            command.CommandText = String.Format(SELECT, "count(1)", classMap.TableName, ctx.AliasForTable(classMap), visitor.ToString());
            return command;
        }

        public static IDbCommand BuildSum<T, TProperty>(IDbConnection connection, IClassMap<T> classMap, Expression<Func<T, TProperty>> property)
        {
            if (classMap == null)
                throw new ArgumentNullException("classMap");
            if (property == null)
                throw new ArgumentNullException("property");

            var ctx = new QueryContext(classMap);
            var command = DbCommandDecorator.Create(connection);
            var propertyMap = classMap.Properties.Single(it => it.Alias == MemberHelper.GetName(property));
            var sumStr = String.Format(propertyMap.IsColumnDiffer ? "sum({0})" : "sum({1}.[{0}])", propertyMap.ColumnNameOrFormula, ctx.AliasForTable(classMap));
            command.CommandText = String.Format(SELECTALL, sumStr, classMap.TableName, ctx.AliasForTable(classMap));
            return command;
        }

        public static IDbCommand BuildSum<T, TProperty>(IDbConnection connection, IClassMap<T> classMap, Expression<Func<T, TProperty>> property, Expression<Func<T, bool>> predicate)
        {
            if (classMap == null)
                throw new ArgumentNullException("classMap");
            if (property == null)
                throw new ArgumentNullException("property");
            if (predicate == null)
                throw new ArgumentNullException("predicate");

            var ctx = new QueryContext(classMap);
            var command = DbCommandDecorator.Create(connection);
            var visitor = new PredicateVisitor(ctx);
            visitor.Visit(predicate.Body);
            foreach (var pair in visitor.Parameters)
                command.AddParam(pair.Key, pair.Value);
            var propertyMap = classMap.Properties.Single(it => it.Alias == MemberHelper.GetName(property));
            var sumStr = String.Format(propertyMap.IsColumnDiffer ? "sum({0})" : "sum({1}.[{0}])", propertyMap.ColumnNameOrFormula, ctx.AliasForTable(classMap));
            command.CommandText = String.Format(SELECT, sumStr, classMap.TableName, ctx.AliasForTable(classMap), visitor.ToString());
            return command;
        }

        public static IDbCommand BuildInsert<T>(IDbConnection connection, IClassMap<T> classMap, T item)
        {
            if (classMap == null)
                throw new ArgumentNullException("classMap");
            if (item == null)
                throw new ArgumentNullException("item");

            var command = DbCommandDecorator.Create(connection);
            var columnList = classMap.Properties.Where(it => !it.IsIdentity && !it.IsReadOnly)
                .Aggregate(string.Empty, (accum, val) => String.Format("{0}, [{1}]", accum, val.ColumnNameOrFormula)).Trim(',').Trim();
            foreach (var columnMap in classMap.Properties.Where(it => !it.IsIdentity && !it.IsReadOnly))
                command.AddParam(null, GetPropertyValue(item, columnMap));
            var paramList = command.Parameters.OfType<IDbDataParameter>().Aggregate(string.Empty, (accum, val) => String.Format("{0}, {1}", accum, val)).Trim(',').Trim();
            command.CommandText = String.Format(INSERT, classMap.TableName, columnList, paramList);
            return command;
        }

        public static IDbCommand BuildUpdate<T>(IDbConnection connection, IClassMap<T> classMap, T item)
        {
            if (classMap == null)
                throw new ArgumentNullException("classMap");
            if (item == null)
                throw new ArgumentNullException("item");

            if (!classMap.Properties.Any(it => it.IsPrimaryKey))
                throw new InvalidOperationException("Primary key is not configured.");

            var command = DbCommandDecorator.Create(connection);
            var where = new Dictionary<string, string>();
            foreach (var primaryKeyMap in classMap.Properties.Where(it => it.IsPrimaryKey))
            {
                var param = command.AddParam(null, GetPropertyValue(item, primaryKeyMap));
                where.Add(primaryKeyMap.ColumnNameOrFormula, param.ParameterName);
            }
            var set = new Dictionary<string, string>();
            foreach (var columnMap in classMap.Properties.Where(it => !it.IsIdentity && !it.IsReadOnly))
            {
                var param = command.AddParam(null, GetPropertyValue(item, columnMap));
                set.Add(columnMap.ColumnNameOrFormula, param.ParameterName);
            }
            command.CommandText = String.Format(UPDATE, classMap.TableName,
                set.Aggregate(string.Empty, (accum, value) => String.Format("{0}, [{1}] = {2}", accum, value.Key, value.Value)).Trim(',').Trim(),
                where.Aggregate(string.Empty, GetWhereAggregator()));
            return command;
        }

        public static IDbCommand BuildDelete<T>(IDbConnection connection, IClassMap<T> classMap, T item)
        {
            if (classMap == null)
                throw new ArgumentNullException("classMap");
            if (item == null)
                throw new ArgumentNullException("item");

            if (!classMap.Properties.Any(it => it.IsPrimaryKey))
                throw new InvalidOperationException("Primary key is not configured.");

            var command = DbCommandDecorator.Create(connection);
            var where = new Dictionary<string, string>();
            foreach (var primaryKeyMap in classMap.Properties.Where(it => it.IsPrimaryKey))
            {
                var param = command.AddParam(null, GetPropertyValue(item, primaryKeyMap));
                where.Add(primaryKeyMap.ColumnNameOrFormula, param.ParameterName);
            }
            command.CommandText = String.Format(DELETE, classMap.TableName, where.Aggregate(string.Empty, GetWhereAggregator()));
            return command;
        }

        #region Private methods

        private static object GetPropertyValue<T>(T item, IPropertyMap<T> propertyMap)
        {
            if (item != null && propertyMap != null && propertyMap.Getter != null)
                return propertyMap.Getter(item) ?? System.DBNull.Value;
            else
                return System.DBNull.Value;
        }

        #endregion
    }
}


text:
namespace RapidVulkan
{
  //! This object is movable so it can be thought of as behaving in the same was as a unique_ptr and is compatible with std containers
  class QueryPool
  {
    VkDevice m_device{VK_NULL_HANDLE};
    VkQueryPool m_queryPool{VK_NULL_HANDLE};

  public:
    QueryPool(const QueryPool&) = delete;
    QueryPool& operator=(const QueryPool&) = delete;

    //! @brief Move assignment operator
    QueryPool& operator=(QueryPool&& other) noexcept
    {
      if (this != &other)
      {
        // Free existing resources then transfer the content of other to this one and fill other with default values
        if (IsValid())
        {
          Reset();
        }

        // Claim ownership here
        m_device = other.m_device;
        m_queryPool = other.m_queryPool;

        // Remove the data from other
        other.m_device = VK_NULL_HANDLE;
        other.m_queryPool = VK_NULL_HANDLE;
      }
      return *this;
    }

    //! @brief Move constructor
    //! Transfer ownership from other to this
    QueryPool(QueryPool&& other) noexcept
      : m_device(other.m_device)
      , m_queryPool(other.m_queryPool)
    {
      // Remove the data from other
      other.m_device = VK_NULL_HANDLE;
      other.m_queryPool = VK_NULL_HANDLE;
    }

    //! @brief Create a 'invalid' instance (use Reset to populate it)
    QueryPool()

        = default;

    //! @brief Assume control of the QueryPool (this object becomes responsible for releasing it)
    explicit QueryPool(const ClaimMode claimMode, const VkDevice device, const VkQueryPool queryPool)
      : QueryPool()
    {
      Reset(claimMode, device, queryPool);
    }

    //! @brief Create the requested resource
    //! @note  Function: vkCreateQueryPool
    QueryPool(const VkDevice device, const VkQueryPoolCreateInfo& createInfo)
      : QueryPool()
    {
      Reset(device, createInfo);
    }

#ifndef RAPIDVULKAN_DISABLE_UNROLLED_STRUCT_METHODS
    //! @brief Create the requested resource
    //! @note  Function: vkCreateQueryPool
    QueryPool(const VkDevice device, const VkQueryPoolCreateFlags flags, const VkQueryType queryType, const uint32_t queryCount, const VkQueryPipelineStatisticFlags pipelineStatistics)
      : QueryPool()
    {
      Reset(device, flags, queryType, queryCount, pipelineStatistics);
    }
#endif

    ~QueryPool()
    {
      Reset();
    }

    //! @brief returns the managed handle and releases the ownership.
    RAPIDVULKAN_FUNC_WARN_UNUSED_RESULT VkQueryPool Release()
    {
      const auto resource = m_queryPool;
      m_device = VK_NULL_HANDLE;
      m_queryPool = VK_NULL_HANDLE;
      return resource;
    }

    //! @brief Destroys any owned resources and resets the object to its default state.
    void Reset() noexcept
    {
      if (! IsValid())
      {
        return;
      }

      assert(m_device != VK_NULL_HANDLE);
      assert(m_queryPool != VK_NULL_HANDLE);

      vkDestroyQueryPool(m_device, m_queryPool, nullptr);
      m_device = VK_NULL_HANDLE;
      m_queryPool = VK_NULL_HANDLE;
    }

    //! @brief Destroys any owned resources and assume control of the QueryPool (this object becomes responsible for releasing it)
    void Reset(const ClaimMode claimMode, const VkDevice device, const VkQueryPool queryPool)
    {
      if (IsValid())
      {
        Reset();
      }

      m_device = device;
      m_queryPool = queryPool;
    }

    //! @brief Destroys any owned resources and then creates the requested one
    //! @note  Function: vkCreateQueryPool
    void Reset(const VkDevice device, const VkQueryPoolCreateInfo& createInfo)
    {
#ifndef RAPIDVULKAN_DISABLE_PARAM_VALIDATION
      if (device == VK_NULL_HANDLE)
      {
        throw std::invalid_argument("device can not be VK_NULL_HANDLE");
      }
#else
      assert(device != VK_NULL_HANDLE);
#endif

      // Free any currently allocated resource
      if (IsValid())
      {
        Reset();
      }

      // Since we want to ensure that the resource is left untouched on error we use a local variable as a intermediary
      VkQueryPool queryPool;
      CheckError(vkCreateQueryPool(device, &createInfo, nullptr, &queryPool), "vkCreateQueryPool", __FILE__, __LINE__);

      // Everything is ready, so assign the members
      m_device = device;
      m_queryPool = queryPool;
    }

#ifndef RAPIDVULKAN_DISABLE_UNROLLED_STRUCT_METHODS
    //! @brief Destroys any owned resources and then creates the requested one
    //! @note  Function: vkCreateQueryPool
    void Reset(const VkDevice device, const VkQueryPoolCreateFlags flags, const VkQueryType queryType, const uint32_t queryCount, const VkQueryPipelineStatisticFlags pipelineStatistics)
    {
      VkQueryPoolCreateInfo createInfo{};
      createInfo.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO;
      createInfo.pNext = nullptr;
      createInfo.flags = flags;
      createInfo.queryType = queryType;
      createInfo.queryCount = queryCount;
      createInfo.pipelineStatistics = pipelineStatistics;

      Reset(device, createInfo);
    }
#endif

    //! @brief Get the associated 'Device'
    VkDevice GetDevice() const
    {
      return m_device;
    }

    //! @brief Get the associated resource handle
    VkQueryPool Get() const
    {
      return m_queryPool;
    }

    //! @brief Get a pointer to the associated resource handle
    const VkQueryPool* GetPointer() const
    {
      return &m_queryPool;
    }

    //! @brief Check if this object contains a valid resource
    inline bool IsValid() const
    {
      return m_queryPool != VK_NULL_HANDLE;
    }

    //! @note  Function: vkGetQueryPoolResults
    void GetQueryPoolResults(const uint32_t firstQuery, const uint32_t queryCount, const size_t dataSize, void * pData, const VkDeviceSize stride, const VkQueryResultFlags flags)
    {
      CheckError(vkGetQueryPoolResults(m_device, m_queryPool, firstQuery, queryCount, dataSize, pData, stride, flags), "vkGetQueryPoolResults", __FILE__, __LINE__);
    }

#if VK_HEADER_VERSION >= 131
    //! @note  Function: vkResetQueryPool
    void ResetQueryPool(const uint32_t firstQuery, const uint32_t queryCount)
    {
      vkResetQueryPool(m_device, m_queryPool, firstQuery, queryCount);
    }
#endif
  };
}

#endif


text:
<!DOCTYPE html>

    <title></title>

    <link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/css/bootstrap.min.css" media="all" />
    <link rel="stylesheet" type="text/css" href="css/simon.css" media="all" />


text:
layout: page
title: Talks
permalink: /talks/
---

Here is a list of the talks that I have given on various meetups and
conferences:

{% for cat in site.data.talks %}
## {{ cat.language }}
{% include talk-list.md talks=cat.talks %}
---
{% endfor %}


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

<TITLE>
Uses of Class com.google.flightmap.android.map.MapPresenter (Flight Map android)
</TITLE>

<META NAME="date" CONTENT="2011-02-02">

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

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
com.google.flightmap.android.map.MapPresenter

Packages that use MapPresenter

com.google.flightmap.android.map

Uses of MapPresenter in com.google.flightmap.android.map

Fields in com.google.flightmap.android.map declared as MapPresenter

private  MapPresenter
MapView.presenter

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


text:
const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
const find = require('lodash/find');

module.exports = createTransactionalMigration(
    async function up(knex) {
        logging.info('Migrating sender settings to default newsletter');

        // Get all settings in one query
        const settings = await knex('settings')
            .whereIn('key', [
                'members_from_address',
                'members_reply_address'
            ])
            .select(['key', 'value']);

        // sender_reply_to and members_reply_address are both enums ['newsletter', 'support']
        const replyTo = find(settings, {key: 'members_reply_address'});
        const fromAddress = find(settings, {key: 'members_from_address'});

        // Update all newsletters that haven't been (re)configured already
        await knex('newsletters')
            .update({
                // CASE: members_from_address is 'noreply' - we leave it as null to maintain fallback behaviour
                sender_email: !fromAddress || fromAddress.value === 'noreply' ? null : fromAddress.value,
                sender_reply_to: replyTo ? replyTo.value : undefined
            })
            .whereNull('sender_email')
            .where('sender_reply_to', 'newsletter');
    },
    async function down() {
        // no-op
    }
);


text:
<ion-view view-title="Badge">
    <ion-content class="module-action">
        <button class="button button-block button-calm" ng-click="addBadge()">
            Add Badge
        </button>
        <button class="button button-block button-positive" ng-click="clearBadge()">
            Clear Badge
        </button>

    </ion-content>
</ion-view>


text:
<?php
    $this->load->view('template/header');

?>

<form method="post" action="<?php echo base_url();?>house/update">

House Damage

 Name of Owner:

                <input type="text" class="form-control" value="<?php echo $data['name'];?>" name="name" id="" placeholder="Name" ng-model="data.name" required>

Father Name:

                   <input type="text" class="form-control" name="fathername" value="<?php echo $data['father_name'];?>"id="" placeholder="Father Name" ng-model="data.fathername">

Date of Incident:

<input type="date" class="form-control" name="incidentdate" value="<?php echo $data['date_of_incident'];?>" ng-model="data.incidentdate">

Cnic Number:

                       <input type="text" class="form-control" name="cnic" id="" value="<?php echo $data['cnic'];?>" placeholder="CNIC Number" ng-model="data.cnicnumber">

District

                    <select class="form-control input-sm" name="district" ng-model="data.district">
                    <option selected="selected">
                        <?php echo $data['district'];?>
                    </optiion>
                             <option>Abbottabad</option>
                            <option>Bannu</option>
                             <option>Batagram</option>
                             <option>Buner</option>
                             <option>Charsadda</option>
                             <option>Chitral</option>
                            <option>Dera Ismail Khan</option>
                             <option>Hangu</option>
                             <option>Haripur</option>
                             <option>Karak</option>
                             <option>Kohat</option>
                             <option>Kohistan</option>
                             <option>Lakki Marwat</option>
                             <option>Lower Dir</option>
                             <option>Malakand</option>
                             <option>Mansehra</option>
                             <option>Mardan</option>
                             <option>Nowshera</option>
                             <option>Peshawar</option>
                             <option>Shangla</option>
                             <option>Swabi</option>
                            <option>Swat</option>
                             <option>Tank</option>
                             <option>Tor Ghar</option>
                             <option>Upper Dir</option>
                             <option>Lower Kohistan</option>

                      </select>

 Address:

                       <input type="text" class="form-control" name="address" id="" value="<?php echo $data['address'];?>"placeholder="Address" ng-model="data.address">

Nature of Clamity:

                    <select class="form-control input-sm" name="reason" ng-model="data.reason">
                    <optiion selected="selected"><?php
                    echo $data['hd_reason'];?></optiion>
                            <option >Flood </option>
                            <option >Earth Quake</option>
                             <option> Thunder Storm</option>
                      </select>

Budget

                        <select name="budget" required="required">
                        <?php
                        foreach ($budget as $b) {
                        ?>
                            <option value="<?php echo $b->b_id?>"
                            <?php
                            if($data['b_id']==$b->b_id)
                                echo 'selected';
                            ?>
                            ><?php echo $b->b_amount;?></option>
                        <?php
                        }
                        ?>
                        </select>

                        Special Compensation <input type="checkbox" name="" id="compensation-checkbox">

                        <input type="text" name="" class="form-control" id="compensation-amount" disabled ng-model="data.special_compensation">

House Damage:

                <input type="radio" name="housedamage" value="full"
                <?php
                if($data['damage_type'] == "full")
                echo 'checked';
                ?>
                > Fully Damage
                 <input type="radio" name="housedamage" value="partial"
                 <?php
                if($data['damage_type'] == "partial")
                echo 'checked';
                ?>
                > Partially Damage

Halqa patwari:

                  <input type="radio" name="patwari" value="yes"
                  <?php
                if($data['patwari'] == "yes")
                echo 'checked';
                ?>
                  >Yes
                 <input type="radio" name="patwari" value="no"
                 <?php
                if($data['patwari'] == "no")
                echo 'checked';
                ?>
                  >No

Rep of MPA:

                 <input type="radio" name="repofmpa" value="yes"
                 <?php
                if($data['rep_mpa'] == "yes")
                echo 'checked';
                ?>
                 > Yes
                 <input type="radio" name="repofmpa" value="no"
                 <?php
                if($data['rep_mpa'] == "no")
                echo 'checked';
                ?>
                 > No

Tehsildar:

                <input type="radio" name="tehsildar" value="yes"
                <?php
                if($data['tehsildar'] == "yes")
                echo 'checked';
                ?>
                > Yes
                 <input type="radio" name="tehsildar" value="no"
                <?php
                if($data['tehsildar'] == "no")
                echo 'checked';
                ?>
                 > No

Local School Headmaster:

                <input type="radio" name="headmaster" value="yes"
                <?php
                if($data['headmaster'] == "yes")
                echo 'checked';
                ?>
                > Yes
                 <input type="radio" name="headmaster" value="no"
                 <?php
                if($data['headmaster'] == "no")
                echo 'checked';
                ?>
                 > No

Local Imam Masjid:

                <input type="radio" name="imam" value="yes"
                <?php
                if($data['imam'] == "yes")
                echo 'checked';
                ?>
                > Yes
                 <input type="radio" name="imam" value="no"
                 <?php
                if($data['imam'] == "no")
                echo 'checked';
                ?>
                 > No

Counter Signed by DC :

               <input type="radio" name="dc" value="yes"
                <?php
                    if($data['dc'] == "yes")
                    echo 'checked';
                    ?>
                > Yes
                <input type="radio" name="dc" value="no"
                <?php
                    if($data['dc'] == "no")
                    echo 'checked';
                    ?>
                > No

                 <input type="hidden" value="<?php echo $data['hd_id']?>" name="hd_id">
            <button type="submit" class="btn btn-success">Update</button>

        </form>

<?php
$this->load->view('template/footer');

?>


text:
CREATE TABLE pgPolyphenPred (
    chrom varchar(255),	# Chromosome
    chromStart int unsigned,	# Start position in chrom
    chromEnd int unsigned,	# End position in chrom
    prediction varchar(255),	# polyphens prediction, damaging, benign,...
    basedOn varchar(255),	# prediction basis
    geneName varchar(255),	# gene/protein name
    aaChange varchar(255),	# amino acid change
              #Indices
    INDEX(chrom(20), chromStart)
);


text:
if [ $# -lt 1 ]; then
  echo "ERROR: Need at least 1 argument, $# were provided"
  exit 1
fi

pkg-resolver/check_platform.py "$1"
if [ $? -eq 1 ]; then
  echo "ERROR: Unsupported platform $1"
  exit 1
fi

default_version="8"
version_to_install=$default_version
if [ -n "$2" ]; then
  version_to_install="$2"
fi

if [ "$version_to_install" != "8" ]; then
  echo "WARN: Don't know how to install version $version_to_install, installing the default version $default_version instead"
  version_to_install=$default_version
fi

if [ "$version_to_install" == "8" ]; then
  mkdir -p /tmp/epel &&
    curl -L -s -S https://download-ib01.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
      -o /tmp/epel/epel-release-latest-8.noarch.rpm &&
    rpm -Uvh /tmp/epel/epel-release-latest-8.noarch.rpm
else
  echo "ERROR: Don't know how to install version $version_to_install"
  exit 1
fi


text:
from hodor import db
from sqlalchemy import inspect
from sqlalchemy_utils import PasswordType

class User(db.Model):
    __tablename__ = 'users'

    # Values entered by the user
    username = db.Column(db.String(32), primary_key=True, nullable=False)
    first_name = db.Column(db.String(32), nullable=False)
    last_name = db.Column(db.String(32), nullable=False)
    email = db.Column(db.String(64), unique=True, nullable=False)
    country = db.Column(db.String(64))
    avatar_url = db.Column(db.String(256))
    '''PasswordType is an awesome function. To check for passwords later,
        you can just do user['password'] == 'plaintext' for a boolean response.'''
    password = db.Column(PasswordType(
        schemes=[
            'pbkdf2_sha512',
            'md5_crypt'
        ],
        deprecated=['md5_crypt']
    ), nullable=False)

    # Platform values
    disabled = db.Column(db.Boolean, default=False)
    verified_account = db.Column(db.Boolean, default=False)
    verification_code = db.Column(db.String(32), nullable=False)

    def __unicode__(self):
        return unicode(self.username)

    def save(self):
        print type(self)
        print self.email
        db.session.add(self)
        db.session.commit()

    @staticmethod
    def get_all():
        return User.query.all()

    def get_all_dict(self):
        return {c.key: getattr(self, c.key)
                for c in inspect(self).mapper.column_attrs}

    def delete(self):
        db.session.delete(self)
        db.session.commit()

    def __repr__(self):
        return "<User: {}>".format(self.name)


text:
title: Mixer Handler
---
Mixer handler 相当于配置完备的 mixer 适配器。一个适配器二进制文件可以被不同配置使用,这些配置也可以称为 handler。在 mixer 运行时,mixer 将 [mixer instance](#mixer-instance) 路由到一个或多个 handler。


text:
A custom permutation cipher. This cipher is immune to frequency analysis attacks.

The permutation cipher works as follows. It takes as input a plaintext from a message space and a key randomly chosen from a key space and returns a ciphertext.

    The message space is the set {<space>,a,..,z}^L. In other words the message m can be written as m[1]...m[L], where each m[i] is in {<space>,a,...,z}

    The ciphertext c can be written as c[1],...,c[L], where each c[i] is in {<space>,0,..,102}. To avoid ambiguities, cyphertext symbols are separated by a comma.

    The key space is the set of random maps from {0,..,26} to a permutation of all numbers in {0,…,102}, grouped in 26 lists, each list having length determined by column 2 of the table below.

    The encryption algorithm works as follows. A space in the plaintext is mapped to a space in the ciphertext. For each message character m[j], the algorithm finds m[j] in column 1 of the table below, and returns one of the keys in column 3 of the same row. The computation of which key is returned by the algorithm is based on a scheduling algorithm which is intentionally left unknown and is a deterministic algorithm (that is, it does not use new random bits) that may depend on j, L and the length of the list on that row.

    The decryption algorithm does the inverse process. It maps space to a space in the plaintext. On any ciphertext character different from a space, it finds the ciphertext character in column 3 of the table, and returns the column 1 plaintext letter that is on the same row.

For instance, assume k(b,1)=23, k(c,1)=11, k(c,2)=98, k(c,3)=5, k(g,1)=34, k(g,2)=56. Then the plaintext "cbcb gbgg gcb" may be encrypted as "98,23,5,23 34,23,56,34 34,11,23"

| English Letters 	| Avg. Frequency 	| Key Values (randomly chosen distinct numbers between 0 and 102 	|
|:---------------:	|----------------	|----------------------------------------------------------------	|
|        a        	|        8       	|                        k(a,1),...,k(a,8)                       	|
|        b        	|        1       	|                             k(b,1)                             	|
|        c        	|        3       	|                        k(c,1),...,k(c,3)                       	|
|        d        	|        4       	|                        k(d,1),...,k(d,4)                       	|
|        e        	|       13       	|                       k(d,1),...,k(d,13)                       	|
|        f        	|        2       	|                               ...                              	|
|        g        	|        2       	|                                                                	|
|        h        	|        6       	|                                                                	|
|        i        	|        7       	|                                                                	|
|        j        	|        1       	|                                                                	|
|        k        	|        1       	|                                                                	|
|        l        	|        4       	|                                                                	|
|        m        	|        2       	|                                                                	|
|        n        	|        7       	|                                                                	|
|        o        	|        8       	|                                                                	|
|        p        	|        2       	|                                                                	|
|        q        	|        1       	|                                                                	|
|        r        	|        6       	|                                                                	|
|        s        	|        6       	|                                                                	|
|        t        	|        9       	|                                                                	|
|        u        	|        3       	|                                                                	|
|        v        	|        1       	|                                                                	|
|        w        	|        2       	|                                                                	|
|        x        	|        1       	|                                                                	|
|        y        	|        2       	|                                                                	|
|        z        	|        1       	|                                                                	|

## Download ZIP
* [Version 0.1](https://github.com/cnibley/permutation-cipher/archive/master.zip)

## Build
* Install Build Environoment Maven 3.3.9 or later from: [Maven](https://maven.apache.org/download.cgi)
* From the root folder run Maven:
```$ mvn clean install```
* A JAR will be built in the root directory of the project.

## Command Line Usage
* Install Java 1.8 JDK from: [1.8 JDK](http://www.oracle.com/technetwork/pt/java/javase/downloads/jdk8-downloads-2133151.html)
* To run the jar from the command line:
```$ java -jar permutation-cipher-0.0.1-SNAPSHOT.jar
...```

## Run Within IDE (optional)
* Using Maven in Eclipse for Java Developers
------------------------------------------
If m2e (Maven plugin) is not built into Eclipse, follow these steps to install the plugin:

  * Open Eclipse.
  * Go to Help -> Eclipse Marketplace.
  * Search for Maven.
  * Click "Install" button at "Maven Integration for Eclipse" or "m2e" section.
  * Follow the instruction step by step.,

Restart Eclipse after installing m2e.

* Build the project then run the src/main/java/com/heynt/permutation/main/Main.java main class within your IDE.

## Download Source:
```$ git clone https://github.com/cnibley/permutation-software.git
...```

### Contributors on GitHub
* [Contributors](https://github.com/cnibley/permutation-cipher/graphs/contributors)

### Third party libraries
* see [LIBRARIES](https://github.com/cnibley/permutation-cipher/blob/master/LIBRARIES.md) files

## License
* see [LICENSE](https://github.com/cnibley/permutation-cipher/blob/master/LICENSE.md) file

## Version
* Version 0.1

## Contact
#### Charley Nibley
* Twitter: [@cnibley](https://twitter.com/cnibley "cnibley on twitter")

<!--
[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=username&url=https://github.com/cnibley/permutation-cipher&title=permuation-cipher&language=en&tags=github&category=software) -->


text:
FactoryBot.define do
  factory :item do
    name { Faker::Food.name }
  end
end