text:
#include "mem/ruby/profiler/MemCntrlProfiler.hh"

using namespace std;

MemCntrlProfiler::MemCntrlProfiler(const string& description,
    int banks_per_rank, int ranks_per_dimm, int dimms_per_channel)
{
    m_description = description;
    m_banks_per_rank = banks_per_rank;
    m_ranks_per_dimm = ranks_per_dimm;
    m_dimms_per_channel = dimms_per_channel;

    int totalBanks = banks_per_rank * ranks_per_dimm * dimms_per_channel;
    m_memBankCount.setSize(totalBanks);

    clearStats();
}

MemCntrlProfiler::~MemCntrlProfiler()
{
}

void
MemCntrlProfiler::printStats(ostream& out) const
{
    if (!m_memReq && !m_memRefresh) {
        out << "Memory Controller: " << m_description
            << " no stats recorded." << endl
            << endl
            << endl;
        return;
    }

    // if there's a memory controller at all
    uint64 total_stalls = m_memInputQ + m_memBankQ + m_memWaitCycles;
    double stallsPerReq = total_stalls * 1.0 / m_memReq;
    out << "Memory controller: " << m_description << ":" << endl;

    // does not include refreshes
    out << "  memory_total_requests: " << m_memReq << endl;
    out << "  memory_reads: " << m_memRead << endl;
    out << "  memory_writes: " << m_memWrite << endl;
    out << "  memory_refreshes: " << m_memRefresh << endl;
    out << "  memory_total_request_delays: " << total_stalls << endl;
    out << "  memory_delays_per_request: " << stallsPerReq << endl;
    out << "  memory_delays_in_input_queue: " << m_memInputQ << endl;
    out << "  memory_delays_behind_head_of_bank_queue: "
        << m_memBankQ << endl;
    out << "  memory_delays_stalled_at_head_of_bank_queue: "
        << m_memWaitCycles << endl;

    // Note: The following "memory stalls" entries are a breakdown of
    // the cycles which already showed up in m_memWaitCycles.  The
    // order is significant; it is the priority of attributing the
    // cycles.  For example, bank_busy is before arbitration because
    // if the bank was busy, we didn't even check arbitration.
    // Note: "not old enough" means that since we grouped waiting
    // heads-of-queues into batches to avoid starvation, a request in
    // a newer batch didn't try to arbitrate yet because there are
    // older requests waiting.
    out << "  memory_stalls_for_bank_busy: " << m_memBankBusy << endl;
    out << "  memory_stalls_for_random_busy: " << m_memRandBusy << endl;
    out << "  memory_stalls_for_anti_starvation: " << m_memNotOld << endl;
    out << "  memory_stalls_for_arbitration: " << m_memArbWait << endl;
    out << "  memory_stalls_for_bus: " << m_memBusBusy << endl;
    out << "  memory_stalls_for_tfaw: " << m_memTfawBusy << endl;
    out << "  memory_stalls_for_read_write_turnaround: "
        << m_memReadWriteBusy << endl;
    out << "  memory_stalls_for_read_read_turnaround: "
        << m_memDataBusBusy << endl;
    out << "  accesses_per_bank: ";

    for (int bank = 0; bank < m_memBankCount.size(); bank++) {
        out << m_memBankCount[bank] << "  ";
    }
    out << endl;
    out << endl;
}

void
MemCntrlProfiler::clearStats()
{
    m_memReq = 0;
    m_memBankBusy = 0;
    m_memBusBusy = 0;
    m_memTfawBusy = 0;
    m_memReadWriteBusy = 0;
    m_memDataBusBusy = 0;
    m_memRefresh = 0;
    m_memRead = 0;
    m_memWrite = 0;
    m_memWaitCycles = 0;
    m_memInputQ = 0;
    m_memBankQ = 0;
    m_memArbWait = 0;
    m_memRandBusy = 0;
    m_memNotOld = 0;

    for (int bank = 0; bank < m_memBankCount.size(); bank++) {
        m_memBankCount[bank] = 0;
    }
}

void
MemCntrlProfiler::profileMemReq(int bank)
{
    m_memReq++;
    m_memBankCount[bank]++;
}

void
MemCntrlProfiler::profileMemBankBusy()
{
    m_memBankBusy++;
}

void
MemCntrlProfiler::profileMemBusBusy()
{
    m_memBusBusy++;
}

void
MemCntrlProfiler::profileMemReadWriteBusy()
{
    m_memReadWriteBusy++;
}

void
MemCntrlProfiler::profileMemDataBusBusy()
{
    m_memDataBusBusy++;
}

void
MemCntrlProfiler::profileMemTfawBusy()
{
    m_memTfawBusy++;
}

void
MemCntrlProfiler::profileMemRefresh()
{
    m_memRefresh++;
}

void
MemCntrlProfiler::profileMemRead()
{
    m_memRead++;
}

void
MemCntrlProfiler::profileMemWrite()
{
    m_memWrite++;
}

void
MemCntrlProfiler::profileMemWaitCycles(int cycles)
{
    m_memWaitCycles += cycles;
}

void
MemCntrlProfiler::profileMemInputQ(int cycles)
{
    m_memInputQ += cycles;
}

void
MemCntrlProfiler::profileMemBankQ(int cycles)
{
    m_memBankQ += cycles;
}

void
MemCntrlProfiler::profileMemArbWait(int cycles)
{
    m_memArbWait += cycles;
}

void
MemCntrlProfiler::profileMemRandBusy()
{
    m_memRandBusy++;
}

void
MemCntrlProfiler::profileMemNotOld()
{
    m_memNotOld++;
}


text:
import { compose } from './compose';
import React from 'react';
import difference from 'lodash/difference';

export const Components = {}; // will be populated on startup
export const ComponentsTable = {}; // storage for infos about components

export const coreComponents = [
  'Alert',
  'Button',
  'Modal',
  'ModalTrigger',
  'Table',
  'FormComponentCheckbox',
  'FormComponentCheckboxGroup',
  'FormComponentDate',
  'FormComponentDate2',
  'FormComponentDateTime',
  'FormComponentDefault',
  'FormComponentText',
  'FormComponentEmail',
  'FormComponentNumber',
  'FormComponentRadioGroup',
  'FormComponentSelect',
  'FormComponentSelectMultiple',
  'FormComponentStaticText',
  'FormComponentTextarea',
  'FormComponentTime',
  'FormComponentUrl',
  'FormComponentInner',
  'FormControl',
  'FormElement',
];

/**
 * Register a Vulcan component with a name, a raw component than can be extended
 * and one or more optional higher order components.
 *
 * @param {String} name The name of the component to register.
 * @param {Component} rawComponent Interchangeable/extendable react component.
 * @param {...(Function|Array)} hocs The HOCs to compose with the raw component.
 *
 * Note: when a component is registered without higher order component, `hocs` will be
 * an empty array, and it's ok!
 * See https://github.com/reactjs/redux/blob/master/src/compose.js#L13-L15
 *
 * @returns Structure of a component in the list:
 *
 * ComponentsTable.Foo = {
 *    name: 'Foo',
 *    hocs: [fn1, fn2],
 *    rawComponent: React.Component,
 *    call: () => compose(...hocs)(rawComponent),
 * }
 *
 */
export function registerComponent(name, rawComponent, ...hocs) {
  // support single-argument syntax
  if (typeof arguments[0] === 'object') {
    // note: cannot use `const` because name, components, hocs are already defined
    // as arguments so destructuring cannot work
    // eslint-disable-next-line no-redeclare
    var { name, component, hocs = [] } = arguments[0];
    rawComponent = component;
  }
  // store the component in the table
  ComponentsTable[name] = {
    name,
    rawComponent,
    hocs,
  };
}

/**
 * Returns true if a component with the given name has been registered with
 * registerComponent(name, component, ...hocs).
 *
 * @param {String} name The name of the component to get.
 * @returns {Boolean}
 */
export const componentExists = (name) => {
  const component = ComponentsTable[name];
  return !!component;
};

/**
 * Get a component registered with registerComponent(name, component, ...hocs).
 *
 * @param {String} name The name of the component to get.
 * @returns {Function|React Component} A (wrapped) React component
 */
export const getComponent = name => {
  const component = ComponentsTable[name];
  if (!component) {
    throw new Error(`Component ${name} not registered.`);
  }
  if (component.hocs && component.hocs.length) {
    const hocs = component.hocs.map(hoc => {
      if (!Array.isArray(hoc)) {
        if (typeof hoc !== 'function') {
          throw new Error(`In registered component ${name}, an hoc is of type ${typeof hoc}`);
        }
        return hoc;
      }
      const [actualHoc, ...args] = hoc;
      if (typeof actualHoc !== 'function') {
        throw new Error(`In registered component ${name}, an hoc is of type ${typeof actualHoc}`);
      }
      return actualHoc(...args);
    });
    return compose(...hocs)(component.rawComponent);
  } else {
    return component.rawComponent;
  }
};

/**
 * Populate the lookup table for components to be callable
 * ℹ Called once on app startup
 **/
export const populateComponentsApp = () => {
  const registeredComponents = Object.keys(ComponentsTable);

  // loop over each component in the list
  registeredComponents.map(name => {
    // populate an entry in the lookup table
    Components[name] = getComponent(name);

    // uncomment for debug
    // console.log('init component:', name);
  });

  const missingComponents = difference(coreComponents, registeredComponents);

  if (missingComponents.length) {
    // eslint-disable-next-line no-console
    console.warn(
      `Found the following missing core components: ${missingComponents.join(
        ', '
      )}. Include a UI package such as vulcan:ui-bootstrap to add them.`
    );
  }
};

/**
 * Get the **raw** (original) component registered with registerComponent
 * without the possible HOCs wrapping it.
 *
 * @param {String} name The name of the component to get.
 * @returns {Function|React Component} An interchangeable/extendable React component
 */
