text:
package patch

import (
	"encoding/json"
	"fmt"
	"testing"

	resource_admission "k8s.io/autoscaler/vertical-pod-autoscaler/pkg/admission-controller/resource"

	"github.com/stretchr/testify/assert"
)

// EqPatch returns true if patches are equal by comparing their
// marshalling result.
func EqPatch(a, b resource_admission.PatchRecord) bool {
	aJson, aErr := json.Marshal(a)
	bJson, bErr := json.Marshal(b)
	return string(aJson) == string(bJson) && aErr == bErr
}

// AssertEqPatch asserts patches are equal.
func AssertEqPatch(t *testing.T, got, want resource_admission.PatchRecord) {
	assert.True(t, EqPatch(got, want), "got %+v, want: %+v", got, want)
}

// AssertPatchOneOf asserts patch is one of possible expected patches.
func AssertPatchOneOf(t *testing.T, got resource_admission.PatchRecord, want []resource_admission.PatchRecord) {
	for _, wanted := range want {
		if EqPatch(got, wanted) {
			return
		}
	}
	msg := fmt.Sprintf("got: %+v, expected one of %+v", got, want)
	assert.Fail(t, msg)
}


text:
#import "CountLyModule.h"
#import "TiBase.h"
#import "TiHost.h"
#import "TiUtils.h"
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
#import <CoreTelephony/CTCarrier.h>
#include <UIKit/UIKit.h>
#include <sys/types.h>
#include <sys/sysctl.h>

@implementation CountLyModule

#pragma mark Internal

// this is generated for your module, please do not change it
-(id)moduleGUID
{
	return @"ad1ce2b6-9511-403b-b5de-50c40542c433";
}

// this is generated for your module, please do not change it
-(NSString*)moduleId
{
	return @"count.ly";
}

#pragma mark Lifecycle

-(void)startup
{
	[super startup];
	NSLog(@"[INFO] %@ loaded",self);
}

-(void)shutdown:(id)sender
{
	// this method is called when the module is being unloaded
	// typically this is during shutdown. make sure you don't do too
	// much processing here or the app will be quit forceably

	// you *must* call the superclass
	[super shutdown:sender];
}

#pragma mark Cleanup

-(void)dealloc
{
	// release any resources that have been retained by the module
	[super dealloc];
}

#pragma mark Internal Memory Management

-(void)didReceiveMemoryWarning:(NSNotification*)notification
{
	// optionally release any resources that can be dynamically
	// reloaded once memory is available - such as caches
	[super didReceiveMemoryWarning:notification];
}

#pragma Public APIs

-(void)start:(id)args
{
	ENSURE_ARG_COUNT(args, 2);
	NSString* apikey = [TiUtils stringValue:[args objectAtIndex:0]];
	NSString* apiHost = [TiUtils stringValue:[args objectAtIndex:1]];
    TiThreadPerformOnMainThread(^{[[Countly sharedInstance] start:apikey withHost:apiHost];}, NO);
}

-(void)startOnCloud:(id)args
{
    ENSURE_ARG_COUNT(args, 1);
    NSString* apikey = [TiUtils stringValue:[args objectAtIndex:0]];
    TiThreadPerformOnMainThread(^{[[Countly sharedInstance] startOnCloudWithAppKey:apikey];}, NO);
}

- (void)event:(id)args
{
    NSDictionary * params = [args objectAtIndex:0];
    long numberOfArgs = [params count];
    NSString* event = [TiUtils stringValue:[params objectForKey:@"name"]];
    int count = [TiUtils intValue:[params objectForKey:@"count"]];
    double sum = [TiUtils doubleValue:[params objectForKey:@"sum"]];
    NSDictionary* segmentation = [params objectForKey:@"segmentation"];

    for (id key in params) {

        NSLog(@"key: %@, value: %@", key, [params objectForKey:key]);

    }

    if([segmentation count]){

        if(sum){

            [[Countly sharedInstance]recordEvent:event segmentation:segmentation count:count sum:sum];

        }else{

            [[Countly sharedInstance]recordEvent:event segmentation:segmentation count:count];

        }

    }else if(sum){

        [[Countly sharedInstance]recordEvent:event count:count sum:sum];

    }else{

        [[Countly sharedInstance]recordEvent:event count:count];

    }

}

- (void)userData:(id)args
{

    //  All keys are optional:
    //  kCLYUserName - (String) User's full name
    //  kCLYUserUsername - (String) User's nickname
    //  kCLYUserEmail - (String) User's email address
    //  kCLYUserOrganization - (String) User's organization
    //  kCLYUserPhone - (String) User's phone number with country code
    //  kCLYUserPicture - (String) WWW URL to User's avatar or profile picture
    //  kCLYUserPicturePath - (String) providing local path to user's avatar or profile picture
    //  kCLYUserGender - (String) User's gender as M for male and F for female
    //  kCLYUserBirthYear - (Integer) User's year of birth as integer
    //  kCLYUserCustom - (Dictionary) User custom dat - NSDictionary with your key values

    // set userDataArgs as args passed
    NSDictionary * userDataArgs = [args objectAtIndex:0];

    // get userData and customUserData from userDataArgs
    NSDictionary * userData = [userDataArgs objectForKey:@"userData"];
    NSDictionary* customUserData = [userDataArgs objectForKey:@"customUserData"];

    // get params out of userData
    NSString* name = [TiUtils stringValue:[userData objectForKey:@"name"]];
    NSString* username = [TiUtils stringValue:[userData objectForKey:@"username"]];
    NSString* email = [TiUtils stringValue:[userData objectForKey:@"email"]];
    NSString* organization = [TiUtils stringValue:[userData objectForKey:@"organization"]];
    NSString* phone = [TiUtils stringValue:[userData objectForKey:@"phone"]];
    NSString* picture = [TiUtils stringValue:[userData objectForKey:@"picture"]];
    NSString* picturePath = [TiUtils stringValue:[userData objectForKey:@"picturePath"]];
    NSString* gender = [TiUtils stringValue:[userData objectForKey:@"gender"]];
    NSString* birthyear = [TiUtils stringValue:[userData objectForKey:@"byear"]];

    // set userDetails
    NSMutableDictionary* userDetails = [[[NSMutableDictionary alloc] init] autorelease];

    // START - CHECK if params set and add to userDetails
    if(name){
        [userDetails setObject:name forKey:kCLYUserName];
    }
    if(username){
        [userDetails setObject:username forKey:kCLYUserUsername];
    }
    if(email){
        [userDetails setObject:email forKey:kCLYUserEmail];
    }
    if(organization){
        [userDetails setObject:organization forKey:kCLYUserOrganization];
    }
    if(phone){
        [userDetails setObject:phone forKey:kCLYUserPhone];
    }
    if(gender){
        [userDetails setObject:gender forKey:kCLYUserGender];
    }
    if(picture){
        [userDetails setObject:picture forKey:kCLYUserPicture];
    }
    if(picturePath){
        [userDetails setObject:picturePath forKey:kCLYUserPicturePath];
    }
    if(birthyear){
        [userDetails setObject:birthyear forKey:kCLYUserBirthYear];
    }
    if(customUserData){
        [userDetails setObject:customUserData forKey:kCLYUserCustom];
    }
    // END - CHECK if params set and add to userDetails

    NSLog(@"[INFO] %@ userDetails",userDetails);

    // run recordUserDetails function with userDetails
    [Countly.sharedInstance recordUserDetails: userDetails];

}
- (id)device
{
    size_t size;
    sysctlbyname("hw.machine", NULL, &size, NULL, 0);
    char *machine = malloc(size);
    sysctlbyname("hw.machine", machine, &size, NULL, 0);
    NSString *platform = [NSString stringWithUTF8String:machine];
    free(machine);
    return platform;
}

- (id)deviceName
{
  return [[UIDevice currentDevice] name];
}

- (id)platform
{
  return [[UIDevice currentDevice] model];
}

- (id)multitaskingSupported
{
  return NUMBOOL([[UIDevice currentDevice] isMultitaskingSupported]);
}

- (id)orientation
{
  //Obtaining the current device orientation
  UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];

  NSString* value = @"portrait";

  switch(orientation){
    // Device oriented vertically, home button on the bottom
    case UIDeviceOrientationPortrait:
      value = @"PORTRAIT";
      break;
    // Device oriented vertically, home button on the bottom
    case UIDeviceOrientationPortraitUpsideDown:
      value = @"PORTRAIT_UPSIDE_DOWN";
      break;
    // Device oriented vertically, home button on the top
    case UIDeviceOrientationLandscapeLeft:
      value = @"LANDSCAPE_LEFT";
      break;
    // Device oriented horizontally, home button on the right
    case UIDeviceOrientationLandscapeRight:
      value = @"LANDSCAPE_RIGHT";
      break;
    // Device oriented flat, face up
    case UIDeviceOrientationFaceUp:
      value = @"FACE_UP";
      break;
    // Device oriented flat, face down
    case UIDeviceOrientationFaceDown:
      value = @"FACE_DOWN";
      break;
    default:
      value = @"UNKNOWN";
      break;
  }

  return value;
}

- (id)osVersion
{
	return [[UIDevice currentDevice] systemVersion];
}

- (id)systemName
{
  return [[UIDevice currentDevice] systemName];
}

- (id)carrier
{
	if (NSClassFromString(@"CTTelephonyNetworkInfo"))
	{
		CTTelephonyNetworkInfo *netinfo = [[[CTTelephonyNetworkInfo alloc] init] autorelease];
		CTCarrier *carrier = [netinfo subscriberCellularProvider];
    if ([carrier carrierName]) {
      return [carrier carrierName];
    }
		return @"Simulator";
	}

	return @"Unknown";
}

- (id)resolution
{
	CGRect bounds = [[UIScreen mainScreen] bounds];
	CGFloat scale = [[UIScreen mainScreen] respondsToSelector:@selector(scale)] ? [[UIScreen mainScreen] scale] : 1.f;
	CGSize res = CGSizeMake(bounds.size.width * scale, bounds.size.height * scale);
	return [TiUtils sizeToDictionary:res];

}

- (id)locale
{
	return [[NSLocale currentLocale] localeIdentifier];
}

- (id)appVersion
{
	return [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleVersionKey];
}

- (id)proximityState
{
  return NUMBOOL([[UIDevice currentDevice] proximityState]);
}

@end

redpajama_set_name: RedPajamaGithub


text:
/**
 *
 */
package edu.umn.cs.crisys.tb.codegen.common.names;

import java.util.StringTokenizer;

import edu.umn.cs.crisys.tb.TbException;
import edu.umn.cs.crisys.tb.codegen.common.emitters.NameEmitter;
import edu.umn.cs.crisys.tb.codegen.common.emitters.Port.PortEmitter;

/**
 * @author Whalen
 *
 */
public class MemoryRegionNames implements NameEmitter {

  private String name;
  private String address;
  private int size;
  private PortEmitter pn;

  public MemoryRegionNames(PortEmitter pn, String name, String region) {
    this.pn = pn;
    this.name = name;
    StringTokenizer tok =
          new StringTokenizer(region, ":");
    this.address = tok.nextToken();
    String size = tok.nextToken();
    if (this.address == null || size == null) {
       throw new TbException("In IRQ port " + pn.getName() + ", memory region is mis-specified");
    }
    try {
       this.size = Integer.decode(size);
    } catch (NumberFormatException ne) {
       throw new TbException("In IRQ port " + pn.getName() + ", memory region is mis-specified");
    }
  }

  public String getName() { return name; }

  public String getAddress() { return address; }

  public int getSize() { return size; }
  public String getRegionTypeName() {
     return pn.getQualifiedName() + "_" + getName() + "_type";
  }
}


text:
import { DefaultTimeZone, toUtc } from '@grafana/data';

import { ExploreId } from '../../../types';

