text:
package org.luapp.practise.netty;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import org.luapp.practise.proto.ResponseProto;

/**
 * Created by lum on 2015/5/26.
 */
public class LdapServerHandler extends ChannelInboundHandlerAdapter {

    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) {
        // Echo back the received object to the client.
        ResponseProto.Response.Builder rb = ResponseProto.Response.newBuilder();
        ResponseProto.Response r= rb.setRet(0).setMsg("ok").build();
        ctx.write(r);
    }

    @Override
    public void channelReadComplete(ChannelHandlerContext ctx) {
        ctx.flush();
    }

    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
        cause.printStackTrace();
        ctx.close();
    }
}

redpajama_set_name: RedPajamaGithub


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="generator" content="PHPDoctor 2RC4 (http://peej.github.com/phpdoctor/)">
<meta name="when" content="Tue, 15 May 2012 19:23:20 +0000">

<link rel="stylesheet" type="text/css" href="../../../stylesheet.css">
<link rel="start" href="../../../overview-summary.html">

<title>CrossORM/Exceptions/Exception.php (CrossORM Documentation)</title>

CrossORM

Overview

Package

Class

Tree

Files

Deprecated

Todo

Index

Frames
No frames

CrossORM/Exceptions/Exception.php

<?php

namespace CrossORM\Exceptions;

class Exception extends \Exception {}

CrossORM

Overview

Package

Class

Tree

Files

Deprecated

Todo

Index

Frames
No frames

This document was generated by PHPDoctor: The PHP Documentation Creator


text:
package jwtc.android.chess.ics;

import java.io.IOException;
import java.io.InputStream;

/**
 * This code was reverse engineered from the JIN project. JIN is a gpled
 * project. Its url can be found here: http://www.jinchess.com/
 */
class TimesealInputStream extends InputStream {

    private final TimesealPipe a;

    public TimesealInputStream(TimesealPipe c1) {
        a = c1;
    }

    public int available() {
        return a._mthcase();
    }

    public void close() throws IOException {
        a._mthnew();
    }

    public int read() throws IOException {
        return a._mthfor();
    }

    public int read(byte abyte0[], int i, int j) throws IOException {
        return a._mthif(abyte0, i, j);
    }
}


text:
package za.org.grassroot.integration.mqtt;

import org.jivesoftware.smack.packet.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter;
import org.springframework.messaging.MessageChannel;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import za.org.grassroot.core.domain.Group;
import za.org.grassroot.core.domain.User;
import za.org.grassroot.core.repository.GroupRepository;
import za.org.grassroot.integration.utils.MessageUtils;
import za.org.grassroot.integration.xmpp.GcmXmppMessageCodec;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
 * Created by luke on 2016/11/05.
 */
@Service
@ConditionalOnProperty(name = "mqtt.connection.enabled", havingValue = "true",  matchIfMissing = false)
public class MqttSubscriptionServiceImpl implements MqttSubscriptionService {

    @Value("${gcm.topics.path}")
    private String TOPICS;

    private GroupRepository groupRepository;
    private MqttPahoMessageDrivenChannelAdapter mqttAdapter;
    private MessageChannel gcmXmppOutboundChannel;

    @Autowired
    public MqttSubscriptionServiceImpl(GroupRepository groupRepository, MqttPahoMessageDrivenChannelAdapter mqttAdapter, MessageChannel gcmXmppOutboundChannel) {
        this.groupRepository = groupRepository;
        this.mqttAdapter = mqttAdapter;
        this.gcmXmppOutboundChannel = gcmXmppOutboundChannel;
    }

    @Override @Async
    @Transactional
    public void subscribeServerToAllGroupTopics() {
        List<Group> groups = groupRepository.findAll();
        List<String> topicsSubscribedTo = Arrays.asList(mqttAdapter.getTopic());
        for(Group group: groups){
            if(!topicsSubscribedTo.contains(group.getUid())){
                mqttAdapter.addTopic(group.getUid(), 1);
            }
        }
    }

    @Async
    @Override
    public void subscribeServerToGroupTopic(Group group) {
        Objects.requireNonNull(group);

        List<String> topicsSubscribeTo = Arrays.asList(mqttAdapter.getTopic());
        if (!topicsSubscribeTo.contains(group.getUid())) {
            mqttAdapter.addTopic(group.getUid(), 1);
        }
    }

    private void pingUsersForGroupChat(Group group) {
        Map<String, Object> data = MessageUtils.generatePingMessageData(group);
        org.springframework.messaging.Message<Message> gcmMessage = GcmXmppMessageCodec.encode(TOPICS.concat(group.getUid()), (String) data.get("messageId"),
                null,
                data);
        gcmXmppOutboundChannel.send(gcmMessage);
    }

}


text:
package cn.fql.lock;

/**
 * Created by fuquanlin on 06/12/2017.
 */
@FunctionalInterface
public interface LockCallBack<T> {
    T process();
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="../stylesheets/default.css">
    <title>tim l kelly</title>

      timkelly

blog

about

projects

contact

Regular Expressions

      1.30.2016

        Regular expressions, also know as regexp or regex, is a sequence of characters that is used to define a search pattern.  They are mainly used for searching through strings by pattern matching. In Ruby the regex constructor is //. This is an empty expression but the pattern would go in between the forward slashes. The method match can be used to detect matches in a string. Match is both a regex and string method so it can be used either way.

puts "Match!" if /cat/.match("There's a cat in this string!")
puts "Match!" if "There's a cat in this string!".match(/cat/)

        Ruby also provides a regex operator: =~.

puts "Match!"if "There's a cat in this string!" =~ /cat/

        Though the =~ operator will return the numerical index of the character in the string where the match started.  Match will return an instance of the class MatchData:

        Here are some additional regular expression search parameters.

        . is the wild card character c.t would match "cat"

        Square brackets [] can be used can be used to match a single character or through a range. [cat] would match the characters "c", "a", and "t". [a-g] would match any lower case character a through g. [cb]at would match "cat" and "bat".

        [^ ] matches a single character that is not inside of the brackets. [^cat] will match any character other than "c", "a", or "t".

        ^ before the pattern will match if the starting position or line of the string begins with that pattern.
        $is the opposite of ^. It looks for matches at the end of the string

        /^cat/.match("Hello cat") would not match cat but /$cat/.match("Hello cat")would.

        () allows for submatches or subexpressions. These can later be recalled with $n where n refers to the subexpression that was set. If you were to use a regular expression with multiple subexpressions you could recall the first one with $1, $2 would recall the second subexpression and so on.

        {} specifies exactly how many repetitions of the pattern to match by providing a number inside the curly braces directly after the expression to be matched. /\d{3}/ will match exactly three digits. Ranges can be specified like so {3,7} which would return any matches between three to seven and lastly {3,} results in three or more.

        * and + are the zero or more and one or more quantifiers, respectively.  They will return as much of the string as they possibly can.  Adding a ? after either quantifier will make them stop at the end of the first match.

        Regular expressions seem like powerful tools but they can easily become overwhelming to decipher. What do you imagine \b(\w)?(\w)\w?\2\1 does? Or how about \b\d{3}[-.]?\d{3}[-.]?\d{4}\b? Well the first one will return two to five letter palindromes and the second returns phone numbers that use hyphons, periods or do not contain a spacer. As with anything, I'm sure you can read these faster as you use regex more and more, however it does provide for a rather steep learning curve.

        regexr.com is a great interactive website to learn and experiment with regular expressions. Check it out!

