text:
#include "SDL_config.h"

#include "CDPlayer.h"
#include "AudioFilePlayer.h"
#include "SDLOSXCAGuard.h"

/* we're exporting these functions into C land for SDL_syscdrom.c */
/*extern "C" {*/

/*///////////////////////////////////////////////////////////////////////////
    Constants
  //////////////////////////////////////////////////////////////////////////*/

#define kAudioCDFilesystemID   (UInt16)(('J' << 8) | 'H') /* 'JH'; this avoids compiler warning */

/* XML PList keys */
#define kRawTOCDataString           "Format 0x02 TOC Data"
#define kSessionsString             "Sessions"
#define kSessionTypeString          "Session Type"
#define kTrackArrayString           "Track Array"
#define kFirstTrackInSessionString      "First Track"
#define kLastTrackInSessionString       "Last Track"
#define kLeadoutBlockString         "Leadout Block"
#define kDataKeyString              "Data"
#define kPointKeyString             "Point"
#define kSessionNumberKeyString         "Session Number"
#define kStartBlockKeyString            "Start Block"

/*///////////////////////////////////////////////////////////////////////////
    Globals
  //////////////////////////////////////////////////////////////////////////*/

#pragma mark -- Globals --

static int             playBackWasInit = 0;
static AudioUnit        theUnit;
static AudioFilePlayer* thePlayer = NULL;
static CDPlayerCompletionProc   completionProc = NULL;
static SDL_mutex       *apiMutex = NULL;
static SDL_sem         *callbackSem;
static SDL_CD*          theCDROM;

/*///////////////////////////////////////////////////////////////////////////
    Prototypes
  //////////////////////////////////////////////////////////////////////////*/

#pragma mark -- Prototypes --

static OSStatus CheckInit ();

static void     FilePlayNotificationHandler (void* inRefCon, OSStatus inStatus);

static int      RunCallBackThread (void* inRefCon);

#pragma mark -- Public Functions --

void     Lock ()
{
    if (!apiMutex) {
        apiMutex = SDL_CreateMutex();
    }
    SDL_mutexP(apiMutex);
}

void     Unlock ()
{
    SDL_mutexV(apiMutex);
}

int DetectAudioCDVolumes(FSVolumeRefNum *volumes, int numVolumes)
{
    int volumeIndex;
    int cdVolumeCount = 0;
    OSStatus result = noErr;

    for (volumeIndex = 1; result == noErr || result != nsvErr; volumeIndex++)
    {
        FSVolumeRefNum  actualVolume;
        FSVolumeInfo    volumeInfo;

        memset (&volumeInfo, 0, sizeof(volumeInfo));

        result = FSGetVolumeInfo (kFSInvalidVolumeRefNum,
                                  volumeIndex,
                                  &actualVolume,
                                  kFSVolInfoFSInfo,
                                  &volumeInfo,
                                  NULL,
                                  NULL);

        if (result == noErr)
        {
            if (volumeInfo.filesystemID == kAudioCDFilesystemID) /* It's an audio CD */
            {
                if (volumes != NULL && cdVolumeCount < numVolumes)
                    volumes[cdVolumeCount] = actualVolume;

                cdVolumeCount++;
            }
        }
        else
        {
            /* I'm commenting this out because it seems to be harmless */
            /*SDL_SetError ("DetectAudioCDVolumes: FSGetVolumeInfo returned %d", result);*/
        }
    }

    return cdVolumeCount;
}

int ReadTOCData (FSVolumeRefNum theVolume, SDL_CD *theCD)
{
    HFSUniStr255      dataForkName;
    OSStatus          theErr;
    FSIORefNum        forkRefNum;
    SInt64            forkSize;
    Ptr               forkData = 0;
    ByteCount         actualRead;
    CFDataRef         dataRef = 0;
    CFPropertyListRef propertyListRef = 0;
    int               i;
    FSRefParam      fsRefPB;
    FSRef           tocPlistFSRef;
    FSRef           rootRef;
    const char* error = "Unspecified Error";
    const UniChar uniName[] = { '.','T','O','C','.','p','l','i','s','t' };

    theErr = FSGetVolumeInfo(theVolume, 0, 0, kFSVolInfoNone, 0, 0, &rootRef);
    if(theErr != noErr) {
        error = "FSGetVolumeInfo";
        goto bail;
    }

    SDL_memset(&fsRefPB, '\0', sizeof (fsRefPB));

    /* get stuff from .TOC.plist */
    fsRefPB.ref = &rootRef;
    fsRefPB.newRef = &tocPlistFSRef;
    fsRefPB.nameLength = sizeof (uniName) / sizeof (uniName[0]);
    fsRefPB.name = uniName;
    fsRefPB.textEncodingHint = kTextEncodingUnknown;

    theErr = PBMakeFSRefUnicodeSync (&fsRefPB);
    if(theErr != noErr) {
        error = "PBMakeFSRefUnicodeSync";
        goto bail;
    }

    /* Load and parse the TOC XML data */

    theErr = FSGetDataForkName (&dataForkName);
    if (theErr != noErr) {
        error = "FSGetDataForkName";
        goto bail;
    }

    theErr = FSOpenFork (&tocPlistFSRef, dataForkName.length, dataForkName.unicode, fsRdPerm, &forkRefNum);
    if (theErr != noErr) {
        error = "FSOpenFork";
        goto bail;
    }

    theErr = FSGetForkSize (forkRefNum, &forkSize);
    if (theErr != noErr) {
        error = "FSGetForkSize";
        goto bail;
    }

    /* Allocate some memory for the XML data */
    forkData = NewPtr (forkSize);
    if(forkData == NULL) {
        error = "NewPtr";
        goto bail;
    }

    theErr = FSReadFork (forkRefNum, fsFromStart, 0 /* offset location */, forkSize, forkData, &actualRead);
    if(theErr != noErr) {
        error = "FSReadFork";
        goto bail;
    }

    dataRef = CFDataCreate (kCFAllocatorDefault, (UInt8 *)forkData, forkSize);
    if(dataRef == 0) {
        error = "CFDataCreate";
        goto bail;
    }

    propertyListRef = CFPropertyListCreateFromXMLData (kCFAllocatorDefault,
                                                       dataRef,
                                                       kCFPropertyListImmutable,
                                                       NULL);
    if (propertyListRef == NULL) {
        error = "CFPropertyListCreateFromXMLData";
        goto bail;
    }

    /* Now we got the Property List in memory. Parse it. */

    /* First, make sure the root item is a CFDictionary. If not, release and bail. */
    if(CFGetTypeID(propertyListRef)== CFDictionaryGetTypeID())
    {
        CFDictionaryRef dictRef = (CFDictionaryRef)propertyListRef;

        CFDataRef   theRawTOCDataRef;
        CFArrayRef  theSessionArrayRef;
        CFIndex     numSessions;
        CFIndex     index;

        /* This is how we get the Raw TOC Data */
        theRawTOCDataRef = (CFDataRef)CFDictionaryGetValue (dictRef, CFSTR(kRawTOCDataString));

        /* Get the session array info. */
        theSessionArrayRef = (CFArrayRef)CFDictionaryGetValue (dictRef, CFSTR(kSessionsString));

        /* Find out how many sessions there are. */
        numSessions = CFArrayGetCount (theSessionArrayRef);

        /* Initialize the total number of tracks to 0 */
        theCD->numtracks = 0;

        /* Iterate over all sessions, collecting the track data */
        for(index = 0; index < numSessions; index++)
        {
            CFDictionaryRef theSessionDict;
            CFNumberRef     leadoutBlock;
            CFArrayRef      trackArray;
            CFIndex         numTracks;
            CFIndex         trackIndex;
            UInt32          value = 0;

            theSessionDict      = (CFDictionaryRef) CFArrayGetValueAtIndex (theSessionArrayRef, index);
            leadoutBlock        = (CFNumberRef) CFDictionaryGetValue (theSessionDict, CFSTR(kLeadoutBlockString));

            trackArray = (CFArrayRef)CFDictionaryGetValue (theSessionDict, CFSTR(kTrackArrayString));

            numTracks = CFArrayGetCount (trackArray);

            for(trackIndex = 0; trackIndex < numTracks; trackIndex++) {

                CFDictionaryRef theTrackDict;
                CFNumberRef     trackNumber;
                CFNumberRef     sessionNumber;
                CFNumberRef     startBlock;
                CFBooleanRef    isDataTrack;
                UInt32          value;

                theTrackDict  = (CFDictionaryRef) CFArrayGetValueAtIndex (trackArray, trackIndex);

                trackNumber   = (CFNumberRef)  CFDictionaryGetValue (theTrackDict, CFSTR(kPointKeyString));
                sessionNumber = (CFNumberRef)  CFDictionaryGetValue (theTrackDict, CFSTR(kSessionNumberKeyString));
                startBlock    = (CFNumberRef)  CFDictionaryGetValue (theTrackDict, CFSTR(kStartBlockKeyString));
                isDataTrack   = (CFBooleanRef) CFDictionaryGetValue (theTrackDict, CFSTR(kDataKeyString));

                /* Fill in the SDL_CD struct */
                int idx = theCD->numtracks++;

                CFNumberGetValue (trackNumber, kCFNumberSInt32Type, &value);
                theCD->track[idx].id = value;

                CFNumberGetValue (startBlock, kCFNumberSInt32Type, &value);
                theCD->track[idx].offset = value;

                theCD->track[idx].type = (isDataTrack == kCFBooleanTrue) ? SDL_DATA_TRACK : SDL_AUDIO_TRACK;

                /* Since the track lengths are not stored in .TOC.plist we compute them. */
                if (trackIndex > 0) {
                    theCD->track[idx-1].length = theCD->track[idx].offset - theCD->track[idx-1].offset;
                }
            }

            /* Compute the length of the last track */
            CFNumberGetValue (leadoutBlock, kCFNumberSInt32Type, &value);

            theCD->track[theCD->numtracks-1].length =
                value - theCD->track[theCD->numtracks-1].offset;

            /* Set offset to leadout track */
            theCD->track[theCD->numtracks].offset = value;
        }

    }

    theErr = 0;
    goto cleanup;
bail:
    SDL_SetError ("ReadTOCData: %s returned %d", error, theErr);
    theErr = -1;
cleanup:

    if (propertyListRef != NULL)
        CFRelease(propertyListRef);
    if (dataRef != NULL)
        CFRelease(dataRef);
    if (forkData != NULL)
        DisposePtr(forkData);

    FSCloseFork (forkRefNum);

    return theErr;
}

int ListTrackFiles (FSVolumeRefNum theVolume, FSRef *trackFiles, int numTracks)
{
    OSStatus        result = -1;
    FSIterator      iterator;
    ItemCount       actualObjects;
    FSRef           rootDirectory;
    FSRef           ref;
    HFSUniStr255    nameStr;

    result = FSGetVolumeInfo (theVolume,
                              0,
                              NULL,
                              kFSVolInfoFSInfo,
                              NULL,
                              NULL,
                              &rootDirectory);

    if (result != noErr) {
        SDL_SetError ("ListTrackFiles: FSGetVolumeInfo returned %d", result);
        return result;
    }

    result = FSOpenIterator (&rootDirectory, kFSIterateFlat, &iterator);
    if (result == noErr) {
        do
        {
            result = FSGetCatalogInfoBulk (iterator, 1, &actualObjects,
                                           NULL, kFSCatInfoNone, NULL, &ref, NULL, &nameStr);
            if (result == noErr) {

                CFStringRef  name;
                name = CFStringCreateWithCharacters (NULL, nameStr.unicode, nameStr.length);

                /* Look for .aiff extension */
                if (CFStringHasSuffix (name, CFSTR(".aiff")) ||
                    CFStringHasSuffix (name, CFSTR(".cdda"))) {

                    /* Extract the track id from the filename */
                    int trackID = 0, i = 0;
                    while (i < nameStr.length && !isdigit(nameStr.unicode[i])) {
                        ++i;
                    }
                    while (i < nameStr.length && isdigit(nameStr.unicode[i])) {
                        trackID = 10 * trackID +(nameStr.unicode[i] - '0');
                        ++i;
                    }

                    #if DEBUG_CDROM
                    printf("Found AIFF for track %d: '%s'\n", trackID,
                    CFStringGetCStringPtr (name, CFStringGetSystemEncoding()));
                    #endif

                    /* Track ID's start at 1, but we want to start at 0 */
                    trackID--;

                    assert(0 <= trackID && trackID <= SDL_MAX_TRACKS);

                    if (trackID < numTracks)
                        memcpy (&trackFiles[trackID], &ref, sizeof(FSRef));
                }
                CFRelease (name);
            }
        } while(noErr == result);
        FSCloseIterator (iterator);
    }

    return 0;
}

