text:
using System;

namespace BackToBg.Core.Business.Attributes
{
    [AttributeUsage(AttributeTargets.Class)]
    public class QuestAttribute : Attribute
    {
        public QuestAttribute(Type questType, string name, string description, int rewardExperiancePoints,
            int rewardMoney)
        {
            this.Name = name;
            this.Description = description;
            this.RewardExperiancePoints = rewardExperiancePoints;
            this.RewardMoney = rewardMoney;
            this.QuestType = questType;
        }

        public Type QuestType { get; }

        public string Name { get; }

        public string Description { get; }

        public int RewardExperiancePoints { get; }

        public int RewardMoney { get; }
    }
}


text:
namespace switches {

#if !BUILDFLAG(IS_CHROMEOS_ASH)
// Enables the Chrome Browser Cloud Management integration on Chromium builds.
// CBCM is always enabled in branded builds.
const char kEnableChromeBrowserCloudManagement[] =
    "enable-chrome-browser-cloud-management";
#endif

}  // namespace switches

redpajama_set_name: RedPajamaGithub


text:
package emoteservice

type sevenTvEmote struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Owner struct {
		ID          string `json:"id"`
		TwitchID    string `json:"twitch_id"`
		Login       string `json:"login"`
		DisplayName string `json:"display_name"`
		Role        struct {
			ID       string `json:"id"`
			Name     string `json:"name"`
			Position int    `json:"position"`
			Color    int    `json:"color"`
			Allowed  int    `json:"allowed"`
			Denied   int    `json:"denied"`
			Default  bool   `json:"default"`
		} `json:"role"`
	} `json:"owner"`
	Visibility       int           `json:"visibility"`
	VisibilitySimple []interface{} `json:"visibility_simple"`
	Mime             string        `json:"mime"`
	Status           int           `json:"status"`
	Tags             []interface{} `json:"tags"`
	Width            []int         `json:"width"`
	Height           []int         `json:"height"`
	Urls             [][]string    `json:"urls"`
}

type gqlQuery struct {
	Query     string                 `json:"query"`
	Variables map[string]interface{} `json:"variables"`
}

type SevenTvUserResponse struct {
	Data struct {
		User struct {
			ID     string `json:"id"`
			Emotes []struct {
				ID         string `json:"id"`
				Name       string `json:"name"`
				Status     int    `json:"status"`
				Visibility int    `json:"visibility"`
				Width      []int  `json:"width"`
				Height     []int  `json:"height"`
			} `json:"emotes"`
			EmoteSlots int `json:"emote_slots"`
		} `json:"user"`
	} `json:"data"`
}

const (
	EmoteVisibilityPrivate int32 = 1 << iota
	EmoteVisibilityGlobal
	EmoteVisibilityUnlisted
	EmoteVisibilityOverrideBTTV
	EmoteVisibilityOverrideFFZ
	EmoteVisibilityOverrideTwitchGlobal
	EmoteVisibilityOverrideTwitchSubscriber
	EmoteVisibilityZeroWidth
	EmoteVisibilityPermanentlyUnlisted

	EmoteVisibilityAll int32 = (1 << iota) - 1
)


text:
    #include <GLUT/GLUT.h>
#elif __linux
    #include <GL/glut.h>
#endif
#include <stdexcept>

RIVUIElement::RIVUIElement(int x, int y, int width, int height) : x(x), y(y), width(width), height(height) {

}
bool RIVUIElement::containsPoint(int pX, int pY) {
	return pX >= x && pX <= (x + width) && pY >= y && pY <= (y + height);
}
void RIVUIElement::drawText(char* text, int size, int x, int y, float* color, float sizeModifier) {
	//Estimate center, seems to be the magic number for font pixel size
	float xCenter = sizeModifier * size / 2.F;

	glLineWidth(1);
	glColor3f(*color,*(color+1),*(color+2));
	glPushMatrix();
	glTranslatef(x - xCenter,y, 0);
	glPushMatrix();
	glScalef(sizeModifier,sizeModifier,1);
	for(int i = 0 ; i < size ; i++) {
		glutStrokeCharacter(GLUT_STROKE_ROMAN, text[i]);
	}
	glPopMatrix();
	glPopMatrix();
}
void RIVUIElement::drawText(const std::string& text, int x, int y, float *color, float sizeModifier) {
	drawText((char*)text.c_str(),(int)text.size(),x,y,color,sizeModifier);
}
void RIVUIElement::drawText(const std::string& text, int x, int y, float sizeModifier) {
	float black[] = {0,0,0};
	drawText((char*)text.c_str(),(int)text.size(),x,y,black,sizeModifier);
}
void RIVUIElement::drawText(const std::string& text, int x, int y) {
	drawText(text, x, y, 0.08F);
}


text:
from .codec import (
    ABIEncoder,
)
from .registry import (
    registry_packed,
)

default_encoder_packed = ABIEncoder(registry_packed)

encode_single_packed = default_encoder_packed.encode_single
encode_abi_packed = default_encoder_packed.encode_abi
is_encodable_packed = default_encoder_packed.is_encodable


text:
<?php

namespace Tymon\JWTAuth\Test\Claims;

use Tymon\JWTAuth\Claims\Custom;
use Tymon\JWTAuth\Claims\Expiration;
use Tymon\JWTAuth\Claims\Factory;
use Tymon\JWTAuth\Claims\IssuedAt;
use Tymon\JWTAuth\Claims\Issuer;
use Tymon\JWTAuth\Claims\JwtId;
use Tymon\JWTAuth\Claims\NotBefore;
use Tymon\JWTAuth\Claims\Subject;
use Tymon\JWTAuth\Test\AbstractTestCase;

class FactoryTest extends AbstractTestCase
{
    /**
     * @var \Tymon\JWTAuth\Claims\Factory
     */
    protected $factory;

    public function setUp()
    {
        parent::setUp();

        $this->factory = new Factory();
    }

    /** @test */
    public function it_should_get_a_defined_claim_instance_when_passing_a_name_and_value()
    {
        $this->assertInstanceOf(Subject::class, $this->factory->get('sub', 1));
        $this->assertInstanceOf(Issuer::class, $this->factory->get('iss', 'http://example.com'));
        $this->assertInstanceOf(Expiration::class, $this->factory->get('exp', $this->testNowTimestamp + 3600));
        $this->assertInstanceOf(NotBefore::class, $this->factory->get('nbf', $this->testNowTimestamp));
        $this->assertInstanceOf(IssuedAt::class, $this->factory->get('iat', $this->testNowTimestamp));
        $this->assertInstanceOf(JwtId::class, $this->factory->get('jti', 'foo'));
    }

    /** @test */
    public function it_should_get_a_custom_claim_instance_when_passing_a_non_defined_name_and_value()
    {
        $this->assertInstanceOf(Custom::class, $this->factory->get('foo', ['bar']));
    }
}


text:
module Clever
  # Configuration for accessing the Clever API over HTTP
  class Configuration
    # Access API Key
    # @api private
    # @return [String]
    attr_accessor :api_key

    # Access API Token
    # @api private
    # @return [String]
    attr_accessor :token

    # Access API base URL
    # @api private
    # @return [String]
    attr_accessor :api_base

    # Access API timeout
    # @api private
    # @return [Fixnum]
    attr_accessor :timeout

    # Access API open timeout
    # @api private
    # @return [Fixnum]
    attr_accessor :open_timeout

    # Initialize configuration
    # @api private
    # @return [Clever::Configuration]
    def initialize
      @api_key  = nil
      @token = nil
      @api_base = 'https://api.clever.com/'
      @timeout = 120
      @open_timeout = 30
    end
  end
end


text:
package com.vladium.jcd.cls.attribute;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import com.vladium.jcd.lib.UDataOutputStream;

// ----------------------------------------------------------------------------
/**
 * @author (C) 2001, Vlad Roubtsov
 */
final class ExceptionHandlerTable implements IExceptionHandlerTable
{
    // public: ................................................................

    // ACCESSORS:

    public Exception_info get (final int offset)
    {
        return (Exception_info) m_exceptions.get (offset);
    }

    public int size ()
    {
        return m_exceptions.size ();
    }

    public long length ()
    {
        return 2 + (m_exceptions.size () << 3); // use size() if class becomes non-final
    }

    // Cloneable:

    /**
     * Performs a deep copy.
     */
    public Object clone ()
    {
        try
        {
            final ExceptionHandlerTable _clone = (ExceptionHandlerTable) super.clone ();

            // deep clone:
            final int exceptions_count = m_exceptions.size (); // use size() if class becomes non-final
            _clone.m_exceptions = new ArrayList (exceptions_count);
            for (int e = 0; e < exceptions_count; ++ e)
            {
                _clone.m_exceptions.add (((Exception_info) m_exceptions.get (e)).clone ());
            }

            return _clone;
        }
        catch (CloneNotSupportedException e)
        {
            throw new InternalError (e.toString ());
        }
    }

    // IClassFormatOutput:

    public void writeInClassFormat (final UDataOutputStream out) throws IOException
    {
        int exception_table_length = m_exceptions.size (); // use size() if class becomes non-final
        out.writeU2 (exception_table_length);

        for (int i = 0; i < exception_table_length; i++)
        {
            get (i).writeInClassFormat (out);
        }
    }

    // MUTATORS:

    public int add (final Exception_info exception)
    {
        final int newoffset = m_exceptions.size (); // use size() if class becomes non-final
        m_exceptions.add (exception);

        return newoffset;
    }

    public Exception_info set (final int offset, final Exception_info exception)
    {
        return (Exception_info) m_exceptions.set (offset, exception);
    }