      footer


text:
static bool FIRCLSDwarfParseAndProcessAugmentation(DWARFCIERecord* record, const void** ptr);

#pragma mark - Record Parsing
bool FIRCLSDwarfParseCIERecord(DWARFCIERecord* cie, const void* ptr) {
  if (!cie || !ptr) {
    return false;
  }

  memset(cie, 0, sizeof(DWARFCIERecord));

  cie->length = FIRCLSParseRecordLengthAndAdvance(&ptr);
  if (cie->length == 0) {
    FIRCLSSDKLog("Error: CIE length invalid\n");
    return false;
  }

  // the length does not include the length field(s) themselves
  const void* endAddress = ptr + cie->length;

  if (FIRCLSParseUint32AndAdvance(&ptr) != DWARF_CIE_ID_CIE_FLAG) {
    FIRCLSSDKLog("Error: CIE flag not found\n");
  }

  cie->version = FIRCLSParseUint8AndAdvance(&ptr);
  if (cie->version != 1 && cie->version != 3) {
    FIRCLSSDKLog("Error: CIE version %u unsupported\n", cie->version);
  }

  cie->pointerEncoding = DW_EH_PE_absptr;
  cie->lsdaEncoding = DW_EH_PE_absptr;

  cie->augmentation = FIRCLSParseStringAndAdvance(&ptr);
  cie->codeAlignFactor = FIRCLSParseULEB128AndAdvance(&ptr);
  cie->dataAlignFactor = FIRCLSParseLEB128AndAdvance(&ptr);

  switch (cie->version) {
    case 1:
      cie->returnAddressRegister = FIRCLSParseUint8AndAdvance(&ptr);
      break;
    case 3:
      cie->returnAddressRegister = FIRCLSParseULEB128AndAdvance(&ptr);
      break;
    default:
      FIRCLSSDKLog("Error: CIE version %u unsupported\n", cie->version);
      return false;
  }

  if (!FIRCLSDwarfParseAndProcessAugmentation(cie, &ptr)) {
    return false;
  }

  cie->instructions.data = ptr;
  cie->instructions.length = (uint32_t)(endAddress - ptr);

  return true;
}

static bool FIRCLSDwarfParseAndProcessAugmentation(DWARFCIERecord* record, const void** ptr) {
  if (!record || !ptr) {
    return false;
  }

  if (!record->augmentation) {
    return false;
  }

  if (record->augmentation[0] == 0) {
    return true;
  }

  if (record->augmentation[0] != 'z') {
    FIRCLSSDKLog("Error: Unimplemented: augmentation string %s\n", record->augmentation);
    return false;
  }

  size_t stringLength = strlen(record->augmentation);

  uint64_t dataLength = FIRCLSParseULEB128AndAdvance(ptr);
  const void* ending = *ptr + dataLength;

  // start at 1 because we know the first character is a 'z'
  for (size_t i = 1; i < stringLength; ++i) {
    switch (record->augmentation[i]) {
      case 'L':
        // There is an LSDA pointer encoding present.  The actual address of the LSDA
        // is in the FDE
        record->lsdaEncoding = FIRCLSParseUint8AndAdvance(ptr);
        break;
      case 'R':
        // There is a pointer encoding present, used for all addresses in an FDE.
        record->pointerEncoding = FIRCLSParseUint8AndAdvance(ptr);
        break;
      case 'P':
        // Two arguments.  A pointer encoding, and a pointer to a personality function encoded
        // with that value.
        record->personalityEncoding = FIRCLSParseUint8AndAdvance(ptr);
        record->personalityFunction =
            FIRCLSParseAddressWithEncodingAndAdvance(ptr, record->personalityEncoding);
        if (record->personalityFunction == CLS_INVALID_ADDRESS) {
          FIRCLSSDKLog("Error: Found an invalid start address\n");
          return false;
        }
        break;
      case 'S':
        record->signalFrame = true;
        break;
      default:
        FIRCLSSDKLog("Error: Unhandled augmentation string entry %c\n", record->augmentation[i]);
        return false;
    }

    // small sanity check
    if (*ptr > ending) {
      return false;
    }
  }

  return true;
}

bool FIRCLSDwarfParseFDERecord(DWARFFDERecord* fdeRecord,
                               bool parseCIE,
                               DWARFCIERecord* cieRecord,
                               const void* ptr) {
  if (!fdeRecord || !cieRecord || !ptr) {
    return false;
  }

  fdeRecord->length = FIRCLSParseRecordLengthAndAdvance(&ptr);
  if (fdeRecord->length == 0) {
    FIRCLSSDKLog("Error: FDE has zero length\n");
    return false;
  }

  // length does not include length field
  const void* endAddress = ptr + fdeRecord->length;

  // According to the spec, this is 32/64 bit value, but libunwind always
  // parses this as a 32bit value.
  fdeRecord->cieOffset = FIRCLSParseUint32AndAdvance(&ptr);
  if (fdeRecord->cieOffset == 0) {
    FIRCLSSDKLog("Error: CIE offset invalid\n");
    return false;
  }

  if (parseCIE) {
    // The CIE offset is really weird. It appears to be an offset from the
    // beginning of its field. This isn't what the documentation says, but it is
    // a little ambigious. This is what DwarfParser.hpp does.
    // Note that we have to back up one sizeof(uint32_t), because we've advanced
    // by parsing the offset
    const void* ciePointer = ptr - fdeRecord->cieOffset - sizeof(uint32_t);
    if (!FIRCLSDwarfParseCIERecord(cieRecord, ciePointer)) {
      FIRCLSSDKLog("Error: Unable to parse CIE record\n");
      return false;
    }
  }

  if (!FIRCLSDwarfCIEIsValid(cieRecord)) {
    FIRCLSSDKLog("Error: CIE invalid\n");
    return false;
  }

  // the next field depends on the pointer encoding style used
  fdeRecord->startAddress =
      FIRCLSParseAddressWithEncodingAndAdvance(&ptr, cieRecord->pointerEncoding);
  if (fdeRecord->startAddress == CLS_INVALID_ADDRESS) {
    FIRCLSSDKLog("Error: Found an invalid start address\n");
    return false;
  }

  // Here's something weird too. The range is encoded as a "special" address, where only the value
  // is used, regardless of other pointer-encoding schemes.
  fdeRecord->rangeSize = FIRCLSParseAddressWithEncodingAndAdvance(
      &ptr, cieRecord->pointerEncoding & DW_EH_PE_VALUE_MASK);
  if (fdeRecord->rangeSize == CLS_INVALID_ADDRESS) {
    FIRCLSSDKLog("Error: Found an invalid address range\n");
    return false;
  }

  // Just skip over the section for now. The data here is only needed for personality functions,
  // which we don't need
  if (FIRCLSDwarfCIEHasAugmentationData(cieRecord)) {
    uintptr_t augmentationLength = (uintptr_t)FIRCLSParseULEB128AndAdvance(&ptr);

    ptr += augmentationLength;
  }

  fdeRecord->instructions.data = ptr;
  fdeRecord->instructions.length = (uint32_t)(endAddress - ptr);

  return true;
}

bool FIRCLSDwarfParseCFIFromFDERecord(FIRCLSDwarfCFIRecord* record, const void* ptr) {
  if (!record || !ptr) {
    return false;
  }

  return FIRCLSDwarfParseFDERecord(&record->fde, true, &record->cie, ptr);
}

bool FIRCLSDwarfParseCFIFromFDERecordOffset(FIRCLSDwarfCFIRecord* record,
                                            const void* ehFrame,
                                            uintptr_t fdeOffset) {
  if (!record || !ehFrame || (fdeOffset == 0)) {
    return false;
  }

  const void* ptr = ehFrame + fdeOffset;

  return FIRCLSDwarfParseCFIFromFDERecord(record, ptr);
}

#pragma mark - Properties
bool FIRCLSDwarfCIEIsValid(DWARFCIERecord* cie) {
  if (!cie) {
    return false;
  }

  if (cie->length == 0) {
    return false;
  }

  if (cie->version != 1 && cie->version != 3) {
    return false;
  }

  return true;
}

bool FIRCLSDwarfCIEHasAugmentationData(DWARFCIERecord* cie) {
  if (!cie) {
    return false;
  }

  if (!cie->augmentation) {
    return false;
  }

  return cie->augmentation[0] == 'z';
}

#pragma mark - Instructions

static bool FIRCLSDwarfParseAndExecute_set_loc(const void** cursor,
                                               DWARFCIERecord* cieRecord,
                                               intptr_t* codeOffset) {
  uintptr_t operand = FIRCLSParseAddressWithEncodingAndAdvance(cursor, cieRecord->pointerEncoding);

  *codeOffset = operand;

  FIRCLSDwarfLog("DW_CFA_set_loc %lu\n", operand);

  return true;
}

static bool FIRCLSDwarfParseAndExecute_advance_loc1(const void** cursor,
                                                    DWARFCIERecord* cieRecord,
                                                    intptr_t* codeOffset) {
  int64_t offset = FIRCLSParseUint8AndAdvance(cursor) * cieRecord->codeAlignFactor;

  *codeOffset += offset;

  FIRCLSDwarfLog("DW_CFA_advance_loc1 %lld\n", offset);

  return true;
}

static bool FIRCLSDwarfParseAndExecute_advance_loc2(const void** cursor,
                                                    DWARFCIERecord* cieRecord,
                                                    intptr_t* codeOffset) {
  int64_t offset = FIRCLSParseUint16AndAdvance(cursor) * cieRecord->codeAlignFactor;

  *codeOffset += offset;

  FIRCLSDwarfLog("DW_CFA_advance_loc2 %lld\n", offset);

  return true;
}

static bool FIRCLSDwarfParseAndExecute_advance_loc4(const void** cursor,
                                                    DWARFCIERecord* cieRecord,
                                                    intptr_t* codeOffset) {
  int64_t offset = FIRCLSParseUint32AndAdvance(cursor) * cieRecord->codeAlignFactor;

  *codeOffset += offset;

  FIRCLSDwarfLog("DW_CFA_advance_loc4 %lld\n", offset);

  return true;
}

static bool FIRCLSDwarfParseAndExecute_def_cfa(const void** cursor,
                                               DWARFCIERecord* cieRecord,
                                               FIRCLSDwarfState* state) {
  uint64_t regNum = FIRCLSParseULEB128AndAdvance(cursor);

  if (regNum > CLS_DWARF_MAX_REGISTER_NUM) {
    FIRCLSSDKLog("Error: Found an invalid DW_CFA_def_cfa register number\n");
    return false;
  }

  int64_t offset = FIRCLSParseULEB128AndAdvance(cursor);

  state->cfaRegister = regNum;
  state->cfaRegisterOffset = offset;

  FIRCLSDwarfLog("DW_CFA_def_cfa %llu, %lld\n", regNum, offset);

  return true;
}

static bool FIRCLSDwarfParseAndExecute_def_cfa_register(const void** cursor,
                                                        DWARFCIERecord* cieRecord,
                                                        FIRCLSDwarfState* state) {
  uint64_t regNum = FIRCLSParseULEB128AndAdvance(cursor);

  if (regNum > CLS_DWARF_MAX_REGISTER_NUM) {
    FIRCLSSDKLog("Error: Found an invalid DW_CFA_def_cfa_register register number\n");
    return false;
  }

  state->cfaRegister = regNum;

  FIRCLSDwarfLog("DW_CFA_def_cfa_register %llu\n", regNum);

  return true;
}

static bool FIRCLSDwarfParseAndExecute_def_cfa_offset(const void** cursor,
                                                      DWARFCIERecord* cieRecord,
                                                      FIRCLSDwarfState* state) {
  uint64_t offset = FIRCLSParseULEB128AndAdvance(cursor);

  state->cfaRegisterOffset = offset;

  FIRCLSDwarfLog("DW_CFA_def_cfa_offset %lld\n", offset);

  return true;
}

static bool FIRCLSDwarfParseAndExecute_same_value(const void** cursor,
                                                  DWARFCIERecord* cieRecord,
                                                  FIRCLSDwarfState* state) {
  uint64_t regNum = FIRCLSParseULEB128AndAdvance(cursor);

  if (regNum > CLS_DWARF_MAX_REGISTER_NUM) {
    FIRCLSSDKLog("Error: Found an invalid DW_CFA_same_value register number\n");
    return false;
  }

  state->registers[regNum].location = FIRCLSDwarfRegisterUnused;

  FIRCLSDwarfLog("DW_CFA_same_value %llu\n", regNum);

  return true;
}

static bool FIRCLSDwarfParseAndExecute_register(const void** cursor,
                                                DWARFCIERecord* cieRecord,
                                                FIRCLSDwarfState* state) {
  uint64_t regNum = FIRCLSParseULEB128AndAdvance(cursor);

  if (regNum > CLS_DWARF_MAX_REGISTER_NUM) {
    FIRCLSSDKLog("Error: Found an invalid DW_CFA_register number\n");
    return false;
  }

  uint64_t regValue = FIRCLSParseULEB128AndAdvance(cursor);

  if (regValue > CLS_DWARF_MAX_REGISTER_NUM) {
    FIRCLSSDKLog("Error: Found an invalid DW_CFA_register value\n");
    return false;
  }

  state->registers[regNum].location = FIRCLSDwarfRegisterInRegister;
  state->registers[regNum].value = regValue;

  FIRCLSDwarfLog("DW_CFA_register %llu %llu\n", regNum, regValue);

  return true;
}

static bool FIRCLSDwarfParseAndExecute_expression(const void** cursor,
                                                  DWARFCIERecord* cieRecord,
                                                  FIRCLSDwarfState* state) {
  uint64_t regNum = FIRCLSParseULEB128AndAdvance(cursor);

  if (regNum > CLS_DWARF_MAX_REGISTER_NUM) {
    FIRCLSSDKLog("Error: Found an invalid DW_CFA_expression register number\n");
    return false;
  }

  state->registers[regNum].location = FIRCLSDwarfRegisterAtExpression;
  state->registers[regNum].value = (uintptr_t)*cursor;

  // read the length of the expression, and advance past it
  uint64_t length = FIRCLSParseULEB128AndAdvance(cursor);
  *cursor += length;

  FIRCLSDwarfLog("DW_CFA_expression %llu %llu\n", regNum, length);

  return true;
}

static bool FIRCLSDwarfParseAndExecute_val_expression(const void** cursor,
                                                      DWARFCIERecord* cieRecord,
                                                      FIRCLSDwarfState* state) {
  uint64_t regNum = FIRCLSParseULEB128AndAdvance(cursor);

  if (regNum > CLS_DWARF_MAX_REGISTER_NUM) {
    FIRCLSSDKLog("Error: Found an invalid DW_CFA_val_expression register number\n");
    return false;
  }

  state->registers[regNum].location = FIRCLSDwarfRegisterIsExpression;
  state->registers[regNum].value = (uintptr_t)*cursor;

  // read the length of the expression, and advance past it
  uint64_t length = FIRCLSParseULEB128AndAdvance(cursor);
  *cursor += length;

  FIRCLSDwarfLog("DW_CFA_val_expression %llu %llu\n", regNum, length);

  return true;
}

static bool FIRCLSDwarfParseAndExecute_def_cfa_expression(const void** cursor,
                                                          DWARFCIERecord* cieRecord,
                                                          FIRCLSDwarfState* state) {
  state->cfaRegister = CLS_DWARF_INVALID_REGISTER_NUM;
  state->cfaExpression = *cursor;

  // read the length of the expression, and advance past it
  uint64_t length = FIRCLSParseULEB128AndAdvance(cursor);
  *cursor += length;

  FIRCLSDwarfLog("DW_CFA_def_cfa_expression %llu\n", length);

  return true;
}

static bool FIRCLSDwarfParseAndExecute_offset(const void** cursor,
                                              DWARFCIERecord* cieRecord,
                                              FIRCLSDwarfState* state,
                                              uint8_t regNum) {
  if (regNum > CLS_DWARF_MAX_REGISTER_NUM) {
    FIRCLSSDKLog("Error: Found an invalid DW_CFA_offset register number\n");
    return false;
  }

  int64_t offset = FIRCLSParseULEB128AndAdvance(cursor) * cieRecord->dataAlignFactor;

  state->registers[regNum].location = FIRCLSDwarfRegisterInCFA;
  state->registers[regNum].value = offset;

  FIRCLSDwarfLog("DW_CFA_offset %u, %lld\n", regNum, offset);

  return true;
}

static bool FIRCLSDwarfParseAndExecute_advance_loc(const void** cursor,
                                                   DWARFCIERecord* cieRecord,
                                                   FIRCLSDwarfState* state,
                                                   uint8_t delta,
                                                   intptr_t* codeOffset) {
  if (!FIRCLSIsValidPointer(codeOffset) || !FIRCLSIsValidPointer(cieRecord)) {
    FIRCLSSDKLog("Error: invalid inputs\n");
    return false;
  }

  *codeOffset = delta * (intptr_t)cieRecord->codeAlignFactor;

  FIRCLSDwarfLog("DW_CFA_advance_loc %u\n", delta);

  return true;
}

static bool FIRCLSDwarfParseAndExecuteInstructionWithOperand(const void** cursor,
                                                             uint8_t instruction,
                                                             DWARFCIERecord* cieRecord,
                                                             FIRCLSDwarfState* state,
                                                             intptr_t* codeOffset) {
  uint8_t operand = instruction & DW_CFA_OPERAND_MASK;
  bool success = false;

  switch (instruction & DW_CFA_OPCODE_MASK) {
    case DW_CFA_offset:
      success = FIRCLSDwarfParseAndExecute_offset(cursor, cieRecord, state, operand);
      break;
    case DW_CFA_advance_loc:
      success =
          FIRCLSDwarfParseAndExecute_advance_loc(cursor, cieRecord, state, operand, codeOffset);
      break;
    case DW_CFA_restore:
      FIRCLSSDKLog("Error: Unimplemented DWARF instruction with operand 0x%x\n", instruction);
      break;
    default:
      FIRCLSSDKLog("Error: Unrecognized DWARF instruction 0x%x\n", instruction);
      break;
  }

  return success;
}

#pragma mark - Expressions
static bool FIRCLSDwarfEvalulateExpression(const void* cursor,
                                           const FIRCLSThreadContext* registers,
                                           intptr_t stackValue,
                                           intptr_t* result) {
  FIRCLSDwarfLog("starting at %p with initial value %lx\n", cursor, stackValue);

  if (!FIRCLSIsValidPointer(cursor) || !FIRCLSIsValidPointer(result)) {
    FIRCLSSDKLog("Error: inputs invalid\n");
    return false;
  }

  FIRCLSDwarfExpressionMachine machine;

  if (!FIRCLSDwarfExpressionMachineInit(&machine, cursor, registers, stackValue)) {
    FIRCLSSDKLog("Error: unable to init DWARF expression machine\n");
    return false;
  }

  if (!FIRCLSDwarfExpressionMachinePrepareForExecution(&machine)) {
    FIRCLSSDKLog("Error: unable to prepare for execution\n");
    return false;
  }

  while (!FIRCLSDwarfExpressionMachineIsFinished(&machine)) {
    if (!FIRCLSDwarfExpressionMachineExecuteNextOpcode(&machine)) {
      FIRCLSSDKLog("Error: failed to execute DWARF machine opcode\n");
      return false;
    }
  }

  if (!FIRCLSDwarfExpressionMachineGetResult(&machine, result)) {
    FIRCLSSDKLog("Error: failed to get DWARF expression result\n");
    return false;
  }

  FIRCLSDwarfLog("successfully computed expression result\n");

  return true;
}

#pragma mark - Execution
bool FIRCLSDwarfInstructionsEnumerate(DWARFInstructions* instructions,
                                      DWARFCIERecord* cieRecord,
                                      FIRCLSDwarfState* state,
                                      intptr_t pcOffset) {
  if (!instructions || !cieRecord || !state) {
    FIRCLSSDKLog("Error: inputs invalid\n");
    return false;
  }

  // This is a little bit of state that can't be put into the state structure, because
  // it is possible for instructions to push/pop state that does not affect this value.
  intptr_t codeOffset = 0;

  const void* cursor = instructions->data;
  const void* endAddress = cursor + instructions->length;

  FIRCLSDwarfLog("Running instructions from %p to %p\n", cursor, endAddress);

  // parse the instructions, as long as:
  // - our data pointer is still in range
  // - the pc offset is within the range of instructions that apply

  while ((cursor < endAddress) && (codeOffset < pcOffset)) {
    uint8_t instruction = FIRCLSParseUint8AndAdvance(&cursor);
    bool success = false;

    switch (instruction) {
      case DW_CFA_nop:
        FIRCLSDwarfLog("DW_CFA_nop\n");
        continue;
      case DW_CFA_set_loc:
        success = FIRCLSDwarfParseAndExecute_set_loc(&cursor, cieRecord, &codeOffset);
        break;
      case DW_CFA_advance_loc1:
        success = FIRCLSDwarfParseAndExecute_advance_loc1(&cursor, cieRecord, &codeOffset);
        break;
      case DW_CFA_advance_loc2:
        success = FIRCLSDwarfParseAndExecute_advance_loc2(&cursor, cieRecord, &codeOffset);
        break;
      case DW_CFA_advance_loc4:
        success = FIRCLSDwarfParseAndExecute_advance_loc4(&cursor, cieRecord, &codeOffset);
        break;
      case DW_CFA_def_cfa:
        success = FIRCLSDwarfParseAndExecute_def_cfa(&cursor, cieRecord, state);
        break;
      case DW_CFA_def_cfa_register:
        success = FIRCLSDwarfParseAndExecute_def_cfa_register(&cursor, cieRecord, state);
        break;
      case DW_CFA_def_cfa_offset:
        success = FIRCLSDwarfParseAndExecute_def_cfa_offset(&cursor, cieRecord, state);
        break;
      case DW_CFA_same_value:
        success = FIRCLSDwarfParseAndExecute_same_value(&cursor, cieRecord, state);
        break;
      case DW_CFA_register:
        success = FIRCLSDwarfParseAndExecute_register(&cursor, cieRecord, state);
        break;
      case DW_CFA_def_cfa_expression:
        success = FIRCLSDwarfParseAndExecute_def_cfa_expression(&cursor, cieRecord, state);
        break;
      case DW_CFA_expression:
        success = FIRCLSDwarfParseAndExecute_expression(&cursor, cieRecord, state);
        break;
      case DW_CFA_val_expression:
        success = FIRCLSDwarfParseAndExecute_val_expression(&cursor, cieRecord, state);
        break;
      case DW_CFA_offset_extended:
      case DW_CFA_restore_extended:
      case DW_CFA_undefined:
      case DW_CFA_remember_state:
      case DW_CFA_restore_state:
      case DW_CFA_offset_extended_sf:
      case DW_CFA_def_cfa_sf:
      case DW_CFA_def_cfa_offset_sf:
      case DW_CFA_val_offset:
      case DW_CFA_val_offset_sf:
      case DW_CFA_GNU_window_save:
      case DW_CFA_GNU_args_size:
      case DW_CFA_GNU_negative_offset_extended:
        FIRCLSSDKLog("Error: Unimplemented DWARF instruction 0x%x\n", instruction);
        return false;
      default:
        success = FIRCLSDwarfParseAndExecuteInstructionWithOperand(&cursor, instruction, cieRecord,
                                                                   state, &codeOffset);
        break;
    }

    if (!success) {
      FIRCLSSDKLog("Error: Failed to execute dwarf instruction 0x%x\n", instruction);
      return false;
    }
  }

  return true;
}

bool FIRCLSDwarfUnwindComputeRegisters(FIRCLSDwarfCFIRecord* record,
                                       FIRCLSThreadContext* registers) {
  if (!record || !registers) {
    return false;
  }

  // We need to run the dwarf instructions to compute our register values.
  // - initialize state
  // - run the CIE instructions
  // - run the FDE instructions
  // - grab the values

  FIRCLSDwarfState state;

  memset(&state, 0, sizeof(FIRCLSDwarfState));

  // We need to run all the instructions in the CIE record. So, pass in a large value for the pc
  // offset so we don't stop early.
  if (!FIRCLSDwarfInstructionsEnumerate(&record->cie.instructions, &record->cie, &state,
                                        INTPTR_MAX)) {
    FIRCLSSDKLog("Error: Unable to run CIE instructions\n");
    return false;
  }

  intptr_t pcOffset = FIRCLSThreadContextGetPC(registers) - record->fde.startAddress;
  if (pcOffset < 0) {
    FIRCLSSDKLog("Error: The FDE pcOffset value cannot be negative\n");
    return false;
  }

  if (!FIRCLSDwarfInstructionsEnumerate(&record->fde.instructions, &record->cie, &state,
                                        pcOffset)) {
    FIRCLSSDKLog("Error: Unable to run FDE instructions\n");
    return false;
  }

  uintptr_t cfaRegister = 0;

  if (!FIRCLSDwarfGetCFA(&state, registers, &cfaRegister)) {
    FIRCLSSDKLog("Error: failed to get CFA\n");
    return false;
  }

  if (!FIRCLSDwarfUnwindAssignRegisters(&state, registers, cfaRegister, registers)) {
    FIRCLSSDKLogError("Error: Unable to assign DWARF registers\n");
    return false;
  }

  return true;
}

bool FIRCLSDwarfUnwindAssignRegisters(const FIRCLSDwarfState* state,
                                      const FIRCLSThreadContext* registers,
                                      uintptr_t cfaRegister,
                                      FIRCLSThreadContext* outputRegisters) {
  if (!FIRCLSIsValidPointer(state) || !FIRCLSIsValidPointer(registers)) {
    FIRCLSSDKLogError("Error: input invalid\n");
    return false;
  }

  // make a copy, which we'll be changing
  FIRCLSThreadContext newThreadState = *registers;

  // loop through all the registers, so we can set their values
  for (size_t i = 0; i <= CLS_DWARF_MAX_REGISTER_NUM; ++i) {
    if (state->registers[i].location == FIRCLSDwarfRegisterUnused) {
      continue;
    }

    const uintptr_t value =
        FIRCLSDwarfGetSavedRegister(registers, cfaRegister, state->registers[i]);

    if (!FIRCLSDwarfUnwindSetRegisterValue(&newThreadState, i, value)) {
      FIRCLSSDKLog("Error: Unable to restore register value\n");
      return false;
    }
  }

  if (!FIRCLSDwarfUnwindSetRegisterValue(&newThreadState, CLS_DWARF_REG_SP, cfaRegister)) {
    FIRCLSSDKLog("Error: Unable to restore SP value\n");
    return false;
  }

  // sanity-check that things have changed
  if (FIRCLSDwarfCompareRegisters(registers, &newThreadState, CLS_DWARF_REG_SP)) {
    FIRCLSSDKLog("Error: Stack pointer hasn't changed\n");
    return false;
  }

  if (FIRCLSDwarfCompareRegisters(registers, &newThreadState, CLS_DWARF_REG_RETURN)) {
    FIRCLSSDKLog("Error: PC hasn't changed\n");
    return false;
  }

  // set our new value
  *outputRegisters = newThreadState;

  return true;
}

#pragma mark - Register Operations
bool FIRCLSDwarfCompareRegisters(const FIRCLSThreadContext* a,
                                 const FIRCLSThreadContext* b,
                                 uint64_t registerNum) {
  return FIRCLSDwarfUnwindGetRegisterValue(a, registerNum) ==
         FIRCLSDwarfUnwindGetRegisterValue(b, registerNum);
}

bool FIRCLSDwarfGetCFA(FIRCLSDwarfState* state,
                       const FIRCLSThreadContext* registers,
                       uintptr_t* cfa) {
  if (!FIRCLSIsValidPointer(state) || !FIRCLSIsValidPointer(registers) ||
      !FIRCLSIsValidPointer(cfa)) {
    FIRCLSSDKLog("Error: invalid input\n");
    return false;
  }

  if (state->cfaExpression) {
    if (!FIRCLSDwarfEvalulateExpression(state->cfaExpression, registers, 0, (intptr_t*)cfa)) {
      FIRCLSSDKLog("Error: failed to compute CFA expression\n");
      return false;
    }

    return true;
  }

  // libunwind checks that cfaRegister is not zero. This seems like a potential bug - why couldn't
  // it be zero?

  *cfa = FIRCLSDwarfUnwindGetRegisterValue(registers, state->cfaRegister) +
         (uintptr_t)state->cfaRegisterOffset;

  return true;
}

uintptr_t FIRCLSDwarfGetSavedRegister(const FIRCLSThreadContext* registers,
                                      uintptr_t cfaRegister,
                                      FIRCLSDwarfRegister dRegister) {
  intptr_t result = 0;

  FIRCLSDwarfLog("Getting register %x\n", dRegister.location);

  switch (dRegister.location) {
    case FIRCLSDwarfRegisterInCFA: {
      const uintptr_t address = cfaRegister + (uintptr_t)dRegister.value;

      if (!FIRCLSReadMemory(address, &result, sizeof(result))) {
        FIRCLSSDKLog("Error: Unable to read CFA value\n");
        return 0;
      }
    }
      return result;
    case FIRCLSDwarfRegisterInRegister:
      return FIRCLSDwarfUnwindGetRegisterValue(registers, dRegister.value);
    case FIRCLSDwarfRegisterOffsetFromCFA:
      FIRCLSSDKLog("Error: OffsetFromCFA unhandled\n");
      break;
    case FIRCLSDwarfRegisterAtExpression:
      if (!FIRCLSDwarfEvalulateExpression((void*)dRegister.value, registers, cfaRegister,
                                          &result)) {
        FIRCLSSDKLog("Error: unable to evaluate expression\n");
        return 0;
      }

      if (!FIRCLSReadMemory(result, &result, sizeof(result))) {
        FIRCLSSDKLog("Error: Unable to read memory computed from expression\n");
        return 0;
      }

      return result;
    case FIRCLSDwarfRegisterIsExpression:
      if (!FIRCLSDwarfEvalulateExpression((void*)dRegister.value, registers, cfaRegister,
                                          &result)) {
        FIRCLSSDKLog("Error: unable to evaluate expression\n");
        return 0;
      }

      return result;
    default:
      FIRCLSSDKLog("Error: Unrecognized register save location 0x%x\n", dRegister.location);
      break;
  }

  return 0;
}

#if DEBUG
#pragma mark - Debugging
void FIRCLSCFIRecordShow(FIRCLSDwarfCFIRecord* record) {
  if (!record) {
    FIRCLSSDKLog("Error: CFI record: null\n");
    return;
  }

  FIRCLSCIERecordShow(&record->cie);
  FIRCLSFDERecordShow(&record->fde, &record->cie);
}

void FIRCLSCIERecordShow(DWARFCIERecord* record) {
  if (!record) {
    FIRCLSSDKLog("Error: CIE: null\n");
    return;
  }

  FIRCLSSDKLog("CIE:\n");
  FIRCLSSDKLog("       length: %llu\n", record->length);
  FIRCLSSDKLog("      version: %u\n", record->version);
  FIRCLSSDKLog(" augmentation: %s\n", record->augmentation);
  FIRCLSSDKLog("      EH Data: 0x%04lx\n", record->ehData);
  FIRCLSSDKLog("LSDA encoding: 0x%02x\n", record->lsdaEncoding);
  FIRCLSSDKLog("  personality: 0x%lx\n", record->personalityFunction);

  FIRCLSDwarfPointerEncodingShow("     encoding", record->pointerEncoding);
  FIRCLSDwarfPointerEncodingShow("   P encoding", record->personalityEncoding);

  FIRCLSSDKLog("   code align: %llu\n", record->codeAlignFactor);
  FIRCLSSDKLog("   data align: %lld\n", record->dataAlignFactor);
  FIRCLSSDKLog("  RA register: %llu\n", record->returnAddressRegister);

  FIRCLSDwarfInstructionsShow(&record->instructions, record);
}

void FIRCLSFDERecordShow(DWARFFDERecord* record, DWARFCIERecord* cie) {
  if (!record) {
    FIRCLSSDKLog("FDE: null\n");
    return;
  }

  FIRCLSSDKLog("FDE:\n");
  FIRCLSSDKLog("      length: %llu\n", record->length);
  FIRCLSSDKLog("  CIE offset: %llu\n", record->cieOffset);
  FIRCLSSDKLog("  start addr: 0x%lx\n", record->startAddress);
  FIRCLSSDKLog("       range: %lu\n", record->rangeSize);

  FIRCLSDwarfInstructionsShow(&record->instructions, cie);
}

void FIRCLSDwarfPointerEncodingShow(const char* leadString, uint8_t encoding) {
  if (encoding == DW_EH_PE_omit) {
    FIRCLSSDKLog("%s: 0x%02x (omit)\n", leadString, encoding);
  } else {
    const char* peValue = "";
    const char* peOffset = "";

    switch (encoding & DW_EH_PE_VALUE_MASK) {
      case DW_EH_PE_absptr:
        peValue = "DW_EH_PE_absptr";
        break;
      case DW_EH_PE_uleb128:
        peValue = "DW_EH_PE_uleb128";
        break;
      case DW_EH_PE_udata2:
        peValue = "DW_EH_PE_udata2";
        break;
      case DW_EH_PE_udata4:
        peValue = "DW_EH_PE_udata4";
        break;
      case DW_EH_PE_udata8:
        peValue = "DW_EH_PE_udata8";
        break;
      case DW_EH_PE_signed:
        peValue = "DW_EH_PE_signed";
        break;
      case DW_EH_PE_sleb128:
        peValue = "DW_EH_PE_sleb128";
        break;
      case DW_EH_PE_sdata2:
        peValue = "DW_EH_PE_sdata2";
        break;
      case DW_EH_PE_sdata4:
        peValue = "DW_EH_PE_sdata4";
        break;
      case DW_EH_PE_sdata8:
        peValue = "DW_EH_PE_sdata8";
        break;
      default:
        peValue = "unknown";
        break;
    }

    switch (encoding & DW_EH_PE_RELATIVE_OFFSET_MASK) {
      case DW_EH_PE_absptr:
        break;
      case DW_EH_PE_pcrel:
        peOffset = " + DW_EH_PE_pcrel";
        break;
      case DW_EH_PE_textrel:
        peOffset = " + DW_EH_PE_textrel";
        break;
      case DW_EH_PE_datarel:
        peOffset = " + DW_EH_PE_datarel";
        break;
      case DW_EH_PE_funcrel:
        peOffset = " + DW_EH_PE_funcrel";
        break;
      case DW_EH_PE_aligned:
        peOffset = " + DW_EH_PE_aligned";
        break;
      case DW_EH_PE_indirect:
        peOffset = " + DW_EH_PE_indirect";
        break;
      default:
        break;
    }

    FIRCLSSDKLog("%s: 0x%02x (%s%s)\n", leadString, encoding, peValue, peOffset);
  }
}

void FIRCLSDwarfInstructionsShow(DWARFInstructions* instructions, DWARFCIERecord* cie) {
  if (!instructions) {
    FIRCLSSDKLog("Error: Instructions null\n");
  }

  FIRCLSDwarfState state;

  memset(&state, 0, sizeof(FIRCLSDwarfState));

  FIRCLSDwarfInstructionsEnumerate(instructions, cie, &state, -1);
}

#endif

#else
INJECT_STRIP_SYMBOL(dwarf_unwind)
#endif


text:
/**
 * Internal dependencies
 */
import useProviderContextValueProvider from './useProviderContextValueProvider';
import { PROVIDERS } from './providerConfiguration';

/**
 * @typedef {import('./typedefs').Media3pReducerState} Media3pReducerState
 * @typedef {import('./typedefs').Media3pReducerActions} Media3pReducerActions
 * @typedef {import('./typedefs').Media3pContext} Media3pContext
 */

function useProviderSetContextValueProvider(reducerState, reducerActions) {
  const result = {};

  for (const provider of Object.keys(PROVIDERS)) {
    // eslint-disable-next-line react-hooks/rules-of-hooks -- The 'providers' list is a constant, and so hooks are still called in the same order during a re-render as per rules-of-hooks.
    result[provider] = useProviderContextValueProvider(
      provider,
      reducerState,
      reducerActions
    );
  }
  return result;
}

/**
 * Context fragment provider for 3rd party media (Unsplash, Coverr, etc).
 * This is called from {@link MediaProvider} to provide the media global state.
 *
 * @param {Media3pReducerState} reducerState The 'media3p'
 * fragment of the state returned from `useMediaReducer`
 * @param {Media3pReducerActions} reducerActions
 * The 'media3p' fragment of the actions returned from `useMediaReducer`
 * @return {Media3pContext} Object containing all context state and actions of
 * media3p.
 */
export default function useContextValueProvider(reducerState, reducerActions) {
  return {
    state: {
      selectedProvider: reducerState.selectedProvider,
      searchTerm: reducerState.searchTerm,
    },
    actions: {
      setSelectedProvider: reducerActions.setSelectedProvider,
      setSearchTerm: reducerActions.setSearchTerm,
    },
    ...useProviderSetContextValueProvider(reducerState, reducerActions),
  };
}


text:
'use strict';

var gulp = require('gulp');
var gutil = require('gulp-util');
var source = require('vinyl-source-stream');
var watchify = require('watchify');
var glob = require('glob');
var browserify = require('browserify');
var babelify = require('babelify');
var aliasify = require('aliasify');
var extend = require('extend');

var config = require('../config');

module.exports = function buildTestsTask(before, after) {
    var bundler = watchify(browserify(extend(watchify.args, {
        debug: true,
        entry: true
    })));

    glob.sync(config.test.files).forEach(function(filePath) {
        bundler = bundler.add(filePath);
    });

    bundler = bundler.transform(babelify.configure({
        only: /^(?!.*node_modules)+.+\.js$/,
        sourceMap: 'inline',
        sourceMapRelative: __dirname
    }))
    .transform(aliasify.configure({
        aliases: {
            'x-tag': '../../shims/x-tag.js'
        },
        configDir: __dirname
    }))
    .on('update', _build);

    function _build(changedFiles) {
        gutil.log('building is starting...');

        if(changedFiles) {
            gutil.log([ 'files to rebuild:' ].concat(changedFiles).join('\n'));
        }

        return before(changedFiles)
            .pipe(bundler.bundle())
            .on('error', function(err) {
                gutil.log('Browserify error:', err.message);
            })
            .pipe(source(config.test.bundle.name))
            .pipe(gulp.dest(config.test.bundle.dir))
            .on('finish', function() {
                gutil.log('building finished!');
            })
            .pipe(after(changedFiles));
    };

    return function() {
        return _build();
    };
};


text:
package org.apache.hive.ptest.execution;

import org.approvaltests.Approvals;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import java.io.File;
import java.net.URL;
import java.util.HashSet;
import java.util.Set;

public class TestTestCheckPhase extends AbstractTestPhase {
  private TestCheckPhase phase;

