text:
#include <aws/imagebuilder/model/ImagePipeline.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace imagebuilder
{
namespace Model
{

ImagePipeline::ImagePipeline() :
    m_arnHasBeenSet(false),
    m_nameHasBeenSet(false),
    m_descriptionHasBeenSet(false),
    m_platform(Platform::NOT_SET),
    m_platformHasBeenSet(false),
    m_enhancedImageMetadataEnabled(false),
    m_enhancedImageMetadataEnabledHasBeenSet(false),
    m_imageRecipeArnHasBeenSet(false),
    m_containerRecipeArnHasBeenSet(false),
    m_infrastructureConfigurationArnHasBeenSet(false),
    m_distributionConfigurationArnHasBeenSet(false),
    m_imageTestsConfigurationHasBeenSet(false),
    m_scheduleHasBeenSet(false),
    m_status(PipelineStatus::NOT_SET),
    m_statusHasBeenSet(false),
    m_dateCreatedHasBeenSet(false),
    m_dateUpdatedHasBeenSet(false),
    m_dateLastRunHasBeenSet(false),
    m_dateNextRunHasBeenSet(false),
    m_tagsHasBeenSet(false)
{
}

ImagePipeline::ImagePipeline(JsonView jsonValue) :
    m_arnHasBeenSet(false),
    m_nameHasBeenSet(false),
    m_descriptionHasBeenSet(false),
    m_platform(Platform::NOT_SET),
    m_platformHasBeenSet(false),
    m_enhancedImageMetadataEnabled(false),
    m_enhancedImageMetadataEnabledHasBeenSet(false),
    m_imageRecipeArnHasBeenSet(false),
    m_containerRecipeArnHasBeenSet(false),
    m_infrastructureConfigurationArnHasBeenSet(false),
    m_distributionConfigurationArnHasBeenSet(false),
    m_imageTestsConfigurationHasBeenSet(false),
    m_scheduleHasBeenSet(false),
    m_status(PipelineStatus::NOT_SET),
    m_statusHasBeenSet(false),
    m_dateCreatedHasBeenSet(false),
    m_dateUpdatedHasBeenSet(false),
    m_dateLastRunHasBeenSet(false),
    m_dateNextRunHasBeenSet(false),
    m_tagsHasBeenSet(false)
{
  *this = jsonValue;
}

ImagePipeline& ImagePipeline::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("arn"))
  {
    m_arn = jsonValue.GetString("arn");

    m_arnHasBeenSet = true;
  }

  if(jsonValue.ValueExists("name"))
  {
    m_name = jsonValue.GetString("name");

    m_nameHasBeenSet = true;
  }

  if(jsonValue.ValueExists("description"))
  {
    m_description = jsonValue.GetString("description");

    m_descriptionHasBeenSet = true;
  }

  if(jsonValue.ValueExists("platform"))
  {
    m_platform = PlatformMapper::GetPlatformForName(jsonValue.GetString("platform"));

    m_platformHasBeenSet = true;
  }

  if(jsonValue.ValueExists("enhancedImageMetadataEnabled"))
  {
    m_enhancedImageMetadataEnabled = jsonValue.GetBool("enhancedImageMetadataEnabled");

    m_enhancedImageMetadataEnabledHasBeenSet = true;
  }

  if(jsonValue.ValueExists("imageRecipeArn"))
  {
    m_imageRecipeArn = jsonValue.GetString("imageRecipeArn");

    m_imageRecipeArnHasBeenSet = true;
  }

  if(jsonValue.ValueExists("containerRecipeArn"))
  {
    m_containerRecipeArn = jsonValue.GetString("containerRecipeArn");

    m_containerRecipeArnHasBeenSet = true;
  }

  if(jsonValue.ValueExists("infrastructureConfigurationArn"))
  {
    m_infrastructureConfigurationArn = jsonValue.GetString("infrastructureConfigurationArn");

    m_infrastructureConfigurationArnHasBeenSet = true;
  }

  if(jsonValue.ValueExists("distributionConfigurationArn"))
  {
    m_distributionConfigurationArn = jsonValue.GetString("distributionConfigurationArn");

    m_distributionConfigurationArnHasBeenSet = true;
  }

  if(jsonValue.ValueExists("imageTestsConfiguration"))
  {
    m_imageTestsConfiguration = jsonValue.GetObject("imageTestsConfiguration");

    m_imageTestsConfigurationHasBeenSet = true;
  }

  if(jsonValue.ValueExists("schedule"))
  {
    m_schedule = jsonValue.GetObject("schedule");

    m_scheduleHasBeenSet = true;
  }

  if(jsonValue.ValueExists("status"))
  {
    m_status = PipelineStatusMapper::GetPipelineStatusForName(jsonValue.GetString("status"));

    m_statusHasBeenSet = true;
  }

  if(jsonValue.ValueExists("dateCreated"))
  {
    m_dateCreated = jsonValue.GetString("dateCreated");

    m_dateCreatedHasBeenSet = true;
  }

  if(jsonValue.ValueExists("dateUpdated"))
  {
    m_dateUpdated = jsonValue.GetString("dateUpdated");

    m_dateUpdatedHasBeenSet = true;
  }

  if(jsonValue.ValueExists("dateLastRun"))
  {
    m_dateLastRun = jsonValue.GetString("dateLastRun");

    m_dateLastRunHasBeenSet = true;
  }

  if(jsonValue.ValueExists("dateNextRun"))
  {
    m_dateNextRun = jsonValue.GetString("dateNextRun");

    m_dateNextRunHasBeenSet = true;
  }

  if(jsonValue.ValueExists("tags"))
  {
    Aws::Map<Aws::String, JsonView> tagsJsonMap = jsonValue.GetObject("tags").GetAllObjects();
    for(auto& tagsItem : tagsJsonMap)
    {
      m_tags[tagsItem.first] = tagsItem.second.AsString();
    }
    m_tagsHasBeenSet = true;
  }

  return *this;
}

JsonValue ImagePipeline::Jsonize() const
{
  JsonValue payload;

  if(m_arnHasBeenSet)
  {
   payload.WithString("arn", m_arn);

  }

  if(m_nameHasBeenSet)
  {
   payload.WithString("name", m_name);

  }

  if(m_descriptionHasBeenSet)
  {
   payload.WithString("description", m_description);

  }

  if(m_platformHasBeenSet)
  {
   payload.WithString("platform", PlatformMapper::GetNameForPlatform(m_platform));
  }

  if(m_enhancedImageMetadataEnabledHasBeenSet)
  {
   payload.WithBool("enhancedImageMetadataEnabled", m_enhancedImageMetadataEnabled);

  }

  if(m_imageRecipeArnHasBeenSet)
  {
   payload.WithString("imageRecipeArn", m_imageRecipeArn);

  }

  if(m_containerRecipeArnHasBeenSet)
  {
   payload.WithString("containerRecipeArn", m_containerRecipeArn);

  }

  if(m_infrastructureConfigurationArnHasBeenSet)
  {
   payload.WithString("infrastructureConfigurationArn", m_infrastructureConfigurationArn);

  }

  if(m_distributionConfigurationArnHasBeenSet)
  {
   payload.WithString("distributionConfigurationArn", m_distributionConfigurationArn);

  }

  if(m_imageTestsConfigurationHasBeenSet)
  {
   payload.WithObject("imageTestsConfiguration", m_imageTestsConfiguration.Jsonize());

  }

  if(m_scheduleHasBeenSet)
  {
   payload.WithObject("schedule", m_schedule.Jsonize());

  }

  if(m_statusHasBeenSet)
  {
   payload.WithString("status", PipelineStatusMapper::GetNameForPipelineStatus(m_status));
  }

  if(m_dateCreatedHasBeenSet)
  {
   payload.WithString("dateCreated", m_dateCreated);

  }

  if(m_dateUpdatedHasBeenSet)
  {
   payload.WithString("dateUpdated", m_dateUpdated);

  }

  if(m_dateLastRunHasBeenSet)
  {
   payload.WithString("dateLastRun", m_dateLastRun);

  }

  if(m_dateNextRunHasBeenSet)
  {
   payload.WithString("dateNextRun", m_dateNextRun);

  }

  if(m_tagsHasBeenSet)
  {
   JsonValue tagsJsonMap;
   for(auto& tagsItem : m_tags)
   {
     tagsJsonMap.WithString(tagsItem.first, tagsItem.second);
   }
   payload.WithObject("tags", std::move(tagsJsonMap));

  }

  return payload;
}

} // namespace Model
} // namespace imagebuilder
} // namespace Aws


text:
import Either from 'data.either';

const a  = Either.Left('fail');
const a2 = Either.Left('fail');
const b  = Either.Right(5);
const c  = Either.Right(10);
const d  = Either.of({a: 'alpha'});
const e  = Either.fromNullable(null);

const t: boolean = a.isLeft;
const f: boolean = a2.isRight;

const eq = a.isEqual(Either.Left('fail'));
const str: string = Either.Left('fail').toString();
const value: number = b.get();
const x: number = Either.Left('fail').getOrElse(10);
const y: string = Either.Left('fail').merge();
const z: {a: string, ...} = Either.of({a: 'alpha'}).merge();

const concatC = a => b => a.concat(b);

const applicative: Either<*, Array<string>> = Either.of(concatC)
  .ap(Either.of(['a']))
  .ap(Either.of(['b']));

const map = b.map(x => x + 5)
const chain = b.chain(x => x < 5 ? Either.Right(x + 5) : Either.Left('too big'));
const fold = Either.of('test').fold(l => String(l), r => r);
const cata = Either.of('test').cata({
  Left: l => new Error(l),
  Right: r => r.concat('test')
});
const swap: Either<*, string> = Either.Left('swapped').swap();
const bimap1: Either<number, *> = Either.Left('1').bimap(x => parseInt(x, 10), x => x);
const bimap2: Either<*, number> = Either.Right('1').bimap(x => x, x => parseInt(x, 10));
const leftMap: Either<number, *> = Either.Left('1').leftMap(x => parseInt(x, 10));
const orElse: Either<number, *> = Either.Left('1').orElse(l => Either.Left(parseInt(l, 10)));
const concat: Either<*, string[]> = Either.Right(['a']).concat(Either.of(['b']));