int LoadFile (const FSRef *ref, int startFrame, int stopFrame)
{
    int error = -1;

    if (CheckInit () < 0)
        goto bail;

    /* release any currently playing file */
    if (ReleaseFile () < 0)
        goto bail;

    #if DEBUG_CDROM
    printf ("LoadFile: %d %d\n", startFrame, stopFrame);
    #endif

    /*try {*/

        /* create a new player, and attach to the audio unit */

        thePlayer = new_AudioFilePlayer(ref);
        if (thePlayer == NULL) {
            SDL_SetError ("LoadFile: Could not create player");
            return -3; /*throw (-3);*/
        }

        if (!thePlayer->SetDestination(thePlayer, &theUnit))
            goto bail;

        if (startFrame >= 0)
            thePlayer->SetStartFrame (thePlayer, startFrame);

        if (stopFrame >= 0 && stopFrame > startFrame)
            thePlayer->SetStopFrame (thePlayer, stopFrame);

        /* we set the notifier later */
        /*thePlayer->SetNotifier(thePlayer, FilePlayNotificationHandler, NULL);*/

        if (!thePlayer->Connect(thePlayer))
            goto bail;

        #if DEBUG_CDROM
        thePlayer->Print(thePlayer);
        fflush (stdout);
        #endif
    /*}
      catch (...)
      {
          goto bail;
      }*/

    error = 0;

    bail:
    return error;
}

int ReleaseFile ()
{
    int error = -1;

    /* (Don't see any way that the original C++ code could throw here.) --ryan. */
    /*try {*/
        if (thePlayer != NULL) {

            thePlayer->Disconnect(thePlayer);

            delete_AudioFilePlayer(thePlayer);

            thePlayer = NULL;
        }
    /*}
      catch (...)
      {
          goto bail;
      }*/

    error = 0;

/*  bail: */
    return error;
}

int PlayFile ()
{
    OSStatus result = -1;

    if (CheckInit () < 0)
        goto bail;

    /*try {*/

        // start processing of the audio unit
        result = AudioOutputUnitStart (theUnit);
            if (result) goto bail; //THROW_RESULT("PlayFile: AudioOutputUnitStart")

    /*}
    catch (...)
    {
        goto bail;
    }*/

    result = 0;

bail:
    return result;
}

int PauseFile ()
{
    OSStatus result = -1;

    if (CheckInit () < 0)
        goto bail;

    /*try {*/

        /* stop processing the audio unit */
        result = AudioOutputUnitStop (theUnit);
            if (result) goto bail;  /*THROW_RESULT("PauseFile: AudioOutputUnitStop")*/
    /*}
      catch (...)
      {
          goto bail;
      }*/

    result = 0;
bail:
    return result;
}

void SetCompletionProc (CDPlayerCompletionProc proc, SDL_CD *cdrom)
{
    assert(thePlayer != NULL);

    theCDROM = cdrom;
    completionProc = proc;
    thePlayer->SetNotifier (thePlayer, FilePlayNotificationHandler, cdrom);
}

int GetCurrentFrame ()
{
    int frame;

    if (thePlayer == NULL)
        frame = 0;
    else
        frame = thePlayer->GetCurrentFrame (thePlayer);

    return frame;
}

#pragma mark -- Private Functions --

static OSStatus CheckInit ()
{
    if (playBackWasInit)
        return 0;

    OSStatus result = noErr;

    /* Create the callback semaphore */
    callbackSem = SDL_CreateSemaphore(0);

    /* Start callback thread */
    SDL_CreateThread(RunCallBackThread, NULL);

    { /*try {*/
        ComponentDescription desc;

        desc.componentType = kAudioUnitType_Output;
        desc.componentSubType = kAudioUnitSubType_DefaultOutput;
        desc.componentManufacturer = kAudioUnitManufacturer_Apple;
        desc.componentFlags = 0;
        desc.componentFlagsMask = 0;

        Component comp = FindNextComponent (NULL, &desc);
        if (comp == NULL) {
            SDL_SetError ("CheckInit: FindNextComponent returned NULL");
            if (result) return -1; //throw(internalComponentErr);
        }

        result = OpenAComponent (comp, &theUnit);
            if (result) return -1; //THROW_RESULT("CheckInit: OpenAComponent")

        // you need to initialize the output unit before you set it as a destination
        result = AudioUnitInitialize (theUnit);
            if (result) return -1; //THROW_RESULT("CheckInit: AudioUnitInitialize")

        playBackWasInit = true;
    }
    /*catch (...)
      {
          return -1;
      }*/

    return 0;
}

static void FilePlayNotificationHandler(void * inRefCon, OSStatus inStatus)
{
    if (inStatus == kAudioFilePlay_FileIsFinished) {

        /* notify non-CA thread to perform the callback */
        SDL_SemPost(callbackSem);

    } else if (inStatus == kAudioFilePlayErr_FilePlayUnderrun) {

        SDL_SetError ("CDPlayer Notification: buffer underrun");
    } else if (inStatus == kAudioFilePlay_PlayerIsUninitialized) {

        SDL_SetError ("CDPlayer Notification: player is uninitialized");
    } else {

        SDL_SetError ("CDPlayer Notification: unknown error %ld", inStatus);
    }
}

static int RunCallBackThread (void *param)
{
    for (;;) {

	SDL_SemWait(callbackSem);

        if (completionProc && theCDROM) {
            #if DEBUG_CDROM
            printf ("callback!\n");
            #endif
            (*completionProc)(theCDROM);
        } else {
            #if DEBUG_CDROM
            printf ("callback?\n");
            #endif
        }
    }

    #if DEBUG_CDROM
    printf ("thread dying now...\n");
    #endif

    return 0;
}

/*}; // extern "C" */


text:
@protocol ComGoogleCommonBaseSupplier < NSObject, JavaObject >

- (id)get;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonBaseSupplier)
#endif

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonBaseSupplier)

redpajama_set_name: RedPajamaGithub


text:
/**
 *
 */
package com.ctgi.google.problems;

/**
 * @author Dany
 *
 */

// If I type a line of text that is too wide to fit the text area it will automatically wrap to the next line. This is what you will be implementing in this coding problem.
// Write function: input 1) string 2) width in pixels of text area -> output 1) string with newlines added
// Provided function: input 1) string -> output 1) width in pixels of string
// f(u+v) != f(u) + f(v)
// f(u+v) >= f(u)
// "Hello world" != "Hello" + " " + "world"

// "Hello world again", 500px
// "Hello world again" -> 750px
// "Hello" -> 450px

//""
public class FormatStringToFitInTextAreaByPixels {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

	public String appendStringWithNewLines(String str, int pixels)
	{
		int strLength = str.length();

		String currentStringPart = "";
		int currentPixelSize = 0;
		String lastValidStringPart = "";

		StringBuffer formattedStringBuffer = new StringBuffer();
		int j=0;
		int i=0;

		while(j<strLength)
		{

			for(i=j;i<strLength;i++)
			{
				currentStringPart = str.substring(j,i);
				currentPixelSize = f(currentStringPart);
				if(currentPixelSize == pixels)
				{
					currentStringPart = currentStringPart + "\n";
					formattedStringBuffer.append(currentStringPart);
					break;
					//return currentStringPart;
				}else if(currentPixelSize < pixels)
				{
					lastValidStringPart = currentStringPart;
				}else
				{
					lastValidStringPart = lastValidStringPart + "\n";
					formattedStringBuffer.append(lastValidStringPart);
					break;
					//return lastValidStringPart;
				}
			}
			j=i;
		}

		return formattedStringBuffer.toString();

	}
}


text:
<?php

use yii\db\Migration;

class m160405_231553_alteracao_usuario extends Migration
{
    public function up()
    {
        $this->alterColumn('usuario','senha',$this->string(100));
    }

    public function down()
    {
        echo "m160405_231553_alteracao_usuario cannot be reverted.\n";

        return true;
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}


text:
/*
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

/**
 * @author Nikolay A. Kuznetsov
 */
package org.teavm.classlib.java.util.regex;

import java.util.ArrayList;

/**
 * Positive lookahead node.
 *
 * @author Nikolay A. Kuznetsov
 */
class TPositiveLookAhead extends TAtomicJointSet {
    public TPositiveLookAhead(ArrayList<TAbstractSet> children, TFSet fSet) {
        super(children, fSet);
    }

    /**
     * Returns stringIndex+shift, the next position to match
     */
    @Override
    public int matches(int stringIndex, CharSequence testString, TMatchResultImpl matchResult) {
        int size = children.size();
        for (int i = 0; i < size; i++) {
            TAbstractSet e = children.get(i);
            int shift = e.matches(stringIndex, testString, matchResult);
            if (shift >= 0) {
                // PosLookaheadFset always returns true, position remains the
                // same
                // next.match() from;
                return next.matches(stringIndex, testString, matchResult);
            }
        }

        return -1;
    }

    @Override
    public boolean hasConsumed(TMatchResultImpl matchResult) {
        return false;
    }

    @Override
    protected String getName() {
        return "PosLookaheadJointSet";
    }
}


text:
<!DOCTYPE html>

    <title>Input Test</title>

        Canvas:

            <input id="button1" type="button" value="L"><input id="button2" type="button" value="M"><input id="button4" type="button" value="R">

        <canvas id="canvas" width="640" height="20"
                style="border-style: dotted; border-width: 1px;">
            Canvas not supported.
        </canvas>

        Results:

        <textarea id="messages" style="font-size: 9;" cols=80 rows=25></textarea>


text:
require 'pathname'
require 'singleton'

class Sass::CssImporter::Importer < Sass::Importers::Filesystem

  def initialize(root)
    super(root)
  end

  # Enable watching of css files in Sass 3.3+
  def watched_directories
    [root]
  end

  # Enable watching of css files in Sass 3.3+
  def watched_file?(file)
    file.start_with?(root+File::SEPARATOR) && File.extname(file) == ".css"
  end

  def extensions
    {'css' => :scss}
  end

  def find_relative(name, base, options)
    super(strip_prefix(name), base, options)
  end

  def find(name, options)
    super(strip_prefix(name), options)
  end

  def mtime(name, options)
    super(strip_prefix(name), options)
  end

  def key(name, options)
    super(strip_prefix(name), options)
  end

  def to_s
    "Sass::CssImporter::Importer(#{root})"
  end

  def eql?(other)
    other.class == self.class && other.root == self.root
  end

  protected