  @Before
  public void setup() throws Exception {
    initialize(getClass().getSimpleName());
    createHostExecutor();
  }
  @Test
  public void testNoTests() throws Exception {
    URL url = this.getClass().getResource("/HIVE-9377.1.patch");
    File patchFile = new File(url.getFile());
    Set<String> addedTests = new HashSet<String>();
    phase = new TestCheckPhase(hostExecutors, localCommandFactory,
      templateDefaults, patchFile, logger, addedTests);
    phase.execute();

    Assert.assertEquals(addedTests.size(), 0);
  }

  @Test
  public void testJavaTests() throws Exception {
    URL url = this.getClass().getResource("/HIVE-10761.6.patch");
    File patchFile = new File(url.getFile());
    Set<String> addedTests = new HashSet<String>();
    phase = new TestCheckPhase(hostExecutors, localCommandFactory,
      templateDefaults, patchFile, logger, addedTests);
    phase.execute();

    Assert.assertEquals(addedTests.size(), 3);
    Assert.assertTrue(addedTests.contains("TestCodahaleMetrics.java"));
    Assert.assertTrue(addedTests.contains("TestMetaStoreMetrics.java"));
    Assert.assertTrue(addedTests.contains("TestLegacyMetrics.java"));
  }

  @Test
  public void testQTests() throws Exception {
    URL url = this.getClass().getResource("/HIVE-11271.4.patch");
    File patchFile = new File(url.getFile());
    Set<String> addedTests = new HashSet<String>();
    phase = new TestCheckPhase(hostExecutors, localCommandFactory,
      templateDefaults, patchFile, logger, addedTests);
    phase.execute();

    Assert.assertEquals(addedTests.size(), 1);
    Assert.assertTrue(addedTests.contains("unionall_unbalancedppd.q"));
  }