    // protected: .............................................................

    // package: ...............................................................

    ExceptionHandlerTable (final int capacity)
    {
        m_exceptions = capacity < 0 ? new ArrayList () : new ArrayList (capacity);
    }

    // private: ...............................................................

    private List/* Exception_info */ m_exceptions;

} // end of class
// ----------------------------------------------------------------------------


text:
<?xml version="1.0" encoding="UTF-8"?>
<DARoots Version="1" Minor="30">
  <FileSet Name="sources" Type="DesignSrcs" RelSrcDir="$PSRCDIR/sources_1">
    <Filter Type="Srcs"/>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/tx/output_queue_mem_check.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/tx/output_queue_memory.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/tx/output_queue_fifo.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/tx/output_queue_control.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/tx/output_queue_arbitration.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/rx/input_queue_overflow.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/rx/input_queue_memory.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/rx/input_queue_fifo.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/rx/input_queue_control.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/rx/input_queue_arbitration.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/mac/mac_fifo/switch_output_port_fifo.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/mac/mac_fifo/switch_input_port_fifo.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/sync_blocks/aeg_design_reset_sync.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/tx/tx_path_output_queue.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/rx/rx_path_lookup_memory.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/rx/rx_path_lookup.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/rx/rx_path_input_queue.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/rx/rx_path_header_extraction.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/mac/mac_fifo/mac_fifo_interface.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/imports/switch_fabric/arbitration_algorithm.vhd">
      <FileInfo>
        <Attr Name="ImportPath" Val="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_fabric/arbitration_algorithm.vhd"/>
        <Attr Name="ImportTime" Val="1390883016"/>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/sync_blocks/aeg_design_sync_block.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/tx/switch_port_tx_path.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/rx/switch_port_rx_path.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/mac/tri_mode_ethernet_mac_block.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/config/config_mac_phy_sm.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_fabric/switch_fabric_arbitration.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/clocking/aeg_design_clk_wiz.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/timer.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/mac/tri_mode_ethernet_mac_0_support_resets.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_port/aeg_design_switch_port.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/switch_fabric/aeg_design_switch_fabric.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/reset/aeg_design_resets.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/clocking/aeg_design_clocks.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/rtl/automotive_ethernet_gateway.vhd">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.data/sources_1/ports.xml">
      <FileInfo SFType="PortsDb">
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <File Path="$PPRDIR/automotive_ethernet_gateway_project/automotive_ethernet_gateway_project.srcs/sources_1/mem_init/lookup_mem_init.coe">
      <FileInfo>
        <Attr Name="UsedInSynthesis" Val="1"/>
        <Attr Name="UsedInSimulation" Val="1"/>
        <Attr Name="UsedIn" Val="synthesis"/>
        <Attr Name="UsedIn" Val="implementation"/>
        <Attr Name="UsedIn" Val="simulation"/>
      </FileInfo>
    </File>
    <Config>
      <Option Name="DesignMode" Val="RTL"/>
      <Option Name="TopModule" Val="automotive_ethernet_gateway"/>
      <Option Name="TopAutoSet" Val="TRUE"/>
    </Config>
  </FileSet>
</DARoots>


text:
require 'spec_helper'

feature "User landing on website" do

	context "on homepage" do
   it " should have a flights page" do
      visit new_flight_path
      expect(page).to have_content "dodo"
    end

   it "should create a new flight when filling out form" do
			visit new_flight_path
			expect {
				fill_in 'flight_beginning_airport',   with: "Germany"
				fill_in 'flight_ending_airport', with: "France"
				fill_in 'flight_price', with: 50
				fill_in 'flight_phone_number', with: "917-957-7347"
				click_button 'submit'
			}.to change(Flight, :count).by(1)
     end
  end

end


text:
from __future__ import (
    unicode_literals,
    absolute_import,
    print_function,
    division,
    )
str = type('')
try:
    range = xrange
except NameError:
    pass

import io
import os
import errno
from time import time, sleep

import pytest
import pkg_resources

from gpiozero import *
from gpiozero.pins.mock import MockConnectedPin, MockFactory
from gpiozero.pins.native import NativeFactory
try:
    from math import isclose
except ImportError:
    from gpiozero.compat import isclose

# This module assumes you've wired the following GPIO pins together. The pins
# can be re-configured via the listed environment variables (useful for when
# your testing rig requires different pins because the defaults interfere with
# attached hardware).
TEST_PIN = int(os.environ.get('GPIOZERO_TEST_PIN', '22'))
INPUT_PIN = int(os.environ.get('GPIOZERO_TEST_INPUT_PIN', '27'))
TEST_LOCK = os.environ.get('GPIOZERO_TEST_LOCK', '/tmp/real_pins_lock')

@pytest.fixture(
    scope='module',
    params=[
        name
        for name in pkg_resources.\
            get_distribution('gpiozero').\
            get_entry_map('gpiozero_pin_factories').keys()
        if not name.endswith('Pin') # leave out compatibility names
    ])
def pin_factory_name(request):
    return request.param

@pytest.yield_fixture()
def pin_factory(request, pin_factory_name):
    try:
        factory = pkg_resources.load_entry_point(
            'gpiozero', 'gpiozero_pin_factories', pin_factory_name)()
    except Exception as e:
        pytest.skip("skipped factory %s: %s" % (pin_factory_name, str(e)))
    else:
        yield factory
        factory.close()

@pytest.yield_fixture()
def default_factory(request, pin_factory):
    save_pin_factory = Device.pin_factory
    Device.pin_factory = pin_factory
    yield pin_factory
    Device.pin_factory = save_pin_factory

@pytest.yield_fixture(scope='function')
def pins(request, pin_factory):
    # Why return both pins in a single fixture? If we defined one fixture for
    # each pin then pytest will (correctly) test RPiGPIOPin(22) against
    # NativePin(27) and so on. This isn't supported, so we don't test it
    input_pin = pin_factory.pin(INPUT_PIN)
    input_pin.function = 'input'
    input_pin.pull = 'down'
    if isinstance(pin_factory, MockFactory):
        test_pin = pin_factory.pin(TEST_PIN, pin_class=MockConnectedPin, input_pin=input_pin)
    else:
        test_pin = pin_factory.pin(TEST_PIN)
    yield test_pin, input_pin
    test_pin.close()
    input_pin.close()

def setup_module(module):
    # Python 2.7 compatible method of exclusive-open
    flags = os.O_CREAT | os.O_EXCL | os.O_WRONLY
    start = time()
    while True:
        if time() - start > 300:  # 5 minute timeout
            raise RuntimeError('timed out waiting for real pins lock')
        try:
            fd = os.open(TEST_LOCK, flags)
        except OSError as e:
            if e.errno == errno.EEXIST:
                print('Waiting for lock before testing real-pins')
                sleep(0.1)
            else:
                raise
        else:
            with os.fdopen(fd, 'w') as f:
                f.write('Lock file for gpiozero real-pin tests; delete '
                        'this if the test suite is not currently running\n')
            break

def teardown_module(module):
    os.unlink(TEST_LOCK)

def test_pin_numbers(pins):
    test_pin, input_pin = pins
    assert test_pin.number == TEST_PIN
    assert input_pin.number == INPUT_PIN

def test_function_bad(pins):
    test_pin, input_pin = pins
    with pytest.raises(PinInvalidFunction):
        test_pin.function = 'foo'

def test_output(pins):
    test_pin, input_pin = pins
    test_pin.function = 'output'
    test_pin.state = 0
    assert input_pin.state == 0
    test_pin.state = 1
    assert input_pin.state == 1

def test_output_with_state(pins):
    test_pin, input_pin = pins
    test_pin.output_with_state(0)
    assert input_pin.state == 0
    test_pin.output_with_state(1)
    assert input_pin.state == 1

def test_pull(pins):
    test_pin, input_pin = pins
    test_pin.function = 'input'
    test_pin.pull = 'up'
    assert input_pin.state == 1
    test_pin.pull = 'down'
    test_pin, input_pin = pins
    assert input_pin.state == 0

def test_pull_bad(pins):
    test_pin, input_pin = pins
    test_pin.function = 'input'
    with pytest.raises(PinInvalidPull):
        test_pin.pull = 'foo'
    with pytest.raises(PinInvalidPull):
        test_pin.input_with_pull('foo')

def test_pull_down_warning(pin_factory):
    if pin_factory.pi_info.pulled_up('GPIO2'):
        pin = pin_factory.pin(2)
        try:
            with pytest.raises(PinFixedPull):
                pin.pull = 'down'
            with pytest.raises(PinFixedPull):
                pin.input_with_pull('down')
        finally:
            pin.close()
    else:
        pytest.skip("GPIO2 isn't pulled up on this pi")

def test_input_with_pull(pins):
    test_pin, input_pin = pins
    test_pin.input_with_pull('up')
    assert input_pin.state == 1
    test_pin.input_with_pull('down')
    assert input_pin.state == 0

def test_bad_duty_cycle(pins):
    test_pin, input_pin = pins
    test_pin.function = 'output'
    try:
        # NOTE: There's some race in RPi.GPIO that causes a segfault if we
        # don't pause before starting PWM; only seems to happen when stopping
        # and restarting PWM very rapidly (i.e. between test cases).
        if Device.pin_factory.__class__.__name__ == 'RPiGPIOFactory':
            sleep(0.1)
        test_pin.frequency = 100
    except PinPWMUnsupported:
        pytest.skip("%r doesn't support PWM" % test_pin.factory)
    else:
        try:
            with pytest.raises(ValueError):
                test_pin.state = 1.1
        finally:
            test_pin.frequency = None

