text:
package AXIChisel

import Chisel._
import Literal._
import Node._
import AXILiteDefs._

// a simple read-only register block AXI lite slave example
// returns a constant value for all addresses
// TODO reading causes processor to freeze - what can be wrong?

class ConstRegBlock(addrBits: Int, dataBits: Int) extends Module {
  val io = new AXILiteSlaveIF(addrBits, dataBits)

  io.renameSignals()

  // as this is a read-only block, write response logic and such is constant
  // -- we do acknowledge writes and don't signal any errors, but writes have
  // simply no effect
  io.writeAddr.ready  := Bool(true)
  io.writeData.ready  := Bool(true)
  io.writeResp.bits   := UInt(0)
  io.writeResp.valid  := Bool(true)

  io.readAddr.ready := Bool(true)

  // loopback request address as data
  //io.readData.bits.data   := Reg(next = io.readAddr.bits.addr)
  io.readData.bits.data   := UInt(0xdeadbeef)
  io.readData.valid       := Bool(true)

  // read response always returns OK in our case
  io.readData.bits.resp   := UInt(0)
}


text:
// Copyright (C) 2013 the original author or authors.
//
// See the LICENSE.txt file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// This code is taken from https://github.com/jcommon/process that are
// licensed under Apache 2.0 License

package nanomsg.async.impl.epoll;

import com.sun.jna.Union;
import com.sun.jna.Pointer;
import com.sun.jna.ptr.PointerByReference;
import com.sun.jna.Memory;
import com.sun.jna.Structure;
import com.sun.jna.Native;

import java.util.Arrays;
import java.util.List;

public class Epoll {
    private static final String LIB = "c";

    static {
        Native.register(LIB);
    }

    public static final int
        EPOLL_CTL_ADD = 1
      , EPOLL_CTL_DEL = 2
      , EPOLL_CTL_MOD = 3
    ;

    // /usr/include/x86_64-linux-gnu/bits/epoll.h
    public static final int
        EPOLL_CLOEXEC  = 02000000
    ;

    public static int
        EPOLLIN      = (int)0x001
      , EPOLLPRI     = (int)0x002
      , EPOLLOUT     = (int)0x004
      , EPOLLRDNORM  = (int)0x040
      , EPOLLRDBAND  = (int)0x080
      , EPOLLWRNORM  = (int)0x100
      , EPOLLWRBAND  = (int)0x200
      , EPOLLMSG     = (int)0x400
      , EPOLLERR     = (int)0x008
      , EPOLLHUP     = (int)0x010
      , EPOLLRDHUP   = (int)0x2000
      , EPOLLWAKEUP  = (int)(1 << 29)
      , EPOLLONESHOT = (int)(1 << 30)
      , EPOLLET      = (int)(1 << 31)
    ;

    public static class EpollData extends Union {
        public Pointer ptr;
        public int fd;
        public int u32;
        public long u64;

        public EpollData() {
            super();
        }

        public EpollData(int fd_or_u32) {
            super();
            this.u32 = this.fd = fd_or_u32;
            setType(Integer.TYPE);
        }

        public EpollData(long u64) {
            super();
            this.u64 = u64;
            setType(Long.TYPE);
        }

        public EpollData(Pointer ptr) {
            super();
            this.ptr = ptr;
            setType(Pointer.class);
        }

        public static class ByReference extends EpollData implements Structure.ByReference {}
        public static class ByValue extends EpollData implements Structure.ByValue {}
    }

    /*
        struct EpollEvent
        {
          uint32_t events;	//Epoll events
          EpollData data;	//User data variable
        } __EPOLL_PACKED;
    */
    public static class EpollEvent extends Structure {
        public int events;        //Epoll events
        public EpollData data; //User data variable

        protected List getFieldOrder() {
            return Arrays.asList("events", "data");
        }

        public EpollEvent() {
            super(Structure.ALIGN_NONE);
        }

        public EpollEvent(Pointer p) {
            super(p, Structure.ALIGN_NONE);
            setAlignType(Structure.ALIGN_NONE);
            read();
        }

        public EpollEvent(int events, EpollData data) {
            super(Structure.ALIGN_NONE);
            this.events = events;
            this.data = data;
        }

        public void reuse(Pointer p, int offset) {
            useMemory(p, offset);
            read();
        }

        public static class ByReference extends EpollEvent implements Structure.ByReference {
            public ByReference() {
                super();
            }

            public ByReference(int fd, int events) {
                super();
                this.events = events;
                data.fd = fd;
                data.setType(Integer.TYPE);
            }

            public ByReference(Pointer ptr, int events) {
                super();
                this.events = events;
                data.ptr = ptr;
                data.setType(Pointer.class);
            }

            public ByReference oneshot() {
                this.events = events | EPOLLONESHOT;
                return this;
            }
        }

        public static class ByValue extends EpollEvent implements Structure.ByValue {}
    }

    //extern int epoll_create (int __size) __THROW;
    public static native int epoll_create(int size);

    //extern int epoll_create1 (int __flags) __THROW;
    public static native int epoll_create1(int flags);

    //extern int epoll_ctl (int __epfd, int __op, int __fd, struct EpollEvent *__event) __THROW;
    public static native int epoll_ctl(int epfd, int op, int fd, EpollEvent.ByReference event);
    public static native int epoll_ctl(int epfd, int op, int fd, Pointer event);

    //extern int epoll_wait (int __epfd, struct EpollEvent *__events, int __maxevents, int __timeout);
    public static native int epoll_wait(int epfd, Pointer events, int maxevents, int timeout);
}

redpajama_set_name: RedPajamaGithub


text:
#!/bin/bash

set -e

# install report generator
nuget install -Verbosity quiet -OutputDirectory ./packages -Version 5.1.10 ReportGenerator

# run all tests
for f in ./test/**/*.csproj; do
dotnet test $f --no-build --collect:"XPlat Code Coverage"
done

# generate report
dotnet ./packages/ReportGenerator.5.1.10/tools/net6.0/ReportGenerator.dll \
    -reports:./test/*/TestResults/*/*.xml \
    -targetdir:./TestReport \
    -historydir:./TestReport/history

# remove all test reports
rm -rf ./test/**/TestResults


text:
'use strict';

describe('Controller: ProjectEditCtrl', function () {

  // load the controller's module
  beforeEach(module('projectHomeGeneratorUiApp'));

  var ProjectEditCtrl,
    scope;

  // Initialize the controller and a mock scope
  beforeEach(inject(function ($controller, $rootScope) {
    scope = $rootScope.$new();
    ProjectEditCtrl = $controller('ProjectEditCtrl', {
      $scope: scope
      // place here mocked dependencies
    });
  }));

  it('should attach a list of awesomeThings to the scope', function () {
    expect(ProjectEditCtrl.awesomeThings.length).toBe(3);
  });
});


text:
package org.lp20.aikuma.audio.record;

/**
 * Interface for anything that handles (saves/processes) audio.
 *
 * @author	Oliver Adams	<oliver.adams@gmail.com>
 * @author	Florian Hanke	<florian.hanke@gmail.com>
 */
public interface AudioHandler {

	/**
	 * The caller has detected non-silent audio.
	 *
	 * @param buffer An array of samples.
	 * @param justChanged Whether the caller has just changed
	 *        from silence to audio.
	 */
	public void audioTriggered(short[] buffer, boolean justChanged);

	/**
	 * The caller has detected silent audio.
	 *
	 * @param buffer An array of samples.
	 * @param justChanged Whether the caller has just changed
	 *        from audio to silence.
	 */
	public void silenceTriggered(short[] buffer, boolean justChanged);
}


text:
ACCEPTED

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

#### Published in
Mycologia 21(5): 244 (1929)

#### Original name
null

### Remarks
null


text:
package com.google.android.libraries.remixer;

/**
 * The base class for all variable builders
 * @param <V> The type of variable this builder builds.
 * @param <T> The type of data stored in the variable.
 */
public abstract class BaseVariableBuilder<V, T> {
  protected T initialValue;
  protected String key;
  protected String title;
  protected Object context;
  protected int layoutId = 0;
  protected Callback<T> callback;
  protected DataType dataType;

  public BaseVariableBuilder<V, T> setKey(String key) {
    this.key = key;
    return this;
  }

  public BaseVariableBuilder<V, T> setTitle(String title) {
    this.title = title;
    return this;
  }

  public BaseVariableBuilder<V, T> setLayoutId(int layoutId) {
    this.layoutId = layoutId;
    return this;
  }

  public BaseVariableBuilder<V, T> setContext(Object context) {
    this.context = context;
    return this;
  }

  public BaseVariableBuilder<V, T> setCallback(Callback<T> callback) {
    this.callback = callback;
    return this;
  }

  public BaseVariableBuilder<V, T> setDataType(DataType dataType) {
    this.dataType = dataType;
    return this;
  }

  public BaseVariableBuilder<V, T> setInitialValue(T initialValue) {
    this.initialValue = initialValue;
    return this;
  }

  protected void checkBaseFields() {
    if (key == null) {
      throw new IllegalArgumentException("key cannot be unset");
    }
    if (context == null) {
      throw new IllegalArgumentException("context cannot be unset");
    }
    if (dataType == null) {
      throw new IllegalArgumentException("dataType cannot be unset");
    }
    if (title == null) {
      title = key;
    }
  }

  /**
   * Returns the built Variable. Implementors must call {@link #checkBaseFields()}.
   * @throws IllegalArgumentException if the minimally required fields were not set or their
   *     configuration is invalid.
   */
  public abstract V build();
}


text:
using System.Collections.Generic;
using Azure.Core;

namespace Azure.ResourceManager.EventHubs.Models
{
    /// <summary> Properties to configure Encryption. </summary>
    public partial class EventHubsEncryption
    {
        /// <summary> Initializes a new instance of EventHubsEncryption. </summary>
        public EventHubsEncryption()
        {
            KeyVaultProperties = new ChangeTrackingList<EventHubsKeyVaultProperties>();
        }

        /// <summary> Initializes a new instance of EventHubsEncryption. </summary>
        /// <param name="keyVaultProperties"> Properties of KeyVault. </param>
        /// <param name="keySource"> Enumerates the possible value of keySource for Encryption. </param>
        /// <param name="requireInfrastructureEncryption"> Enable Infrastructure Encryption (Double Encryption). </param>
        internal EventHubsEncryption(IList<EventHubsKeyVaultProperties> keyVaultProperties, EventHubsKeySource? keySource, bool? requireInfrastructureEncryption)
        {
            KeyVaultProperties = keyVaultProperties;
            KeySource = keySource;
            RequireInfrastructureEncryption = requireInfrastructureEncryption;
        }