export const createDefaultInitialState = () => {
  const t = toUtc();
  const testRange = {
    from: t,
    to: t,
    raw: {
      from: t,
      to: t,
    },
  };

  const defaultInitialState = {
    user: {
      orgId: '1',
      timeZone: DefaultTimeZone,
    },
    explore: {
      [ExploreId.left]: {
        datasourceInstance: {
          query: jest.fn(),
          getRef: jest.fn(),
          getLogsVolumeDataProvider: jest.fn(),
          meta: {
            id: 'something',
          },
        },
        initialized: true,
        containerWidth: 1920,
        eventBridge: { emit: () => {} } as any,
        queries: [{ expr: 'test' }] as any[],
        range: testRange,
        history: [],
        refreshInterval: {
          label: 'Off',
          value: 0,
        },
        cache: [],
        richHistory: [],
      },
    },
  };

  return { testRange, defaultInitialState };
};


text:
<?php

namespace OpenCloud\Identity\Resource;

use OpenCloud\Common\PersistentObject;

/**
 * Token class for token functionality.
 *
 * A token is an opaque string that represents an authorization to access cloud resources. Tokens may be revoked at any
 * time and are valid for a finite duration.
 *
 * @package OpenCloud\Identity\Resource
 */
class Token extends PersistentObject
{
    /** @var string The token ID */
    private $id;

    /** @var string Timestamp of when this token will expire */
    private $expires;

    protected static $url_resource = 'tokens';

    /**
     * @param $id Sets the ID
     */
    public function setId($id)
    {
        $this->id = $id;
    }

    /**
     * @return string Returns the ID
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param $expires Set the expiry timestamp
     */
    public function setExpires($expires)
    {
        $this->expires = $expires;
    }

    /**
     * @return string Get the expiry timestamp
     */
    public function getExpires()
    {
        return $this->expires;
    }

    /**
     * @return bool Check whether this token has expired (i.e. still valid or not)
     */
    public function hasExpired()
    {
        return time() >= strtotime($this->expires);
    }
}


text:
package mb.statix.generator.util;

import java.util.Random;

public class RandomGenerator implements org.apache.commons.math3.random.RandomGenerator {

    private final Random rnd;

    public RandomGenerator(Random rnd) {
        this.rnd = rnd;
    }

    @Override public void setSeed(int seed) {
        throw new UnsupportedOperationException();
    }

    @Override public void setSeed(int[] seed) {
        throw new UnsupportedOperationException();
    }

    @Override public void setSeed(long seed) {
        throw new UnsupportedOperationException();
    }

    @Override public void nextBytes(byte[] bytes) {
        rnd.nextBytes(bytes);
    }

    @Override public int nextInt() {
        return rnd.nextInt();
    }

    @Override public int nextInt(int n) {
        return rnd.nextInt(n);
    }

    @Override public long nextLong() {
        return rnd.nextLong();
    }

    @Override public boolean nextBoolean() {
        return rnd.nextBoolean();
    }

    @Override public float nextFloat() {
        return rnd.nextFloat();
    }

    @Override public double nextDouble() {
        return rnd.nextDouble();
    }

    @Override public double nextGaussian() {
        return rnd.nextGaussian();
    }

}


text:
using FFXIV.Framework.Globalization;

namespace ACT.SpecialSpellTimer.resources
{
    public interface ILocalizable
    {
        void SetLocale(Locales locale);
    }
}


text:
package com.hsdc.dp.intf.service.mediator;

import java.util.List;

import com.hsdc.dp.intf.dto.mediator.Product;

public interface StockingUco {
	List<Product> getAllProducts();
	boolean checkQunatity(String prodName);
}


text:
package io.xn.dx;

import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import com.google.common.collect.Maps;
import org.junit.Before;
import org.junit.Test;

import java.util.Map;

import static org.assertj.core.api.Assertions.assertThat;

public class JacksonTest
{
    private ObjectMapper mapper;
    private String yaml;

    @Before
    public void setUp() throws Exception
    {
        mapper = new ObjectMapper(new YAMLFactory());
        yaml = "---\n" +
               "server:\n" +
               "  host: 0.0.0.0\n" +
               "  port: 7070\n" +
               "foo.rb:\n" +
               "  path: /tmp/\n" +
               "bar.jar:\n" +
               "  url: http://dx.xn.io/\n";
    }

    @Test
    public void testCaptureRandomTopLevelObjects() throws Exception
    {
        ConfigTree config = mapper.readValue(yaml, ConfigTree.class);

        assertThat(config.plugins.keySet()).containsExactly("foo.rb", "bar.jar");
        assertThat(config.server).isEqualToComparingFieldByField(new Server()
        {{
                this.host = "0.0.0.0";
                this.port = 7070;
            }});
    }

    @Test
    public void testRegenerateYaml() throws Exception
    {
        ConfigTree config = mapper.readValue(yaml, ConfigTree.class);
        JsonNode node = config.plugins.get("foo.rb");
        String foo = mapper.writeValueAsString(node);
        assertThat(foo).isEqualTo("---\npath: \"/tmp/\"\n");
    }

    public static class Server
    {
        public String host;
        public Integer port;
        public JsonNode child;
    }

    public static class ConfigTree
    {
        public Server server;
        public Map<String, JsonNode> plugins = Maps.newLinkedHashMap();

        @JsonAnySetter
        public void plugin(String name, JsonNode node)
        {
            plugins.put(name, node);
        }
    }

}


text:
<?php

namespace RenanBr\PhpAct\Report;

abstract class Factory
{
    /**
     * @param string $format
     * @return ReportInterface
     */
    public static function create($format)
    {
        switch ($format) {
            case 'text':
                return new TextReport();
            case 'markdown':
                return new MarkdownReport();
            case 'html':
                return new HtmlReport();
            case 'xml':
                return new XmlReport();
            case 'console':
                return new ConsoleReport();
            default:
                throw new \InvalidArgumentException(
                    "Invalid '$format' report format given"
                );
        }
    }
}


text:
    This example shows how to use the client-side API of Telerik Chart for ASP.NET MVC.

    To use the client-side API you should first retrieve the chart's client-side object.

<script type="text/javascript">
function getChart(){
    // The chart name is "chart"
    return $("#chart").data("tChart");
}
</script>

    Available client-side methods:

        refresh() repaints the Chart. Starting with the 2011 Q3 release this method no longer rebinds the Chart!

        rebind(data) rebinds a client-side bound chart.
        You can pass a data object containing additional arguments to the action method.


text:
var faker = require("faker");
var _ = require("lodash");
var util = require("../util/util");

var defaultInput = require("../util/test-input");
var parseXY = require("../../src/js/charts/cb-xy/parse-xy");
var xyConfig = require("../../src/js/charts/cb-xy/xy-config");
var inputKeys = Object.keys(defaultInput);

var options = {
	type: ["line", "column", "scatterPlot"],
	axis: ["left", "right"]
};

var defaultOpts = {
	size: "auto"
};

function generateXY(_opts) {
	_opts = _opts || {};
	var opts = _.defaults(_opts, defaultOpts);

	var randChartProps = {
		scale: {
			primaryScale: {
				prefix: faker.finance.currencySymbol(),
				suffix: " " + faker.hacker.noun() + "s",
				ticks: util.randInt(3, 8),
				precision: 0
			},
			secondaryScale: {
				precision: 0
			}
		},
		input: {
			raw: defaultInput.init_data_ordinal,
			status: "VALID",
			valid: true
		},
		chartSettings: [],
		data: [],
		extraPadding: {
			top: 0,
			right: 0,
			bottom: 0,
			left: 0
		},
		_annotations: {
			labels: {
				hasDragged: false,
				values: []
			}
		},
		_dateScale: {
			dateFrequency: "auto",
			dateFormat: "M"
		},
		mobile: {}
	};

	var randMetadata = {
		id: null,
		chartType: "xy",
		title: faker.company.catchPhrase(),
		source: "Data: " + faker.company.companyName(),
		credit: faker.address.country() + " | " + faker.internet.domainName(),
		size: opts.size
	};

	var chartProps = parseXY(xyConfig, randChartProps);
	var anyDragged = false;

	_.each(chartProps.data, function(d, i) {
		var randSetting = {
			type: util.randArrElement(options.type),
			colorIndex: util.randInt(0, 9),
			altAxis: false
		};

		chartProps.chartSettings[i] = randSetting;
	});

	chartProps._annotations.labels.hasDragged = anyDragged;
	chartProps = parseXY(xyConfig, chartProps);

	return {
		chartProps: chartProps,
		metadata: randMetadata
	};
}

module.exports = generateXY;


text:
import {Meteor} from 'meteor/meteor';

import { Router } from 'meteor/iron:router';
import _ from 'underscore';

import { attachBaseSchema } from '../schemas';

import schema_extension from './schema';
import {
    typeOptions,
    roleOptions,
    routePaths,
    statusOptions,
    unstartedStatuses,
} from './constants';

let instanceMethods = {
        getURL: function() {
            if (Meteor.isServer){
                return;
            }

            let route = routePaths[this.tblType];
            if(route){
                return Router.path(route, {_id: this._id});
            } else {
                return Router.path('Http404');
            }
        },
        canEdit: function() {
            var currentUser = Meteor.user(),
                ids = [], id;

            if (currentUser) id = currentUser._id;
            if (id === undefined) return false;
            if (currentUser.roles.indexOf('superuser') >= 0) return true;

            ids = _.chain(this.user_roles)
                    .filter(function(v){return v.role === 'projectManagers';})
                    .pluck('user_id')
                    .value();

            return (id === this.user_id) || _.contains(ids, id);
        },
        getStatusColorClass: function() {
            return statusOptions[this.status];
        },
    },
    classMethods = {
        typeOptions,
        roleOptions,
        routePaths,
        statusOptions,
        unstartedStatuses,
    },
    Tables = new Meteor.Collection('tables', {
        transform: function (doc) {
            return  _.extend(Object.create(instanceMethods), doc);
        },
    });

_.extend(Tables, classMethods);
attachBaseSchema(Tables, schema_extension);

export default Tables;


text:
use sexp::*;
use std::collections::HashMap;
use std::ascii::StrAsciiExt;

pub fn parse(source: &str) -> Result<Sexp, &'static str> {
    let arg = format!("({:s})", source);
    let cells = parse_cells(arg.as_slice());
    match cells {
        Ok(a) => {
            let result = Sexp{sexp: a.value, signatures: a.signatures};
            return Ok(result);
        }
        Err(message) => {
            return Err(message);
        }
    }
}

struct ParseResult {
    value:      Cell,
    left:       String,
    signatures: HashMap<String, TypeSignature>
}

struct SignatureParseResult {
    types: TypeSignature,
    left:        String
}

fn parse_cells(source: &str) -> Result<ParseResult, &'static str> {
    let trimmed_source = source.trim();

    let first = trimmed_source.char_at(0);
    if first == '{' {
        let l = parse_signature(trimmed_source.slice_from(1));
        match l {
            Ok(m) => {
                // hack to map signatures to fun and action forms
                let next = m.left.as_slice().trim();
                if !next.is_empty() && next.char_at(0) == '(' {
                    let mut z = parse_list(next.slice_from(1));
                    match z {
                        Ok(result) => {
                            match result.value {
                                ListCell(a) => {
                                    match *a.get(0) {
                                        StringCell(b) => {
                                            if b.as_slice() == "fun" || b.as_slice() == "action" {
                                                result.signatures.insert(b, m.types);
                                                return Ok(result);
                                            }
                                            else {
                                               return Err("type signature is valid only for fun");
                                            }
                                        }
                                        _ => {
                                           return Err("type signature is valid only for fun");
                                        }
                                    }
                                }
                                _ => {
                                    return Err("type signature is valid only for fun");
                                }
                            }
                        }
                        Err(message) => {
                            return Err(message);
                        }
                    }
                }
                else {
                    return Err("type signature is valid only for fun");
                }
            }
            Err(ex) => {
                return Err(ex);
            }
        }
    }
    else if first == '(' {
        return parse_list(trimmed_source.slice_from(1));
    }
    else if first == '"' {
        return Ok(parse_string(trimmed_source.slice_from(1)));
    }
    else if first.is_digit() {
        return Ok(parse_int(trimmed_source));
    }
    else { //if first.is_digit_radix(36) {
        return Ok(parse_ident(trimmed_source));
    }
}