  @Test
  public void testRemoveTest() throws Exception {
    URL url = this.getClass().getResource("/remove-test.patch");
    File patchFile = new File(url.getFile());
    Set<String> addedTests = new HashSet<String>();
    phase = new TestCheckPhase(hostExecutors, localCommandFactory,
      templateDefaults, patchFile, logger, addedTests);
    phase.execute();

    Assert.assertEquals(addedTests.size(), 0);
  }
}


text:
using System.Collections.Generic;

namespace Amberframe.UI.Abstractions.Controls
{
    public interface ITabControl : IInputControl<int>
    {
        IList<IPanel> TabPages { get; }
    }
}


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

namespace Azure.ResourceManager.DataFactory.Models
{
    /// <summary> HDInsight Pig activity type. </summary>
    public partial class HDInsightPigActivity : ExecutionActivity
    {
        /// <summary> Initializes a new instance of HDInsightPigActivity. </summary>
        /// <param name="name"> Activity name. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception>
        public HDInsightPigActivity(string name) : base(name)
        {
            Argument.AssertNotNull(name, nameof(name));

            StorageLinkedServices = new ChangeTrackingList<FactoryLinkedServiceReference>();
            Defines = new ChangeTrackingDictionary<string, BinaryData>();
            ActivityType = "HDInsightPig";
        }