// --- Errors
// $FlowExpectedError
const _eq = a.isEqual('fail');
// $FlowExpectedError
const _value: string = b.get();
// $FlowExpectedError
const _x: string = Either.Left('fail').getOrElse(10);
// $FlowExpectedError
const _y: number = Either.Left('fail').merge();
// $FlowExpectedError
const _applicative = Either.of(concat).ap('a').ap('b');
// $FlowExpectedError
const _map = b.map(1);
// $FlowExpectedError
const _chain = b.chain(x => x + x);
// $FlowExpectedError
const _fold: string = Either.of('test').fold((l): number => Number(l), (r): string => r);
// $FlowExpectedError
const _cata = Either.of('test').cata({
  ALeft: l => new Error(l),
  ARight: r => r.concat('test')
});
// $FlowExpectedError
const _bimap: Either<*, number> = Either.Right('1').bimap(x => x);
// $FlowExpectedError
const _leftMap: Either<number, *> = Either.Left('1').leftMap(x => x);
// $FlowExpectedError
const _orElse: Either<number, *> = Either.Left('1').orElse(l => l);
// $FlowExpectedError
const _concat: Either<*, string[]> = Either.Right(1).concat(['b']);

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    android:key="app_prefs"
    android:title="@string/prefs_title" >

    <ListPreference
        android:defaultValue="@string/pref_display_lang_default"
        android:dialogTitle="@string/pref_display_lang_title"
        android:entries="@array/pref_display_names"
        android:entryValues="@array/pref_display_values"
        android:key="pref_currencies_language"
        android:persistent="true"
        android:title="@string/pref_display_lang_title" android:summary="@string/pref_display_lang_summary"/>

    <ListPreference
        android:defaultValue="@string/pref_precision_default"
        android:dialogTitle="@string/pref_precision_title"
        android:entries="@array/pref_precision_names"
        android:entryValues="@array/pref_precision_values"
        android:key="pref_currencies_precision"
        android:persistent="true"
        android:title="@string/pref_precision_title" android:summary="@string/pref_precision_summary"/>

    <Preference
        android:enabled="true"
        android:key="rateus"
        android:title="@string/pref_rateus_title" android:summary="@string/pref_rateus_summary"/>
    <Preference
        android:key="about"
        android:title="@string/pref_about_title" >
        <intent android:action="net.vexelon.bgrates.ui.activities.AboutActivity" />
    </Preference>

</PreferenceScreen>


text:
// Copyright (c) 2003 Compaq Corporation.  All rights reserved.
// Portions Copyright (c) 2003 Microsoft Corporation.  All rights reserved.
package tlc2.tool.fp;

import java.io.EOFException;
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
import java.rmi.RemoteException;

import tlc2.output.EC;
import tlc2.output.MP;
import tlc2.tool.TLCTrace;
import util.Assert;
import util.BufferedDataInputStream;
import util.BufferedDataOutputStream;
import util.FileUtil;

/**
 * MemFPSet2 is a subclass of {@link MemFPSet} that
 * implements a fingerprint set as a hashtable with a central spine
 * and collision buckets.
 *

 * This class recognizes the following attribute in its
 * alist argument:
 *

 * Name          Type     Default  Legal range  Meaning
 * ------------  -------  -------  -----------  ---------------------------------
 * LogSpineSize  Integer  24       [24 .. 30]   Log of size of hash table's spine
 *

 *

 * Collision buckets are implemented as arrays that are grown on
 * demand, one entry at a time.  The last 3 bytes of each fingerprint
 * is encoded in the bucket index, leaving 5 bytes to be stored in the
 * buckets.  Under the Compaq JVM with the -fast64 flag,
 * pointers are 8 bytes long, and the overhead per array is 16 bytes
 * (8 bytes object overhead, 4 bytes padding, and 4 bytes for the
 * length field).  Assuming a spine size of 224, the cost
 * of storing 230 fingerprints is 5.375 GB.
 */

public final class MemFPSet2 extends FPSet {
    private String metadir;
    private String filename;

    /* The hash table used to represent the set. */
    private byte[][] table;
    //@ invariant table.length > 0
    /*@ invariant (forall int i; 0 <= i & i

            table[i] == null | (table[i].length / 5) * 5 ==  table[i].length) */

    /* The total number of entries in the set. */
    private long count;

    /* The bit-mask used in hashing fingerprints. Relies on two assumptions:

 table.length is a power of 2

 fingerprints are so random that extracting parts of their bits
            makes a good hash function.

     */
    private int mask;
    //@ invariant mask == table.length - 1

    private int LogSpineSize = 24;

  /* Constructs a new, empty FPSet. */
  public MemFPSet2(final FPSetConfiguration fpSetConfig) throws RemoteException {
	super(fpSetConfig);
    int spineSize = 1 << LogSpineSize;
    this.count = 0;
    this.table = new byte[spineSize][];
    this.mask = spineSize - 1;
  }

  public FPSet init(int numThreads, String metadir, String fname) {
    this.metadir = metadir;
    this.filename = metadir + FileUtil.separator + fname;
	return this;
  }

  public synchronized final long size() { return this.count; }

  public synchronized final boolean put(long fp) {
        int index = (int)(fp & this.mask);
        byte[] bucket = this.table[index];
        byte b1 = (byte)((fp >>> 24) & 0xffL);
        byte b2 = (byte)((fp >>> 32) & 0xffL);
        byte b3 = (byte)((fp >>> 40) & 0xffL);
        byte b4 = (byte)((fp >>> 48) & 0xffL);
        byte b5 = (byte)((fp >>> 56) & 0xffL);
        // Test if the fingerprint is already in the hashtable.
        int len = bucket == null ? 0 : bucket.length;
        for (int i = 0; i < len; i += 5) {
            if (bucket[i  ] == b1 &&
                bucket[i+1] == b2 &&
                bucket[i+2] == b3 &&
                bucket[i+3] == b4 &&
                bucket[i+4] == b5) return true;
        }
        // bucket is full
        byte[] newBucket = new byte[len + 5];
        if (bucket != null) System.arraycopy(bucket, 0, newBucket, 0, len);
        this.table[index] = newBucket;
        newBucket[len  ] = b1;
        newBucket[len+1] = b2;
        newBucket[len+2] = b3;
        newBucket[len+3] = b4;
        newBucket[len+4] = b5;
        this.count++;
        return false;
  }

  public synchronized final boolean contains(long fp) {
    int index = (int)(fp & this.mask);
    byte[] bucket = this.table[index];
    byte b1 = (byte)((fp >>> 24) & 0xffL);
    byte b2 = (byte)((fp >>> 32) & 0xffL);
    byte b3 = (byte)((fp >>> 40) & 0xffL);
    byte b4 = (byte)((fp >>> 48) & 0xffL);
    byte b5 = (byte)((fp >>> 56) & 0xffL);
    // Test if the fingerprint is already in the hashtable.
    int len = bucket == null ? 0 : bucket.length;
    for (int i = 0; i < len; i += 5) {
      if (bucket[i  ] == b1 &&
	  bucket[i+1] == b2 &&
	  bucket[i+2] == b3 &&
	  bucket[i+3] == b4 &&
	  bucket[i+4] == b5) return true;
    }
    return false;
  }

  public final void exit(boolean cleanup) throws IOException {
	super.exit(cleanup);
    if (cleanup) {
      // Delete the metadata directory:
      FileUtil.deleteDir(this.metadir, true);
    }
    String hostname = InetAddress.getLocalHost().getHostName();
    MP.printMessage(EC.TLC_FP_COMPLETED, hostname);
    System.exit(0);
  }

  public final long checkFPs() {
    long dis = Long.MAX_VALUE;
    for (int i = 0; i < this.table.length; i++) {
      long low = i & 0xffffffL;
      byte[] bucket = this.table[i];
      if (bucket != null) {
	int j = 0;
	while (j < bucket.length) {
	  long b1 = (bucket[j++] & 0xffL) << 24;
	  long b2 = (bucket[j++] & 0xffL) << 32;
	  long b3 = (bucket[j++] & 0xffL) << 40;
	  long b4 = (bucket[j++] & 0xffL) << 48;
	  long b5 = (bucket[j++] & 0xffL) << 56;
	  long fp = b5 | b4 | b3 | b2 | b1 | low;
	  int k = j;
	  while (k < bucket.length) {
	    b1 = (bucket[k++] & 0xffL) << 24;
	    b2 = (bucket[k++] & 0xffL) << 32;
	    b3 = (bucket[k++] & 0xffL) << 40;
	    b4 = (bucket[k++] & 0xffL) << 48;
	    b5 = (bucket[k++] & 0xffL) << 56;
	    long fp1 = b5 | b4 | b3 | b2 | b1 | low;
	    long dis1 = (fp > fp1) ? fp-fp1 : fp1-fp;
	    if (dis1 >= 0) {
	      dis = Math.min(dis, dis1);
	    }
	  }
	  for (k = i+1; k < this.table.length; k++) {
	    byte[] bucket1 = this.table[k];
	    if (bucket1 != null) {
	      long low1 = k & 0xffffffL;
	      int k1 = 0;
	      while (k1 < bucket.length) {
		b1 = (bucket[k1++] & 0xffL) << 24;
		b2 = (bucket[k1++] & 0xffL) << 32;
		b3 = (bucket[k1++] & 0xffL) << 40;
		b4 = (bucket[k1++] & 0xffL) << 48;
		b5 = (bucket[k1++] & 0xffL) << 56;
		long fp1 = b5 | b4 | b3 | b2 | b1 | low1;
		long dis1 = (fp > fp1) ? fp-fp1 : fp1-fp;
		if (dis1 >= 0) {
		  dis = Math.min(dis, dis1);
		}
	      }
	    }
	  }
	}
      }
    }
    return dis;
  }

  public final void beginChkpt(String fname) throws IOException {
    BufferedDataOutputStream dos =
      new BufferedDataOutputStream(this.chkptName(fname, "tmp"));
    for (int i = 0; i < this.table.length; i++) {
      long low = i & 0xffffffL;
      byte[] bucket = this.table[i];
      if (bucket != null) {
	int j = 0;
	while (j < bucket.length) {
	  long b1 = (bucket[j++] & 0xffL) << 24;
	  long b2 = (bucket[j++] & 0xffL) << 32;
	  long b3 = (bucket[j++] & 0xffL) << 40;
	  long b4 = (bucket[j++] & 0xffL) << 48;
	  long b5 = (bucket[j++] & 0xffL) << 56;
	  long fp = b5 | b4 | b3 | b2 | b1 | low;
	  dos.writeLong(fp);
	}
      }
    }
    dos.close();
  }

  final public void commitChkpt(String fname) throws IOException {
    File oldChkpt = new File(this.chkptName(fname, "chkpt"));
    File newChkpt = new File(this.chkptName(fname, "tmp"));
    if ((oldChkpt.exists() && !oldChkpt.delete()) ||
	!newChkpt.renameTo(oldChkpt))
    {
      throw new IOException("MemFPSet2.commitChkpt: cannot delete " + oldChkpt);
    }
  }