def test_duty_cycles(pins):
    test_pin, input_pin = pins
    test_pin.function = 'output'
    try:
        # NOTE: see above
        if Device.pin_factory.__class__.__name__ == 'RPiGPIOFactory':
            sleep(0.1)
        test_pin.frequency = 100
    except PinPWMUnsupported:
        pytest.skip("%r doesn't support PWM" % test_pin.factory)
    else:
        try:
            for duty_cycle in (0.0, 0.1, 0.5, 1.0):
                test_pin.state = duty_cycle
                assert test_pin.state == duty_cycle
                total = sum(input_pin.state for i in range(20000))
                assert isclose(total / 20000, duty_cycle, rel_tol=0.1, abs_tol=0.1)
        finally:
            test_pin.frequency = None

def test_explicit_factory(no_default_factory, pin_factory):
    with GPIODevice(TEST_PIN, pin_factory=pin_factory) as device:
        assert Device.pin_factory is None
        assert device.pin_factory is pin_factory
        assert device.pin.number == TEST_PIN

def test_envvar_factory(no_default_factory, pin_factory_name):
    os.environ['GPIOZERO_PIN_FACTORY'] = pin_factory_name
    assert Device.pin_factory is None
    try:
        device = GPIODevice(TEST_PIN)
    except Exception as e:
        pytest.skip("skipped factory %s: %s" % (pin_factory_name, str(e)))
    else:
        try:
            group = 'gpiozero_pin_factories'
            for factory in pkg_resources.iter_entry_points(group, pin_factory_name):
                factory_class = factory.load()
            assert isinstance(Device.pin_factory, factory_class)
            assert device.pin_factory is Device.pin_factory
            assert device.pin.number == TEST_PIN
        finally:
            device.close()
            Device.pin_factory.close()

def test_compatibility_names(no_default_factory):
    os.environ['GPIOZERO_PIN_FACTORY'] = 'NATIVE'
    try:
        device = GPIODevice(TEST_PIN)
    except Exception as e:
        pytest.skip("skipped factory %s: %s" % (pin_factory_name, str(e)))
    else:
        try:
            assert isinstance(Device.pin_factory, NativeFactory)
            assert device.pin_factory is Device.pin_factory
            assert device.pin.number == TEST_PIN
        finally:
            device.close()
            Device.pin_factory.close()

def test_bad_factory(no_default_factory):
    os.environ['GPIOZERO_PIN_FACTORY'] = 'foobarbaz'
    # Waits for someone to implement the foobarbaz pin factory just to
    # mess with our tests ...
    with pytest.raises(BadPinFactory):
        GPIODevice(TEST_PIN)

def test_default_factory(no_default_factory):
    assert Device.pin_factory is None
    os.environ.pop('GPIOZERO_PIN_FACTORY', None)
    try:
        device = GPIODevice(TEST_PIN)
    except Exception as e:
        pytest.skip("no default factories")
    else:
        try:
            assert device.pin_factory is Device.pin_factory
            assert device.pin.number == TEST_PIN
        finally:
            device.close()
            Device.pin_factory.close()


text:
package uk.gov.gds.ier.transaction.overseas.parentsAddress

import uk.gov.gds.ier.transaction.overseas.InprogressOverseas
import uk.gov.gds.ier.step.StepTemplate

trait ParentsAddressLookupMustache extends StepTemplate[InprogressOverseas] {

  val title = "What was your parent or guardian's last UK address?"
  val questionNumber = ""

  case class LookupModel (
      question: Question,
      postcode: Field
  ) extends MustacheData

  val mustache = MustacheTemplate("overseas/parentsAddressLookup") { (form, post) =>

    implicit val progressForm = form

    LookupModel(
      question = Question(
        postUrl = post.url,
        title = title,
        errorMessages = form.globalErrors.map(_.message)
      ),
      postcode = Field(
        id = keys.parentsAddress.postcode.asId(),
        name = keys.parentsAddress.postcode.key,
        value = form(keys.parentsAddress.postcode).value.getOrElse(""),
        classes = if (form(keys.parentsAddress.postcode).hasErrors) {
          "invalid"
        } else {
          ""
        }
      )
    )
  }
}


text:
'use strict';

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    jshint: {
      all: [
        'Gruntfile.js',
        'tasks/*.js',
      ],
      options: {
        jshintrc: '.jshintrc',
      },
    },
  });

  // Actually load this plugin's task(s).
  grunt.loadTasks('tasks');

  grunt.loadNpmTasks('grunt-contrib-jshint');

  // By default, lint and run all tests.
  grunt.registerTask('default', ['jshint']);

};


text:
"""
Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking
about the node number and not the value in the nodes.

You should try to do it in place. The program should run in O(1) space complexity and O(nodes) time complexity.

Example:
Given 1->2->3->4->5->NULL,
return 1->3->5->2->4->NULL.

Note:
The relative order inside both the even and odd groups should remain as it was in the input.
The first node is considered odd, the second node even and so on ...
"""
__author__ = 'Daniel'

# Definition for singly-linked list.
class ListNode(object):
    def __init__(self, x):
        self.val = x
        self.next = None

class Solution(object):
    def oddEvenList(self, head):
        """
        :type head: ListNode
        :rtype: ListNode
        """
        if not head:
            return

        ptr = head  # end of odd position
        pre = head  # don't move the first
        cnt = 1
        while pre and pre.next:
            cur = pre.next
            cnt += 1
            if cnt % 2 == 0:
                pre = pre.next
            else:
                start = ptr.next
                nxt = cur.next

                ptr.next = cur
                cur.next = start
                pre.next = nxt

                ptr = ptr.next

        return head

    def oddEvenListError(self, head):
        """
        Wrongly move by node value
        :type head: ListNode
        :rtype: ListNode
        """
        if not head:
            return

        ptr = head  # end of first parity
        parity = ptr.val % 2

        pre = head
        while pre and pre.next:
            cur = pre.next
            if cur.val % 2 != parity:
                pre = pre.next
            else:
                start = ptr.next
                nxt = cur.next

                ptr.next = cur
                cur.next = start
                pre.next = nxt

                ptr = ptr.next

        return head


text:
package org.apache.flink.yarn;

import org.apache.flink.client.cli.CliFrontendTestBase;
import org.apache.flink.client.cli.CliFrontendTestUtils;
import org.apache.flink.client.program.ClusterClient;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.configuration.JobManagerOptions;
import org.apache.flink.util.FlinkException;
import org.apache.flink.yarn.cli.FlinkYarnSessionCli;
import org.apache.flink.yarn.util.FakeClusterClient;
import org.apache.flink.yarn.util.NonDeployingYarnClusterDescriptor;

import org.apache.commons.cli.CommandLine;
import org.apache.hadoop.yarn.api.records.ApplicationId;
import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import static org.apache.flink.client.cli.CliFrontendRunTest.verifyCliFrontend;
import static org.apache.flink.yarn.util.YarnTestUtils.getTestJarPath;

/**
 * Tests for the RUN command using a {@link org.apache.flink.yarn.cli.FlinkYarnSessionCli} inside
 * the {@link org.apache.flink.client.cli.CliFrontend}.
 *
 * @see org.apache.flink.client.cli.CliFrontendRunTest
 */
public class CliFrontendRunWithYarnTest extends CliFrontendTestBase {

	@Rule
	public TemporaryFolder tmp = new TemporaryFolder();

	@BeforeClass
	public static void init() {
		CliFrontendTestUtils.pipeSystemOutToNull();
	}

	@AfterClass
	public static void shutdown() {
		CliFrontendTestUtils.restoreSystemOut();
	}

	@Test
	public void testRun() throws Exception {
		String testJarPath = getTestJarPath("BatchWordCount.jar").getAbsolutePath();

		Configuration configuration = new Configuration();
		configuration.setString(JobManagerOptions.ADDRESS, "localhost");
		configuration.setInteger(JobManagerOptions.PORT, 8081);

		FlinkYarnSessionCli yarnCLI = new TestingFlinkYarnSessionCli(
			configuration,
			tmp.getRoot().getAbsolutePath(),
			"y",
			"yarn");

		// test detached mode
		{
			String[] parameters = {"-m", "yarn-cluster", "-p", "2", "-d", testJarPath};
			verifyCliFrontend(yarnCLI, parameters, 2, true);
		}

		// test detached mode
		{
			String[] parameters = {"-m", "yarn-cluster", "-p", "2", "-yd", testJarPath};
			verifyCliFrontend(yarnCLI, parameters, 2, true);
		}
	}

	private static class TestingFlinkYarnSessionCli extends FlinkYarnSessionCli {
		private final ClusterClient<ApplicationId> clusterClient;
		private final String configurationDirectory;

		private TestingFlinkYarnSessionCli(
				Configuration configuration,
				String configurationDirectory,
				String shortPrefix,
				String longPrefix) throws Exception {
			super(configuration, configurationDirectory, shortPrefix, longPrefix);

			this.clusterClient = new FakeClusterClient(configuration);
			this.configurationDirectory = configurationDirectory;
		}

		@Override
		public YarnClusterDescriptor createClusterDescriptor(CommandLine commandLine)
			throws FlinkException {
			YarnClusterDescriptor parent = super.createClusterDescriptor(commandLine);
			return new NonDeployingYarnClusterDescriptor(
					parent.getFlinkConfiguration(),
					(YarnConfiguration) parent.getYarnClient().getConfig(),
					configurationDirectory,
					parent.getYarnClient(),
					clusterClient);
		}
	}

}


text:
/*
 * Numerics.h
 *
 *  Created on: Mar 7, 2013
 *      Author: kristof
 */