fn parse_list(source: &str) -> Result<ParseResult, &'static str> {
    // parse 2 4 ) 2 -> ListCell([IntCell(2), IntCell(4)]), " 2"
    let mut list = vec![];
    let trimmed_source = source.trim();
    let mut first = trimmed_source.char_at(0);
    let mut left = String::from_str(trimmed_source);

    while first != ')' {
        let r = parse_cells(left.as_slice());
        match r {
            Ok(result) => {
                let l = result.left;
                left = l.to_string();
                list.push(result.value);
            }
            Err(message) => {
                return Err(message);
            }
        }

        if left.is_empty() {
            return Ok(ParseResult{value: ListCell(list), left: left, signatures: HashMap::new()});
        }
        else {
            first = left.as_slice().char_at(0);
        }
    }

    return Ok(ParseResult{value: ListCell(list), left: left, signatures: HashMap::new()});
}

fn parse_int(source: &str) -> ParseResult {
    // parse 23 ew -> IntCell(23), " ew"
    let mut number = 0u;
    let mut index = 0u;
    while index < source.len() && source.char_at(index).is_digit() {
        let digit = source.char_at(index).to_digit(10);
        match digit {
            Some(x) => {
                number = 10 * number + x;
                index += 1;
            }
            None => { break }
        }
    }
    return ParseResult{value: IntCell(number), left: source.slice_from(index).to_string(), signatures: HashMap::new()}
}

fn parse_ident(source: &str) -> ParseResult {
    let mut label = String::from_str("");
    let mut index = 0u;

    while index < source.len() && source.char_at(index) != ' ' {
        label.push_char(source.char_at(index));
        index += 1;
    }
    return ParseResult{value: IdentCell(label), left: source.slice_from(index).to_string(), signatures: HashMap::new()}
}

fn parse_string(source: &str) -> ParseResult {
    // parse e" 2 -> StringCell("e"), " 2"
    let mut label = String::from_str("");
    let mut index = 0u;

    while index < source.len() && source.char_at(index) != '"' {
        label.push_char(source.char_at(index));
        index += 1;
    }
    return ParseResult{value: StringCell(label), left: source.slice_from(index + 1).to_string(), signatures: HashMap::new()}
}

fn parse_signature(source: &str) -> Result<SignatureParseResult, &'static str> {
    let mut t = vec![];
    let mut parameters = vec![];
    let trimmed_source = source.trim();
    let mut first = trimmed_source.char_at(0);
    let mut left = String::from_str(trimmed_source);

    while first != '}' {
        let r = parse_cells(left.as_slice());
        match r {
            Ok(result) => {
                match result.value {
                    IdentCell(label) => {
                        if label.as_slice().char_at(0).is_uppercase() {
                            t.push(Type{label: label});
                        }
                        else if !parameters.contains(&label) {
                            parameters.push(ParameterType{label: label});
                        }
                        left = result.left;
                    }
                    _ => {
                        return Err("expected a label");
                    }
                }
            }
            Err(message) => { return Err(message); }
        }
        if left.is_empty() {
            return Ok(SignatureParseResult{types: TypeSignature{types: t, parameters: parameters}, left: left});
        }
        else {
            first = left.as_slice().char_at(0);
        }
    }

    return Ok(SignatureParseResult{types: TypeSignature{types: t, parameters: parameters}, left: left});
}


text:
#ifndef _R819XU_PHY_H
#define _R819XU_PHY_H

/* Channel switch: the size of command tables for switch channel */
#define MAX_PRECMD_CNT 16
#define MAX_RFDEPENDCMD_CNT 16
#define MAX_POSTCMD_CNT 16

#define MACPHY_Array_PGLength 30
#define Rtl819XMACPHY_Array_PG Rtl8192PciEMACPHY_Array_PG
#define Rtl819XMACPHY_Array Rtl8192PciEMACPHY_Array
#define RadioC_ArrayLength 1
#define RadioD_ArrayLength 1
#define Rtl819XRadioA_Array Rtl8192PciERadioA_Array
#define Rtl819XRadioB_Array Rtl8192PciERadioB_Array
#define Rtl819XRadioC_Array Rtl8192PciERadioC_Array
#define Rtl819XRadioD_Array Rtl8192PciERadioD_Array
#define Rtl819XAGCTAB_Array Rtl8192PciEAGCTAB_Array
#define PHY_REGArrayLength 1
#define Rtl819XPHY_REGArray Rtl8192PciEPHY_REGArray
#define PHY_REG_1T2RArrayLength 296
#define Rtl819XPHY_REG_1T2RArray Rtl8192PciEPHY_REG_1T2RArray

#define AGCTAB_ArrayLength 384
#define MACPHY_ArrayLength 18

#define RadioA_ArrayLength 246
#define RadioB_ArrayLength 78

typedef enum _SwChnlCmdID {
	CmdID_End,
	CmdID_SetTxPowerLevel,
	CmdID_BBRegWrite10,
	CmdID_WritePortUlong,
	CmdID_WritePortUshort,
	CmdID_WritePortUchar,
	CmdID_RF_WriteReg,
} SwChnlCmdID;

/* switch channel data structure */
typedef struct _SwChnlCmd {
	SwChnlCmdID CmdID;
	u32 Para1;
	u32 Para2;
	u32 msDelay;
} __attribute__ ((packed)) SwChnlCmd;

extern u32 rtl819XMACPHY_Array_PG[];
extern u32 rtl819XPHY_REG_1T2RArray[];
extern u32 rtl819XAGCTAB_Array[];
extern u32 rtl819XRadioA_Array[];
extern u32 rtl819XRadioB_Array[];
extern u32 rtl819XRadioC_Array[];
extern u32 rtl819XRadioD_Array[];

typedef enum _HW90_BLOCK {
	HW90_BLOCK_MAC = 0,
	HW90_BLOCK_PHY0 = 1,
	HW90_BLOCK_PHY1 = 2,
	HW90_BLOCK_RF = 3,
	/* Don't ever use this. */
	HW90_BLOCK_MAXIMUM = 4,
} HW90_BLOCK_E, *PHW90_BLOCK_E;

typedef enum _RF90_RADIO_PATH {
	/* Radio paths */
	RF90_PATH_A = 0,
	RF90_PATH_B = 1,
	RF90_PATH_C = 2,
	RF90_PATH_D = 3,

	/* Max RF number 92 support */
	RF90_PATH_MAX
} RF90_RADIO_PATH_E, *PRF90_RADIO_PATH_E;

#define bMaskByte0 0xff
#define bMaskByte1 0xff00
#define bMaskByte2 0xff0000
#define bMaskByte3 0xff000000
#define bMaskHWord 0xffff0000
#define bMaskLWord 0x0000ffff
#define bMaskDWord 0xffffffff

u8 rtl8192_phy_CheckIsLegalRFPath(struct r8192_priv *priv, u32 eRFPath);

void rtl8192_setBBreg(struct r8192_priv *priv, u32 dwRegAddr,
			     u32 dwBitMask, u32 dwData);

u32 rtl8192_QueryBBReg(struct r8192_priv *priv, u32 dwRegAddr,
			     u32 dwBitMask);

void rtl8192_phy_SetRFReg(struct r8192_priv *priv,
		RF90_RADIO_PATH_E eRFPath, u32 RegAddr,
		u32 BitMask, u32 Data);

u32 rtl8192_phy_QueryRFReg(struct r8192_priv *priv,
		RF90_RADIO_PATH_E eRFPath, u32 RegAddr, u32 BitMask);

void rtl8192_phy_configmac(struct r8192_priv *priv);

void rtl8192_phyConfigBB(struct r8192_priv *priv, u8 ConfigType);

RT_STATUS rtl8192_phy_checkBBAndRF(struct r8192_priv *priv,
		HW90_BLOCK_E CheckBlock, RF90_RADIO_PATH_E eRFPath);

RT_STATUS rtl8192_BBConfig(struct r8192_priv *priv);

void rtl8192_phy_getTxPower(struct r8192_priv *priv);

void rtl8192_phy_setTxPower(struct r8192_priv *priv, u8 channel);

RT_STATUS rtl8192_phy_RFConfig(struct r8192_priv *priv);

void rtl8192_phy_updateInitGain(struct r8192_priv *priv);

u8 rtl8192_phy_ConfigRFWithHeaderFile(struct r8192_priv *priv,
					RF90_RADIO_PATH_E eRFPath);

u8 rtl8192_phy_SwChnl(struct ieee80211_device *ieee80211, u8 channel);

void rtl8192_SetBWMode(struct ieee80211_device *ieee80211,
		HT_CHANNEL_WIDTH Bandwidth, HT_EXTCHNL_OFFSET Offset);

void rtl8192_SwChnl_WorkItem(struct r8192_priv *priv);

void rtl8192_SetBWModeWorkItem(struct r8192_priv *priv);

void InitialGain819xPci(struct ieee80211_device *ieee, u8 Operation);

#endif /* _R819XU_PHY_H */


text:
// -*- c++ -*-
// Generated by gmmproc 2.46.2 -- DO NOT MODIFY!
#ifndef _GIOMM_VOLUMEMONITOR_H
#define _GIOMM_VOLUMEMONITOR_H

#include <giommconfig.h>

#include <glibmm/ustring.h>
#include <sigc++/sigc++.h>

#include <giomm/drive.h>
#include <giomm/volume.h>
#include <giomm/mount.h>

#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GVolumeMonitor GVolumeMonitor;
typedef struct _GVolumeMonitorClass GVolumeMonitorClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Gio
{ class VolumeMonitor_Class; } // namespace Gio
#endif //DOXYGEN_SHOULD_SKIP_THIS

namespace Gio
{

/** Monitors a file or directory for changes.
 * VolumeMonitor is for listing the user-interesting devices and volumes on the
 * computer. In other words, what a file selector or file manager would show in
 * a sidebar.
 *
 * @newin{2,16}
 */

class VolumeMonitor : public Glib::Object
{

#ifndef DOXYGEN_SHOULD_SKIP_THIS

public:
  typedef VolumeMonitor CppObjectType;
  typedef VolumeMonitor_Class CppClassType;
  typedef GVolumeMonitor BaseObjectType;
  typedef GVolumeMonitorClass BaseClassType;

  // noncopyable
  VolumeMonitor(const VolumeMonitor&) = delete;
  VolumeMonitor& operator=(const VolumeMonitor&) = delete;

private:  friend class VolumeMonitor_Class;
  static CppClassType volumemonitor_class_;

protected:
  explicit VolumeMonitor(const Glib::ConstructParams& construct_params);
  explicit VolumeMonitor(GVolumeMonitor* castitem);

#endif /* DOXYGEN_SHOULD_SKIP_THIS */

public:

  VolumeMonitor(VolumeMonitor&& src) noexcept;
  VolumeMonitor& operator=(VolumeMonitor&& src) noexcept;

  virtual ~VolumeMonitor() noexcept;

  /** Get the GType for this class, for use with the underlying GObject type system.
   */
  static GType get_type()      G_GNUC_CONST;

#ifndef DOXYGEN_SHOULD_SKIP_THIS

  static GType get_base_type() G_GNUC_CONST;
#endif

  ///Provides access to the underlying C GObject.
  GVolumeMonitor*       gobj()       { return reinterpret_cast<GVolumeMonitor*>(gobject_); }

  ///Provides access to the underlying C GObject.
  const GVolumeMonitor* gobj() const { return reinterpret_cast<GVolumeMonitor*>(gobject_); }

  ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
  GVolumeMonitor* gobj_copy();

private:

protected:

public:

  /** Gets the volume monitor used by gio.
   *
   * @return A reference to the VolumeMonitor used by gio. Call
   * Glib::object_unref() when done with it.
   */
  static Glib::RefPtr<VolumeMonitor> get();

  /** Gets a list of drives connected to the system.
   *
   * The returned list should be freed with Glib::list_free(), after
   * its elements have been unreffed with Glib::object_unref().
   *
   * @return A List of connected Drive objects.
   */
  Glib::ListHandle< Glib::RefPtr<Drive> > get_connected_drives();