        /// <summary> Initializes a new instance of HDInsightPigActivity. </summary>
        /// <param name="name"> Activity name. </param>
        /// <param name="activityType"> Type of activity. </param>
        /// <param name="description"> Activity description. </param>
        /// <param name="dependsOn"> Activity depends on condition. </param>
        /// <param name="userProperties"> Activity user properties. </param>
        /// <param name="additionalProperties"> Additional Properties. </param>
        /// <param name="linkedServiceName"> Linked service reference. </param>
        /// <param name="policy"> Activity policy. </param>
        /// <param name="storageLinkedServices"> Storage linked service references. </param>
        /// <param name="arguments"> User specified arguments to HDInsightActivity. Type: array (or Expression with resultType array). </param>
        /// <param name="getDebugInfo"> Debug info option. </param>
        /// <param name="scriptPath"> Script path. Type: string (or Expression with resultType string). </param>
        /// <param name="scriptLinkedService"> Script linked service reference. </param>
        /// <param name="defines"> Allows user to specify defines for Pig job request. </param>
        internal HDInsightPigActivity(string name, string activityType, string description, IList<ActivityDependency> dependsOn, IList<ActivityUserProperty> userProperties, IDictionary<string, BinaryData> additionalProperties, FactoryLinkedServiceReference linkedServiceName, ActivityPolicy policy, IList<FactoryLinkedServiceReference> storageLinkedServices, BinaryData arguments, HDInsightActivityDebugInfoOptionSetting? getDebugInfo, BinaryData scriptPath, FactoryLinkedServiceReference scriptLinkedService, IDictionary<string, BinaryData> defines) : base(name, activityType, description, dependsOn, userProperties, additionalProperties, linkedServiceName, policy)
        {
            StorageLinkedServices = storageLinkedServices;
            Arguments = arguments;
            GetDebugInfo = getDebugInfo;
            ScriptPath = scriptPath;
            ScriptLinkedService = scriptLinkedService;
            Defines = defines;
            ActivityType = activityType ?? "HDInsightPig";
        }