export const getRawComponent = name => {
  return ComponentsTable[name].rawComponent;
};

/**
 * Replace a Vulcan component with the same name with a new component or
 * an extension of the raw component and one or more optional higher order components.
 * This function keeps track of the previous HOCs and wrap the new HOCs around previous ones
 *
 * @param {String} name The name of the component to register.
 * @param {React Component} newComponent Interchangeable/extendable component.
 * @param {...Function} newHocs The HOCs to compose with the raw component.
 * @returns {Function|React Component} A component callable with Components[name]
 *
 * Note: when a component is registered without higher order component, `hocs` will be
 * an empty array, and it's ok!
 * See https://github.com/reactjs/redux/blob/master/src/compose.js#L13-L15
 */
export function replaceComponent(name, newComponent, ...newHocs) {
  // support single argument syntax
  if (typeof arguments[0] === 'object') {
    // eslint-disable-next-line no-redeclare
    var { name, component, hocs = [] } = arguments[0];
    newComponent = component;
    newHocs = hocs;
  }

  const previousComponent = ComponentsTable[name];
  const previousHocs = (previousComponent && previousComponent.hocs) || [];

  if (!previousComponent) {
    // eslint-disable-next-line no-console
    console.warn(
      `Trying to replace non-registered component ${name}. The component is ` +
        'being registered. If you were trying to replace a component defined by ' +
        "another package, make sure that you haven't misspelled the name. Check " +
        'also if the original component is still being registered or that it ' +
        "hasn't been renamed."
    );
  }

  return registerComponent(name, newComponent, ...newHocs, ...previousHocs);
}

export const copyHoCs = (sourceComponent, targetComponent) => {
  return compose(...sourceComponent.hocs)(targetComponent);
};

/**
 * Returns an instance of the given component name of function
 * @param {string|function} component  A component, the name of a component, or a react element
 * @param {Object} [props]  Optional properties to pass to the component
 */
//eslint-disable-next-line react/display-name
export const instantiateComponent = (component, props) => {
  if (!component) {
    return null;
  } else if (typeof component === 'string') {
    const Component = Components[component];
    return <Component {...props} />;
  } else if (React.isValidElement(component)) {
    return React.cloneElement(component, props);
  } else if (typeof component === 'function' &&
    component.prototype &&
    component.prototype.isReactComponent
  ) {
    const Component = component;
    return <Component {...props} />;
  } else if (typeof component === 'function') {
    return component(props);
  } else if (typeof component === 'object' && component.$$typeof && component.render) {
    const Component = component;
    return <Component {...props} />;
  } else {
    return component;
  }
};

/**
 * Creates a component that will render the registered component with the given name.
 *
 * This function  may be useful when in need for some registered component, but in contexts
 * where they have not yet been initialized, for example at compile time execution. In other
 * words, when using `Components.ComponentName` is not allowed (because it has not yet been
 * populated, hence would be `undefined`), then `delayedComponent('ComponentName')` can be
 * used instead.
 *
 * @example Create a container for a registered component
 *  // SomeContainer.js
 *  import { compose } from 'meteor/vulcan:lib';
 *  import { delayedComponent } from 'meteor/vulcan:core';
 *
 *  export default compose(
 *    // ...some hocs with container logic
 *  )(delayedComponent('ComponentName')); // cannot use Components.ComponentName in this context!
 *
 * @example {@link dynamicLoader}
 * @param {String} name Component name
 * @return {Function}
 *  Functional component that will render the given registered component
 */
export const delayedComponent = name => {
  return props => {
    const Component = Components[name] || null;
    return Component && <Component {...props} />;
  };
};

// Example with Proxy (might be unstable/hard to reason about)
//const mergeWithComponents = (myComponents = {}) => {
//  const handler = {
//    get: function(target, name) {
//      return name in target ? target[name] : Components[name];
//    }
//  };
//  const proxy = new Proxy(myComponents, handler);
//  return proxy;
//};
export const mergeWithComponents = myComponents =>
  myComponents ? { ...Components, ...myComponents } : Components;

redpajama_set_name: RedPajamaGithub


text:
IF(NOT EXISTS "E:/Projects/fispToos/assimp/Build/install_manifest.txt")
  MESSAGE(FATAL_ERROR "Cannot find install manifest: \"E:/Projects/fispToos/assimp/Build/install_manifest.txt\"")
ENDIF(NOT EXISTS "E:/Projects/fispToos/assimp/Build/install_manifest.txt")

FILE(READ "E:/Projects/fispToos/assimp/Build/install_manifest.txt" files)
STRING(REGEX REPLACE "\n" ";" files "${files}")
FOREACH(file ${files})
  MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
  EXEC_PROGRAM(
    "D:/program files/tools/CMake/bin/cmake.exe" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
    OUTPUT_VARIABLE rm_out
    RETURN_VALUE rm_retval
    )
  IF(NOT "${rm_retval}" STREQUAL 0)
    MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
  ENDIF(NOT "${rm_retval}" STREQUAL 0)
ENDFOREACH(file)


text:
require "fileutils"
require "pathname"

def execute_cmd(cmd, sudo)
	action = []
	action << "sudo -n" if sudo
	action << cmd
	`#{action.join(' ')}`
end

def select_channel(backup_path)
	# Todo: should be moved to the backup_path directory and we'd be reading it from there
	directory_mapping = [
		# Apps
		{
			backup_path: "/Applications/Xamarin Studio.app",
			final_path: "/Applications/Xamarin Studio.app",
			admin: false
		},
		{
			backup_path: "/Applications/Xamarin.iOS Build Host.app",
			final_path: "/Applications/Xamarin.iOS Build Host.app",
			admin: false
		},
		# Frameworks
		{
			backup_path: "/Library/Frameworks/Xamarin.iOS.framework",
			final_path: "/Library/Frameworks/Xamarin.iOS.framework",
			admin: true
		},
		{
			backup_path: "/Library/Frameworks/Mono.framework",
			final_path: "/Library/Frameworks/Mono.framework",
			admin: true
		},
		{
			backup_path: "/Library/LaunchAgents/com.xamarin.mtvs.buildserver.plist",
			final_path: "/Library/LaunchAgents/com.xamarin.mtvs.buildserver.plist",
			admin: true
		},
		# Developer
		{
			backup_path: "/Developer/MonoTouch",
			final_path: "/Developer/MonoTouch",
			admin: true
		},
		# Home
		{
			backup_path: "/Users/Birmacher/Library/Preferences/Xamarin*",
			final_path: "#{ENV['HOME']}/Library/Preferences/Xamarin*"
		},
	]

	# Copy Xamarin files
	directory_mapping.each do |mapping|
		Dir[mapping[:final_path]].each do |directory|
			if File.exists?(directory)
				if File.lstat(directory).symlink?
					execute_cmd("rm \"#{directory}\"", mapping[:admin])
				else
					puts "Path is not empty: #{directory}"
					exit 1
				end
			end
		end

		execute_cmd("mkdir -p \"#{Pathname.new(mapping[:final_path]).dirname}\"", mapping[:admin])
		execute_cmd("ln -s \"#{File.join(backup_path, mapping[:backup_path])}\" \"#{mapping[:final_path]}\"", mapping[:admin])
	end
end

if ARGV.count < 2
	puts "Not enough argumets"
	exit(1)
end

puts "Switching to #{ARGV[1]}..."
select_channel(File.join(ARGV[0], "xamarin_#{ARGV[1]}"))


text:
namespace configure { namespace commands {

	void fetch(std::string const& uri, boost::filesystem::path const& dest);

}}


text:
package metrics

import "golang.org/x/sys/unix"

// Errno2Outcome converts a unix.Errno to LabelOutcome
func Errno2Outcome(errno unix.Errno) string {
	if errno != 0 {
		return LabelValueOutcomeFail
	}

	return LabelValueOutcomeSuccess
}


text:
<?php

namespace Recca0120\Support\Functions;

class Enable
{
    public static function escapeshellarg()
    {
        include __DIR__.'/escapeshellarg.php';
    }
}


text:
//package org.aja.tej.examples.sparksql.sql
//
//import org.aja.tej.utils.TejUtils
//import org.apache.spark.sql.functions._
//import org.apache.spark.sql.{Row, SQLContext}
//import org.apache.spark.{SparkContext, SparkConf}
//import org.apache.spark.sql.types._
//
//import scala.beans.{BeanInfo, BeanProperty}
//
//@SQLUserDefinedType(udt = classOf[MyPoint3DUDT])
//private case class MyPoint3D(x: Double, y: Double, z: Double)
//
//private class MyPoint3DUDT extends UserDefinedType[MyPoint3D] {
//  override def sqlType: DataType = ArrayType(DoubleType, containsNull = false)
//
//  override def serialize(obj: Any): ArrayData = {
//    obj match {
//      case features: MyPoint3D =>
//        new GenericArrayData(Array(features.x, features.y, features.z))
//    }
//  }
//
//  override def deserialize(datum: Any): MyPoint3D = {
//    datum match {
//      case data: ArrayData if data.numElements() == 3 => {
//        val arr = data.toDoubleArray()
//        new MyPoint3D(arr(0), arr(1), arr(2))
//      }
//    }
//  }
//
//  override def userClass: Class[MyPoint3D] = classOf[MyPoint3D]
//
//  override def asNullable: MyPoint3DUDT = this
//}
//
//@BeanInfo
//private case class MyLabeledPoint( @BeanProperty label: String,
//                                   @BeanProperty point: MyPoint3D)
//
//
///**
// * Created by mageswaran on 24/1/16.
// */
//object UDT extends App{
//
//  val sc = TejUtils.getSparkContext(this.getClass.getSimpleName)
//
//  val sqlContext = new SQLContext(sc)
//  import sqlContext.implicits._
//
//
//  val points = Seq(
//    new MyLabeledPoint("A", new MyPoint3D(1.0, 2.0, 3.0)),
//    new MyLabeledPoint("B", new MyPoint3D(1.0, 0.0, 2.0))
//  ).toDF()
//
//  points.printSchema()
//
//  points.show()
//
//  points.registerTempTable("points")
//  sqlContext.udf.register("myMagnitude", (p: MyPoint3D) =>
//    math.sqrt(math.abs(p.x) * math.abs(p.y) + math.abs(p.z)))
//
//  val labeledMagnitudes =
//    sqlContext.sql("SELECT label, myMagnitude(point) as magnitude FROM points")
//
//  labeledMagnitudes.printSchema()
//
//  labeledMagnitudes.show()
//
//}