        /// <summary> Properties of KeyVault. </summary>
        public IList<EventHubsKeyVaultProperties> KeyVaultProperties { get; }
        /// <summary> Enumerates the possible value of keySource for Encryption. </summary>
        public EventHubsKeySource? KeySource { get; set; }
        /// <summary> Enable Infrastructure Encryption (Double Encryption). </summary>
        public bool? RequireInfrastructureEncryption { get; set; }
    }
}


text:
Note: Artifactory credentials will be required for upcoming changes to the app, which will take advantage of the next-generation SDK.

Sample Android app featuring implementations of GPShopper SDK modules


text:
module.exports = {
  context: {
    closeIcon: 'close',
    text: 'Subscribe and get 10$ for Shopping!',
    class: 'marketing-bar--closed',
    attributes: 'data-type="marketing-bar"',
    closeButton: {
      tag: 'button',
      text: '',
      class: 'button--icon marketing-bar__close',
      icon: {
        id: 'close',
        title: 'Close',
        class: 'marketing-bar__close-icon'
      },
      attributes: 'type="button" aria-label="Close marketing bar"',
    },
  },
};


text:
package org.springframework.web.servlet.support;

import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;

import org.junit.Before;
import org.junit.Test;

import org.springframework.mock.web.test.MockServletContext;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.StaticWebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;

import static org.junit.Assert.*;

/**
 * Test case for {@link AbstractDispatcherServletInitializer}.
 *
 * @author Arjen Poutsma
 */
public class DispatcherServletInitializerTests {

	private static final String SERVLET_NAME = "myservlet";

	private static final String ROLE_NAME = "role";

	private static final String SERVLET_MAPPING = "/myservlet";

	private AbstractDispatcherServletInitializer initializer;

	private MockServletContext servletContext;

	private Map<String, Servlet> servlets;

	private Map<String, MockServletRegistration> registrations;

	@Before
	public void setUp() throws Exception {
		servletContext = new MyMockServletContext();
		initializer = new MyDispatcherServletInitializer();
		servlets = new LinkedHashMap<String, Servlet>(2);
		registrations = new LinkedHashMap<String, MockServletRegistration>(2);
	}

	@Test
	public void register() throws ServletException {
		initializer.onStartup(servletContext);

		assertEquals(1, servlets.size());
		assertNotNull(servlets.get(SERVLET_NAME));

		DispatcherServlet servlet = (DispatcherServlet) servlets.get(SERVLET_NAME);
		WebApplicationContext servletContext = servlet.getWebApplicationContext();

		assertTrue(servletContext.containsBean("bean"));
		assertTrue(servletContext.getBean("bean") instanceof MyBean);

		assertEquals(1, registrations.size());
		assertNotNull(registrations.get(SERVLET_NAME));

		MockServletRegistration registration = registrations.get(SERVLET_NAME);
		assertEquals(Collections.singleton(SERVLET_MAPPING), registration.getMappings());
		assertEquals(1, registration.getLoadOnStartup());
		assertEquals(ROLE_NAME, registration.getRunAsRole());
	}

	private class MyMockServletContext extends MockServletContext {

		@Override
		public ServletRegistration.Dynamic addServlet(String servletName,
													  Servlet servlet) {
			servlets.put(servletName, servlet);
			MockServletRegistration registration = new MockServletRegistration();
			registrations.put(servletName, registration);
			return registration;
		}
	}

	private static class MyDispatcherServletInitializer
			extends AbstractDispatcherServletInitializer {

		@Override
		protected String getServletName() {
			return SERVLET_NAME;
		}

		@Override
		protected WebApplicationContext createServletApplicationContext() {
			StaticWebApplicationContext servletContext =
					new StaticWebApplicationContext();
			servletContext.registerSingleton("bean", MyBean.class);
			return servletContext;
		}

		@Override
		protected String[] getServletMappings() {
			return new String[]{"/myservlet"};
		}

		@Override
		protected void customizeRegistration(ServletRegistration.Dynamic registration) {
			registration.setRunAsRole("role");
		}

		@Override
		protected WebApplicationContext createRootApplicationContext() {
			return null;
		}
	}

	private static class MyBean {

	}

}


text:
namespace Bazooka.Core
{
    using System;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using System.Globalization;
    using System.Management.Automation;
    using System.Management.Automation.Host;
    using System.Security;
    using System.Text;

    /// <summary>
    ///     Fake host user inteface for powershell host
    /// </summary>
    class HostUserInterface : PSHostUserInterface, IHostUISupportsMultipleChoiceSelection
    {
        private PSHostRawUserInterface _psRawUserInterface = new HostRawUserInterface();

        public override PSHostRawUserInterface RawUI
        {
            get { return _psRawUserInterface; }
        }

        public override string ReadLine()
        {
            return Console.ReadLine();
        }

        public override SecureString ReadLineAsSecureString()
        {
            throw new NotImplementedException();
        }

        public override void Write(string value)
        {
            string output = value ?? "null";
            Console.Write(output);
        }

        public override void Write(ConsoleColor foregroundColor, ConsoleColor backgroundColor, string value)
        {
            string output = value ?? "null";
            var origFgColor = Console.ForegroundColor;
            var origBgColor = Console.BackgroundColor;
            Console.ForegroundColor = foregroundColor;
            Console.BackgroundColor = backgroundColor;
            Console.Write(output);
            Console.ForegroundColor = origFgColor;
            Console.BackgroundColor = origBgColor;
        }

        public override void WriteLine(string value)
        {
            string output = value ?? "null";
            Console.WriteLine(output);
        }

        public override void WriteErrorLine(string value)
        {
            string output = value ?? "null";
            var origFgColor = Console.ForegroundColor;
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine(output);
            Console.ForegroundColor = origFgColor;
        }

        public override void WriteDebugLine(string message)
        {
            WriteYellowAnnotatedLine(message, "DEBUG");
        }

        public override void WriteVerboseLine(string message)
        {
            WriteYellowAnnotatedLine(message, "VERBOSE");
        }

        public override void WriteWarningLine(string message)
        {
            WriteYellowAnnotatedLine(message, "WARNING");
        }

        private void WriteYellowAnnotatedLine(string message, string annotation)
        {
            string output = message ?? "null";
            var origFgColor = Console.ForegroundColor;
            var origBgColor = Console.BackgroundColor;
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.BackgroundColor = ConsoleColor.Black;
            WriteLine(String.Format(CultureInfo.CurrentCulture, "{0}: {1}", annotation, output));
            Console.ForegroundColor = origFgColor;
            Console.BackgroundColor = origBgColor;
        }

        public override void WriteProgress(long sourceId, ProgressRecord record)
        {
            throw new NotImplementedException();
        }

        public override Dictionary<string, PSObject> Prompt(string caption, string message, Collection<FieldDescription> descriptions)
        {
            if (String.IsNullOrEmpty(caption) && String.IsNullOrEmpty(message) && descriptions.Count > 0)
            {
                Console.Write(descriptions[0].Name + ": ");
            }
            else
            {
                this.Write(ConsoleColor.DarkCyan, ConsoleColor.Black, caption + "\n" + message + " ");
            }
            var results = new Dictionary<string, PSObject>();
            foreach (FieldDescription fd in descriptions)
            {
                string[] label = GetHotkeyAndLabel(fd.Label);
                this.WriteLine(label[1]);
                string userData = Console.ReadLine();
                if (userData == null)
                {
                    return null;
                }

                results[fd.Name] = PSObject.AsPSObject(userData);
            }

            return results;
        }

        public override PSCredential PromptForCredential(string caption, string message, string userName, string targetName)
        {
            throw new NotImplementedException();
        }

        public override PSCredential PromptForCredential(string caption, string message, string userName, string targetName, PSCredentialTypes allowedCredentialTypes, PSCredentialUIOptions options)
        {
            throw new NotImplementedException();
        }

        public override int PromptForChoice(string caption, string message, Collection<ChoiceDescription> choices, int defaultChoice)
        {
            // Write the caption and message strings in Blue.
            this.WriteLine(ConsoleColor.Blue, ConsoleColor.Black, caption + "\n" + message + "\n");

            // Convert the choice collection into something that is
            // easier to work with. See the BuildHotkeysAndPlainLabels
            // method for details.
            string[,] promptData = BuildHotkeysAndPlainLabels(choices);

            // Format the overall choice prompt string to display.
            var sb = new StringBuilder();
            for (int element = 0; element < choices.Count; element++)
            {
                sb.Append(String.Format(CultureInfo.CurrentCulture, "|{0}> {1} ", promptData[0, element], promptData[1, element]));
            }

            sb.Append(String.Format(CultureInfo.CurrentCulture, "[Default is ({0}]", promptData[0, defaultChoice]));

            // Read prompts until a match is made, the default is
            // chosen, or the loop is interrupted with ctrl-C.
            while (true)
            {
                this.WriteLine(sb.ToString());
                string data = Console.ReadLine().Trim().ToUpper(CultureInfo.CurrentCulture);

                // If the choice string was empty, use the default selection.
                if (data.Length == 0)
                {
                    return defaultChoice;
                }

                // See if the selection matched and return the
                // corresponding index if it did.
                for (int i = 0; i < choices.Count; i++)
                {
                    if (promptData[0, i] == data)
                    {
                        return i;
                    }
                }

                this.WriteErrorLine("Invalid choice: " + data);
            }
        }

        #region IHostUISupportsMultipleChoiceSelection Members

        public Collection<int> PromptForChoice(string caption, string message, Collection<ChoiceDescription> choices, IEnumerable<int> defaultChoices)
        {
            this.WriteLine(ConsoleColor.Blue, ConsoleColor.Black, caption + "\n" + message + "\n");

            string[,] promptData = BuildHotkeysAndPlainLabels(choices);

            var sb = new StringBuilder();
            for (int element = 0; element < choices.Count; element++)
            {
                sb.Append(String.Format(CultureInfo.CurrentCulture, "|{0}> {1} ", promptData[0, element], promptData[1, element]));
            }

            var defaultResults = new Collection<int>();
            if (defaultChoices != null)
            {
                int countDefaults = 0;
                foreach (int defaultChoice in defaultChoices)
                {
                    ++countDefaults;
                    defaultResults.Add(defaultChoice);
                }

                if (countDefaults != 0)
                {
                    sb.Append(countDefaults == 1 ? "[Default choice is " : "[Default choices are ");
                    foreach (int defaultChoice in defaultChoices)
                    {
                        sb.AppendFormat(CultureInfo.CurrentCulture, "\"{0}\",", promptData[0, defaultChoice]);
                    }
                    sb.Remove(sb.Length - 1, 1);
                    sb.Append("]");
                }
            }

            this.WriteLine(ConsoleColor.Cyan, ConsoleColor.Black, sb.ToString());

            var results = new Collection<int>();
            while (true)
            {
                ReadNext:
                string prompt = string.Format(CultureInfo.CurrentCulture, "Choice[{0}]:", results.Count);
                this.Write(ConsoleColor.Cyan, ConsoleColor.Black, prompt);
                string data = Console.ReadLine().Trim().ToUpper(CultureInfo.CurrentCulture);

                if (data.Length == 0)
                {
                    return (results.Count == 0) ? defaultResults : results;
                }

                for (int i = 0; i < choices.Count; i++)
                {
                    if (promptData[0, i] == data)
                    {
                        results.Add(i);
                        goto ReadNext;
                    }
                }

                this.WriteErrorLine("Invalid choice: " + data);
            }
        }