        /// <summary> Storage linked service references. </summary>
        public IList<FactoryLinkedServiceReference> StorageLinkedServices { get; }
        /// <summary>
        /// User specified arguments to HDInsightActivity. Type: array (or Expression with resultType array).
        /// <para>
        /// To assign an object to this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>.
        /// </para>
        /// <para>
        /// To assign an already formated json string to this property use <see cref="BinaryData.FromString(string)"/>.
        /// </para>
        /// <para>
        /// Examples:
        /// <list type="bullet">
        /// <item>
        /// <term>BinaryData.FromObjectAsJson("foo")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("\"foo\"")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// </list>
        /// </para>
        /// </summary>
        public BinaryData Arguments { get; set; }
        /// <summary> Debug info option. </summary>
        public HDInsightActivityDebugInfoOptionSetting? GetDebugInfo { get; set; }
        /// <summary>
        /// Script path. Type: string (or Expression with resultType string).
        /// <para>
        /// To assign an object to this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>.
        /// </para>
        /// <para>
        /// To assign an already formated json string to this property use <see cref="BinaryData.FromString(string)"/>.
        /// </para>
        /// <para>
        /// Examples:
        /// <list type="bullet">
        /// <item>
        /// <term>BinaryData.FromObjectAsJson("foo")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("\"foo\"")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// </list>
        /// </para>
        /// </summary>
        public BinaryData ScriptPath { get; set; }
        /// <summary> Script linked service reference. </summary>
        public FactoryLinkedServiceReference ScriptLinkedService { get; set; }
        /// <summary>
        /// Allows user to specify defines for Pig job request.
        /// <para>
        /// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>.
        /// </para>
        /// <para>
        /// To assign an already formated json string to this property use <see cref="BinaryData.FromString(string)"/>.
        /// </para>
        /// <para>
        /// Examples:
        /// <list type="bullet">
        /// <item>
        /// <term>BinaryData.FromObjectAsJson("foo")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("\"foo\"")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// </list>
        /// </para>
        /// </summary>
        public IDictionary<string, BinaryData> Defines { get; }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Boletín de la Sociedad Mexicana de Micología 17: 50 (1983)

#### Original name
Lepiota quintanaroensis Guzm.-Dáv. & Guzmán

### Remarks
null


text:
layout: post
---

Welcome to to the ADS Help Pages

This site is a place to find documentation, tutorials, and information about new features.

  To view the latest information about the ADS, visit the ADS blog.

To see the latest releases to our website, API, and data holdings, see our What's New page.

Sign up for our monthly newsletter to keep up with the latest
developments on our website and the latest posts on our blog.

Search for information by using the search bar in the upper right corner.


text:
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using DeepdreamGui.Model;

namespace DeepdreamGui
{
    /// <summary>
    /// Interactionlogic for "App.xaml"
    /// </summary>
    public partial class App : Application
    {
        private async void Application_Exit(object sender, ExitEventArgs e)
        {
            await Worker.Instance.Kill().ContinueWith(task => Worker.DeleteDirectory(Worker.DataPath));
        }
    }

}


text:
package net.kr9ly.doubler.model;

import com.squareup.javapoet.*;
import net.kr9ly.doubler.ProvidedBy;
import net.kr9ly.doubler.SpecHelper;

import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.element.AnnotationValue;
import javax.lang.model.element.Element;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeMirror;

public class ProvideBuilderClassBuilder {

    private ProcessingEnvironment processingEnv;

    private TypeSpec.Builder classBuilder;

    private MethodSpec.Builder constructorBuilder;

    private MethodSpec.Builder buildMethodBuilder;

    private StringBuilder constructorParams = new StringBuilder();

    private Element provideClass;

    public ProvideBuilderClassBuilder(ProcessingEnvironment processingEnv, Element provideClass) {
        this.processingEnv = processingEnv;
        this.provideClass = provideClass;

        ClassName builderName = ClassName.bestGuess(SpecHelper.getPackageName(processingEnv, provideClass) + "." + toBuilderName(provideClass));

        classBuilder = TypeSpec.classBuilder(builderName.simpleName())
                .addAnnotation(SpecHelper.getGeneratedAnnotation())
                .addModifiers(Modifier.PUBLIC);

        constructorBuilder = MethodSpec.constructorBuilder()
                .addModifiers(Modifier.PUBLIC);

        buildMethodBuilder = MethodSpec.methodBuilder("build")
                .addModifiers(Modifier.PUBLIC)
                .returns(TypeName.get(provideClass.asType()));
    }

    public void addParameterToBuilderMethod(VariableElement variable) {
        String variableName = variable.getSimpleName().toString();
        buildMethodBuilder.addParameter(TypeName.get(variable.asType()), variableName);
    }

    public void addParameterToConstructor(VariableElement parameter) {
        String parameterName = parameter.getSimpleName().toString();

        constructorBuilder.addParameter(TypeName.get(parameter.asType()), parameterName);
        constructorParams.append(parameterName).append(", ");
    }

    public void addProviderInjectField() {
        AnnotationValue annotationValue = SpecHelper.getAnnotationValue(provideClass, ProvidedBy.class);
        ClassName className = ClassName.bestGuess(annotationValue.getValue().toString());
        String parameterName = "__provider";
        classBuilder
                .addField(className, parameterName, Modifier.PRIVATE)
                .addMethod(
                        MethodSpec.methodBuilder(toSetterName(parameterName))
                                .addModifiers(Modifier.PUBLIC)
                                .addParameter(className, parameterName)
                                .addStatement("this.$L  = $L", parameterName, parameterName)
                                .build()
                );
    }

    public void addInjectField(VariableElement variable) {
        TypeMirror type = variable.asType();
        String parameterName = variable.getSimpleName().toString();
        classBuilder
                .addField(TypeName.get(type), parameterName, Modifier.PRIVATE)
                .addMethod(
                        MethodSpec.methodBuilder(toSetterName(parameterName))
                                .addModifiers(Modifier.PUBLIC)
                                .addParameter(TypeName.get(type), parameterName)
                                .addStatement("this.$L  = $L", parameterName, parameterName)
                                .build()
                );
    }

    public void beginProvidedBuildMethod() {
        buildMethodBuilder.addStatement("$T instance = __provider.provide($T.class)", provideClass.asType(), provideClass.asType());
    }

    public void beginBuildMethod() {
        String constructorParamsStr = "";
        if (constructorParams.length() > 0) {
            constructorParamsStr = constructorParams.substring(0, constructorParams.length() - 2);
        }
        buildMethodBuilder.addStatement("$T instance = new $T($L)", provideClass.asType(), provideClass.asType(), constructorParamsStr);
    }

    public void addBuildMethodStatement(VariableElement field) {
        String fieldName = field.getSimpleName().toString();
        buildMethodBuilder
                .addStatement("instance.$L = $L", fieldName, fieldName);
    }

    public void addBuildMethod() {
        buildMethodBuilder.addStatement("return instance");
        classBuilder.addMethod(buildMethodBuilder.build());
    }

    public TypeSpec build() {
        return classBuilder.build();
    }

    private String toBuilderName(Element module) {
        return module.getSimpleName() + "Builder";
    }

    private String toSetterName(String fieldName) {
        return "set" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
    }
}


text:
<!DOCTYPE HTML>
<html>
<head>
  <title>Test that scaled elements with scrolled contents don't repaint unnecessarily when we scroll inside them</title>
  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
  <script type="application/javascript" src="chrome://mochikit/content/chrome-harness.js"></script>
  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
</head>
<!-- Need a timeout here to allow paint unsuppression before we start the test -->
<body>
<pre id="test">
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();

var root = getRootDirectory(window.location.href);
window.open(root + "transformed_scrolling_repaints_3_window.html", "transformed_scrolling_repaints_3",
            "chrome,width=300,height=400");
</script>
</pre>
</body>
</html>


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

<TITLE>
Overview
</TITLE>

<META NAME="keywords" CONTENT="Overview, Ganymed SSH-2 for Java">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

    Overview
      Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

Ganymed SSH-2 for Java

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Ganymed SSH-2 for Java

Ganymed SSH2 for Java is a library which implements the SSH-2 protocol in pure Java
(tested on J2SE 1.4.2 and 5.0).

See:

