text:
"use strict";

function Actor() {
	this.alive = true;
	this.actions = [];
}

Actor.prototype.addAction = function(action) {
	this.actions.push(action);
};

Actor.prototype.performActions = function(level) {
	if(this.actions.length)
		console.log("performin actions", this.actions);
	this.actions.forEach(function(action) {
		action.execute(level);
	});

	this.actions = [];
};

Actor.prototype.logic = function() {
};

Actor.prototype.draw = function(context, tileSet, interpolation, ticks) {
};

// Called before actor is added to the game
Actor.prototype.beforeAddActor = function() {
};

// Called before actor is removed from the game
Actor.prototype.beforeRemoveActor = function() {
};

// Called by CollisionEngine if it have been used as a value for CollisionDetection
Actor.prototype.isBlocking = function(otherActor) {
	console.log(this, "is blocking for ", otherActor);

	return false;
};


text:
using System.Web.Http;

namespace Cosmos.Loggings.SampleSink_AspNetMvc {
    public static class WebApiConfig {
        public static void Register(HttpConfiguration config) {
            // Web API configuration and services

            // Web API routes
            config.MapHttpAttributeRoutes();

            config.Routes.MapHttpRoute(
                "DefaultApi",
                "api/{controller}/{id}",
                new {id = RouteParameter.Optional}
            );
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System.Collections.Generic;

namespace Cake.Storm.Fluent.Interfaces
{
	public interface IApplicationConfiguration : IConfiguration
	{
		IReadOnlyDictionary<string, ITargetConfiguration> Targets { get; }

		void AddTarget(string name, ITargetConfiguration targetConfiguration);
	}
}


text:
import Styles from "../utils/Style";

class InlineStyle{

    constructor(){//to-do need to add verifier for each Session property to restrict to respective property

        Object.defineProperties(this, {
            "default": {
                value: Weave.linkableChild(this, new weavejs.core.LinkableVariable())
            },
            "domDefined":{
                value: Weave.linkableChild(this, new weavejs.core.LinkableVariable())
            }
        });

        Object.defineProperties(this, {
            "state": {
                get: function(){
                    var stateObj = this.default.state;
                    if(this.domDefined.state){
                         stateObj = stateObj ? Styles.mergeStyleObjects(stateObj,this.domDefined.state) :this.domDefined.state
                    }
                    return Styles.mergeStyleObjects({},stateObj,true);// need to send new copy to avoid react warniing

                },
                set: function(obj){
                    var stateObj = this.default.state;
                    this.default.state = stateObj?Styles.mergeStyleObjects(stateObj,obj,true):obj;
                }
            }
        });

    }

    getStyleFor(){
        //to-do : type: mobile mode | Tablet mode | laptop Mode  | iconMode
        return this.state
    }

}

Weave.registerClass( InlineStyle,['weavereact.InlineStyle'],[weavejs.api.core.ILinkableObject],'Inline Style');

export default InlineStyle;


text:
// coding: utf-8

// ----------------------------------------------------------------------------

//
// STM32F4DISCOVERY
// Discovery kit for STM32F407/417 lines
// http://www.st.com/web/en/catalog/tools/FM116/SC959/SS1532/PF252419
//

#ifndef XPCC_STM32_F4_DISCOVERY_HPP
#define XPCC_STM32_F4_DISCOVERY_HPP

#include <xpcc/architecture/platform.hpp>
#include <xpcc/driver/inertial/lis3dsh.hpp>

using namespace xpcc::stm32;

namespace Board
{

/* SystemClock generator is only available for selected STM32F4 devices.
 * The idea is that it is generated automatically for you like the rest of the
 * HAL, however, xpcc does not have this capability yet. See PR #36.
 */
// using systemClock = SystemClock<Pll<ExternalCrystal<MHz8>, MHz168, MHz48> >;

// Instead this manual implementation of the system clock is used:
/// STM32F407 running at 168MHz generated from the external 8MHz crystal
struct systemClock {
	static constexpr uint32_t Frequency = 168 * MHz1;
	static constexpr uint32_t Ahb = Frequency;
	static constexpr uint32_t Apb1 = Frequency / 4;
	static constexpr uint32_t Apb2 = Frequency / 2;

	static constexpr uint32_t Adc = Apb2;

	static constexpr uint32_t Can1   = Apb1;
	static constexpr uint32_t Can2   = Apb1;

	static constexpr uint32_t Spi1   = Apb2;
	static constexpr uint32_t Spi2   = Apb1;
	static constexpr uint32_t Spi3   = Apb1;
	static constexpr uint32_t Spi4   = Apb2;
	static constexpr uint32_t Spi5   = Apb2;
	static constexpr uint32_t Spi6   = Apb2;

	static constexpr uint32_t Usart1 = Apb2;
	static constexpr uint32_t Usart2 = Apb1;
	static constexpr uint32_t Usart3 = Apb1;
	static constexpr uint32_t Uart4  = Apb1;
	static constexpr uint32_t Uart5  = Apb1;
	static constexpr uint32_t Usart6 = Apb2;
	static constexpr uint32_t Uart7  = Apb1;
	static constexpr uint32_t Uart8  = Apb1;

	static constexpr uint32_t I2c1   = Apb1;
	static constexpr uint32_t I2c2   = Apb1;
	static constexpr uint32_t I2c3   = Apb1;

	static constexpr uint32_t Apb1Timer = Apb1 * 2;
	static constexpr uint32_t Apb2Timer = Apb2 * 2;
	static constexpr uint32_t Timer1  = Apb2Timer;
	static constexpr uint32_t Timer2  = Apb1Timer;
	static constexpr uint32_t Timer3  = Apb1Timer;
	static constexpr uint32_t Timer4  = Apb1Timer;
	static constexpr uint32_t Timer5  = Apb1Timer;
	static constexpr uint32_t Timer6  = Apb1Timer;
	static constexpr uint32_t Timer7  = Apb1Timer;
	static constexpr uint32_t Timer8  = Apb2Timer;
	static constexpr uint32_t Timer9  = Apb2Timer;
	static constexpr uint32_t Timer10 = Apb2Timer;
	static constexpr uint32_t Timer11 = Apb2Timer;
	static constexpr uint32_t Timer12 = Apb1Timer;
	static constexpr uint32_t Timer13 = Apb1Timer;
	static constexpr uint32_t Timer14 = Apb1Timer;

	static bool inline
	enable()
	{
		ClockControl::enableExternalCrystal();	// 8MHz
		ClockControl::enablePll(
			ClockControl::PllSource::ExternalCrystal,
			4,		// 8MHz / N=2 -> 2MHz
			168,	// 2MHz * M=168 -> 336MHz
			2,		// 336MHz / P=2 -> 168MHz = F_cpu
			7		// 336MHz / Q=7 -> 48MHz = F_usb
		);
		// set flash latency for 168MHz
		ClockControl::setFlashLatency(Frequency);
		// switch system clock to PLL output
		ClockControl::enableSystemClock(ClockControl::SystemClockSource::Pll);
		ClockControl::setAhbPrescaler(ClockControl::AhbPrescaler::Div1);
		// APB1 has max. 42MHz
		// APB2 has max. 84MHz
		ClockControl::setApb1Prescaler(ClockControl::Apb1Prescaler::Div4);
		ClockControl::setApb2Prescaler(ClockControl::Apb2Prescaler::Div2);
		// update frequencies for busy-wait delay functions
		xpcc::clock::fcpu     = Frequency;
		xpcc::clock::fcpu_kHz = Frequency / 1000;
		xpcc::clock::fcpu_MHz = Frequency / 1000000;
		xpcc::clock::ns_per_loop = ::round(3000 / (Frequency / 1000000));

		return true;
	}
};

using Button = GpioInputA0;
using ClockOut = GpioOutputA8;
using SystemClockOut = GpioOutputC9;

using LedOrange = GpioOutputD13;	// User LED 3
using LedGreen  = GpioOutputD12;	// User LED 4
using LedRed    = GpioOutputD14;	// User LED 5
using LedBlue   = GpioOutputD15;	// User LED 6

using Leds = xpcc::SoftwareGpioPort< LedGreen, LedBlue, LedRed, LedOrange >;

namespace lis3
{
using Int = GpioInputE1;	// LIS302DL_INT2

using Cs   = GpioOutputE3;	// LIS302DL_CS_I2C/SPI
using Sck  = GpioOutputA5;	// SPI1_SCK
using Mosi = GpioOutputA7;	// SPI1_MOSI
using Miso = GpioInputA6;	// SPI1_MISO

using SpiMaster = SpiMaster1;
using Transport = xpcc::Lis3TransportSpi< SpiMaster, Cs >;
}

namespace cs43
{
using Lrck = GpioOutputA4;	// I2S3_WS
using Mclk = GpioOutputC7;	// I2S3_MCK
using Sclk = GpioOutputC10;	// I2S3_SCK
using Sdin = GpioOutputC12;	// I2S3_SD

using Reset = GpioOutputD4;	// Audio_RST
using Scl = GpioB6;			// Audio_SCL
using Sda = GpioB9;			// Audio_SDA

using I2cMaster = I2cMaster1;
//using I2sMaster = I2sMaster3;
}

namespace mp45
{
using Clk = GpioOutputB10;	// CLK_IN: I2S2_CK
using Dout = GpioInputC3;	// PDM_OUT: I2S2_SD
//using  = I2sMaster2 I2sMaster;
}

namespace usb
{
using Dm = GpioA11;			// OTG_FS_DM: USB_OTG_FS_DM
using Dp = GpioA12;			// OTG_FS_DP: USB_OTG_FS_DP
using Id = GpioA10;			// OTG_FS_ID: USB_OTG_FS_ID

using Overcurrent = GpioD5;	// OTG_FS_OverCurrent
using Power = GpioOutputC0;	// OTG_FS_PowerSwitchOn
using VBus = GpioInputA9;	// VBUS_FS: USB_OTG_HS_VBUS
//using Device = UsbFs;
}

inline void
initialize()
{
	systemClock::enable();
	xpcc::cortex::SysTickTimer::initialize<systemClock>();

	LedOrange::setOutput(xpcc::Gpio::Low);
	LedGreen::setOutput(xpcc::Gpio::Low);
	LedRed::setOutput(xpcc::Gpio::Low);
	LedBlue::setOutput(xpcc::Gpio::Low);

	Button::setInput();
	Button::setInputTrigger(Gpio::InputTrigger::RisingEdge);
	Button::enableExternalInterrupt();
//	Button::enableExternalInterruptVector(12);
}

inline void
initializeLis3()
{
	lis3::Int::setInput();
	lis3::Int::setInputTrigger(Gpio::InputTrigger::RisingEdge);
	lis3::Int::enableExternalInterrupt();
//	lis3::Int::enableExternalInterruptVector(12);

	lis3::Cs::setOutput(xpcc::Gpio::High);

	lis3::Sck::connect(lis3::SpiMaster::Sck);
	lis3::Mosi::connect(lis3::SpiMaster::Mosi);
	lis3::Miso::connect(lis3::SpiMaster::Miso);

	lis3::SpiMaster::initialize<systemClock, MHz10>();
	lis3::SpiMaster::setDataMode(lis3::SpiMaster::DataMode::Mode3);
}

/// not supported yet, due to missing I2S driver
inline void
initializeCs43()
{
//	cs43::Lrck::connect(cs43::I2sMaster::Ws);
//	cs43::Mclk::connect(cs43::I2sMaster::Mck);
//	cs43::Sclk::connect(cs43::I2sMaster::Ck);
//	cs43::Sdin::connect(cs43::I2sMaster::Sd);

	cs43::Reset::setOutput(xpcc::Gpio::High);

	cs43::Scl::connect(cs43::I2cMaster::Scl);
	cs43::Sda::connect(cs43::I2cMaster::Sda);
	cs43::I2cMaster::initialize<systemClock, cs43::I2cMaster::Baudrate::Standard>();
}

/// not supported yet, due to missing I2S driver
inline void
initializeMp45()
{
//	mp45::Clk::connect(mp45::I2sMaster::Ck);
//	mp45::Dout::connect(mp45::I2sMaster::Sd);
}

/// not supported yet, due to missing USB driver
inline void
initializeUsb()
{
//	usb::Dm::connect(usb::Device::Dm);
//	usb::Dp::connect(usb::Device::Dp);
//	usb::Id::connect(usb::Device::Id);

	usb::Power::setOutput(Gpio::OutputType::PushPull, Gpio::OutputSpeed::MHz2);

	usb::Overcurrent::setInput(Gpio::InputType::Floating);
	usb::VBus::setInput(Gpio::InputType::Floating);
}

}

#endif	// XPCC_STM32_F4_DISCOVERY_HPP


text:
module Main where

--------------------------------------------------------------------------------

import Data.Bits

import Graphics.Rendering.OpenGL.GL
import Graphics.UI.GLUT

import Data.Bitmap.Pure
import Data.Bitmap.OpenGL

import Codec.Image.STB

import System.Environment
import System.Exit
import System.IO.Unsafe

import Control.Monad
--import Foreign

--------------------------------------------------------------------------------

main = do
  initialDisplayMode $= [ RGBAMode, DoubleBuffered ]

  args <- getArgs
  nonGLUTArgs <- initialize "viewer" args

  fname <- case nonGLUTArgs of
    [fn] -> return fn
    _    -> putStrLn "usage: viewer <imagefile.ext>" >> exitFailure

  img <- loadImage fname >>= \result -> case result of
    Left err  -> putStrLn err >> exitFailure
    Right img -> return img

  let (x,y) = bitmapSize img
      c = bitmapNChannels img

  putStrLn $ "\"" ++ fname ++ "\" loaded"
  putStrLn $ "resolution = " ++ show x ++ " x " ++ show y ++ ", " ++ show c ++ " bytes per pixel"

  createWindow ("viewer - " ++ show fname)

  let eimg = extendImage img
  tex <- makeSimpleBitmapTexture eimg

  displayCallback       $= display img tex
  reshapeCallback       $= Just reshape
  keyboardMouseCallback $= Just keyboard

  drawBuffer $= BackBuffers
  postRedisplay Nothing

  mainLoop

-- reshape callback
reshape _ = postRedisplay Nothing

-- keyboard callback
keyboard key keyState mod pos =
  case key of
    Char '\ESC' -> exitWith ExitSuccess
    _ -> return ()

--------------------------------------------------------------------------------

-- glVertex2d / glTexCoord2d, convenient because the OpenGL vertex / texCoord functions are too polymorphic

vt :: Double -> Double -> IO ()
vt x y = vertex (Vertex2 (realToFrac x :: GLdouble) (realToFrac y :: GLdouble))

tc :: Double -> Double -> IO ()
tc x y = texCoord (TexCoord2 (realToFrac x :: GLdouble) (realToFrac y :: GLdouble))

--------------------------------------------------------------------------------

-- display callback
display img tex = do
  let (xsize,ysize) = bitmapSize img
  clear [ColorBuffer]

  size@(Size xres yres) <- get windowSize
  viewport $= ( Position 0 0 , size )
  let winaspect = fromIntegral xres  / fromIntegral yres  :: Double
      picaspect = fromIntegral xsize / fromIntegral ysize :: Double
  matrixMode $= Projection >> loadIdentity
  ortho (-1) 1 (-1) 1 (-1) 1

  texture Texture2D $= Enabled
  textureBinding Texture2D $= Just tex
  let (x,y) = if picaspect > winaspect then (1,winaspect/picaspect) else (picaspect/winaspect,1)
      r = fromIntegral xsize / fromIntegral (nextPowerOfTwo xsize)
      b = fromIntegral ysize / fromIntegral (nextPowerOfTwo ysize)
  renderPrimitive Quads $ do
    tc 0 0 ; vt (-x) ( y)
    tc r 0 ; vt ( x) ( y)
    tc r b ; vt ( x) (-y)
    tc 0 b ; vt (-x) (-y)

  swapBuffers

--------------------------------------------------------------------------------

log2 :: Int -> Int
log2 n = case n of
  0 -> -1
  _ -> 1 + log2 (shiftR n 1)

nextPowerOfTwo :: Int -> Int
nextPowerOfTwo n = 2 ^ ( 1 + log2 (n-1) )

-- extend the image to have power-of-two sizes, for old videocards
extendImage :: Image -> Image
extendImage bm = copySubImage' bm (0,0) (oldx,oldy) (newx,newy) (0,0) where
  (oldx,oldy) = bitmapSize bm
  (newx,newy) = (nextPowerOfTwo oldx, nextPowerOfTwo newx)

--------------------------------------------------------------------------------


text:
title: Cucumber Tests as First Class Citizens in TeamCity
author: karl
date: Thu, 03 Sep 2009 11:42:47 GMT
template: article.pug
---

[TeamCity](http://www.jetbrains.com/teamcity/) is a great continuous integration server, and has brilliant built in support for running [NUnit](http://www.nunit.org/) tests. The web interface updates automatically as each test is run, and gives immediate feedback on which tests have failed without waiting for the entire suite to finish. It also keeps track of tests over multiple builds, showing you exactly when each test first failed, how often they fail etc.

If like me you are using [Cucumber](http://cukes.info/) to run your acceptance tests, wouldn't it be great to get the same level of TeamCity integration for every Cucumber test. Well now you can, using the `TeamCity::Cucumber::Formatter` from the TeamCity 5.0 EAP release.

JetBrains, the makers of TeamCity, released a [blog post demostrating the Cucumber test integration](http://blogs.jetbrains.com/ruby/2009/08/testing-rubymine-with-cucumber/), but without any details in how to set it up yourself. So I'll take you through it here.

## Getting a Copy of the TeamCity Cucumber Formatter

The [latest TeamCity EAP](http://www.jetbrains.net/confluence/display/TW/TeamCity+EAP) contains the new Cucumber Formatter hidden deep in it's bowels. Rather than make you wade through it all, I've extracted the relevant files and they are available to download here:

#### [Download the TeamCity Cucumber Formatter](TeamCityCucumberFormatter.zip)

The archive contains the formatter and the TeamCity library files it requires to run. Extract the archive in your project root and it will add the following files:

```plain
features/
    support/
        jetbrains-teamcity-formatter.rb
lib/
    teamcity/
        [some support and utility files]
```

If you want to locate these files within the TeamCity EAP yourself, [download the TeamCity 5.0 EAP War](http://download.jetbrains.com/teamcity/TeamCity-10307.war) file and extract it. Then from within the war unzip `WEB-INF/plugins/rake-runner-plugin.zip`. And from within the rake-runner-plugin look at `rake-runner/lib/rb/patch/bdd/teamcity/cucumber/formatter.rb` and all the files in `rake-runner/lib/rb/patch/common/teamcity/`.

The formatter in my download has been tweaked to look in a new location for the teamcity support files, and has been changed to be a single class in a module named `JBTeamCityFormatter` (to ease calling it from the command line).

The relevant changes in the file are:

```ruby

$: << File.expand_path(File.dirname(__FILE__) + '/../../lib/')
require 'teamcity/runner_common'
require 'teamcity/utils/service_message_factory'
require 'teamcity/utils/runner_utils'
require 'teamcity/utils/url_formatter'

class JBTeamCityFormatter < ::Cucumber::Ast::Visitor
```

## Setting up Cucumber to use the TeamCity Formatter

Once you have the formatter installed you can use it as with any Cucumber formatter by adding it as a command line parameter:

```bash
cucumber features -f JBTeamCityFormatter
```

To use it with TeamCity, add a profile your `cucumber.yml` file that runs all your features using the new formatter:

#### cucumber.yml
```yaml
default: features -q
teamcity: features -q --no-c  -f JBTeamCityFormatter
```

## Running Cucumber with TeamCity

Now when you run Cucumber within TeamCity (using the `teamcity` profile) it will report tests in real time, with all the feedback you are used to. Just add a call to the Cucumber executable to your build script (NAnt, MSBuild, Ant, Rake, etc).

![Cucumber tests in TeamCity](cucumber-tests-in-teamcity-cropped.png)

Enjoy the new found treatment of Cucumber tests as first class citizens in TeamCity!


text:
SYNONYM

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

#### Published in
Sydowia 37: 54 (1984)

#### Original name
Agaricus colossus Fr., 1838

### Remarks
null


text:
/**
 * DocuSign REST API
 * The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
 *
 * OpenAPI spec version: v2.1
 * Contact: devcenter@docusign.com
 *
 * NOTE: This class is auto generated. Do not edit the class manually and submit a new issue instead.
 *
 */

(function(root, factory) {
  if (typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module.
    define(['ApiClient', 'model/AccountSignatureProviderOption', 'model/SignatureProviderRequiredOption'], factory);
  } else if (typeof module === 'object' && module.exports) {
    // CommonJS-like environments that support module.exports, like Node.
    module.exports = factory(require('../ApiClient'), require('./AccountSignatureProviderOption'), require('./SignatureProviderRequiredOption'));
  } else {
    // Browser globals (root is window)
    if (!root.Docusign) {
      root.Docusign = {};
    }
    root.Docusign.AccountSignatureProvider = factory(root.Docusign.ApiClient, root.Docusign.AccountSignatureProviderOption, root.Docusign.SignatureProviderRequiredOption);
  }
}(this, function(ApiClient, AccountSignatureProviderOption, SignatureProviderRequiredOption) {
  'use strict';

  /**
   * The AccountSignatureProvider model module.
   * @module model/AccountSignatureProvider
   */

  /**
   * Constructs a new AccountSignatureProvider.
   * @alias module:model/AccountSignatureProvider
   * @class
   */
  var exports = function() {
    var _this = this;

  };

  /**
   * Constructs a AccountSignatureProvider from a plain JavaScript object, optionally creating a new instance.
   * Copies all relevant properties from data to obj if supplied or a new instance if not.
   * @param {Object} data The plain JavaScript object bearing properties of interest.
   * @param {module:model/AccountSignatureProvider} obj Optional instance to populate.
   * @return {module:model/AccountSignatureProvider} The populated AccountSignatureProvider instance.
   */
  exports.constructFromObject = function(data, obj) {
    if (data) {
      obj = obj || new exports();

      if (data.hasOwnProperty('isRequired')) {
        obj['isRequired'] = ApiClient.convertToType(data['isRequired'], 'String');
      }
      if (data.hasOwnProperty('priority')) {
        obj['priority'] = ApiClient.convertToType(data['priority'], 'String');
      }
      if (data.hasOwnProperty('signatureProviderDisplayName')) {
        obj['signatureProviderDisplayName'] = ApiClient.convertToType(data['signatureProviderDisplayName'], 'String');
      }
      if (data.hasOwnProperty('signatureProviderId')) {
        obj['signatureProviderId'] = ApiClient.convertToType(data['signatureProviderId'], 'String');
      }
      if (data.hasOwnProperty('signatureProviderName')) {
        obj['signatureProviderName'] = ApiClient.convertToType(data['signatureProviderName'], 'String');
      }
      if (data.hasOwnProperty('signatureProviderOptionsMetadata')) {
        obj['signatureProviderOptionsMetadata'] = ApiClient.convertToType(data['signatureProviderOptionsMetadata'], [AccountSignatureProviderOption]);
      }
      if (data.hasOwnProperty('signatureProviderRequiredOptions')) {
        obj['signatureProviderRequiredOptions'] = ApiClient.convertToType(data['signatureProviderRequiredOptions'], [SignatureProviderRequiredOption]);
      }
    }
    return obj;
  }

  /**
   *
   * @member {String} isRequired
   */
  exports.prototype['isRequired'] = undefined;
  /**
   *
   * @member {String} priority
   */
  exports.prototype['priority'] = undefined;
  /**
   *
   * @member {String} signatureProviderDisplayName
   */
  exports.prototype['signatureProviderDisplayName'] = undefined;
  /**
   *
   * @member {String} signatureProviderId
   */
  exports.prototype['signatureProviderId'] = undefined;
  /**
   *
   * @member {String} signatureProviderName
   */
  exports.prototype['signatureProviderName'] = undefined;
  /**
   *
   * @member {Array.<module:model/AccountSignatureProviderOption>} signatureProviderOptionsMetadata
   */
  exports.prototype['signatureProviderOptionsMetadata'] = undefined;
  /**
   *
   * @member {Array.<module:model/SignatureProviderRequiredOption>} signatureProviderRequiredOptions
   */
  exports.prototype['signatureProviderRequiredOptions'] = undefined;

  return exports;
}));


text:
require 'spec_helper'

describe Threadable::Organizations::Create, :type => :request do
  describe '#call' do
    let :params do
      {
        name: "Not your mom's company",
        slug: 'notyourmom',
        subject_tag: 'no',
        email_address_username: 'notyourmom',
      }
    end

    let(:organization) { threadable.organizations.find_by_slug('notyourmom') }

    before do
      expect(threadable.organizations.create(params)).to be_a Threadable::Organization
    end

    it 'creates the org' do
      expect(organization.name).to eq "Not your mom's company"
      expect(organization.email_address_username).to eq 'notyourmom'
      expect(organization.subject_tag).to eq 'no'
    end

    it 'populates the org with starter groups and enqueues the messages to be sent' do
      expect(organization.groups.all.map(&:slug)).to match_array ['social', 'notyourmom']
      drain_background_jobs!  # drains all scheduled jobs
      expect(organization.messages.all.length).to eq 0
    end

    it 'sets one of the starter groups to primary' do
      group = organization.groups.find_by_slug('notyourmom')
      expect(group.primary?).to be_truthy
      expect(group.auto_join?).to be_truthy
    end
  end
end


text:
#region Header

// Copyright (c) 2012 Diego Frata
//
// 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, modif/ 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.

#endregion

#region Using Statements

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using RdioNet.Models.Extras;
using RdioNet.Util;

#endregion

namespace RdioNet.Models
{
	/// <summary>
	/// Represents an artist in a user's collection. It will be basically the same as the
	/// equivalent Artist except it only contains the albums that are in the user's collection.
	/// </summary>
	[DebuggerDisplay("{Name,nq}")]
	public class RdioCollectionArtist : RdioArtist
	{
		#region Public Properties

		/// <summary>
		/// The key of the user whose collection this artist is in.
		/// </summary>
		public string UserKey
		{
			get;
			set;
		}

		/// <summary>
		/// The username of the user whose collection this artist is in.
		/// </summary>
		public string Username
		{
			get;
			set;
		}

		/// <summary>
		/// The key of the artist.
		/// </summary>
		public string ArtistKey
		{
			get;
			set;
		}

		/// <summary>
		/// The relative URL of the artist.
		/// </summary>
		public string ArtistUrl
		{
			get;
			set;
		}

		/// <summary>
		/// The relative URL of the user's collection page.	This item doesn't seem to be provided.
		/// </summary>
		public string CollectionUrl
		{
			get;
			set;
		}

		/// <summary>
		/// Extra. The number of tracks from this artist in the user collection.
		/// </summary>
		public int? Count
		{
			get;
			set;
		}

		/// <summary>
		/// List of extra properties.
		/// </summary>
		public static new RdioCollectionArtistExtras Extras
		{
			get
			{
				return Singleton<RdioCollectionArtistExtras>.Instance;
			}
		}

		#endregion
	}
}


text:
package com.lightbend.lagom.internal.javadsl.testkit

import java.util.concurrent.CompletionStage

import akka.Done
import akka.actor.ActorRef
import akka.stream.Materializer
import akka.stream.javadsl.{ Flow, Source }
import com.lightbend.lagom.internal.testkit.InternalSubscriberStub
import com.lightbend.lagom.javadsl.api.broker.{ Subscriber, Topic }

import scala.compat.java8.FutureConverters.toJava

private[lagom] class TopicStub[T](val topicId: Topic.TopicId, topicBuffer: ActorRef)(implicit materializer: Materializer) extends Topic[T] {

  // TODO: use ServiceInfo's name as a default value.
  def subscribe = new SubscriberStub("default", topicBuffer)

  class SubscriberStub(groupId: String, topicBuffer: ActorRef)(implicit materializer: Materializer)
    extends InternalSubscriberStub[T](groupId, topicBuffer)(materializer) with Subscriber[T] {

    override def withGroupId(groupId: String): Subscriber[T] = new SubscriberStub(groupId, topicBuffer)
    override def atMostOnceSource(): Source[T, _] = super.mostOnceSource.asJava
    override def atLeastOnce(flow: Flow[T, Done, _]): CompletionStage[Done] = toJava(super.leastOnce(flow.asScala))
  }
}


text:
Login

		<form data-ng-submit="signin()" class="signin form-horizontal" autocomplete="off">
			<fieldset>

						<input type="text" id="username" name="username" class="form-control" data-ng-model="credentials.username" placeholder="Username">

						<input type="password" id="password" name="password" class="form-control" data-ng-model="credentials.password" placeholder="Password">

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

					Forgot your password?  Or
					Sign up

			</fieldset>
		</form>


text:
from sklearn.metrics import confusion_matrix, f1_score, roc_curve
import numpy as np
import pandas as pd

class analysis:

	def __init__(self):
		pass

	def _getComplexParams(self, abs=False):
		"""
		Function for extracting the data associated with
		the second component of the complex source.

		To call:
			_getComplexParams(abs)

		Parameters:
			abs	Take the absolute value of the difference

		Postcondition:
			The flux of the second component, the difference
			in phases and depth between the two components,
			and the noise value are stored in the data
			frame "self.dfComplex_"

			The model's predicted probability that
			the source is complex is also stored.
		"""

		# ===================================================
		# 	Determine which sources are complex
		# ===================================================
		loc = np.where(self.testLabel_ == 1)[0]

		# ===================================================
		#	Retrieve the model's prediction that
		#	the complex source is complex
		# ===================================================
		prob = self.testProb_[loc]

		# ===================================================
		# 	Extract the flux of the second component
		# ===================================================
		flux = self.testFlux_[loc]
		flux = np.asarray([f[1] for f in flux])

		# ===================================================
		# 	Compute the difference in phases
		# ===================================================
		chi = self.testChi_[loc]
		chi = np.asarray([c[1] - c[0] for c in chi])
		if abs: chi = np.abs(chi)

		# ===================================================
		# 	Compute the difference in Faraday depths
		# ===================================================
		depth = self.testDepth_[loc]
		depth = np.asarray([d[1] - d[0] for d in depth])
		if abs: depth = np.abs(depth)

		# ===================================================
		#	Retrieve the noise parameter
		# ===================================================
		sig = self.testSig_[loc]

		# ===================================================
		#	Convert to pandas series
		# ===================================================
		chi   = pd.Series(chi, name='chi')
		depth = pd.Series(depth, name='depth')
		flux  = pd.Series(flux, name='flux')
		prob  = pd.Series(prob, name='prob')
		sig   = pd.Series(sig, name="sig")

		# ===================================================
		#	Store the results in a dataframe
		# ===================================================
		self.dfComplex_ = pd.concat([chi, depth, flux, prob, sig], axis=1)

	def _getSimpleParams(self):
		"""
		Function for extracting the data associated with
		the simple sources.

		To call:
			_getSimpleParams()

		Parameters:
			None

		Postcondition:

		"""

		# ===================================================
		# 	Determine which sources are complex
		# ===================================================
		loc = np.where(self.testLabel_ == 0)[0]

		# ===================================================
		#	Retrieve the model's prediction that
		#	the complex source is complex
		# ===================================================
		prob = self.testProb_[loc]

		# ===================================================
		# 	Extract the flux
		# ===================================================
		flux = self.testFlux_[loc]

		# ===================================================
		# 	Extract the phase
		# ===================================================
		chi = self.testChi_[loc]

		# ===================================================
		# 	Extract the Faraday depth
		# ===================================================
		depth = self.testDepth_[loc]

		# ===================================================
		#	Retrieve the noise parameter
		# ===================================================
		sig = self.testSig_[loc]

		# ===================================================
		#	Convert to pandas series
		# ===================================================
		chi   = pd.Series(chi, name='chi')
		depth = pd.Series(depth, name='depth')
		flux  = pd.Series(flux, name='flux')
		prob  = pd.Series(prob, name='prob')
		sig   = pd.Series(sig, name="sig")

		# ===================================================
		#	Store the results in a dataframe
		# ===================================================
		self.dfSimple_ = pd.concat([chi, depth, flux, prob, sig], axis=1)

	def _getF1(self, step=0.025, save=False, suffix='', dir='./'):

		try:
			self.testProb_
		except:
			self._test()

		threshold = np.arange(0.5, 1, step)
		F1 = np.zeros_like(threshold)

		for i, p in enumerate(threshold):
			testPred = np.where(self.testProb_ > p, 1, 0)
			F1[i] = f1_score(self.testLabel_, testPred)

		self.threshold_ = threshold
		self.F1_ = F1

		if save:
			np.save(dir + 'threshold' + suffix + '.npy', threshold)
			np.save(dir + 'F1' + suffix + '.npy', F1)

	def _getROC(self, data='test', save=False, suffix='', dir='./'):

		try:
			if data == 'train':
				fpr, tpr, thresh = roc_curve(self.trainLabel_, self.trainProb_)
			elif data == 'valid':
				fpr, tpr, thresh = roc_curve(self.validLabel_, self.validProb_)
			else:
				fpr, tpr, thresh = roc_curve(self.testLabel_, self.testProb_)
		except:
			print("No data found. Aborting.")
			sys.exit(1)

		self.fpr_ = fpr
		self.tpr_ = tpr

		if save:
			np.save(dir + 'fpr' + suffix + '.npy', fpr)
			np.save(dir + 'tpr' + suffix + '.npy', tpr)


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed><tipo>Rua</tipo><logradouro>Cinco</logradouro><bairro>Amazonas</bairro><cidade>Itabira</cidade><uf>MG</uf><cep>35900728</cep></feed>


text:
package org.apache.flink.client.program;

import org.apache.flink.api.common.JobID;
import org.apache.flink.api.dag.Pipeline;
import org.apache.flink.client.FlinkPipelineTranslationUtil;
import org.apache.flink.configuration.ConfigConstants;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.optimizer.CompilerException;
import org.apache.flink.runtime.jobgraph.JobGraph;

import org.apache.commons.collections.CollectionUtils;

import javax.annotation.Nullable;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.FileSystems;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import static org.apache.flink.util.Preconditions.checkState;

/** Utility class for {@link PackagedProgram} related operations. */
public enum PackagedProgramUtils {
    ;

    private static final String PYTHON_GATEWAY_CLASS_NAME =
            "org.apache.flink.client.python.PythonGatewayServer";

    private static final String PYTHON_DRIVER_CLASS_NAME =
            "org.apache.flink.client.python.PythonDriver";

    /**
     * Creates a {@link JobGraph} with a specified {@link JobID} from the given {@link
     * PackagedProgram}.
     *
     * @param packagedProgram to extract the JobGraph from
     * @param configuration to use for the optimizer and job graph generator
     * @param defaultParallelism for the JobGraph
     * @param jobID the pre-generated job id
     * @return JobGraph extracted from the PackagedProgram
     * @throws ProgramInvocationException if the JobGraph generation failed
     */
    public static JobGraph createJobGraph(
            PackagedProgram packagedProgram,
            Configuration configuration,
            int defaultParallelism,
            @Nullable JobID jobID,
            boolean suppressOutput)
            throws ProgramInvocationException {
        final Pipeline pipeline =
                getPipelineFromProgram(
                        packagedProgram, configuration, defaultParallelism, suppressOutput);
        final JobGraph jobGraph =
                FlinkPipelineTranslationUtil.getJobGraphUnderUserClassLoader(
                        packagedProgram.getUserCodeClassLoader(),
                        pipeline,
                        configuration,
                        defaultParallelism);
        if (jobID != null) {
            jobGraph.setJobID(jobID);
        }
        jobGraph.addJars(packagedProgram.getJobJarAndDependencies());
        jobGraph.setClasspaths(packagedProgram.getClasspaths());
        jobGraph.setSavepointRestoreSettings(packagedProgram.getSavepointSettings());

        return jobGraph;
    }

    /**
     * Creates a {@link JobGraph} with a random {@link JobID} from the given {@link
     * PackagedProgram}.
     *
     * @param packagedProgram to extract the JobGraph from
     * @param configuration to use for the optimizer and job graph generator
     * @param defaultParallelism for the JobGraph
     * @param suppressOutput Whether to suppress stdout/stderr during interactive JobGraph creation.
     * @return JobGraph extracted from the PackagedProgram
     * @throws ProgramInvocationException if the JobGraph generation failed
     */
    public static JobGraph createJobGraph(
            PackagedProgram packagedProgram,
            Configuration configuration,
            int defaultParallelism,
            boolean suppressOutput)
            throws ProgramInvocationException {
        return createJobGraph(
                packagedProgram, configuration, defaultParallelism, null, suppressOutput);
    }

    public static Pipeline getPipelineFromProgram(
            PackagedProgram program,
            Configuration configuration,
            int parallelism,
            boolean suppressOutput)
            throws CompilerException, ProgramInvocationException {
        final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();

        Thread.currentThread().setContextClassLoader(program.getUserCodeClassLoader());

        final PrintStream originalOut = System.out;
        final PrintStream originalErr = System.err;
        final ByteArrayOutputStream stdOutBuffer;
        final ByteArrayOutputStream stdErrBuffer;

        if (suppressOutput) {
            // temporarily write STDERR and STDOUT to a byte array.
            stdOutBuffer = new ByteArrayOutputStream();
            System.setOut(new PrintStream(stdOutBuffer));
            stdErrBuffer = new ByteArrayOutputStream();
            System.setErr(new PrintStream(stdErrBuffer));
        } else {
            stdOutBuffer = null;
            stdErrBuffer = null;
        }

        // temporary hack to support the optimizer plan preview
        OptimizerPlanEnvironment benv =
                new OptimizerPlanEnvironment(
                        configuration, program.getUserCodeClassLoader(), parallelism);
        benv.setAsContext();
        StreamPlanEnvironment senv =
                new StreamPlanEnvironment(
                        configuration, program.getUserCodeClassLoader(), parallelism);
        senv.setAsContext();

        try {
            program.invokeInteractiveModeForExecution();
        } catch (Throwable t) {
            if (benv.getPipeline() != null) {
                return benv.getPipeline();
            }

            if (senv.getPipeline() != null) {
                return senv.getPipeline();
            }

            if (t instanceof ProgramInvocationException) {
                throw t;
            }

            throw generateException(
                    program, "The program caused an error: ", t, stdOutBuffer, stdErrBuffer);
        } finally {
            benv.unsetAsContext();
            senv.unsetAsContext();
            if (suppressOutput) {
                System.setOut(originalOut);
                System.setErr(originalErr);
            }
            Thread.currentThread().setContextClassLoader(contextClassLoader);
        }

        throw generateException(
                program,
                "The program plan could not be fetched - the program aborted pre-maturely.",
                null,
                stdOutBuffer,
                stdErrBuffer);
    }

    public static Boolean isPython(String entryPointClassName) {
        return (entryPointClassName != null)
                && (entryPointClassName.equals(PYTHON_DRIVER_CLASS_NAME)
                        || entryPointClassName.equals(PYTHON_GATEWAY_CLASS_NAME));
    }

    public static boolean isPython(String[] programArguments) {
        return CollectionUtils.containsAny(
                Arrays.asList(programArguments),
                Arrays.asList("-py", "-pym", "--python", "--pyModule"));
    }

    public static URL getPythonJar() {
        String flinkOptPath = System.getenv(ConfigConstants.ENV_FLINK_OPT_DIR);
        final List<Path> pythonJarPath = new ArrayList<>();
        try {
            Files.walkFileTree(
                    FileSystems.getDefault().getPath(flinkOptPath),
                    new SimpleFileVisitor<Path>() {
                        @Override
                        public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
                                throws IOException {
                            FileVisitResult result = super.visitFile(file, attrs);
                            if (file.getFileName().toString().startsWith("flink-python")) {
                                pythonJarPath.add(file);
                            }
                            return result;
                        }
                    });
        } catch (IOException e) {
            throw new RuntimeException(
                    "Exception encountered during finding the flink-python jar. This should not happen.",
                    e);
        }

        if (pythonJarPath.size() != 1) {
            throw new RuntimeException("Found " + pythonJarPath.size() + " flink-python jar.");
        }

        try {
            return pythonJarPath.get(0).toUri().toURL();
        } catch (MalformedURLException e) {
            throw new RuntimeException("URL is invalid. This should not happen.", e);
        }
    }

    public static String getPythonDriverClassName() {
        return PYTHON_DRIVER_CLASS_NAME;
    }

    public static URI resolveURI(String path) throws URISyntaxException {
        final URI uri = new URI(path);
        if (uri.getScheme() != null) {
            return uri;
        }
        return new File(path).getAbsoluteFile().toURI();
    }

    private static ProgramInvocationException generateException(
            PackagedProgram program,
            String msg,
            @Nullable Throwable cause,
            @Nullable ByteArrayOutputStream stdoutBuffer,
            @Nullable ByteArrayOutputStream stderrBuffer) {
        checkState(
                (stdoutBuffer != null) == (stderrBuffer != null),
                "Stderr/Stdout should either both be set or both be null.");

        final String stdout = (stdoutBuffer != null) ? stdoutBuffer.toString() : "";
        final String stderr = (stderrBuffer != null) ? stderrBuffer.toString() : "";

        return new ProgramInvocationException(
                String.format(
                        "%s\n\nClasspath: %s\n\nSystem.out: %s\n\nSystem.err: %s",
                        msg,
                        program.getJobJarAndDependencies(),
                        stdout.length() == 0 ? "(none)" : stdout,
                        stderr.length() == 0 ? "(none)" : stderr),
                cause);
    }
}


text:
import { css } from 'glamor'
import React, { Component } from 'react'
import {
  EditableText,
  ResourceProvider,
  Text,
  ThemeProvider,
  View,
} from '../src/'

const DEFAULT_TEXT = 'Edit me!'
const MARGIN = 15 // px
const STATUSES = {
  DEFAULT: 'edit',
  PROGRESS: 'sand-glass',
  DONE: 'check',
} as const

const STYLES = {
  editable: css({ minWidth: '3rem' }),
  title: (first = false) =>
    css({
      margin: `${MARGIN * (first ? 1 : 2)}px 0 ${MARGIN}px 0`,
    }),
}

class EditableTextStory extends Component<
  Record<string, never>,
  { status: string; text: string }
> {
  state = {
    status: STATUSES.DEFAULT,
    text: DEFAULT_TEXT,
  }

  handleBlur = () => {
    this.setState({ status: STATUSES.PROGRESS })
    setTimeout(() => this.setState({ status: STATUSES.DONE }), 500)
  }

  render() {
    const { status, text } = this.state
    return (
      <ThemeProvider>
        <ResourceProvider>
          <View direction="column" {...css({ padding: '10px 20px' })}>
            <Text weight="semi-bold" {...STYLES.title(true)}>
              Default editable text
            </Text>
            <EditableText {...STYLES.editable}>{DEFAULT_TEXT}</EditableText>

            <Text weight="semi-bold" {...STYLES.title()}>
              Editable text with a custom icon and icon color
            </Text>
            <EditableText
              icon="chat"
              iconColor="purpleIntense"
              {...STYLES.editable}
            >
              {DEFAULT_TEXT}
            </EditableText>

            <Text weight="semi-bold" {...STYLES.title()}>
              Editable text with a custom decoration color
            </Text>
            <EditableText decorationColor="purpleIntense" {...STYLES.editable}>
              {DEFAULT_TEXT}
            </EditableText>

            <Text weight="semi-bold" {...STYLES.title()}>
              Editable text reacting on the onBlur event (fake request)
            </Text>
            <EditableText
              decorationColor="purpleIntense"
              icon={status}
              onBlur={this.handleBlur}
              {...STYLES.editable}
            >
              {text}
            </EditableText>
          </View>
        </ResourceProvider>
      </ThemeProvider>
    )
  }
}
export default EditableTextStory


text:
#ifndef MT_CLOCK_TASK_INTERNAL_H
#define MT_CLOCK_TASK_INTERNAL_H

#include <mach/mach_types.h>
#include <time.h>

int mt_clock_task_getres(mach_port_t port, struct timespec *res);
int mt_clock_task_gettime(mach_port_t port, struct timespec *ts);
int mt_clock_task_settime(mach_port_t port, const struct timespec *ts);

#endif /* !MT_CLOCK_TASK_INTERNAL_H */


text:
package org.hoteia.qalingo.core.domain;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name="TECO_STORE_CUSTOMER_COMMENT")
public class StoreCustomerComment extends AbstractEntity<StoreCustomerComment> {

	/**
	 * Generated UID
	 */
    private static final long serialVersionUID = 1424510337043858148L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name="ID", nullable=false)
	private Long id;

    @Column(name = "TITLE")
    private String title;

    @Column(name="COMMENT")
    private String comment;

	@Column(name="STORE_CUSTOMER_COMMENT_ID")
	private Long storeCustomerCommentId;

    @ManyToOne(fetch = FetchType.LAZY, targetEntity = org.hoteia.qalingo.core.domain.Customer.class)
    @JoinColumn(name = "CUSTOMER_ID", insertable = true, updatable = true)
    private Customer customer;

    @Column(name="MARKET_AREA_ID")
    private Long marketAreaId;

    @ManyToOne(fetch = FetchType.LAZY, targetEntity = org.hoteia.qalingo.core.domain.Store.class)
    @JoinColumn(name = "STORE_ID", insertable = true, updatable = true)
    private Store store;

	@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    @JoinColumn(name="STORE_CUSTOMER_COMMENT_ID")
	private Set<StoreCustomerComment> customerComments = new HashSet<StoreCustomerComment>();

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="DATE_CREATE")
	private Date dateCreate;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="DATE_UPDATE")
	private Date dateUpdate;

	public StoreCustomerComment() {
        this.dateCreate = new Date();
        this.dateUpdate = new Date();
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

	public Long getStoreCustomerCommentId() {
    	return storeCustomerCommentId;
    }

	public void setRetailerCustomerCommentId(Long storeCustomerCommentId) {
    	this.storeCustomerCommentId = storeCustomerCommentId;
    }

    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    public Long getMarketAreaId() {
        return marketAreaId;
    }

    public void setMarketAreaId(Long marketAreaId) {
        this.marketAreaId = marketAreaId;
    }

	public Store getStore() {
        return store;
    }

	public void setStore(Store store) {
        this.store = store;
    }

	public Set<StoreCustomerComment> getCustomerComments() {
    	return customerComments;
    }

	public void setCustomerComments(Set<StoreCustomerComment> customerComments) {
    	this.customerComments = customerComments;
    }

	public Date getDateCreate() {
    	return dateCreate;
    }

	public void setDateCreate(Date dateCreate) {
    	this.dateCreate = dateCreate;
    }

	public Date getDateUpdate() {
    	return dateUpdate;
    }

	public void setDateUpdate(Date dateUpdate) {
    	this.dateUpdate = dateUpdate;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((dateCreate == null) ? 0 : dateCreate.hashCode());
        result = prime * result + ((id == null) ? 0 : id.hashCode());
        result = prime * result + ((marketAreaId == null) ? 0 : marketAreaId.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object sourceObj) {
        Object obj = deproxy(sourceObj);
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        StoreCustomerComment other = (StoreCustomerComment) obj;
        if (dateCreate == null) {
            if (other.dateCreate != null)
                return false;
        } else if (!dateCreate.equals(other.dateCreate))
            return false;
        if (id == null) {
            if (other.id != null)
                return false;
        } else if (!id.equals(other.id))
            return false;
        return true;
    }

    @Override
    public String toString() {
        return "StoreCustomerComment [id=" + id + ", comment=" + comment + ", storeCustomerCommentId=" + storeCustomerCommentId + ", dateCreate=" + dateCreate
                + ", dateUpdate=" + dateUpdate + "]";
    }

}


text:
Choosing an Appropriate Reference
===============

Introduction
----

Any sort of analysis that involves a reference strain begs the question: which strain should I use? Luckily, riboSeed's *de fere novo* approach gives you a bit of flexiblility here, in that the method is not affected my major genomic restructuring events, as long as they do not occur in the rDNA region.  Still, using a close reference maximizes your chance for a successful assembly.

There are three ways that we recommend selecting a reference.  The first uses average nucleotide identity to select an optimal reference for a given set of potential genomes -- perfect if you are sequencing a popular bug and are spoiled for reference choice.  The Kraken method gives great results when nothing is known a priori, and results in a high degree of certainty, but requires a bit of legwork. The last method can be done entirely through your web browser, but is much less robust. For popular bugs, we reccomend ANI; otherwise we recommend Kraken, but if you have already pulled out all of your hair from bioinformatics software installation, reads2Type/cgfind is a nice, painless alternative.

Reference Selection via ANI
---------------------------

With any assembly that uses a reference, the choice of that reference is
crucial. Here, we outline a protocol for using Average Nucleotide
Identity via pyANI.  We call this pipeline Plenty of Bugs, as it
will help you find a compatible match for your sequenced isolate.

`PlentyOfBugs found here <https://github.com/nickp60/plentyofbugs>`__

This is easiest to do with Docker (or Singularity)

The following script will identify 25 random E. coli genomes,
download then, build the pyani database, do a quick assembly of your isolate,
and find the closest reference to your isolate.

::

    docker run --rm -t -v  ${PWD}:/data/ nickp60/plentyofbugs:0.87 -f /data/tests/references/toy_reads1.fq -o "Escherichia coli" -n 25 -e sample_ecoli -d /data/results/

Kraken Method
-----

Kraken is a kmer-based phylogeny tool that can be used to idenify the strains present in a metagenomic dataset;  the installation and usage `instructions can be found here <https://ccb.jhu.edu/software/kraken/>`__

- Download and install Kraken, along with the MiniKraken database from their website.
- Run Kraken on your isolate's reads, and generate the Kraken report.

::

    kraken --db MiniKraken reads1.fq reads2.fastq  > sequences.kraken
    kraken-translate --db MiniKraken sequences.kraken > sequences.labels
    kraken-report --db MiniKraken sequence.kraken

Because the MiniKraken database was built from all the complete genomes from RefSeq, it should be easy to identify which strain in the database has the closest match to your sequenced isolate.

PS:  This is a great time to check if you have any contamination in your sample;  thanks, Kraken!

reads2type and  `cgFind <https://nickp60.github.io/cgfind>`__ Method
------

reads2type is also a kmer-based phylogeny tool, but it relies on a lightweight, prebuilt database that allows the analysis to be performed in your web browser, and it doesn't require you to upload your whole read file to a webserver.  It works by taking one read at a time from your file, generating 55-mers, and comparing to its databse. If there is not enough taxanomic information to indentify the isolate off of that read alone, additional reads will be processed until a single taxonomy is achieved.  This method works best on trimmed reads. `Instructions and the webserver can be found here <https://cge.cbs.dtu.dk/services/Reads2Type/>`__

Once you have a genus and species, you can use ``cgfind``, a tool we developed to provide easy access to downloadable genomes based on the complete prokaryotic genomes found in NCBI.  `it can be found here <https://nickp60.github.io/cgfind>`__  Just enter your genus and species name, and select one of the available strains to download.


text:
layout: example
title: Zoomable Binned Plot Example
permalink: /examples/zoomable-binned-plot/index.html
spec: zoomable-binned-plot
image: /examples/img/zoomable-binned-plot.png
---

An interactive scatter plot with binned aggregation supporting pan and zoom. Click and drag to pan, use the scroll wheel to zoom. This example demonstrates how binning works and, when you disable stable bins, how changes to the bin alignment can affect the perceived density.

{% include example spec=page.spec %}


text:
jmpSetStartTransformationFraction()
===================================

Defines the fraction value that flags the start of austenite
decomposition in TTT/CCT calculations.

Syntax
------

int jmpSetStartTransformationFraction (double startFraction);

Parameters
----------

`startFraction [input]`

Double that specifies the amount (in volume fraction) of a newly formed
phase that will be taken as the beginning of austenite decomposition
when calculating TTT/CCT diagrams.

Return values
-------------

  -------------------- ------------------------------------------
  `JMP_STATUS_OK`      Request has been successfully completed.
  `JMP_STATUS_ERROR`   An error has occurred.
  -------------------- ------------------------------------------

Remarks
-------

-   This function is only relevant to set up the TTT and CCT modules.
-   This function call is optional. If you do not specify the start
    transformation fraction, a default value of 0.01 will be assumed.

**Note**  The value specified for the start transformation fraction is
also used to signal the completion of austenite decomposition. When the
remaining austenite volume fraction becomes lower than such value, the
transformation is considered to be complete.

Requirements
------------

  --------- ---------------------------------
  Header    `jmpcore.h`
  Library   `jmpcore.lib`/`jmpcore_x64.lib`
  DLL       `jmpcore.dll`/`jmpcore_x64.dll`
  --------- ---------------------------------


text:
layout: post
author: Jim Tunnessen
title:  "LASERFISH -- Yep, the game is here!"
date:   2015-02-15 18:32:00
categories: Product Development, Arcade Game, 4TUNGaming
permalink: laserfish
tags: arcade, fish, video-game, mobile-game, sharks, piranhas, Android, Amazon
published: true
---

### Sharks vs. Minnows

# LASERFISH
Released: February 15, 2015

Available on the [Amazon App Store](http://www.amazon.com/TheDoctor-LaserFish/dp/B00TNMH2XO/ref=sr_1_1?ie=UTF8&qid=1432865794&sr=8-1&keywords=laserfish "Amazon App Store")

![LaserFish Promotional Banner](/img/laserfish_promo.png "LaserFish")

Navigate the sea as the minnows' protector, LaserFish. Grow and protect your school of minnows from the deadly piranha and sharks. Save minnows and collect gems to upgrade your laser. Are you just another minnow or are you LaserFish?

Tilt your mobile device left, right, forward, and backward to control LaserFish's swimming.

Collect gems and protect minnows to upgrade your laser gun.

Don't get bit by the piranha or sharks, bites take away health, and some steal gems.
Don't let them get past you either or they will snack on your fellow minnows and steal your gems.

Do you have what it takes to be a SUPERFISH? Find out what you can do, just don't get bit. Beware of the piranha, leopard sharks, gray sharks, and the deadly Great White!

<img src="/img/sharksVSminnowsExplosion.png" alt="LaserFish Explosion Screenshot">

**Product Features:**

+ Arcade Game

+ No Ads

+ Fire Lasers

+ Fight sharks and piranha

+ Protect your fellow minnows


text:
package main

import (
	"html/template"
	"log"
	"net/http"
	"os"
	"quintus"
)

func checkerror(err error) {
	if err != nil {
		log.Fatalln("[ERROR]", err)
	}
}

func handle_index(w http.ResponseWriter, r *http.Request) {
	t, err := template.ParseFiles("templates/layout.template", "templates/index.template")

	checkerror(err)

	t.Execute(w, someq)
}

var someq []quintus.Quintus

func init() {
	qs := make([]quintus.Quintus, 1)

	qs[0].Name = "Go"
	qs[0].Date = "Today"
	qs[0].Times = 0

	quintus.Write(qs)

	someq = quintus.Read()
	log.Println("[INFO]", "LOADED GOB", someq)
}

func main() {
	workingdirectory, err := os.Getwd()

	checkerror(err)

	log.Println("[INFO]", "Starting server in directory", workingdirectory)

	http.HandleFunc("/", handle_index)
	http.Handle("/public/", http.StripPrefix("/public/", http.FileServer(http.Dir(workingdirectory+`/public`))))

	err = http.ListenAndServe(":9090", nil)

	checkerror(err)
}


text:
<?php
if(!isset($_SESSION['session_id']))
{
    header("location: login");
}
?>

                <img src=<?=base_url("img/users/default.png")?> />

<?=$username?>

                Moje przedmioty

                Moje aukcje

                Ustawienia

                <a href=<?=base_url("wylogowanie")?>><img src=<?=base_url("img/site/logout_icon.png")?> />


text:
import React from 'react';
export interface PaginationProps {
    /** 当前页数*/
    current?: number;
    /** 默认的当前页数*/
    defaultCurrent?: number;
    /** 数据总数*/
    total: number;
    /** 初始的每页条数*/
    defaultPageSize?: number;
    /** 每页条数*/
    pageSize?: number;
    /** 页码改变的回调,参数是改变后的页码*/
    onChange?: (page: number) => void;
    /** 是否可以改变 pageSize */
    showSizeChanger?: boolean;
    /** 指定每页可以显示多少条*/
    pageSizeOptions?: Array<string>;
    /** pageSize 变化的回调  */
    onShowSizeChange?: (current: number, size: number) => void;
    /** 是否可以快速跳转至某页*/
    showQuickJumper?: boolean;
    /** 当为「small」时,是小尺寸分页 */
    size?: string;
    /** 当添加该属性时,显示为简单分页*/
    simple?: Object;
    /** 用于显示总共有多少条数据*/
    showTotal?: (total: number) => React.ReactNode;
    style?: React.CSSProperties;
    className?: string;
    locale?: Object;
    prefixCls?: string;
    selectPrefixCls?: string;
}
export interface PaginationContext {
    antLocale?: {
        Pagination?: any;
    };
}
export default class Pagination extends React.Component<PaginationProps, any> {
    static defaultProps: {
        locale: any;
        className: string;
        prefixCls: string;
        selectPrefixCls: string;
    };
    static contextTypes: {
        antLocale: React.Requireable<any>;
    };
    context: PaginationContext;
    render(): JSX.Element;
}


text:
package edu.uci.ics.jung.utils;

import edu.uci.ics.jung.graph.ArchetypeGraph;

/**
 * An abstract class based on VertexMapper that specifies
 * a destination graph.
 *
 * @author Joshua O'Madadhain
 */
public abstract class AbstractVertexMapper implements VertexMapper
{
    protected ArchetypeGraph dest;
    /**
     *
     */
    public AbstractVertexMapper(ArchetypeGraph dest)
    {
        this.dest = dest;
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;

#if STATIC
using IKVM.Reflection;
using IKVM.Reflection.Emit;
#else
using System.Reflection;
using System.Reflection.Emit;
#endif

namespace Mono.CSharp {

	struct TypeAndMethods {
		public TypeSpec          type;
		public IList<MethodSpec> methods;

		//
		// Whether it is optional, this is used to allow the explicit/implicit
		// implementation when a base class already implements an interface.
		//
		// For example:
		//
		// class X : IA { }  class Y : X, IA { IA.Explicit (); }
		//
		public bool          optional;

		//
		// This flag on the method says `We found a match, but
		// because it was private, we could not use the match
		//
		public MethodData [] found;

		// If a method is defined here, then we always need to
		// create a proxy for it.  This is used when implementing
		// an interface's indexer with a different IndexerName.
		public MethodSpec [] need_proxy;
	}

	struct ProxyMethodContext : IMemberContext
	{
		readonly TypeContainer container;

		public ProxyMethodContext (TypeContainer container)
		{
			this.container = container;
		}

		public TypeSpec CurrentType {
			get {
				throw new NotImplementedException ();
			}
		}

		public TypeParameters CurrentTypeParameters {
			get {
				throw new NotImplementedException ();
			}
		}

		public MemberCore CurrentMemberDefinition {
			get {
				throw new NotImplementedException ();
			}
		}

		public bool IsObsolete {
			get {
				return false;
			}
		}

		public bool IsUnsafe {
			get {
				throw new NotImplementedException ();
			}
		}

		public bool IsStatic {
			get {
				return false;
			}
		}

		public ModuleContainer Module {
			get {
				return container.Module;
			}
		}

		public string GetSignatureForError ()
		{
			throw new NotImplementedException ();
		}

		public ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity)
		{
			throw new NotImplementedException ();
		}

		public FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc)
		{
			throw new NotImplementedException ();
		}

		public FullNamedExpression LookupNamespaceAlias (string name)
		{
			throw new NotImplementedException ();
		}
	}

	public class PendingImplementation
	{
		/// <summary>
		///   The container for this PendingImplementation
		/// </summary>
		readonly TypeDefinition container;

		/// <summary>
		///   This is the array of TypeAndMethods that describes the pending implementations
		///   (both interfaces and abstract methods in base class)
		/// </summary>
		TypeAndMethods [] pending_implementations;

		PendingImplementation (TypeDefinition container, MissingInterfacesInfo[] missing_ifaces, MethodSpec[] abstract_methods, int total)
		{
			var type_builder = container.Definition;

			this.container = container;
			pending_implementations = new TypeAndMethods [total];

			int i = 0;
			if (abstract_methods != null) {
				int count = abstract_methods.Length;
				pending_implementations [i].methods = new MethodSpec [count];
				pending_implementations [i].need_proxy = new MethodSpec [count];

				pending_implementations [i].methods = abstract_methods;
				pending_implementations [i].found = new MethodData [count];
				pending_implementations [i].type = type_builder;
				++i;
			}

			foreach (MissingInterfacesInfo missing in missing_ifaces) {
				var iface = missing.Type;
				var mi = MemberCache.GetInterfaceMethods (iface);

				int count = mi.Count;
				pending_implementations [i].type = iface;
				pending_implementations [i].optional = missing.Optional;
				pending_implementations [i].methods = mi;
				pending_implementations [i].found = new MethodData [count];
				pending_implementations [i].need_proxy = new MethodSpec [count];
				i++;
			}
		}

		Report Report {
			get {
				return container.Module.Compiler.Report;
			}
		}

		struct MissingInterfacesInfo {
			public TypeSpec Type;
			public bool Optional;

			public MissingInterfacesInfo (TypeSpec t)
			{
				Type = t;
				Optional = false;
			}
		}

		static readonly MissingInterfacesInfo [] EmptyMissingInterfacesInfo = new MissingInterfacesInfo [0];

		static MissingInterfacesInfo [] GetMissingInterfaces (TypeDefinition container)
		{
			//
			// Interfaces will return all interfaces that the container
			// implements including any inherited interfaces
			//
			var impl = container.Definition.Interfaces;

			if (impl == null || impl.Count == 0)
				return EmptyMissingInterfacesInfo;

			var ret = new MissingInterfacesInfo[impl.Count];

			for (int i = 0; i < ret.Length; i++)
				ret [i] = new MissingInterfacesInfo (impl [i]);

			// we really should not get here because Object doesnt implement any
			// interfaces. But it could implement something internal, so we have
			// to handle that case.
			if (container.BaseType == null)
				return ret;

			var base_impls = container.BaseType.Interfaces;
			if (base_impls != null) {
				foreach (TypeSpec t in base_impls) {
					for (int i = 0; i < ret.Length; i++) {
						if (t == ret[i].Type) {
							ret[i].Optional = true;
							break;
						}
					}
				}
			}

			return ret;
		}

		//
		// Factory method: if there are pending implementation methods, we return a PendingImplementation
		// object, otherwise we return null.
		//
		// Register method implementations are either abstract methods
		// flagged as such on the base class or interface methods
		//
		static public PendingImplementation GetPendingImplementations (TypeDefinition container)
		{
			TypeSpec b = container.BaseType;

			var missing_interfaces = GetMissingInterfaces (container);

			//
			// If we are implementing an abstract class, and we are not
			// ourselves abstract, and there are abstract methods (C# allows
			// abstract classes that have no abstract methods), then allocate
			// one slot.
			//
			// We also pre-compute the methods.
			//
			bool implementing_abstract = ((b != null) && b.IsAbstract && (container.ModFlags & Modifiers.ABSTRACT) == 0);
			MethodSpec[] abstract_methods = null;

			if (implementing_abstract){
				var am = MemberCache.GetNotImplementedAbstractMethods (b);

				if (am == null) {
					implementing_abstract = false;
				} else {
					abstract_methods = new MethodSpec[am.Count];
					am.CopyTo (abstract_methods, 0);
				}
			}

			int total = missing_interfaces.Length +  (implementing_abstract ? 1 : 0);
			if (total == 0)
				return null;

			var pending = new PendingImplementation (container, missing_interfaces, abstract_methods, total);

			//
			// check for inherited conflicting methods
			//
			foreach (var p in pending.pending_implementations) {
				//
				// It can happen for generic interfaces only
				//
				if (!p.type.IsGeneric)
					continue;

				//
				// CLR does not distinguishes between ref and out
				//
				for (int i = 0; i < p.methods.Count; ++i) {
					MethodSpec compared_method = p.methods[i];
					if (compared_method.Parameters.IsEmpty)
						continue;

					for (int ii = i + 1; ii < p.methods.Count; ++ii) {
						MethodSpec tested_method = p.methods[ii];
						if (compared_method.Name != tested_method.Name)
							continue;

						if (p.type != tested_method.DeclaringType)
							continue;

						if (!TypeSpecComparer.Override.IsSame (compared_method.Parameters.Types, tested_method.Parameters.Types))
							continue;

						bool exact_match = true;
						bool ref_only_difference = false;
						var cp = compared_method.Parameters.FixedParameters;
						var tp = tested_method.Parameters.FixedParameters;

						for (int pi = 0; pi < cp.Length; ++pi) {
							//
							// First check exact modifiers match
							//
							if ((cp[pi].ModFlags & Parameter.Modifier.RefOutMask) == (tp[pi].ModFlags & Parameter.Modifier.RefOutMask))
								continue;

							if (((cp[pi].ModFlags | tp[pi].ModFlags) & Parameter.Modifier.RefOutMask) == Parameter.Modifier.RefOutMask) {
								ref_only_difference = true;
								continue;
							}

							exact_match = false;
							break;
						}

						if (!exact_match || !ref_only_difference)
							continue;

						pending.Report.SymbolRelatedToPreviousError (compared_method);
						pending.Report.SymbolRelatedToPreviousError (tested_method);
						pending.Report.Error (767, container.Location,
							"Cannot implement interface `{0}' with the specified type parameters because it causes method `{1}' to differ on parameter modifiers only",
							p.type.GetDefinition().GetSignatureForError (), compared_method.GetSignatureForError ());

						break;
					}
				}
			}

			return pending;
		}

		public enum Operation {
			//
			// If you change this, review the whole InterfaceMethod routine as there
			// are a couple of assumptions on these three states
			//
			Lookup, ClearOne, ClearAll
		}

		/// <summary>
		///   Whether the specified method is an interface method implementation
		/// </summary>
		public MethodSpec IsInterfaceMethod (MemberName name, TypeSpec ifaceType, MethodData method, out MethodSpec ambiguousCandidate, ref bool optional)
		{
			return InterfaceMethod (name, ifaceType, method, Operation.Lookup, out ambiguousCandidate, ref optional);
		}

		public void ImplementMethod (MemberName name, TypeSpec ifaceType, MethodData method, bool clear_one, out MethodSpec ambiguousCandidate, ref bool optional)
		{
			InterfaceMethod (name, ifaceType, method, clear_one ? Operation.ClearOne : Operation.ClearAll, out ambiguousCandidate, ref optional);
		}

		/// <remarks>
		///   If a method in Type `t' (or null to look in all interfaces
		///   and the base abstract class) with name `Name', return type `ret_type' and
		///   arguments `args' implements an interface, this method will
		///   return the MethodInfo that this method implements.
		///
		///   If `name' is null, we operate solely on the method's signature.  This is for
		///   instance used when implementing indexers.
		///
		///   The `Operation op' controls whether to lookup, clear the pending bit, or clear
		///   all the methods with the given signature.
		///
		///   The `MethodInfo need_proxy' is used when we're implementing an interface's
		///   indexer in a class.  If the new indexer's IndexerName does not match the one
		///   that was used in the interface, then we always need to create a proxy for it.
		///
		/// </remarks>
		public MethodSpec InterfaceMethod (MemberName name, TypeSpec iType, MethodData method, Operation op, out MethodSpec ambiguousCandidate, ref bool optional)
		{
			ambiguousCandidate = null;

			if (pending_implementations == null)
				return null;

			TypeSpec ret_type = method.method.ReturnType;
			ParametersCompiled args = method.method.ParameterInfo;
			bool is_indexer = method.method is Indexer.SetIndexerMethod || method.method is Indexer.GetIndexerMethod;
			MethodSpec m;

			foreach (TypeAndMethods tm in pending_implementations){
				if (!(iType == null || tm.type == iType))
					continue;

				int method_count = tm.methods.Count;
				for (int i = 0; i < method_count; i++){
					m = tm.methods [i];

					if (m == null)
						continue;

					if (is_indexer) {
						if (!m.IsAccessor || m.Parameters.IsEmpty)
							continue;
					} else {
						if (name.Name != m.Name)
							continue;

						if (m.Arity != name.Arity)
							continue;
					}

					if (!TypeSpecComparer.Override.IsEqual (m.Parameters, args))
						continue;

					if (!TypeSpecComparer.Override.IsEqual (m.ReturnType, ret_type)) {
						tm.found[i] = method;
						continue;
					}

					//
					// `need_proxy' is not null when we're implementing an
					// interface indexer and this is Clear(One/All) operation.
					//
					// If `name' is null, then we do a match solely based on the
					// signature and not on the name (this is done in the Lookup
					// for an interface indexer).
					//
					if (op != Operation.Lookup) {
						if (m.IsAccessor != method.method.IsAccessor)
							continue;

						// If `t != null', then this is an explicitly interface
						// implementation and we can always clear the method.
						// `need_proxy' is not null if we're implementing an
						// interface indexer.  In this case, we need to create
						// a proxy if the implementation's IndexerName doesn't
						// match the IndexerName in the interface.
						if (m.DeclaringType.IsInterface && iType == null && name.Name != m.Name) {	// TODO: This is very expensive comparison
							tm.need_proxy[i] = method.method.Spec;
						} else {
							tm.methods[i] = null;
						}
					} else {
						tm.found [i] = method;
						optional = tm.optional;
					}

					if (op == Operation.Lookup && name.ExplicitInterface != null && ambiguousCandidate == null) {
						ambiguousCandidate = m;
						continue;
					}

					//
					// Lookups and ClearOne return
					//
					if (op != Operation.ClearAll)
						return m;
				}

				// If a specific type was requested, we can stop now.
				if (tm.type == iType)
					break;
			}

			m = ambiguousCandidate;
			ambiguousCandidate = null;
			return m;
		}

		/// <summary>
		///   C# allows this kind of scenarios:
		///   interface I { void M (); }
		///   class X { public void M (); }
		///   class Y : X, I { }
		///
		///   For that case, we create an explicit implementation function
		///   I.M in Y.
		/// </summary>
		void DefineProxy (TypeSpec iface, MethodSpec base_method, MethodSpec iface_method)
		{
			// TODO: Handle nested iface names
			string proxy_name;
			var ns = iface.MemberDefinition.Namespace;
			if (string.IsNullOrEmpty (ns))
				proxy_name = iface.MemberDefinition.Name + "." + iface_method.Name;
			else
				proxy_name = ns + "." + iface.MemberDefinition.Name + "." + iface_method.Name;

			var param = iface_method.Parameters;

			MethodBuilder proxy = container.TypeBuilder.DefineMethod (
				proxy_name,
				MethodAttributes.Private |
				MethodAttributes.HideBySig |
				MethodAttributes.NewSlot |
				MethodAttributes.CheckAccessOnOverride |
				MethodAttributes.Virtual | MethodAttributes.Final,
				CallingConventions.Standard | CallingConventions.HasThis,
				base_method.ReturnType.GetMetaInfo (), param.GetMetaInfo ());

			if (iface_method.IsGeneric) {
				var gnames = iface_method.GenericDefinition.TypeParameters.Select (l => l.Name).ToArray ();
				proxy.DefineGenericParameters (gnames);
			}

			for (int i = 0; i < param.Count; i++) {
				string name = param.FixedParameters [i].Name;
				ParameterAttributes attr = ParametersCompiled.GetParameterAttribute (param.FixedParameters [i].ModFlags);
				proxy.DefineParameter (i + 1, attr, name);
			}

			int top = param.Count;
			var ec = new EmitContext (new ProxyMethodContext (container), proxy.GetILGenerator (), null, null);
			ec.EmitThis ();
			// TODO: GetAllParametersArguments
			for (int i = 0; i < top; i++)
				ec.EmitArgumentLoad (i);

			ec.Emit (OpCodes.Call, base_method);
			ec.Emit (OpCodes.Ret);

			container.TypeBuilder.DefineMethodOverride (proxy, (MethodInfo) iface_method.GetMetaInfo ());
		}

		/// <summary>
		///   This function tells whether one of our base classes implements
		///   the given method (which turns out, it is valid to have an interface
		///   implementation in a base
		/// </summary>
		bool BaseImplements (TypeSpec iface_type, MethodSpec mi, out MethodSpec base_method)
		{
			base_method = null;
			var base_type = container.BaseType;

			//
			// Setup filter with no return type to give better error message
			// about mismatch at return type when the check bellow rejects them
			//
			var parameters = mi.Parameters;
			MethodSpec close_match = null;

			while (true) {
				var candidates = MemberCache.FindMembers (base_type, mi.Name, false);
				if (candidates == null) {
					base_method = close_match;
					return false;
				}

				MethodSpec similar_candidate = null;
				foreach (var candidate in candidates) {
					if (candidate.Kind != MemberKind.Method)
						continue;

					if (candidate.Arity != mi.Arity)
						continue;

					var candidate_param = ((MethodSpec) candidate).Parameters;
					if (!TypeSpecComparer.Override.IsEqual (parameters.Types, candidate_param.Types))
						continue;

					bool modifiers_match = true;
					for (int i = 0; i < parameters.Count; ++i) {
						//
						// First check exact ref/out match
						//
						if ((parameters.FixedParameters[i].ModFlags & Parameter.Modifier.RefOutMask) == (candidate_param.FixedParameters[i].ModFlags & Parameter.Modifier.RefOutMask))
							continue;

						modifiers_match = false;

						//
						// Different in ref/out only
						//
						if ((parameters.FixedParameters[i].ModFlags & Parameter.Modifier.RefOutMask) != (candidate_param.FixedParameters[i].ModFlags & Parameter.Modifier.RefOutMask)) {
							if (similar_candidate == null) {
								if (!candidate.IsPublic)
									break;

								if (!TypeSpecComparer.Override.IsEqual (mi.ReturnType, ((MethodSpec) candidate).ReturnType))
									break;

								// It's used for ref/out ambiguity overload check
								similar_candidate = (MethodSpec) candidate;
							}

							continue;
						}

						similar_candidate = null;
						break;
					}

					if (!modifiers_match)
						continue;

					//
					// From this point the candidate is used for detailed error reporting
					// because it's very close match to what we are looking for
					//
					var m = (MethodSpec) candidate;

					if (!m.IsPublic) {
						if (close_match == null)
							close_match = m;

						continue;
					}

					if (!TypeSpecComparer.Override.IsEqual (mi.ReturnType, m.ReturnType)) {
						if (close_match == null)
							close_match = m;

						continue;
					}

					base_method = m;

					if (mi.IsGeneric && !Method.CheckImplementingMethodConstraints (container, m, mi)) {
						return true;
					}
				}

				if (base_method != null) {
					if (similar_candidate != null) {
						Report.SymbolRelatedToPreviousError (similar_candidate);
						Report.SymbolRelatedToPreviousError (mi);
						Report.SymbolRelatedToPreviousError (container);
						Report.Warning (1956, 1, ((MemberCore) base_method.MemberDefinition).Location,
							"The interface method `{0}' implementation is ambiguous between following methods: `{1}' and `{2}' in type `{3}'",
							mi.GetSignatureForError (), base_method.GetSignatureForError (), similar_candidate.GetSignatureForError (), container.GetSignatureForError ());
					}

					break;
				}

				base_type = candidates[0].DeclaringType.BaseType;
				if (base_type == null) {
					base_method = close_match;
					return false;
				}
			}

			if (!base_method.IsVirtual) {
#if STATIC
				var base_builder = base_method.GetMetaInfo () as MethodBuilder;
				if (base_builder != null) {
					//
					// We can avoid creating a proxy if base_method can be marked 'final virtual'. This can
					// be done for all methods from compiled assembly
					//
					base_builder.__SetAttributes (base_builder.Attributes | MethodAttributes.Virtual | MethodAttributes.Final | MethodAttributes.NewSlot);
					return true;
				}
#endif
				DefineProxy (iface_type, base_method, mi);
			}

			return true;
		}

		/// <summary>
		///   Verifies that any pending abstract methods or interface methods
		///   were implemented.
		/// </summary>
		public bool VerifyPendingMethods ()
		{
			int top = pending_implementations.Length;
			bool errors = false;
			int i;

			for (i = 0; i < top; i++){
				TypeSpec type = pending_implementations [i].type;

				bool base_implements_type = type.IsInterface &&
					container.BaseType != null &&
					container.BaseType.ImplementsInterface (type, false);

				for (int j = 0; j < pending_implementations [i].methods.Count; ++j) {
					var mi = pending_implementations[i].methods[j];
					if (mi == null)
						continue;

					if (type.IsInterface){
						var need_proxy =
							pending_implementations [i].need_proxy [j];

						if (need_proxy != null) {
							DefineProxy (type, need_proxy, mi);
							continue;
						}

						if (pending_implementations [i].optional)
							continue;

						MethodSpec candidate;
						if (base_implements_type || BaseImplements (type, mi, out candidate))
							continue;

						if (candidate == null) {
							MethodData md = pending_implementations [i].found [j];
							if (md != null)
								candidate = md.method.Spec;
						}

						Report.SymbolRelatedToPreviousError (mi);
						if (candidate != null) {
							Report.SymbolRelatedToPreviousError (candidate);
							if (candidate.IsStatic) {
								Report.Error (736, container.Location,
									"`{0}' does not implement interface member `{1}' and the best implementing candidate `{2}' is static",
									container.GetSignatureForError (), mi.GetSignatureForError (), candidate.GetSignatureForError ());
							} else if ((candidate.Modifiers & Modifiers.PUBLIC) == 0) {
								Report.Error (737, container.Location,
									"`{0}' does not implement interface member `{1}' and the best implementing candidate `{2}' is not public",
									container.GetSignatureForError (), mi.GetSignatureForError (), candidate.GetSignatureForError ());
							} else {
								Report.Error (738, container.Location,
									"`{0}' does not implement interface member `{1}' and the best implementing candidate `{2}' return type `{3}' does not match interface member return type `{4}'",
									container.GetSignatureForError (), mi.GetSignatureForError (), candidate.GetSignatureForError (),
									candidate.ReturnType.GetSignatureForError (), mi.ReturnType.GetSignatureForError ());
							}
						} else {
							Report.Error (535, container.Location, "`{0}' does not implement interface member `{1}'",
								container.GetSignatureForError (), mi.GetSignatureForError ());
						}
					} else {
						Report.SymbolRelatedToPreviousError (mi);
						Report.Error (534, container.Location, "`{0}' does not implement inherited abstract member `{1}'",
							container.GetSignatureForError (), mi.GetSignatureForError ());
					}
					errors = true;
				}
			}
			return errors;
		}
	}
}


text:
{% extends "layout.html" %}
{% block body %}

My Company

This is a simple Flask web site.

Learn more »

Heading

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

View details »

Heading

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

View details »

Heading

Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

View details »

© Company 2014

{% endblock %}


text:
import styled from 'styled-components';
import { Box } from '@strapi/design-system/Box';

const BoxWrapper = styled(Box)`
  width: 100%;
  height: 100%;
  border: 1px solid ${({ theme }) => theme.colors.neutral200};
  &:hover {
    background: ${({ theme }) => theme.colors.primary100};
    border: 1px solid ${({ theme }) => theme.colors.primary200};
  }
`;

export default BoxWrapper;


text:
from copy import deepcopy
from string import Template
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from .plot_helpers import (
    cc,
    SinglePlotFigureHandler,
    content_facecolors,
    deathrate_facecolors,
    loss_facecolors,
    gain_facecolors,
)
from .TstBin import TstBin
from .TsTpMassField import TsTpMassField

def plot_external_gains(external_input_numbers, tss, nTs, nTp, max_z):
    for key, number in external_input_numbers.items():

        tuplestr = "{first_arg:01d}".format(first_arg=key)
        with SinglePlotFigureHandler("external_gains_pool" + tuplestr + ".pdf") as ax:
            ax.set_title(
                Template("external gains for pool  ${key}").substitute(key=key)
            )
            f = TsTpMassField(np.zeros((nTs, nTp)), tss)
            f[0, 0] = number
            f.plot_bins(ax, facecolors=gain_facecolors)
            ax.set_zlim3d(0, max_z)

def plot_figure_per_pipe(rectangles, max_Ts, max_Tp, max_z, title_stem, facecolors):
    # this could be a method of TsTpMassFieldsPerPipe
    # but maybe it is a bit special...
    for key, f in rectangles.items():
        tupelstr = "{first_arg:01d}_{second_arg:01d}".format(
            first_arg=key[0], second_arg=key[1]
        )
        with SinglePlotFigureHandler(
            title_stem.replace(" ", "_") + tupelstr + ".pdf"
        ) as ax:
            ax.set_title(title_stem + str(key))
            f.plot_bins(ax, facecolors=facecolors)
            ax.set_xlim3d(0, max_Ts)
            ax.set_ylim3d(0, max_Tp)
            ax.set_zlim3d(0, max_z)

def plot_figure_per_pool(rectangles, max_Ts, max_Tp, max_z, title_stem, facecolors):
    # this could be a method of TsTpMassFieldsPerPool
    # but maybe it is a bit special...
    for key, f in rectangles.items():
        with SinglePlotFigureHandler(
            title_stem.replace(" ", "_")
            + "{first_arg:01d}".format(first_arg=key)
            + ".pdf"
        ) as ax:
            ax.set_title(title_stem + str(key))
            f.plot_bins(ax, facecolors=facecolors)
            ax.set_xlim3d(0, max_Ts)
            ax.set_ylim3d(0, max_Tp)
            ax.set_zlim3d(0, max_z)

def plot_contents_and_gains(
    contents, internal_gains, external_gains, max_Ts, max_Tp, max_z
):
    for content_pool_key, content in contents.items():
        with SinglePlotFigureHandler(
            "contents_and_gains_pool_"
            + "{first_arg:01d}".format(first_arg=content_pool_key)
            + ".pdf"
        ) as ax:
            ax.set_title(
                Template("contents of pool ${key} and all gains").substitute(
                    key=content_pool_key
                )
            )
            offset = content.arr[:, 0]  # since gains can be at most one dimensional
            for receiver, gain in internal_gains.items():
                if receiver == content_pool_key:
                    gain.plot_bins(
                        ax, 0, facecolors=gain_facecolors, offset_field=offset
                    )
                    offset += gain.arr
            for receiver, gain in external_gains.items():
                if receiver == content_pool_key:
                    b = TstBin(content.tss, 0, 0, gain, facecolors=gain_facecolors)
                    b.plot(ax)
                    offset[0] += gain
            content.plot_bins(ax, facecolors=content_facecolors)
            ax.set_xlim3d(0, max_Ts)
            ax.set_ylim3d(0, max_Tp)
            ax.set_zlim3d(0, max_z)

def plot_contents_and_losses(
    remainders, internal_losses, external_losses, max_Ts, max_Tp, max_z
):
    for content_pool_key, this_pool_remainder in remainders.items():

        with SinglePlotFigureHandler(
            "contents_and_losses_pool_"
            + "{first_arg:01d}".format(first_arg=content_pool_key)
            + ".pdf"
        ) as ax:
            ax.set_title(
                Template("contents of pool ${key} and all losses").substitute(
                    key=content_pool_key
                )
            )

            offset = this_pool_remainder.arr
            for pipe_key, loss in internal_losses.items():
                sender = pipe_key[0]
                if sender == content_pool_key:
                    loss.plot_bins(ax, facecolors=loss_facecolors, offset_field=offset)
                    offset += loss.arr

            for pipe_key, loss in external_losses.items():
                sender = pipe_key
                print(loss.arr)
                if sender == content_pool_key:
                    loss.plot_bins(ax, facecolors=loss_facecolors, offset_field=offset)
                    offset += loss.arr

            this_pool_remainder.plot_bins(ax, facecolors=content_facecolors)
            ax.set_xlim3d(0, max_Ts)
            ax.set_ylim3d(0, max_Tp)
            ax.set_zlim3d(0, max_z)

def plot_internal_gains(gains, max_Ts, max_Tp, max_z):
    # internal gains per pool
    for key, f in gains.items():

        tuplestr = "{first_arg:01d}".format(first_arg=key)
        with SinglePlotFigureHandler("internal_gains_pool" + tuplestr + ".pdf") as ax:
            ax.set_title(
                Template("internal gains for pool  ${key}").substitute(key=key)
            )
            # f.plot_bins(ax,0,t_min=0,t_max=3,facecolors=gain_facecolors)
            f.plot_bins(ax, 0, facecolors=gain_facecolors)
            ax.set_xlim3d(0, max_Ts)
            ax.set_ylim3d(0, max_Tp)
            ax.set_zlim3d(0, max_z)

class TimeStepPlotter:
    def __init__(self, time_step):
        self.time_step = time_step

    def plot_pdfs(self):
        ts = self.time_step
        updated_content = ts.updated_content
        external_death_rate_fields = ts.external_death_rate_fields
        internal_death_rate_fields = ts.internal_death_rate_fields
        external_input_numbers = ts.external_input_numbers
        res = deepcopy(ts.rectangles)
        external_losses = res.external_losses(external_death_rate_fields)
        internal_losses = res.internal_losses(internal_death_rate_fields)
        gains = internal_losses.gains
        res = deepcopy(ts.rectangles)
        # first determine the plotting area (Tsmax,Tpmax,zmax)
        # so that all plots get the same size which looks nicer for a cartoon
        ts.rectangles.update(ts.updated_content)
        tss = ts.rectangles[0].tss
        nTs = max([c.number_of_Ts_entries for c in ts.rectangles.values()])
        max_Ts = nTs * tss

        nTp = max([c.number_of_Tp_entries for c in ts.rectangles.values()])
        max_Tp = nTp * tss

        max_z = max([c.arr.max() for c in ts.rectangles.values()])

        plot_figure_per_pool(
            res, max_Ts, max_Tp, max_z, "initial content pool ", content_facecolors
        )

        res.remove(external_losses)
        res.remove(internal_losses)
        remainder = deepcopy(res)
        plot_contents_and_losses(
            remainder, internal_losses, external_losses, max_Ts, max_Tp, max_z
        )
        plot_figure_per_pool(
            external_losses,
            max_Ts,
            max_Tp,
            max_z,
            "external losses pool ",
            loss_facecolors,
        )
        plot_figure_per_pool(
            external_death_rate_fields,
            max_Ts,
            max_Tp,
            max_z,
            "external death rates pool ",
            deathrate_facecolors,
        )
        plot_figure_per_pipe(
            internal_death_rate_fields,
            max_Ts,
            max_Tp,
            max_z,
            "internal death rates pipe ",
            deathrate_facecolors,
        )

        plot_figure_per_pipe(
            internal_losses,
            max_Ts,
            max_Tp,
            max_z,
            "internal losses pipe ",
            loss_facecolors,
        )
        plot_figure_per_pool(
            res,
            max_Ts,
            max_Tp,
            max_z,
            "content after removel of internal and external losses pool ",
            content_facecolors,
        )
        res.shift()
        plot_figure_per_pool(
            res, max_Ts, max_Tp, max_z, "contents after shift", content_facecolors
        )

        plot_contents_and_gains(
            res, gains, external_input_numbers, max_Ts, max_Tp, max_z
        )
        res.receive(gains)
        res.receive_external(external_input_numbers)
        plot_figure_per_pool(
            res, max_Ts, max_Tp, max_z, "updated contents pool ", content_facecolors
        )
        #
        plot_external_gains(external_input_numbers, res[0].tss, nTs, nTp, max_z)
        plot_internal_gains(gains, max_Ts, max_Tp, max_z)


text:
package io.debezium.examples.kstreams.liveupdate.eventsource;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="products")
public class Product {
    @Id
    public long id;

    public String name;
    public String description;
    public Float weight;

    public Product() {

    }
}


text:
require 'pry'

# class Series
#   attr_reader :digits

#   def initialize(digit_string)
#     @digits = digit_string.chars.map(&:to_i)
#   end

#   def slices(slice_length)
#     slices = []
#     raise ArgumentError, "Slice length is larger than digit string length" if slice_length > digits.length
#     digits.each_index do |index|
#       slice = digits[index, slice_length]
#       slices << slice if slice.count == slice_length
#     end
#     slices
#   end
# end

class Series
  attr_reader :digits

  def initialize(digit_string)
    @digits = digit_string.chars.map(&:to_i)
  end

  def slices(slice_length)
    raise ArgumentError, "Slice length is larger than digit string length" if slice_length > digits.length
    digits.each_cons(slice_length).to_a
  end
end