#ifndef PEANOCLAW_NUMERICS_H_
#define PEANOCLAW_NUMERICS_H_

#include "peanoclaw/interSubgridCommunication/Interpolation.h"
#include "peanoclaw/interSubgridCommunication/Restriction.h"
#include "peanoclaw/interSubgridCommunication/FluxCorrection.h"

#include "tarch/la/Vector.h"

namespace peanoclaw {
  class Numerics;
  class Patch;

  namespace interSubgridCommunication {
    class DefaultTransfer;
  }
}

/**
 * Interface for functionality provided by the coupled framework
 * (I.e. PyClaw).
 */
class peanoclaw::Numerics {

private:
  peanoclaw::interSubgridCommunication::DefaultTransfer* _transfer;
  peanoclaw::interSubgridCommunication::Interpolation*   _interpolation;
  peanoclaw::interSubgridCommunication::Restriction*     _restriction;
  peanoclaw::interSubgridCommunication::FluxCorrection*  _fluxCorrection;

  public:
    Numerics(
        peanoclaw::interSubgridCommunication::DefaultTransfer* transfer,
      peanoclaw::interSubgridCommunication::Interpolation*     interpolation,
      peanoclaw::interSubgridCommunication::Restriction*       restriction,
      peanoclaw::interSubgridCommunication::FluxCorrection*    fluxCorrection
    );

    virtual ~Numerics();

    /**
     * Adds a patch to the solution which is hold in PyClaw. This method is used for gathering a solution
     * holding the complete grid in PyClaw to plot it via VisClaw.
     */
    virtual void addPatchToSolution(Patch& patch) = 0;

    /**
     * Initializes the given patch at the beginning of a simulation run.
     *
     */
    virtual void initializePatch(Patch& patch) = 0;

    /**
     * Transfers ghostlayer values from the source subgrid to
     * the destination subgrid.
     */
    virtual void transferGhostlayer(
      const tarch::la::Vector<DIMENSIONS, int>&    size,
      const tarch::la::Vector<DIMENSIONS, int>&    sourceOffset,
      const tarch::la::Vector<DIMENSIONS, int>&    destinationOffset,
      peanoclaw::Patch& source,
      peanoclaw::Patch&       destination
    ) const;

    /**
     * Performs the interpolation between the given source and destination
     * by means of the interpolation method implemented in Python. I.e. this
     * method can only be called if providesInterpolation() returns <tt>true</tt>.
     */
    virtual void interpolateSolution (
      const tarch::la::Vector<DIMENSIONS, int>&    destinationSize,
      const tarch::la::Vector<DIMENSIONS, int>&    destinationOffset,
      peanoclaw::Patch& source,
      peanoclaw::Patch&        destination,
      bool interpolateToUOld,
      bool interpolateToCurrentTime,
      bool useTimeUNewOrTimeUOld
    ) const;

    /**
     * Performs the restriction between the given source and destination
     * by means of the restriction method implemented in Python. I.e. this
     * method can only be called if providesRestriction() returns <tt>true</tt>.
     * This method returns the number of restricted cells.
     */
    virtual int restrictSolution (
      peanoclaw::Patch& source,
      peanoclaw::Patch& destination,
      bool              restrictOnlyOverlappedRegions
    ) const;

    /**
     * As the restriction is a splitted process over all fine subgrids
     * this event allows to do operations after all restriction steps
     * are finished.
     */
    virtual void postProcessRestriction(
      peanoclaw::Patch& destination,
      bool              restrictOnlyOverlappedRegions
    ) const;

    /**
     * Performs the flux correction between the given source and destination
     * by means of the restriction method implemented in Python. I.e. this
     * method can only be called if providesRestriction() returns <tt>true</tt>.
     */
    virtual void applyFluxCorrection (
      Patch& sourceSubgrid,
      Patch& destinationSubgrid,
      int dimension,
      int direction
    ) const;

    virtual void computeFluxes(Patch& subgrid) const;

    /**
     * Fills the specified boundary layer.
     *
     * @param patch The patch for which the boundary needs to be set.
     * @param dimension The dimension in perpendicular to which the
     * boundary needs to be set.
     * @param setUpper Specifies, whether the upper or the lower part
     * of the boundary needs to be set.
     */
    virtual void fillBoundaryLayer(
      Patch& subgrid,
      int dimension,
      bool setUpper
    ) = 0;

    /**
     * Solves a timestep. All updates (e.g. change of grid values, taken timestep size, new cfl number)
     * are performed on the patch object
     *
     * @param patch The Patch object holding the grid data.
     * @param maximumTimestepSize The maximal timestep size with regard to the current global timestep.
     * @param useDimensionalSplitting Enables dimensional splitting for the solver if available.
     * @param domainBoundaryFlags Specifies which boundaries of the subgrid are actual boundaries of the domain.
     *
     */
    virtual void solveTimestep(
      Patch& subgrid,
      double maximumTimestepSize,
      bool useDimensionalSplitting,
      tarch::la::Vector<DIMENSIONS_TIMES_TWO, bool> domainBoundaryFlags
    ) = 0;

    /**
     * Retrieves the demanded mesh width for the given patch.
     *
     * @return The mesh width demanded by the application. This is assumed to be the minimal mesh width
     * over all dimensions, hence it's a scalar value.
     */
    virtual tarch::la::Vector<DIMENSIONS, double> getDemandedMeshWidth(
      Patch& patch,
      bool   isInitializing
    ) = 0;

    /**
     * this function is e.g. useful to update auxillary data like bathymetry on a finer leverl
     */
    virtual void update (Patch& finePatch);

    /**
     * Returns the number of unknowns that have to be stored per cell.
     */
    virtual int getNumberOfUnknownsPerCell() const = 0;

    virtual int getNumberOfParameterFieldsWithoutGhostlayer() const = 0;

    virtual int getNumberOfParameterFieldsWithGhostlayer() const = 0;

    /**
     * Returns the ghostlayer width in cells that is required for the applied solver.
     */
    virtual int getGhostlayerWidth() const = 0;

    //Default Implementations for fluxes
    template<int NumberOfUnknowns>
    static tarch::la::Vector<NumberOfUnknowns,double> computeFlux(
      int dimension,
      const tarch::la::Vector<NumberOfUnknowns,double>& unknowns
    ) {
      tarch::la::Vector<NumberOfUnknowns,double> fluxes(unknowns * unknowns[1 + dimension]);
      for(int i = 0; i < DIMENSIONS; i++) {
        fluxes[i + 1] *= unknowns[0];
      }
      #ifdef PEANOCLAW_EULER3D
      #elif PEANOCLAW_FULLSWOF2D
      #else
      if(NumberOfUnknowns == 3) {
        //Shallow Water
        const double g = 1.0; //9.80665;
        double p = 0.5 * g * unknowns[0] * unknowns[0];
        fluxes[1 + dimension] += p;
      } else {
        //Euler
        const double gasConstant = 0.0; //<--
        double p = gasConstant * unknowns[0] * 273.0; //<--
        for(int i = 0; i < DIMENSIONS; i++) {
          fluxes[i + 1] += p;
        }
        fluxes[1 + DIMENSIONS] += p * unknowns[0];
      }
      #endif
      return fluxes;
    }
};

#endif /* PEANOCLAW_NUMERICS_H_ */


text:
void sampleMiss(double *y, double B0, double B1, double *t, double sig2_e, double *Psi,
                int Nobs, int Nmiss, int *miss, double *ySample);

SEXP RMCTwoSampleAR(SEXP yR, SEXP NR, SEXP distMatR, SEXP tR, SEXP rscaleR, SEXP alphaThetaR, SEXP betaThetaR, SEXP iterationsR);

double MCTwoSampleAR(double *y, int N, int *distMat, double *t, double rscale, double alphaTheta, double betaTheta, int iterations);

SEXP RgibbsTwoSampleAR(SEXP yR, SEXP NR, SEXP tR, SEXP rscaleR, SEXP alphaThetaR, SEXP betaThetaR,
                      SEXP loAreaR, SEXP upAreaR, SEXP iterationsR, SEXP leftSidedR, SEXP sdmetR, SEXP missR, SEXP NmissR,
                      SEXP progressR,SEXP pBar, SEXP rho);

void gibbsTwoSampleAR(double *y, int N, double *t, double rscale, double alphaTheta, double betaTheta,
                      double loArea, double upArea, int iterations, int leftSided, double sdmet, double *chains,
                      double *postp, int progress, int *miss, int Nmiss, SEXP pBar, SEXP rho);

double sampThetaAR(double theta, double mu, double delta, double sig2, double g, double *y, int N, double *t, double alphaTheta, double betaTheta , double sdmet);

double thetaLogLikeAR(double theta, double mu, double delta, double sig2, double g, double *y, int N, double *t, double alphaTheta, double betaTheta);