  def strip_prefix(name)
    name.start_with?("CSS:") ? name[4..-1] : name
  end

end


text:
'use strict';

var async = require('async'),
    path = require('path'),
    ZapClient = require('zaproxy'),
    spawn = require('child_process').spawn,
    _ = require('lodash');

module.exports = function (grunt) {

  // Please see the Grunt documentation for more information regarding task
  // creation: http://gruntjs.com/creating-tasks

  /**
   * Start ZAProxy and wait for it to finish initializing.
   **/
  grunt.registerTask('zap_start', 'Start ZAProxy.', function () {
    // Set up command line options.
    var options = this.options({
      host: 'localhost',
      port: '8080',
      daemon: true,
      path: undefined,
      os: 'linux'
    });

    var args = [];
    if (options.daemon) {
      args.push('-daemon');
    }
    if (options.config) {
      for (var k in options.config) {
        args.push('-config');
        args.push(k + '=' + options.config[k]);
      }
    }
    if (options.host) {
      args.push('-host');
      args.push(options.host);
    }
    if (options.port) {
      args.push('-port');
      args.push(options.port);
    }

    // Spawn ZAProxy
    // var zapPath = path.join(__dirname, '../vendor/zap');

    grunt.log.write('Starting ZAProxy: ');

    var zapScript = (options.os === 'windows' ? 'zap.bat' : 'zap.sh');

    var cmd = function () {
      return (options.path ? path.join(options.path, zapScript) : zapScript);
    };

    var child = (options.os === 'windows' ? spawn(zapScript, args, {cwd: options.path}) : spawn(cmd(), args));

    child.on('close', function (code) {
      if (code) {
        grunt.fail.warn('Error launching ZAProxy: ' + code);
      }
    });
    child.on('error', function (err) {
      if (err.code === 'ENOENT') {
        grunt.fail.fatal('Error launching ZAProxy. Make sure that ZAProxy is installed and ' + zapScript + ' is available on the executable path: ' + JSON.stringify(err, null, 2));
      }
    });

    // Wait until the proxy is responding
    var done = this.async();
    var retryCount = 0;
    var zaproxy = new ZapClient({ proxy: 'http://' + options.host + ':' + options.port });
    var wait = function (callback) {
      zaproxy.core.version(function (err) {
        if (err) {
          grunt.log.write('.');
          retryCount += 1;
          if (retryCount > 30) {
            grunt.log.writeln('ZAProxy is taking too long, killing.');
            child.kill('SIGKILL');
            done();
          } else {
            setTimeout(function () {
              wait(callback);
            }, 1000);
          }
        } else {
          zaproxy.core.newSession('', false, function () {
            grunt.log.ok();
            done();
          });
        }
      });
    };
    wait();
  });

  /**
   * Stop a running ZAProxy.
   **/
  grunt.registerTask('zap_stop', 'Stop ZAProxy.', function () {
    // Set up options.
    var options = this.options({
      host: 'localhost',
      port: '8080',
      apiKey: 'null'
    });

    var done = this.async();

    var zapOptions = { proxy: 'http://' + options.host + ':' + options.port};

    var zaproxy = new ZapClient(zapOptions);
    grunt.log.write('Stopping ZAProxy: ');
    zaproxy.core.shutdown(options.apiKey, function (err) {
      if (err) {
        grunt.fail.warn('ZAProxy does not appear to be running: ' + JSON.stringify(err, null, 2));
        done();
        return;
      }

      var retryCount = 0;
      var wait = function (callback) {
        zaproxy.core.version(function (err) {
          if (err) {
            grunt.log.ok();
            done();
          } else {
            grunt.log.write('.');
            retryCount += 1;
            if (retryCount > 30) {
              grunt.log.writeln('ZAProxy is taking too long, exiting.');
              done();
            } else {
              setTimeout(function () {
                wait(callback);
              }, 1000);
            }
          }
        });
      };
      wait();
    });
  });

  /**
   * Wait for a scan to finish.
   **/
  var waitForScan = function (zaproxy, statusFn, callback) {
    var wait = function () {
      statusFn(function (err, body) {
        if (err) {
          callback(err);
          return;
        }
        if (body.status < 100) {
          grunt.log.write('.');
          setTimeout(function () {
            wait(callback);
          }, 1000);
        } else {
          callback(null, body);
        }
      });
    };
    wait();
  };

  /**
   * Wait for passive scanning to finish.
   **/
  var waitForPassive = function (zaproxy, callback) {
    var wait = function () {
      zaproxy.pscan.recordsToScan(function (err, body) {
        if (err) {
          callback(err);
          return;
        }
        if (body.recordsToScan > 0) {
          grunt.log.write('.');
          setTimeout(function () {
            wait(callback);
          }, 1000);
        } else {
          callback(null, body);
        }
      });
    };
    wait();
  };

  /**
   * Initiate a spider scan and wait for it to finish.
   **/
  grunt.registerMultiTask('zap_spider', 'Execute a ZAProxy spider.', function () {
    // Set up options.
    var options = this.options({
      host: 'localhost',
      port: '8080',
      exclude: []
    });

    // check for required options
    if (!options.url) {
      grunt.fail.warn('url must be defined.');
      return;
    }

    grunt.log.write('Spidering: ');
    var done = this.async();
    var zaproxy = new ZapClient({ proxy: 'http://' + options.host + ':' + options.port });
    _.bindAll(zaproxy.spider, _.functions(zaproxy.spider));

    async.series([
      async.apply(async.eachSeries, options.exclude, zaproxy.spider.excludeFromScan),
      async.apply(zaproxy.spider.scan, options.url),
      async.apply(waitForScan, zaproxy, zaproxy.spider.status)
    ], function (err) {
      if (err) {
        grunt.fail.warn('Spider Error: ' + JSON.stringify(err, null, 2));
        done();
        return;
      }

      grunt.log.ok();
      done();
    });
  });

  /**
   * Initiate an active scan and wait for it to finish.
   **/
  grunt.registerMultiTask('zap_scan', 'Execute a ZAProxy scan.', function () {
    // Set up options.
    var options = this.options({
      host: 'localhost',
      port: '8080',
      exclude: [],
      disable: []
    });

    // check for required options
    if (!options.url) {
      grunt.fail.warn('url must be defined.');
      return;
    }

    grunt.log.write('Scanning: ');
    var done = this.async();
    var zaproxy = new ZapClient({ proxy: 'http://' + options.host + ':' + options.port });
    _.bindAll(zaproxy.ascan, _.functions(zaproxy.ascan));

    async.series([
      async.apply(async.eachSeries, options.exclude, zaproxy.ascan.excludeFromScan),
      async.apply(zaproxy.ascan.enableAllScanners),
      function (callback) {
        if (options.disable && options.disable.length) {
          zaproxy.ascan.disableScanners(options.disable.join(','), callback);
        } else {
          callback();
        }
      },
      async.apply(zaproxy.ascan.scan, options.url, '', ''),
      async.apply(waitForScan, zaproxy, zaproxy.ascan.status)
    ], function (err) {
      if (err) {
        grunt.fail.warn('Scan Error: ' + JSON.stringify(err, null, 2));
        done();
        return;
      }

      grunt.log.ok();
      done();
    });
  });

  /**
   * Check alerts from a running ZAProxy.
   **/
  grunt.registerTask('zap_alert', 'Check alerts from ZAProxy.', function () {
    // Set up options.
    var options = this.options({
      host: 'localhost',
      port: '8080',
      ignore: []
    });

    var done = this.async();
    var zaproxy = new ZapClient({ proxy: 'http://' + options.host + ':' + options.port });

    grunt.log.write('Waiting for scanning to finish: ');
    waitForPassive(zaproxy, function (err) {
      if (err) {
        grunt.fail.warn('ZAProxy does not appear to be running: ' + JSON.stringify(err, null, 2));
        done();
        return;
      }

      grunt.log.ok();
      grunt.log.write('Checking for alerts: ');
      zaproxy.core.alerts('', '', '', function (err, res) {
        if (err) {
          grunt.fail.warn('ZAProxy does not appear to be running: ' + JSON.stringify(err, null, 2));
          done();
          return;
        }

        var alerts = _.chain(res.alerts)
              .filter(function (alert) {
                return !_.contains(options.ignore, alert.alert);
              })
              .value();

        if (alerts.length > 0) {
          grunt.log.error('Alerts found: ' + JSON.stringify(alerts, null, 2));

          // set a flag so that the cleanup task can fail the build
          grunt.config.set('zap_alert.failed', true);
          grunt.config.set('zap_alert.alerts', alerts);
        } else {
          grunt.config.set('zap_alert.failed', false);
          grunt.log.ok();
        }
        done();
      });
    });
  });

  /**
   * Retrieve the XML report from a running ZAProxy.
   **/
  grunt.registerTask('zap_report', 'Retrieve the ZAProxy XML report.', function () {
    // Set up options.
    var options = this.options({
      host: 'localhost',
      port: '8080',
      html: false
    });

    // check for required options
    if (!options.dir) {
      grunt.fail.warn('dir must be defined.');
      return;
    }

    var done = this.async();
    var zaproxy = new ZapClient({ proxy: 'http://' + options.host + ':' + options.port });

    grunt.log.write('Retrieving XML report: ');
    zaproxy.core.xmlreport(function (err, data) {
      grunt.log.ok();

      var filename = path.join(options.dir, 'report.xml');
      grunt.log.write('Writing ' + filename + ': ');
      grunt.file.write(filename, data);
      grunt.log.ok();

      if (options.html) {
        var xslt;
        try {
          xslt = require('node_xslt');
        } catch (e) {
          grunt.log.error('Unable to generate HTML report because node_xslt is not installed. Make sure that you have the required dependencies for node_xslt: ' + JSON.stringify(e, null, 2));
          done(false);
          return;
        }

        var htmlFilename = path.join(options.dir, 'report.html');
        grunt.log.write('Writing ' + htmlFilename + ': ');
        var stylesheet = xslt.readXsltFile(path.join(__dirname, '../report.html.xsl'));
        var document = xslt.readXmlString(data);
        grunt.file.write(htmlFilename, xslt.transform(stylesheet, document, []));
        grunt.log.ok();
        done();
      } else {
        done();
      }
    });
  });

  grunt.registerTask('zap_results', 'It fails if found an alert that should not be ignored', function () {
    var done = this.async();

    var options = this.options({
      risks : ['High', 'Medium', 'Low', 'Informational']
    });

    grunt.log.write('Verifying alert errors...');

    var alerts = grunt.config.get('zap_alert.alerts') || [];

    var filteredAlerts = alerts.filter(function(alert){
      return options.risks.indexOf(alert.risk) > -1;
    });

    if (grunt.config.get('zap_alert.failed') && filteredAlerts.length > 0) {
      grunt.fail.warn('Error found!');
      done(false);
    }

    grunt.log.write('No errors found');
    done(true);

  });
};


text:
package me.Flibio.EconomyManager;

import org.slf4j.Logger;
import org.spongepowered.api.Game;
import org.spongepowered.api.event.Subscribe;
import org.spongepowered.api.event.state.ServerStartedEvent;
import org.spongepowered.api.plugin.Plugin;

import com.google.inject.Inject;

@Plugin(id = "EconomyManager", name = "EconomyManager", version = "1.0.0")
public class EconomyManager {

	@Inject
	private Logger logger;

	protected static Economy currentEconomy = null;

	protected static EconomyManager manager;

	private Game game;

	@Subscribe
    public void onServerStart(ServerStartedEvent event) {
        logger.info("EconomyManager by Flibio enabling!");

        manager = this;

        game = event.getGame();
    }

	protected static EconomyManager getPlugin(){
		return manager;
	}

	protected Logger getLogger(){
		return logger;
	}

	protected Game getGame(){
		return game;
	}
}


text:
using Robust.Shared.Utility;

namespace Content.Server.Objectives.Interfaces
{
    public interface IObjectiveCondition : IEquatable<IObjectiveCondition>
    {
        /// <summary>
        /// Returns a copy of the IObjectiveCondition which is assigned to the mind.
        /// </summary>
        /// <param name="mind">Mind to assign to.</param>
        /// <returns>The new IObjectiveCondition.</returns>
        IObjectiveCondition GetAssigned(Mind.Mind mind);

        /// <summary>
        /// Returns the title of the condition.
        /// </summary>
        string Title { get; }

        /// <summary>
        /// Returns the description of the condition.
        /// </summary>
        string Description { get; }

        /// <summary>
        /// Returns a SpriteSpecifier to be used as an icon for the condition.
        /// </summary>
        SpriteSpecifier Icon { get; }