        #endregion

        private static string[,] BuildHotkeysAndPlainLabels(Collection<ChoiceDescription> choices)
        {
            // Allocate the result array
            string[,] hotkeysAndPlainLabels = new string[2, choices.Count];

            for (int i = 0; i < choices.Count; ++i)
            {
                string[] hotkeyAndLabel = GetHotkeyAndLabel(choices[i].Label);
                hotkeysAndPlainLabels[0, i] = hotkeyAndLabel[0];
                hotkeysAndPlainLabels[1, i] = hotkeyAndLabel[1];
            }

            return hotkeysAndPlainLabels;
        }

        private static string[] GetHotkeyAndLabel(string input)
        {
            string[] result = new string[] { String.Empty, String.Empty };
            string[] fragments = input.Split('&');
            if (fragments.Length == 2)
            {
                if (fragments[1].Length > 0)
                {
                    result[0] = fragments[1][0].ToString().
                    ToUpper(CultureInfo.CurrentCulture);
                }

                result[1] = (fragments[0] + fragments[1]).Trim();
            }
            else
            {
                result[1] = input;
            }

            return result;
        }
    }
}


text:
require "bridge"
require_relative "../lib/bbo2bridge"
require_relative "../lib/brist"
require_relative "../lib/helpers"

ENV["BRIST_HOST"] ||= "http://localhost:9292"


text:
using namespace std;
using namespace BaseSimulator;

ConfigStat::ConfigStat(BaseSimulator::World *w) {
	diameter = 0;
	radius = 0;
	size = 0;
	world = w;
	distanceMatrix = NULL;
	eccentricity = NULL;
	closenessCentrality = NULL;
	betweennessCentrality = NULL;
	compute();
}

void ConfigStat::deleteComputation() {
	delete[] eccentricity; eccentricity = NULL;
	delete[] closenessCentrality; closenessCentrality = NULL;
	delete[] betweennessCentrality; betweennessCentrality = NULL;
	delete distanceMatrix; distanceMatrix = NULL;
	center.clear();
	centroid.clear();
	betweennessCenter.clear();
	diameter = 0;
	radius = 0;
}

void ConfigStat::initComputation() {
	size = world->getMap().size()+1;
	distanceMatrix = new SquareMatrix(size);
	eccentricity = new int[size];
	closenessCentrality = new int[size];
	betweennessCentrality = new int[size];
}

ConfigStat::~ConfigStat() {
	deleteComputation();
}

int ConfigStat::getDiameter() {
	return diameter;
}

int ConfigStat::getRadius() {
	return radius;
}

list<BaseSimulator::BuildingBlock*>& ConfigStat::getCenter() {
	return center;
}

list<BaseSimulator::BuildingBlock*>& ConfigStat::getCentroid() {
	return centroid;
}

list<BaseSimulator::BuildingBlock*>& ConfigStat::getBetweennessCenter() {
	return betweennessCenter;
}

void ConfigStat::compute() {

	deleteComputation();
	initComputation();

	computeDistanceMatrix();
	computeCenter();
	computeCentroid();
	computeBetweennessCenter();
}

void ConfigStat::computeDistanceMatrix() {
	int size = distanceMatrix->getSize();
	bool adjacencyMatrix[size][size];
	int distTmp;

	for (int i = 0; i < size; i++) {
		for (int j = 0; j < size; j++) {
			adjacencyMatrix[i][j] = false;
			distanceMatrix->set(i, j, INT_MAX);
		}
	}

	map<bID, BuildingBlock*>::iterator bit;
	for (bit = world->getMap().begin() ; bit != world->getMap().end() ; bit++) {
		vector<P2PNetworkInterface*>::iterator niit;
		for (niit = bit->second->getP2PNetworkInterfaces().begin(); niit != bit->second->getP2PNetworkInterfaces().end(); niit++) {
			if ((*niit)->connectedInterface) {
				adjacencyMatrix[bit->second->blockId][(*niit)->connectedInterface->hostBlock->blockId] = true;
			}
		}
	}

	bool changed = false;
	for (int s = 1; s < size; s++) {
		distanceMatrix->set(s,s,0);
		for (int i = 1; i < size; i++ ) {
			changed = false;
			for (int u = 1; u < size; u++ ) {
				for (int v = 1; v < size; v++) {
					if (adjacencyMatrix[u][v]) {
						//if (distance[s][v] != UINT_MAX) {
						if (distanceMatrix->get(s,u) != INT_MAX) {
							//distTmp = distance[s][u] + 1;
							distTmp = distanceMatrix->get(s,u) + 1;
							//if (distTmp < distance[s][v]) {
							//cout << "distTmp" <<
							if (distTmp < distanceMatrix->get(s,v)) {
								//cout << "set: " << s << "," << v << ": " << v << endl;
								distanceMatrix->set(s,v,distTmp);
								distanceMatrix->set(v,s,distTmp);
								changed = true;
								//distance[s][v] = distTmp;
							}
						}
					}
				}
			}
			if(!changed) break;
		}
	}
}

void ConfigStat::computeCenter() {
	radius = INT_MAX;
	diameter = 0;

	for (int i = 1; i < size; i++) {
		eccentricity[i] = 0;
		for (int j = 1; j < size; j++) {
			eccentricity[i] = max(eccentricity[i],distanceMatrix->get(i,j));
		}
		radius = min(radius, eccentricity[i]);
		diameter = max(diameter, eccentricity[i]);
	}

	for (int i = 1; i < size; i++) {
		if (eccentricity[i] == radius) {
			center.push_back(world->getBlockById(i));
		}
	}
}

void ConfigStat::computeCentroid() {
	int minSum = INT_MAX;
	int maxSum = 0;

	for (int i = 1; i < size; i++) {
		closenessCentrality[i] = 0;
		for (int j = 1; j < size; j++) {
			closenessCentrality[i] += distanceMatrix->get(i,j);
		}
		minSum = min(closenessCentrality[i], minSum);
		maxSum = max(closenessCentrality[i], maxSum);
	}

	for (int i = 1; i < size; i++) {
		if (closenessCentrality[i] == minSum) {
			centroid.push_back(world->getBlockById(i));
		}
	}

	(void) maxSum;
}

void ConfigStat::computeBetweennessCenter() {
	// TODO
}

void ConfigStat::print(string name, list<BaseSimulator::BuildingBlock*>& l) {
	cout << name <<":";
	for (list<BaseSimulator::BuildingBlock*>::iterator it=l.begin(); it != l.end(); it++) {
		cout << ' ' << (*it)->blockId << "(eccentricity:" << eccentricity[(*it)->blockId]<< ", closeness centrality:" <<  closenessCentrality[(*it)->blockId] << ")";
    }
	cout << endl;
}

void ConfigStat::print() {
	cout << "Diameter: " << diameter << "," << "radius: " << radius << endl;
	print("Center", center);
	print("Centroid", centroid);
	print("Betweenness", betweennessCenter);
}


text:
require 'spec_helper'

describe Parser do

  it "expects true to be true" do
    expect(true).to eql true
  end
end


text:
function loadData(params, action, container, type_insert)
{
	loadAsync(params, action, container, type_insert);
}

function loadAsync (params, action, container, type_insert)
	{

		$.ajax({
			  type: "GET",
			  url: "/springmvc/"+action,
			  data: params,
			  success: function(data){
				  if(container.length > 1)
				    $(container).html(data);
				  }
			});
	}

function loadAsyncPost (params, action, container, type_insert)
{

	$.ajax({
		  type: "POST",
		  url: "./"+action,
		  data: params,
		  mimeType:"text/html; charset=UTF-8",
		  success: function(data){
			  //alert('PDF created succesful');
			  }, error: function (xhr, ajaxOptions, thrownError) {
			        alert(xhr.status);
			        alert(ajaxOptions);
			      }
		});
}

function loadAsyncPDF (params, action, filename)
{

	$.ajax({
		  type: "GET",
		  url: "/springmvc/"+action,
		  success: function(data){
			  loadAsyncPost({pdf: data}, params);
		  }
		});
}

$(document).ready(function(){

	$('body').on('click', '#printHumans', function(){

		loadAsyncPDF('printCustomerList', 'getHumans');

	});

	$('body').on('click', '#printExcel', function(){

		loadAsync('', 'printExcel');
		//alert('Excel file created succesfuly.');

	});

	$('body').on('click', '#printJasper', function(){

		loadAsync('', 'printJasper');

	})

	$('body').on('click','#getList', function()
	        {
		loadData('', 'list', '.body');
	        });

	$('body').on('click','.registration', function()
	    {
				$('.login-block').toggle();
				$('.reg-block').show();
	    });

	$('body').on('click','.pagination li a.human', function(){
		var page = $(this).html();
	    loadData({page: page}, 'list', '#customer-list');
	});

	$('body').on('click','.list-actions .edit', function(){
		var elem = $(this).prop("value");
		var modal = $(this).attr("data-target");
		loadData({userID: elem}, 'edit_customer', '#main-modal-insert');
		$(modal).modal('show');
	});

	$('body').on('click','.add-human', function(){
		var modal = $(this).attr("data-target");
		loadData('', 'add_human', '#main-modal-insert');
		$(modal).modal('show');
	});

	$('body').on('click','.add-company', function(){
		var modal = $(this).attr("data-target");
		loadData('', 'add_company', '#main-modal-insert');
		$(modal).modal('show');
	});

	$('body').on('click','.list-actions .edit-company', function(){
		var elem = $(this).prop("value");
		var modal = $(this).attr("data-target");
		loadData({companyID: elem}, 'edit_company', '#main-modal-insert');
		$(modal).modal('show');
	});

	$('body').on('click','.edit-user', function(){
		var elem = $(this).prop("value");
		var modal = $(this).attr("data-target");
		loadData({userID: elem}, 'edit_user', '#main-modal-insert');
		$(modal).modal('show');
	});

	$('body').on('click','#search-list', function(){
		var post = $('#Industry').val();
		loadData({industry: post}, 'search_list', '#list_campaigns');
	});

	$('body').on('click','.add-user', function(){
		var modal = $(this).attr("data-target");
		loadData('', 'add_user', '#main-modal-insert');
		$(modal).modal('show');
	});

	$('body').on('click','.company-list', function(){
		var campaignID = $(this).attr('company-id');
		$('.company-list').removeClass('active');
		$(this).addClass('active');
		loadData({ID: campaignID}, 'search_humans_params', '#searched-data');
	});

	$('body').on('click', '.join-campaign', function(){
		var campaignID = $('.company-list.active').attr('company-id');
		var customerID = $(this).prop('value');
		$(this).addClass('disabled');
		loadData({campaignID: campaignID, customerID: customerID}, 'connect_human_company', '');
	});
});