  /** Gets a list of the volumes on the system.
   *
   * The returned list should be freed with Glib::list_free(), after
   * its elements have been unreffed with Glib::object_unref().
   *
   * @return A List of Volume objects.
   */
  Glib::ListHandle< Glib::RefPtr<Volume> > get_volumes();

  /** Gets a list of the mounts on the system.
   *
   * The returned list should be freed with Glib::list_free(), after
   * its elements have been unreffed with Glib::object_unref().
   *
   * @return A List of Mount objects.
   */
  Glib::ListHandle< Glib::RefPtr<Mount> > get_mounts();

  /** Finds a Volume object by its UUID (see g_volume_get_uuid())
   *
   * @param uuid The UUID to look for.
   * @return A Volume or <tt>0</tt> if no such volume is available.
   * Free the returned object with Glib::object_unref().
   */
  Glib::RefPtr<Volume> get_volume_for_uuid(const std::string& uuid);

  /** Finds a Mount object by its UUID (see g_mount_get_uuid())
   *
   * @param uuid The UUID to look for.
   * @return A Mount or <tt>0</tt> if no such mount is available.
   * Free the returned object with Glib::object_unref().
   */
  Glib::RefPtr<Mount> get_mount_for_uuid(const std::string& uuid);

#ifndef GIOMM_DISABLE_DEPRECATED

  /** This function should be called by any VolumeMonitor
   * implementation when a new Mount object is created that is not
   * associated with a Volume object. It must be called just before
   * emitting the @a mount_added signal.
   *
   * If the return value is not <tt>0</tt>, the caller must associate the
   * returned Volume object with the Mount. This involves returning
   * it in its g_mount_get_volume() implementation. The caller must
   * also listen for the "removed" signal on the returned object
   * and give up its reference when handling that signal
   *
   * Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
   * the implementor must take a reference to @a mount and return it in
   * its g_volume_get_mount() implemented. Also, the implementor must
   * listen for the "unmounted" signal on @a mount and give up its
   * reference upon handling that signal.
   *
   * There are two main use cases for this function.
   *
   * One is when implementing a user space file system driver that reads
   * blocks of a block device that is already represented by the native
   * volume monitor (for example a CD Audio file system driver). Such
   * a driver will generate its own Mount object that needs to be
   * associated with the Volume object that represents the volume.
   *
   * The other is for implementing a VolumeMonitor whose sole purpose
   * is to return Volume objects representing entries in the users
   * "favorite servers" list or similar.
   *
   * Deprecated: 2.20: Instead of using this function, VolumeMonitor
   * implementations should instead create shadow mounts with the URI of
   * the mount they intend to adopt. See the proxy volume monitor in
   * gvfs for an example of this. Also see g_mount_is_shadowed(),
   * g_mount_shadow() and g_mount_unshadow() functions.
   *
   * @deprecated Instead of using this function, create shadow mounts with the URI of the mount you intend to adopt.
   *
   * @param mount A Mount object to find a parent for.
   * @return The Volume object that is the parent for @a mount or <tt>0</tt>
   * if no wants to adopt the Mount.
   */
  static Glib::RefPtr<Volume> adopt_orphan_mount(const Glib::RefPtr<Mount>& mount);
#endif // GIOMM_DISABLE_DEPRECATED

  /**
   * @par Slot Prototype:
   * <tt>void on_my_%volume_added(const Glib::RefPtr<Volume>& volume)</tt>
   *
   * Emitted when a mountable volume is added to the system.
   *
   * @param volume A Volume that was added.
   */

  Glib::SignalProxy1< void,const Glib::RefPtr<Volume>& > signal_volume_added();

  /**
   * @par Slot Prototype:
   * <tt>void on_my_%volume_removed(const Glib::RefPtr<Volume>& volume)</tt>
   *
   * Emitted when a mountable volume is removed from the system.
   *
   * @param volume A Volume that was removed.
   */

  Glib::SignalProxy1< void,const Glib::RefPtr<Volume>& > signal_volume_removed();

  /**
   * @par Slot Prototype:
   * <tt>void on_my_%volume_changed(const Glib::RefPtr<Volume>& volume)</tt>
   *
   * Emitted when mountable volume is changed.
   *
   * @param volume A Volume that changed.
   */

  Glib::SignalProxy1< void,const Glib::RefPtr<Volume>& > signal_volume_changed();

  /**
   * @par Slot Prototype:
   * <tt>void on_my_%mount_added(const Glib::RefPtr<Mount>& mount)</tt>
   *
   * Emitted when a mount is added.
   *
   * @param mount A Mount that was added.
   */

  Glib::SignalProxy1< void,const Glib::RefPtr<Mount>& > signal_mount_added();

  /**
   * @par Slot Prototype:
   * <tt>void on_my_%mount_removed(const Glib::RefPtr<Mount>& mount)</tt>
   *
   * Emitted when a mount is removed.
   *
   * @param mount A Mount that was removed.
   */

  Glib::SignalProxy1< void,const Glib::RefPtr<Mount>& > signal_mount_removed();

  /**
   * @par Slot Prototype:
   * <tt>void on_my_%mount_pre_unmount(const Glib::RefPtr<Mount>& mount)</tt>
   *
   * Emitted when a mount is about to be removed.
   *
   * @param mount A Mount that is being unmounted.
   */

  Glib::SignalProxy1< void,const Glib::RefPtr<Mount>& > signal_mount_pre_unmount();

  /**
   * @par Slot Prototype:
   * <tt>void on_my_%mount_changed(const Glib::RefPtr<Mount>& mount)</tt>
   *
   * Emitted when a mount changes.
   *
   * @param mount A Mount that changed.
   */

  Glib::SignalProxy1< void,const Glib::RefPtr<Mount>& > signal_mount_changed();

  /**
   * @par Slot Prototype:
   * <tt>void on_my_%drive_connected(const Glib::RefPtr<Drive>& drive)</tt>
   *
   * Emitted when a drive is connected to the system.
   *
   * @param drive A Drive that was connected.
   */

  Glib::SignalProxy1< void,const Glib::RefPtr<Drive>& > signal_drive_connected();

  /**
   * @par Slot Prototype:
   * <tt>void on_my_%drive_disconnected(const Glib::RefPtr<Drive>& drive)</tt>
   *
   * Emitted when a drive is disconnected from the system.
   *
   * @param drive A Drive that was disconnected.
   */

  Glib::SignalProxy1< void,const Glib::RefPtr<Drive>& > signal_drive_disconnected();

  /**
   * @par Slot Prototype:
   * <tt>void on_my_%drive_changed(const Glib::RefPtr<Drive>& drive)</tt>
   *
   * Emitted when a drive changes.
   *
   * @param drive The drive that changed.
   */

  Glib::SignalProxy1< void,const Glib::RefPtr<Drive>& > signal_drive_changed();

  //TODO: Remove no_default_handler when we can break ABI:

  /**
   * @par Slot Prototype:
   * <tt>void on_my_%drive_eject_button(const Glib::RefPtr<Drive>& drive)</tt>
   *
   * Emitted when the eject button is pressed on @a drive.
   *
   * @newin{2,18}
   *
   * @param drive The drive where the eject button was pressed.
   */

  Glib::SignalProxy1< void,const Glib::RefPtr<Drive>& > signal_drive_eject_button();

  /**
   * @par Slot Prototype:
   * <tt>void on_my_%drive_stop_button(const Glib::RefPtr<Drive>& drive)</tt>
   *
   * Emitted when the stop button is pressed on @a drive.
   *
   * @newin{2,22}
   *
   * @param drive The drive where the stop button was pressed.
   */

  Glib::SignalProxy1< void,const Glib::RefPtr<Drive>& > signal_drive_stop_button();

  //TODO: Use ListHandle?
  //_WRAP_VFUNC(GList* get_volumes(), get_volumes)
  //_WRAP_VFUNC(GList* get_mounts(), get_mounts)

  //_WRAP_VFUNC(Glib::RefPtr<Volume> get_volume_for_uuid(const std::string& uuid), get_volume_for_uuid)

  //_WRAP_VFUNC(Glib::RefPtr<Mount> get_mount_for_uuid(const std::string& uuid), get_mount_for_uuid)

  //There are no properties.

public:

public:
  //C++ methods used to invoke GTK+ virtual functions:

protected:
  //GTK+ Virtual Functions (override these to change behaviour):

  //Default Signal Handlers::
  /// This is a default handler for the signal signal_volume_added().
  virtual void on_volume_added(const Glib::RefPtr<Volume>& volume);
  /// This is a default handler for the signal signal_volume_removed().
  virtual void on_volume_removed(const Glib::RefPtr<Volume>& volume);
  /// This is a default handler for the signal signal_volume_changed().
  virtual void on_volume_changed(const Glib::RefPtr<Volume>& volume);
  /// This is a default handler for the signal signal_mount_added().
  virtual void on_mount_added(const Glib::RefPtr<Mount>& mount);
  /// This is a default handler for the signal signal_mount_removed().
  virtual void on_mount_removed(const Glib::RefPtr<Mount>& mount);
  /// This is a default handler for the signal signal_mount_pre_unmount().
  virtual void on_mount_pre_unmount(const Glib::RefPtr<Mount>& mount);
  /// This is a default handler for the signal signal_mount_changed().
  virtual void on_mount_changed(const Glib::RefPtr<Mount>& mount);
  /// This is a default handler for the signal signal_drive_connected().
  virtual void on_drive_connected(const Glib::RefPtr<Drive>& drive);
  /// This is a default handler for the signal signal_drive_disconnected().
  virtual void on_drive_disconnected(const Glib::RefPtr<Drive>& drive);
  /// This is a default handler for the signal signal_drive_changed().
  virtual void on_drive_changed(const Glib::RefPtr<Drive>& drive);

};

} // namespace Gio

namespace Glib
{
  /** A Glib::wrap() method for this object.
   *
   * @param object The C instance.
   * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
   * @result A C++ instance that wraps this C instance.
   *
   * @relates Gio::VolumeMonitor
   */
  Glib::RefPtr<Gio::VolumeMonitor> wrap(GVolumeMonitor* object, bool take_copy = false);
}

#endif /* _GIOMM_VOLUMEMONITOR_H */


text:
<!DOCTYPE HTML>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>

<button id="button">Button</button>
<label id="label" for="button" style="display:none" aria-label="AriaLabel">Label</label>

<script>
test(function(t){
    var axButton = accessibilityController.accessibleElementById("button");

    // Get the AXObject for the label indirectly, even though it's display:none.
    // Ensure that it's valid.
    var axLabel = axButton.titleUIElement();
    assert_equals(axLabel.isValid, true);
    assert_equals(axLabel.deprecatedDescription, 'AXDescription: AriaLabel');

    // Now un-hide the label.
    var label = document.getElementById('label');
    label.style.display = "block";

    // Ensure that the previous AXObject we had for the label is now invalid, but if
    // we fetch an AXObject for it, we get a new valid object.
    var axLabel2 = axButton.titleUIElement();
    assert_equals(axLabel.isValid, false);
    assert_equals(axLabel2.isValid, true);
    assert_equals(axLabel2.deprecatedDescription, 'AXDescription: AriaLabel');
    assert_equals(axLabel.isEqual(axLabel2), false);

    // Now hide the label again.
    label.style.display = "none";

    // Check once more: the second AXObject is now invalid, but if we fetch
    // an AXObject for the label a third time, we get a valid object again.
    var axLabel3 = axButton.titleUIElement();
    assert_equals(axLabel.isValid, false);
    assert_equals(axLabel2.isValid, false);
    assert_equals(axLabel3.isValid, true);
    assert_equals(axLabel3.deprecatedDescription, 'AXDescription: AriaLabel');
    assert_equals(axLabel.isEqual(axLabel3), false);
    assert_equals(axLabel2.isEqual(axLabel3), false);
}, "Accessibility objects for display:none elements");

if (window.testRunner)
    document.getElementById('button').style.display = 'none';
</script>