        /// <summary>
        /// Returns the current progress of the condition in % from 0 to 1.
        /// </summary>
        /// <returns>Current progress in %.</returns>
        float Progress { get; }

        /// <summary>
        /// Returns a difficulty of the condition.
        /// </summary>
        float Difficulty { get; }
    }
}


text:
/*
 * This class requires no changes from the 1.0 version.
 * It's kept here so the rest of the example can compile.
 */

import java.awt.*;

public class Chopstick {
    Philosopher owner = null;

    public synchronized void release(Philosopher phil) {
        if (phil == owner)
            owner = null;
        notify();
    }

    public synchronized void grab(Philosopher phil)
					throws InterruptedException {
        while (owner != null)
            wait();
        owner = phil;
    }
}


text:
using Avalonia.Interactivity;
using Avalonia.VisualTree;

namespace Avalonia.Controls
{
    public class RequestBringIntoViewEventArgs : RoutedEventArgs
    {
        public IVisual? TargetObject { get; set; }

        public Rect TargetRect { get; set; }
    }
}


text:
from selenium.webdriver.common import utils
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
from selenium.webdriver.remote.remote_connection import RemoteConnection
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from .service import Service

class WebDriver(RemoteWebDriver):

    def __init__(self, executable_path='MicrosoftWebDriver.exe',
                 capabilities=None, port=0, verbose=False, log_path=None):
        self.port = port
        if self.port == 0:
            self.port = utils.free_port()

        self.edge_service = Service(executable_path, port=self.port, verbose=verbose, log_path=log_path)
        self.edge_service.start()

        if capabilities is None:
            capabilities = DesiredCapabilities.EDGE

        RemoteWebDriver.__init__(
            self,
            command_executor=RemoteConnection('http://localhost:%d' % self.port,
                                              resolve_ip=False),
            desired_capabilities=capabilities)
        self._is_remote = False

    def quit(self):
        RemoteWebDriver.quit(self)
        self.edge_service.stop()


text:
"""doit - Automation Tool

The MIT License

Copyright (c) 2008-2013 Eduardo Naufel Schettino

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"""

from doit.version import VERSION

__version__ = VERSION

from doit import loader
from doit.loader import create_after
from doit.doit_cmd import get_var
from doit.api import run
from doit.tools import load_ipython_extension

__all__ = ['get_var', 'run', 'create_after']

def get_initial_workdir():
    """working-directory from where the doit command was invoked on shell"""
    return loader.initial_workdir

assert load_ipython_extension  # silence pyflakes


text:
/* -*- mode:C++; -*- */
/* MIT License -- MyThOS: The Many-Threads Operating System
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use, copy,
 * modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 * Copyright 2019 Randolf Rotta and contributors, BTU Cottbus-Senftenberg
 */
#pragma once

#include <cstdint>
#include <cstddef>

namespace mythos {
  /** extract a bitrange from an integer */
  inline constexpr uint32_t bits(uint32_t val, unsigned last, unsigned first) {
    return (val >> first) & ((1<<(last-first+1))-1);
  }

  /** extract a single bit from an integer */
  inline constexpr bool bits(uint32_t val, unsigned pos) {
    return (val >> pos) & 0x1;
  }

  /** extract a bitrange from an integer */
  inline constexpr uint64_t bits(uint64_t val, unsigned last, unsigned first) {
    return (val >> first) & ((1<<(last-first+1))-1);
  }

  /** extract a single bit from an integer */
  inline constexpr bool bits(uint64_t val, unsigned pos) {
    return (val >> pos) & 0x1;
  }

  namespace x86 {
    struct Regs {
      uint32_t eax;
      uint32_t ebx;
      uint32_t ecx;
      uint32_t edx;
    };

    /** query the processor with the cpuid instruction */
    inline Regs cpuid(uint32_t eax, uint32_t ecx=0) {
      Regs r;
      asm volatile("cpuid"
           : "=a"(r.eax), "=b"(r.ebx), "=c"(r.ecx), "=d"(r.edx)
           : "a"(eax), "c"(ecx));
      return r;
    }

    inline uint32_t maxLeave() { return cpuid(0).eax; }

    inline uint32_t initialApicID() { return bits(cpuid(1).ebx,31,24); }
    inline uint32_t maxApicThreads() { return bits(cpuid(1).ebx,23,16); }
    inline uint32_t maxApicCores() { return 1+bits(cpuid(4,0).eax,31,26); }

    // see http://developer.amd.com/resources/documentation-articles/articles-whitepapers/processor-and-core-enumeration-using-cpuid/
    // does not work on XeonPhi
    inline uint32_t apicIdCoreIdSize() { return 1<<bits(cpuid(0x80000008).ecx,15,12); }

    inline bool hasLeaveB() { return maxLeave()>=11 && cpuid(11,0).ebx!=0; }

    inline bool x2ApicSupported() { return bits(cpuid(1).ecx, 21); }
    inline uint32_t x2ApicID() { return cpuid(11, 0).edx; }
    inline uint32_t x2ApicThreadsPerCore() { return 1<<bits(cpuid(11,0).eax,4,0); }
    inline uint32_t x2ApicThreadsPerPkg() { return 1<<bits(cpuid(11,1).eax,4,0); }
    inline uint32_t x2ApicThreadsEnabled(unsigned level) { return bits(cpuid(11,level).ebx,15,0); }

    /** check if the 8-entry page-attribute table (PAT) is
     * supported. When the PAT is supported, three bits in certain
     * paging-structure entries select a memory type (used to
     * determine type of caching used) from the PAT (see Section
     * 4.9.2).
     */
    inline bool hasPAT() { return bits(cpuid(0x01).edx,16); }

    /** check if CR4.PCIDE may be set to 1, enabling process-context identifiers inside the TLB */
    inline bool hasPCIDE() { return bits(cpuid(0x01).ecx,17); }

    /** check if CR4.SMEP may be set to 1, enabling supervisor-mode execution prevention */
    inline bool hasSMEP() { return bits(cpuid(0x07).ebx,7); }

    /** check if IA32_EFER.NXE may be set to 1, allowing PAE paging
     * and IA-32e paging to disable execute access to selected
     * pages */
    inline bool hasNXE() { return bits(cpuid(0x80000001).edx,20); }

    /** check if 1-GByte pages are supported with IA-32e paging */
    inline bool has1Gpages() { return bits(cpuid(0x80000001).edx,26); }

    enum MSR {
      IA32_APIC_BASE_MSR         = 0x0000001B,
      MSR_IA32_SYSENTER_CS       = 0x00000174,
      MSR_IA32_SYSENTER_ESP      = 0x00000175,
      MSR_IA32_SYSENTER_EIP      = 0x00000176,
      MSR_RAPL_POWER_UNIT        = 0x00000606,
      MSR_PKG_RAPL_POWER_LIMIT	 = 0x00000610,
      MSR_PKG_ENERGY_STATUS	     = 0x00000611,
      MSR_PKG_PERF_STATUS	       = 0x00000613,
      MSR_PKG_POWER_INFO         = 0x00000614,
      MSR_PP0_POWER_LIMIT	       = 0x00000638,
      MSR_PP0_ENERGY_STATUS	     = 0x00000639,
      MSR_PP0_POLICY             = 0x0000063A,
      MSR_PP0_PERF_STATUS	       = 0x0000063B,
      MSR_PP1_POWER_LIMIT	       = 0x00000640,
      MSR_PP1_ENERGY_STATUS	     = 0x00000641,
      MSR_PP1_POLICY	           = 0x00000642,
      MSR_DRAM_POWER_LIMIT	     = 0x00000618,
      MSR_DRAM_ENERGY_STATUS	   = 0x00000619,
      MSR_DRAM_PERF_STATUS	     = 0x0000061B,
      MSR_DRAM_POWER_INFO	       = 0x0000061C,
      MSR_PLATFORM_ENERGY_STATUS = 0x0000064D,
      MSR_EFER                   = 0xc0000080,
      MSR_IA32_STAR              = 0xc0000081,
      MSR_IA32_LSTAR             = 0xc0000082,
      MSR_IA32_FMASK             = 0xc0000084,
      MSR_FS_BASE                = 0xc0000100,
      MSR_GS_BASE                = 0xc0000101,
      MSR_KERNEL_GS_BASE         = 0xc0000102,
    };

    enum Idx {
      MSR_SYSCALL_SEG = 32, //< bit index for kernel segment selector in STAR
      MSR_SYSRET_SEG = 48,  //< bit index for user segment selector in START
      EFER_SCE = 1 << 0,    //< syscall enable
      EFER_LME = 1 << 8,    //< IA-32e mode enable
      EFER_LMA = 1 << 10,   //< IA-32e mode active indicator bit
      EFER_NXE = 1 << 11,    //< Execute-disable bit enable
      X2APIC_ENABLED = 1ul << 10, //< bit index for x2APIC enabled in APIC_BASE_MSR
      XAPIC_ENABLED  = 1ul << 11, //< bit index for APIC enabled in APIC_BASE_MSR
      XAPIC_BSP = 1ul << 8 //< BootStrap Processor flag (read only)
    };

    inline uint64_t getMSR(uint32_t msr) {
      uint32_t h,l;
      asm volatile ("rdmsr" : "=a"(l), "=d"(h) : "c"(msr));
      return (uint64_t(h) << 32) | l;
    }

    inline void setMSR(uint32_t msr, uint64_t value) {
      asm volatile ("wrmsr" : : "a"(uint32_t(value)),
            "d"(uint32_t(value >> 32)), "c"(msr));
    }

    inline size_t getApicBase() { return (getMSR(IA32_APIC_BASE_MSR) & 0xFFFFFF000); }
    inline bool isApicBSP() { return getMSR(IA32_APIC_BASE_MSR) & XAPIC_BSP; }
    inline bool isApicEnabled() { return getMSR(IA32_APIC_BASE_MSR) & XAPIC_ENABLED; }
    inline bool isX2ApicEnabled() { return getMSR(IA32_APIC_BASE_MSR) & X2APIC_ENABLED; }
    inline void disableApic() { setMSR(IA32_APIC_BASE_MSR, getMSR(IA32_APIC_BASE_MSR) & uint64_t(~XAPIC_ENABLED) & uint64_t(~X2APIC_ENABLED)); }
    inline void enableApic() { setMSR(IA32_APIC_BASE_MSR, getMSR(IA32_APIC_BASE_MSR) | XAPIC_ENABLED); }
    inline void enableX2Apic() {
      setMSR(IA32_APIC_BASE_MSR, getMSR(IA32_APIC_BASE_MSR) | XAPIC_ENABLED | X2APIC_ENABLED);
    }

    inline void setStar(uint64_t kerncs, uint64_t usercs32) {
      setMSR(MSR_IA32_STAR, usercs32<<MSR_SYSRET_SEG | kerncs<<MSR_SYSCALL_SEG);
    }

    inline void setLStar(void (*entryptr)()) { setMSR(MSR_IA32_LSTAR, uint64_t(entryptr)); }

    enum FLAGS {
      FLAG_CF      = 1ul << 0,  // 0x000001
      FLAG_PF      = 1ul << 2,  // 0x000004
      FLAG_AF      = 1ul << 4,  // 0x000010
      FLAG_ZF      = 1ul << 6,  // 0x000040
      FLAG_SF      = 1ul << 7,  // 0x000080
      FLAG_TF      = 1ul << 8,  // 0x000100
      FLAG_IF      = 1ul << 9,  // 0x000200
      FLAG_DF      = 1ul << 10, // 0x000400
      FLAG_OF      = 1ul << 11, // 0x000800
      FLAG_IOPL    = 3ul << 12, // 0x003000
      FLAG_NT      = 1ul << 14, // 0x004000
      FLAG_RF      = 1ul << 16, // 0x010000
      FLAG_VM      = 1ul << 17, // 0x020000
      FLAG_AC      = 1ul << 18, // 0x040000
      FLAG_VIF     = 1ul << 19, // 0x080000
      FLAG_VIP     = 1ul << 20, // 0x100000
      FLAG_ID      = 1ul << 21  // 0x200000
    };