  public final void recover(String fname) throws IOException {
    BufferedDataInputStream dis =
      new BufferedDataInputStream(this.chkptName(fname, "chkpt"));
    try {
      while (!dis.atEOF()) {
	Assert.check(!this.put(dis.readLong()), EC.TLC_FP_NOT_IN_SET);
      }
    }
    catch (EOFException e)
    {
        throw new IOException("MemFPSet2.recover: failed.");
    }
    dis.close();
  }

  public final void beginChkpt() throws IOException {
    this.beginChkpt(this.filename);
  }

  public final void commitChkpt() throws IOException {
    this.commitChkpt(this.filename);
  }

  public final void recover(TLCTrace trace) throws IOException {
    this.recover(this.filename);
  }

  public final void recoverFP(long fp) throws IOException {
    Assert.check(!this.put(fp), EC.TLC_FP_NOT_IN_SET);
  }

  final private String chkptName(String fname, String ext) {
    return this.metadir + FileUtil.separator + fname + ".fp." + ext;
  }

}


text:
#region Using directives

using System;

#endregion

namespace Nettiers.AdventureWorks.Entities
{
	///
	/// Displays the content from each employement history related element in the xml column Resume in the HumanResources.JobCandidate table. The content has been localized into French, Simplified Chinese and Thai. Some data may not display correctly unless supplemental language support is installed.
	///
	/// <remarks>
	/// This file is generated once and will never be overwritten.
	/// </remarks>
	[Serializable]
	[CLSCompliant(true)]
	public partial class VJobCandidateEmployment : VJobCandidateEmploymentBase
	{
		#region Constructors

		///
		/// Creates a new <see cref="VJobCandidateEmployment"/> instance.
		///
		public VJobCandidateEmployment():base(){}

		#endregion
	}
}


text:
A basic pf firewall for common services

This configuration file is intended to contain the details necessary to maintain a personal firewall using packetfilter (pf). It is intended to contain some examples of common services and associated rules.

On OpenBSD the pf.conf file belongs in /etc/pf.conf
To restart pf with updated rules use pfctl -f /etc/pf.conf
If you wish to save test configurations in another file change /etc/pf.conf to the location of the desired configuration.


text:
DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    # ('Your Name', 'your_email@domain.com'),
)

MANAGERS = ADMINS

DATABASE_ENGINE = 'sqlite3'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'kambing.db'             # Or path to database file if using sqlite3.
DATABASE_USER = ''             # Not used with sqlite3.
DATABASE_PASSWORD = ''         # Not used with sqlite3.
DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.

TIME_ZONE = 'Asia/Jakarta'

LANGUAGE_CODE = 'en-us'

SITE_ID = 1

USE_I18N = False

import os
MEDIA_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'media')

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = '/media/'

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'swgm*3%po62mg76m4iq!k8h3j+_)x=8b--7skjc_0wiak^wksr'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
#     'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
)

ROOT_URLCONF = 'mmmblog.urls'

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    'mmmblog',
)

WEB_ROOT = 'www'


text:
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta name="Content-Style" content="text/css">
<title>TIFFReadRGBAStrip</title>

TIFFReadRGBAStrip

NAME

SYNOPSIS

DESCRIPTION

NOTES

RETURN VALUES

DIAGNOSTICS

SEE ALSO

NAME

TIFFReadRGBAStrip − read and decode an image strip
into a fixed-format raster

SYNOPSIS

#include <tiffio.h>

#define TIFFGetR(abgr) ((abgr) & 0xff)

#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)

#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)

#define TIFFGetA(abgr) (((abgr) >> 24) &
0xff)

int TIFFReadRGBAStrip(TIFF *tif,
uint32 row, uint32
*raster)

DESCRIPTION

TIFFReadRGBAStrip reads a single strip of a
strip-based image into memory, storing the result in the
user supplied RGBA raster. The raster is assumed to
be an array of width times rowsperstrip 32-bit entries,
where width is the width of the image (TIFFTAG_IMAGEWIDTH)
and rowsperstrip is the maximum lines in a strip
(TIFFTAG_ROWSPERSTRIP).

The row value should be the row of the first row
in the strip (strip * rowsperstrip, zero based).

Note that the raster is assume to be organized such that
the pixel at location (x,y) is
raster[y*width+x]; with the
raster origin in the lower-left hand corner of the
strip. That is bottom to top organization. When reading a
partial last strip in the file the last line of the image
will begin at the beginning of the buffer.

Raster pixels are 8-bit packed red, green, blue, alpha
samples. The macros TIFFGetR, TIFFGetG,
TIFFGetB, and TIFFGetA should be used to
access individual samples. Images without Associated Alpha
matting information have a constant Alpha of 1.0 (255).

See the TIFFRGBAImage(3TIFF) page for more details
on how various image types are converted to RGBA values.

NOTES

Samples must be either 1, 2, 4, 8, or 16 bits.
Colorimetric samples/pixel must be either 1, 3, or 4 (i.e.
SamplesPerPixel minus ExtraSamples).

Palette image colormaps that appear to be incorrectly
written as 8-bit values are automatically scaled to
16-bits.

TIFFReadRGBAStrip is just a wrapper around the
more general TIFFRGBAImage(3TIFF) facilities.
It’s main advantage over the similar
TIFFReadRGBAImage() function is that for large images
a single buffer capable of holding the whole image
doesn’t need to be allocated, only enough for one
strip. The TIFFReadRGBATile() function does a similar
operation for tiled images.

RETURN VALUES

1 is returned if the image was successfully read and
converted. Otherwise, 0 is returned if an error was
encountered.

DIAGNOSTICS

All error messages are directed to the
TIFFError(3TIFF) routine.

Sorry, can not handle %d-bit pictures. The image
had BitsPerSample other than 1, 2, 4, 8, or 16.

Sorry, can not handle %d-channel images. The image
had SamplesPerPixel other than 1, 3, or 4.

Missing needed "PhotometricInterpretation"
tag. The image did not have a tag that describes how to
display the data.

No "PhotometricInterpretation" tag, assuming
RGB. The image was missing a tag that describes how to
display it, but because it has 3 or 4 samples/pixel, it is
assumed to be RGB.

No "PhotometricInterpretation" tag, assuming
min-is-black. The image was missing a tag that describes
how to display it, but because it has 1 sample/pixel, it is
assumed to be a grayscale or bilevel image.

No space for photometric conversion table. There
was insufficient memory for a table used to convert image
samples to 8-bit RGB.

Missing required "Colormap" tag. A
Palette image did not have a required Colormap
tag.

No space for tile buffer. There was insufficient
memory to allocate an i/o buffer.

No space for strip buffer. There was insufficient
memory to allocate an i/o buffer.

Can not handle format. The image has a format
(combination of BitsPerSample,
SamplesPerPixel, and
PhotometricInterpretation) that
TIFFReadRGBAImage can not handle.

No space for B&W mapping table. There was
insufficient memory to allocate a table used to map
grayscale data to RGB.

No space for Palette mapping table. There was
insufficient memory to allocate a table used to map data to
8-bit RGB.

SEE ALSO

libtiff(3TIFF), TIFFOpen(3TIFF),
TIFFRGBAImage(3TIFF),
TIFFReadRGBAImage(3TIFF),
TIFFReadRGBATile(3TIFF)


text: python ultrasonic.py -j test3@localhost -p test -q &


text:
// This file has been prepared for Doxygen automatic documentation generation.

/*================================= INCLUDES         =========================*/
#include <stdint.h>
#include <stdbool.h>

#include "compiler.h"
#include "board.h"
#include "vrt_kernel.h"
#include "self_programming.h"
#include "self_programming_conf.h"
#include "led.h"
#include "cmd_if_bootloader.h"
#include "wdt_avr.h"
#include "eep.h"

#include "usb_drv.h"
#include "usb_descriptors.h"
#include "usb_task.h"
/*================================= MACROS           =========================*/
/*================================= TYEPDEFS         =========================*/
/*================================= GLOBAL VARIABLES =========================*/
/*================================= LOCAL VARIABLES  =========================*/
static void(* const start_application)(void) = (void(*)(void))0x0000;
/*================================= PROTOTYPES       =========================*/
/*! \brief Initialize the AVR peripheral modules.
 *
 *  \retval true All peripheral modules are disabled.
 *  \retval false Will never happen.
 */
static bool avr_init(void);

/*! \brief Error handler trap.
 *
 *         This function will be called if a serious error occurs. The red LED will
 *         be lit to inidicate that something went seriously wrong. The RZUSBSTICK
 *         must be reset to leave this state.
 */
static void error_handler(void);

static bool avr_init(void) {
    PRR0 = (1 << PRTWI)  |   // Disable TWI.
	       (1 << PRTIM2) |   // Disable TIMER2.
	       (1 << PRTIM0) |   // Disable TIMER0.
           (1 << PRTIM1) |   // Disable TIMER1.
           (1 << PRSPI)  |   // Disable SPI.
	       (1 << PRADC);     // Disable ADC.

    PRR1 = (1 << PRUSB)  |   // Disable USB.
	       (1 << PRTIM3) |   // Disable TIMER3.
	       (1 << PRUSART1);  // Disable USART1.

	ACSR |= (1 << ACD);      // Disable Analog Comparator.

	DIDR0 = (1 << ADC7D) |   // Disable digital input buffer for analog input pins.
	        (1 << ADC6D) |   // Disable digital input buffer for analog input pins.
	        (1 << ADC5D) |   // Disable digital input buffer for analog input pins.
	        (1 << ADC4D);    // Disable digital input buffer for analog input pins.

    /* Initialize LEDs. */
    LED_INIT();

    /* Set the RX-TX pins to input with pull-up. */
    BOOT_DDR &= ~(1 << BOOT_RX);
    BOOT_DDR |= (1 << BOOT_TX);

    BOOT_PORT |= (1 << BOOT_RX);
    BOOT_PORT &= ~(1 << BOOT_TX);

    return true;
}

static void error_handler(void) {
    /* Inidicate serious HW error by turning the red LED on. */
    LED_RED_ON();

    /* Enter non-interryuptable endless loop. */
    cli();
    while (true) {
        ;
    }
}