          Description

Packages

ch.ethz.ssh2

Ganymed SSH2 for Java is a library which implements the SSH-2 protocol in pure Java
(tested on J2SE 1.4.2 and 5.0). It allows one to connect to SSH servers from within
Java programs. It supports SSH sessions (remote command execution and shell access),
local and remote port forwarding, local stream forwarding, X11 forwarding, SCP and SFTP.
There are no dependencies on any JCE provider, as all crypto functionality is included.

Ganymed SSH2 for Java was first developed for the Ganymed replication project and a
couple of other projects at the IKS group at ETH Zurich.

Website: http://www.ganymed.ethz.ch/ssh2.

Please read the included LICENCE.txt, latest changes can be found in HISTORY.txt.

    Overview
      Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

Ganymed SSH-2 for Java

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


text:
#ifndef __ASM_VIRTEX_DEVICES_H__
#define __ASM_VIRTEX_DEVICES_H__

#include <linux/platform_device.h>

/* ML300/403 reference design framebuffer driver platform data struct */
struct xilinxfb_platform_data {
	u32 rotate_screen;
	u32 screen_height_mm;
	u32 screen_width_mm;
};

void __init virtex_early_serial_map(void);

/* Prototype for device fixup routine.  Implement this routine in the
 * board specific fixup code and the generic setup code will call it for
 * each device is the platform device list.
 *
 * If the hook returns a non-zero value, then the device will not get
 * registered with the platform bus
 */
int virtex_device_fixup(struct platform_device *dev);

#endif  /* __ASM_VIRTEX_DEVICES_H__ */


text:
package edu.isi.wubble.jgn.sheep.entity;

import com.jme.bounding.OrientedBoundingBox;
import com.jme.intersection.TriangleCollisionResults;
import com.jme.math.Vector3f;
import com.jme.renderer.ColorRGBA;
import com.jme.scene.Node;
import com.jme.scene.Spatial;
import com.jmex.physics.DynamicPhysicsNode;
import com.jmex.physics.material.Material;

import edu.isi.wubble.jgn.sheep.Utils;
import edu.isi.wubble.physics.entity.controller.GoaltendingController;

public class Wrench extends SDynamicEntity {

	public Wrench(String name, int x, int y, int z) {
		// For now, no user controlling of wrenches.
		super(name, new Vector3f(x,y,z));
	}

	protected void makeBody() {
		String filename = "wrench.jme";
		Spatial body = Utils.loadModel(filename);

		// Set the name of this spatial to the name of the entity, to allow Entity::checkCollisions
		// to pull the right name for the mesh's parent.
		body.setName(getName());
		body.setModelBound(new OrientedBoundingBox());
		body.updateModelBound();
		// This is important for geometry-based collisions to work correctly
		for (Spatial child : ((Node) body).getChildren()) {
			child.setName(getName());
		}

		// Attach the body to the node, set the bounds and material.
		DynamicPhysicsNode p = getPhysicsNode();
		p.attachChild(body);
		p.setMaterial(Material.IRON);
		Utils.setColor(body, ColorRGBA.brown);
	}

	//
	// Wrenches need more accurate physics geometry, so this method is overridden.
	// ////////////////////////////////////////////////////////////
	protected void makePhysics() {
		// Is this where to put it?
		DynamicPhysicsNode p = getPhysicsNode();

		// Does this help?
		p.setModelBound(new OrientedBoundingBox());
		p.updateModelBound();

		p.generatePhysicsGeometry(true);
		p.computeMass();
	}

	@Override
	// Override this to also add the goaltending controller for wrenches.
	public void addLoggingControllers() {
		super.addLoggingControllers();

		GoaltendingController gtc = new GoaltendingController(this);
		gtc.setActive(true);
		addController(gtc);
	}

	@Override
	// ////////////////////////////////////////////////////////////
	protected void setCollisionResultsType() { _res = new TriangleCollisionResults(); }
}


text:
/* eslint-disable no-console */

import React, { useCallback, useEffect, useState } from 'react';
import { useFocus } from 'ink';
import { msg } from '../translate';
import { Prompt, PromptProps } from './internal/Prompt';
import { Selected } from './internal/Selected';
import { Style } from './Style';

export interface ConfirmProps extends Omit<PromptProps<boolean>, 'validate'> {
	/** Error message to display when an invalid character is pressed. Defaults to a custom message. */
	invalidError?: string;
	/** Character that triggers a falsy state when pressed. Defaults to "N". */
	no?: string;
	/** Character that triggers a truthy state when pressed. Defaults to "y". */
	yes?: string;
}

/**
 * A React component that renders a yes/no confirmation prompt.
 */
export function Confirm(props: ConfirmProps) {
	const { invalidError, onSubmit, no = 'N', yes = 'y', ...restProps } = props;
	const [value, setValue] = useState<boolean | null>(null);
	const { isFocused } = useFocus({ autoFocus: true });

	useEffect(() => {
		if (no.length !== 1) {
			console.error(`Prop "no" must be a single character.`);
		} else if (yes.length !== 1) {
			console.error(`Prop "yes" must be a single character.`);
		}
	}, [no, yes]);

	const handleInput = useCallback(
		(input: string) => {
			if (input === no) {
				setValue(false);
				onSubmit(false);
			} else if (input === yes) {
				setValue(true);
				onSubmit(true);
			} else {
				setValue(null);

				throw new Error(invalidError ?? msg('prompt:confirmInvalidValue', { no, yes }));
			}

			// Trigger submit
			return true;
		},
		[invalidError, no, onSubmit, yes],
	);

	return (
		<Prompt<boolean>
			{...restProps}
			afterLabel={
				value === null ? <Style type="muted">{`(${yes}/${no})`}</Style> : <Selected value={value} />
			}
			focused={isFocused}
			value={value}
			onInput={handleInput}
		/>
	);
}


text: Simple number grid game.


text:
id: 60facf914c7b9b08d7510c2c
title: Step 34
challengeType: 0
dashedName: step-34
---

# --description--

The `textarea` appears too small. To give it an initial size, you can add the `rows` and `cols` attributes.

Add an initial size of `3` rows and `30` columns.

# --hints--

You should give the `textarea` a `rows` attribute with value `3`.

```js
assert.equal(document.querySelector('fieldset:nth-child(3) > label:nth-child(4) > textarea')?.rows, 3);
```

You should give the textarea a `cols` attribute with value `30`.

```js
assert.equal(document.querySelector('fieldset:nth-child(3) > label:nth-child(4) > textarea')?.cols, 30);
```

# --seed--

## --seed-contents--

```html
<!DOCTYPE html>
<html>
  <head>
    <title>freeCodeCamp Registration Form Project</title>
	  <link rel="stylesheet" type="text/css" href="styles.css" />
  </head>
  <body>
    <h1>Registration Form</h1>
    <p>Please fill out this form with the required information</p>
    <form action='https://fcc-registration-form.com'>
      <fieldset>
        <label>Enter Your First Name: <input type="text" required /></label>
        <label>Enter Your Last Name: <input type="text" required /></label>
        <label>Enter Your Email: <input type="email" required /></label>
        <label>Create a New Password: <input type="password" pattern="[a-z0-5]{8,}" required /></label>
      </fieldset>
      <fieldset>
        <label><input type="radio" name="account-type" /> Personal Account</label>
        <label><input type="radio" name="account-type" /> Business Account</label>
        <label>
          <input type="checkbox" required /> I accept the <a href="https://www.freecodecamp.org/news/terms-of-service/">terms and conditions</a>
			  </label>
      </fieldset>
--fcc-editable-region--
      <fieldset>
        <label>Upload a profile picture: <input type="file" /></label>
        <label>Input your age (years): <input type="number" min="13" max="120" />
			  </label>
        <label>How did you hear about us?
          <select>
            <option value="">(select one)</option>
            <option value="1">freeCodeCamp News</option>
            <option value="2">freeCodeCamp YouTube Channel</option>
            <option value="3">freeCodeCamp Forum</option>
            <option value="4">Other</option>
          </select>
        </label>
        <label>Provide a bio:
				  <textarea></textarea>
			  </label>
      </fieldset>
--fcc-editable-region--
      <input type="submit" value="Submit" />
    </form>
  </body>
</html>
```

```css
body {
  width: 100%;
  height: 100vh;
  margin: 0;
  background-color: #1b1b32;
	color: #f5f6f7;
}

label {
	display: block;
	margin: 0.5rem 0;
}

```


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PseudoInternationalization {

    class ProcessorFactory {

        private static readonly Dictionary<string, Type> _extensionMap = new Dictionary<string, Type> {
            { ".resx", typeof(ResxProcessor) },
            { ".xml", typeof(AndroidProcessor) },
            { ".strings", typeof(StringsProcessor) }
        };

        public bool IsSupported(string path) => _extensionMap.ContainsKey(Path.GetExtension(path));

        public IProcessor GetProcessor(string path) {
            var extension = Path.GetExtension(path);
            if (_extensionMap.ContainsKey(extension)) {
                return (IProcessor)Activator.CreateInstance(_extensionMap[extension]);
            }
            else {
                throw new ArgumentException("File type not supported");
            }
        }

    }

}


text:
using mockitopp::mock_object;
using mockitopp::matcher::null;

struct test_null : tpunit::TestFixture
{
   test_null() : tpunit::TestFixture
   (
      TEST(test_null::prim_int_ptr),
      TEST(test_null::std_string_ptr),
      TEST(test_null::object_ptr)
   )
   {}

   struct null_test_object {};

   struct null_test_interface
   {
      virtual std::string prim_int_ptr(int*) = 0;
      virtual std::string std_string_ptr(std::string*) = 0;
      virtual std::string object_ptr(null_test_object*) = 0;
   };

   void prim_int_ptr()
   {
      mock_object<null_test_interface> mock;
      mock(&null_test_interface::prim_int_ptr).when(null<int*>()).thenReturn("int* == NULL");
      null_test_interface& obj = mock.getInstance();

      ASSERT_EQUAL("int* == NULL", obj.prim_int_ptr(0));
      ASSERT_THROW(obj.prim_int_ptr(new int), mockitopp::partial_implementation_exception);
   }