text:
namespace crashpad {
namespace test {
namespace {

TEST(Handle, HandleToInt) {
  EXPECT_EQ(0, HandleToInt(nullptr));
  EXPECT_EQ(-1, HandleToInt(INVALID_HANDLE_VALUE));
  EXPECT_EQ(1, HandleToInt(reinterpret_cast<HANDLE>(1)));
  EXPECT_EQ(std::numeric_limits<int>::max(),
            HandleToInt(reinterpret_cast<HANDLE>(
                static_cast<intptr_t>(std::numeric_limits<int>::max()))));
  EXPECT_EQ(std::numeric_limits<int>::min(),
            HandleToInt(reinterpret_cast<HANDLE>(
                static_cast<intptr_t>(std::numeric_limits<int>::min()))));
}

TEST(Handle, IntToHandle) {
  EXPECT_EQ(nullptr, IntToHandle(0));
  EXPECT_EQ(INVALID_HANDLE_VALUE, IntToHandle(-1));
  EXPECT_EQ(reinterpret_cast<HANDLE>(1), IntToHandle(1));
  EXPECT_EQ(reinterpret_cast<HANDLE>(
                static_cast<intptr_t>(std::numeric_limits<int>::max())),
            IntToHandle(std::numeric_limits<int>::max()));
  EXPECT_EQ(reinterpret_cast<HANDLE>(
                static_cast<intptr_t>(std::numeric_limits<int>::min())),
            IntToHandle(std::numeric_limits<int>::min()));
}

}  // namespace
}  // namespace test
}  // namespace crashpad


text:
/**
 * Administrative console command-line extensions for interacting with the
 * network model & services.
 */
package org.onosproject.cli.net;


text:
package org.apache.sentry.tests.e2e;

import static org.junit.Assert.assertFalse;

import java.io.File;
import java.io.FileOutputStream;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.google.common.io.Resources;

public class TestPrivilegesAtFunctionScope extends AbstractTestWithStaticLocalFS {
  private Context context;
  private final String SINGLE_TYPE_DATA_FILE_NAME = "kv1.dat";
  private File dataDir;
  private File dataFile;

  @Before
  public void setup() throws Exception {
    context = createContext();
    dataDir = context.getDataDir();
    dataFile = new File(dataDir, SINGLE_TYPE_DATA_FILE_NAME);
    FileOutputStream to = new FileOutputStream(dataFile);
    Resources.copy(Resources.getResource(SINGLE_TYPE_DATA_FILE_NAME), to);
    to.close();
  }

  @After
  public void tearDown() throws Exception {
    if (context != null) {
      context.close();
    }
  }

  /**
   * admin should be able to create/drop temp functions
   * user with db level access should be able to create/drop temp functions
   * user with table level access should be able to create/drop temp functions
   * user with no privilege should NOT be able to create/drop temp functions
   */
  @Test
  public void testFuncPrivileges1() throws Exception {
    String dbName1 = "db_1";
    String tableName1 = "tb_1";
    // edit policy file
    File policyFile = context.getPolicyFile();
    PolicyFileEditor editor = new PolicyFileEditor(policyFile);
    editor.addPolicy("admin = admin", "groups");
    editor.addPolicy("group1 = db1_all,UDF_JAR", "groups");
    editor.addPolicy("group2 = db1_tab1,UDF_JAR", "groups");
    editor.addPolicy("group3 = db1_tab1", "groups");
    editor.addPolicy("admin = server=server1", "roles");
    editor.addPolicy("db1_all = server=server1->db=" + dbName1, "roles");
    editor.addPolicy("db1_tab1 = server=server1->db=" + dbName1 + "->table=" + tableName1, "roles");
    editor.addPolicy("UDF_JAR = server=server1->uri=file://${user.home}/.m2", "roles");
    editor.addPolicy("admin1 = admin", "users");
    editor.addPolicy("user1 = group1", "users");
    editor.addPolicy("user2 = group2", "users");
    editor.addPolicy("user3 = group3", "users");

    Connection connection = context.createConnection("admin1", "foo");
    Statement statement = context.createStatement(connection);
    statement.execute("DROP DATABASE IF EXISTS " + dbName1 + " CASCADE");
    statement.execute("CREATE DATABASE " + dbName1);
    statement.execute("USE " + dbName1);
    statement.execute("DROP TABLE IF EXISTS " + dbName1 + "." + tableName1);
    statement.execute("create table " + dbName1 + "." + tableName1
        + " (under_col int comment 'the under column', value string)");
    statement.execute("LOAD DATA INPATH '" + dataFile.getPath() + "' INTO TABLE "
        + dbName1 + "." + tableName1);
    statement.execute("DROP TEMPORARY FUNCTION IF EXISTS printf_test");
    statement.execute("DROP TEMPORARY FUNCTION IF EXISTS printf_test_2");
    context.close();

    // user1 should be able create/drop temp functions
    connection = context.createConnection("user1", "foo");
    statement = context.createStatement(connection);
    statement.execute("USE " + dbName1);
    statement.execute(
        "CREATE TEMPORARY FUNCTION printf_test AS 'org.apache.hadoop.hive.ql.udf.generic.GenericUDFPrintf'");
    statement.execute("DROP TEMPORARY FUNCTION printf_test");
    context.close();

    // user2 has select privilege on one of the tables in db2, should be able create/drop temp functions
    connection = context.createConnection("user2", "foo");
    statement = context.createStatement(connection);
    statement.execute("USE " + dbName1);
    statement.execute(
        "CREATE TEMPORARY FUNCTION printf_test_2 AS 'org.apache.hadoop.hive.ql.udf.generic.GenericUDFPrintf'");
    statement.execute("DROP TEMPORARY FUNCTION printf_test");
    context.close();

    // user3 shouldn't be able to create/drop temp functions since it doesn't have permission for jar
    connection = context.createConnection("user3", "foo");
    statement = context.createStatement(connection);
    try {
      statement.execute("USE " + dbName1);
      statement.execute(
      "CREATE TEMPORARY FUNCTION printf_test_bad AS 'org.apache.hadoop.hive.ql.udf.generic.GenericUDFPrintf'");
      assertFalse("CREATE TEMPORARY FUNCTION should fail for user3", true);
    } catch (SQLException e) {
      context.verifyAuthzException(e);
    }
    context.close();

    // user4 (not part of any group ) shouldn't be able to create/drop temp functions
    connection = context.createConnection("user4", "foo");
    statement = context.createStatement(connection);
    try {
      statement.execute("USE default");
      statement.execute(
      "CREATE TEMPORARY FUNCTION printf_test_bad AS 'org.apache.hadoop.hive.ql.udf.generic.GenericUDFPrintf'");
      assertFalse("CREATE TEMPORARY FUNCTION should fail for user4", true);
    } catch (SQLException e) {
      context.verifyAuthzException(e);
    }
    context.close();

  }

  @Test
  public void testUdfWhiteList () throws Exception {
    String dbName1 = "db1";
    String tableName1 = "tab1";

    File policyFile = context.getPolicyFile();
    PolicyFileEditor editor = new PolicyFileEditor(policyFile);
    editor.addPolicy("admin = admin", "groups");
    editor.addPolicy("group1 = db1_all,UDF_JAR", "groups");
    editor.addPolicy("group2 = db1_tab1,UDF_JAR", "groups");
    editor.addPolicy("group3 = db1_tab1", "groups");
    editor.addPolicy("admin = server=server1", "roles");
    editor.addPolicy("db1_all = server=server1->db=" + dbName1, "roles");
    editor.addPolicy("db1_tab1 = server=server1->db=" + dbName1 + "->table=" + tableName1, "roles");
    editor.addPolicy("UDF_JAR = server=server1->uri=file://${user.home}/.m2", "roles");
    editor.addPolicy("admin1 = admin", "users");
    editor.addPolicy("user1 = group1", "users");

    Connection connection = context.createConnection("admin1", "password");
    Statement statement = connection.createStatement();
    statement.execute("DROP DATABASE IF EXISTS " + dbName1 + " CASCADE");
    statement.execute("CREATE DATABASE " + dbName1);
    statement.execute("USE " + dbName1);
    statement.execute("create table " + tableName1
        + " (under_col int comment 'the under column', value string)");
    statement.execute("LOAD DATA INPATH '" + dataFile.getPath() + "' INTO TABLE "
        + dbName1 + "." + tableName1);
    statement.execute("SELECT rand(), concat(value, '_foo') FROM " + tableName1);

    context.assertAuthzException(statement,
        "SELECT  reflect('java.net.URLDecoder', 'decode', 'http://www.apache.org', 'utf-8'), value FROM " + tableName1);
    context.assertAuthzException(statement,
        "SELECT  java_method('java.net.URLDecoder', 'decode', 'http://www.apache.org', 'utf-8'), value FROM " + tableName1);
    statement.close();
    connection.close();
  }
}


text:
package io.dropwizard.hibernate;

import com.codahale.metrics.MetricRegistry;
import com.google.common.collect.ImmutableList;
import io.dropwizard.db.DataSourceFactory;
import io.dropwizard.lifecycle.setup.LifecycleEnvironment;
import io.dropwizard.logging.LoggingFactory;
import io.dropwizard.setup.Environment;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.*;

public class SessionFactoryFactoryTest {
    static {
        LoggingFactory.bootstrap();
    }

    private final SessionFactoryFactory factory = new SessionFactoryFactory();

    private final HibernateBundle<?> bundle = mock(HibernateBundle.class);
    private final LifecycleEnvironment lifecycleEnvironment = mock(LifecycleEnvironment.class);
    private final Environment environment = mock(Environment.class);
    private final DataSourceFactory config = new DataSourceFactory();
    private final MetricRegistry metricRegistry = new MetricRegistry();