    inline void setFMask(uint32_t flags) { setMSR(MSR_IA32_FMASK, flags); }
    inline void enableSyscalls() { setMSR(MSR_EFER, getMSR(MSR_EFER) | EFER_SCE); }
    inline void setFSBase(uint64_t value) { setMSR(MSR_FS_BASE, value); }
    inline uint64_t readFSBase() { return getMSR(MSR_FS_BASE); }
    inline void setGSBase(uint64_t value) { setMSR(MSR_GS_BASE, value); }
    inline uint64_t readGSBase() { return getMSR(MSR_GS_BASE); }
    inline void setKernelGSBase(uint64_t value) { setMSR(MSR_KERNEL_GS_BASE, value); }
    inline uint64_t readKernelGSBase() { return getMSR(MSR_KERNEL_GS_BASE); }

    enum CR0Bits {
      PG = 1<<31, // Paging: If 1, enable paging and use the CR3 register, else disable paging
      CD = 1<<30, // Cache disable: Globally enables/disable the memory cache
      NW = 1<<29, // Not-write through: Globally enables/disable write-through caching
      AM = 1<<18, // Alignment mask: Alignment check enabled if AM set, AC flag (in EFLAGS register) set, and privilege level is 3
      WP = 1<<16, // Write protect: Determines whether the CPU can write to pages marked read-only when privilege level is 0
      NE = 1<<5,  // Numeric error: Enable internal x87 floating point error reporting when set, else enables PC style x87 error detection
      ET = 1<<4,  // Extension type: On the 386, whether external math coprocessor is 80287 or 80387
      TS = 1<<3,  // Task switched: Allows saving x87 task context upon a task switch only after x87 instruction used
      EM = 1<<2,  // Emulation: If set, no x87 floating point unit present, if clear, x87 FPU present
      MP = 1<<1,  // Monitor co-processor: Controls interaction of WAIT/FWAIT instructions with TS flag in CR0
      PE = 1<<0   // Protected Mode Enable: If 1, system is in protected mode, else real mode
    };

    inline size_t getCR0() {
      size_t res;
      asm volatile ("mov %%cr0, %0" : "=r"(res));
      return res;
    }

    inline void setCR0(size_t val) { asm volatile ("mov %0, %%cr0" : : "r"(val)); }

    /** Page Fault Linear Address (PFLA). When a page fault occurs,
     * the address the program attempted to access is stored in the
     * CR2 register.
     */
    inline size_t getCR2() {
      size_t res;
      asm volatile ("mov %%cr2, %0" : "=r"(res));
      return res;
    }

    /** the upper 20 bits of CR3 become the page directory base
     * register (PDBR), which stores the physical address of the first
     * page directory entry.
     */
    inline size_t getCR3() {
      size_t res;
      asm volatile ("mov %%cr3, %0" : "=r"(res));
      return res;
    }

    inline void setCR3(size_t val) { asm volatile ("mov %0, %%cr3" : : "r"(val)); }

    enum CR4Bits {
      SMAP = 1<<21, // Supervisor Mode Access Protection Enable: access of data in a higher ring generates a fault
      SMEP = 1<<20, // Supervisor Mode Execution Protection Enable: execution of code in a higher ring generates a fault
      OSXSAVE = 1<<18, // XSAVE and Processor Extended States Enable
      PCIDE = 1<<17, // PCID Enable: enables process-context identifiers (PCIDs) in the TLB
      SMXE = 1<<14, // Safer Mode Extensions Enable, see Trusted Execution Technology (TXT)
      VMXE = 1<<13, // Virtual Machine Extensions Enable, see Intel VT-x
      OSXMMEXCPT = 1<<10, // Operating System Support for Unmasked SIMD Floating-Point Exceptions   If set, enables unmasked SSE exception.
      OSFXSR = 1<<9, // Operating system support for FXSAVE and FXRSTOR instructions: enables SSE instructions and fast FPU save & restoreCPU_COFFEELAKE_U
      PCE = 1<<8, // Performance-Monitoring Counter enable: RDPMC can be executed at any privilege level, else RDPMC can only be used in ring 0
      PGE = 1<<7, // Page Global Enabled: address translations may be shared between address spaces
      MCE = 1<<6, // Machine Check Exception: enables machine check interrupts to occur
      PAE = 1<<5, // Physical Address Extension: translate to extended 36-bit or 48-bit physical addresses
      PSE = 1<<4, // Page Size Extension: page size is increased to 4 MiB (or 2 MiB with PAE set)
      DE = 1<<3,  // Debugging Extensions: enables debug register based breaks on I/O space access
      TSD = 1<<2, // Time Stamp Disable: RDTSC instruction can only be executed when in ring 0, otherwise RDTSC can be used at any privilege level
      PVI = 1<<1, // Protected-mode Virtual Interrupts: enables support for the virtual interrupt flag (VIF) in protected mode
      VME = 1<<0  // Virtual 8086 Mode Extensions: enables support for the virtual interrupt flag (VIF) in virtual-8086 mode
    };

    inline size_t getCR4() {
      size_t res;
      asm volatile ("mov %%cr4, %0" : "=r"(res));
      return res;
    }

    inline void setCR4(size_t val) { asm volatile ("mov %0, %%cr4" : : "r"(val)); }

    // get CPU family
    inline uint32_t getCpuFam() { return bits(cpuid(1).eax, 11, 8); }
    // get CPU extended model
    inline uint32_t getCpuExtModel() { return (bits(cpuid(1).eax, 19, 16) << 4) + bits(cpuid(1).eax, 7, 4); }

    /*
     * Intel Processor family 11 model number
     */
    enum IntelExtendedModelFamily11 {
      CPU_KNIGHTS_CORNER = 1
    };

    /*
     * Intel Processor family 6 model number
     */
    enum IntelExtendedModelFamily6 {
      CPU_SANDYBRIDGE	=	42,
      CPU_SANDYBRIDGE_EP =	45,
      CPU_IVYBRIDGE	=	58,
      CPU_IVYBRIDGE_EP	= 62,
      CPU_HASWELL	=	60,
      CPU_HASWELL_ULT	= 69,
      CPU_HASWELL_GT3E	= 70,
      CPU_HASWELL_EP	=	63,
      CPU_BROADWELL	=	61,
      CPU_BROADWELL_GT3E	= 71,
      CPU_BROADWELL_EP	= 79,
      CPU_BROADWELL_DE	= 86,
      CPU_SKYLAKE	=	78,
      CPU_SKYLAKE_HS	=	94,
      CPU_SKYLAKE_X	 =	85,
      CPU_KNIGHTS_LANDING	= 87,
      CPU_KNIGHTS_MILL	= 133,
      CPU_KABYLAKE_MOBILE	= 142, // also CPU_COFFEELAKE_U
      CPU_KABYLAKE	=	158, // also CPU_COFFEELAKE
      CPU_ATOM_SILVERMONT	= 55,
      CPU_ATOM_AIRMONT	= 76,
      CPU_ATOM_MERRIFIELD	= 74,
      CPU_ATOM_MOOREFIELD	= 90,
      CPU_ATOM_GOLDMONT	= 92,
      CPU_ATOM_GEMINI_LAKE	= 122,
      CPU_ATOM_DENVERTON	= 95
    };

    /* Performance monitoring */

    //cpuid performance monitoring
    enum CpuidPerfMon{
      ARCHITECTURAL_PERFORMANCE_MONTIROING_LEAF = 0xA
    };

    enum PerfMsrAddress{
      //Performance counter register
      //scope: core
      IA32_PMC0 = 0xC1,
      //...
      //IA32_PMC7 = 0xC8,

      //TSC Frequency Clock Counter (R/Write to
      //clear)
      IA32_MPERF = 0xE7, // If CPUID.06H: ECX[0] = 1

      //Actual Performance Clock Counter (R/Write
      //to clear)
      IA32_APERF = 0xE8, // If CPUID.06H: ECX[0] = 1

      //Performance Event Select Register 0 (R/W)
      IA32_PERFEVTSEL0 = 0x186,
      //...
      //IA32_PERFEVTSEL7 = 0x18D,

      //Current Performance Status (RO)
      IA32_PERF_STATUS = 0x198,

      //Performance Control MSR (R/W)
      //Software makes a request for a new
      //Performance state (P-State) by writing this
      //MSR.
      IA32_PERF_CTL = 0x199,

      //Enable Misc. Processor Features (R/W)
      //Allows a variety of processor functions to
      //be enabled and disabled.
      //(performance monitoring/ speedstep / monitor&mwait )
      IA32_MISC_ENABLE = 0x1A0,

      //Offcore Response Event Select Register (R/W)
      //scope: module
      MSR_OFFCORE_RSP_0 = 0x1A6,
      MSR_OFFCORE_RSP_1 = 0x1A7,

      //Performance Energy Bias Hint (R/W)
      IA32_ENERGY_PERF_BIAS = 0x1B0,

      // This event counts the number of instructions that retire
      // execution. For instructions that consist of multiple micro-
      // ops, this event counts the retirement of the last micro-op
      // of the instruction. The counter continues counting during
      // hardware interrupts, traps, and inside interrupt handlers.
      // Event Mask Mnemonic: Inst_Retired.Any
      IA32_PERF_FIXED_CTR0 = 0x309,

      // The CPU_CLK_UNHALTED.THREAD event counts the
      // number of core cycles while the logical processor is not in
      // a halt state.
      // If there is only one logical processor in a processor core,
      // CPU_CLK_UNHALTED.CORE counts the unhalted cycles of
      // the processor core.
      // If there are more than one logical processor in a processor
      // core, CPU_CLK_UNHALTED.THREAD_ANY is supported by
      //programming IA32_FIXED_CTR_CTRL[bit 6]AnyThread =
      // 1.
      //The core frequency may change from time to time due to
      //transitions associated with Enhanced Intel SpeedStep
      //Technology or TM2. For this reason this event may have a
      //changing ratio with regards to time.
      // Event Mask Mnemonic:CPU_CLK_UNHALTED.THREAD/CPU_CLK_UNHALTED.CORE/CPU_CLK_UNHALTED.THREAD_ANY
      IA32_PERF_FIXED_CTR1 = 0x30A,

      //This event counts the number of reference cycles at the
      //TSC rate when the core is not in a halt state and not in a
      //TM stop-clock state. The core enters the halt state when
      //it is running the HLT instruction or the MWAIT instruction.
      //This event is not affected by core frequency changes (e.g.,
      //P states) but counts at the same frequency as the time
      //stamp counter. This event can approximate elapsed time
      //while the core was not in a halt state and not in a TM
      //stopclock state.
      // Event Mask Mnemonic: CPU_CLK_UNHALTED.REF_TSC
      IA32_PERF_FIXED_CTR2 = 0x30B,

      //Read Only MSR that enumerates the
      //existence of performance monitoring
      //features. (RO)
      IA32_PERF_CAPABILITIES = 0x345,

      //Fixed-Function Performance Counter
      //Control (R/W)
      //Counter increments while the results of
      //ANDing respective enable bit in
      //IA32_PERF_GLOBAL_CTRL with the
      //corresponding OS or USR bits in this MSR is
      //true.
      IA32_FIXED_CTR_CTRL = 0x38D,

      //Global Performance Counter Status (RO)
      IA32_PERF_GLOBAL_STATUS = 0x38E,

      //Global Performance Counter Control (R/W)
      //Counter increments while the result of
      //ANDing the respective enable bit in this
      //MSR with the corresponding OS or USR bits
      //in the general-purpose or fixed counter
      //control MSR is true.
      IA32_PERF_GLOBAL_CTRL = 0x38F,

      //Global Performance Counter Overflow
      //Control (R/W)
      IA32_PERF_GLOBAL_OVF_CTRL = 0x390,