text:
require 'iron/extensions'
require 'iron/dsl'

# Include required classes
require_relative 'import/column'
require_relative 'import/row'
require_relative 'import/error'
require_relative 'import/data_reader'
require_relative 'import/csv_reader'
require_relative 'import/html_reader'
require_relative 'import/excel_reader'
require_relative 'import/xls_reader'
require_relative 'import/xlsx_reader'
require_relative 'import/custom_reader'
require_relative 'import/importer'


text:
namespace ChinhDo.Transactions
{
    /// <summary>Delegate to call when a new found is found.</summary>
    public delegate void FileEventHandler(string fileName, ref bool cancel);
}


text:
package org.apache.ignite.examples;

import org.apache.ignite.examples.binary.datagrid.CacheClientBinaryPutGetExample;
import org.apache.ignite.examples.binary.datagrid.CacheClientBinaryQueryExample;
import org.apache.ignite.testframework.junits.common.GridAbstractExamplesTest;

/**
 *
 */
public class CacheClientBinaryExampleTest extends GridAbstractExamplesTest {
    /** {@inheritDoc} */
    @Override protected String defaultConfig() {
        return "examples/config/binary/example-ignite-binary.xml";
    }

    /**
     * @throws Exception If failed.
     */
    public void testBinaryPutGetExample() throws Exception {
        CacheClientBinaryPutGetExample.main(new String[] {});
    }

    /**
     * @throws Exception If failed.
     */
    public void testBinaryQueryExample() throws Exception {
        CacheClientBinaryQueryExample.main(new String[] {});
    }
}


text:
#include "modules/audio_processing/aec3/coarse_filter_update_gain.h"

#include <algorithm>
#include <functional>

#include "rtc_base/checks.h"

namespace webrtc {

CoarseFilterUpdateGain::CoarseFilterUpdateGain(
    const EchoCanceller3Config::Filter::CoarseConfiguration& config,
    size_t config_change_duration_blocks)
    : config_change_duration_blocks_(
          static_cast<int>(config_change_duration_blocks)) {
  SetConfig(config, true);
  RTC_DCHECK_LT(0, config_change_duration_blocks_);
  one_by_config_change_duration_blocks_ = 1.f / config_change_duration_blocks_;
}

void CoarseFilterUpdateGain::HandleEchoPathChange() {
  poor_signal_excitation_counter_ = 0;
  call_counter_ = 0;
}

void CoarseFilterUpdateGain::Compute(
    const std::array<float, kFftLengthBy2Plus1>& render_power,
    const RenderSignalAnalyzer& render_signal_analyzer,
    const FftData& E_coarse,
    size_t size_partitions,
    bool saturated_capture_signal,
    FftData* G) {
  RTC_DCHECK(G);
  ++call_counter_;

  UpdateCurrentConfig();

  if (render_signal_analyzer.PoorSignalExcitation()) {
    poor_signal_excitation_counter_ = 0;
  }

  // Do not update the filter if the render is not sufficiently excited.
  if (++poor_signal_excitation_counter_ < size_partitions ||
      saturated_capture_signal || call_counter_ <= size_partitions) {
    G->re.fill(0.f);
    G->im.fill(0.f);
    return;
  }

  // Compute mu.
  std::array<float, kFftLengthBy2Plus1> mu;
  const auto& X2 = render_power;
  for (size_t k = 0; k < kFftLengthBy2Plus1; ++k) {
    if (X2[k] > current_config_.noise_gate) {
      mu[k] = current_config_.rate / X2[k];
    } else {
      mu[k] = 0.f;
    }
  }

  // Avoid updating the filter close to narrow bands in the render signals.
  render_signal_analyzer.MaskRegionsAroundNarrowBands(&mu);

  // G = mu * E * X2.
  for (size_t k = 0; k < kFftLengthBy2Plus1; ++k) {
    G->re[k] = mu[k] * E_coarse.re[k];
    G->im[k] = mu[k] * E_coarse.im[k];
  }
}

void CoarseFilterUpdateGain::UpdateCurrentConfig() {
  RTC_DCHECK_GE(config_change_duration_blocks_, config_change_counter_);
  if (config_change_counter_ > 0) {
    if (--config_change_counter_ > 0) {
      auto average = [](float from, float to, float from_weight) {
        return from * from_weight + to * (1.f - from_weight);
      };

      float change_factor =
          config_change_counter_ * one_by_config_change_duration_blocks_;

      current_config_.rate =
          average(old_target_config_.rate, target_config_.rate, change_factor);
      current_config_.noise_gate =
          average(old_target_config_.noise_gate, target_config_.noise_gate,
                  change_factor);
    } else {
      current_config_ = old_target_config_ = target_config_;
    }
  }
  RTC_DCHECK_LE(0, config_change_counter_);
}

}  // namespace webrtc