    private SessionFactory sessionFactory;

    @Before
    public void setUp() throws Exception {
        when(environment.metrics()).thenReturn(metricRegistry);
        when(environment.lifecycle()).thenReturn(lifecycleEnvironment);

        config.setUrl("jdbc:hsqldb:mem:DbTest-" + System.currentTimeMillis());
        config.setUser("sa");
        config.setDriverClass("org.hsqldb.jdbcDriver");
        config.setValidationQuery("SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS");
    }

    @After
    public void tearDown() throws Exception {
        if (sessionFactory != null) {
            sessionFactory.close();
        }
    }

    @Test
    public void managesTheSessionFactory() throws Exception {
        build();

        verify(lifecycleEnvironment).manage(any(SessionFactoryManager.class));
    }

    @Test
    public void callsBundleToConfigure() throws Exception {
      build();

      verify(bundle).configure(any(Configuration.class));
    }

    @Test
    public void buildsAWorkingSessionFactory() throws Exception {
        build();

        final Session session = sessionFactory.openSession();
        try {
            session.createSQLQuery("DROP TABLE people IF EXISTS").executeUpdate();
            session.createSQLQuery("CREATE TABLE people (name varchar(100) primary key, email varchar(100), birthday timestamp)").executeUpdate();
            session.createSQLQuery("INSERT INTO people VALUES ('Coda', 'coda@example.com', '1979-01-02 00:22:00')").executeUpdate();

            final Person entity = (Person) session.get(Person.class, "Coda");

            assertThat(entity.getName())
                    .isEqualTo("Coda");

            assertThat(entity.getEmail())
                    .isEqualTo("coda@example.com");

            assertThat(entity.getBirthday().toDateTime(DateTimeZone.UTC))
                    .isEqualTo(new DateTime(1979, 1, 2, 0, 22, DateTimeZone.UTC));
        } finally {
            session.close();
        }
    }

    private void build() throws ClassNotFoundException {
        this.sessionFactory = factory.build(bundle,
                                            environment,
                                            config,
                                            ImmutableList.<Class<?>>of(Person.class));
    }
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: eduardo
 * Date: 08/01/15
 * Time: 17:21
 */

namespace Cacic\MultiBundle\Connection;

use Doctrine\DBAL\Connection;
use Symfony\Component\HttpFoundation\Session\Session;
use Doctrine\Common\EventManager;
use Doctrine\DBAL\Events;
use Doctrine\DBAL\Event\ConnectionEventArgs;

/**
 * Class ConnectionWrapper
 * Example from http://stackoverflow.com/questions/6409167/symfony-2-multiple-and-dynamic-database-connection
 *
 * @package Cacic\MultiBundle\Connection
 */
class ConnectionWrapper extends Connection {

    const SESSION_ACTIVE_DYNAMIC_CONN = 'active_dynamic_conn';

    /**
     * @var Session
     */
    private $session;

    /**
     * @var bool
     */
    private $_isConnected = false;

    /**
     * @param Session $sess
     */
    public function setSession(Session $sess)
    {
        $this->session = $sess;
    }

    public function forceSwitch($dbName, $dbUser, $dbPassword)
    {
        if ($this->session->has(self::SESSION_ACTIVE_DYNAMIC_CONN)) {
            $current = $this->session->get(self::SESSION_ACTIVE_DYNAMIC_CONN);
            if ($current[0] === $dbName) {
                return;
            }
        }

        $this->session->set(self::SESSION_ACTIVE_DYNAMIC_CONN, [
            $dbName,
            $dbUser,
            $dbPassword
        ]);

        if ($this->isConnected()) {
            $this->close();
        }
    }

    /**
     * {@inheritDoc}
     */
    public function connect()
    {
        if (! $this->session->has(self::SESSION_ACTIVE_DYNAMIC_CONN)) {
            throw new \InvalidArgumentException('You have to inject into valid context first');
        }
        if ($this->isConnected()) {
            return true;
        }

        $driverOptions = isset($params['driverOptions']) ? $params['driverOptions'] : array();

        $params = $this->getParams();
        $realParams = $this->session->get(self::SESSION_ACTIVE_DYNAMIC_CONN);
        $params['dbname'] = $realParams[0];
        $params['user'] = $realParams[1];
        $params['password'] = $realParams[2];

        $this->_conn = $this->_driver->connect($params, $params['user'], $params['password'], $driverOptions);

        if ($this->_eventManager->hasListeners(Events::postConnect)) {
            $eventArgs = new ConnectionEventArgs($this);
            $this->_eventManager->dispatchEvent(Events::postConnect, $eventArgs);
        }

        $this->_isConnected = true;

        return true;
    }

    /**
     * {@inheritDoc}
     */
    public function isConnected()
    {
        return $this->_isConnected;
    }

    /**
     * {@inheritDoc}
     */
    public function close()
    {
        if ($this->isConnected()) {
            parent::close();
            $this->_isConnected = false;
        }
    }
}


text:
/**
 * Loads the `axy` object as node module
 */
"use strict";

var min = false, // load compressed file
    fs = require("fs"),
    vm = require("vm"),
    filename,
    content,
    axy = {},
    vars = {
        axy: axy,
        window: global,
        console: console,
        setTimeout: setTimeout
    },
    context = vm.createContext(vars);

if (min) {
    filename = __dirname + "/tmp/axy-define.min-" + require("./package.json").version + ".js";
} else {
    filename = __dirname + "/axy-define.js";
}

if (!fs.existsSync(filename)) {
    throw new Error(filename + " not found. Run 'grunt build'.");
}

content = fs.readFileSync(filename, {encoding: "utf-8"});
vm.runInContext(content, context);

module.exports = axy;


text:
package ca.momoperes.onelinereflection.example;

public class DyeColor {

    public byte data;

    public DyeColor(byte data) {
        this.data = data;
    }

    public byte getData() {
        return data;
    }
}


text:
package com.yahoo.yqlplus.engine.internal.bytecode.types.gambit;

import com.yahoo.yqlplus.api.types.YQLCoreType;
import com.yahoo.yqlplus.engine.internal.plan.types.ProgramValueTypeAdapter;
import com.yahoo.yqlplus.engine.internal.plan.types.PromiseAdapter;
import com.yahoo.yqlplus.engine.internal.plan.types.SerializationAdapter;
import com.yahoo.yqlplus.engine.internal.plan.types.TypeWidget;
import com.yahoo.yqlplus.engine.internal.plan.types.base.BaseTypeWidget;
import com.yahoo.yqlplus.engine.internal.plan.types.base.TodoException;
import org.objectweb.asm.Type;

import java.util.concurrent.Future;

public class FutureResultType extends BaseTypeWidget {
    private final TypeWidget valueType;

    public FutureResultType(TypeWidget valueType) {
        super(Type.getType(Future.class));
        this.valueType = valueType;
    }

    @Override
    public YQLCoreType getValueCoreType() {
        return YQLCoreType.PROMISE;
    }

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

    @Override
    public PromiseAdapter getPromiseAdapter() {
        return new FuturePromiseAdapter(valueType);
    }

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

    @Override
    public UnificationAdapter getUnificationAdapter(final ProgramValueTypeAdapter typeAdapter) {
        return new UnificationAdapter() {
            @Override
            public TypeWidget unify(TypeWidget other) {
                PromiseAdapter promiseAdapter = other.getPromiseAdapter();
                return new FutureResultType(typeAdapter.unifyTypes(valueType, promiseAdapter.getResultType()));
            }
        };
    }

    @Override
    protected SerializationAdapter getJsonSerializationAdapter() {
        throw new TodoException();
    }
}


text:
A simple blog template for Jekyll.

Uses:
* Font Awesome 4.2.0

To get started:
* Fork this repo
* Edit [_config.yml](_config.yml):

To create a post:
* Create a **.md** or **.markdown** file in the _post directory. Add a thumbnail image for the post in the yml front matter, its shown as the post thumbnail in the homepage


text:
{% extends "modal.html" %}
{% load i18n %}

{% block header %}
{% trans "Move customer" %}
{% endblock header %}

{% block body %}
<form action="{% url 'customers-filter' %}" method="post" accept-charset="utf-8" id="search-form" data-target="#search-results">
  {% csrf_token %}
  <input type="hidden" name="id" value="{{ customer.pk|safe }}"/>
  <input type="text" class="search-query" name="name" autocomplete="off" placeholder="{% trans "Customer name" %}"/>
</form>

{% endblock body %}

{% block footer %}
{% trans "Move to top" %}
<button class="btn btn-primary" data-dismiss="modal">{% trans "Close" %}</button>
{% endblock footer %}


text:
#include "Enums.h"
#include "Controller Enums.h"
#include "Description.h"

using namespace System;

namespace StillDesign
{
	namespace PhysX
	{
		ref class Actor;
		ref class UserControllerHitReport;

		public delegate ControllerAction ControllerActionHandler();