/*! \brief This is the main loop for the RZRAVEN bootloader. */
#if defined(__ICCAVR__)
#pragma type_attribute = __task
void main(void) {
#else
int main(void) {
#endif
    /* Ensure that the watchdog is not running. */
    wdt_disable();

    /* Initialize AVR peripheral modules. */
    (bool)avr_init();

    /* Check if the RX and TX pins are shorted. If they are shorted, the RZUSBSTICK
     * shall start the bootloader. If not, continue to verify if the application
     * requested to enter the bootloader.
     */

    /* Check if the application has requested to enter the bootloader. */
    if ((BOOT_PIN & (1 << BOOT_RX)) != (1 << BOOT_RX)) {
        /* Check that RX goes high when TX is pulled high. */
        BOOT_PORT |= (1 << BOOT_TX);

        nop();
        nop();
        nop();
        nop();

        if ((BOOT_PIN & (1 << BOOT_RX)) != (1 << BOOT_RX)) {
            start_application();
        }
    } else {
        /* Check if the application has requested to enter the bootloader. */
        uint8_t volatile magic_value = 0xAA;
        EEGET(magic_value, EE_BOOT_MAGIC_ADR);

        if (EE_BOOT_MAGIC_VALUE != magic_value) {
            start_application();
        } else {
            EEPUT(EE_BOOT_MAGIC_ADR, 0xFF);
        }
    }

    /* Set the interrupt vectors to the bootloader, initialize the LEDs and the
     * VRT kernel.
     */
    ENTER_CRITICAL_REGION();
    uint8_t temp_mcucr = MCUCR;
    MCUCR = (1 << IVCE);
    MCUCR = (1 << IVSEL);
    MCUCR = temp_mcucr;
    LEAVE_CRITICAL_REGION();

    LED_INIT();
    vrt_init();

    if (true != eep_init()) {
        error_handler();
    } else if (true != cmd_if_init()) {
        error_handler();
    }

    LED_ORANGE_ON();

    /* Enable Interrupts. */
    sei();

    /* Enter the endless application loop. */
    for (;;) {
        vrt_dispatch_event();
        usb_task();
    }
}
/*EOF*/


text:
package com.vigorous.asynchronized.network.data.request;

import com.google.gson.annotations.SerializedName;
import com.vigorous.asynchronized.network.data.NetWorkRequestConst;
import com.vigorous.asynchronized.network.data.RequestParamBase;

/**
 * Created by Vigorous.Liang on 2017/9/17.
 */

public class ExampleRequestParam extends RequestParamBase {

    @SerializedName(NetWorkRequestConst.SERIALIZED_REQUEST_EXAMPLE_ONCE_NO)
    private boolean all;

    public boolean isAll() {
        return all;
    }

    public void setAll(boolean all) {
        this.all = all;
    }

}


text:
import wx

from kiva.cairo import CompiledPath, GraphicsContext, font_metrics_provider

from base_window import BaseWindow
from scrollbar import NativeScrollBar

class Window(BaseWindow):
    def _create_gc(self, size, pix_format="bgra32"):
        "Create a Kiva graphics context of a specified size"
        gc = GraphicsContext((size[0]+1, size[1]+1))
        gc.translate_ctm(0.5, 0.5)
        return gc

    def _window_paint(self, event):
        "Do a GUI toolkit specific screen update"
        if self.control is None:
            event.Skip()
            return

        control = self.control
        pixel_map = self._gc.pixel_map
        wdc = control._dc = wx.PaintDC(control)
        self._update_region = None
        if self._update_region is not None:
            update_bounds = reduce(union_bounds, self._update_region)
            pixel_map.draw_to_wxwindow(control, int(update_bounds[0]), int(update_bounds[1]),
                                       width=int(update_bounds[2]), height=int(update_bounds[3]))
        else:
            pixel_map.draw_to_wxwindow(control, 0, 0)

        control._dc = None
        return

# EOF


text:
<?xml version="1.0" encoding="UTF-8"?>

<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>
	<artifactId>async-process</artifactId>
	<parent>
		<artifactId>spring-batch-scaling</artifactId>
		<groupId>io.spring</groupId>
		<version>1.0.0.BUILD-SNAPSHOT</version>
	</parent>
	<packaging>jar</packaging>
	<dependencies>
		<dependency>
			<groupId>org.springframework.batch</groupId>
			<artifactId>spring-batch-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.batch</groupId>
			<artifactId>spring-batch-infrastructure</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.batch</groupId>
			<artifactId>spring-batch-integration</artifactId>
			<version>${spring.batch.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-jdbc</artifactId>
		</dependency>
		<dependency>
			<groupId>org.hsqldb</groupId>
			<artifactId>hsqldb</artifactId>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-dbcp</groupId>
			<artifactId>commons-dbcp</artifactId>
		</dependency>
		<dependency>
			<groupId>org.imgscalr</groupId>
			<artifactId>imgscalr-lib</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
		</dependency>
	</dependencies>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>2.3</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
							<transformers>
								<transformer
										implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
									<mainClass>io.spring.asyncprocess.JobRunner</mainClass>
								</transformer>
								<transformer
										implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
									<resource>META-INF/spring.handlers</resource>
								</transformer>
								<transformer
										implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
									<resource>META-INF/spring.schemas</resource>
								</transformer>
							</transformers>
							<createDependencyReducedPom>false</createDependencyReducedPom>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>


text:
var _ = require('underscore');
var path = require('path');
var claire = require('..');

function reportMatches(err, matches) {
  console.log('----');

  if(err) {
    console.log('ERROR:', err);
  }

  _.each(matches, function(match) {
    console.log(match.rendered, match.score);
  });
}

claire.find(path.join(__dirname, 'amp'), reportMatches);
claire.find(path.join('~', 'rep'), reportMatches);
claire.find(path.join(__dirname, 'amp'), reportMatches, {short: true});


text:
module.exports = function stripUTF8ByteOrder(data) {
	var content = data.toString()
	if(content[0] === '\uFEFF') {
		content = content.substring(1)
	}
	return content
}


text:
layout: post
title:  "Welcome"
date:   2017-11-24 09:34:11 -0800
categories: jekyll update
---
Welcome to my new site! Shoutout to cypher.codes for the theme. I will be blogging about tech topics, tutorials, and my current projects. Keep an eye out for it!
- Nick


text:
<?php

namespace JBZoo\Utils;

/**
 * Class Exception
 * @package JBZoo\Utils
 */
class Exception extends \Exception
{

}


text:
#pragma once

#include "../oomodel_api.h"

#include "Declaration.h"

#include "../expressions/ReferenceExpression.h"

DECLARE_TYPED_LIST(OOMODEL_API, OOModel, ExplicitTemplateInstantiation)

namespace OOModel {

class OOMODEL_API ExplicitTemplateInstantiation : public Super<Declaration>
{
	COMPOSITENODE_DECLARE_STANDARD_METHODS(ExplicitTemplateInstantiation)
	ATTRIBUTE(ReferenceExpression, instantiatedClass, setInstantiatedClass)

	public:
		ExplicitTemplateInstantiation(ReferenceExpression* instantiatedClass);

		virtual SymbolTypes symbolType() const override;

};

}


text:
<!DOCTYPE html>

What does "Collection" mean?

A collection is a container or folder which contains one or more digital objects. The user is able to add and remove collections from the tool.

What does "Object" mean?

Object here means a  complex digital object is made up of interdependent simple digital objects or components (e.g. files, software applications, hardware specifications). In the media domain, it a combination of a digital video file and its playback environment. In science, it is the raw data, scripts and outputs of the experiment.

Explanations of each column in the "Objects" table

Object Name: The name of the digital object.

Creation Date: Date the object was uploaded to the system.

Risk Level: Combined risk proximity and impact measure: 1 – low, 10 – high.

Primary Risk: Type of risk of nearest proximity to the object.

Date for action: The predicted date that action is required.

Confidence: confidence interval of the prediction

Impact: Confidence interval for the date for action.

Delete Selected: Select one or more objects for deletion.

How to create a new collection?

1. Click the "New" button on the sidebar on the left side of the page.

2. Click "Collection".

3. Enter the name of the new collection

4. Click "Create" button.

How to delete an existing collection?

1. Click "Collections" on the sidebar on the left side of the page.

2. Click the bin icon next to the collection to be deleted.

3. Click "Yes" to confirm your selection when the warning message is displayed.

How to create a new digital object?

1. Click the "New" button on the sidebar on the left side of the page.

2. Click "Object".

3. Select the "Collection" for the new object from the dropdown list.

4. Enter the name of the new object.

5. Select the "Accession Date".

6. Select the "Database" from the dropdown list.

7. Select the "Scripting Language" from the dropdown list.

8. Select the "Image Format" from the dropdown list.

9. Select the "Image Viewer" from the dropdown list.

10. Select the "Document Format" from the dropdown list.

11. Select the "Document Viewer" from the dropdown list.

Once all the information for the object is provided, click the "Create" button.

How to delete existing object(s)?

1. Click the checkbox of the object(s) to be deleted.

2. Click "Delete Selected".

3. Click "Yes" to confirm your selection when the warning message is displayed.


text:
/**
 *
 */
package uk.ac.soton.ecs.wais.fest13.sound;

import java.util.Collection;

import uk.ac.soton.ecs.wais.fest13.SocialComment;
import uk.ac.soton.ecs.wais.fest13.UserInformation;

/**
 *	Takes a set of social comments and plays an appropriate sound.
 *
 *	@author David Dupplaw (dpd@ecs.soton.ac.uk)
 *  @created 12 Sep 2013
 */
public interface SoundTranslator
{
	/**
	 * 	For the given set of social comments and the given information about the user,
	 * 	this sound translator should generate an appropriate sound.
	 *
	 *	@param comment The aggregation of social comments.
	 *	@param userInformation The user information.
	 */
	public void translate( Collection<SocialComment> comment, UserInformation userInformation );

	/**
	 *  Stop all ongoing translations.
	 */
	public void stop();
}


text:
using namespace std;

TrainerCreator::TrainerCreator()
{
	m_title = "";
	m_region = "";
	m_gameTitle = "";
	m_author = "";
	m_info = "";
	totalCodeSize = 0;

	//lets find the locations
	vector<unsigned char> s;
	s.assign(trainSrc, trainSrc+sizeof(trainSrc));
	auto it = search(s.begin(), s.end(), TITLE_TXT, TITLE_TXT+strlen(TITLE_TXT));			m_locationMap[TITLE_TXT] = rkPair(it - s.begin(), TITLELEN);
	it = search(s.begin(), s.end(), AUTHOR_TXT, AUTHOR_TXT+strlen(AUTHOR_TXT));				m_locationMap[AUTHOR_TXT] = rkPair(it - s.begin(), AUTHORLEN);
	it = search(s.begin(), s.end(), INFO_TXT, INFO_TXT+strlen(INFO_TXT));					m_locationMap[INFO_TXT] = rkPair(it - s.begin(), INFOLEN);
	it = search(s.begin(), s.end(), CODES_TXT, CODES_TXT+strlen(CODES_TXT));				m_locationMap[CODES_TXT] = rkPair(it - s.begin(), CODESLEN);
	it = search(s.begin(), s.end(), GAME_TITLE_TXT, GAME_TITLE_TXT+strlen(GAME_TITLE_TXT)); m_locationMap[GAME_TITLE_TXT] = rkPair(it - s.begin(), GAMETITLELEN);
	it = search(s.begin(), s.end(), VERSION_TXT, VERSION_TXT+strlen(VERSION_TXT));			m_locationMap[VERSION_TXT] = rkPair(it - s.begin(), VERSIONLEN);
	it = search(s.begin(), s.end(), REGION_TXT, REGION_TXT+strlen(REGION_TXT));				m_locationMap[REGION_TXT] = rkPair(it - s.begin(), REGIONLEN);
}

TrainerCreator::~TrainerCreator()
{
}

void TrainerCreator::setCodes(vector<rkTrainerCode> &codes)
{
	int pos = 1;
	codeBuffer[0] = codes.size();
	for (auto it = codes.begin(); it != codes.end(); ++it)
	{
		pos += (*it)->write(&codeBuffer[pos]);
	}
	totalCodeSize = pos;
}

void TrainerCreator::inject(string findValue, string replaceValue)
{
	if (m_locationMap.count(findValue) == 0)
		return;
	unsigned char *pt = &trainSrc[m_locationMap[findValue].location];
	int size = m_locationMap[findValue].length;
	memset(pt, 0, size);
	memcpy(pt, replaceValue.c_str(), replaceValue.length());
}

void TrainerCreator::injectCode(char *buffer)
{
	if (m_locationMap.count(CODES_TXT) == 0)
		return;
	unsigned char *pt = &trainSrc[m_locationMap[CODES_TXT].location];
	int size = m_locationMap[CODES_TXT].length;
	memset(pt, 0, size);
	memcpy(pt, (unsigned char*)codeBuffer, totalCodeSize);
}

void TrainerCreator::exportTrainer(bool debug)
{
	if (codeBuffer[0] == 0)
		return;
#if defined(_WIN32) || defined(WIN32)
	string fname = m_title + "-" + m_gameTitle + ".exe";
#else
	string fname = m_title + "-" + m_gameTitle;
#endif
	inject(TITLE_TXT, m_title);
	inject(AUTHOR_TXT, m_author);
	inject(INFO_TXT, m_info);
	inject(GAME_TITLE_TXT, m_gameTitle);
	inject(VERSION_TXT, m_version);
	inject(REGION_TXT, m_region);
	injectCode(codeBuffer);
	ofstream outFile(fname.c_str(), ofstream::binary);
	outFile.write((char*)trainSrc, sizeof(trainSrc));
	outFile.close();
#if !defined(_WIN32) && !defined(WIN32)
	chmod(fname.c_str(),755);
#endif
	if (debug)
	{
		ofstream outDebugFile("dbg.dat", ofstream::binary);
		outDebugFile.write((char*)codeBuffer, totalCodeSize);
		outDebugFile.close();

	}
}


text:
@class IFTTTTransform3D;

@interface IFTTTAnimationFrame : NSObject

@property (nonatomic, assign) CGRect frame;
@property (nonatomic, assign) CGFloat alpha;
@property (nonatomic, assign) BOOL hidden;
@property (nonatomic, copy) UIColor *color;
@property (nonatomic, assign) CGFloat angle;
@property (nonatomic, strong) IFTTTTransform3D *transform;
@property (nonatomic, assign) CGFloat scale;
@property (nonatomic, assign) CGFloat constraintConstant;

@end


text:
package main

import (
	"fmt"
	"github.com/freignat91/blockchain/api"
	"github.com/spf13/cobra"
)

// PlatformMonitor is the main command for attaching platform subcommands.
var NodeKillCmd = &cobra.Command{
	Use:   "kill",
	Short: "kill an blockchain node",
	Long:  `kill an blockchain node`,
	Run: func(cmd *cobra.Command, args []string) {
		if err := bCLI.kill(cmd, args); err != nil {
			bCLI.fatal("Error: %v\n", err)
		}
	},
}

func init() {
	NodeCmd.AddCommand(NodeKillCmd)
}

func (m *bchainCLI) kill(cmd *cobra.Command, args []string) error {
	if len(args) < 1 {
		return fmt.Errorf("Needs node name as first argument")
	}
	node := args[0]
	m.pInfo("Execute: kill node %s\n", node)
	tapi := api.New(m.server)
	m.setAPI(tapi)
	if err := tapi.NodeKill(node); err != nil {
		return err
	}
	m.pSuccess("Container killed node %s\n", node)
	return nil
}


text:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.WindowsAzure.Storage.Table;

namespace AzureStorage
{

    public interface INoSQLTableStorage<T> : IEnumerable<T> where T : ITableEntity, new()
    {

        /// <summary>
        /// Добавить новый элемент в таблице
        /// </summary>
        /// <param name="item">Элемент, который нужно вставить</param>
        /// <param name="notLogCodes">не логировать эксепшены с кодами согласно списку</param>
        void Insert(T item, params int[] notLogCodes);

        // Добавить новый элемент асинхронно (элемент вообще не должен существовать)
        Task InsertAsync(T item, params int[] notLogCodes);

        // Добавить новый элемент, или добавиить поля к существующему элементу
        void InsertOrMerge(T item);

        // Полностью заменть существующий элемент на новый
        T Replace(string partitionKey, string rowKey, Func<T, T> item);
        Task<T> ReplaceAsync(string partitionKey, string rowKey, Func<T, T> item);

        Task<T> MergeAsync(string partitionKey, string rowKey, Func<T, T> item);

        void InsertOrReplaceBatch(IEnumerable<T> entites);
        Task InsertOrReplaceBatchAsync(IEnumerable<T> entites);

        // Добавить к существующему элементу новые поля
        T Merge(string partitionKey, string rowKey, Func<T, T> item);

        /// <summary>
        /// Добавляет новый элемент, или заменяет полностью существующий
        /// </summary>
        /// <param name="item"></param>
        void InsertOrReplace(T item);

        Task InsertOrReplaceAsync(T item);

        /// <summary>
        /// Удаляет элемент из таблицы
        /// </summary>
        /// <param name="item"></param>
        void Delete(T item);

        Task DeleteAsync(T item);

        T Delete(string partitionKey, string rowKey);

        Task<T> DeleteAsync(string partitionKey, string rowKey);

        void CreateIfNotExists(T item);

        /// <summary>
        /// Выполнить набор операций
        /// </summary>
        /// <param name="batch"></param>
        void DoBatch(TableBatchOperation batch);

        /// <summary>
        /// Возвращает элемент
        /// </summary>
        /// <param name="partition">Партиция</param>
        /// <param name="row">Колонка</param>
        /// <returns>null или объект</returns>
        T this[string partition, string row] { get; }

        IEnumerable<T> this[string partition] { get; }
        IEnumerable<T> GetData(Func<T, bool> filter = null);

        Task<T> GetDataAsync(string partition, string row);

        /// <summary>
        /// Получить записи, предварительно отфильтровав их
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        Task<IList<T>> GetDataAsync(Func<T, bool> filter = null);

        /// <summary>
        /// Запрос по одной партиции и нескольким элементам
        /// </summary>
        /// <param name="partitionKey"></param>
        /// <param name="rowKeys"></param>
        /// <param name="pieceSize">На сколько частейделим запрос</param>
        /// <param name="filter">Фильтрация записей</param>
        /// <returns></returns>
        Task<IEnumerable<T>> GetDataAsync(string partitionKey, IEnumerable<string> rowKeys, int pieceSize = 100, Func<T, bool> filter = null);

        Task<IEnumerable<T>> GetDataAsync(IEnumerable<string> partitionKeys, int pieceSize = 100, Func<T, bool> filter = null);

        Task<IEnumerable<T>> GetDataAsync(IEnumerable<Tuple<string, string>> keys, int pieceSize = 100, Func<T, bool> filter = null);

        Task GetDataByChunksAsync(Func<IEnumerable<T>, Task> chunks);

        Task GetDataByChunksAsync(Action<IEnumerable<T>> chunks);
        Task GetDataByChunksAsync(string partitionKey, Action<IEnumerable<T>> chunks);

        /// <summary>
        /// Scan table by chinks and find an instane
        /// </summary>
        /// <param name="partitionKey">Partition we are going to scan</param>
        /// <param name="dataToSearch">CallBack, which we going to call when we have chunk of data to scan. </param>
        /// <returns>Null or instance</returns>
        Task<T> FirstOrNullViaScanAsync(string partitionKey, Func<IEnumerable<T>, T> dataToSearch);

        IEnumerable<T> GetData(string partitionKey, Func<T, bool> filter = null);
        Task<IEnumerable<T>> GetDataAsync(string partition, Func<T, bool> filter = null);

        Task<IEnumerable<T>> GetDataRowKeysOnlyAsync(IEnumerable<string> rowKeys);

        IEnumerable<T> Where(TableQuery<T> rangeQuery, Func<T, bool> filter = null);
        Task<IEnumerable<T>> WhereAsyncc(TableQuery<T> rangeQuery, Func<T, Task<bool>> filter = null);
        Task<IEnumerable<T>> WhereAsync(TableQuery<T> rangeQuery, Func<T, bool> filter = null);

        /// <summary>
        /// Асинхронное получение данных. Можно использовать для экономии памяти запроса.
        /// </summary>
        /// <param name="rangeQuery">Запрос</param>
        /// <param name="yieldResult">обратные вызовы кусками с информацией, полученной по сети</param>
        /// <returns>Task</returns>
        Task ExecuteAsync(TableQuery<T> rangeQuery, Action<IEnumerable<T>> yieldResult);

    }

}


text:
SYNONYM

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

#### Published in
Indian Polyporaceae on Trees and Timber (New Delhi) 113 (1971)

#### Original name
Inonotus nothofagi G. Cunn., 1948

### Remarks
null


text:
from optparse import make_option
import httplib
import json
import urllib

from django.conf import settings
from django.core.management.base import CommandError
from django.core.management.base import BaseCommand
from django.db import connection

API_DOMAIN = "api.edgecast.com"
API_PATH = "/v2/mcc/customers/%s/edge/purge"

SETTINGS_URL = 'CDN_URL'
SETTINGS_CUSTOMER = 'CDN_CUSTOMER_ID'
SETTINGS_TYPE = 'CDN_TYPE'
SETTINGS_ACCESS = 'CDN_ACCESS_KEY'

error_message = """You must specify the required options either in your settings file or as an option to this command.

Required:
Full CDN URL: use --cdn= or %s in your settings file.
Customer id: use --customer= or %s in your settings file.
Access Key: use --key= or %s in your settings file.

Optional
CDN type: use --type= or %s in your settings file. Defaults to 8, small http.
""" % (SETTINGS_URL, SETTINGS_CUSTOMER, SETTINGS_TYPE, SETTINGS_ACCESS )

class Command(BaseCommand):
    help = "Purge a Edgecast CDN Cache"

    option_list = BaseCommand.option_list + (
        make_option('--customer', action="store", type="string", dest="customer"),
        make_option('--cdn', action="store", type="string", dest="cdn"),
        make_option('--type', action="store", type="string", dest="type"),
        make_option('--key', action="store", type="string", dest="key"),
        )

    def clear_cache(self, cdn_url, customer_id, access_key, cdn_type):
        url = API_PATH % customer_id

        if not cdn_url.endswith('/'):
            cdn_url = cdn_url + '/'

        data = json.dumps({
            "MediaPath": cdn_url + '*',
            "MediaType": cdn_type
        })

        headers = {
            "Authorization" : "TOK:%s" % access_key,
            "Accept" : "application/json",
            "Content-Type" : "application/json"
        }

        conn = httplib.HTTPSConnection(API_DOMAIN)
        conn.request("PUT", url, data, headers)

        response = conn.getresponse()
        data = response.read()
        if response.status != 200:
            e = ["Got Unexpected response: %s" % response.status, data]
            raise CommandError('\n'.join(e))
        else:
            print "Cache flush accepted."

    def handle(self, *args, **options):
        cdn_url = getattr(settings, SETTINGS_URL, options.get('cdn'))
        customer_id = getattr(settings, SETTINGS_CUSTOMER, options.get('customer'))
        cdn_type = getattr(settings, SETTINGS_TYPE, options.get('type'))
        access_key = getattr(settings, SETTINGS_ACCESS, options.get('key', 3))

        if not cdn_url or not customer_id or not access_key:
            raise CommandError(error_message)

        if not cdn_type:
            cdn_type = 8

        self.clear_cache(cdn_url, customer_id, access_key, cdn_type)


text:
package org.apache.taglibs.standard.examples.startup;

import java.util.Enumeration;
import java.util.Hashtable;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.taglibs.standard.examples.beans.Customers;

/**
 * Initialization class. Builds all the data structures
 * used in the "examples" webapp.
 *
 * @author Pierre Delisle
 * @version $Revision: 1.4 $ $Date: 2004/08/16 21:38:27 $
 */
public class Init implements ServletContextListener {

    //*********************************************************************
    // ServletContextListener methods

    // recovers the one context parameter we need
    public void contextInitialized(ServletContextEvent sce) {
        //p("contextInitialized");
        init(sce);
    }

    public void contextDestroyed(ServletContextEvent sce) {
        //p("contextInitialized");
    }

    //*********************************************************************
    // Initializations

    private void init(ServletContextEvent sce) {
        /*
         *  Customers
         */
        Customers.create("Richard", "Maurice", "5/15/35",
        "123 Chemin Royal", "Appt. #301",
        "Montreal", "QC", "H3J 9R9", "Canada");
        Customers.create("Mikita", "Stan", "12/25/47",
        "45 Fisher Blvd", "Suite 203",
        "Chicago", "IL", "65982", "USA", "(320)876-9784", null);
        Customers.create("Gilbert", "Rod", "3/11/51",
        "123 Main Street", "",
        "New-York City", "NY", "19432", "USA");
        Customers.create("Howe", "Gordie", "7/25/46",
        "7654 Wings Street", "",
        "Detroit", "MG", "07685", "USA", "(465)675-0761", "(465)879-9802");
        Customers.create("Sawchuk", "Terrie", "11/05/46",
        "12 Maple Leafs Avenue", "",
        "Toronto", "ON", "M5C 1Z1", "Canada");
        sce.getServletContext().setAttribute("customers", Customers.findAll());

	/**
	 * Array of primitives (int)
	 */
	int[] intArray = new int[] {10, 20, 30, 40, 50};
        sce.getServletContext().setAttribute("intArray", intArray);

	/**
	 * Array of Objects (String)
	 */
	String[] stringArray = new String[] {
	    "A first string",
	    "La deuxieme string",
	    "Ella troisiemo stringo",
	};
        sce.getServletContext().setAttribute("stringArray", stringArray);

	/**
        * String-keyed Map
        */
        Hashtable stringMap = new Hashtable();
        sce.getServletContext().setAttribute("stringMap", stringMap);
        stringMap.put("one", "uno");
        stringMap.put("two", "dos");
        stringMap.put("three", "tres");
        stringMap.put("four", "cuatro");
        stringMap.put("five", "cinco");
        stringMap.put("six", "seis");
        stringMap.put("seven", "siete");
        stringMap.put("eight", "ocho");
        stringMap.put("nine", "nueve");
        stringMap.put("ten", "diez");

        /**
         * Integer-keyed Map
	 */
	// we use a Hashtable so we can get an Enumeration easily, below
        Hashtable numberMap = new Hashtable();
	sce.getServletContext().setAttribute("numberMap", numberMap);
	numberMap.put(new Integer(1), "uno");
	numberMap.put(new Integer(2), "dos");
	numberMap.put(new Integer(3), "tres");
	numberMap.put(new Integer(4), "cuatro");
	numberMap.put(new Integer(5), "cinco");
	numberMap.put(new Integer(6), "seis");
	numberMap.put(new Integer(7), "siete");
	numberMap.put(new Integer(8), "ocho");
	numberMap.put(new Integer(9), "nueve");
	numberMap.put(new Integer(10), "diez");

	/**
	 * Enumeration
	 */
	Enumeration enum_ = numberMap.keys();
	// don't use 'enum' for attribute name because it is a
	// reserved word in EcmaScript.
        sce.getServletContext().setAttribute("enumeration", enum_);

	/**
	 * Message arguments for parametric replacement
	 */
	Object[] serverInfoArgs =
	    new Object[] {
		sce.getServletContext().getServerInfo(),
		System.getProperty("java.version")
	    };
	sce.getServletContext().setAttribute("serverInfoArgs", serverInfoArgs);
    }

    //*********************************************************************
    // Initializations

    private void p(String s) {
        System.out.println("[Init] " + s);
    }
}


text:
@interface CTPViewController ()

@end

@implementation CTPViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.

    // make one that counts up
    UICountingLabel* myLabel = [[UICountingLabel alloc] initWithFrame:CGRectMake(10, 10, 200, 40)];
    myLabel.method = UILabelCountingMethodLinear;
    myLabel.format = @"%d";
    [self.view addSubview:myLabel];
    [myLabel countFrom:1 to:10 withDuration:3.0];

    // make one that counts up from 5% to 10%, using ease in out (the default)
    UICountingLabel* countPercentageLabel = [[UICountingLabel alloc] initWithFrame:CGRectMake(10, 50, 200, 40)];
    [self.view addSubview:countPercentageLabel];
    countPercentageLabel.format = @"%.1f%%";
    [countPercentageLabel countFrom:5 to:10];

    // count up using a string that uses a number formatter
    UICountingLabel* scoreLabel = [[UICountingLabel alloc] initWithFrame:CGRectMake(10, 90, 200, 40)];
    [self.view addSubview:scoreLabel];
    NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
    formatter.numberStyle = kCFNumberFormatterDecimalStyle;
    scoreLabel.formatBlock = ^NSString* (float value)
    {
        NSString* formatted = [formatter stringFromNumber:@((int)value)];
        return [NSString stringWithFormat:@"Score: %@",formatted];
    };
    scoreLabel.method = UILabelCountingMethodEaseOut;
    [scoreLabel countFrom:0 to:10000 withDuration:2.5];

    // count up with attributed string
    NSInteger toValue = 100;
    UICountingLabel* attributedLabel = [[UICountingLabel alloc] initWithFrame:CGRectMake(10, 130, 200, 40)];
    [self.view addSubview:attributedLabel];
    attributedLabel.attributedFormatBlock = ^NSAttributedString* (float value)
    {
        NSDictionary* normal = @{ NSFontAttributeName: [UIFont fontWithName: @"HelveticaNeue-UltraLight" size: 20] };
        NSDictionary* highlight = @{ NSFontAttributeName: [UIFont fontWithName: @"HelveticaNeue" size: 20] };

        NSString* prefix = [NSString stringWithFormat:@"%d", (int)value];
        NSString* postfix = [NSString stringWithFormat:@"/%d", (int)toValue];

        NSMutableAttributedString* prefixAttr = [[NSMutableAttributedString alloc] initWithString: prefix
                                                                                attributes: highlight];
        NSAttributedString* postfixAttr = [[NSAttributedString alloc] initWithString: postfix
                                                                          attributes: normal];
        [prefixAttr appendAttributedString: postfixAttr];

        return prefixAttr;
    };
    [attributedLabel countFrom:0 to:toValue withDuration:20.5];

    self.label.method = UILabelCountingMethodEaseInOut;
    self.label.format = @"%d%%";
    __weak CTPViewController* blockSelf = self;
    self.label.completionBlock = ^{
        blockSelf.label.textColor = [UIColor colorWithRed:0 green:0.5 blue:0 alpha:1];
    };
    [self.label countFrom:0 to:100];

}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end


text:
#define INCLUDE_WEB_FUNCTIONS

using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;

namespace Sked24.Dotnet.Samples.MVC.Business.ExcelGenerator
{
    public class CreateExcel
    {
        //
        //  September 2016
        //  http://www.mikesknowledgebase.com
        //
        //  Note: if you plan to use this in an ASP.Net application, remember to add a reference to "System.Web", and to uncomment
        //  the "INCLUDE_WEB_FUNCTIONS" definition at the top of this file.
        //
        //  Release history
        //  -  Sep 2016:
        //        Make sure figures with a decimal part are formatted with a full-stop as a decimal point.
        //  -  Feb 2015:
        //        Needed to replace "Response.End();" with some other code, to make sure the Excel was fully written to the HTTP Response
        //        New ReplaceHexadecimalSymbols() function to prevent hex characters from crashing the export.
        //        Changed GetExcelColumnName() to cope with more than 702 columns (!)
        //   - Jan 2015:
        //        Throwing an exception when trying to export a DateTime containing null.
        //        Was missing the function declaration for "CreateExcelDocument(DataSet ds, string filename, System.Web.HttpResponse Response)"
        //        Removed the "Response.End();" from the web version, as recommended in: https://support.microsoft.com/kb/312629/EN-US/?wa=wsignin1.0
        //   - Mar 2014:
        //        Now writes the Excel data using the OpenXmlWriter classes, which are much more memory efficient.
        //   - Nov 2013:
        //        Changed "CreateExcelDocument(DataTable dt, string xlsxFilePath)" to remove the DataTable from the DataSet after creating the Excel file.
        //        You can now create an Excel file via a Stream (making it more ASP.Net friendly)
        //   - Jan 2013: Fix: Couldn't open .xlsx files using OLEDB  (was missing "WorkbookStylesPart" part)
        //   - Nov 2012:
        //        List<>s with Nullable columns weren't be handled properly.
        //        If a value in a numeric column doesn't have any data, don't write anything to the Excel file (previously, it'd write a '0')
        //   - Jul 2012: Fix: Some worksheets weren't exporting their numeric data properly, causing "Excel found unreadable content in '___.xslx'" errors.
        //   - Mar 2012: Fixed issue, where Microsoft.ACE.OLEDB.12.0 wasn't able to connect to the Excel files created using this class.
        //
        //
        //   (c) www.mikesknowledgebase.com 2014
        //
        //   Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
        //   (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,
        //   publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
        //   subject to the following conditions:
        //
        //   The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        //
        //   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
        //   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
        //   FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
        //   WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        //
        public class CreateExcelFile
        {
            public static bool CreateExcelDocument<T>(List<T> list, string xlsxFilePath)
            {
                DataSet ds = new DataSet();
                ds.Tables.Add(ListToDataTable(list));

                return CreateExcelDocument(ds, xlsxFilePath);
            }
            #region HELPER_FUNCTIONS
            //  This function is adapated from: http://www.codeguru.com/forum/showthread.php?t=450171
            //  My thanks to Carl Quirion, for making it "nullable-friendly".
            public static DataTable ListToDataTable<T>(List<T> list)
            {
                DataTable dt = new DataTable();

                foreach (PropertyInfo info in typeof(T).GetProperties())
                {
                    dt.Columns.Add(new DataColumn(info.Name, GetNullableType(info.PropertyType)));
                }
                foreach (T t in list)
                {
                    DataRow row = dt.NewRow();
                    foreach (PropertyInfo info in typeof(T).GetProperties())
                    {
                        if (!IsNullableType(info.PropertyType))
                            row[info.Name] = info.GetValue(t, null);
                        else
                            row[info.Name] = (info.GetValue(t, null) ?? DBNull.Value);
                    }
                    dt.Rows.Add(row);
                }
                return dt;
            }
            private static Type GetNullableType(Type t)
            {
                Type returnType = t;
                if (t.IsGenericType && t.GetGenericTypeDefinition().Equals(typeof(Nullable<>)))
                {
                    returnType = Nullable.GetUnderlyingType(t);
                }
                return returnType;
            }
            private static bool IsNullableType(Type type)
            {
                return (type == typeof(string) ||
                        type.IsArray ||
                        (type.IsGenericType &&
                         type.GetGenericTypeDefinition().Equals(typeof(Nullable<>))));
            }

            public static bool CreateExcelDocument(DataTable dt, string xlsxFilePath)
            {
                DataSet ds = new DataSet();
                ds.Tables.Add(dt);
                bool result = CreateExcelDocument(ds, xlsxFilePath);
                ds.Tables.Remove(dt);
                return result;
            }
            #endregion

#if INCLUDE_WEB_FUNCTIONS
        /// <summary>
        /// Create an Excel file, and write it out to a MemoryStream (rather than directly to a file)
        /// </summary>
        /// <param name="dt">DataTable containing the data to be written to the Excel.</param>
        /// <param name="filename">The filename (without a path) to call the new Excel file.</param>
        /// <param name="Response">HttpResponse of the current page.</param>
        /// <returns>True if it was created succesfully, otherwise false.</returns>
        public static bool CreateExcelDocument(DataSet ds, string filename, System.Web.HttpResponse Response)
        {
            try
            {
                CreateExcelDocumentAsStream(ds, filename, Response);
                return true;
            }
            catch (Exception ex)
            {
                Trace.WriteLine("Failed, exception thrown: " + ex.Message);
                return false;
            }
        }

        public static bool CreateExcelDocument(DataTable dt, string filename, System.Web.HttpResponse Response)
        {
            try
            {
                DataSet ds = new DataSet();
                ds.Tables.Add(dt);
                CreateExcelDocument(ds, filename, Response);
                ds.Tables.Remove(dt);
                return true;
            }
            catch (Exception ex)
            {
                Trace.WriteLine("Failed, exception thrown: " + ex.Message);
                return false;
            }
        }

        public static bool CreateExcelDocument<T>(List<T> list, string filename, System.Web.HttpResponse Response)
        {
            try
            {
                DataSet ds = new DataSet();
                ds.Tables.Add(ListToDataTable(list));
                CreateExcelDocumentAsStream(ds, filename, Response);
                return true;
            }
            catch (Exception ex)
            {
                Trace.WriteLine("Failed, exception thrown: " + ex.Message);
                return false;
            }
        }

        /// <summary>
        /// Create an Excel file, and write it out to a MemoryStream (rather than directly to a file)
        /// </summary>
        /// <param name="ds">DataSet containing the data to be written to the Excel.</param>
        /// <param name="filename">The filename (without a path) to call the new Excel file.</param>
        /// <param name="Response">HttpResponse of the current page.</param>
        /// <returns>Either a MemoryStream, or NULL if something goes wrong.</returns>
        public static bool CreateExcelDocumentAsStream(DataSet ds, string filename, System.Web.HttpResponse Response)
        {
            try
            {
                System.IO.MemoryStream stream = new System.IO.MemoryStream();
                using (SpreadsheetDocument document = SpreadsheetDocument.Create(stream, SpreadsheetDocumentType.Workbook, true))
                {
                    WriteExcelFile(ds, document);
                }
                stream.Flush();
                stream.Position = 0;

                Response.ClearContent();
                Response.Clear();
                Response.Buffer = true;
                Response.Charset = "";

                //  NOTE: If you get an "HttpCacheability does not exist" error on the following line, make sure you have
                //  manually added System.Web to this project's References.

                Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
                Response.AddHeader("content-disposition", "attachment; filename=" + filename);
                Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
                Response.AppendHeader("content-length", stream.Length.ToString());
                byte[] data1 = new byte[stream.Length];
                stream.Read(data1, 0, data1.Length);
                stream.Close();
                Response.BinaryWrite(data1);
                Response.Flush();

                //  Feb2015: Needed to replace "Response.End();" with the following 3 lines, to make sure the Excel was fully written to the Response
                System.Web.HttpContext.Current.Response.Flush();
                System.Web.HttpContext.Current.Response.SuppressContent = true;
                System.Web.HttpContext.Current.ApplicationInstance.CompleteRequest();

                return true;
            }
            catch (Exception ex)
            {
                Trace.WriteLine("Failed, exception thrown: " + ex.Message);

                //  Display an error on the webpage.
                System.Web.UI.Page page = System.Web.HttpContext.Current.CurrentHandler as System.Web.UI.Page;
                page.ClientScript.RegisterStartupScript(page.GetType(), "log", "console.log('Failed, exception thrown: " + ex.Message + "')", true);

                return false;
            }
        }
#endif      //  End of "INCLUDE_WEB_FUNCTIONS" section

            /// <summary>
            /// Create an Excel file, and write it to a file.
            /// </summary>
            /// <param name="ds">DataSet containing the data to be written to the Excel.</param>
            /// <param name="excelFilename">Name of file to be written.</param>
            /// <returns>True if successful, false if something went wrong.</returns>
            public static bool CreateExcelDocument(DataSet ds, string excelFilename)
            {
                try
                {
                    using (SpreadsheetDocument spreadsheet = SpreadsheetDocument.Create(excelFilename, SpreadsheetDocumentType.Workbook))
                    {
                        WriteExcelFile(ds, spreadsheet);
                    }
                    Trace.WriteLine("Successfully created: " + excelFilename);
                    return true;
                }
                catch (Exception ex)
                {
                    Trace.WriteLine("Failed, exception thrown: " + ex.Message);
                    return false;
                }
            }

            private static void WriteExcelFile(DataSet ds, SpreadsheetDocument spreadsheet)
            {
                //  Create the Excel file contents.  This function is used when creating an Excel file either writing
                //  to a file, or writing to a MemoryStream.
                spreadsheet.AddWorkbookPart();
                spreadsheet.WorkbookPart.Workbook = new DocumentFormat.OpenXml.Spreadsheet.Workbook();

                //  My thanks to James Miera for the following line of code (which prevents crashes in Excel 2010)
                spreadsheet.WorkbookPart.Workbook.Append(new BookViews(new WorkbookView()));

                //  If we don't add a "WorkbookStylesPart", OLEDB will refuse to connect to this .xlsx file !
                WorkbookStylesPart workbookStylesPart = spreadsheet.WorkbookPart.AddNewPart<WorkbookStylesPart>("rIdStyles");
                Stylesheet stylesheet = new Stylesheet();
                workbookStylesPart.Stylesheet = stylesheet;

                //  Loop through each of the DataTables in our DataSet, and create a new Excel Worksheet for each.
                uint worksheetNumber = 1;
                Sheets sheets = spreadsheet.WorkbookPart.Workbook.AppendChild<Sheets>(new Sheets());
                foreach (DataTable dt in ds.Tables)
                {
                    //  For each worksheet you want to create
                    string worksheetName = dt.TableName;

                    //  Create worksheet part, and add it to the sheets collection in workbook
                    WorksheetPart newWorksheetPart = spreadsheet.WorkbookPart.AddNewPart<WorksheetPart>();
                    Sheet sheet = new Sheet() { Id = spreadsheet.WorkbookPart.GetIdOfPart(newWorksheetPart), SheetId = worksheetNumber, Name = worksheetName };

                    // If you want to define the Column Widths for a Worksheet, you need to do this *before* appending the SheetData
                    // http://social.msdn.microsoft.com/Forums/en-US/oxmlsdk/thread/1d93eca8-2949-4d12-8dd9-15cc24128b10/

                    sheets.Append(sheet);

                    //  Append this worksheet's data to our Workbook, using OpenXmlWriter, to prevent memory problems
                    WriteDataTableToExcelWorksheet(dt, newWorksheetPart);

                    worksheetNumber++;
                }

                spreadsheet.WorkbookPart.Workbook.Save();
            }

            private static void WriteDataTableToExcelWorksheet(DataTable dt, WorksheetPart worksheetPart)
            {
                OpenXmlWriter writer = OpenXmlWriter.Create(worksheetPart, Encoding.ASCII);
                writer.WriteStartElement(new Worksheet());
                writer.WriteStartElement(new SheetData());

                string cellValue = "";
                string cellReference = "";

                //  Create a Header Row in our Excel file, containing one header for each Column of data in our DataTable.
                //
                //  We'll also create an array, showing which type each column of data is (Text or Numeric), so when we come to write the actual
                //  cells of data, we'll know if to write Text values or Numeric cell values.
                int numberOfColumns = dt.Columns.Count;
                bool[] IsIntegerColumn = new bool[numberOfColumns];
                bool[] IsFloatColumn = new bool[numberOfColumns];
                bool[] IsDateColumn = new bool[numberOfColumns];

                string[] excelColumnNames = new string[numberOfColumns];
                for (int n = 0; n < numberOfColumns; n++)
                    excelColumnNames[n] = GetExcelColumnName(n);

                //
                //  Create the Header row in our Excel Worksheet
                //
                uint rowIndex = 1;

                writer.WriteStartElement(new Row { RowIndex = rowIndex });
                for (int colInx = 0; colInx < numberOfColumns; colInx++)
                {
                    DataColumn col = dt.Columns[colInx];
                    AppendHeaderTextCell(excelColumnNames[colInx] + "1", col.ColumnName, writer);
                    IsIntegerColumn[colInx] = (col.DataType.FullName.StartsWith("System.Int"));
                    IsFloatColumn[colInx] = (col.DataType.FullName == "System.Decimal") || (col.DataType.FullName == "System.Double") || (col.DataType.FullName == "System.Single");
                    IsDateColumn[colInx] = (col.DataType.FullName == "System.DateTime");

                }
                writer.WriteEndElement();   //  End of header "Row"

                //
                //  Now, step through each row of data in our DataTable...
                //
                double cellFloatValue = 0;
                CultureInfo ci = new CultureInfo("en-US");
                foreach (DataRow dr in dt.Rows)
                {
                    // ...create a new row, and append a set of this row's data to it.
                    ++rowIndex;

                    writer.WriteStartElement(new Row { RowIndex = rowIndex });

                    for (int colInx = 0; colInx < numberOfColumns; colInx++)
                    {
                        cellValue = dr.ItemArray[colInx].ToString();
                        cellValue = ReplaceHexadecimalSymbols(cellValue);
                        cellReference = excelColumnNames[colInx] + rowIndex.ToString();

                        // Create cell with data
                        if (IsIntegerColumn[colInx] || IsFloatColumn[colInx])
                        {
                            //  For numeric cells without any decimal places.
                            //  If this numeric value is NULL, then don't write anything to the Excel file.
                            cellFloatValue = 0;
                            if (double.TryParse(cellValue, out cellFloatValue))
                            {
                                cellValue = cellFloatValue.ToString(ci);
                                AppendNumericCell(cellReference, cellValue, writer);
                            }
                        }
                        else if (IsDateColumn[colInx])
                        {
                            //  This is a date value.
                            DateTime dateValue;
                            if (DateTime.TryParse(cellValue, out dateValue))
                            {
                                AppendDateCell(cellReference, dateValue, writer);
                            }
                            else
                            {
                                //  This should only happen if we have a DataColumn of type "DateTime", but this particular value is null/blank.
                                AppendTextCell(cellReference, cellValue, writer);
                            }
                        }
                        else
                        {
                            //  For text cells, just write the input data straight out to the Excel file.
                            AppendTextCell(cellReference, cellValue, writer);
                        }
                    }
                    writer.WriteEndElement(); //  End of Row
                }
                writer.WriteEndElement(); //  End of SheetData
                writer.WriteEndElement(); //  End of worksheet

                writer.Close();
            }

            private static void AppendHeaderTextCell(string cellReference, string cellStringValue, OpenXmlWriter writer)
            {
                //  Add a new "text" Cell to the first row in our Excel worksheet
                //  We set these cells to use "Style # 3", so they have a gray background color & white text.
                writer.WriteElement(new Cell
                {
                    CellValue = new CellValue(cellStringValue),
                    CellReference = cellReference,
                    DataType = CellValues.String
                });
            }

            private static void AppendTextCell(string cellReference, string cellStringValue, OpenXmlWriter writer)
            {
                //  Add a new "text" Cell to our Row

#if DATA_CONTAINS_FORMULAE
            //  If this item of data looks like a formula, let's store it in the Excel file as a formula rather than a string.
            if (cellStringValue.StartsWith("="))
            {
                AppendFormulaCell(cellReference, cellStringValue, writer);
                return;
            }
#endif

                //  Add a new Excel Cell to our Row
                writer.WriteElement(new Cell
                {
                    CellValue = new CellValue(cellStringValue),
                    CellReference = cellReference,
                    DataType = CellValues.String
                });
            }

            private static void AppendDateCell(string cellReference, DateTime dateTimeValue, OpenXmlWriter writer)
            {
                //  Add a new "datetime" Excel Cell to our Row.
                //
                string cellStringValue = dateTimeValue.ToShortDateString();

                writer.WriteElement(new Cell
                {
                    CellValue = new CellValue(cellStringValue),
                    CellReference = cellReference,
                    DataType = CellValues.String
                });
            }

            private static void AppendFormulaCell(string cellReference, string cellStringValue, OpenXmlWriter writer)
            {
                //  Add a new "formula" Excel Cell to our Row
                writer.WriteElement(new Cell
                {
                    CellFormula = new CellFormula(cellStringValue),
                    CellReference = cellReference,
                    DataType = CellValues.Number
                });
            }

            private static void AppendNumericCell(string cellReference, string cellStringValue, OpenXmlWriter writer)
            {
                //  Add a new numeric Excel Cell to our Row.
                writer.WriteElement(new Cell
                {
                    CellValue = new CellValue(cellStringValue),
                    CellReference = cellReference,
                    DataType = CellValues.Number
                });
            }

            private static string ReplaceHexadecimalSymbols(string txt)
            {
                string r = "[\x00-\x08\x0B\x0C\x0E-\x1F\x26]";
                return Regex.Replace(txt, r, "", RegexOptions.Compiled);
            }

            //  Convert a zero-based column index into an Excel column reference  (A, B, C.. Y, Y, AA, AB, AC... AY, AZ, B1, B2..)
            public static string GetExcelColumnName(int columnIndex)
            {
                //  eg  (0) should return "A"
                //      (1) should return "B"
                //      (25) should return "Z"
                //      (26) should return "AA"
                //      (27) should return "AB"
                //      ..etc..
                char firstChar;
                char secondChar;
                char thirdChar;

                if (columnIndex < 26)
                {
                    return ((char)('A' + columnIndex)).ToString();
                }

                if (columnIndex < 702)
                {
                    firstChar = (char)('A' + (columnIndex / 26) - 1);
                    secondChar = (char)('A' + (columnIndex % 26));

                    return string.Format("{0}{1}", firstChar, secondChar);
                }

                int firstInt = columnIndex / 676;
                int secondInt = (columnIndex % 676) / 26;
                if (secondInt == 0)
                {
                    secondInt = 26;
                    firstInt = firstInt - 1;
                }
                int thirdInt = (columnIndex % 26);

                firstChar = (char)('A' + firstInt - 1);
                secondChar = (char)('A' + secondInt - 1);
                thirdChar = (char)('A' + thirdInt);

                return string.Format("{0}{1}{2}", firstChar, secondChar, thirdChar);
            }

        }
    }
}


text:
'use strict';
// var projects = [];
// var projectData = projectData || [];

// $.ajax({
//   url: 'scripts/ProjectData.json',
//   type: 'get',
//   dataType: 'json',
//   error: function(data){
//     console.log('No JSON to GET: ' + data);
//   },
//   success: function(data){
//     projectData = data;
//     console.log(data);
//     sortProjects();
//   }
// });

// $( '.cross' ).hide();
// $( '.menu' ).hide();
// $( '.hamburger' ).click(function() {
//   $( '.menu' ).slideToggle( 'slow', function() {
//     $( '.hamburger' ).hide();
//     $( '.cross' ).show();
//   });
// });

// $( '.cross' ).click(function() {
//   $( '.menu' ).slideToggle( 'slow', function() {
//     $( '.cross' ).hide();
//     $( '.hamburger' ).show();
//   });
// });

// function Project (projectsObj) {
//   this.title = projectsObj.title;
//   this.link = projectsObj.link;
//   this.description = projectsObj.description;
// }
// var sortProjects = function(){
//   Project.prototype.toHtml = function() {
//     var template = Handlebars.compile($('#project-template').text());
//     return template(this);
//   };
//   projectData.sort(function(a,b) {
//     return (new Date(b.publishedOn)) - (new Date(a.publishedOn));
//   });
//   projectData.forEach(function(projectObject) {
//     projects.push(new Project(projectObject));
//   });
//   projects.forEach(function(project){
//     $('#project').append(project.toHtml())
//   });
// };
// var headerNav = function() {
//   $('#tabs').on('click', '.tab', function() {
//     $('.tab-content').hide();
//     $('#' + $(this).data('content')).fadeIn();
//   });
// };
//
// headerNav();


text:
{{title}}

    {{admin_link('App Config', 'cog', url_for('admin_config'))}}
    {{admin_link('Auth Config', 'lock', url_for('admin_auth'))}}
    {{admin_link('Test', 'sliders', url_for('admin_test'))}}

Models

    {{admin_link('User List', 'group', url_for('user_list', order='-modified', active=True))}}
    {{admin_link('Person', 'user-secret', url_for('admin_person_list'))}}

      Google Cloud Platform
      ({{config.APPLICATION_ID}})

    # if localhost
      {{admin_link('Localhost', 'home', localhost, 'gae')}}
    # endif
    {{admin_link('Overview', 'tachometer', 'https://console.developers.google.com/home/dashboard?project=%s' % config.APPLICATION_ID, 'gae')}}
    {{admin_link('Datastore', 'database', 'https://console.developers.google.com/datastore/query?project=%s' % config.APPLICATION_ID, 'gae')}}
    {{admin_link('Instances', 'bolt', 'https://console.developers.google.com/appengine/instances?project=%s' % config.APPLICATION_ID, 'gae')}}
    {{admin_link('Versions', 'archive', 'https://console.developers.google.com/appengine/versions?project=%s' % config.APPLICATION_ID, 'gae')}}
    {{admin_link('Logs', 'bullhorn', 'https://console.developers.google.com/logs?project=%s&versionId=%s' % (config.APPLICATION_ID, config.CURRENT_VERSION_NAME), 'gae')}}
    {{admin_link('Settings', 'cogs', 'https://console.developers.google.com/settings?project=%s' % config.APPLICATION_ID, 'gae')}}
    {{admin_link('Billing', 'credit-card', 'https://console.developers.google.com/billing', 'gae')}}

# endblock

# macro admin_link(title, icon, url, target='_self')

{{title}}

# endmacro


text:
package com.vk.sdk;

import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;
import android.view.View;

public class WebView extends android.webkit.WebView {

	public WebView(Context context) {
		super(context);
	}

	public WebView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public WebView(Context context, AttributeSet attrs, int defStyleAttr) {
		super(context, attrs, defStyleAttr);
	}

	@Override
	public boolean onCheckIsTextEditor() {
		return true;
	}

	@Override
	protected void onAttachedToWindow() {
		super.onAttachedToWindow();
		View view = this;
		while (view.getParent() instanceof View) {
			view = (View) view.getParent();
			view.setBackgroundColor(Color.TRANSPARENT);
		}
	}
}