text:
namespace UI
{
    partial class UserControlClientEditDetails
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.buttonSave = new System.Windows.Forms.Button();
            this.textBoxCardNumber = new System.Windows.Forms.TextBox();
            this.labelCardNumber = new System.Windows.Forms.Label();
            this.labelSeparate = new System.Windows.Forms.Label();
            this.textBoxId = new System.Windows.Forms.TextBox();
            this.textBoxCreditMonth = new System.Windows.Forms.TextBox();
            this.textBoxCreditYear = new System.Windows.Forms.TextBox();
            this.textBoxCreditName = new System.Windows.Forms.TextBox();
            this.textBoxZipCode = new System.Windows.Forms.TextBox();
            this.textBoxHouseNum = new System.Windows.Forms.TextBox();
            this.textBoxStreet = new System.Windows.Forms.TextBox();
            this.textBoxCity = new System.Windows.Forms.TextBox();
            this.textBoxCell = new System.Windows.Forms.TextBox();
            this.textBoxPhone = new System.Windows.Forms.TextBox();
            this.textBoxLastName = new System.Windows.Forms.TextBox();
            this.textBoxPrivateName = new System.Windows.Forms.TextBox();
            this.labelId = new System.Windows.Forms.Label();
            this.labelCreditValidity = new System.Windows.Forms.Label();
            this.labelZipCode = new System.Windows.Forms.Label();
            this.labelCreditName = new System.Windows.Forms.Label();
            this.labelHouseNum = new System.Windows.Forms.Label();
            this.labelStreet = new System.Windows.Forms.Label();
            this.labelCity = new System.Windows.Forms.Label();
            this.labelCell = new System.Windows.Forms.Label();
            this.labelPhone = new System.Windows.Forms.Label();
            this.labelLastName = new System.Windows.Forms.Label();
            this.labelPrivateName = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // buttonSave
            //
            this.buttonSave.Location = new System.Drawing.Point(144, 490);
            this.buttonSave.Name = "buttonSave";
            this.buttonSave.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.buttonSave.Size = new System.Drawing.Size(75, 23);
            this.buttonSave.TabIndex = 13;
            this.buttonSave.Text = "Save";
            this.buttonSave.UseVisualStyleBackColor = true;
            this.buttonSave.Click += new System.EventHandler(this.ButtonSaveClick);
            //
            // textBoxCardNumber
            //
            this.textBoxCardNumber.Location = new System.Drawing.Point(159, 334);
            this.textBoxCardNumber.Multiline = true;
            this.textBoxCardNumber.Name = "textBoxCardNumber";
            this.textBoxCardNumber.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.textBoxCardNumber.Size = new System.Drawing.Size(159, 20);
            this.textBoxCardNumber.TabIndex = 8;
            //
            // labelCardNumber
            //
            this.labelCardNumber.AutoSize = true;
            this.labelCardNumber.Location = new System.Drawing.Point(28, 337);
            this.labelCardNumber.Name = "labelCardNumber";
            this.labelCardNumber.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.labelCardNumber.Size = new System.Drawing.Size(67, 13);
            this.labelCardNumber.TabIndex = 51;
            this.labelCardNumber.Text = "Card number";
            //
            // labelSeparate
            //
            this.labelSeparate.AutoSize = true;
            this.labelSeparate.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(177)));
            this.labelSeparate.Location = new System.Drawing.Point(225, 407);
            this.labelSeparate.Name = "labelSeparate";
            this.labelSeparate.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.labelSeparate.Size = new System.Drawing.Size(15, 24);
            this.labelSeparate.TabIndex = 23;
            this.labelSeparate.Text = "/";
            //
            // textBoxId
            //
            this.textBoxId.Location = new System.Drawing.Point(159, 453);
            this.textBoxId.Multiline = true;
            this.textBoxId.Name = "textBoxId";
            this.textBoxId.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.textBoxId.Size = new System.Drawing.Size(159, 20);
            this.textBoxId.TabIndex = 12;
            //
            // textBoxCreditMonth
            //
            this.textBoxCreditMonth.Location = new System.Drawing.Point(159, 409);
            this.textBoxCreditMonth.Multiline = true;
            this.textBoxCreditMonth.Name = "textBoxCreditMonth";
            this.textBoxCreditMonth.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.textBoxCreditMonth.Size = new System.Drawing.Size(55, 20);
            this.textBoxCreditMonth.TabIndex = 10;
            //
            // textBoxCreditYear
            //
            this.textBoxCreditYear.Location = new System.Drawing.Point(246, 412);
            this.textBoxCreditYear.Multiline = true;
            this.textBoxCreditYear.Name = "textBoxCreditYear";
            this.textBoxCreditYear.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.textBoxCreditYear.Size = new System.Drawing.Size(54, 20);
            this.textBoxCreditYear.TabIndex = 11;
            //
            // textBoxCreditName
            //
            this.textBoxCreditName.Location = new System.Drawing.Point(159, 375);
            this.textBoxCreditName.Multiline = true;
            this.textBoxCreditName.Name = "textBoxCreditName";
            this.textBoxCreditName.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.textBoxCreditName.Size = new System.Drawing.Size(159, 20);
            this.textBoxCreditName.TabIndex = 9;
            //
            // textBoxZipCode
            //
            this.textBoxZipCode.Location = new System.Drawing.Point(159, 298);
            this.textBoxZipCode.Multiline = true;
            this.textBoxZipCode.Name = "textBoxZipCode";
            this.textBoxZipCode.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.textBoxZipCode.Size = new System.Drawing.Size(159, 20);
            this.textBoxZipCode.TabIndex = 7;
            //
            // textBoxHouseNum
            //
            this.textBoxHouseNum.Location = new System.Drawing.Point(159, 255);
            this.textBoxHouseNum.Multiline = true;
            this.textBoxHouseNum.Name = "textBoxHouseNum";
            this.textBoxHouseNum.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.textBoxHouseNum.Size = new System.Drawing.Size(159, 20);
            this.textBoxHouseNum.TabIndex = 6;
            //
            // textBoxStreet
            //
            this.textBoxStreet.Location = new System.Drawing.Point(159, 224);
            this.textBoxStreet.Multiline = true;
            this.textBoxStreet.Name = "textBoxStreet";
            this.textBoxStreet.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.textBoxStreet.Size = new System.Drawing.Size(159, 20);
            this.textBoxStreet.TabIndex = 5;
            //
            // textBoxCity
            //
            this.textBoxCity.Location = new System.Drawing.Point(159, 191);
            this.textBoxCity.Multiline = true;
            this.textBoxCity.Name = "textBoxCity";
            this.textBoxCity.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.textBoxCity.Size = new System.Drawing.Size(159, 20);
            this.textBoxCity.TabIndex = 4;
            //
            // textBoxCell
            //
            this.textBoxCell.Location = new System.Drawing.Point(159, 146);
            this.textBoxCell.Multiline = true;
            this.textBoxCell.Name = "textBoxCell";
            this.textBoxCell.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.textBoxCell.Size = new System.Drawing.Size(159, 20);
            this.textBoxCell.TabIndex = 3;
            //
            // textBoxPhone
            //
            this.textBoxPhone.Location = new System.Drawing.Point(159, 117);
            this.textBoxPhone.Multiline = true;
            this.textBoxPhone.Name = "textBoxPhone";
            this.textBoxPhone.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.textBoxPhone.Size = new System.Drawing.Size(159, 20);
            this.textBoxPhone.TabIndex = 2;
            //
            // textBoxLastName
            //
            this.textBoxLastName.Location = new System.Drawing.Point(159, 81);
            this.textBoxLastName.Multiline = true;
            this.textBoxLastName.Name = "textBoxLastName";
            this.textBoxLastName.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.textBoxLastName.Size = new System.Drawing.Size(159, 20);
            this.textBoxLastName.TabIndex = 1;
            //
            // textBoxPrivateName
            //
            this.textBoxPrivateName.Location = new System.Drawing.Point(159, 42);
            this.textBoxPrivateName.Multiline = true;
            this.textBoxPrivateName.Name = "textBoxPrivateName";
            this.textBoxPrivateName.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.textBoxPrivateName.Size = new System.Drawing.Size(159, 20);
            this.textBoxPrivateName.TabIndex = 0;
            //
            // labelId
            //
            this.labelId.AutoSize = true;
            this.labelId.Location = new System.Drawing.Point(28, 456);
            this.labelId.Name = "labelId";
            this.labelId.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.labelId.Size = new System.Drawing.Size(56, 13);
            this.labelId.TabIndex = 9;
            this.labelId.Text = "ID number";
            //
            // labelCreditValidity
            //
            this.labelCreditValidity.AutoSize = true;
            this.labelCreditValidity.Location = new System.Drawing.Point(24, 414);
            this.labelCreditValidity.Name = "labelCreditValidity";
            this.labelCreditValidity.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.labelCreditValidity.Size = new System.Drawing.Size(64, 13);
            this.labelCreditValidity.TabIndex = 8;
            this.labelCreditValidity.Text = "Validity date";
            //
            // labelZipCode
            //
            this.labelZipCode.AutoSize = true;
            this.labelZipCode.Location = new System.Drawing.Point(28, 305);
            this.labelZipCode.Name = "labelZipCode";
            this.labelZipCode.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.labelZipCode.Size = new System.Drawing.Size(49, 13);
            this.labelZipCode.TabIndex = 7;
            this.labelZipCode.Text = "Zip code";
            //
            // labelCreditName
            //
            this.labelCreditName.AutoSize = true;
            this.labelCreditName.Location = new System.Drawing.Point(24, 375);
            this.labelCreditName.Name = "labelCreditName";
            this.labelCreditName.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.labelCreditName.Size = new System.Drawing.Size(109, 13);
            this.labelCreditName.TabIndex = 7;
            this.labelCreditName.Text = "Credit company name";
            //
            // labelHouseNum
            //
            this.labelHouseNum.AutoSize = true;
            this.labelHouseNum.Location = new System.Drawing.Point(24, 258);
            this.labelHouseNum.Name = "labelHouseNum";
            this.labelHouseNum.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.labelHouseNum.Size = new System.Drawing.Size(76, 13);
            this.labelHouseNum.TabIndex = 6;
            this.labelHouseNum.Text = "House number";
            //
            // labelStreet
            //
            this.labelStreet.AutoSize = true;
            this.labelStreet.Location = new System.Drawing.Point(28, 227);
            this.labelStreet.Name = "labelStreet";
            this.labelStreet.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.labelStreet.Size = new System.Drawing.Size(35, 13);
            this.labelStreet.TabIndex = 5;
            this.labelStreet.Text = "Street";
            //
            // labelCity
            //
            this.labelCity.AutoSize = true;
            this.labelCity.Location = new System.Drawing.Point(28, 198);
            this.labelCity.Name = "labelCity";
            this.labelCity.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.labelCity.Size = new System.Drawing.Size(24, 13);
            this.labelCity.TabIndex = 4;
            this.labelCity.Text = "City";
            //
            // labelCell
            //
            this.labelCell.AutoSize = true;
            this.labelCell.Location = new System.Drawing.Point(24, 153);
            this.labelCell.Name = "labelCell";
            this.labelCell.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.labelCell.Size = new System.Drawing.Size(92, 13);
            this.labelCell.TabIndex = 3;
            this.labelCell.Text = "Cellphone number";
            //
            // labelPhone
            //
            this.labelPhone.AutoSize = true;
            this.labelPhone.Location = new System.Drawing.Point(28, 120);
            this.labelPhone.Name = "labelPhone";
            this.labelPhone.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.labelPhone.Size = new System.Drawing.Size(76, 13);
            this.labelPhone.TabIndex = 2;
            this.labelPhone.Text = "Phone number";
            //
            // labelLastName
            //
            this.labelLastName.AutoSize = true;
            this.labelLastName.Location = new System.Drawing.Point(28, 84);
            this.labelLastName.Name = "labelLastName";
            this.labelLastName.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.labelLastName.Size = new System.Drawing.Size(56, 13);
            this.labelLastName.TabIndex = 1;
            this.labelLastName.Text = "Last name";
            //
            // labelPrivateName
            //
            this.labelPrivateName.AutoSize = true;
            this.labelPrivateName.Location = new System.Drawing.Point(28, 45);
            this.labelPrivateName.Name = "labelPrivateName";
            this.labelPrivateName.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.labelPrivateName.Size = new System.Drawing.Size(55, 13);
            this.labelPrivateName.TabIndex = 0;
            this.labelPrivateName.Text = "First name";
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.Location = new System.Drawing.Point(100, 8);
            this.label2.Name = "label2";
            this.label2.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.label2.Size = new System.Drawing.Size(228, 25);
            this.label2.TabIndex = 52;
            this.label2.Text = "Edit personal details";
            //
            // UserControlClientEditDetails
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(225)))), ((int)(((byte)(255)))));
            this.Controls.Add(this.label2);
            this.Controls.Add(this.buttonSave);
            this.Controls.Add(this.textBoxCardNumber);
            this.Controls.Add(this.labelCardNumber);
            this.Controls.Add(this.labelSeparate);
            this.Controls.Add(this.textBoxId);
            this.Controls.Add(this.textBoxCreditMonth);
            this.Controls.Add(this.textBoxCreditYear);
            this.Controls.Add(this.textBoxCreditName);
            this.Controls.Add(this.textBoxZipCode);
            this.Controls.Add(this.textBoxHouseNum);
            this.Controls.Add(this.textBoxStreet);
            this.Controls.Add(this.textBoxCity);
            this.Controls.Add(this.textBoxCell);
            this.Controls.Add(this.textBoxPhone);
            this.Controls.Add(this.textBoxLastName);
            this.Controls.Add(this.textBoxPrivateName);
            this.Controls.Add(this.labelId);
            this.Controls.Add(this.labelCreditValidity);
            this.Controls.Add(this.labelZipCode);
            this.Controls.Add(this.labelCreditName);
            this.Controls.Add(this.labelHouseNum);
            this.Controls.Add(this.labelStreet);
            this.Controls.Add(this.labelCity);
            this.Controls.Add(this.labelCell);
            this.Controls.Add(this.labelPhone);
            this.Controls.Add(this.labelLastName);
            this.Controls.Add(this.labelPrivateName);
            this.Name = "UserControlClientEditDetails";
            this.Size = new System.Drawing.Size(387, 516);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label labelPrivateName;
        private System.Windows.Forms.Label labelLastName;
        private System.Windows.Forms.Label labelPhone;
        private System.Windows.Forms.Label labelCell;
        private System.Windows.Forms.Label labelCity;
        private System.Windows.Forms.Label labelStreet;
        private System.Windows.Forms.Label labelHouseNum;
        private System.Windows.Forms.Label labelCreditName;
        private System.Windows.Forms.Label labelZipCode;
        private System.Windows.Forms.Label labelCreditValidity;
        private System.Windows.Forms.Label labelId;
        private System.Windows.Forms.TextBox textBoxPrivateName;
        private System.Windows.Forms.TextBox textBoxLastName;
        private System.Windows.Forms.TextBox textBoxPhone;
        private System.Windows.Forms.TextBox textBoxCell;
        private System.Windows.Forms.TextBox textBoxCity;
        private System.Windows.Forms.TextBox textBoxStreet;
        private System.Windows.Forms.TextBox textBoxHouseNum;
        private System.Windows.Forms.TextBox textBoxZipCode;
        private System.Windows.Forms.TextBox textBoxCreditName;
        private System.Windows.Forms.TextBox textBoxCreditYear;
        private System.Windows.Forms.TextBox textBoxCreditMonth;
        private System.Windows.Forms.Label labelSeparate;
        private System.Windows.Forms.TextBox textBoxId;
        private System.Windows.Forms.TextBox textBoxCardNumber;
        private System.Windows.Forms.Label labelCardNumber;
        private System.Windows.Forms.Button buttonSave;
        private System.Windows.Forms.Label label2;
    }
}