		public ref class ControllerDescription abstract : Description
		{
			private:
				NxControllerDesc* _desc;

				UserControllerHitReport^ _hitReport;

			protected:
				ControllerDescription( NxControllerDesc* controllerDesc );
			public:
				~ControllerDescription();
			protected:
				!ControllerDescription();

			public:
				/// Is the Description Settings Valid
				bool IsValid();
				virtual int CheckValid() override;
				void SetToDefault();

				/// Gets the Character Controller Type
				property ControllerType Type
				{
					ControllerType get();
				}

				/// Gets or Sets the Position of the Character
				property Vector3 Position
				{
					Vector3 get();
					void set( Vector3 value );
				}
				/// Gets or Sets the Maximum Slope Which the Character Can Walk Up
				property float SlopeLimit
				{
					float get();
					void set( float value );
				}
				/// Gets or Sets the Skin Width Used by the Controller
				property float SkinWidth
				{
					float get();
					void set( float value );
				}
				/// Defines the Maximum Height of an Obstacle Which the Character Can Climb
				property float StepOffset
				{
					float get();
					void set( float value );
				}
				/// Gets or Sets the Interaction Flag. This Controls how a Character Controller Collides with Other Controllers
				property CCTInteractionFlag InteractionFlag
				{
					CCTInteractionFlag get();
					void set( CCTInteractionFlag value );
				}

				/// Gets or Sets the 'Up' Direction
				property Axis UpDirection
				{
					Axis get();
					void set( Axis value );
				}

				/// Sets the user callback interface
				property UserControllerHitReport^ Callback
				{
					UserControllerHitReport^ get();
					void set( UserControllerHitReport^ value );
				}

			internal:
				/// Gets the Unmanaged Pointer to the NxControllerDesc
				property NxControllerDesc* UnmanagedPointer
				{
					NxControllerDesc* get();
				}
		};
	};
};


text:
package iso20022

type DateOffsetText string


text:
package com.thinkgem.jeesite.modules.top.entity;

import java.util.Date;

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

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.taobao.api.internal.mapping.ApiField;
import com.thinkgem.jeesite.common.persistence.BaseEntity;

/**
 * 淘宝商品Entity
 * @author lay
 * @version 2013-03-18
 */
@Entity
@Table(name = "top_item_img")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class ItemImg extends BaseEntity {

	private static final long serialVersionUID = 1L;

	private Long numIid;

	/**
	 * 图片创建时间 时间格式:yyyy-MM-dd HH:mm:ss
	 */
	@ApiField("created")
 	private Date created;

	/**
	 * 商品图片的id,和商品相对应(主图id默认为0)
	 */
	@ApiField("id")
	private Long id;

	/**
	 * 图片放在第几张(多图时可设置)
	 */
	@ApiField("position")
	private Long position;

	/**
	 * 图片链接地址
	 */
	@ApiField("url")
	private String url;

	public Date getCreated() {
		return this.created;
	}
	public void setCreated(Date created) {
		this.created = created;
	}

	@Id
	public Long getId() {
		return this.id;
	}
	public void setId(Long id) {
		this.id = id;
	}

	public Long getPosition() {
		return this.position;
	}
	public void setPosition(Long position) {
		this.position = position;
	}

	public String getUrl() {
		return this.url;
	}
	public void setUrl(String url) {
		this.url = url;
	}

	@Column(name = "num_iid")
	public Long getNumIid() {
		return numIid;
	}
	public void setNumIid(Long numIid) {
		this.numIid = numIid;
	}

}


text:
#define DEBUG

#include <common.h>

static const char test_cmd[] = "setenv list 1\n setenv list ${list}2; "
		"setenv list ${list}3\0"
		"setenv list ${list}4";

static int do_ut_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
	printf("%s: Testing commands\n", __func__);
	run_command("env default -f -a", 0);

	/* commands separated by \n */
	run_command_list("setenv list 1\n setenv list ${list}1", -1, 0);
	assert(!strcmp("11", getenv("list")));

	/* command followed by \n and nothing else */
	run_command_list("setenv list 1${list}\n", -1, 0);
	assert(!strcmp("111", getenv("list")));

	/* a command string with \0 in it. Stuff after \0 should be ignored */
	run_command("setenv list", 0);
	run_command_list(test_cmd, sizeof(test_cmd), 0);
	assert(!strcmp("123", getenv("list")));

	/*
	 * a command list where we limit execution to only the first command
	 * using the length parameter.
	 */
	run_command_list("setenv list 1\n setenv list ${list}2; "
		"setenv list ${list}3", strlen("setenv list 1"), 0);
	assert(!strcmp("1", getenv("list")));

	assert(run_command("false", 0) == 1);
	assert(run_command("echo", 0) == 0);
	assert(run_command_list("false", -1, 0) == 1);
	assert(run_command_list("echo", -1, 0) == 0);

#ifdef CONFIG_SYS_HUSH_PARSER
	run_command("setenv foo 'setenv black 1\nsetenv adder 2'", 0);
	run_command("run foo", 0);
	assert(getenv("black") != NULL);
	assert(!strcmp("1", getenv("black")));
	assert(getenv("adder") != NULL);
	assert(!strcmp("2", getenv("adder")));
#endif

	assert(run_command("", 0) == 0);
	assert(run_command(" ", 0) == 0);

	assert(run_command("'", 0) == 1);

	printf("%s: Everything went swimmingly\n", __func__);
	return 0;
}

U_BOOT_CMD(
	ut_cmd,	5,	1,	do_ut_cmd,
	"Very basic test of command parsers",
	""
);


text:
import {List} from './data/list';
import {Leaf} from './data/leaf';

/**
 * Create an empty list.
 *
 * @example
 * const l = List.empty();
 *
 * @memberof List
 * @return {List}
 */
export function empty() {
  return new List(new Leaf());
}


text:
package display

// ModeDuringHBlank - The LCD controller is in the H-Blank period and
// the CPU can access both the display RAM (8000h-9FFFh) and OAM (FE00h-FE9Fh)
const ModeDuringHBlank byte = 0x00

// ModeDuringVBlank - The LCD contoller is in the V-Blank period (or the
// display is disabled) and the CPU can access both the display RAM (8000h-9FFFh)
// and OAM (FE00h-FE9Fh)
const ModeDuringVBlank byte = 0x01

// ModeSearchingOAM - The LCD controller is reading from OAM memory.
// The CPU <cannot> access OAM memory (FE00h-FE9Fh) during this period.
const ModeSearchingOAM byte = 0x02

// ModeTransferingDataToLCD - The LCD controller is reading from both OAM and VRAM,
// The CPU <cannot> access OAM and VRAM during this period. CGB Mode: Cannot access
// Palette Data (FF69,FF6B) either.
const ModeTransferingDataToLCD byte = 0x03

// STAT is the LCD Status register
type STAT byte

// coincidenceInterruptEnabled returns true iff bit 6 is set
func (s *STAT) coincidenceInterruptEnabled() bool {
	return *s&0x40 == 0x40
}

// oamInterruptEnabled returns true iff bit 5 is set
func (s *STAT) oamInterruptEnabled() bool {
	return *s&0x20 == 0x20
}

// vBlankInterruptEnabled returns true iff bit 4 is set
func (s *STAT) vBlankInterruptEnabled() bool {
	return *s&0x10 == 0x10
}

// hBlankInterruptEnabled returns true iff bit 3 is set
func (s *STAT) hBlankInterruptEnabled() bool {
	return *s&0x08 == 0x08
}

// modeFlag return the current mode
func (s *STAT) modeFlag() byte {
	return byte(*s) & 0x03
}

// setModeFlag to 0, 1, 2, or 3
func (s *STAT) setModeFlag(mode byte) {
	if mode < 4 {
		*s = STAT((byte(*s) & 0xFC) | mode)
	}
}

// coincidenceFlag returns true iff bit 2 is set
func (s *STAT) coincidenceFlag() bool {
	return *s&0x04 == 0x04
}

// setCoincidenceFlag by setting or resetting bit 2
func (s *STAT) setCoincidenceFlag(state bool) {
	if state {
		*s = *s | 0x04
	} else {
		*s = *s & 0xFB
	}
}

// Read from the register
func (s *STAT) Read(addr uint16) (byte, error) {
	return byte(*s), nil
}

// Write to the register
func (s *STAT) Write(addr uint16, data byte) error {
	*s = STAT((byte(*s) & 0x07) | (data & 0xF8))
	return nil
}


text:
package java.io;

/**
 * This exception is thrown when there is an error in the data that is
 * read from a stream during de-serialization.
 *
 * @author Aaron M. Renn (arenn@urbanophile.com)
 * @author Warren Levy (warrenl@cygnus.com)
 * @since 1.1
 * @status updated to 1.4
 */
public class StreamCorruptedException extends ObjectStreamException
{
  /**
   * Compatible with JDK 1.1+.
   */
  private static final long serialVersionUID = 8983558202217591746L;

  /**
   * Create an exception without a descriptive error message.
   */
  public StreamCorruptedException()
  {
  }

  /**
   * Create an exception with a descriptive error message.
   *
   * @param message the descriptive error message
   */
  public StreamCorruptedException(String message)
  {
    super(message);
  }
} // class StreamCorruptedException


text:
import { MockBoot } from "DevTools"
import { FairAppFragmentContainer } from "Apps/Fair/FairApp"
import { graphql } from "react-relay"
import { FairApp_Test_Query } from "__generated__/FairApp_Test_Query.graphql"
import { useTracking } from "react-tracking"
import { OwnerType } from "@artsy/cohesion"
import { setupTestWrapperTL } from "DevTools/setupTestWrapper"
import { useRouter } from "System/Router/useRouter"
import { fireEvent, screen } from "@testing-library/react"

const mockJumpTo = jest.fn()

jest.unmock("react-relay")
jest.mock("react-tracking")
jest.mock("Utils/Hooks/useMatchMedia", () => ({
  __internal__useMatchMedia: () => false,
}))
jest.mock("System/Router/useRouter", () => ({
  useRouter: jest.fn(),
  useIsRouteActive: () => false,
}))
jest.mock("Utils/Hooks/useJump", () => ({
  useJump: () => ({ jumpTo: mockJumpTo }),
  Jump: () => null,
}))

const { renderWithRelay } = setupTestWrapperTL<FairApp_Test_Query>({
  Component: props => {
    if (!props.fair) return null

    return (
      <MockBoot
        context={{
          analytics: {
            contextPageOwnerId: "bson-fair",
            contextPageOwnerSlug: "miart-2020",
            contextPageOwnerType: OwnerType.fair,
          },
        }}
      >
        <FairAppFragmentContainer fair={props.fair} />
      </MockBoot>
    )
  },
  query: graphql`
    query FairApp_Test_Query @relay_test_operation {
      fair(id: "example") {
        ...FairApp_fair
      }
    }
  `,
})