text:
layout: sidebar-right
title: 'High Sheriff''s award success for Gainsborough Community Library  '
author: james-powell
date: 2020-04-06T11:53:16.380Z
category: news
breadcrumb: news
excerpt: >-
  Gainsborough Community Library are celebrating after recently winning the
  Strengthen Your Community Award at the Suffolk High Sheriff's Awards.
---
Gainsborough Community Library in Ipswich is celebrating after winning the Strengthen Your Community Award at the [Suffolk High Sheriff's Awards](https://www.suffolkcf.org.uk/meet-the-2020-high-sheriffs-award-winners/) recently.

Gainsborough Community Library plays a pivotal role in its community. Although the library is closed at the moment due to the coronavirus situation it runs around 30 different types of events and activities. These include activities for children, young people and older people, as well as health and wellbeing, arts and crafts and even sports and martial arts sessions. It also has a popular volunteer-run café.

Mandy Grimwood, Manager of Gainsborough Library, said:

"We are incredibly honoured to have received the Strengthen Your Community Award at The High Sheriff's Awards; we are so passionate about the community we are in and providing the best we can to those around us. It's not just our incredible staff and volunteers but every face that we see, that smiles with us, that uses the library or any one of our activities or services that makes Gainsborough Community Library what it is. We hope you are all safe and well, we hope to see you all soon!"

Rachel Wood of Newmarket Library Friends Group was also shortlisted for the Volunteer of the Year award.


text:
package at.fhjoanneum.ippr.processengine.akka.config;

import org.springframework.context.ApplicationContext;

import akka.actor.Actor;
import akka.actor.IndirectActorProducer;

public class SpringActorProducer implements IndirectActorProducer {

  private final ApplicationContext applicationContext;
  private final String actorBeanName;
  private Object[] args;

  public SpringActorProducer(final ApplicationContext applicationContext,
      final String actorBeanName) {
    this.applicationContext = applicationContext;
    this.actorBeanName = actorBeanName;
  }

  public SpringActorProducer(final ApplicationContext applicationContext,
      final String actorBeanName, final Object... args) {
    this(applicationContext, actorBeanName);
    this.args = args;
  }

  @Override
  public Actor produce() {
    if (args == null) {
      return (Actor) applicationContext.getBean(actorBeanName);
    } else {
      return (Actor) applicationContext.getBean(actorBeanName, args);
    }
  }

  @SuppressWarnings("unchecked")
  @Override
  public Class<? extends Actor> actorClass() {
    return (Class<? extends Actor>) applicationContext.getType(actorBeanName);
  }
}


text:
require_relative 'base'
require 'whois/scanners/base_afilias'

module Whois
  class Parsers

    # Base parser for Afilias servers.
    #
    # @abstract
    class BaseAfilias2 < Base
      include Scanners::Scannable

      self.scanner = Scanners::BaseAfilias

      property_supported :disclaimer do
        node("field:disclaimer")
      end

      property_supported :domain do
        node("Domain Name", &:downcase)
      end

      property_supported :domain_id do
        node("Domain ID")
      end

      property_supported :status do
        Array.wrap(node("Domain Status"))
      end

      property_supported :available? do
        !!node("status:available")
      end

      property_supported :registered? do
        !available?
      end

      property_supported :created_on do
        node("Creation Date") do |value|
          parse_time(value)
        end
      end

      property_supported :updated_on do
        node("Updated Date") do |value|
          parse_time(value)
        end
      end

      property_supported :expires_on do
        node("Registry Expiry Date") do |value|
          parse_time(value)
        end
      end

      property_supported :registrar do
        node("Sponsoring Registrar") do |value|
          id, name = decompose_registrar(value)

          Parser::Registrar.new({
              id:           id,
              name:         name,
          })
        end
      end

      property_supported :registrant_contacts do
        build_contact("Registrant", Parser::Contact::TYPE_REGISTRANT)
      end

      property_supported :admin_contacts do
        build_contact("Admin", Parser::Contact::TYPE_ADMINISTRATIVE)
      end

      property_supported :technical_contacts do
        build_contact("Tech", Parser::Contact::TYPE_TECHNICAL)
      end

      property_supported :nameservers do
        Array.wrap(node("Name Server")).reject(&:empty?).map do |name|
          Parser::Nameserver.new(:name => name.downcase)
        end
      end

      private

      def build_contact(element, type)
        node("#{element} ID") do
          address = ["", "1", "2", "3"]
                    .map { |i| node("#{element} Street#{i}") }
                    .delete_if { |i| i.nil? || i.empty? }
                    .join("\n")

          Parser::Contact.new(
              :type         => type,
              :id           => node("#{element} ID"),
              :name         => node("#{element} Name"),
              :organization => node("#{element} Organization"),
              :address      => address,
              :city         => node("#{element} City"),
              :zip          => node("#{element} Postal Code"),
              :state        => node("#{element} State/Province"),
              :country_code => node("#{element} Country"),
              :phone        => node("#{element} Phone"),
              :fax          => node("#{element} FAX") || node("#{element} Fax"),
              :email        => node("#{element} Email")
          )
        end
      end

      def decompose_registrar(value)
        if value =~ /(.+?) \((.+?)\)/
          [::Regexp.last_match(2), ::Regexp.last_match(1)]
        else
          [nil, value]
        end
      end

    end

  end
end


text:
/*********************************************
 * Einstellungen und Globale Variablen
 ********************************************/
//Pictures
var imgBackground, imgStart_normal, imgExit_closed, imgExit_opened, imgDirt_left, imgDirt_right, imgDirt_up, imgDirt_down;
var imgDirt_left_full, imgDirt_right_full, imgDirt_up_full, imgDirt_down_full, imgStone_normal, imgDiamond, imgWall_normal;
var imgFire, imgPlayer, imgButterfly, imgBee, imgBomb, imgCheckbox_0, imgCheckbox_1, imgCheckbox_sound_0, imgCheckbox_sound_1;
var imgCheckbox_sound_2, imgCheckbox_minus, imgCheckbox_plus;

//Sounds
var step, boulderMove, tickMusic, lostMusic, wonMusic, diamondMusic, beeMusic, butterflyMusic, explosionMusic, boulderHit, fireMusic, soundtrack;

//Globale Variablen
var levelJSON;
var canvas, ctx;
var gameLoop;
var newGame;
var pressedKey;
var gamePaused = false;
var maxLevel = 27;
var timerInterval;
var deathtxt = 'You Lost';

var gameIsLost = false;
var gameIsWon = true;
//Scoreboard
var username = "Anonymus";
var scoreboard = [];
var scoreboardEnabled = true;

var bombDelay = 5;
var fireDelay = 3;

//SpriteSheet counter
var beePic = 0;
var firePic = 0;
var diamondPic = 1;
var butterflyPics = 2;
var userDir = 3;

//Einstellungen die vom User Beeinflusst werden können
var visionLengthClick = true;
var brightness = 2;
var brightnessClick = true;
var fogOfWar = false;
var fogOfWarClick = true;
var hardmode = false;
var hardmodeClick = true;
var cheat = false;
var cheatClick = true;
var volume = 1;
var autoScore = false;
var vision = {
    "length": 13,
    "radius": (13 - 1) / 2
};

var keyControl = {
    1: 37,
    2: 38,
    3: 39,
    4: 40
}

//console.log(keyControl);

var canvasElements = {
    header: { height: 3, width: vision.length, px: { x: 0, y: 0, height: 0, width: 0 } },
    game: { height: vision.length, width: vision.length, px: { x: 0, y: 0, height: 0, width: 0 } },
    setting: { height: 6, width: 6, px: { x: 0, y: 0, height: 0, width: 0 } },
    scoreboard: { height: 10, width: 6, px: { x: 0, y: 0, height: 0, width: 0 } },
    spacer: { height: 1, width: 1, px: { x: 0, y: 0, height: 0, width: 0 } }
};

function updateCanvasElements(width, height) {
    canvasElements.header.width = width;
    canvasElements.game.width = width;
    canvasElements.game.height = height;
    canvasElements.scoreboard.height = canvasElements.game.height + canvasElements.header.height - canvasElements.setting.height;
}

//Blockarten + Eigenschaften
var blockObject = {
    start: { blockNum: 1, isExploadable: false, lightConsumption: 1, isConsumable: true, isGravity: false },
    end: { blockNum: 2, isExploadable: false, lightConsumption: 1, isConsumable: true, isGravity: false },
    empty: { blockNum: 3, isExploadable: true, lightConsumption: 1, isConsumable: true, isGravity: false },
    dirt1: { blockNum: 4, isExploadable: true, lightConsumption: 2, isConsumable: true, isGravity: false },
    dirt2: { blockNum: 5, isExploadable: true, lightConsumption: 2, isConsumable: true, isGravity: false },
    dirt3: { blockNum: 6, isExploadable: true, lightConsumption: 2, isConsumable: true, isGravity: false },
    wall1: { blockNum: 7, isExploadable: true, lightConsumption: 10, isConsumable: false, isGravity: false },
    wall2: { blockNum: 8, isExploadable: true, lightConsumption: 10, isConsumable: false, isGravity: false },
    wall3: { blockNum: 9, isExploadable: false, lightConsumption: 10, isConsumable: false, isGravity: false },
    stone1: { blockNum: 10, isExploadable: true, lightConsumption: 3, isConsumable: true, isGravity: true },
    stone2: { blockNum: 11, isExploadable: true, lightConsumption: 3, isConsumable: true, isGravity: true },
    stone3: { blockNum: 12, isExploadable: true, lightConsumption: 3, isConsumable: true, isGravity: true },
    stone4: { blockNum: 13, isExploadable: true, lightConsumption: 3, isConsumable: true, isGravity: true },
    stone5: { blockNum: 14, isExploadable: true, lightConsumption: 3, isConsumable: true, isGravity: true },
    stone6: { blockNum: 15, isExploadable: true, lightConsumption: 3, isConsumable: true, isGravity: true },
    diamond1: { blockNum: 16, isExploadable: false, lightConsumption: 1, isConsumable: true, isGravity: true },
    diamond2: { blockNum: 17, isExploadable: false, lightConsumption: 1, isConsumable: true, isGravity: true },
    diamond3: { blockNum: 18, isExploadable: false, lightConsumption: 1, isConsumable: true, isGravity: true },
    diamond4: { blockNum: 19, isExploadable: false, lightConsumption: 1, isConsumable: true, isGravity: true },
    diamond5: { blockNum: 20, isExploadable: false, lightConsumption: 1, isConsumable: true, isGravity: true },
    butterfly1: { blockNum: 21, isExploadable: true, lightConsumption: 1, isConsumable: false, isGravity: false },
    butterfly2: { blockNum: 22, isExploadable: true, lightConsumption: 1, isConsumable: false, isGravity: false },
    butterfly3: { blockNum: 23, isExploadable: true, lightConsumption: 1, isConsumable: false, isGravity: false },
    butterfly4: { blockNum: 24, isExploadable: true, lightConsumption: 1, isConsumable: false, isGravity: false },
    bee1: { blockNum: 25, isExploadable: true, lightConsumption: 1, isConsumable: false, isGravity: false },
    bee2: { blockNum: 26, isExploadable: true, lightConsumption: 1, isConsumable: false, isGravity: false },
    bee3: { blockNum: 27, isExploadable: true, lightConsumption: 1, isConsumable: false, isGravity: false },
    bee4: { blockNum: 28, isExploadable: true, lightConsumption: 1, isConsumable: false, isGravity: false },
    outOfGame: { blockNum: 29, isExploadable: false, lightConsumption: 20, isConsumable: false, isGravity: false },
    fire: { blockNum: 30, isExploadable: true, lightConsumption: 1, isConsumable: true, isGravity: false },
    bomb: { blockNum: 31, isExploadable: true, lightConsumption: 1, isConsumable: true, isGravity: false },
};

//Blöcke auch mit Key aufrufen können
for (var key in blockObject) {
    blockObject[blockObject[key].blockNum] = blockObject[key];
}

//globale Funktionen
function isExploadable(key) {
    return blockTypeExists(key) && blockObject[key].isExploadable;
}

function isConsumable(key) {
    return blockTypeExists(key) && blockObject[key].isConsumable;
}

function isGravity(key) {
    return blockTypeExists(key) && blockObject[key].isGravity;
}

function getLightConsumption(key) {
    return blockTypeExists(key) && blockObject[key].lightConsumption;
}

function blockTypeExists(key) {
    return typeof blockObject[key] !== "undefined";
}

/**
 * Funktion für Tastatur Steuerung
 * @param {any} ev
 */
function globalKey(ev) {
    if (ev.keyCode == 27) {
        if (cheat) {
            newGame = new game(newGame.curLevel);
        }
        else {
            newGame.curLevel = 1;
            newGame = new game(newGame.curLevel);
        }

    }
    if (ev.keyCode == 13 && gameIsWon) {
        if (newGame.curLevel == maxLevel) {
            newGame.curLevel = 0;
        }
        newGame.loadLevel(++newGame.curLevel);
    }
    if (ev.keyCode == 32 && !gamePaused) {
        newGame.map.placeBomb(newGame, newGame.map.user.x, newGame.map.user.y);
    }

}


text:
package org.adligo.fabricate.common.system;

import org.adligo.fabricate.common.i18n.I_CommandLineConstants;
import org.adligo.fabricate.common.i18n.I_FabricateConstants;
import org.adligo.fabricate.common.i18n.I_SystemMessages;
import org.adligo.fabricate.common.log.FabLog;
import org.adligo.fabricate.common.log.I_FabLog;
import org.adligo.fabricate.common.util.StringUtils;
import org.adligo.fabricate.xml.io_v1.fabricate_v1_0.FabricateType;
import org.adligo.fabricate.xml.io_v1.fabricate_v1_0.LogSettingType;
import org.adligo.fabricate.xml.io_v1.fabricate_v1_0.LogSettingsType;

import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;

public class FabSystemSetup {
  public static final Set<String> DEFALUT_ON_LOGS = getDefaultOns();

  private static Set<String> getDefaultOns() {
    Set<String> toRet = new HashSet<String>();

    toRet.add("org.adligo.fabricate.FabricateController");
    toRet.add("org.adligo.fabricate.managers.CommandManager");
    toRet.add("org.adligo.fabricate.managers.FabricationManager");
    toRet.add("org.adligo.fabricate.managers.ProjectsManager");
    toRet.add("org.adligo.fabricate.routines.implicit.JarRoutine");

    return Collections.unmodifiableSet(toRet);
  }

  @SuppressWarnings("boxing")
  public static Map<String, Boolean> getSettings(FabricateType fabricate, Set<String> defaultOns) {
    Map<String,Boolean> logSets = new HashMap<String,Boolean>();
    for (String clazz: defaultOns) {
      logSets.put(clazz, true);
    }
    LogSettingsType logs = fabricate.getLogs();
    if (logs != null) {
      List<LogSettingType> settings = logs.getLog();

      for (LogSettingType set: settings) {
        String clazz = set.getClazz();
        Boolean value = set.isSetting();
        if (value != null) {
          logSets.put(clazz, value);
        }
      }
    }

    return logSets;
  }

  public static void setup(FabSystem sys, String [] args) {
    Map<String,String> argMap = CommandLineArgs.parseArgs(args);

    String language = sys.getDefaultLanguage();
    String country = sys.getDefaultCountry();

    String argLoc = argMap.get(CommandLineArgs.LOCALE);
    if (argLoc != null) {
      StringTokenizer st = new StringTokenizer(argLoc, "_");
      String tempLang = st.nextToken();
      String tempCountry = st.nextToken();
      language = tempLang;
      country = tempCountry;
    }
    I_FabricateConstants constants = sys.newFabConstantsDiscovery(language, country);

    if (!argMap.containsKey(CommandLineArgs.PASSABLE_ARGS_)) {
      String passableArgs = CommandLineArgs.toPassableString(args);
      argMap.put(CommandLineArgs.PASSABLE_ARGS_, passableArgs);
    }
    I_CommandLineConstants clConstants = constants.getCommandLineConstants();
    argMap = CommandLineArgs.normalizeArgs(argMap, clConstants);
    String logAlias = clConstants.getLog(true);
    boolean debug = argMap.containsKey(logAlias);
    Map<String, Boolean> em = Collections.emptyMap();
    FabLog log = new FabLog(em, debug);
    sys.setLog(log);
    sys.setConstants(constants);
    sys.setArgs(argMap);
  }

  public static void checkManditoryInjectedArgs(I_FabSystem sys) {
    String version = sys.getArgValue("java");
    if (StringUtils.isEmpty(version)) {
      I_FabricateConstants constants = sys.getConstants();
      I_FabLog log = sys.getLog();
      I_SystemMessages sysMessages = constants.getSystemMessages();
      log.println(CommandLineArgs.END);
      throw new IllegalStateException(sysMessages.getExceptionJavaVersionParameterExpected());
    }

    String start = sys.getArgValue("start");
    if (StringUtils.isEmpty(start)) {
      I_FabricateConstants constants = sys.getConstants();
      I_FabLog log = sys.getLog();
      I_SystemMessages sysMessages = constants.getSystemMessages();
      log.println(CommandLineArgs.END);
      throw new IllegalStateException(sysMessages.getExceptionNoStartTimeArg());
    }
  }

  public static void setup(FabSystem sys, FabricateType fabricate) {
    I_FabricateConstants constants = sys.getConstants();
    I_CommandLineConstants clConstants = constants.getCommandLineConstants();
    boolean debug = sys.hasArg(clConstants.getLog(true));

    Map<String, Boolean> logSets = getSettings(fabricate, DEFALUT_ON_LOGS);
    FabLog log = new FabLog(logSets, debug);
    sys.setLog(log);
    sys.setConstants(constants);
  }
}


text:
Dinghy is a web app for facillitating a week long, collaborative "Dinghies & Dolphins" game at sea.

## Install ALL the Things

Don't forget you probably need to install the prerequisites:

```bash
dinghy$ npm install  # Back-end NodeJS stuff and JSPM dev-time needs
dinghy/public$ jspm install # Front-end In Browser stuff like System.js
```


text:
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">

		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<meta name="description" content="Association sociale de la ville de Rochefort.  Elle regroupe une maison des jeunes, une école des devoirs et une maison de quartier." />
		<meta name="author" content="previzio" />
		<title th:text="${WEBSITE_TITLE}">Title</title>

		<link rel="alternate" type="application/atom+xml" th:title="${WEBSITE_TITLE}" th:href="@{~/feed/atom.xml}" />
		<link rel="alternate" type="application/rss+xml" th:title="${WEBSITE_TITLE}" th:href="@{~/feed/rss.xml}" />

		<link rel="stylesheet" href="@{~/resources/css/bootstrap.min.css}" />
		<link rel="stylesheet" th:href="@{~/resources/css/sticky-footer-navbar.css}" href="#" />
		<link rel="stylesheet" th:href="@{~/resources/css/common.css}" href="#" />

About

Sticky footer with fixed navbar

Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS. A fixed navbar has been added within #wrap with padding-top: 60px; on the .container.

Back to the default sticky footer minus the navbar.

					secretariat@gamedella.be
					084/21.07.53

					Facebook

Conception Previz.io


text:
#include <cstdlib>
#include <cyclone/world.h>

using namespace cyclone;

World::World(unsigned maxContacts, unsigned iterations)
:
firstBody(NULL),
firstContactGen(NULL),
resolver(iterations),
maxContacts(maxContacts)
{
    contacts = new Contact[maxContacts];
    calculateIterations = (iterations == 0);
}

World::~World()
{
    delete[] contacts;
}

void World::startFrame()
{
    BodyRegistration *reg = firstBody;
    while (reg)
    {
        // Remove all forces from the accumulator
        reg->body->clearAccumulators();
        reg->body->calculateDerivedData();

        // Get the next registration
        reg = reg->next;
    }
}

unsigned World::generateContacts()
{
    unsigned limit = maxContacts;
    Contact *nextContact = contacts;

    ContactGenRegistration * reg = firstContactGen;
    while (reg)
    {
        unsigned used = reg->gen->addContact(nextContact, limit);
        limit -= used;
        nextContact += used;

        // We've run out of contacts to fill. This means we're missing
        // contacts.
        if (limit <= 0) break;

        reg = reg->next;
    }

    // Return the number of contacts used.
    return maxContacts - limit;
}

void World::runPhysics(real duration)
{
    // First apply the force generators
    //registry.updateForces(duration);

    // Then integrate the objects
    BodyRegistration *reg = firstBody;
    while (reg)
    {
        // Remove all forces from the accumulator
        reg->body->integrate(duration);

        // Get the next registration
        reg = reg->next;
    }

    // Generate contacts
    unsigned usedContacts = generateContacts();

    // And process them
    if (calculateIterations) resolver.setIterations(usedContacts * 4);
    resolver.resolveContacts(contacts, usedContacts, duration);
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>reduction-effects: Error 🔥</title>
    <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
    <link href="../../../../../bootstrap.min.css" rel="stylesheet">
    <link href="../../../../../bootstrap-custom.css" rel="stylesheet">
    <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

             Coq bench

clean / extra-dev

dev / reduction-effects - 0.1.3

            « Up

              reduction-effects

                0.1.3
                Error 🔥

📅  (2022-05-14 08:21:45 UTC)

Context

# Packages matching: installed
# Name                # Installed # Synopsis
base-bigarray         base
base-threads          base
base-unix             base
conf-findutils        1           Virtual package relying on findutils
conf-gmp              4           Virtual package relying on a GMP lib system installation
coq                   dev         Formal proof management system
dune                  3.1.1       Fast, portable, and opinionated build system
ocaml                 4.12.1      The OCaml compiler (virtual package)
ocaml-base-compiler   4.12.1      Official release 4.12.1
ocaml-config          2           OCaml Switch Configuration
ocaml-options-vanilla 1           Ensure that OCaml is compiled with no special options enabled
ocamlfind             1.9.3       A library manager for OCaml
zarith                1.12        Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "Yishuai Li <yishuai@cis.upenn.edu>"
homepage: "https://github.com/coq-community/reduction-effects"
dev-repo: "git+https://github.com/coq-community/reduction-effects.git"
bug-reports: "https://github.com/coq-community/reduction-effects/issues"
license: "MPL-2.0"
synopsis: "A Coq plugin to add reduction side effects to some Coq reduction strategies"
build:   [make "-j%{jobs}%"]
install: [make "install"]
run-test:[make "-j%{jobs}%" "test"]
depends: [
  "coq" { >= "8.10" }
]
tags: [
  "logpath:ReductionEffect"
]
authors: [
  "Hugo Herbelin"
]
url {
  src:
    "https://github.com/coq-community/reduction-effects/archive/v0.1.3.tar.gz"
  checksum: [
    "md5=d35d53ce952676472249feba84ac5c53"
    "sha512=7c3144e7f7d54374e7a9d8ce88584c385294cb69c4f66db6aadceb1975be834969d0a5f1acf10459fb117b35df6924d8d879f708068a60e9f835514e0798e5d1"
  ]
}

Lint

Command

true

Return code

0

Dry install 🏜

Dry install with the current Coq version:

Command

opam install -y --show-action coq-reduction-effects.0.1.3 coq.dev

Return code

0

Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:

Command

true

Return code

0

Install dependencies

Command

opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-reduction-effects.0.1.3 coq.dev

Return code

0

Duration

12 s

Install 🚀

Command

opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-reduction-effects.0.1.3 coq.dev

Return code

7936

Duration

15 s

Output

# Packages matching: installed
# Name                # Installed # Synopsis
base-bigarray         base
base-threads          base
base-unix             base
conf-findutils        1           Virtual package relying on findutils
conf-gmp              4           Virtual package relying on a GMP lib system installation
coq                   dev         Formal proof management system
dune                  3.1.1       Fast, portable, and opinionated build system
ocaml                 4.12.1      The OCaml compiler (virtual package)
ocaml-base-compiler   4.12.1      Official release 4.12.1
ocaml-config          2           OCaml Switch Configuration
ocaml-options-vanilla 1           Ensure that OCaml is compiled with no special options enabled
ocamlfind             1.9.3       A library manager for OCaml
zarith                1.12        Implements arithmetic and logical operations over arbitrary-precision integers
[NOTE] Package coq is already installed (current version is dev).
The following actions will be performed:
  - install coq-reduction-effects 0.1.3
<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Processing  1/1: [coq-reduction-effects.0.1.3: http]
[coq-reduction-effects.0.1.3] downloaded from https://github.com/coq-community/reduction-effects/archive/v0.1.3.tar.gz
Processing  1/1:
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Processing  1/2: [coq-reduction-effects: make]
+ /home/bench/.opam/opam-init/hooks/sandbox.sh "build" "make" "-j4" (CWD=/home/bench/.opam/ocaml-base-compiler.4.12.1/.opam-switch/build/coq-reduction-effects.0.1.3)
- coq_makefile -f _CoqProject -o Makefile.coq
- Warning: it is recommended you provide a META.package-name file
- Warning: since you build plugins. See also -generate-meta-for-package.
- make -f Makefile.coq all
- make[1]: Entering directory '/home/bench/.opam/ocaml-base-compiler.4.12.1/.opam-switch/build/coq-reduction-effects.0.1.3'
- COQDEP VFILES
- COQPP redeffect.mlg
- OCAMLLIBDEP redeffect_plugin.mlpack
- CAMLDEP redeffect.ml
- *** Error: in file PrintingEffect.v, redeffect_plugin is not a valid plugin name anymore.Plugins should be loaded using their public name according to findlib,
-            for example package-name.foo and not foo_plugin.
-            If you are building with dune < 2.9.4 you must specify both
-            the legacy and the findlib plugin name as in:
-            Declare ML Module "foo_plugin:package-name.foo".
- COQDEP VFILES
- *** Error: in file PrintingEffect.v, redeffect_plugin is not a valid plugin name anymore.Plugins should be loaded using their public name according to findlib,
-            for example package-name.foo and not foo_plugin.
-            If you are building with dune < 2.9.4 you must specify both
-            the legacy and the findlib plugin name as in:
-            Declare ML Module "foo_plugin:package-name.foo".
- COQDEP VFILES
- *** Error: in file PrintingEffect.v, redeffect_plugin is not a valid plugin name anymore.Plugins should be loaded using their public name according to findlib,
-            for example package-name.foo and not foo_plugin.
-            If you are building with dune < 2.9.4 you must specify both
-            the legacy and the findlib plugin name as in:
-            Declare ML Module "foo_plugin:package-name.foo".
- COQDEP VFILES
- *** Error: in file PrintingEffect.v, redeffect_plugin is not a valid plugin name anymore.Plugins should be loaded using their public name according to findlib,
-            for example package-name.foo and not foo_plugin.
-            If you are building with dune < 2.9.4 you must specify both
-            the legacy and the findlib plugin name as in:
-            Declare ML Module "foo_plugin:package-name.foo".
- make[2]: *** No rule to make target '.Makefile.coq.d', needed by 'PrintingEffect.vo'.  Stop.
- make[1]: *** [Makefile.coq:408: all] Error 2
- make[1]: Leaving directory '/home/bench/.opam/ocaml-base-compiler.4.12.1/.opam-switch/build/coq-reduction-effects.0.1.3'
- make: *** [Makefile:2: all] Error 2
[ERROR] The compilation of coq-reduction-effects failed at "/home/bench/.opam/opam-init/hooks/sandbox.sh build make -j4".
#=== ERROR while compiling coq-reduction-effects.0.1.3 ========================#
# context              2.0.8 | linux/x86_64 | ocaml-base-compiler.4.12.1 | file:///home/bench/run/opam-coq-archive/released
# path                 ~/.opam/ocaml-base-compiler.4.12.1/.opam-switch/build/coq-reduction-effects.0.1.3
# command              ~/.opam/opam-init/hooks/sandbox.sh build make -j4
# exit-code            2
# env-file             ~/.opam/log/coq-reduction-effects-23753-0a5907.env
# output-file          ~/.opam/log/coq-reduction-effects-23753-0a5907.out
### output ###
# *** Error: in file PrintingEffect.v, redeffect_plugin is not a valid plugin name anymore.Plugins should be loaded using their public name according to findlib,
# [...]
#            Declare ML Module "foo_plugin:package-name.foo".
# COQDEP VFILES
# *** Error: in file PrintingEffect.v, redeffect_plugin is not a valid plugin name anymore.Plugins should be loaded using their public name according to findlib,
#            for example package-name.foo and not foo_plugin.
#            If you are building with dune < 2.9.4 you must specify both
#            the legacy and the findlib plugin name as in:
#            Declare ML Module "foo_plugin:package-name.foo".
# make[2]: *** No rule to make target '.Makefile.coq.d', needed by 'PrintingEffect.vo'.  Stop.
# make[1]: *** [Makefile.coq:408: all] Error 2
# make[1]: Leaving directory '/home/bench/.opam/ocaml-base-compiler.4.12.1/.opam-switch/build/coq-reduction-effects.0.1.3'
# make: *** [Makefile:2: all] Error 2
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build coq-reduction-effects 0.1.3
+-
- No changes have been performed
# Run eval $(opam env) to update the current shell environment
'opam install -y -v coq-reduction-effects.0.1.3 coq.dev' failed.

Installation size

No files were installed.

Uninstall 🧹

Command

true

Return code

0

Missing removes

                none

Wrong removes

                none

          Sources are on GitHub © Guillaume Claret 🐣


text:
<?php

namespace Symfony\Component\Messenger\Middleware;

use Psr\Log\LoggerAwareTrait;
use Psr\Log\NullLogger;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Event\SendMessageToTransportsEvent;
use Symfony\Component\Messenger\Stamp\ForceCallHandlersStamp;
use Symfony\Component\Messenger\Stamp\ReceivedStamp;
use Symfony\Component\Messenger\Stamp\RedeliveryStamp;
use Symfony\Component\Messenger\Stamp\SentStamp;
use Symfony\Component\Messenger\Transport\Sender\SenderInterface;
use Symfony\Component\Messenger\Transport\Sender\SendersLocatorInterface;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

/**
 * @author Samuel Roze <samuel.roze@gmail.com>
 * @author Tobias Schultze <http://tobion.de>
 *
 * @experimental in 4.2
 */
class SendMessageMiddleware implements MiddlewareInterface
{
    use LoggerAwareTrait;

    private $sendersLocator;
    private $eventDispatcher;

    public function __construct(SendersLocatorInterface $sendersLocator, EventDispatcherInterface $eventDispatcher = null)
    {
        $this->sendersLocator = $sendersLocator;
        $this->eventDispatcher = $eventDispatcher;
        $this->logger = new NullLogger();
    }

    /**
     * {@inheritdoc}
     */
    public function handle(Envelope $envelope, StackInterface $stack): Envelope
    {
        $context = [
            'message' => $envelope->getMessage(),
            'class' => \get_class($envelope->getMessage()),
        ];

        $handle = false;
        $sender = null;

        try {
            if ($envelope->all(ReceivedStamp::class)) {
                // it's a received message, do not send it back
                $this->logger->info('Received message "{class}"', $context);
            } else {
                /** @var RedeliveryStamp|null $redeliveryStamp */
                $redeliveryStamp = $envelope->last(RedeliveryStamp::class);

                // dispatch event unless this is a redelivery
                $shouldDispatchEvent = null === $redeliveryStamp;
                foreach ($this->getSenders($envelope, $handle, $redeliveryStamp) as $alias => $sender) {
                    if (null !== $this->eventDispatcher && $shouldDispatchEvent) {
                        $event = new SendMessageToTransportsEvent($envelope);
                        $this->eventDispatcher->dispatch($event);
                        $envelope = $event->getEnvelope();
                        $shouldDispatchEvent = false;
                    }

                    $this->logger->info('Sending message "{class}" with "{sender}"', $context + ['sender' => \get_class($sender)]);
                    $envelope = $sender->send($envelope->with(new SentStamp(\get_class($sender), \is_string($alias) ? $alias : null)));
                }

                // if the message was marked (usually by SyncTransport) that it handlers
                // MUST be called, mark them to be handled.
                if (null !== $envelope->last(ForceCallHandlersStamp::class)) {
                    $handle = true;
                }

                // on a redelivery, only send back to queue: never call local handlers
                if (null !== $redeliveryStamp) {
                    $handle = false;
                }
            }

            if (null === $sender || $handle) {
                return $stack->next()->handle($envelope, $stack);
            }
        } catch (\Throwable $e) {
            $context['exception'] = $e;
            $this->logger->warning('An exception occurred while handling message "{class}": '.$e->getMessage(), $context);

            throw $e;
        }

        // message should only be sent and not be handled by the next middleware
        return $envelope;
    }

    /**
     * * @return iterable|SenderInterface[]
     */
    private function getSenders(Envelope $envelope, &$handle, ?RedeliveryStamp $redeliveryStamp): iterable
    {
        if (null !== $redeliveryStamp) {
            return [
                $redeliveryStamp->getSenderClassOrAlias() => $this->sendersLocator->getSenderByAlias($redeliveryStamp->getSenderClassOrAlias()),
            ];
        }

        return $this->sendersLocator->getSenders($envelope, $handle);
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>BitmapWorkerTask</title>
<meta name="date" content="2013-03-03">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

de.hdm.hettich.studienarbeit.loading

Class BitmapWorkerTask

java.lang.Object

android.os.AsyncTask<Tile,java.lang.Void,android.graphics.Bitmap>

de.hdm.hettich.studienarbeit.loading.BitmapWorkerTask

public class BitmapWorkerTask
extends android.os.AsyncTask<Tile,java.lang.Void,android.graphics.Bitmap>

Die Klasse BitmapWorkerTask ist von AsyncTask
 abgeleitet und bietet die Möglichkeit Operationen im Hintergrund, ohne den
 Hauptprogrammfluss zu blockieren, auszufüheren. Hier werden die PNGs in
 Bitmaps konvertiert.

Version:

1.0, 2013-03-04

Author:

Stefan Hettich

Nested Class Summary

Nested classes/interfaces inherited from class android.os.AsyncTask

android.os.AsyncTask.Status

Field Summary

Fields

Modifier and Type
Field and Description

private BitmapConverter
converter

BitmapConverter, der diesen BitmapWorkerTask erstellt hat.

Fields inherited from class android.os.AsyncTask

SERIAL_EXECUTOR, THREAD_POOL_EXECUTOR

Constructor Summary

Constructors

Constructor and Description

BitmapWorkerTask(BitmapConverter converter)

Konstruktor, der einen neuen BitmapWorkerTask erstellt.

Method Summary

Methods

Modifier and Type
Method and Description

protected android.graphics.Bitmap
doInBackground(Tile... params)

BitmapConverter
getConverter()

protected void
onCancelled()

protected void
onPostExecute(android.graphics.Bitmap bitmap)

void
setConverter(BitmapConverter converter)

Methods inherited from class android.os.AsyncTask

cancel, execute, execute, executeOnExecutor, get, get, getStatus, isCancelled, onCancelled, onPreExecute, onProgressUpdate, publishProgress

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

converter

private BitmapConverter converter

BitmapConverter, der diesen BitmapWorkerTask erstellt hat.
 Die Referenz wird benötigt, um auf die process-Methoden zugreifen zu
 können und den BitmapWorkerTask nicht als NestedClass des
 BitmapConverter implementierren zu müssen.

Constructor Detail

BitmapWorkerTask

public BitmapWorkerTask(BitmapConverter converter)

Konstruktor, der einen neuen BitmapWorkerTask erstellt.

Parameters:

converter -

Method Detail

getConverter

public BitmapConverter getConverter()

Returns:

the converter

setConverter

public void setConverter(BitmapConverter converter)

Parameters:

converter - the converter to set

doInBackground

protected android.graphics.Bitmap doInBackground(Tile... params)

Specified by:

doInBackground in class android.os.AsyncTask<Tile,java.lang.Void,android.graphics.Bitmap>

onPostExecute

protected void onPostExecute(android.graphics.Bitmap bitmap)

Overrides:

onPostExecute in class android.os.AsyncTask<Tile,java.lang.Void,android.graphics.Bitmap>

onCancelled

protected void onCancelled()

Overrides:

onCancelled in class android.os.AsyncTask<Tile,java.lang.Void,android.graphics.Bitmap>

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
package com.amazonaws.services.s3.transfer;

import static com.amazonaws.services.s3.internal.ServiceUtils.createParentDirectoryIfNecessary;

import com.amazonaws.AmazonClientException;
import com.amazonaws.SdkClientException;
import com.amazonaws.annotation.SdkInternalApi;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.internal.FileLocks;
import com.amazonaws.services.s3.internal.ServiceUtils;
import com.amazonaws.services.s3.internal.ServiceUtils.RetryableS3DownloadTask;
import com.amazonaws.services.s3.model.GetObjectRequest;
import com.amazonaws.services.s3.model.S3Object;
import com.amazonaws.services.s3.transfer.Transfer.TransferState;
import com.amazonaws.services.s3.transfer.exception.FileLockException;
import com.amazonaws.services.s3.transfer.internal.AbstractDownloadCallable;
import com.amazonaws.services.s3.transfer.internal.CompleteMultipartDownload;
import com.amazonaws.services.s3.transfer.internal.DownloadImpl;
import com.amazonaws.services.s3.transfer.internal.DownloadMonitor;
import com.amazonaws.services.s3.transfer.internal.DownloadS3ObjectCallable;
import com.amazonaws.util.IOUtils;
import java.io.File;
import java.io.RandomAccessFile;
import java.net.SocketException;
import java.util.Arrays;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import javax.net.ssl.SSLProtocolException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@SdkInternalApi
final class DownloadCallable extends AbstractDownloadCallable {
    private static final Log LOG = LogFactory.getLog(DownloadCallable.class);

    private final AmazonS3 s3;
    private final GetObjectRequest req;
    private final boolean resumeExistingDownload;
    private final DownloadImpl download;
    private final long origStartingByte;
    private Integer lastFullyMergedPartNumber;
    private Long lastFullyMergedPartPosition;
    private final boolean resumeOnRetry;
    private long expectedFileLength;

    DownloadCallable(AmazonS3 s3, CountDownLatch latch,
                     GetObjectRequest req, boolean resumeExistingDownload,
                     DownloadImpl download, File dstfile, long origStartingByte,
                     long expectedFileLength, long timeout,
                     ScheduledExecutorService timedExecutor,
                     ExecutorService executor,
                     Integer lastFullyDownloadedPartNumber, boolean isDownloadParallel, boolean resumeOnRetry) {
        super(constructCallableConfig(executor, dstfile, latch, download, isDownloadParallel, timedExecutor, timeout));

        if (s3 == null || req == null || download == null) {
            throw new IllegalArgumentException();
        }
        this.s3 = s3;
        this.req = req;
        this.resumeExistingDownload = resumeExistingDownload;
        this.download = download;
        this.origStartingByte = origStartingByte;
        this.expectedFileLength = expectedFileLength;
        this.lastFullyMergedPartNumber = lastFullyDownloadedPartNumber;
        this.resumeOnRetry = resumeOnRetry;
    }

    DownloadCallable withLastFullyMergedPartPosition(Long lastFullyMergedPartPosition) {
        this.lastFullyMergedPartPosition = lastFullyMergedPartPosition;
        return this;
    }

    @Override
    protected void downloadAsSingleObject() {
        S3Object s3Object = retryableDownloadS3ObjectToFile(dstfile,
                                                            new DownloadTaskImpl(s3, download, req));
        updateDownloadStatus(s3Object);
    }

    @Override
    protected void downloadInParallel() throws Exception {
        downloadInParallel(ServiceUtils.getPartCount(req, s3));
    }

    @Override
    protected void setState(TransferState transferState) {
        download.setState(transferState);
    }

    /**
     * Takes the result from serial download,
     * updates the transfer state and monitor in downloadImpl object
     * based on the result.
     */
    private void updateDownloadStatus(S3Object result) {
        if (result == null) {
            download.setState(TransferState.Canceled);
            download.setMonitor(new DownloadMonitor(download, null));
        } else {
            download.setState(TransferState.Completed);
        }
    }

    /**
     * Downloads each part of the object into the different parts of the destination file in parallel.
     */
    private void downloadInParallel(int partCount) throws Exception {

        if (lastFullyMergedPartNumber == null) {
            lastFullyMergedPartNumber = 0;
        }

        if (lastFullyMergedPartPosition == null) {
            lastFullyMergedPartPosition = 0L;
        }

        long previousPartLength = 0L;
        long filePositionToWrite = lastFullyMergedPartPosition;

        createParentDirectoryIfNecessary(dstfile);

        truncateDestinationFileIfNecessary();

        if (!FileLocks.lock(dstfile)) {
            throw new FileLockException("Fail to lock " + dstfile);
        }

        try {
            for (int i = lastFullyMergedPartNumber + 1; i <= partCount; i++) {
                filePositionToWrite += previousPartLength;

                GetObjectRequest getPartRequest = new GetObjectRequest(req.getBucketName(), req.getKey(),
                                                                       req.getVersionId()).withUnmodifiedSinceConstraint(req.getUnmodifiedSinceConstraint())
                                                                                .withModifiedSinceConstraint(req.getModifiedSinceConstraint())
                                                                                .withResponseHeaders(req.getResponseHeaders()).withSSECustomerKey(req.getSSECustomerKey())
                                                                                .withGeneralProgressListener(req.getGeneralProgressListener());

                getPartRequest.setMatchingETagConstraints(req.getMatchingETagConstraints());
                getPartRequest.setNonmatchingETagConstraints(req.getNonmatchingETagConstraints());
                getPartRequest.setRequesterPays(req.isRequesterPays());
                getPartRequest.setRequestCredentialsProvider(req.getRequestCredentialsProvider());

                // Update the part number
                getPartRequest.setPartNumber(i);

                futures.add(executor.submit(new DownloadS3ObjectCallable(serviceCall(getPartRequest),
                                                                         dstfile,
                                                                         filePositionToWrite)));

                previousPartLength = ServiceUtils.getPartSize(req, s3, i);
            }

            Future<File> future = executor.submit(new CompleteMultipartDownload(futures, dstfile, download,
                                                                                ++lastFullyMergedPartNumber));
            ((DownloadMonitor) download.getMonitor()).setFuture(future);

        } catch (Exception exception){
            FileLocks.unlock(dstfile);
            throw exception;
        }
    }

    /**
     * Returns a Callable to execute {@link AmazonS3#getObject(GetObjectRequest)} with given request.
     */
    private Callable<S3Object> serviceCall(final GetObjectRequest request) {
        return new Callable<S3Object>() {
            @Override
            public S3Object call() throws Exception {
                return s3.getObject(request);
            }
        };
    }

    /**
     * If only partial part object is merged into the dstFile(due to pause
     * operation), adjust the file length so that the part starts writing from
     * the correct position.
     */
    private void truncateDestinationFileIfNecessary() {
        RandomAccessFile raf = null;
        if (!FileLocks.lock(dstfile)) {
            throw new FileLockException("Fail to lock " + dstfile);
        }

        try {
            raf = new RandomAccessFile(dstfile, "rw");
            if (lastFullyMergedPartNumber == 0) {
                raf.setLength(0);
            } else {
                long lastByte = ServiceUtils.getLastByteInPart(s3, req, lastFullyMergedPartNumber);
                if (dstfile.length() < lastByte) {
                    throw new SdkClientException(
                        "File " + dstfile.getAbsolutePath() + " has been modified since last pause.");
                }
                raf.setLength(lastByte + 1);
                download.getProgress().updateProgress(lastByte + 1);
            }
        } catch (Exception e) {
            throw new SdkClientException("Unable to append part file to dstfile " + e.getMessage(), e);
        } finally {
            IOUtils.closeQuietly(raf, LOG);
            FileLocks.unlock(dstfile);
        }
    }

    /**
     * This method is called only if it is a resumed download.
     *
     * Adjust the range of the get request, and the expected (ie current) file
     * length of the destination file to append to.
     */
    private void adjustRequest(GetObjectRequest req) {
        long[] range = req.getRange();
        long lastByte = range[1];
        long totalBytesToDownload = lastByte - this.origStartingByte + 1;

        if (dstfile.exists()) {
            if (!FileLocks.lock(dstfile)) {
                throw new FileLockException("Fail to lock " + dstfile
                                            + " for range adjustment");
            }
            try {
                expectedFileLength = dstfile.length();
                long startingByte = this.origStartingByte + expectedFileLength;
                LOG.info("Adjusting request range from " + Arrays.toString(range)
                         + " to "
                         + Arrays.toString(new long[] {startingByte, lastByte})
                         + " for file " + dstfile);
                req.setRange(startingByte, lastByte);
                totalBytesToDownload = lastByte - startingByte + 1;
            } finally {
                FileLocks.unlock(dstfile);
            }
        }

        if (totalBytesToDownload < 0) {
            throw new IllegalArgumentException(
                "Unable to determine the range for download operation. lastByte="
                + lastByte + ", origStartingByte=" + origStartingByte
                + ", expectedFileLength=" + expectedFileLength
                + ", totalBytesToDownload=" + totalBytesToDownload);
        }
    }

    private S3Object retryableDownloadS3ObjectToFile(File file,
                                                     RetryableS3DownloadTask retryableS3DownloadTask) {
        boolean hasRetried = false;
        S3Object s3Object;
        for (; ; ) {
            final boolean appendData = resumeExistingDownload || (resumeOnRetry && hasRetried);
            if (appendData && hasRetried) {
                // Need to adjust the get range or else we risk corrupting the downloaded file
                adjustRequest(req);
            }
            s3Object = retryableS3DownloadTask.getS3ObjectStream();
            if (s3Object == null) {
                return null;
            }
            try {
                if (testing && resumeExistingDownload && !hasRetried) {
                    throw new SdkClientException("testing");
                }
                ServiceUtils.downloadToFile(s3Object, file,
                                            retryableS3DownloadTask.needIntegrityCheck(),
                                            appendData, expectedFileLength);
                return s3Object;
            } catch (AmazonClientException ace) {
                if (!ace.isRetryable()) {
                    throw ace;
                }
                // Determine whether an immediate retry is needed according to the captured SdkClientException.
                // (There are three cases when downloadObjectToFile() throws SdkClientException:
                //      1) SocketException or SSLProtocolException when writing to disk (e.g. when user aborts the download)
                //      2) Other IOException when writing to disk
                //      3) MD5 hashes don't match
                // For 1) If SocketException is the result of the client side resetting the connection, this is retried
                // Cases 2) and 3) will always be retried
                final Throwable cause = ace.getCause();
                if ((cause instanceof SocketException && !cause.getMessage().equals("Connection reset"))
                    || (cause instanceof SSLProtocolException)) {
                    throw ace;
                } else {
                    if (hasRetried) {
                        throw ace;
                    } else {
                        LOG.info("Retry the download of object " + s3Object.getKey() + " (bucket " + s3Object.getBucketName() + ")", ace);
                        hasRetried = true;
                    }
                }
            } finally {
                s3Object.getObjectContent().abort();
            }
        }
    }

    private static boolean testing;

    /**
     * Used for testing purpose only.
     */
    static void setTesting(boolean b) {
        testing = b;
    }
}


text:
package com.sumologic.sumobot.brain

import akka.actor.Actor

class InMemoryBrain extends Actor {

  import Brain._

  private var brainContents = Map[String, String]()

  override def receive = {
    case Store(key, value) =>
      brainContents += (key -> value)

    case Remove(key) =>
      brainContents -= key

    case Retrieve(key) =>
      brainContents.get(key) match {
        case Some(value) => sender() ! ValueRetrieved(key, value)
        case None => sender() ! ValueMissing(key)
      }

    case ListValues(prefix) =>
      sender() ! ValueMap(brainContents.filter(_._1.startsWith(prefix)))
  }
}