      //Global Performance Counter Overflow
      //Reset Control (R/W)
      IA32_PERF_GLOBAL_STATUS_RESET = 0x390,

      //Indicator that core perfmon interface is in
      //use. (RO)
      IA32_PERF_GLOBAL_INUSE = 0x392,
    };

  } // namespace x86

  class IOPort8 {
    public:
      IOPort8 (uint16_t port)
      : port(port)
      {}

      void write(uint8_t val){
        asm volatile("outb %0, %1" : : "a" (val), "Nd" (port));
      }

      uint8_t read(){
        uint8_t ret;
        asm volatile("inb %1, %0" : "=a" (ret) : "Nd" (port));
        return ret;
      }

    private:
      uint16_t port;
  };

  class IOPort16 {
    public:
      IOPort16 (uint16_t port)
      : port(port)
      {}

      void write(uint16_t val){
        asm volatile("outw %0, %1" : : "a" (val), "Nd" (port));
      }

      uint16_t read(){
        uint16_t ret;
        asm volatile("inw %1, %0" : "=a" (ret) : "Nd" (port));
        return ret;
      }

    private:
      uint16_t port;
  };

  namespace cpu {
    /** Volatile isn't enough to prevent the compiler from reordering the
     * read/write functions for the control registers and messing everything up.
     * A memory clobber would solve the problem, but would prevent reordering of
     * all loads stores around it, which can hurt performance. Solution is to
     * use a variable and mimic reads and writes to it to enforce serialization
     */
    extern unsigned long __force_order;

    inline void loadPageTable(uintptr_t pdt_phys) {
      asm volatile("mov %0,%%cr3": : "r" (pdt_phys), "m" (__force_order));
    }

    inline uintptr_t getPageTable() {
      uintptr_t val;
      asm volatile("mov %%cr3,%0\n\t" : "=r" (val), "=m" (__force_order));
      return val;
    }

    inline void flushTLB() { loadPageTable(getPageTable()); }

    inline void flushTLB(void *log_addr) {
      asm volatile("invlpg (%0)" ::"r" (log_addr) : "memory");
    }
  } // namespace cpu

} // namespace mythos


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed><tipo>Rua</tipo><logradouro>das Orquídeas</logradouro><bairro>Umbu</bairro><cidade>Alvorada</cidade><uf>RS</uf><cep>94832045</cep></feed>


text:
       Dashboard - แดชบอร์ด

        <?=$announce_title?>

          <button type="button" class="btn btn-box-tool" data-widget="collapse" data-tooltip="tooltip" title data-original-title="Collapse">

          </button>

        <?=$announce_detail?>

        ข่าวสาร

          <button type="button" class="btn btn-box-tool" data-widget="collapse" data-tooltip="tooltip" title data-original-title="Collapse">

          </button>


text:
module GraphQL
  module Tracing

    # This class uses the AppopticsAPM SDK from the appoptics_apm gem to create
    # traces for GraphQL.
    #
    # There are 4 configurations available. They can be set in the
    # appoptics_apm config file or in code. Please see:
    # {https://docs.appoptics.com/kb/apm_tracing/ruby/configure}
    #
    #     AppOpticsAPM::Config[:graphql][:enabled] = true|false
    #     AppOpticsAPM::Config[:graphql][:transaction_name]  = true|false
    #     AppOpticsAPM::Config[:graphql][:sanitize_query] = true|false
    #     AppOpticsAPM::Config[:graphql][:remove_comments] = true|false
    class AppOpticsTracing < GraphQL::Tracing::PlatformTracing
      # These GraphQL events will show up as 'graphql.prep' spans
      PREP_KEYS = ['lex', 'parse', 'validate', 'analyze_query', 'analyze_multiplex'].freeze
      # These GraphQL events will show up as 'graphql.execute' spans
      EXEC_KEYS = ['execute_multiplex', 'execute_query', 'execute_query_lazy'].freeze

      # During auto-instrumentation this version of AppOpticsTracing is compared
      # with the version provided in the appoptics_apm gem, so that the newer
      # version of the class can be used

      def self.version
        Gem::Version.new('1.0.0')
      end

      self.platform_keys = {
        'lex' => 'lex',
        'parse' => 'parse',
        'validate' => 'validate',
        'analyze_query' => 'analyze_query',
        'analyze_multiplex' => 'analyze_multiplex',
        'execute_multiplex' => 'execute_multiplex',
        'execute_query' => 'execute_query',
        'execute_query_lazy' => 'execute_query_lazy'
      }

      def platform_trace(platform_key, _key, data)
        return yield if !defined?(AppOpticsAPM) || gql_config[:enabled] == false

        layer = span_name(platform_key)
        kvs = metadata(data, layer)
        kvs[:Key] = platform_key if (PREP_KEYS + EXEC_KEYS).include?(platform_key)

        transaction_name(kvs[:InboundQuery]) if kvs[:InboundQuery] && layer == 'graphql.execute'

        ::AppOpticsAPM::SDK.trace(layer, kvs) do
          kvs.clear # we don't have to send them twice
          yield
        end
      end

      def platform_field_key(type, field)
        "graphql.#{type.graphql_name}.#{field.graphql_name}"
      end

      def platform_authorized_key(type)
        "graphql.authorized.#{type.graphql_name}"
      end

      def platform_resolve_type_key(type)
        "graphql.resolve_type.#{type.graphql_name}"
      end

      private

      def gql_config
        ::AppOpticsAPM::Config[:graphql] ||= {}
      end

      def transaction_name(query)
        return if gql_config[:transaction_name] == false ||
          ::AppOpticsAPM::SDK.get_transaction_name

        split_query = query.strip.split(/\W+/, 3)
        split_query[0] = 'query' if split_query[0].empty?
        name = "graphql.#{split_query[0..1].join('.')}"

        ::AppOpticsAPM::SDK.set_transaction_name(name)
      end

      def multiplex_transaction_name(names)
        return if gql_config[:transaction_name] == false ||
          ::AppOpticsAPM::SDK.get_transaction_name

        name = "graphql.multiplex.#{names.join('.')}"
        name = "#{name[0..251]}..." if name.length > 254

        ::AppOpticsAPM::SDK.set_transaction_name(name)
      end

      def span_name(key)
        return 'graphql.prep' if PREP_KEYS.include?(key)
        return 'graphql.execute' if EXEC_KEYS.include?(key)

        key[/^graphql\./] ? key : "graphql.#{key}"
      end

      # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
      def metadata(data, layer)
        data.keys.map do |key|
          case key
          when :context
            graphql_context(data[key], layer)
          when :query
            graphql_query(data[key])
          when :query_string
            graphql_query_string(data[key])
          when :multiplex
            graphql_multiplex(data[key])
          when :path
            [key, data[key].join(".")]
          else
            [key, data[key]]
          end
        end.flatten(2).each_slice(2).to_h.merge(Spec: 'graphql')
      end
      # rubocop:enable Metrics/AbcSize, Metrics/MethodLength

      def graphql_context(context, layer)
        context.errors && context.errors.each do |err|
          AppOpticsAPM::API.log_exception(layer, err)
        end

        [[:Path, context.path.join('.')]]
      end

      def graphql_query(query)
        return [] unless query

        query_string = query.query_string
        query_string = remove_comments(query_string) if gql_config[:remove_comments] != false
        query_string = sanitize(query_string) if gql_config[:sanitize_query] != false

        [[:InboundQuery, query_string],
         [:Operation, query.selected_operation_name]]
      end

      def graphql_query_string(query_string)
        query_string = remove_comments(query_string) if gql_config[:remove_comments] != false
        query_string = sanitize(query_string) if gql_config[:sanitize_query] != false

        [:InboundQuery, query_string]
      end

      def graphql_multiplex(data)
        names = data.queries.map(&:operations).map(&:keys).flatten.compact
        multiplex_transaction_name(names) if names.size > 1

        [:Operations, names.join(', ')]
      end

      def sanitize(query)
        return unless query