   void std_string_ptr()
   {
      mock_object<null_test_interface> mock;
      mock(&null_test_interface::std_string_ptr).when(null<std::string*>()).thenReturn("std::string* == NULL");
      null_test_interface& obj = mock.getInstance();

      ASSERT_EQUAL("std::string* == NULL", obj.std_string_ptr(0));
      ASSERT_THROW(obj.std_string_ptr(new std::string("foo")), mockitopp::partial_implementation_exception);
      ASSERT_THROW(obj.std_string_ptr(new std::string("bar")), mockitopp::partial_implementation_exception);
   }

   void object_ptr()
   {
      mock_object<null_test_interface> mock;
      mock(&null_test_interface::object_ptr).when(null<null_test_object*>()).thenReturn("null_test_obj* == NULL");
      null_test_interface& obj = mock.getInstance();

      ASSERT_EQUAL("null_test_obj* == NULL", obj.object_ptr(0));
      ASSERT_THROW(obj.object_ptr(new null_test_object), mockitopp::partial_implementation_exception);
   }
} __test_null;


text:
package io.imgn.common.io;

import static java.util.Objects.requireNonNull;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Optional;

public final class Resources {

  private Resources() {
  }

  public static ByteSource asByteSource(URL url) {
    return new UrlByteSource(url);
  }

  public static URL getResource(String resourceName) {
    return tryGetResource(resourceName)
        .orElseThrow(
            () -> new IllegalArgumentException("resource " + resourceName + " not found."));
  }

  public static URL getResource(Class<?> contextClass, String resourceName) {
    return tryGetResource(contextClass, resourceName)
        .orElseThrow(() -> new IllegalArgumentException(
            "resource " + resourceName + " relative to " + contextClass.getName() + " not found."));
  }

  public static Optional<URL> tryGetResource(String resourceName) {
    ClassLoader loader = Optional.ofNullable(Thread.currentThread().getContextClassLoader())
        .orElseGet(Resources.class::getClassLoader);
    return Optional.ofNullable(loader.getResource(resourceName));
  }

  public static Optional<URL> tryGetResource(Class<?> contextClass, String resourceName) {
    return Optional.ofNullable(contextClass.getResource(resourceName));
  }

  private static final class UrlByteSource extends ByteSource {

    private final URL url;

    private UrlByteSource(URL url) {
      this.url = requireNonNull(url);
    }

    @Override
    public InputStream openStream() throws IOException {
      return url.openStream();
    }

    @Override
    public String toString() {
      return "Resources.asByteSource(" + url + ")";
    }
  }
}


text:
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">

	<context:component-scan base-package="com.viewer.controller" />

	<bean		class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="prefix">
			<value>/WEB-INF/views/</value>
		</property>
		<property name="suffix">
			<value>.jsp</value>
		</property>

	</bean>

	<mvc:resources mapping="/resources/**" location="classpath:/" />
	<mvc:default-servlet-handler ></mvc:default-servlet-handler>
	<mvc:annotation-driven />

</beans>


text:
<?xml version="1.0" encoding="utf-8"?>

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/blue_underline_dark"
        android:state_checked="true"/>
    <item android:drawable="@color/superDarkGrey"
        android:state_checked="false"/>
</selector>


text:
import pytest
from testfixtures import compare, Comparison as C
from pyramid import testing
# from rebecca.testing import config

@pytest.fixture
def config(request):
    config = testing.setUp()

    def fin():
        testing.tearDown()

    request.addfinalizer(fin)
    return config

class TestRouteMenuFactory(object):
    @pytest.fixture
    def target(self):
        from rebecca.menu import RouteMenuFactory
        return RouteMenuFactory

    def test_has_permission(self, config, target):
        from rebecca.menu import MenuItem
        config.add_route("menu1", 'menus/menu1')
        config.add_route("menu2", 'menus/menu2')

        config.testing_securitypolicy(userid="testing")

        menu_factory = target(name=testing)
        menu_factory.add_item(route_name="menu1", display_name="testing-menu1")
        menu_factory.add_item(
            route_name="menu2",
            display_name="testing-menu2",
            permission="testing-permission")
        request = testing.DummyRequest()
        result = menu_factory(request)

        compare(
            result.menu_items, [
                C(MenuItem,
                  strict=False,
                  url="http://example.com/menus/menu1",
                  display_name="testing-menu1"),
                C(MenuItem,
                  strict=False,
                  url="http://example.com/menus/menu2",
                  display_name="testing-menu2")
            ])

    def test_without_permission(self, config, target):
        from rebecca.menu import MenuItem
        config.add_route("menu1", 'menus/menu1')
        config.add_route("menu2", 'menus/menu2/')

        config.testing_securitypolicy(userid="testing", permissive=False)

        menu_factory = target(name=testing)
        menu_factory.add_item(route_name="menu1", display_name="testing-menu1")
        menu_factory.add_item(
            route_name="menu2",
            display_name="testing-menu2",
            permission="testing-permission")
        request = testing.DummyRequest()
        result = menu_factory(request)

        compare(
            result.menu_items, [
                C(MenuItem,
                  strict=False,
                  url="http://example.com/menus/menu1",
                  display_name="testing-menu1")
            ])

    def test_matchdict(self, config, target):
        from rebecca.menu import MenuItem
        config.add_route("menu1", 'menus/menu1/{testing_vars}')

        config.testing_securitypolicy(userid="testing", permissive=False)

        menu_factory = target(name=testing)
        menu_factory.add_item(route_name="menu1", display_name="testing-menu1")
        request = testing.DummyRequest(
            matchdict={"testing_vars": "that-is-testing"})
        result = menu_factory(request)

        compare(
            result.menu_items, [
                C(MenuItem,
                  strict=False,
                  url="http://example.com/menus/menu1/that-is-testing",
                  display_name="testing-menu1")
            ])


text:
package designpatterns.factory.pizzafm;

public class ChicagoStyleVeggiePizza extends Pizza {
	public ChicagoStyleVeggiePizza() {
		name = "Chicago Deep Dish Veggie Pizza";
		dough = "Extra Thick Crust Dough";
		sauce = "Plum Tomato Sauce";

		toppings.add("Shredded Mozzarella Cheese");
		toppings.add("Black Olives");
		toppings.add("Spinach");
		toppings.add("Eggplant");
	}

	void cut() {
		System.out.println("Cutting the pizza into square slices");
	}
}


text:
<META http-equiv="content-type" content="text/html; charset=utf-8"><title>编辑留言</title>
<?php error_reporting(0);
include 'conn.php'; session_start();
//echo $_POST[id],$_SESSION[userid],$_POST[content];
$query="UPDATE `post_detail` SET `text`='$_POST[content]' WHERE ID='$_POST[id]' AND floor='1'";
$querya="UPDATE `post_base` SET `title`='$_POST[title]' WHERE ID='$_POST[id]'";
mysql_query($query);mysql_query($querya);

?>
<?php
//页面跳转,实现方式为javascript
$url = "list.php";
echo "<script language='javascript' type='text/javascript'>";
echo "window.location.href='$url'";
echo "</script>";
?>


text:
package org.eclipse.paho.mqtt.ui;

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

/**
 * Constants
 *
 * @author Bin Zhang
 */
public final class Constants {
	// system property to be over written
	public static final String PROP_DATA_DIR = "paho.data.dir";
	// data dir inside paho UI application directory
	public static final String DATA_DIR = "data";
	public static final String DATA_FILE_EXTENSION = ".paho";
	public static final String TCP_SERVER_URI = "tcp://localhost:1883";
	public static final String SSL_SERVER_URI = "ssl://localhost:8883";
	public static final String DEFAULT_SERVER_URI = TCP_SERVER_URI;
	public static final List<String> HA_SERVER_URIS = Collections.unmodifiableList(Arrays.asList(TCP_SERVER_URI,
			SSL_SERVER_URI));
	public static final List<String> MQTT_SCHEMES = Collections.unmodifiableList(Arrays.asList("tcp", "ssl", "local"));
	public static final int BUTTON_WIDTH = 100;
	public static final String DEFAULT_DATA_FORMAT = "yyyy-MM-dd HH:mm:ss";

	// Image keys
	public static class ImageKeys {
		public static final String IMG_CONNECTION = "connection";
		public static final String IMG_CONNECTION_EDIT = "connection_edit";
		public static final String IMG_CONNECTION_GRAY = "connection_gray";
		public static final String IMG_MQTT = "mqtt";
		public static final String IMG_ADD = "add";
		public static final String IMG_ADD_GRAY = "add_gray";
		public static final String IMG_REMOVE = "remove";
		public static final String IMG_REMOVE_GRAY = "remove_gray";
		public static final String IMG_CLEAR = "clear";
		public static final String IMG_OPTIONS = "options";
		public static final String IMG_HISTORY = "history";
		public static final String IMG_LASTMSG = "lastmsg";
	}

}


text:
{% extends 'layout.html' %}

{% block content %}

map all the things

Your WA geographical data wizard

About Us

We respectfully acknowledge the past and present traditional owners of this land on which we are meeting, the Noongar people. It is a privilege to be standing on Noongar country. We also acknowledge the contributions of Aboriginal Australians and non-Aboriginal Australians to the education of all children and people in this country we all live in and share together – Australia.

Members

Molly Tebo

An eLearning Librarian, former scientist, trainer, spinner, knitter, photographer and mother. Molly is a loudmouth and loves working on interesting tech projects.

@madradish

Marcus Holmes

Gentleman technologist and start-up monkey. Runs //Startup News

@GentlemanTech

Mary Hewitt

Musician, Composer, Geologist, Geospatial Scientist, Perpetual University Student and Data Nerd.

@MaryHewitt93

Patrik Affentranger

Awesome web publisher, who basically learnt Google Maps API in a day.

@pzimat

Van Dutton

Passionnate about collaborative innovation for transformation of business and society

@hangvan96

Jacqui Swingler

Mother, Designer, Innovator and Life-Long Learner

@jjandthebear

{% endblock  %}