text:
layout: post
title: "GNOME Recipes: Yuk Bagikan Resepmu!"
description: "GNOME Recipes: Yuk Bagikan Resepmu!"
comments: false
keywords: "GNOME, Recipes"
---

![https://raw.githubusercontent.com/gnome-id/poster/master/gnome-recipe-poster.png](https://raw.githubusercontent.com/gnome-id/poster/master/gnome-recipe-poster.png)

Menindaklanjuti kegiatan [GNOME Recipes Hackfest 2018](https://wiki.gnome.org/Hackfests/Recipes2018) yang digelar pada tanggal 28 Februari–2 Maret 2018 lalu, GNOME Indonesia berkolaborasi dengan beberapa komunitas open source seperti BlankOn, Endless, dan openSUSE Indonesia mengadakan kegiatan pengumpulan resep lokal. Kegiatan ini akan digelar mulai Mei hingga Juni 2018.

GNOME Recipes merupakan aplikasi yang dapat membantu Anda untuk memasak dengan menu-menu umum maupun khusus yang telah tersedia di dalam aplikasi. Sayangnya sampai sampai saat ini aplikasi GNOME Recipes belum memuat menu-menu Indonesia. GNOME memerlukan kontribusi dari komunitas untuk dapat memperkaya menu pada GNOME Recipes ini.

Kirim resep terbaik lengkap dengan foto masakanmu melalui [formulir ini](https://s.id/gnomerecipes). Untuk membantu Anda dalam menulis resep, kami telah menyediakan template yang dapat diunduh melalui [tautan ini](https://drive.google.com/drive/folders/17YYN_QKYwmR36CjhutDuMW8bQrmCkLkr?usp=sharing).

Kami menyediakan beragam hadiah menarik untuk kontributor yang mengirim minimal 7 resep masakan dalam kegiatan ini. Yuk berbagi resep!


text:
'use strict'

const express = require('express')
const router = express.Router()
const config = require('../config.json')

router.get('/', function (req, res, next) {
  res.render('index', {
    config: config,
    user: req.session.user,
    active: '/'
  })
})

router.get('/shop', function (req, res, next) {
  res.render('shop', {
    config: config,
    user: req.session.user,
    active: '/shop'
  })
})

module.exports = router


text:
FOUNDATION_EXPORT double Pods_BDTestsUnitTestsVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_BDTestsUnitTestsVersionString[];


text:
<?php

declare(strict_types=1);
use OAuth2Framework\Component\AuthorizationEndpoint\ResponseMode\FormPostResponseMode;
use Psr\Http\Message\ResponseFactoryInterface;

use OAuth2Framework\Component\AuthorizationEndpoint;
use OAuth2Framework\ServerBundle\Service\TwigFormPostResponseRenderer;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use function Symfony\Component\DependencyInjection\Loader\Configurator\ref;

return function (ContainerConfigurator $container) {
    $container = $container->services()->defaults()
        ->private()
        ->autoconfigure()
    ;

    $container->set(TwigFormPostResponseRenderer::class)
        ->args([
            ref('twig'),
            '%oauth2_server.endpoint.authorization.response_mode.form_post.template%',
        ])
    ;

    $container->set(FormPostResponseMode::class)
        ->args([
            ref(TwigFormPostResponseRenderer::class),
            ref(ResponseFactoryInterface::class),
        ])
    ;
};


text:
```
bundle install
bundle exec rake db:setup
```

## Start import

```
bundle rake ruian:update_all
bundle rake ruian:import
```

## How it works

See example lib/tasks/ruian.rake for details about ruian:import task. Mainly example/lib/importer.rb is used for importing.

'Interface' is defined in lib/ruian/importer.rb.

Update tasks are defined in lib/tasks/ruian.rake.


text:
{% extends "website/base.html" %}

{% block pagetitle %}{{news.title}}{% endblock %}

{% load static %}
{% load thumbnail %}
{% load cropping %}
{% load ml_tags %}

{% block stylesheets %}
    <link rel="stylesheet" href="{% static 'website/css/news.css' %}">
    <link rel="stylesheet" href="{% static 'website/css/bignews.css' %}">
{% endblock %}

{% block maincarousel %}

        {# Uncomment the following if you want to have a carousel on the people page #}
        {# {% include "snippets/display_short_carousel_snippet.html" %} #}

{% endblock %}

{% block content %}

		    {% if news.image %}

		    {% else %}

		    {% endif %}

{{news.title}}

		    {{news.author.get_full_name}}

		    Published {{news.short_date}}

		    {% for project in news.project.all %}
		    {{project.name}}

		    {% endfor %}

		{% autoescape off %}

{{news.content}}

		{% endautoescape %}

	    {% if author_news %}

Recent News from {{news.author.first_name}}

		    {% for item in author_news %}

			    {% if item.image %}

			    {% else %}

			    {% endif %}

{{item.title}}

{{item.short_date}} | {{item.author.first_name}}

			    {% autoescape off %}

{{ item.content | removehtmltags }}

			    {% endautoescape %}

		    {% endfor %}

	    {% endif %}
	    {% for project, proj_news in project_news.items %}

		{% if proj_news %}

Recent News from {{project.name}}

		{% endif %}

		    {% for item in proj_news %}

			    {% if item.image %}

			    {% else %}

			    {% endif %}

{{item.title}}

{{item.short_date}} | {{item.author.first_name}}

			    {% autoescape off %}

{{item.content}}

			    {% endautoescape %}

		    {% endfor %}

	    {% endfor %}

{% endblock %}


text:
topic: "Rational: ex11"
desc: "Using java arrays and java.util.ArrayList with Rational; running main() programs from a jar file; reading from file, constructing from string"
indent: true
code_repo: https://github.com/UCSB-CS56-pconrad/cs56-rational-ex11
---

{% include rational_example_header.html %}

# Plain Java Arrays of our Rational object

We can create plain old Java Arrays of Rational objects with code such as this:

```java
Rational [] terms = new Rational[5];
```

at which point we have an array of 10 null references, each of which could be initialized to a Rational number.  For example,
we can get the first five terms of this sequence:

$$ 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \frac{1}{5} $$

With this code:

```java
   Rational [] terms = new Rational[5];

   int denom = 1;
   for (int i=0; i<terms.length; i++) {
      terms[i] = new Rational(1, denom);
      denom++;
   }
```

The file [PlainArrayDemo.java](https://github.com/UCSB-CS56-pconrad/cs56-rational-ex11/blob/master/src/edu/ucsb/cs56/pconrad/rational/PlainArrayDemo.java) in ex11 demonstrates this.

# Running from a jar

To run the example, we can create a jar file with `ant jar`

```
cs56-rational-ex11 pconrad$ ant jar
Buildfile: /Users/pconrad/github/UCSB-CS56-pconrad/cs56-rational-ex11/build.xml

compile:

jar:
      [jar] Building jar: /Users/pconrad/github/UCSB-CS56-pconrad/cs56-rational-ex11/build/rational.jar

BUILD SUCCESSFUL
Total time: 0 seconds
cs56-rational-ex11 pconrad$
```

Then we can use that jar in our classpath (the `-cp` argument of the `java` command) and specify the full
name of the class we want to run:

```
cs56-rational-ex11 pconrad$ java -cp build/rational.jar edu.ucsb.cs56.pconrad.rational.PlainArrayDemo
Traditional for loop:
terms[0]=1
terms[1]=1/2
terms[2]=1/3
terms[3]=1/4
terms[4]=1/5
For-each style loop:
r=1
r=1/2
r=1/3
r=1/4
r=1/5
Phillips-Mac-mini:cs56-rational-ex11 pconrad$
```
# Using `ArrayList<Rational>`

We can also do the same with an ArrayList.  The file  [ArrayListDemo.java](https://github.com/UCSB-CS56-pconrad/cs56-rational-ex11/blob/master/src/edu/ucsb/cs56/pconrad/rational/ArrayListDemo.java) in ex11 demonstrates this.

```
 ArrayList<Rational> terms = new ArrayList<Rational>();

 int denom = 1;
 for (int i=0; i<5; i++) {
   terms.add(new Rational(1, denom));
   denom++;
 }
```

We can traverse an ArrayList with either a traditional for loop, or the for-each style loop:

```
 System.out.println("Traditional for loop:");
        for (int i=0; i<terms.size(); i++) {
            System.out.println("terms[" + i + "]=" + terms.get(i));
        }

        System.out.println("For-each style loop:");
        for (Rational r: terms) {
            System.out.println("r=" + r);
        }
```

# Reading lines from a file to initialize an ArrayList

The "best way" to read from a file, line-by-line, in Java has changed signficantly over the years.   Both Java 7 and Java 8 introduced
significant improvements in the I/O routines.  The old ways still work, but the new ways offer signficant advantages in terms of simplicity.

Two small digressions before the main presentation about reading from a file:

1. try with resources
2. constructing from a string

## "try with resources"

The technique I'm showing here is not the "bleeding edge" of new Java functionality, but is more of a blend of some older approaches with one new innovation from Java 8: the "try with resources" construct.

Basically, the idea is that there are some kinds of resources that we should "close" when we are finished with them, including files.   (Files get automatically closed when a program exits, but in the meantime, if the file is kept open, there are certain performance penalties.)

You can read more about this here:

* <https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html>

## A constructor for Rational objects that takes a String

A useful constructor to implement is one that is the inverse of the toString method; that is one that takes the String representation of
an object as input, parses it, and then initializes an equivalent object.

In this version, I've introduced tests cases in RationalTest and an implementation in Rational for a constructor that takes a String that is more or less of the same form at the output of toString.  In fact, it is a bit less restrictive in that is allows for whitespace around the numerator and denominator, though no other characters are permitted.    Also, it requires the numerator and denominator to present, which may differ from our toString output when denominator is 1; this is something we might address in a later version or as an exercise for the student.

Look for these test cases and for the new constructor in RationalTest.java and Rational.java.

Also note that we have factored out a helper method rationalize() where we've also introduced some missing functionality to move signs from denominator to numerator when needed (this was deliberately left out of some earlier examples, because it was left as an exercise for the student.)

## The loop that reads

Our program, [ReadFileOfRationals](https://github.com/UCSB-CS56-pconrad/cs56-rational-ex11/blob/master/src/edu/ucsb/cs56/pconrad/rational/ReadFileOfRationals.java), contains this main.  Note how we've tried to factor out
code and details (such as the `USAGE` message, and the details of `readArray`) into constants and methods to keep the code short.

Short methods are good.  They are easier to understand and maintain.  Strive for short methods.

```java
public static void main(String args[]) {

	if (args.length != 1) {
	    System.err.println("Error: Missing filename parameter");
	    System.err.println(USAGE);
	    System.exit(1);
	}

	String filename = args[0];

	ArrayList<Rational> numbers = readArrayListFromFile(filename);

	System.out.println("numbers = " + numbers);
   }
```

Here is our `readArrayFromList` method.  I've taken out this comment to make the lines easier to follow

```
public static ArrayList<Rational> readArrayListFromFile(String fileName) {

	ArrayList<Rational> items = new ArrayList<Rational>();

	try (BufferedReader br =
	     new BufferedReader(new FileReader(fileName))) {

	    String line;
	    while ((line = br.readLine()) != null) {
		   // process "line" as input
		   try {
		      Rational r = new Rational(line);
		      items.add(r);
		   } catch (IllegalArgumentException iae) {
		       System.err.println("Warning: ignored bad input line: " +
				       line);
		   }
	    } // while

	} catch (IOException e) {
	    e.printStackTrace();
	} // try with resources

	return items;
```

Look at the two lines of code from the above example:

```java
try (BufferedReader br =
	     new BufferedReader(new FileReader(fileName))) {
```

These two lines are an example of the start of a "try with resources" block.  The short explanation is that
objects that implement "java.lang.AutoCloseable" are "automatically closed" at the end of a "try with resources construct".

This allows the programmer to not have to worry about making sure that the appropriate `close()` method is called on every conceivable
path through the code, which is a great simplification.   It makes it more likely that the programmer will "get it right".

# More on advanced I/O techniques in Java

This is only one of several ways to read from a file in Java.  The following web page has some nice examples of how to read a file line-by-line, using various techniques.   You are encouraged to explore all of them.

<https://www.mkyong.com/java8/java-8-stream-read-a-file-line-by-line/>


text:
from django.conf import settings

import traceback
import sys
import re

class Menu(object):
    """
    Menu is a class that generates menus

    It allows for multiple named menus, which can be accessed in your templates
    using the generate_menu template tag.

    Menus are loaded from the INSTALLED_APPS, inside a file named menus.py.
    This file should import the Menu & MenuItem classes and then call add_item:

        Menu.add_item("main", MenuItem("My item",
                                       reverse("myapp.views.myview"),
                                       weight=10))

    Note: You cannot have the same URL in a MenuItem in different
    Menus, but it is not enforced. If you do submenus will not work
    properly.
    """
    items = {}
    sorted = {}
    loaded = False

    @classmethod
    def add_item(c, name, item):
        """
        add_item adds MenuItems to the menu identified by 'name'
        """
        if isinstance(item, MenuItem):
            if name not in c.items:
                c.items[name] = []
            c.items[name].append(item)
            c.sorted[name] = False

    @classmethod
    def load_menus(c):
        """
        load_menus loops through INSTALLED_APPS and loads the menu.py
        files from them.
        """

        # we don't need to do this more than once
        if c.loaded == True:
            return

        # loop through our INSTALLED_APPS
        for app in settings.INSTALLED_APPS:
            # skip any django apps
            if re.match("django", app):
                continue

            menu_module = '%s.menus' % app
            try:
                __import__(menu_module, fromlist=["menu",])
            except ImportError:
                pass

        c.loaded = True

    @classmethod
    def sort_menus(c):
        """
        sort_menus goes through the items and sorts them based on
        their weight
        """
        for name in c.items:
            if c.sorted[name] != True:
                c.items[name].sort(cmp=lambda x,y: cmp(x.weight, y.weight))
                c.sorted[name] = True

    @classmethod
    def process(c, request, name=None):
        """
        process uses the current request to determine which menus
        should be visible, which are selected, etc.
        """
        # make sure we're loaded & sorted
        c.load_menus()
        c.sort_menus()

        if name is None:
            # special case, process all menus
            items = {}
            for name in c.items:
                items[name] = c.process(request, name)
            return items

        if name not in c.items:
            return []

        curitem = None
        for item in c.items[name]:
            item.process(request)
            if item.visible == True:
                item.selected = False
                if item.match_url(request):
                    if curitem is None or len(curitem.url) < len(item.url):
                        curitem = item

        if curitem is not None:
            curitem.selected = True

        # return only visible items
        visible = [
            item
            for item in c.items[name]
            if item.visible
        ]

        # determine if we should apply 'selected' to parents when one of their
        # children is the 'selected' menu
        if getattr(settings, 'MENU_SELECT_PARENTS', False):
            def is_child_selected(item):
                for child in item.children:
                    if child.selected or is_child_selected(child):
                        return True

            for item in visible:
                if is_child_selected(item):
                    item.selected = True

        return visible

class MenuItem(object):
    """
    MenuItem represents an item in a menu, possibly one that has a sub-
    menu (children).
    """

    def __init__(self, title, url, children=[], weight=1, check=None,
                 visible=True, slug=None, exact_url=False, **kwargs):
        """
        MenuItem constructor

        title       either a string or a callable to be used for the title
        url         the url of the item
        children    an array of MenuItems that are sub menus to this item
                    this can also be a callable that generates an array
        weight      used to sort adjacent MenuItems
        check       a callable to determine if this item is visible
        slug        used to generate id's in the HTML, auto generated from
                    the title if left as None
        exact_url   normally we check if the url matches the request prefix
                    this requires an exact match if set

        All other keyword arguments passed into the MenuItem constructor are
        assigned to the MenuItem object as attributes so that they may be used
        in your templates. This allows you to attach arbitrary data and use it
        in which ever way suits your menus the best.
        """

        self.url = url
        self.title = title
        self._title = None
        self.visible = visible
        self.children = children
        self.children_sorted = False
        self.weight = weight
        self.check = check
        self.slug = slug
        self.exact_url = exact_url
        self.selected = False
        self.parent = None

        # merge our kwargs into our self
        for k in kwargs:
            setattr(self, k, kwargs[k])

        # if title is a callable store a reference to it for later
        # then we'll process it at runtime
        if callable(title):
            self.title = ""
            self._title = title

    def process(self, request):
        """
        process determines if this item should visible, if its selected, etc...
        """
        self.check_check(request)
        if not self.visible:
            return

        self.check_title(request)
        self.check_children(request)

        children = [
            kid
            for kid in self.children
            if kid.visible
        ]

        curitem = None
        for item in children:
            item.process(request)
            item.selected = False

            if item.match_url(request):
                if curitem is None or len(curitem.url) < len(item.url):
                    curitem = item

        if curitem is not None:
            curitem.selected = True

    def match_url(self, request):
        """
        match url determines if this is selected
        """
        matched = False
        if self.exact_url:
            if re.match("%s$" % (self.url,), request.path):
                matched = True
        elif re.match("%s" % self.url, request.path):
            matched = True
        return matched

    def check_children(self, request):
        if hasattr(self, '_children'):
            self.children = self._children(request)
        if callable(self.children):
            kids = self.children(request)
            self._children = self.children
            self.children = kids

        for kid in self.children:
            kid.parent = self

    def check_check(self, request):
        if callable(self.check):
            check = self.check(request)
            if check != True:
                self.visible = False
            else:
                self.visible = True

    def check_title(self, request):
        if callable(self._title):
            self.title = self._title(request)
        if self.slug is None:
            self.slug = re.sub(r'[^a-zA-Z0-9\-]+', '_', self.title.lower()).strip('_')


text:
from PyObjCTools.TestSupport import *
from AppKit import *

class TestNSSearchFieldCell (TestCase):
    def testConstants(self):
        self.assertEqual(NSSearchFieldRecentsTitleMenuItemTag, 1000)
        self.assertEqual(NSSearchFieldRecentsMenuItemTag, 1001)
        self.assertEqual(NSSearchFieldClearRecentsMenuItemTag, 1002)
        self.assertEqual(NSSearchFieldNoRecentsMenuItemTag, 1003)

    def testMethods(self):
        self.assertResultIsBOOL(NSSearchFieldCell.sendsWholeSearchString)
        self.assertArgIsBOOL(NSSearchFieldCell.setSendsWholeSearchString_, 0)
        self.assertResultIsBOOL(NSSearchFieldCell.sendsSearchStringImmediately)
        self.assertArgIsBOOL(NSSearchFieldCell.setSendsSearchStringImmediately_, 0)

if __name__ == "__main__":
    main()


text:
package com.booking.spark

import java.io.File
import com.typesafe.config.{ConfigFactory, Config, ConfigRenderOptions, ConfigException}
import scala.collection.JavaConversions._
import org.apache.log4j.{Level, Logger}

class Settings() {
  private val logger = Logger.getLogger(this.getClass())
  logger.setLevel(Level.DEBUG)

  private val config: Config = ConfigFactory.load()

  private def formatConfig(config: Config): String = config.root().render(ConfigRenderOptions.concise().setFormatted(true))

  def getSchema(): SnapshotterSchema = {
    try {
      config.checkValid(ConfigFactory.defaultReference().getConfig("HBaseSnapshotter.MySQLSchema"))
      logger.info(s"Detected valid $MySQLSchema")
      MySQLSchema
    } catch {
      case e: ConfigException => {
        try
        {
          config.checkValid(ConfigFactory.defaultReference().getConfig("HBaseSnapshotter.HBaseSchema"))
          logger.info(s"Detected valid $HBaseSchema")
          HBaseSchema
        }
        catch {
          case e: ConfigException => {
            logger.error(
              s"""Bad config. Your application.json:
                  |${formatConfig(config)}
                  |HBaseSchema format:
                  |${formatConfig(ConfigFactory.defaultReference().getConfig("HBaseSnapshotter.HBaseSchema"))}
                  |MySQLSchema format:
                  |${formatConfig(ConfigFactory.defaultReference().getConfig("HBaseSnapshotter.MySQLSchema"))}
                  |$e
              """.stripMargin)
            System.exit(1)
            HBaseSchema
          }
        }
      }
    }
  }

  val schemaType: SnapshotterSchema = getSchema()
  def mysqlTable(): String = config.getString("mysql.table")
  def mysqlSchema(): String = config.getString("mysql.schema")
  def hbaseTimestamp(): Long = config.getLong("hbase.timestamp")
  def hbaseZookeperQuorum(): String = config.getStringList("hbase.zookeeper_quorum").toList.mkString(",")
  def hbaseSchema(): List[String]  = config.getStringList("hbase.schema").toList
  def hbaseTable(): String = config.getString("hbase.table")
  def hiveTable(): String = config.getString("hive.table")
}


text:
<?php

function smtp_send($to, $title, $text)
{
  include('PHPMailer/class.phpmailer.php');
  include('PHPMailer/class.smtp.php');
  $mail = new PHPMailer;
  $mail->CharSet = 'UTF-8';

  //$mail->SMTPDebug = 3;                               // Enable verbose debug output

  $mail->isSMTP();                                      // Set mailer to use SMTP
  $mail->Host = 'smtp.mail.ru';  // Specify main and backup SMTP servers
  $mail->SMTPAuth = true;                               // Enable SMTP authentication
  $mail->Username = 'email';                 // SMTP username
  $mail->Password = 'qwerty';   // SMTP password
  $mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted
  $mail->Port = 587;                                    // TCP port to connect to

  $mail->From = 'email';
  $mail->FromName = 'Name Surname';
  //$mail->addAddress('nurettin@a.com', 'a');     // Add a recipient
  $mail->addAddress($to);               // Name is optional
  $mail->addReplyTo('email', 'Name Surname');

  $mail->isHTML(true);                                  // Set email format to HTML

  $mail->Subject = $title;
  $mail->Body    = $text;
  //$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

  if(!$mail->send()) {
      echo 'Message could not be sent.';
      echo 'Mailer Error: ' . $mail->ErrorInfo;
  } else {
      echo 'Message has been sent';
  }
}

function render_template($tmpl)
{
  if ($tmpl != 'default')
  {
    $str = file_get_contents($tmpl);
    $obj = json_decode($str, true);
    if (!isset($obj['template']))
      die("Шаблон поврежден. Неудается прочитать");
    $overload = str_replace(["\r", "\n"], "\n", $obj['template']);

    global $title;
    $title = $obj['title'];
  }

  ob_start();
  include('template.php');
  $rendered = ob_get_contents();
  ob_end_clean();

  return $rendered;
}

$html = render_template($_GET['template']);
if (!isset($title))
  $title = "Посмотрите правде в глаза – ваше производство скоро вымрет.";
smtp_send($_GET['to'], $title, $html);