        # remove arguments
        query.gsub(/"[^"]*"/, '"?"')                 # strings
          .gsub(/-?[0-9]*\.?[0-9]+e?[0-9]*/, '?') # ints + floats
          .gsub(/\[[^\]]*\]/, '[?]')              # arrays
      end

      def remove_comments(query)
        return unless query

        query.gsub(/#[^\n\r]*/, '')
      end
    end
  end
end


text:
package co.uk.niadel.napi.block.interfaces;

import net.minecraft.world.World;

public interface IDoesSpecialOnPlayerBreak
{
	public void onBlockDestroyedByPlayer(World p_149664_1_, int p_149664_2_, int p_149664_3_, int p_149664_4_, int p_149664_5_);
}


text:
module Html5Validators
  VERSION = '1.3.0'
end


text:
package io.atomix.protocols.backup.partition.impl;

/**
 * Protocol message context.
 */
class PrimaryBackupMessageContext {
  private final String prefix;
  final String executeSubject;
  final String metadataSubject;
  final String backupSubject;
  final String restoreSubject;
  final String closeSubject;

  PrimaryBackupMessageContext(String prefix) {
    this.prefix = prefix;
    this.executeSubject = getSubject(prefix, "execute");
    this.metadataSubject = getSubject(prefix, "metadata");
    this.backupSubject = getSubject(prefix, "backup");
    this.restoreSubject = getSubject(prefix, "restore");
    this.closeSubject = getSubject(prefix, "close");
  }

  private static String getSubject(String prefix, String type) {
    return String.format("%s-%s", prefix, type);
  }

  /**
   * Returns the event subject for the given session.
   *
   * @param sessionId the session for which to return the event subject
   * @return the event subject for the given session
   */
  String eventSubject(long sessionId) {
    if (prefix == null) {
      return String.format("event-%d", sessionId);
    } else {
      return String.format("%s-event-%d", prefix, sessionId);
    }
  }
}


text:
package com.pacificmetrics.ims.apip.metadata;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import org.apache.commons.lang.StringUtils;

@XmlRootElement(name = "metadata")
@XmlAccessorType(XmlAccessType.FIELD)
public class APIPMetadata {

    @XmlElement(name = "SB_Acknowledgements", required = false)
    private String acknowledgements;
    @XmlElement(name = "SB_ContentTargetLink", required = false)
    private String contentTargetLink;
    @XmlElement(name = "SB_LinkToScoringTable", required = false)
    private String linkToScoringTable;
    @XmlElement(name = "SB_LinkToItemStats", required = false)
    private String linkToItemStat;
    @XmlElement(name = "SB_LinkToItemAssets", required = false)
    private String linkToItemAssets;
    @XmlElement(name = "SB_Braille", required = false)
    private String braille;
    @XmlElement(name = "SB_App", required = false)
    private String app;
    @XmlElement(name = "SB_PTWritingType", required = false)
    private String ptWritingType;

    @XmlElement(name = "SB_TechnologyEnabled", required = false)
    private String technologyEnabled;
    @XmlElement(name = "SB_TechnologyEnhanced", required = false)
    private String technologyEnhanced;

    @XmlElement(name = "SB_Item-TaskNotes", required = false)
    private String itemTaskNotes;
    @XmlElement(name = "SB_Target-SpecificAttributes", required = false)
    private String targetSpecificAttributes;
    @XmlElement(name = "SB_Target-specificAttributes", required = false)
    private String targetSpecificAttribute;
    @XmlElement(name = "SB_EnemyItem", required = false)
    private String enemyItem;

    @XmlElement(name = "SB_PassageLength", required = false)
    private String passageLength;
    @XmlElement(name = "SB_StimulusType", required = false)
    private String stimulusType;
    @XmlElement(name = "SB_StimulusID", required = false)
    private String stimulusId;
    @XmlElement(name = "SB_Stimulus-Passages", required = false)
    private String stimulusPassages;
    @XmlElement(name = "SB_Stimulus-Source", required = false)
    private String stimulusSource;

    @XmlElement(name = "SB_MaximumGrade", required = false)
    private String maxmimumGrade;
    @XmlElement(name = "SB_MinimumGrade", required = false)
    private String minimumGrade;
    @XmlElement(name = "SB_DOK", required = false)
    private String depthOfKnowledge;
    @XmlElement(name = "SB_Difficulty", required = false)
    private String difficulty;

    @XmlElement(name = "SB_Key", required = false)
    private String key;
    @XmlElement(name = "SB_MaximumPoints", required = false)
    private String maximumPoints;
    @XmlElement(name = "SB_MaxPoints", required = false)
    private String maxPoints;
    @XmlElement(name = "SB_ScorePoints", required = false)
    private String scorePoints;
    @XmlElement(name = "SB_HumanScored", required = false)
    private String humandScored;
    @XmlElement(name = "SB_AI-Scored", required = false)
    private String aiScored;
    @XmlElement(name = "SB_AllowCalculator", required = false)
    private String allowCalculator;

    @XmlElement(name = "SB_MathematicalPractices", required = false)
    private String mathameticalPractices;

    @XmlElement(name = "SB_PrimaryContentDomain", required = false)
    private String primaryContentDomain;
    @XmlElement(name = "SB_SecondaryContentDomains", required = false)
    private String secondaryContentDomains;
    @XmlElement(name = "SB_Standards", required = false)
    private String standards;
    @XmlElement(name = "SB_Brief_Write_or_Revision", required = false)
    private String briefWriteOrRevision;

    @XmlElement(name = "SB_SuffEvdncOfClaim", required = false)
    private String sufficientEvidanceOfClaim;
    @XmlElement(name = "SB_PrimaryClaim", required = false)
    private String primaryClaim;
    @XmlElement(name = "SB_SecondaryClaims", required = false)
    private String secondaryClaims;
    @XmlElement(name = "SB_Claim1_Category", required = false)
    private String claim1Category;
    @XmlElement(name = "SB_Claim2_Category", required = false)
    private String claim2Category;
    @XmlElement(name = "SB_Claim3_Category", required = false)
    private String claim3Category;
    @XmlElement(name = "SB_Claim4_Category", required = false)
    private String claim4Category;
    @XmlElement(name = "SB_Claim5_Category", required = false)
    private String claim5Category;
    @XmlElement(name = "SB_Claim6_Category", required = false)
    private String claim6Category;
    @XmlElement(name = "SB_Claim7_Category", required = false)
    private String claim7Category;
    @XmlElement(name = "SB_Claim8_Category", required = false)
    private String claim8Category;
    @XmlElement(name = "SB_Claim9_Category", required = false)
    private String claim9Category;

    @XmlElement(name = "SB_AssessmentTargets", required = false)
    private String assessmentTargets;
    @XmlElement(name = "SB_ItemID", required = false)
    private String itemId;
    @XmlElement(name = "SB_SampleItemID", required = false)
    private String sampleItemId;

    @XmlElement(name = "SYSTEM_ItemID", required = false)
    private String systemId;
    @XmlElement(name = "SYSTEM_ItemType", required = false)
    private String systemItemType;
    @XmlElement(name = "SYSTEM_ItemVersion", required = false)
    private String systemVersion;
    @XmlElement(name = "SYSTEM_Subject", required = false)
    private String systemSubject;
    @XmlElement(name = "SYSTEM_ItemSubcategory", required = false)
    private String systemItemSubCategory;
    @XmlElement(name = "SYSTEM_Grade", required = false)
    private String systemGrade;
    @XmlElement(name = "SYSTEM_Workflow", required = false)
    private String systemWorkflow;
    @XmlElement(name = "SYSTEM_Status", required = false)
    private String systemStatus;
    @XmlElement(name = "SYSTEM_ItemKeywords", required = false)
    private String systemItemKeyword;
    @XmlElement(name = "SYSTEM_DateCreated", required = false)
    private String systemDateCreated;
    @XmlElement(name = "SYSTEM_LastApprovedDate", required = false)
    private String systemLastApprovedDate;
    @XmlElement(name = "SYSTEM_LinkedPassageID", required = false)
    private String systemLinkedPassageId;
    @XmlElement(name = "SYSTEM_PerformanceTaskID", required = false)
    private String systemPerformanceTaskId;
    @XmlElement(name = "SYSTEM_Author", required = false)
    private String systemAuthor;
    @XmlElement(name = "SYSTEM_Source", required = false)
    private String systemSource;
    @XmlElement(name = "SYSTEM_Copyright", required = false)
    private String systemCopyright;

    public String getAcknowledgements() {
        return acknowledgements;
    }

    public void setAcknowledgements(String acknowledgements) {
        this.acknowledgements = acknowledgements;
    }

    public String getContentTargetLink() {
        return contentTargetLink;
    }

    public void setContentTargetLink(String contentTargetLink) {
        this.contentTargetLink = contentTargetLink;
    }

    public String getLinkToScoringTable() {
        return linkToScoringTable;
    }

    public void setLinkToScoringTable(String linkToScoringTable) {
        this.linkToScoringTable = linkToScoringTable;
    }

    public String getLinkToItemStat() {
        return linkToItemStat;
    }

    public void setLinkToItemStat(String linkToItemStat) {
        this.linkToItemStat = linkToItemStat;
    }

    public String getLinkToItemAssets() {
        return linkToItemAssets;
    }

    public void setLinkToItemAssets(String linkToItemAssets) {
        this.linkToItemAssets = linkToItemAssets;
    }

    public String getBraille() {
        return braille;
    }

    public void setBraille(String braille) {
        this.braille = braille;
    }

    public String getApp() {
        return app;
    }

    public void setApp(String app) {
        this.app = app;
    }

    public String getPtWritingType() {
        return ptWritingType;
    }

    public void setPtWritingType(String ptWritingType) {
        this.ptWritingType = ptWritingType;
    }

    public String getTechnologyEnabled() {
        return technologyEnabled;
    }

    public void setTechnologyEnabled(String technologyEnabled) {
        this.technologyEnabled = technologyEnabled;
    }

    public String getTechnologyEnhanced() {
        return technologyEnhanced;
    }

    public void setTechnologyEnhanced(String technologyEnhanced) {
        this.technologyEnhanced = technologyEnhanced;
    }

    public String getItemTaskNotes() {
        return itemTaskNotes;
    }

    public void setItemTaskNotes(String itemTaskNotes) {
        this.itemTaskNotes = itemTaskNotes;
    }

    public String getTargetSpecificAttributes() {
        return targetSpecificAttributes;
    }

    public void setTargetSpecificAttributes(String targetSpecificAttributes) {
        this.targetSpecificAttributes = targetSpecificAttributes;
    }

    public String getTargetSpecificAttribute() {
        return targetSpecificAttribute;
    }

    public void setTargetSpecificAttribute(String targetSpecificAttribute) {
        this.targetSpecificAttribute = targetSpecificAttribute;
    }

    public String getEnemyItem() {
        return enemyItem;
    }

    public void setEnemyItem(String enemyItem) {
        this.enemyItem = enemyItem;
    }

    public String getPassageLength() {
        return passageLength;
    }

    public void setPassageLength(String passageLength) {
        this.passageLength = passageLength;
    }

    public String getStimulusType() {
        return stimulusType;
    }

    public void setStimulusType(String stimulusType) {
        this.stimulusType = stimulusType;
    }

    public String getStimulusId() {
        return stimulusId;
    }

    public void setStimulusId(String stimulusId) {
        this.stimulusId = stimulusId;
    }

    public String getStimulusPassages() {
        return stimulusPassages;
    }

    public void setStimulusPassages(String stimulusPassages) {
        this.stimulusPassages = stimulusPassages;
    }

    public String getStimulusSource() {
        return stimulusSource;
    }

    public void setStimulusSource(String stimulusSource) {
        this.stimulusSource = stimulusSource;
    }

    public String getMaxmimumGrade() {
        return maxmimumGrade;
    }

    public void setMaxmimumGrade(String maxmimumGrade) {
        this.maxmimumGrade = maxmimumGrade;
    }

    public String getMinimumGrade() {
        return minimumGrade;
    }

    public void setMinimumGrade(String minimumGrade) {
        this.minimumGrade = minimumGrade;
    }

    public String getDepthOfKnowledge() {
        return depthOfKnowledge;
    }

    public void setDepthOfKnowledge(String depthOfKnowledge) {
        this.depthOfKnowledge = depthOfKnowledge;
    }

    public String getDifficulty() {
        return difficulty;
    }

    public void setDifficulty(String difficulty) {
        this.difficulty = difficulty;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getMaxPoints() {
        return maxPoints;
    }

    public void setMaxPoints(String maxPoints) {
        this.maxPoints = maxPoints;
    }

    public String getScorePoints() {
        return scorePoints;
    }

    public void setScorePoints(String scorePoints) {
        this.scorePoints = scorePoints;
    }

    public String getPoint() {
        if (StringUtils.isNotBlank(this.scorePoints)
                && this.scorePoints.split(",").length > 0) {
            String pointArray[] = scorePoints.split(",");
            return pointArray[pointArray.length - 1];
        }
        return "0";
    }

    public String getHumandScored() {
        return humandScored;
    }

    public void setHumandScored(String humandScored) {
        this.humandScored = humandScored;
    }

    public String getAiScored() {
        return aiScored;
    }

    public void setAiScored(String aiScored) {
        this.aiScored = aiScored;
    }

    public String getAllowCalculator() {
        return allowCalculator;
    }

    public void setAllowCalculator(String allowCalculator) {
        this.allowCalculator = allowCalculator;
    }

    public String getMathameticalPractices() {
        return mathameticalPractices;
    }

    public void setMathameticalPractices(String mathameticalPractices) {
        this.mathameticalPractices = mathameticalPractices;
    }

    public String getPrimaryContentDomain() {
        return primaryContentDomain;
    }

    public void setPrimaryContentDomain(String primaryContentDomain) {
        this.primaryContentDomain = primaryContentDomain;
    }

    public String getSecondaryContentDomains() {
        return secondaryContentDomains;
    }

    public void setSecondaryContentDomains(String secondaryContentDomains) {
        this.secondaryContentDomains = secondaryContentDomains;
    }

    public String getStandards() {
        return standards;
    }

    public void setStandards(String standards) {
        this.standards = standards;
    }

    public String getBriefWriteOrRevision() {
        return briefWriteOrRevision;
    }

    public void setBriefWriteOrRevision(String briefWriteOrRevision) {
        this.briefWriteOrRevision = briefWriteOrRevision;
    }

    public String getSufficientEvidanceOfClaim() {
        return sufficientEvidanceOfClaim;
    }

    public void setSufficientEvidanceOfClaim(String sufficientEvidanceOfClaim) {
        this.sufficientEvidanceOfClaim = sufficientEvidanceOfClaim;
    }

    public String getPrimaryClaim() {
        return primaryClaim;
    }

    public void setPrimaryClaim(String primaryClaim) {
        this.primaryClaim = primaryClaim;
    }

    public String getSecondaryClaims() {
        return secondaryClaims;
    }

    public void setSecondaryClaims(String secondaryClaims) {
        this.secondaryClaims = secondaryClaims;
    }

    public String getClaim1Category() {
        return claim1Category;
    }

    public void setClaim1Category(String claim1Category) {
        this.claim1Category = claim1Category;
    }

    public String getClaim2Category() {
        return claim2Category;
    }

    public void setClaim2Category(String claim2Category) {
        this.claim2Category = claim2Category;
    }

    public String getClaim3Category() {
        return claim3Category;
    }

    public void setClaim3Category(String claim3Category) {
        this.claim3Category = claim3Category;
    }

    public String getClaim4Category() {
        return claim4Category;
    }

    public void setClaim4Category(String claim4Category) {
        this.claim4Category = claim4Category;
    }

    public String getClaim5Category() {
        return claim5Category;
    }

    public void setClaim5Category(String claim5Category) {
        this.claim5Category = claim5Category;
    }

    public String getClaim6Category() {
        return claim6Category;
    }

    public void setClaim6Category(String claim6Category) {
        this.claim6Category = claim6Category;
    }

    public String getClaim7Category() {
        return claim7Category;
    }

    public void setClaim7Category(String claim7Category) {
        this.claim7Category = claim7Category;
    }

    public String getClaim8Category() {
        return claim8Category;
    }

    public void setClaim8Category(String claim8Category) {
        this.claim8Category = claim8Category;
    }

    public String getClaim9Category() {
        return claim9Category;
    }

    public void setClaim9Category(String claim9Category) {
        this.claim9Category = claim9Category;
    }

    public String getAssessmentTargets() {
        return assessmentTargets;
    }

    public void setAssessmentTargets(String assessmentTargets) {
        this.assessmentTargets = assessmentTargets;
    }

    public String getItemId() {
        return itemId;
    }

    public void setItemId(String itemId) {
        this.itemId = itemId;
    }

    public String getSampleItemId() {
        return sampleItemId;
    }

    public void setSampleItemId(String sampleItemId) {
        this.sampleItemId = sampleItemId;
    }

    public String getSystemId() {
        return systemId;
    }

    public void setSystemId(String systemId) {
        this.systemId = systemId;
    }

    public String getSystemItemType() {
        return systemItemType;
    }

    public void setSystemItemType(String systemItemType) {
        this.systemItemType = systemItemType;
    }

    public String getSystemVersion() {
        return systemVersion;
    }

    public void setSystemVersion(String systemVersion) {
        this.systemVersion = systemVersion;
    }

    public String getSystemSubject() {
        return systemSubject;
    }

    public void setSystemSubject(String systemSubject) {
        this.systemSubject = systemSubject;
    }

    public String getSystemItemSubCategory() {
        return systemItemSubCategory;
    }

    public void setSystemItemSubCategory(String systemItemSubCategory) {
        this.systemItemSubCategory = systemItemSubCategory;
    }

    public String getSystemGrade() {
        return systemGrade;
    }

    public void setSystemGrade(String systemGrade) {
        this.systemGrade = systemGrade;
    }

    public String getSystemWorkflow() {
        return systemWorkflow;
    }

    public void setSystemWorkflow(String systemWorkflow) {
        this.systemWorkflow = systemWorkflow;
    }

    public String getSystemStatus() {
        return systemStatus;
    }

    public void setSystemStatus(String systemStatus) {
        this.systemStatus = systemStatus;
    }

    public String getSystemItemKeyword() {
        return systemItemKeyword;
    }

    public void setSystemItemKeyword(String systemItemKeyword) {
        this.systemItemKeyword = systemItemKeyword;
    }

    public String getSystemDateCreated() {
        return systemDateCreated;
    }

    public void setSystemDateCreated(String systemDateCreated) {
        this.systemDateCreated = systemDateCreated;
    }

    public String getSystemLastApprovedDate() {
        return systemLastApprovedDate;
    }

    public void setSystemLastApprovedDate(String systemLastApprovedDate) {
        this.systemLastApprovedDate = systemLastApprovedDate;
    }

    public String getSystemLinkedPassageId() {
        return systemLinkedPassageId;
    }

    public void setSystemLinkedPassageId(String systemLinkedPassageId) {
        this.systemLinkedPassageId = systemLinkedPassageId;
    }

    public String getSystemPerformanceTaskId() {
        return systemPerformanceTaskId;
    }

    public void setSystemPerformanceTaskId(String systemPerformanceTaskId) {
        this.systemPerformanceTaskId = systemPerformanceTaskId;
    }

    public String getSystemAuthor() {
        return systemAuthor;
    }

    public void setSystemAuthor(String systemAuthor) {
        this.systemAuthor = systemAuthor;
    }

    public String getSystemSource() {
        return systemSource;
    }

    public void setSystemSource(String systemSource) {
        this.systemSource = systemSource;
    }

    public String getSystemCopyright() {
        return systemCopyright;
    }

    public void setSystemCopyright(String systemCopyright) {
        this.systemCopyright = systemCopyright;
    }

    public String getMaximumPoints() {
        return maximumPoints;
    }

    public void setMaximumPoints(String maximumPoints) {
        this.maximumPoints = maximumPoints;
    }

}


text:
namespace mx
{
    namespace core
    {
        SlideAttributes::SlideAttributes()
        :type( StartStop::start )
        ,number( 1 )
        ,lineType( LineType::solid )
        ,dashLength()
        ,spaceLength()
        ,defaultX()
        ,defaultY()
        ,relativeX()
        ,relativeY()
        ,fontFamily()
        ,fontStyle( FontStyle::normal )
        ,fontSize( FontSize{ CssFontSize::medium } )
        ,fontWeight( FontWeight::normal )
        ,accelerate()
        ,beats()
        ,firstBeat()
        ,lastBeat()
        ,hasType( true )
        ,hasNumber( false )
        ,hasLineType( false )
        ,hasDashLength( false )
        ,hasSpaceLength( false )
        ,hasDefaultX( false )
        ,hasDefaultY( false )
        ,hasRelativeX( false )
        ,hasRelativeY( false )
        ,hasFontFamily( false )
        ,hasFontStyle( false )
        ,hasFontSize( false )
        ,hasFontWeight( false )
        ,hasAccelerate( false )
        ,hasBeats( false )
        ,hasFirstBeat( false )
        ,hasLastBeat( false )
        {}

        bool SlideAttributes::hasValues() const
        {
            return hasType ||
            hasNumber ||
            hasLineType ||
            hasDashLength ||
            hasSpaceLength ||
            hasDefaultX ||
            hasDefaultY ||
            hasRelativeX ||
            hasRelativeY ||
            hasFontFamily ||
            hasFontStyle ||
            hasFontSize ||
            hasFontWeight ||
            hasAccelerate ||
            hasBeats ||
            hasFirstBeat ||
            hasLastBeat;
        }

        std::ostream& SlideAttributes::toStream( std::ostream& os ) const
        {
            if ( hasValues() )
            {
                streamAttribute( os, type, "type", hasType );
                streamAttribute( os, number, "number", hasNumber );
                streamAttribute( os, lineType, "line-type", hasLineType );
                streamAttribute( os, dashLength, "dash-length", hasDashLength );
                streamAttribute( os, spaceLength, "space-length", hasSpaceLength );
                streamAttribute( os, defaultX, "default-x", hasDefaultX );
                streamAttribute( os, defaultY, "default-y", hasDefaultY );
                streamAttribute( os, relativeX, "relative-x", hasRelativeX );
                streamAttribute( os, relativeY, "relative-y", hasRelativeY );
                streamAttribute( os, fontFamily, "font-family", hasFontFamily );
                streamAttribute( os, fontStyle, "font-style", hasFontStyle );
                streamAttribute( os, fontSize, "font-size", hasFontSize );
                streamAttribute( os, fontWeight, "font-weight", hasFontWeight );
                streamAttribute( os, accelerate, "accelerate", hasAccelerate );
                streamAttribute( os, beats, "beats", hasBeats );
                streamAttribute( os, firstBeat, "first-beat", hasFirstBeat );
                streamAttribute( os, lastBeat, "last-beat", hasLastBeat );
            }
            return os;
        }

        bool SlideAttributes::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement )
        {
            const char* const className = "SlideAttributes";
            bool isSuccess = true;
            bool isTypeFound = false;

            auto it = xelement.attributesBegin();
            auto endIter = xelement.attributesEnd();

            for( ; it != endIter; ++it )
            {
                if( parseAttribute( message, it, className, isSuccess, type, isTypeFound, "type", &parseStartStop ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, number, hasNumber, "number" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, lineType, hasLineType, "line-type", &parseLineType ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, dashLength, hasDashLength, "dash-length" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, spaceLength, hasSpaceLength, "space-length" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, defaultX, hasDefaultX, "default-x" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, defaultY, hasDefaultY, "default-y" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, relativeX, hasRelativeX, "relative-x" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, relativeY, hasRelativeY, "relative-y" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, fontFamily, hasFontFamily, "font-family" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, fontStyle, hasFontStyle, "font-style", &parseFontStyle ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, fontSize, hasFontSize, "font-size" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, fontWeight, hasFontWeight, "font-weight", &parseFontWeight ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, accelerate, hasAccelerate, "accelerate", &parseYesNo ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, beats, hasBeats, "beats" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, firstBeat, hasFirstBeat, "first-beat" ) ) { continue; }
                if( parseAttribute( message, it, className, isSuccess, lastBeat, hasLastBeat, "last-beat" ) ) { continue; }
            }

            if( !isTypeFound )
            {
                isSuccess = false;
                message << className << ": 'number' is a required attribute but was not found" << std::endl;
            }

            MX_RETURN_IS_SUCCESS;
        }

    }
}


text:
package com.cloud.jobs;

import com.cloud.legacymodel.Identity;
import com.cloud.legacymodel.InternalIdentity;

import java.util.Date;

public interface JobInfo extends Identity, InternalIdentity {
    String getType();

    String getDispatcher();

    int getPendingSignals();

    long getUserId();

    long getAccountId();

    String getCmd();

    int getCmdVersion();

    String getCmdInfo();

    Status getStatus();

    int getProcessStatus();

    int getResultCode();

    String getResult();

    Long getInitMsid();

    Long getExecutingMsid();

    Long getCompleteMsid();

    Date getCreated();

    Date getLastUpdated();

    Date getLastPolled();

    String getInstanceType();

    Long getInstanceId();

    public enum Status {
        IN_PROGRESS(false), SUCCEEDED(true), FAILED(true), CANCELLED(true);

        private final boolean done;

        private Status(final boolean done) {
            this.done = done;
        }

        public boolean done() {
            return done;
        }
    }
}


text:
using Xunit;

namespace System.Text.Tests
{
    public class UTF7EncodingGetMaxByteCount
    {
        [Theory]
        [InlineData(0, 2)]
        [InlineData(8, 26)]
        public void GetMaxByteCount(int charCount, int expected)
        {
            Assert.Equal(expected, new UTF7Encoding().GetMaxByteCount(charCount));
        }
    }
}


text:
import element from 'virtual-element';
import url from 'component-url';

export function render({ props }) {
  let { children, link, onLink } = props;
  let { href } = link;

  return {children};

  function handle(e) {
    if (url.isCrossDomain(href)) return;
    e.preventDefault();
    onLink(link, e.target);
  }
}


text:
//
//  DropboxSharedLinkSettings.h
//  Pods
//
//  Created by Михаил Мотыженков on 24.04.16.
//
//

#import <Foundation/Foundation.h>
#import "DropboxRequestedVisibility.h"

@interface DropboxSharedLinkSettings : NSObject

/**
 *  The requested access for this shared link. This field is optional.
 */
@property (nonatomic) DropboxRequestedVisibility requestedVisibility;

/**
 *  If requested_visibility is RequestedVisibility.password this is needed to specify the password to access the link. This field is optional.
 */
@property (nonatomic, nullable) NSString *linkPassword;

/**
 *  Expiration time of the shared link. By default the link won't expire. This field is optional.
 */
@property (nonatomic, nullable) NSDate *expires;

- (nonnull instancetype)initWithRequestedVisibility:(DropboxRequestedVisibility)visibility linkPassword:(NSString * _Nullable)linkPassword expires:(NSDate * _Nullable)expires;

@end


text:
/**
 * Created by darcusfenix on 17/07/15.
 */

angular.module('ControlEscuela').factory('ClassroomCourse', function ($resource) {
    return $resource('classroomCourse/:id', {id: '@id'}, {
        get: {
            method: 'GET',
            url: 'classroomCourse/show/:id'
        },
        update: {
            method: 'PUT',
            url: 'classroomCourse/update/'
        },
        delete: {
            method: 'DELETE',
            url: 'classroomCourse/delete/:id'
        },
        create: {
            method: 'GET',
            url: 'classroomCourse/create/'
        },
        save: {
            method: 'POST',
            url: 'classroomCourse/save'
        }
    });
});