describe("FairApp", () => {
  const trackEvent = jest.fn()
  const mockUseRouter = useRouter as jest.Mock

  beforeEach(() => {
    ;(useTracking as jest.Mock).mockImplementation(() => ({ trackEvent }))
    mockUseRouter.mockImplementation(() => ({
      match: {
        location: {
          pathname: "anything",
        },
      },
    }))
  })

  afterEach(() => {
    mockUseRouter.mockReset()
  })

  afterEach(() => {
    trackEvent.mockClear()
  })

  it("renders the overview tab by default", () => {
    renderWithRelay()

    expect(screen.getByText("Overview")).toBeInTheDocument()
  })

  it("sets a title tag", () => {
    renderWithRelay({
      Fair: () => ({ name: "Miart 2020" }),
    })

    expect(document.title).toBe("Miart 2020 | Artsy")
  })

  it("renders the exhibitors tab", () => {
    renderWithRelay({
      Fair: () => ({
        href: "/fair/miart-2020",
      }),
    })

    expect(screen.getByText("Exhibitors A-Z")).toBeInTheDocument()
    expect(screen.getByText("Exhibitors A-Z")).toHaveAttribute(
      "href",
      "/fair/miart-2020/exhibitors"
    )
  })

  it("renders the artworks tab with a count and appropriate href", () => {
    renderWithRelay({
      Fair: () => ({ href: "/fair/miart-2020", counts: { artworks: 2 } }),
    })

    expect(screen.getByText("Artworks")).toBeInTheDocument()
    expect(screen.getByText("Artworks")).toHaveAttribute(
      "href",
      "/fair/miart-2020/artworks"
    )
  })

  it("tracks clicks to the artworks tab", () => {
    renderWithRelay({
      Fair: () => ({
        internalID: "bson-fair",
        slug: "miart-2020",
        href: "/fair/miart-2020",
      }),
    })

    fireEvent.click(screen.getByText("Artworks"))

    expect(trackEvent).toHaveBeenCalledWith({
      action: "clickedNavigationTab",
      context_module: "fairInfo",
      context_page_owner_id: "bson-fair",
      context_page_owner_slug: "miart-2020",
      context_page_owner_type: "fair",
      destination_path: "/fair/miart-2020/artworks",
      subject: "Artworks",
    })
  })

  it("tracks clicks to the exhibitors tab", () => {
    renderWithRelay({
      Fair: () => ({
        internalID: "bson-fair",
        slug: "miart-2020",
        href: "/fair/miart-2020",
      }),
    })

    fireEvent.click(screen.getByText("Exhibitors A-Z"))

    expect(trackEvent).toHaveBeenCalledWith({
      action: "clickedNavigationTab",
      context_module: "fairInfo",
      context_page_owner_id: "bson-fair",
      context_page_owner_slug: "miart-2020",
      context_page_owner_type: "fair",
      destination_path: "/fair/miart-2020/exhibitors",
      subject: "Exhibitors",
    })
  })

  describe("Exhibitors tab", () => {
    beforeEach(() => {
      mockUseRouter.mockImplementation(() => ({
        match: {
          location: {
            pathname: "/exhibitors",
          },
        },
      }))
    })

    it("renders the letters nav", () => {
      renderWithRelay(FAIR_FIXTURE)

      expect(screen.getByText("A")).toBeInTheDocument()
      expect(screen.getByText("B")).toBeInTheDocument()
      expect(screen.getByText("C")).toBeInTheDocument()
    })

    it("scrolls down the page on letter click", () => {
      renderWithRelay(FAIR_FIXTURE)

      fireEvent.click(screen.getByText("C"))

      expect(mockJumpTo).toBeCalled()
    })
  })
})

const FAIR_FIXTURE = {
  Fair: () => ({
    exhibitorsGroupedByName: [
      {
        letter: "A",
        exhibitors: [],
      },
      {
        letter: "C",
        exhibitors: [],
      },
      {
        letter: "D",
        exhibitors: [],
      },
    ],
  }),
}


text:
using System.Collections.Generic;
using System.Security.Claims;

namespace IdentityServer3.Core.Services.Default
{
    /// <summary>
    /// Claims filter to aggregate other claims filters.
    /// </summary>
    public class AggregateExternalClaimsFilter : IExternalClaimsFilter
    {
        readonly IExternalClaimsFilter[] filters;

        /// <summary>
        /// Initializes a new instance of the <see cref="AggregateExternalClaimsFilter"/> class.
        /// </summary>
        /// <param name="filters">The filters to aggregate.</param>
        public AggregateExternalClaimsFilter(params IExternalClaimsFilter[] filters)
        {
            this.filters = filters;
        }

        /// <summary>
        /// Filters the specified claims from an external identity provider.
        /// </summary>
        /// <param name="provider">The identifier for the external identity provider.</param>
        /// <param name="claims">The incoming claims.</param>
        /// <returns>
        /// The transformed claims.
        /// </returns>
        public IEnumerable<Claim> Filter(string provider, IEnumerable<Claim> claims)
        {
            foreach (var filter in this.filters)
            {
                claims = filter.Filter(provider, claims);
            }
            return claims;
        }
    }
}


text:
layout: default
title: ICBES'17 - PayPal
meta: PayPal Payment information for Registration
keyword: biomedical engineering conference, biomedical conference, biosystems conference, biomaterials conference, biomechanics conference, biomechatronics conference, biosensors conference, telemedicine conference, robotics conference, biomedical engineering, biomedical, biosystems, biomaterials, biomechanics, biomechatronics, biosensors, telemedicine, robotics
---

Please select the proper registration type from the drop-down box and click Pay Now to proceed with the payment.

    <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top" class="paypal">
	<input type="hidden" name="cmd" value="_s-xclick">
	<input type="hidden" name="hosted_button_id" value="V2GJT22E4242Y">

<input type="hidden" name="on0" value="~ Select Registration Type ~">Select Registration Type

<select name="os0">
	<option value="Full Registration">Full Registration €750.00 EUR</option>
	<option value="Student Registration">Student Registration €600.00 EUR</option>
	<option value="Additional Paper">Additional Paper €150.00 EUR</option>
	<option value="Accompanying Person">Accompanying Person €150.00 EUR</option>
	<option value="Closing Ceremony">Closing Ceremony €70.00 EUR</option>
	<option value="EECSS Workshop">EECSS Workshop €122.00 EUR</option>
	</select>

	<input type="hidden" name="currency_code" value="EUR">
	<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">

	</form>

If you are not able to use this method of payment, you may use our other types of payment. For more information please visit the link below:

   	 www.icbes.net/registration/


text:
/*
  Configuration defines by Trolltech.
*/

#include <qglobal.h>
#if defined(Q_OS_WINCE)
# include <qfunctions_wince.h>
#endif

/* Support CCITT Group 3 & 4 algorithms */
#define CCITT_SUPPORT 1

/* Pick up YCbCr subsampling info from the JPEG data stream to support files
   lacking the tag (default enabled). */
#define CHECK_JPEG_YCBCR_SUBSAMPLING 1

/* Support C++ stream API (requires C++ compiler) */
/* #undef CXX_SUPPORT */

/* Treat extra sample as alpha (default enabled). The RGBA interface will
   treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many
   packages produce RGBA files but don't mark the alpha properly. */
#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1

/* Use the Apple OpenGL framework. */
/* #undef HAVE_APPLE_OPENGL_FRAMEWORK */

/* Define to 1 if you have the <assert.h> header file. */
#define HAVE_ASSERT_H 1

/* Define to 1 if you have the <dlfcn.h> header file. */
/* #undef HAVE_DLFCN_H */

/* Define to 1 if you have the <fcntl.h> header file. */
#if !defined(Q_OS_WINCE)
#define HAVE_FCNTL_H 1
#endif

/* Define to 1 if you have the `floor' function. */
/* #undef HAVE_FLOOR */

/* Define to 1 if you have the `getopt' function. */
/* #undef HAVE_GETOPT */

/* Define as 0 or 1 according to the floating point format suported by the
   machine */
#define HAVE_IEEEFP 1

/* Define to 1 if the system has the type `int16'. */
/* #undef HAVE_INT16 */
#ifdef Q_OS_AIX
#define HAVE_INT16 1
#endif

/* Define to 1 if the system has the type `int32'. */
/* #undef HAVE_INT32 */
#ifdef Q_OS_AIX
#define HAVE_INT32 1
#endif

/* Define to 1 if the system has the type `int8'. */
/* #undef HAVE_INT8 */
#ifdef Q_OS_AIX
#define HAVE_INT8 1
#endif

/* Define to 1 if you have the <inttypes.h> header file. */
/* #undef HAVE_INTTYPES_H */

/* Define to 1 if you have the `isascii' function. */
/* #undef HAVE_ISASCII */

/* Define to 1 if you have the `lfind' function. */
/* #undef HAVE_LFIND */

/* Define to 1 if you have the `c' library (-lc). */
/* #undef HAVE_LIBC */

/* Define to 1 if you have the `m' library (-lm). */
/* #undef HAVE_LIBM */

/* Define to 1 if you have the <limits.h> header file. */
/* #undef HAVE_LIMITS_H */

/* Define to 1 if you have the <malloc.h> header file. */
/* #undef HAVE_MALLOC_H */

/* Define to 1 if you have the `memmove' function. */
/* #undef HAVE_MEMMOVE */

/* Define to 1 if you have the <memory.h> header file. */
/* #undef HAVE_MEMORY_H */

/* Define to 1 if you have the `memset' function. */
/* #undef HAVE_MEMSET */

/* Define to 1 if you have the `mmap' function. */
/* #undef HAVE_MMAP */

/* Define to 1 if you have the `pow' function. */
/* #undef HAVE_POW */

/* Define if you have POSIX threads libraries and header files. */
/* #undef HAVE_PTHREAD */

/* Define to 1 if you have the <search.h> header file. */
#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) && !defined(Q_OS_VXWORKS)
#define HAVE_SEARCH_H 1
#endif

/* Define to 1 if you have the `sqrt' function. */
/* #undef HAVE_SQRT */

/* Define to 1 if you have the <stdint.h> header file. */
/* #undef HAVE_STDINT_H */

/* Define to 1 if you have the <stdlib.h> header file. */
/* #undef HAVE_STDLIB_H */

/* Define to 1 if you have the `strcasecmp' function. */
/* #undef HAVE_STRCASECMP */

/* Define to 1 if you have the `strchr' function. */
/* #undef HAVE_STRCHR */

/* Define to 1 if you have the <strings.h> header file. */
/* #undef HAVE_STRINGS_H */

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the `strrchr' function. */
/* #undef HAVE_STRRCHR */

/* Define to 1 if you have the `strstr' function. */
/* #undef HAVE_STRSTR */

/* Define to 1 if you have the `strtol' function. */
/* #undef HAVE_STRTOL */

/* Define to 1 if you have the `strtoul' function. */
/* #undef HAVE_STRTOUL */

/* Define to 1 if you have the <sys/stat.h> header file. */
/* #undef HAVE_SYS_STAT_H */

/* Define to 1 if you have the <sys/time.h> header file. */
/* #undef HAVE_SYS_TIME_H */

/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

/* Define to 1 if you have the <windows.h> header file. */
/* #undef HAVE_WINDOWS_H */
#ifdef Q_OS_WIN
#define TIF_PLATFORM_CONSOLE
#endif

/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
   (Intel) */
#if (Q_BYTE_ORDER == Q_BIG_ENDIAN)
#define HOST_BIGENDIAN 1
#else
#define HOST_BIGENDIAN 0
#endif

/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
#define HOST_FILLORDER FILLORDER_LSB2MSB

/* Support JPEG compression (requires IJG JPEG library) */
/* #undef JPEG_SUPPORT */

/* Support LogLuv high dynamic range encoding */
#define LOGLUV_SUPPORT 1

/* Define to the sub-directory in which libtool stores uninstalled libraries.
   */
/* #undef LT_OBJDIR */