text:
''' This attribute should be used to decorate a Class with a Friendly Name.
''' <autogenerated>Generated from a T4 template. Modifications will be lost, if applicable use a partial class instead.</autogenerated>
''' <generator-date>10/02/2014 15:37:47</generator-date>
''' <generator-functions>1</generator-functions>
''' <generator-source>Leviathan\General\Attributes\Generated\NameAttribute.tt</generator-source>
''' <generator-template>Text-Templates\Classes\VB_Object.tt</generator-template>
''' <generator-version>1</generator-version>
<System.CodeDom.Compiler.GeneratedCode("Leviathan\General\Attributes\Generated\NameAttribute.tt", "1")> _
<AttributeUsageAttribute(AttributeTargets.[Class], _
	AllowMultiple:=False, Inherited:=False)> _
Partial Public NotInheritable Class NameAttribute
	Inherits System.Attribute

	#Region " Public Constructors "

		''' Default Constructor
		Public Sub New()

			MyBase.New()

		End Sub

		''' Parametered Constructor (1 Parameters)
		Public Sub New( _
			ByVal _ResourceContainingType As System.Type _
		)

			MyBase.New()

			ResourceContainingType = _ResourceContainingType

		End Sub

		''' Parametered Constructor (2 Parameters)
		Public Sub New( _
			ByVal _ResourceContainingType As System.Type, _
			ByVal _ResourceName As System.String _
		)

			MyBase.New()

			ResourceContainingType = _ResourceContainingType
			ResourceName = _ResourceName

		End Sub

		''' Parametered Constructor (3 Parameters)
		Public Sub New( _
			ByVal _ResourceContainingType As System.Type, _
			ByVal _ResourceName As System.String, _
			ByVal _Name As System.String _
		)

			MyBase.New()

			ResourceContainingType = _ResourceContainingType
			ResourceName = _ResourceName
			Name = _Name

		End Sub

	#End Region

	#Region " Class Plumbing/Interface Code "

		#Region " Attributable Implementation "

			#Region " Public Shared Methods "

				Public Shared Function GetMember( _
					ByVal onType As Type _
				) As Leviathan.Inspection.MemberAnalyser

					Return GetSingleObject(GetMembers(onType))

				End Function

				Public Shared Function GetMembers( _
					ByVal onType As Type _
				) As Leviathan.Inspection.MemberAnalyser()

					Return Leviathan.Inspection.TypeAnalyser.GetInstance(onType) _
						.ExecuteQuery(Leviathan.Inspection.AnalyserQuery.QUERY_MEMBERS_READABLE _
							.SetPresentAttribute(GetType(NameAttribute)) _
					)

				End Function

			#End Region

		#End Region

		#Region " Resourced Implementation "

			#Region " Public Constants "

				'''
				''' <remarks></remarks>
				Public Const RESOURCE_PREFIX As String = "@"

				'''
				''' <remarks></remarks>
				Public Const RESOURCE_SUFFIX As String = "@"

			#End Region

			#Region " Private Properties "

				Private ReadOnly Property ResourceContainingAssembly() As System.Reflection.Assembly
					Get
						If ResourceContainingType Is Nothing Then

							If Not System.Reflection.Assembly.GetEntryAssembly Is Nothing Then

								Return System.Reflection.Assembly.GetEntryAssembly

							Else

								Return System.Reflection.Assembly.GetExecutingAssembly

							End If

						Else

							Return ResourceContainingType.Assembly

						End If
					End Get
				End Property

			#End Region

			#Region " Protected Methods "

				Protected Function GetResourcedValue( _
					ByVal value As String _
				) As String

					If Not String.IsNullOrEmpty(value) AndAlso value.StartsWith(RESOURCE_PREFIX) AndAlso _
						value.EndsWith(RESOURCE_SUFFIX) Then

						Return Resources.SingleResource( _
							ResourceContainingAssembly, ResourceName, _
							value.Substring(RESOURCE_PREFIX.Length, value.Length - _
							(RESOURCE_PREFIX.Length + RESOURCE_SUFFIX.Length)))

					Else

						Return value

					End If

				End Function

			#End Region

		#End Region

	#End Region

	#Region " Public Constants "

		''' Public Shared Reference to the Name of the Property: ResourceContainingType
		''' <remarks></remarks>
		Public Const PROPERTY_RESOURCECONTAININGTYPE As String = "ResourceContainingType"

		''' Public Shared Reference to the Name of the Property: ResourceName
		''' <remarks></remarks>
		Public Const PROPERTY_RESOURCENAME As String = "ResourceName"

		''' Public Shared Reference to the Name of the Property: Name
		''' <remarks></remarks>
		Public Const PROPERTY_NAME As String = "Name"

	#End Region

	#Region " Private Variables "

		''' Private Data Storage Variable for Property: ResourceContainingType
		''' <remarks></remarks>
		Private m_ResourceContainingType As System.Type

		''' Private Data Storage Variable for Property: ResourceName
		''' <remarks></remarks>
		Private m_ResourceName As System.String

		''' Private Data Storage Variable for Property: Name
		''' <remarks></remarks>
		Private m_Name As System.String

	#End Region

	#Region " Public Properties "

		''' Provides Access to the Property: ResourceContainingType
		''' <remarks></remarks>
		Public Property ResourceContainingType() As System.Type
			Get
				Return m_ResourceContainingType
			End Get
			Set(value As System.Type)
				m_ResourceContainingType = value
			End Set
		End Property

		''' Provides Access to the Property: ResourceName
		''' <remarks></remarks>
		Public Property ResourceName() As System.String
			Get
				Return m_ResourceName
			End Get
			Set(value As System.String)
				m_ResourceName = value
			End Set
		End Property

		''' Provides Access to the Property: Name
		''' <remarks></remarks>
		Public Property Name() As System.String
			Get
				Return m_Name
			End Get
			Set(value As System.String)
				m_Name = value
				m_Name = GetResourcedValue(m_Name)
			End Set
		End Property

	#End Region

End Class


text:
package pl.pronux.sokker.importer.controller;

import java.io.StringReader;
import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.List;

import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

import pl.pronux.sokker.actions.ConfigurationManager;
import pl.pronux.sokker.actions.JuniorsManager;
import pl.pronux.sokker.actions.PlayersManager;
import pl.pronux.sokker.actions.TeamManager;
import pl.pronux.sokker.actions.TrainersManager;
import pl.pronux.sokker.data.sql.SQLSession;
import pl.pronux.sokker.downloader.managers.JuniorsXmlManager;
import pl.pronux.sokker.downloader.managers.PlayersXmlManager;
import pl.pronux.sokker.downloader.managers.ReportsXmlManager;
import pl.pronux.sokker.downloader.managers.TeamsXmlManager;
import pl.pronux.sokker.downloader.managers.TrainersXmlManager;
import pl.pronux.sokker.downloader.managers.TransfersXmlManager;
import pl.pronux.sokker.downloader.managers.XmlManagerUtils;
import pl.pronux.sokker.downloader.xml.parsers.OldXmlParser;
import pl.pronux.sokker.importer.model.IXMLpack;
import pl.pronux.sokker.importer.model.XMLpack;
import pl.pronux.sokker.importer.model.XMLpackOld;
import pl.pronux.sokker.interfaces.ProgressMonitor;
import pl.pronux.sokker.interfaces.RunnableWithProgress;
import pl.pronux.sokker.model.Club;
import pl.pronux.sokker.model.Coach;
import pl.pronux.sokker.model.Junior;
import pl.pronux.sokker.model.Player;
import pl.pronux.sokker.model.Report;
import pl.pronux.sokker.model.Training;
import pl.pronux.sokker.model.Transfer;
import pl.pronux.sokker.resources.Messages;
import pl.pronux.sokker.utils.Log;
import pl.pronux.sokker.utils.file.OperationOnFile;

public class ImportXMLAction implements RunnableWithProgress {

	private ConfigurationManager configurationManager = ConfigurationManager.getInstance();

	private TrainersManager trainersManager = TrainersManager.getInstance();

	private TeamManager teamManager = TeamManager.getInstance();

	private JuniorsManager juniorsManager = JuniorsManager.getInstance();

	private PlayersManager playersManager = PlayersManager.getInstance();

	private List<IXMLpack> packages;

	public ImportXMLAction(List<IXMLpack> packages) {
		this.packages = packages;
	}

	public void run(ProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
		monitor.beginTask(Messages.getString("ImportXMLAction.start"), packages.size());
		try {
			SQLSession.connect();
			int teamID = configurationManager.getTeamId();
			for (IXMLpack child : packages) {
				if (monitor.isCanceled()) {
					throw new InterruptedException();
				}

				monitor.setTaskName(Messages.getString("ImportXMLAction.import"));
				monitor.subTask(child.getDate().toDateTimeString());
				if (child instanceof XMLpack) {
					XMLpack pack = (XMLpack) child;
					if (pack.isComplete()) {
						try {
							SQLSession.beginTransaction();
							// if (pack.getCountries() != null) {
							// CountriesXmlManager countriesManager = new
							// CountriesXmlManager(OperationOnFile.readFromFile(pack.getCountries(),
							// "UTF-8"), pack.getDate(), pack.getTeamID());
							// countriesManager.parseXML();
							// countriesManager.importToSQL();
							// }
							TeamsXmlManager teamXmlManager = new TeamsXmlManager(
								OperationOnFile.readFromFile(pack.getTeam(), "UTF-8"), pack.getDate(), pack.getTeamId());
							PlayersXmlManager playersXmlManager = new PlayersXmlManager(
								OperationOnFile.readFromFile(pack.getPlayers(), "UTF-8"), pack.getDate(), pack.getTeamId());
							JuniorsXmlManager juniorsXmlManager = new JuniorsXmlManager(
								OperationOnFile.readFromFile(pack.getJuniors(), "UTF-8"), pack.getDate(), pack.getTeamId());
							TrainersXmlManager trainersXMLManager;
							TransfersXmlManager transfersManager;
							ReportsXmlManager reportsManager;
							List<Coach> trainers;

							Club club = teamXmlManager.parseXML(teamID);
							List<Player> players = playersXmlManager.parseXML();
							List<Junior> juniors = juniorsXmlManager.parseXML();

							if (club.getId() == teamID) {
								if (club.getId() == pack.getTeamId()) {
									teamManager.importerTeam(club, pack.getDate());
								}

								Training training = null;

								if (club != null) {
									training = club.getTraining();
									if (pack.getTrainers() != null) {
										trainersXMLManager = new TrainersXmlManager(
											OperationOnFile.readFromFile(pack.getTrainers(), "UTF-8"), pack.getDate(), pack.getTeamId());
										trainers = trainersXMLManager.parseXML();
										trainersManager.importerTrainers(trainers);
										trainersXMLManager.importCoachesAtTraining(training);
									}
								}
								playersManager.importPlayers(players, training);
								juniorsManager.importJuniors(juniors, training, club.getId());

								if (pack.getReports() != null) {
									reportsManager = new ReportsXmlManager(
										OperationOnFile.readFromFile(pack.getReports(), "UTF-8"), pack.getDate(), pack.getTeamId());
									List<Report> reports = reportsManager.parseXML();
									teamManager.importerReports(reports);
								}

								// if(pack.getRegion() != null) {
								// CountriesManager countriesManager = new
								// CountriesManager();
								// regionManager = new
								// RegionXmlManager(OperationOnFile.readFromFile(pack.getRegion(),
								// "UTF-8"), pack.getDate(), pack.getTeamID());
								// List<Region> regions =
								// regionManager.parseXML();
								// if(regions.get(0) != null) {
								// countriesManager.importRegion(regions.get(0));
								// }
								// }

								if (pack.getTransfers() != null) {
									transfersManager = new TransfersXmlManager(
										OperationOnFile.readFromFile(pack.getTransfers(), "UTF-8"), pack.getDate(), pack.getTeamId());
									List<Transfer> transfers = transfersManager.parseXML();
									teamManager.importerTransfers(transfers);
								}

								// if(pack.getLeagues().size() > 0) {
								// leagueXmlManager = new LeagueXmlManager();
								// List<String> leagues = new ArrayList<String>();
								// for(File league : pack.getLeagues()) {
								// leagues.add(OperationOnFile.readFromFile(league, "UTF-8"));
								// }
								// leagueXmlManager.parseXML(leagues);
								// leagueXmlManager.importToSQL();
								// }
								//
								// if(pack.getMatches().size() > 0) {
								// matchXmlManager = new MatchXmlManager();
								// List<String> matches = new ArrayList<String>();
								// for(File match : pack.getMatches()) {
								// matches.add(OperationOnFile.readFromFile(match, "UTF-8"));
								// }
								// matchXmlManager.parseXML(matches);
								// matchXmlManager.importToSQL();
								// }
								pack.setImported(true);
							} else {
								pack.setImported(false);
							}

							SQLSession.commit();

						} catch (Exception e) {
							pack.setImported(false);
							SQLSession.rollback();
							Log.error("XML Importer ", e);
						} finally {
							SQLSession.endTransaction();
						}
					}
				} else if (child instanceof XMLpackOld) {
					XMLpackOld pack = (XMLpackOld) child;
					try {

						// FIXME: data zmiany kodowania z ISO-8859-2 na utf 24.03.2006
						// BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(importXMLTable.getItem(i).getText(0)), "ISO-8859-2"));

						SQLSession.beginTransaction();
						OldXmlParser oldXMLParser = new OldXmlParser();
						String xml = OperationOnFile.readFromFile(pack.getFile(), "UTF-8");
						InputSource input = new InputSource(new StringReader(xml));
						try {
							oldXMLParser.parseXmlSax(input, null);
						} catch (SAXException ex) {
							input = new InputSource(new StringReader(XmlManagerUtils.filterCharacters(xml)));
							oldXMLParser.parseXmlSax(input, null);
						}
						Club club = oldXMLParser.getClub();
						if (club.getId() == teamID) {

							trainersManager.importerTrainers(club.getCoaches());
							teamManager.importerTeam(club, pack.getDate());
							Training training = null;
							if (club != null) {
								training = club.getTraining();
								if ((training.getStatus() & Training.NEW_TRAINING) != 0) {
									trainersManager.importTrainersAtTraining(club.getCoaches(), training);
								} else if ((training.getStatus() & Training.UPDATE_TRAINING) != 0) {
									trainersManager.updateTrainersAtTraining(club.getCoaches(), training);
								}
							}
							playersManager.importPlayers(club.getPlayers(), training);
							juniorsManager.importJuniors(club.getJuniors(), training, club.getId());

							pack.setImported(true);
						} else {
							pack.setImported(false);
						}
						SQLSession.commit();
					} catch (Exception e) {
						pack.setImported(false);
						SQLSession.rollback();
						Log.error("XML Importer ", e);
					} finally {
						SQLSession.endTransaction();
					}

				}
				monitor.worked(1);
			}
			// new DatabaseConfiguration().updateDbCountry(true);
			// new DatabaseConfiguration().updateDbUpdate(true);
			// SQLSession.commit();
			SQLSession.close();
		} catch (SQLException e) {
			try {
				SQLSession.rollback();
				SQLSession.close();
			} catch (SQLException e1) {
				Log.error("Synchronizer -> SQL Importing Rollback", e1);
			}
			Log.error("Synchronizer -> SQL Importing", e);
		} finally {
			monitor.done();
		}
	}

	public void onFinish() {
		// TODO Auto-generated method stub

	}
}


text:
ARGS=$@

#
# Import common functions.
#
if [ "${IGNITE_HOME}" = "" ];
    then IGNITE_HOME_TMP="$(dirname "$(cd "$(dirname "$0")"; "pwd")")";
    else IGNITE_HOME_TMP=${IGNITE_HOME};
fi

#
# Set SCRIPTS_HOME - base path to scripts.
#
SCRIPTS_HOME="${IGNITE_HOME_TMP}/bin"

source "${SCRIPTS_HOME}"/include/functions.sh

#
# Discover path to Java executable and check it's version.
#
checkJava

#
# Discover IGNITE_HOME environment variable.
#
setIgniteHome

#
# Parse command line parameters.
#
. "${SCRIPTS_HOME}"/include/parseargs.sh

#
# Set IGNITE_LIBS.
#
. "${SCRIPTS_HOME}"/include/setenv.sh
. "${SCRIPTS_HOME}"/include/target-classpath.sh # Will be removed in release.
CP="${IGNITE_HOME}/bin/include/visor-common/*${SEP}${IGNITE_HOME}/bin/include/visorcmd/*${SEP}${IGNITE_LIBS}"

#
# JVM options. See http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp for more details.
#
# ADD YOUR/CHANGE ADDITIONAL OPTIONS HERE
#
JVM_OPTS="-Xms1g -Xmx1g -XX:MaxPermSize=128M -server ${JVM_OPTS}"

# Mac OS specific support to display correct name in the dock.
osname=`uname`

if [ "${DOCK_OPTS}" == "" ]; then
    DOCK_OPTS="-Xdock:name=Visor - Ignite Shell Console"
fi

#
# Uncomment to set preference for IPv4 stack.
#
# JVM_OPTS="${JVM_OPTS} -Djava.net.preferIPv4Stack=true"

#
# Assertions are disabled by default since version 3.5.
# If you want to enable them - set 'ENABLE_ASSERTIONS' flag to '1'.
#
ENABLE_ASSERTIONS="1"

#
# Set '-ea' options if assertions are enabled.
#
if [ "${ENABLE_ASSERTIONS}" = "1" ]; then
    JVM_OPTS="${JVM_OPTS} -ea"
fi

#
# Save terminal setting. Used to restore terminal on finish.
#
SAVED_STTY=`stty -g 2>/dev/null`

#
# Restores terminal.
#
function restoreSttySettings() {
    stty ${SAVED_STTY}
}

#
# Trap that restores terminal in case script execution is interrupted.
#
trap restoreSttySettings INT

#
# Start Visor console.
#
case $osname in
    Darwin*)
        "$JAVA" ${JVM_OPTS} ${QUIET} "${DOCK_OPTS}" \
        -DIGNITE_UPDATE_NOTIFIER=false -DIGNITE_HOME="${IGNITE_HOME}" -DIGNITE_PROG_NAME="$0" \
        -DIGNITE_DEPLOYMENT_MODE_OVERRIDE=ISOLATED ${JVM_XOPTS} -cp "${CP}" \
        org.apache.ignite.visor.commands.VisorConsole ${ARGS}
    ;;
    *)
        "$JAVA" ${JVM_OPTS} ${QUIET} -DIGNITE_UPDATE_NOTIFIER=false \
        -DIGNITE_HOME="${IGNITE_HOME}" -DIGNITE_PROG_NAME="$0" -DIGNITE_DEPLOYMENT_MODE_OVERRIDE=ISOLATED \
        ${JVM_XOPTS} -cp "${CP}" \
        org.apache.ignite.visor.commands.VisorConsole ${ARGS}
    ;;
esac

#
# Restore terminal.
#
restoreSttySettings


text:
package build

import (
	"log"
	"os"
	"path/filepath"

	"github.com/kubernetes-incubator/apiserver-builder/cmd/apiserver-boot/boot/util"
	"github.com/spf13/cobra"
	"io/ioutil"
)

var Image string

var createBuildContainerCmd = &cobra.Command{
	Use:   "container",
	Short: "Builds a container with the apiserver and controller-manager binaries",
	Long:  `Builds a container with the apiserver and controller-manager binaries`,
	Example: `# Build an image containing the apiserver
# and controller-manager binaries (built for linux:amd64)
apiserver-boot build container --image gcr.io/myrepo/myimage:mytag

# Push the newly built image to the image repo
docker push gcr.io/myrepo/myimage:mytag`,
	Run: RunBuildContainer,
}

func AddBuildContainer(cmd *cobra.Command) {
	cmd.AddCommand(createBuildContainerCmd)
	AddBuildContainerFlags(createBuildContainerCmd)
}

func AddBuildContainerFlags(cmd *cobra.Command) {
	cmd.Flags().StringVar(&Image, "image", "", "name of the image with tag")
	cmd.Flags().BoolVar(&GenerateForBuild, "generate", true, "if true, generate code before building")
}

func RunBuildContainer(cmd *cobra.Command, args []string) {
	if len(Image) == 0 {
		log.Fatalf("Must specify --image")
	}

	dir, err := ioutil.TempDir(os.TempDir(), "apiserver-boot-build-container")
	if err != nil {
		log.Fatalf("failed to create temp directory %s %v", dir, err)
	}
	log.Printf("Will build docker Image from directory %s", dir)

	log.Printf("Writing the Dockerfile.")

	path := filepath.Join(dir, "Dockerfile")
	util.WriteIfNotFound(path, "dockerfile-template", dockerfileTemplate, dockerfileTemplateArguments{})

	log.Printf("Building binaries for linux amd64.")

	// Set the goos and goarch
	goos = "linux"
	goarch = "amd64"
	outputdir = dir
	RunBuildExecutables(cmd, args)

	log.Printf("Building the docker Image using %s.", path)

	util.DoCmd("docker", "build", "-t", Image, dir)
}

type dockerfileTemplateArguments struct {
}

var dockerfileTemplate = `
FROM ubuntu:14.04

RUN apt-get update
RUN apt-get install -y ca-certificates

ADD apiserver .
ADD controller-manager .
`


text:
<component
		id="HexBin"
		title="Hexbin Chart 2.0"
		icon="res/HexBin/HexBin.png"
		handlerType="div"
		modes="commons m"
		propertySheetPath="aps/PropertyPage.html"
		group="ScnCommunityVisualizations"
		databound="true"
>
<requireJs modes="commons m">res/HexBin/HexBin</requireJs>


text:
using Nethereum.JsonRpc.Client;
using Nethereum.RPC.Shh.KeyPair;
using Nethereum.RPC.Tests.Testers;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Xunit;

namespace Nethereum.RPC.Tests.Testers
{
    public class ShhAddPrivateKeyTester : RPCRequestTester<string>, IRPCRequestTester
    {
        [Fact]
        public async void ShouldReturnTheKeyPairID()
        {
            var result = await ExecuteAsync().ConfigureAwait(false);
            Assert.NotNull(result);
        }

        public override Task<string> ExecuteAsync(IClient client)
        {
            var shhAddPrivateKey = new ShhAddPrivateKey(client);
            return shhAddPrivateKey.SendRequestAsync(Settings.GetDefaultShhPrivateKey());
        }

        public override Type GetRequestType()
        {
            return typeof(ShhAddPrivateKey);
        }
    }
}


text:
using Content.Client.Utility;
using Robust.Client.Graphics;
using Robust.Client.Graphics.Drawing;
using Robust.Client.Interfaces.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Shared.Maths;

namespace Content.Client.UserInterface.Stylesheets
{
    public abstract class StyleBase
    {
        public const string ClassHighDivider = "HighDivider";
        public const string StyleClassLabelHeading = "LabelHeading";
        public const string StyleClassLabelSubText = "LabelSubText";
        public const string StyleClassItalic = "Italic";

        public const string ButtonOpenRight = "OpenRight";
        public const string ButtonOpenLeft = "OpenLeft";
        public const string ButtonOpenBoth = "OpenBoth";

        public const string ButtonCaution = "Caution";

        public abstract Stylesheet Stylesheet { get; }

        protected StyleRule[] BaseRules { get; }

        protected StyleBoxTexture BaseButton { get; }
        protected StyleBoxTexture BaseButtonOpenRight { get; }
        protected StyleBoxTexture BaseButtonOpenLeft { get; }
        protected StyleBoxTexture BaseButtonOpenBoth { get; }

        protected StyleBase(IResourceCache resCache)
        {
            var notoSans12 = resCache.GetFont("/Fonts/NotoSans/NotoSans-Regular.ttf", 12);
            var notoSans12Italic = resCache.GetFont("/Fonts/NotoSans/NotoSans-Italic.ttf", 12);

            // Button styles.
            var buttonTex = resCache.GetTexture("/Textures/Interface/Nano/button.svg.96dpi.png");
            BaseButton = new StyleBoxTexture
            {
                Texture = buttonTex,
            };
            BaseButton.SetPatchMargin(StyleBox.Margin.All, 10);
            BaseButton.SetPadding(StyleBox.Margin.All, 1);
            BaseButton.SetContentMarginOverride(StyleBox.Margin.Vertical, 2);
            BaseButton.SetContentMarginOverride(StyleBox.Margin.Horizontal, 14);

            BaseButtonOpenRight = new StyleBoxTexture(BaseButton)
            {
                Texture = new AtlasTexture(buttonTex, UIBox2.FromDimensions((0, 0), (14, 24))),
            };
            BaseButtonOpenRight.SetPatchMargin(StyleBox.Margin.Right, 0);
            BaseButtonOpenRight.SetContentMarginOverride(StyleBox.Margin.Right, 8);
            BaseButtonOpenRight.SetPadding(StyleBox.Margin.Right, 2);

            BaseButtonOpenLeft = new StyleBoxTexture(BaseButton)
            {
                Texture = new AtlasTexture(buttonTex, UIBox2.FromDimensions((10, 0), (14, 24))),
            };
            BaseButtonOpenLeft.SetPatchMargin(StyleBox.Margin.Left, 0);
            BaseButtonOpenLeft.SetContentMarginOverride(StyleBox.Margin.Left, 8);
            BaseButtonOpenLeft.SetPadding(StyleBox.Margin.Left, 1);

            BaseButtonOpenBoth = new StyleBoxTexture(BaseButton)
            {
                Texture = new AtlasTexture(buttonTex, UIBox2.FromDimensions((10, 0), (3, 24))),
            };
            BaseButtonOpenBoth.SetPatchMargin(StyleBox.Margin.Horizontal, 0);
            BaseButtonOpenBoth.SetContentMarginOverride(StyleBox.Margin.Horizontal, 8);
            BaseButtonOpenBoth.SetPadding(StyleBox.Margin.Right, 2);
            BaseButtonOpenBoth.SetPadding(StyleBox.Margin.Left, 1);

            BaseRules = new[]
            {
                // Default font.
                new StyleRule(
                    new SelectorElement(null, null, null, null),
                    new[]
                    {
                        new StyleProperty("font", notoSans12),
                    }),

                // Default font.
                new StyleRule(
                    new SelectorElement(null, new[] {StyleClassItalic}, null, null),
                    new[]
                    {
                        new StyleProperty("font", notoSans12Italic),
                    }),
            };
        }
    }
}


text:
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc

package android.support.v7.internal.widget;

import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.database.DataSetObserver;
import android.graphics.drawable.Drawable;
import android.support.v4.view.ActionProvider;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.LinearLayoutCompat;
import android.support.v7.widget.ListPopupWindow;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

// Referenced classes of package android.support.v7.internal.widget:
//            ActivityChooserModel, TintTypedArray

public class ActivityChooserView extends ViewGroup
    implements ActivityChooserModel.ActivityChooserModelClient
{
    private class ActivityChooserViewAdapter extends BaseAdapter
    {

        private static final int ITEM_VIEW_TYPE_ACTIVITY = 0;
        private static final int ITEM_VIEW_TYPE_COUNT = 3;
        private static final int ITEM_VIEW_TYPE_FOOTER = 1;
        public static final int MAX_ACTIVITY_COUNT_DEFAULT = 4;
        public static final int MAX_ACTIVITY_COUNT_UNLIMITED = 0x7fffffff;
        private ActivityChooserModel mDataModel;
        private boolean mHighlightDefaultActivity;
        private int mMaxActivityCount;
        private boolean mShowDefaultActivity;
        private boolean mShowFooterView;
        final ActivityChooserView this$0;

        public int getActivityCount()
        {
            return mDataModel.getActivityCount();
        }

        public int getCount()
        {
            int j = mDataModel.getActivityCount();
            int i = j;
            if (!mShowDefaultActivity)
            {
                i = j;
                if (mDataModel.getDefaultActivity() != null)
                {
                    i = j - 1;
                }
            }
            j = Math.min(i, mMaxActivityCount);
            i = j;
            if (mShowFooterView)
            {
                i = j + 1;
            }
            return i;
        }

        public ActivityChooserModel getDataModel()
        {
            return mDataModel;
        }

        public ResolveInfo getDefaultActivity()
        {
            return mDataModel.getDefaultActivity();
        }

        public int getHistorySize()
        {
            return mDataModel.getHistorySize();
        }

        public Object getItem(int i)
        {
            int j;
            switch (getItemViewType(i))
            {
            default:
                throw new IllegalArgumentException();

            case 1: // '\001'
                return null;

            case 0: // '\0'
                j = i;
                break;
            }
            if (!mShowDefaultActivity)
            {
                j = i;
                if (mDataModel.getDefaultActivity() != null)
                {
                    j = i + 1;
                }
            }
            return mDataModel.getActivity(j);
        }

        public long getItemId(int i)
        {
            return (long)i;
        }

        public int getItemViewType(int i)
        {
            return !mShowFooterView || i != getCount() - 1 ? 0 : 1;
        }

        public boolean getShowDefaultActivity()
        {
            return mShowDefaultActivity;
        }

        public View getView(int i, View view, ViewGroup viewgroup)
        {
            getItemViewType(i);
            JVM INSTR tableswitch 0 1: default 28
        //                       0 107
        //                       1 36;
               goto _L1 _L2 _L3
_L1:
            throw new IllegalArgumentException();
_L3:
            if (view == null) goto _L5; else goto _L4
_L4:
            View view1 = view;
            if (view.getId() == 1) goto _L6; else goto _L5
_L5:
            view1 = LayoutInflater.from(getContext()).inflate(android.support.v7.appcompat.R.layout.abc_activity_chooser_view_list_item, viewgroup, false);
            view1.setId(1);
            ((TextView)view1.findViewById(android.support.v7.appcompat.R.id.title)).setText(getContext().getString(android.support.v7.appcompat.R.string.abc_activity_chooser_view_see_all));
_L6:
            return view1;
_L2:
            if (view == null) goto _L8; else goto _L7
_L7:
            view1 = view;
            if (view.getId() == android.support.v7.appcompat.R.id.list_item) goto _L9; else goto _L8
_L8:
            view1 = LayoutInflater.from(getContext()).inflate(android.support.v7.appcompat.R.layout.abc_activity_chooser_view_list_item, viewgroup, false);
_L9:
            view = getContext().getPackageManager();
            viewgroup = (ImageView)view1.findViewById(android.support.v7.appcompat.R.id.icon);
            ResolveInfo resolveinfo = (ResolveInfo)getItem(i);
            viewgroup.setImageDrawable(resolveinfo.loadIcon(view));
            ((TextView)view1.findViewById(android.support.v7.appcompat.R.id.title)).setText(resolveinfo.loadLabel(view));
            if (mShowDefaultActivity && i == 0 && mHighlightDefaultActivity)
            {
                ViewCompat.setActivated(view1, true);
            } else
            {
                ViewCompat.setActivated(view1, false);
            }
            return view1;
        }

        public int getViewTypeCount()
        {
            return 3;
        }

        public int measureContentWidth()
        {
            int k = mMaxActivityCount;
            mMaxActivityCount = 0x7fffffff;
            int j = 0;
            View view = null;
            int l = android.view.View.MeasureSpec.makeMeasureSpec(0, 0);
            int i1 = android.view.View.MeasureSpec.makeMeasureSpec(0, 0);
            int j1 = getCount();
            for (int i = 0; i < j1; i++)
            {
                view = getView(i, view, null);
                view.measure(l, i1);
                j = Math.max(j, view.getMeasuredWidth());
            }

            mMaxActivityCount = k;
            return j;
        }

        public void setDataModel(ActivityChooserModel activitychoosermodel)
        {
            ActivityChooserModel activitychoosermodel1 = mAdapter.getDataModel();
            if (activitychoosermodel1 != null && isShown())
            {
                activitychoosermodel1.unregisterObserver(mModelDataSetOberver);
            }
            mDataModel = activitychoosermodel;
            if (activitychoosermodel != null && isShown())
            {
                activitychoosermodel.registerObserver(mModelDataSetOberver);
            }
            notifyDataSetChanged();
        }

        public void setMaxActivityCount(int i)
        {
            if (mMaxActivityCount != i)
            {
                mMaxActivityCount = i;
                notifyDataSetChanged();
            }
        }

        public void setShowDefaultActivity(boolean flag, boolean flag1)
        {
            if (mShowDefaultActivity != flag || mHighlightDefaultActivity != flag1)
            {
                mShowDefaultActivity = flag;
                mHighlightDefaultActivity = flag1;
                notifyDataSetChanged();
            }
        }

        public void setShowFooterView(boolean flag)
        {
            if (mShowFooterView != flag)
            {
                mShowFooterView = flag;
                notifyDataSetChanged();
            }
        }

        private ActivityChooserViewAdapter()
        {
            this$0 = ActivityChooserView.this;
            super();
            mMaxActivityCount = 4;
        }

    }

    private class Callbacks
        implements android.widget.AdapterView.OnItemClickListener, android.view.View.OnClickListener, android.view.View.OnLongClickListener, android.widget.PopupWindow.OnDismissListener
    {

        final ActivityChooserView this$0;

        private void notifyOnDismissListener()
        {
            if (mOnDismissListener != null)
            {
                mOnDismissListener.onDismiss();
            }
        }

        public void onClick(View view)
        {
            if (view == mDefaultActivityButton)
            {
                dismissPopup();
                view = mAdapter.getDefaultActivity();
                int i = mAdapter.getDataModel().getActivityIndex(view);
                view = mAdapter.getDataModel().chooseActivity(i);
                if (view != null)
                {
                    view.addFlags(0x80000);
                    getContext().startActivity(view);
                }
                return;
            }
            if (view == mExpandActivityOverflowButton)
            {
                mIsSelectingDefaultActivity = false;
                showPopupUnchecked(mInitialActivityCount);
                return;
            } else
            {
                throw new IllegalArgumentException();
            }
        }

        public void onDismiss()
        {
            notifyOnDismissListener();
            if (mProvider != null)
            {
                mProvider.subUiVisibilityChanged(false);
            }
        }

        public void onItemClick(AdapterView adapterview, View view, int i, long l)
        {
            ((ActivityChooserViewAdapter)adapterview.getAdapter()).getItemViewType(i);
            JVM INSTR tableswitch 0 1: default 32
        //                       0 50
        //                       1 40;
               goto _L1 _L2 _L3
_L1:
            throw new IllegalArgumentException();
_L3:
            showPopupUnchecked(0x7fffffff);
_L5:
            return;
_L2:
            dismissPopup();
            if (!mIsSelectingDefaultActivity)
            {
                break; /* Loop/switch isn't completed */
            }
            if (i > 0)
            {
                mAdapter.getDataModel().setDefaultActivity(i);
                return;
            }
            if (true) goto _L5; else goto _L4
_L4:
            if (!mAdapter.getShowDefaultActivity())
            {
                i++;
            }
            adapterview = mAdapter.getDataModel().chooseActivity(i);
            if (adapterview != null)
            {
                adapterview.addFlags(0x80000);
                getContext().startActivity(adapterview);
                return;
            }
            if (true) goto _L5; else goto _L6
_L6:
        }

        public boolean onLongClick(View view)
        {
            if (view == mDefaultActivityButton)
            {
                if (mAdapter.getCount() > 0)
                {
                    mIsSelectingDefaultActivity = true;
                    showPopupUnchecked(mInitialActivityCount);
                }
                return true;
            } else
            {
                throw new IllegalArgumentException();
            }
        }

        private Callbacks()
        {
            this$0 = ActivityChooserView.this;
            super();
        }

    }

    public static class InnerLayout extends LinearLayoutCompat
    {

        private static final int TINT_ATTRS[] = {
            0x10100d4
        };

        public InnerLayout(Context context, AttributeSet attributeset)
        {
            super(context, attributeset);
            context = TintTypedArray.obtainStyledAttributes(context, attributeset, TINT_ATTRS);
            setBackgroundDrawable(context.getDrawable(0));
            context.recycle();
        }
    }

    private static final String LOG_TAG = "ActivityChooserView";
    private final LinearLayoutCompat mActivityChooserContent;
    private final Drawable mActivityChooserContentBackground;
    private final ActivityChooserViewAdapter mAdapter;
    private final Callbacks mCallbacks;
    private int mDefaultActionButtonContentDescription;
    private final FrameLayout mDefaultActivityButton;
    private final ImageView mDefaultActivityButtonImage;
    private final FrameLayout mExpandActivityOverflowButton;
    private final ImageView mExpandActivityOverflowButtonImage;
    private int mInitialActivityCount;
    private boolean mIsAttachedToWindow;
    private boolean mIsSelectingDefaultActivity;
    private final int mListPopupMaxWidth;
    private ListPopupWindow mListPopupWindow;
    private final DataSetObserver mModelDataSetOberver;
    private android.widget.PopupWindow.OnDismissListener mOnDismissListener;
    private final android.view.ViewTreeObserver.OnGlobalLayoutListener mOnGlobalLayoutListener;
    ActionProvider mProvider;

    public ActivityChooserView(Context context)
    {
        this(context, null);
    }

    public ActivityChooserView(Context context, AttributeSet attributeset)
    {
        this(context, attributeset, 0);
    }

    public ActivityChooserView(Context context, AttributeSet attributeset, int i)
    {
        super(context, attributeset, i);
        mModelDataSetOberver = new DataSetObserver() {

            final ActivityChooserView this$0;

            public void onChanged()
            {
                super.onChanged();
                mAdapter.notifyDataSetChanged();
            }

            public void onInvalidated()
            {
                super.onInvalidated();
                mAdapter.notifyDataSetInvalidated();
            }

            {
                this$0 = ActivityChooserView.this;
                super();
            }
        };
        mOnGlobalLayoutListener = new android.view.ViewTreeObserver.OnGlobalLayoutListener() {

            final ActivityChooserView this$0;

            public void onGlobalLayout()
            {
                if (isShowingPopup())
                {
                    if (!isShown())
                    {
                        getListPopupWindow().dismiss();
                    } else
                    {
                        getListPopupWindow().show();
                        if (mProvider != null)
                        {
                            mProvider.subUiVisibilityChanged(true);
                            return;
                        }
                    }
                }
            }

            {
                this$0 = ActivityChooserView.this;
                super();
            }
        };
        mInitialActivityCount = 4;
        Object obj = context.obtainStyledAttributes(attributeset, android.support.v7.appcompat.R.styleable.ActivityChooserView, i, 0);
        mInitialActivityCount = ((TypedArray) (obj)).getInt(android.support.v7.appcompat.R.styleable.ActivityChooserView_initialActivityCount, 4);
        attributeset = ((TypedArray) (obj)).getDrawable(android.support.v7.appcompat.R.styleable.ActivityChooserView_expandActivityOverflowButtonDrawable);
        ((TypedArray) (obj)).recycle();
        LayoutInflater.from(getContext()).inflate(android.support.v7.appcompat.R.layout.abc_activity_chooser_view, this, true);
        mCallbacks = new Callbacks();
        mActivityChooserContent = (LinearLayoutCompat)findViewById(android.support.v7.appcompat.R.id.activity_chooser_view_content);
        mActivityChooserContentBackground = mActivityChooserContent.getBackground();
        mDefaultActivityButton = (FrameLayout)findViewById(android.support.v7.appcompat.R.id.default_activity_button);
        mDefaultActivityButton.setOnClickListener(mCallbacks);
        mDefaultActivityButton.setOnLongClickListener(mCallbacks);
        mDefaultActivityButtonImage = (ImageView)mDefaultActivityButton.findViewById(android.support.v7.appcompat.R.id.image);
        obj = (FrameLayout)findViewById(android.support.v7.appcompat.R.id.expand_activities_button);
        ((FrameLayout) (obj)).setOnClickListener(mCallbacks);
        ((FrameLayout) (obj)).setOnTouchListener(new android.support.v7.widget.ListPopupWindow.ForwardingListener(((View) (obj))) {

            final ActivityChooserView this$0;

            public ListPopupWindow getPopup()
            {
                return getListPopupWindow();
            }

            protected boolean onForwardingStarted()
            {
                showPopup();
                return true;
            }

            protected boolean onForwardingStopped()
            {
                dismissPopup();
                return true;
            }

            {
                this$0 = ActivityChooserView.this;
                super(view);
            }
        });
        mExpandActivityOverflowButton = ((FrameLayout) (obj));
        mExpandActivityOverflowButtonImage = (ImageView)((FrameLayout) (obj)).findViewById(android.support.v7.appcompat.R.id.image);
        mExpandActivityOverflowButtonImage.setImageDrawable(attributeset);
        mAdapter = new ActivityChooserViewAdapter();
        mAdapter.registerDataSetObserver(new DataSetObserver() {

            final ActivityChooserView this$0;

            public void onChanged()
            {
                super.onChanged();
                updateAppearance();
            }

            {
                this$0 = ActivityChooserView.this;
                super();
            }
        });
        context = context.getResources();
        mListPopupMaxWidth = Math.max(context.getDisplayMetrics().widthPixels / 2, context.getDimensionPixelSize(android.support.v7.appcompat.R.dimen.abc_config_prefDialogWidth));
    }

    private ListPopupWindow getListPopupWindow()
    {
        if (mListPopupWindow == null)
        {
            mListPopupWindow = new ListPopupWindow(getContext());
            mListPopupWindow.setAdapter(mAdapter);
            mListPopupWindow.setAnchorView(this);
            mListPopupWindow.setModal(true);
            mListPopupWindow.setOnItemClickListener(mCallbacks);
            mListPopupWindow.setOnDismissListener(mCallbacks);
        }
        return mListPopupWindow;
    }

    private void showPopupUnchecked(int i)
    {
        if (mAdapter.getDataModel() == null)
        {
            throw new IllegalStateException("No data model. Did you call #setDataModel?");
        }
        getViewTreeObserver().addOnGlobalLayoutListener(mOnGlobalLayoutListener);
        ListPopupWindow listpopupwindow;
        int j;
        int k;
        boolean flag;
        if (mDefaultActivityButton.getVisibility() == 0)
        {
            flag = true;
        } else
        {
            flag = false;
        }
        k = mAdapter.getActivityCount();
        if (flag)
        {
            j = 1;
        } else
        {
            j = 0;
        }
        if (i != 0x7fffffff && k > i + j)
        {
            mAdapter.setShowFooterView(true);
            mAdapter.setMaxActivityCount(i - 1);
        } else
        {
            mAdapter.setShowFooterView(false);
            mAdapter.setMaxActivityCount(i);
        }
        listpopupwindow = getListPopupWindow();
        if (!listpopupwindow.isShowing())
        {
            if (mIsSelectingDefaultActivity || !flag)
            {
                mAdapter.setShowDefaultActivity(true, flag);
            } else
            {
                mAdapter.setShowDefaultActivity(false, false);
            }
            listpopupwindow.setContentWidth(Math.min(mAdapter.measureContentWidth(), mListPopupMaxWidth));
            listpopupwindow.show();
            if (mProvider != null)
            {
                mProvider.subUiVisibilityChanged(true);
            }
            listpopupwindow.getListView().setContentDescription(getContext().getString(android.support.v7.appcompat.R.string.abc_activitychooserview_choose_application));
        }
    }

    private void updateAppearance()
    {
        int i;
        int j;
        if (mAdapter.getCount() > 0)
        {
            mExpandActivityOverflowButton.setEnabled(true);
        } else
        {
            mExpandActivityOverflowButton.setEnabled(false);
        }
        i = mAdapter.getActivityCount();
        j = mAdapter.getHistorySize();
        if (i == 1 || i > 1 && j > 0)
        {
            mDefaultActivityButton.setVisibility(0);
            Object obj = mAdapter.getDefaultActivity();
            android.content.pm.PackageManager packagemanager = getContext().getPackageManager();
            mDefaultActivityButtonImage.setImageDrawable(((ResolveInfo) (obj)).loadIcon(packagemanager));
            if (mDefaultActionButtonContentDescription != 0)
            {
                obj = ((ResolveInfo) (obj)).loadLabel(packagemanager);
                obj = getContext().getString(mDefaultActionButtonContentDescription, new Object[] {
                    obj
                });
                mDefaultActivityButton.setContentDescription(((CharSequence) (obj)));
            }
        } else
        {
            mDefaultActivityButton.setVisibility(8);
        }
        if (mDefaultActivityButton.getVisibility() == 0)
        {
            mActivityChooserContent.setBackgroundDrawable(mActivityChooserContentBackground);
            return;
        } else
        {
            mActivityChooserContent.setBackgroundDrawable(null);
            return;
        }
    }

    public boolean dismissPopup()
    {
        if (isShowingPopup())
        {
            getListPopupWindow().dismiss();
            ViewTreeObserver viewtreeobserver = getViewTreeObserver();
            if (viewtreeobserver.isAlive())
            {
                viewtreeobserver.removeGlobalOnLayoutListener(mOnGlobalLayoutListener);
            }
        }
        return true;
    }

    public ActivityChooserModel getDataModel()
    {
        return mAdapter.getDataModel();
    }

    public boolean isShowingPopup()
    {
        return getListPopupWindow().isShowing();
    }

    protected void onAttachedToWindow()
    {
        super.onAttachedToWindow();
        ActivityChooserModel activitychoosermodel = mAdapter.getDataModel();
        if (activitychoosermodel != null)
        {
            activitychoosermodel.registerObserver(mModelDataSetOberver);
        }
        mIsAttachedToWindow = true;
    }

    protected void onDetachedFromWindow()
    {
        super.onDetachedFromWindow();
        Object obj = mAdapter.getDataModel();
        if (obj != null)
        {
            ((ActivityChooserModel) (obj)).unregisterObserver(mModelDataSetOberver);
        }
        obj = getViewTreeObserver();
        if (((ViewTreeObserver) (obj)).isAlive())
        {
            ((ViewTreeObserver) (obj)).removeGlobalOnLayoutListener(mOnGlobalLayoutListener);
        }
        if (isShowingPopup())
        {
            dismissPopup();
        }
        mIsAttachedToWindow = false;
    }

    protected void onLayout(boolean flag, int i, int j, int k, int l)
    {
        mActivityChooserContent.layout(0, 0, k - i, l - j);
        if (!isShowingPopup())
        {
            dismissPopup();
        }
    }

    protected void onMeasure(int i, int j)
    {
        LinearLayoutCompat linearlayoutcompat = mActivityChooserContent;
        int k = j;
        if (mDefaultActivityButton.getVisibility() != 0)
        {
            k = android.view.View.MeasureSpec.makeMeasureSpec(android.view.View.MeasureSpec.getSize(j), 0x40000000);
        }
        measureChild(linearlayoutcompat, i, k);
        setMeasuredDimension(linearlayoutcompat.getMeasuredWidth(), linearlayoutcompat.getMeasuredHeight());
    }

    public void setActivityChooserModel(ActivityChooserModel activitychoosermodel)
    {
        mAdapter.setDataModel(activitychoosermodel);
        if (isShowingPopup())
        {
            dismissPopup();
            showPopup();
        }
    }

    public void setDefaultActionButtonContentDescription(int i)
    {
        mDefaultActionButtonContentDescription = i;
    }

    public void setExpandActivityOverflowButtonContentDescription(int i)
    {
        String s = getContext().getString(i);
        mExpandActivityOverflowButtonImage.setContentDescription(s);
    }

    public void setExpandActivityOverflowButtonDrawable(Drawable drawable)
    {
        mExpandActivityOverflowButtonImage.setImageDrawable(drawable);
    }

    public void setInitialActivityCount(int i)
    {
        mInitialActivityCount = i;
    }

    public void setOnDismissListener(android.widget.PopupWindow.OnDismissListener ondismisslistener)
    {
        mOnDismissListener = ondismisslistener;
    }

    public void setProvider(ActionProvider actionprovider)
    {
        mProvider = actionprovider;
    }

    public boolean showPopup()
    {
        if (isShowingPopup() || !mIsAttachedToWindow)
        {
            return false;
        } else
        {
            mIsSelectingDefaultActivity = false;
            showPopupUnchecked(mInitialActivityCount);
            return true;
        }
    }

/*
    static boolean access$602(ActivityChooserView activitychooserview, boolean flag)
    {
        activitychooserview.mIsSelectingDefaultActivity = flag;
        return flag;
    }

*/

}


text:
import bgpranking
import argparse

import redis

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Generate a list of all IPS for a day.')
    parser.add_argument('-d', '--date', default=None, help='Date of the dump (YYYY-MM-DD)')

    args = parser.parse_args()
    date = args.date

    if date is None:
        date = bgpranking.get_default_date()

    dates_sources = bgpranking.prepare_sources_by_dates(date, 1)

    asns = bgpranking.existing_asns_timeframe(dates_sources)

    r = redis.Redis(unix_socket_path='./redis_export.sock')
    r.set('date', date)
    for asn in asns:
        blocks = bgpranking.get_all_blocks(asn)
        p = r.pipeline(False)
        for b in blocks:
            p.sadd('asn_b', "{asn}_{b}".format(asn=asn, b=b))
        p.execute()


text:
<?php
/**
 * Provides a means of redirecting a page conditionally
 * based on whether the destination is where the user
 * currently is or not.
 * @author Nate Levesque <public@thenaterhood.com>
 */

namespace Naterweb\Routing\Redirects;

include_once NWEB_ROOT.'/Routing/Redirects/class_redirect.php';

/**
 * Manages conditionally redirecting pages based
 * on the requested uri and a given uri to redirect from.
 * Checks to see if the uri requested by the user contains
 * the uri to redirect from, and prepares to perform the
 * redirect if so.
 *
 * Relies on the redirect class to manage the actual redirecting,
 * this class is primarly an interface to it that deals with the
 * conditional aspect.
 */
class ConditionalRedirect extends Redirect{

	/**
	 * @var $apply - whether or not the redirect needs to occur
	 */

	private $apply;
	/**
	 * Creates an instance of the conditional redirect class
	 * and decides whether the redirect will be performed
	 *
	 * @param $origin - a chosen uri to redirect from
	 * @param $destination - a uri to redirect to
	 * @param $uri - the uri requested by the user
	 */
	public function __construct( $origin, $destination, $uri ){

		$this->origin = $origin;
		$this->destination = $destination;

		if ( is_int( strpos($uri, $origin) ) && $origin != $destination ){

			$this->apply = True;
		}
	}

	/**
	 * Applies the redirect to the page if the redirect should happen
	 *
	 * @param $type - the type of redirect to apply
	 */
	public function apply( $type ){

		if ( $this->apply ){
			parent::apply( $type );
		}

	}

}

?>


text:
namespace NuPattern.Configuration
{
    using System;
    using System.Linq;

    public class EventFor<T> where T : class
    {
        private ComponentConfiguration parent;

        internal EventFor(ComponentConfiguration parent)
        {
            this.parent = parent;
        }

        public ComponentConfiguration Configuration { get { return parent; } }
    }
}


text:
namespace BooleanToStringConverter
{
    using System;

    public class BooleanToStringConverter
    {
        public static void CreateConverter()
        {
            var converter = new Converter();
            converter.ConvertBooleanToString(true);
        }

        private class Converter
        {
            public void ConvertBooleanToString(bool inputToConvert)
            {
                string booleanAsString = inputToConvert.ToString();
                Console.WriteLine(booleanAsString);
            }
        }
    }
}


text:
package de.woerteler.gui;

import static de.woerteler.gui.GUIActions.ActionID.*;

import java.awt.BorderLayout;
import java.awt.ComponentOrientation;

import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JToolBar;
import javax.swing.text.Document;

/**
 * This {@link JPanel} displays the grammar that's currently used.
 *
 * @author Leo Woerteler
 */
public final class GrammarEditor extends JPanel {

  /** Text area. */
  private final JTextArea area;

  /** Serial version UID. */
  private static final long serialVersionUID = 7554060907371987000L;

  /**
   * Default constructor.
   *
   * @param ctrl Controller
   */
  public GrammarEditor(final Controller ctrl) {
    super(new BorderLayout());
    final JToolBar toolBar = new JToolBar();
    toolBar.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
    toolBar.setFloatable(false);

    // save button
    final JButton save = new JButton(ctrl.getActionFor(GRAMMAR_SAVE));
    save.setText(null);
    toolBar.add(save);

    // open button
    final JButton open = new JButton(ctrl.getActionFor(GRAMMAR_OPEN));
    open.setText(null);
    toolBar.add(open);

    add(toolBar, BorderLayout.PAGE_START);

    area = new JTextArea();
    add(new JScrollPane(area), BorderLayout.CENTER);
  }

  /**
   * Getter for the text area's document.
   *
   * @return the document
   */
  public Document getDocument() {
    return area.getDocument();
  }

  /** Rewinds the caret position to the start of the document. */
  public void rewind() {
    area.setCaretPosition(0);
  }

}