/* Support LZW algorithm */
#define LZW_SUPPORT 1

/* Support Microsoft Document Imaging format */
#define MDI_SUPPORT 1

/* Support NeXT 2-bit RLE algorithm */
#define NEXT_SUPPORT 1

/* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */

/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation
   fails with unpatched IJG JPEG library) */
/* #undef OJPEG_SUPPORT */

/* Name of package */
/* #undef PACKAGE */

/* Define to the address where bug reports for this package should be sent. */
/* #undef PACKAGE_BUGREPORT */

/* Define to the full name of this package. */
/* #undef PACKAGE_NAME */

/* Define to the full name and version of this package. */
/* #undef PACKAGE_STRING */

/* Define to the one symbol short name of this package. */
/* #undef PACKAGE_TARNAME */

/* Define to the version of this package. */
/* #undef PACKAGE_VERSION */

/* Support Macintosh PackBits algorithm */
#define PACKBITS_SUPPORT 1

/* Support Pixar log-format algorithm (requires Zlib) */
#define PIXARLOG_SUPPORT 1

/* Define to necessary symbol if this constant uses a non-standard name on
   your system. */
/* #undef PTHREAD_CREATE_JOINABLE */

/* The size of a `int', as computed by sizeof. */
#define SIZEOF_INT 4

/* The size of a `long', as computed by sizeof. */
#if (QT_POINTER_SIZE == 8) && !defined(Q_OS_WIN64)
#define SIZEOF_LONG 8
#else
#define SIZEOF_LONG 4
#endif

/* Define to 1 if you have the ANSI C header files. */
/* #undef STDC_HEADERS */

/* Support strip chopping (whether or not to convert single-strip uncompressed
   images to mutiple strips of specified size to reduce memory usage) */
#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP

/* Default size of the strip in bytes (when strip chopping enabled) */
/* #undef STRIP_SIZE_DEFAULT */

/* Enable SubIFD tag (330) support */
#define SUBIFD_SUPPORT 1

/* Support ThunderScan 4-bit RLE algorithm */
#define THUNDER_SUPPORT 1

/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
/* #undef TIME_WITH_SYS_TIME */

/* Define to 1 if your <sys/time.h> declares `struct tm'. */
/* #undef TM_IN_SYS_TIME */

/* Version number of package */
/* #undef VERSION */

/* Define to 1 if your processor stores words with the most significant byte
   first (like Motorola and SPARC, unlike Intel and VAX). */
#if (Q_BYTE_ORDER == Q_BIG_ENDIAN)
#define WORDS_BIGENDIAN 1
#else
/* #undef WORDS_BIGENDIAN */
#endif

/* Define to 1 if the X Window System is missing or not being used. */
/* #undef X_DISPLAY_MISSING */

/* Support Deflate compression */
#define ZIP_SUPPORT 1

/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */

/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */

/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */

/* Define to `__inline__' or `__inline' if that's what the C compiler
   calls it, or to nothing if 'inline' is not supported under any name.  */
#ifndef Q_OS_SYMBIAN
#ifndef __cplusplus
#undef inline
#define inline
#endif
#endif

/* Define to `long' if <sys/types.h> does not define. */
/* #undef off_t */

/* Define to `unsigned' if <sys/types.h> does not define. */
/* #undef size_t */


text:
layout: page
title: Stone - Johnston Wedding
date: 2016-05-24
author: Nicole Ramos
tags: weekly links, java
status: published
summary: Nullam eleifend efficitur nulla eu venenatis.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 08/15/2019
  endDate: 08/19/2019
  ctyhocn: BHMMBHX
  groupCode: SJW
published: true
---
Phasellus sollicitudin commodo eros, at tempor lectus lobortis vel. Sed pulvinar ultricies erat, at scelerisque massa laoreet non. Maecenas vitae molestie felis. Duis eu nibh interdum lacus mattis interdum ut vel lacus. Proin et dignissim turpis. Donec quis libero eget nulla commodo facilisis. Morbi elementum elit et nulla condimentum, in egestas nunc bibendum.

* Etiam ut dui imperdiet, placerat justo vel, tempor leo
* Sed sagittis justo nec tempus imperdiet
* Vivamus molestie libero eu purus eleifend, at cursus leo efficitur
* Nunc aliquet nunc ut tellus consequat, vitae lacinia leo elementum.

Vestibulum placerat et ligula eu faucibus. Fusce ante ex, aliquet vel egestas nec, viverra sit amet ex. Sed vehicula ipsum nisl, nec faucibus eros pulvinar et. Morbi tristique ac orci eget posuere. Phasellus libero nulla, hendrerit et posuere nec, ornare sit amet mauris. Nulla id elit ex. Aliquam et urna eu nisi mollis auctor. Vestibulum ultrices quam sed ex faucibus, nec convallis velit pellentesque. Phasellus eget imperdiet elit. Integer efficitur metus nec efficitur rhoncus. In facilisis, nunc vel sollicitudin bibendum, neque lectus fringilla urna, id sollicitudin ipsum dolor sit amet massa. Morbi mi diam, facilisis in dictum in, vulputate nec elit. Suspendisse potenti. Ut aliquet velit quis tincidunt pulvinar. Suspendisse id nibh consequat tellus consequat volutpat. Cras sit amet sem in leo porta pulvinar.


text:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "google_apis/drive/test_util.h"

#include "base/file_util.h"
#include "base/json/json_file_value_serializer.h"
#include "base/json/json_reader.h"
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "base/rand_util.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "google_apis/drive/drive_api_parser.h"
#include "google_apis/drive/gdata_wapi_parser.h"
#include "google_apis/drive/gdata_wapi_requests.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "url/gurl.h"

namespace google_apis {
namespace test_util {

bool RemovePrefix(const std::string& input,
                  const std::string& prefix,
                  std::string* output) {
  if (!StartsWithASCII(input, prefix, true /* case sensitive */))
    return false;

  *output = input.substr(prefix.size());
  return true;
}

base::FilePath GetTestFilePath(const std::string& relative_path) {
  base::FilePath path;
  if (!PathService::Get(base::DIR_SOURCE_ROOT, &path))
    return base::FilePath();
  path = path.AppendASCII("chrome")
             .AppendASCII("test")
             .AppendASCII("data")
             .Append(base::FilePath::FromUTF8Unsafe(relative_path));
  return path;
}

GURL GetBaseUrlForTesting(int port) {
  return GURL(base::StringPrintf("http://127.0.0.1:%d/", port));
}

void RunAndQuit(base::RunLoop* run_loop, const base::Closure& closure) {
  closure.Run();
  run_loop->Quit();
}

bool WriteStringToFile(const base::FilePath& file_path,
                       const std::string& content) {
  int result = file_util::WriteFile(file_path, content.data(), content.size());
  return content.size() == static_cast<size_t>(result);
}

bool CreateFileOfSpecifiedSize(const base::FilePath& temp_dir,
                               size_t size,
                               base::FilePath* path,
                               std::string* data) {
  if (!base::CreateTemporaryFileInDir(temp_dir, path))
    return false;

  if (size == 0) {
    // Note: RandBytesAsString doesn't support generating an empty string.
    data->clear();
    return true;
  }

  *data = base::RandBytesAsString(size);
  return WriteStringToFile(*path, *data);
}

scoped_ptr<base::Value> LoadJSONFile(const std::string& relative_path) {
  base::FilePath path = GetTestFilePath(relative_path);

  std::string error;
  JSONFileValueSerializer serializer(path);
  scoped_ptr<base::Value> value(serializer.Deserialize(NULL, &error));
  LOG_IF(WARNING, !value.get()) << "Failed to parse " << path.value()
                                << ": " << error;
  return value.Pass();
}

// Returns a HttpResponse created from the given file path.
scoped_ptr<net::test_server::BasicHttpResponse> CreateHttpResponseFromFile(
    const base::FilePath& file_path) {
  std::string content;
  if (!base::ReadFileToString(file_path, &content))
    return scoped_ptr<net::test_server::BasicHttpResponse>();

  std::string content_type = "text/plain";
  if (EndsWith(file_path.AsUTF8Unsafe(), ".json", true /* case sensitive */))
    content_type = "application/json";

  scoped_ptr<net::test_server::BasicHttpResponse> http_response(
      new net::test_server::BasicHttpResponse);
  http_response->set_code(net::HTTP_OK);
  http_response->set_content(content);
  http_response->set_content_type(content_type);
  return http_response.Pass();
}

scoped_ptr<net::test_server::HttpResponse> HandleDownloadFileRequest(
    const GURL& base_url,
    net::test_server::HttpRequest* out_request,
    const net::test_server::HttpRequest& request) {
  *out_request = request;

  GURL absolute_url = base_url.Resolve(request.relative_url);
  std::string remaining_path;
  if (!RemovePrefix(absolute_url.path(), "/files/", &remaining_path))
    return scoped_ptr<net::test_server::HttpResponse>();
  return CreateHttpResponseFromFile(
      GetTestFilePath(remaining_path)).PassAs<net::test_server::HttpResponse>();
}

bool ParseContentRangeHeader(const std::string& value,
                             int64* start_position,
                             int64* end_position,
                             int64* length) {
  DCHECK(start_position);
  DCHECK(end_position);
  DCHECK(length);

  std::string remaining;
  if (!RemovePrefix(value, "bytes ", &remaining))
    return false;

  std::vector<std::string> parts;
  base::SplitString(remaining, '/', &parts);
  if (parts.size() != 2U)
    return false;

  const std::string range = parts[0];
  if (!base::StringToInt64(parts[1], length))
    return false;

  parts.clear();
  base::SplitString(range, '-', &parts);
  if (parts.size() != 2U)
    return false;

  return (base::StringToInt64(parts[0], start_position) &&
          base::StringToInt64(parts[1], end_position));
}

void AppendProgressCallbackResult(std::vector<ProgressInfo>* progress_values,
                                  int64 progress,
                                  int64 total) {
  progress_values->push_back(ProgressInfo(progress, total));
}

TestGetContentCallback::TestGetContentCallback()
    : callback_(base::Bind(&TestGetContentCallback::OnGetContent,
                           base::Unretained(this))) {
}

TestGetContentCallback::~TestGetContentCallback() {
}

std::string TestGetContentCallback::GetConcatenatedData() const {
  std::string result;
  for (size_t i = 0; i < data_.size(); ++i) {
    result += *data_[i];
  }
  return result;
}

void TestGetContentCallback::OnGetContent(google_apis::GDataErrorCode error,
                                          scoped_ptr<std::string> data) {
  data_.push_back(data.release());
}

}  // namespace test_util
}  // namespace google_apis